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

@tanstack/router - npm Package Compare versions

Comparing version 0.0.1-beta.138 to 0.0.1-beta.139

29

build/cjs/react.js

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

}) {
const [show, setShow] = React__namespace.useState(process.env.NODE_ENV !== 'production');
return /*#__PURE__*/React__namespace.createElement("div", {

@@ -478,11 +479,27 @@ style: {

}
}, /*#__PURE__*/React__namespace.createElement("div", {
style: {
display: 'flex',
alignItems: 'center',
gap: '.5rem'
}
}, /*#__PURE__*/React__namespace.createElement("strong", {
style: {
fontSize: '1.2rem'
fontSize: '1rem'
}
}, "Something went wrong!"), /*#__PURE__*/React__namespace.createElement("div", {
}, "Something went wrong!"), /*#__PURE__*/React__namespace.createElement("button", {
style: {
height: '.5rem'
appearance: 'none',
fontSize: '.6em',
border: '1px solid currentColor',
padding: '.1rem .2rem',
fontWeight: 'bold',
borderRadius: '.25rem'
},
onClick: () => setShow(d => !d)
}, show ? 'Hide Error' : 'Show Error')), /*#__PURE__*/React__namespace.createElement("div", {
style: {
height: '.25rem'
}
}), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("pre", {
}), show ? /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("pre", {
style: {

@@ -492,7 +509,7 @@ fontSize: '.7em',

borderRadius: '.25rem',
padding: '.5rem',
padding: '.3rem',
color: 'red',
overflow: 'auto'
}
}, error.message ? /*#__PURE__*/React__namespace.createElement("code", null, error.message) : null)));
}, error.message ? /*#__PURE__*/React__namespace.createElement("code", null, error.message) : null)) : null);
}

@@ -499,0 +516,0 @@ function useBlocker(message, condition = true) {

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

"name": "tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
"uid": "d626-47"
"uid": "4f60-47"
},
{
"name": "tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js",
"uid": "d626-49"
"uid": "4f60-49"
}

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

{
"uid": "d626-51",
"uid": "4f60-51",
"name": "history.ts"
},
{
"uid": "d626-53",
"uid": "4f60-53",
"name": "utils.ts"
},
{
"uid": "d626-55",
"uid": "4f60-55",
"name": "path.ts"
},
{
"uid": "d626-57",
"uid": "4f60-57",
"name": "qss.ts"
},
{
"uid": "d626-65",
"uid": "4f60-65",
"name": "react.tsx"
},
{
"uid": "d626-67",
"uid": "4f60-67",
"name": "route.ts"
},
{
"uid": "d626-69",
"uid": "4f60-69",
"name": "searchParams.ts"
},
{
"uid": "d626-71",
"uid": "4f60-71",
"name": "router.ts"
},
{
"uid": "d626-73",
"uid": "4f60-73",
"name": "index.ts"

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

"name": "store/build/esm/index.js",
"uid": "d626-61"
"uid": "4f60-61"
},
{
"name": "react-store/build/esm/index.js",
"uid": "d626-63"
"uid": "4f60-63"
}

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

{
"uid": "d626-59",
"uid": "4f60-59",
"name": "\u0000rollupPluginBabelHelpers.js"

@@ -90,92 +90,92 @@ }

"nodeParts": {
"d626-47": {
"4f60-47": {
"renderedLength": 199,
"gzipLength": 134,
"brotliLength": 0,
"mainUid": "d626-46"
"mainUid": "4f60-46"
},
"d626-49": {
"4f60-49": {
"renderedLength": 48,
"gzipLength": 65,
"brotliLength": 0,
"mainUid": "d626-48"
"mainUid": "4f60-48"
},
"d626-51": {
"4f60-51": {
"renderedLength": 6378,
"gzipLength": 1522,
"brotliLength": 0,
"mainUid": "d626-50"
"mainUid": "4f60-50"
},
"d626-53": {
"4f60-53": {
"renderedLength": 2821,
"gzipLength": 990,
"brotliLength": 0,
"mainUid": "d626-52"
"mainUid": "4f60-52"
},
"d626-55": {
"4f60-55": {
"renderedLength": 6028,
"gzipLength": 1423,
"brotliLength": 0,
"mainUid": "d626-54"
"mainUid": "4f60-54"
},
"d626-57": {
"4f60-57": {
"renderedLength": 1395,
"gzipLength": 558,
"brotliLength": 0,
"mainUid": "d626-56"
"mainUid": "4f60-56"
},
"d626-59": {
"4f60-59": {
"renderedLength": 457,
"gzipLength": 241,
"brotliLength": 0,
"mainUid": "d626-58"
"mainUid": "4f60-58"
},
"d626-61": {
"4f60-61": {
"renderedLength": 1969,
"gzipLength": 653,
"brotliLength": 0,
"mainUid": "d626-60"
"mainUid": "4f60-60"
},
"d626-63": {
"4f60-63": {
"renderedLength": 1070,
"gzipLength": 485,
"brotliLength": 0,
"mainUid": "d626-62"
"mainUid": "4f60-62"
},
"d626-65": {
"renderedLength": 16047,
"gzipLength": 3528,
"4f60-65": {
"renderedLength": 16689,
"gzipLength": 3680,
"brotliLength": 0,
"mainUid": "d626-64"
"mainUid": "4f60-64"
},
"d626-67": {
"4f60-67": {
"renderedLength": 4568,
"gzipLength": 1127,
"brotliLength": 0,
"mainUid": "d626-66"
"mainUid": "4f60-66"
},
"d626-69": {
"4f60-69": {
"renderedLength": 1387,
"gzipLength": 483,
"brotliLength": 0,
"mainUid": "d626-68"
"mainUid": "4f60-68"
},
"d626-71": {
"4f60-71": {
"renderedLength": 34332,
"gzipLength": 7709,
"brotliLength": 0,
"mainUid": "d626-70"
"mainUid": "4f60-70"
},
"d626-73": {
"4f60-73": {
"renderedLength": 0,
"gzipLength": 0,
"brotliLength": 0,
"mainUid": "d626-72"
"mainUid": "4f60-72"
}
},
"nodeMetas": {
"d626-46": {
"4f60-46": {
"id": "/node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
"moduleParts": {
"index.production.js": "d626-47"
"index.production.js": "4f60-47"
},

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

{
"uid": "d626-72"
"uid": "4f60-72"
},
{
"uid": "d626-66"
"uid": "4f60-66"
},
{
"uid": "d626-70"
"uid": "4f60-70"
},
{
"uid": "d626-64"
"uid": "4f60-64"
}
]
},
"d626-48": {
"4f60-48": {
"id": "/node_modules/.pnpm/tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js",
"moduleParts": {
"index.production.js": "d626-49"
"index.production.js": "4f60-49"
},

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

{
"uid": "d626-72"
"uid": "4f60-72"
},
{
"uid": "d626-64"
"uid": "4f60-64"
}
]
},
"d626-50": {
"4f60-50": {
"id": "/packages/router/src/history.ts",
"moduleParts": {
"index.production.js": "d626-51"
"index.production.js": "4f60-51"
},

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

{
"uid": "d626-72"
"uid": "4f60-72"
},
{
"uid": "d626-70"
"uid": "4f60-70"
}
]
},
"d626-52": {
"4f60-52": {
"id": "/packages/router/src/utils.ts",
"moduleParts": {
"index.production.js": "d626-53"
"index.production.js": "4f60-53"
},

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

{
"uid": "d626-72"
"uid": "4f60-72"
},
{
"uid": "d626-54"
"uid": "4f60-54"
},
{
"uid": "d626-70"
"uid": "4f60-70"
},
{
"uid": "d626-64"
"uid": "4f60-64"
}
]
},
"d626-54": {
"4f60-54": {
"id": "/packages/router/src/path.ts",
"moduleParts": {
"index.production.js": "d626-55"
"index.production.js": "4f60-55"
},
"imported": [
{
"uid": "d626-52"
"uid": "4f60-52"
}

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

{
"uid": "d626-72"
"uid": "4f60-72"
},
{
"uid": "d626-66"
"uid": "4f60-66"
},
{
"uid": "d626-70"
"uid": "4f60-70"
}
]
},
"d626-56": {
"4f60-56": {
"id": "/packages/router/src/qss.ts",
"moduleParts": {
"index.production.js": "d626-57"
"index.production.js": "4f60-57"
},

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

{
"uid": "d626-72"
"uid": "4f60-72"
},
{
"uid": "d626-68"
"uid": "4f60-68"
}
]
},
"d626-58": {
"4f60-58": {
"id": "\u0000rollupPluginBabelHelpers.js",
"moduleParts": {
"index.production.js": "d626-59"
"index.production.js": "4f60-59"
},

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

{
"uid": "d626-64"
"uid": "4f60-64"
}
]
},
"d626-60": {
"4f60-60": {
"id": "/packages/store/build/esm/index.js",
"moduleParts": {
"index.production.js": "d626-61"
"index.production.js": "4f60-61"
},

@@ -313,17 +313,17 @@ "imported": [],

{
"uid": "d626-62"
"uid": "4f60-62"
}
]
},
"d626-62": {
"4f60-62": {
"id": "/packages/react-store/build/esm/index.js",
"moduleParts": {
"index.production.js": "d626-63"
"index.production.js": "4f60-63"
},
"imported": [
{
"uid": "d626-77"
"uid": "4f60-77"
},
{
"uid": "d626-60"
"uid": "4f60-60"
}

@@ -333,32 +333,32 @@ ],

{
"uid": "d626-70"
"uid": "4f60-70"
},
{
"uid": "d626-64"
"uid": "4f60-64"
}
]
},
"d626-64": {
"4f60-64": {
"id": "/packages/router/src/react.tsx",
"moduleParts": {
"index.production.js": "d626-65"
"index.production.js": "4f60-65"
},
"imported": [
{
"uid": "d626-58"
"uid": "4f60-58"
},
{
"uid": "d626-76"
"uid": "4f60-76"
},
{
"uid": "d626-62"
"uid": "4f60-62"
},
{
"uid": "d626-46"
"uid": "4f60-46"
},
{
"uid": "d626-48"
"uid": "4f60-48"
},
{
"uid": "d626-52"
"uid": "4f60-52"
}

@@ -368,23 +368,23 @@ ],

{
"uid": "d626-72"
"uid": "4f60-72"
},
{
"uid": "d626-66"
"uid": "4f60-66"
}
]
},
"d626-66": {
"4f60-66": {
"id": "/packages/router/src/route.ts",
"moduleParts": {
"index.production.js": "d626-67"
"index.production.js": "4f60-67"
},
"imported": [
{
"uid": "d626-46"
"uid": "4f60-46"
},
{
"uid": "d626-54"
"uid": "4f60-54"
},
{
"uid": "d626-64"
"uid": "4f60-64"
}

@@ -394,14 +394,14 @@ ],

{
"uid": "d626-72"
"uid": "4f60-72"
}
]
},
"d626-68": {
"4f60-68": {
"id": "/packages/router/src/searchParams.ts",
"moduleParts": {
"index.production.js": "d626-69"
"index.production.js": "4f60-69"
},
"imported": [
{
"uid": "d626-56"
"uid": "4f60-56"
}

@@ -411,32 +411,32 @@ ],

{
"uid": "d626-72"
"uid": "4f60-72"
},
{
"uid": "d626-70"
"uid": "4f60-70"
}
]
},
"d626-70": {
"4f60-70": {
"id": "/packages/router/src/router.ts",
"moduleParts": {
"index.production.js": "d626-71"
"index.production.js": "4f60-71"
},
"imported": [
{
"uid": "d626-62"
"uid": "4f60-62"
},
{
"uid": "d626-46"
"uid": "4f60-46"
},
{
"uid": "d626-54"
"uid": "4f60-54"
},
{
"uid": "d626-68"
"uid": "4f60-68"
},
{
"uid": "d626-52"
"uid": "4f60-52"
},
{
"uid": "d626-50"
"uid": "4f60-50"
}

@@ -446,47 +446,47 @@ ],

{
"uid": "d626-72"
"uid": "4f60-72"
}
]
},
"d626-72": {
"4f60-72": {
"id": "/packages/router/src/index.ts",
"moduleParts": {
"index.production.js": "d626-73"
"index.production.js": "4f60-73"
},
"imported": [
{
"uid": "d626-46"
"uid": "4f60-46"
},
{
"uid": "d626-48"
"uid": "4f60-48"
},
{
"uid": "d626-50"
"uid": "4f60-50"
},
{
"uid": "d626-74"
"uid": "4f60-74"
},
{
"uid": "d626-54"
"uid": "4f60-54"
},
{
"uid": "d626-56"
"uid": "4f60-56"
},
{
"uid": "d626-66"
"uid": "4f60-66"
},
{
"uid": "d626-75"
"uid": "4f60-75"
},
{
"uid": "d626-70"
"uid": "4f60-70"
},
{
"uid": "d626-68"
"uid": "4f60-68"
},
{
"uid": "d626-52"
"uid": "4f60-52"
},
{
"uid": "d626-64"
"uid": "4f60-64"
}

@@ -497,3 +497,3 @@ ],

},
"d626-74": {
"4f60-74": {
"id": "/packages/router/src/link.ts",

@@ -504,7 +504,7 @@ "moduleParts": {},

{
"uid": "d626-72"
"uid": "4f60-72"
}
]
},
"d626-75": {
"4f60-75": {
"id": "/packages/router/src/routeInfo.ts",

@@ -515,7 +515,7 @@ "moduleParts": {},

{
"uid": "d626-72"
"uid": "4f60-72"
}
]
},
"d626-76": {
"4f60-76": {
"id": "react",

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

{
"uid": "d626-64"
"uid": "4f60-64"
}

@@ -532,3 +532,3 @@ ],

},
"d626-77": {
"4f60-77": {
"id": "use-sync-external-store/shim/with-selector",

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

{
"uid": "d626-62"
"uid": "4f60-62"
}

@@ -542,0 +542,0 @@ ],

@@ -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){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 s=o(e);function n(t,e){if(!t)throw new Error("Invariant failed")}const a="pushstate",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,s=[],n=[];const a=()=>{if(s.length)s[0]?.(a,(()=>{s=[],u()}));else for(;n.length;)n.shift()?.()},i=t=>{n.push(t),a()},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=>(s.push(t),1===s.length&&addEventListener(c,h,{capture:!0}),()=>{s=s.filter((e=>e!==t)),s.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(a,t),window.addEventListener(i,t);var e=window.history.pushState;window.history.pushState=function(){let r=e.apply(history,arguments);return t(),r};var r=window.history.replaceState;return window.history.replaceState=function(){let e=r.apply(history,arguments);return t(),e},()=>{window.history.pushState=e,window.history.replaceState=r,window.removeEventListener(a,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,s)=>{o={...s,key:m()},e.push(t),r++},replaceState:(t,s)=>{o={...s,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 w(t,e){if(t===e)return t;const r=e,o=Array.isArray(t)&&Array.isArray(r);if(o||b(t)&&b(r)){const e=o?t.length:Object.keys(t).length,s=o?r:Object.keys(r),n=s.length,a=o?[]:{};let i=0;for(let e=0;e<n;e++){const n=o?e:s[e];a[n]=w(t[n],r[n]),a[n]===t[n]&&i++}return e===n&&i===e?t:a}return r}function b(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 E(t,e){return t===e||typeof t==typeof e&&(b(t)&&b(e)?!Object.keys(e).some((r=>!E(t[r],e[r]))):!(!Array.isArray(t)||!Array.isArray(e))&&(t.length===e.length&&t.every(((t,r)=>E(t,e[r])))))}function P(t){return R(t.filter(Boolean).join("/"))}function R(t){return t.replace(/\/{2,}/g,"/")}function _(t){return"/"===t?t:t.replace(/^\/{1,}/,"")}function x(t){return"/"===t?t:t.replace(/\/{1,}$/,"")}function M(t){return x(_(t))}function C(t,e,r){e=e.replace(new RegExp(`^${t}`),"/"),r=r.replace(new RegExp(`^${t}`),"/");let o=L(e);const s=L(r);s.forEach(((t,e)=>{if("/"===t.value)e?e===s.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 R(P([t,...o.map((t=>t.value))]))}function L(t){if(!t)return[];const e=[];if("/"===(t=R(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 P(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=k(t,e,r);if(!r.to||o)return o??{}}function k(t,e,r){e="/"!=t?e.substring(t.length):e;const o=`${r.to??"$"}`,s=L(e),n=L(o);e.startsWith("/")||s.unshift({type:"pathname",value:"/"}),o.startsWith("/")||n.unshift({type:"pathname",value:"/"});const a={};return(()=>{for(let t=0;t<Math.max(s.length,n.length);t++){const e=s[t],o=n[t],i=t>=s.length-1,c=t>=n.length-1;if(o){if("wildcard"===o.type)return!!e?.value&&(a["*"]=P(s.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)&&(a[o.value.substring(1)]=e.value)}}if(!i&&c)return!!r.fuzzy}return!0})()?a:void 0}function I(t,e){var r,o,s,n="";for(r in t)if(void 0!==(s=t[r]))if(Array.isArray(s))for(o=0;o<s.length;o++)n&&(n+="&"),n+=encodeURIComponent(r)+"="+encodeURIComponent(s[o]);else n&&(n+="&"),n+=encodeURIComponent(r)+"="+encodeURIComponent(s);return(e||"")+n}function $(t){if(!t)return"";var e=decodeURIComponent(t);return"false"!==e&&("true"===e||("0"===e.charAt(0)?e:0*+e==0?+e:e))}function D(t){for(var e,r,o={},s=t.split("&");e=s.shift();)void 0!==o[r=(e=e.split("=")).shift()]?o[r]=[].concat(o[r],$(e.shift())):o[r]=$(e.shift());return o}function T(){return T=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},T.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 n=o(e);function s(t,e){if(!t)throw new Error("Invariant failed")}const a="pushstate",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,n=[],s=[];const a=()=>{if(n.length)n[0]?.(a,(()=>{n=[],u()}));else for(;s.length;)s.shift()?.()},i=t=>{s.push(t),a()},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=>(n.push(t),1===n.length&&addEventListener(c,h,{capture:!0}),()=>{n=n.filter((e=>e!==t)),n.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(a,t),window.addEventListener(i,t);var e=window.history.pushState;window.history.pushState=function(){let r=e.apply(history,arguments);return t(),r};var r=window.history.replaceState;return window.history.replaceState=function(){let e=r.apply(history,arguments);return t(),e},()=>{window.history.pushState=e,window.history.replaceState=r,window.removeEventListener(a,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,n)=>{o={...n,key:m()},e.push(t),r++},replaceState:(t,n)=>{o={...n,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 w(t,e){if(t===e)return t;const r=e,o=Array.isArray(t)&&Array.isArray(r);if(o||b(t)&&b(r)){const e=o?t.length:Object.keys(t).length,n=o?r:Object.keys(r),s=n.length,a=o?[]:{};let i=0;for(let e=0;e<s;e++){const s=o?e:n[e];a[s]=w(t[s],r[s]),a[s]===t[s]&&i++}return e===s&&i===e?t:a}return r}function b(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 E(t,e){return t===e||typeof t==typeof e&&(b(t)&&b(e)?!Object.keys(e).some((r=>!E(t[r],e[r]))):!(!Array.isArray(t)||!Array.isArray(e))&&(t.length===e.length&&t.every(((t,r)=>E(t,e[r])))))}function R(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 M(t){return x(_(t))}function C(t,e,r){e=e.replace(new RegExp(`^${t}`),"/"),r=r.replace(new RegExp(`^${t}`),"/");let o=L(e);const n=L(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&&"/"===y(o)?.value&&o.pop(),o.pop();else{if("."===t.value)return;o.push(t)}}));return P(R([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 O(t,e,r=!1){return R(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=k(t,e,r);if(!r.to||o)return o??{}}function k(t,e,r){e="/"!=t?e.substring(t.length):e;const o=`${r.to??"$"}`,n=L(e),s=L(o);e.startsWith("/")||n.unshift({type:"pathname",value:"/"}),o.startsWith("/")||s.unshift({type:"pathname",value:"/"});const a={};return(()=>{for(let t=0;t<Math.max(n.length,s.length);t++){const e=n[t],o=s[t],i=t>=n.length-1,c=t>=s.length-1;if(o){if("wildcard"===o.type)return!!e?.value&&(a["*"]=R(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)&&(a[o.value.substring(1)]=e.value)}}if(!i&&c)return!!r.fuzzy}return!0})()?a:void 0}function I(t,e){var r,o,n,s="";for(r in t)if(void 0!==(n=t[r]))if(Array.isArray(n))for(o=0;o<n.length;o++)s&&(s+="&"),s+=encodeURIComponent(r)+"="+encodeURIComponent(n[o]);else s&&(s+="&"),s+=encodeURIComponent(r)+"="+encodeURIComponent(n);return(e||"")+s}function $(t){if(!t)return"";var e=decodeURIComponent(t);return"false"!==e&&("true"===e||("0"===e.charAt(0)?e:0*+e==0?+e:e))}function D(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],$(e.shift())):o[r]=$(e.shift());return o}function T(){return T=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},T.apply(this,arguments)}
/**

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

* @license MIT
*/function A(t,e=(t=>t)){return r.useSyncExternalStoreWithSelector(t.subscribe,(()=>t.state),(()=>t.state),e,B)}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}function N(t){const e=K(),{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:v,className:w,onClick:b,onFocus:S,onMouseEnter:E,onMouseLeave:P,onTouchStart:R,..._}=t,x=e.buildLink(t);if("external"===x.type){const{href:t}=x;return{href:t}}const{handleClick:M,handleFocus:C,handleEnter:L,handleLeave:O,handleTouchStart:j,isActive:k,next:I}=x,$=t=>e=>{e.persist&&e.persist(),t.filter(Boolean).forEach((t=>{e.defaultPrevented||t(e)}))},D=k?g(a,{})??{}:{},T=k?{}:g(i,{})??{};return{...D,...T,..._,href:h?void 0:I.href,onClick:$([b,e=>{(t.startTransition??1)&&(s.startTransition||(t=>t))((()=>{M(e)}))}]),onFocus:$([S,C]),onMouseEnter:$([E,L]),onMouseLeave:$([P,O]),onTouchStart:$([R,j]),target:n,style:{...v,...D.style,...T.style},className:[w,D.className,T.className].filter(Boolean).join(" ")||void 0,...h?{role:"link","aria-disabled":!0}:void 0,"data-status":k?"active":void 0}}const U=s.forwardRef(((t,e)=>{const r=N(t);return s.createElement("a",T({ref:e},r,{children:"function"==typeof t.children?t.children({isActive:"active"===r["data-status"]}):t.children}))}));const F=s.createContext(null),z=s.createContext(null);function W(t){return A(K().__store,t?.select)}function J(){const t=K(),e=W({select:e=>e.pendingMatches.some((e=>!!t.getRoute(e.routeId)?.options.pendingComponent))?e.pendingMatches.map((t=>t.id)):e.matches.map((t=>t.id))});return s.createElement(F.Provider,{value:[void 0,...e]},s.createElement(ot,{errorComponent:nt,onCatch:()=>{}},s.createElement(X,null)))}function K(){return s.useContext(z)}function q(t){const e=K(),r=s.useContext(F)[0],o=e.getRouteMatch(r)?.routeId,a=W({select:e=>{const o=e.matches;return(t?.from?o.find((e=>e.routeId===t?.from)):o.find((t=>t.id===r))).routeId}});(t?.strict??1)&&n(o==a);return W({select:e=>{const o=e.matches,s=t?.from?o.find((e=>e.routeId===t?.from)):o.find((t=>t.id===r));return n(s,t?.from&&t.from),t?.select?.(s)??s}})}function Y(t){return q({...t,select:e=>t?.select?.(e.loader)??e.loader})}function V(t){return q({...t,select:e=>t?.select?.(e.search)??e.search})}function G(t){return W({select:e=>{const r=y(e.matches)?.params;return t?.select?.(r)??r}})}function Q(){const t=K();return s.useCallback((e=>{const{pending:r,caseSensitive:o,...s}=e;return t.matchRoute(s,{pending:r,caseSensitive:o})}),[])}function X(){const t=s.useContext(F).slice(1);return t[0]?s.createElement(tt,{matchIds:t}):null}const Z=()=>null;function tt({matchIds:t}){const e=K(),r=t[0],o=e.getRouteMatch(r).routeId,n=e.getRoute(o),a=n.options.pendingComponent??e.options.defaultPendingComponent??Z,i=n.options.errorComponent??e.options.defaultErrorComponent??nt,c=n.options.wrapInSuspense??!n.isRoot?s.Suspense:rt,h=i?ot:rt;return s.createElement(F.Provider,{value:t},s.createElement(c,{fallback:s.createElement(a,{useLoader:n.useLoader,useMatch:n.useMatch,useContext:n.useContext,useSearch:n.useSearch,useParams:n.useParams})},s.createElement(h,{key:n.id,errorComponent:i,onCatch:()=>{}},s.createElement(et,{matchId:r,PendingComponent:a}))))}function et({matchId:t,PendingComponent:e}){const r=K(),o=W({select:e=>v(e.pendingMatches.find((e=>e.id===t))||e.matches.find((e=>e.id===t)),["status","loadPromise","routeId","error"])}),a=r.getRoute(o.routeId);if("error"===o.status)throw o.error;if("pending"===o.status)return s.createElement(e,{useLoader:a.useLoader,useMatch:a.useMatch,useContext:a.useContext,useSearch:a.useSearch,useParams:a.useParams});if("success"===o.status){let t=a.options.component??r.options.defaultComponent;return t?s.createElement(t,{useLoader:a.useLoader,useMatch:a.useMatch,useContext:a.useContext,useSearch:a.useSearch,useParams:a.useParams}):s.createElement(X,null)}n(!1)}function rt(t){return s.createElement(s.Fragment,null,t.children)}class ot extends s.Component{state={error:!1,info:void 0};componentDidCatch(t,e){this.props.onCatch(t,e),this.setState({error:t,info:e})}render(){return s.createElement(st,T({},this.props,{errorState:this.state,reset:()=>this.setState({})}))}}function st(t){const e=W({select:t=>t.resolvedLocation.key}),[r,o]=s.useState(t.errorState),n=t.errorComponent??nt,a=s.useRef("");return s.useEffect((()=>{r&&e!==a.current&&o({}),a.current=e}),[r,e]),s.useEffect((()=>{t.errorState.error&&o(t.errorState)}),[t.errorState.error]),t.errorState.error&&r.error?s.createElement(n,r):t.children}function nt({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 at(t,e=!0){const r=K();s.useEffect((()=>{if(!e)return;let o=r.history.block(((e,r)=>{window.confirm(t)&&(o(),e())}));return o}))}const it="__root__";class ct{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=it:n(this.parentRoute);let o=r?it:e.path;o&&"/"!==o&&(o=M(o));const s=e?.id||o;let a=r?it:P([this.parentRoute.id===it?"":this.parentRoute.id,s]);o===it&&(o="/"),a!==it&&(a=P(["/",a]));const i=a===it?"/":P([this.parentRoute.fullPath,o]);this.path=o,this.id=a,this.fullPath=i,this.to=i};addChildren=t=>(this.children=t,this);update=t=>(Object.assign(this.options,t),this);useMatch=t=>q({...t,from:this.id});useLoader=t=>Y({...t,from:this.id});useContext=t=>q({...t,from:this.id,select:e=>t?.select?.(e.context)??e.context});useSearch=t=>V({...t,from:this.id});useParams=t=>G({...t,from:this.id})}class ht extends ct{constructor(t){super(t)}}const ut=dt(JSON.parse),lt=pt(JSON.stringify);function dt(t){return e=>{"?"===e.substring(0,1)&&(e=e.substring(1));let r=D(e);for(let e in r){const o=r[e];if("string"==typeof o)try{r[e]=t(o)}catch(t){}}return r}}function pt(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=I(e).toString();return r?`?${r}`:""}}const ft=["component","errorComponent","pendingComponent"];const mt="undefined"==typeof window||!window.document.createElement;function yt(){return{status:"idle",resolvedLocation:null,location:null,matches:[],pendingMatches:[],preloadMatches:{},lastUpdated:Date.now()}}function gt(t){return!!t?.isRedirect}class vt extends Error{}class wt extends Error{}t.Block=function({message:t,condition:e,children:r}){return at(t,e),r??null},t.ErrorComponent=nt,t.Link=U,t.MatchRoute=function(t){const e=Q()(t);return"function"==typeof t.children?t.children(e):e?t.children:null},t.Navigate=function(t){const e=K();return s.useLayoutEffect((()=>{e.navigate(t)}),[]),null},t.Outlet=X,t.PathParamError=wt,t.RootRoute=ht,t.Route=ct,t.Router=class{#t;constructor(t){this.options={defaultPreloadDelay:50,context:void 0,...t,stringifySearch:t?.stringifySearch??lt,parseSearch:t?.parseSearch??ut},this.__store=new H(yt(),{onUpdate:()=>{this.state=this.__store.state},defaultPriority:"low"}),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,yt())))};mount=()=>{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??(mt?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=`/${M(e??"")??""}`,r&&r!==this.routeTree&&this.#o(r),this};buildNext=t=>{const e=this.#s(t),r=this.matchRoutes(e.pathname,e.search);return this.#s({...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=>{}));latestLoadPromise=null;load=async t=>{const e=new Promise((async(r,o)=>{let s;const n=()=>this.latestLoadPromise!==e?this.latestLoadPromise:void 0;let a;this.cancelMatches(),this.__store.batch((()=>{t?.next&&this.__store.setState((e=>({...e,location:t.next}))),a=this.matchRoutes(this.state.location.pathname,this.state.location.search,{throwOnError:t?.throwOnError}),this.__store.setState((t=>({...t,status:"pending",pendingMatches:a})))}));try{if(await this.loadMatches(a),s=n())return await s;const t=this.state.resolvedLocation;this.__store.setState((t=>({...t,status:"idle",resolvedLocation:t.location,matches:t.pendingMatches,pendingMatches:[]}))),t.href!==this.state.location.href&&this.options.onRouteChange?.(),r()}catch(t){if(s=n())return await s;o(t)}}));return this.latestLoadPromise=e,this.latestLoadPromise};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,{throwOnError:!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={},s=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=[s];for(;s?.parentRoute;)s=s.parentRoute,s&&n.unshift(s);let a={};const i=n.map((t=>{let s,n;try{s=t.options.parseParams?.(o)??o}catch(t){if(n=new wt(t.message,{cause:t}),r?.throwOnError)throw n}Object.assign(a,s);const i=O(t.path,a),c=O(t.id,a,!0)+(t.options.getKey?.({params:a,search:e})??""),h=this.getRouteMatch(c);if(h)return{...h};const u=!(!t.options.loader&&!ft.some((e=>t.options[e]?.preload)));return{id:c,routeId:t.id,params:a,pathname:P([this.basepath,i]),updatedAt:0,routeSearch:{},search:{},status:u?"pending":"success",error:void 0,paramsError:n,searchError:void 0,loader:void 0,loadPromise:Promise.resolve(),routeContext:void 0,context:void 0,abortController:new AbortController,fetchedAt:0}}));return i.forEach(((t,o)=>{const s=i[o-1],n=this.getRoute(t.routeId),a=(()=>{const o={search:s?.search??e,routeSearch:s?.routeSearch??e};try{const e=("object"==typeof n.options.validateSearch?n.options.validateSearch.parse:n.options.validateSearch)?.(o.search)??{},r={...o.search,...e};return{routeSearch:w(t.routeSearch,e),search:w(t.search,r)}}catch(e){if(t.searchError=new vt(e.message,{cause:e}),r?.throwOnError)throw t.searchError;return o}})(),c=(()=>{try{const e=n.options.getContext?.({parentContext:s?.routeContext??{},context:s?.context??this?.options.context??{},params:t.params,search:t.search})||{};return{context:{...s?.context??this?.options.context,...e},routeContext:e}}catch(t){throw n.options.onError?.(t),t}})();Object.assign(t,{...a,...c})})),i};loadMatches=async(t,e)=>{let r;try{await Promise.all(t.map((async(t,o)=>{const s=this.getRoute(t.routeId),n=(e,n)=>{if(r=r??o,n=n||s.options.onError,gt(e))throw e;try{n?.(e)}catch(t){if(e=t,gt(t))throw t}this.setRouteMatch(t.id,(t=>({...t,error:e,status:"error",updatedAt:Date.now()})))};t.paramsError&&n(t.paramsError,s.options.onParseParamsError),t.searchError&&n(t.searchError,s.options.onValidateSearchError);try{await(s.options.beforeLoad?.({...t,preload:!!e?.preload}))}catch(t){n(t,s.options.onBeforeLoadError)}})))}catch(t){throw e?.preload||this.navigate(t),t}const o=t.slice(0,r),s=[];o.forEach(((t,r)=>{s.push(Promise.resolve().then((async()=>{const o=s[r-1],n=this.getRoute(t.routeId),a=Date.now(),i=Promise.resolve().then((async()=>{const r=()=>{const e=this.getRouteMatch(t.id);return e&&e.fetchedAt!==a?e.loadPromise:void 0};let s;const i=Promise.all(ft.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(s=r())return await s;e?.preload&&this.state.matches.find((e=>e.id===t.id))||this.setRouteMatch(t.id,(t=>({...t,error:void 0,status:"success",updatedAt:Date.now(),loader:n})))}catch(o){if(s=r())return await s;if(gt(o))return void(e?.preload||this.navigate(o));const a=n.options.onLoadError??n.options.onError;let i=o;try{a?.(o)}catch(t){if(i=t,gt(t))return void(e?.preload||this.navigate(t))}this.setRouteMatch(t.id,(t=>({...t,error:i,status:"error",updatedAt:Date.now()})))}finally{if(s=r())return await s;e?.preload&&this.__store.setState((e=>{const r={...e.preloadMatches};return delete r[t.id],{...e,preloadMatches:r}}))}}));this.setRouteMatch(t.id,(t=>({...t,loadPromise:i,fetchedAt:a}))),await i})))})),await Promise.all(s)};reload=()=>{this.navigate({fromCurrent:!0,replace:!0,search:!0})};resolvePath=(t,e)=>C(this.basepath,t,R(e));navigate=async({from:t,to:e="",search:r,hash:o,replace:s,params:a})=>{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:s,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 s=j(this.basepath,o.pathname,{...e,to:r.pathname});return!!s&&(e?.includeSearch??1?!!E(o.search,r.search)&&s:s)};buildLink=({from:t,to:e=".",search:r,params:o,hash:s,target:n,replace:a,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:s,replace:a},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)||E(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__${s=r,s.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 s})),()=>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=M(t.fullPath),o=L(r);for(;o.length>1&&"/"===o[0]?.value;)o.shift();const s=o.map((t=>"param"===t.type?.5:"wildcard"===t.type?.25:1));return{child:t,trimmed:r,parsed:o,index:e,score:s}})).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:s}=this.history.location;const n=this.options.parseSearch(r);return{pathname:e,searchStr:r,search:w(t?.search,n),hash:o.split("#").reverse()[0]??"",href:`${e}${r}${o}`,state:s,key:s?.key||"__init__"}};#s=(t={})=>{t.fromCurrent=t.fromCurrent??""===t.to;const e=t.fromCurrent?this.state.location.pathname:t.from??this.state.location.pathname;let r=C(this.basepath??"/",e,`${t.to??""}`);const o={...y(this.matchRoutes(this.state.location.pathname,this.state.location.search))?.params};let s=!0===(t.params??!0)?o:g(t.params,o);s&&t.__matches?.map((t=>this.getRoute(t.routeId).options.stringifyParams)).filter(Boolean).forEach((t=>{s={...s,...t(s)}})),r=O(r,s??{});const n=t.__matches?.map((t=>this.getRoute(t.routeId).options.preSearchFilters??[])).flat().filter(Boolean)??[],a=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=a?.length?a.reduce(((t,e)=>e(t)),c):c,u=w(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 s=`${e.pathname}${e.searchStr}${e.hash?`#${e.hash}`:""}`;return this.history["push"===o?"push":"replace"](s,{id:r,...e.state}),this.latestLoadPromise};getRouteMatch=t=>this.state.matches.find((e=>e.id===t))||this.state.pendingMatches.find((e=>e.id===t))||this.state.preloadMatches[t];#n=(t,e)=>{this.__store.setState((r=>({...r,matches:r.matches.map((r=>r.id===t?e(r):r))})))};#a=(t,e)=>{this.__store.setState((r=>({...r,pendingMatches:r.pendingMatches.map((r=>r.id===t?e(r):r))})))};#i=(t,e)=>{n(this.state.preloadMatches[t]),this.__store.setState((r=>({...r,preloadMatches:{...r.preloadMatches,[t]:e(r.preloadMatches[t])}})))};setRouteMatch=(t,e)=>this.state.matches.find((e=>e.id===t))?this.#n(t,e):this.state.pendingMatches.find((e=>e.id===t))?this.#a(t,e):this.state.preloadMatches[t]?this.#i(t,e):void 0},t.RouterContext=class{constructor(){}createRootRoute=t=>new ht(t)},t.RouterProvider=function({router:t,...e}){t.update(e),s.useEffect((()=>{let e;return s.startTransition((()=>{e=t.mount()})),e}),[t]);const r=t.options.Wrap||s.Fragment;return s.createElement(s.Suspense,{fallback:null},s.createElement(r,null,s.createElement(z.Provider,{value:t},s.createElement(J,null))))},t.SearchParamError=vt,t.cleanPath=R,t.componentTypes=ft,t.createBrowserHistory=d,t.createHashHistory=function(){return d({getHref:()=>window.location.hash.substring(1),createHref:t=>`#${t}`})},t.createMemoryHistory=p,t.decode=D,t.defaultParseSearch=ut,t.defaultStringifySearch=lt,t.encode=I,t.functionalUpdate=g,t.interpolatePath=O,t.invariant=n,t.isPlainObject=b,t.isRedirect=gt,t.joinPaths=P,t.last=y,t.lazyFn=function(t,e){return async(...r)=>(await t())[e||"default"](...r)},t.lazyRouteComponent=function(t,e){let r;const o=()=>(r||(r=t()),r),n=s.lazy((async()=>({default:(await o())[e??"default"]})));return n.preload=o,n},t.matchByPath=k,t.matchIdsContext=F,t.matchPathname=j,t.parsePathname=L,t.parseSearchWith=dt,t.partialDeepEqual=E,t.pick=v,t.redirect=function(t){return t.isRedirect=!0,t},t.replaceEqualDeep=w,t.resolvePath=C,t.rootRouteId=it,t.routerContext=z,t.shallow=function(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},t.stringifySearchWith=pt,t.trimPath=M,t.trimPathLeft=_,t.trimPathRight=x,t.useBlocker=at,t.useDehydrate=function(){const t=K();return s.useCallback((function(e,r){return t.dehydrateData(e,r)}),[])},t.useHydrate=function(){const t=K();return function(e){return t.hydrateData(e)}},t.useInjectHtml=function(){const t=K();return s.useCallback((e=>{t.injectHtml(e)}),[])},t.useLinkProps=N,t.useLoader=Y,t.useMatch=q,t.useMatchRoute=Q,t.useMatches=function(t){const e=s.useContext(F);return W({select:r=>{const o=r.matches.slice(r.matches.findIndex((t=>t.id===e[0])));return t?.select?.(o)??o}})},t.useNavigate=function(t){const e=K();return s.useCallback((r=>e.navigate({...t,...r})),[])},t.useParams=G,t.useRouter=K,t.useRouterState=W,t.useSearch=V,t.useStore=A,t.warning=function(t,e){},Object.defineProperty(t,"__esModule",{value:!0})}));
*/function A(t,e=(t=>t)){return r.useSyncExternalStoreWithSelector(t.subscribe,(()=>t.state),(()=>t.state),e,B)}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}function N(t){const e=K(),{type:r,children:o,target:s,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:v,className:w,onClick:b,onFocus:S,onMouseEnter:E,onMouseLeave:R,onTouchStart:P,..._}=t,x=e.buildLink(t);if("external"===x.type){const{href:t}=x;return{href:t}}const{handleClick:M,handleFocus:C,handleEnter:L,handleLeave:O,handleTouchStart:j,isActive:k,next:I}=x,$=t=>e=>{e.persist&&e.persist(),t.filter(Boolean).forEach((t=>{e.defaultPrevented||t(e)}))},D=k?g(a,{})??{}:{},T=k?{}:g(i,{})??{};return{...D,...T,..._,href:h?void 0:I.href,onClick:$([b,e=>{(t.startTransition??1)&&(n.startTransition||(t=>t))((()=>{M(e)}))}]),onFocus:$([S,C]),onMouseEnter:$([E,L]),onMouseLeave:$([R,O]),onTouchStart:$([P,j]),target:s,style:{...v,...D.style,...T.style},className:[w,D.className,T.className].filter(Boolean).join(" ")||void 0,...h?{role:"link","aria-disabled":!0}:void 0,"data-status":k?"active":void 0}}const U=n.forwardRef(((t,e)=>{const r=N(t);return n.createElement("a",T({ref:e},r,{children:"function"==typeof t.children?t.children({isActive:"active"===r["data-status"]}):t.children}))}));const z=n.createContext(null),F=n.createContext(null);function W(t){return A(K().__store,t?.select)}function J(){const t=K(),e=W({select:e=>e.pendingMatches.some((e=>!!t.getRoute(e.routeId)?.options.pendingComponent))?e.pendingMatches.map((t=>t.id)):e.matches.map((t=>t.id))});return n.createElement(z.Provider,{value:[void 0,...e]},n.createElement(ot,{errorComponent:st,onCatch:()=>{}},n.createElement(X,null)))}function K(){return n.useContext(F)}function q(t){const e=K(),r=n.useContext(z)[0],o=e.getRouteMatch(r)?.routeId,a=W({select:e=>{const o=e.matches;return(t?.from?o.find((e=>e.routeId===t?.from)):o.find((t=>t.id===r))).routeId}});(t?.strict??1)&&s(o==a);return W({select:e=>{const o=e.matches,n=t?.from?o.find((e=>e.routeId===t?.from)):o.find((t=>t.id===r));return s(n,t?.from&&t.from),t?.select?.(n)??n}})}function Y(t){return q({...t,select:e=>t?.select?.(e.loader)??e.loader})}function V(t){return q({...t,select:e=>t?.select?.(e.search)??e.search})}function G(t){return W({select:e=>{const r=y(e.matches)?.params;return t?.select?.(r)??r}})}function Q(){const t=K();return n.useCallback((e=>{const{pending:r,caseSensitive:o,...n}=e;return t.matchRoute(n,{pending:r,caseSensitive:o})}),[])}function X(){const t=n.useContext(z).slice(1);return t[0]?n.createElement(tt,{matchIds:t}):null}const Z=()=>null;function tt({matchIds:t}){const e=K(),r=t[0],o=e.getRouteMatch(r).routeId,s=e.getRoute(o),a=s.options.pendingComponent??e.options.defaultPendingComponent??Z,i=s.options.errorComponent??e.options.defaultErrorComponent??st,c=s.options.wrapInSuspense??!s.isRoot?n.Suspense:rt,h=i?ot:rt;return n.createElement(z.Provider,{value:t},n.createElement(c,{fallback:n.createElement(a,{useLoader:s.useLoader,useMatch:s.useMatch,useContext:s.useContext,useSearch:s.useSearch,useParams:s.useParams})},n.createElement(h,{key:s.id,errorComponent:i,onCatch:()=>{}},n.createElement(et,{matchId:r,PendingComponent:a}))))}function et({matchId:t,PendingComponent:e}){const r=K(),o=W({select:e=>v(e.pendingMatches.find((e=>e.id===t))||e.matches.find((e=>e.id===t)),["status","loadPromise","routeId","error"])}),a=r.getRoute(o.routeId);if("error"===o.status)throw o.error;if("pending"===o.status)return n.createElement(e,{useLoader:a.useLoader,useMatch:a.useMatch,useContext:a.useContext,useSearch:a.useSearch,useParams:a.useParams});if("success"===o.status){let t=a.options.component??r.options.defaultComponent;return t?n.createElement(t,{useLoader:a.useLoader,useMatch:a.useMatch,useContext:a.useContext,useSearch:a.useSearch,useParams:a.useParams}):n.createElement(X,null)}s(!1)}function rt(t){return n.createElement(n.Fragment,null,t.children)}class ot extends n.Component{state={error:!1,info:void 0};componentDidCatch(t,e){this.props.onCatch(t,e),this.setState({error:t,info:e})}render(){return n.createElement(nt,T({},this.props,{errorState:this.state,reset:()=>this.setState({})}))}}function nt(t){const e=W({select:t=>t.resolvedLocation.key}),[r,o]=n.useState(t.errorState),s=t.errorComponent??st,a=n.useRef("");return n.useEffect((()=>{r&&e!==a.current&&o({}),a.current=e}),[r,e]),n.useEffect((()=>{t.errorState.error&&o(t.errorState)}),[t.errorState.error]),t.errorState.error&&r.error?n.createElement(s,r):t.children}function st({error:t}){const[e,r]=n.useState(!1);return n.createElement("div",{style:{padding:".5rem",maxWidth:"100%"}},n.createElement("div",{style:{display:"flex",alignItems:"center",gap:".5rem"}},n.createElement("strong",{style:{fontSize:"1rem"}},"Something went wrong!"),n.createElement("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>r((t=>!t))},e?"Hide Error":"Show Error")),n.createElement("div",{style:{height:".25rem"}}),e?n.createElement("div",null,n.createElement("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"}},t.message?n.createElement("code",null,t.message):null)):null)}function at(t,e=!0){const r=K();n.useEffect((()=>{if(!e)return;let o=r.history.block(((e,r)=>{window.confirm(t)&&(o(),e())}));return o}))}const it="__root__";class ct{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=it:s(this.parentRoute);let o=r?it:e.path;o&&"/"!==o&&(o=M(o));const n=e?.id||o;let a=r?it:R([this.parentRoute.id===it?"":this.parentRoute.id,n]);o===it&&(o="/"),a!==it&&(a=R(["/",a]));const i=a===it?"/":R([this.parentRoute.fullPath,o]);this.path=o,this.id=a,this.fullPath=i,this.to=i};addChildren=t=>(this.children=t,this);update=t=>(Object.assign(this.options,t),this);useMatch=t=>q({...t,from:this.id});useLoader=t=>Y({...t,from:this.id});useContext=t=>q({...t,from:this.id,select:e=>t?.select?.(e.context)??e.context});useSearch=t=>V({...t,from:this.id});useParams=t=>G({...t,from:this.id})}class ht extends ct{constructor(t){super(t)}}const ut=dt(JSON.parse),lt=pt(JSON.stringify);function dt(t){return e=>{"?"===e.substring(0,1)&&(e=e.substring(1));let r=D(e);for(let e in r){const o=r[e];if("string"==typeof o)try{r[e]=t(o)}catch(t){}}return r}}function pt(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=I(e).toString();return r?`?${r}`:""}}const ft=["component","errorComponent","pendingComponent"];const mt="undefined"==typeof window||!window.document.createElement;function yt(){return{status:"idle",resolvedLocation:null,location:null,matches:[],pendingMatches:[],preloadMatches:{},lastUpdated:Date.now()}}function gt(t){return!!t?.isRedirect}class vt extends Error{}class wt extends Error{}t.Block=function({message:t,condition:e,children:r}){return at(t,e),r??null},t.ErrorComponent=st,t.Link=U,t.MatchRoute=function(t){const e=Q()(t);return"function"==typeof t.children?t.children(e):e?t.children:null},t.Navigate=function(t){const e=K();return n.useLayoutEffect((()=>{e.navigate(t)}),[]),null},t.Outlet=X,t.PathParamError=wt,t.RootRoute=ht,t.Route=ct,t.Router=class{#t;constructor(t){this.options={defaultPreloadDelay:50,context:void 0,...t,stringifySearch:t?.stringifySearch??lt,parseSearch:t?.parseSearch??ut},this.__store=new H(yt(),{onUpdate:()=>{this.state=this.__store.state},defaultPriority:"low"}),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,yt())))};mount=()=>{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??(mt?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=`/${M(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=>{}));latestLoadPromise=null;load=async t=>{const e=new Promise((async(r,o)=>{let n;const s=()=>this.latestLoadPromise!==e?this.latestLoadPromise:void 0;let a;this.cancelMatches(),this.__store.batch((()=>{t?.next&&this.__store.setState((e=>({...e,location:t.next}))),a=this.matchRoutes(this.state.location.pathname,this.state.location.search,{throwOnError:t?.throwOnError}),this.__store.setState((t=>({...t,status:"pending",pendingMatches:a})))}));try{if(await this.loadMatches(a),n=s())return await n;const t=this.state.resolvedLocation;this.__store.setState((t=>({...t,status:"idle",resolvedLocation:t.location,matches:t.pendingMatches,pendingMatches:[]}))),t.href!==this.state.location.href&&this.options.onRouteChange?.(),r()}catch(t){if(n=s())return await n;o(t)}}));return this.latestLoadPromise=e,this.latestLoadPromise};getRoute=t=>{const e=this.routesById[t];return s(e),e};preloadRoute=async(t=this.state.location)=>{const e=this.buildNext(t),r=this.matchRoutes(e.pathname,e.search,{throwOnError:!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=j(this.basepath,t,{to:e.fullPath,caseSensitive:e.options.caseSensitive??this.options.caseSensitive});return!!r&&(o=r,!0)}))||this.routesById.__root__,s=[n];for(;n?.parentRoute;)n=n.parentRoute,n&&s.unshift(n);let a={};const i=s.map((t=>{let n,s;try{n=t.options.parseParams?.(o)??o}catch(t){if(s=new wt(t.message,{cause:t}),r?.throwOnError)throw s}Object.assign(a,n);const i=O(t.path,a),c=O(t.id,a,!0)+(t.options.getKey?.({params:a,search:e})??""),h=this.getRouteMatch(c);if(h)return{...h};const u=!(!t.options.loader&&!ft.some((e=>t.options[e]?.preload)));return{id:c,routeId:t.id,params:a,pathname:R([this.basepath,i]),updatedAt:0,routeSearch:{},search:{},status:u?"pending":"success",error:void 0,paramsError:s,searchError:void 0,loader:void 0,loadPromise:Promise.resolve(),routeContext:void 0,context:void 0,abortController:new AbortController,fetchedAt:0}}));return i.forEach(((t,o)=>{const n=i[o-1],s=this.getRoute(t.routeId),a=(()=>{const o={search:n?.search??e,routeSearch:n?.routeSearch??e};try{const e=("object"==typeof s.options.validateSearch?s.options.validateSearch.parse:s.options.validateSearch)?.(o.search)??{},r={...o.search,...e};return{routeSearch:w(t.routeSearch,e),search:w(t.search,r)}}catch(e){if(t.searchError=new vt(e.message,{cause:e}),r?.throwOnError)throw t.searchError;return o}})(),c=(()=>{try{const e=s.options.getContext?.({parentContext:n?.routeContext??{},context:n?.context??this?.options.context??{},params:t.params,search:t.search})||{};return{context:{...n?.context??this?.options.context,...e},routeContext:e}}catch(t){throw s.options.onError?.(t),t}})();Object.assign(t,{...a,...c})})),i};loadMatches=async(t,e)=>{let r;try{await Promise.all(t.map((async(t,o)=>{const n=this.getRoute(t.routeId),s=(e,s)=>{if(r=r??o,s=s||n.options.onError,gt(e))throw e;try{s?.(e)}catch(t){if(e=t,gt(t))throw t}this.setRouteMatch(t.id,(t=>({...t,error:e,status:"error",updatedAt:Date.now()})))};t.paramsError&&s(t.paramsError,n.options.onParseParamsError),t.searchError&&s(t.searchError,n.options.onValidateSearchError);try{await(n.options.beforeLoad?.({...t,preload:!!e?.preload}))}catch(t){s(t,n.options.onBeforeLoadError)}})))}catch(t){throw e?.preload||this.navigate(t),t}const o=t.slice(0,r),n=[];o.forEach(((t,r)=>{n.push(Promise.resolve().then((async()=>{const o=n[r-1],s=this.getRoute(t.routeId),a=Date.now(),i=Promise.resolve().then((async()=>{const r=()=>{const e=this.getRouteMatch(t.id);return e&&e.fetchedAt!==a?e.loadPromise:void 0};let n;const i=Promise.all(ft.map((async t=>{const e=s.options[t];e?.preload&&await e.preload()}))),c=Promise.resolve().then((()=>{if(s.options.loader)return s.options.loader({...t,preload:!!e?.preload,parentMatchPromise:o})}));try{const[o,s]=await Promise.all([i,c]);if(n=r())return await n;e?.preload&&this.state.matches.find((e=>e.id===t.id))||this.setRouteMatch(t.id,(t=>({...t,error:void 0,status:"success",updatedAt:Date.now(),loader:s})))}catch(o){if(n=r())return await n;if(gt(o))return void(e?.preload||this.navigate(o));const a=s.options.onLoadError??s.options.onError;let i=o;try{a?.(o)}catch(t){if(i=t,gt(t))return void(e?.preload||this.navigate(t))}this.setRouteMatch(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.setRouteMatch(t.id,(t=>({...t,loadPromise:i,fetchedAt:a}))),await i})))})),await Promise.all(n)};reload=()=>{this.navigate({fromCurrent:!0,replace:!0,search:!0})};resolvePath=(t,e)=>C(this.basepath,t,P(e));navigate=async({from:t,to:e="",search:r,hash:o,replace:n,params:a})=>{const i=String(e),c=void 0===t?t:String(t);let h;try{new URL(`${i}`),h=!0}catch(t){}return s(!h),this.#e({from:c,to:i,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=j(this.basepath,o.pathname,{...e,to:r.pathname});return!!n&&(e?.includeSearch??1?!!E(o.search,r.search)&&n:n)};buildLink=({from:t,to:e=".",search:r,params:o,hash:n,target:s,replace:a,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:a},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)||E(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||s&&"_self"!==s||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__),s(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__${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(s(!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=M(t.fullPath),o=L(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 s=this.options.parseSearch(r);return{pathname:e,searchStr:r,search:w(t?.search,s),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=C(this.basepath??"/",e,`${t.to??""}`);const o={...y(this.matchRoutes(this.state.location.pathname,this.state.location.search))?.params};let n=!0===(t.params??!0)?o:g(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 s=t.__matches?.map((t=>this.getRoute(t.routeId).options.preSearchFilters??[])).flat().filter(Boolean)??[],a=t.__matches?.map((t=>this.getRoute(t.routeId).options.postSearchFilters??[])).flat().filter(Boolean)??[],i=s?.length?s?.reduce(((t,e)=>e(t)),this.state.location.search):this.state.location.search,c=!0===t.search?i:t.search?g(t.search,i)??{}:s?.length?i:{},h=a?.length?a.reduce(((t,e)=>e(t)),c):c,u=w(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 n=`${e.pathname}${e.searchStr}${e.hash?`#${e.hash}`:""}`;return this.history["push"===o?"push":"replace"](n,{id:r,...e.state}),this.latestLoadPromise};getRouteMatch=t=>this.state.matches.find((e=>e.id===t))||this.state.pendingMatches.find((e=>e.id===t))||this.state.preloadMatches[t];#s=(t,e)=>{this.__store.setState((r=>({...r,matches:r.matches.map((r=>r.id===t?e(r):r))})))};#a=(t,e)=>{this.__store.setState((r=>({...r,pendingMatches:r.pendingMatches.map((r=>r.id===t?e(r):r))})))};#i=(t,e)=>{s(this.state.preloadMatches[t]),this.__store.setState((r=>({...r,preloadMatches:{...r.preloadMatches,[t]:e(r.preloadMatches[t])}})))};setRouteMatch=(t,e)=>this.state.matches.find((e=>e.id===t))?this.#s(t,e):this.state.pendingMatches.find((e=>e.id===t))?this.#a(t,e):this.state.preloadMatches[t]?this.#i(t,e):void 0},t.RouterContext=class{constructor(){}createRootRoute=t=>new ht(t)},t.RouterProvider=function({router:t,...e}){t.update(e),n.useEffect((()=>{let e;return n.startTransition((()=>{e=t.mount()})),e}),[t]);const r=t.options.Wrap||n.Fragment;return n.createElement(n.Suspense,{fallback:null},n.createElement(r,null,n.createElement(F.Provider,{value:t},n.createElement(J,null))))},t.SearchParamError=vt,t.cleanPath=P,t.componentTypes=ft,t.createBrowserHistory=d,t.createHashHistory=function(){return d({getHref:()=>window.location.hash.substring(1),createHref:t=>`#${t}`})},t.createMemoryHistory=p,t.decode=D,t.defaultParseSearch=ut,t.defaultStringifySearch=lt,t.encode=I,t.functionalUpdate=g,t.interpolatePath=O,t.invariant=s,t.isPlainObject=b,t.isRedirect=gt,t.joinPaths=R,t.last=y,t.lazyFn=function(t,e){return async(...r)=>(await t())[e||"default"](...r)},t.lazyRouteComponent=function(t,e){let r;const o=()=>(r||(r=t()),r),s=n.lazy((async()=>({default:(await o())[e??"default"]})));return s.preload=o,s},t.matchByPath=k,t.matchIdsContext=z,t.matchPathname=j,t.parsePathname=L,t.parseSearchWith=dt,t.partialDeepEqual=E,t.pick=v,t.redirect=function(t){return t.isRedirect=!0,t},t.replaceEqualDeep=w,t.resolvePath=C,t.rootRouteId=it,t.routerContext=F,t.shallow=function(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},t.stringifySearchWith=pt,t.trimPath=M,t.trimPathLeft=_,t.trimPathRight=x,t.useBlocker=at,t.useDehydrate=function(){const t=K();return n.useCallback((function(e,r){return t.dehydrateData(e,r)}),[])},t.useHydrate=function(){const t=K();return function(e){return t.hydrateData(e)}},t.useInjectHtml=function(){const t=K();return n.useCallback((e=>{t.injectHtml(e)}),[])},t.useLinkProps=N,t.useLoader=Y,t.useMatch=q,t.useMatchRoute=Q,t.useMatches=function(t){const e=n.useContext(z);return W({select:r=>{const o=r.matches.slice(r.matches.findIndex((t=>t.id===e[0])));return t?.select?.(o)??o}})},t.useNavigate=function(t){const e=K();return n.useCallback((r=>e.navigate({...t,...r})),[])},t.useParams=G,t.useRouter=K,t.useRouterState=W,t.useSearch=V,t.useStore=A,t.warning=function(t,e){},Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=index.production.js.map
{
"name": "@tanstack/router",
"author": "Tanner Linsley",
"version": "0.0.1-beta.138",
"version": "0.0.1-beta.139",
"license": "MIT",

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

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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc