Socket
Socket
Sign inDemoInstall

@tanstack/react-router

Package Overview
Dependencies
3
Maintainers
1
Versions
497
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.1-alpha.10 to 0.0.1-alpha.11

30

build/cjs/react-router/src/index.js

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

return {
useRoute: function useRoute(subRouteId) {
if (subRouteId === void 0) {
subRouteId = '.';
}
const resolvedRouteId = router.resolvePath(route.routeId, subRouteId);
const resolvedRoute = router.getRoute(resolvedRouteId);
useRouterSubscription(router);
index.invariant(resolvedRoute, "Could not find a route for route \"" + resolvedRouteId + "\"! Did you forget to add it to your route config?");
return resolvedRoute;
},
linkProps: options => {

@@ -168,8 +179,2 @@ var _functionalUpdate, _functionalUpdate2;

},
useRoute: routeId => {
const route = router.getRoute(routeId);
useRouterSubscription(router);
index.invariant(route, "Could not find a route for route \"" + routeId + "\"! Did you forget to add it to your route config?");
return route;
},
useMatch: routeId => {

@@ -202,2 +207,15 @@ useRouterSubscription(router);

Object.assign(route, routeExt);
},
createElement: async element => {
if (typeof element === 'function') {
const res = await element(); // Support direct import() calls
if (typeof res === 'object' && res.default) {
return /*#__PURE__*/React__namespace.createElement(res.default);
} else {
return res;
}
}
return element;
}

@@ -204,0 +222,0 @@ }));

58

build/stats-react.json

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

{
"uid": "55de-67",
"uid": "f71d-67",
"name": "\u0000rollupPluginBabelHelpers.js"

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

"name": "router-core/build/esm/index.js",
"uid": "55de-69"
"uid": "f71d-69"
},
{
"name": "react-router/src/index.tsx",
"uid": "55de-71"
"uid": "f71d-71"
}

@@ -34,26 +34,26 @@ ]

"nodeParts": {
"55de-67": {
"f71d-67": {
"renderedLength": 798,
"gzipLength": 366,
"brotliLength": 0,
"mainUid": "55de-66"
"mainUid": "f71d-66"
},
"55de-69": {
"renderedLength": 73849,
"gzipLength": 15420,
"f71d-69": {
"renderedLength": 74805,
"gzipLength": 15586,
"brotliLength": 0,
"mainUid": "55de-68"
"mainUid": "f71d-68"
},
"55de-71": {
"renderedLength": 12114,
"gzipLength": 3160,
"f71d-71": {
"renderedLength": 12706,
"gzipLength": 3314,
"brotliLength": 0,
"mainUid": "55de-70"
"mainUid": "f71d-70"
}
},
"nodeMetas": {
"55de-66": {
"f71d-66": {
"id": "\u0000rollupPluginBabelHelpers.js",
"moduleParts": {
"index.production.js": "55de-67"
"index.production.js": "f71d-67"
},

@@ -63,10 +63,10 @@ "imported": [],

{
"uid": "55de-70"
"uid": "f71d-70"
}
]
},
"55de-68": {
"f71d-68": {
"id": "/packages/router-core/build/esm/index.js",
"moduleParts": {
"index.production.js": "55de-69"
"index.production.js": "f71d-69"
},

@@ -76,23 +76,23 @@ "imported": [],

{
"uid": "55de-70"
"uid": "f71d-70"
}
]
},
"55de-70": {
"f71d-70": {
"id": "/packages/react-router/src/index.tsx",
"moduleParts": {
"index.production.js": "55de-71"
"index.production.js": "f71d-71"
},
"imported": [
{
"uid": "55de-66"
"uid": "f71d-66"
},
{
"uid": "55de-72"
"uid": "f71d-72"
},
{
"uid": "55de-73"
"uid": "f71d-73"
},
{
"uid": "55de-68"
"uid": "f71d-68"
}

@@ -103,3 +103,3 @@ ],

},
"55de-72": {
"f71d-72": {
"id": "react",

@@ -110,3 +110,3 @@ "moduleParts": {},

{
"uid": "55de-70"
"uid": "f71d-70"
}

@@ -116,3 +116,3 @@ ],

},
"55de-73": {
"f71d-73": {
"id": "use-sync-external-store/shim",

@@ -123,3 +123,3 @@ "moduleParts": {},

{
"uid": "55de-70"
"uid": "f71d-70"
}

@@ -126,0 +126,0 @@ ],

@@ -12,3 +12,3 @@ /**

import * as React from 'react';
import { AnyRouteConfig, RouteConfig, AnyAllRouteInfo, AllRouteInfo, RootRouteId, RouterState, RouteMatch, ToOptions, MatchRouteOptions, RouteInfoByPath, ResolveRelativePath, NoInfer, DefaultAllRouteInfo, AnyRouteInfo, RouteInfo, ValidFromPath, LinkOptions, RouterOptions, Router } from '@tanstack/router-core';
import { AnyRouteConfig, RouteConfig, AnyAllRouteInfo, AllRouteInfo, RouterState, RouteMatch, ToOptions, MatchRouteOptions, RouteInfoByPath, ResolveRelativePath, NoInfer, DefaultAllRouteInfo, AnyRouteInfo, RouteInfo, CheckId, ToIdOption, ValidFromPath, LinkOptions, RouterOptions, Router } from '@tanstack/router-core';
export * from '@tanstack/router-core';

@@ -19,8 +19,5 @@

Element: React.ReactNode;
AsyncElement: (opts: {
params: Record<string, string>;
}) => Promise<React.ReactNode>;
SyncOrAsyncElement: React.ReactNode | FrameworkGenerics['AsyncElement'];
SyncOrAsyncElement: React.ReactNode | (() => Promise<any>);
}
interface Router<TRouteConfig extends AnyRouteConfig = RouteConfig, TAllRouteInfo extends AnyAllRouteInfo = AllRouteInfo<TRouteConfig>> extends Pick<Route<TAllRouteInfo, TAllRouteInfo['routeInfoById'][RootRouteId]>, 'linkProps' | 'Link' | 'MatchRoute'> {
interface Router<TRouteConfig extends AnyRouteConfig = RouteConfig, TAllRouteInfo extends AnyAllRouteInfo = AllRouteInfo<TRouteConfig>> {
useState: () => RouterState;

@@ -40,2 +37,3 @@ useRoute: <TId extends keyof TAllRouteInfo['routeInfoById']>(routeId: TId) => Route<TAllRouteInfo, TAllRouteInfo['routeInfoById'][TId]>;

interface Route<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TRouteInfo extends AnyRouteInfo = RouteInfo> {
useRoute: <TTo extends string = '.', TResolved extends string = ResolveRelativePath<TRouteInfo['id'], NoInfer<TTo>>>(routeId: CheckId<TAllRouteInfo, TResolved, ToIdOption<TAllRouteInfo, TRouteInfo['id'], TTo>>) => Route<TAllRouteInfo, TAllRouteInfo['routeInfoById'][TResolved]>;
linkProps: <TTo extends string = '.'>(props: LinkPropsOptions<TAllRouteInfo, TRouteInfo['fullPath'], TTo> & React.AnchorHTMLAttributes<HTMLAnchorElement>) => React.AnchorHTMLAttributes<HTMLAnchorElement>;

@@ -42,0 +40,0 @@ Link: <TTo extends string = '.'>(props: LinkPropsOptions<TAllRouteInfo, TRouteInfo['fullPath'], TTo> & React.AnchorHTMLAttributes<HTMLAnchorElement> & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'children'> & {

@@ -21,3 +21,3 @@ /**

* @license MIT
*/function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},l.apply(this,arguments)}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(o||(o={}));var c="beforeunload",u="popstate";function d(e){void 0===e&&(e={});var t=e.window,n=void 0===t?document.defaultView:t,a=n.history;function r(){var e=n.location,t=e.pathname,o=e.search,r=e.hash,i=a.state||{};return[i.idx,{pathname:t,search:o,hash:r,state:i.usr||null,key:i.key||"default"}]}var i=null;n.addEventListener(u,(function(){if(i)P.call(i),i=null;else{var e=o.Pop,t=r(),n=t[0],a=t[1];if(P.length){if(null!=n){var s=h-n;s&&(i={action:e,location:a,retry:function(){M(-1*s)}},M(s))}}else x(e)}}));var s=o.Pop,d=r(),h=d[0],f=d[1],_=m(),P=m();function b(e){return"string"==typeof e?e:g(e)}function w(e,t){return void 0===t&&(t=null),l({pathname:f.pathname,hash:"",search:""},"string"==typeof e?y(e):e,{state:t,key:v()})}function E(e,t){return[{usr:e.state,key:e.key,idx:t},b(e)]}function R(e,t,n){return!P.length||(P.call({action:e,location:t,retry:n}),!1)}function x(e){s=e;var t=r();h=t[0],f=t[1],_.call({action:s,location:f})}function M(e){a.go(e)}null==h&&(h=0,a.replaceState(l({},a.state,{idx:h}),""));var A={get action(){return s},get location(){return f},createHref:b,push:function e(t,r){var i=o.Push,s=w(t,r);if(R(i,s,(function(){e(t,r)}))){var l=E(s,h+1),c=l[0],u=l[1];try{a.pushState(c,"",u)}catch(e){n.location.assign(u)}x(i)}},replace:function e(t,n){var r=o.Replace,i=w(t,n);if(R(r,i,(function(){e(t,n)}))){var s=E(i,h),l=s[0],c=s[1];a.replaceState(l,"",c),x(r)}},go:M,back:function(){M(-1)},forward:function(){M(1)},listen:function(e){return _.push(e)},block:function(e){var t=P.push(e);return 1===P.length&&n.addEventListener(c,p),function(){t(),P.length||n.removeEventListener(c,p)}}};return A}function h(e){void 0===e&&(e={});var t=e,n=t.initialEntries,a=void 0===n?["/"]:n,r=t.initialIndex,i=a.map((function(e){return l({pathname:"/",search:"",hash:"",state:null,key:v()},"string"==typeof e?y(e):e)})),s=f(null==r?i.length-1:r,0,i.length-1),c=o.Pop,u=i[s],d=m(),h=m();function p(e,t){return void 0===t&&(t=null),l({pathname:u.pathname,search:"",hash:""},"string"==typeof e?y(e):e,{state:t,key:v()})}function _(e,t,n){return!h.length||(h.call({action:e,location:t,retry:n}),!1)}function P(e,t){c=e,u=t,d.call({action:c,location:u})}function b(e){var t=f(s+e,0,i.length-1),n=o.Pop,a=i[t];_(n,a,(function(){b(e)}))&&(s=t,P(n,a))}var w={get index(){return s},get action(){return c},get location(){return u},createHref:function(e){return"string"==typeof e?e:g(e)},push:function e(t,n){var a=o.Push,r=p(t,n);_(a,r,(function(){e(t,n)}))&&(s+=1,i.splice(s,i.length,r),P(a,r))},replace:function e(t,n){var a=o.Replace,r=p(t,n);_(a,r,(function(){e(t,n)}))&&(i[s]=r,P(a,r))},go:b,back:function(){b(-1)},forward:function(){b(1)},listen:function(e){return d.push(e)},block:function(e){return h.push(e)}};return w}function f(e,t,n){return Math.min(Math.max(e,t),n)}function p(e){e.preventDefault(),e.returnValue=""}function m(){var e=[];return{get length(){return e.length},push:function(t){return e.push(t),function(){e=e.filter((function(e){return e!==t}))}},call:function(t){e.forEach((function(e){return e&&e(t)}))}}}function v(){return Math.random().toString(36).substr(2,8)}function g(e){var t=e.pathname,n=void 0===t?"/":t,a=e.search,o=void 0===a?"":a,r=e.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 y(e){var t={};if(e){var n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));var a=e.indexOf("?");a>=0&&(t.search=e.substr(a),e=e.substr(0,a)),e&&(t.pathname=e)}return t}function _(e,t){if(!e)throw new Error("Invariant failed")}function P(e,t){if(e===t)return e;const n=Array.isArray(e)&&Array.isArray(t);if(n||b(e)&&b(t)){const a=n?e.length:Object.keys(e).length,o=n?t:Object.keys(t),r=o.length,i=n?[]:{};let s=0;for(let a=0;a<r;a++){const r=n?a:o[a];i[r]=P(e[r],t[r]),i[r]===e[r]&&s++}return a===r&&s===a?e:i}return t}function b(e){if(!w(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!!w(n)&&!!n.hasOwnProperty("isPrototypeOf")}function w(e){return"[object Object]"===Object.prototype.toString.call(e)}function E(e){return e[e.length-1]}function R(e,t){if(e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}return!0}function x(e,t){return"function"==typeof e?e(t):e}function M(e){return A(e.filter(Boolean).join("/"))}function A(e){return e.replace(/\/{2,}/g,"/")}function S(e){return"/"===e?e:e.replace(/^\/{1,}/,"")}function L(e){return"/"===e?e:e.replace(/\/{1,}$/,"")}function I(e){return L(S(e))}function k(e,t,n){t=t.replace(new RegExp("^"+e),"/"),n=n.replace(new RegExp("^"+e),"/");let a=C(t);const o=C(n);o.forEach(((e,t)=>{if("/"===e.value)t?t===o.length-1&&a.push(e):a=[e];else if(".."===e.value){var n;a.length>1&&"/"===(null==(n=E(a))?void 0:n.value)&&a.pop(),a.pop()}else{if("."===e.value)return;a.push(e)}}));return A(M([e,...a.map((e=>e.value))]))}function C(e){if(!e)return[];const t=[];if("/"===(e=A(e)).slice(0,1)&&(e=e.substring(1),t.push({type:"pathname",value:"/"})),!e)return t;const n=e.split("/").filter(Boolean);return t.push(...n.map((e=>e.startsWith("*")?{type:"wildcard",value:e}:":"===e.charAt(0)?{type:"param",value:e}:{type:"pathname",value:e}))),"/"===e.slice(-1)&&(e=e.substring(1),t.push({type:"pathname",value:"/"})),t}function O(e,t,n){return M(C(e).map((e=>{return"*"!==e.value||n?"param"===e.type?null!=(a=t[e.value.substring(1)])?a:"":e.value:"";var a})))}function j(e,t){const n=T(e,t);if(!t.to||n)return null!=n?n:{}}function T(e,t){var n;const a=C(e),o=C(""+(null!=(n=t.to)?n:"*")),r={};return(()=>{for(let e=0;e<Math.max(a.length,o.length);e++){const n=a[e],i=o[e],s=e===o.length-1,l=e===a.length-1;if(i){if("wildcard"===i.type)return!(null==n||!n.value)&&(r["*"]=M(a.slice(e).map((e=>e.value))),!0);if("pathname"===i.type){if("/"===i.value&&(null==n||!n.value))return!0;if(n)if(t.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!!t.fuzzy}return!0})()?r:void 0}function D(e,t){var n,a,o,r="";for(n in e)if(void 0!==(o=e[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(t||"")+r}function F(e){if(!e)return"";var t=decodeURIComponent(e);return"false"!==t&&("true"===t||(0*+t==0?+t:t))}function N(e){for(var t,n,a={},o=e.split("&");t=o.shift();)void 0!==a[n=(t=t.split("=")).shift()]?a[n]=[].concat(a[n],F(t.shift())):a[n]=F(t.shift());return a}function B(){return B=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},B.apply(this,arguments)}function H(e,t,n,a){const{id:o,routeId:r,path:i,fullPath:s}=e,l=a.state.actions[o]||(a.state.actions[o]={pending:[],submit:async(e,t)=>{var n;if(!c)return;const o=null==(n=null==t?void 0:t.invalidate)||n,r={submittedAt:Date.now(),status:"pending",submission:e};l.current=r,l.latest=r,l.pending.push(r),a.state=B({},a.state,{currentAction:r,latestAction:r}),a.notify();try{const t=await(null==c.options.action?void 0:c.options.action(e));return r.data=t,o&&(a.invalidateRoute({to:".",fromCurrent:!0}),await a.reload()),r.status="success",t}catch(e){console.error(e),r.error=e,r.status="error"}finally{l.pending=l.pending.filter((e=>e!==r)),a.removeActionQueue.push({action:l,actionState:r}),a.notify()}}},a.state.actions[o]);let c={routeId:o,routeRouteId:r,routePath:i,fullPath:s,options:t,router:a,childRoutes:void 0,parentRoute:n,action:l,buildLink:e=>a.buildLink(B({},e,{from:s})),navigate:e=>a.navigate(B({},e,{from:s})),matchRoute:(e,t)=>a.matchRoute(B({},e,{from:s}),t)};return null==a.options.createRoute||a.options.createRoute({router:a,route:c}),c}function U(e){e.forEach(((t,n)=>{const a=e[n-1];a&&(t.loaderData=P(t.loaderData,B({},a.loaderData,t.routeLoaderData)))}))}const z="__root__",G=["element","errorElement","catchElement","pendingElement"];function W(e,t,n){const a=B({},t,n,{router:e,routeSearch:{},search:{},childMatches:[],status:"idle",routeLoaderData:{},loaderData:{},isPending:!1,isFetching:!1,isInvalid:!1,invalidAt:1/0,getIsInvalid:()=>{const e=Date.now();return a.isInvalid||a.invalidAt<e},__:{abortController:new AbortController,latestId:"",resolve:()=>{},notify:()=>{a.__.resolve(),a.router.notify()},startPending:()=>{var t,n;const o=null!=(t=a.options.pendingMs)?t:e.options.defaultPendingMs,r=null!=(n=a.options.pendingMinMs)?n:e.options.defaultPendingMinMs;a.__.pendingTimeout||"loading"!==a.status||void 0===o||(a.__.pendingTimeout=setTimeout((()=>{a.isPending=!0,a.__.resolve(),void 0!==r&&(a.__.pendingMinPromise=new Promise((e=>a.__.pendingMinTimeout=setTimeout(e,r))))}),o))},cancelPending:()=>{a.isPending=!1,clearTimeout(a.__.pendingTimeout),clearTimeout(a.__.pendingMinTimeout),delete a.__.pendingMinPromise},validate:()=>{var t,n;const o=null!=(t=null==(n=a.parentMatch)?void 0:n.search)?t:e.location.search;try{const e=a.routeSearch,t="object"==typeof a.options.validateSearch?a.options.validateSearch.parse:a.options.validateSearch;let n=P(e,null==t?void 0:t(o));e!==n&&(a.isInvalid=!0),a.routeSearch=n,a.search=P(o,B({},o,n))}catch(e){console.error(e);const t=new Error("Invalid search params found",{cause:e});return t.code="INVALID_SEARCH_PARAMS",a.status="error",void(a.error=t)}}},cancel:()=>{var e;null==(e=a.__.abortController)||e.abort(),a.__.cancelPending()},invalidate:()=>{a.isInvalid=!0},hasLoaders:()=>!(!t.options.loader&&!G.some((e=>"function"==typeof t.options[e]))),load:async t=>{const n=""+Date.now()+Math.random();return a.__.latestId=n,"idle"===a.status&&(a.status="loading"),a.isInvalid=!1,a.__.loadPromise=new Promise((async o=>{a.isFetching=!0,a.__.resolve=o;const r=(async()=>{a.__.elementsPromise=(async()=>{await Promise.all(G.map((async e=>{const t=a.options[e];if(!a.__[e])if("function"==typeof t){const n=await t(a);a.__[e]=n}else a.__[e]=a.options[e]})))})(),a.__.dataPromise=Promise.resolve().then((async()=>{try{var o,r,i;if(a.options.loader){const e=await a.options.loader({params:a.params,search:a.routeSearch,signal:a.__.abortController.signal});if(n!==a.__.latestId)return a.__.loaderPromise;a.routeLoaderData=P(a.routeLoaderData,e)}a.error=void 0,a.status="success",a.updatedAt=Date.now(),a.invalidAt=a.updatedAt+(null!=(o=null!=(r=null!=(i=null==t?void 0:t.maxAge)?i:a.options.loaderMaxAge)?r:e.options.defaultLoaderMaxAge)?o:0)}catch(e){if(n!==a.__.latestId)return a.__.loaderPromise;a.error=e,a.status="error",a.updatedAt=Date.now()}}));try{if(await Promise.all([a.__.elementsPromise,a.__.dataPromise]),n!==a.__.latestId)return a.__.loaderPromise;a.__.pendingMinPromise&&(await a.__.pendingMinPromise,delete a.__.pendingMinPromise)}finally{if(n!==a.__.latestId)return a.__.loaderPromise;a.__.cancelPending(),a.isPending=!1,a.isFetching=!1,a.__.notify()}})();if(a.__.loaderPromise=r,await r,n!==a.__.latestId)return a.__.loaderPromise;delete a.__.loaderPromise})),await a.__.loadPromise}});return a.hasLoaders()||(a.status="success"),a}const q=Q(JSON.parse),K=V(JSON.stringify);function Q(e){return t=>{"?"===t.substring(0,1)&&(t=t.substring(1));let n=N(t);for(let t in n){const a=n[t];if("string"==typeof a)try{n[t]=e(a)}catch(e){}}return n}}function V(e){return t=>{(t=B({},t))&&Object.keys(t).forEach((n=>{const a=t[n];if(void 0===a||void 0===a)delete t[n];else if(a&&"object"==typeof a&&null!==a)try{t[n]=e(a)}catch(e){}}));const n=D(t).toString();return n?"?"+n:""}}var J;const X=Boolean("undefined"==typeof window||!(null!=(J=window.document)&&J.createElement));function Y(e){var t,n;const a=(null==e?void 0:e.history)||(X?h():d()),o=B({defaultLoaderGcMaxAge:3e5,defaultLoaderMaxAge:0,defaultPreloadMaxAge:2e3,defaultPreloadDelay:50},e,{stringifySearch:null!=(t=null==e?void 0:e.stringifySearch)?t:K,parseSearch:null!=(n=null==e?void 0:e.parseSearch)?n:q});let r={history:a,options:o,listeners:[],removeActionQueue:[],basepath:"",routeTree:void 0,routesById:{},location:void 0,allRouteInfo:void 0,navigationPromise:Promise.resolve(),resolveNavigation:()=>{},matchCache:{},state:{status:"idle",location:null,matches:[],actions:{},loaderData:{},lastUpdated:Date.now(),isFetching:!1,isPreloading:!1},startedLoadingAt:Date.now(),subscribe:e=>(r.listeners.push(e),()=>{r.listeners=r.listeners.filter((t=>t!==e))}),getRoute:e=>r.routesById[e],notify:()=>{r.state=B({},r.state,{isFetching:"loading"===r.state.status||r.state.matches.some((e=>e.isFetching)),isPreloading:Object.values(r.matchCache).some((e=>e.match.isFetching&&!r.state.matches.find((t=>t.matchId===e.match.matchId))))}),U(r.state.matches),r.listeners.forEach((e=>e()))},mount:()=>{const e=r.__.buildLocation({to:".",search:!0,hash:!0});e.href!==r.location.href?r.__.commitLocation(e,!0):r.loadLocation();const t=a.listen((e=>{r.loadLocation(r.__.parseLocation(e.location,r.location))}));return!X&&window.addEventListener&&(window.addEventListener("visibilitychange",r.onFocus,!1),window.addEventListener("focus",r.onFocus,!1)),()=>{t(),window.removeEventListener("visibilitychange",r.onFocus),window.removeEventListener("focus",r.onFocus)}},onFocus:()=>{r.loadLocation()},update:e=>{Object.assign(r.options,e);const{basepath:t,routeConfig:n}=r.options;return r.basepath=A("/"+(null!=t?t:"")),n&&(r.routesById={},r.routeTree=r.__.buildRouteTree(n)),r},cancelMatches:()=>{var e,t;[...r.state.matches,...null!=(e=null==(t=r.state.pending)?void 0:t.matches)?e:[]].forEach((e=>{e.cancel()}))},loadLocation:async e=>{const t=Math.random();r.startedLoadingAt=t,e&&(r.location=e),r.removeActionQueue.forEach((e=>{let{action:t,actionState:n}=e;r.state.currentAction===n&&(r.state.currentAction=void 0),t.current===n&&(t.current=void 0)})),r.removeActionQueue=[],r.cancelMatches();const n=r.matchRoutes(location.pathname,{strictParseParams:!0});if(r.state=B({},r.state,{pending:{matches:n,location:r.location},status:"loading"}),r.notify(),await r.loadMatches(n,{withPending:!0}),r.startedLoadingAt!==t)return r.navigationPromise;const a=r.state.matches,o=[],i=[];a.forEach((e=>{n.find((t=>t.matchId===e.matchId))?i.push(e):o.push(e)}));const s=Date.now();o.forEach((e=>{var t,n,a,o;null==e.__.onExit||e.__.onExit({params:e.params,search:e.routeSearch}),"error"!==e.status||e.isFetching||(e.status="idle",e.error=void 0);const i=Math.max(null!=(t=null!=(n=e.options.loaderGcMaxAge)?n:r.options.defaultLoaderGcMaxAge)?t:0,null!=(a=null!=(o=e.options.loaderMaxAge)?o:r.options.defaultLoaderMaxAge)?a:0);i>0&&(r.matchCache[e.matchId]={gc:i==1/0?Number.MAX_SAFE_INTEGER:s+i,match:e})})),i.forEach((e=>{null==e.options.onTransition||e.options.onTransition({params:e.params,search:e.routeSearch})}));n.filter((e=>!a.find((t=>t.matchId===e.matchId)))).forEach((e=>{e.__.onExit=null==e.options.onMatch?void 0:e.options.onMatch({params:e.params,search:e.search}),delete r.matchCache[e.matchId]})),n.some((e=>"loading"===e.status))&&(r.notify(),await Promise.all(n.map((e=>e.__.loaderPromise||Promise.resolve())))),r.startedLoadingAt===t&&(r.state=B({},r.state,{location:r.location,matches:n,pending:void 0,status:"idle"}),r.notify(),r.resolveNavigation())},cleanMatchCache:()=>{const e=Date.now();Object.keys(r.matchCache).forEach((t=>{const n=r.matchCache[t];"loading"!==n.match.status&&(n.gc>0&&n.gc>e||delete r.matchCache[t])}))},loadRoute:async function(e){void 0===e&&(e=r.location);const t=r.buildNext(e),n=r.matchRoutes(t.pathname,{strictParseParams:!0});return await r.loadMatches(n),n},preloadRoute:async function(e,t){var n,a,o,i,s,l;void 0===e&&(e=r.location);const c=r.buildNext(e),u=r.matchRoutes(c.pathname,{strictParseParams:!0});return await r.loadMatches(u,{preload:!0,maxAge:null!=(n=null!=(a=null!=(o=t.maxAge)?o:r.options.defaultPreloadMaxAge)?a:r.options.defaultLoaderMaxAge)?n:0,gcMaxAge:null!=(i=null!=(s=null!=(l=t.gcMaxAge)?l:r.options.defaultPreloadGcMaxAge)?s:r.options.defaultLoaderGcMaxAge)?i:0}),u},matchRoutes:(e,t)=>{var n,a;r.cleanMatchCache();const o=[];if(!r.routeTree)return o;const i=[...r.state.matches,...null!=(n=null==(a=r.state.pending)?void 0:a.matches)?n:[]],s=async n=>{var a,l,c;const u=E(o);let d=null!=(a=null==u?void 0:u.params)?a:{};const h=null!=(l=null==r.options.filterRoutes?void 0:r.options.filterRoutes(n))?l:n;let f=[];const p=(n,a)=>(a.some((a=>{var o,i,s;if(!a.routePath&&null!=(o=a.childRoutes)&&o.length)return p([...f,a],a.childRoutes);const l=!!("/"!==a.routePath||null!=(i=a.childRoutes)&&i.length),c=j(e,{to:a.fullPath,fuzzy:l,caseSensitive:null!=(s=a.options.caseSensitive)?s:r.options.caseSensitive});if(c){let e;try{var u;e=null!=(u=null==a.options.parseParams?void 0:a.options.parseParams(c))?u:c}catch(e){if(null!=t&&t.strictParseParams)throw e}d=B({},d,e)}return c&&(f=[...n,a]),!!f.length})),!!f.length);if(p([],h),!f.length)return;f.forEach((t=>{var n;const a=O(t.routePath,d),s=O(t.routeId,d,!0),l=i.find((e=>e.matchId===s))||(null==(n=r.matchCache[s])?void 0:n.match)||W(r,t,{matchId:s,params:d,pathname:M([e,a])});o.push(l)}));const m=E(f);null!=(c=m.childRoutes)&&c.length&&s(m.childRoutes)};return s([r.routeTree]),U(o),o},loadMatches:async(e,t)=>{const n=Date.now(),a=null!=t&&t.preload?Math.max(null==t?void 0:t.maxAge,null==t?void 0:t.gcMaxAge):0,o=e.map((async e=>{if(e.__.validate(),null!=t&&t.preload&&a>0){if(r.state.matches.find((t=>t.matchId===e.matchId)))return;r.matchCache[e.matchId]={gc:n+t.gcMaxAge,match:e}}if("success"===e.status&&e.getIsInvalid()||"error"===e.status||"idle"===e.status){const n=null!=t&&t.preload?null==t?void 0:t.maxAge:void 0;e.load({maxAge:n})}"loading"===e.status&&(null!=t&&t.withPending&&e.__.startPending(),await e.__.loadPromise)}));r.notify(),await Promise.all(o)},invalidateRoute:e=>{var t,n;const a=r.buildNext(e),o=r.matchRoutes(a.pathname).map((e=>e.matchId));[...r.state.matches,...null!=(t=null==(n=r.state.pending)?void 0:n.matches)?t:[]].forEach((e=>{o.includes(e.matchId)&&e.invalidate()}))},reload:()=>r.__.navigate({fromCurrent:!0,replace:!0,search:!0}),resolvePath:(e,t)=>k(r.basepath,e,A(t)),matchRoute:(e,t)=>{var n;e=B({},e,{to:e.to?r.resolvePath(null!=(n=e.from)?n:"",e.to):void 0});const a=r.buildNext(e);var o;return null!=t&&t.pending?!(null==(o=r.state.pending)||!o.location)&&!!j(r.state.pending.location.pathname,B({},t,{to:a.pathname})):!!j(r.state.location.pathname,B({},t,{to:a.pathname}))},navigate:async e=>{let{from:t,to:n=".",search:a,hash:o,replace:i,params:s}=e;const l=String(n),c=String(t);let u;try{new URL(""+l),u=!0}catch(e){}return _(!u),r.__.navigate({from:c,to:l,search:a,hash:o,replace:i,params:s})},buildLink:e=>{var t,n;let{from:a,to:o=".",search:i,params:s,hash:l,target:c,replace:u,activeOptions:d,preload:h,preloadMaxAge:f,preloadGcMaxAge:p,preloadDelay:m,disabled:v}=e;try{return new URL(""+o),{type:"external",href:o}}catch(e){}const g={from:a,to:o,search:i,params:s,hash:l,replace:u},y=r.buildNext(g);h=null!=(t=h)?t:r.options.defaultPreload;const _=null!=(n=null!=m?m:r.options.defaultPreloadDelay)?n:0,P=r.state.location.pathname===y.pathname,b=r.state.location.pathname.split("/"),w=y.pathname.split("/").every(((e,t)=>e===b[t])),E=r.state.location.hash===y.hash,R=null!=d&&d.exact?P:w,x=null==d||!d.includeHash||E;return{type:"internal",next:y,handleFocus:e=>{h&&r.preloadRoute(g,{maxAge:f,gcMaxAge:p})},handleClick:e=>{v||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||e.defaultPrevented||c&&"_self"!==c||0!==e.button||(e.preventDefault(),!P||i||l||r.invalidateRoute(g),r.__.navigate(g))},handleEnter:e=>{const t=e.target||{};if(h){if(t.preloadTimeout)return;t.preloadTimeout=setTimeout((()=>{t.preloadTimeout=null,r.preloadRoute(g,{maxAge:f,gcMaxAge:p})}),_)}},handleLeave:e=>{const t=e.target||{};t.preloadTimeout&&(clearTimeout(t.preloadTimeout),t.preloadTimeout=null)},isActive:R&&x,disabled:v}},buildNext:e=>{const t=r.__.buildLocation(e),n=r.matchRoutes(t.pathname),a=n.map((e=>{var t;return null!=(t=e.options.preSearchFilters)?t:[]})).flat().filter(Boolean),o=n.map((e=>{var t;return null!=(t=e.options.postSearchFilters)?t:[]})).flat().filter(Boolean);return r.__.buildLocation(B({},e,{__preSearchFilters:a,__postSearchFilters:o}))},__:{buildRouteTree:e=>{const t=(e,n)=>e.map((e=>{const a=H(e,e.options,n,r);if(r.routesById[a.routeId])throw new Error;r.routesById[a.routeId]=a;const o=e.children;return a.childRoutes=null!=o&&o.length?t(o,a):void 0,a}));return t([e])[0]},parseLocation:(e,t)=>{var n;const a=r.options.parseSearch(e.search);return{pathname:e.pathname,searchStr:e.search,search:P(null==t?void 0:t.search,a),hash:null!=(n=e.hash.split("#").reverse()[0])?n:"",href:""+e.pathname+e.search+e.hash,state:e.state,key:e.key}},navigate:e=>{const t=r.buildNext(e);return r.__.commitLocation(t,e.replace)},buildLocation:function(e){var t,n,a,o,i,s,l,c,u;void 0===e&&(e={});const d=e.fromCurrent?r.location.pathname:null!=(t=e.from)?t:r.location.pathname;let h=k(null!=(n=r.basepath)?n:"/",d,""+(null!=(a=e.to)?a:"."));const f=r.matchRoutes(r.location.pathname,{strictParseParams:!0}),p=r.matchRoutes(h),m=B({},null==(o=E(f))?void 0:o.params);let v=!0===(null==(i=e.params)||i)?m:x(e.params,m);v&&p.map((e=>e.options.stringifyParams)).filter(Boolean).forEach((e=>{Object.assign({},v,e(v))})),h=O(h,null!=v?v:{});const g=null!=(s=e.__preSearchFilters)&&s.length?e.__preSearchFilters.reduce(((e,t)=>t(e)),r.location.search):r.location.search,y=!0===e.search?g:e.search?null!=(l=x(e.search,g))?l:{}:null!=(c=e.__preSearchFilters)&&c.length?g:{},_=null!=(u=e.__postSearchFilters)&&u.length?e.__postSearchFilters.reduce(((e,t)=>t(e)),y):y,b=P(r.location.search,_),w=r.options.stringifySearch(b);let R=!0===e.hash?r.location.hash:x(e.hash,r.location.hash);return R=R?"#"+R:"",{pathname:h,search:b,searchStr:w,state:r.location.state,hash:R,href:""+h+w+R,key:e.key}},commitLocation:(e,t)=>{const n=""+Date.now()+Math.random();r.navigateTimeout&&clearTimeout(r.navigateTimeout);let o="replace";t||(o="push");return r.__.parseLocation(a.location).href===e.href&&!e.key&&(o="replace"),"replace"===o?a.replace({pathname:e.pathname,hash:e.hash,search:e.searchStr},{id:n}):a.push({pathname:e.pathname,hash:e.hash,search:e.searchStr},{id:n}),r.navigationPromise=new Promise((e=>{const t=r.resolveNavigation;r.resolveNavigation=()=>{t(),e()}})),r.navigationPromise}}};return r.location=r.__.parseLocation(a.location),r.state.location=r.location,r.update(e),null==r.options.createRouter||r.options.createRouter(r),r}const $=["type","children","target","activeProps","inactiveProps","activeOptions","disabled","hash","search","params","to","preload","preloadDelay","preloadMaxAge","replace","style","className","onClick","onFocus","onMouseEnter","onMouseLeave","onTouchStart","onTouchEnd"],Z=["pending","caseSensitive","children"],ee=["children","router"],te=r.createContext(null),ne=r.createContext(null),ae=Boolean("undefined"!=typeof window&&window.document&&window.document.createElement)?r.useLayoutEffect:r.useEffect;function oe(e){return r.createElement(te.Provider,e)}const re=e=>{n.useSyncExternalStore((t=>e.subscribe((()=>t()))),(()=>e.state))};function ie(){const e=r.useContext(ne);return R(!e,"useRouter must be used inside a <Router> component!"),re(e.router),e.router}function se(){return r.useContext(te)}function le(){var e;const t=ie(),[,...n]=se(),a=n[0];if(!a)return null;const o=(()=>{var e,n;if(!a)return null;const o=null!=(e=a.__.errorElement)?e:t.options.defaultErrorElement;if("error"===a.status){if(o)return o;if(a.options.useErrorBoundary||t.options.useErrorBoundary)throw a.error;return r.createElement(ue,{error:a.error})}if("loading"===a.status||"idle"===a.status){if(a.isPending){var i;const e=null!=(i=a.__.pendingElement)?i:t.options.defaultPendingElement;var s;if(a.options.pendingMs||e)return null!=(s=e)?s:null}return null}return null!=(n=a.__.element)?n:t.options.defaultElement})(),i=null!=(e=null==a?void 0:a.options.catchElement)?e:t.options.defaultCatchElement;return r.createElement(oe,{value:n,key:a.matchId},r.createElement(ce,{catchElement:i},o))}class ce extends r.Component{constructor(){super(...arguments),this.state={error:!1},this.reset=()=>{this.setState({error:!1,info:!1})}}componentDidCatch(e,t){console.error(e),this.setState({error:e,info:t})}render(){var e;const t=null!=(e=this.props.catchElement)?e:ue;return this.state.error?"function"==typeof t?t(this.state):t:this.props.children}}function ue(e){let{error:t}=e;return r.createElement("div",{style:{padding:".5rem",maxWidth:"100%"}},r.createElement("strong",{style:{fontSize:"1.2rem"}},"Something went wrong!"),r.createElement("div",{style:{height:".5rem"}}),r.createElement("div",null,r.createElement("pre",null,t.message?r.createElement("code",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".5rem",color:"red"}},t.message):null)),r.createElement("div",{style:{height:"1rem"}}),r.createElement("div",{style:{fontSize:".8em",borderLeft:"3px solid rgba(127, 127, 127, 1)",paddingLeft:".5rem",opacity:.5}},"If you are the owner of this website, it's highly recommended that you configure your own custom Catch/Error boundaries for the router. You can optionally configure a boundary for each route."))}function de(e,t){const n=ie();r.useEffect((()=>{if(!t)return;let a=n.history.block((t=>{window.confirm(e)?(a(),t.retry()):n.location.pathname=window.location.pathname}));return a}),[t,location,e])}e.DefaultErrorBoundary=ue,e.MatchesProvider=oe,e.Outlet=le,e.Prompt=function(e){let{message:t,when:n,children:a}=e;return de(t,null==n||n),null!=a?a:null},e.RouterProvider=function(e){let{children:t,router:n}=e,a=s(e,ee);return n.update(a),re(n),ae((()=>n.mount()),[n]),r.createElement(ne.Provider,{value:{router:n}},r.createElement(oe,{value:n.state.matches},null!=t?t:r.createElement(le,null)))},e.cascadeLoaderData=U,e.cleanPath=A,e.createBrowserHistory=d,e.createHashHistory=function(e){void 0===e&&(e={});var t=e.window,n=void 0===t?document.defaultView:t,a=n.history;function r(){var e=y(n.location.hash.substr(1)),t=e.pathname,o=void 0===t?"/":t,r=e.search,i=void 0===r?"":r,s=e.hash,l=void 0===s?"":s,c=a.state||{};return[c.idx,{pathname:o,search:i,hash:l,state:c.usr||null,key:c.key||"default"}]}var i=null;function s(){if(i)b.call(i),i=null;else{var e=o.Pop,t=r(),n=t[0],a=t[1];if(b.length){if(null!=n){var s=f-n;s&&(i={action:e,location:a,retry:function(){A(-1*s)}},A(s))}}else M(e)}}n.addEventListener(u,s),n.addEventListener("hashchange",(function(){g(r()[1])!==g(_)&&s()}));var d=o.Pop,h=r(),f=h[0],_=h[1],P=m(),b=m();function w(e){return function(){var e=document.querySelector("base"),t="";if(e&&e.getAttribute("href")){var a=n.location.href,o=a.indexOf("#");t=-1===o?a:a.slice(0,o)}return t}()+"#"+("string"==typeof e?e:g(e))}function E(e,t){return void 0===t&&(t=null),l({pathname:_.pathname,hash:"",search:""},"string"==typeof e?y(e):e,{state:t,key:v()})}function R(e,t){return[{usr:e.state,key:e.key,idx:t},w(e)]}function x(e,t,n){return!b.length||(b.call({action:e,location:t,retry:n}),!1)}function M(e){d=e;var t=r();f=t[0],_=t[1],P.call({action:d,location:_})}function A(e){a.go(e)}null==f&&(f=0,a.replaceState(l({},a.state,{idx:f}),""));var S={get action(){return d},get location(){return _},createHref:w,push:function e(t,r){var i=o.Push,s=E(t,r);if(x(i,s,(function(){e(t,r)}))){var l=R(s,f+1),c=l[0],u=l[1];try{a.pushState(c,"",u)}catch(e){n.location.assign(u)}M(i)}},replace:function e(t,n){var r=o.Replace,i=E(t,n);if(x(r,i,(function(){e(t,n)}))){var s=R(i,f),l=s[0],c=s[1];a.replaceState(l,"",c),M(r)}},go:A,back:function(){A(-1)},forward:function(){A(1)},listen:function(e){return P.push(e)},block:function(e){var t=b.push(e);return 1===b.length&&n.addEventListener(c,p),function(){t(),b.length||n.removeEventListener(c,p)}}};return S},e.createMemoryHistory=h,e.createReactRouter=function(e){const t=(e,t)=>({linkProps:t=>{var n,a;const{target:o,activeProps:r=(()=>({className:"active"})),inactiveProps:l=(()=>({})),disabled:c,style:u,className:d,onClick:h,onFocus:f,onMouseEnter:p,onMouseLeave:m}=t,v=s(t,$),g=e.buildLink(t);if("external"===g.type){const{href:e}=g;return{href:e}}const{handleClick:y,handleFocus:_,handleEnter:P,handleLeave:b,isActive:w,next:E}=g,R=e=>t=>{t.persist(),e.forEach((e=>{e&&e(t)}))},M=w&&null!=(n=x(r,{}))?n:{},A=w?{}:null!=(a=x(l,{}))?a:{};return i({},M,A,v,{href:c?void 0:E.href,onClick:R([y,h]),onFocus:R([_,f]),onMouseEnter:R([P,p]),onMouseLeave:R([b,m]),target:o,style:i({},u,M.style,A.style),className:[d,M.className,A.className].filter(Boolean).join(" ")||void 0},c?{role:"link","aria-disabled":!0}:void 0,{"data-status":w?"active":void 0})},Link:r.forwardRef(((n,a)=>{const o=e.linkProps(n);return re(t),r.createElement("a",i({ref:a},o,{children:"function"==typeof n.children?n.children({isActive:"active"===o["data-status"]}):n.children}))})),MatchRoute:t=>{const{pending:n,caseSensitive:a}=t,o=s(t,Z),r=e.matchRoute(o,{pending:n,caseSensitive:a});return r?"function"==typeof t.children?t.children(r):t.children:null}});return Y(i({},e,{createRouter:e=>{const n={useState:()=>(re(e),e.state),useRoute:t=>{const n=e.getRoute(t);return re(e),_(n),n},useMatch:t=>{re(e),_(t!==z);const n=null==(a=se())?void 0:a[0];var a;const o=e.state.matches.find((e=>e.routeId===t));return _(o),_(n.routeId==(null==o?void 0:o.routeId),(null==o||o.routeId,n.routeId,null==o||o.routeId)),o||_("Match not found!"),o}},a=t(e.getRoute("/"),e);Object.assign(e,n,a)},createRoute:e=>{let{router:n,route:a}=e;const o=t(a,n);Object.assign(a,o)}}))},e.createRoute=H,e.createRouteConfig=function e(t,n,a,o,r){void 0===t&&(t={}),void 0===a&&(a=!0),a&&(t.path=z),o===z&&(o="");let i=a?z:t.path;i&&"/"!==i&&(i=I(i));const s=i||t.id;let l=M([o,s]);i===z&&(i="/"),l!==z&&(l=M(["/",l]));const c=l===z?"/":L(M([r,i]));return{id:l,routeId:s,path:i,fullPath:c,options:t,children:n,createChildren:n=>e(t,n((t=>e(t,void 0,!1,l,c))),!1,o,r),addChildren:n=>e(t,n,!1,o,r),createRoute:t=>e(t,void 0,!1,l,c)}},e.createRouteMatch=W,e.createRouter=Y,e.decode=N,e.defaultParseSearch=q,e.defaultStringifySearch=K,e.encode=D,e.functionalUpdate=x,e.interpolatePath=O,e.invariant=_,e.joinPaths=M,e.last=E,e.matchByPath=T,e.matchPathname=j,e.parsePathname=C,e.parseSearchWith=Q,e.replaceEqualDeep=P,e.resolvePath=k,e.rootRouteId=z,e.stringifySearchWith=V,e.trimPath=I,e.trimPathLeft=S,e.trimPathRight=L,e.usePrompt=de,e.warning=R,Object.defineProperty(e,"__esModule",{value:!0})}));
*/function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},l.apply(this,arguments)}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(o||(o={}));var c="beforeunload",u="popstate";function d(e){void 0===e&&(e={});var t=e.window,n=void 0===t?document.defaultView:t,a=n.history;function r(){var e=n.location,t=e.pathname,o=e.search,r=e.hash,i=a.state||{};return[i.idx,{pathname:t,search:o,hash:r,state:i.usr||null,key:i.key||"default"}]}var i=null;n.addEventListener(u,(function(){if(i)P.call(i),i=null;else{var e=o.Pop,t=r(),n=t[0],a=t[1];if(P.length){if(null!=n){var s=h-n;s&&(i={action:e,location:a,retry:function(){M(-1*s)}},M(s))}}else R(e)}}));var s=o.Pop,d=r(),h=d[0],f=d[1],_=m(),P=m();function b(e){return"string"==typeof e?e:g(e)}function w(e,t){return void 0===t&&(t=null),l({pathname:f.pathname,hash:"",search:""},"string"==typeof e?y(e):e,{state:t,key:v()})}function E(e,t){return[{usr:e.state,key:e.key,idx:t},b(e)]}function x(e,t,n){return!P.length||(P.call({action:e,location:t,retry:n}),!1)}function R(e){s=e;var t=r();h=t[0],f=t[1],_.call({action:s,location:f})}function M(e){a.go(e)}null==h&&(h=0,a.replaceState(l({},a.state,{idx:h}),""));var A={get action(){return s},get location(){return f},createHref:b,push:function e(t,r){var i=o.Push,s=w(t,r);if(x(i,s,(function(){e(t,r)}))){var l=E(s,h+1),c=l[0],u=l[1];try{a.pushState(c,"",u)}catch(e){n.location.assign(u)}R(i)}},replace:function e(t,n){var r=o.Replace,i=w(t,n);if(x(r,i,(function(){e(t,n)}))){var s=E(i,h),l=s[0],c=s[1];a.replaceState(l,"",c),R(r)}},go:M,back:function(){M(-1)},forward:function(){M(1)},listen:function(e){return _.push(e)},block:function(e){var t=P.push(e);return 1===P.length&&n.addEventListener(c,p),function(){t(),P.length||n.removeEventListener(c,p)}}};return A}function h(e){void 0===e&&(e={});var t=e,n=t.initialEntries,a=void 0===n?["/"]:n,r=t.initialIndex,i=a.map((function(e){return l({pathname:"/",search:"",hash:"",state:null,key:v()},"string"==typeof e?y(e):e)})),s=f(null==r?i.length-1:r,0,i.length-1),c=o.Pop,u=i[s],d=m(),h=m();function p(e,t){return void 0===t&&(t=null),l({pathname:u.pathname,search:"",hash:""},"string"==typeof e?y(e):e,{state:t,key:v()})}function _(e,t,n){return!h.length||(h.call({action:e,location:t,retry:n}),!1)}function P(e,t){c=e,u=t,d.call({action:c,location:u})}function b(e){var t=f(s+e,0,i.length-1),n=o.Pop,a=i[t];_(n,a,(function(){b(e)}))&&(s=t,P(n,a))}var w={get index(){return s},get action(){return c},get location(){return u},createHref:function(e){return"string"==typeof e?e:g(e)},push:function e(t,n){var a=o.Push,r=p(t,n);_(a,r,(function(){e(t,n)}))&&(s+=1,i.splice(s,i.length,r),P(a,r))},replace:function e(t,n){var a=o.Replace,r=p(t,n);_(a,r,(function(){e(t,n)}))&&(i[s]=r,P(a,r))},go:b,back:function(){b(-1)},forward:function(){b(1)},listen:function(e){return d.push(e)},block:function(e){return h.push(e)}};return w}function f(e,t,n){return Math.min(Math.max(e,t),n)}function p(e){e.preventDefault(),e.returnValue=""}function m(){var e=[];return{get length(){return e.length},push:function(t){return e.push(t),function(){e=e.filter((function(e){return e!==t}))}},call:function(t){e.forEach((function(e){return e&&e(t)}))}}}function v(){return Math.random().toString(36).substr(2,8)}function g(e){var t=e.pathname,n=void 0===t?"/":t,a=e.search,o=void 0===a?"":a,r=e.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 y(e){var t={};if(e){var n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));var a=e.indexOf("?");a>=0&&(t.search=e.substr(a),e=e.substr(0,a)),e&&(t.pathname=e)}return t}function _(e,t){if(!e)throw new Error("Invariant failed")}function P(e,t){if(e===t)return e;const n=Array.isArray(e)&&Array.isArray(t);if(n||b(e)&&b(t)){const a=n?e.length:Object.keys(e).length,o=n?t:Object.keys(t),r=o.length,i=n?[]:{};let s=0;for(let a=0;a<r;a++){const r=n?a:o[a];i[r]=P(e[r],t[r]),i[r]===e[r]&&s++}return a===r&&s===a?e:i}return t}function b(e){if(!w(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!!w(n)&&!!n.hasOwnProperty("isPrototypeOf")}function w(e){return"[object Object]"===Object.prototype.toString.call(e)}function E(e){return e[e.length-1]}function x(e,t){if(e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}return!0}function R(e,t){return"function"==typeof e?e(t):e}function M(e){return A(e.filter(Boolean).join("/"))}function A(e){return e.replace(/\/{2,}/g,"/")}function S(e){return"/"===e?e:e.replace(/^\/{1,}/,"")}function I(e){return"/"===e?e:e.replace(/\/{1,}$/,"")}function L(e){return I(S(e))}function C(e,t,n){t=t.replace(new RegExp("^"+e),"/"),n=n.replace(new RegExp("^"+e),"/");let a=k(t);const o=k(n);o.forEach(((e,t)=>{if("/"===e.value)t?t===o.length-1&&a.push(e):a=[e];else if(".."===e.value){var n;a.length>1&&"/"===(null==(n=E(a))?void 0:n.value)&&a.pop(),a.pop()}else{if("."===e.value)return;a.push(e)}}));return A(M([e,...a.map((e=>e.value))]))}function k(e){if(!e)return[];const t=[];if("/"===(e=A(e)).slice(0,1)&&(e=e.substring(1),t.push({type:"pathname",value:"/"})),!e)return t;const n=e.split("/").filter(Boolean);return t.push(...n.map((e=>e.startsWith("*")?{type:"wildcard",value:e}:":"===e.charAt(0)?{type:"param",value:e}:{type:"pathname",value:e}))),"/"===e.slice(-1)&&(e=e.substring(1),t.push({type:"pathname",value:"/"})),t}function O(e,t,n){return M(k(e).map((e=>{return"*"!==e.value||n?"param"===e.type?null!=(a=t[e.value.substring(1)])?a:"":e.value:"";var a})))}function j(e,t){const n=D(e,t);if(!t.to||n)return null!=n?n:{}}function D(e,t){var n;const a=k(e),o=k(""+(null!=(n=t.to)?n:"*")),r={};return(()=>{for(let e=0;e<Math.max(a.length,o.length);e++){const n=a[e],i=o[e],s=e===o.length-1,l=e===a.length-1;if(i){if("wildcard"===i.type)return!(null==n||!n.value)&&(r["*"]=M(a.slice(e).map((e=>e.value))),!0);if("pathname"===i.type){if("/"===i.value&&(null==n||!n.value))return!0;if(n)if(t.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!!t.fuzzy}return!0})()?r:void 0}function T(e,t){var n,a,o,r="";for(n in e)if(void 0!==(o=e[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(t||"")+r}function F(e){if(!e)return"";var t=decodeURIComponent(e);return"false"!==t&&("true"===t||(0*+t==0?+t:t))}function N(e){for(var t,n,a={},o=e.split("&");t=o.shift();)void 0!==a[n=(t=t.split("=")).shift()]?a[n]=[].concat(a[n],F(t.shift())):a[n]=F(t.shift());return a}function B(){return B=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},B.apply(this,arguments)}function H(e,t,n,a){const{id:o,routeId:r,path:i,fullPath:s}=e,l=a.state.actions[o]||(a.state.actions[o]={pending:[],submit:async(e,t)=>{var n;if(!u)return;const o=null==(n=null==t?void 0:t.invalidate)||n,r={submittedAt:Date.now(),status:"pending",submission:e};l.current=r,l.latest=r,l.pending.push(r),a.state=B({},a.state,{currentAction:r,latestAction:r}),a.notify();try{const t=await(null==u.options.action?void 0:u.options.action(e));return r.data=t,o&&(a.invalidateRoute({to:".",fromCurrent:!0}),await a.reload()),r.status="success",t}catch(e){console.error(e),r.error=e,r.status="error"}finally{l.pending=l.pending.filter((e=>e!==r)),a.removeActionQueue.push({action:l,actionState:r}),a.notify()}}},a.state.actions[o]),c=a.state.loaders[o]||(a.state.loaders[o]={pending:[],fetch:async e=>{if(!u)return;const t={loadedAt:Date.now(),loaderContext:e};c.current=t,c.latest=t,c.pending.push(t),a.notify();try{return await(null==u.options.loader?void 0:u.options.loader(e))}finally{c.pending=c.pending.filter((e=>e!==t)),a.notify()}}},a.state.loaders[o]);let u={routeId:o,routeRouteId:r,routePath:i,fullPath:s,options:t,router:a,childRoutes:void 0,parentRoute:n,action:l,loader:c,buildLink:e=>a.buildLink(B({},e,{from:s})),navigate:e=>a.navigate(B({},e,{from:s})),matchRoute:(e,t)=>a.matchRoute(B({},e,{from:s}),t)};return null==a.options.createRoute||a.options.createRoute({router:a,route:u}),u}function U(e){e.forEach(((t,n)=>{const a=e[n-1];a&&(t.loaderData=P(t.loaderData,B({},a.loaderData,t.routeLoaderData)))}))}const z="__root__",G=["element","errorElement","catchElement","pendingElement"];function W(e,t,n){const a=B({},t,n,{router:e,routeSearch:{},search:{},childMatches:[],status:"idle",routeLoaderData:{},loaderData:{},isPending:!1,isFetching:!1,isInvalid:!1,invalidAt:1/0,getIsInvalid:()=>{const e=Date.now();return a.isInvalid||a.invalidAt<e},__:{abortController:new AbortController,latestId:"",resolve:()=>{},notify:()=>{a.__.resolve(),a.router.notify()},startPending:()=>{var t,n;const o=null!=(t=a.options.pendingMs)?t:e.options.defaultPendingMs,r=null!=(n=a.options.pendingMinMs)?n:e.options.defaultPendingMinMs;a.__.pendingTimeout||"loading"!==a.status||void 0===o||(a.__.pendingTimeout=setTimeout((()=>{a.isPending=!0,a.__.resolve(),void 0!==r&&(a.__.pendingMinPromise=new Promise((e=>a.__.pendingMinTimeout=setTimeout(e,r))))}),o))},cancelPending:()=>{a.isPending=!1,clearTimeout(a.__.pendingTimeout),clearTimeout(a.__.pendingMinTimeout),delete a.__.pendingMinPromise},validate:()=>{var t,n;const o=null!=(t=null==(n=a.parentMatch)?void 0:n.search)?t:e.location.search;try{const e=a.routeSearch,t="object"==typeof a.options.validateSearch?a.options.validateSearch.parse:a.options.validateSearch;let n=P(e,null==t?void 0:t(o));e!==n&&(a.isInvalid=!0),a.routeSearch=n,a.search=P(o,B({},o,n))}catch(e){console.error(e);const t=new Error("Invalid search params found",{cause:e});return t.code="INVALID_SEARCH_PARAMS",a.status="error",void(a.error=t)}}},cancel:()=>{var e;null==(e=a.__.abortController)||e.abort(),a.__.cancelPending()},invalidate:()=>{a.isInvalid=!0},hasLoaders:()=>!(!t.options.loader&&!G.some((e=>"function"==typeof t.options[e]))),load:async t=>{const n=Date.now(),o=null!=t&&t.preload?Math.max(null==t?void 0:t.maxAge,null==t?void 0:t.gcMaxAge):0;if(null!=t&&t.preload&&o>0){if(e.state.matches.find((e=>e.matchId===a.matchId)))return;e.matchCache[a.matchId]={gc:n+t.gcMaxAge,match:a}}if("success"===a.status&&a.getIsInvalid()||"error"===a.status||"idle"===a.status){const e=null!=t&&t.preload?null==t?void 0:t.maxAge:void 0;a.fetch({maxAge:e})}},fetch:async t=>{const n=""+Date.now()+Math.random();return a.__.latestId=n,"idle"===a.status&&(a.status="loading"),a.isInvalid=!1,a.__.loadPromise=new Promise((async o=>{a.isFetching=!0,a.__.resolve=o;const r=(async()=>{a.__.elementsPromise=(async()=>{await Promise.all(G.map((async t=>{const n=a.options[t];a.__[t]||(a.__[t]=await e.options.createElement(n))})))})(),a.__.dataPromise=Promise.resolve().then((async()=>{try{var o,r,i;if(a.options.loader){const e=await a.options.loader({params:a.params,search:a.routeSearch,signal:a.__.abortController.signal});if(n!==a.__.latestId)return a.__.loaderPromise;a.routeLoaderData=P(a.routeLoaderData,e)}a.error=void 0,a.status="success",a.updatedAt=Date.now(),a.invalidAt=a.updatedAt+(null!=(o=null!=(r=null!=(i=null==t?void 0:t.maxAge)?i:a.options.loaderMaxAge)?r:e.options.defaultLoaderMaxAge)?o:0)}catch(e){if(n!==a.__.latestId)return a.__.loaderPromise;a.error=e,a.status="error",a.updatedAt=Date.now()}}));try{if(await Promise.all([a.__.elementsPromise,a.__.dataPromise]),n!==a.__.latestId)return a.__.loaderPromise;a.__.pendingMinPromise&&(await a.__.pendingMinPromise,delete a.__.pendingMinPromise)}finally{if(n!==a.__.latestId)return a.__.loaderPromise;a.__.cancelPending(),a.isPending=!1,a.isFetching=!1,a.__.notify()}})();if(a.__.loaderPromise=r,await r,n!==a.__.latestId)return a.__.loaderPromise;delete a.__.loaderPromise})),await a.__.loadPromise}});return a.hasLoaders()||(a.status="success"),a}const q=Q(JSON.parse),K=V(JSON.stringify);function Q(e){return t=>{"?"===t.substring(0,1)&&(t=t.substring(1));let n=N(t);for(let t in n){const a=n[t];if("string"==typeof a)try{n[t]=e(a)}catch(e){}}return n}}function V(e){return t=>{(t=B({},t))&&Object.keys(t).forEach((n=>{const a=t[n];if(void 0===a||void 0===a)delete t[n];else if(a&&"object"==typeof a&&null!==a)try{t[n]=e(a)}catch(e){}}));const n=T(t).toString();return n?"?"+n:""}}var J;const X=Boolean("undefined"==typeof window||!(null!=(J=window.document)&&J.createElement));function Y(e){var t,n;const a=(null==e?void 0:e.history)||(X?h():d()),o=B({defaultLoaderGcMaxAge:3e5,defaultLoaderMaxAge:0,defaultPreloadMaxAge:2e3,defaultPreloadDelay:50},e,{stringifySearch:null!=(t=null==e?void 0:e.stringifySearch)?t:K,parseSearch:null!=(n=null==e?void 0:e.parseSearch)?n:q});let r={history:a,options:o,listeners:[],removeActionQueue:[],basepath:"",routeTree:void 0,routesById:{},location:void 0,allRouteInfo:void 0,navigationPromise:Promise.resolve(),resolveNavigation:()=>{},matchCache:{},state:{status:"idle",location:null,matches:[],actions:{},loaders:{},loaderData:{},lastUpdated:Date.now(),isFetching:!1,isPreloading:!1},startedLoadingAt:Date.now(),subscribe:e=>(r.listeners.push(e),()=>{r.listeners=r.listeners.filter((t=>t!==e))}),getRoute:e=>r.routesById[e],notify:()=>{r.state=B({},r.state,{isFetching:"loading"===r.state.status||r.state.matches.some((e=>e.isFetching)),isPreloading:Object.values(r.matchCache).some((e=>e.match.isFetching&&!r.state.matches.find((t=>t.matchId===e.match.matchId))))}),U(r.state.matches),r.listeners.forEach((e=>e()))},mount:()=>{const e=r.__.buildLocation({to:".",search:!0,hash:!0});e.href!==r.location.href?r.__.commitLocation(e,!0):r.loadLocation();const t=a.listen((e=>{r.loadLocation(r.__.parseLocation(e.location,r.location))}));return!X&&window.addEventListener&&(window.addEventListener("visibilitychange",r.onFocus,!1),window.addEventListener("focus",r.onFocus,!1)),()=>{t(),window.removeEventListener("visibilitychange",r.onFocus),window.removeEventListener("focus",r.onFocus)}},onFocus:()=>{r.loadLocation()},update:e=>{Object.assign(r.options,e);const{basepath:t,routeConfig:n}=r.options;return r.basepath=A("/"+(null!=t?t:"")),n&&(r.routesById={},r.routeTree=r.__.buildRouteTree(n)),r},cancelMatches:()=>{var e,t;[...r.state.matches,...null!=(e=null==(t=r.state.pending)?void 0:t.matches)?e:[]].forEach((e=>{e.cancel()}))},loadLocation:async e=>{const t=Math.random();r.startedLoadingAt=t,e&&(r.location=e),r.removeActionQueue.forEach((e=>{let{action:t,actionState:n}=e;r.state.currentAction===n&&(r.state.currentAction=void 0),t.current===n&&(t.current=void 0)})),r.removeActionQueue=[],r.cancelMatches();const n=r.matchRoutes(location.pathname,{strictParseParams:!0});if(r.state=B({},r.state,{pending:{matches:n,location:r.location},status:"loading"}),r.notify(),await r.loadMatches(n,{withPending:!0}),r.startedLoadingAt!==t)return r.navigationPromise;const a=r.state.matches,o=[],i=[];a.forEach((e=>{n.find((t=>t.matchId===e.matchId))?i.push(e):o.push(e)}));const s=Date.now();o.forEach((e=>{var t,n,a,o;null==e.__.onExit||e.__.onExit({params:e.params,search:e.routeSearch}),"error"!==e.status||e.isFetching||(e.status="idle",e.error=void 0);const i=Math.max(null!=(t=null!=(n=e.options.loaderGcMaxAge)?n:r.options.defaultLoaderGcMaxAge)?t:0,null!=(a=null!=(o=e.options.loaderMaxAge)?o:r.options.defaultLoaderMaxAge)?a:0);i>0&&(r.matchCache[e.matchId]={gc:i==1/0?Number.MAX_SAFE_INTEGER:s+i,match:e})})),i.forEach((e=>{null==e.options.onTransition||e.options.onTransition({params:e.params,search:e.routeSearch})}));n.filter((e=>!a.find((t=>t.matchId===e.matchId)))).forEach((e=>{e.__.onExit=null==e.options.onMatch?void 0:e.options.onMatch({params:e.params,search:e.search}),delete r.matchCache[e.matchId]})),n.some((e=>"loading"===e.status))&&(r.notify(),await Promise.all(n.map((e=>e.__.loaderPromise||Promise.resolve())))),r.startedLoadingAt===t&&(r.state=B({},r.state,{location:r.location,matches:n,pending:void 0,status:"idle"}),r.notify(),r.resolveNavigation())},cleanMatchCache:()=>{const e=Date.now();Object.keys(r.matchCache).forEach((t=>{const n=r.matchCache[t];"loading"!==n.match.status&&(n.gc>0&&n.gc>e||delete r.matchCache[t])}))},loadRoute:async function(e){void 0===e&&(e=r.location);const t=r.buildNext(e),n=r.matchRoutes(t.pathname,{strictParseParams:!0});return await r.loadMatches(n),n},preloadRoute:async function(e,t){var n,a,o,i,s,l;void 0===e&&(e=r.location);const c=r.buildNext(e),u=r.matchRoutes(c.pathname,{strictParseParams:!0});return await r.loadMatches(u,{preload:!0,maxAge:null!=(n=null!=(a=null!=(o=t.maxAge)?o:r.options.defaultPreloadMaxAge)?a:r.options.defaultLoaderMaxAge)?n:0,gcMaxAge:null!=(i=null!=(s=null!=(l=t.gcMaxAge)?l:r.options.defaultPreloadGcMaxAge)?s:r.options.defaultLoaderGcMaxAge)?i:0}),u},matchRoutes:(e,t)=>{var n,a;r.cleanMatchCache();const o=[];if(!r.routeTree)return o;const i=[...r.state.matches,...null!=(n=null==(a=r.state.pending)?void 0:a.matches)?n:[]],s=async n=>{var a,l,c;const u=E(o);let d=null!=(a=null==u?void 0:u.params)?a:{};const h=null!=(l=null==r.options.filterRoutes?void 0:r.options.filterRoutes(n))?l:n;let f=[];const p=(n,a)=>(a.some((a=>{var o,i,s;if(!a.routePath&&null!=(o=a.childRoutes)&&o.length)return p([...f,a],a.childRoutes);const l=!!("/"!==a.routePath||null!=(i=a.childRoutes)&&i.length),c=j(e,{to:a.fullPath,fuzzy:l,caseSensitive:null!=(s=a.options.caseSensitive)?s:r.options.caseSensitive});if(c){let e;try{var u;e=null!=(u=null==a.options.parseParams?void 0:a.options.parseParams(c))?u:c}catch(e){if(null!=t&&t.strictParseParams)throw e}d=B({},d,e)}return c&&(f=[...n,a]),!!f.length})),!!f.length);if(p([],h),!f.length)return;f.forEach((t=>{var n;const a=O(t.routePath,d),s=O(t.routeId,d,!0),l=i.find((e=>e.matchId===s))||(null==(n=r.matchCache[s])?void 0:n.match)||W(r,t,{matchId:s,params:d,pathname:M([e,a])});o.push(l)}));const m=E(f);null!=(c=m.childRoutes)&&c.length&&s(m.childRoutes)};return s([r.routeTree]),U(o),o},loadMatches:async(e,t)=>{const n=e.map((async e=>{e.__.validate(),e.load(t),"loading"===e.status&&(null!=t&&t.withPending&&e.__.startPending(),await e.__.loadPromise)}));r.notify(),await Promise.all(n)},invalidateRoute:e=>{var t,n;const a=r.buildNext(e),o=r.matchRoutes(a.pathname).map((e=>e.matchId));[...r.state.matches,...null!=(t=null==(n=r.state.pending)?void 0:n.matches)?t:[]].forEach((e=>{o.includes(e.matchId)&&e.invalidate()}))},reload:()=>r.__.navigate({fromCurrent:!0,replace:!0,search:!0}),resolvePath:(e,t)=>C(r.basepath,e,A(t)),matchRoute:(e,t)=>{var n;e=B({},e,{to:e.to?r.resolvePath(null!=(n=e.from)?n:"",e.to):void 0});const a=r.buildNext(e);var o;return null!=t&&t.pending?!(null==(o=r.state.pending)||!o.location)&&!!j(r.state.pending.location.pathname,B({},t,{to:a.pathname})):!!j(r.state.location.pathname,B({},t,{to:a.pathname}))},navigate:async e=>{let{from:t,to:n=".",search:a,hash:o,replace:i,params:s}=e;const l=String(n),c=String(t);let u;try{new URL(""+l),u=!0}catch(e){}return _(!u),r.__.navigate({from:c,to:l,search:a,hash:o,replace:i,params:s})},buildLink:e=>{var t,n;let{from:a,to:o=".",search:i,params:s,hash:l,target:c,replace:u,activeOptions:d,preload:h,preloadMaxAge:f,preloadGcMaxAge:p,preloadDelay:m,disabled:v}=e;try{return new URL(""+o),{type:"external",href:o}}catch(e){}const g={from:a,to:o,search:i,params:s,hash:l,replace:u},y=r.buildNext(g);h=null!=(t=h)?t:r.options.defaultPreload;const _=null!=(n=null!=m?m:r.options.defaultPreloadDelay)?n:0,P=r.state.location.pathname===y.pathname,b=r.state.location.pathname.split("/"),w=y.pathname.split("/").every(((e,t)=>e===b[t])),E=r.state.location.hash===y.hash,x=null!=d&&d.exact?P:w,R=null==d||!d.includeHash||E;return{type:"internal",next:y,handleFocus:e=>{h&&r.preloadRoute(g,{maxAge:f,gcMaxAge:p})},handleClick:e=>{v||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||e.defaultPrevented||c&&"_self"!==c||0!==e.button||(e.preventDefault(),!P||i||l||r.invalidateRoute(g),r.__.navigate(g))},handleEnter:e=>{const t=e.target||{};if(h){if(t.preloadTimeout)return;t.preloadTimeout=setTimeout((()=>{t.preloadTimeout=null,r.preloadRoute(g,{maxAge:f,gcMaxAge:p})}),_)}},handleLeave:e=>{const t=e.target||{};t.preloadTimeout&&(clearTimeout(t.preloadTimeout),t.preloadTimeout=null)},isActive:x&&R,disabled:v}},buildNext:e=>{const t=r.__.buildLocation(e),n=r.matchRoutes(t.pathname),a=n.map((e=>{var t;return null!=(t=e.options.preSearchFilters)?t:[]})).flat().filter(Boolean),o=n.map((e=>{var t;return null!=(t=e.options.postSearchFilters)?t:[]})).flat().filter(Boolean);return r.__.buildLocation(B({},e,{__preSearchFilters:a,__postSearchFilters:o}))},__:{buildRouteTree:e=>{const t=(e,n)=>e.map((e=>{const a=H(e,e.options,n,r);if(r.routesById[a.routeId])throw new Error;r.routesById[a.routeId]=a;const o=e.children;return a.childRoutes=null!=o&&o.length?t(o,a):void 0,a}));return t([e])[0]},parseLocation:(e,t)=>{var n;const a=r.options.parseSearch(e.search);return{pathname:e.pathname,searchStr:e.search,search:P(null==t?void 0:t.search,a),hash:null!=(n=e.hash.split("#").reverse()[0])?n:"",href:""+e.pathname+e.search+e.hash,state:e.state,key:e.key}},navigate:e=>{const t=r.buildNext(e);return r.__.commitLocation(t,e.replace)},buildLocation:function(e){var t,n,a,o,i,s,l,c,u;void 0===e&&(e={});const d=e.fromCurrent?r.location.pathname:null!=(t=e.from)?t:r.location.pathname;let h=C(null!=(n=r.basepath)?n:"/",d,""+(null!=(a=e.to)?a:"."));const f=r.matchRoutes(r.location.pathname,{strictParseParams:!0}),p=r.matchRoutes(h),m=B({},null==(o=E(f))?void 0:o.params);let v=!0===(null==(i=e.params)||i)?m:R(e.params,m);v&&p.map((e=>e.options.stringifyParams)).filter(Boolean).forEach((e=>{Object.assign({},v,e(v))})),h=O(h,null!=v?v:{});const g=null!=(s=e.__preSearchFilters)&&s.length?e.__preSearchFilters.reduce(((e,t)=>t(e)),r.location.search):r.location.search,y=!0===e.search?g:e.search?null!=(l=R(e.search,g))?l:{}:null!=(c=e.__preSearchFilters)&&c.length?g:{},_=null!=(u=e.__postSearchFilters)&&u.length?e.__postSearchFilters.reduce(((e,t)=>t(e)),y):y,b=P(r.location.search,_),w=r.options.stringifySearch(b);let x=!0===e.hash?r.location.hash:R(e.hash,r.location.hash);return x=x?"#"+x:"",{pathname:h,search:b,searchStr:w,state:r.location.state,hash:x,href:""+h+w+x,key:e.key}},commitLocation:(e,t)=>{const n=""+Date.now()+Math.random();r.navigateTimeout&&clearTimeout(r.navigateTimeout);let o="replace";t||(o="push");return r.__.parseLocation(a.location).href===e.href&&!e.key&&(o="replace"),"replace"===o?a.replace({pathname:e.pathname,hash:e.hash,search:e.searchStr},{id:n}):a.push({pathname:e.pathname,hash:e.hash,search:e.searchStr},{id:n}),r.navigationPromise=new Promise((e=>{const t=r.resolveNavigation;r.resolveNavigation=()=>{t(),e()}})),r.navigationPromise}}};return r.location=r.__.parseLocation(a.location),r.state.location=r.location,r.update(e),null==r.options.createRouter||r.options.createRouter(r),r}const $=["type","children","target","activeProps","inactiveProps","activeOptions","disabled","hash","search","params","to","preload","preloadDelay","preloadMaxAge","replace","style","className","onClick","onFocus","onMouseEnter","onMouseLeave","onTouchStart","onTouchEnd"],Z=["pending","caseSensitive","children"],ee=["children","router"],te=r.createContext(null),ne=r.createContext(null),ae=Boolean("undefined"!=typeof window&&window.document&&window.document.createElement)?r.useLayoutEffect:r.useEffect;function oe(e){return r.createElement(te.Provider,e)}const re=e=>{n.useSyncExternalStore((t=>e.subscribe((()=>t()))),(()=>e.state))};function ie(){const e=r.useContext(ne);return x(!e,"useRouter must be used inside a <Router> component!"),re(e.router),e.router}function se(){return r.useContext(te)}function le(){var e;const t=ie(),[,...n]=se(),a=n[0];if(!a)return null;const o=(()=>{var e,n;if(!a)return null;const o=null!=(e=a.__.errorElement)?e:t.options.defaultErrorElement;if("error"===a.status){if(o)return o;if(a.options.useErrorBoundary||t.options.useErrorBoundary)throw a.error;return r.createElement(ue,{error:a.error})}if("loading"===a.status||"idle"===a.status){if(a.isPending){var i;const e=null!=(i=a.__.pendingElement)?i:t.options.defaultPendingElement;var s;if(a.options.pendingMs||e)return null!=(s=e)?s:null}return null}return null!=(n=a.__.element)?n:t.options.defaultElement})(),i=null!=(e=null==a?void 0:a.options.catchElement)?e:t.options.defaultCatchElement;return r.createElement(oe,{value:n,key:a.matchId},r.createElement(ce,{catchElement:i},o))}class ce extends r.Component{constructor(){super(...arguments),this.state={error:!1},this.reset=()=>{this.setState({error:!1,info:!1})}}componentDidCatch(e,t){console.error(e),this.setState({error:e,info:t})}render(){var e;const t=null!=(e=this.props.catchElement)?e:ue;return this.state.error?"function"==typeof t?t(this.state):t:this.props.children}}function ue(e){let{error:t}=e;return r.createElement("div",{style:{padding:".5rem",maxWidth:"100%"}},r.createElement("strong",{style:{fontSize:"1.2rem"}},"Something went wrong!"),r.createElement("div",{style:{height:".5rem"}}),r.createElement("div",null,r.createElement("pre",null,t.message?r.createElement("code",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".5rem",color:"red"}},t.message):null)),r.createElement("div",{style:{height:"1rem"}}),r.createElement("div",{style:{fontSize:".8em",borderLeft:"3px solid rgba(127, 127, 127, 1)",paddingLeft:".5rem",opacity:.5}},"If you are the owner of this website, it's highly recommended that you configure your own custom Catch/Error boundaries for the router. You can optionally configure a boundary for each route."))}function de(e,t){const n=ie();r.useEffect((()=>{if(!t)return;let a=n.history.block((t=>{window.confirm(e)?(a(),t.retry()):n.location.pathname=window.location.pathname}));return a}),[t,location,e])}e.DefaultErrorBoundary=ue,e.MatchesProvider=oe,e.Outlet=le,e.Prompt=function(e){let{message:t,when:n,children:a}=e;return de(t,null==n||n),null!=a?a:null},e.RouterProvider=function(e){let{children:t,router:n}=e,a=s(e,ee);return n.update(a),re(n),ae((()=>n.mount()),[n]),r.createElement(ne.Provider,{value:{router:n}},r.createElement(oe,{value:n.state.matches},null!=t?t:r.createElement(le,null)))},e.cascadeLoaderData=U,e.cleanPath=A,e.createBrowserHistory=d,e.createHashHistory=function(e){void 0===e&&(e={});var t=e.window,n=void 0===t?document.defaultView:t,a=n.history;function r(){var e=y(n.location.hash.substr(1)),t=e.pathname,o=void 0===t?"/":t,r=e.search,i=void 0===r?"":r,s=e.hash,l=void 0===s?"":s,c=a.state||{};return[c.idx,{pathname:o,search:i,hash:l,state:c.usr||null,key:c.key||"default"}]}var i=null;function s(){if(i)b.call(i),i=null;else{var e=o.Pop,t=r(),n=t[0],a=t[1];if(b.length){if(null!=n){var s=f-n;s&&(i={action:e,location:a,retry:function(){A(-1*s)}},A(s))}}else M(e)}}n.addEventListener(u,s),n.addEventListener("hashchange",(function(){g(r()[1])!==g(_)&&s()}));var d=o.Pop,h=r(),f=h[0],_=h[1],P=m(),b=m();function w(e){return function(){var e=document.querySelector("base"),t="";if(e&&e.getAttribute("href")){var a=n.location.href,o=a.indexOf("#");t=-1===o?a:a.slice(0,o)}return t}()+"#"+("string"==typeof e?e:g(e))}function E(e,t){return void 0===t&&(t=null),l({pathname:_.pathname,hash:"",search:""},"string"==typeof e?y(e):e,{state:t,key:v()})}function x(e,t){return[{usr:e.state,key:e.key,idx:t},w(e)]}function R(e,t,n){return!b.length||(b.call({action:e,location:t,retry:n}),!1)}function M(e){d=e;var t=r();f=t[0],_=t[1],P.call({action:d,location:_})}function A(e){a.go(e)}null==f&&(f=0,a.replaceState(l({},a.state,{idx:f}),""));var S={get action(){return d},get location(){return _},createHref:w,push:function e(t,r){var i=o.Push,s=E(t,r);if(R(i,s,(function(){e(t,r)}))){var l=x(s,f+1),c=l[0],u=l[1];try{a.pushState(c,"",u)}catch(e){n.location.assign(u)}M(i)}},replace:function e(t,n){var r=o.Replace,i=E(t,n);if(R(r,i,(function(){e(t,n)}))){var s=x(i,f),l=s[0],c=s[1];a.replaceState(l,"",c),M(r)}},go:A,back:function(){A(-1)},forward:function(){A(1)},listen:function(e){return P.push(e)},block:function(e){var t=b.push(e);return 1===b.length&&n.addEventListener(c,p),function(){t(),b.length||n.removeEventListener(c,p)}}};return S},e.createMemoryHistory=h,e.createReactRouter=function(e){const t=(e,t)=>({useRoute:function(n){void 0===n&&(n=".");const a=t.resolvePath(e.routeId,n),o=t.getRoute(a);return re(t),_(o),o},linkProps:t=>{var n,a;const{target:o,activeProps:r=(()=>({className:"active"})),inactiveProps:l=(()=>({})),disabled:c,style:u,className:d,onClick:h,onFocus:f,onMouseEnter:p,onMouseLeave:m}=t,v=s(t,$),g=e.buildLink(t);if("external"===g.type){const{href:e}=g;return{href:e}}const{handleClick:y,handleFocus:_,handleEnter:P,handleLeave:b,isActive:w,next:E}=g,x=e=>t=>{t.persist(),e.forEach((e=>{e&&e(t)}))},M=w&&null!=(n=R(r,{}))?n:{},A=w?{}:null!=(a=R(l,{}))?a:{};return i({},M,A,v,{href:c?void 0:E.href,onClick:x([y,h]),onFocus:x([_,f]),onMouseEnter:x([P,p]),onMouseLeave:x([b,m]),target:o,style:i({},u,M.style,A.style),className:[d,M.className,A.className].filter(Boolean).join(" ")||void 0},c?{role:"link","aria-disabled":!0}:void 0,{"data-status":w?"active":void 0})},Link:r.forwardRef(((n,a)=>{const o=e.linkProps(n);return re(t),r.createElement("a",i({ref:a},o,{children:"function"==typeof n.children?n.children({isActive:"active"===o["data-status"]}):n.children}))})),MatchRoute:t=>{const{pending:n,caseSensitive:a}=t,o=s(t,Z),r=e.matchRoute(o,{pending:n,caseSensitive:a});return r?"function"==typeof t.children?t.children(r):t.children:null}});return Y(i({},e,{createRouter:e=>{const n={useState:()=>(re(e),e.state),useMatch:t=>{re(e),_(t!==z);const n=null==(a=se())?void 0:a[0];var a;const o=e.state.matches.find((e=>e.routeId===t));return _(o),_(n.routeId==(null==o?void 0:o.routeId),(null==o||o.routeId,n.routeId,null==o||o.routeId)),o||_("Match not found!"),o}},a=t(e.getRoute("/"),e);Object.assign(e,n,a)},createRoute:e=>{let{router:n,route:a}=e;const o=t(a,n);Object.assign(a,o)},createElement:async e=>{if("function"==typeof e){const t=await e();return"object"==typeof t&&t.default?r.createElement(t.default):t}return e}}))},e.createRoute=H,e.createRouteConfig=function e(t,n,a,o,r){void 0===t&&(t={}),void 0===a&&(a=!0),a&&(t.path=z),o===z&&(o="");let i=a?z:t.path;i&&"/"!==i&&(i=L(i));const s=i||t.id;let l=M([o,s]);i===z&&(i="/"),l!==z&&(l=M(["/",l]));const c=l===z?"/":I(M([r,i]));return{id:l,routeId:s,path:i,fullPath:c,options:t,children:n,createChildren:n=>e(t,n((t=>e(t,void 0,!1,l,c))),!1,o,r),addChildren:n=>e(t,n,!1,o,r),createRoute:t=>e(t,void 0,!1,l,c)}},e.createRouteMatch=W,e.createRouter=Y,e.decode=N,e.defaultParseSearch=q,e.defaultStringifySearch=K,e.encode=T,e.functionalUpdate=R,e.interpolatePath=O,e.invariant=_,e.joinPaths=M,e.last=E,e.matchByPath=D,e.matchPathname=j,e.parsePathname=k,e.parseSearchWith=Q,e.replaceEqualDeep=P,e.resolvePath=C,e.rootRouteId=z,e.stringifySearchWith=V,e.trimPath=L,e.trimPathLeft=S,e.trimPathRight=I,e.usePrompt=de,e.warning=x,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=index.production.js.map
{
"name": "@tanstack/react-router",
"author": "Tanner Linsley",
"version": "0.0.1-alpha.10",
"version": "0.0.1-alpha.11",
"license": "MIT",

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

"@babel/runtime": "^7.16.7",
"@tanstack/router-core": "0.0.1-alpha.10",
"@tanstack/router-core": "0.0.1-alpha.11",
"use-sync-external-store": "^1.2.0"

@@ -46,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 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 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