@tanstack/react-router
Advanced tools
Comparing version 0.0.1-beta.162 to 0.0.1-beta.163
@@ -21,2 +21,3 @@ /** | ||
var routerCore = require('@tanstack/router-core'); | ||
var scrollRestoration = require('./scroll-restoration.js'); | ||
@@ -616,2 +617,3 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
}); | ||
exports.ScrollRestoration = scrollRestoration.ScrollRestoration; | ||
exports.Block = Block; | ||
@@ -618,0 +620,0 @@ exports.ErrorComponent = ErrorComponent; |
@@ -34,2 +34,127 @@ /** | ||
const useLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect; | ||
const windowKey = 'window'; | ||
const delimiter = '___'; | ||
let weakScrolledElementsByRestoreKey = {}; | ||
const cache = (() => { | ||
if (typeof window === 'undefined') { | ||
return { | ||
set: () => {}, | ||
get: () => {} | ||
}; | ||
} | ||
const storageKey = 'tsr-scroll-restoration-v1'; | ||
let cache = JSON.parse(window.sessionStorage.getItem(storageKey) || '{}'); | ||
return { | ||
current: cache, | ||
set: (key, value) => { | ||
cache[key] = value; | ||
window.sessionStorage.setItem(storageKey, JSON.stringify(cache)); | ||
} | ||
}; | ||
})(); | ||
function ScrollRestoration() { | ||
const router = useRouter(); | ||
const getKey = location => location.key; | ||
const pathDidChangeRef = React.useRef(false); | ||
const restoreScrollPositions = () => { | ||
const restoreKey = getKey(router.state.location); | ||
let windowRestored = false; | ||
for (const cacheKey in cache.current) { | ||
const entry = cache.current[cacheKey]; | ||
const [key, elementSelector] = cacheKey.split(delimiter); | ||
if (key === restoreKey) { | ||
if (elementSelector === windowKey) { | ||
windowRestored = true; | ||
window.scrollTo(entry.scrollX, entry.scrollY); | ||
} else if (elementSelector) { | ||
const element = document.querySelector(elementSelector); | ||
if (element) { | ||
element.scrollLeft = entry.scrollX; | ||
element.scrollTop = entry.scrollY; | ||
} | ||
} | ||
} | ||
} | ||
if (!windowRestored) { | ||
window.scrollTo(0, 0); | ||
} | ||
}; | ||
useLayoutEffect(() => { | ||
const { | ||
history | ||
} = window; | ||
if (history.scrollRestoration) { | ||
history.scrollRestoration = 'manual'; | ||
} | ||
const onScroll = event => { | ||
const restoreKey = getKey(router.state.resolvedLocation); | ||
if (!weakScrolledElementsByRestoreKey[restoreKey]) { | ||
weakScrolledElementsByRestoreKey[restoreKey] = new WeakSet(); | ||
} | ||
const set = weakScrolledElementsByRestoreKey[restoreKey]; | ||
if (set.has(event.target)) return; | ||
set.add(event.target); | ||
const cacheKey = [restoreKey, event.target === document || event.target === window ? windowKey : getCssSelector(event.target)].join(delimiter); | ||
if (!cache.current[cacheKey]) { | ||
cache.set(cacheKey, { | ||
scrollX: NaN, | ||
scrollY: NaN | ||
}); | ||
} | ||
}; | ||
const getCssSelector = el => { | ||
let path = [], | ||
parent; | ||
while (parent = el.parentNode) { | ||
path.unshift(`${el.tagName}:nth-child(${[].indexOf.call(parent.children, el) + 1})`); | ||
el = parent; | ||
} | ||
return `${path.join(' > ')}`.toLowerCase(); | ||
}; | ||
const onPathWillChange = from => { | ||
const restoreKey = getKey(from); | ||
for (const cacheKey in cache.current) { | ||
const entry = cache.current[cacheKey]; | ||
const [key, elementSelector] = cacheKey.split(delimiter); | ||
if (restoreKey === key) { | ||
if (elementSelector === windowKey) { | ||
entry.scrollX = window.scrollX || 0; | ||
entry.scrollY = window.scrollY || 0; | ||
} else if (elementSelector) { | ||
const element = document.querySelector(elementSelector); | ||
entry.scrollX = element?.scrollLeft || 0; | ||
entry.scrollY = element?.scrollTop || 0; | ||
} | ||
cache.set(cacheKey, entry); | ||
} | ||
} | ||
}; | ||
const onPathChange = () => { | ||
pathDidChangeRef.current = true; | ||
}; | ||
if (typeof document !== 'undefined') { | ||
document.addEventListener('scroll', onScroll, true); | ||
} | ||
const unsubOnBeforeLoad = router.subscribe('onBeforeLoad', event => { | ||
if (event.pathChanged) onPathWillChange(event.from); | ||
}); | ||
const unsubOnLoad = router.subscribe('onLoad', event => { | ||
if (event.pathChanged) onPathChange(); | ||
}); | ||
return () => { | ||
document.removeEventListener('scroll', onScroll); | ||
unsubOnBeforeLoad(); | ||
unsubOnLoad(); | ||
}; | ||
}, []); | ||
useLayoutEffect(() => { | ||
if (pathDidChangeRef.current) { | ||
pathDidChangeRef.current = false; | ||
restoreScrollPositions(); | ||
} | ||
}); | ||
return null; | ||
} | ||
Route.__onInit = route => { | ||
@@ -600,3 +725,3 @@ Object.assign(route, { | ||
export { Block, ErrorComponent, Link, MatchRoute, Navigate, Outlet, RouterProvider, lazyRouteComponent, matchIdsContext, routerContext, shallow, useBlocker, useDehydrate, useHydrate, useInjectHtml, useLinkProps, useLoader, useMatch, useMatchRoute, useMatches, useNavigate, useParams, useRouteContext, useRouter, useRouterContext, useRouterState, useSearch }; | ||
export { Block, ErrorComponent, Link, MatchRoute, Navigate, Outlet, RouterProvider, ScrollRestoration, lazyRouteComponent, matchIdsContext, routerContext, shallow, useBlocker, useDehydrate, useHydrate, useInjectHtml, useLinkProps, useLoader, useMatch, useMatchRoute, useMatches, useNavigate, useParams, useRouteContext, useRouter, useRouterContext, useRouterState, useSearch }; | ||
//# sourceMappingURL=index.js.map |
@@ -10,3 +10,3 @@ { | ||
{ | ||
"uid": "1c86-167", | ||
"uid": "830a-169", | ||
"name": "\u0000rollupPluginBabelHelpers.js" | ||
@@ -19,15 +19,24 @@ }, | ||
"name": "store/build/esm/index.js", | ||
"uid": "1c86-169" | ||
"uid": "830a-171" | ||
}, | ||
{ | ||
"name": "react-store/build/esm/index.js", | ||
"uid": "1c86-171" | ||
"uid": "830a-173" | ||
}, | ||
{ | ||
"name": "router-core/build/esm/index.js", | ||
"uid": "1c86-177" | ||
"uid": "830a-179" | ||
}, | ||
{ | ||
"name": "react-router/src/index.tsx", | ||
"uid": "1c86-179" | ||
"name": "react-router/src", | ||
"children": [ | ||
{ | ||
"uid": "830a-181", | ||
"name": "scroll-restoration.tsx" | ||
}, | ||
{ | ||
"uid": "830a-183", | ||
"name": "index.tsx" | ||
} | ||
] | ||
} | ||
@@ -41,7 +50,7 @@ ] | ||
"name": "tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js", | ||
"uid": "1c86-173" | ||
"uid": "830a-175" | ||
}, | ||
{ | ||
"name": "tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js", | ||
"uid": "1c86-175" | ||
"uid": "830a-177" | ||
} | ||
@@ -56,50 +65,56 @@ ] | ||
"nodeParts": { | ||
"1c86-167": { | ||
"830a-169": { | ||
"renderedLength": 429, | ||
"gzipLength": 238, | ||
"brotliLength": 0, | ||
"mainUid": "1c86-166" | ||
"mainUid": "830a-168" | ||
}, | ||
"1c86-169": { | ||
"830a-171": { | ||
"renderedLength": 1843, | ||
"gzipLength": 644, | ||
"brotliLength": 0, | ||
"mainUid": "1c86-168" | ||
"mainUid": "830a-170" | ||
}, | ||
"1c86-171": { | ||
"830a-173": { | ||
"renderedLength": 1006, | ||
"gzipLength": 479, | ||
"brotliLength": 0, | ||
"mainUid": "1c86-170" | ||
"mainUid": "830a-172" | ||
}, | ||
"1c86-173": { | ||
"830a-175": { | ||
"renderedLength": 181, | ||
"gzipLength": 129, | ||
"brotliLength": 0, | ||
"mainUid": "1c86-172" | ||
"mainUid": "830a-174" | ||
}, | ||
"1c86-175": { | ||
"830a-177": { | ||
"renderedLength": 44, | ||
"gzipLength": 62, | ||
"brotliLength": 0, | ||
"mainUid": "1c86-174" | ||
"mainUid": "830a-176" | ||
}, | ||
"1c86-177": { | ||
"renderedLength": 56934, | ||
"gzipLength": 13356, | ||
"830a-179": { | ||
"renderedLength": 57185, | ||
"gzipLength": 13483, | ||
"brotliLength": 0, | ||
"mainUid": "1c86-176" | ||
"mainUid": "830a-178" | ||
}, | ||
"1c86-179": { | ||
"830a-181": { | ||
"renderedLength": 4385, | ||
"gzipLength": 1261, | ||
"brotliLength": 0, | ||
"mainUid": "830a-180" | ||
}, | ||
"830a-183": { | ||
"renderedLength": 17058, | ||
"gzipLength": 3802, | ||
"brotliLength": 0, | ||
"mainUid": "1c86-178" | ||
"mainUid": "830a-182" | ||
} | ||
}, | ||
"nodeMetas": { | ||
"1c86-166": { | ||
"830a-168": { | ||
"id": "\u0000rollupPluginBabelHelpers.js", | ||
"moduleParts": { | ||
"index.production.js": "1c86-167" | ||
"index.production.js": "830a-169" | ||
}, | ||
@@ -109,10 +124,10 @@ "imported": [], | ||
{ | ||
"uid": "1c86-178" | ||
"uid": "830a-182" | ||
} | ||
] | ||
}, | ||
"1c86-168": { | ||
"830a-170": { | ||
"id": "/packages/store/build/esm/index.js", | ||
"moduleParts": { | ||
"index.production.js": "1c86-169" | ||
"index.production.js": "830a-171" | ||
}, | ||
@@ -122,17 +137,17 @@ "imported": [], | ||
{ | ||
"uid": "1c86-170" | ||
"uid": "830a-172" | ||
} | ||
] | ||
}, | ||
"1c86-170": { | ||
"830a-172": { | ||
"id": "/packages/react-store/build/esm/index.js", | ||
"moduleParts": { | ||
"index.production.js": "1c86-171" | ||
"index.production.js": "830a-173" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "1c86-181" | ||
"uid": "830a-185" | ||
}, | ||
{ | ||
"uid": "1c86-168" | ||
"uid": "830a-170" | ||
} | ||
@@ -142,13 +157,13 @@ ], | ||
{ | ||
"uid": "1c86-178" | ||
"uid": "830a-182" | ||
}, | ||
{ | ||
"uid": "1c86-176" | ||
"uid": "830a-178" | ||
} | ||
] | ||
}, | ||
"1c86-172": { | ||
"830a-174": { | ||
"id": "/node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js", | ||
"moduleParts": { | ||
"index.production.js": "1c86-173" | ||
"index.production.js": "830a-175" | ||
}, | ||
@@ -158,13 +173,13 @@ "imported": [], | ||
{ | ||
"uid": "1c86-178" | ||
"uid": "830a-182" | ||
}, | ||
{ | ||
"uid": "1c86-176" | ||
"uid": "830a-178" | ||
} | ||
] | ||
}, | ||
"1c86-174": { | ||
"830a-176": { | ||
"id": "/node_modules/.pnpm/tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js", | ||
"moduleParts": { | ||
"index.production.js": "1c86-175" | ||
"index.production.js": "830a-177" | ||
}, | ||
@@ -174,23 +189,23 @@ "imported": [], | ||
{ | ||
"uid": "1c86-178" | ||
"uid": "830a-182" | ||
}, | ||
{ | ||
"uid": "1c86-176" | ||
"uid": "830a-178" | ||
} | ||
] | ||
}, | ||
"1c86-176": { | ||
"830a-178": { | ||
"id": "/packages/router-core/build/esm/index.js", | ||
"moduleParts": { | ||
"index.production.js": "1c86-177" | ||
"index.production.js": "830a-179" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "1c86-172" | ||
"uid": "830a-174" | ||
}, | ||
{ | ||
"uid": "1c86-174" | ||
"uid": "830a-176" | ||
}, | ||
{ | ||
"uid": "1c86-170" | ||
"uid": "830a-172" | ||
} | ||
@@ -200,35 +215,61 @@ ], | ||
{ | ||
"uid": "1c86-178" | ||
"uid": "830a-182" | ||
} | ||
] | ||
}, | ||
"1c86-178": { | ||
"830a-180": { | ||
"id": "/packages/react-router/src/scroll-restoration.tsx", | ||
"moduleParts": { | ||
"index.production.js": "830a-181" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "830a-184" | ||
}, | ||
{ | ||
"uid": "830a-182" | ||
} | ||
], | ||
"importedBy": [ | ||
{ | ||
"uid": "830a-182" | ||
} | ||
] | ||
}, | ||
"830a-182": { | ||
"id": "/packages/react-router/src/index.tsx", | ||
"moduleParts": { | ||
"index.production.js": "1c86-179" | ||
"index.production.js": "830a-183" | ||
}, | ||
"imported": [ | ||
{ | ||
"uid": "1c86-166" | ||
"uid": "830a-168" | ||
}, | ||
{ | ||
"uid": "1c86-180" | ||
"uid": "830a-184" | ||
}, | ||
{ | ||
"uid": "1c86-170" | ||
"uid": "830a-172" | ||
}, | ||
{ | ||
"uid": "1c86-172" | ||
"uid": "830a-174" | ||
}, | ||
{ | ||
"uid": "1c86-174" | ||
"uid": "830a-176" | ||
}, | ||
{ | ||
"uid": "1c86-176" | ||
"uid": "830a-178" | ||
}, | ||
{ | ||
"uid": "830a-180" | ||
} | ||
], | ||
"importedBy": [], | ||
"importedBy": [ | ||
{ | ||
"uid": "830a-180" | ||
} | ||
], | ||
"isEntry": true | ||
}, | ||
"1c86-180": { | ||
"830a-184": { | ||
"id": "react", | ||
@@ -239,3 +280,6 @@ "moduleParts": {}, | ||
{ | ||
"uid": "1c86-178" | ||
"uid": "830a-182" | ||
}, | ||
{ | ||
"uid": "830a-180" | ||
} | ||
@@ -245,3 +289,3 @@ ], | ||
}, | ||
"1c86-181": { | ||
"830a-185": { | ||
"id": "use-sync-external-store/shim/with-selector", | ||
@@ -252,3 +296,3 @@ "moduleParts": {}, | ||
{ | ||
"uid": "1c86-170" | ||
"uid": "830a-172" | ||
} | ||
@@ -255,0 +299,0 @@ ], |
@@ -18,2 +18,4 @@ /** | ||
declare function ScrollRestoration(): null; | ||
declare module '@tanstack/router-core' { | ||
@@ -154,2 +156,2 @@ interface RegisterRouteComponent<TProps extends Record<string, any>> { | ||
export { AnyRouteComponent, AsyncRouteComponent, Block, ErrorComponent, Link, LinkComponent, LinkPropsOptions, MakeLinkOptions, MakeLinkPropsOptions, MakeMatchRouteOptions, MakeUseMatchRouteOptions, MatchRoute, Navigate, Outlet, PromptProps, RouteComponent, RouteErrorComponent, RouteErrorComponentProps, RouteFromIdOrRoute, RouterProps, RouterProvider, SyncRouteComponent, lazyRouteComponent, matchIdsContext, routerContext, shallow, useBlocker, useDehydrate, useHydrate, useInjectHtml, useLinkProps, useLoader, useMatch, useMatchRoute, useMatches, useNavigate, useParams, useRouteContext, useRouter, useRouterContext, useRouterState, useSearch }; | ||
export { AnyRouteComponent, AsyncRouteComponent, Block, ErrorComponent, Link, LinkComponent, LinkPropsOptions, MakeLinkOptions, MakeLinkPropsOptions, MakeMatchRouteOptions, MakeUseMatchRouteOptions, MatchRoute, Navigate, Outlet, PromptProps, RouteComponent, RouteErrorComponent, RouteErrorComponentProps, RouteFromIdOrRoute, RouterProps, RouterProvider, ScrollRestoration, SyncRouteComponent, lazyRouteComponent, matchIdsContext, routerContext, shallow, useBlocker, useDehydrate, useHydrate, useInjectHtml, useLinkProps, useLoader, useMatch, useMatchRoute, useMatches, useNavigate, useParams, useRouteContext, useRouter, useRouterContext, useRouterState, useSearch }; |
@@ -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).ReactRouter={},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(){return s=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},s.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).ReactRouter={},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(){return n=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},n.apply(this,arguments)} | ||
/** | ||
@@ -43,3 +43,3 @@ * @tanstack/store/src/index.ts | ||
*/ | ||
const u="pushstate",l="popstate",d="beforeunload",p=t=>(t.preventDefault(),t.returnValue=""),f=()=>{removeEventListener(d,p,{capture:!0})};function m(t){let e=t.getLocation(),r=()=>{},o=new Set,n=[],s=[];const a=()=>{if(n.length)n[0]?.(a,(()=>{n=[],f()}));else{for(;s.length;)s.shift()?.();t.listener||c()}},i=t=>{s.push(t),a()},c=()=>{e=t.getLocation(),o.forEach((t=>t()))};return{get location(){return e},listen:e=>(0===o.size&&(r="function"==typeof t.listener?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(d,p,{capture:!0}),()=>{n=n.filter((e=>e!==t)),n.length||f()})}}function y(t){const e=t?.getHref??(()=>`${window.location.pathname}${window.location.search}${window.location.hash}`),r=t?.createHref??(t=>t);return m({getLocation:()=>v(e(),history.state),listener:t=>{window.addEventListener(u,t),window.addEventListener(l,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(u,t),window.removeEventListener(l,t)}},pushState:(t,e)=>{window.history.pushState({...e,key:w()},"",r(t))},replaceState:(t,e)=>{window.history.replaceState({...e,key:w()},"",r(t))},back:()=>window.history.back(),forward:()=>window.history.forward(),go:t=>window.history.go(t),createHref:t=>r(t)})}function g(t={initialEntries:["/"]}){const e=t.initialEntries;let r=t.initialIndex??e.length-1,o={};return m({getLocation:()=>v(e[r],o),listener:!1,pushState:(t,n)=>{o={...n,key:w()},e.push(t),r++},replaceState:(t,n)=>{o={...n,key:w()},e[r]=t},back:()=>{r--},forward:()=>{r=Math.min(r+1,e.length-1)},go:t=>window.history.go(t),createHref:t=>t})}function v(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 w(){return(Math.random()+1).toString(36).substring(7)}function b(t){return t[t.length-1]}function S(t,e){return"function"==typeof t?t(e):t}function E(t,e){return e.reduce(((e,r)=>(e[r]=t[r],e)),{})}function R(t,e){if(t===e)return t;const r=e,o=Array.isArray(t)&&Array.isArray(r);if(o||x(t)&&x(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]=R(t[s],r[s]),a[s]===t[s]&&i++}return e===s&&i===e?t:a}return r}function x(t){if(!I(t))return!1;const e=t.constructor;if(void 0===e)return!0;const r=e.prototype;return!!I(r)&&!!r.hasOwnProperty("isPrototypeOf")}function I(t){return"[object Object]"===Object.prototype.toString.call(t)}function _(t,e){return t===e||typeof t==typeof e&&(x(t)&&x(e)?!Object.keys(e).some((r=>!_(t[r],e[r]))):!(!Array.isArray(t)||!Array.isArray(e))&&(t.length===e.length&&t.every(((t,r)=>_(t,e[r])))))}function P(t){return C(t.filter(Boolean).join("/"))}function C(t){return t.replace(/\/{2,}/g,"/")}function M(t){return"/"===t?t:t.replace(/^\/{1,}/,"")}function L(t){return"/"===t?t:t.replace(/\/{1,}$/,"")}function O(t){return L(M(t))}function j(t,e,r){e=e.replace(new RegExp(`^${t}`),"/"),r=r.replace(new RegExp(`^${t}`),"/");let o=k(e);const n=k(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&&"/"===b(o)?.value&&o.pop(),o.pop();else{if("."===t.value)return;o.push(t)}}));return C(P([t,...o.map((t=>t.value))]))}function k(t){if(!t)return[];const e=[];if("/"===(t=C(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 A(t,e,r=!1){return P(k(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 D(t,e,r){const o=B(t,e,r);if(!r.to||o)return o??{}}function B(t,e,r){e="/"!=t?e.substring(t.length):e;const o=`${r.to??"$"}`,n=k(e),s=k(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["*"]=P(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 $(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(t){if(!t)return"";var e=decodeURIComponent(t);return"false"!==e&&("true"===e||(0*+e==0&&+e+""===e?+e:e))}function H(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],T(e.shift())):o[r]=T(e.shift());return o}const N="__root__";class F{constructor(t){this.options=t||{},this.isRoot=!t?.getParentRoute,F.__onInit(this)}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=N:h(this.parentRoute);let o=r?N:e.path;o&&"/"!==o&&(o=O(o));const n=e?.id||o;let s=r?N:P([this.parentRoute.id===N?"":this.parentRoute.id,n]);o===N&&(o="/"),s!==N&&(s=P(["/",s]));const a=s===N?"/":P([this.parentRoute.fullPath,o]);this.path=o,this.id=s,this.fullPath=a,this.to=a};addChildren=t=>(this.children=t,this);update=t=>(Object.assign(this.options,t),this);static __onInit=t=>{}}class U extends F{constructor(t){super(t)}}const z=J(JSON.parse),W=q(JSON.stringify,JSON.parse);function J(t){return e=>{"?"===e.substring(0,1)&&(e=e.substring(1));let r=H(e);for(let e in r){const o=r[e];if("string"==typeof o)try{r[e]=t(o)}catch(t){}}return r}}function q(t,e){function r(r){if("object"==typeof r&&null!==r)try{return t(r)}catch(t){}else if("string"==typeof r&&"function"==typeof e)try{return e(r),t(r)}catch(t){}return r}return t=>{(t={...t})&&Object.keys(t).forEach((e=>{const o=t[e];void 0===o||void 0===o?delete t[e]:Array.isArray(o)?t[e]=o.map(r):t[e]=r(o)}));const e=$(t).toString();return e?`?${e}`:""}}const K=["component","errorComponent","pendingComponent"];const Y="undefined"==typeof window||!window.document.createElement;function V(){return{status:"idle",isFetching:!1,resolvedLocation:null,location:null,matchesById:{},matchIds:[],pendingMatchIds:[],matches:[],pendingMatches:[],lastUpdated:Date.now()}}function G(t){return!!t?.isRedirect}class Q extends Error{}class X extends Error{}function Z(t){const e=st(),{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:g,className:v,onClick:w,onFocus:b,onMouseEnter:E,onMouseLeave:R,onTouchStart:x,...I}=t,_=e.buildLink(t);if("external"===_.type){const{href:t}=_;return{href:t}}const{handleClick:P,handleFocus:C,handleEnter:M,handleLeave:L,handleTouchStart:O,isActive:j,next:k}=_,A=t=>e=>{e.persist&&e.persist(),t.filter(Boolean).forEach((t=>{e.defaultPrevented||t(e)}))},D=j?S(a,{})??{}:{},B=j?{}:S(i,{})??{};return{...D,...B,...I,href:h?void 0:k.href,onClick:A([w,e=>{(t.startTransition??1)&&(n.startTransition||(t=>t))((()=>{P(e)}))}]),onFocus:A([b,C]),onMouseEnter:A([E,M]),onMouseLeave:A([R,L]),onTouchStart:A([x,O]),target:s,style:{...g,...D.style,...B.style},className:[v,D.className,B.className].filter(Boolean).join(" ")||void 0,...h?{role:"link","aria-disabled":!0}:void 0,"data-status":j?"active":void 0}}F.__onInit=t=>{Object.assign(t,{useMatch:(e={})=>at({...e,from:t.id}),useLoader:(e={})=>it({...e,from:t.id}),useContext:(e={})=>at({...e,from:t.id,select:t=>e?.select?.(t.context)??t.context}),useRouteContext:(e={})=>at({...e,from:t.id,select:t=>e?.select?.(t.routeContext)??t.routeContext}),useSearch:(e={})=>ct({...e,from:t.id}),useParams:(e={})=>ht({...e,from:t.id})})};const tt=n.forwardRef(((t,e)=>{const r=Z(t);return n.createElement("a",s({ref:e},r,{children:"function"==typeof t.children?t.children({isActive:"active"===r["data-status"]}):t.children}))}));const et=n.createContext(null),rt=n.createContext(null);function ot(t){return i(st().__store,t?.select)}function nt(){const t=st(),e=ot({select:e=>e.pendingMatches.some((e=>!!t.getRoute(e.routeId)?.options.pendingComponent))?e.pendingMatchIds:e.matchIds});return n.createElement(et.Provider,{value:[void 0,...e]},n.createElement(yt,{errorComponent:vt,onCatch:()=>{}},n.createElement(lt,null)))}function st(){return n.useContext(rt)}function at(t){const e=st(),r=n.useContext(et)[0],o=e.getRouteMatch(r)?.routeId,s=ot({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)&&h(o==s);return ot({select:e=>{const o=e.matches,n=t?.from?o.find((e=>e.routeId===t?.from)):o.find((t=>t.id===r));return h(n,t?.from&&t.from),t?.select?.(n)??n}})}function it(t){return at({...t,select:e=>t?.select?.(e.loaderData)??e.loaderData})}function ct(t){return at({...t,select:e=>t?.select?.(e.search)??e.search})}function ht(t){return ot({select:e=>{const r=b(e.matches)?.params;return t?.select?.(r)??r}})}function ut(){const t=st();return n.useCallback((e=>{const{pending:r,caseSensitive:o,...n}=e;return t.matchRoute(n,{pending:r,caseSensitive:o})}),[])}function lt(){const t=n.useContext(et).slice(1);return t[0]?n.createElement(pt,{matchIds:t}):null}const dt=()=>null;function pt({matchIds:t}){const e=st(),r=t[0],o=e.getRouteMatch(r).routeId,s=e.getRoute(o),a=s.options.pendingComponent??e.options.defaultPendingComponent??dt,i=s.options.errorComponent??e.options.defaultErrorComponent??vt,c=s.options.wrapInSuspense??!s.isRoot?n.Suspense:mt,h=i?yt:mt;return n.createElement(et.Provider,{value:t},n.createElement(c,{fallback:n.createElement(a,{useLoader:s.useLoader,useMatch:s.useMatch,useContext:s.useContext,useRouteContext:s.useRouteContext,useSearch:s.useSearch,useParams:s.useParams})},n.createElement(h,{key:s.id,errorComponent:i,onCatch:()=>{}},n.createElement(ft,{matchId:r,PendingComponent:a}))))}function ft({matchId:t,PendingComponent:e}){const r=st(),o=ot({select:e=>E(e.matchesById[t],["status","loadPromise","routeId","error"])}),s=r.getRoute(o.routeId);if("error"===o.status)throw o.error;if("pending"===o.status)return n.createElement(e,{useLoader:s.useLoader,useMatch:s.useMatch,useContext:s.useContext,useRouteContext:s.useRouteContext,useSearch:s.useSearch,useParams:s.useParams});if("success"===o.status){let t=s.options.component??r.options.defaultComponent;return t?n.createElement(t,{useLoader:s.useLoader,useMatch:s.useMatch,useContext:s.useContext,useRouteContext:s.useRouteContext,useSearch:s.useSearch,useParams:s.useParams}):n.createElement(lt,null)}h(!1)}function mt(t){return n.createElement(n.Fragment,null,t.children)}class yt 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(gt,s({},this.props,{errorState:this.state,reset:()=>this.setState({})}))}}function gt(t){const e=ot({select:t=>t.resolvedLocation.key}),[r,o]=n.useState(t.errorState),s=t.errorComponent??vt,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 vt({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 wt(t,e=!0){const r=st();n.useEffect((()=>{if(!e)return;let o=r.history.block(((e,r)=>{window.confirm(t)&&(o(),e())}));return o}))}t.Block=function({message:t,condition:e,children:r}){return wt(t,e),r??null},t.ErrorComponent=vt,t.FileRoute=class{constructor(t){this.path=t}createRoute=t=>{const e=new F(t);return e.isRoot=!1,e}},t.Link=tt,t.MatchRoute=function(t){const e=ut()(t);return"function"==typeof t.children?t.children(e):e?t.children:null},t.Navigate=function(t){const e=st();return n.useLayoutEffect((()=>{e.navigate(t)}),[]),null},t.Outlet=lt,t.PathParamError=X,t.RootRoute=U,t.Route=F,t.Router=class{#t;constructor(t){this.options={defaultPreloadDelay:50,context:void 0,...t,stringifySearch:t?.stringifySearch??W,parseSearch:t?.parseSearch??z},this.__store=new a(V(),{onUpdate:()=>{const t=this.state,e=this.__store.state,r=t.matchesById!==e.matchesById;let o,n;r||(o=t.matchIds.length!==e.matchIds.length||t.matchIds.some(((t,r)=>t!==e.matchIds[r])),n=t.pendingMatchIds.length!==e.pendingMatchIds.length||t.pendingMatchIds.some(((t,r)=>t!==e.pendingMatchIds[r]))),(r||o)&&(e.matches=e.matchIds.map((t=>e.matchesById[t]))),(r||n)&&(e.pendingMatches=e.pendingMatchIds.map((t=>e.matchesById[t]))),e.isFetching=[...e.matches,...e.pendingMatches].some((t=>t.isFetching)),this.state=e},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,V())))};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??(Y?g():y());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=`/${O(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=async t=>{try{return this.load(t)}catch(t){}};latestLoadPromise=Promise.resolve();load=async t=>{const e=new Promise((async(r,o)=>{let n;const s=()=>this.latestLoadPromise!==e?this.latestLoadPromise:void 0;let a;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,debug:!0}),this.__store.setState((t=>({...t,status:"pending",pendingMatchIds:a.map((t=>t.id)),matchesById:this.#s(t.matchesById,a)})))}));try{try{await this.loadMatches(a)}catch(t){}if(n=s())return n;const t=this.state.resolvedLocation;this.__store.setState((t=>({...t,status:"idle",resolvedLocation:t.location,matchIds:t.pendingMatchIds,pendingMatchIds:[]}))),t.href!==this.state.location.href&&this.options.onRouteChange?.(),r()}catch(t){if(n=s())return n;o(t)}}));return this.latestLoadPromise=e,this.latestLoadPromise};#s=(t,e)=>{const r={...t};let o=!1;return e.forEach((t=>{r[t.id]||(o=!0,r[t.id]=t)})),o?r:t};getRoute=t=>{const e=this.routesById[t];return h(e),e};preloadRoute=async(t=this.state.location)=>{const e=this.buildNext(t),r=this.matchRoutes(e.pathname,e.search,{throwOnError:!0});return this.__store.setState((t=>({...t,matchesById:this.#s(t.matchesById,r)}))),await this.loadMatches(r,{preload:!0,maxAge:t.maxAge}),r};cleanMatches=()=>{const t=Date.now(),e=Object.values(this.state.matchesById).filter((e=>{const r=this.getRoute(e.routeId);return!this.state.matchIds.includes(e.id)&&!this.state.pendingMatchIds.includes(e.id)&&e.preloadInvalidAt<t&&(!r.options.gcMaxAge||e.updatedAt+r.options.gcMaxAge<t)})).map((t=>t.id));e.length&&this.__store.setState((t=>{const r={...t.matchesById};return e.forEach((t=>{delete r[t]})),{...t,matchesById:r}}))};matchRoutes=(t,e,r)=>{let o={},n=this.flatRoutes.find((e=>{const r=D(this.basepath,L(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);const a=s.map((t=>{let e;if(t.options.parseParams)try{const e=t.options.parseParams(o);Object.assign(o,e)}catch(t){if(e=new X(t.message,{cause:t}),r?.throwOnError)throw e;return e}})),i=s.map(((t,r)=>{const n=A(t.path,o),s=t.options.key?t.options.key({params:o,search:e})??"":"",i=s?JSON.stringify(s):"",c=A(t.id,o,!0)+i,h=this.getRouteMatch(c);if(h)return{...h};const u=!(!t.options.loader&&!K.some((e=>t.options[e]?.preload)));return{id:c,key:i,routeId:t.id,params:o,pathname:P([this.basepath,n]),updatedAt:Date.now(),invalidAt:1/0,preloadInvalidAt:1/0,routeSearch:{},search:{},status:u?"pending":"success",isFetching:!1,invalid:!1,error:void 0,paramsError:a[r],searchError:void 0,loaderData: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:R(t.routeSearch,e),search:R(t.search,r)}}catch(e){if(t.searchError=new Q(e.message,{cause:e}),r?.throwOnError)throw t.searchError;return o}})();Object.assign(t,{...a});const 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,{...c})})),i};loadMatches=async(t,e)=>{let r;this.cleanMatches(),e?.preload||t.forEach((t=>{this.setRouteMatch(t.id,(e=>({...e,routeSearch:t.routeSearch,search:t.search,routeContext:t.routeContext,context:t.context,error:t.error,paramsError:t.paramsError,searchError:t.searchError,params:t.params})))}));try{for(const[o,n]of t.entries()){const t=this.getRoute(n.routeId),s=(e,s)=>{if(r=r??o,s=s||t.options.onError,G(e))throw e;try{s?.(e)}catch(t){if(e=t,G(t))throw t}this.setRouteMatch(n.id,(t=>({...t,error:e,status:"error",updatedAt:Date.now()})))};n.paramsError&&s(n.paramsError,t.options.onParseParamsError),n.searchError&&s(n.searchError,t.options.onValidateSearchError);let a=!1;try{await(t.options.beforeLoad?.({...n,preload:!!e?.preload}))}catch(e){s(e,t.options.onBeforeLoadError),a=!0}if(a)break}}catch(t){throw e?.preload||this.navigate(t),t}const o=t.slice(0,r),n=[];o.forEach(((t,r)=>{n.push((async()=>{const o=n[r-1],s=this.getRoute(t.routeId);if(t.isFetching||"success"===t.status&&!this.getIsInvalid({matchId:t.id,preload:e?.preload}))return this.getRouteMatch(t.id)?.loadPromise;const a=Date.now(),i=()=>{const e=this.getRouteMatch(t.id);return e&&e.fetchedAt!==a?e.loadPromise:void 0},c=t=>!!G(t)&&(e?.preload||this.navigate(t),!0),h=async()=>{let r;try{const n=Promise.all(K.map((async t=>{const e=s.options[t];e?.preload&&await e.preload()}))),a=s.options.loader?.({...t,preload:!!e?.preload,parentMatchPromise:o}),[c,h]=await Promise.all([n,a]);if(r=i())return await r;this.setRouteMatchData(t.id,(()=>h),e)}catch(e){let o=e;if(r=i())return await r;if(c(e))return;if(s.options.onLoadError)try{s.options.onLoadError(e)}catch(t){if(o=t,c(t))return}if((!s.options.onLoadError||o!==e)&&s.options.onError)try{s.options.onError(o)}catch(t){if(c(t))return}this.setRouteMatch(t.id,(t=>({...t,error:e,status:"error",isFetching:!1,updatedAt:Date.now()})))}};let u;this.__store.batch((()=>{this.setRouteMatch(t.id,(t=>({...t,isFetching:!0,fetchedAt:a,invalid:!1}))),u=h(),this.setRouteMatch(t.id,(t=>({...t,loadPromise:u})))})),await u})())})),await Promise.all(n)};reload=()=>this.navigate({fromCurrent:!0,replace:!0,search:!0});resolvePath=(t,e)=>j(this.basepath,t,C(e));navigate=async({from:t,to:e="",search:r,hash:o,replace:n,params:s})=>{const a=String(e),i=void 0===t?t:String(t);let c;try{new URL(`${a}`),c=!0}catch(t){}return h(!c),this.#e({from:i,to:a,search:r,hash:o,replace:n,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 n=D(this.basepath,o.pathname,{...e,to:r.pathname});return!!n&&(e?.includeSearch??1?!!_(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,state:l})=>{try{return new URL(`${e}`),{type:"external",href:e}}catch(t){}const d={from:t,to:e,search:r,params:o,hash:n,replace:a,state:l},p=this.buildNext(d);c=c??this.options.defaultPreload;const f=h??this.options.defaultPreloadDelay??0,m=this.state.location.pathname.split("/"),y=p.pathname.split("/").every(((t,e)=>t===m[e])),g=i?.exact?this.state.location.pathname===p.pathname:y,v=!i?.includeHash||this.state.location.hash===p.hash,w=!(i?.includeSearch??1)||_(this.state.location.search,p.search);return{type:"internal",next:p,handleFocus:t=>{c&&this.preloadRoute(d).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(d))},handleEnter:t=>{const e=t.target||{};if(c){if(e.preloadTimeout)return;e.preloadTimeout=setTimeout((()=>{e.preloadTimeout=null,this.preloadRoute(d).catch((t=>{console.warn(t),console.warn("Error preloading route! ☝️")}))}),f)}},handleLeave:t=>{const e=t.target||{};e.preloadTimeout&&(clearTimeout(e.preloadTimeout),e.preloadTimeout=null)},handleTouchStart:t=>{this.preloadRoute(d).catch((t=>{console.warn(t),console.warn("Error preloading route! ☝️")}))},isActive:g&&v&&w,disabled:u}};dehydrate=()=>({state:E(this.state,["location","status","lastUpdated"])});hydrate=async t=>{let e=t;"undefined"!=typeof document&&(e=window.__TSR_DEHYDRATED__),h(e);const r=e;this.dehydratedData=r.payload,this.options.hydrate?.(r.payload);const o=r.router.state;this.__store.setState((t=>({...t,...o,resolvedLocation:o.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(h(!this.routesById[t.id],String(t.id)),this.routesById[t.id]=t,!t.isRoot&&t.path){const e=L(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=O(t.fullPath),o=k(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:R(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=j(this.basepath??"/",e,`${t.to??""}`);const o={...b(this.matchRoutes(this.state.location.pathname,this.state.location.search))?.params};let n=!0===(t.params??!0)?o:S(t.params,o);n&&t.__matches?.map((t=>this.getRoute(t.routeId).options.stringifyParams)).filter(Boolean).forEach((t=>{n={...n,...t(n)}})),r=A(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?S(t.search,i)??{}:s?.length?i:{},h=a?.length?a.reduce(((t,e)=>e(t)),c):c,u=R(this.state.location.search,h),l=this.options.stringifySearch(u),d=!0===t.hash?this.state.location.hash:S(t.hash,this.state.location.hash),p=d?`#${d}`:"";return{pathname:r,search:u,searchStr:l,state:!0===t.state?this.state.location.state:S(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.matchesById[t];setRouteMatch=(t,e)=>{this.__store.setState((r=>(r.matchesById[t]||console.warn(`No match found with id: ${t}`),{...r,matchesById:{...r.matchesById,[t]:e(r.matchesById[t])}})))};setRouteMatchData=(t,e,r)=>{const o=this.getRouteMatch(t);if(!o)return;const n=this.getRoute(o.routeId),s=r?.updatedAt??Date.now(),a=s+(r?.maxAge??n.options.preloadMaxAge??this.options.defaultPreloadMaxAge??5e3),i=s+(r?.maxAge??n.options.maxAge??this.options.defaultMaxAge??1/0);this.setRouteMatch(t,(t=>({...t,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),loaderData:S(e,t.loaderData),preloadInvalidAt:a,invalidAt:i}))),this.state.matches.find((e=>e.id===t))};invalidate=async t=>{if(t?.matchId){this.setRouteMatch(t.matchId,(t=>({...t,invalid:!0})));const e=this.state.matches.findIndex((e=>e.id===t.matchId)),r=this.state.matches[e+1];if(r)return this.invalidate({matchId:r.id,reload:!1})}else this.__store.batch((()=>{Object.values(this.state.matchesById).forEach((t=>{this.setRouteMatch(t.id,(t=>({...t,invalid:!0})))}))}));if(t?.reload??1)return this.reload()};getIsInvalid=t=>{if(!t?.matchId)return!!this.state.matches.find((e=>this.getIsInvalid({matchId:e.id,preload:t?.preload})));const e=this.getRouteMatch(t?.matchId);if(!e)return!1;const r=Date.now();return e.invalid||(t?.preload?e.preloadInvalidAt:e.invalidAt)<r}},t.RouterContext=class{constructor(){}createRootRoute=t=>new U(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(rt.Provider,{value:t},n.createElement(nt,null))))},t.SearchParamError=Q,t.cleanPath=C,t.componentTypes=K,t.createBrowserHistory=y,t.createHashHistory=function(){return y({getHref:()=>window.location.hash.substring(1),createHref:t=>`#${t}`})},t.createMemoryHistory=g,t.decode=H,t.defaultParseSearch=z,t.defaultStringifySearch=W,t.encode=$,t.functionalUpdate=S,t.interpolatePath=A,t.invariant=h,t.isPlainObject=x,t.isRedirect=G,t.joinPaths=P,t.last=b,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=B,t.matchIdsContext=et,t.matchPathname=D,t.parsePathname=k,t.parseSearchWith=J,t.partialDeepEqual=_,t.pick=E,t.redirect=function(t){return t.isRedirect=!0,t},t.replaceEqualDeep=R,t.resolvePath=j,t.rootRouteId=N,t.routerContext=rt,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=q,t.trimPath=O,t.trimPathLeft=M,t.trimPathRight=L,t.useBlocker=wt,t.useDehydrate=function(){const t=st();return n.useCallback((function(e,r){return t.dehydrateData(e,r)}),[])},t.useHydrate=function(){const t=st();return function(e){return t.hydrateData(e)}},t.useInjectHtml=function(){const t=st();return n.useCallback((e=>{t.injectHtml(e)}),[])},t.useLinkProps=Z,t.useLoader=it,t.useMatch=at,t.useMatchRoute=ut,t.useMatches=function(t){const e=n.useContext(et);return ot({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=st();return n.useCallback((r=>e.navigate({...t,...r})),[])},t.useParams=ht,t.useRouteContext=function(t){return at({...t,select:e=>t?.select?.(e.routeContext)??e.routeContext})},t.useRouter=st,t.useRouterContext=function(t){return at({...t,select:e=>t?.select?.(e.context)??e.context})},t.useRouterState=ot,t.useSearch=ct,t.useStore=i,t.warning=function(t,e){},Object.defineProperty(t,"__esModule",{value:!0})})); | ||
const u="pushstate",l="popstate",d="beforeunload",p=t=>(t.preventDefault(),t.returnValue=""),f=()=>{removeEventListener(d,p,{capture:!0})};function m(t){let e=t.getLocation(),r=()=>{},o=new Set,s=[],n=[];const a=()=>{if(s.length)s[0]?.(a,(()=>{s=[],f()}));else{for(;n.length;)n.shift()?.();t.subscriber||c()}},i=t=>{n.push(t),a()},c=()=>{e=t.getLocation(),o.forEach((t=>t()))};return{get location(){return e},subscribe:e=>(0===o.size&&(r="function"==typeof t.subscriber?t.subscriber(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=>(s.push(t),1===s.length&&addEventListener(d,p,{capture:!0}),()=>{s=s.filter((e=>e!==t)),s.length||f()})}}function y(t){const e=t?.getHref??(()=>`${window.location.pathname}${window.location.search}${window.location.hash}`),r=t?.createHref??(t=>t);return m({getLocation:()=>v(e(),history.state),subscriber:t=>{window.addEventListener(u,t),window.addEventListener(l,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(u,t),window.removeEventListener(l,t)}},pushState:(t,e)=>{window.history.pushState({...e,key:w()},"",r(t))},replaceState:(t,e)=>{window.history.replaceState({...e,key:w()},"",r(t))},back:()=>window.history.back(),forward:()=>window.history.forward(),go:t=>window.history.go(t),createHref:t=>r(t)})}function g(t={initialEntries:["/"]}){const e=t.initialEntries;let r=t.initialIndex??e.length-1,o={};return m({getLocation:()=>v(e[r],o),subscriber:!1,pushState:(t,s)=>{o={...s,key:w()},e.push(t),r++},replaceState:(t,s)=>{o={...s,key:w()},e[r]=t},back:()=>{r--},forward:()=>{r=Math.min(r+1,e.length-1)},go:t=>window.history.go(t),createHref:t=>t})}function v(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 w(){return(Math.random()+1).toString(36).substring(7)}function b(t){return t[t.length-1]}function S(t,e){return"function"==typeof t?t(e):t}function R(t,e){return e.reduce(((e,r)=>(e[r]=t[r],e)),{})}function E(t,e){if(t===e)return t;const r=e,o=Array.isArray(t)&&Array.isArray(r);if(o||x(t)&&x(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]=E(t[n],r[n]),a[n]===t[n]&&i++}return e===n&&i===e?t:a}return r}function x(t){if(!I(t))return!1;const e=t.constructor;if(void 0===e)return!0;const r=e.prototype;return!!I(r)&&!!r.hasOwnProperty("isPrototypeOf")}function I(t){return"[object Object]"===Object.prototype.toString.call(t)}function _(t,e){return t===e||typeof t==typeof e&&(x(t)&&x(e)?!Object.keys(e).some((r=>!_(t[r],e[r]))):!(!Array.isArray(t)||!Array.isArray(e))&&(t.length===e.length&&t.every(((t,r)=>_(t,e[r])))))}function P(t){return C(t.filter(Boolean).join("/"))}function C(t){return t.replace(/\/{2,}/g,"/")}function M(t){return"/"===t?t:t.replace(/^\/{1,}/,"")}function L(t){return"/"===t?t:t.replace(/\/{1,}$/,"")}function O(t){return L(M(t))}function A(t,e,r){e=e.replace(new RegExp(`^${t}`),"/"),r=r.replace(new RegExp(`^${t}`),"/");let o=j(e);const s=j(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&&"/"===b(o)?.value&&o.pop(),o.pop();else{if("."===t.value)return;o.push(t)}}));return C(P([t,...o.map((t=>t.value))]))}function j(t){if(!t)return[];const e=[];if("/"===(t=C(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 P(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 D(t,e,r){const o=B(t,e,r);if(!r.to||o)return o??{}}function B(t,e,r){e="/"!=t?e.substring(t.length):e;const o=`${r.to??"$"}`,s=j(e),n=j(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 T(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==0&&+e+""===e?+e:e))}function H(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}const N="__root__";class F{constructor(t){this.options=t||{},this.isRoot=!t?.getParentRoute,F.__onInit(this)}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=N:h(this.parentRoute);let o=r?N:e.path;o&&"/"!==o&&(o=O(o));const s=e?.id||o;let n=r?N:P([this.parentRoute.id===N?"":this.parentRoute.id,s]);o===N&&(o="/"),n!==N&&(n=P(["/",n]));const a=n===N?"/":P([this.parentRoute.fullPath,o]);this.path=o,this.id=n,this.fullPath=a,this.to=a};addChildren=t=>(this.children=t,this);update=t=>(Object.assign(this.options,t),this);static __onInit=t=>{}}class U extends F{constructor(t){super(t)}}const z=Y(JSON.parse),W=J(JSON.stringify,JSON.parse);function Y(t){return e=>{"?"===e.substring(0,1)&&(e=e.substring(1));let r=H(e);for(let e in r){const o=r[e];if("string"==typeof o)try{r[e]=t(o)}catch(t){}}return r}}function J(t,e){function r(r){if("object"==typeof r&&null!==r)try{return t(r)}catch(t){}else if("string"==typeof r&&"function"==typeof e)try{return e(r),t(r)}catch(t){}return r}return t=>{(t={...t})&&Object.keys(t).forEach((e=>{const o=t[e];void 0===o||void 0===o?delete t[e]:Array.isArray(o)?t[e]=o.map(r):t[e]=r(o)}));const e=T(t).toString();return e?`?${e}`:""}}const q=["component","errorComponent","pendingComponent"];const X="undefined"==typeof window||!window.document.createElement;function K(){return{status:"idle",isFetching:!1,resolvedLocation:null,location:null,matchesById:{},matchIds:[],pendingMatchIds:[],matches:[],pendingMatches:[],lastUpdated:Date.now()}}function V(t){return!!t?.isRedirect}class G extends Error{}class Q extends Error{}const Z="undefined"!=typeof window?s.useLayoutEffect:s.useEffect,tt="window",et="___";let rt={};const ot=(()=>{if("undefined"==typeof window)return{set:()=>{},get:()=>{}};const t="tsr-scroll-restoration-v1";let e=JSON.parse(window.sessionStorage.getItem(t)||"{}");return{current:e,set:(r,o)=>{e[r]=o,window.sessionStorage.setItem(t,JSON.stringify(e))}}})();function st(t){const e=ut(),{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:b,onMouseEnter:R,onMouseLeave:E,onTouchStart:x,...I}=t,_=e.buildLink(t);if("external"===_.type){const{href:t}=_;return{href:t}}const{handleClick:P,handleFocus:C,handleEnter:M,handleLeave:L,handleTouchStart:O,isActive:A,next:j}=_,k=t=>e=>{e.persist&&e.persist(),t.filter(Boolean).forEach((t=>{e.defaultPrevented||t(e)}))},D=A?S(a,{})??{}:{},B=A?{}:S(i,{})??{};return{...D,...B,...I,href:h?void 0:j.href,onClick:k([w,e=>{(t.startTransition??1)&&(s.startTransition||(t=>t))((()=>{P(e)}))}]),onFocus:k([b,C]),onMouseEnter:k([R,M]),onMouseLeave:k([E,L]),onTouchStart:k([x,O]),target:n,style:{...g,...D.style,...B.style},className:[v,D.className,B.className].filter(Boolean).join(" ")||void 0,...h?{role:"link","aria-disabled":!0}:void 0,"data-status":A?"active":void 0}}F.__onInit=t=>{Object.assign(t,{useMatch:(e={})=>lt({...e,from:t.id}),useLoader:(e={})=>dt({...e,from:t.id}),useContext:(e={})=>lt({...e,from:t.id,select:t=>e?.select?.(t.context)??t.context}),useRouteContext:(e={})=>lt({...e,from:t.id,select:t=>e?.select?.(t.routeContext)??t.routeContext}),useSearch:(e={})=>pt({...e,from:t.id}),useParams:(e={})=>ft({...e,from:t.id})})};const nt=s.forwardRef(((t,e)=>{const r=st(t);return s.createElement("a",n({ref:e},r,{children:"function"==typeof t.children?t.children({isActive:"active"===r["data-status"]}):t.children}))}));const at=s.createContext(null),it=s.createContext(null);function ct(t){return i(ut().__store,t?.select)}function ht(){const t=ut(),e=ct({select:e=>e.pendingMatches.some((e=>!!t.getRoute(e.routeId)?.options.pendingComponent))?e.pendingMatchIds:e.matchIds});return s.createElement(at.Provider,{value:[void 0,...e]},s.createElement(St,{errorComponent:Et,onCatch:()=>{}},s.createElement(yt,null)))}function ut(){return s.useContext(it)}function lt(t){const e=ut(),r=s.useContext(at)[0],o=e.getRouteMatch(r)?.routeId,n=ct({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)&&h(o==n);return ct({select:e=>{const o=e.matches,s=t?.from?o.find((e=>e.routeId===t?.from)):o.find((t=>t.id===r));return h(s,t?.from&&t.from),t?.select?.(s)??s}})}function dt(t){return lt({...t,select:e=>t?.select?.(e.loaderData)??e.loaderData})}function pt(t){return lt({...t,select:e=>t?.select?.(e.search)??e.search})}function ft(t){return ct({select:e=>{const r=b(e.matches)?.params;return t?.select?.(r)??r}})}function mt(){const t=ut();return s.useCallback((e=>{const{pending:r,caseSensitive:o,...s}=e;return t.matchRoute(s,{pending:r,caseSensitive:o})}),[])}function yt(){const t=s.useContext(at).slice(1);return t[0]?s.createElement(vt,{matchIds:t}):null}const gt=()=>null;function vt({matchIds:t}){const e=ut(),r=t[0],o=e.getRouteMatch(r).routeId,n=e.getRoute(o),a=n.options.pendingComponent??e.options.defaultPendingComponent??gt,i=n.options.errorComponent??e.options.defaultErrorComponent??Et,c=n.options.wrapInSuspense??!n.isRoot?s.Suspense:bt,h=i?St:bt;return s.createElement(at.Provider,{value:t},s.createElement(c,{fallback:s.createElement(a,{useLoader:n.useLoader,useMatch:n.useMatch,useContext:n.useContext,useRouteContext:n.useRouteContext,useSearch:n.useSearch,useParams:n.useParams})},s.createElement(h,{key:n.id,errorComponent:i,onCatch:()=>{}},s.createElement(wt,{matchId:r,PendingComponent:a}))))}function wt({matchId:t,PendingComponent:e}){const r=ut(),o=ct({select:e=>R(e.matchesById[t],["status","loadPromise","routeId","error"])}),n=r.getRoute(o.routeId);if("error"===o.status)throw o.error;if("pending"===o.status)return s.createElement(e,{useLoader:n.useLoader,useMatch:n.useMatch,useContext:n.useContext,useRouteContext:n.useRouteContext,useSearch:n.useSearch,useParams:n.useParams});if("success"===o.status){let t=n.options.component??r.options.defaultComponent;return t?s.createElement(t,{useLoader:n.useLoader,useMatch:n.useMatch,useContext:n.useContext,useRouteContext:n.useRouteContext,useSearch:n.useSearch,useParams:n.useParams}):s.createElement(yt,null)}h(!1)}function bt(t){return s.createElement(s.Fragment,null,t.children)}class St 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(Rt,n({},this.props,{errorState:this.state,reset:()=>this.setState({})}))}}function Rt(t){const e=ct({select:t=>t.resolvedLocation.key}),[r,o]=s.useState(t.errorState),n=t.errorComponent??Et,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 Et({error:t}){const[e,r]=s.useState(!1);return s.createElement("div",{style:{padding:".5rem",maxWidth:"100%"}},s.createElement("div",{style:{display:"flex",alignItems:"center",gap:".5rem"}},s.createElement("strong",{style:{fontSize:"1rem"}},"Something went wrong!"),s.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")),s.createElement("div",{style:{height:".25rem"}}),e?s.createElement("div",null,s.createElement("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"}},t.message?s.createElement("code",null,t.message):null)):null)}function xt(t,e=!0){const r=ut();s.useEffect((()=>{if(!e)return;let o=r.history.block(((e,r)=>{window.confirm(t)&&(o(),e())}));return o}))}t.Block=function({message:t,condition:e,children:r}){return xt(t,e),r??null},t.ErrorComponent=Et,t.FileRoute=class{constructor(t){this.path=t}createRoute=t=>{const e=new F(t);return e.isRoot=!1,e}},t.Link=nt,t.MatchRoute=function(t){const e=mt()(t);return"function"==typeof t.children?t.children(e):e?t.children:null},t.Navigate=function(t){const e=ut();return s.useLayoutEffect((()=>{e.navigate(t)}),[]),null},t.Outlet=yt,t.PathParamError=Q,t.RootRoute=U,t.Route=F,t.Router=class{#t;constructor(t){this.options={defaultPreloadDelay:50,context:void 0,...t,stringifySearch:t?.stringifySearch??W,parseSearch:t?.parseSearch??z},this.__store=new a(K(),{onUpdate:()=>{const t=this.state,e=this.__store.state,r=t.matchesById!==e.matchesById;let o,s;r||(o=t.matchIds.length!==e.matchIds.length||t.matchIds.some(((t,r)=>t!==e.matchIds[r])),s=t.pendingMatchIds.length!==e.pendingMatchIds.length||t.pendingMatchIds.some(((t,r)=>t!==e.pendingMatchIds[r]))),(r||o)&&(e.matches=e.matchIds.map((t=>e.matchesById[t]))),(r||s)&&(e.pendingMatches=e.pendingMatchIds.map((t=>e.matchesById[t]))),e.isFetching=[...e.matches,...e.pendingMatches].some((t=>t.isFetching)),this.state=e},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})}subscribers=new Set;subscribe=(t,e)=>{const r={eventType:t,fn:e};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}};#r=t=>{this.subscribers.forEach((e=>{e.eventType===t.type&&e.fn(t)}))};reset=()=>{this.__store.setState((t=>Object.assign(t,K())))};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??(X?g():y());const t=this.#o();this.__store.setState((e=>({...e,resolvedLocation:t,location:t}))),this.#t=this.history.subscribe((()=>{this.safeLoad({next:this.#o(this.state.location)})}))}const{basepath:e,routeTree:r}=this.options;return this.basepath=`/${O(e??"")??""}`,r&&r!==this.routeTree&&this.#s(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=async t=>{try{return this.load(t)}catch(t){}};latestLoadPromise=Promise.resolve();load=async t=>{const e=new Promise((async(r,o)=>{const s=this.state.resolvedLocation,n=!(!t?.next||s.href===t.next.href);let a;const i=()=>this.latestLoadPromise!==e?this.latestLoadPromise:void 0;let c;this.#r({type:"onBeforeLoad",from:s,to:t?.next??this.state.location,pathChanged:n}),this.__store.batch((()=>{t?.next&&this.__store.setState((e=>({...e,location:t.next}))),c=this.matchRoutes(this.state.location.pathname,this.state.location.search,{throwOnError:t?.throwOnError,debug:!0}),this.__store.setState((t=>({...t,status:"pending",pendingMatchIds:c.map((t=>t.id)),matchesById:this.#a(t.matchesById,c)})))}));try{try{await this.loadMatches(c)}catch(t){}if(a=i())return a;this.__store.setState((t=>({...t,status:"idle",resolvedLocation:t.location,matchIds:t.pendingMatchIds,pendingMatchIds:[]}))),this.#r({type:"onLoad",from:s,to:this.state.location,pathChanged:n}),r()}catch(t){if(a=i())return a;o(t)}}));return this.latestLoadPromise=e,this.latestLoadPromise};#a=(t,e)=>{const r={...t};let o=!1;return e.forEach((t=>{r[t.id]||(o=!0,r[t.id]=t)})),o?r:t};getRoute=t=>{const e=this.routesById[t];return h(e),e};preloadRoute=async(t=this.state.location)=>{const e=this.buildNext(t),r=this.matchRoutes(e.pathname,e.search,{throwOnError:!0});return this.__store.setState((t=>({...t,matchesById:this.#a(t.matchesById,r)}))),await this.loadMatches(r,{preload:!0,maxAge:t.maxAge}),r};cleanMatches=()=>{const t=Date.now(),e=Object.values(this.state.matchesById).filter((e=>{const r=this.getRoute(e.routeId);return!this.state.matchIds.includes(e.id)&&!this.state.pendingMatchIds.includes(e.id)&&e.preloadInvalidAt<t&&(!r.options.gcMaxAge||e.updatedAt+r.options.gcMaxAge<t)})).map((t=>t.id));e.length&&this.__store.setState((t=>{const r={...t.matchesById};return e.forEach((t=>{delete r[t]})),{...t,matchesById:r}}))};matchRoutes=(t,e,r)=>{let o={},s=this.flatRoutes.find((e=>{const r=D(this.basepath,L(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);const a=n.map((t=>{let e;if(t.options.parseParams)try{const e=t.options.parseParams(o);Object.assign(o,e)}catch(t){if(e=new Q(t.message,{cause:t}),r?.throwOnError)throw e;return e}})),i=n.map(((t,r)=>{const s=k(t.path,o),n=t.options.key?t.options.key({params:o,search:e})??"":"",i=n?JSON.stringify(n):"",c=k(t.id,o,!0)+i,h=this.getRouteMatch(c);if(h)return{...h};const u=!(!t.options.loader&&!q.some((e=>t.options[e]?.preload)));return{id:c,key:i,routeId:t.id,params:o,pathname:P([this.basepath,s]),updatedAt:Date.now(),invalidAt:1/0,preloadInvalidAt:1/0,routeSearch:{},search:{},status:u?"pending":"success",isFetching:!1,invalid:!1,error:void 0,paramsError:a[r],searchError:void 0,loaderData: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:E(t.routeSearch,e),search:E(t.search,r)}}catch(e){if(t.searchError=new G(e.message,{cause:e}),r?.throwOnError)throw t.searchError;return o}})();Object.assign(t,{...a});const 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,{...c})})),i};loadMatches=async(t,e)=>{let r;this.cleanMatches(),e?.preload||t.forEach((t=>{this.setRouteMatch(t.id,(e=>({...e,routeSearch:t.routeSearch,search:t.search,routeContext:t.routeContext,context:t.context,error:t.error,paramsError:t.paramsError,searchError:t.searchError,params:t.params})))}));try{for(const[o,s]of t.entries()){const t=this.getRoute(s.routeId),n=(e,n)=>{if(e.routerCode=n,r=r??o,V(e))throw e;try{t.options.onError?.(e)}catch(t){if(e=t,V(t))throw t}this.setRouteMatch(s.id,(t=>({...t,error:e,status:"error",updatedAt:Date.now()})))};s.paramsError&&n(s.paramsError,"PARSE_PARAMS"),s.searchError&&n(s.searchError,"VALIDATE_SEARCH");let a=!1;try{await(t.options.beforeLoad?.({...s,preload:!!e?.preload}))}catch(t){n(t,"BEFORE_LOAD"),a=!0}if(a)break}}catch(t){throw e?.preload||this.navigate(t),t}const o=t.slice(0,r),s=[];o.forEach(((t,r)=>{s.push((async()=>{const o=s[r-1],n=this.getRoute(t.routeId);if(t.isFetching||"success"===t.status&&!this.getIsInvalid({matchId:t.id,preload:e?.preload}))return this.getRouteMatch(t.id)?.loadPromise;const a=Date.now(),i=()=>{const e=this.getRouteMatch(t.id);return e&&e.fetchedAt!==a?e.loadPromise:void 0},c=t=>!!V(t)&&(e?.preload||this.navigate(t),!0),h=async()=>{let r;try{const s=Promise.all(q.map((async t=>{const e=n.options[t];e?.preload&&await e.preload()}))),a=n.options.loader?.({...t,preload:!!e?.preload,parentMatchPromise:o}),[c,h]=await Promise.all([s,a]);if(r=i())return await r;this.setRouteMatchData(t.id,(()=>h),e)}catch(e){if(r=i())return await r;if(c(e))return;try{n.options.onError?.(e)}catch(t){if(e=t,c(t))return}this.setRouteMatch(t.id,(t=>({...t,error:e,status:"error",isFetching:!1,updatedAt:Date.now()})))}};let u;this.__store.batch((()=>{this.setRouteMatch(t.id,(t=>({...t,isFetching:!0,fetchedAt:a,invalid:!1}))),u=h(),this.setRouteMatch(t.id,(t=>({...t,loadPromise:u})))})),await u})())})),await Promise.all(s)};reload=()=>this.navigate({fromCurrent:!0,replace:!0,search:!0});resolvePath=(t,e)=>A(this.basepath,t,C(e));navigate=async({from:t,to:e="",search:r,hash:o,replace:s,params:n})=>{const a=String(e),i=void 0===t?t:String(t);let c;try{new URL(`${a}`),c=!0}catch(t){}return h(!c),this.#e({from:i,to:a,search:r,hash:o,replace:s,params:n})};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=D(this.basepath,o.pathname,{...e,to:r.pathname});return!!s&&(e?.includeSearch??1?!!_(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,state:l})=>{try{return new URL(`${e}`),{type:"external",href:e}}catch(t){}const d={from:t,to:e,search:r,params:o,hash:s,replace:a,state:l},p=this.buildNext(d);c=c??this.options.defaultPreload;const f=h??this.options.defaultPreloadDelay??0,m=this.state.location.pathname.split("/"),y=p.pathname.split("/").every(((t,e)=>t===m[e])),g=i?.exact?this.state.location.pathname===p.pathname:y,v=!i?.includeHash||this.state.location.hash===p.hash,w=!(i?.includeSearch??1)||_(this.state.location.search,p.search);return{type:"internal",next:p,handleFocus:t=>{c&&this.preloadRoute(d).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(d))},handleEnter:t=>{const e=t.target||{};if(c){if(e.preloadTimeout)return;e.preloadTimeout=setTimeout((()=>{e.preloadTimeout=null,this.preloadRoute(d).catch((t=>{console.warn(t),console.warn("Error preloading route! ☝️")}))}),f)}},handleLeave:t=>{const e=t.target||{};e.preloadTimeout&&(clearTimeout(e.preloadTimeout),e.preloadTimeout=null)},handleTouchStart:t=>{this.preloadRoute(d).catch((t=>{console.warn(t),console.warn("Error preloading route! ☝️")}))},isActive:g&&v&&w,disabled:u}};dehydrate=()=>({state:R(this.state,["location","status","lastUpdated"])});hydrate=async t=>{let e=t;"undefined"!=typeof document&&(e=window.__TSR_DEHYDRATED__),h(e);const r=e;this.dehydratedData=r.payload,this.options.hydrate?.(r.payload);const o=r.router.state;this.__store.setState((t=>({...t,...o,resolvedLocation:o.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}`]}};#s=t=>{this.routeTree=t,this.routesById={},this.routesByPath={},this.flatRoutes=[];const e=t=>{t.forEach(((t,r)=>{t.init({originalIndex:r,router:this});if(h(!this.routesById[t.id],String(t.id)),this.routesById[t.id]=t,!t.isRoot&&t.path){const e=L(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=O(t.fullPath),o=j(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)))};#o=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:E(t?.search,n),hash:o.split("#").reverse()[0]??"",href:`${e}${r}${o}`,state:s,key:s?.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=A(this.basepath??"/",e,`${t.to??""}`);const o={...b(this.matchRoutes(this.state.location.pathname,this.state.location.search))?.params};let s=!0===(t.params??!0)?o:S(t.params,o);s&&t.__matches?.map((t=>this.getRoute(t.routeId).options.stringifyParams)).filter(Boolean).forEach((t=>{s={...s,...t(s)}})),r=k(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?S(t.search,i)??{}:n?.length?i:{},h=a?.length?a.reduce(((t,e)=>e(t)),c):c,u=E(this.state.location.search,h),l=this.options.stringifySearch(u),d=!0===t.hash?this.state.location.hash:S(t.hash,this.state.location.hash),p=d?`#${d}`:"";return{pathname:r,search:u,searchStr:l,state:!0===t.state?this.state.location.state:S(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.matchesById[t];setRouteMatch=(t,e)=>{this.__store.setState((r=>(r.matchesById[t]||console.warn(`No match found with id: ${t}`),{...r,matchesById:{...r.matchesById,[t]:e(r.matchesById[t])}})))};setRouteMatchData=(t,e,r)=>{const o=this.getRouteMatch(t);if(!o)return;const s=this.getRoute(o.routeId),n=r?.updatedAt??Date.now(),a=n+(r?.maxAge??s.options.preloadMaxAge??this.options.defaultPreloadMaxAge??5e3),i=n+(r?.maxAge??s.options.maxAge??this.options.defaultMaxAge??1/0);this.setRouteMatch(t,(t=>({...t,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),loaderData:S(e,t.loaderData),preloadInvalidAt:a,invalidAt:i}))),this.state.matches.find((e=>e.id===t))};invalidate=async t=>{if(t?.matchId){this.setRouteMatch(t.matchId,(t=>({...t,invalid:!0})));const e=this.state.matches.findIndex((e=>e.id===t.matchId)),r=this.state.matches[e+1];if(r)return this.invalidate({matchId:r.id,reload:!1})}else this.__store.batch((()=>{Object.values(this.state.matchesById).forEach((t=>{this.setRouteMatch(t.id,(t=>({...t,invalid:!0})))}))}));if(t?.reload??1)return this.reload()};getIsInvalid=t=>{if(!t?.matchId)return!!this.state.matches.find((e=>this.getIsInvalid({matchId:e.id,preload:t?.preload})));const e=this.getRouteMatch(t?.matchId);if(!e)return!1;const r=Date.now();return e.invalid||(t?.preload?e.preloadInvalidAt:e.invalidAt)<r}},t.RouterContext=class{constructor(){}createRootRoute=t=>new U(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(it.Provider,{value:t},s.createElement(ht,null))))},t.ScrollRestoration=function(){const t=ut(),e=t=>t.key,r=s.useRef(!1);return Z((()=>{const{history:o}=window;o.scrollRestoration&&(o.scrollRestoration="manual");const s=r=>{const o=e(t.state.resolvedLocation);rt[o]||(rt[o]=new WeakSet);const s=rt[o];if(s.has(r.target))return;s.add(r.target);const a=[o,r.target===document||r.target===window?tt:n(r.target)].join(et);ot.current[a]||ot.set(a,{scrollX:NaN,scrollY:NaN})},n=t=>{let e,r=[];for(;e=t.parentNode;)r.unshift(`${t.tagName}:nth-child(${[].indexOf.call(e.children,t)+1})`),t=e;return`${r.join(" > ")}`.toLowerCase()};"undefined"!=typeof document&&document.addEventListener("scroll",s,!0);const a=t.subscribe("onBeforeLoad",(t=>{t.pathChanged&&(t=>{const r=e(t);for(const t in ot.current){const e=ot.current[t],[o,s]=t.split(et);if(r===o){if(s===tt)e.scrollX=window.scrollX||0,e.scrollY=window.scrollY||0;else if(s){const t=document.querySelector(s);e.scrollX=t?.scrollLeft||0,e.scrollY=t?.scrollTop||0}ot.set(t,e)}}})(t.from)})),i=t.subscribe("onLoad",(t=>{t.pathChanged&&(r.current=!0)}));return()=>{document.removeEventListener("scroll",s),a(),i()}}),[]),Z((()=>{r.current&&(r.current=!1,(()=>{const r=e(t.state.location);let o=!1;for(const t in ot.current){const e=ot.current[t],[s,n]=t.split(et);if(s===r)if(n===tt)o=!0,window.scrollTo(e.scrollX,e.scrollY);else if(n){const t=document.querySelector(n);t&&(t.scrollLeft=e.scrollX,t.scrollTop=e.scrollY)}}o||window.scrollTo(0,0)})())})),null},t.SearchParamError=G,t.cleanPath=C,t.componentTypes=q,t.createBrowserHistory=y,t.createHashHistory=function(){return y({getHref:()=>window.location.hash.substring(1),createHref:t=>`#${t}`})},t.createMemoryHistory=g,t.decode=H,t.defaultParseSearch=z,t.defaultStringifySearch=W,t.encode=T,t.functionalUpdate=S,t.interpolatePath=k,t.invariant=h,t.isPlainObject=x,t.isRedirect=V,t.joinPaths=P,t.last=b,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=B,t.matchIdsContext=at,t.matchPathname=D,t.parsePathname=j,t.parseSearchWith=Y,t.partialDeepEqual=_,t.pick=R,t.redirect=function(t){return t.isRedirect=!0,t},t.replaceEqualDeep=E,t.resolvePath=A,t.rootRouteId=N,t.routerContext=it,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=J,t.trimPath=O,t.trimPathLeft=M,t.trimPathRight=L,t.useBlocker=xt,t.useDehydrate=function(){const t=ut();return s.useCallback((function(e,r){return t.dehydrateData(e,r)}),[])},t.useHydrate=function(){const t=ut();return function(e){return t.hydrateData(e)}},t.useInjectHtml=function(){const t=ut();return s.useCallback((e=>{t.injectHtml(e)}),[])},t.useLinkProps=st,t.useLoader=dt,t.useMatch=lt,t.useMatchRoute=mt,t.useMatches=function(t){const e=s.useContext(at);return ct({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=ut();return s.useCallback((r=>e.navigate({...t,...r})),[])},t.useParams=ft,t.useRouteContext=function(t){return lt({...t,select:e=>t?.select?.(e.routeContext)??e.routeContext})},t.useRouter=ut,t.useRouterContext=function(t){return lt({...t,select:e=>t?.select?.(e.context)??e.context})},t.useRouterState=ct,t.useSearch=pt,t.useStore=i,t.warning=function(t,e){},Object.defineProperty(t,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=index.production.js.map |
{ | ||
"name": "@tanstack/react-router", | ||
"author": "Tanner Linsley", | ||
"version": "0.0.1-beta.162", | ||
"version": "0.0.1-beta.163", | ||
"license": "MIT", | ||
@@ -46,4 +46,4 @@ "repository": "tanstack/router", | ||
"@gisatcz/cross-package-react-context": "^0.2.0", | ||
"@tanstack/router-core": "0.0.1-beta.162", | ||
"@tanstack/react-store": "0.0.1-beta.162" | ||
"@tanstack/router-core": "0.0.1-beta.163", | ||
"@tanstack/react-store": "0.0.1-beta.163" | ||
}, | ||
@@ -50,0 +50,0 @@ "scripts": { |
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 not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
826994
19
5923
+ Added@tanstack/react-store@0.0.1-beta.163(transitive)
+ Added@tanstack/router-core@0.0.1-beta.163(transitive)
+ Added@tanstack/store@0.0.1-beta.163(transitive)
- Removed@tanstack/react-store@0.0.1-beta.162(transitive)
- Removed@tanstack/router-core@0.0.1-beta.162(transitive)
- Removed@tanstack/store@0.0.1-beta.162(transitive)