You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@tanstack/router

Package Overview
Dependencies
Maintainers
2
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.1-beta.130 to 0.0.1-beta.131

1

build/cjs/index.js

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

exports.useHydrate = react.useHydrate;
exports.useHydrationContext = react.useHydrationContext;
exports.useInjectHtml = react.useInjectHtml;

@@ -94,0 +93,0 @@ exports.useLinkProps = react.useLinkProps;

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

var warning = require('tiny-warning');
var cprc = require('@gisatcz/cross-package-react-context');
var utils = require('./utils.js');

@@ -47,3 +46,2 @@

var warning__default = /*#__PURE__*/_interopDefaultLegacy(warning);
var cprc__default = /*#__PURE__*/_interopDefaultLegacy(cprc);

@@ -231,5 +229,2 @@ //

}
function useHydrationContext() {
return cprc__default["default"].getContext('TanStackRouterHydrationContext', {}).payload;
}
function useRouter() {

@@ -542,3 +537,2 @@ const value = React__namespace.useContext(routerContext);

exports.useHydrate = useHydrate;
exports.useHydrationContext = useHydrationContext;
exports.useInjectHtml = useInjectHtml;

@@ -545,0 +539,0 @@ exports.useLinkProps = useLinkProps;

@@ -675,12 +675,5 @@ /**

return {
state: {
...utils.pick(this.state, ['location', 'status', 'lastUpdated'])
// matches: this.state.matches.map((m) => ({
// id: m.id,
// promiseKeys: Object.keys(m.__promisesByKey),
// })),
}
state: utils.pick(this.state, ['location', 'status', 'lastUpdated'])
};
};
hydrate = async __do_not_use_server_ctx => {

@@ -694,2 +687,3 @@ let _ctx = __do_not_use_server_ctx;

const ctx = _ctx;
this.dehydratedData = ctx.payload;
this.options.hydrate?.(ctx.payload);

@@ -705,8 +699,2 @@ this.__store.setState(s => {

await this.load();
// this.state.matches.forEach((m) => {
// m.__promiseKeys =
// ctx.router.state.matches.find((d) => d.id === m.id)?.promiseKeys ?? []
// })
return;

@@ -713,0 +701,0 @@ };

316

build/stats-react.json

@@ -14,11 +14,7 @@ {

"name": "tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
"uid": "1f06-51"
"uid": "c30b-49"
},
{
"name": "tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js",
"uid": "1f06-53"
},
{
"name": "@gisatcz+cross-package-react-context@0.2.0/node_modules/@gisatcz/cross-package-react-context/lib/index.js",
"uid": "1f06-69"
"uid": "c30b-51"
}

@@ -34,35 +30,35 @@ ]

{
"uid": "1f06-55",
"uid": "c30b-53",
"name": "history.ts"
},
{
"uid": "1f06-57",
"uid": "c30b-55",
"name": "utils.ts"
},
{
"uid": "1f06-59",
"uid": "c30b-57",
"name": "path.ts"
},
{
"uid": "1f06-61",
"uid": "c30b-59",
"name": "qss.ts"
},
{
"uid": "1f06-71",
"uid": "c30b-67",
"name": "react.tsx"
},
{
"uid": "1f06-73",
"uid": "c30b-69",
"name": "route.ts"
},
{
"uid": "1f06-75",
"uid": "c30b-71",
"name": "searchParams.ts"
},
{
"uid": "1f06-77",
"uid": "c30b-73",
"name": "router.ts"
},
{
"uid": "1f06-79",
"uid": "c30b-75",
"name": "index.ts"

@@ -74,7 +70,7 @@ }

"name": "store/build/esm/index.js",
"uid": "1f06-65"
"uid": "c30b-63"
},
{
"name": "react-store/build/esm/index.js",
"uid": "1f06-67"
"uid": "c30b-65"
}

@@ -84,3 +80,3 @@ ]

{
"uid": "1f06-63",
"uid": "c30b-61",
"name": "\u0000rollupPluginBabelHelpers.js"

@@ -94,98 +90,92 @@ }

"nodeParts": {
"1f06-51": {
"c30b-49": {
"renderedLength": 199,
"gzipLength": 134,
"brotliLength": 0,
"mainUid": "1f06-50"
"mainUid": "c30b-48"
},
"1f06-53": {
"c30b-51": {
"renderedLength": 48,
"gzipLength": 65,
"brotliLength": 0,
"mainUid": "1f06-52"
"mainUid": "c30b-50"
},
"1f06-55": {
"c30b-53": {
"renderedLength": 5643,
"gzipLength": 1404,
"brotliLength": 0,
"mainUid": "1f06-54"
"mainUid": "c30b-52"
},
"1f06-57": {
"c30b-55": {
"renderedLength": 2821,
"gzipLength": 990,
"brotliLength": 0,
"mainUid": "1f06-56"
"mainUid": "c30b-54"
},
"1f06-59": {
"c30b-57": {
"renderedLength": 6028,
"gzipLength": 1423,
"brotliLength": 0,
"mainUid": "1f06-58"
"mainUid": "c30b-56"
},
"1f06-61": {
"c30b-59": {
"renderedLength": 1395,
"gzipLength": 558,
"brotliLength": 0,
"mainUid": "1f06-60"
"mainUid": "c30b-58"
},
"1f06-63": {
"c30b-61": {
"renderedLength": 457,
"gzipLength": 241,
"brotliLength": 0,
"mainUid": "1f06-62"
"mainUid": "c30b-60"
},
"1f06-65": {
"c30b-63": {
"renderedLength": 1459,
"gzipLength": 543,
"brotliLength": 0,
"mainUid": "1f06-64"
"mainUid": "c30b-62"
},
"1f06-67": {
"c30b-65": {
"renderedLength": 2158,
"gzipLength": 750,
"brotliLength": 0,
"mainUid": "1f06-66"
"mainUid": "c30b-64"
},
"1f06-69": {
"renderedLength": 482,
"gzipLength": 191,
"c30b-67": {
"renderedLength": 15468,
"gzipLength": 3672,
"brotliLength": 0,
"mainUid": "1f06-68"
"mainUid": "c30b-66"
},
"1f06-71": {
"renderedLength": 15587,
"gzipLength": 3712,
"brotliLength": 0,
"mainUid": "1f06-70"
},
"1f06-73": {
"c30b-69": {
"renderedLength": 4424,
"gzipLength": 1083,
"brotliLength": 0,
"mainUid": "1f06-72"
"mainUid": "c30b-68"
},
"1f06-75": {
"c30b-71": {
"renderedLength": 1387,
"gzipLength": 483,
"brotliLength": 0,
"mainUid": "1f06-74"
"mainUid": "c30b-70"
},
"1f06-77": {
"renderedLength": 33528,
"gzipLength": 7647,
"c30b-73": {
"renderedLength": 33195,
"gzipLength": 7568,
"brotliLength": 0,
"mainUid": "1f06-76"
"mainUid": "c30b-72"
},
"1f06-79": {
"c30b-75": {
"renderedLength": 0,
"gzipLength": 0,
"brotliLength": 0,
"mainUid": "1f06-78"
"mainUid": "c30b-74"
}
},
"nodeMetas": {
"1f06-50": {
"c30b-48": {
"id": "/node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
"moduleParts": {
"index.production.js": "1f06-51"
"index.production.js": "c30b-49"
},

@@ -195,19 +185,19 @@ "imported": [],

{
"uid": "1f06-78"
"uid": "c30b-74"
},
{
"uid": "1f06-72"
"uid": "c30b-68"
},
{
"uid": "1f06-76"
"uid": "c30b-72"
},
{
"uid": "1f06-70"
"uid": "c30b-66"
}
]
},
"1f06-52": {
"c30b-50": {
"id": "/node_modules/.pnpm/tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js",
"moduleParts": {
"index.production.js": "1f06-53"
"index.production.js": "c30b-51"
},

@@ -217,13 +207,13 @@ "imported": [],

{
"uid": "1f06-78"
"uid": "c30b-74"
},
{
"uid": "1f06-70"
"uid": "c30b-66"
}
]
},
"1f06-54": {
"c30b-52": {
"id": "/packages/router/src/history.ts",
"moduleParts": {
"index.production.js": "1f06-55"
"index.production.js": "c30b-53"
},

@@ -233,13 +223,13 @@ "imported": [],

{
"uid": "1f06-78"
"uid": "c30b-74"
},
{
"uid": "1f06-76"
"uid": "c30b-72"
}
]
},
"1f06-56": {
"c30b-54": {
"id": "/packages/router/src/utils.ts",
"moduleParts": {
"index.production.js": "1f06-57"
"index.production.js": "c30b-55"
},

@@ -249,23 +239,23 @@ "imported": [],

{
"uid": "1f06-78"
"uid": "c30b-74"
},
{
"uid": "1f06-58"
"uid": "c30b-56"
},
{
"uid": "1f06-76"
"uid": "c30b-72"
},
{
"uid": "1f06-70"
"uid": "c30b-66"
}
]
},
"1f06-58": {
"c30b-56": {
"id": "/packages/router/src/path.ts",
"moduleParts": {
"index.production.js": "1f06-59"
"index.production.js": "c30b-57"
},
"imported": [
{
"uid": "1f06-56"
"uid": "c30b-54"
}

@@ -275,16 +265,16 @@ ],

{
"uid": "1f06-78"
"uid": "c30b-74"
},
{
"uid": "1f06-72"
"uid": "c30b-68"
},
{
"uid": "1f06-76"
"uid": "c30b-72"
}
]
},
"1f06-60": {
"c30b-58": {
"id": "/packages/router/src/qss.ts",
"moduleParts": {
"index.production.js": "1f06-61"
"index.production.js": "c30b-59"
},

@@ -294,13 +284,13 @@ "imported": [],

{
"uid": "1f06-78"
"uid": "c30b-74"
},
{
"uid": "1f06-74"
"uid": "c30b-70"
}
]
},
"1f06-62": {
"c30b-60": {
"id": "\u0000rollupPluginBabelHelpers.js",
"moduleParts": {
"index.production.js": "1f06-63"
"index.production.js": "c30b-61"
},

@@ -310,10 +300,10 @@ "imported": [],

{
"uid": "1f06-70"
"uid": "c30b-66"
}
]
},
"1f06-64": {
"c30b-62": {
"id": "/packages/store/build/esm/index.js",
"moduleParts": {
"index.production.js": "1f06-65"
"index.production.js": "c30b-63"
},

@@ -323,20 +313,20 @@ "imported": [],

{
"uid": "1f06-66"
"uid": "c30b-64"
}
]
},
"1f06-66": {
"c30b-64": {
"id": "/packages/react-store/build/esm/index.js",
"moduleParts": {
"index.production.js": "1f06-67"
"index.production.js": "c30b-65"
},
"imported": [
{
"uid": "1f06-82"
"uid": "c30b-78"
},
{
"uid": "1f06-83"
"uid": "c30b-79"
},
{
"uid": "1f06-64"
"uid": "c30b-62"
}

@@ -346,51 +336,32 @@ ],

{
"uid": "1f06-76"
"uid": "c30b-72"
},
{
"uid": "1f06-70"
"uid": "c30b-66"
}
]
},
"1f06-68": {
"id": "/node_modules/.pnpm/@gisatcz+cross-package-react-context@0.2.0/node_modules/@gisatcz/cross-package-react-context/lib/index.js",
"moduleParts": {
"index.production.js": "1f06-69"
},
"imported": [
{
"uid": "1f06-82"
}
],
"importedBy": [
{
"uid": "1f06-70"
}
]
},
"1f06-70": {
"c30b-66": {
"id": "/packages/router/src/react.tsx",
"moduleParts": {
"index.production.js": "1f06-71"
"index.production.js": "c30b-67"
},
"imported": [
{
"uid": "1f06-62"
"uid": "c30b-60"
},
{
"uid": "1f06-82"
"uid": "c30b-78"
},
{
"uid": "1f06-66"
"uid": "c30b-64"
},
{
"uid": "1f06-50"
"uid": "c30b-48"
},
{
"uid": "1f06-52"
"uid": "c30b-50"
},
{
"uid": "1f06-68"
},
{
"uid": "1f06-56"
"uid": "c30b-54"
}

@@ -400,23 +371,23 @@ ],

{
"uid": "1f06-78"
"uid": "c30b-74"
},
{
"uid": "1f06-72"
"uid": "c30b-68"
}
]
},
"1f06-72": {
"c30b-68": {
"id": "/packages/router/src/route.ts",
"moduleParts": {
"index.production.js": "1f06-73"
"index.production.js": "c30b-69"
},
"imported": [
{
"uid": "1f06-50"
"uid": "c30b-48"
},
{
"uid": "1f06-58"
"uid": "c30b-56"
},
{
"uid": "1f06-70"
"uid": "c30b-66"
}

@@ -426,14 +397,14 @@ ],

{
"uid": "1f06-78"
"uid": "c30b-74"
}
]
},
"1f06-74": {
"c30b-70": {
"id": "/packages/router/src/searchParams.ts",
"moduleParts": {
"index.production.js": "1f06-75"
"index.production.js": "c30b-71"
},
"imported": [
{
"uid": "1f06-60"
"uid": "c30b-58"
}

@@ -443,32 +414,32 @@ ],

{
"uid": "1f06-78"
"uid": "c30b-74"
},
{
"uid": "1f06-76"
"uid": "c30b-72"
}
]
},
"1f06-76": {
"c30b-72": {
"id": "/packages/router/src/router.ts",
"moduleParts": {
"index.production.js": "1f06-77"
"index.production.js": "c30b-73"
},
"imported": [
{
"uid": "1f06-66"
"uid": "c30b-64"
},
{
"uid": "1f06-50"
"uid": "c30b-48"
},
{
"uid": "1f06-58"
"uid": "c30b-56"
},
{
"uid": "1f06-74"
"uid": "c30b-70"
},
{
"uid": "1f06-56"
"uid": "c30b-54"
},
{
"uid": "1f06-54"
"uid": "c30b-52"
}

@@ -478,47 +449,47 @@ ],

{
"uid": "1f06-78"
"uid": "c30b-74"
}
]
},
"1f06-78": {
"c30b-74": {
"id": "/packages/router/src/index.ts",
"moduleParts": {
"index.production.js": "1f06-79"
"index.production.js": "c30b-75"
},
"imported": [
{
"uid": "1f06-50"
"uid": "c30b-48"
},
{
"uid": "1f06-52"
"uid": "c30b-50"
},
{
"uid": "1f06-54"
"uid": "c30b-52"
},
{
"uid": "1f06-80"
"uid": "c30b-76"
},
{
"uid": "1f06-58"
"uid": "c30b-56"
},
{
"uid": "1f06-60"
"uid": "c30b-58"
},
{
"uid": "1f06-72"
"uid": "c30b-68"
},
{
"uid": "1f06-81"
"uid": "c30b-77"
},
{
"uid": "1f06-76"
"uid": "c30b-72"
},
{
"uid": "1f06-74"
"uid": "c30b-70"
},
{
"uid": "1f06-56"
"uid": "c30b-54"
},
{
"uid": "1f06-70"
"uid": "c30b-66"
}

@@ -529,3 +500,3 @@ ],

},
"1f06-80": {
"c30b-76": {
"id": "/packages/router/src/link.ts",

@@ -536,7 +507,7 @@ "moduleParts": {},

{
"uid": "1f06-78"
"uid": "c30b-74"
}
]
},
"1f06-81": {
"c30b-77": {
"id": "/packages/router/src/routeInfo.ts",

@@ -547,7 +518,7 @@ "moduleParts": {},

{
"uid": "1f06-78"
"uid": "c30b-74"
}
]
},
"1f06-82": {
"c30b-78": {
"id": "react",

@@ -558,9 +529,6 @@ "moduleParts": {},

{
"uid": "1f06-70"
"uid": "c30b-66"
},
{
"uid": "1f06-66"
},
{
"uid": "1f06-68"
"uid": "c30b-64"
}

@@ -570,3 +538,3 @@ ],

},
"1f06-83": {
"c30b-79": {
"id": "use-sync-external-store/shim/with-selector",

@@ -577,3 +545,3 @@ "moduleParts": {},

{
"uid": "1f06-66"
"uid": "c30b-64"
}

@@ -580,0 +548,0 @@ ],

@@ -56,3 +56,2 @@ import * as React from 'react';

export declare function RouterProvider<TRouteConfig extends AnyRoute = AnyRoute, TRoutesInfo extends AnyRoutesInfo = DefaultRoutesInfo, TDehydrated extends Record<string, any> = Record<string, any>>({ router, ...rest }: RouterProps<TRouteConfig, TRoutesInfo, TDehydrated>): JSX.Element;
export declare function useHydrationContext(): any;
export declare function useRouter(): RegisteredRouter;

@@ -59,0 +58,0 @@ export declare function useRouterState<T = Router['state']>(select?: (state: Router['state']) => T): T;

@@ -162,2 +162,3 @@ /// <reference types="react" />

resolveNavigation: () => void;
dehydratedData?: TDehydrated;
constructor(options: RouterConstructorOptions<TRouteTree, TDehydrated>);

@@ -164,0 +165,0 @@ reset: () => void;

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

*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("use-sync-external-store/shim/with-selector")):"function"==typeof define&&define.amd?define(["exports","react","use-sync-external-store/shim/with-selector"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RouterCore={},t.React,t.withSelector)}(this,(function(t,e,r){"use strict";function o(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function n(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(r){if("default"!==r){var o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,o.get?o:{enumerable:!0,get:function(){return t[r]}})}})),e.default=t,Object.freeze(e)}var a=o(e),s=n(e);function i(t,e){if(!t)throw new Error("Invariant failed")}function c(t,e){}const h="popstate",u="beforeunload",l=t=>(t.preventDefault(),t.returnValue=""),d=()=>{removeEventListener(u,l,{capture:!0})};function p(t){let e=t.getLocation(),r=()=>{},o=new Set,n=[],a=[];const s=()=>{if(n.length)n[0]?.(s,(()=>{n=[],d()}));else{for(;a.length;)a.shift()?.();c()}},i=t=>{a.push(t),s()},c=()=>{e=t.getLocation(),o.forEach((t=>t()))};return{get location(){return e},listen:e=>(0===o.size&&(r=t.listener(c)),o.add(e),()=>{o.delete(e),0===o.size&&r()}),push:(e,r)=>{i((()=>{t.pushState(e,r)}))},replace:(e,r)=>{i((()=>{t.replaceState(e,r)}))},go:e=>{i((()=>{t.go(e)}))},back:()=>{i((()=>{t.back()}))},forward:()=>{i((()=>{t.forward()}))},createHref:e=>t.createHref(e),block:t=>(n.push(t),1===n.length&&addEventListener(u,l,{capture:!0}),()=>{n=n.filter((e=>e!==t)),n.length||d()})}}function f(t){const e=t?.getHref??(()=>`${window.location.pathname}${window.location.search}${window.location.hash}`),r=t?.createHref??(t=>t);return p({getLocation:()=>y(e(),history.state),listener:t=>(window.addEventListener(h,t),()=>{window.removeEventListener(h,t)}),pushState:(t,e)=>{window.history.pushState({...e,key:g()},"",r(t))},replaceState:(t,e)=>{window.history.replaceState({...e,key:g()},"",r(t))},back:()=>window.history.back(),forward:()=>window.history.forward(),go:t=>window.history.go(t),createHref:t=>r(t)})}function m(t={initialEntries:["/"]}){const e=t.initialEntries;let r=t.initialIndex??e.length-1,o={};return p({getLocation:()=>y(e[r],o),listener:()=>()=>{},pushState:(t,n)=>{o={...n,key:g()},e.push(t),r++},replaceState:(t,n)=>{o={...n,key:g()},e[r]=t},back:()=>{r--},forward:()=>{r=Math.min(r+1,e.length-1)},go:t=>window.history.go(t),createHref:t=>t})}function y(t,e){let r=t.indexOf("#"),o=t.indexOf("?");return{href:t,pathname:t.substring(0,r>0?o>0?Math.min(r,o):r:o>0?o:t.length),hash:r>-1?t.substring(r):"",search:o>-1?t.slice(o,-1===r?void 0:r):"",state:e}}function g(){return(Math.random()+1).toString(36).substring(7)}function v(t){return t[t.length-1]}function b(t,e){return"function"==typeof t?t(e):t}function w(t,e){return e.reduce(((e,r)=>(e[r]=t[r],e)),{})}function S(t,e){if(t===e)return t;const r=e,o=Array.isArray(t)&&Array.isArray(r);if(o||R(t)&&R(r)){const e=o?t.length:Object.keys(t).length,n=o?r:Object.keys(r),a=n.length,s=o?[]:{};let i=0;for(let e=0;e<a;e++){const a=o?e:n[e];s[a]=S(t[a],r[a]),s[a]===t[a]&&i++}return e===a&&i===e?t:s}return r}function R(t){if(!E(t))return!1;const e=t.constructor;if(void 0===e)return!0;const r=e.prototype;return!!E(r)&&!!r.hasOwnProperty("isPrototypeOf")}function E(t){return"[object Object]"===Object.prototype.toString.call(t)}function P(t,e){return t===e||typeof t==typeof e&&(R(t)&&R(e)?!Object.keys(e).some((r=>!P(t[r],e[r]))):!(!Array.isArray(t)||!Array.isArray(e))&&(t.length===e.length&&t.every(((t,r)=>P(t,e[r])))))}function _(t){return x(t.filter(Boolean).join("/"))}function x(t){return t.replace(/\/{2,}/g,"/")}function C(t){return"/"===t?t:t.replace(/^\/{1,}/,"")}function M(t){return"/"===t?t:t.replace(/\/{1,}$/,"")}function L(t){return M(C(t))}function k(t,e,r){e=e.replace(new RegExp(`^${t}`),"/"),r=r.replace(new RegExp(`^${t}`),"/");let o=j(e);const n=j(r);n.forEach(((t,e)=>{if("/"===t.value)e?e===n.length-1&&o.push(t):o=[t];else if(".."===t.value)o.length>1&&"/"===v(o)?.value&&o.pop(),o.pop();else{if("."===t.value)return;o.push(t)}}));return x(_([t,...o.map((t=>t.value))]))}function j(t){if(!t)return[];const e=[];if("/"===(t=x(t)).slice(0,1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),!t)return e;const r=t.split("/").filter(Boolean);return e.push(...r.map((t=>"$"===t||"*"===t?{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 O(t,e,r=!1){return _(j(t).map((t=>{if("wildcard"===t.type){const o=e[t.value];return r?`${t.value}${o??""}`:o}return"param"===t.type?e[t.value.substring(1)]??"":t.value})))}function I(t,e,r){const o=D(t,e,r);if(!r.to||o)return o??{}}function D(t,e,r){e="/"!=t?e.substring(t.length):e;const o=`${r.to??"$"}`,n=j(e),a=j(o);e.startsWith("/")||n.unshift({type:"pathname",value:"/"}),o.startsWith("/")||a.unshift({type:"pathname",value:"/"});const s={};return(()=>{for(let t=0;t<Math.max(n.length,a.length);t++){const e=n[t],o=a[t],i=t>=n.length-1,c=t>=a.length-1;if(o){if("wildcard"===o.type)return!!e?.value&&(s["*"]=_(n.slice(t).map((t=>t.value))),!0);if("pathname"===o.type){if("/"===o.value&&!e?.value)return!0;if(e)if(r.caseSensitive){if(o.value!==e.value)return!1}else if(o.value.toLowerCase()!==e.value.toLowerCase())return!1}if(!e)return!1;if("param"===o.type){if("/"===e?.value)return!1;"$"!==e.value.charAt(0)&&(s[o.value.substring(1)]=e.value)}}if(!i&&c)return!!r.fuzzy}return!0})()?s:void 0}function $(t,e){var r,o,n,a="";for(r in t)if(void 0!==(n=t[r]))if(Array.isArray(n))for(o=0;o<n.length;o++)a&&(a+="&"),a+=encodeURIComponent(r)+"="+encodeURIComponent(n[o]);else a&&(a+="&"),a+=encodeURIComponent(r)+"="+encodeURIComponent(n);return(e||"")+a}function A(t){if(!t)return"";var e=decodeURIComponent(t);return"false"!==e&&("true"===e||("0"===e.charAt(0)?e:0*+e==0?+e:e))}function T(t){for(var e,r,o={},n=t.split("&");e=n.shift();)void 0!==o[r=(e=e.split("=")).shift()]?o[r]=[].concat(o[r],A(e.shift())):o[r]=A(e.shift());return o}function H(){return H=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},H.apply(this,arguments)}
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("use-sync-external-store/shim/with-selector")):"function"==typeof define&&define.amd?define(["exports","react","use-sync-external-store/shim/with-selector"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RouterCore={},t.React,t.withSelector)}(this,(function(t,e,r){"use strict";function o(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(r){if("default"!==r){var o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,o.get?o:{enumerable:!0,get:function(){return t[r]}})}})),e.default=t,Object.freeze(e)}var a=o(e);function n(t,e){if(!t)throw new Error("Invariant failed")}function s(t,e){}const i="popstate",c="beforeunload",h=t=>(t.preventDefault(),t.returnValue=""),u=()=>{removeEventListener(c,h,{capture:!0})};function l(t){let e=t.getLocation(),r=()=>{},o=new Set,a=[],n=[];const s=()=>{if(a.length)a[0]?.(s,(()=>{a=[],u()}));else{for(;n.length;)n.shift()?.();l()}},i=t=>{n.push(t),s()},l=()=>{e=t.getLocation(),o.forEach((t=>t()))};return{get location(){return e},listen:e=>(0===o.size&&(r=t.listener(l)),o.add(e),()=>{o.delete(e),0===o.size&&r()}),push:(e,r)=>{i((()=>{t.pushState(e,r)}))},replace:(e,r)=>{i((()=>{t.replaceState(e,r)}))},go:e=>{i((()=>{t.go(e)}))},back:()=>{i((()=>{t.back()}))},forward:()=>{i((()=>{t.forward()}))},createHref:e=>t.createHref(e),block:t=>(a.push(t),1===a.length&&addEventListener(c,h,{capture:!0}),()=>{a=a.filter((e=>e!==t)),a.length||u()})}}function d(t){const e=t?.getHref??(()=>`${window.location.pathname}${window.location.search}${window.location.hash}`),r=t?.createHref??(t=>t);return l({getLocation:()=>f(e(),history.state),listener:t=>(window.addEventListener(i,t),()=>{window.removeEventListener(i,t)}),pushState:(t,e)=>{window.history.pushState({...e,key:m()},"",r(t))},replaceState:(t,e)=>{window.history.replaceState({...e,key:m()},"",r(t))},back:()=>window.history.back(),forward:()=>window.history.forward(),go:t=>window.history.go(t),createHref:t=>r(t)})}function p(t={initialEntries:["/"]}){const e=t.initialEntries;let r=t.initialIndex??e.length-1,o={};return l({getLocation:()=>f(e[r],o),listener:()=>()=>{},pushState:(t,a)=>{o={...a,key:m()},e.push(t),r++},replaceState:(t,a)=>{o={...a,key:m()},e[r]=t},back:()=>{r--},forward:()=>{r=Math.min(r+1,e.length-1)},go:t=>window.history.go(t),createHref:t=>t})}function f(t,e){let r=t.indexOf("#"),o=t.indexOf("?");return{href:t,pathname:t.substring(0,r>0?o>0?Math.min(r,o):r:o>0?o:t.length),hash:r>-1?t.substring(r):"",search:o>-1?t.slice(o,-1===r?void 0:r):"",state:e}}function m(){return(Math.random()+1).toString(36).substring(7)}function y(t){return t[t.length-1]}function g(t,e){return"function"==typeof t?t(e):t}function v(t,e){return e.reduce(((e,r)=>(e[r]=t[r],e)),{})}function b(t,e){if(t===e)return t;const r=e,o=Array.isArray(t)&&Array.isArray(r);if(o||w(t)&&w(r)){const e=o?t.length:Object.keys(t).length,a=o?r:Object.keys(r),n=a.length,s=o?[]:{};let i=0;for(let e=0;e<n;e++){const n=o?e:a[e];s[n]=b(t[n],r[n]),s[n]===t[n]&&i++}return e===n&&i===e?t:s}return r}function w(t){if(!S(t))return!1;const e=t.constructor;if(void 0===e)return!0;const r=e.prototype;return!!S(r)&&!!r.hasOwnProperty("isPrototypeOf")}function S(t){return"[object Object]"===Object.prototype.toString.call(t)}function R(t,e){return t===e||typeof t==typeof e&&(w(t)&&w(e)?!Object.keys(e).some((r=>!R(t[r],e[r]))):!(!Array.isArray(t)||!Array.isArray(e))&&(t.length===e.length&&t.every(((t,r)=>R(t,e[r])))))}function E(t){return P(t.filter(Boolean).join("/"))}function P(t){return t.replace(/\/{2,}/g,"/")}function _(t){return"/"===t?t:t.replace(/^\/{1,}/,"")}function x(t){return"/"===t?t:t.replace(/\/{1,}$/,"")}function C(t){return x(_(t))}function M(t,e,r){e=e.replace(new RegExp(`^${t}`),"/"),r=r.replace(new RegExp(`^${t}`),"/");let o=L(e);const a=L(r);a.forEach(((t,e)=>{if("/"===t.value)e?e===a.length-1&&o.push(t):o=[t];else if(".."===t.value)o.length>1&&"/"===y(o)?.value&&o.pop(),o.pop();else{if("."===t.value)return;o.push(t)}}));return P(E([t,...o.map((t=>t.value))]))}function L(t){if(!t)return[];const e=[];if("/"===(t=P(t)).slice(0,1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),!t)return e;const r=t.split("/").filter(Boolean);return e.push(...r.map((t=>"$"===t||"*"===t?{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 k(t,e,r=!1){return E(L(t).map((t=>{if("wildcard"===t.type){const o=e[t.value];return r?`${t.value}${o??""}`:o}return"param"===t.type?e[t.value.substring(1)]??"":t.value})))}function j(t,e,r){const o=O(t,e,r);if(!r.to||o)return o??{}}function O(t,e,r){e="/"!=t?e.substring(t.length):e;const o=`${r.to??"$"}`,a=L(e),n=L(o);e.startsWith("/")||a.unshift({type:"pathname",value:"/"}),o.startsWith("/")||n.unshift({type:"pathname",value:"/"});const s={};return(()=>{for(let t=0;t<Math.max(a.length,n.length);t++){const e=a[t],o=n[t],i=t>=a.length-1,c=t>=n.length-1;if(o){if("wildcard"===o.type)return!!e?.value&&(s["*"]=E(a.slice(t).map((t=>t.value))),!0);if("pathname"===o.type){if("/"===o.value&&!e?.value)return!0;if(e)if(r.caseSensitive){if(o.value!==e.value)return!1}else if(o.value.toLowerCase()!==e.value.toLowerCase())return!1}if(!e)return!1;if("param"===o.type){if("/"===e?.value)return!1;"$"!==e.value.charAt(0)&&(s[o.value.substring(1)]=e.value)}}if(!i&&c)return!!r.fuzzy}return!0})()?s:void 0}function D(t,e){var r,o,a,n="";for(r in t)if(void 0!==(a=t[r]))if(Array.isArray(a))for(o=0;o<a.length;o++)n&&(n+="&"),n+=encodeURIComponent(r)+"="+encodeURIComponent(a[o]);else n&&(n+="&"),n+=encodeURIComponent(r)+"="+encodeURIComponent(a);return(e||"")+n}function I(t){if(!t)return"";var e=decodeURIComponent(t);return"false"!==e&&("true"===e||("0"===e.charAt(0)?e:0*+e==0?+e:e))}function $(t){for(var e,r,o={},a=t.split("&");e=a.shift();)void 0!==o[r=(e=e.split("=")).shift()]?o[r]=[].concat(o[r],I(e.shift())):o[r]=I(e.shift());return o}function A(){return A=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},A.apply(this,arguments)}
/**

@@ -22,3 +22,3 @@ * @tanstack/store/src/index.ts

* @license MIT
*/class N{listeners=new Set;_batching=!1;_flushing=0;constructor(t,e){this.state=t,this.options=e}subscribe=t=>{this.listeners.add(t);const e=this.options?.onSubscribe?.(t,this);return()=>{this.listeners.delete(t),e?.()}};setState=t=>{const e=this.state;this.state=this.options?.updateFn?this.options.updateFn(e)(t):t(e),this.options?.onUpdate?.(),this._flush()};_flush=()=>{if(this._batching)return;const t=++this._flushing;this.listeners.forEach((e=>{this._flushing===t&&e()}))};batch=t=>{if(this._batching)return t();this._batching=!0,t(),this._batching=!1,this._flush()}}
*/class T{listeners=new Set;_batching=!1;_flushing=0;constructor(t,e){this.state=t,this.options=e}subscribe=t=>{this.listeners.add(t);const e=this.options?.onSubscribe?.(t,this);return()=>{this.listeners.delete(t),e?.()}};setState=t=>{const e=this.state;this.state=this.options?.updateFn?this.options.updateFn(e)(t):t(e),this.options?.onUpdate?.(),this._flush()};_flush=()=>{if(this._batching)return;const t=++this._flushing;this.listeners.forEach((e=>{this._flushing===t&&e()}))};batch=t=>{if(this._batching)return t();this._batching=!0,t(),this._batching=!1,this._flush()}}
/**

@@ -33,3 +33,3 @@ * @tanstack/react-store/src/index.tsx

* @license MIT
*/function B(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!1;for(let o=0;o<r.length;o++)if(!Object.prototype.hasOwnProperty.call(e,r[o])||!Object.is(t[r[o]],e[r[o]]))return!1;return!0}var U,F=(U={},{getContext:function(t,e){return U[t]||function(t,e){return U[t]=a.default.createContext(e),U[t]}(t,e)}});function z(t){const e=V(),{type:r,children:o,target:n,activeProps:a=(()=>({className:"active"})),inactiveProps:i=(()=>({})),activeOptions:c,disabled:h,hash:u,search:l,params:d,to:p=".",preload:f,preloadDelay:m,replace:y,style:g,className:v,onClick:w,onFocus:S,onMouseEnter:R,onMouseLeave:E,onTouchStart:P,..._}=t,x=e.buildLink(t);if("external"===x.type){const{href:t}=x;return{href:t}}const{handleClick:C,handleFocus:M,handleEnter:L,handleLeave:k,handleTouchStart:j,isActive:O,next:I}=x,D=t=>e=>{e.persist&&e.persist(),t.filter(Boolean).forEach((t=>{e.defaultPrevented||t(e)}))},$=O?b(a,{})??{}:{},A=O?{}:b(i,{})??{};return{...$,...A,..._,href:h?void 0:I.href,onClick:D([w,t=>{s.startTransition?s.startTransition((()=>{C(t)})):C(t)}]),onFocus:D([S,M]),onMouseEnter:D([R,L]),onMouseLeave:D([E,k]),onTouchStart:D([P,j]),target:n,style:{...g,...$.style,...A.style},className:[v,$.className,A.className].filter(Boolean).join(" ")||void 0,...h?{role:"link","aria-disabled":!0}:void 0,"data-status":O?"active":void 0}}const W=s.forwardRef(((t,e)=>{const r=z(t);return s.createElement("a",H({ref:e},r,{children:"function"==typeof t.children?t.children({isActive:"active"===r["data-status"]}):t.children}))}));const J=s.createContext(null),K=s.createContext(null),q=s.createContext(null);const Y="undefined"==typeof document?s.useEffect:s.useLayoutEffect;function V(){return s.useContext(q)}function G(t){const e=s.useContext(K),r=t?.(e)??e,o=s.useRef(r);return lt(o.current,r)||(o.current=r),o.current}function Q(){return s.useContext(J)}function X(t){const e=G(),r=Q()[0],o=e.matches,n=t?.from?o.find((e=>e.routeId===t?.from)):r;return i(n,t?.from&&t.from),(t?.strict??1)&&i(r.routeId==n?.routeId,(n?.routeId,r.routeId,n?.routeId,n?.routeId)),n}function Z(t){const{track:e,...r}=t;return X(r).loader}function tt(t){const{track:e,...r}=t??{};return X(r).search}function et(t){return G((t=>{const e=v(t.matches)?.params;return e}))}function rt(){const t=V();return s.useCallback((e=>{const{pending:r,caseSensitive:o,...n}=e;return t.matchRoute(n,{pending:r,caseSensitive:o})}),[])}function ot(){const t=Q().slice(1),e=t[0];return e?s.createElement(nt,{matches:t,match:e}):null}function nt({matches:t,match:e}){const r=V(),o=s.useCallback((()=>null),[]),n=r.getRoute(e.routeId),a=n.options.pendingComponent??r.options.defaultPendingComponent??o,i=n.options.errorComponent??r.options.defaultErrorComponent,c=n.options.wrapInSuspense??!n.isRoot?s.Suspense:st,h=i?it:st;return s.createElement(J.Provider,{value:t},s.createElement(c,{fallback:s.createElement(a,null)},s.createElement(h,{key:n.id,errorComponent:i,onCatch:()=>{e.id}},s.createElement(at,{match:e}))))}function at(t){const e=V(),r=e.getRoute(t.match.routeId);if("error"===t.match.status)throw t.match.error;if("pending"===t.match.status)throw t.match.loadPromise?.then((()=>{Object.assign(t.match,e.getRouteMatch(t.match.id))}))||i(!1);if("success"===t.match.status){let t=r.options.component??e.options.defaultComponent;return t?s.createElement(t,{useLoader:r.useLoader,useMatch:r.useMatch,useContext:r.useContext,useSearch:r.useSearch,useParams:r.useParams}):s.createElement(ot,null)}i(!1)}function st(t){return s.createElement(s.Fragment,null,t.children)}class it extends s.Component{state={error:!1,info:void 0};componentDidCatch(t,e){this.props.onCatch(t,e),console.error(t),this.setState({error:t,info:e})}render(){return s.createElement(ct,H({},this.props,{errorState:this.state,reset:()=>this.setState({})}))}}function ct(t){const e=G(),[r,o]=s.useState(t.errorState),n=t.errorComponent??ht,a=s.useRef("");return s.useEffect((()=>{r&&e.location.key!==a.current&&o({}),a.current=e.location.key}),[r,e.location.key]),s.useEffect((()=>{t.errorState.error&&o(t.errorState)}),[t.errorState.error]),t.errorState.error&&r.error?s.createElement(n,r):t.children}function ht({error:t}){return s.createElement("div",{style:{padding:".5rem",maxWidth:"100%"}},s.createElement("strong",{style:{fontSize:"1.2rem"}},"Something went wrong!"),s.createElement("div",{style:{height:".5rem"}}),s.createElement("div",null,s.createElement("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".5rem",color:"red",overflow:"auto"}},t.message?s.createElement("code",null,t.message):null)))}function ut(t,e=!0){const r=V();s.useEffect((()=>{if(!e)return;let o=r.history.block(((e,r)=>{window.confirm(t)&&(o(),e())}));return o}))}function lt(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!1;for(let o=0;o<r.length;o++)if(!Object.prototype.hasOwnProperty.call(e,r[o])||!Object.is(t[r[o]],e[r[o]]))return!1;return!0}const dt="__root__";class pt{constructor(t){this.options=t||{},this.isRoot=!t?.getParentRoute}init=t=>{this.originalIndex=t.originalIndex,this.router=t.router;const e=this.options,r=!e?.path&&!e?.id;this.parentRoute=this.options?.getParentRoute?.(),r?this.path=dt:i(this.parentRoute);let o=r?dt:e.path;o&&"/"!==o&&(o=L(o));const n=e?.id||o;let a=r?dt:_([this.parentRoute.id===dt?"":this.parentRoute.id,n]);o===dt&&(o="/"),a!==dt&&(a=_(["/",a]));const s=a===dt?"/":_([this.parentRoute.fullPath,o]);this.path=o,this.id=a,this.fullPath=s,this.to=s};addChildren=t=>(this.children=t,this);useMatch=t=>X({...t,from:this.id});useLoader=t=>Z({...t,from:this.id});useContext=t=>X({...t,from:this.id}).context;useSearch=t=>tt({...t,from:this.id});useParams=t=>et(this.id)}class ft extends pt{constructor(t){super(t)}}const mt=gt(JSON.parse),yt=vt(JSON.stringify);function gt(t){return e=>{"?"===e.substring(0,1)&&(e=e.substring(1));let r=T(e);for(let e in r){const o=r[e];if("string"==typeof o)try{r[e]=t(o)}catch(t){}}return r}}function vt(t){return e=>{(e={...e})&&Object.keys(e).forEach((r=>{const o=e[r];if(void 0===o||void 0===o)delete e[r];else if(o&&"object"==typeof o&&null!==o)try{e[r]=t(o)}catch(t){}}));const r=$(e).toString();return r?`?${r}`:""}}const bt=["component","errorComponent","pendingComponent"];const wt="undefined"==typeof window||!window.document.createElement;function St(){return{status:"idle",resolvedLocation:null,location:null,matches:[],preloadMatches:{},lastUpdated:Date.now()}}function Rt(t){return!!t?.isRedirect}t.Block=function({message:t,condition:e,children:r}){return ut(t,e),r??null},t.ErrorComponent=ht,t.Link=W,t.MatchRoute=function(t){const e=rt()(t);return e?"function"==typeof t.children?t.children(e):e?t.children:null:null},t.MatchesProvider=function({matches:t,children:e}){return s.createElement(J.Provider,{value:t},e)},t.Navigate=function(t){const e=V();return s.useLayoutEffect((()=>{e.navigate(t)}),[]),null},t.Outlet=ot,t.RootRoute=ft,t.Route=pt,t.Router=class{#t;startedLoadingAt=Date.now();resolveNavigation=()=>{};constructor(t){this.options={defaultPreloadDelay:50,context:void 0,...t,stringifySearch:t?.stringifySearch??yt,parseSearch:t?.parseSearch??mt},this.__store=new N(St(),{onUpdate:()=>{this.state=this.__store.state}}),this.state=this.__store.state,this.update(t);const e=this.buildNext({hash:!0,fromCurrent:!0,search:!0,state:!0});this.state.location.href!==e.href&&this.#e({...e,replace:!0})}reset=()=>{this.__store.setState((t=>Object.assign(t,St())))};mount=()=>(wt||this.state.matches.length||this.safeLoad(),()=>{});update=t=>{if(this.options={...this.options,...t,context:{...this.options.context,...t?.context}},!this.history||this.options.history&&this.options.history!==this.history){this.#t&&this.#t(),this.history=this.options.history??(wt?m():f());const t=this.#r();this.__store.setState((e=>({...e,resolvedLocation:t,location:t}))),this.#t=this.history.listen((()=>{this.safeLoad({next:this.#r(this.state.location)})}))}const{basepath:e,routeTree:r}=this.options;return this.basepath=`/${L(e??"")??""}`,r&&r!==this.routeTree&&this.#o(r),this};buildNext=t=>{const e=this.#n(t),r=this.matchRoutes(e.pathname,e.search);return this.#n({...t,__matches:r})};cancelMatches=()=>{this.state.matches.forEach((t=>{this.cancelMatch(t.id)}))};cancelMatch=t=>{this.getRouteMatch(t)?.abortController?.abort()};safeLoad=t=>{this.load(t).catch((t=>{console.warn(t),i(!1)}))};load=async t=>{this.#a();const e=Date.now();let r;if(this.startedLoadingAt=e,this.cancelMatches(),this.__store.batch((()=>{t?.next&&this.__store.setState((e=>({...e,location:t.next}))),r=this.matchRoutes(this.state.location.pathname,this.state.location.search,{strictParseParams:!0,debug:!0}),this.__store.setState((t=>({...t,status:"pending",matches:r})))})),await this.loadMatches(r),this.startedLoadingAt!==e)return this.navigationPromise;const o=this.state.resolvedLocation;this.__store.setState((t=>({...t,status:"idle",resolvedLocation:t.location}))),o.href!==this.state.location.href&&this.options.onRouteChange?.(),this.resolveNavigation()};getRoute=t=>{const e=this.routesById[t];return i(e),e};preloadRoute=async(t=this.state.location)=>{const e=this.buildNext(t),r=this.matchRoutes(e.pathname,e.search,{strictParseParams:!0}),o={};return r.forEach((t=>{this.state.matches.find((e=>e.id===t.id))||(o[t.id]=t)})),this.__store.setState((t=>({...t,preloadMatches:{...t.preloadMatches,...o}}))),await this.loadMatches(r,{preload:!0}),r};matchRoutes=(t,e,r)=>{let o={},n=this.flatRoutes.find((e=>{const r=I(this.basepath,t,{to:e.fullPath,caseSensitive:e.options.caseSensitive??this.options.caseSensitive});return!!r&&(o=r,!0)}))||this.routesById.__root__,a=[n];for(;n?.parentRoute;)n=n.parentRoute,n&&a.unshift(n);let s={};const i=a.map((t=>{let n;try{n=t.options.parseParams?.(o)??o}catch(t){if(r?.strictParseParams)throw t}Object.assign(s,n);const a=O(t.path,s),i=O(t.id,s,!0)+(t.options.getKey?.({params:s,search:e})??""),c=this.getRouteMatch(i);if(c)return{...c};const h=!(!t.options.loader&&!bt.some((e=>t.options[e]?.preload)));return{id:i,routeId:t.id,params:s,pathname:_([this.basepath,a]),updatedAt:0,routeSearch:{},search:{},status:h?"pending":"success",error:void 0,loader:void 0,loadPromise:Promise.resolve(),routeContext:void 0,context:void 0,abortController:new AbortController,fetchedAt:0}}));return i.forEach(((t,r)=>{const o=i[r-1],n=this.getRoute(t.routeId),a=(()=>{const r={search:o?.search??e,routeSearch:o?.routeSearch??e};try{const e=("object"==typeof n.options.validateSearch?n.options.validateSearch.parse:n.options.validateSearch)?.(r.search)??{},o={...r.search,...e};return{routeSearch:S(t.routeSearch,e),search:S(t.search,o)}}catch(t){if(Rt(t))throw t;(n.options.onValidateSearchError??n.options.onError)?.(t);const e=new Error("Invalid search params found",{cause:t});throw e.code="INVALID_SEARCH_PARAMS",e}})(),s=(()=>{try{const e=n.options.getContext?.({parentContext:o?.routeContext??{},context:o?.context??this?.options.context??{},params:t.params,search:t.search})||{};return{context:{...o?.context??this?.options.context,...e},routeContext:e}}catch(t){throw n.options.onError?.(t),t}})();Object.assign(t,{...a,...s})})),i};loadMatches=async(t,e)=>{let r;try{await Promise.all(t.map((async(t,e)=>{const o=this.getRoute(t.routeId);try{await(o.options.beforeLoad?.({router:this,match:t}))}catch(n){if(Rt(n))throw n;r=r??e;const a=o.options.onBeforeLoadError??o.options.onError;let s=n;try{a?.(n)}catch(t){if(s=t,Rt(t))throw t}this.#s(t.id,(t=>({...t,error:s,status:"error",updatedAt:Date.now()})))}})))}catch(t){if(Rt(t))return void(e?.preload||this.navigate(t));throw t}const o=t.slice(0,r),n=[];o.forEach(((t,r)=>{n.push(Promise.resolve().then((async()=>{const o=n[r-1],a=this.getRoute(t.routeId),s=Date.now(),i=Promise.resolve().then((async()=>{const r=()=>{const e=this.getRouteMatch(t.id);return e&&e.fetchedAt!==s?e.loadPromise:void 0};let n;const i=(async()=>{await Promise.all(bt.map((async t=>{const e=a.options[t];e?.preload&&await e.preload()})))})(),c=Promise.resolve().then((()=>{if(a.options.loader)return a.options.loader({...t,preload:!!e?.preload,parentMatchPromise:o})}));try{const[o,a]=await Promise.all([i,c]);if(n=r())return await n;e?.preload&&this.state.matches.find((e=>e.id===t.id))||this.#s(t.id,(t=>({...t,error:void 0,status:"success",updatedAt:Date.now(),loader:a})))}catch(o){if(n=r())return await n;if(Rt(o))return void(e?.preload||this.navigate(o));const s=a.options.onLoadError??a.options.onError;let i=o;try{s?.(o)}catch(t){if(i=t,Rt(t))return void(e?.preload||this.navigate(t))}this.#s(t.id,(t=>({...t,error:i,status:"error",updatedAt:Date.now()})))}finally{if(n=r())return await n;e?.preload&&this.__store.setState((e=>{const r={...e.preloadMatches};return delete r[t.id],{...e,preloadMatches:r}}))}}));this.#s(t.id,(t=>({...t,loadPromise:i,fetchedAt:s}))),await i})))})),await Promise.all(n)};reload=()=>{this.navigate({fromCurrent:!0,replace:!0,search:!0})};resolvePath=(t,e)=>k(this.basepath,t,x(e));navigate=async({from:t,to:e="",search:r,hash:o,replace:n,params:a})=>{const s=String(e),c=void 0===t?t:String(t);let h;try{new URL(`${s}`),h=!0}catch(t){}return i(!h),this.#e({from:c,to:s,search:r,hash:o,replace:n,params:a})};matchRoute=(t,e)=>{t={...t,to:t.to?this.resolvePath(t.from??"",t.to):void 0};const r=this.buildNext(t);if(e?.pending&&"pending"!==this.state.status)return!1;const o=e?.pending?this.state.location:this.state.resolvedLocation;if(!o)return!1;const n=I(this.basepath,o.pathname,{...e,to:r.pathname});return!!n&&(e?.includeSearch??1?!!P(o.search,r.search)&&n:n)};buildLink=({from:t,to:e=".",search:r,params:o,hash:n,target:a,replace:s,activeOptions:i,preload:c,preloadDelay:h,disabled:u})=>{try{return new URL(`${e}`),{type:"external",href:e}}catch(t){}const l={from:t,to:e,search:r,params:o,hash:n,replace:s},d=this.buildNext(l);c=c??this.options.defaultPreload;const p=h??this.options.defaultPreloadDelay??0,f=this.state.location.pathname.split("/"),m=d.pathname.split("/").every(((t,e)=>t===f[e])),y=i?.exact?this.state.location.pathname===d.pathname:m,g=!i?.includeHash||this.state.location.hash===d.hash,v=!(i?.includeSearch??1)||P(this.state.location.search,d.search);return{type:"internal",next:d,handleFocus:t=>{c&&this.preloadRoute(l).catch((t=>{console.warn(t),console.warn("Error preloading route! ☝️")}))},handleClick:t=>{u||function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}(t)||t.defaultPrevented||a&&"_self"!==a||0!==t.button||(t.preventDefault(),this.#e(l))},handleEnter:t=>{const e=t.target||{};if(c){if(e.preloadTimeout)return;e.preloadTimeout=setTimeout((()=>{e.preloadTimeout=null,this.preloadRoute(l).catch((t=>{console.warn(t),console.warn("Error preloading route! ☝️")}))}),p)}},handleLeave:t=>{const e=t.target||{};e.preloadTimeout&&(clearTimeout(e.preloadTimeout),e.preloadTimeout=null)},handleTouchStart:t=>{this.preloadRoute(l).catch((t=>{console.warn(t),console.warn("Error preloading route! ☝️")}))},isActive:y&&g&&v,disabled:u}};dehydrate=()=>({state:{...w(this.state,["location","status","lastUpdated"])}});hydrate=async t=>{let e=t;"undefined"!=typeof document&&(e=window.__TSR_DEHYDRATED__),i(e);const r=e;this.options.hydrate?.(r.payload),this.__store.setState((t=>({...t,...r.router.state,matches:t.matches,resolvedLocation:r.router.state.location}))),await this.load()};injectedHtml=[];injectHtml=async t=>{this.injectedHtml.push(t)};dehydrateData=(t,e)=>{if("undefined"==typeof document){const r="string"==typeof t?t:JSON.stringify(t);return this.injectHtml((async()=>{const t=`__TSR_DEHYDRATED__${r}`,o="function"==typeof e?await e():e;return`<script id='${t}' suppressHydrationWarning>window["__TSR_DEHYDRATED__${n=r,n.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/"/g,'\\"')}"] = ${JSON.stringify(o)}\n ;(() => {\n var el = document.getElementById('${t}')\n el.parentElement.removeChild(el)\n })()\n <\/script>`;var n})),()=>this.hydrateData(t)}return()=>{}};hydrateData=t=>{if("undefined"!=typeof document){const e="string"==typeof t?t:JSON.stringify(t);return window[`__TSR_DEHYDRATED__${e}`]}};#o=t=>{this.routeTree=t,this.routesById={},this.routesByPath={},this.flatRoutes=[];const e=t=>{t.forEach(((t,r)=>{t.init({originalIndex:r,router:this});if(i(!this.routesById[t.id],String(t.id)),this.routesById[t.id]=t,!t.isRoot&&t.path){const e=M(t.fullPath);this.routesByPath[e]&&!t.fullPath.endsWith("/")||(this.routesByPath[e]=t)}const o=t.children;o?.length&&e(o)}))};e([t]),this.flatRoutes=Object.values(this.routesByPath).map(((t,e)=>{const r=L(t.fullPath),o=j(r);for(;o.length>1&&"/"===o[0]?.value;)o.shift();const n=o.map((t=>"param"===t.type?.5:"wildcard"===t.type?.25:1));return{child:t,trimmed:r,parsed:o,index:e,score:n}})).sort(((t,e)=>{let r="/"===t.trimmed?1:"/"===e.trimmed?-1:0;if(0!==r)return r;const o=Math.min(t.score.length,e.score.length);if(t.score.length!==e.score.length)return e.score.length-t.score.length;for(let r=0;r<o;r++)if(t.score[r]!==e.score[r])return e.score[r]-t.score[r];for(let r=0;r<o;r++)if(t.parsed[r].value!==e.parsed[r].value)return t.parsed[r].value>e.parsed[r].value?1:-1;return t.trimmed!==e.trimmed?t.trimmed>e.trimmed?1:-1:t.index-e.index})).map(((t,e)=>(t.child.rank=e,t.child)))};#r=t=>{let{pathname:e,search:r,hash:o,state:n}=this.history.location;const a=this.options.parseSearch(r);return{pathname:e,searchStr:r,search:S(t?.search,a),hash:o.split("#").reverse()[0]??"",href:`${e}${r}${o}`,state:n,key:n?.key||"__init__"}};#n=(t={})=>{t.fromCurrent=t.fromCurrent??""===t.to;const e=t.fromCurrent?this.state.location.pathname:t.from??this.state.location.pathname;let r=k(this.basepath??"/",e,`${t.to??""}`);const o={...v(this.matchRoutes(this.state.location.pathname,this.state.location.search,{strictParseParams:!0}))?.params};let n=!0===(t.params??!0)?o:b(t.params,o);n&&t.__matches?.map((t=>this.getRoute(t.routeId).options.stringifyParams)).filter(Boolean).forEach((t=>{n={...n,...t(n)}})),r=O(r,n??{});const a=t.__matches?.map((t=>this.getRoute(t.routeId).options.preSearchFilters??[])).flat().filter(Boolean)??[],s=t.__matches?.map((t=>this.getRoute(t.routeId).options.postSearchFilters??[])).flat().filter(Boolean)??[],i=a?.length?a?.reduce(((t,e)=>e(t)),this.state.location.search):this.state.location.search,c=!0===t.search?i:t.search?b(t.search,i)??{}:a?.length?i:{},h=s?.length?s.reduce(((t,e)=>e(t)),c):c,u=S(this.state.location.search,h),l=this.options.stringifySearch(u),d=!0===t.hash?this.state.location.hash:b(t.hash,this.state.location.hash),p=d?`#${d}`:"";return{pathname:r,search:u,searchStr:l,state:!0===t.state?this.state.location.state:b(t.state,this.state.location.state),hash:d,href:this.history.createHref(`${r}${l}${p}`),key:t.key}};#e=async t=>{const e=this.buildNext(t),r=""+Date.now()+Math.random();this.navigateTimeout&&clearTimeout(this.navigateTimeout);let o="replace";t.replace||(o="push");this.state.location.href===e.href&&!e.key&&(o="replace");const n=`${e.pathname}${e.searchStr}${e.hash?`#${e.hash}`:""}`;return this.history["push"===o?"push":"replace"](n,{id:r,...e.state}),this.#a()};#a=()=>{const t=this.resolveNavigation;return this.navigationPromise=new Promise((e=>{this.resolveNavigation=()=>{e(),t()}})),this.navigationPromise};getRouteMatch=t=>this.state.matches.find((e=>e.id===t))||this.state.preloadMatches[t];setRouteMatch=(t,e)=>{this.__store.setState((r=>({...r,matches:r.matches.map((r=>r.id===t?e(r):r))})))};setPreloadRouteMatch=(t,e)=>{i(this.state.preloadMatches[t]),this.__store.setState((r=>({...r,preloadMatches:{...r.preloadMatches,[t]:e(r.preloadMatches[t])}})))};#s=(t,e)=>this.state.matches.find((e=>e.id===t))?this.setRouteMatch(t,e):this.state.preloadMatches[t]?this.setPreloadRouteMatch(t,e):void 0},t.RouterContext=class{constructor(){}createRootRoute=t=>new ft(t)},t.RouterProvider=function({router:t,...e}){t.update(e);const[r,o]=s.useState((()=>t.state)),n=r.matches;Y((()=>t.__store.subscribe((()=>{Promise.resolve().then((()=>{(s.startTransition||(t=>t()))((()=>o(t.state)))}))})))),s.useEffect(t.mount,[t]);const a=t.options.Wrap||s.Fragment;return s.createElement(a,null,s.createElement(q.Provider,{value:t},s.createElement(K.Provider,{value:r},s.createElement(J.Provider,{value:[void 0,...n]},s.createElement(it,{errorComponent:ht,onCatch:()=>{}},s.createElement(ot,null))))))},t.cleanPath=x,t.componentTypes=bt,t.createBrowserHistory=f,t.createHashHistory=function(){return f({getHref:()=>window.location.hash.substring(1),createHref:t=>`#${t}`})},t.createMemoryHistory=m,t.decode=T,t.defaultParseSearch=mt,t.defaultStringifySearch=yt,t.encode=$,t.functionalUpdate=b,t.interpolatePath=O,t.invariant=i,t.isPlainObject=R,t.isRedirect=Rt,t.joinPaths=_,t.last=v,t.lazy=function(t,e="default"){const r=s.lazy((async()=>({default:(await t())[e]})));return r.preload=async()=>{await t()},r},t.matchByPath=D,t.matchPathname=I,t.matchesContext=J,t.parsePathname=j,t.parseSearchWith=gt,t.partialDeepEqual=P,t.pick=w,t.redirect=function(t){return t.isRedirect=!0,t},t.replaceEqualDeep=S,t.resolvePath=k,t.rootRouteId=dt,t.routerContext=q,t.routerStateContext=K,t.shallow=lt,t.stringifySearchWith=vt,t.trimPath=L,t.trimPathLeft=C,t.trimPathRight=M,t.useBlocker=ut,t.useDehydrate=function(){const t=V();return s.useCallback((function(e,r){return t.dehydrateData(e,r)}),[])},t.useHydrate=function(){const t=V();return function(e){return t.hydrateData(e)}},t.useHydrationContext=function(){return F.getContext("TanStackRouterHydrationContext",{}).payload},t.useInjectHtml=function(){const t=V();return s.useCallback((e=>{t.injectHtml(e)}),[])},t.useLinkProps=z,t.useLoader=Z,t.useMatch=X,t.useMatchRoute=rt,t.useMatches=Q,t.useNavigate=function(t){const e=V();return s.useCallback((r=>e.navigate({...t,...r})),[])},t.useParams=et,t.useRouter=V,t.useRouterState=G,t.useSearch=tt,t.useStore=function(t,e=(t=>t)){return r.useSyncExternalStoreWithSelector(t.subscribe,(()=>t.state),(()=>t.state),e,B)},t.warning=c,Object.defineProperty(t,"__esModule",{value:!0})}));
*/function H(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!1;for(let o=0;o<r.length;o++)if(!Object.prototype.hasOwnProperty.call(e,r[o])||!Object.is(t[r[o]],e[r[o]]))return!1;return!0}function N(t){const e=J(),{type:r,children:o,target:n,activeProps:s=(()=>({className:"active"})),inactiveProps:i=(()=>({})),activeOptions:c,disabled:h,hash:u,search:l,params:d,to:p=".",preload:f,preloadDelay:m,replace:y,style:v,className:b,onClick:w,onFocus:S,onMouseEnter:R,onMouseLeave:E,onTouchStart:P,..._}=t,x=e.buildLink(t);if("external"===x.type){const{href:t}=x;return{href:t}}const{handleClick:C,handleFocus:M,handleEnter:L,handleLeave:k,handleTouchStart:j,isActive:O,next:D}=x,I=t=>e=>{e.persist&&e.persist(),t.filter(Boolean).forEach((t=>{e.defaultPrevented||t(e)}))},$=O?g(s,{})??{}:{},A=O?{}:g(i,{})??{};return{...$,...A,..._,href:h?void 0:D.href,onClick:I([w,t=>{a.startTransition?a.startTransition((()=>{C(t)})):C(t)}]),onFocus:I([S,M]),onMouseEnter:I([R,L]),onMouseLeave:I([E,k]),onTouchStart:I([P,j]),target:n,style:{...v,...$.style,...A.style},className:[b,$.className,A.className].filter(Boolean).join(" ")||void 0,...h?{role:"link","aria-disabled":!0}:void 0,"data-status":O?"active":void 0}}const B=a.forwardRef(((t,e)=>{const r=N(t);return a.createElement("a",A({ref:e},r,{children:"function"==typeof t.children?t.children({isActive:"active"===r["data-status"]}):t.children}))}));const U=a.createContext(null),F=a.createContext(null),z=a.createContext(null);const W="undefined"==typeof document?a.useEffect:a.useLayoutEffect;function J(){return a.useContext(z)}function K(t){const e=a.useContext(F),r=t?.(e)??e,o=a.useRef(r);return it(o.current,r)||(o.current=r),o.current}function q(){return a.useContext(U)}function Y(t){const e=K(),r=q()[0],o=e.matches,a=t?.from?o.find((e=>e.routeId===t?.from)):r;return n(a,t?.from&&t.from),(t?.strict??1)&&n(r.routeId==a?.routeId,(a?.routeId,r.routeId,a?.routeId,a?.routeId)),a}function V(t){const{track:e,...r}=t;return Y(r).loader}function G(t){const{track:e,...r}=t??{};return Y(r).search}function Q(t){return K((t=>{const e=y(t.matches)?.params;return e}))}function X(){const t=J();return a.useCallback((e=>{const{pending:r,caseSensitive:o,...a}=e;return t.matchRoute(a,{pending:r,caseSensitive:o})}),[])}function Z(){const t=q().slice(1),e=t[0];return e?a.createElement(tt,{matches:t,match:e}):null}function tt({matches:t,match:e}){const r=J(),o=a.useCallback((()=>null),[]),n=r.getRoute(e.routeId),s=n.options.pendingComponent??r.options.defaultPendingComponent??o,i=n.options.errorComponent??r.options.defaultErrorComponent,c=n.options.wrapInSuspense??!n.isRoot?a.Suspense:rt,h=i?ot:rt;return a.createElement(U.Provider,{value:t},a.createElement(c,{fallback:a.createElement(s,null)},a.createElement(h,{key:n.id,errorComponent:i,onCatch:()=>{e.id}},a.createElement(et,{match:e}))))}function et(t){const e=J(),r=e.getRoute(t.match.routeId);if("error"===t.match.status)throw t.match.error;if("pending"===t.match.status)throw t.match.loadPromise?.then((()=>{Object.assign(t.match,e.getRouteMatch(t.match.id))}))||n(!1);if("success"===t.match.status){let t=r.options.component??e.options.defaultComponent;return t?a.createElement(t,{useLoader:r.useLoader,useMatch:r.useMatch,useContext:r.useContext,useSearch:r.useSearch,useParams:r.useParams}):a.createElement(Z,null)}n(!1)}function rt(t){return a.createElement(a.Fragment,null,t.children)}class ot extends a.Component{state={error:!1,info:void 0};componentDidCatch(t,e){this.props.onCatch(t,e),console.error(t),this.setState({error:t,info:e})}render(){return a.createElement(at,A({},this.props,{errorState:this.state,reset:()=>this.setState({})}))}}function at(t){const e=K(),[r,o]=a.useState(t.errorState),n=t.errorComponent??nt,s=a.useRef("");return a.useEffect((()=>{r&&e.location.key!==s.current&&o({}),s.current=e.location.key}),[r,e.location.key]),a.useEffect((()=>{t.errorState.error&&o(t.errorState)}),[t.errorState.error]),t.errorState.error&&r.error?a.createElement(n,r):t.children}function nt({error:t}){return a.createElement("div",{style:{padding:".5rem",maxWidth:"100%"}},a.createElement("strong",{style:{fontSize:"1.2rem"}},"Something went wrong!"),a.createElement("div",{style:{height:".5rem"}}),a.createElement("div",null,a.createElement("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".5rem",color:"red",overflow:"auto"}},t.message?a.createElement("code",null,t.message):null)))}function st(t,e=!0){const r=J();a.useEffect((()=>{if(!e)return;let o=r.history.block(((e,r)=>{window.confirm(t)&&(o(),e())}));return o}))}function it(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!1;for(let o=0;o<r.length;o++)if(!Object.prototype.hasOwnProperty.call(e,r[o])||!Object.is(t[r[o]],e[r[o]]))return!1;return!0}const ct="__root__";class ht{constructor(t){this.options=t||{},this.isRoot=!t?.getParentRoute}init=t=>{this.originalIndex=t.originalIndex,this.router=t.router;const e=this.options,r=!e?.path&&!e?.id;this.parentRoute=this.options?.getParentRoute?.(),r?this.path=ct:n(this.parentRoute);let o=r?ct:e.path;o&&"/"!==o&&(o=C(o));const a=e?.id||o;let s=r?ct:E([this.parentRoute.id===ct?"":this.parentRoute.id,a]);o===ct&&(o="/"),s!==ct&&(s=E(["/",s]));const i=s===ct?"/":E([this.parentRoute.fullPath,o]);this.path=o,this.id=s,this.fullPath=i,this.to=i};addChildren=t=>(this.children=t,this);useMatch=t=>Y({...t,from:this.id});useLoader=t=>V({...t,from:this.id});useContext=t=>Y({...t,from:this.id}).context;useSearch=t=>G({...t,from:this.id});useParams=t=>Q(this.id)}class ut extends ht{constructor(t){super(t)}}const lt=pt(JSON.parse),dt=ft(JSON.stringify);function pt(t){return e=>{"?"===e.substring(0,1)&&(e=e.substring(1));let r=$(e);for(let e in r){const o=r[e];if("string"==typeof o)try{r[e]=t(o)}catch(t){}}return r}}function ft(t){return e=>{(e={...e})&&Object.keys(e).forEach((r=>{const o=e[r];if(void 0===o||void 0===o)delete e[r];else if(o&&"object"==typeof o&&null!==o)try{e[r]=t(o)}catch(t){}}));const r=D(e).toString();return r?`?${r}`:""}}const mt=["component","errorComponent","pendingComponent"];const yt="undefined"==typeof window||!window.document.createElement;function gt(){return{status:"idle",resolvedLocation:null,location:null,matches:[],preloadMatches:{},lastUpdated:Date.now()}}function vt(t){return!!t?.isRedirect}t.Block=function({message:t,condition:e,children:r}){return st(t,e),r??null},t.ErrorComponent=nt,t.Link=B,t.MatchRoute=function(t){const e=X()(t);return e?"function"==typeof t.children?t.children(e):e?t.children:null:null},t.MatchesProvider=function({matches:t,children:e}){return a.createElement(U.Provider,{value:t},e)},t.Navigate=function(t){const e=J();return a.useLayoutEffect((()=>{e.navigate(t)}),[]),null},t.Outlet=Z,t.RootRoute=ut,t.Route=ht,t.Router=class{#t;startedLoadingAt=Date.now();resolveNavigation=()=>{};constructor(t){this.options={defaultPreloadDelay:50,context:void 0,...t,stringifySearch:t?.stringifySearch??dt,parseSearch:t?.parseSearch??lt},this.__store=new T(gt(),{onUpdate:()=>{this.state=this.__store.state}}),this.state=this.__store.state,this.update(t);const e=this.buildNext({hash:!0,fromCurrent:!0,search:!0,state:!0});this.state.location.href!==e.href&&this.#e({...e,replace:!0})}reset=()=>{this.__store.setState((t=>Object.assign(t,gt())))};mount=()=>(yt||this.state.matches.length||this.safeLoad(),()=>{});update=t=>{if(this.options={...this.options,...t,context:{...this.options.context,...t?.context}},!this.history||this.options.history&&this.options.history!==this.history){this.#t&&this.#t(),this.history=this.options.history??(yt?p():d());const t=this.#r();this.__store.setState((e=>({...e,resolvedLocation:t,location:t}))),this.#t=this.history.listen((()=>{this.safeLoad({next:this.#r(this.state.location)})}))}const{basepath:e,routeTree:r}=this.options;return this.basepath=`/${C(e??"")??""}`,r&&r!==this.routeTree&&this.#o(r),this};buildNext=t=>{const e=this.#a(t),r=this.matchRoutes(e.pathname,e.search);return this.#a({...t,__matches:r})};cancelMatches=()=>{this.state.matches.forEach((t=>{this.cancelMatch(t.id)}))};cancelMatch=t=>{this.getRouteMatch(t)?.abortController?.abort()};safeLoad=t=>{this.load(t).catch((t=>{console.warn(t),n(!1)}))};load=async t=>{this.#n();const e=Date.now();let r;if(this.startedLoadingAt=e,this.cancelMatches(),this.__store.batch((()=>{t?.next&&this.__store.setState((e=>({...e,location:t.next}))),r=this.matchRoutes(this.state.location.pathname,this.state.location.search,{strictParseParams:!0,debug:!0}),this.__store.setState((t=>({...t,status:"pending",matches:r})))})),await this.loadMatches(r),this.startedLoadingAt!==e)return this.navigationPromise;const o=this.state.resolvedLocation;this.__store.setState((t=>({...t,status:"idle",resolvedLocation:t.location}))),o.href!==this.state.location.href&&this.options.onRouteChange?.(),this.resolveNavigation()};getRoute=t=>{const e=this.routesById[t];return n(e),e};preloadRoute=async(t=this.state.location)=>{const e=this.buildNext(t),r=this.matchRoutes(e.pathname,e.search,{strictParseParams:!0}),o={};return r.forEach((t=>{this.state.matches.find((e=>e.id===t.id))||(o[t.id]=t)})),this.__store.setState((t=>({...t,preloadMatches:{...t.preloadMatches,...o}}))),await this.loadMatches(r,{preload:!0}),r};matchRoutes=(t,e,r)=>{let o={},a=this.flatRoutes.find((e=>{const r=j(this.basepath,t,{to:e.fullPath,caseSensitive:e.options.caseSensitive??this.options.caseSensitive});return!!r&&(o=r,!0)}))||this.routesById.__root__,n=[a];for(;a?.parentRoute;)a=a.parentRoute,a&&n.unshift(a);let s={};const i=n.map((t=>{let a;try{a=t.options.parseParams?.(o)??o}catch(t){if(r?.strictParseParams)throw t}Object.assign(s,a);const n=k(t.path,s),i=k(t.id,s,!0)+(t.options.getKey?.({params:s,search:e})??""),c=this.getRouteMatch(i);if(c)return{...c};const h=!(!t.options.loader&&!mt.some((e=>t.options[e]?.preload)));return{id:i,routeId:t.id,params:s,pathname:E([this.basepath,n]),updatedAt:0,routeSearch:{},search:{},status:h?"pending":"success",error:void 0,loader:void 0,loadPromise:Promise.resolve(),routeContext:void 0,context:void 0,abortController:new AbortController,fetchedAt:0}}));return i.forEach(((t,r)=>{const o=i[r-1],a=this.getRoute(t.routeId),n=(()=>{const r={search:o?.search??e,routeSearch:o?.routeSearch??e};try{const e=("object"==typeof a.options.validateSearch?a.options.validateSearch.parse:a.options.validateSearch)?.(r.search)??{},o={...r.search,...e};return{routeSearch:b(t.routeSearch,e),search:b(t.search,o)}}catch(t){if(vt(t))throw t;(a.options.onValidateSearchError??a.options.onError)?.(t);const e=new Error("Invalid search params found",{cause:t});throw e.code="INVALID_SEARCH_PARAMS",e}})(),s=(()=>{try{const e=a.options.getContext?.({parentContext:o?.routeContext??{},context:o?.context??this?.options.context??{},params:t.params,search:t.search})||{};return{context:{...o?.context??this?.options.context,...e},routeContext:e}}catch(t){throw a.options.onError?.(t),t}})();Object.assign(t,{...n,...s})})),i};loadMatches=async(t,e)=>{let r;try{await Promise.all(t.map((async(t,e)=>{const o=this.getRoute(t.routeId);try{await(o.options.beforeLoad?.({router:this,match:t}))}catch(a){if(vt(a))throw a;r=r??e;const n=o.options.onBeforeLoadError??o.options.onError;let s=a;try{n?.(a)}catch(t){if(s=t,vt(t))throw t}this.#s(t.id,(t=>({...t,error:s,status:"error",updatedAt:Date.now()})))}})))}catch(t){if(vt(t))return void(e?.preload||this.navigate(t));throw t}const o=t.slice(0,r),a=[];o.forEach(((t,r)=>{a.push(Promise.resolve().then((async()=>{const o=a[r-1],n=this.getRoute(t.routeId),s=Date.now(),i=Promise.resolve().then((async()=>{const r=()=>{const e=this.getRouteMatch(t.id);return e&&e.fetchedAt!==s?e.loadPromise:void 0};let a;const i=(async()=>{await Promise.all(mt.map((async t=>{const e=n.options[t];e?.preload&&await e.preload()})))})(),c=Promise.resolve().then((()=>{if(n.options.loader)return n.options.loader({...t,preload:!!e?.preload,parentMatchPromise:o})}));try{const[o,n]=await Promise.all([i,c]);if(a=r())return await a;e?.preload&&this.state.matches.find((e=>e.id===t.id))||this.#s(t.id,(t=>({...t,error:void 0,status:"success",updatedAt:Date.now(),loader:n})))}catch(o){if(a=r())return await a;if(vt(o))return void(e?.preload||this.navigate(o));const s=n.options.onLoadError??n.options.onError;let i=o;try{s?.(o)}catch(t){if(i=t,vt(t))return void(e?.preload||this.navigate(t))}this.#s(t.id,(t=>({...t,error:i,status:"error",updatedAt:Date.now()})))}finally{if(a=r())return await a;e?.preload&&this.__store.setState((e=>{const r={...e.preloadMatches};return delete r[t.id],{...e,preloadMatches:r}}))}}));this.#s(t.id,(t=>({...t,loadPromise:i,fetchedAt:s}))),await i})))})),await Promise.all(a)};reload=()=>{this.navigate({fromCurrent:!0,replace:!0,search:!0})};resolvePath=(t,e)=>M(this.basepath,t,P(e));navigate=async({from:t,to:e="",search:r,hash:o,replace:a,params:s})=>{const i=String(e),c=void 0===t?t:String(t);let h;try{new URL(`${i}`),h=!0}catch(t){}return n(!h),this.#e({from:c,to:i,search:r,hash:o,replace:a,params:s})};matchRoute=(t,e)=>{t={...t,to:t.to?this.resolvePath(t.from??"",t.to):void 0};const r=this.buildNext(t);if(e?.pending&&"pending"!==this.state.status)return!1;const o=e?.pending?this.state.location:this.state.resolvedLocation;if(!o)return!1;const a=j(this.basepath,o.pathname,{...e,to:r.pathname});return!!a&&(e?.includeSearch??1?!!R(o.search,r.search)&&a:a)};buildLink=({from:t,to:e=".",search:r,params:o,hash:a,target:n,replace:s,activeOptions:i,preload:c,preloadDelay:h,disabled:u})=>{try{return new URL(`${e}`),{type:"external",href:e}}catch(t){}const l={from:t,to:e,search:r,params:o,hash:a,replace:s},d=this.buildNext(l);c=c??this.options.defaultPreload;const p=h??this.options.defaultPreloadDelay??0,f=this.state.location.pathname.split("/"),m=d.pathname.split("/").every(((t,e)=>t===f[e])),y=i?.exact?this.state.location.pathname===d.pathname:m,g=!i?.includeHash||this.state.location.hash===d.hash,v=!(i?.includeSearch??1)||R(this.state.location.search,d.search);return{type:"internal",next:d,handleFocus:t=>{c&&this.preloadRoute(l).catch((t=>{console.warn(t),console.warn("Error preloading route! ☝️")}))},handleClick:t=>{u||function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}(t)||t.defaultPrevented||n&&"_self"!==n||0!==t.button||(t.preventDefault(),this.#e(l))},handleEnter:t=>{const e=t.target||{};if(c){if(e.preloadTimeout)return;e.preloadTimeout=setTimeout((()=>{e.preloadTimeout=null,this.preloadRoute(l).catch((t=>{console.warn(t),console.warn("Error preloading route! ☝️")}))}),p)}},handleLeave:t=>{const e=t.target||{};e.preloadTimeout&&(clearTimeout(e.preloadTimeout),e.preloadTimeout=null)},handleTouchStart:t=>{this.preloadRoute(l).catch((t=>{console.warn(t),console.warn("Error preloading route! ☝️")}))},isActive:y&&g&&v,disabled:u}};dehydrate=()=>({state:v(this.state,["location","status","lastUpdated"])});hydrate=async t=>{let e=t;"undefined"!=typeof document&&(e=window.__TSR_DEHYDRATED__),n(e);const r=e;this.dehydratedData=r.payload,this.options.hydrate?.(r.payload),this.__store.setState((t=>({...t,...r.router.state,matches:t.matches,resolvedLocation:r.router.state.location}))),await this.load()};injectedHtml=[];injectHtml=async t=>{this.injectedHtml.push(t)};dehydrateData=(t,e)=>{if("undefined"==typeof document){const r="string"==typeof t?t:JSON.stringify(t);return this.injectHtml((async()=>{const t=`__TSR_DEHYDRATED__${r}`,o="function"==typeof e?await e():e;return`<script id='${t}' suppressHydrationWarning>window["__TSR_DEHYDRATED__${a=r,a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/"/g,'\\"')}"] = ${JSON.stringify(o)}\n ;(() => {\n var el = document.getElementById('${t}')\n el.parentElement.removeChild(el)\n })()\n <\/script>`;var a})),()=>this.hydrateData(t)}return()=>{}};hydrateData=t=>{if("undefined"!=typeof document){const e="string"==typeof t?t:JSON.stringify(t);return window[`__TSR_DEHYDRATED__${e}`]}};#o=t=>{this.routeTree=t,this.routesById={},this.routesByPath={},this.flatRoutes=[];const e=t=>{t.forEach(((t,r)=>{t.init({originalIndex:r,router:this});if(n(!this.routesById[t.id],String(t.id)),this.routesById[t.id]=t,!t.isRoot&&t.path){const e=x(t.fullPath);this.routesByPath[e]&&!t.fullPath.endsWith("/")||(this.routesByPath[e]=t)}const o=t.children;o?.length&&e(o)}))};e([t]),this.flatRoutes=Object.values(this.routesByPath).map(((t,e)=>{const r=C(t.fullPath),o=L(r);for(;o.length>1&&"/"===o[0]?.value;)o.shift();const a=o.map((t=>"param"===t.type?.5:"wildcard"===t.type?.25:1));return{child:t,trimmed:r,parsed:o,index:e,score:a}})).sort(((t,e)=>{let r="/"===t.trimmed?1:"/"===e.trimmed?-1:0;if(0!==r)return r;const o=Math.min(t.score.length,e.score.length);if(t.score.length!==e.score.length)return e.score.length-t.score.length;for(let r=0;r<o;r++)if(t.score[r]!==e.score[r])return e.score[r]-t.score[r];for(let r=0;r<o;r++)if(t.parsed[r].value!==e.parsed[r].value)return t.parsed[r].value>e.parsed[r].value?1:-1;return t.trimmed!==e.trimmed?t.trimmed>e.trimmed?1:-1:t.index-e.index})).map(((t,e)=>(t.child.rank=e,t.child)))};#r=t=>{let{pathname:e,search:r,hash:o,state:a}=this.history.location;const n=this.options.parseSearch(r);return{pathname:e,searchStr:r,search:b(t?.search,n),hash:o.split("#").reverse()[0]??"",href:`${e}${r}${o}`,state:a,key:a?.key||"__init__"}};#a=(t={})=>{t.fromCurrent=t.fromCurrent??""===t.to;const e=t.fromCurrent?this.state.location.pathname:t.from??this.state.location.pathname;let r=M(this.basepath??"/",e,`${t.to??""}`);const o={...y(this.matchRoutes(this.state.location.pathname,this.state.location.search,{strictParseParams:!0}))?.params};let a=!0===(t.params??!0)?o:g(t.params,o);a&&t.__matches?.map((t=>this.getRoute(t.routeId).options.stringifyParams)).filter(Boolean).forEach((t=>{a={...a,...t(a)}})),r=k(r,a??{});const n=t.__matches?.map((t=>this.getRoute(t.routeId).options.preSearchFilters??[])).flat().filter(Boolean)??[],s=t.__matches?.map((t=>this.getRoute(t.routeId).options.postSearchFilters??[])).flat().filter(Boolean)??[],i=n?.length?n?.reduce(((t,e)=>e(t)),this.state.location.search):this.state.location.search,c=!0===t.search?i:t.search?g(t.search,i)??{}:n?.length?i:{},h=s?.length?s.reduce(((t,e)=>e(t)),c):c,u=b(this.state.location.search,h),l=this.options.stringifySearch(u),d=!0===t.hash?this.state.location.hash:g(t.hash,this.state.location.hash),p=d?`#${d}`:"";return{pathname:r,search:u,searchStr:l,state:!0===t.state?this.state.location.state:g(t.state,this.state.location.state),hash:d,href:this.history.createHref(`${r}${l}${p}`),key:t.key}};#e=async t=>{const e=this.buildNext(t),r=""+Date.now()+Math.random();this.navigateTimeout&&clearTimeout(this.navigateTimeout);let o="replace";t.replace||(o="push");this.state.location.href===e.href&&!e.key&&(o="replace");const a=`${e.pathname}${e.searchStr}${e.hash?`#${e.hash}`:""}`;return this.history["push"===o?"push":"replace"](a,{id:r,...e.state}),this.#n()};#n=()=>{const t=this.resolveNavigation;return this.navigationPromise=new Promise((e=>{this.resolveNavigation=()=>{e(),t()}})),this.navigationPromise};getRouteMatch=t=>this.state.matches.find((e=>e.id===t))||this.state.preloadMatches[t];setRouteMatch=(t,e)=>{this.__store.setState((r=>({...r,matches:r.matches.map((r=>r.id===t?e(r):r))})))};setPreloadRouteMatch=(t,e)=>{n(this.state.preloadMatches[t]),this.__store.setState((r=>({...r,preloadMatches:{...r.preloadMatches,[t]:e(r.preloadMatches[t])}})))};#s=(t,e)=>this.state.matches.find((e=>e.id===t))?this.setRouteMatch(t,e):this.state.preloadMatches[t]?this.setPreloadRouteMatch(t,e):void 0},t.RouterContext=class{constructor(){}createRootRoute=t=>new ut(t)},t.RouterProvider=function({router:t,...e}){t.update(e);const[r,o]=a.useState((()=>t.state)),n=r.matches;W((()=>t.__store.subscribe((()=>{Promise.resolve().then((()=>{(a.startTransition||(t=>t()))((()=>o(t.state)))}))})))),a.useEffect(t.mount,[t]);const s=t.options.Wrap||a.Fragment;return a.createElement(s,null,a.createElement(z.Provider,{value:t},a.createElement(F.Provider,{value:r},a.createElement(U.Provider,{value:[void 0,...n]},a.createElement(ot,{errorComponent:nt,onCatch:()=>{}},a.createElement(Z,null))))))},t.cleanPath=P,t.componentTypes=mt,t.createBrowserHistory=d,t.createHashHistory=function(){return d({getHref:()=>window.location.hash.substring(1),createHref:t=>`#${t}`})},t.createMemoryHistory=p,t.decode=$,t.defaultParseSearch=lt,t.defaultStringifySearch=dt,t.encode=D,t.functionalUpdate=g,t.interpolatePath=k,t.invariant=n,t.isPlainObject=w,t.isRedirect=vt,t.joinPaths=E,t.last=y,t.lazy=function(t,e="default"){const r=a.lazy((async()=>({default:(await t())[e]})));return r.preload=async()=>{await t()},r},t.matchByPath=O,t.matchPathname=j,t.matchesContext=U,t.parsePathname=L,t.parseSearchWith=pt,t.partialDeepEqual=R,t.pick=v,t.redirect=function(t){return t.isRedirect=!0,t},t.replaceEqualDeep=b,t.resolvePath=M,t.rootRouteId=ct,t.routerContext=z,t.routerStateContext=F,t.shallow=it,t.stringifySearchWith=ft,t.trimPath=C,t.trimPathLeft=_,t.trimPathRight=x,t.useBlocker=st,t.useDehydrate=function(){const t=J();return a.useCallback((function(e,r){return t.dehydrateData(e,r)}),[])},t.useHydrate=function(){const t=J();return function(e){return t.hydrateData(e)}},t.useInjectHtml=function(){const t=J();return a.useCallback((e=>{t.injectHtml(e)}),[])},t.useLinkProps=N,t.useLoader=V,t.useMatch=Y,t.useMatchRoute=X,t.useMatches=q,t.useNavigate=function(t){const e=J();return a.useCallback((r=>e.navigate({...t,...r})),[])},t.useParams=Q,t.useRouter=J,t.useRouterState=K,t.useSearch=G,t.useStore=function(t,e=(t=>t)){return r.useSyncExternalStoreWithSelector(t.subscribe,(()=>t.state),(()=>t.state),e,H)},t.warning=s,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=index.production.js.map
{
"name": "@tanstack/router",
"author": "Tanner Linsley",
"version": "0.0.1-beta.130",
"version": "0.0.1-beta.131",
"license": "MIT",

@@ -6,0 +6,0 @@ "repository": "tanstack/router",

@@ -277,2 +277,3 @@ import { Store } from '@tanstack/react-store'

resolveNavigation: () => void = () => {}
dehydratedData?: TDehydrated

@@ -586,3 +587,2 @@ constructor(options: RouterConstructorOptions<TRouteTree, TDehydrated>) {

const routeMatch: RouteMatch = {

@@ -1109,9 +1109,3 @@ id: matchId,

return {
state: {
...pick(this.state, ['location', 'status', 'lastUpdated']),
// matches: this.state.matches.map((m) => ({
// id: m.id,
// promiseKeys: Object.keys(m.__promisesByKey),
// })),
},
state: pick(this.state, ['location', 'status', 'lastUpdated']),
}

@@ -1133,3 +1127,3 @@ }

const ctx = _ctx
this.dehydratedData = ctx.payload as any
this.options.hydrate?.(ctx.payload as any)

@@ -1148,7 +1142,2 @@

// this.state.matches.forEach((m) => {
// m.__promiseKeys =
// ctx.router.state.matches.find((d) => d.id === m.id)?.promiseKeys ?? []
// })
return

@@ -1155,0 +1144,0 @@ }

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

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
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc