Socket
Socket
Sign inDemoInstall

@tanstack/router-core

Package Overview
Dependencies
Maintainers
1
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tanstack/router-core - npm Package Compare versions

Comparing version 0.0.1-alpha.3 to 0.0.1-alpha.4

build/cjs/node_modules/tiny-invariant/dist/esm/tiny-invariant.js

124

build/cjs/packages/router-core/src/index.js

@@ -17,5 +17,6 @@ /**

var index = require('../../../node_modules/history/index.js');
var tinyInvariant = require('../../../node_modules/tiny-invariant/dist/esm/tiny-invariant.js');
var qss = require('./qss.js');
const createRouteConfig = function createRouteConfig(options, children, isRoot, parentId) {
const createRouteConfig = function createRouteConfig(options, children, isRoot, parentId, parentPath) {
if (options === void 0) {

@@ -31,4 +32,2 @@ options = {};

options.path = rootRouteId;
} else {
warning(!options.path, 'Routes must have a path property.');
} // Strip the root from parentIds

@@ -41,9 +40,10 @@

let path = String(isRoot ? rootRouteId : options.path); // If the path is anything other than an index path, trim it up
let path = isRoot ? rootRouteId : options.path; // If the path is anything other than an index path, trim it up
if (path !== '/') {
if (path && path !== '/') {
path = trimPath(path);
}
let id = joinPaths([parentId, path]);
const routeId = path || options.id;
let id = joinPaths([parentId, routeId]);

@@ -58,5 +58,6 @@ if (path === rootRouteId) {

const fullPath = id === rootRouteId ? '/' : trimPathRight(id);
const fullPath = id === rootRouteId ? '/' : trimPathRight(joinPaths([parentPath, path]));
return {
id: id,
routeId: routeId,
path: path,

@@ -66,3 +67,3 @@ fullPath: fullPath,

children,
addChildren: cb => createRouteConfig(options, cb(childOptions => createRouteConfig(childOptions, undefined, false, id)), false, parentId)
addChildren: cb => createRouteConfig(options, cb(childOptions => createRouteConfig(childOptions, undefined, false, id, fullPath)), false, parentId, parentPath)
};

@@ -443,51 +444,72 @@ };

const recurse = async (routes, parentMatch) => {
var _parentMatch$params, _router$options$filte, _router$preloadCache$, _route$childRoutes2;
const recurse = async routes => {
var _parentMatch$params, _router$options$filte, _foundRoute$childRout;
const parentMatch = last(matches);
let params = (_parentMatch$params = parentMatch == null ? void 0 : parentMatch.params) != null ? _parentMatch$params : {};
const filteredRoutes = (_router$options$filte = router.options.filterRoutes == null ? void 0 : router.options.filterRoutes(routes)) != null ? _router$options$filte : routes;
const route = filteredRoutes == null ? void 0 : filteredRoutes.find(route => {
var _route$childRoutes, _route$options$caseSe;
let foundRoutes = [];
const fuzzy = !!(route.routePath !== '/' || (_route$childRoutes = route.childRoutes) != null && _route$childRoutes.length);
const matchParams = matchPathname(pathname, {
to: route.fullPath,
fuzzy,
caseSensitive: (_route$options$caseSe = route.options.caseSensitive) != null ? _route$options$caseSe : router.options.caseSensitive
});
const findMatchInRoutes = (parentRoutes, routes) => {
routes.some(route => {
var _route$childRoutes, _route$childRoutes2, _route$options$caseSe;
if (matchParams) {
let parsedParams;
if (!route.routePath && (_route$childRoutes = route.childRoutes) != null && _route$childRoutes.length) {
return findMatchInRoutes([...foundRoutes, route], route.childRoutes);
}
try {
var _route$options$parseP;
const fuzzy = !!(route.routePath !== '/' || (_route$childRoutes2 = route.childRoutes) != null && _route$childRoutes2.length);
const matchParams = matchPathname(pathname, {
to: route.fullPath,
fuzzy,
caseSensitive: (_route$options$caseSe = route.options.caseSensitive) != null ? _route$options$caseSe : router.options.caseSensitive
});
parsedParams = (_route$options$parseP = route.options.parseParams == null ? void 0 : route.options.parseParams(matchParams)) != null ? _route$options$parseP : matchParams;
} catch (err) {
if (opts != null && opts.strictParseParams) {
throw err;
if (matchParams) {
let parsedParams;
try {
var _route$options$parseP;
parsedParams = (_route$options$parseP = route.options.parseParams == null ? void 0 : route.options.parseParams(matchParams)) != null ? _route$options$parseP : matchParams;
} catch (err) {
if (opts != null && opts.strictParseParams) {
throw err;
}
}
params = _rollupPluginBabelHelpers["extends"]({}, params, parsedParams);
}
params = _rollupPluginBabelHelpers["extends"]({}, params, parsedParams);
}
if (!!matchParams) {
foundRoutes = [...parentRoutes, route];
}
return !!matchParams;
});
return !!foundRoutes.length;
});
return !!foundRoutes.length;
};
if (!route) {
findMatchInRoutes([], filteredRoutes);
if (!foundRoutes.length) {
return;
}
const interpolatedPath = interpolatePath(route.routePath, params);
const matchId = interpolatePath(route.routeId, params, true);
const match = existingMatches.find(d => d.matchId === matchId) || ((_router$preloadCache$ = router.preloadCache[matchId]) == null ? void 0 : _router$preloadCache$.match) || createRouteMatch(router, route, {
matchId,
params,
pathname: joinPaths([pathname, interpolatedPath])
foundRoutes.forEach(foundRoute => {
var _router$preloadCache$;
const interpolatedPath = interpolatePath(foundRoute.routePath, params);
const matchId = interpolatePath(foundRoute.routeId, params, true);
const match = existingMatches.find(d => d.matchId === matchId) || ((_router$preloadCache$ = router.preloadCache[matchId]) == null ? void 0 : _router$preloadCache$.match) || createRouteMatch(router, foundRoute, {
matchId,
params,
pathname: joinPaths([pathname, interpolatedPath])
});
matches.push(match);
});
matches.push(match);
const foundRoute = last(foundRoutes);
if ((_route$childRoutes2 = route.childRoutes) != null && _route$childRoutes2.length) {
recurse(route.childRoutes, match);
if ((_foundRoute$childRout = foundRoute.childRoutes) != null && _foundRoute$childRout.length) {
recurse(foundRoute.childRoutes);
}

@@ -596,10 +618,3 @@ };

if (isExternal) {
if (process.env.NODE_ENV !== 'production') {
throw new Error('Attempting to navigate to external url with router.navigate!');
}
return;
}
tinyInvariant["default"](!isExternal, 'Attempting to navigate to external url with router.navigate!');
return router._navigate({

@@ -759,3 +774,4 @@ from: fromString,

const {
id: routeId,
id,
routeId,
path: routePath,

@@ -765,4 +781,4 @@ fullPath

const action = router.state.actions[routeId] || (() => {
router.state.actions[routeId] = {
const action = router.state.actions[id] || (() => {
router.state.actions[id] = {
pending: [],

@@ -818,7 +834,8 @@ submit: async (submission, actionOpts) => {

};
return router.state.actions[routeId];
return router.state.actions[id];
})();
let route = {
routeId,
routeId: id,
routeRouteId: routeId,
routePath,

@@ -1437,2 +1454,3 @@ fullPath,

exports.createMemoryHistory = index.createMemoryHistory;
exports.invariant = tinyInvariant["default"];
exports.createRoute = createRoute;

@@ -1439,0 +1457,0 @@ exports.createRouteConfig = createRouteConfig;

@@ -10,3 +10,3 @@ {

{
"uid": "b6e9-11",
"uid": "c4e0-13",
"name": "\u0000rollupPluginBabelHelpers.js"

@@ -19,7 +19,11 @@ },

"name": "@babel/runtime/helpers/esm/extends.js",
"uid": "b6e9-13"
"uid": "c4e0-15"
},
{
"name": "history/index.js",
"uid": "b6e9-15"
"uid": "c4e0-17"
},
{
"name": "tiny-invariant/dist/esm/tiny-invariant.js",
"uid": "c4e0-19"
}

@@ -32,7 +36,7 @@ ]

{
"uid": "b6e9-17",
"uid": "c4e0-21",
"name": "qss.ts"
},
{
"uid": "b6e9-19",
"uid": "c4e0-23",
"name": "index.ts"

@@ -48,38 +52,44 @@ }

"nodeParts": {
"b6e9-11": {
"c4e0-13": {
"renderedLength": 437,
"gzipLength": 243,
"brotliLength": 0,
"mainUid": "b6e9-10"
"mainUid": "c4e0-12"
},
"b6e9-13": {
"c4e0-15": {
"renderedLength": 431,
"gzipLength": 240,
"brotliLength": 0,
"mainUid": "b6e9-12"
"mainUid": "c4e0-14"
},
"b6e9-15": {
"c4e0-17": {
"renderedLength": 20618,
"gzipLength": 3797,
"brotliLength": 0,
"mainUid": "b6e9-14"
"mainUid": "c4e0-16"
},
"b6e9-17": {
"c4e0-19": {
"renderedLength": 181,
"gzipLength": 129,
"brotliLength": 0,
"mainUid": "c4e0-18"
},
"c4e0-21": {
"renderedLength": 1241,
"gzipLength": 523,
"brotliLength": 0,
"mainUid": "b6e9-16"
"mainUid": "c4e0-20"
},
"b6e9-19": {
"renderedLength": 45660,
"gzipLength": 10084,
"c4e0-23": {
"renderedLength": 46465,
"gzipLength": 10249,
"brotliLength": 0,
"mainUid": "b6e9-18"
"mainUid": "c4e0-22"
}
},
"nodeMetas": {
"b6e9-10": {
"c4e0-12": {
"id": "\u0000rollupPluginBabelHelpers.js",
"moduleParts": {
"index.production.js": "b6e9-11"
"index.production.js": "c4e0-13"
},

@@ -89,10 +99,10 @@ "imported": [],

{
"uid": "b6e9-18"
"uid": "c4e0-22"
}
]
},
"b6e9-12": {
"c4e0-14": {
"id": "/node_modules/@babel/runtime/helpers/esm/extends.js",
"moduleParts": {
"index.production.js": "b6e9-13"
"index.production.js": "c4e0-15"
},

@@ -102,14 +112,14 @@ "imported": [],

{
"uid": "b6e9-14"
"uid": "c4e0-16"
}
]
},
"b6e9-14": {
"c4e0-16": {
"id": "/node_modules/history/index.js",
"moduleParts": {
"index.production.js": "b6e9-15"
"index.production.js": "c4e0-17"
},
"imported": [
{
"uid": "b6e9-12"
"uid": "c4e0-14"
}

@@ -119,10 +129,22 @@ ],

{
"uid": "b6e9-18"
"uid": "c4e0-22"
}
]
},
"b6e9-16": {
"c4e0-18": {
"id": "/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
"moduleParts": {
"index.production.js": "c4e0-19"
},
"imported": [],
"importedBy": [
{
"uid": "c4e0-22"
}
]
},
"c4e0-20": {
"id": "/packages/router-core/src/qss.ts",
"moduleParts": {
"index.production.js": "b6e9-17"
"index.production.js": "c4e0-21"
},

@@ -132,20 +154,23 @@ "imported": [],

{
"uid": "b6e9-18"
"uid": "c4e0-22"
}
]
},
"b6e9-18": {
"c4e0-22": {
"id": "/packages/router-core/src/index.ts",
"moduleParts": {
"index.production.js": "b6e9-19"
"index.production.js": "c4e0-23"
},
"imported": [
{
"uid": "b6e9-10"
"uid": "c4e0-12"
},
{
"uid": "b6e9-14"
"uid": "c4e0-16"
},
{
"uid": "b6e9-16"
"uid": "c4e0-18"
},
{
"uid": "c4e0-20"
}

@@ -152,0 +177,0 @@ ],

@@ -13,2 +13,3 @@ /**

export { createBrowserHistory, createHashHistory, createMemoryHistory } from 'history';
export { default as invariant } from 'tiny-invariant';

@@ -34,20 +35,21 @@ declare type NoInfer<T> = [T][T extends any ? 0 : never];

}
interface RouteConfig<TId extends string = string, TPath extends string = string, TFullPath extends string = string, TRouteLoaderData extends AnyLoaderData = AnyLoaderData, TLoaderData extends AnyLoaderData = AnyLoaderData, TActionPayload = unknown, TActionResponse = unknown, TParentSearchSchema extends {} = {}, TSearchSchema extends AnySearchSchema = {}, TFullSearchSchema extends AnySearchSchema = {}, TParentParams extends AnyPathParams = {}, TParams extends Record<ParsePathParams<TPath>, unknown> = Record<ParsePathParams<TPath>, string>, TAllParams extends AnyPathParams = {}, TKnownChildren = unknown> {
interface RouteConfig<TId extends string = string, TRouteId extends string = string, TPath extends string = string, TFullPath extends string = string, TRouteLoaderData extends AnyLoaderData = AnyLoaderData, TLoaderData extends AnyLoaderData = AnyLoaderData, TActionPayload = unknown, TActionResponse = unknown, TParentSearchSchema extends {} = {}, TSearchSchema extends AnySearchSchema = {}, TFullSearchSchema extends AnySearchSchema = {}, TParentParams extends AnyPathParams = {}, TParams extends Record<ParsePathParams<TPath>, unknown> = Record<ParsePathParams<TPath>, string>, TAllParams extends AnyPathParams = {}, TKnownChildren = unknown> {
id: TId;
routeId: TRouteId;
path: NoInfer<TPath>;
fullPath: TFullPath;
options: RouteOptions<TPath, TRouteLoaderData, TLoaderData, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, TFullSearchSchema, TParentParams, TParams, TAllParams>;
options: RouteOptions<TRouteId, TPath, TRouteLoaderData, TLoaderData, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, TFullSearchSchema, TParentParams, TParams, TAllParams>;
children?: TKnownChildren;
addChildren: IsAny<TId, any, <TNewChildren extends any>(cb: (createChildRoute: CreateRouteConfigFn<false, TId, TLoaderData, TFullSearchSchema, TAllParams>) => TNewChildren extends AnyRouteConfig[] ? TNewChildren : {
addChildren: IsAny<TId, any, <TNewChildren extends any>(cb: (createChildRoute: CreateRouteConfigFn<false, TId, TFullPath, TLoaderData, TFullSearchSchema, TAllParams>) => TNewChildren extends AnyRouteConfig[] ? TNewChildren : {
error: 'Invalid route detected';
route: TNewChildren;
}) => RouteConfig<TId, TPath, TFullPath, TRouteLoaderData, TLoaderData, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, TFullSearchSchema, TParentParams, TParams, TAllParams, TNewChildren>>;
}) => RouteConfig<TId, TRouteId, TPath, TFullPath, TRouteLoaderData, TLoaderData, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, TFullSearchSchema, TParentParams, TParams, TAllParams, TNewChildren>>;
}
declare type CreateRouteConfigFn<TIsRoot extends boolean = false, TParentId extends string = string, TParentAllLoaderData extends AnyLoaderData = {}, TParentSearchSchema extends AnySearchSchema = {}, TParentParams extends AnyPathParams = {}> = <TPath extends string, TRouteLoaderData extends AnyLoaderData, TActionPayload, TActionResponse, TSearchSchema extends AnySearchSchema = AnySearchSchema, TParams extends Record<ParsePathParams<TPath>, unknown> = Record<ParsePathParams<TPath>, string>, TAllParams extends AnyPathParams extends TParams ? Record<ParsePathParams<TPath>, string> : NoInfer<TParams> = AnyPathParams extends TParams ? Record<ParsePathParams<TPath>, string> : NoInfer<TParams>, TKnownChildren extends RouteConfig[] = RouteConfig[]>(options?: TIsRoot extends true ? Omit<RouteOptions<TPath, TRouteLoaderData, Expand<TParentAllLoaderData & DeepAwaited<NoInfer<TRouteLoaderData>>>, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, Expand<TParentSearchSchema & TSearchSchema>, TParentParams, TParams, Expand<TParentParams & TAllParams>>, 'path'> & {
declare type CreateRouteConfigFn<TIsRoot extends boolean = false, TParentId extends string = string, TParentPath extends string = string, TParentAllLoaderData extends AnyLoaderData = {}, TParentSearchSchema extends AnySearchSchema = {}, TParentParams extends AnyPathParams = {}> = <TRouteId extends string, TPath extends string, TRouteLoaderData extends AnyLoaderData, TActionPayload, TActionResponse, TSearchSchema extends AnySearchSchema = AnySearchSchema, TParams extends Record<ParsePathParams<TPath>, unknown> = Record<ParsePathParams<TPath>, string>, TAllParams extends AnyPathParams extends TParams ? Record<ParsePathParams<TPath>, string> : NoInfer<TParams> = AnyPathParams extends TParams ? Record<ParsePathParams<TPath>, string> : NoInfer<TParams>, TKnownChildren extends RouteConfig[] = RouteConfig[], TResolvedId extends string = string extends TRouteId ? string extends TPath ? string : TPath : TRouteId>(options?: TIsRoot extends true ? Omit<RouteOptions<TRouteId, TPath, TRouteLoaderData, Expand<TParentAllLoaderData & DeepAwaited<NoInfer<TRouteLoaderData>>>, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, Expand<TParentSearchSchema & TSearchSchema>, TParentParams, TParams, Expand<TParentParams & TAllParams>>, 'path'> & {
path?: never;
} : RouteOptions<TPath, TRouteLoaderData, Expand<TParentAllLoaderData & DeepAwaited<NoInfer<TRouteLoaderData>>>, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, Expand<TParentSearchSchema & TSearchSchema>, TParentParams, TParams, Expand<TParentParams & TAllParams>>, children?: TKnownChildren, isRoot?: boolean, parentId?: string) => RouteConfig<RouteId<TParentId, TPath>, TPath, RouteIdToPath<RouteId<TParentId, TPath>>, TRouteLoaderData, Expand<TParentAllLoaderData & DeepAwaited<NoInfer<TRouteLoaderData>>>, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, Expand<TParentSearchSchema & TSearchSchema>, TParentParams, TParams, Expand<TParentParams & TAllParams>, TKnownChildren>;
} : RouteOptions<TRouteId, TPath, TRouteLoaderData, Expand<TParentAllLoaderData & DeepAwaited<NoInfer<TRouteLoaderData>>>, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, Expand<TParentSearchSchema & TSearchSchema>, TParentParams, TParams, Expand<TParentParams & TAllParams>>, children?: TKnownChildren, isRoot?: boolean, parentId?: string, parentPath?: string) => RouteConfig<RoutePrefix<TParentId, TResolvedId>, TResolvedId, TPath, string extends TPath ? '' : RoutePath<RoutePrefix<TParentPath, TPath>>, TRouteLoaderData, Expand<TParentAllLoaderData & DeepAwaited<NoInfer<TRouteLoaderData>>>, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, Expand<TParentSearchSchema & TSearchSchema>, TParentParams, TParams, Expand<TParentParams & TAllParams>, TKnownChildren>;
declare const createRouteConfig: CreateRouteConfigFn<true>;
interface AnyRouteConfig extends RouteConfig<any, any, any, any, any, any, any, any, any, any, any, any, any> {
interface AnyRouteConfig extends RouteConfig<any, any, any, any, any, any, any, any, any, any, any, any, any, any, any> {
}
interface AnyRouteConfigWithChildren<TChildren> extends RouteConfig<any, any, any, any, any, any, any, any, any, any, any, any, any, TChildren> {
interface AnyRouteConfigWithChildren<TChildren> extends RouteConfig<any, any, any, any, any, any, any, any, any, any, any, any, any, any, TChildren> {
}

@@ -59,3 +61,4 @@ interface AnyAllRouteInfo {

routeInfoByFullPath: Record<string, AnyRouteInfo>;
fullPath: string;
routeIds: any;
routePaths: any;
}

@@ -67,22 +70,24 @@ interface DefaultAllRouteInfo {

routeInfoByFullPath: Record<string, RouteInfo>;
fullPath: string;
routeIds: string;
routePaths: string;
}
interface AllRouteInfo<TRouteConfig extends AnyRouteConfig = RouteConfig> extends RoutesInfoInner<TRouteConfig, ParseRouteConfig<TRouteConfig>> {
}
interface RoutesInfoInner<TRouteConfig extends AnyRouteConfig, TRouteInfo extends RouteInfo<string, string, any, any, any, any, any, any, any, any, any, any> = RouteInfo> {
interface RoutesInfoInner<TRouteConfig extends AnyRouteConfig, TRouteInfo extends RouteInfo<string, string, any, any, any, any, any, any, any, any, any, any, any, any> = RouteInfo, TRouteInfoById = {
[TInfo in TRouteInfo as TInfo['id']]: TInfo;
}, TRouteInfoByFullPath = {
[TInfo in TRouteInfo as TInfo['fullPath'] extends RootRouteId ? never : string extends TInfo['fullPath'] ? never : TInfo['fullPath']]: TInfo;
}> {
routeConfig: TRouteConfig;
routeInfo: TRouteInfo;
routeInfoById: {
[TInfo in TRouteInfo as TInfo['id']]: TInfo;
};
routeInfoByFullPath: {
[TInfo in TRouteInfo as TInfo['id'] extends RootRouteId ? never : RouteIdToPath<TInfo['id']>]: TInfo;
};
fullPath: RouteIdToPath<TRouteInfo['id']>;
routeInfoById: TRouteInfoById;
routeInfoByFullPath: TRouteInfoByFullPath;
routeIds: keyof TRouteInfoById;
routePaths: keyof TRouteInfoByFullPath;
}
interface AnyRoute extends Route<any, any> {
}
interface AnyRouteInfo extends RouteInfo<any, any, any, any, any, any, any, any, any, any, any, any, any> {
interface AnyRouteInfo extends RouteInfo<any, any, any, any, any, any, any, any, any, any, any, any, any, any> {
}
declare type RouteIdToPath<T extends string> = T extends RootRouteId ? '/' : TrimPathRight<`${T}`>;
declare type RoutePath<T extends string> = T extends RootRouteId ? '/' : TrimPathRight<`${T}`>;
declare type ParseRouteConfig<TRouteConfig = AnyRouteConfig> = TRouteConfig extends AnyRouteConfig ? RouteConfigRoute<TRouteConfig> | ParseRouteChildren<TRouteConfig> : never;

@@ -97,5 +102,6 @@ declare type ParseRouteChildren<TRouteConfig> = TRouteConfig extends AnyRouteConfigWithChildren<infer TChildren> ? unknown extends TChildren ? never : TChildren extends AnyRouteConfig[] ? Values<{

declare type ValueKeys<O> = Extract<keyof O, PropertyKey>;
declare type RouteConfigRoute<TRouteConfig> = TRouteConfig extends RouteConfig<infer TId, infer TPath, infer TFullPath, infer TRouteLoaderData, infer TLoaderData, infer TActionPayload, infer TActionResponse, infer TParentSearchSchema, infer TSearchSchema, infer TFullSearchSchema, infer TParentParams, infer TParams, infer TAllParams, any> ? string extends TId ? never : RouteInfo<TId, TPath, TFullPath, TRouteLoaderData, TLoaderData, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, TFullSearchSchema, TParentParams, TParams, TAllParams> : never;
interface RouteInfo<TId extends string = string, TPath extends string = string, TFullPath extends {} = string, TRouteLoaderData extends AnyLoaderData = {}, TLoaderData extends AnyLoaderData = {}, TActionPayload = unknown, TActionResponse = unknown, TParentSearchSchema extends {} = {}, TSearchSchema extends AnySearchSchema = {}, TFullSearchSchema extends AnySearchSchema = {}, TParentParams extends AnyPathParams = {}, TParams extends Record<ParsePathParams<TPath>, unknown> = Record<ParsePathParams<TPath>, string>, TAllParams extends AnyPathParams = {}> {
declare type RouteConfigRoute<TRouteConfig> = TRouteConfig extends RouteConfig<infer TId, infer TRouteId, infer TPath, infer TFullPath, infer TRouteLoaderData, infer TLoaderData, infer TActionPayload, infer TActionResponse, infer TParentSearchSchema, infer TSearchSchema, infer TFullSearchSchema, infer TParentParams, infer TParams, infer TAllParams, any> ? string extends TRouteId ? never : RouteInfo<TId, TRouteId, TPath, TFullPath, TRouteLoaderData, TLoaderData, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, TFullSearchSchema, TParentParams, TParams, TAllParams> : never;
interface RouteInfo<TId extends string = string, TRouteId extends string = string, TPath extends string = string, TFullPath extends string = string, TRouteLoaderData extends AnyLoaderData = {}, TLoaderData extends AnyLoaderData = {}, TActionPayload = unknown, TActionResponse = unknown, TParentSearchSchema extends {} = {}, TSearchSchema extends AnySearchSchema = {}, TFullSearchSchema extends AnySearchSchema = {}, TParentParams extends AnyPathParams = {}, TParams extends Record<ParsePathParams<TPath>, unknown> = Record<ParsePathParams<TPath>, string>, TAllParams extends AnyPathParams = {}> {
id: TId;
routeId: TRouteId;
path: TPath;

@@ -112,3 +118,3 @@ fullPath: TFullPath;

allParams: TAllParams;
options: RouteOptions<TPath, TRouteLoaderData, TLoaderData, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, TFullSearchSchema, TParentParams, TParams, TAllParams>;
options: RouteOptions<TRouteId, TPath, TRouteLoaderData, TLoaderData, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, TFullSearchSchema, TParentParams, TParams, TAllParams>;
}

@@ -120,3 +126,3 @@ declare type DeepAwaited<T> = T extends Promise<infer A> ? DeepAwaited<A> : T extends Record<infer A, Promise<infer B>> ? {

declare type RootRouteId = typeof rootRouteId;
declare type RouteId<TPrefix extends string, TPath extends string> = string extends TPath ? RootRouteId : `${TPrefix}/${TPath}` extends '/' ? '/' : `/${TrimPathLeft<`${TrimPathRight<TPrefix>}/${TrimPath<TPath>}`>}`;
declare type RoutePrefix<TPrefix extends string, TId extends string> = string extends TId ? RootRouteId : TId extends string ? `${TPrefix}/${TId}` extends '/' ? '/' : `/${TrimPathLeft<`${TrimPathRight<TPrefix>}/${TrimPath<TId>}`>}` : never;
declare type CleanPath<T extends string> = T extends `${infer L}//${infer R}` ? CleanPath<`${CleanPath<L>}/${CleanPath<R>}`> : T extends `${infer L}//` ? `${CleanPath<L>}/` : T extends `//${infer L}` ? `/${CleanPath<L>}` : T;

@@ -170,4 +176,7 @@ declare type TrimPath<T extends string> = '' extends T ? '' : TrimPathRight<TrimPathLeft<T>>;

};
declare type RouteOptions<TPath extends string = string, TRouteLoaderData extends AnyLoaderData = {}, TLoaderData extends AnyLoaderData = {}, TActionPayload = unknown, TActionResponse = unknown, TParentSearchSchema extends {} = {}, TSearchSchema extends AnySearchSchema = {}, TFullSearchSchema extends AnySearchSchema = TSearchSchema, TParentParams extends AnyPathParams = {}, TParams extends Record<ParsePathParams<TPath>, unknown> = Record<ParsePathParams<TPath>, string>, TAllParams extends AnyPathParams = {}> = {
declare type RouteOptions<TRouteId extends string = string, TPath extends string = string, TRouteLoaderData extends AnyLoaderData = {}, TLoaderData extends AnyLoaderData = {}, TActionPayload = unknown, TActionResponse = unknown, TParentSearchSchema extends {} = {}, TSearchSchema extends AnySearchSchema = {}, TFullSearchSchema extends AnySearchSchema = TSearchSchema, TParentParams extends AnyPathParams = {}, TParams extends Record<ParsePathParams<TPath>, unknown> = Record<ParsePathParams<TPath>, string>, TAllParams extends AnyPathParams = {}> = ({
path: TPath;
} | {
id: TRouteId;
}) & {
caseSensitive?: boolean;

@@ -333,3 +342,3 @@ validateSearch?: SearchSchemaValidator<TSearchSchema, TParentSearchSchema>;

};
declare type ValidFromPath<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo> = undefined | (string extends TAllRouteInfo['fullPath'] ? string : TAllRouteInfo['fullPath']);
declare type ValidFromPath<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo> = undefined | (string extends TAllRouteInfo['routePaths'] ? string : TAllRouteInfo['routePaths']);
interface Router<TRouteConfig extends AnyRouteConfig = RouteConfig, TAllRouteInfo extends AnyAllRouteInfo = AllRouteInfo<TRouteConfig>> {

@@ -393,2 +402,3 @@ options: PickAsRequired<RouterOptions<TRouteConfig>, 'stringifySearch' | 'parseSearch'>;

routeId: TRouteInfo['id'];
routeRouteId: TRouteInfo['routeId'];
routePath: TRouteInfo['path'];

@@ -401,3 +411,3 @@ fullPath: TRouteInfo['fullPath'];

buildLink: <TTo extends string = '.'>(options: Omit<LinkOptions<TAllRouteInfo, TRouteInfo['fullPath'], TTo>, 'from'>) => LinkInfo;
matchRoute: <TTo extends string = '.', TResolved extends string = ResolveRelativePath<TRouteInfo['id'], TTo>>(matchLocation: Omit<ToOptions<TAllRouteInfo, TRouteInfo['fullPath'], TTo>, 'from'>, opts?: MatchRouteOptions) => RouteInfoByPath<TAllRouteInfo, TResolved>['allParams'];
matchRoute: <TTo extends string = '.', TResolved extends string = ResolveRelativePath<TRouteInfo['id'], TTo>>(matchLocation: CheckRelativePath<TAllRouteInfo, TRouteInfo['fullPath'], NoInfer<TTo>> & Omit<ToOptions<TAllRouteInfo, TRouteInfo['fullPath'], TTo>, 'from'>, opts?: MatchRouteOptions) => RouteInfoByPath<TAllRouteInfo, TResolved>['allParams'];
navigate: <TTo extends string = '.'>(options: Omit<LinkOptions<TAllRouteInfo, TRouteInfo['id'], TTo>, 'from'>) => Promise<void>;

@@ -425,5 +435,5 @@ action: unknown extends TRouteInfo['actionResponse'] ? Action<TRouteInfo['actionPayload'], TRouteInfo['actionResponse']> | undefined : Action<TRouteInfo['actionPayload'], TRouteInfo['actionResponse']>;

from?: TFrom;
} & SearchParamOptions<TAllRouteInfo, TFrom, TResolvedTo> & PathParamOptions<TAllRouteInfo, TFrom, TResolvedTo>;
declare type ToPathOption<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TFrom extends ValidFromPath<TAllRouteInfo> = '/', TTo extends string = '.'> = TTo | RelativeToPathAutoComplete<TAllRouteInfo['fullPath'], NoInfer<TFrom> extends string ? NoInfer<TFrom> : '', NoInfer<TTo> & string>;
declare type ToIdOption<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TFrom extends ValidFromPath<TAllRouteInfo> = '/', TTo extends string = '.'> = TTo | RelativeToPathAutoComplete<TAllRouteInfo['routeInfo']['id'], NoInfer<TFrom> extends string ? NoInfer<TFrom> : '', NoInfer<TTo> & string>;
} & CheckPath<TAllRouteInfo, NoInfer<TResolvedTo>> & SearchParamOptions<TAllRouteInfo, TFrom, TResolvedTo> & PathParamOptions<TAllRouteInfo, TFrom, TResolvedTo>;
declare type ToPathOption<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TFrom extends ValidFromPath<TAllRouteInfo> = '/', TTo extends string = '.'> = TTo | RelativeToPathAutoComplete<TAllRouteInfo['routePaths'], NoInfer<TFrom> extends string ? NoInfer<TFrom> : '', NoInfer<TTo> & string>;
declare type ToIdOption<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TFrom extends ValidFromPath<TAllRouteInfo> = '/', TTo extends string = '.'> = TTo | RelativeToPathAutoComplete<TAllRouteInfo['routeIds'], NoInfer<TFrom> extends string ? NoInfer<TFrom> : '', NoInfer<TTo> & string>;
declare type LinkOptions<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TFrom extends ValidFromPath<TAllRouteInfo> = '/', TTo extends string = '.'> = NavigateOptionsAbsolute<TAllRouteInfo, TFrom, TTo> & {

@@ -437,7 +447,12 @@ target?: HTMLAnchorElement['target'];

};
declare type CheckRelativePath<TAllRouteInfo extends AnyAllRouteInfo, TFrom, TTo> = TTo extends string ? TFrom extends string ? ResolveRelativePath<TFrom, TTo> extends TAllRouteInfo['fullPath'] ? {} : {
declare type CheckRelativePath<TAllRouteInfo extends AnyAllRouteInfo, TFrom, TTo> = TTo extends string ? TFrom extends string ? ResolveRelativePath<TFrom, TTo> extends TAllRouteInfo['routePaths'] ? {} : {
Error: `${TFrom} + ${TTo} resolves to ${ResolveRelativePath<TFrom, TTo>}, which is not a valid route path.`;
'Valid Route Paths': TAllRouteInfo['fullPath'];
'Valid Route Paths': TAllRouteInfo['routePaths'];
} : {} : {};
declare type ResolveRelativePath<TFrom, TTo = '.', TRooted = false> = TFrom extends string ? TTo extends string ? TTo extends '.' ? TFrom : TTo extends `./` ? Join<[TFrom, '/']> : TTo extends `./${infer TRest}` ? ResolveRelativePath<TFrom, TRest> : TTo extends `/${infer TRest}` ? TTo : Split<TTo> extends ['..', ...infer ToRest] ? Split<TFrom> extends [...infer FromRest, infer FromTail] ? ResolveRelativePath<Join<FromRest>, Join<ToRest>> : never : Split<TTo> extends ['.', ...infer ToRest] ? ResolveRelativePath<TFrom, Join<ToRest>> : CleanPath<Join<['/', ...Split<TFrom>, ...Split<TTo>]>> : never : never;
declare type CheckPath<TAllRouteInfo extends AnyAllRouteInfo, TPath> = Exclude<TPath, TAllRouteInfo['routePaths']> extends never ? {} : CheckPathError<TAllRouteInfo, Exclude<TPath, TAllRouteInfo['routePaths']>>;
declare type CheckPathError<TAllRouteInfo extends AnyAllRouteInfo, TInvalids> = {
Error: `${TInvalids extends string ? TInvalids : never} is not a valid route path.`;
'Valid Route Paths': TAllRouteInfo['routePaths'];
};
declare type ResolveRelativePath<TFrom, TTo = '.'> = TFrom extends string ? TTo extends string ? TTo extends '.' ? TFrom : TTo extends `./` ? Join<[TFrom, '/']> : TTo extends `./${infer TRest}` ? ResolveRelativePath<TFrom, TRest> : TTo extends `/${infer TRest}` ? TTo : Split<TTo> extends ['..', ...infer ToRest] ? Split<TFrom> extends [...infer FromRest, infer FromTail] ? ResolveRelativePath<Join<FromRest>, Join<ToRest>> : never : Split<TTo> extends ['.', ...infer ToRest] ? ResolveRelativePath<TFrom, Join<ToRest>> : CleanPath<Join<['/', ...Split<TFrom>, ...Split<TTo>]>> : never : never;
declare type RouteInfoById<TAllRouteInfo extends AnyAllRouteInfo, TId> = TId extends keyof TAllRouteInfo['routeInfoById'] ? IsAny<TAllRouteInfo['routeInfoById'][TId]['id'], RouteInfo, TAllRouteInfo['routeInfoById'][TId]> : never;

@@ -530,2 +545,2 @@ declare type RouteInfoByPath<TAllRouteInfo extends AnyAllRouteInfo, TPath> = TPath extends keyof TAllRouteInfo['routeInfoByFullPath'] ? IsAny<TAllRouteInfo['routeInfoByFullPath'][TPath]['id'], RouteInfo, TAllRouteInfo['routeInfoByFullPath'][TPath]> : never;

export { Action, ActionFn, ActionState, AllRouteInfo, AnyAllRouteInfo, AnyLoaderData, AnyPathParams, AnyRoute, AnyRouteConfig, AnyRouteConfigWithChildren, AnyRouteInfo, AnySearchSchema, BuildNextOptions, CheckRelativePath, DefaultAllRouteInfo, DefinedPathParamWarning, FilterRoutesFn, FrameworkGenerics, FromLocation, IsAny, IsAnyBoolean, IsKnown, LinkInfo, LinkOptions, ListenerFn, LoaderFn, Location, LocationState, MatchLocation, MatchRouteOptions, NavigateOptionsAbsolute, NoInfer, ParentParams, ParsePathParams, PathParamMask, PendingState, PickAsPartial, PickAsRequired, PickExclude, PickExtra, PickExtract, PickUnsafe, PreloadCacheEntry, RelativeToPathAutoComplete, ResolveRelativePath, RootRouteId, Route, RouteConfig, RouteConfigRoute, RouteInfo, RouteInfoById, RouteInfoByPath, RouteLoaders, RouteMatch, RouteMeta, RouteOptions, Router, RouterOptions, RouterState, RoutesInfoInner, SearchFilter, SearchParser, SearchPredicate, SearchSchemaValidator, SearchSerializer, Segment, SnapshotRouteMatch, ToIdOption, ToOptions, ToPathOption, UnloaderFn, Updater, ValidFromPath, ValueKeys, Values, __Experimental__RouterSnapshot, createRoute, createRouteConfig, createRouteMatch, createRouter, defaultParseSearch, defaultStringifySearch, functionalUpdate, last, matchByPath, matchPathname, parsePathname, parseSearchWith, replaceEqualDeep, resolvePath, rootRouteId, stringifySearchWith, warning };
export { Action, ActionFn, ActionState, AllRouteInfo, AnyAllRouteInfo, AnyLoaderData, AnyPathParams, AnyRoute, AnyRouteConfig, AnyRouteConfigWithChildren, AnyRouteInfo, AnySearchSchema, BuildNextOptions, CheckPath, CheckPathError, CheckRelativePath, DefaultAllRouteInfo, DefinedPathParamWarning, FilterRoutesFn, FrameworkGenerics, FromLocation, IsAny, IsAnyBoolean, IsKnown, LinkInfo, LinkOptions, ListenerFn, LoaderFn, Location, LocationState, MatchLocation, MatchRouteOptions, NavigateOptionsAbsolute, NoInfer, ParentParams, ParsePathParams, PathParamMask, PendingState, PickAsPartial, PickAsRequired, PickExclude, PickExtra, PickExtract, PickUnsafe, PreloadCacheEntry, RelativeToPathAutoComplete, ResolveRelativePath, RootRouteId, Route, RouteConfig, RouteConfigRoute, RouteInfo, RouteInfoById, RouteInfoByPath, RouteLoaders, RouteMatch, RouteMeta, RouteOptions, Router, RouterOptions, RouterState, RoutesInfoInner, SearchFilter, SearchParser, SearchPredicate, SearchSchemaValidator, SearchSerializer, Segment, SnapshotRouteMatch, ToIdOption, ToOptions, ToPathOption, UnloaderFn, Updater, ValidFromPath, ValueKeys, Values, __Experimental__RouterSnapshot, createRoute, createRouteConfig, createRouteMatch, createRouter, defaultParseSearch, defaultStringifySearch, functionalUpdate, last, matchByPath, matchPathname, parsePathname, parseSearchWith, replaceEqualDeep, resolvePath, rootRouteId, stringifySearchWith, warning };

@@ -11,3 +11,3 @@ /**

*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RouterCore={})}(this,(function(t){"use strict";function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t},e.apply(this,arguments)}function a(){return a=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])}return t},a.apply(this,arguments)}var n;!function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"}(n||(n={}));var o="beforeunload",r="popstate";function i(t){void 0===t&&(t={});var e=t.window,i=void 0===e?document.defaultView:e,s=i.history;function l(){var t=i.location,e=t.pathname,a=t.search,n=t.hash,o=s.state||{};return[o.idx,{pathname:e,search:a,hash:n,state:o.usr||null,key:o.key||"default"}]}var f=null;i.addEventListener(r,(function(){if(f)P.call(f),f=null;else{var t=n.Pop,e=l(),a=e[0],o=e[1];if(P.length){if(null!=a){var r=g-a;r&&(f={action:t,location:o,retry:function(){M(-1*r)}},M(r))}}else I(t)}}));var m=n.Pop,v=l(),g=v[0],y=v[1],_=u(),P=u();function b(t){return"string"==typeof t?t:d(t)}function w(t,e){return void 0===e&&(e=null),a({pathname:y.pathname,hash:"",search:""},"string"==typeof t?p(t):t,{state:e,key:h()})}function R(t,e){return[{usr:t.state,key:t.key,idx:e},b(t)]}function S(t,e,a){return!P.length||(P.call({action:t,location:e,retry:a}),!1)}function I(t){m=t;var e=l();g=e[0],y=e[1],_.call({action:m,location:y})}function M(t){s.go(t)}null==g&&(g=0,s.replaceState(a({},s.state,{idx:g}),""));var L={get action(){return m},get location(){return y},createHref:b,push:function t(e,a){var o=n.Push,r=w(e,a);if(S(o,r,(function(){t(e,a)}))){var l=R(r,g+1),c=l[0],u=l[1];try{s.pushState(c,"",u)}catch(t){i.location.assign(u)}I(o)}},replace:function t(e,a){var o=n.Replace,r=w(e,a);if(S(o,r,(function(){t(e,a)}))){var i=R(r,g),l=i[0],c=i[1];s.replaceState(l,"",c),I(o)}},go:M,back:function(){M(-1)},forward:function(){M(1)},listen:function(t){return _.push(t)},block:function(t){var e=P.push(t);return 1===P.length&&i.addEventListener(o,c),function(){e(),P.length||i.removeEventListener(o,c)}}};return L}function s(t){void 0===t&&(t={});var e=t,o=e.initialEntries,r=void 0===o?["/"]:o,i=e.initialIndex,s=r.map((function(t){return a({pathname:"/",search:"",hash:"",state:null,key:h()},"string"==typeof t?p(t):t)})),c=l(null==i?s.length-1:i,0,s.length-1),f=n.Pop,m=s[c],v=u(),g=u();function y(t,e){return void 0===e&&(e=null),a({pathname:m.pathname,search:"",hash:""},"string"==typeof t?p(t):t,{state:e,key:h()})}function _(t,e,a){return!g.length||(g.call({action:t,location:e,retry:a}),!1)}function P(t,e){f=t,m=e,v.call({action:f,location:m})}function b(t){var e=l(c+t,0,s.length-1),a=n.Pop,o=s[e];_(a,o,(function(){b(t)}))&&(c=e,P(a,o))}var w={get index(){return c},get action(){return f},get location(){return m},createHref:function(t){return"string"==typeof t?t:d(t)},push:function t(e,a){var o=n.Push,r=y(e,a);_(o,r,(function(){t(e,a)}))&&(c+=1,s.splice(c,s.length,r),P(o,r))},replace:function t(e,a){var o=n.Replace,r=y(e,a);_(o,r,(function(){t(e,a)}))&&(s[c]=r,P(o,r))},go:b,back:function(){b(-1)},forward:function(){b(1)},listen:function(t){return v.push(t)},block:function(t){return g.push(t)}};return w}function l(t,e,a){return Math.min(Math.max(t,e),a)}function c(t){t.preventDefault(),t.returnValue=""}function u(){var t=[];return{get length(){return t.length},push:function(e){return t.push(e),function(){t=t.filter((function(t){return t!==e}))}},call:function(e){t.forEach((function(t){return t&&t(e)}))}}}function h(){return Math.random().toString(36).substr(2,8)}function d(t){var e=t.pathname,a=void 0===e?"/":e,n=t.search,o=void 0===n?"":n,r=t.hash,i=void 0===r?"":r;return o&&"?"!==o&&(a+="?"===o.charAt(0)?o:"?"+o),i&&"#"!==i&&(a+="#"===i.charAt(0)?i:"#"+i),a}function p(t){var e={};if(t){var a=t.indexOf("#");a>=0&&(e.hash=t.substr(a),t=t.substr(0,a));var n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function f(t){if(!t)return"";var e=decodeURIComponent(t);return"false"!==e&&("true"===e||(0*+e==0?+e:e))}const m="__root__",v=Boolean("undefined"!=typeof window&&window.document&&window.document.createElement);function g(t,a,n,o){const{id:r,path:i,fullPath:s}=t,l=o.state.actions[r]||(o.state.actions[r]={pending:[],submit:async(t,a)=>{var n;if(!c)return;const r=null==(n=null==a?void 0:a.invalidate)||n,i={submittedAt:Date.now(),status:"pending",submission:t};l.latest=i,l.pending.push(i),o.state=e({},o.state,{action:i}),o.notify();try{const e=await(null==c.options.action?void 0:c.options.action(t));return i.data=e,r&&(o.invalidateRoute({to:".",fromCurrent:!0}),await o.reload()),i.status="success",e}catch(t){console.error(t),i.error=t,i.status="error"}finally{l.pending=l.pending.filter((t=>t!==i)),i===o.state.action&&(o.state.action=void 0),o.notify()}}},o.state.actions[r]);let c={routeId:r,routePath:i,fullPath:s,options:a,router:o,childRoutes:void 0,parentRoute:n,action:l,buildLink:t=>o.buildLink(e({},t,{from:s})),navigate:t=>o.navigate(e({},t,{from:s})),matchRoute:(t,a)=>o.matchRoute(e({},t,{from:s}),a)};return null==o.options.createRoute||o.options.createRoute({router:o,route:c}),c}function y(t,a,n){const o=e({},a,n,{router:t,routeSearch:{},search:{},childMatches:[],status:"idle",routeLoaderData:{},loaderData:{},isPending:!1,isFetching:!1,isInvalid:!1,__:{abortController:new AbortController,latestId:"",resolve:()=>{},notify:()=>{o.__.resolve(),o.router.notify()},startPending:()=>{var e,a;const n=null!=(e=o.options.pendingMs)?e:t.options.defaultPendingMs,r=null!=(a=o.options.pendingMinMs)?a:t.options.defaultPendingMinMs;o.__.pendingTimeout||"loading"!==o.status||void 0===n||(o.__.pendingTimeout=setTimeout((()=>{o.isPending=!0,o.__.resolve(),void 0!==r&&(o.__.pendingMinPromise=new Promise((t=>o.__.pendingMinTimeout=setTimeout(t,r))))}),n))},cancelPending:()=>{o.isPending=!1,clearTimeout(o.__.pendingTimeout),clearTimeout(o.__.pendingMinTimeout),delete o.__.pendingMinPromise},setParentMatch:t=>{o.parentMatch=t},addChildMatch:t=>{o.childMatches.find((e=>e.matchId===t.matchId))||o.childMatches.push(t)},validate:()=>{var a,n;const r=null!=(a=null==(n=o.parentMatch)?void 0:n.search)?a:t.location.search;try{const t=o.routeSearch;let a=A(t,null==o.options.validateSearch?void 0:o.options.validateSearch(r));t!==a&&(o.isInvalid=!0),o.routeSearch=a,o.search=A(r,e({},r,a))}catch(t){console.error(t);const e=new Error("Invalid search params found",{cause:t});return e.code="INVALID_SEARCH_PARAMS",o.status="error",void(o.error=e)}}},cancel:()=>{var t;null==(t=o.__.abortController)||t.abort(),o.__.cancelPending()},load:async()=>{const t=""+Date.now()+Math.random();return o.__.latestId=t,"error"!==o.status&&"idle"!==o.status||(o.status="loading"),o.isInvalid=!1,o.__.loadPromise=new Promise((async a=>{o.isFetching=!0,o.__.resolve=a;const n=(async()=>{const a=o.options.import;a&&(o.__.importPromise=a({params:o.params}).then((t=>{o.__=e({},o.__,t)}))),await o.__.importPromise,o.__.elementsPromise=(async()=>{await Promise.all(["element","errorElement","catchElement","pendingElement"].map((async t=>{const e=o.options[t];if(!o.__[t])if("function"==typeof e){const a=await e(o);o.__[t]=a}else o.__[t]=o.options[t]})))})(),o.__.dataPromise=Promise.resolve().then((async()=>{try{const e=await(null==o.options.loader?void 0:o.options.loader({params:o.params,search:o.routeSearch,signal:o.__.abortController.signal}));if(t!==o.__.latestId)return o.__.loaderPromise;o.routeLoaderData=A(o.routeLoaderData,e),_(o),o.error=void 0,o.status="success",o.updatedAt=Date.now()}catch(e){if(t!==o.__.latestId)return o.__.loaderPromise;o.error=e,o.status="error",o.updatedAt=Date.now()}}));try{if(await Promise.all([o.__.elementsPromise,o.__.dataPromise]),t!==o.__.latestId)return o.__.loaderPromise;o.__.pendingMinPromise&&(await o.__.pendingMinPromise,delete o.__.pendingMinPromise)}finally{if(t!==o.__.latestId)return o.__.loaderPromise;o.__.cancelPending(),o.isPending=!1,o.isFetching=!1,o.__.notify()}})();if(o.__.loaderPromise=n,await n,t!==o.__.latestId)return o.__.loaderPromise;delete o.__.loaderPromise})),await o.__.loadPromise}});return o}function _(t){t.parentMatch&&(t.loaderData=A(t.loaderData,e({},t.parentMatch.loaderData,t.routeLoaderData))),t.childMatches.length&&t.childMatches.forEach((t=>{_(t)}))}function P(t,e){const a=L(t,e);if(!e.to||a)return null!=a?a:{}}function b(t,e,a){return S(x(t).map((t=>{return"*"!==t.value||a?"param"===t.type?null!=(n=e[t.value.substring(1)])?n:"":t.value:"";var n})))}function w(t,e){if(t){"undefined"!=typeof console&&console.warn(e);try{throw new Error(e)}catch(t){}}return!0}function R(t,e){return"function"==typeof t?t(e):t}function S(t){return I(t.filter(Boolean).join("/"))}function I(t){return t.replace(/\/{2,}/g,"/")}function M(t){return"/"===t?t:t.replace(/\/{1,}$/,"")}function L(t,e){var a;const n=x(t),o=x(""+(null!=(a=e.to)?a:"*")),r={};return(()=>{for(let t=0;t<Math.max(n.length,o.length);t++){const a=n[t],i=o[t],s=t===o.length-1,l=t===n.length-1;if(i){if("wildcard"===i.type)return!(null==a||!a.value)&&(r["*"]=S(n.slice(t).map((t=>t.value))),!0);if("pathname"===i.type){if("/"===i.value&&(null==a||!a.value))return!0;if(a)if(e.caseSensitive){if(i.value!==a.value)return!1}else if(i.value.toLowerCase()!==a.value.toLowerCase())return!1}if(!a)return!1;if("param"===i.type){if("/"===(null==a?void 0:a.value))return!1;a.value.startsWith(":")||(r[i.value.substring(1)]=a.value)}}if(s&&!l)return!!e.fuzzy}return!0})()?r:void 0}function x(t){if(!t)return[];const e=[];if("/"===(t=I(t)).slice(0,1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),!t)return e;const a=t.split("/").filter(Boolean);return e.push(...a.map((t=>t.startsWith("*")?{type:"wildcard",value:t}:":"===t.charAt(0)?{type:"param",value:t}:{type:"pathname",value:t}))),"/"===t.slice(-1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),e}function E(t,e,a){e=e.replace(new RegExp("^"+t),"/"),a=a.replace(new RegExp("^"+t),"/");let n=x(e);const o=x(a);o.forEach(((t,e)=>{if("/"===t.value)e?e===o.length-1&&n.push(t):n=[t];else if(".."===t.value){var a;n.length>1&&"/"===(null==(a=B(n))?void 0:a.value)&&n.pop(),n.pop()}else{if("."===t.value)return;n.push(t)}}));return I(S([t,...n.map((t=>t.value))]))}function A(t,e){if(t===e)return t;const a=Array.isArray(t)&&Array.isArray(e);if(a||k(t)&&k(e)){const n=a?t.length:Object.keys(t).length,o=a?e:Object.keys(e),r=o.length,i=a?[]:{};let s=0;for(let n=0;n<r;n++){const r=a?n:o[n];i[r]=A(t[r],e[r]),i[r]===t[r]&&s++}return n===r&&s===n?t:i}return e}function k(t){if(!C(t))return!1;const e=t.constructor;if(void 0===e)return!0;const a=e.prototype;return!!C(a)&&!!a.hasOwnProperty("isPrototypeOf")}function C(t){return"[object Object]"===Object.prototype.toString.call(t)}const T=D(JSON.parse),O=j(JSON.stringify);function D(t){return e=>{"?"===e.substring(0,1)&&(e=e.substring(1));let a=function(t){for(var e,a,n={},o=t.split("&");e=o.shift();)void 0!==n[a=(e=e.split("=")).shift()]?n[a]=[].concat(n[a],f(e.shift())):n[a]=f(e.shift());return n}(e);for(let e in a){const n=a[e];if("string"==typeof n)try{a[e]=t(n)}catch(t){}}return a}}function j(t){return a=>{(a=e({},a))&&Object.keys(a).forEach((e=>{const n=a[e];if(void 0===n||void 0===n)delete a[e];else if(n&&"object"==typeof n&&null!==n)try{a[e]=t(n)}catch(t){}}));const n=function(t,e){var a,n,o,r="";for(a in t)if(void 0!==(o=t[a]))if(Array.isArray(o))for(n=0;n<o.length;n++)r&&(r+="&"),r+=encodeURIComponent(a)+"="+encodeURIComponent(o[n]);else r&&(r+="&"),r+=encodeURIComponent(a)+"="+encodeURIComponent(o);return(e||"")+r}(a).toString();return n?"?"+n:""}}function B(t){return t[t.length-1]}t.createBrowserHistory=i,t.createHashHistory=function(t){void 0===t&&(t={});var e=t.window,i=void 0===e?document.defaultView:e,s=i.history;function l(){var t=p(i.location.hash.substr(1)),e=t.pathname,a=void 0===e?"/":e,n=t.search,o=void 0===n?"":n,r=t.hash,l=void 0===r?"":r,c=s.state||{};return[c.idx,{pathname:a,search:o,hash:l,state:c.usr||null,key:c.key||"default"}]}var f=null;function m(){if(f)b.call(f),f=null;else{var t=n.Pop,e=l(),a=e[0],o=e[1];if(b.length){if(null!=a){var r=y-a;r&&(f={action:t,location:o,retry:function(){L(-1*r)}},L(r))}}else M(t)}}i.addEventListener(r,m),i.addEventListener("hashchange",(function(){d(l()[1])!==d(_)&&m()}));var v=n.Pop,g=l(),y=g[0],_=g[1],P=u(),b=u();function w(t){return function(){var t=document.querySelector("base"),e="";if(t&&t.getAttribute("href")){var a=i.location.href,n=a.indexOf("#");e=-1===n?a:a.slice(0,n)}return e}()+"#"+("string"==typeof t?t:d(t))}function R(t,e){return void 0===e&&(e=null),a({pathname:_.pathname,hash:"",search:""},"string"==typeof t?p(t):t,{state:e,key:h()})}function S(t,e){return[{usr:t.state,key:t.key,idx:e},w(t)]}function I(t,e,a){return!b.length||(b.call({action:t,location:e,retry:a}),!1)}function M(t){v=t;var e=l();y=e[0],_=e[1],P.call({action:v,location:_})}function L(t){s.go(t)}null==y&&(y=0,s.replaceState(a({},s.state,{idx:y}),""));var x={get action(){return v},get location(){return _},createHref:w,push:function t(e,a){var o=n.Push,r=R(e,a);if(I(o,r,(function(){t(e,a)}))){var l=S(r,y+1),c=l[0],u=l[1];try{s.pushState(c,"",u)}catch(t){i.location.assign(u)}M(o)}},replace:function t(e,a){var o=n.Replace,r=R(e,a);if(I(o,r,(function(){t(e,a)}))){var i=S(r,y),l=i[0],c=i[1];s.replaceState(l,"",c),M(o)}},go:L,back:function(){L(-1)},forward:function(){L(1)},listen:function(t){return P.push(t)},block:function(t){var e=b.push(t);return 1===b.length&&i.addEventListener(o,c),function(){e(),b.length||i.removeEventListener(o,c)}}};return x},t.createMemoryHistory=s,t.createRoute=g,t.createRouteConfig=function t(e,a,n,o){void 0===e&&(e={}),void 0===n&&(n=!0),n?e.path=m:w(!e.path,"Routes must have a path property."),o===m&&(o="");let r=String(n?m:e.path);"/"!==r&&(r=function(t){return M(function(t){return"/"===t?t:t.replace(/^\/{1,}/,"")}(t))}(r));let i=S([o,r]);r===m&&(r="/"),i!==m&&(i=S(["/",i]));const s=i===m?"/":M(i);return{id:i,path:r,fullPath:s,options:e,children:a,addChildren:a=>t(e,a((e=>t(e,void 0,!1,i))),!1,o)}},t.createRouteMatch=y,t.createRouter=function(t){var a,n;const o=(null==t?void 0:t.history)||(v?i():s());let r={options:e({},t,{stringifySearch:null!=(a=null==t?void 0:t.stringifySearch)?a:O,parseSearch:null!=(n=null==t?void 0:t.parseSearch)?n:T}),listeners:[],basepath:"",routeTree:void 0,routesById:{},location:void 0,allRouteInfo:void 0,navigationPromise:Promise.resolve(),resolveNavigation:()=>{},preloadCache:{},state:{status:"idle",location:null,matches:[],actions:{},loaderData:{},lastUpdated:Date.now()},startedLoadingAt:Date.now(),subscribe:t=>(r.listeners.push(t),()=>{r.listeners=r.listeners.filter((e=>e!==t))}),getRoute:t=>r.routesById[t],notify:()=>{r.state=e({},r.state),r.listeners.forEach((t=>t()))},mount:()=>{const t=r.buildLocation({to:".",search:!0,hash:!0});return t.href!==r.location.href?r.commitLocation(t,!0):r.loadLocation()},update:t=>{Object.assign(r.options,t);const{basepath:e,routeConfig:a}=r.options;return r.basepath=I("/"+(null!=e?e:"")),a&&(r.routesById={},r.routeTree=r.buildRouteTree(a)),r},destroy:o.listen((t=>{r.loadLocation(r.parseLocation(t.location,r.location))})),buildRouteTree:t=>{const e=(t,a)=>t.map((t=>{const n=g(t,t.options,a,r);if(r.routesById[n.routeId])throw new Error;r.routesById[n.routeId]=n;const o=t.children;return n.childRoutes=null!=o&&o.length?e(o,n):void 0,n}));return e([t])[0]},parseLocation:(t,e)=>{var a;const n=r.options.parseSearch(t.search);return{pathname:t.pathname,searchStr:t.search,search:A(null==e?void 0:e.search,n),hash:null!=(a=t.hash.split("#").reverse()[0])?a:"",href:""+t.pathname+t.search+t.hash,state:t.state,key:t.key}},buildLocation:function(t){var e,a,n,o,i,s,l,c,u;void 0===t&&(t={});const h=t.fromCurrent?r.location.pathname:null!=(e=t.from)?e:r.location.pathname;let d=E(null!=(a=r.basepath)?a:"/",h,""+(null!=(n=t.to)?n:"."));const p=r.matchRoutes(r.location.pathname,{strictParseParams:!0}),f=r.matchRoutes(d),m=null==(o=B(p))?void 0:o.params;let v=!0===(null==(i=t.params)||i)?m:R(t.params,m);v&&f.map((t=>t.options.stringifyParams)).filter(Boolean).forEach((t=>{Object.assign(v,t(v))})),d=b(d,null!=v?v:{});const g=null!=(s=t.__preSearchFilters)&&s.length?t.__preSearchFilters.reduce(((t,e)=>e(t)),r.location.search):r.location.search,y=!0===t.search?g:t.search?null!=(l=R(t.search,g))?l:{}:null!=(c=t.__preSearchFilters)&&c.length?g:{},_=null!=(u=t.__postSearchFilters)&&u.length?t.__postSearchFilters.reduce(((t,e)=>e(t)),y):y,P=A(r.location.search,_),w=r.options.stringifySearch(P);let S=!0===t.hash?r.location.hash:R(t.hash,r.location.hash);return S=S?"#"+S:"",{pathname:d,search:P,searchStr:w,state:r.location.state,hash:S,href:""+d+w+S,key:t.key}},commitLocation:(t,e)=>{const a=""+Date.now()+Math.random();r.navigateTimeout&&clearTimeout(r.navigateTimeout);let n="replace";e||(n="push");return r.parseLocation(o.location).href===t.href&&!t.key&&(n="replace"),"replace"===n?o.replace({pathname:t.pathname,hash:t.hash,search:t.searchStr},{id:a}):o.push({pathname:t.pathname,hash:t.hash,search:t.searchStr},{id:a}),r.navigationPromise=new Promise((t=>{const e=r.resolveNavigation;r.resolveNavigation=()=>{e(),t()}})),r.navigationPromise},buildNext:t=>{const a=r.buildLocation(t),n=r.matchRoutes(a.pathname),o=n.map((t=>{var e;return null!=(e=t.options.preSearchFilters)?e:[]})).flat().filter(Boolean),i=n.map((t=>{var e;return null!=(e=t.options.postSearchFilters)?e:[]})).flat().filter(Boolean);return r.buildLocation(e({},t,{__preSearchFilters:o,__postSearchFilters:i}))},cancelMatches:()=>{var t,e;[...r.state.matches,...null!=(t=null==(e=r.state.pending)?void 0:e.matches)?t:[]].forEach((t=>{t.cancel()}))},loadLocation:async t=>{const a=Math.random();r.startedLoadingAt=a,t&&(r.location=t),r.cancelMatches();const n=r.matchRoutes(location.pathname,{strictParseParams:!0});n.forEach(((t,e)=>{const a=n[e-1],o=n[e+1];a&&t.__.setParentMatch(a),o&&t.__.addChildMatch(o)})),r.state=e({},r.state,{pending:{matches:n,location:r.location}}),r.notify();const o=await r.loadMatches(n,{withPending:!0});if(r.startedLoadingAt!==a)return r.navigationPromise;const i=r.state.matches;i.filter((t=>!o.find((e=>e.matchId===t.matchId)))).forEach((t=>{null==t.__.onExit||t.__.onExit({params:t.params,search:t.routeSearch})})),i.filter((t=>o.find((e=>e.matchId===t.matchId)))).forEach((t=>{null==t.options.onTransition||t.options.onTransition({params:t.params,search:t.routeSearch})})),o.filter((t=>!i.find((e=>e.matchId===t.matchId)))).forEach((t=>{t.__.onExit=null==t.options.onMatch?void 0:t.options.onMatch({params:t.params,search:t.search})})),r.state=e({},r.state,{location:r.location,matches:o,pending:void 0}),o.some((t=>"loading"===t.status))&&(r.notify(),await Promise.all(o.map((t=>t.__.loaderPromise||Promise.resolve())))),r.startedLoadingAt===a&&(r.notify(),r.resolveNavigation())},cleanPreloadCache:()=>{const t=Date.now();Object.keys(r.preloadCache).forEach((e=>{const a=r.preloadCache[e];"loading"!==a.match.status&&(a.match.updatedAt&&a.match.updatedAt+a.maxAge>t||delete r.preloadCache[e])}))},loadRoute:async function(t,e){void 0===t&&(t=r.location);const a=r.buildNext(t),n=r.matchRoutes(a.pathname,{strictParseParams:!0});return await r.loadMatches(n,{preload:!0,maxAge:e.maxAge}),n},matchRoutes:(t,a)=>{var n,o;r.cleanPreloadCache();const i=[];if(!r.routeTree)return i;const s=[...r.state.matches,...null!=(n=null==(o=r.state.pending)?void 0:o.matches)?n:[]],l=async(n,o)=>{var c,u,h,d;let p=null!=(c=null==o?void 0:o.params)?c:{};const f=null!=(u=null==r.options.filterRoutes?void 0:r.options.filterRoutes(n))?u:n,m=null==f?void 0:f.find((n=>{var o,i;const s=!!("/"!==n.routePath||null!=(o=n.childRoutes)&&o.length),l=P(t,{to:n.fullPath,fuzzy:s,caseSensitive:null!=(i=n.options.caseSensitive)?i:r.options.caseSensitive});if(l){let t;try{var c;t=null!=(c=null==n.options.parseParams?void 0:n.options.parseParams(l))?c:l}catch(t){if(null!=a&&a.strictParseParams)throw t}p=e({},p,t)}return!!l}));if(!m)return;const v=b(m.routePath,p),g=b(m.routeId,p,!0),_=s.find((t=>t.matchId===g))||(null==(h=r.preloadCache[g])?void 0:h.match)||y(r,m,{matchId:g,params:p,pathname:S([t,v])});i.push(_),null!=(d=m.childRoutes)&&d.length&&l(m.childRoutes,_)};return l([r.routeTree]),i},loadMatches:async(t,e)=>{const a=t.map((async t=>{t.__.validate(),null!=e&&e.preload&&(r.preloadCache[t.matchId]={maxAge:null==e?void 0:e.maxAge,match:t}),("success"===t.status&&t.isInvalid||"error"===t.status||"idle"===t.status)&&t.load(),null!=e&&e.withPending&&t.__.startPending(),await t.__.loadPromise}));return r.notify(),await Promise.all(a),t},invalidateRoute:t=>{var e,a;const n=r.buildNext(t),o=r.matchRoutes(n.pathname).map((t=>t.matchId));[...r.state.matches,...null!=(e=null==(a=r.state.pending)?void 0:a.matches)?e:[]].forEach((t=>{o.includes(t.matchId)&&(t.isInvalid=!0)}))},reload:()=>r._navigate({fromCurrent:!0,replace:!0,search:!0}),resolvePath:(t,e)=>E(r.basepath,t,I(e)),matchRoute:(t,a)=>{var n;t=e({},t,{to:t.to?r.resolvePath(null!=(n=t.from)?n:"",t.to):void 0});const o=r.buildNext(t);var i;return null!=a&&a.pending?!(null==(i=r.state.pending)||!i.location)&&!!P(r.state.pending.location.pathname,e({},a,{to:o.pathname})):!!P(r.state.location.pathname,e({},a,{to:o.pathname}))},_navigate:t=>{const e=r.buildNext(t);return r.commitLocation(e,t.replace)},navigate:async t=>{let{from:e,to:a=".",search:n,hash:o,replace:i}=t;const s=String(a),l=String(e);let c;try{new URL(""+s),c=!0}catch(t){}if(!c)return r._navigate({from:l,to:s,search:n,hash:o})},buildLink:t=>{var e,a,n;let{from:o,to:i=".",search:s,params:l,hash:c,target:u,replace:h,activeOptions:d,preload:p,preloadMaxAge:f,preloadDelay:m,disabled:v}=t;try{return new URL(""+i),{type:"external",href:i}}catch(t){}const g={from:o,to:i,search:s,params:l,hash:c,replace:h},y=r.buildNext(g);p=null!=(e=p)?e:r.options.defaultLinkPreload;const _=null!=(a=null!=f?f:r.options.defaultLinkPreloadMaxAge)?a:2e3,P=null!=(n=null!=m?m:r.options.defaultLinkPreloadDelay)?n:50,b=r.state.location.pathname===y.pathname,w=r.state.location.pathname.split("/"),R=y.pathname.split("/").every(((t,e)=>t===w[e])),S=r.state.location.hash===y.hash,I=null!=d&&d.exact?b:R,M=null==d||!d.includeHash||S;return{type:"internal",next:y,handleFocus:t=>{p&&_>0&&r.loadRoute(g,{maxAge:_})},handleClick:t=>{v||function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}(t)||t.defaultPrevented||u&&"_self"!==u||0!==t.button||(t.preventDefault(),!b||s||c||r.invalidateRoute(g),r._navigate(g))},handleEnter:t=>{const e=t.target||{};if(p&&_>0){if(e.preloadTimeout)return;e.preloadTimeout=setTimeout((()=>{e.preloadTimeout=null,r.loadRoute(g,{maxAge:_})}),P)}},handleLeave:t=>{const e=t.target||{};e.preloadTimeout&&(clearTimeout(e.preloadTimeout),e.preloadTimeout=null)},isActive:I&&M,disabled:v}},__experimental__createSnapshot:()=>e({},r.state,{matches:r.state.matches.map((t=>{let{routeLoaderData:e,matchId:a}=t;return{matchId:a,loaderData:e}}))})};return r.location=r.parseLocation(o.location),r.state.location=r.location,r.update(t),null==r.options.createRouter||r.options.createRouter(r),r},t.defaultParseSearch=T,t.defaultStringifySearch=O,t.functionalUpdate=R,t.last=B,t.matchByPath=L,t.matchPathname=P,t.parsePathname=x,t.parseSearchWith=D,t.replaceEqualDeep=A,t.resolvePath=E,t.rootRouteId=m,t.stringifySearchWith=j,t.warning=w,Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RouterCore={})}(this,(function(t){"use strict";function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},e.apply(this,arguments)}function n(){return n=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},n.apply(this,arguments)}var a;!function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"}(a||(a={}));var o="beforeunload",r="popstate";function i(t){void 0===t&&(t={});var e=t.window,i=void 0===e?document.defaultView:e,s=i.history;function l(){var t=i.location,e=t.pathname,n=t.search,a=t.hash,o=s.state||{};return[o.idx,{pathname:e,search:n,hash:a,state:o.usr||null,key:o.key||"default"}]}var f=null;i.addEventListener(r,(function(){if(f)P.call(f),f=null;else{var t=a.Pop,e=l(),n=e[0],o=e[1];if(P.length){if(null!=n){var r=g-n;r&&(f={action:t,location:o,retry:function(){M(-1*r)}},M(r))}}else I(t)}}));var m=a.Pop,v=l(),g=v[0],y=v[1],_=u(),P=u();function b(t){return"string"==typeof t?t:d(t)}function w(t,e){return void 0===e&&(e=null),n({pathname:y.pathname,hash:"",search:""},"string"==typeof t?p(t):t,{state:e,key:h()})}function R(t,e){return[{usr:t.state,key:t.key,idx:e},b(t)]}function S(t,e,n){return!P.length||(P.call({action:t,location:e,retry:n}),!1)}function I(t){m=t;var e=l();g=e[0],y=e[1],_.call({action:m,location:y})}function M(t){s.go(t)}null==g&&(g=0,s.replaceState(n({},s.state,{idx:g}),""));var L={get action(){return m},get location(){return y},createHref:b,push:function t(e,n){var o=a.Push,r=w(e,n);if(S(o,r,(function(){t(e,n)}))){var l=R(r,g+1),c=l[0],u=l[1];try{s.pushState(c,"",u)}catch(t){i.location.assign(u)}I(o)}},replace:function t(e,n){var o=a.Replace,r=w(e,n);if(S(o,r,(function(){t(e,n)}))){var i=R(r,g),l=i[0],c=i[1];s.replaceState(l,"",c),I(o)}},go:M,back:function(){M(-1)},forward:function(){M(1)},listen:function(t){return _.push(t)},block:function(t){var e=P.push(t);return 1===P.length&&i.addEventListener(o,c),function(){e(),P.length||i.removeEventListener(o,c)}}};return L}function s(t){void 0===t&&(t={});var e=t,o=e.initialEntries,r=void 0===o?["/"]:o,i=e.initialIndex,s=r.map((function(t){return n({pathname:"/",search:"",hash:"",state:null,key:h()},"string"==typeof t?p(t):t)})),c=l(null==i?s.length-1:i,0,s.length-1),f=a.Pop,m=s[c],v=u(),g=u();function y(t,e){return void 0===e&&(e=null),n({pathname:m.pathname,search:"",hash:""},"string"==typeof t?p(t):t,{state:e,key:h()})}function _(t,e,n){return!g.length||(g.call({action:t,location:e,retry:n}),!1)}function P(t,e){f=t,m=e,v.call({action:f,location:m})}function b(t){var e=l(c+t,0,s.length-1),n=a.Pop,o=s[e];_(n,o,(function(){b(t)}))&&(c=e,P(n,o))}var w={get index(){return c},get action(){return f},get location(){return m},createHref:function(t){return"string"==typeof t?t:d(t)},push:function t(e,n){var o=a.Push,r=y(e,n);_(o,r,(function(){t(e,n)}))&&(c+=1,s.splice(c,s.length,r),P(o,r))},replace:function t(e,n){var o=a.Replace,r=y(e,n);_(o,r,(function(){t(e,n)}))&&(s[c]=r,P(o,r))},go:b,back:function(){b(-1)},forward:function(){b(1)},listen:function(t){return v.push(t)},block:function(t){return g.push(t)}};return w}function l(t,e,n){return Math.min(Math.max(t,e),n)}function c(t){t.preventDefault(),t.returnValue=""}function u(){var t=[];return{get length(){return t.length},push:function(e){return t.push(e),function(){t=t.filter((function(t){return t!==e}))}},call:function(e){t.forEach((function(t){return t&&t(e)}))}}}function h(){return Math.random().toString(36).substr(2,8)}function d(t){var e=t.pathname,n=void 0===e?"/":e,a=t.search,o=void 0===a?"":a,r=t.hash,i=void 0===r?"":r;return o&&"?"!==o&&(n+="?"===o.charAt(0)?o:"?"+o),i&&"#"!==i&&(n+="#"===i.charAt(0)?i:"#"+i),n}function p(t){var e={};if(t){var n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));var a=t.indexOf("?");a>=0&&(e.search=t.substr(a),t=t.substr(0,a)),t&&(e.pathname=t)}return e}function f(t,e){if(!t)throw new Error("Invariant failed")}function m(t){if(!t)return"";var e=decodeURIComponent(t);return"false"!==e&&("true"===e||(0*+e==0?+e:e))}const v="__root__",g=Boolean("undefined"!=typeof window&&window.document&&window.document.createElement);function y(t,n,a,o){const{id:r,routeId:i,path:s,fullPath:l}=t,c=o.state.actions[r]||(o.state.actions[r]={pending:[],submit:async(t,n)=>{var a;if(!u)return;const r=null==(a=null==n?void 0:n.invalidate)||a,i={submittedAt:Date.now(),status:"pending",submission:t};c.latest=i,c.pending.push(i),o.state=e({},o.state,{action:i}),o.notify();try{const e=await(null==u.options.action?void 0:u.options.action(t));return i.data=e,r&&(o.invalidateRoute({to:".",fromCurrent:!0}),await o.reload()),i.status="success",e}catch(t){console.error(t),i.error=t,i.status="error"}finally{c.pending=c.pending.filter((t=>t!==i)),i===o.state.action&&(o.state.action=void 0),o.notify()}}},o.state.actions[r]);let u={routeId:r,routeRouteId:i,routePath:s,fullPath:l,options:n,router:o,childRoutes:void 0,parentRoute:a,action:c,buildLink:t=>o.buildLink(e({},t,{from:l})),navigate:t=>o.navigate(e({},t,{from:l})),matchRoute:(t,n)=>o.matchRoute(e({},t,{from:l}),n)};return null==o.options.createRoute||o.options.createRoute({router:o,route:u}),u}function _(t,n,a){const o=e({},n,a,{router:t,routeSearch:{},search:{},childMatches:[],status:"idle",routeLoaderData:{},loaderData:{},isPending:!1,isFetching:!1,isInvalid:!1,__:{abortController:new AbortController,latestId:"",resolve:()=>{},notify:()=>{o.__.resolve(),o.router.notify()},startPending:()=>{var e,n;const a=null!=(e=o.options.pendingMs)?e:t.options.defaultPendingMs,r=null!=(n=o.options.pendingMinMs)?n:t.options.defaultPendingMinMs;o.__.pendingTimeout||"loading"!==o.status||void 0===a||(o.__.pendingTimeout=setTimeout((()=>{o.isPending=!0,o.__.resolve(),void 0!==r&&(o.__.pendingMinPromise=new Promise((t=>o.__.pendingMinTimeout=setTimeout(t,r))))}),a))},cancelPending:()=>{o.isPending=!1,clearTimeout(o.__.pendingTimeout),clearTimeout(o.__.pendingMinTimeout),delete o.__.pendingMinPromise},setParentMatch:t=>{o.parentMatch=t},addChildMatch:t=>{o.childMatches.find((e=>e.matchId===t.matchId))||o.childMatches.push(t)},validate:()=>{var n,a;const r=null!=(n=null==(a=o.parentMatch)?void 0:a.search)?n:t.location.search;try{const t=o.routeSearch;let n=A(t,null==o.options.validateSearch?void 0:o.options.validateSearch(r));t!==n&&(o.isInvalid=!0),o.routeSearch=n,o.search=A(r,e({},r,n))}catch(t){console.error(t);const e=new Error("Invalid search params found",{cause:t});return e.code="INVALID_SEARCH_PARAMS",o.status="error",void(o.error=e)}}},cancel:()=>{var t;null==(t=o.__.abortController)||t.abort(),o.__.cancelPending()},load:async()=>{const t=""+Date.now()+Math.random();return o.__.latestId=t,"error"!==o.status&&"idle"!==o.status||(o.status="loading"),o.isInvalid=!1,o.__.loadPromise=new Promise((async n=>{o.isFetching=!0,o.__.resolve=n;const a=(async()=>{const n=o.options.import;n&&(o.__.importPromise=n({params:o.params}).then((t=>{o.__=e({},o.__,t)}))),await o.__.importPromise,o.__.elementsPromise=(async()=>{await Promise.all(["element","errorElement","catchElement","pendingElement"].map((async t=>{const e=o.options[t];if(!o.__[t])if("function"==typeof e){const n=await e(o);o.__[t]=n}else o.__[t]=o.options[t]})))})(),o.__.dataPromise=Promise.resolve().then((async()=>{try{const e=await(null==o.options.loader?void 0:o.options.loader({params:o.params,search:o.routeSearch,signal:o.__.abortController.signal}));if(t!==o.__.latestId)return o.__.loaderPromise;o.routeLoaderData=A(o.routeLoaderData,e),P(o),o.error=void 0,o.status="success",o.updatedAt=Date.now()}catch(e){if(t!==o.__.latestId)return o.__.loaderPromise;o.error=e,o.status="error",o.updatedAt=Date.now()}}));try{if(await Promise.all([o.__.elementsPromise,o.__.dataPromise]),t!==o.__.latestId)return o.__.loaderPromise;o.__.pendingMinPromise&&(await o.__.pendingMinPromise,delete o.__.pendingMinPromise)}finally{if(t!==o.__.latestId)return o.__.loaderPromise;o.__.cancelPending(),o.isPending=!1,o.isFetching=!1,o.__.notify()}})();if(o.__.loaderPromise=a,await a,t!==o.__.latestId)return o.__.loaderPromise;delete o.__.loaderPromise})),await o.__.loadPromise}});return o}function P(t){t.parentMatch&&(t.loaderData=A(t.loaderData,e({},t.parentMatch.loaderData,t.routeLoaderData))),t.childMatches.length&&t.childMatches.forEach((t=>{P(t)}))}function b(t,e){const n=L(t,e);if(!e.to||n)return null!=n?n:{}}function w(t,e,n){return S(x(t).map((t=>{return"*"!==t.value||n?"param"===t.type?null!=(a=e[t.value.substring(1)])?a:"":t.value:"";var a})))}function R(t,e){return"function"==typeof t?t(e):t}function S(t){return I(t.filter(Boolean).join("/"))}function I(t){return t.replace(/\/{2,}/g,"/")}function M(t){return"/"===t?t:t.replace(/\/{1,}$/,"")}function L(t,e){var n;const a=x(t),o=x(""+(null!=(n=e.to)?n:"*")),r={};return(()=>{for(let t=0;t<Math.max(a.length,o.length);t++){const n=a[t],i=o[t],s=t===o.length-1,l=t===a.length-1;if(i){if("wildcard"===i.type)return!(null==n||!n.value)&&(r["*"]=S(a.slice(t).map((t=>t.value))),!0);if("pathname"===i.type){if("/"===i.value&&(null==n||!n.value))return!0;if(n)if(e.caseSensitive){if(i.value!==n.value)return!1}else if(i.value.toLowerCase()!==n.value.toLowerCase())return!1}if(!n)return!1;if("param"===i.type){if("/"===(null==n?void 0:n.value))return!1;n.value.startsWith(":")||(r[i.value.substring(1)]=n.value)}}if(s&&!l)return!!e.fuzzy}return!0})()?r:void 0}function x(t){if(!t)return[];const e=[];if("/"===(t=I(t)).slice(0,1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),!t)return e;const n=t.split("/").filter(Boolean);return e.push(...n.map((t=>t.startsWith("*")?{type:"wildcard",value:t}:":"===t.charAt(0)?{type:"param",value:t}:{type:"pathname",value:t}))),"/"===t.slice(-1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),e}function E(t,e,n){e=e.replace(new RegExp("^"+t),"/"),n=n.replace(new RegExp("^"+t),"/");let a=x(e);const o=x(n);o.forEach(((t,e)=>{if("/"===t.value)e?e===o.length-1&&a.push(t):a=[t];else if(".."===t.value){var n;a.length>1&&"/"===(null==(n=B(a))?void 0:n.value)&&a.pop(),a.pop()}else{if("."===t.value)return;a.push(t)}}));return I(S([t,...a.map((t=>t.value))]))}function A(t,e){if(t===e)return t;const n=Array.isArray(t)&&Array.isArray(e);if(n||k(t)&&k(e)){const a=n?t.length:Object.keys(t).length,o=n?e:Object.keys(e),r=o.length,i=n?[]:{};let s=0;for(let a=0;a<r;a++){const r=n?a:o[a];i[r]=A(t[r],e[r]),i[r]===t[r]&&s++}return a===r&&s===a?t:i}return e}function k(t){if(!C(t))return!1;const e=t.constructor;if(void 0===e)return!0;const n=e.prototype;return!!C(n)&&!!n.hasOwnProperty("isPrototypeOf")}function C(t){return"[object Object]"===Object.prototype.toString.call(t)}const T=D(JSON.parse),O=j(JSON.stringify);function D(t){return e=>{"?"===e.substring(0,1)&&(e=e.substring(1));let n=function(t){for(var e,n,a={},o=t.split("&");e=o.shift();)void 0!==a[n=(e=e.split("=")).shift()]?a[n]=[].concat(a[n],m(e.shift())):a[n]=m(e.shift());return a}(e);for(let e in n){const a=n[e];if("string"==typeof a)try{n[e]=t(a)}catch(t){}}return n}}function j(t){return n=>{(n=e({},n))&&Object.keys(n).forEach((e=>{const a=n[e];if(void 0===a||void 0===a)delete n[e];else if(a&&"object"==typeof a&&null!==a)try{n[e]=t(a)}catch(t){}}));const a=function(t,e){var n,a,o,r="";for(n in t)if(void 0!==(o=t[n]))if(Array.isArray(o))for(a=0;a<o.length;a++)r&&(r+="&"),r+=encodeURIComponent(n)+"="+encodeURIComponent(o[a]);else r&&(r+="&"),r+=encodeURIComponent(n)+"="+encodeURIComponent(o);return(e||"")+r}(n).toString();return a?"?"+a:""}}function B(t){return t[t.length-1]}t.createBrowserHistory=i,t.createHashHistory=function(t){void 0===t&&(t={});var e=t.window,i=void 0===e?document.defaultView:e,s=i.history;function l(){var t=p(i.location.hash.substr(1)),e=t.pathname,n=void 0===e?"/":e,a=t.search,o=void 0===a?"":a,r=t.hash,l=void 0===r?"":r,c=s.state||{};return[c.idx,{pathname:n,search:o,hash:l,state:c.usr||null,key:c.key||"default"}]}var f=null;function m(){if(f)b.call(f),f=null;else{var t=a.Pop,e=l(),n=e[0],o=e[1];if(b.length){if(null!=n){var r=y-n;r&&(f={action:t,location:o,retry:function(){L(-1*r)}},L(r))}}else M(t)}}i.addEventListener(r,m),i.addEventListener("hashchange",(function(){d(l()[1])!==d(_)&&m()}));var v=a.Pop,g=l(),y=g[0],_=g[1],P=u(),b=u();function w(t){return function(){var t=document.querySelector("base"),e="";if(t&&t.getAttribute("href")){var n=i.location.href,a=n.indexOf("#");e=-1===a?n:n.slice(0,a)}return e}()+"#"+("string"==typeof t?t:d(t))}function R(t,e){return void 0===e&&(e=null),n({pathname:_.pathname,hash:"",search:""},"string"==typeof t?p(t):t,{state:e,key:h()})}function S(t,e){return[{usr:t.state,key:t.key,idx:e},w(t)]}function I(t,e,n){return!b.length||(b.call({action:t,location:e,retry:n}),!1)}function M(t){v=t;var e=l();y=e[0],_=e[1],P.call({action:v,location:_})}function L(t){s.go(t)}null==y&&(y=0,s.replaceState(n({},s.state,{idx:y}),""));var x={get action(){return v},get location(){return _},createHref:w,push:function t(e,n){var o=a.Push,r=R(e,n);if(I(o,r,(function(){t(e,n)}))){var l=S(r,y+1),c=l[0],u=l[1];try{s.pushState(c,"",u)}catch(t){i.location.assign(u)}M(o)}},replace:function t(e,n){var o=a.Replace,r=R(e,n);if(I(o,r,(function(){t(e,n)}))){var i=S(r,y),l=i[0],c=i[1];s.replaceState(l,"",c),M(o)}},go:L,back:function(){L(-1)},forward:function(){L(1)},listen:function(t){return P.push(t)},block:function(t){var e=b.push(t);return 1===b.length&&i.addEventListener(o,c),function(){e(),b.length||i.removeEventListener(o,c)}}};return x},t.createMemoryHistory=s,t.createRoute=y,t.createRouteConfig=function t(e,n,a,o,r){void 0===e&&(e={}),void 0===a&&(a=!0),a&&(e.path=v),o===v&&(o="");let i=a?v:e.path;i&&"/"!==i&&(i=function(t){return M(function(t){return"/"===t?t:t.replace(/^\/{1,}/,"")}(t))}(i));const s=i||e.id;let l=S([o,s]);i===v&&(i="/"),l!==v&&(l=S(["/",l]));const c=l===v?"/":M(S([r,i]));return{id:l,routeId:s,path:i,fullPath:c,options:e,children:n,addChildren:n=>t(e,n((e=>t(e,void 0,!1,l,c))),!1,o,r)}},t.createRouteMatch=_,t.createRouter=function(t){var n,a;const o=(null==t?void 0:t.history)||(g?i():s());let r={options:e({},t,{stringifySearch:null!=(n=null==t?void 0:t.stringifySearch)?n:O,parseSearch:null!=(a=null==t?void 0:t.parseSearch)?a:T}),listeners:[],basepath:"",routeTree:void 0,routesById:{},location:void 0,allRouteInfo:void 0,navigationPromise:Promise.resolve(),resolveNavigation:()=>{},preloadCache:{},state:{status:"idle",location:null,matches:[],actions:{},loaderData:{},lastUpdated:Date.now()},startedLoadingAt:Date.now(),subscribe:t=>(r.listeners.push(t),()=>{r.listeners=r.listeners.filter((e=>e!==t))}),getRoute:t=>r.routesById[t],notify:()=>{r.state=e({},r.state),r.listeners.forEach((t=>t()))},mount:()=>{const t=r.buildLocation({to:".",search:!0,hash:!0});return t.href!==r.location.href?r.commitLocation(t,!0):r.loadLocation()},update:t=>{Object.assign(r.options,t);const{basepath:e,routeConfig:n}=r.options;return r.basepath=I("/"+(null!=e?e:"")),n&&(r.routesById={},r.routeTree=r.buildRouteTree(n)),r},destroy:o.listen((t=>{r.loadLocation(r.parseLocation(t.location,r.location))})),buildRouteTree:t=>{const e=(t,n)=>t.map((t=>{const a=y(t,t.options,n,r);if(r.routesById[a.routeId])throw new Error;r.routesById[a.routeId]=a;const o=t.children;return a.childRoutes=null!=o&&o.length?e(o,a):void 0,a}));return e([t])[0]},parseLocation:(t,e)=>{var n;const a=r.options.parseSearch(t.search);return{pathname:t.pathname,searchStr:t.search,search:A(null==e?void 0:e.search,a),hash:null!=(n=t.hash.split("#").reverse()[0])?n:"",href:""+t.pathname+t.search+t.hash,state:t.state,key:t.key}},buildLocation:function(t){var e,n,a,o,i,s,l,c,u;void 0===t&&(t={});const h=t.fromCurrent?r.location.pathname:null!=(e=t.from)?e:r.location.pathname;let d=E(null!=(n=r.basepath)?n:"/",h,""+(null!=(a=t.to)?a:"."));const p=r.matchRoutes(r.location.pathname,{strictParseParams:!0}),f=r.matchRoutes(d),m=null==(o=B(p))?void 0:o.params;let v=!0===(null==(i=t.params)||i)?m:R(t.params,m);v&&f.map((t=>t.options.stringifyParams)).filter(Boolean).forEach((t=>{Object.assign(v,t(v))})),d=w(d,null!=v?v:{});const g=null!=(s=t.__preSearchFilters)&&s.length?t.__preSearchFilters.reduce(((t,e)=>e(t)),r.location.search):r.location.search,y=!0===t.search?g:t.search?null!=(l=R(t.search,g))?l:{}:null!=(c=t.__preSearchFilters)&&c.length?g:{},_=null!=(u=t.__postSearchFilters)&&u.length?t.__postSearchFilters.reduce(((t,e)=>e(t)),y):y,P=A(r.location.search,_),b=r.options.stringifySearch(P);let S=!0===t.hash?r.location.hash:R(t.hash,r.location.hash);return S=S?"#"+S:"",{pathname:d,search:P,searchStr:b,state:r.location.state,hash:S,href:""+d+b+S,key:t.key}},commitLocation:(t,e)=>{const n=""+Date.now()+Math.random();r.navigateTimeout&&clearTimeout(r.navigateTimeout);let a="replace";e||(a="push");return r.parseLocation(o.location).href===t.href&&!t.key&&(a="replace"),"replace"===a?o.replace({pathname:t.pathname,hash:t.hash,search:t.searchStr},{id:n}):o.push({pathname:t.pathname,hash:t.hash,search:t.searchStr},{id:n}),r.navigationPromise=new Promise((t=>{const e=r.resolveNavigation;r.resolveNavigation=()=>{e(),t()}})),r.navigationPromise},buildNext:t=>{const n=r.buildLocation(t),a=r.matchRoutes(n.pathname),o=a.map((t=>{var e;return null!=(e=t.options.preSearchFilters)?e:[]})).flat().filter(Boolean),i=a.map((t=>{var e;return null!=(e=t.options.postSearchFilters)?e:[]})).flat().filter(Boolean);return r.buildLocation(e({},t,{__preSearchFilters:o,__postSearchFilters:i}))},cancelMatches:()=>{var t,e;[...r.state.matches,...null!=(t=null==(e=r.state.pending)?void 0:e.matches)?t:[]].forEach((t=>{t.cancel()}))},loadLocation:async t=>{const n=Math.random();r.startedLoadingAt=n,t&&(r.location=t),r.cancelMatches();const a=r.matchRoutes(location.pathname,{strictParseParams:!0});a.forEach(((t,e)=>{const n=a[e-1],o=a[e+1];n&&t.__.setParentMatch(n),o&&t.__.addChildMatch(o)})),r.state=e({},r.state,{pending:{matches:a,location:r.location}}),r.notify();const o=await r.loadMatches(a,{withPending:!0});if(r.startedLoadingAt!==n)return r.navigationPromise;const i=r.state.matches;i.filter((t=>!o.find((e=>e.matchId===t.matchId)))).forEach((t=>{null==t.__.onExit||t.__.onExit({params:t.params,search:t.routeSearch})})),i.filter((t=>o.find((e=>e.matchId===t.matchId)))).forEach((t=>{null==t.options.onTransition||t.options.onTransition({params:t.params,search:t.routeSearch})})),o.filter((t=>!i.find((e=>e.matchId===t.matchId)))).forEach((t=>{t.__.onExit=null==t.options.onMatch?void 0:t.options.onMatch({params:t.params,search:t.search})})),r.state=e({},r.state,{location:r.location,matches:o,pending:void 0}),o.some((t=>"loading"===t.status))&&(r.notify(),await Promise.all(o.map((t=>t.__.loaderPromise||Promise.resolve())))),r.startedLoadingAt===n&&(r.notify(),r.resolveNavigation())},cleanPreloadCache:()=>{const t=Date.now();Object.keys(r.preloadCache).forEach((e=>{const n=r.preloadCache[e];"loading"!==n.match.status&&(n.match.updatedAt&&n.match.updatedAt+n.maxAge>t||delete r.preloadCache[e])}))},loadRoute:async function(t,e){void 0===t&&(t=r.location);const n=r.buildNext(t),a=r.matchRoutes(n.pathname,{strictParseParams:!0});return await r.loadMatches(a,{preload:!0,maxAge:e.maxAge}),a},matchRoutes:(t,n)=>{var a,o;r.cleanPreloadCache();const i=[];if(!r.routeTree)return i;const s=[...r.state.matches,...null!=(a=null==(o=r.state.pending)?void 0:o.matches)?a:[]],l=async a=>{var o,c,u;const h=B(i);let d=null!=(o=null==h?void 0:h.params)?o:{};const p=null!=(c=null==r.options.filterRoutes?void 0:r.options.filterRoutes(a))?c:a;let f=[];const m=(a,o)=>(o.some((o=>{var i,s,l;if(!o.routePath&&null!=(i=o.childRoutes)&&i.length)return m([...f,o],o.childRoutes);const c=!!("/"!==o.routePath||null!=(s=o.childRoutes)&&s.length),u=b(t,{to:o.fullPath,fuzzy:c,caseSensitive:null!=(l=o.options.caseSensitive)?l:r.options.caseSensitive});if(u){let t;try{var h;t=null!=(h=null==o.options.parseParams?void 0:o.options.parseParams(u))?h:u}catch(t){if(null!=n&&n.strictParseParams)throw t}d=e({},d,t)}return u&&(f=[...a,o]),!!f.length})),!!f.length);if(m([],p),!f.length)return;f.forEach((e=>{var n;const a=w(e.routePath,d),o=w(e.routeId,d,!0),l=s.find((t=>t.matchId===o))||(null==(n=r.preloadCache[o])?void 0:n.match)||_(r,e,{matchId:o,params:d,pathname:S([t,a])});i.push(l)}));const v=B(f);null!=(u=v.childRoutes)&&u.length&&l(v.childRoutes)};return l([r.routeTree]),i},loadMatches:async(t,e)=>{const n=t.map((async t=>{t.__.validate(),null!=e&&e.preload&&(r.preloadCache[t.matchId]={maxAge:null==e?void 0:e.maxAge,match:t}),("success"===t.status&&t.isInvalid||"error"===t.status||"idle"===t.status)&&t.load(),null!=e&&e.withPending&&t.__.startPending(),await t.__.loadPromise}));return r.notify(),await Promise.all(n),t},invalidateRoute:t=>{var e,n;const a=r.buildNext(t),o=r.matchRoutes(a.pathname).map((t=>t.matchId));[...r.state.matches,...null!=(e=null==(n=r.state.pending)?void 0:n.matches)?e:[]].forEach((t=>{o.includes(t.matchId)&&(t.isInvalid=!0)}))},reload:()=>r._navigate({fromCurrent:!0,replace:!0,search:!0}),resolvePath:(t,e)=>E(r.basepath,t,I(e)),matchRoute:(t,n)=>{var a;t=e({},t,{to:t.to?r.resolvePath(null!=(a=t.from)?a:"",t.to):void 0});const o=r.buildNext(t);var i;return null!=n&&n.pending?!(null==(i=r.state.pending)||!i.location)&&!!b(r.state.pending.location.pathname,e({},n,{to:o.pathname})):!!b(r.state.location.pathname,e({},n,{to:o.pathname}))},_navigate:t=>{const e=r.buildNext(t);return r.commitLocation(e,t.replace)},navigate:async t=>{let{from:e,to:n=".",search:a,hash:o,replace:i}=t;const s=String(n),l=String(e);let c;try{new URL(""+s),c=!0}catch(t){}return f(!c),r._navigate({from:l,to:s,search:a,hash:o})},buildLink:t=>{var e,n,a;let{from:o,to:i=".",search:s,params:l,hash:c,target:u,replace:h,activeOptions:d,preload:p,preloadMaxAge:f,preloadDelay:m,disabled:v}=t;try{return new URL(""+i),{type:"external",href:i}}catch(t){}const g={from:o,to:i,search:s,params:l,hash:c,replace:h},y=r.buildNext(g);p=null!=(e=p)?e:r.options.defaultLinkPreload;const _=null!=(n=null!=f?f:r.options.defaultLinkPreloadMaxAge)?n:2e3,P=null!=(a=null!=m?m:r.options.defaultLinkPreloadDelay)?a:50,b=r.state.location.pathname===y.pathname,w=r.state.location.pathname.split("/"),R=y.pathname.split("/").every(((t,e)=>t===w[e])),S=r.state.location.hash===y.hash,I=null!=d&&d.exact?b:R,M=null==d||!d.includeHash||S;return{type:"internal",next:y,handleFocus:t=>{p&&_>0&&r.loadRoute(g,{maxAge:_})},handleClick:t=>{v||function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}(t)||t.defaultPrevented||u&&"_self"!==u||0!==t.button||(t.preventDefault(),!b||s||c||r.invalidateRoute(g),r._navigate(g))},handleEnter:t=>{const e=t.target||{};if(p&&_>0){if(e.preloadTimeout)return;e.preloadTimeout=setTimeout((()=>{e.preloadTimeout=null,r.loadRoute(g,{maxAge:_})}),P)}},handleLeave:t=>{const e=t.target||{};e.preloadTimeout&&(clearTimeout(e.preloadTimeout),e.preloadTimeout=null)},isActive:I&&M,disabled:v}},__experimental__createSnapshot:()=>e({},r.state,{matches:r.state.matches.map((t=>{let{routeLoaderData:e,matchId:n}=t;return{matchId:n,loaderData:e}}))})};return r.location=r.parseLocation(o.location),r.state.location=r.location,r.update(t),null==r.options.createRouter||r.options.createRouter(r),r},t.defaultParseSearch=T,t.defaultStringifySearch=O,t.functionalUpdate=R,t.invariant=f,t.last=B,t.matchByPath=L,t.matchPathname=b,t.parsePathname=x,t.parseSearchWith=D,t.replaceEqualDeep=A,t.resolvePath=E,t.rootRouteId=v,t.stringifySearchWith=j,t.warning=function(t,e){if(t){"undefined"!=typeof console&&console.warn(e);try{throw new Error(e)}catch(t){}}return!0},Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=index.production.js.map
{
"name": "@tanstack/router-core",
"author": "Tanner Linsley",
"version": "0.0.1-alpha.3",
"version": "0.0.1-alpha.4",
"license": "MIT",

@@ -43,2 +43,3 @@ "repository": "tanstack/router",

"history": "^5.2.0",
"tiny-invariant": "^1.3.1",
"ts-toolbelt": "^9.6.0"

@@ -45,0 +46,0 @@ },

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 not supported yet

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 not supported yet

Sorry, the diff of this file is not supported yet

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc