Socket
Socket
Sign inDemoInstall

vue-router

Package Overview
Dependencies
1
Maintainers
2
Versions
180
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.1.0-4da5e55 to 4.1.0-51021cc

7

CHANGELOG.md

@@ -0,1 +1,8 @@

## [4.0.16](https://github.com/vuejs/router/compare/v4.0.15...v4.0.16) (2022-06-09)
### Bug Fixes
- **compat:** force router-link mode to Vue 3 ([#1426](https://github.com/vuejs/router/issues/1426)) ([0478512](https://github.com/vuejs/router/commit/047851299c4c438cc977f6d5d7da455eb69195db))
- **matcher:** leave catchall routes at the end ([77f0998](https://github.com/vuejs/router/commit/77f099835a237e5b996ff4af19d1488b49990c38)), closes [#1435](https://github.com/vuejs/router/issues/1435)
## [4.0.15](https://github.com/vuejs/router/compare/v4.0.14...v4.0.15) (2022-05-04)

@@ -2,0 +9,0 @@

333

dist/vue-router.d.ts

@@ -14,2 +14,7 @@ import { AllowedComponentProps } from 'vue';

/**
* @internal
*/
declare type _AlphaNumeric = 'a' | 'A' | 'b' | 'B' | 'c' | 'C' | 'd' | 'D' | 'e' | 'E' | 'f' | 'F' | 'g' | 'G' | 'h' | 'H' | 'i' | 'I' | 'j' | 'J' | 'k' | 'K' | 'l' | 'L' | 'm' | 'M' | 'n' | 'N' | 'o' | 'O' | 'p' | 'P' | 'q' | 'Q' | 'r' | 'R' | 's' | 'S' | 't' | 'T' | 'u' | 'U' | 'v' | 'V' | 'w' | 'W' | 'x' | 'X' | 'y' | 'Y' | '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '_';
declare type Awaitable<T> = T | Promise<T>;

@@ -67,11 +72,9 @@

/**
* Creates a hash history. Useful for web applications with no host (e.g.
* `file://`) or when configuring a server to handle any URL is not possible.
* Creates a hash history. Useful for web applications with no host (e.g. `file://`) or when configuring a server to
* handle any URL is not possible.
*
* @param base - optional base to provide. Defaults to `location.pathname +
* location.search` If there is a `<base>` tag in the `head`, its value will be
* ignored in favor of this parameter **but note it affects all the
* history.pushState() calls**, meaning that if you use a `<base>` tag, it's
* `href` value **has to match this parameter** (ignoring anything after the
* `#`).
* @param base - optional base to provide. Defaults to `location.pathname + location.search` If there is a `<base>` tag
* in the `head`, its value will be ignored in favor of this parameter **but note it affects all the history.pushState()
* calls**, meaning that if you use a `<base>` tag, it's `href` value **has to match this parameter** (ignoring anything
* after the `#`).
*

@@ -113,5 +116,8 @@ * @example

/**
* Flags so we can combine them when checking for multiple errors
* Flags so we can combine them when checking for multiple errors. This is the internal version of
* {@link NavigationFailureType}.
*
* @internal
*/
declare const enum ErrorTypes {
export declare const enum ErrorTypes {
MATCHER_NOT_FOUND = 1,

@@ -125,15 +131,28 @@ NAVIGATION_GUARD_REDIRECT = 2,

/**
* Extract the first param name (after a `:`) and ignores the rest.
* Extracts the modifier and the rest of the path. This is meant to be used with everything after the param name, e.g.,
* given a path of `/:paths(.+)+/end`, it should be given `+/end` and will split the path into `+` and `/end`.
*
* @internal
*/
export declare type _ExtractFirstParamName<S extends string> = S extends `${infer P}${_ParamDelimiter}${string}` ? _ExtractFirstParamName<P> : S extends `${string}${_ParamDelimiter}${string}` ? never : S;
export declare type _ExtractModifier<P extends string> = P extends `${_ParamModifier}${infer Rest}` ? P extends `${infer M}${Rest}` ? M extends _ParamModifier ? _ModifierExtracTResult<M, Rest> : never : never : _ModifierExtracTResult<'', P>;
/**
* Given a simple path, creates an object of the possible param values.
* Extracts the param name from a path. Requires to strip off the starting `:`
*
* @example
* ```ts
* _ExtractParamName<'id/:b'> // 'id'
* ```
*
* @internal
*/
declare type _ExtractParamsPath<P extends string, isRaw extends boolean> = P extends `${string}{${infer PP}}${infer Rest}` ? (PP extends `${infer N}${_ParamModifier}` ? PP extends `${N}${infer M}` ? M extends _ParamModifier ? _ParamToObject<N, M, isRaw> : never : never : _ParamToObject<PP, '', isRaw>) & _ExtractParamsPath<Rest, isRaw> : {};
declare type _ExtractParamName<Tail extends string, Head extends string = ''> = Tail extends `${_AlphaNumeric}${infer Rest}` ? Tail extends `${infer C}${Rest}` ? _ExtractParamName<Rest, `${Head}${C}`> : never : _ParamExtractResult<Head, Tail>;
/**
* Given a path, extracts the possible params or \{\} when there are no params.
*
* @internal
*/
export declare type _ExtractParamsOfPath<P extends string, isRaw extends boolean> = P extends `${string}:${infer HasParam}` ? _ExtractParamName<HasParam> extends _ParamExtractResult<infer ParamName, infer Rest> ? _ExtractModifier<_StripRegex<Rest>> extends _ModifierExtracTResult<infer Modifier, infer Rest2> ? _ParamToObject<ParamName, Modifier, isRaw> & _ExtractParamsOfPath<Rest2, isRaw> : never : _ParamToObject<HasParam, '', isRaw> : {};
declare type HistoryLocation = string;

@@ -149,2 +168,7 @@

/**
* Allowed arrays for history.state.
*
* @internal
*/
declare interface HistoryStateArray extends Array<HistoryStateValue> {

@@ -154,3 +178,7 @@ }

/**
* Allowed variables in HTML5 history state
* Allowed variables in HTML5 history state. Note that pushState clones the state
* passed and does not accept everything: e.g it doesn't accept symbols, nor
* functions as values. It also ignores Symbols as keys.
*
* @internal
*/

@@ -193,6 +221,8 @@ declare type HistoryStateValue = string | number | boolean | null | undefined | HistoryState | HistoryStateArray;

*/
export declare type JoinPath<Prefix extends string, Path extends string> = Path extends `/${string}` ? Path : '' extends Prefix ? never : `${Prefix}${Prefix extends `${string}/` ? '' : '/'}${Path}`;
export declare type _JoinPath<Prefix extends string, Path extends string> = Path extends `/${string}` ? Path : '' extends Prefix ? never : `${Prefix}${Prefix extends `${string}/` ? '' : '/'}${Path}`;
declare type Lazy<T> = () => Promise<T>;
declare type LiteralUnion<LiteralType, BaseType extends string = string> = LiteralType | (BaseType & Record<never, never>);
/**

@@ -208,27 +238,8 @@ * Ensures a route is loaded so it can be passed as o prop to `<RouterView>`.

*/
declare interface LocationAsName {
name: RouteRecordName;
params?: RouteParams;
export declare interface LocationAsRelativeRaw<Name extends RouteRecordName = RouteRecordName, Info extends RouteNamedInfo = RouteNamedInfo> {
name?: Name;
params?: Info extends RouteNamedInfo<any, any, infer ParamsRaw> ? ParamsRaw : RouteParamsRaw;
}
/**
* @internal
*/
export declare interface LocationAsPath {
path: string;
}
declare interface LocationAsRelative<RouteMap extends RouteNamedMapGeneric = RouteNamedMapGeneric, Name extends keyof RouteMap = keyof RouteMap> {
params?: RouteNamedMapGeneric extends RouteMap ? RouteParams : RouteMap[Name]['params'];
}
/**
* @internal
*/
export declare interface LocationAsRelativeRaw<RouteMap extends RouteNamedMapGeneric = RouteNamedMapGeneric, Name extends keyof RouteMap = keyof RouteMap> {
name?: RouteNamedMapGeneric extends RouteMap ? RouteRecordName : Name;
params?: RouteNamedMapGeneric extends RouteMap ? RouteParamsRaw : RouteMap[Name]['paramsRaw'];
}
/**
* Normalized query object that appears in {@link RouteLocationNormalized}

@@ -280,2 +291,5 @@ *

/**
* Normalized/resolved Route location that returned by the matcher.
*/
declare interface MatcherLocation {

@@ -306,5 +320,40 @@ /**

declare type MatcherLocationRaw = LocationAsPath | LocationAsName | LocationAsRelative;
/**
* @internal
*/
declare interface MatcherLocationAsName {
name: RouteRecordName;
params?: RouteParams;
}
/**
* @internal
*/
export declare interface MatcherLocationAsPath<P extends string = string> {
path: P;
}
/**
* @internal
*/
declare interface MatcherLocationAsRelative<Info extends RouteNamedInfo = RouteNamedInfo> {
params?: Info extends RouteNamedInfo<any, infer Params, any> ? Params : RouteParams;
}
/**
* Route location that can be passed to the matcher.
*/
declare type MatcherLocationRaw = MatcherLocationAsPath | MatcherLocationAsName | MatcherLocationAsRelative;
/**
* Helper type to infer a modifier extraction result.
*
* @internal
*/
export declare interface _ModifierExtracTResult<M extends _ParamModifier | '', Rest extends string> {
modifier: M;
rest: Rest;
}
/**
* Gets the possible type of a param based on its modifier M.

@@ -403,3 +452,8 @@ *

declare interface NavigationRedirectError extends Omit<NavigationFailure, 'to' | 'type'> {
/**
* Internal error used to detect a redirection.
*
* @internal
*/
export declare interface NavigationRedirectError extends Omit<NavigationFailure, 'to' | 'type'> {
type: ErrorTypes.NAVIGATION_GUARD_REDIRECT;

@@ -440,5 +494,14 @@ to: RouteLocationRaw;

*/
declare type _ParamDelimiter = '-' | '/' | '%' | ':' | '(' | '\\' | ';' | ',' | '&' | '!' | "'" | '=' | '@' | '[' | ']' | _ParamModifier;
export declare type _ParamDelimiter = '-' | '/' | '%' | ':' | '(' | '\\' | ';' | ',' | '&' | '!' | "'" | '=' | '@' | '[' | ']' | '$' | _ParamModifier;
/**
* Helper type to infer a param name extraction result
* @internal
*/
export declare interface _ParamExtractResult<P extends string, Rest extends string> {
param: P;
rest: Rest;
}
/**
* Possible param modifiers.

@@ -448,3 +511,3 @@ *

*/
declare type _ParamModifier = '+' | '?' | '*';
export declare type _ParamModifier = '+' | '?' | '*';

@@ -459,5 +522,5 @@ /**

*/
export declare type ParamsFromPath<P extends string = string> = string extends P ? RouteParams : _ExtractParamsPath<_RemoveRegexpFromParam<P>, false>;
export declare type ParamsFromPath<P extends string = string> = P extends `${string}:${string}` ? Simplify<_ExtractParamsOfPath<P, false>> : Record<any, never>;
declare type ParamsRawFromPath<P extends string = string> = string extends P ? RouteParamsRaw : _ExtractParamsPath<_RemoveRegexpFromParam<P>, true>;
export declare type ParamsRawFromPath<P extends string = string> = P extends `${string}:${string}` ? Simplify<_ExtractParamsOfPath<P, true>> : Record<any, never>;

@@ -588,18 +651,11 @@ /**

/**
* Reformats a path string `/:id(custom-regex)/:other+` by wrapping params with
* `{}` and removing custom regexps to make them easier to parse.
* Takes the custom regex (and everything after) of a param and strips it off. Must be called with a string that starts
* with a `(` **after the parenthesis**.
*
* @internal
*/
export declare type _RemoveRegexpFromParam<S extends string> = S extends `${infer A}:${infer P}${_ParamDelimiter}${infer Rest}` ? P extends _ExtractFirstParamName<P> ? S extends `${A}:${P}${infer D}${Rest}` ? D extends _ParamModifier | '' ? `${A}{${P}${D}}${S extends `${A}:${P}${D}${infer Rest2}` ? _RemoveRegexpFromParam<Rest2> : never}` : D extends _ParamDelimiter ? '(' extends D ? `${A}{${P}${S extends `${A}:${P}(${infer Rest2}` ? _RemoveRegexpFromParam<_RemoveUntilClosingPar<Rest2>> : '}'}` : `${A}{${P}}${S extends `${A}:${P}${infer Rest2}` ? _RemoveRegexpFromParam<Rest2> : never}` : never : never : never : S extends `${infer A}:${infer P}` ? P extends _ExtractFirstParamName<P> ? `${A}{${P}}` : never : S;
/**
* Takes the custom regex (and everything after) of a param and strips it off.
*
* @example
* - `\\d+(?:inner-group\\)-end)/:rest-of-url` -> `/:rest-of-url`
* - `\\d+(?:inner-group\\)-end)/:rest-of-url` becomes `/:rest-of-url`
*
* @internal
*/
export declare type _RemoveUntilClosingPar<S extends string> = S extends `${infer A}\\)${infer Rest}` ? A extends `${string})${infer Rest2}` ? Rest2 extends `${_ParamModifier}${infer Rest3}` ? Rest2 extends `${infer M}${Rest3}` ? `${M}}${Rest3}\\)${Rest}` : never : `}${Rest2}\\)${Rest}` : _RemoveUntilClosingPar<Rest> : S extends `${string})${infer Rest}` ? Rest extends `${_ParamModifier}${infer Rest2}` ? Rest extends `${infer M}${Rest2}` ? `${M}}${Rest2}` : never : `}${Rest}` : never;
export declare type _RemoveUntilClosingPar<S extends string> = S extends `${infer A}\\)${infer Rest}` ? A extends `${string})${infer Rest2}` ? `${Rest2}\\)${Rest}` : _RemoveUntilClosingPar<Rest> : S extends `${string})${infer Rest}` ? Rest : never;

@@ -662,7 +718,10 @@ /**

/**
* Route Location that can infer the necessary params based on the name
* Route Location that can infer the necessary params based on the name.
*
* @internal
*/
declare type RouteLocationNamedRaw<RouteMap extends RouteNamedMapGeneric = RouteNamedMapGeneric, Name extends keyof RouteMap = keyof RouteMap> = RouteQueryAndHash & LocationAsRelativeRaw<RouteMap, Name> & RouteLocationOptions;
export declare type RouteLocationNamedRaw<RouteMap extends RouteNamedMapGeneric = RouteNamedMapGeneric> = RouteNamedMapGeneric extends RouteMap ? // allows assigning a RouteLocationRaw to RouteLocationNamedRaw
RouteQueryAndHash & LocationAsRelativeRaw & RouteLocationOptions : {
[K in Extract<keyof RouteMap, RouteRecordName>]: LocationAsRelativeRaw<K, RouteMap[K]>;
}[Extract<keyof RouteMap, RouteRecordName>] & RouteQueryAndHash & RouteLocationOptions;

@@ -693,2 +752,5 @@ /**

/**
* Common options for all navigation methods.
*/
export declare interface RouteLocationOptions {

@@ -700,3 +762,5 @@ /**

/**
* Triggers the navigation even if the location is the same as the current one
* Triggers the navigation even if the location is the same as the current one.
* Note this will also add a new entry to the history unless `replace: true`
* is passed.
*/

@@ -712,3 +776,11 @@ force?: boolean;

declare type RouteLocationPathRaw = RouteQueryAndHash & LocationAsPath & RouteLocationOptions;
/**
* Route Location that can infer the possible paths.
*
* @internal
*/
export declare type RouteLocationPathRaw<RouteMap extends RouteStaticPathMapGeneric = RouteStaticPathMapGeneric> = RouteStaticPathMapGeneric extends RouteMap ? // allows assigning a RouteLocationRaw to RouteLocationPath
RouteQueryAndHash & MatcherLocationAsPath & RouteLocationOptions : RouteQueryAndHash & RouteLocationOptions & MatcherLocationAsPath<LiteralUnion<{
[K in keyof RouteMap]: RouteMap[K];
}[keyof RouteMap], string>>;

@@ -721,2 +793,11 @@ /**

/**
* Route location that can infer full path locations
*
* @internal
*/
export declare type RouteLocationString<RouteMap extends RouteStaticPathMapGeneric = RouteStaticPathMapGeneric> = RouteStaticPathMapGeneric extends RouteMap ? string : LiteralUnion<{
[K in keyof RouteMap]: RouteMap[K];
}[keyof RouteMap], string>;
/**
* Interface to type `meta` fields in route records.

@@ -740,19 +821,32 @@ *

export declare type RouteNamedMap<Routes extends Readonly<RouteRecordRaw[]>, Prefix extends string = ''> = Routes extends readonly [infer R, ...infer Rest] ? Rest extends Readonly<RouteRecordRaw[]> ? (R extends {
name?: infer Name;
path: infer Path;
children?: infer Children;
} ? Path extends string ? (Name extends string | symbol ? {
/**
* Relevant information about a named route record to deduce its params.
*
* @internal
*/
export declare interface RouteNamedInfo<Path extends string = string, Params extends RouteParams = RouteParams, ParamsRaw extends RouteParamsRaw = RouteParamsRaw> {
params: Params;
paramsRaw: ParamsRaw;
path: Path;
}
/**
* Creates a map with each named route as a properties. Each property contains the type of the params in raw and
* normalized versions as well as the raw path.
* @internal
*/
export declare type RouteNamedMap<Routes extends Readonly<RouteRecordRaw[]>, Prefix extends string = ''> = Routes extends readonly [infer R, ...infer Rest] ? Rest extends Readonly<RouteRecordRaw[]> ? (R extends _RouteRecordNamedBaseInfo<infer Name, infer Path, infer Children> ? (Name extends RouteRecordName ? {
[N in Name]: {
params: ParamsFromPath<JoinPath<Prefix, Path>>;
paramsRaw: ParamsRawFromPath<JoinPath<Prefix, Path>>;
path: JoinPath<Prefix, Path>;
params: ParamsFromPath<_JoinPath<Prefix, Path>>;
paramsRaw: ParamsRawFromPath<_JoinPath<Prefix, Path>>;
path: _JoinPath<Prefix, Path>;
};
} : {}) & (Children extends Readonly<RouteRecordRaw[]> ? RouteNamedMap<Children, JoinPath<Prefix, Path>> : {}) : never : {}) & RouteNamedMap<Rest, Prefix> : never : {};
} : {}) & (Children extends Readonly<RouteRecordRaw[]> ? RouteNamedMap<Children, _JoinPath<Prefix, Path>> : {}) : {}) & RouteNamedMap<Rest, Prefix> : never : {};
declare type RouteNamedMapGeneric = Record<string | symbol | number, {
params: RouteParams;
paramsRaw: RouteParamsRaw;
path: string;
}>;
/**
* Generic map of named routes from a list of route records.
*
* @internal
*/
declare type RouteNamedMapGeneric = Record<RouteRecordName, RouteNamedInfo>;

@@ -801,3 +895,3 @@ export declare type RouteParams = Record<string, RouteParamValue | readonly RouteParamValue[]>;

/**
* Add a new {@link RouteRecordRaw route record} as the child of an existing route.
* Add a new {@link RouteRecordRaw | route record} as the child of an existing route.
*

@@ -809,3 +903,3 @@ * @param parentName - Parent Route Record where `route` should be appended at

/**
* Add a new {@link RouteRecordRaw route record} to the router.
* Add a new {@link RouteRecordRaw | route record} to the router.
*

@@ -828,8 +922,8 @@ * @param route - Route Record to add

/**
* Get a full list of all the {@link RouteRecord route records}.
* Get a full list of all the {@link RouteRecord | route records}.
*/
getRoutes(): RouteRecord[];
/**
* Returns the {@link RouteLocation normalized version} of a
* {@link RouteLocationRaw route location}. Also includes an `href` property
* Returns the {@link RouteLocation | normalized version} of a
* {@link RouteLocationRaw | route location}. Also includes an `href` property
* that includes any existing `base`. By default the `currentLocation` used is

@@ -850,3 +944,3 @@ * `route.currentRoute` and should only be overridden in advanced use cases.

*/
push<RouteMap extends RouteNamedMapGeneric = RouteNamedMap<Options['routes']>, Name extends keyof RouteMap = keyof RouteNamedMap<Options['routes']>>(to: RouteNamedMapGeneric extends RouteMap ? RouteLocationRaw : RouteLocationNamedRaw<RouteMap, Name> | RouteLocationPathRaw | string): Promise<NavigationFailure | void | undefined>;
push(to: RouteLocationNamedRaw<RouteNamedMap<Options['routes']>> | RouteLocationString<RouteStaticPathMap<Options['routes']>> | RouteLocationPathRaw<RouteStaticPathMap<Options['routes']>>): Promise<NavigationFailure | void | undefined>;
/**

@@ -858,3 +952,3 @@ * Programmatically navigate to a new URL by replacing the current entry in

*/
replace<RouteMap extends RouteNamedMapGeneric = RouteNamedMap<Options['routes']>, Name extends keyof RouteMap = keyof RouteNamedMap<Options['routes']>>(to: RouteNamedMapGeneric extends RouteMap ? RouteLocationRaw : RouteLocationNamedRaw<RouteMap, Name> | RouteLocationPathRaw | string): Promise<NavigationFailure | void | undefined>;
replace(to: RouteLocationNamedRaw<RouteNamedMap<Options['routes']>> | RouteLocationString<RouteStaticPathMap<Options['routes']>> | RouteLocationPathRaw<RouteStaticPathMap<Options['routes']>>): Promise<NavigationFailure | void | undefined>;
/**

@@ -1041,4 +1135,15 @@ * Go back in history if possible by calling `history.back()`. Equivalent to

/**
* Normalized version of a {@link RouteRecord route record}
* Important information in a Named Route Record
* @internal
*/
export declare interface _RouteRecordNamedBaseInfo<Name extends RouteRecordName = RouteRecordName, // we don't care about symbols
Path extends string = string, Children extends Readonly<RouteRecordRaw[]> = Readonly<RouteRecordRaw[]>> {
name?: Name;
path: Path;
children?: Children;
}
/**
* Normalized version of a {@link RouteRecord | route record}.
*/
export declare interface RouteRecordNormalized {

@@ -1255,22 +1360,9 @@ /**

*/
export declare const RouterLink: {
new (): {
$props: AllowedComponentProps & ComponentCustomProps & VNodeProps & RouterLinkProps;
$slots: {
default: (arg: UnwrapRef<ReturnType<typeof useLink>>) => VNode[];
};
};
/**
* Access to `useLink()` without depending on using vue-router
*
* @internal
*/
useLink: typeof useLink;
};
export declare const RouterLink: RouterLinkTyped<Router<RouterOptions>>;
declare interface RouterLinkOptions {
declare interface RouterLinkOptions<Routes extends RouteLocationRaw = RouteLocationRaw> {
/**
* Route Location the link should navigate to when clicked on.
*/
to: Parameters<RouterTyped['push']>[0];
to: Routes;
/**

@@ -1282,3 +1374,3 @@ * Calls `router.replace` instead of `router.push`.

export declare interface RouterLinkProps extends RouterLinkOptions {
export declare interface RouterLinkProps<Routes extends RouteLocationRaw = RouteLocationRaw> extends RouterLinkOptions<Routes> {
/**

@@ -1303,2 +1395,17 @@ * Whether RouterLink should not wrap its content in an `a` tag. Useful when

export declare interface RouterLinkTyped<R extends Router = Router> {
new (): {
$props: AllowedComponentProps & ComponentCustomProps & VNodeProps & RouterLinkProps<RouteLocationNamedRaw<RouteNamedMap<R['options']['routes']>> | RouteLocationString<RouteStaticPathMap<R['options']['routes']>> | RouteLocationPathRaw<RouteStaticPathMap<R['options']['routes']>>>;
$slots: {
default: (arg: UnwrapRef<ReturnType<typeof useLink>>) => VNode[];
};
};
/**
* Access to `useLink()` without depending on using vue-router
*
* @internal
*/
useLink: typeof useLink;
}
/**

@@ -1368,3 +1475,3 @@ * Internal RouterMatcher

* @example
* Let's say you want to use the package {@link https://github.com/ljharb/qs | qs}
* Let's say you want to use the [qs package](https://github.com/ljharb/qs)
* to parse queries, you can provide both `parseQuery` and `stringifyQuery`:

@@ -1439,2 +1546,17 @@ * ```js

/**
* @internal
*/
export declare type RouteStaticPathMap<Routes extends Readonly<RouteRecordRaw[]>, Prefix extends string = ''> = Routes extends readonly [infer R, ...infer Rest] ? Rest extends Readonly<RouteRecordRaw[]> ? (R extends _RouteRecordNamedBaseInfo<infer _Name, infer Path, infer Children> ? {
[P in Path as _JoinPath<Prefix, Path>]: _JoinPath<Prefix, Path>;
} & (Children extends Readonly<RouteRecordRaw[]> ? RouteStaticPathMap<Children, _JoinPath<Prefix, Path>> : {}) : never) & // R must be a valid route record
RouteStaticPathMap<Rest, Prefix> : {} : {};
/**
* Generic map of routes paths from a list of route records.
*
* @internal
*/
declare type RouteStaticPathMapGeneric = Record<string, string>;
declare type ScrollPosition = ScrollPositionCoordinates | ScrollPositionElement;

@@ -1481,2 +1603,6 @@

declare type Simplify<T> = {
[K in keyof T]: T[K];
};
/**

@@ -1510,2 +1636,11 @@ * Initial route location where the router is. Can be used in navigation guards

/**
* We consider a what comes after a param, e.g. For `/:id(\\d+)+/edit`, it would be `(\\d+)+/edit`. This should output
* everything after the regex while handling escaped `)`: `+/edit`. Note this type should be used with a string that
* starts with `(` as it will remove everything until the closing parenthesis `)`.
*
* @internal
*/
export declare type _StripRegex<S extends string> = S extends `(${infer A}\\)${infer Rest}` ? A extends `${string})${infer Rest2}` ? `${Rest2}\\)${Rest}` : _RemoveUntilClosingPar<Rest> : S extends `(${string})${infer Rest}` ? Rest : S;
export declare function useLink(props: UseLinkOptions): {

@@ -1512,0 +1647,0 @@ route: ComputedRef<RouteLocation & {

/*!
* vue-router v4.0.15
* vue-router v4.0.16
* (c) 2022 Eduardo San Martin Morote
* @license MIT
*/
var VueRouter=function(e,t){"use strict";const n="undefined"!=typeof window;function r(e){return e.__esModule||"Module"===e[Symbol.toStringTag]}const o=Object.assign;function a(e,t){const n={};for(const r in t){const o=t[r];n[r]=s(o)?o.map(e):e(o)}return n}const c=()=>{},s=Array.isArray,i=/\/$/;function l(e,t,n="/"){let r,o={},a="",c="";const s=t.indexOf("?"),i=t.indexOf("#",s>-1?s:0);return s>-1&&(r=t.slice(0,s),a=t.slice(s+1,i>-1?i:t.length),o=e(a)),i>-1&&(r=r||t.slice(0,i),c=t.slice(i,t.length)),r=function(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/");let o,a,c=n.length-1;for(o=0;o<r.length;o++)if(a=r[o],1!==c&&"."!==a){if(".."!==a)break;c--}return n.slice(0,c).join("/")+"/"+r.slice(o-(o===r.length?1:0)).join("/")}(null!=r?r:t,n),{fullPath:r+(a&&"?")+a+c,path:r,query:o,hash:c}}function u(e,t){return t&&e.toLowerCase().startsWith(t.toLowerCase())?e.slice(t.length)||"/":e}function f(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function p(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!h(e[n],t[n]))return!1;return!0}function h(e,t){return s(e)?d(e,t):s(t)?d(t,e):e===t}function d(e,t){return s(t)?e.length===t.length&&e.every(((e,n)=>e===t[n])):1===e.length&&e[0]===t}var m,g;!function(e){e.pop="pop",e.push="push"}(m||(m={})),function(e){e.back="back",e.forward="forward",e.unknown=""}(g||(g={}));function v(e){if(!e)if(n){const t=document.querySelector("base");e=(e=t&&t.getAttribute("href")||"/").replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return"/"!==e[0]&&"#"!==e[0]&&(e="/"+e),e.replace(i,"")}const y=/^[^#]+#/;function b(e,t){return e.replace(y,"#")+t}const w=()=>({left:window.pageXOffset,top:window.pageYOffset});function E(e){let t;if("el"in e){const n=e.el,r="string"==typeof n&&n.startsWith("#"),o="string"==typeof n?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o)return;t=function(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}(o,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(null!=t.left?t.left:window.pageXOffset,null!=t.top?t.top:window.pageYOffset)}function R(e,t){return(history.state?history.state.position-t:-1)+e}const O=new Map;let k=()=>location.protocol+"//"+location.host;function P(e,t){const{pathname:n,search:r,hash:o}=t,a=e.indexOf("#");if(a>-1){let t=o.includes(e.slice(a))?e.slice(a).length:1,n=o.slice(t);return"/"!==n[0]&&(n="/"+n),u(n,"")}return u(n,e)+r+o}function j(e,t,n,r=!1,o=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:o?w():null}}function C(e){const t=function(e){const{history:t,location:n}=window,r={value:P(e,n)},a={value:t.state};function c(r,o,c){const s=e.indexOf("#"),i=s>-1?(n.host&&document.querySelector("base")?e:e.slice(s))+r:k()+e+r;try{t[c?"replaceState":"pushState"](o,"",i),a.value=o}catch(e){console.error(e),n[c?"replace":"assign"](i)}}return a.value||c(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0),{location:r,state:a,push:function(e,n){const s=o({},a.value,t.state,{forward:e,scroll:w()});c(s.current,s,!0),c(e,o({},j(r.value,e,null),{position:s.position+1},n),!1),r.value=e},replace:function(e,n){c(e,o({},t.state,j(a.value.back,e,a.value.forward,!0),n,{position:a.value.position}),!0),r.value=e}}}(e=v(e)),n=function(e,t,n,r){let a=[],c=[],s=null;const i=({state:o})=>{const c=P(e,location),i=n.value,l=t.value;let u=0;if(o){if(n.value=c,t.value=o,s&&s===i)return void(s=null);u=l?o.position-l.position:0}else r(c);a.forEach((e=>{e(n.value,i,{delta:u,type:m.pop,direction:u?u>0?g.forward:g.back:g.unknown})}))};function l(){const{history:e}=window;e.state&&e.replaceState(o({},e.state,{scroll:w()}),"")}return window.addEventListener("popstate",i),window.addEventListener("beforeunload",l),{pauseListeners:function(){s=n.value},listen:function(e){a.push(e);const t=()=>{const t=a.indexOf(e);t>-1&&a.splice(t,1)};return c.push(t),t},destroy:function(){for(const e of c)e();c=[],window.removeEventListener("popstate",i),window.removeEventListener("beforeunload",l)}}}(e,t.state,t.location,t.replace);const r=o({location:"",base:e,go:function(e,t=!0){t||n.pauseListeners(),history.go(e)},createHref:b.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}function x(e){return"string"==typeof e||"symbol"==typeof e}const $={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},S=Symbol("");var A;function L(e,t){return o(new Error,{type:e,[S]:!0},t)}function q(e,t){return e instanceof Error&&S in e&&(null==t||!!(e.type&t))}e.NavigationFailureType=void 0,(A=e.NavigationFailureType||(e.NavigationFailureType={}))[A.aborted=4]="aborted",A[A.cancelled=8]="cancelled",A[A.duplicated=16]="duplicated";const M="[^/]+?",B={sensitive:!1,strict:!1,start:!0,end:!0},T=/[.+*?^${}()[\]/\\]/g;function _(e,t){let n=0;for(;n<e.length&&n<t.length;){const r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?1===e.length&&80===e[0]?-1:1:e.length>t.length?1===t.length&&80===t[0]?1:-1:0}function G(e,t){let n=0;const r=e.score,o=t.score;for(;n<r.length&&n<o.length;){const e=_(r[n],o[n]);if(e)return e;n++}return o.length-r.length}const F={type:0,value:""},I=/[a-zA-Z0-9_]/;function K(e,t,n){const r=function(e,t){const n=o({},B,t),r=[];let a=n.start?"^":"";const c=[];for(const t of e){const e=t.length?[]:[90];n.strict&&!t.length&&(a+="/");for(let r=0;r<t.length;r++){const o=t[r];let s=40+(n.sensitive?.25:0);if(0===o.type)r||(a+="/"),a+=o.value.replace(T,"\\$&"),s+=40;else if(1===o.type){const{value:e,repeatable:n,optional:i,regexp:l}=o;c.push({name:e,repeatable:n,optional:i});const u=l||M;if(u!==M){s+=10;try{new RegExp(`(${u})`)}catch(t){throw new Error(`Invalid custom RegExp for param "${e}" (${u}): `+t.message)}}let f=n?`((?:${u})(?:/(?:${u}))*)`:`(${u})`;r||(f=i&&t.length<2?`(?:/${f})`:"/"+f),i&&(f+="?"),a+=f,s+=20,i&&(s+=-8),n&&(s+=-20),".*"===u&&(s+=-50)}e.push(s)}r.push(e)}if(n.strict&&n.end){const e=r.length-1;r[e][r[e].length-1]+=.7000000000000001}n.strict||(a+="/?"),n.end?a+="$":n.strict&&(a+="(?:/|$)");const i=new RegExp(a,n.sensitive?"":"i");return{re:i,score:r,keys:c,parse:function(e){const t=e.match(i),n={};if(!t)return null;for(let e=1;e<t.length;e++){const r=t[e]||"",o=c[e-1];n[o.name]=r&&o.repeatable?r.split("/"):r}return n},stringify:function(t){let n="",r=!1;for(const o of e){r&&n.endsWith("/")||(n+="/"),r=!1;for(const a of o)if(0===a.type)n+=a.value;else if(1===a.type){const{value:c,repeatable:i,optional:l}=a,u=c in t?t[c]:"";if(s(u)&&!i)throw new Error(`Provided param "${c}" is an array but it is not repeatable (* or + modifiers)`);const f=s(u)?u.join("/"):u;if(!f){if(!l)throw new Error(`Missing required param "${c}"`);o.length<2&&e.length>1&&(n.endsWith("/")?n=n.slice(0,-1):r=!0)}n+=f}}return n}}}(function(e){if(!e)return[[]];if("/"===e)return[[F]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(e){throw new Error(`ERR (${n})/"${l}": ${e}`)}let n=0,r=n;const o=[];let a;function c(){a&&o.push(a),a=[]}let s,i=0,l="",u="";function f(){l&&(0===n?a.push({type:0,value:l}):1===n||2===n||3===n?(a.length>1&&("*"===s||"+"===s)&&t(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),a.push({type:1,value:l,regexp:u,repeatable:"*"===s||"+"===s,optional:"*"===s||"?"===s})):t("Invalid state to consume buffer"),l="")}function p(){l+=s}for(;i<e.length;)if(s=e[i++],"\\"!==s||2===n)switch(n){case 0:"/"===s?(l&&f(),c()):":"===s?(f(),n=1):p();break;case 4:p(),n=r;break;case 1:"("===s?n=2:I.test(s)?p():(f(),n=0,"*"!==s&&"?"!==s&&"+"!==s&&i--);break;case 2:")"===s?"\\"==u[u.length-1]?u=u.slice(0,-1)+s:n=3:u+=s;break;case 3:f(),n=0,"*"!==s&&"?"!==s&&"+"!==s&&i--,u="";break;default:t("Unknown state")}else r=n,n=4;return 2===n&&t(`Unfinished custom RegExp for param "${l}"`),f(),c(),o}(e.path),n),a=o(r,{record:e,parent:t,children:[],alias:[]});return t&&!a.record.aliasOf==!t.record.aliasOf&&t.children.push(a),a}function U(e,t){const n=[],r=new Map;function a(e,n,r){const l=!r,u=function(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:V(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}(e);u.aliasOf=r&&r.record;const f=W(t,e),p=[u];if("alias"in e){const t="string"==typeof e.alias?[e.alias]:e.alias;for(const e of t)p.push(o({},u,{components:r?r.record.components:u.components,path:e,aliasOf:r?r.record:u}))}let h,d;for(const t of p){const{path:o}=t;if(n&&"/"!==o[0]){const e=n.record.path,r="/"===e[e.length-1]?"":"/";t.path=n.record.path+(o&&r+o)}if(h=K(t,n,f),r?r.alias.push(h):(d=d||h,d!==h&&d.alias.push(h),l&&e.name&&!D(h)&&s(e.name)),"children"in u){const e=u.children;for(let t=0;t<e.length;t++)a(e[t],h,r&&r.children[t])}r=r||h,i(h)}return d?()=>{s(d)}:c}function s(e){if(x(e)){const t=r.get(e);t&&(r.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(s),t.alias.forEach(s))}else{const t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&r.delete(e.record.name),e.children.forEach(s),e.alias.forEach(s))}}function i(e){let t=0;for(;t<n.length&&G(e,n[t])>=0&&(e.record.path!==n[t].record.path||!N(e,n[t]));)t++;n.splice(t,0,e),e.record.name&&!D(e)&&r.set(e.record.name,e)}return t=W({strict:!1,end:!0,sensitive:!1},t),e.forEach((e=>a(e))),{addRoute:a,resolve:function(e,t){let a,c,s,i={};if("name"in e&&e.name){if(a=r.get(e.name),!a)throw L(1,{location:e});s=a.record.name,i=o(function(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}(t.params,a.keys.filter((e=>!e.optional)).map((e=>e.name))),e.params),c=a.stringify(i)}else if("path"in e)c=e.path,a=n.find((e=>e.re.test(c))),a&&(i=a.parse(c),s=a.record.name);else{if(a=t.name?r.get(t.name):n.find((e=>e.re.test(t.path))),!a)throw L(1,{location:e,currentLocation:t});s=a.record.name,i=o({},t.params,e.params),c=a.stringify(i)}const l=[];let u=a;for(;u;)l.unshift(u.record),u=u.parent;return{name:s,path:c,params:i,matched:l,meta:H(l)}},removeRoute:s,getRoutes:function(){return n},getRecordMatcher:function(e){return r.get(e)}}}function V(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]="boolean"==typeof n?n:n[r];return t}function D(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function H(e){return e.reduce(((e,t)=>o(e,t.meta)),{})}function W(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}function N(e,t){return t.children.some((t=>t===e||N(e,t)))}const z=/#/g,Q=/&/g,X=/\//g,Y=/=/g,Z=/\?/g,J=/\+/g,ee=/%5B/g,te=/%5D/g,ne=/%5E/g,re=/%60/g,oe=/%7B/g,ae=/%7C/g,ce=/%7D/g,se=/%20/g;function ie(e){return encodeURI(""+e).replace(ae,"|").replace(ee,"[").replace(te,"]")}function le(e){return ie(e).replace(J,"%2B").replace(se,"+").replace(z,"%23").replace(Q,"%26").replace(re,"`").replace(oe,"{").replace(ce,"}").replace(ne,"^")}function ue(e){return null==e?"":function(e){return ie(e).replace(z,"%23").replace(Z,"%3F")}(e).replace(X,"%2F")}function fe(e){try{return decodeURIComponent(""+e)}catch(e){}return""+e}function pe(e){const t={};if(""===e||"?"===e)return t;const n=("?"===e[0]?e.slice(1):e).split("&");for(let e=0;e<n.length;++e){const r=n[e].replace(J," "),o=r.indexOf("="),a=fe(o<0?r:r.slice(0,o)),c=o<0?null:fe(r.slice(o+1));if(a in t){let e=t[a];s(e)||(e=t[a]=[e]),e.push(c)}else t[a]=c}return t}function he(e){let t="";for(let n in e){const r=e[n];if(n=le(n).replace(Y,"%3D"),null==r){void 0!==r&&(t+=(t.length?"&":"")+n);continue}(s(r)?r.map((e=>e&&le(e))):[r&&le(r)]).forEach((e=>{void 0!==e&&(t+=(t.length?"&":"")+n,null!=e&&(t+="="+e))}))}return t}function de(e){const t={};for(const n in e){const r=e[n];void 0!==r&&(t[n]=s(r)?r.map((e=>null==e?null:""+e)):null==r?r:""+r)}return t}const me=Symbol(""),ge=Symbol(""),ve=Symbol(""),ye=Symbol(""),be=Symbol("");function we(){let e=[];return{add:function(t){return e.push(t),()=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)}},list:()=>e,reset:function(){e=[]}}}function Ee(e,n,r){const o=()=>{e[n].delete(r)};t.onUnmounted(o),t.onDeactivated(o),t.onActivated((()=>{e[n].add(r)})),e[n].add(r)}function Re(e,t,n,r,o){const a=r&&(r.enterCallbacks[o]=r.enterCallbacks[o]||[]);return()=>new Promise(((c,s)=>{const i=e=>{var i;!1===e?s(L(4,{from:n,to:t})):e instanceof Error?s(e):"string"==typeof(i=e)||i&&"object"==typeof i?s(L(2,{from:t,to:e})):(a&&r.enterCallbacks[o]===a&&"function"==typeof e&&a.push(e),c())},l=e.call(r&&r.instances[o],t,n,i);let u=Promise.resolve(l);e.length<3&&(u=u.then(i)),u.catch((e=>s(e)))}))}function Oe(e,t,n,o){const a=[];for(const s of e)for(const e in s.components){let i=s.components[e];if("beforeRouteEnter"===t||s.instances[e])if("object"==typeof(c=i)||"displayName"in c||"props"in c||"__vccOpts"in c){const r=(i.__vccOpts||i)[t];r&&a.push(Re(r,n,o,s,e))}else{let c=i();a.push((()=>c.then((a=>{if(!a)return Promise.reject(new Error(`Couldn't resolve component "${e}" at "${s.path}"`));const c=r(a)?a.default:a;s.components[e]=c;const i=(c.__vccOpts||c)[t];return i&&Re(i,n,o,s,e)()}))))}}var c;return a}function ke(e){const n=t.inject(ve),r=t.inject(ye),o=t.computed((()=>n.resolve(t.unref(e.to)))),a=t.computed((()=>{const{matched:e}=o.value,{length:t}=e,n=e[t-1],a=r.matched;if(!n||!a.length)return-1;const c=a.findIndex(f.bind(null,n));if(c>-1)return c;const s=je(e[t-2]);return t>1&&je(n)===s&&a[a.length-1].path!==s?a.findIndex(f.bind(null,e[t-2])):c})),i=t.computed((()=>a.value>-1&&function(e,t){for(const n in t){const r=t[n],o=e[n];if("string"==typeof r){if(r!==o)return!1}else if(!s(o)||o.length!==r.length||r.some(((e,t)=>e!==o[t])))return!1}return!0}(r.params,o.value.params))),l=t.computed((()=>a.value>-1&&a.value===r.matched.length-1&&p(r.params,o.value.params)));return{route:o,href:t.computed((()=>o.value.href)),isActive:i,isExactActive:l,navigate:function(r={}){return function(e){if(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)return;if(e.defaultPrevented)return;if(void 0!==e.button&&0!==e.button)return;if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}e.preventDefault&&e.preventDefault();return!0}(r)?n[t.unref(e.replace)?"replace":"push"](t.unref(e.to)).catch(c):Promise.resolve()}}}const Pe=t.defineComponent({name:"RouterLink",props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:ke,setup(e,{slots:n}){const r=t.reactive(ke(e)),{options:o}=t.inject(ve),a=t.computed((()=>({[Ce(e.activeClass,o.linkActiveClass,"router-link-active")]:r.isActive,[Ce(e.exactActiveClass,o.linkExactActiveClass,"router-link-exact-active")]:r.isExactActive})));return()=>{const o=n.default&&n.default(r);return e.custom?o:t.h("a",{"aria-current":r.isExactActive?e.ariaCurrentValue:null,href:r.href,onClick:r.navigate,class:a.value},o)}}});function je(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Ce=(e,t,n)=>null!=e?e:null!=t?t:n;function xe(e,t){if(!e)return null;const n=e(t);return 1===n.length?n[0]:n}const $e=t.defineComponent({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:n,slots:r}){const a=t.inject(be),c=t.computed((()=>e.route||a.value)),s=t.inject(ge,0),i=t.computed((()=>{let e=t.unref(s);const{matched:n}=c.value;let r;for(;(r=n[e])&&!r.components;)e++;return e})),l=t.computed((()=>c.value.matched[i.value]));t.provide(ge,t.computed((()=>i.value+1))),t.provide(me,l),t.provide(be,c);const u=t.ref();return t.watch((()=>[u.value,l.value,e.name]),(([e,t,n],[r,o,a])=>{t&&(t.instances[n]=e,o&&o!==t&&e&&e===r&&(t.leaveGuards.size||(t.leaveGuards=o.leaveGuards),t.updateGuards.size||(t.updateGuards=o.updateGuards))),!e||!t||o&&f(t,o)&&r||(t.enterCallbacks[n]||[]).forEach((t=>t(e)))}),{flush:"post"}),()=>{const a=c.value,s=l.value,i=s&&s.components[e.name],f=e.name;if(!i)return xe(r.default,{Component:i,route:a});const p=s.props[e.name],h=p?!0===p?a.params:"function"==typeof p?p(a):p:null,d=t.h(i,o({},h,n,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(s.instances[f]=null)},ref:u}));return xe(r.default,{Component:d,route:a})||d}}});function Se(e){return e.reduce(((e,t)=>e.then((()=>t()))),Promise.resolve())}return e.RouterLink=Pe,e.RouterView=$e,e.START_LOCATION=$,e.createMemoryHistory=function(e=""){let t=[],n=[""],r=0;function o(e){r++,r===n.length||n.splice(r),n.push(e)}const a={location:"",state:{},base:e=v(e),createHref:b.bind(null,e),replace(e){n.splice(r--,1),o(e)},push(e,t){o(e)},listen:e=>(t.push(e),()=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)}),destroy(){t=[],n=[""],r=0},go(e,o=!0){const a=this.location,c=e<0?g.back:g.forward;r=Math.max(0,Math.min(r+e,n.length-1)),o&&function(e,n,{direction:r,delta:o}){const a={direction:r,delta:o,type:m.pop};for(const r of t)r(e,n,a)}(this.location,a,{direction:c,delta:e})}};return Object.defineProperty(a,"location",{enumerable:!0,get:()=>n[r]}),a},e.createRouter=function(e){const r=U(e.routes,e),i=e.parseQuery||pe,u=e.stringifyQuery||he,h=e.history,d=we(),g=we(),v=we(),y=t.shallowRef($);let b=$;n&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const k=a.bind(null,(e=>""+e)),P=a.bind(null,ue),j=a.bind(null,fe);function C(e,t){if(t=o({},t||y.value),"string"==typeof e){const n=l(i,e,t.path),a=r.resolve({path:n.path},t),c=h.createHref(n.fullPath);return o(n,a,{params:j(a.params),hash:fe(n.hash),redirectedFrom:void 0,href:c})}let n;if("path"in e)n=o({},e,{path:l(i,e.path,t.path).path});else{const r=o({},e.params);for(const e in r)null==r[e]&&delete r[e];n=o({},e,{params:P(e.params)}),t.params=P(t.params)}const a=r.resolve(n,t),c=e.hash||"";a.params=k(j(a.params));const s=function(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}(u,o({},e,{hash:(f=c,ie(f).replace(oe,"{").replace(ce,"}").replace(ne,"^")),path:a.path}));var f;const p=h.createHref(s);return o({fullPath:s,hash:c,query:u===he?de(e.query):e.query||{}},a,{redirectedFrom:void 0,href:p})}function S(e){return"string"==typeof e?l(i,e,y.value.path):o({},e)}function A(e,t){if(b!==e)return L(8,{from:t,to:e})}function M(e){return T(e)}function B(e){const t=e.matched[e.matched.length-1];if(t&&t.redirect){const{redirect:n}=t;let r="function"==typeof n?n(e):n;return"string"==typeof r&&(r=r.includes("?")||r.includes("#")?r=S(r):{path:r},r.params={}),o({query:e.query,hash:e.hash,params:"path"in r?{}:e.params},r)}}function T(e,t){const n=b=C(e),r=y.value,a=e.state,c=e.force,s=!0===e.replace,i=B(n);if(i)return T(o(S(i),{state:a,force:c,replace:s}),t||n);const l=n;let h;return l.redirectedFrom=t,!c&&function(e,t,n){const r=t.matched.length-1,o=n.matched.length-1;return r>-1&&r===o&&f(t.matched[r],n.matched[o])&&p(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}(u,r,n)&&(h=L(16,{to:l,from:r}),Q(r,r,!0,!1)),(h?Promise.resolve(h):G(l,r)).catch((e=>q(e)?q(e,2)?e:z(e):N(e,l,r))).then((e=>{if(e){if(q(e,2))return T(o(S(e.to),{state:a,force:c,replace:s}),t||l)}else e=I(l,r,!0,s,a);return F(l,r,e),e}))}function _(e,t){const n=A(e,t);return n?Promise.reject(n):Promise.resolve()}function G(e,t){let n;const[r,o,a]=function(e,t){const n=[],r=[],o=[],a=Math.max(t.matched.length,e.matched.length);for(let c=0;c<a;c++){const a=t.matched[c];a&&(e.matched.find((e=>f(e,a)))?r.push(a):n.push(a));const s=e.matched[c];s&&(t.matched.find((e=>f(e,s)))||o.push(s))}return[n,r,o]}(e,t);n=Oe(r.reverse(),"beforeRouteLeave",e,t);for(const o of r)o.leaveGuards.forEach((r=>{n.push(Re(r,e,t))}));const c=_.bind(null,e,t);return n.push(c),Se(n).then((()=>{n=[];for(const r of d.list())n.push(Re(r,e,t));return n.push(c),Se(n)})).then((()=>{n=Oe(o,"beforeRouteUpdate",e,t);for(const r of o)r.updateGuards.forEach((r=>{n.push(Re(r,e,t))}));return n.push(c),Se(n)})).then((()=>{n=[];for(const r of e.matched)if(r.beforeEnter&&!t.matched.includes(r))if(s(r.beforeEnter))for(const o of r.beforeEnter)n.push(Re(o,e,t));else n.push(Re(r.beforeEnter,e,t));return n.push(c),Se(n)})).then((()=>(e.matched.forEach((e=>e.enterCallbacks={})),n=Oe(a,"beforeRouteEnter",e,t),n.push(c),Se(n)))).then((()=>{n=[];for(const r of g.list())n.push(Re(r,e,t));return n.push(c),Se(n)})).catch((e=>q(e,8)?e:Promise.reject(e)))}function F(e,t,n){for(const r of v.list())r(e,t,n)}function I(e,t,r,a,c){const s=A(e,t);if(s)return s;const i=t===$,l=n?history.state:{};r&&(a||i?h.replace(e.fullPath,o({scroll:i&&l&&l.scroll},c)):h.push(e.fullPath,c)),y.value=e,Q(e,t,r,i),z()}let K;function V(){K||(K=h.listen(((e,t,r)=>{if(!J.listening)return;const a=C(e),s=B(a);if(s)return void T(o(s,{replace:!0}),a).catch(c);b=a;const i=y.value;var l,u;n&&(l=R(i.fullPath,r.delta),u=w(),O.set(l,u)),G(a,i).catch((e=>q(e,12)?e:q(e,2)?(T(e.to,a).then((e=>{q(e,20)&&!r.delta&&r.type===m.pop&&h.go(-1,!1)})).catch(c),Promise.reject()):(r.delta&&h.go(-r.delta,!1),N(e,a,i)))).then((e=>{(e=e||I(a,i,!1))&&(r.delta?h.go(-r.delta,!1):r.type===m.pop&&q(e,20)&&h.go(-1,!1)),F(a,i,e)})).catch(c)})))}let D,H=we(),W=we();function N(e,t,n){z(e);const r=W.list();return r.length?r.forEach((r=>r(e,t,n))):console.error(e),Promise.reject(e)}function z(e){return D||(D=!e,V(),H.list().forEach((([t,n])=>e?n(e):t())),H.reset()),e}function Q(r,o,a,c){const{scrollBehavior:s}=e;if(!n||!s)return Promise.resolve();const i=!a&&function(e){const t=O.get(e);return O.delete(e),t}(R(r.fullPath,0))||(c||!a)&&history.state&&history.state.scroll||null;return t.nextTick().then((()=>s(r,o,i))).then((e=>e&&E(e))).catch((e=>N(e,r,o)))}const X=e=>h.go(e);let Y;const Z=new Set,J={currentRoute:y,listening:!0,addRoute:function(e,t){let n,o;return x(e)?(n=r.getRecordMatcher(e),o=t):o=e,r.addRoute(o,n)},removeRoute:function(e){const t=r.getRecordMatcher(e);t&&r.removeRoute(t)},hasRoute:function(e){return!!r.getRecordMatcher(e)},getRoutes:function(){return r.getRoutes().map((e=>e.record))},resolve:C,options:e,push:M,replace:function(e){return M(o(S(e),{replace:!0}))},go:X,back:()=>X(-1),forward:()=>X(1),beforeEach:d.add,beforeResolve:g.add,afterEach:v.add,onError:W.add,isReady:function(){return D&&y.value!==$?Promise.resolve():new Promise(((e,t)=>{H.add([e,t])}))},install(e){e.component("RouterLink",Pe),e.component("RouterView",$e),e.config.globalProperties.$router=this,Object.defineProperty(e.config.globalProperties,"$route",{enumerable:!0,get:()=>t.unref(y)}),n&&!Y&&y.value===$&&(Y=!0,M(h.location).catch((e=>{})));const r={};for(const e in $)r[e]=t.computed((()=>y.value[e]));e.provide(ve,this),e.provide(ye,t.reactive(r)),e.provide(be,y);const o=e.unmount;Z.add(e),e.unmount=function(){Z.delete(e),Z.size<1&&(b=$,K&&K(),K=null,y.value=$,Y=!1,D=!1),o()}}};return J},e.createRouterMatcher=U,e.createWebHashHistory=function(e){return(e=location.host?e||location.pathname+location.search:"").includes("#")||(e+="#"),C(e)},e.createWebHistory=C,e.isNavigationFailure=q,e.loadRouteLocation=function(e){return e.matched.every((e=>e.redirect))?Promise.reject(new Error("Cannot load a route that redirects.")):Promise.all(e.matched.map((e=>e.components&&Promise.all(Object.keys(e.components).reduce(((t,n)=>{const o=e.components[n];return"function"!=typeof o||"displayName"in o||t.push(o().then((t=>{if(!t)return Promise.reject(new Error(`Couldn't resolve component "${n}" at "${e.path}". Ensure you passed a function that returns a promise.`));const o=r(t)?t.default:t;e.components[n]=o}))),t}),[]))))).then((()=>e))},e.matchedRouteKey=me,e.onBeforeRouteLeave=function(e){const n=t.inject(me,{}).value;n&&Ee(n,"leaveGuards",e)},e.onBeforeRouteUpdate=function(e){const n=t.inject(me,{}).value;n&&Ee(n,"updateGuards",e)},e.parseQuery=pe,e.routeLocationKey=ye,e.routerKey=ve,e.routerViewLocationKey=be,e.stringifyQuery=he,e.useLink=ke,e.useRoute=function(){return t.inject(ye)},e.useRouter=function(){return t.inject(ve)},e.viewDepthKey=ge,Object.defineProperty(e,"__esModule",{value:!0}),e}({},Vue);
var VueRouter=function(e,t){"use strict";const n="undefined"!=typeof window;function r(e){return e.__esModule||"Module"===e[Symbol.toStringTag]}const o=Object.assign;function a(e,t){const n={};for(const r in t){const o=t[r];n[r]=s(o)?o.map(e):e(o)}return n}const c=()=>{},s=Array.isArray,i=/\/$/;function l(e,t,n="/"){let r,o={},a="",c="";const s=t.indexOf("#");let i=t.indexOf("?");return s<i&&s>=0&&(i=-1),i>-1&&(r=t.slice(0,i),a=t.slice(i+1,s>-1?s:t.length),o=e(a)),s>-1&&(r=r||t.slice(0,s),c=t.slice(s,t.length)),r=function(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/");let o,a,c=n.length-1;for(o=0;o<r.length;o++)if(a=r[o],"."!==a){if(".."!==a)break;c>1&&c--}return n.slice(0,c).join("/")+"/"+r.slice(o-(o===r.length?1:0)).join("/")}(null!=r?r:t,n),{fullPath:r+(a&&"?")+a+c,path:r,query:o,hash:c}}function u(e,t){return t&&e.toLowerCase().startsWith(t.toLowerCase())?e.slice(t.length)||"/":e}function f(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function p(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!h(e[n],t[n]))return!1;return!0}function h(e,t){return s(e)?d(e,t):s(t)?d(t,e):e===t}function d(e,t){return s(t)?e.length===t.length&&e.every(((e,n)=>e===t[n])):1===e.length&&e[0]===t}var m,g;!function(e){e.pop="pop",e.push="push"}(m||(m={})),function(e){e.back="back",e.forward="forward",e.unknown=""}(g||(g={}));function v(e){if(!e)if(n){const t=document.querySelector("base");e=(e=t&&t.getAttribute("href")||"/").replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return"/"!==e[0]&&"#"!==e[0]&&(e="/"+e),e.replace(i,"")}const y=/^[^#]+#/;function b(e,t){return e.replace(y,"#")+t}const w=()=>({left:window.pageXOffset,top:window.pageYOffset});function E(e){let t;if("el"in e){const n=e.el,r="string"==typeof n&&n.startsWith("#"),o="string"==typeof n?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o)return;t=function(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}(o,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(null!=t.left?t.left:window.pageXOffset,null!=t.top?t.top:window.pageYOffset)}function R(e,t){return(history.state?history.state.position-t:-1)+e}const O=new Map;let k=()=>location.protocol+"//"+location.host;function P(e,t){const{pathname:n,search:r,hash:o}=t,a=e.indexOf("#");if(a>-1){let t=o.includes(e.slice(a))?e.slice(a).length:1,n=o.slice(t);return"/"!==n[0]&&(n="/"+n),u(n,"")}return u(n,e)+r+o}function j(e,t,n,r=!1,o=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:o?w():null}}function C(e){const t=function(e){const{history:t,location:n}=window,r={value:P(e,n)},a={value:t.state};function c(r,o,c){const s=e.indexOf("#"),i=s>-1?(n.host&&document.querySelector("base")?e:e.slice(s))+r:k()+e+r;try{t[c?"replaceState":"pushState"](o,"",i),a.value=o}catch(e){console.error(e),n[c?"replace":"assign"](i)}}return a.value||c(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0),{location:r,state:a,push:function(e,n){const s=o({},a.value,t.state,{forward:e,scroll:w()});c(s.current,s,!0),c(e,o({},j(r.value,e,null),{position:s.position+1},n),!1),r.value=e},replace:function(e,n){c(e,o({},t.state,j(a.value.back,e,a.value.forward,!0),n,{position:a.value.position}),!0),r.value=e}}}(e=v(e)),n=function(e,t,n,r){let a=[],c=[],s=null;const i=({state:o})=>{const c=P(e,location),i=n.value,l=t.value;let u=0;if(o){if(n.value=c,t.value=o,s&&s===i)return void(s=null);u=l?o.position-l.position:0}else r(c);a.forEach((e=>{e(n.value,i,{delta:u,type:m.pop,direction:u?u>0?g.forward:g.back:g.unknown})}))};function l(){const{history:e}=window;e.state&&e.replaceState(o({},e.state,{scroll:w()}),"")}return window.addEventListener("popstate",i),window.addEventListener("beforeunload",l),{pauseListeners:function(){s=n.value},listen:function(e){a.push(e);const t=()=>{const t=a.indexOf(e);t>-1&&a.splice(t,1)};return c.push(t),t},destroy:function(){for(const e of c)e();c=[],window.removeEventListener("popstate",i),window.removeEventListener("beforeunload",l)}}}(e,t.state,t.location,t.replace);const r=o({location:"",base:e,go:function(e,t=!0){t||n.pauseListeners(),history.go(e)},createHref:b.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}function x(e){return"string"==typeof e||"symbol"==typeof e}const $={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},S=Symbol("");var A;function L(e,t){return o(new Error,{type:e,[S]:!0},t)}function M(e,t){return e instanceof Error&&S in e&&(null==t||!!(e.type&t))}e.NavigationFailureType=void 0,(A=e.NavigationFailureType||(e.NavigationFailureType={}))[A.aborted=4]="aborted",A[A.cancelled=8]="cancelled",A[A.duplicated=16]="duplicated";const q="[^/]+?",B={sensitive:!1,strict:!1,start:!0,end:!0},T=/[.+*?^${}()[\]/\\]/g;function _(e,t){let n=0;for(;n<e.length&&n<t.length;){const r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?1===e.length&&80===e[0]?-1:1:e.length>t.length?1===t.length&&80===t[0]?1:-1:0}function G(e,t){let n=0;const r=e.score,o=t.score;for(;n<r.length&&n<o.length;){const e=_(r[n],o[n]);if(e)return e;n++}if(1===Math.abs(o.length-r.length)){if(F(r))return 1;if(F(o))return-1}return o.length-r.length}function F(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const D={type:0,value:""},I=/[a-zA-Z0-9_]/;function K(e,t,n){const r=function(e,t){const n=o({},B,t),r=[];let a=n.start?"^":"";const c=[];for(const t of e){const e=t.length?[]:[90];n.strict&&!t.length&&(a+="/");for(let r=0;r<t.length;r++){const o=t[r];let s=40+(n.sensitive?.25:0);if(0===o.type)r||(a+="/"),a+=o.value.replace(T,"\\$&"),s+=40;else if(1===o.type){const{value:e,repeatable:n,optional:i,regexp:l}=o;c.push({name:e,repeatable:n,optional:i});const u=l||q;if(u!==q){s+=10;try{new RegExp(`(${u})`)}catch(t){throw new Error(`Invalid custom RegExp for param "${e}" (${u}): `+t.message)}}let f=n?`((?:${u})(?:/(?:${u}))*)`:`(${u})`;r||(f=i&&t.length<2?`(?:/${f})`:"/"+f),i&&(f+="?"),a+=f,s+=20,i&&(s+=-8),n&&(s+=-20),".*"===u&&(s+=-50)}e.push(s)}r.push(e)}if(n.strict&&n.end){const e=r.length-1;r[e][r[e].length-1]+=.7000000000000001}n.strict||(a+="/?"),n.end?a+="$":n.strict&&(a+="(?:/|$)");const i=new RegExp(a,n.sensitive?"":"i");return{re:i,score:r,keys:c,parse:function(e){const t=e.match(i),n={};if(!t)return null;for(let e=1;e<t.length;e++){const r=t[e]||"",o=c[e-1];n[o.name]=r&&o.repeatable?r.split("/"):r}return n},stringify:function(t){let n="",r=!1;for(const o of e){r&&n.endsWith("/")||(n+="/"),r=!1;for(const a of o)if(0===a.type)n+=a.value;else if(1===a.type){const{value:c,repeatable:i,optional:l}=a,u=c in t?t[c]:"";if(s(u)&&!i)throw new Error(`Provided param "${c}" is an array but it is not repeatable (* or + modifiers)`);const f=s(u)?u.join("/"):u;if(!f){if(!l)throw new Error(`Missing required param "${c}"`);o.length<2&&e.length>1&&(n.endsWith("/")?n=n.slice(0,-1):r=!0)}n+=f}}return n}}}(function(e){if(!e)return[[]];if("/"===e)return[[D]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(e){throw new Error(`ERR (${n})/"${l}": ${e}`)}let n=0,r=n;const o=[];let a;function c(){a&&o.push(a),a=[]}let s,i=0,l="",u="";function f(){l&&(0===n?a.push({type:0,value:l}):1===n||2===n||3===n?(a.length>1&&("*"===s||"+"===s)&&t(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),a.push({type:1,value:l,regexp:u,repeatable:"*"===s||"+"===s,optional:"*"===s||"?"===s})):t("Invalid state to consume buffer"),l="")}function p(){l+=s}for(;i<e.length;)if(s=e[i++],"\\"!==s||2===n)switch(n){case 0:"/"===s?(l&&f(),c()):":"===s?(f(),n=1):p();break;case 4:p(),n=r;break;case 1:"("===s?n=2:I.test(s)?p():(f(),n=0,"*"!==s&&"?"!==s&&"+"!==s&&i--);break;case 2:")"===s?"\\"==u[u.length-1]?u=u.slice(0,-1)+s:n=3:u+=s;break;case 3:f(),n=0,"*"!==s&&"?"!==s&&"+"!==s&&i--,u="";break;default:t("Unknown state")}else r=n,n=4;return 2===n&&t(`Unfinished custom RegExp for param "${l}"`),f(),c(),o}(e.path),n),a=o(r,{record:e,parent:t,children:[],alias:[]});return t&&!a.record.aliasOf==!t.record.aliasOf&&t.children.push(a),a}function U(e,t){const n=[],r=new Map;function a(e,n,r){const l=!r,u=function(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:V(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}(e);u.aliasOf=r&&r.record;const f=N(t,e),p=[u];if("alias"in e){const t="string"==typeof e.alias?[e.alias]:e.alias;for(const e of t)p.push(o({},u,{components:r?r.record.components:u.components,path:e,aliasOf:r?r.record:u}))}let h,d;for(const t of p){const{path:o}=t;if(n&&"/"!==o[0]){const e=n.record.path,r="/"===e[e.length-1]?"":"/";t.path=n.record.path+(o&&r+o)}if(h=K(t,n,f),r?r.alias.push(h):(d=d||h,d!==h&&d.alias.push(h),l&&e.name&&!H(h)&&s(e.name)),"children"in u){const e=u.children;for(let t=0;t<e.length;t++)a(e[t],h,r&&r.children[t])}r=r||h,i(h)}return d?()=>{s(d)}:c}function s(e){if(x(e)){const t=r.get(e);t&&(r.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(s),t.alias.forEach(s))}else{const t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&r.delete(e.record.name),e.children.forEach(s),e.alias.forEach(s))}}function i(e){let t=0;for(;t<n.length&&G(e,n[t])>=0&&(e.record.path!==n[t].record.path||!z(e,n[t]));)t++;n.splice(t,0,e),e.record.name&&!H(e)&&r.set(e.record.name,e)}return t=N({strict:!1,end:!0,sensitive:!1},t),e.forEach((e=>a(e))),{addRoute:a,resolve:function(e,t){let a,c,s,i={};if("name"in e&&e.name){if(a=r.get(e.name),!a)throw L(1,{location:e});s=a.record.name,i=o(function(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}(t.params,a.keys.filter((e=>!e.optional)).map((e=>e.name))),e.params),c=a.stringify(i)}else if("path"in e)c=e.path,a=n.find((e=>e.re.test(c))),a&&(i=a.parse(c),s=a.record.name);else{if(a=t.name?r.get(t.name):n.find((e=>e.re.test(t.path))),!a)throw L(1,{location:e,currentLocation:t});s=a.record.name,i=o({},t.params,e.params),c=a.stringify(i)}const l=[];let u=a;for(;u;)l.unshift(u.record),u=u.parent;return{name:s,path:c,params:i,matched:l,meta:W(l)}},removeRoute:s,getRoutes:function(){return n},getRecordMatcher:function(e){return r.get(e)}}}function V(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]="boolean"==typeof n?n:n[r];return t}function H(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function W(e){return e.reduce(((e,t)=>o(e,t.meta)),{})}function N(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}function z(e,t){return t.children.some((t=>t===e||z(e,t)))}const Q=/#/g,X=/&/g,Y=/\//g,Z=/=/g,J=/\?/g,ee=/\+/g,te=/%5B/g,ne=/%5D/g,re=/%5E/g,oe=/%60/g,ae=/%7B/g,ce=/%7C/g,se=/%7D/g,ie=/%20/g;function le(e){return encodeURI(""+e).replace(ce,"|").replace(te,"[").replace(ne,"]")}function ue(e){return le(e).replace(ee,"%2B").replace(ie,"+").replace(Q,"%23").replace(X,"%26").replace(oe,"`").replace(ae,"{").replace(se,"}").replace(re,"^")}function fe(e){return null==e?"":function(e){return le(e).replace(Q,"%23").replace(J,"%3F")}(e).replace(Y,"%2F")}function pe(e){try{return decodeURIComponent(""+e)}catch(e){}return""+e}function he(e){const t={};if(""===e||"?"===e)return t;const n=("?"===e[0]?e.slice(1):e).split("&");for(let e=0;e<n.length;++e){const r=n[e].replace(ee," "),o=r.indexOf("="),a=pe(o<0?r:r.slice(0,o)),c=o<0?null:pe(r.slice(o+1));if(a in t){let e=t[a];s(e)||(e=t[a]=[e]),e.push(c)}else t[a]=c}return t}function de(e){let t="";for(let n in e){const r=e[n];if(n=ue(n).replace(Z,"%3D"),null==r){void 0!==r&&(t+=(t.length?"&":"")+n);continue}(s(r)?r.map((e=>e&&ue(e))):[r&&ue(r)]).forEach((e=>{void 0!==e&&(t+=(t.length?"&":"")+n,null!=e&&(t+="="+e))}))}return t}function me(e){const t={};for(const n in e){const r=e[n];void 0!==r&&(t[n]=s(r)?r.map((e=>null==e?null:""+e)):null==r?r:""+r)}return t}const ge=Symbol(""),ve=Symbol(""),ye=Symbol(""),be=Symbol(""),we=Symbol("");function Ee(){let e=[];return{add:function(t){return e.push(t),()=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)}},list:()=>e,reset:function(){e=[]}}}function Re(e,n,r){const o=()=>{e[n].delete(r)};t.onUnmounted(o),t.onDeactivated(o),t.onActivated((()=>{e[n].add(r)})),e[n].add(r)}function Oe(e,t,n,r,o){const a=r&&(r.enterCallbacks[o]=r.enterCallbacks[o]||[]);return()=>new Promise(((c,s)=>{const i=e=>{var i;!1===e?s(L(4,{from:n,to:t})):e instanceof Error?s(e):"string"==typeof(i=e)||i&&"object"==typeof i?s(L(2,{from:t,to:e})):(a&&r.enterCallbacks[o]===a&&"function"==typeof e&&a.push(e),c())},l=e.call(r&&r.instances[o],t,n,i);let u=Promise.resolve(l);e.length<3&&(u=u.then(i)),u.catch((e=>s(e)))}))}function ke(e,t,n,o){const a=[];for(const s of e)for(const e in s.components){let i=s.components[e];if("beforeRouteEnter"===t||s.instances[e])if("object"==typeof(c=i)||"displayName"in c||"props"in c||"__vccOpts"in c){const r=(i.__vccOpts||i)[t];r&&a.push(Oe(r,n,o,s,e))}else{let c=i();a.push((()=>c.then((a=>{if(!a)return Promise.reject(new Error(`Couldn't resolve component "${e}" at "${s.path}"`));const c=r(a)?a.default:a;s.components[e]=c;const i=(c.__vccOpts||c)[t];return i&&Oe(i,n,o,s,e)()}))))}}var c;return a}function Pe(e){const n=t.inject(ye),r=t.inject(be),o=t.computed((()=>n.resolve(t.unref(e.to)))),a=t.computed((()=>{const{matched:e}=o.value,{length:t}=e,n=e[t-1],a=r.matched;if(!n||!a.length)return-1;const c=a.findIndex(f.bind(null,n));if(c>-1)return c;const s=Ce(e[t-2]);return t>1&&Ce(n)===s&&a[a.length-1].path!==s?a.findIndex(f.bind(null,e[t-2])):c})),i=t.computed((()=>a.value>-1&&function(e,t){for(const n in t){const r=t[n],o=e[n];if("string"==typeof r){if(r!==o)return!1}else if(!s(o)||o.length!==r.length||r.some(((e,t)=>e!==o[t])))return!1}return!0}(r.params,o.value.params))),l=t.computed((()=>a.value>-1&&a.value===r.matched.length-1&&p(r.params,o.value.params)));return{route:o,href:t.computed((()=>o.value.href)),isActive:i,isExactActive:l,navigate:function(r={}){return function(e){if(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)return;if(e.defaultPrevented)return;if(void 0!==e.button&&0!==e.button)return;if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}e.preventDefault&&e.preventDefault();return!0}(r)?n[t.unref(e.replace)?"replace":"push"](t.unref(e.to)).catch(c):Promise.resolve()}}}const je=t.defineComponent({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Pe,setup(e,{slots:n}){const r=t.reactive(Pe(e)),{options:o}=t.inject(ye),a=t.computed((()=>({[xe(e.activeClass,o.linkActiveClass,"router-link-active")]:r.isActive,[xe(e.exactActiveClass,o.linkExactActiveClass,"router-link-exact-active")]:r.isExactActive})));return()=>{const o=n.default&&n.default(r);return e.custom?o:t.h("a",{"aria-current":r.isExactActive?e.ariaCurrentValue:null,href:r.href,onClick:r.navigate,class:a.value},o)}}});function Ce(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const xe=(e,t,n)=>null!=e?e:null!=t?t:n;function $e(e,t){if(!e)return null;const n=e(t);return 1===n.length?n[0]:n}const Se=t.defineComponent({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:n,slots:r}){const a=t.inject(we),c=t.computed((()=>e.route||a.value)),s=t.inject(ve,0),i=t.computed((()=>{let e=t.unref(s);const{matched:n}=c.value;let r;for(;(r=n[e])&&!r.components;)e++;return e})),l=t.computed((()=>c.value.matched[i.value]));t.provide(ve,t.computed((()=>i.value+1))),t.provide(ge,l),t.provide(we,c);const u=t.ref();return t.watch((()=>[u.value,l.value,e.name]),(([e,t,n],[r,o,a])=>{t&&(t.instances[n]=e,o&&o!==t&&e&&e===r&&(t.leaveGuards.size||(t.leaveGuards=o.leaveGuards),t.updateGuards.size||(t.updateGuards=o.updateGuards))),!e||!t||o&&f(t,o)&&r||(t.enterCallbacks[n]||[]).forEach((t=>t(e)))}),{flush:"post"}),()=>{const a=c.value,s=l.value,i=s&&s.components[e.name],f=e.name;if(!i)return $e(r.default,{Component:i,route:a});const p=s.props[e.name],h=p?!0===p?a.params:"function"==typeof p?p(a):p:null,d=t.h(i,o({},h,n,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(s.instances[f]=null)},ref:u}));return $e(r.default,{Component:d,route:a})||d}}});function Ae(e){return e.reduce(((e,t)=>e.then((()=>t()))),Promise.resolve())}return e.RouterLink=je,e.RouterView=Se,e.START_LOCATION=$,e.createMemoryHistory=function(e=""){let t=[],n=[""],r=0;function o(e){r++,r===n.length||n.splice(r),n.push(e)}const a={location:"",state:{},base:e=v(e),createHref:b.bind(null,e),replace(e){n.splice(r--,1),o(e)},push(e,t){o(e)},listen:e=>(t.push(e),()=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)}),destroy(){t=[],n=[""],r=0},go(e,o=!0){const a=this.location,c=e<0?g.back:g.forward;r=Math.max(0,Math.min(r+e,n.length-1)),o&&function(e,n,{direction:r,delta:o}){const a={direction:r,delta:o,type:m.pop};for(const r of t)r(e,n,a)}(this.location,a,{direction:c,delta:e})}};return Object.defineProperty(a,"location",{enumerable:!0,get:()=>n[r]}),a},e.createRouter=function(e){const r=U(e.routes,e),i=e.parseQuery||he,u=e.stringifyQuery||de,h=e.history,d=Ee(),g=Ee(),v=Ee(),y=t.shallowRef($);let b=$;n&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const k=a.bind(null,(e=>""+e)),P=a.bind(null,fe),j=a.bind(null,pe);function C(e,t){if(t=o({},t||y.value),"string"==typeof e){const n=l(i,e,t.path),a=r.resolve({path:n.path},t),c=h.createHref(n.fullPath);return o(n,a,{params:j(a.params),hash:pe(n.hash),redirectedFrom:void 0,href:c})}let n;if("path"in e)n=o({},e,{path:l(i,e.path,t.path).path});else{const r=o({},e.params);for(const e in r)null==r[e]&&delete r[e];n=o({},e,{params:P(e.params)}),t.params=P(t.params)}const a=r.resolve(n,t),c=e.hash||"";a.params=k(j(a.params));const s=function(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}(u,o({},e,{hash:(f=c,le(f).replace(ae,"{").replace(se,"}").replace(re,"^")),path:a.path}));var f;const p=h.createHref(s);return o({fullPath:s,hash:c,query:u===de?me(e.query):e.query||{}},a,{redirectedFrom:void 0,href:p})}function S(e){return"string"==typeof e?l(i,e,y.value.path):o({},e)}function A(e,t){if(b!==e)return L(8,{from:t,to:e})}function q(e){return T(e)}function B(e){const t=e.matched[e.matched.length-1];if(t&&t.redirect){const{redirect:n}=t;let r="function"==typeof n?n(e):n;return"string"==typeof r&&(r=r.includes("?")||r.includes("#")?r=S(r):{path:r},r.params={}),o({query:e.query,hash:e.hash,params:"path"in r?{}:e.params},r)}}function T(e,t){const n=b=C(e),r=y.value,a=e.state,c=e.force,s=!0===e.replace,i=B(n);if(i)return T(o(S(i),{state:a,force:c,replace:s}),t||n);const l=n;let h;return l.redirectedFrom=t,!c&&function(e,t,n){const r=t.matched.length-1,o=n.matched.length-1;return r>-1&&r===o&&f(t.matched[r],n.matched[o])&&p(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}(u,r,n)&&(h=L(16,{to:l,from:r}),Q(r,r,!0,!1)),(h?Promise.resolve(h):G(l,r)).catch((e=>M(e)?M(e,2)?e:z(e):N(e,l,r))).then((e=>{if(e){if(M(e,2))return T(o(S(e.to),{state:a,force:c,replace:s}),t||l)}else e=D(l,r,!0,s,a);return F(l,r,e),e}))}function _(e,t){const n=A(e,t);return n?Promise.reject(n):Promise.resolve()}function G(e,t){let n;const[r,o,a]=function(e,t){const n=[],r=[],o=[],a=Math.max(t.matched.length,e.matched.length);for(let c=0;c<a;c++){const a=t.matched[c];a&&(e.matched.find((e=>f(e,a)))?r.push(a):n.push(a));const s=e.matched[c];s&&(t.matched.find((e=>f(e,s)))||o.push(s))}return[n,r,o]}(e,t);n=ke(r.reverse(),"beforeRouteLeave",e,t);for(const o of r)o.leaveGuards.forEach((r=>{n.push(Oe(r,e,t))}));const c=_.bind(null,e,t);return n.push(c),Ae(n).then((()=>{n=[];for(const r of d.list())n.push(Oe(r,e,t));return n.push(c),Ae(n)})).then((()=>{n=ke(o,"beforeRouteUpdate",e,t);for(const r of o)r.updateGuards.forEach((r=>{n.push(Oe(r,e,t))}));return n.push(c),Ae(n)})).then((()=>{n=[];for(const r of e.matched)if(r.beforeEnter&&!t.matched.includes(r))if(s(r.beforeEnter))for(const o of r.beforeEnter)n.push(Oe(o,e,t));else n.push(Oe(r.beforeEnter,e,t));return n.push(c),Ae(n)})).then((()=>(e.matched.forEach((e=>e.enterCallbacks={})),n=ke(a,"beforeRouteEnter",e,t),n.push(c),Ae(n)))).then((()=>{n=[];for(const r of g.list())n.push(Oe(r,e,t));return n.push(c),Ae(n)})).catch((e=>M(e,8)?e:Promise.reject(e)))}function F(e,t,n){for(const r of v.list())r(e,t,n)}function D(e,t,r,a,c){const s=A(e,t);if(s)return s;const i=t===$,l=n?history.state:{};r&&(a||i?h.replace(e.fullPath,o({scroll:i&&l&&l.scroll},c)):h.push(e.fullPath,c)),y.value=e,Q(e,t,r,i),z()}let I;function K(){I||(I=h.listen(((e,t,r)=>{if(!J.listening)return;const a=C(e),s=B(a);if(s)return void T(o(s,{replace:!0}),a).catch(c);b=a;const i=y.value;var l,u;n&&(l=R(i.fullPath,r.delta),u=w(),O.set(l,u)),G(a,i).catch((e=>M(e,12)?e:M(e,2)?(T(e.to,a).then((e=>{M(e,20)&&!r.delta&&r.type===m.pop&&h.go(-1,!1)})).catch(c),Promise.reject()):(r.delta&&h.go(-r.delta,!1),N(e,a,i)))).then((e=>{(e=e||D(a,i,!1))&&(r.delta?h.go(-r.delta,!1):r.type===m.pop&&M(e,20)&&h.go(-1,!1)),F(a,i,e)})).catch(c)})))}let V,H=Ee(),W=Ee();function N(e,t,n){z(e);const r=W.list();return r.length?r.forEach((r=>r(e,t,n))):console.error(e),Promise.reject(e)}function z(e){return V||(V=!e,K(),H.list().forEach((([t,n])=>e?n(e):t())),H.reset()),e}function Q(r,o,a,c){const{scrollBehavior:s}=e;if(!n||!s)return Promise.resolve();const i=!a&&function(e){const t=O.get(e);return O.delete(e),t}(R(r.fullPath,0))||(c||!a)&&history.state&&history.state.scroll||null;return t.nextTick().then((()=>s(r,o,i))).then((e=>e&&E(e))).catch((e=>N(e,r,o)))}const X=e=>h.go(e);let Y;const Z=new Set,J={currentRoute:y,listening:!0,addRoute:function(e,t){let n,o;return x(e)?(n=r.getRecordMatcher(e),o=t):o=e,r.addRoute(o,n)},removeRoute:function(e){const t=r.getRecordMatcher(e);t&&r.removeRoute(t)},hasRoute:function(e){return!!r.getRecordMatcher(e)},getRoutes:function(){return r.getRoutes().map((e=>e.record))},resolve:C,options:e,push:q,replace:function(e){return q(o(S(e),{replace:!0}))},go:X,back:()=>X(-1),forward:()=>X(1),beforeEach:d.add,beforeResolve:g.add,afterEach:v.add,onError:W.add,isReady:function(){return V&&y.value!==$?Promise.resolve():new Promise(((e,t)=>{H.add([e,t])}))},install(e){e.component("RouterLink",je),e.component("RouterView",Se),e.config.globalProperties.$router=this,Object.defineProperty(e.config.globalProperties,"$route",{enumerable:!0,get:()=>t.unref(y)}),n&&!Y&&y.value===$&&(Y=!0,q(h.location).catch((e=>{})));const r={};for(const e in $)r[e]=t.computed((()=>y.value[e]));e.provide(ye,this),e.provide(be,t.reactive(r)),e.provide(we,y);const o=e.unmount;Z.add(e),e.unmount=function(){Z.delete(e),Z.size<1&&(b=$,I&&I(),I=null,y.value=$,Y=!1,V=!1),o()}}};return J},e.createRouterMatcher=U,e.createWebHashHistory=function(e){return(e=location.host?e||location.pathname+location.search:"").includes("#")||(e+="#"),C(e)},e.createWebHistory=C,e.isNavigationFailure=M,e.loadRouteLocation=function(e){return e.matched.every((e=>e.redirect))?Promise.reject(new Error("Cannot load a route that redirects.")):Promise.all(e.matched.map((e=>e.components&&Promise.all(Object.keys(e.components).reduce(((t,n)=>{const o=e.components[n];return"function"!=typeof o||"displayName"in o||t.push(o().then((t=>{if(!t)return Promise.reject(new Error(`Couldn't resolve component "${n}" at "${e.path}". Ensure you passed a function that returns a promise.`));const o=r(t)?t.default:t;e.components[n]=o}))),t}),[]))))).then((()=>e))},e.matchedRouteKey=ge,e.onBeforeRouteLeave=function(e){const n=t.inject(ge,{}).value;n&&Re(n,"leaveGuards",e)},e.onBeforeRouteUpdate=function(e){const n=t.inject(ge,{}).value;n&&Re(n,"updateGuards",e)},e.parseQuery=he,e.routeLocationKey=be,e.routerKey=ye,e.routerViewLocationKey=we,e.stringifyQuery=de,e.useLink=Pe,e.useRoute=function(){return t.inject(be)},e.useRouter=function(){return t.inject(ye)},e.viewDepthKey=ve,Object.defineProperty(e,"__esModule",{value:!0}),e}({},Vue);
{
"name": "vue-router",
"version": "4.1.0-4da5e55",
"version": "4.1.0-51021cc",
"main": "index.js",

@@ -51,3 +51,2 @@ "unpkg": "dist/vue-router.global.js",

"dev": "vite --config playground/vite.config.js",
"release": "bash scripts/release.sh",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1",

@@ -58,32 +57,15 @@ "build": "rimraf dist && rollup -c rollup.config.js",

"build:e2e": "vue-tsc --noEmit && vite build --config e2e/vite.config.js",
"build:size": "yarn run build && rollup -c size-checks/rollup.config.js",
"build:size": "pnpm run build && rollup -c size-checks/rollup.config.js",
"dev:e2e": "vite --config e2e/vite.config.js",
"docs": "vitepress dev docs",
"docs:build": "vitepress build docs",
"lint": "yarn run lint:script && yarn run lint:html",
"lint:script": "prettier -c --parser typescript \"{src,__tests__,e2e,playground}/**/*.[jt]s?(x)\"",
"lint:html": "prettier -c --parser html \"{playground,e2e}/**/*.html\"",
"lint:fix": "yarn run lint:script --write && yarn run lint:html --write",
"test:types": "tsc --build tsconfig.json",
"test:dts": "tsc -p ./test-dts/tsconfig.json",
"test:unit": "jest --coverage",
"test": "yarn run test:types && yarn run test:unit && yarn run build && yarn run build:dts && yarn run test:e2e",
"test:e2e": "yarn run test:e2e:headless && yarn run test:e2e:native",
"test:e2e:headless": "node e2e/runner.js -e chrome-headless --skiptags no-headless",
"test:e2e:native": "node e2e/runner.js -e chrome --tag no-headless",
"test:e2e:ci": "node e2e/runner.js -e firefox --retries 2",
"test:e2e:bs": "node e2e/runner.js --local -e edge_pre_chrome,android44 -c e2e/nightwatch.browserstack.js --tag browserstack"
"test": "pnpm run test:types && pnpm run test:unit && pnpm run build && pnpm run build:dts && pnpm run test:e2e",
"test:e2e": "pnpm run test:e2e:headless",
"test:e2e:headless": "node e2e/runner.js --env chrome-headless",
"test:e2e:native": "node e2e/runner.js --env chrome",
"test:e2e:ci": "node e2e/runner.js --env chrome-headless --retries 2",
"test:e2e:bs": "node e2e/runner.js --local -e android5 --tag browserstack",
"test:e2e:bs-test": "node e2e/runner.js --local --env browserstack.local_chrome --tag browserstack"
},
"gitHooks": {
"pre-commit": "lint-staged",
"commit-msg": "node scripts/verifyCommit.js"
},
"lint-staged": {
"*.js": [
"prettier --write"
],
"*.ts?(x)": [
"prettier --parser=typescript --write"
]
},
"peerDependencies": {

@@ -102,3 +84,3 @@ "vue": "^3.2.0"

"@rollup/plugin-alias": "^3.1.4",
"@rollup/plugin-commonjs": "^21.0.2",
"@rollup/plugin-commonjs": "^22.0.0",
"@rollup/plugin-node-resolve": "^13.0.5",

@@ -109,25 +91,18 @@ "@rollup/plugin-replace": "^4.0.0",

"@types/jsdom": "^16.2.13",
"@types/webpack": "^5.28.0",
"@types/webpack-env": "^1.16.2",
"@vitejs/plugin-vue": "^2.2.2",
"@types/nightwatch": "^2.0.8",
"@vitejs/plugin-vue": "^2.3.3",
"@vue/compiler-sfc": "^3.2.31",
"@vue/server-renderer": "^3.2.31",
"@vue/test-utils": "^2.0.0-rc.3",
"axios": "^0.26.0",
"brotli": "^1.3.2",
"@vue/server-renderer": "^3.2.37",
"@vue/test-utils": "^2.0.0",
"browserstack-local": "^1.4.5",
"chalk": "^4.1.0",
"chromedriver": "^97.0.4",
"chromedriver": "^102.0.0",
"connect-history-api-fallback": "^1.6.0",
"conventional-changelog-cli": "^2.1.1",
"css-loader": "^6.3.0",
"dotenv": "^16.0.0",
"faked-promise": "^2.2.2",
"html-webpack-plugin": "^5.3.2",
"geckodriver": "^3.0.1",
"jest": "^27.5.1",
"jest-mock-warn": "^1.1.0",
"lint-staged": "^12.3.4",
"nightwatch": "^1.7.11",
"nightwatch": "^2.0.0",
"nightwatch-helpers": "^1.2.0",
"prettier": "^2.4.1",
"rimraf": "^3.0.2",

@@ -137,12 +112,7 @@ "rollup": "^2.68.0",

"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.31.0",
"selenium-server": "^3.141.59",
"serve-handler": "^6.1.3",
"typescript": "~4.4.3",
"vite": "~2.8.4",
"vitepress": "^0.20.0",
"vue": "^3.2.31",
"vue-tsc": "^0.32.0",
"yorkie": "^2.0.0"
"rollup-plugin-typescript2": "^0.32.1",
"typescript": "~4.7.2",
"vite": "^2.9.9",
"vue": "^3.2.37"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc