@tanstack/react-router 0.0.1-beta.7 → 0.0.1-beta.70

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.
@@ -8,9 +8,9 @@
8
8
  *
9
9
  * @license MIT
10
10
  */
11
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("use-sync-external-store/shim")):"function"==typeof define&&define.amd?define(["exports","react","use-sync-external-store/shim"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactRouter={},e.React,e.shim)}(this,(function(e,t,n){"use strict";function a(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var o,r=a(t);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},i.apply(this,arguments)}function s(e,t){if(null==e)return{};var n,a,o={},r=Object.keys(e);for(a=0;a<r.length;a++)n=r[a],t.indexOf(n)>=0||(o[n]=e[n]);return o}
11
+ !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 a(){return a=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},a.apply(this,arguments)}function n(t,e){if(!t)throw new Error("Invariant failed")}function i(t,e){}
12
12
  /**
13
- * router-core
13
+ * store
14
14
  *
15
15
  * Copyright (c) TanStack
16
16
  *
@@ -18,5 +18,25 @@
18
18
  * LICENSE.md file in the root directory of this source tree.
19
19
  *
20
20
  * @license MIT
21
- */function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},l.apply(this,arguments)}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(o||(o={}));var c="beforeunload",u="popstate";function d(e){void 0===e&&(e={});var t=e.window,n=void 0===t?document.defaultView:t,a=n.history;function r(){var e=n.location,t=e.pathname,o=e.search,r=e.hash,i=a.state||{};return[i.idx,{pathname:t,search:o,hash:r,state:i.usr||null,key:i.key||"default"}]}var i=null;n.addEventListener(u,(function(){if(i)P.call(i),i=null;else{var e=o.Pop,t=r(),n=t[0],a=t[1];if(P.length){if(null!=n){var s=h-n;s&&(i={action:e,location:a,retry:function(){A(-1*s)}},A(s))}}else x(e)}}));var s=o.Pop,d=r(),h=d[0],f=d[1],_=m(),P=m();function b(e){return"string"==typeof e?e:g(e)}function w(e,t){return void 0===t&&(t=null),l({pathname:f.pathname,hash:"",search:""},"string"==typeof e?y(e):e,{state:t,key:v()})}function E(e,t){return[{usr:e.state,key:e.key,idx:t},b(e)]}function R(e,t,n){return!P.length||(P.call({action:e,location:t,retry:n}),!1)}function x(e){s=e;var t=r();h=t[0],f=t[1],_.call({action:s,location:f})}function A(e){a.go(e)}null==h&&(h=0,a.replaceState(l({},a.state,{idx:h}),""));var M={get action(){return s},get location(){return f},createHref:b,push:function e(t,r){var i=o.Push,s=w(t,r);if(R(i,s,(function(){e(t,r)}))){var l=E(s,h+1),c=l[0],u=l[1];try{a.pushState(c,"",u)}catch(e){n.location.assign(u)}x(i)}},replace:function e(t,n){var r=o.Replace,i=w(t,n);if(R(r,i,(function(){e(t,n)}))){var s=E(i,h),l=s[0],c=s[1];a.replaceState(l,"",c),x(r)}},go:A,back:function(){A(-1)},forward:function(){A(1)},listen:function(e){return _.push(e)},block:function(e){var t=P.push(e);return 1===P.length&&n.addEventListener(c,p),function(){t(),P.length||n.removeEventListener(c,p)}}};return M}function h(e){void 0===e&&(e={});var t=e,n=t.initialEntries,a=void 0===n?["/"]:n,r=t.initialIndex,i=a.map((function(e){return l({pathname:"/",search:"",hash:"",state:null,key:v()},"string"==typeof e?y(e):e)})),s=f(null==r?i.length-1:r,0,i.length-1),c=o.Pop,u=i[s],d=m(),h=m();function p(e,t){return void 0===t&&(t=null),l({pathname:u.pathname,search:"",hash:""},"string"==typeof e?y(e):e,{state:t,key:v()})}function _(e,t,n){return!h.length||(h.call({action:e,location:t,retry:n}),!1)}function P(e,t){c=e,u=t,d.call({action:c,location:u})}function b(e){var t=f(s+e,0,i.length-1),n=o.Pop,a=i[t];_(n,a,(function(){b(e)}))&&(s=t,P(n,a))}var w={get index(){return s},get action(){return c},get location(){return u},createHref:function(e){return"string"==typeof e?e:g(e)},push:function e(t,n){var a=o.Push,r=p(t,n);_(a,r,(function(){e(t,n)}))&&(s+=1,i.splice(s,i.length,r),P(a,r))},replace:function e(t,n){var a=o.Replace,r=p(t,n);_(a,r,(function(){e(t,n)}))&&(i[s]=r,P(a,r))},go:b,back:function(){b(-1)},forward:function(){b(1)},listen:function(e){return d.push(e)},block:function(e){return h.push(e)}};return w}function f(e,t,n){return Math.min(Math.max(e,t),n)}function p(e){e.preventDefault(),e.returnValue=""}function m(){var e=[];return{get length(){return e.length},push:function(t){return e.push(t),function(){e=e.filter((function(e){return e!==t}))}},call:function(t){e.forEach((function(e){return e&&e(t)}))}}}function v(){return Math.random().toString(36).substr(2,8)}function g(e){var t=e.pathname,n=void 0===t?"/":t,a=e.search,o=void 0===a?"":a,r=e.hash,i=void 0===r?"":r;return o&&"?"!==o&&(n+="?"===o.charAt(0)?o:"?"+o),i&&"#"!==i&&(n+="#"===i.charAt(0)?i:"#"+i),n}function y(e){var t={};if(e){var n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));var a=e.indexOf("?");a>=0&&(t.search=e.substr(a),e=e.substr(0,a)),e&&(t.pathname=e)}return t}function _(e,t){if(!e)throw new Error("Invariant failed")}function P(e,t){if(e===t)return e;const n=Array.isArray(e)&&Array.isArray(t);if(n||b(e)&&b(t)){const a=n?e.length:Object.keys(e).length,o=n?t:Object.keys(t),r=o.length,i=n?[]:{};let s=0;for(let a=0;a<r;a++){const r=n?a:o[a];i[r]=P(e[r],t[r]),i[r]===e[r]&&s++}return a===r&&s===a?e:i}return t}function b(e){if(!w(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!!w(n)&&!!n.hasOwnProperty("isPrototypeOf")}function w(e){return"[object Object]"===Object.prototype.toString.call(e)}function E(e){return e[e.length-1]}function R(e,t){if(e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}return!0}function x(e,t){return"function"==typeof e?e(t):e}function A(e,t){return t.reduce(((t,n)=>(t[n]=e[n],t)),{})}function M(e){return S(e.filter(Boolean).join("/"))}function S(e){return e.replace(/\/{2,}/g,"/")}function I(e){return"/"===e?e:e.replace(/^\/{1,}/,"")}function L(e){return"/"===e?e:e.replace(/\/{1,}$/,"")}function k(e){return L(I(e))}function C(e,t,n){t=t.replace(new RegExp("^"+e),"/"),n=n.replace(new RegExp("^"+e),"/");let a=O(t);const o=O(n);o.forEach(((e,t)=>{if("/"===e.value)t?t===o.length-1&&a.push(e):a=[e];else if(".."===e.value){var n;a.length>1&&"/"===(null==(n=E(a))?void 0:n.value)&&a.pop(),a.pop()}else{if("."===e.value)return;a.push(e)}}));return S(M([e,...a.map((e=>e.value))]))}function O(e){if(!e)return[];const t=[];if("/"===(e=S(e)).slice(0,1)&&(e=e.substring(1),t.push({type:"pathname",value:"/"})),!e)return t;const n=e.split("/").filter(Boolean);return t.push(...n.map((e=>e.startsWith("*")?{type:"wildcard",value:e}:":"===e.charAt(0)?{type:"param",value:e}:{type:"pathname",value:e}))),"/"===e.slice(-1)&&(e=e.substring(1),t.push({type:"pathname",value:"/"})),t}function j(e,t,n){return M(O(e).map((e=>{return"*"!==e.value||n?"param"===e.type?null!=(a=t[e.value.substring(1)])?a:"":e.value:"";var a})))}function D(e,t){const n=T(e,t);if(!t.to||n)return null!=n?n:{}}function T(e,t){var n;const a=O(e),o=O(""+(null!=(n=t.to)?n:"*")),r={};return(()=>{for(let e=0;e<Math.max(a.length,o.length);e++){const n=a[e],i=o[e],s=e===o.length-1,l=e===a.length-1;if(i){if("wildcard"===i.type)return!(null==n||!n.value)&&(r["*"]=M(a.slice(e).map((e=>e.value))),!0);if("pathname"===i.type){if("/"===i.value&&(null==n||!n.value))return!0;if(n)if(t.caseSensitive){if(i.value!==n.value)return!1}else if(i.value.toLowerCase()!==n.value.toLowerCase())return!1}if(!n)return!1;if("param"===i.type){if("/"===(null==n?void 0:n.value))return!1;n.value.startsWith(":")||(r[i.value.substring(1)]=n.value)}}if(s&&!l)return!!t.fuzzy}return!0})()?r:void 0}function F(e,t){var n,a,o,r="";for(n in e)if(void 0!==(o=e[n]))if(Array.isArray(o))for(a=0;a<o.length;a++)r&&(r+="&"),r+=encodeURIComponent(n)+"="+encodeURIComponent(o[a]);else r&&(r+="&"),r+=encodeURIComponent(n)+"="+encodeURIComponent(o);return(t||"")+r}function N(e){if(!e)return"";var t=decodeURIComponent(e);return"false"!==t&&("true"===t||("0"===t.charAt(0)?t:0*+t==0?+t:t))}function B(e){for(var t,n,a={},o=e.split("&");t=o.shift();)void 0!==a[n=(t=t.split("=")).shift()]?a[n]=[].concat(a[n],N(t.shift())):a[n]=N(t.shift());return a}function U(){return U=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},U.apply(this,arguments)}function H(e,t,n,a){const{id:o,routeId:r,path:i,fullPath:s}=e,l=a.state.actions[o]||(a.state.actions[o]={pending:[],submit:async(e,t)=>{var n;if(!u)return;const o=null==(n=null==t?void 0:t.invalidate)||n,r={submittedAt:Date.now(),status:"pending",submission:e};l.current=r,l.latest=r,l.pending.push(r),a.state=U({},a.state,{currentAction:r,latestAction:r}),a.notify();try{const t=await(null==u.options.action?void 0:u.options.action(e));return r.data=t,o&&(a.invalidateRoute({to:".",fromCurrent:!0}),await a.reload()),r.status="success",t}catch(e){console.error(e),r.error=e,r.status="error"}finally{l.pending=l.pending.filter((e=>e!==r)),a.removeActionQueue.push({action:l,actionState:r}),a.notify()}}},a.state.actions[o]),c=a.state.loaders[o]||(a.state.loaders[o]={pending:[],fetch:async e=>{if(!u)return;const t={loadedAt:Date.now(),loaderContext:e};c.current=t,c.latest=t,c.pending.push(t),a.notify();try{return await(null==u.options.loader?void 0:u.options.loader(e))}finally{c.pending=c.pending.filter((e=>e!==t)),a.notify()}}},a.state.loaders[o]);let u={routeId:o,routeRouteId:r,routePath:i,fullPath:s,options:t,router:a,childRoutes:void 0,parentRoute:n,action:l,loader:c,buildLink:e=>a.buildLink(U({},e,{from:s})),navigate:e=>a.navigate(U({},e,{from:s})),matchRoute:(e,t)=>a.matchRoute(U({},e,{from:s}),t)};return null==a.options.createRoute||a.options.createRoute({router:a,route:u}),u}function z(e){e.forEach(((t,n)=>{const a=e[n-1];a&&(t.loaderData=P(t.loaderData,U({},a.loaderData,t.routeLoaderData)))}))}const G="__root__",W=["element","errorElement","catchElement","pendingElement"];function q(e,t,n){const a=U({},t,n,{router:e,routeSearch:{},search:{},childMatches:[],status:"idle",routeLoaderData:{},loaderData:{},isPending:!1,isFetching:!1,isInvalid:!1,invalidAt:1/0,getIsInvalid:()=>{const e=Date.now();return a.isInvalid||a.invalidAt<e},__:{abortController:new AbortController,latestId:"",resolve:()=>{},notify:()=>{a.__.resolve(),a.router.notify()},startPending:()=>{var t,n;const o=null!=(t=a.options.pendingMs)?t:e.options.defaultPendingMs,r=null!=(n=a.options.pendingMinMs)?n:e.options.defaultPendingMinMs;a.__.pendingTimeout||"loading"!==a.status||void 0===o||(a.__.pendingTimeout=setTimeout((()=>{a.isPending=!0,a.__.resolve(),void 0!==r&&(a.__.pendingMinPromise=new Promise((e=>a.__.pendingMinTimeout=setTimeout(e,r))))}),o))},cancelPending:()=>{a.isPending=!1,clearTimeout(a.__.pendingTimeout),clearTimeout(a.__.pendingMinTimeout),delete a.__.pendingMinPromise},validate:()=>{var t,n;const o=null!=(t=null==(n=a.parentMatch)?void 0:n.search)?t:e.location.search;try{const e=a.routeSearch,t="object"==typeof a.options.validateSearch?a.options.validateSearch.parse:a.options.validateSearch;let n=P(e,null==t?void 0:t(o));e!==n&&(a.isInvalid=!0),a.routeSearch=n,a.search=P(o,U({},o,n))}catch(e){console.error(e);const t=new Error("Invalid search params found",{cause:e});return t.code="INVALID_SEARCH_PARAMS",a.status="error",void(a.error=t)}}},cancel:()=>{var e;null==(e=a.__.abortController)||e.abort(),a.__.cancelPending()},invalidate:()=>{a.isInvalid=!0},hasLoaders:()=>!(!t.options.loader&&!W.some((e=>"function"==typeof t.options[e]))),load:async t=>{const n=Date.now(),o=null!=t&&t.preload?Math.max(null==t?void 0:t.maxAge,null==t?void 0:t.gcMaxAge):0;if(null!=t&&t.preload&&o>0){if(e.state.matches.find((e=>e.matchId===a.matchId)))return;e.matchCache[a.matchId]={gc:n+t.gcMaxAge,match:a}}if("success"===a.status&&a.getIsInvalid()||"error"===a.status||"idle"===a.status){const e=null!=t&&t.preload?null==t?void 0:t.maxAge:void 0;a.fetch({maxAge:e})}},fetch:async t=>{const n=""+Date.now()+Math.random();return a.__.latestId=n,"idle"===a.status&&(a.status="loading"),a.isInvalid=!1,a.__.loadPromise=new Promise((async o=>{a.isFetching=!0,a.__.resolve=o;const r=(async()=>{a.__.elementsPromise=(async()=>{await Promise.all(W.map((async t=>{const n=a.options[t];a.__[t]||(a.__[t]=await e.options.createElement(n))})))})(),a.__.dataPromise=Promise.resolve().then((async()=>{try{var o,r,i;if(a.options.loader){const e=await a.options.loader({params:a.params,search:a.routeSearch,signal:a.__.abortController.signal});if(n!==a.__.latestId)return a.__.loaderPromise;a.routeLoaderData=P(a.routeLoaderData,e)}a.error=void 0,a.status="success",a.updatedAt=Date.now(),a.invalidAt=a.updatedAt+(null!=(o=null!=(r=null!=(i=null==t?void 0:t.maxAge)?i:a.options.loaderMaxAge)?r:e.options.defaultLoaderMaxAge)?o:0)}catch(e){if(n!==a.__.latestId)return a.__.loaderPromise;a.error=e,a.status="error",a.updatedAt=Date.now()}}));try{if(await Promise.all([a.__.elementsPromise,a.__.dataPromise]),n!==a.__.latestId)return a.__.loaderPromise;a.__.pendingMinPromise&&(await a.__.pendingMinPromise,delete a.__.pendingMinPromise)}finally{if(n!==a.__.latestId)return a.__.loaderPromise;a.__.cancelPending(),a.isPending=!1,a.isFetching=!1,a.__.notify()}})();if(a.__.loaderPromise=r,await r,n!==a.__.latestId)return a.__.loaderPromise;delete a.__.loaderPromise})),await a.__.loadPromise}});return a.hasLoaders()||(a.status="success"),a}const K=V(JSON.parse),Q=J(JSON.stringify);function V(e){return t=>{"?"===t.substring(0,1)&&(t=t.substring(1));let n=B(t);for(let t in n){const a=n[t];if("string"==typeof a)try{n[t]=e(a)}catch(e){}}return n}}function J(e){return t=>{(t=U({},t))&&Object.keys(t).forEach((n=>{const a=t[n];if(void 0===a||void 0===a)delete t[n];else if(a&&"object"==typeof a&&null!==a)try{t[n]=e(a)}catch(e){}}));const n=F(t).toString();return n?"?"+n:""}}var X;const Y="undefined"==typeof window||!(null!=(X=window.document)&&X.createElement);function $(e){var t,n;const a=(null==e?void 0:e.history)||(Y?h():d()),o=U({defaultLoaderGcMaxAge:3e5,defaultLoaderMaxAge:0,defaultPreloadMaxAge:2e3,defaultPreloadDelay:50},e,{stringifySearch:null!=(t=null==e?void 0:e.stringifySearch)?t:Q,parseSearch:null!=(n=null==e?void 0:e.parseSearch)?n:K});let r={history:a,options:o,listeners:[],removeActionQueue:[],basepath:"",routeTree:void 0,routesById:{},location:void 0,allRouteInfo:void 0,navigationPromise:Promise.resolve(),resolveNavigation:()=>{},matchCache:{},state:{status:"idle",location:null,matches:[],actions:{},loaders:{},lastUpdated:Date.now(),isFetching:!1,isPreloading:!1},startedLoadingAt:Date.now(),subscribe:e=>(r.listeners.push(e),()=>{r.listeners=r.listeners.filter((t=>t!==e))}),getRoute:e=>r.routesById[e],notify:()=>{r.state=U({},r.state,{isFetching:"loading"===r.state.status||r.state.matches.some((e=>e.isFetching)),isPreloading:Object.values(r.matchCache).some((e=>e.match.isFetching&&!r.state.matches.find((t=>t.matchId===e.match.matchId))))}),z(r.state.matches),r.listeners.forEach((e=>e(r)))},dehydrateState:()=>U({},A(r.state,["status","location","lastUpdated"]),{matches:r.state.matches.map((e=>A(e,["matchId","status","routeLoaderData","loaderData","isInvalid","invalidAt"])))}),hydrateState:e=>{const t=r.matchRoutes(r.location.pathname,{strictParseParams:!0});r.state=U({},r.state,e,{matches:t.map((t=>{const n=e.matches.find((e=>e.matchId===t.matchId));return _(n),Object.assign(t,n),t}))})},mount:()=>{const e=r.__.buildLocation({to:".",search:!0,hash:!0});e.href!==r.location.href&&r.__.commitLocation(e,!0),r.loadLocation();const t=r.history.listen((e=>{console.log(e.location),r.loadLocation(r.__.parseLocation(e.location,r.location))}));return!Y&&window.addEventListener&&(window.addEventListener("visibilitychange",r.onFocus,!1),window.addEventListener("focus",r.onFocus,!1)),()=>{t(),window.removeEventListener("visibilitychange",r.onFocus),window.removeEventListener("focus",r.onFocus)}},onFocus:()=>{r.loadLocation()},update:e=>{const t=(null==e?void 0:e.history)!==r.history;r.location&&!t||(null!=e&&e.history&&(r.history=e.history),r.location=r.__.parseLocation(r.history.location),r.state.location=r.location),Object.assign(r.options,e);const{basepath:n,routeConfig:a}=r.options;return r.basepath=S("/"+(null!=n?n:"")),a&&(r.routesById={},r.routeTree=r.__.buildRouteTree(a)),r},cancelMatches:()=>{var e,t;[...r.state.matches,...null!=(e=null==(t=r.state.pending)?void 0:t.matches)?e:[]].forEach((e=>{e.cancel()}))},loadLocation:async e=>{const t=Math.random();r.startedLoadingAt=t,e&&(r.location=e),r.removeActionQueue.forEach((e=>{let{action:t,actionState:n}=e;r.state.currentAction===n&&(r.state.currentAction=void 0),t.current===n&&(t.current=void 0)})),r.removeActionQueue=[],r.cancelMatches();const n=r.matchRoutes(r.location.pathname,{strictParseParams:!0});if(r.state=U({},r.state,{pending:{matches:n,location:r.location},status:"loading"}),r.notify(),await r.loadMatches(n,{withPending:!0}),r.startedLoadingAt!==t)return r.navigationPromise;const a=r.state.matches,o=[],i=[];a.forEach((e=>{n.find((t=>t.matchId===e.matchId))?i.push(e):o.push(e)}));const s=Date.now();o.forEach((e=>{var t,n,a,o;null==e.__.onExit||e.__.onExit({params:e.params,search:e.routeSearch}),"error"!==e.status||e.isFetching||(e.status="idle",e.error=void 0);const i=Math.max(null!=(t=null!=(n=e.options.loaderGcMaxAge)?n:r.options.defaultLoaderGcMaxAge)?t:0,null!=(a=null!=(o=e.options.loaderMaxAge)?o:r.options.defaultLoaderMaxAge)?a:0);i>0&&(r.matchCache[e.matchId]={gc:i==1/0?Number.MAX_SAFE_INTEGER:s+i,match:e})})),i.forEach((e=>{null==e.options.onTransition||e.options.onTransition({params:e.params,search:e.routeSearch})}));n.filter((e=>!a.find((t=>t.matchId===e.matchId)))).forEach((e=>{e.__.onExit=null==e.options.onMatch?void 0:e.options.onMatch({params:e.params,search:e.search}),delete r.matchCache[e.matchId]})),n.some((e=>"loading"===e.status))&&(r.notify(),await Promise.all(n.map((e=>e.__.loaderPromise||Promise.resolve())))),r.startedLoadingAt===t&&(r.state=U({},r.state,{location:r.location,matches:n,pending:void 0,status:"idle"}),r.notify(),r.resolveNavigation())},cleanMatchCache:()=>{const e=Date.now();Object.keys(r.matchCache).forEach((t=>{const n=r.matchCache[t];"loading"!==n.match.status&&(n.gc>0&&n.gc>e||delete r.matchCache[t])}))},loadRoute:async function(e){void 0===e&&(e=r.location);const t=r.buildNext(e),n=r.matchRoutes(t.pathname,{strictParseParams:!0});return await r.loadMatches(n),n},preloadRoute:async function(e,t){var n,a,o,i,s,l;void 0===e&&(e=r.location);const c=r.buildNext(e),u=r.matchRoutes(c.pathname,{strictParseParams:!0});return await r.loadMatches(u,{preload:!0,maxAge:null!=(n=null!=(a=null!=(o=t.maxAge)?o:r.options.defaultPreloadMaxAge)?a:r.options.defaultLoaderMaxAge)?n:0,gcMaxAge:null!=(i=null!=(s=null!=(l=t.gcMaxAge)?l:r.options.defaultPreloadGcMaxAge)?s:r.options.defaultLoaderGcMaxAge)?i:0}),u},matchRoutes:(e,t)=>{var n,a;r.cleanMatchCache();const o=[];if(!r.routeTree)return o;const i=[...r.state.matches,...null!=(n=null==(a=r.state.pending)?void 0:a.matches)?n:[]],s=async n=>{var a,l,c;const u=E(o);let d=null!=(a=null==u?void 0:u.params)?a:{};const h=null!=(l=null==r.options.filterRoutes?void 0:r.options.filterRoutes(n))?l:n;let f=[];const p=(n,a)=>(a.some((a=>{var o,i,s;if(!a.routePath&&null!=(o=a.childRoutes)&&o.length)return p([...f,a],a.childRoutes);const l=!!("/"!==a.routePath||null!=(i=a.childRoutes)&&i.length),c=D(e,{to:a.fullPath,fuzzy:l,caseSensitive:null!=(s=a.options.caseSensitive)?s:r.options.caseSensitive});if(c){let e;try{var u;e=null!=(u=null==a.options.parseParams?void 0:a.options.parseParams(c))?u:c}catch(e){if(null!=t&&t.strictParseParams)throw e}d=U({},d,e)}return c&&(f=[...n,a]),!!f.length})),!!f.length);if(p([],h),!f.length)return;f.forEach((t=>{var n;const a=j(t.routePath,d),s=j(t.routeId,d,!0),l=i.find((e=>e.matchId===s))||(null==(n=r.matchCache[s])?void 0:n.match)||q(r,t,{matchId:s,params:d,pathname:M([e,a])});o.push(l)}));const m=E(f);null!=(c=m.childRoutes)&&c.length&&s(m.childRoutes)};return s([r.routeTree]),z(o),o},loadMatches:async(e,t)=>{const n=e.map((async e=>{e.__.validate(),e.load(t),"loading"===e.status&&(null!=t&&t.withPending&&e.__.startPending(),await e.__.loadPromise)}));r.notify(),await Promise.all(n)},invalidateRoute:e=>{var t,n;const a=r.buildNext(e),o=r.matchRoutes(a.pathname).map((e=>e.matchId));[...r.state.matches,...null!=(t=null==(n=r.state.pending)?void 0:n.matches)?t:[]].forEach((e=>{o.includes(e.matchId)&&e.invalidate()}))},reload:()=>r.__.navigate({fromCurrent:!0,replace:!0,search:!0}),resolvePath:(e,t)=>C(r.basepath,e,S(t)),matchRoute:(e,t)=>{var n;e=U({},e,{to:e.to?r.resolvePath(null!=(n=e.from)?n:"",e.to):void 0});const a=r.buildNext(e);var o;return null!=t&&t.pending?!(null==(o=r.state.pending)||!o.location)&&!!D(r.state.pending.location.pathname,U({},t,{to:a.pathname})):!!D(r.state.location.pathname,U({},t,{to:a.pathname}))},navigate:async e=>{let{from:t,to:n=".",search:a,hash:o,replace:i,params:s}=e;const l=String(n),c=String(t);let u;try{new URL(""+l),u=!0}catch(e){}return _(!u),r.__.navigate({from:c,to:l,search:a,hash:o,replace:i,params:s})},buildLink:e=>{var t,n;let{from:a,to:o=".",search:i,params:s,hash:l,target:c,replace:u,activeOptions:d,preload:h,preloadMaxAge:f,preloadGcMaxAge:p,preloadDelay:m,disabled:v}=e;try{return new URL(""+o),{type:"external",href:o}}catch(e){}const g={from:a,to:o,search:i,params:s,hash:l,replace:u},y=r.buildNext(g);h=null!=(t=h)?t:r.options.defaultPreload;const _=null!=(n=null!=m?m:r.options.defaultPreloadDelay)?n:0,P=r.state.location.pathname===y.pathname,b=r.state.location.pathname.split("/"),w=y.pathname.split("/").every(((e,t)=>e===b[t])),E=r.state.location.hash===y.hash,R=null!=d&&d.exact?P:w,x=null==d||!d.includeHash||E;return{type:"internal",next:y,handleFocus:e=>{h&&r.preloadRoute(g,{maxAge:f,gcMaxAge:p})},handleClick:e=>{v||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||e.defaultPrevented||c&&"_self"!==c||0!==e.button||(e.preventDefault(),!P||i||l||r.invalidateRoute(g),r.__.navigate(g))},handleEnter:e=>{const t=e.target||{};if(h){if(t.preloadTimeout)return;t.preloadTimeout=setTimeout((()=>{t.preloadTimeout=null,r.preloadRoute(g,{maxAge:f,gcMaxAge:p})}),_)}},handleLeave:e=>{const t=e.target||{};t.preloadTimeout&&(clearTimeout(t.preloadTimeout),t.preloadTimeout=null)},isActive:R&&x,disabled:v}},buildNext:e=>{const t=r.__.buildLocation(e),n=r.matchRoutes(t.pathname),a=n.map((e=>{var t;return null!=(t=e.options.preSearchFilters)?t:[]})).flat().filter(Boolean),o=n.map((e=>{var t;return null!=(t=e.options.postSearchFilters)?t:[]})).flat().filter(Boolean);return r.__.buildLocation(U({},e,{__preSearchFilters:a,__postSearchFilters:o}))},__:{buildRouteTree:e=>{const t=(e,n)=>e.map((e=>{const a=H(e,e.options,n,r);if(r.routesById[a.routeId])throw new Error;r.routesById[a.routeId]=a;const o=e.children;return a.childRoutes=null!=o&&o.length?t(o,a):void 0,a}));return t([e])[0]},parseLocation:(e,t)=>{var n;const a=r.options.parseSearch(e.search);return{pathname:e.pathname,searchStr:e.search,search:P(null==t?void 0:t.search,a),hash:null!=(n=e.hash.split("#").reverse()[0])?n:"",href:""+e.pathname+e.search+e.hash,state:e.state,key:e.key}},navigate:e=>{const t=r.buildNext(e);return r.__.commitLocation(t,e.replace)},buildLocation:function(e){var t,n,a,o,i,s,l,c,u;void 0===e&&(e={});const d=e.fromCurrent?r.location.pathname:null!=(t=e.from)?t:r.location.pathname;let h=C(null!=(n=r.basepath)?n:"/",d,""+(null!=(a=e.to)?a:"."));const f=r.matchRoutes(r.location.pathname,{strictParseParams:!0}),p=r.matchRoutes(h),m=U({},null==(o=E(f))?void 0:o.params);let v=!0===(null==(i=e.params)||i)?m:x(e.params,m);v&&p.map((e=>e.options.stringifyParams)).filter(Boolean).forEach((e=>{Object.assign({},v,e(v))})),h=j(h,null!=v?v:{});const g=null!=(s=e.__preSearchFilters)&&s.length?e.__preSearchFilters.reduce(((e,t)=>t(e)),r.location.search):r.location.search,y=!0===e.search?g:e.search?null!=(l=x(e.search,g))?l:{}:null!=(c=e.__preSearchFilters)&&c.length?g:{},_=null!=(u=e.__postSearchFilters)&&u.length?e.__postSearchFilters.reduce(((e,t)=>t(e)),y):y,b=P(r.location.search,_),w=r.options.stringifySearch(b);let R=!0===e.hash?r.location.hash:x(e.hash,r.location.hash);return R=R?"#"+R:"",{pathname:h,search:b,searchStr:w,state:r.location.state,hash:R,href:""+h+w+R,key:e.key}},commitLocation:(e,t)=>{const n=""+Date.now()+Math.random();r.navigateTimeout&&clearTimeout(r.navigateTimeout);let o="replace";t||(o="push");return r.__.parseLocation(a.location).href===e.href&&!e.key&&(o="replace"),"replace"===o?a.replace({pathname:e.pathname,hash:e.hash,search:e.searchStr},{id:n}):a.push({pathname:e.pathname,hash:e.hash,search:e.searchStr},{id:n}),r.navigationPromise=new Promise((e=>{const t=r.resolveNavigation;r.resolveNavigation=()=>{t(),e()}})),r.navigationPromise}}};return r.update(e),null==r.options.createRouter||r.options.createRouter(r),r}const Z=["type","children","target","activeProps","inactiveProps","activeOptions","disabled","hash","search","params","to","preload","preloadDelay","preloadMaxAge","replace","style","className","onClick","onFocus","onMouseEnter","onMouseLeave","onTouchStart","onTouchEnd"],ee=["pending","caseSensitive","children"],te=["children","router"],ne=r.createContext(null),ae=r.createContext(null),oe=Boolean("undefined"!=typeof window&&window.document&&window.document.createElement)?r.useLayoutEffect:r.useEffect;function re(e){return r.createElement(ne.Provider,e)}const ie=e=>{n.useSyncExternalStore((t=>e.subscribe((()=>t()))),(()=>e.state),(()=>e.state))};function se(){const e=r.useContext(ae);return R(!e,"useRouter must be used inside a <Router> component!"),ie(e.router),e.router}function le(){return r.useContext(ne)}function ce(){var e;const t=se(),[,...n]=le(),a=n[0];if(!a)return null;const o=(()=>{var e,n;if(!a)return null;const o=null!=(e=a.__.errorElement)?e:t.options.defaultErrorElement;if("error"===a.status){if(o)return o;if(a.options.useErrorBoundary||t.options.useErrorBoundary)throw a.error;return r.createElement(de,{error:a.error})}if("loading"===a.status||"idle"===a.status){if(a.isPending){var i;const e=null!=(i=a.__.pendingElement)?i:t.options.defaultPendingElement;var s;if(a.options.pendingMs||e)return null!=(s=e)?s:null}return null}return null!=(n=a.__.element)?n:t.options.defaultElement})(),i=null!=(e=null==a?void 0:a.options.catchElement)?e:t.options.defaultCatchElement;return r.createElement(re,{value:n,key:a.matchId},r.createElement(ue,{catchElement:i},o))}class ue extends r.Component{constructor(){super(...arguments),this.state={error:!1}}componentDidCatch(e,t){console.error(e),this.setState({error:e,info:t})}render(){var e;const t=null!=(e=this.props.catchElement)?e:de;return this.state.error?"function"==typeof t?t(this.state):t:this.props.children}}function de(e){let{error:t}=e;return r.createElement("div",{style:{padding:".5rem",maxWidth:"100%"}},r.createElement("strong",{style:{fontSize:"1.2rem"}},"Something went wrong!"),r.createElement("div",{style:{height:".5rem"}}),r.createElement("div",null,r.createElement("pre",null,t.message?r.createElement("code",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".5rem",color:"red"}},t.message):null)),r.createElement("div",{style:{height:"1rem"}}),r.createElement("div",{style:{fontSize:".8em",borderLeft:"3px solid rgba(127, 127, 127, 1)",paddingLeft:".5rem",opacity:.5}},"If you are the owner of this website, it's highly recommended that you configure your own custom Catch/Error boundaries for the router. You can optionally configure a boundary for each route."))}function he(e,t){const n=se();r.useEffect((()=>{if(!t)return;let a=n.history.block((t=>{window.confirm(e)?(a(),t.retry()):n.location.pathname=window.location.pathname}));return a}),[t,location,e])}e.DefaultErrorBoundary=de,e.MatchesProvider=re,e.Outlet=ce,e.Prompt=function(e){let{message:t,when:n,children:a}=e;return he(t,null==n||n),null!=a?a:null},e.RouterProvider=function(e){let{children:t,router:n}=e,a=s(e,te);return n.update(a),ie(n),oe((()=>n.mount()),[n]),r.createElement(ae.Provider,{value:{router:n}},r.createElement(re,{value:n.state.matches},null!=t?t:r.createElement(ce,null)))},e.cascadeLoaderData=z,e.cleanPath=S,e.createBrowserHistory=d,e.createHashHistory=function(e){void 0===e&&(e={});var t=e.window,n=void 0===t?document.defaultView:t,a=n.history;function r(){var e=y(n.location.hash.substr(1)),t=e.pathname,o=void 0===t?"/":t,r=e.search,i=void 0===r?"":r,s=e.hash,l=void 0===s?"":s,c=a.state||{};return[c.idx,{pathname:o,search:i,hash:l,state:c.usr||null,key:c.key||"default"}]}var i=null;function s(){if(i)b.call(i),i=null;else{var e=o.Pop,t=r(),n=t[0],a=t[1];if(b.length){if(null!=n){var s=f-n;s&&(i={action:e,location:a,retry:function(){M(-1*s)}},M(s))}}else A(e)}}n.addEventListener(u,s),n.addEventListener("hashchange",(function(){g(r()[1])!==g(_)&&s()}));var d=o.Pop,h=r(),f=h[0],_=h[1],P=m(),b=m();function w(e){return function(){var e=document.querySelector("base"),t="";if(e&&e.getAttribute("href")){var a=n.location.href,o=a.indexOf("#");t=-1===o?a:a.slice(0,o)}return t}()+"#"+("string"==typeof e?e:g(e))}function E(e,t){return void 0===t&&(t=null),l({pathname:_.pathname,hash:"",search:""},"string"==typeof e?y(e):e,{state:t,key:v()})}function R(e,t){return[{usr:e.state,key:e.key,idx:t},w(e)]}function x(e,t,n){return!b.length||(b.call({action:e,location:t,retry:n}),!1)}function A(e){d=e;var t=r();f=t[0],_=t[1],P.call({action:d,location:_})}function M(e){a.go(e)}null==f&&(f=0,a.replaceState(l({},a.state,{idx:f}),""));var S={get action(){return d},get location(){return _},createHref:w,push:function e(t,r){var i=o.Push,s=E(t,r);if(x(i,s,(function(){e(t,r)}))){var l=R(s,f+1),c=l[0],u=l[1];try{a.pushState(c,"",u)}catch(e){n.location.assign(u)}A(i)}},replace:function e(t,n){var r=o.Replace,i=E(t,n);if(x(r,i,(function(){e(t,n)}))){var s=R(i,f),l=s[0],c=s[1];a.replaceState(l,"",c),A(r)}},go:M,back:function(){M(-1)},forward:function(){M(1)},listen:function(e){return P.push(e)},block:function(e){var t=b.push(e);return 1===b.length&&n.addEventListener(c,p),function(){t(),b.length||n.removeEventListener(c,p)}}};return S},e.createMemoryHistory=h,e.createReactRouter=function(e){const t=(e,t)=>({useRoute:function(n){void 0===n&&(n=".");const a=t.resolvePath(e.routeId,n),o=t.getRoute(a);return ie(t),_(o),o},linkProps:t=>{var n,a;const{target:o,activeProps:r=(()=>({className:"active"})),inactiveProps:l=(()=>({})),disabled:c,style:u,className:d,onClick:h,onFocus:f,onMouseEnter:p,onMouseLeave:m}=t,v=s(t,Z),g=e.buildLink(t);if("external"===g.type){const{href:e}=g;return{href:e}}const{handleClick:y,handleFocus:_,handleEnter:P,handleLeave:b,isActive:w,next:E}=g,R=e=>t=>{t.persist(),e.forEach((e=>{e&&e(t)}))},A=w&&null!=(n=x(r,{}))?n:{},M=w?{}:null!=(a=x(l,{}))?a:{};return i({},A,M,v,{href:c?void 0:E.href,onClick:R([y,h]),onFocus:R([_,f]),onMouseEnter:R([P,p]),onMouseLeave:R([b,m]),target:o,style:i({},u,A.style,M.style),className:[d,A.className,M.className].filter(Boolean).join(" ")||void 0},c?{role:"link","aria-disabled":!0}:void 0,{"data-status":w?"active":void 0})},Link:r.forwardRef(((n,a)=>{const o=e.linkProps(n);return ie(t),r.createElement("a",i({ref:a},o,{children:"function"==typeof n.children?n.children({isActive:"active"===o["data-status"]}):n.children}))})),MatchRoute:t=>{const{pending:n,caseSensitive:a}=t,o=s(t,ee),r=e.matchRoute(o,{pending:n,caseSensitive:a});return r?"function"==typeof t.children?t.children(r):t.children:null}});return $(i({},e,{createRouter:e=>{const n={useState:()=>(ie(e),e.state),useMatch:t=>{ie(e),_(t!==G);const n=null==(a=le())?void 0:a[0];var a;const o=e.state.matches.find((e=>e.routeId===t));return _(o),_(n.routeId==(null==o?void 0:o.routeId),(null==o||o.routeId,n.routeId,null==o||o.routeId)),o||_("Match not found!"),o}},a=t(e.getRoute("/"),e);Object.assign(e,n,a)},createRoute:e=>{let{router:n,route:a}=e;const o=t(a,n);Object.assign(a,o)},createElement:async e=>{if("function"==typeof e){const t=await e();return"object"==typeof t&&t.default?r.createElement(t.default):t}return e}}))},e.createRoute=H,e.createRouteConfig=function e(t,n,a,o,r){void 0===t&&(t={}),void 0===a&&(a=!0),a&&(t.path=G),o===G&&(o="");let i=a?G:t.path;i&&"/"!==i&&(i=k(i));const s=i||t.id;let l=M([o,s]);i===G&&(i="/"),l!==G&&(l=M(["/",l]));const c=l===G?"/":L(M([r,i]));return{id:l,routeId:s,path:i,fullPath:c,options:t,children:n,createChildren:n=>e(t,n((t=>e(t,void 0,!1,l,c))),!1,o,r),addChildren:n=>e(t,n,!1,o,r),createRoute:t=>e(t,void 0,!1,l,c)}},e.createRouteMatch=q,e.createRouter=$,e.decode=B,e.defaultParseSearch=K,e.defaultStringifySearch=Q,e.encode=F,e.functionalUpdate=x,e.interpolatePath=j,e.invariant=_,e.joinPaths=M,e.last=E,e.matchByPath=T,e.matchPathname=D,e.parsePathname=O,e.parseSearchWith=V,e.pick=A,e.replaceEqualDeep=P,e.resolvePath=C,e.rootRouteId=G,e.stringifySearchWith=J,e.trimPath=k,e.trimPathLeft=I,e.trimPathRight=L,e.usePrompt=he,e.warning=R,Object.defineProperty(e,"__esModule",{value:!0})}));
21
+ */class c{listeners=new Set;batching=!1;queue=[];constructor(t,e){this.state=t,this.options=e}subscribe=t=>{this.listeners.add(t);const e=this.options?.onSubscribe?.(t,this);return()=>{this.listeners.delete(t),e?.()}};setState=t=>{const e=this.state;this.state=this.options?.updateFn?this.options.updateFn(e)(t):t(e),this.state!==e&&(this.options?.onUpdate?.(this.state,e),this.queue.push((()=>{this.listeners.forEach((t=>t(this.state,e)))})),this.#t())};#t=()=>{this.batching||(this.queue.forEach((t=>t())),this.queue=[])};batch=t=>{this.batching=!0,t(),this.batching=!1,this.#t()}}
22
+ /**
23
+ * router
24
+ *
25
+ * Copyright (c) TanStack
26
+ *
27
+ * This source code is licensed under the MIT license found in the
28
+ * LICENSE.md file in the root directory of this source tree.
29
+ *
30
+ * @license MIT
31
+ */const h="popstate";function u(t){let e=t.getLocation(),r=()=>{},o=new Set;const s=()=>{e=t.getLocation(),o.forEach((t=>t()))};return{get location(){return e},listen:e=>(0===o.size&&(r=t.listener(s)),o.add(e),()=>{o.delete(e),0===o.size&&r()}),push:(e,r)=>{t.pushState(e,r),s()},replace:(e,r)=>{t.replaceState(e,r),s()},go:e=>{t.go(e),s()},back:()=>{t.back(),s()},forward:()=>{t.forward(),s()}}}function l(t){const e=t?.getHref??(()=>`${window.location.pathname}${window.location.hash}${window.location.search}`),r=t?.createHref??(t=>t);return u({getLocation:()=>p(e(),history.state),listener:t=>(window.addEventListener(h,t),()=>{window.removeEventListener(h,t)}),pushState:(t,e)=>{window.history.pushState({...e,key:f()},"",r(t))},replaceState:(t,e)=>{window.history.replaceState({...e,key:f()},"",r(t))},back:()=>window.history.back(),forward:()=>window.history.forward(),go:t=>window.history.go(t)})}function d(t={initialEntries:["/"]}){const e=t.initialEntries;let r=t.initialIndex??e.length-1,o={};return u({getLocation:()=>p(e[r],o),listener:()=>()=>{},pushState:(t,s)=>{o={...s,key:f()},e.push(t),r++},replaceState:(t,s)=>{o={...s,key:f()},e[r]=t},back:()=>{r--},forward:()=>{r=Math.min(r+1,e.length-1)},go:t=>window.history.go(t)})}function p(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,o):"",search:o>-1?t.substring(o):"",state:e}}function f(){return(Math.random()+1).toString(36).substring(7)}function m(t){return t[t.length-1]}function y(t,e){return"function"==typeof t?t(e):t}function g(t,e){return e.reduce(((e,r)=>(e[r]=t[r],e)),{})}function v(t,e){if(t===e)return t;const r=e,o=Array.isArray(t)&&Array.isArray(r);if(o||w(t)&&w(r)){const e=o?t.length:Object.keys(t).length,s=o?r:Object.keys(r),a=s.length,n=o?[]:{};let i=0;for(let e=0;e<a;e++){const a=o?e:s[e];n[a]=v(t[a],r[a]),n[a]===t[a]&&i++}return e===a&&i===e?t:n}return r}function w(t){if(!S(t))return!1;const e=t.constructor;if(void 0===e)return!0;const r=e.prototype;return!!S(r)&&!!r.hasOwnProperty("isPrototypeOf")}function S(t){return"[object Object]"===Object.prototype.toString.call(t)}function b(t,e){return t===e||typeof t==typeof e&&(w(t)&&w(e)?!Object.keys(e).some((r=>!b(t[r],e[r]))):!(!Array.isArray(t)||!Array.isArray(e))&&(t.length===e.length&&t.every(((t,r)=>b(t,e[r])))))}function L(t){return E(t.filter(Boolean).join("/"))}function E(t){return t.replace(/\/{2,}/g,"/")}function P(t){return"/"===t?t:t.replace(/^\/{1,}/,"")}function x(t){return"/"===t?t:t.replace(/\/{1,}$/,"")}function C(t){return x(P(t))}function R(t,e,r){e=e.replace(new RegExp(`^${t}`),"/"),r=r.replace(new RegExp(`^${t}`),"/");let o=_(e);const s=_(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&&"/"===m(o)?.value&&o.pop(),o.pop();else{if("."===t.value)return;o.push(t)}}));return E(L([t,...o.map((t=>t.value))]))}function _(t){if(!t)return[];const e=[];if("/"===(t=E(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?{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 M(t,e,r){return L(_(t).map((t=>"$"!==t.value||r?"param"===t.type?e[t.value.substring(1)]??"":t.value:"")))}function k(t,e,r){const o=O(t,e,r);if(!r.to||o)return o??{}}function O(t,e,r){if(!e.startsWith(t))return;const o=_(e="/"!=t?e.substring(t.length):e),s=_(`${r.to??"$"}`);"/"===m(o)?.value&&o.pop();const a={};return(()=>{for(let t=0;t<Math.max(o.length,s.length);t++){const e=o[t],n=s[t],i=t===s.length-1,c=t===o.length-1;if(n){if("wildcard"===n.type)return!!e?.value&&(a.$=L(o.slice(t).map((t=>t.value))),!0);if("pathname"===n.type){if("/"===n.value&&!e?.value)return!0;if(e)if(r.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!!r.fuzzy}return!0})()?a:void 0}function j(t,e){var r,o,s,a="";for(r in t)if(void 0!==(s=t[r]))if(Array.isArray(s))for(o=0;o<s.length;o++)a&&(a+="&"),a+=encodeURIComponent(r)+"="+encodeURIComponent(s[o]);else a&&(a+="&"),a+=encodeURIComponent(r)+"="+encodeURIComponent(s);return(e||"")+a}function $(t){if(!t)return"";var e=decodeURIComponent(t);return"false"!==e&&("true"===e||("0"===e.charAt(0)?e:0*+e==0?+e:e))}function I(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 A="__root__";class T{constructor(t){this.options=t||{},this.isRoot=!t?.getParentRoute}init=t=>{this.originalIndex=t.originalIndex,this.router=t.router;const e=this.options,r=!e?.path&&!e?.id,o=this.options?.getParentRoute?.();r?this.path=A:n(o);let s=r?A:e.path;s&&"/"!==s&&(s=C(s));const a=e?.id||s;let i=r?A:L([o.id===A?"":o.id,a]);s===A&&(s="/"),i!==A&&(i=L(["/",i]));const c=i===A?"/":x(L([o.fullPath,s]));this.path=s,this.id=i,this.fullPath=c};addChildren=t=>(this.children=t,this);generate=t=>{n(!1)}}class F extends T{constructor(t){super(t)}static withRouterContext=()=>t=>new F(t)}const D=B(JSON.parse),N=H(JSON.stringify);function B(t){return e=>{"?"===e.substring(0,1)&&(e=e.substring(1));let r=I(e);for(let e in r){const o=r[e];if("string"==typeof o)try{r[e]=t(o)}catch(t){}}return r}}function H(t){return e=>{(e={...e})&&Object.keys(e).forEach((r=>{const o=e[r];if(void 0===o||void 0===o)delete e[r];else if(o&&"object"==typeof o&&null!==o)try{e[r]=t(o)}catch(t){}}));const r=j(e).toString();return r?`?${r}`:""}}const U=async({router:t,routeMatch:e})=>{const r=t.buildNext({to:".",search:t=>({...t??{},__data:{matchId:e.id}})}),o=await fetch(r.href,{method:"GET",signal:e.abortController.signal});if(o.ok)return o.json();throw new Error("Failed to fetch match data")};class z{#e;startedLoadingAt=Date.now();resolveNavigation=()=>{};constructor(t){this.options={defaultPreloadDelay:50,context:void 0,...t,stringifySearch:t?.stringifySearch??N,parseSearch:t?.parseSearch??D,fetchServerDataFn:t?.fetchServerDataFn??U},this.store=new c(W(),{onUpdate:t=>{this.state=t}}),this.state=this.store.state,this.basepath="",this.update(t),this.options.Router?.(this)}reset=()=>{this.store.setState((t=>Object.assign(t,W())))};mount=()=>{if(!q){this.state.currentMatches.length||this.safeLoad();const t="visibilitychange",e="focus";return window.addEventListener&&(window.addEventListener(t,this.#r,!1),window.addEventListener(e,this.#r,!1)),()=>{window.removeEventListener&&(window.removeEventListener(t,this.#r),window.removeEventListener(e,this.#r))}}return()=>{}};update=t=>{if(Object.assign(this.options,t),!this.history||this.options.history&&this.options.history!==this.history){this.#e&&this.#e(),this.history=this.options.history??(q?d():l());const t=this.#o();this.store.setState((e=>({...e,latestLocation:t,currentLocation:t}))),this.#e=this.history.listen((()=>{this.safeLoad({next:this.#o(this.state.latestLocation)})}))}const{basepath:e,routeTree:r}=this.options;return this.basepath=`/${C(e??"")??""}`,r&&(this.routesById={},this.routeTree=this.#s(r)),this};buildNext=t=>{const e=this.#a(t),r=this.matchRoutes(e.pathname),o=r.map((t=>t.route.options.preSearchFilters??[])).flat().filter(Boolean),s=r.map((t=>t.route.options.postSearchFilters??[])).flat().filter(Boolean);return this.#a({...t,__preSearchFilters:o,__postSearchFilters:s})};cancelMatches=()=>{[...this.state.currentMatches,...this.state.pendingMatches||[]].forEach((t=>{t.cancel()}))};safeLoad=t=>{this.load(t).catch((t=>{console.warn(t),n(!1)}))};load=async t=>{let e=Date.now();const r=e;let o;if(this.startedLoadingAt=r,this.cancelMatches(),this.store.batch((()=>{t?.next&&this.store.setState((e=>({...e,latestLocation:t.next}))),o=this.matchRoutes(this.state.latestLocation.pathname,{strictParseParams:!0}),this.store.setState((t=>({...t,status:"pending",pendingMatches:o,pendingLocation:this.state.latestLocation})))})),await this.loadMatches(o,this.state.pendingLocation),this.startedLoadingAt!==r)return this.navigationPromise;const s=this.state.currentMatches,a=[],n=[];s.forEach((t=>{o.find((e=>e.id===t.id))?n.push(t):a.push(t)}));const i=o.filter((t=>!s.find((e=>e.id===t.id))));e=Date.now(),a.forEach((t=>{t.__onExit?.({params:t.params,search:t.state.routeSearch}),"error"===t.state.status&&this.store.setState((t=>({...t,status:"idle",error:void 0})))})),n.forEach((t=>{t.route.options.onTransition?.({params:t.params,search:t.state.routeSearch})})),i.forEach((t=>{t.__onExit=t.route.options.onLoaded?.({params:t.params,search:t.state.search})}));const c=this.state.currentLocation;this.store.setState((t=>({...t,status:"idle",currentLocation:this.state.latestLocation,currentMatches:o,pendingLocation:void 0,pendingMatches:void 0}))),o.forEach((t=>{t.__commit()})),c.href!==this.state.currentLocation.href&&this.options.onRouteChange?.(),this.resolveNavigation()};getRoute=t=>{const e=this.routesById[t];return n(e),e};loadRoute=async(t=this.state.latestLocation)=>{const e=this.buildNext(t),r=this.matchRoutes(e.pathname,{strictParseParams:!0});return await this.loadMatches(r,e),r};preloadRoute=async(t=this.state.latestLocation)=>{const e=this.buildNext(t),r=this.matchRoutes(e.pathname,{strictParseParams:!0});return await this.loadMatches(r,e,{preload:!0}),r};matchRoutes=(t,e)=>{const r=[];if(!this.routeTree)return r;const o=[...this.state.currentMatches,...this.state.pendingMatches??[]],s=async a=>{let n=m(r)?.params??{};const i=this.options.filterRoutes?.(a)??a;let c=[];const h=(r,o)=>(o.some((o=>{const s=o.children;if(!o.path&&s?.length)return h([...c,o],s);const a=!("/"===o.path&&!s?.length),i=k(this.basepath,t,{to:o.fullPath,fuzzy:a,caseSensitive:o.options.caseSensitive??this.options.caseSensitive});if(i){let t;try{t=o.options.parseParams?.(i)??i}catch(t){if(e?.strictParseParams)throw t}n={...n,...t}}return i&&(c=[...r,o]),!!c.length})),!!c.length);if(h([],i),!c.length)return;c.forEach((t=>{const e=M(t.path,n),s=M(t.id,n,!0),a=o.find((t=>t.id===s))||new V(this,t,{id:s,params:n,pathname:L([this.basepath,e])});r.push(a)}));const u=m(c).children;u?.length&&s(u)};return s([this.routeTree]),r};loadMatches=async(t,e,r)=>{await Promise.all(t.map((async t=>{try{await(t.route.options.beforeLoad?.({router:this,match:t}))}catch(e){throw r?.preload||t.route.options.onBeforeLoadError?.(e),t.route.options.onError?.(e),e}})));const o=t.map((async(o,s)=>{const a=t[s-1];o.__load({preload:r?.preload,location:e,parentMatch:a}),await o.__loadPromise,a&&await a.__loadPromise}));await Promise.all(o)};reload=()=>{this.navigate({fromCurrent:!0,replace:!0,search:!0})};resolvePath=(t,e)=>R(this.basepath,t,E(e));navigate=async({from:t,to:e="",search:r,hash:o,replace:s,params:a})=>{const i=String(e),c=void 0===t?t:String(t);let h;try{new URL(`${i}`),h=!0}catch(t){}return n(!h),this.#n({from:c,to:i,search:r,hash:o,replace:s,params:a})};matchRoute=(t,e)=>{t={...t,to:t.to?this.resolvePath(t.from??"",t.to):void 0};const r=this.buildNext(t),o=e?.pending?this.state.pendingLocation:this.state.currentLocation;if(!o)return!1;const s=k(this.basepath,o.pathname,{...e,to:r.pathname});return!!s&&(e?.includeSearch??1?!!b(o.search,r.search)&&s:s)};buildLink=({from:t,to:e=".",search:r,params:o,hash:s,target:a,replace:n,activeOptions:i,preload:c,preloadDelay:h,disabled:u})=>{try{return new URL(`${e}`),{type:"external",href:e}}catch(t){}const l={from:t,to:e,search:r,params:o,hash:s,replace:n},d=this.buildNext(l);c=c??this.options.defaultPreload;const p=h??this.options.defaultPreloadDelay??0,f=this.state.currentLocation.pathname.split("/"),m=d.pathname.split("/").every(((t,e)=>t===f[e])),y=i?.exact?this.state.currentLocation.pathname===d.pathname:m,g=!i?.includeHash||this.state.currentLocation.hash===d.hash,v=!(i?.includeSearch??1)||b(this.state.currentLocation.search,d.search);return{type:"internal",next:d,handleFocus:t=>{c&&this.preloadRoute(l).catch((t=>{console.warn(t),console.warn("Error preloading route! ☝️")}))},handleClick:t=>{u||function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}(t)||t.defaultPrevented||a&&"_self"!==a||0!==t.button||(t.preventDefault(),this.#n(l))},handleEnter:t=>{const e=t.target||{};if(c){if(e.preloadTimeout)return;e.preloadTimeout=setTimeout((()=>{e.preloadTimeout=null,this.preloadRoute(l).catch((t=>{console.warn(t),console.warn("Error preloading route! ☝️")}))}),p)}},handleLeave:t=>{const e=t.target||{};e.preloadTimeout&&(clearTimeout(e.preloadTimeout),e.preloadTimeout=null)},handleTouchStart:t=>{this.preloadRoute(l).catch((t=>{console.warn(t),console.warn("Error preloading route! ☝️")}))},isActive:y&&g&&v,disabled:u}};dehydrate=()=>({state:{...g(this.state,["latestLocation","currentLocation","status","lastUpdated"]),currentMatches:this.state.currentMatches.map((t=>({id:t.id,state:{status:t.state.status}})))}});hydrate=t=>{this.store.setState((e=>{const r=this.matchRoutes(t.state.latestLocation.pathname,{strictParseParams:!0});return r.forEach(((e,r)=>{const o=t.state.currentMatches[r];n(o&&o.id===e.id),e.store.setState((t=>({...t,...o.state})))})),{...e,...t.state,currentMatches:r}}))};#s=t=>{const e=t=>{t.forEach(((t,r)=>{t.init({originalIndex:r,router:this});if(this.routesById[t.id])throw new Error;this.routesById[t.id]=t;const o=t.children;o?.length&&e(o)}))};return e([t]),t};#o=t=>{let{pathname:e,search:r,hash:o,state:s}=this.history.location;const a=this.options.parseSearch(r);return{pathname:e,searchStr:r,search:v(t?.search,a),hash:o.split("#").reverse()[0]??"",href:`${e}${r}${o}`,state:s,key:s?.key||"__init__"}};#r=()=>{this.safeLoad()};#a=(t={})=>{t.fromCurrent=t.fromCurrent??""===t.to;const e=t.fromCurrent?this.state.latestLocation.pathname:t.from??this.state.latestLocation.pathname;let r=R(this.basepath??"/",e,`${t.to??""}`);const o=this.matchRoutes(this.state.latestLocation.pathname,{strictParseParams:!0}),s=this.matchRoutes(r),a={...m(o)?.params};let n=!0===(t.params??!0)?a:y(t.params,a);n&&s.map((t=>t.route.options.stringifyParams)).filter(Boolean).forEach((t=>{Object.assign({},n,t(n))})),r=M(r,n??{});const i=t.__preSearchFilters?.length?t.__preSearchFilters?.reduce(((t,e)=>e(t)),this.state.latestLocation.search):this.state.latestLocation.search,c=!0===t.search?i:t.search?y(t.search,i)??{}:t.__preSearchFilters?.length?i:{},h=t.__postSearchFilters?.length?t.__postSearchFilters.reduce(((t,e)=>e(t)),c):c,u=v(this.state.latestLocation.search,h),l=this.options.stringifySearch(u);let d=!0===t.hash?this.state.latestLocation.hash:y(t.hash,this.state.latestLocation.hash);return d=d?`#${d}`:"",{pathname:r,search:u,searchStr:l,state:this.state.latestLocation.state,hash:d,href:`${r}${l}${d}`,key:t.key}};#n=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.latestLocation.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.navigationPromise=new Promise((t=>{const e=this.resolveNavigation;this.resolveNavigation=()=>{e(),t()}}))}}const q="undefined"==typeof window||!window.document.createElement;function W(){return{status:"idle",latestLocation:null,currentLocation:null,currentMatches:[],lastUpdated:Date.now()}}function K(t){return!!t?.isRedirect}const J=["component","errorComponent","pendingComponent"];class V{abortController=new AbortController;onLoaderDataListeners=new Set;constructor(t,e,r){Object.assign(this,{route:e,router:t,id:r.id,pathname:r.pathname,params:r.params,store:new c({updatedAt:0,routeSearch:{},search:{},status:"idle"},{onUpdate:t=>{this.state=t}})}),this.state=this.store.state,J.map((async t=>{const e=this.route.options[t];"function"!=typeof this[t]&&(this[t]=e)})),"idle"!==this.state.status||this.#i()||this.store.setState((t=>({...t,status:"success"})))}#i=()=>!(!this.route.options.onLoad&&!J.some((t=>this.route.options[t]?.preload)));__commit=()=>{const{routeSearch:t,search:e,context:r,routeContext:o}=this.#c({location:this.router.state.currentLocation});this.context=r,this.routeContext=o,this.store.setState((r=>({...r,routeSearch:v(r.routeSearch,t),search:v(r.search,e)})))};cancel=()=>{this.abortController?.abort()};#h=t=>{const e=this.parentMatch?this.parentMatch.#h(t):{search:t.location.search,routeSearch:t.location.search};try{const t=("object"==typeof this.route.options.validateSearch?this.route.options.validateSearch.parse:this.route.options.validateSearch)?.(e.search)??{};return{routeSearch:t,search:{...e.search,...t}}}catch(t){if(K(t))throw t;this.route.options.onValidateSearchError?.(t);const e=new Error("Invalid search params found",{cause:t});throw e.code="INVALID_SEARCH_PARAMS",e}};#c=t=>{const{search:e,routeSearch:r}=this.#h(t),o=this.route.options.getContext?.({parentContext:this.parentMatch?.routeContext??{},context:this.parentMatch?.context??this.router?.options.context??{},params:this.params,search:e})||{};return{routeSearch:r,search:e,context:{...this.parentMatch?.context??this.router?.options.context,...o},routeContext:o}};__load=async t=>{let e;this.parentMatch=t.parentMatch;try{e=this.#c(t)}catch(t){return K(t)?void this.router.navigate(t):(this.route.options.onError?.(t),void this.store.setState((e=>({...e,status:"error",error:t}))))}const{routeSearch:r,search:o,context:s,routeContext:a}=e;if("pending"!==this.state.status)return this.__loadPromise=Promise.resolve().then((async()=>{const e=""+Date.now()+Math.random();this.#u=e;const n=()=>e!==this.#u?this.__loadPromise:void 0;let i;"idle"===this.state.status&&this.store.setState((t=>({...t,status:"pending"})));const c=(async()=>{await Promise.all(J.map((async t=>{const e=this.route.options[t];this[t]?.preload&&(this[t]=await this.router.options.loadComponent(e))})))})(),h=Promise.resolve().then((()=>{if(this.route.options.onLoad)return this.route.options.onLoad({params:this.params,routeSearch:r,search:o,signal:this.abortController.signal,preload:!!t?.preload,routeContext:a,context:s})}));try{if(await Promise.all([c,h]),i=n())return await i;this.store.setState((t=>({...t,error:void 0,status:"success",updatedAt:Date.now()})))}catch(t){if(K(t))return void this.router.navigate(t);this.route.options.onLoadError?.(t),this.route.options.onError?.(t),this.store.setState((e=>({...e,error:t,status:"error",updatedAt:Date.now()})))}finally{delete this.__loadPromise}})),this.__loadPromise};#u=""}
32
+ /**
33
+ * react-store
34
+ *
35
+ * Copyright (c) TanStack
36
+ *
37
+ * This source code is licensed under the MIT license found in the
38
+ * LICENSE.md file in the root directory of this source tree.
39
+ *
40
+ * @license MIT
41
+ */function G(t,e=(t=>t),o){return r.useSyncExternalStoreWithSelector(t.subscribe,(()=>t.state),(()=>t.state),e,o?Q:void 0)}function Q(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!1;for(let o=0;o<r.length;o++)if(!Object.prototype.hasOwnProperty.call(e,r[o])||!Object.is(t[r[o]],e[r[o]]))return!1;return!0}function X(t){const e=et(),{type:r,children:o,target:a,activeProps:n=(()=>({className:"active"})),inactiveProps:i=(()=>({})),activeOptions:c,disabled:h,hash:u,search:l,params:d,to:p=".",preload:f,preloadDelay:m,replace:g,style:v,className:w,onClick:S,onFocus:b,onMouseEnter:L,onMouseLeave:E,onTouchStart:P,...x}=t,C=e.buildLink(t);if("external"===C.type){const{href:t}=C;return{href:t}}const{handleClick:R,handleFocus:_,handleEnter:M,handleLeave:k,handleTouchStart:O,isActive:j,next:$}=C,I=t=>e=>{e.persist&&e.persist(),t.filter(Boolean).forEach((t=>{e.defaultPrevented||t(e)}))},A=j?y(n,{})??{}:{},T=j?{}:y(i,{})??{};return{...A,...T,...x,href:h?void 0:$.href,onClick:I([S,t=>{s.startTransition?s.startTransition((()=>{R(t)})):R(t)}]),onFocus:I([b,_]),onMouseEnter:I([L,M]),onMouseLeave:I([E,k]),onTouchStart:I([P,O]),target:a,style:{...v,...A.style,...T.style},className:[w,A.className,T.className].filter(Boolean).join(" ")||void 0,...h?{role:"link","aria-disabled":!0}:void 0,"data-status":j?"active":void 0}}const Y=s.forwardRef(((t,e)=>{const r=X(t);return s.createElement("a",a({ref:e},r,{children:"function"==typeof t.children?t.children({isActive:"active"===r["data-status"]}):t.children}))}));const Z=s.createContext(null),tt=s.createContext(null);function et(){const t=s.useContext(tt);return G(t.router.store),t.router}function rt(){return s.useContext(Z)}function ot(t){const e=et(),r=rt()[0],o=t?.from?e.state.currentMatches.find((e=>e.route.id===t?.from)):r;return n(o,t?.from&&t.from),(t?.strict??1)&&n(r.route.id==o?.route.id,(o?.route.id,r.route.id,o?.route.id,o?.route.id)),G(o.store,(e=>t?.track?.(o)??o),t?.shallow),o}function st(){const t=et();return s.useCallback((e=>{const{pending:r,caseSensitive:o,...s}=e;return t.matchRoute(s,{pending:r,caseSensitive:o})}),[])}function at(){const t=rt().slice(1),e=t[0];return e?s.createElement(nt,{matches:t,match:e}):null}function nt({matches:t,match:e}){const r=et();G(e.store,(t=>[t.status,t.error]),!0);const o=s.useCallback((()=>null),[]),a=s.useCallback((t=>{if("error"===t.match.state.status)throw t.match.state.error;if("success"===t.match.state.status)return s.createElement(t.match.component??r.options.defaultComponent??at);if("pending"===t.match.state.status)throw t.match.__loadPromise;n(!1)}),[]),i=e.pendingComponent??r.options.defaultPendingComponent??o,c=e.errorComponent??r.options.defaultErrorComponent,h=e.route.options.wrapInSuspense??1?s.Suspense:it,u=c?ct:it;return s.createElement(Z.Provider,{value:t},s.createElement(h,{fallback:s.createElement(i,null)},s.createElement(u,{key:e.route.id,errorComponent:c,onCatch:()=>{e.id}},s.createElement(a,{match:e}))))}function it(t){return s.createElement(s.Fragment,null,t.children)}class ct extends s.Component{state={error:!1,info:void 0};componentDidCatch(t,e){this.props.onCatch(t,e),console.error(t),this.setState({error:t,info:e})}render(){return s.createElement(ht,a({},this.props,{errorState:this.state,reset:()=>this.setState({})}))}}function ht(t){const[e,r]=s.useState(t.errorState),o=et(),a=t.errorComponent??ut,n=s.useRef("");return s.useEffect((()=>{e&&o.state.currentLocation.key!==n.current&&r({}),n.current=o.state.currentLocation.key}),[e,o.state.currentLocation.key]),s.useEffect((()=>{t.errorState.error&&r(t.errorState)}),[t.errorState.error]),t.errorState.error&&e.error?s.createElement(a,e):t.children}function ut({error:t}){return s.createElement("div",{style:{padding:".5rem",maxWidth:"100%"}},s.createElement("strong",{style:{fontSize:"1.2rem"}},"Something went wrong!"),s.createElement("div",{style:{height:".5rem"}}),s.createElement("div",null,s.createElement("pre",null,t.message?s.createElement("code",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".5rem",color:"red"}},t.message):null)))}t.ErrorComponent=ut,t.Link=Y,t.MatchRoute=function(t){const e=st()(t);return e?"function"==typeof t.children?t.children(e):e?t.children:null:null},t.Navigate=function(t){const e=et();return s.useLayoutEffect((()=>{e.navigate(t)}),[]),null},t.Outlet=at,t.ReactRouter=class extends z{constructor(t){super({...t,loadComponent:async t=>(t.preload&&await t.preload(),t)})}},t.RootRoute=F,t.Route=T,t.RouteMatch=V,t.Router=z,t.RouterProvider=function({router:t,...e}){t.update(e);const r=G(t.store,(t=>t.currentMatches));return s.useEffect(t.mount,[t]),s.createElement(tt.Provider,{value:{router:t}},s.createElement(Z.Provider,{value:[void 0,...r]},s.createElement(ct,{errorComponent:ut,onCatch:()=>{}},s.createElement(at,null))))},t.cleanPath=E,t.createBrowserHistory=l,t.createHashHistory=function(){return l({getHref:()=>window.location.hash.substring(1),createHref:t=>`#${t}`})},t.createMemoryHistory=d,t.decode=I,t.defaultFetchServerDataFn=U,t.defaultParseSearch=D,t.defaultStringifySearch=N,t.encode=j,t.functionalUpdate=y,t.interpolatePath=M,t.invariant=n,t.isPlainObject=w,t.isRedirect=K,t.joinPaths=L,t.last=m,t.lazy=function(t){const e=s.lazy(t);return e.preload=async()=>{await t()},e},t.matchByPath=O,t.matchPathname=k,t.matchesContext=Z,t.parsePathname=_,t.parseSearchWith=B,t.partialDeepEqual=b,t.pick=g,t.redirect=function(t){return t.isRedirect=!0,t},t.replaceEqualDeep=v,t.resolvePath=R,t.rootRouteId=A,t.routerContext=tt,t.stringifySearchWith=H,t.trimPath=C,t.trimPathLeft=P,t.trimPathRight=x,t.useLinkProps=X,t.useMatch=ot,t.useMatchRoute=st,t.useMatches=rt,t.useNavigate=function(t){const e=et();return s.useCallback((r=>e.navigate({...t,...r})),[])},t.useParams=function(t){const e=et();return G(e.store,(e=>{const r=m(e.currentMatches)?.params;return t?.track?.(r)??r}),!0),m(e.state.currentMatches)?.params},t.useRoute=function(t){const e=et().getRoute(t);return n(e),e},t.useRouter=function(t,e){const r=et();return G(r.store,t,e),r},t.useRouterContext=et,t.useSearch=function(t){const e=ot(t);return G(e.store,(e=>t?.track?.(e.search)??e.search),!0),e.state.search},t.useStore=G,t.warning=i,Object.defineProperty(t,"__esModule",{value:!0})}));
22
42
  //# sourceMappingURL=index.production.js.map