@tanstack/react-router 1.1.7 → 1.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,5 +18,5 @@
18
18
  * LICENSE.md file in the root directory of this source tree.
19
19
  *
20
20
  * @license MIT
21
- */const s="pushstate",a="popstate",i="beforeunload",c=t=>(t.preventDefault(),t.returnValue=""),l=()=>{removeEventListener(i,c,{capture:!0})};function u(t){let e=t.getLocation(),o=new Set,n=[];const r=()=>{e=t.getLocation(),o.forEach((t=>t()))},s=async e=>{if("undefined"!=typeof document&&n.length)for(let e of n){if(!await e())return void t.onBlocked?.(r)}e()};return{get location(){return e},subscribe:t=>(o.add(t),()=>{o.delete(t)}),push:(e,o)=>{o=h(o),s((()=>{t.pushState(e,o),r()}))},replace:(e,o)=>{o=h(o),s((()=>{t.replaceState(e,o),r()}))},go:e=>{s((()=>{t.go(e)}))},back:()=>{s((()=>{t.back()}))},forward:()=>{s((()=>{t.forward()}))},createHref:e=>t.createHref(e),block:t=>(n.push(t),1===n.length&&addEventListener(i,c,{capture:!0}),()=>{n=n.filter((e=>e!==t)),n.length||l()}),flush:()=>t.flush?.(),destroy:()=>t.destroy?.(),notify:r}}function h(t){return t||(t={}),{...t,key:m()}}function d(t){const e=t?.window??("undefined"!=typeof document?window:void 0),o=t?.createHref??(t=>t),n=t?.parseLocation??(()=>p(`${e.location.pathname}${e.location.search}${e.location.hash}`,e.history.state));let r,i=n();let c,l,h=!0;const d=()=>{h=!1,(()=>{c&&(e.history[c.isPush?"pushState":"replaceState"](c.state,"",c.href),c=void 0,l=void 0,r=void 0)})(),h=!0},f=(t,e,n)=>{const s=o(e);l||(r=i),i=p(e,n),c={href:s,state:n,isPush:c?.isPush||"push"===t},l||(l=Promise.resolve().then((()=>d())))},m=()=>{i=n(),v.notify()};var y=e.history.pushState,g=e.history.replaceState;const v=u({getLocation:()=>i,pushState:(t,e)=>f("push",t,e),replaceState:(t,e)=>f("replace",t,e),back:()=>e.history.back(),forward:()=>e.history.forward(),go:t=>e.history.go(t),createHref:t=>o(t),flush:d,destroy:()=>{e.history.pushState=y,e.history.replaceState=g,e.removeEventListener(s,m),e.removeEventListener(a,m)},onBlocked:t=>{r&&i!==r&&(i=r,t())}});return e.addEventListener(s,m),e.addEventListener(a,m),e.history.pushState=function(){let t=y.apply(e.history,arguments);return h&&v.notify(),t},e.history.replaceState=function(){let t=g.apply(e.history,arguments);return h&&v.notify(),t},v}function f(t={initialEntries:["/"]}){const e=t.initialEntries;let o=t.initialIndex??e.length-1,n={key:m()};return u({getLocation:()=>p(e[o],n),pushState:(t,r)=>{n=r,e.push(t),o++},replaceState:(t,r)=>{n=r,e[o]=t},back:()=>{o--},forward:()=>{o=Math.min(o+1,e.length-1)},go:t=>{o=Math.min(Math.max(o+t,0),e.length-1)},createHref:t=>t})}function p(t,e){let o=t.indexOf("#"),n=t.indexOf("?");return{href:t,pathname:t.substring(0,o>0?n>0?Math.min(o,n):o:n>0?n:t.length),hash:o>-1?t.substring(o):"",search:n>-1?t.slice(n,-1===o?void 0:o):"",state:e||{}}}function m(){return(Math.random()+1).toString(36).substring(7)}var y="Invariant failed";function g(t,e){if(!t)throw new Error(y)}var v,w={exports:{}},_={};w.exports=function(){if(v)return _;v=1;var t=e,n=o,r="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},s=n.useSyncExternalStore,a=t.useRef,i=t.useEffect,c=t.useMemo,l=t.useDebugValue;return _.useSyncExternalStoreWithSelector=function(t,e,o,n,u){var h=a(null);if(null===h.current){var d={hasValue:!1,value:null};h.current=d}else d=h.current;h=c((function(){function t(t){if(!i){if(i=!0,s=t,t=n(t),void 0!==u&&d.hasValue){var e=d.value;if(u(e,t))return a=e}return a=t}if(e=a,r(s,t))return e;var o=n(t);return void 0!==u&&u(e,o)?e:(s=t,a=o)}var s,a,i=!1,c=void 0===o?null:o;return[function(){return t(e())},null===c?void 0:function(){return t(c())}]}),[e,o,n,u]);var f=s(t,h[0],h[1]);return i((function(){d.hasValue=!0,d.value=f}),[f]),l(f),f},_}();var b=w.exports,S=class{constructor(t,e){this.listeners=new Set,this._batching=!1,this._flushing=0,this._nextPriority=null,this.subscribe=t=>{this.listeners.add(t);const e=this.options?.onSubscribe?.(t,this);return()=>{this.listeners.delete(t),e?.()}},this.setState=(t,e)=>{const o=this.state;this.state=this.options?.updateFn?this.options.updateFn(o)(t):t(o);const n=e?.priority??this.options?.defaultPriority??"high";null===this._nextPriority||"high"===this._nextPriority?this._nextPriority=n:this._nextPriority=this.options?.defaultPriority??"high",this.options?.onUpdate?.({priority:this._nextPriority}),this._flush()},this._flush=()=>{if(this._batching)return;const t=++this._flushing;this.listeners.forEach((e=>{this._flushing===t&&e({priority:this._nextPriority??"high"})}))},this.batch=t=>{if(this._batching)return t();this._batching=!0,t(),this._batching=!1,this._flush()},this.state=t,this.options=e}};function R(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!1;for(let n=0;n<o.length;n++)if(!Object.prototype.hasOwnProperty.call(e,o[n])||!Object.is(t[o[n]],e[o[n]]))return!1;return!0}function E(t){const e=t.errorComponent??P;return r.createElement(L,{getResetKey:t.getResetKey,onCatch:t.onCatch,children:({error:o})=>o?r.createElement(e,{error:o}):t.children})}class L extends r.Component{state={error:null};static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}componentDidUpdate(t,e){e.error&&e.resetKey!==this.state.resetKey&&this.setState({error:null})}componentDidCatch(t){console.error(t),this.props.onCatch?.(t)}render(){return this.props.children(this.state)}}function P({error:t}){const[e,o]=r.useState(!1);return r.createElement("div",{style:{padding:".5rem",maxWidth:"100%"}},r.createElement("div",{style:{display:"flex",alignItems:"center",gap:".5rem"}},r.createElement("strong",{style:{fontSize:"1rem"}},"Something went wrong!"),r.createElement("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>o((t=>!t))},e?"Hide Error":"Show Error")),r.createElement("div",{style:{height:".25rem"}}),e?r.createElement("div",null,r.createElement("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"}},t.message?r.createElement("code",null,t.message):null)):null)}const x="undefined"==typeof document;function C(t){return t[t.length-1]}function T(t,e){return"function"==typeof t?t(e):t}function M(t,e){return e.reduce(((e,o)=>(e[o]=t[o],e)),{})}function O(t,e){if(t===e)return t;const o=e,n=Array.isArray(t)&&Array.isArray(o);if(n||k(t)&&k(o)){const e=n?t.length:Object.keys(t).length,r=n?o:Object.keys(o),s=r.length,a=n?[]:{};let i=0;for(let e=0;e<s;e++){const s=n?e:r[e];a[s]=O(t[s],o[s]),a[s]===t[s]&&i++}return e===s&&i===e?t:a}return o}function k(t){if(!I(t))return!1;const e=t.constructor;if(void 0===e)return!0;const o=e.prototype;return!!I(o)&&!!o.hasOwnProperty("isPrototypeOf")}function I(t){return"[object Object]"===Object.prototype.toString.call(t)}function D(t,e,o=!1){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(k(t)&&k(e)){const n=Object.keys(t),r=Object.keys(e);return!(!o&&n.length!==r.length)&&!r.some((n=>!(n in t)||!D(t[n],e[n],o)))}return!(!Array.isArray(t)||!Array.isArray(e))&&!t.some(((t,n)=>!D(t,e[n],o)))}const j="undefined"!=typeof window?r.useLayoutEffect:r.useEffect;function $(t){return t.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/"/g,'\\"')}const B=r.createContext(void 0);function A(){const t=Z(),e=Q({select:t=>U(t)[0]?.id});return r.createElement(B.Provider,{value:e},r.createElement(E,{getResetKey:()=>t.state.resolvedLocation.state?.key,errorComponent:P,onCatch:()=>{}},e?r.createElement(H,{matchId:e}):null))}function N(t){return r.createElement(r.Fragment,null,t.children)}function H({matchId:t}){const e=Z(),o=Q({select:e=>U(e).find((e=>e.id===t))?.routeId});g(o);const n=e.routesById[o],s=n.options.pendingComponent??e.options.defaultPendingComponent,a=s?r.createElement(s,null):null,i=n.options.errorComponent??e.options.defaultErrorComponent??P,c=n.options.wrapInSuspense??s??n.options.component?.preload??n.options.pendingComponent?.preload??n.options.errorComponent?.preload?r.Suspense:N,l=i?E:N;return r.createElement(B.Provider,{value:t},r.createElement(c,{fallback:a},r.createElement(l,{getResetKey:()=>e.state.resolvedLocation.state?.key,errorComponent:i,onCatch:()=>{}},r.createElement(F,{matchId:t,pendingElement:a}))))}function F({matchId:t,pendingElement:e}){const o=Z(),n=Q({select:e=>U(e).find((e=>e.id===t))?.routeId}),s=o.routesById[n],a=Q({select:e=>M(U(e).find((e=>e.id===t)),["status","error","showPending","loadPromise"])});if("error"===a.status)throw a.error;if("pending"===a.status){if(a.showPending)return e;throw a.loadPromise}if("success"===a.status){let t=s.options.component??o.options.defaultComponent;return t?r.createElement(t,null):r.createElement(K,null)}g(!1)}const K=r.memo((function(){const t=r.useContext(B),e=Q({select:e=>{const o=U(e),n=o.findIndex((e=>e.id===t));return o[n+1]?.id}});return e?r.createElement(H,{matchId:e}):null}));function W(){Q({select:t=>[t.location,t.resolvedLocation]});const{matchRoute:t}=Z();return r.useCallback((e=>{const{pending:o,caseSensitive:n,...r}=e;return t(r,{pending:o,caseSensitive:n})}),[])}function U(t){return t.pendingMatches?.some((t=>t.showPending))?t.pendingMatches:t.matches}function z(t){const e=Z(),o=r.useContext(B),n=U(e.state).find((t=>t.id===o))?.routeId,s=(()=>{const n=U(e.state);return(t?.from?n.find((e=>e.routeId===t?.from)):n.find((t=>t.id===o))).routeId})();(t?.strict??1)&&g(n==s);return Q({select:e=>{const n=U(e).find((t=>t.id===o));return g(n,t?.from&&t.from),t?.select?t.select(n):n}})}function Y(t){return Q({select:e=>{let o=U(e);return t?.select?t.select(o):o}})}function J(t){return z({...t,select:e=>"function"==typeof t.select?t.select(e?.loaderDeps):e?.loaderDeps})}function X(t){return z({...t,select:e=>"function"==typeof t.select?t.select(e?.loaderData):e?.loaderData})}const q=r.useTransition||(()=>[!1,t=>{t()}]);function V(){const t=r.useRef(0),e=Z(),o=Q({select:t=>M(t,["isLoading","location","resolvedLocation","isTransitioning"])}),[n,s]=q();e.startReactTransition=s,r.useEffect((()=>{n&&e.__store.setState((t=>({...t,isTransitioning:n})))}),[n]);const a=()=>{var t;t=()=>{try{e.load()}catch(t){console.error(t)}},o.isTransitioning?t():s((()=>t()))};return j((()=>{const t=e.history.subscribe((()=>{e.latestLocation=e.parseLocation(e.latestLocation),o.location!==e.latestLocation&&a()})),n=e.buildLocation({search:!0,params:!0,hash:!0,state:!0});return o.location.href!==n.href&&e.commitLocation({...n,replace:!0}),()=>{t()}}),[e.history]),j((()=>{if(r.useTransition?o.isTransitioning&&!n:!o.isLoading&&o.resolvedLocation!==o.location){if(e.emit({type:"onResolved",fromLocation:o.resolvedLocation,toLocation:o.location,pathChanged:o.location.href!==o.resolvedLocation?.href}),document.querySelector&&""!==o.location.hash){const t=document.getElementById(o.location.hash);t&&t.scrollIntoView()}e.__store.setState((t=>({...t,isTransitioning:!1,resolvedLocation:t.location})))}}),[o.isTransitioning,n,o.isLoading,o.resolvedLocation,o.location]),j((()=>{window.__TSR_DEHYDRATED__||t.current||(t.current++,a())}),[]),null}function G(t,e){return[...t.cachedMatches,...t.pendingMatches??[],...t.matches].find((t=>t.id===e))}function Q(t){return function(t,e=(t=>t)){return b.useSyncExternalStoreWithSelector(t.subscribe,(()=>t.state),(()=>t.state),e,R)}(Z().__store,t?.select)}function Z(){const e="undefined"!=typeof document&&window.__TSR_ROUTER_CONTEXT__||t.routerContext;return r.useContext(e)}function tt(t){return"object"==typeof t&&null!==t&&!(t instanceof Promise)&&!t.then&&"__deferredState"in t}function et({promise:t}){const e=Z();let o=t.__deferredState;const n=`__TSR__DEFERRED__${o.uid}`;if(tt(t)&&(o=e.hydrateData(n),(t=Promise.resolve(o.data)).__deferredState=o),"pending"===o.status)throw new Promise((t=>setTimeout(t,1))).then((()=>t));if("error"===o.status)throw o.error;return e.dehydrateData(n,o),[o.data]}function ot(t){return nt(t.filter(Boolean).join("/"))}function nt(t){return t.replace(/\/{2,}/g,"/")}function rt(t){return"/"===t?t:t.replace(/^\/{1,}/,"")}function st(t){return"/"===t?t:t.replace(/\/{1,}$/,"")}function at(t){return st(rt(t))}function it(t,e,o){e=e.replace(new RegExp(`^${t}`),"/"),o=o.replace(new RegExp(`^${t}`),"/");let n=ct(e);const r=ct(o);r.forEach(((t,e)=>{if("/"===t.value)e?e===r.length-1&&n.push(t):n=[t];else if(".."===t.value)n.length>1&&"/"===C(n)?.value&&n.pop(),n.pop();else{if("."===t.value)return;n.push(t)}}));return nt(ot([t,...n.map((t=>t.value))]))}function ct(t){if(!t)return[];const e=[];if("/"===(t=nt(t)).slice(0,1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),!t)return e;const o=t.split("/").filter(Boolean);return e.push(...o.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 lt(t,e,o=!1){return ot(ct(t).map((t=>{if("wildcard"===t.type){const n=e[t.value];return o?`${t.value}${n??""}`:n}return"param"===t.type?e[t.value.substring(1)]??"undefined":t.value})))}function ut(t,e,o){const n=dt(t,e,o);if(!o.to||n)return n??{}}function ht(t,e){return"/"!=t?e.substring(t.length):e}function dt(t,e,o){e=ht(t,e);const n=`${o.to??"$"}`,r=ct(e),s=ct(n);e.startsWith("/")||r.unshift({type:"pathname",value:"/"}),n.startsWith("/")||s.unshift({type:"pathname",value:"/"});const a={};return(()=>{for(let t=0;t<Math.max(r.length,s.length);t++){const e=r[t],n=s[t],i=t>=r.length-1,c=t>=s.length-1;if(n){if("wildcard"===n.type)return!!e?.value&&(a["*"]=ot(r.slice(t).map((t=>t.value))),!0);if("pathname"===n.type){if("/"===n.value&&!e?.value)return!0;if(e)if(o.caseSensitive){if(n.value!==e.value)return!1}else if(n.value.toLowerCase()!==e.value.toLowerCase())return!1}if(!e)return!1;if("param"===n.type){if("/"===e?.value)return!1;"$"!==e.value.charAt(0)&&(a[n.value.substring(1)]=e.value)}}if(!i&&c)return a["**"]=ot(r.slice(t+1).map((t=>t.value))),!!o.fuzzy&&"/"!==n?.value}return!0})()?a:void 0}function ft(t){return Q({select:e=>{const o=C(U(e))?.params;return t?.select?t.select(o):o}})}function pt(t){return z({...t,select:e=>t?.select?t.select(e.search):e.search})}t.routerContext=r.createContext(null),"undefined"!=typeof document&&(window.__TSR_ROUTER_CONTEXT__?t.routerContext=window.__TSR_ROUTER_CONTEXT__:window.__TSR_ROUTER_CONTEXT__=t.routerContext);const mt="__root__";class yt{constructor(t){this.options=t||{},this.isRoot=!t?.getParentRoute,g(!(t?.id&&t?.path)),this.$$typeof=Symbol.for("react.memo")}init=t=>{this.originalIndex=t.originalIndex;const e=this.options,o=!e?.path&&!e?.id;this.parentRoute=this.options?.getParentRoute?.(),o?this.path=mt:g(this.parentRoute);let n=o?mt:e.path;n&&"/"!==n&&(n=at(n));const r=e?.id||n;let s=o?mt:ot([this.parentRoute.id===mt?"":this.parentRoute.id,r]);n===mt&&(n="/"),s!==mt&&(s=ot(["/",s]));const a=s===mt?"/":ot([this.parentRoute.fullPath,n]);this.path=n,this.id=s,this.fullPath=a,this.to=a};addChildren=t=>(this.children=t,this);updateLoader=t=>(Object.assign(this.options,t),this);update=t=>(Object.assign(this.options,t),this);useMatch=t=>z({...t,from:this.id});useRouteContext=t=>z({...t,from:this.id,select:e=>t?.select?t.select(e.context):e.context});useSearch=t=>pt({...t,from:this.id});useParams=t=>ft({...t,from:this.id});useLoaderDeps=t=>J({...t,from:this.id});useLoaderData=t=>X({...t,from:this.id})}class gt extends yt{constructor(t){super(t)}}function vt(){return vt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},vt.apply(this,arguments)}const wt="Error preloading route! ☝️";function _t(t){const e=Z(),o=z({strict:!1,select:t=>t.pathname}),{children:n,target:r,activeProps:s=(()=>({className:"active"})),inactiveProps:a=(()=>({})),activeOptions:i,disabled:c,hash:l,search:u,params:h,to:d,state:f,mask:p,preload:m,preloadDelay:y,replace:g,startTransition:v,resetScroll:w,style:_,className:b,onClick:S,onFocus:R,onMouseEnter:E,onMouseLeave:L,onTouchStart:P,...x}=t,C={from:t.to?o:void 0,...t};let M="internal";try{new URL(`${d}`),M="external"}catch{}if("external"===M)return{href:d};const O=e.buildLocation(C),k=m??e.options.defaultPreload,I=y??e.options.defaultPreloadDelay??0,j=Q({select:t=>{const e=t.location.pathname.split("/"),o=O.pathname.split("/").every(((t,o)=>t===e[o])),n=i?.exact?t.location.pathname===O.pathname:o,r=!i?.includeHash||t.location.hash===O.hash,s=!(i?.includeSearch??1)||D(t.location.search,O.search,!i?.exact);return n&&r&&s}}),$=t=>e=>{e.persist&&e.persist(),t.filter(Boolean).forEach((t=>{e.defaultPrevented||t(e)}))},B=j?T(s,{})??{}:{},A=j?{}:T(a,{})??{};return{...B,...A,...x,href:c?void 0:O.maskedLocation?O.maskedLocation.href:O.href,onClick:$([S,t=>{c||function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}(t)||t.defaultPrevented||r&&"_self"!==r||0!==t.button||(t.preventDefault(),e.commitLocation({...O,replace:g,resetScroll:w,startTransition:v}))}]),onFocus:$([R,t=>{k&&e.preloadRoute(C).catch((t=>{console.warn(t),console.warn(wt)}))}]),onMouseEnter:$([E,t=>{const o=t.target||{};if(k){if(o.preloadTimeout)return;o.preloadTimeout=setTimeout((()=>{o.preloadTimeout=null,e.preloadRoute(C).catch((t=>{console.warn(t),console.warn(wt)}))}),I)}}]),onMouseLeave:$([L,t=>{const e=t.target||{};e.preloadTimeout&&(clearTimeout(e.preloadTimeout),e.preloadTimeout=null)}]),onTouchStart:$([P,t=>{k&&e.preloadRoute(C).catch((t=>{console.warn(t),console.warn(wt)}))}]),target:r,style:{..._,...B.style,...A.style},className:[b,B.className,A.className].filter(Boolean).join(" ")||void 0,...c?{role:"link","aria-disabled":!0}:void 0,"data-status":j?"active":void 0}}const bt=r.forwardRef(((t,e)=>{const o=_t(t);return r.createElement("a",vt({ref:e},o,{children:"function"==typeof t.children?t.children({isActive:"active"===o["data-status"]}):t.children}))}));function St(t,e){var o,n,r,s="";for(o in t)if(void 0!==(r=t[o]))if(Array.isArray(r))for(n=0;n<r.length;n++)s&&(s+="&"),s+=encodeURIComponent(o)+"="+encodeURIComponent(r[n]);else s&&(s+="&"),s+=encodeURIComponent(o)+"="+encodeURIComponent(r);return(e||"")+s}function Rt(t){if(!t)return"";var e=decodeURIComponent(t);return"false"!==e&&("true"===e||(0*+e==0&&+e+""===e?+e:e))}function Et(t){for(var e,o,n={},r=t.split("&");e=r.shift();)void 0!==n[o=(e=e.split("=")).shift()]?n[o]=[].concat(n[o],Rt(e.shift())):n[o]=Rt(e.shift());return n}function Lt(t){return!!t?.isRedirect}const Pt=Ct(JSON.parse),xt=Tt(JSON.stringify,JSON.parse);function Ct(t){return e=>{"?"===e.substring(0,1)&&(e=e.substring(1));let o=Et(e);for(let e in o){const n=o[e];if("string"==typeof n)try{o[e]=t(n)}catch(t){}}return o}}function Tt(t,e){return o=>{(o={...o})&&Object.keys(o).forEach((n=>{const r=o[n];void 0===r||void 0===r?delete o[n]:o[n]=function(o){if("object"==typeof o&&null!==o)try{return t(o)}catch(t){}else if("string"==typeof o&&"function"==typeof e)try{return e(o),t(o)}catch(t){}return o}(r)}));const n=St(o).toString();return n?`?${n}`:""}}const Mt=["component","errorComponent","pendingComponent"];class Ot extends Error{}class kt extends Error{}function It(t){return{isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:{...t},location:t,matches:[],pendingMatches:[],cachedMatches:[],lastUpdated:Date.now()}}const Dt="undefined"!=typeof window?r.useLayoutEffect:r.useEffect,jt="window",$t="___";let Bt=new WeakSet;let At="undefined"!=typeof window&&window.sessionStorage?(()=>{const t="tsr-scroll-restoration-v2";return{state:JSON.parse(window.sessionStorage.getItem(t)||"null")||{cached:{},next:{}},set:e=>{At.state=T(e,At.state),window.sessionStorage.setItem(t,JSON.stringify(At.state))}}})():void 0;const Nt=t=>t.state.key;function Ht(t){const e=Z();Dt((()=>{const o=t?.getKey||Nt,{history:n}=window;n.scrollRestoration&&(n.scrollRestoration="manual");const r=t=>{if(Bt.has(t.target))return;Bt.add(t.target);let e="";if(t.target===document||t.target===window)e=jt;else{const o=t.target.getAttribute("data-scroll-restoration-id");e=o?`[data-scroll-restoration-id="${o}"]`:Ft(t.target)}At.state.next[e]||At.set((t=>({...t,next:{...t.next,[e]:{scrollX:NaN,scrollY:NaN}}})))};"undefined"!=typeof document&&document.addEventListener("scroll",r,!0);const s=e.subscribe("onBeforeLoad",(t=>{if(t.pathChanged){const e=o(t.fromLocation);for(const t in At.state.next){const o=At.state.next[t];if(t===jt)o.scrollX=window.scrollX||0,o.scrollY=window.scrollY||0;else if(t){const e=document.querySelector(t);o.scrollX=e?.scrollLeft||0,o.scrollY=e?.scrollTop||0}At.set((n=>{const r={...n.next};return delete r[t],{...n,next:r,cached:{...n.cached,[[e,t].join($t)]:o}}}))}}})),a=e.subscribe("onResolved",(o=>{if(o.pathChanged){if(!e.resetNextScroll)return;e.resetNextScroll=!0;const n=(t?.getKey||Nt)(o.toLocation);let r=!1;for(const t in At.state.cached){const e=At.state.cached[t],[o,s]=t.split($t);if(o===n)if(s===jt)r=!0,window.scrollTo(e.scrollX,e.scrollY);else if(s){const t=document.querySelector(s);t&&(t.scrollLeft=e.scrollX,t.scrollTop=e.scrollY)}}r||window.scrollTo(0,0),At.set((t=>({...t,next:{}}))),Bt=new WeakSet}}));return()=>{document.removeEventListener("scroll",r),s(),a()}}),[])}function Ft(t){let e,o=[];for(;e=t.parentNode;)o.unshift(`${t.tagName}:nth-child(${[].indexOf.call(e.children,t)+1})`),t=e;return`${o.join(" > ")}`.toLowerCase()}function Kt(t,e=!0){const{history:o}=Z();r.useEffect((()=>{if(e)return o.block(t)}))}t.Await=function(t){const e=et(t);return t.children(...e)},t.Block=function({blocker:t,condition:e,children:o}){return Kt(t,e),o??null},t.CatchBoundary=E,t.CatchBoundaryImpl=L,t.ErrorComponent=P,t.FileRoute=class{constructor(t){this.path=t}createRoute=t=>{const e=new yt(t);return e.isRoot=!1,e}},t.FileRouteLoader=function(t){return t=>t},t.Link=bt,t.Match=H,t.MatchRoute=function(t){const e=W()(t);return"function"==typeof t.children?t.children(e):e?t.children:null},t.Matches=A,t.Navigate=function(t){const{navigate:e}=Z(),o=z({strict:!1});return r.useEffect((()=>{e({from:t.to?o.pathname:void 0,...t})}),[]),null},t.NotFoundRoute=class extends yt{constructor(t){super({...t,id:"404"})}},t.Outlet=K,t.PathParamError=kt,t.RootRoute=gt,t.Route=yt,t.RouteApi=class{constructor({id:t}){this.id=t}useMatch=t=>z({...t,from:this.id});useRouteContext=t=>z({...t,from:this.id,select:e=>t?.select?t.select(e.context):e.context});useSearch=t=>pt({...t,from:this.id});useParams=t=>ft({...t,from:this.id});useLoaderDeps=t=>J({...t,from:this.id});useLoaderData=t=>X({...t,from:this.id})},t.Router=class{tempLocationKey=`${Math.round(1e7*Math.random())}`;resetNextScroll=!0;navigateTimeout=null;latestLoadPromise=Promise.resolve();subscribers=new Set;injectedHtml=[];constructor(t){this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,stringifySearch:t?.stringifySearch??xt,parseSearch:t?.parseSearch??Pt})}startReactTransition=t=>t();update=t=>{this.options={...this.options,...t},this.basepath=`/${at(t.basepath??"")??""}`,(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history??("undefined"!=typeof document?d():f()),this.latestLocation=this.parseLocation()),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),this.__store||(this.__store=new S(It(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,status:this.state.isTransitioning||this.state.isLoading?"pending":"idle"}}}))};get state(){return this.__store.state}buildRouteTree=()=>{this.routesById={},this.routesByPath={};const t=this.options.notFoundRoute;t&&(t.init({originalIndex:99999999999}),this.routesById[t.id]=t);const e=t=>{t.forEach(((t,o)=>{t.init({originalIndex:o});if(g(!this.routesById[t.id],String(t.id)),this.routesById[t.id]=t,!t.isRoot&&t.path){const e=st(t.fullPath);this.routesByPath[e]&&!t.fullPath.endsWith("/")||(this.routesByPath[e]=t)}const n=t.children;n?.length&&e(n)}))};e([this.routeTree]);const o=[];Object.values(this.routesById).forEach(((t,e)=>{if(t.isRoot||!t.path)return;const n=rt(t.fullPath),r=ct(n);for(;r.length>1&&"/"===r[0]?.value;)r.shift();const s=r.map((t=>"/"===t.value?.75:"param"===t.type?.5:"wildcard"===t.type?.25:1));o.push({child:t,trimmed:n,parsed:r,index:e,scores:s})})),this.flatRoutes=o.sort(((t,e)=>{const o=Math.min(t.scores.length,e.scores.length);for(let n=0;n<o;n++)if(t.scores[n]!==e.scores[n])return e.scores[n]-t.scores[n];if(t.scores.length!==e.scores.length)return e.scores.length-t.scores.length;for(let n=0;n<o;n++)if(t.parsed[n].value!==e.parsed[n].value)return t.parsed[n].value>e.parsed[n].value?1:-1;return t.index-e.index})).map(((t,e)=>(t.child.rank=e,t.child)))};subscribe=(t,e)=>{const o={eventType:t,fn:e};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}};emit=t=>{this.subscribers.forEach((e=>{e.eventType===t.type&&e.fn(t)}))};checkLatest=t=>this.latestLoadPromise!==t?this.latestLoadPromise:void 0;parseLocation=t=>{const e=({pathname:e,search:o,hash:n,state:r})=>{const s=this.options.parseSearch(o);return{pathname:e,searchStr:o,search:O(t?.search,s),hash:n.split("#").reverse()[0]??"",href:`${e}${o}${n}`,state:O(t?.state,r)}},o=e(this.history.location);let{__tempLocation:n,__tempKey:r}=o.state;if(n&&(!r||r===this.tempLocationKey)){const t=e(n);return t.state.key=o.state.key,delete t.state.__tempLocation,{...t,maskedLocation:o}}return o};resolvePathWithBase=(t,e)=>it(this.basepath,t,nt(e));get looseRoutesById(){return this.routesById}matchRoutes=(t,e,o)=>{let n={},r=this.flatRoutes.find((e=>{const o=ut(this.basepath,st(t),{to:e.fullPath,caseSensitive:e.options.caseSensitive??this.options.caseSensitive,fuzzy:!0});return!!o&&(n=o,!0)})),s=r||this.routesById.__root__,a=[s];for((r?"/"!==r.path&&n["**"]:st(t))&&this.options.notFoundRoute&&a.push(this.options.notFoundRoute);s?.parentRoute;)s=s.parentRoute,s&&a.unshift(s);const i=a.map((t=>{let e;if(t.options.parseParams)try{const e=t.options.parseParams(n);Object.assign(n,e)}catch(t){if(e=new kt(t.message,{cause:t}),o?.throwOnError)throw e;return e}})),c=[];return a.forEach(((t,r)=>{const s=c[r-1],[a,l]=(()=>{const n=s?.search??e;try{const e="object"==typeof t.options.validateSearch?t.options.validateSearch.parse:t.options.validateSearch;let o=e?.(n)??{};return[{...n,...o},void 0]}catch(t){const e=new Ot(t.message,{cause:t});if(o?.throwOnError)throw e;return[n,e]}})(),u=t.options.loaderDeps?.({search:a})??"",h=u?JSON.stringify(u):"",d=lt(t.fullPath,n),f=lt(t.id,n,!0)+h,p=G(this.state,f),m=this.state.matches.find((t=>t.id===f))?"stay":"enter",y=!(!t.options.loader&&!Mt.some((e=>t.options[e]?.preload))),g=p?{...p,cause:m}:{id:f,routeId:t.id,params:n,pathname:ot([this.basepath,d]),updatedAt:Date.now(),search:{},searchError:void 0,status:y?"pending":"success",showPending:!1,isFetching:!1,error:void 0,paramsError:i[r],loadPromise:Promise.resolve(),routeContext:void 0,context:void 0,abortController:new AbortController,fetchCount:0,cause:m,loaderDeps:u,invalid:!1,preload:!1};g.search=O(g.search,a),g.searchError=l,c.push(g)})),c};cancelMatch=t=>{G(this.state,t)?.abortController?.abort()};cancelMatches=()=>{this.state.pendingMatches?.forEach((t=>{this.cancelMatch(t.id)}))};buildLocation=t=>{const e=(t={},e)=>{const o=this.latestLocation,n=(this.state.pendingMatches||this.state.matches).at(-1)?.search||o.search,r=t.from??o.pathname;let s=this.resolvePathWithBase(r,`${t.to??""}`);const a=this.matchRoutes(r,n),i=e?.filter((t=>a?.find((e=>e.routeId===t.routeId)))),c={...C(a)?.params};let l=!0===(t.params??!0)?c:T(t.params,c);l&&e?.map((t=>this.looseRoutesById[t.routeId].options.stringifyParams)).filter(Boolean).forEach((t=>{l={...l,...t(l)}})),s=lt(s,l??{});const u=i?.map((t=>this.looseRoutesById[t.routeId].options.preSearchFilters??[])).flat().filter(Boolean)??[],h=i?.map((t=>this.looseRoutesById[t.routeId].options.postSearchFilters??[])).flat().filter(Boolean)??[],d=u?.length?u?.reduce(((t,e)=>e(t)),n):n,f=!0===t.search?d:t.search?T(t.search,d)??{}:u?.length?d:{},p=O(n,h?.length?h.reduce(((t,e)=>e(t)),f):f),m=this.options.stringifySearch(p),y=!0===t.hash?o.hash:t.hash?T(t.hash,o.hash):void 0,g=y?`#${y}`:"";let v=!0===t.state?o.state:t.state?T(t.state,o.state):o.state;return v=O(o.state,v),{pathname:s,search:p,searchStr:m,state:v,hash:y??"",href:`${s}${m}${g}`,unmaskOnReload:t.unmaskOnReload}},o=(t={},o)=>{let n=e(t),r=o?e(o):void 0;if(!r){let t={},s=this.options.routeMasks?.find((e=>{const o=ut(this.basepath,n.pathname,{to:e.from,caseSensitive:!1,fuzzy:!1});return!!o&&(t=o,!0)}));s&&(s={...s,from:lt(s.from,t)},r=e(o=s))}const s=this.matchRoutes(n.pathname,n.search),a=r?this.matchRoutes(r.pathname,r.search):void 0,i=r?e(o,a):void 0,c=e(t,s);return i&&(c.maskedLocation=i),c};return t.mask?o(t,{...M(t,["from"]),...t.mask}):o(t)};commitLocation=async({startTransition:t,...e})=>{this.navigateTimeout&&clearTimeout(this.navigateTimeout);if(!(this.latestLocation.href===e.href)||!e.replace){let{maskedLocation:o,...n}=e;o&&(n={...o,state:{...o.state,__tempKey:void 0,__tempLocation:{...n,search:n.searchStr,state:{...n.state,__tempKey:void 0,__tempLocation:void 0,key:void 0}}}},(n.unmaskOnReload??this.options.unmaskOnReload)&&(n.state.__tempKey=this.tempLocationKey));const r=()=>{this.history[e.replace?"replace":"push"](n.href,n.state)};t??1?this.startReactTransition(r):r()}return this.resetNextScroll=e.resetScroll??!0,this.latestLoadPromise};buildAndCommitLocation=({replace:t,resetScroll:e,startTransition:o,...n}={})=>{const r=this.buildLocation(n);return this.commitLocation({...r,startTransition:o,replace:t,resetScroll:e})};navigate=({from:t,to:e,...o})=>{const n=String(e);let r;try{new URL(`${n}`),r=!0}catch(t){}return g(!r),this.buildAndCommitLocation({...o,from:t,to:e})};loadMatches=async({checkLatest:t,matches:e,preload:o})=>{let n,r;const s=t=>{const e=this.state.pendingMatches?.find((e=>e.id===t.id)),o=this.state.matches.find((e=>e.id===t.id)),n=e?"pendingMatches":o?"matches":"cachedMatches";this.__store.setState((e=>({...e,[n]:e[n]?.map((e=>e.id===t.id?t:e))})))};try{for(let[t,n]of e.entries()){const s=e[t-1],a=this.looseRoutesById[n.routeId],i=new AbortController,c=(o,s)=>{if(o.routerCode=s,r=r??t,Lt(o))throw o;try{a.options.onError?.(o)}catch(t){if(o=t,Lt(t))throw t}e[t]=n={...n,error:o,status:"error",updatedAt:Date.now(),abortController:new AbortController}};try{n.paramsError&&c(n.paramsError,"PARSE_PARAMS"),n.searchError&&c(n.searchError,"VALIDATE_SEARCH");const r=s?.context??this.options.context??{},l=await(a.options.beforeLoad?.({search:n.search,abortController:i,params:n.params,preload:!!o,context:r,location:this.state.location,navigate:t=>this.navigate({...t,from:n.pathname}),buildLocation:this.buildLocation,cause:o?"preload":n.cause}))??{};if(Lt(l))throw l;const u={...r,...l};e[t]=n={...n,routeContext:O(n.routeContext,l),context:O(n.context,u),abortController:i}}catch(t){c(t,"BEFORE_LOAD");break}}}catch(t){if(Lt(t))return o||this.navigate(t),e;throw t}const a=e.slice(0,r),i=[];return a.forEach(((r,a)=>{i.push(new Promise((async c=>{const l=i[a-1],u=this.looseRoutesById[r.routeId],h=t=>!!Lt(t)&&(o||this.navigate(t),!0);let d;e[a]=r={...r,showPending:!1};let f=!1;const p=u.options.pendingMs??this.options.defaultPendingMs,m=u.options.pendingMinMs??this.options.defaultPendingMinMs,y=!o&&p&&(u.options.pendingComponent??this.options.defaultPendingComponent),g={params:r.params,deps:r.loaderDeps,preload:!!o,parentMatchPromise:l,abortController:r.abortController,context:r.context,location:this.state.location,navigate:t=>this.navigate({...t,from:r.pathname}),cause:o?"preload":r.cause},v=async()=>{if(r.isFetching)d=G(this.state,r.id)?.loadPromise;else{r.fetchCount&&"success"===r.status&&c(),e[a]=r={...r,isFetching:!0,fetchCount:r.fetchCount+1};const t=Promise.all(Mt.map((async t=>{const e=u.options[t];e?.preload&&await e.preload()}))),o=u.options.loader?.(g);d=Promise.all([t,o]).then((t=>t[1]))}e[a]=r={...r,loadPromise:d},s(r);try{const o=await d;if(n=t())return await n;if(Lt(o)&&h(o))return;if(f&&m&&await new Promise((t=>setTimeout(t,m))),n=t())return await n;e[a]=r={...r,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),loaderData:o,loadPromise:void 0}}catch(o){if(n=t())return await n;if(h(o))return;try{u.options.onError?.(o)}catch(t){if(o=t,h(t))return}e[a]=r={...r,error:o,status:"error",isFetching:!1}}s(r)},w=Date.now()-r.updatedAt;let _,b=o?u.options.preloadStaleTime??this.options.defaultPreloadStaleTime??3e4:u.options.staleTime??this.options.defaultStaleTime??0;const S=u.options.shouldReload;_="function"==typeof S?S(g):S,e[a]=r={...r,preload:!!o&&!this.state.matches.find((t=>t.id===r.id))},"success"!==r.status?(y&&new Promise((t=>setTimeout(t,p))).then((async()=>{if(n=t())return n;f=!0,e[a]=r={...r,showPending:!0},s(r),c()})),await v()):(r.invalid||(_??w>b))&&v(),c()})))})),await Promise.all(i),e};invalidate=()=>{const t=t=>({...t,invalid:!0});this.__store.setState((e=>({...e,matches:e.matches.map(t),cachedMatches:e.cachedMatches.map(t),pendingMatches:e.pendingMatches?.map(t)}))),this.load()};load=async()=>{const t=new Promise((async(e,o)=>{const n=this.latestLocation,r=this.state.resolvedLocation,s=r.href!==n.href;let a,i;this.cancelMatches(),this.emit({type:"onBeforeLoad",fromLocation:r,toLocation:n,pathChanged:s});const c=this.state.matches;this.__store.batch((()=>{this.cleanCache(),i=this.matchRoutes(n.pathname,n.search,{debug:!0}),this.__store.setState((t=>({...t,isLoading:!0,location:n,pendingMatches:i,cachedMatches:t.cachedMatches.filter((t=>!i.find((e=>e.id===t.id))))})))}));try{try{await this.loadMatches({matches:i,checkLatest:()=>this.checkLatest(t)})}catch(t){}if(a=this.checkLatest(t))return a;const o=c.filter((t=>!i.find((e=>e.id===t.id)))),l=i.filter((t=>!c.find((e=>e.id===t.id)))),u=c.filter((t=>i.find((e=>e.id===t.id))));this.__store.batch((()=>{this.__store.setState((t=>({...t,isLoading:!1,matches:t.pendingMatches,pendingMatches:void 0,cachedMatches:[...t.cachedMatches,...o.filter((t=>"error"!==t.status))]}))),this.cleanCache()})),[[o,"onLeave"],[l,"onEnter"],[u,"onStay"]].forEach((([t,e])=>{t.forEach((t=>{this.looseRoutesById[t.routeId].options[e]?.(t)}))})),this.emit({type:"onLoad",fromLocation:r,toLocation:n,pathChanged:s}),e()}catch(e){if(a=this.checkLatest(t))return a;o(e)}}));return this.latestLoadPromise=t,this.latestLoadPromise};cleanCache=()=>{this.__store.setState((t=>({...t,cachedMatches:t.cachedMatches.filter((t=>{const e=this.looseRoutesById[t.routeId];if(!e.options.loader)return!1;const o=(t.preload?e.options.preloadGcTime??this.options.defaultPreloadGcTime:e.options.gcTime??this.options.defaultGcTime)??3e5;return"error"!==t.status&&Date.now()-t.updatedAt<o}))})))};preloadRoute=async(t=this.state.location)=>{let e=this.buildLocation(t),o=this.matchRoutes(e.pathname,e.search,{throwOnError:!0});const n=Object.fromEntries([...this.state.matches,...this.state.pendingMatches??[],...this.state.cachedMatches]?.map((t=>[t.id,!0])));return this.__store.batch((()=>{o.forEach((t=>{n[t.id]||this.__store.setState((e=>({...e,cachedMatches:[...e.cachedMatches,t]})))}))})),o=await this.loadMatches({matches:o,preload:!0,checkLatest:()=>{}}),o};matchRoute=(t,e)=>{t={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0};const o=this.buildLocation(t);if(e?.pending&&"pending"!==this.state.status)return!1;const n=e?.pending?this.latestLocation:this.state.resolvedLocation;if(!n)return!1;const r=ut(this.basepath,n.pathname,{...e,to:o.pathname});return!!r&&(r&&(e?.includeSearch??1)?!!D(n.search,o.search,!0)&&r:r)};injectHtml=async t=>{this.injectedHtml.push(t)};dehydrateData=(t,e)=>{if("undefined"==typeof document){const o="string"==typeof t?t:JSON.stringify(t);return this.injectHtml((async()=>{const t=`__TSR_DEHYDRATED__${o}`,n="function"==typeof e?await e():e;return`<script id='${t}' suppressHydrationWarning>window["__TSR_DEHYDRATED__${$(o)}"] = ${JSON.stringify(n)}\n ;(() => {\n var el = document.getElementById('${t}')\n el.parentElement.removeChild(el)\n })()\n <\/script>`})),()=>this.hydrateData(t)}return()=>{}};hydrateData=t=>{if("undefined"!=typeof document){const e="string"==typeof t?t:JSON.stringify(t);return window[`__TSR_DEHYDRATED__${e}`]}};dehydrate=()=>({state:{dehydratedMatches:this.state.matches.map((t=>M(t,["id","status","updatedAt","loaderData"])))}});hydrate=async t=>{let e=t;"undefined"!=typeof document&&(e=window.__TSR_DEHYDRATED__),g(e);const o=e;this.dehydratedData=o.payload,this.options.hydrate?.(o.payload);const n=o.router.state;let r=this.matchRoutes(this.state.location.pathname,this.state.location.search).map((t=>{const e=n.dehydratedMatches.find((e=>e.id===t.id));return g(e,t.id),e?{...t,...e}:t}));this.__store.setState((t=>({...t,matches:r})))}},t.RouterProvider=function({router:e,...o}){e.update({...e.options,...o,context:{...e.options.context,...o?.context}});const n=e.options.InnerWrap?r.createElement(e.options.InnerWrap,null,r.createElement(A,null)):r.createElement(A,null),s=r.createElement(t.routerContext.Provider,{value:e},n,r.createElement(V,null));return e.options.Wrap?r.createElement(e.options.Wrap,null,s):s},t.ScrollRestoration=function(t){return Ht(t),null},t.SearchParamError=Ot,t.cleanPath=nt,t.componentTypes=Mt,t.createBrowserHistory=d,t.createHashHistory=function(t){const e=t?.window??("undefined"!=typeof document?window:void 0);return d({window:e,parseLocation:()=>p(e.location.hash.split("#").slice(1).join("#")??"/",e.history.state),createHref:t=>`${e.location.pathname}${e.location.search}#${t}`})},t.createHistory=u,t.createMemoryHistory=f,t.createRouteMask=function(t){return t},t.decode=Et,t.deepEqual=D,t.defaultParseSearch=Pt,t.defaultStringifySearch=xt,t.defer=function(t){const e=t;if(!e.__deferredState){e.__deferredState={uid:Math.random().toString(36).slice(2),status:"pending"};const t=e.__deferredState;e.then((e=>{t.status="success",t.data=e})).catch((e=>{t.status="error",t.error=e}))}return e},t.encode=St,t.escapeJSON=$,t.functionalUpdate=T,t.getInitialRouterState=It,t.getRenderedMatches=U,t.getRouteMatch=G,t.interpolatePath=lt,t.invariant=g,t.isDehydratedDeferred=tt,t.isPlainObject=k,t.isRedirect=Lt,t.isServer=x,t.joinPaths=ot,t.last=C,t.lazyFn=function(t,e){return async(...o)=>(await t())[e||"default"](...o)},t.lazyRouteComponent=function(t,e){let o;const n=()=>(o||(o=t()),o),s=r.lazy((async()=>({default:(await n())[e??"default"]})));return s.preload=n,s},t.matchByPath=dt,t.matchContext=B,t.matchPathname=ut,t.parsePathname=ct,t.parseSearchWith=Ct,t.pick=M,t.redirect=function(t){if(t.isRedirect=!0,t.throw)throw t;return t},t.removeBasepath=ht,t.replaceEqualDeep=O,t.resolvePath=it,t.rootRouteId=mt,t.rootRouteWithContext=function(){return t=>new gt(t)},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 o=Object.keys(t);if(o.length!==Object.keys(e).length)return!1;for(let n=0;n<o.length;n++)if(!Object.prototype.hasOwnProperty.call(e,o[n])||!Object.is(t[o[n]],e[o[n]]))return!1;return!0},t.stringifySearchWith=Tt,t.trimPath=at,t.trimPathLeft=rt,t.trimPathRight=st,t.useAwaited=et,t.useBlocker=Kt,t.useElementScrollRestoration=function(t){const e=Z(),o=t?.getKey||Nt;let n="";if(t.id)n=`[data-scroll-restoration-id="${t.id}"]`;else{const e=t.getElement?.();if(!e)return;n=Ft(e)}const r=[o(e.latestLocation),n].join($t);return At.state.cached[r]},t.useLayoutEffect=j,t.useLinkProps=_t,t.useLoaderData=X,t.useLoaderDeps=J,t.useMatch=z,t.useMatchRoute=W,t.useMatches=Y,t.useNavigate=function(t){const{navigate:e,buildLocation:o}=Z(),n=z({strict:!1,select:t=>t.pathname});return r.useCallback((({from:t,...o})=>e({from:o?.to?n:void 0,...o})),[])},t.useParams=ft,t.useParentMatches=function(t){const e=r.useContext(B);return Y({select:o=>(o=o.slice(o.findIndex((t=>t.id===e))),t?.select?t.select(o):o)})},t.useRouteContext=function(t){return z({...t,select:e=>t?.select?t.select(e.context):e.context})},t.useRouter=Z,t.useRouterState=Q,t.useScrollRestoration=Ht,t.useSearch=pt,t.useStableCallback=function(t){const e=r.useRef(t);return e.current=t,r.useRef(((...t)=>e.current(...t))).current},t.warning=function(t,e){}}));
21
+ */const s="pushstate",a="popstate",i="beforeunload",c=t=>(t.preventDefault(),t.returnValue=""),l=()=>{removeEventListener(i,c,{capture:!0})};function u(t){let e=t.getLocation(),o=new Set,n=[];const r=()=>{e=t.getLocation(),o.forEach((t=>t()))},s=async e=>{if("undefined"!=typeof document&&n.length)for(let e of n){if(!await e())return void t.onBlocked?.(r)}e()};return{get location(){return e},subscribe:t=>(o.add(t),()=>{o.delete(t)}),push:(e,o)=>{o=h(o),s((()=>{t.pushState(e,o),r()}))},replace:(e,o)=>{o=h(o),s((()=>{t.replaceState(e,o),r()}))},go:e=>{s((()=>{t.go(e)}))},back:()=>{s((()=>{t.back()}))},forward:()=>{s((()=>{t.forward()}))},createHref:e=>t.createHref(e),block:t=>(n.push(t),1===n.length&&addEventListener(i,c,{capture:!0}),()=>{n=n.filter((e=>e!==t)),n.length||l()}),flush:()=>t.flush?.(),destroy:()=>t.destroy?.(),notify:r}}function h(t){return t||(t={}),{...t,key:m()}}function d(t){const e=t?.window??("undefined"!=typeof document?window:void 0),o=t?.createHref??(t=>t),n=t?.parseLocation??(()=>p(`${e.location.pathname}${e.location.search}${e.location.hash}`,e.history.state));let r,i=n();let c,l,h=!0;const d=()=>{h=!1,(()=>{c&&(e.history[c.isPush?"pushState":"replaceState"](c.state,"",c.href),c=void 0,l=void 0,r=void 0)})(),h=!0},f=(t,e,n)=>{const s=o(e);l||(r=i),i=p(e,n),c={href:s,state:n,isPush:c?.isPush||"push"===t},l||(l=Promise.resolve().then((()=>d())))},m=()=>{i=n(),v.notify()};var y=e.history.pushState,g=e.history.replaceState;const v=u({getLocation:()=>i,pushState:(t,e)=>f("push",t,e),replaceState:(t,e)=>f("replace",t,e),back:()=>e.history.back(),forward:()=>e.history.forward(),go:t=>e.history.go(t),createHref:t=>o(t),flush:d,destroy:()=>{e.history.pushState=y,e.history.replaceState=g,e.removeEventListener(s,m),e.removeEventListener(a,m)},onBlocked:t=>{r&&i!==r&&(i=r,t())}});return e.addEventListener(s,m),e.addEventListener(a,m),e.history.pushState=function(){let t=y.apply(e.history,arguments);return h&&v.notify(),t},e.history.replaceState=function(){let t=g.apply(e.history,arguments);return h&&v.notify(),t},v}function f(t={initialEntries:["/"]}){const e=t.initialEntries;let o=t.initialIndex??e.length-1,n={key:m()};return u({getLocation:()=>p(e[o],n),pushState:(t,r)=>{n=r,e.push(t),o++},replaceState:(t,r)=>{n=r,e[o]=t},back:()=>{o--},forward:()=>{o=Math.min(o+1,e.length-1)},go:t=>{o=Math.min(Math.max(o+t,0),e.length-1)},createHref:t=>t})}function p(t,e){let o=t.indexOf("#"),n=t.indexOf("?");return{href:t,pathname:t.substring(0,o>0?n>0?Math.min(o,n):o:n>0?n:t.length),hash:o>-1?t.substring(o):"",search:n>-1?t.slice(n,-1===o?void 0:o):"",state:e||{}}}function m(){return(Math.random()+1).toString(36).substring(7)}var y="Invariant failed";function g(t,e){if(!t)throw new Error(y)}var v,w={exports:{}},_={};w.exports=function(){if(v)return _;v=1;var t=e,n=o,r="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},s=n.useSyncExternalStore,a=t.useRef,i=t.useEffect,c=t.useMemo,l=t.useDebugValue;return _.useSyncExternalStoreWithSelector=function(t,e,o,n,u){var h=a(null);if(null===h.current){var d={hasValue:!1,value:null};h.current=d}else d=h.current;h=c((function(){function t(t){if(!i){if(i=!0,s=t,t=n(t),void 0!==u&&d.hasValue){var e=d.value;if(u(e,t))return a=e}return a=t}if(e=a,r(s,t))return e;var o=n(t);return void 0!==u&&u(e,o)?e:(s=t,a=o)}var s,a,i=!1,c=void 0===o?null:o;return[function(){return t(e())},null===c?void 0:function(){return t(c())}]}),[e,o,n,u]);var f=s(t,h[0],h[1]);return i((function(){d.hasValue=!0,d.value=f}),[f]),l(f),f},_}();var b=w.exports,S=class{constructor(t,e){this.listeners=new Set,this._batching=!1,this._flushing=0,this._nextPriority=null,this.subscribe=t=>{this.listeners.add(t);const e=this.options?.onSubscribe?.(t,this);return()=>{this.listeners.delete(t),e?.()}},this.setState=(t,e)=>{const o=this.state;this.state=this.options?.updateFn?this.options.updateFn(o)(t):t(o);const n=e?.priority??this.options?.defaultPriority??"high";null===this._nextPriority||"high"===this._nextPriority?this._nextPriority=n:this._nextPriority=this.options?.defaultPriority??"high",this.options?.onUpdate?.({priority:this._nextPriority}),this._flush()},this._flush=()=>{if(this._batching)return;const t=++this._flushing;this.listeners.forEach((e=>{this._flushing===t&&e({priority:this._nextPriority??"high"})}))},this.batch=t=>{if(this._batching)return t();this._batching=!0,t(),this._batching=!1,this._flush()},this.state=t,this.options=e}};function R(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!1;for(let n=0;n<o.length;n++)if(!Object.prototype.hasOwnProperty.call(e,o[n])||!Object.is(t[o[n]],e[o[n]]))return!1;return!0}function E(t){const e=t.errorComponent??P;return r.createElement(L,{getResetKey:t.getResetKey,onCatch:t.onCatch,children:({error:o})=>o?r.createElement(e,{error:o}):t.children})}class L extends r.Component{state={error:null};static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}componentDidUpdate(t,e){e.error&&e.resetKey!==this.state.resetKey&&this.setState({error:null})}componentDidCatch(t){console.error(t),this.props.onCatch?.(t)}render(){return this.props.children(this.state)}}function P({error:t}){const[e,o]=r.useState(!1);return r.createElement("div",{style:{padding:".5rem",maxWidth:"100%"}},r.createElement("div",{style:{display:"flex",alignItems:"center",gap:".5rem"}},r.createElement("strong",{style:{fontSize:"1rem"}},"Something went wrong!"),r.createElement("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>o((t=>!t))},e?"Hide Error":"Show Error")),r.createElement("div",{style:{height:".25rem"}}),e?r.createElement("div",null,r.createElement("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"}},t.message?r.createElement("code",null,t.message):null)):null)}const x="undefined"==typeof document;function C(t){return t[t.length-1]}function T(t,e){return"function"==typeof t?t(e):t}function M(t,e){return e.reduce(((e,o)=>(e[o]=t[o],e)),{})}function O(t,e){if(t===e)return t;const o=e,n=Array.isArray(t)&&Array.isArray(o);if(n||k(t)&&k(o)){const e=n?t.length:Object.keys(t).length,r=n?o:Object.keys(o),s=r.length,a=n?[]:{};let i=0;for(let e=0;e<s;e++){const s=n?e:r[e];a[s]=O(t[s],o[s]),a[s]===t[s]&&i++}return e===s&&i===e?t:a}return o}function k(t){if(!I(t))return!1;const e=t.constructor;if(void 0===e)return!0;const o=e.prototype;return!!I(o)&&!!o.hasOwnProperty("isPrototypeOf")}function I(t){return"[object Object]"===Object.prototype.toString.call(t)}function D(t,e,o=!1){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(k(t)&&k(e)){const n=Object.keys(t),r=Object.keys(e);return!(!o&&n.length!==r.length)&&!r.some((n=>!(n in t)||!D(t[n],e[n],o)))}return!(!Array.isArray(t)||!Array.isArray(e))&&!t.some(((t,n)=>!D(t,e[n],o)))}const j="undefined"!=typeof window?r.useLayoutEffect:r.useEffect;function $(t){return t.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/"/g,'\\"')}const B=r.createContext(void 0);function A(){const t=Z(),e=Q({select:t=>U(t)[0]?.id});return r.createElement(B.Provider,{value:e},r.createElement(E,{getResetKey:()=>t.state.resolvedLocation.state?.key,errorComponent:P,onCatch:()=>{}},e?r.createElement(H,{matchId:e}):null))}function N(t){return r.createElement(r.Fragment,null,t.children)}function H({matchId:t}){const e=Z(),o=Q({select:e=>U(e).find((e=>e.id===t))?.routeId});g(o);const n=e.routesById[o],s=n.options.pendingComponent??e.options.defaultPendingComponent,a=s?r.createElement(s,null):null,i=n.options.errorComponent??e.options.defaultErrorComponent??P,c=n.options.wrapInSuspense??s??n.options.component?.preload??n.options.pendingComponent?.preload??n.options.errorComponent?.preload?r.Suspense:N,l=i?E:N;return r.createElement(B.Provider,{value:t},r.createElement(c,{fallback:a},r.createElement(l,{getResetKey:()=>e.state.resolvedLocation.state?.key,errorComponent:i,onCatch:()=>{}},r.createElement(F,{matchId:t,pendingElement:a}))))}function F({matchId:t,pendingElement:e}){const o=Z(),n=Q({select:e=>U(e).find((e=>e.id===t))?.routeId}),s=o.routesById[n],a=Q({select:e=>M(U(e).find((e=>e.id===t)),["status","error","showPending","loadPromise"])});if("error"===a.status)throw a.error;if("pending"===a.status){if(a.showPending)return e;throw a.loadPromise}if("success"===a.status){let t=s.options.component??o.options.defaultComponent;return t?r.createElement(t,null):r.createElement(K,null)}g(!1)}const K=r.memo((function(){const t=r.useContext(B),e=Q({select:e=>{const o=U(e),n=o.findIndex((e=>e.id===t));return o[n+1]?.id}});return e?r.createElement(H,{matchId:e}):null}));function W(){Q({select:t=>[t.location,t.resolvedLocation]});const{matchRoute:t}=Z();return r.useCallback((e=>{const{pending:o,caseSensitive:n,...r}=e;return t(r,{pending:o,caseSensitive:n})}),[])}function U(t){return t.pendingMatches?.some((t=>t.showPending))?t.pendingMatches:t.matches}function z(t){const e=Z(),o=r.useContext(B),n=U(e.state).find((t=>t.id===o))?.routeId,s=(()=>{const n=U(e.state);return(t?.from?n.find((e=>e.routeId===t?.from)):n.find((t=>t.id===o))).routeId})();(t?.strict??1)&&g(n==s);return Q({select:e=>{const n=U(e).find((t=>t.id===o));return g(n,t?.from&&t.from),t?.select?t.select(n):n}})}function Y(t){return Q({select:e=>{let o=U(e);return t?.select?t.select(o):o}})}function J(t){return z({...t,select:e=>"function"==typeof t.select?t.select(e?.loaderDeps):e?.loaderDeps})}function X(t){return z({...t,select:e=>"function"==typeof t.select?t.select(e?.loaderData):e?.loaderData})}const q=r.useTransition||(()=>[!1,t=>{t()}]);function V(){const t=r.useRef(0),e=Z(),o=Q({select:t=>M(t,["isLoading","location","resolvedLocation","isTransitioning"])}),[n,s]=q();e.startReactTransition=s,r.useEffect((()=>{n&&e.__store.setState((t=>({...t,isTransitioning:n})))}),[n]);const a=()=>{var t;t=()=>{try{e.load()}catch(t){console.error(t)}},o.isTransitioning?t():s((()=>t()))};return j((()=>{const t=e.history.subscribe((()=>{e.latestLocation=e.parseLocation(e.latestLocation),o.location!==e.latestLocation&&a()})),n=e.buildLocation({search:!0,params:!0,hash:!0,state:!0});return o.location.href!==n.href&&e.commitLocation({...n,replace:!0}),()=>{t()}}),[e.history]),j((()=>{if(r.useTransition?o.isTransitioning&&!n:!o.isLoading&&o.resolvedLocation!==o.location){if(e.emit({type:"onResolved",fromLocation:o.resolvedLocation,toLocation:o.location,pathChanged:o.location.href!==o.resolvedLocation?.href}),document.querySelector&&""!==o.location.hash){const t=document.getElementById(o.location.hash);t&&t.scrollIntoView()}e.__store.setState((t=>({...t,isTransitioning:!1,resolvedLocation:t.location})))}}),[o.isTransitioning,n,o.isLoading,o.resolvedLocation,o.location]),j((()=>{window.__TSR_DEHYDRATED__||t.current||(t.current++,a())}),[]),null}function G(t,e){return[...t.cachedMatches,...t.pendingMatches??[],...t.matches].find((t=>t.id===e))}function Q(t){return function(t,e=(t=>t)){return b.useSyncExternalStoreWithSelector(t.subscribe,(()=>t.state),(()=>t.state),e,R)}(Z().__store,t?.select)}function Z(){const e="undefined"!=typeof document&&window.__TSR_ROUTER_CONTEXT__||t.routerContext;return r.useContext(e)}function tt(t){return"object"==typeof t&&null!==t&&!(t instanceof Promise)&&!t.then&&"__deferredState"in t}function et({promise:t}){const e=Z();let o=t.__deferredState;const n=`__TSR__DEFERRED__${o.uid}`;if(tt(t)&&(o=e.hydrateData(n),(t=Promise.resolve(o.data)).__deferredState=o),"pending"===o.status)throw new Promise((t=>setTimeout(t,1))).then((()=>t));if("error"===o.status)throw o.error;return e.dehydrateData(n,o),[o.data]}function ot(t){return nt(t.filter(Boolean).join("/"))}function nt(t){return t.replace(/\/{2,}/g,"/")}function rt(t){return"/"===t?t:t.replace(/^\/{1,}/,"")}function st(t){return"/"===t?t:t.replace(/\/{1,}$/,"")}function at(t){return st(rt(t))}function it(t,e,o){e=e.replace(new RegExp(`^${t}`),"/"),o=o.replace(new RegExp(`^${t}`),"/");let n=ct(e);const r=ct(o);r.forEach(((t,e)=>{if("/"===t.value)e?e===r.length-1&&n.push(t):n=[t];else if(".."===t.value)n.length>1&&"/"===C(n)?.value&&n.pop(),n.pop();else{if("."===t.value)return;n.push(t)}}));return nt(ot([t,...n.map((t=>t.value))]))}function ct(t){if(!t)return[];const e=[];if("/"===(t=nt(t)).slice(0,1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),!t)return e;const o=t.split("/").filter(Boolean);return e.push(...o.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 lt(t,e,o=!1){return ot(ct(t).map((t=>{if("wildcard"===t.type){const n=e[t.value];return o?`${t.value}${n??""}`:n}return"param"===t.type?e[t.value.substring(1)]??"undefined":t.value})))}function ut(t,e,o){const n=dt(t,e,o);if(!o.to||n)return n??{}}function ht(t,e){return"/"!=t?e.substring(t.length):e}function dt(t,e,o){e=ht(t,e);const n=`${o.to??"$"}`,r=ct(e),s=ct(n);e.startsWith("/")||r.unshift({type:"pathname",value:"/"}),n.startsWith("/")||s.unshift({type:"pathname",value:"/"});const a={};return(()=>{for(let t=0;t<Math.max(r.length,s.length);t++){const e=r[t],n=s[t],i=t>=r.length-1,c=t>=s.length-1;if(n){if("wildcard"===n.type)return!!e?.value&&(a["*"]=ot(r.slice(t).map((t=>t.value))),!0);if("pathname"===n.type){if("/"===n.value&&!e?.value)return!0;if(e)if(o.caseSensitive){if(n.value!==e.value)return!1}else if(n.value.toLowerCase()!==e.value.toLowerCase())return!1}if(!e)return!1;if("param"===n.type){if("/"===e?.value)return!1;"$"!==e.value.charAt(0)&&(a[n.value.substring(1)]=e.value)}}if(!i&&c)return a["**"]=ot(r.slice(t+1).map((t=>t.value))),!!o.fuzzy&&"/"!==n?.value}return!0})()?a:void 0}function ft(t){return Q({select:e=>{const o=C(U(e))?.params;return t?.select?t.select(o):o}})}function pt(t){return z({...t,select:e=>t?.select?t.select(e.search):e.search})}t.routerContext=r.createContext(null),"undefined"!=typeof document&&(window.__TSR_ROUTER_CONTEXT__?t.routerContext=window.__TSR_ROUTER_CONTEXT__:window.__TSR_ROUTER_CONTEXT__=t.routerContext);const mt="__root__";class yt{constructor(t){this.options=t||{},this.isRoot=!t?.getParentRoute,g(!(t?.id&&t?.path)),this.$$typeof=Symbol.for("react.memo")}init=t=>{this.originalIndex=t.originalIndex;const e=this.options,o=!e?.path&&!e?.id;this.parentRoute=this.options?.getParentRoute?.(),o?this.path=mt:g(this.parentRoute);let n=o?mt:e.path;n&&"/"!==n&&(n=at(n));const r=e?.id||n;let s=o?mt:ot([this.parentRoute.id===mt?"":this.parentRoute.id,r]);n===mt&&(n="/"),s!==mt&&(s=ot(["/",s]));const a=s===mt?"/":ot([this.parentRoute.fullPath,n]);this.path=n,this.id=s,this.fullPath=a,this.to=a};addChildren=t=>(this.children=t,this);updateLoader=t=>(Object.assign(this.options,t),this);update=t=>(Object.assign(this.options,t),this);useMatch=t=>z({...t,from:this.id});useRouteContext=t=>z({...t,from:this.id,select:e=>t?.select?t.select(e.context):e.context});useSearch=t=>pt({...t,from:this.id});useParams=t=>ft({...t,from:this.id});useLoaderDeps=t=>J({...t,from:this.id});useLoaderData=t=>X({...t,from:this.id})}class gt extends yt{constructor(t){super(t)}}function vt(){return vt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},vt.apply(this,arguments)}const wt="Error preloading route! ☝️";function _t(t){const e=Z(),o=z({strict:!1,select:t=>t.pathname}),{children:n,target:r,activeProps:s=(()=>({className:"active"})),inactiveProps:a=(()=>({})),activeOptions:i,disabled:c,hash:l,search:u,params:h,to:d,state:f,mask:p,preload:m,preloadDelay:y,replace:g,startTransition:v,resetScroll:w,style:_,className:b,onClick:S,onFocus:R,onMouseEnter:E,onMouseLeave:L,onTouchStart:P,...x}=t,C={from:t.to?o:void 0,...t};let M="internal";try{new URL(`${d}`),M="external"}catch{}if("external"===M)return{href:d};const O=e.buildLocation(C),k=m??e.options.defaultPreload,I=y??e.options.defaultPreloadDelay??0,j=Q({select:t=>{const e=t.location.pathname.split("/"),o=O.pathname.split("/").every(((t,o)=>t===e[o])),n=i?.exact?t.location.pathname===O.pathname:o,r=!i?.includeHash||t.location.hash===O.hash,s=!(i?.includeSearch??1)||D(t.location.search,O.search,!i?.exact);return n&&r&&s}}),$=t=>e=>{e.persist&&e.persist(),t.filter(Boolean).forEach((t=>{e.defaultPrevented||t(e)}))},B=j?T(s,{})??{}:{},A=j?{}:T(a,{})??{};return{...B,...A,...x,href:c?void 0:O.maskedLocation?O.maskedLocation.href:O.href,onClick:$([S,t=>{c||function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}(t)||t.defaultPrevented||r&&"_self"!==r||0!==t.button||(t.preventDefault(),e.commitLocation({...O,replace:g,resetScroll:w,startTransition:v}))}]),onFocus:$([R,t=>{k&&e.preloadRoute(C).catch((t=>{console.warn(t),console.warn(wt)}))}]),onMouseEnter:$([E,t=>{const o=t.target||{};if(k){if(o.preloadTimeout)return;o.preloadTimeout=setTimeout((()=>{o.preloadTimeout=null,e.preloadRoute(C).catch((t=>{console.warn(t),console.warn(wt)}))}),I)}}]),onMouseLeave:$([L,t=>{const e=t.target||{};e.preloadTimeout&&(clearTimeout(e.preloadTimeout),e.preloadTimeout=null)}]),onTouchStart:$([P,t=>{k&&e.preloadRoute(C).catch((t=>{console.warn(t),console.warn(wt)}))}]),target:r,style:{..._,...B.style,...A.style},className:[b,B.className,A.className].filter(Boolean).join(" ")||void 0,...c?{role:"link","aria-disabled":!0}:void 0,"data-status":j?"active":void 0}}const bt=r.forwardRef(((t,e)=>{const o=_t(t);return r.createElement("a",vt({ref:e},o,{children:"function"==typeof t.children?t.children({isActive:"active"===o["data-status"]}):t.children}))}));function St(t,e){var o,n,r,s="";for(o in t)if(void 0!==(r=t[o]))if(Array.isArray(r))for(n=0;n<r.length;n++)s&&(s+="&"),s+=encodeURIComponent(o)+"="+encodeURIComponent(r[n]);else s&&(s+="&"),s+=encodeURIComponent(o)+"="+encodeURIComponent(r);return(e||"")+s}function Rt(t){if(!t)return"";var e=decodeURIComponent(t);return"false"!==e&&("true"===e||(0*+e==0&&+e+""===e?+e:e))}function Et(t){for(var e,o,n={},r=t.split("&");e=r.shift();)void 0!==n[o=(e=e.split("=")).shift()]?n[o]=[].concat(n[o],Rt(e.shift())):n[o]=Rt(e.shift());return n}function Lt(t){return!!t?.isRedirect}const Pt=Ct(JSON.parse),xt=Tt(JSON.stringify,JSON.parse);function Ct(t){return e=>{"?"===e.substring(0,1)&&(e=e.substring(1));let o=Et(e);for(let e in o){const n=o[e];if("string"==typeof n)try{o[e]=t(n)}catch(t){}}return o}}function Tt(t,e){return o=>{(o={...o})&&Object.keys(o).forEach((n=>{const r=o[n];void 0===r||void 0===r?delete o[n]:o[n]=function(o){if("object"==typeof o&&null!==o)try{return t(o)}catch(t){}else if("string"==typeof o&&"function"==typeof e)try{return e(o),t(o)}catch(t){}return o}(r)}));const n=St(o).toString();return n?`?${n}`:""}}const Mt=["component","errorComponent","pendingComponent"];class Ot extends Error{}class kt extends Error{}function It(t){return{isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:{...t},location:t,matches:[],pendingMatches:[],cachedMatches:[],lastUpdated:Date.now()}}const Dt="undefined"!=typeof window?r.useLayoutEffect:r.useEffect,jt="window",$t="___";let Bt=new WeakSet;let At="undefined"!=typeof window&&window.sessionStorage?(()=>{const t="tsr-scroll-restoration-v2";return{state:JSON.parse(window.sessionStorage.getItem(t)||"null")||{cached:{},next:{}},set:e=>{At.state=T(e,At.state),window.sessionStorage.setItem(t,JSON.stringify(At.state))}}})():void 0;const Nt=t=>t.state.key;function Ht(t){const e=Z();Dt((()=>{const o=t?.getKey||Nt,{history:n}=window;n.scrollRestoration&&(n.scrollRestoration="manual");const r=t=>{if(Bt.has(t.target))return;Bt.add(t.target);let e="";if(t.target===document||t.target===window)e=jt;else{const o=t.target.getAttribute("data-scroll-restoration-id");e=o?`[data-scroll-restoration-id="${o}"]`:Ft(t.target)}At.state.next[e]||At.set((t=>({...t,next:{...t.next,[e]:{scrollX:NaN,scrollY:NaN}}})))};"undefined"!=typeof document&&document.addEventListener("scroll",r,!0);const s=e.subscribe("onBeforeLoad",(t=>{if(t.pathChanged){const e=o(t.fromLocation);for(const t in At.state.next){const o=At.state.next[t];if(t===jt)o.scrollX=window.scrollX||0,o.scrollY=window.scrollY||0;else if(t){const e=document.querySelector(t);o.scrollX=e?.scrollLeft||0,o.scrollY=e?.scrollTop||0}At.set((n=>{const r={...n.next};return delete r[t],{...n,next:r,cached:{...n.cached,[[e,t].join($t)]:o}}}))}}})),a=e.subscribe("onResolved",(o=>{if(o.pathChanged){if(!e.resetNextScroll)return;e.resetNextScroll=!0;const n=(t?.getKey||Nt)(o.toLocation);let r=!1;for(const t in At.state.cached){const e=At.state.cached[t],[o,s]=t.split($t);if(o===n)if(s===jt)r=!0,window.scrollTo(e.scrollX,e.scrollY);else if(s){const t=document.querySelector(s);t&&(t.scrollLeft=e.scrollX,t.scrollTop=e.scrollY)}}r||window.scrollTo(0,0),At.set((t=>({...t,next:{}}))),Bt=new WeakSet}}));return()=>{document.removeEventListener("scroll",r),s(),a()}}),[])}function Ft(t){let e,o=[];for(;e=t.parentNode;)o.unshift(`${t.tagName}:nth-child(${[].indexOf.call(e.children,t)+1})`),t=e;return`${o.join(" > ")}`.toLowerCase()}function Kt(t,e=!0){const{history:o}=Z();r.useEffect((()=>{if(e)return o.block(t)}))}t.Await=function(t){const e=et(t);return t.children(...e)},t.Block=function({blocker:t,condition:e,children:o}){return Kt(t,e),o??null},t.CatchBoundary=E,t.CatchBoundaryImpl=L,t.ErrorComponent=P,t.FileRoute=class{constructor(t){this.path=t}createRoute=t=>{const e=new yt(t);return e.isRoot=!1,e}},t.FileRouteLoader=function(t){return t=>t},t.Link=bt,t.Match=H,t.MatchRoute=function(t){const e=W()(t);return"function"==typeof t.children?t.children(e):e?t.children:null},t.Matches=A,t.Navigate=function(t){const{navigate:e}=Z(),o=z({strict:!1});return r.useEffect((()=>{e({from:t.to?o.pathname:void 0,...t})}),[]),null},t.NotFoundRoute=class extends yt{constructor(t){super({...t,id:"404"})}},t.Outlet=K,t.PathParamError=kt,t.RootRoute=gt,t.Route=yt,t.RouteApi=class{constructor({id:t}){this.id=t}useMatch=t=>z({...t,from:this.id});useRouteContext=t=>z({...t,from:this.id,select:e=>t?.select?t.select(e.context):e.context});useSearch=t=>pt({...t,from:this.id});useParams=t=>ft({...t,from:this.id});useLoaderDeps=t=>J({...t,from:this.id});useLoaderData=t=>X({...t,from:this.id})},t.Router=class{tempLocationKey=`${Math.round(1e7*Math.random())}`;resetNextScroll=!0;navigateTimeout=null;latestLoadPromise=Promise.resolve();subscribers=new Set;injectedHtml=[];constructor(t){this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,stringifySearch:t?.stringifySearch??xt,parseSearch:t?.parseSearch??Pt})}startReactTransition=t=>t();update=t=>{this.options={...this.options,...t},this.basepath=`/${at(t.basepath??"")??""}`,(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history??("undefined"!=typeof document?d():f()),this.latestLocation=this.parseLocation()),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),this.__store||(this.__store=new S(It(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,status:this.state.isTransitioning||this.state.isLoading?"pending":"idle"}}}))};get state(){return this.__store.state}buildRouteTree=()=>{this.routesById={},this.routesByPath={};const t=this.options.notFoundRoute;t&&(t.init({originalIndex:99999999999}),this.routesById[t.id]=t);const e=t=>{t.forEach(((t,o)=>{t.init({originalIndex:o});if(g(!this.routesById[t.id],String(t.id)),this.routesById[t.id]=t,!t.isRoot&&t.path){const e=st(t.fullPath);this.routesByPath[e]&&!t.fullPath.endsWith("/")||(this.routesByPath[e]=t)}const n=t.children;n?.length&&e(n)}))};e([this.routeTree]);const o=[];Object.values(this.routesById).forEach(((t,e)=>{if(t.isRoot||!t.path)return;const n=rt(t.fullPath),r=ct(n);for(;r.length>1&&"/"===r[0]?.value;)r.shift();const s=r.map((t=>"/"===t.value?.75:"param"===t.type?.5:"wildcard"===t.type?.25:1));o.push({child:t,trimmed:n,parsed:r,index:e,scores:s})})),this.flatRoutes=o.sort(((t,e)=>{const o=Math.min(t.scores.length,e.scores.length);for(let n=0;n<o;n++)if(t.scores[n]!==e.scores[n])return e.scores[n]-t.scores[n];if(t.scores.length!==e.scores.length)return e.scores.length-t.scores.length;for(let n=0;n<o;n++)if(t.parsed[n].value!==e.parsed[n].value)return t.parsed[n].value>e.parsed[n].value?1:-1;return t.index-e.index})).map(((t,e)=>(t.child.rank=e,t.child)))};subscribe=(t,e)=>{const o={eventType:t,fn:e};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}};emit=t=>{this.subscribers.forEach((e=>{e.eventType===t.type&&e.fn(t)}))};checkLatest=t=>this.latestLoadPromise!==t?this.latestLoadPromise:void 0;parseLocation=t=>{const e=({pathname:e,search:o,hash:n,state:r})=>{const s=this.options.parseSearch(o);return{pathname:e,searchStr:o,search:O(t?.search,s),hash:n.split("#").reverse()[0]??"",href:`${e}${o}${n}`,state:O(t?.state,r)}},o=e(this.history.location);let{__tempLocation:n,__tempKey:r}=o.state;if(n&&(!r||r===this.tempLocationKey)){const t=e(n);return t.state.key=o.state.key,delete t.state.__tempLocation,{...t,maskedLocation:o}}return o};resolvePathWithBase=(t,e)=>it(this.basepath,t,nt(e));get looseRoutesById(){return this.routesById}matchRoutes=(t,e,o)=>{let n={},r=this.flatRoutes.find((e=>{const o=ut(this.basepath,st(t),{to:e.fullPath,caseSensitive:e.options.caseSensitive??this.options.caseSensitive,fuzzy:!0});return!!o&&(n=o,!0)})),s=r||this.routesById.__root__,a=[s];for((r?"/"!==r.path&&n["**"]:st(t))&&this.options.notFoundRoute&&a.push(this.options.notFoundRoute);s?.parentRoute;)s=s.parentRoute,s&&a.unshift(s);const i=a.map((t=>{let e;if(t.options.parseParams)try{const e=t.options.parseParams(n);Object.assign(n,e)}catch(t){if(e=new kt(t.message,{cause:t}),o?.throwOnError)throw e;return e}})),c=[];return a.forEach(((t,r)=>{const s=c[r-1],[a,l]=(()=>{const n=s?.search??e;try{const e="object"==typeof t.options.validateSearch?t.options.validateSearch.parse:t.options.validateSearch;let o=e?.(n)??{};return[{...n,...o},void 0]}catch(t){const e=new Ot(t.message,{cause:t});if(o?.throwOnError)throw e;return[n,e]}})(),u=t.options.loaderDeps?.({search:a})??"",h=u?JSON.stringify(u):"",d=lt(t.fullPath,n),f=lt(t.id,n,!0)+h,p=G(this.state,f),m=this.state.matches.find((t=>t.id===f))?"stay":"enter",y=!(!t.options.loader&&!Mt.some((e=>t.options[e]?.preload))),g=p?{...p,cause:m}:{id:f,routeId:t.id,params:n,pathname:ot([this.basepath,d]),updatedAt:Date.now(),search:{},searchError:void 0,status:y?"pending":"success",showPending:!1,isFetching:!1,error:void 0,paramsError:i[r],loadPromise:Promise.resolve(),routeContext:void 0,context:void 0,abortController:new AbortController,fetchCount:0,cause:m,loaderDeps:u,invalid:!1,preload:!1};g.search=O(g.search,a),g.searchError=l,c.push(g)})),c};cancelMatch=t=>{G(this.state,t)?.abortController?.abort()};cancelMatches=()=>{this.state.pendingMatches?.forEach((t=>{this.cancelMatch(t.id)}))};buildLocation=t=>{const e=(t={},e)=>{const o=this.latestLocation,n=(this.state.pendingMatches||this.state.matches).at(-1)?.search||o.search;let r=this.resolvePathWithBase(o.pathname,`${t.to??""}`);const s=this.matchRoutes(o.pathname,n),a=e?.filter((t=>s?.find((e=>e.routeId===t.routeId)))),i={...C(s)?.params};let c=!0===(t.params??!0)?i:T(t.params,i);c&&e?.map((t=>this.looseRoutesById[t.routeId].options.stringifyParams)).filter(Boolean).forEach((t=>{c={...c,...t(c)}})),r=lt(r,c??{});const l=a?.map((t=>this.looseRoutesById[t.routeId].options.preSearchFilters??[])).flat().filter(Boolean)??[],u=a?.map((t=>this.looseRoutesById[t.routeId].options.postSearchFilters??[])).flat().filter(Boolean)??[],h=l?.length?l?.reduce(((t,e)=>e(t)),n):n,d=!0===t.search?h:t.search?T(t.search,h)??{}:l?.length?h:{},f=O(n,u?.length?u.reduce(((t,e)=>e(t)),d):d),p=this.options.stringifySearch(f),m=!0===t.hash?o.hash:t.hash?T(t.hash,o.hash):void 0,y=m?`#${m}`:"";let g=!0===t.state?o.state:t.state?T(t.state,o.state):o.state;return g=O(o.state,g),{pathname:r,search:f,searchStr:p,state:g,hash:m??"",href:`${r}${p}${y}`,unmaskOnReload:t.unmaskOnReload}},o=(t={},o)=>{let n=e(t),r=o?e(o):void 0;if(!r){let t={},s=this.options.routeMasks?.find((e=>{const o=ut(this.basepath,n.pathname,{to:e.from,caseSensitive:!1,fuzzy:!1});return!!o&&(t=o,!0)}));s&&(s={...s,from:lt(s.from,t)},r=e(o=s))}const s=this.matchRoutes(n.pathname,n.search),a=r?this.matchRoutes(r.pathname,r.search):void 0,i=r?e(o,a):void 0,c=e(t,s);return i&&(c.maskedLocation=i),c};return t.mask?o(t,{...M(t,["from"]),...t.mask}):o(t)};commitLocation=async({startTransition:t,...e})=>{this.navigateTimeout&&clearTimeout(this.navigateTimeout);if(!(this.latestLocation.href===e.href)||!e.replace){let{maskedLocation:o,...n}=e;o&&(n={...o,state:{...o.state,__tempKey:void 0,__tempLocation:{...n,search:n.searchStr,state:{...n.state,__tempKey:void 0,__tempLocation:void 0,key:void 0}}}},(n.unmaskOnReload??this.options.unmaskOnReload)&&(n.state.__tempKey=this.tempLocationKey));const r=()=>{this.history[e.replace?"replace":"push"](n.href,n.state)};t??1?this.startReactTransition(r):r()}return this.resetNextScroll=e.resetScroll??!0,this.latestLoadPromise};buildAndCommitLocation=({replace:t,resetScroll:e,startTransition:o,...n}={})=>{const r=this.buildLocation(n);return this.commitLocation({...r,startTransition:o,replace:t,resetScroll:e})};navigate=({from:t,to:e,...o})=>{const n=String(e);let r;try{new URL(`${n}`),r=!0}catch(t){}return g(!r),this.buildAndCommitLocation({...o,from:t,to:e})};loadMatches=async({checkLatest:t,matches:e,preload:o})=>{let n,r;const s=t=>{const e=this.state.pendingMatches?.find((e=>e.id===t.id)),o=this.state.matches.find((e=>e.id===t.id)),n=e?"pendingMatches":o?"matches":"cachedMatches";this.__store.setState((e=>({...e,[n]:e[n]?.map((e=>e.id===t.id?t:e))})))};try{for(let[t,n]of e.entries()){const s=e[t-1],a=this.looseRoutesById[n.routeId],i=new AbortController,c=(o,s)=>{if(o.routerCode=s,r=r??t,Lt(o))throw o;try{a.options.onError?.(o)}catch(t){if(o=t,Lt(t))throw t}e[t]=n={...n,error:o,status:"error",updatedAt:Date.now(),abortController:new AbortController}};try{n.paramsError&&c(n.paramsError,"PARSE_PARAMS"),n.searchError&&c(n.searchError,"VALIDATE_SEARCH");const r=s?.context??this.options.context??{},l=await(a.options.beforeLoad?.({search:n.search,abortController:i,params:n.params,preload:!!o,context:r,location:this.state.location,navigate:t=>this.navigate({...t,from:n.pathname}),buildLocation:this.buildLocation,cause:o?"preload":n.cause}))??{};if(Lt(l))throw l;const u={...r,...l};e[t]=n={...n,routeContext:O(n.routeContext,l),context:O(n.context,u),abortController:i}}catch(t){c(t,"BEFORE_LOAD");break}}}catch(t){if(Lt(t))return o||this.navigate(t),e;throw t}const a=e.slice(0,r),i=[];return a.forEach(((r,a)=>{i.push(new Promise((async c=>{const l=i[a-1],u=this.looseRoutesById[r.routeId],h=t=>!!Lt(t)&&(o||this.navigate(t),!0);let d;e[a]=r={...r,showPending:!1};let f=!1;const p=u.options.pendingMs??this.options.defaultPendingMs,m=u.options.pendingMinMs??this.options.defaultPendingMinMs,y=!o&&p&&(u.options.pendingComponent??this.options.defaultPendingComponent),g={params:r.params,deps:r.loaderDeps,preload:!!o,parentMatchPromise:l,abortController:r.abortController,context:r.context,location:this.state.location,navigate:t=>this.navigate({...t,from:r.pathname}),cause:o?"preload":r.cause},v=async()=>{if(r.isFetching)d=G(this.state,r.id)?.loadPromise;else{r.fetchCount&&"success"===r.status&&c(),e[a]=r={...r,isFetching:!0,fetchCount:r.fetchCount+1};const t=Promise.all(Mt.map((async t=>{const e=u.options[t];e?.preload&&await e.preload()}))),o=u.options.loader?.(g);d=Promise.all([t,o]).then((t=>t[1]))}e[a]=r={...r,loadPromise:d},s(r);try{const o=await d;if(n=t())return await n;if(Lt(o)&&h(o))return;if(f&&m&&await new Promise((t=>setTimeout(t,m))),n=t())return await n;e[a]=r={...r,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),loaderData:o,loadPromise:void 0}}catch(o){if(n=t())return await n;if(h(o))return;try{u.options.onError?.(o)}catch(t){if(o=t,h(t))return}e[a]=r={...r,error:o,status:"error",isFetching:!1}}s(r)},w=Date.now()-r.updatedAt;let _,b=o?u.options.preloadStaleTime??this.options.defaultPreloadStaleTime??3e4:u.options.staleTime??this.options.defaultStaleTime??0;const S=u.options.shouldReload;_="function"==typeof S?S(g):S,e[a]=r={...r,preload:!!o&&!this.state.matches.find((t=>t.id===r.id))},"success"!==r.status?(y&&new Promise((t=>setTimeout(t,p))).then((async()=>{if(n=t())return n;f=!0,e[a]=r={...r,showPending:!0},s(r),c()})),await v()):(r.invalid||(_??w>b))&&v(),c()})))})),await Promise.all(i),e};invalidate=()=>{const t=t=>({...t,invalid:!0});this.__store.setState((e=>({...e,matches:e.matches.map(t),cachedMatches:e.cachedMatches.map(t),pendingMatches:e.pendingMatches?.map(t)}))),this.load()};load=async()=>{const t=new Promise((async(e,o)=>{const n=this.latestLocation,r=this.state.resolvedLocation,s=r.href!==n.href;let a,i;this.cancelMatches(),this.emit({type:"onBeforeLoad",fromLocation:r,toLocation:n,pathChanged:s});const c=this.state.matches;this.__store.batch((()=>{this.cleanCache(),i=this.matchRoutes(n.pathname,n.search,{debug:!0}),this.__store.setState((t=>({...t,isLoading:!0,location:n,pendingMatches:i,cachedMatches:t.cachedMatches.filter((t=>!i.find((e=>e.id===t.id))))})))}));try{try{await this.loadMatches({matches:i,checkLatest:()=>this.checkLatest(t)})}catch(t){}if(a=this.checkLatest(t))return a;const o=c.filter((t=>!i.find((e=>e.id===t.id)))),l=i.filter((t=>!c.find((e=>e.id===t.id)))),u=c.filter((t=>i.find((e=>e.id===t.id))));this.__store.batch((()=>{this.__store.setState((t=>({...t,isLoading:!1,matches:t.pendingMatches,pendingMatches:void 0,cachedMatches:[...t.cachedMatches,...o.filter((t=>"error"!==t.status))]}))),this.cleanCache()})),[[o,"onLeave"],[l,"onEnter"],[u,"onStay"]].forEach((([t,e])=>{t.forEach((t=>{this.looseRoutesById[t.routeId].options[e]?.(t)}))})),this.emit({type:"onLoad",fromLocation:r,toLocation:n,pathChanged:s}),e()}catch(e){if(a=this.checkLatest(t))return a;o(e)}}));return this.latestLoadPromise=t,this.latestLoadPromise};cleanCache=()=>{this.__store.setState((t=>({...t,cachedMatches:t.cachedMatches.filter((t=>{const e=this.looseRoutesById[t.routeId];if(!e.options.loader)return!1;const o=(t.preload?e.options.preloadGcTime??this.options.defaultPreloadGcTime:e.options.gcTime??this.options.defaultGcTime)??3e5;return"error"!==t.status&&Date.now()-t.updatedAt<o}))})))};preloadRoute=async(t=this.state.location)=>{let e=this.buildLocation(t),o=this.matchRoutes(e.pathname,e.search,{throwOnError:!0});const n=Object.fromEntries([...this.state.matches,...this.state.pendingMatches??[],...this.state.cachedMatches]?.map((t=>[t.id,!0])));return this.__store.batch((()=>{o.forEach((t=>{n[t.id]||this.__store.setState((e=>({...e,cachedMatches:[...e.cachedMatches,t]})))}))})),o=await this.loadMatches({matches:o,preload:!0,checkLatest:()=>{}}),o};matchRoute=(t,e)=>{t={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0};const o=this.buildLocation(t);if(e?.pending&&"pending"!==this.state.status)return!1;const n=e?.pending?this.latestLocation:this.state.resolvedLocation;if(!n)return!1;const r=ut(this.basepath,n.pathname,{...e,to:o.pathname});return!!r&&(r&&(e?.includeSearch??1)?!!D(n.search,o.search,!0)&&r:r)};injectHtml=async t=>{this.injectedHtml.push(t)};dehydrateData=(t,e)=>{if("undefined"==typeof document){const o="string"==typeof t?t:JSON.stringify(t);return this.injectHtml((async()=>{const t=`__TSR_DEHYDRATED__${o}`,n="function"==typeof e?await e():e;return`<script id='${t}' suppressHydrationWarning>window["__TSR_DEHYDRATED__${$(o)}"] = ${JSON.stringify(n)}\n ;(() => {\n var el = document.getElementById('${t}')\n el.parentElement.removeChild(el)\n })()\n <\/script>`})),()=>this.hydrateData(t)}return()=>{}};hydrateData=t=>{if("undefined"!=typeof document){const e="string"==typeof t?t:JSON.stringify(t);return window[`__TSR_DEHYDRATED__${e}`]}};dehydrate=()=>({state:{dehydratedMatches:this.state.matches.map((t=>M(t,["id","status","updatedAt","loaderData"])))}});hydrate=async t=>{let e=t;"undefined"!=typeof document&&(e=window.__TSR_DEHYDRATED__),g(e);const o=e;this.dehydratedData=o.payload,this.options.hydrate?.(o.payload);const n=o.router.state;let r=this.matchRoutes(this.state.location.pathname,this.state.location.search).map((t=>{const e=n.dehydratedMatches.find((e=>e.id===t.id));return g(e,t.id),e?{...t,...e}:t}));this.__store.setState((t=>({...t,matches:r})))}},t.RouterProvider=function({router:e,...o}){e.update({...e.options,...o,context:{...e.options.context,...o?.context}});const n=e.options.InnerWrap?r.createElement(e.options.InnerWrap,null,r.createElement(A,null)):r.createElement(A,null),s=r.createElement(t.routerContext.Provider,{value:e},n,r.createElement(V,null));return e.options.Wrap?r.createElement(e.options.Wrap,null,s):s},t.ScrollRestoration=function(t){return Ht(t),null},t.SearchParamError=Ot,t.cleanPath=nt,t.componentTypes=Mt,t.createBrowserHistory=d,t.createHashHistory=function(t){const e=t?.window??("undefined"!=typeof document?window:void 0);return d({window:e,parseLocation:()=>p(e.location.hash.split("#").slice(1).join("#")??"/",e.history.state),createHref:t=>`${e.location.pathname}${e.location.search}#${t}`})},t.createHistory=u,t.createMemoryHistory=f,t.createRouteMask=function(t){return t},t.decode=Et,t.deepEqual=D,t.defaultParseSearch=Pt,t.defaultStringifySearch=xt,t.defer=function(t){const e=t;if(!e.__deferredState){e.__deferredState={uid:Math.random().toString(36).slice(2),status:"pending"};const t=e.__deferredState;e.then((e=>{t.status="success",t.data=e})).catch((e=>{t.status="error",t.error=e}))}return e},t.encode=St,t.escapeJSON=$,t.functionalUpdate=T,t.getInitialRouterState=It,t.getRenderedMatches=U,t.getRouteMatch=G,t.interpolatePath=lt,t.invariant=g,t.isDehydratedDeferred=tt,t.isPlainObject=k,t.isRedirect=Lt,t.isServer=x,t.joinPaths=ot,t.last=C,t.lazyFn=function(t,e){return async(...o)=>(await t())[e||"default"](...o)},t.lazyRouteComponent=function(t,e){let o;const n=()=>(o||(o=t()),o),s=r.lazy((async()=>({default:(await n())[e??"default"]})));return s.preload=n,s},t.matchByPath=dt,t.matchContext=B,t.matchPathname=ut,t.parsePathname=ct,t.parseSearchWith=Ct,t.pick=M,t.redirect=function(t){if(t.isRedirect=!0,t.throw)throw t;return t},t.removeBasepath=ht,t.replaceEqualDeep=O,t.resolvePath=it,t.rootRouteId=mt,t.rootRouteWithContext=function(){return t=>new gt(t)},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 o=Object.keys(t);if(o.length!==Object.keys(e).length)return!1;for(let n=0;n<o.length;n++)if(!Object.prototype.hasOwnProperty.call(e,o[n])||!Object.is(t[o[n]],e[o[n]]))return!1;return!0},t.stringifySearchWith=Tt,t.trimPath=at,t.trimPathLeft=rt,t.trimPathRight=st,t.useAwaited=et,t.useBlocker=Kt,t.useElementScrollRestoration=function(t){const e=Z(),o=t?.getKey||Nt;let n="";if(t.id)n=`[data-scroll-restoration-id="${t.id}"]`;else{const e=t.getElement?.();if(!e)return;n=Ft(e)}const r=[o(e.latestLocation),n].join($t);return At.state.cached[r]},t.useLayoutEffect=j,t.useLinkProps=_t,t.useLoaderData=X,t.useLoaderDeps=J,t.useMatch=z,t.useMatchRoute=W,t.useMatches=Y,t.useNavigate=function(t){const{navigate:e,buildLocation:o}=Z(),n=z({strict:!1,select:t=>t.pathname});return r.useCallback((({from:t,...o})=>e({from:o?.to?n:void 0,...o})),[])},t.useParams=ft,t.useParentMatches=function(t){const e=r.useContext(B);return Y({select:o=>(o=o.slice(o.findIndex((t=>t.id===e))),t?.select?t.select(o):o)})},t.useRouteContext=function(t){return z({...t,select:e=>t?.select?t.select(e.context):e.context})},t.useRouter=Z,t.useRouterState=Q,t.useScrollRestoration=Ht,t.useSearch=pt,t.useStableCallback=function(t){const e=r.useRef(t);return e.current=t,r.useRef(((...t)=>e.current(...t))).current},t.warning=function(t,e){}}));
22
22
  //# sourceMappingURL=index.production.js.map