blokctl 0.2.11 → 0.4.0

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.
Files changed (39) hide show
  1. package/dist/commands/create/project.js +63 -3
  2. package/dist/commands/create/utils/Examples.d.ts +3 -3
  3. package/dist/commands/create/utils/Examples.js +109 -13
  4. package/dist/commands/dev/index.js +50 -13
  5. package/dist/commands/generate/validators/WorkflowValidator.js +1 -1
  6. package/dist/commands/migrate/index.js +22 -0
  7. package/dist/commands/migrate/paths.d.ts +2 -0
  8. package/dist/commands/migrate/paths.js +267 -0
  9. package/dist/commands/migrate/workflows.d.ts +3 -0
  10. package/dist/commands/migrate/workflows.js +333 -0
  11. package/dist/commands/trace/index.js +6 -2
  12. package/dist/commands/trace/startStudio.d.ts +2 -0
  13. package/dist/commands/trace/startStudio.js +76 -11
  14. package/dist/index.js +1 -0
  15. package/dist/services/health-probe.d.ts +5 -0
  16. package/dist/services/health-probe.js +35 -0
  17. package/dist/services/runtime-detector.d.ts +3 -0
  18. package/dist/services/runtime-detector.js +21 -2
  19. package/dist/services/runtime-setup.d.ts +3 -0
  20. package/dist/services/runtime-setup.js +11 -2
  21. package/dist/studio-dist/assets/charts-Dh48HebV.js +68 -0
  22. package/dist/studio-dist/assets/graph-DWteCadQ.js +7 -0
  23. package/dist/studio-dist/assets/{icons-zP8LLgPh.js → icons-N5J4OhGx.js} +66 -51
  24. package/dist/studio-dist/assets/index-D6hOoOID.css +1 -0
  25. package/dist/studio-dist/assets/index-D_CdNmTc.js +42 -0
  26. package/dist/studio-dist/assets/react-vendor-l0sNRNKZ.js +1 -0
  27. package/dist/studio-dist/assets/tanstack-query-Day3Mt-4.js +17 -0
  28. package/dist/studio-dist/assets/tanstack-router-BB95iErN.js +25 -0
  29. package/dist/studio-dist/assets/{tanstack-table-DhwRvuH2.js → tanstack-table-Biem1hxK.js} +1 -1
  30. package/dist/studio-dist/favicon.svg +7 -4
  31. package/dist/studio-dist/index.html +19 -10
  32. package/package.json +15 -12
  33. package/dist/studio-dist/assets/charts-Dso0hPUR.js +0 -68
  34. package/dist/studio-dist/assets/graph-CsV2nWGn.js +0 -23
  35. package/dist/studio-dist/assets/index-CLyEkXMx.css +0 -1
  36. package/dist/studio-dist/assets/index-CNXFX_ar.js +0 -27
  37. package/dist/studio-dist/assets/react-vendor--Eh9ivFN.js +0 -17
  38. package/dist/studio-dist/assets/tanstack-query-CiM1U6F5.js +0 -1
  39. package/dist/studio-dist/assets/tanstack-router-Btjy0MKq.js +0 -25
@@ -1,17 +0,0 @@
1
- var ue=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function oe(p){return p&&p.__esModule&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p}var I={exports:{}},n={};/**
2
- * @license React
3
- * react.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var K;function te(){if(K)return n;K=1;var p=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),m=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),t=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),C=Symbol.iterator;function A(e){return e===null||typeof e!="object"?null:(e=C&&e[C]||e["@@iterator"],typeof e=="function"?e:null)}var U={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Y=Object.assign,b={};function O(e,r,o){this.props=e,this.context=r,this.refs=b,this.updater=o||U}O.prototype.isReactComponent={},O.prototype.setState=function(e,r){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,r,"setState")},O.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function k(){}k.prototype=O.prototype;function H(e,r,o){this.props=e,this.context=r,this.refs=b,this.updater=o||U}var N=H.prototype=new k;N.constructor=H,Y(N,O.prototype),N.isPureReactComponent=!0;var q=Array.isArray;function D(){}var a={H:null,A:null,T:null,S:null},x=Object.prototype.hasOwnProperty;function j(e,r,o){var u=o.ref;return{$$typeof:p,type:e,key:r,ref:u!==void 0?u:null,props:o}}function Q(e,r){return j(e.type,r,e.props)}function L(e){return typeof e=="object"&&e!==null&&e.$$typeof===p}function Z(e){var r={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(o){return r[o]})}var G=/\/+/g;function M(e,r){return typeof e=="object"&&e!==null&&e.key!=null?Z(""+e.key):r.toString(36)}function J(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(D,D):(e.status="pending",e.then(function(r){e.status==="pending"&&(e.status="fulfilled",e.value=r)},function(r){e.status==="pending"&&(e.status="rejected",e.reason=r)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function S(e,r,o,u,s){var f=typeof e;(f==="undefined"||f==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(f){case"bigint":case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case p:case R:l=!0;break;case c:return l=e._init,S(l(e._payload),r,o,u,s)}}if(l)return s=s(e),l=u===""?"."+M(e,0):u,q(s)?(o="",l!=null&&(o=l.replace(G,"$&/")+"/"),S(s,r,o,"",function(ee){return ee})):s!=null&&(L(s)&&(s=Q(s,o+(s.key==null||e&&e.key===s.key?"":(""+s.key).replace(G,"$&/")+"/")+l)),r.push(s)),1;l=0;var E=u===""?".":u+":";if(q(e))for(var d=0;d<e.length;d++)u=e[d],f=E+M(u,d),l+=S(u,r,o,f,s);else if(d=A(e),typeof d=="function")for(e=d.call(e),d=0;!(u=e.next()).done;)u=u.value,f=E+M(u,d++),l+=S(u,r,o,f,s);else if(f==="object"){if(typeof e.then=="function")return S(J(e),r,o,u,s);throw r=String(e),Error("Objects are not valid as a React child (found: "+(r==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":r)+"). If you meant to render a collection of children, use an array instead.")}return l}function h(e,r,o){if(e==null)return e;var u=[],s=0;return S(e,u,"","",function(f){return r.call(o,f,s++)}),u}function V(e){if(e._status===-1){var r=e._result;r=r(),r.then(function(o){(e._status===0||e._status===-1)&&(e._status=1,e._result=o)},function(o){(e._status===0||e._status===-1)&&(e._status=2,e._result=o)}),e._status===-1&&(e._status=0,e._result=r)}if(e._status===1)return e._result.default;throw e._result}var z=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},F={map:h,forEach:function(e,r,o){h(e,function(){r.apply(this,arguments)},o)},count:function(e){var r=0;return h(e,function(){r++}),r},toArray:function(e){return h(e,function(r){return r})||[]},only:function(e){if(!L(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};return n.Activity=v,n.Children=F,n.Component=O,n.Fragment=g,n.Profiler=P,n.PureComponent=H,n.StrictMode=y,n.Suspense=i,n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,n.__COMPILER_RUNTIME={__proto__:null,c:function(e){return a.H.useMemoCache(e)}},n.cache=function(e){return function(){return e.apply(null,arguments)}},n.cacheSignal=function(){return null},n.cloneElement=function(e,r,o){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var u=Y({},e.props),s=e.key;if(r!=null)for(f in r.key!==void 0&&(s=""+r.key),r)!x.call(r,f)||f==="key"||f==="__self"||f==="__source"||f==="ref"&&r.ref===void 0||(u[f]=r[f]);var f=arguments.length-2;if(f===1)u.children=o;else if(1<f){for(var l=Array(f),E=0;E<f;E++)l[E]=arguments[E+2];u.children=l}return j(e.type,s,u)},n.createContext=function(e){return e={$$typeof:m,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:w,_context:e},e},n.createElement=function(e,r,o){var u,s={},f=null;if(r!=null)for(u in r.key!==void 0&&(f=""+r.key),r)x.call(r,u)&&u!=="key"&&u!=="__self"&&u!=="__source"&&(s[u]=r[u]);var l=arguments.length-2;if(l===1)s.children=o;else if(1<l){for(var E=Array(l),d=0;d<l;d++)E[d]=arguments[d+2];s.children=E}if(e&&e.defaultProps)for(u in l=e.defaultProps,l)s[u]===void 0&&(s[u]=l[u]);return j(e,f,s)},n.createRef=function(){return{current:null}},n.forwardRef=function(e){return{$$typeof:T,render:e}},n.isValidElement=L,n.lazy=function(e){return{$$typeof:c,_payload:{_status:-1,_result:e},_init:V}},n.memo=function(e,r){return{$$typeof:t,type:e,compare:r===void 0?null:r}},n.startTransition=function(e){var r=a.T,o={};a.T=o;try{var u=e(),s=a.S;s!==null&&s(o,u),typeof u=="object"&&u!==null&&typeof u.then=="function"&&u.then(D,z)}catch(f){z(f)}finally{r!==null&&o.types!==null&&(r.types=o.types),a.T=r}},n.unstable_useCacheRefresh=function(){return a.H.useCacheRefresh()},n.use=function(e){return a.H.use(e)},n.useActionState=function(e,r,o){return a.H.useActionState(e,r,o)},n.useCallback=function(e,r){return a.H.useCallback(e,r)},n.useContext=function(e){return a.H.useContext(e)},n.useDebugValue=function(){},n.useDeferredValue=function(e,r){return a.H.useDeferredValue(e,r)},n.useEffect=function(e,r){return a.H.useEffect(e,r)},n.useEffectEvent=function(e){return a.H.useEffectEvent(e)},n.useId=function(){return a.H.useId()},n.useImperativeHandle=function(e,r,o){return a.H.useImperativeHandle(e,r,o)},n.useInsertionEffect=function(e,r){return a.H.useInsertionEffect(e,r)},n.useLayoutEffect=function(e,r){return a.H.useLayoutEffect(e,r)},n.useMemo=function(e,r){return a.H.useMemo(e,r)},n.useOptimistic=function(e,r){return a.H.useOptimistic(e,r)},n.useReducer=function(e,r,o){return a.H.useReducer(e,r,o)},n.useRef=function(e){return a.H.useRef(e)},n.useState=function(e){return a.H.useState(e)},n.useSyncExternalStore=function(e,r,o){return a.H.useSyncExternalStore(e,r,o)},n.useTransition=function(){return a.H.useTransition()},n.version="19.2.4",n}var B;function re(){return B||(B=1,I.exports=te()),I.exports}var $={exports:{}},_={};/**
10
- * @license React
11
- * react-dom.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var W;function ne(){if(W)return _;W=1;var p=re();function R(i){var t="https://react.dev/errors/"+i;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)t+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+i+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function g(){}var y={d:{f:g,r:function(){throw Error(R(522))},D:g,C:g,L:g,m:g,X:g,S:g,M:g},p:0,findDOMNode:null},P=Symbol.for("react.portal");function w(i,t,c){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:P,key:v==null?null:""+v,children:i,containerInfo:t,implementation:c}}var m=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function T(i,t){if(i==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}return _.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=y,_.createPortal=function(i,t){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(R(299));return w(i,t,null,c)},_.flushSync=function(i){var t=m.T,c=y.p;try{if(m.T=null,y.p=2,i)return i()}finally{m.T=t,y.p=c,y.d.f()}},_.preconnect=function(i,t){typeof i=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,y.d.C(i,t))},_.prefetchDNS=function(i){typeof i=="string"&&y.d.D(i)},_.preinit=function(i,t){if(typeof i=="string"&&t&&typeof t.as=="string"){var c=t.as,v=T(c,t.crossOrigin),C=typeof t.integrity=="string"?t.integrity:void 0,A=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;c==="style"?y.d.S(i,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:v,integrity:C,fetchPriority:A}):c==="script"&&y.d.X(i,{crossOrigin:v,integrity:C,fetchPriority:A,nonce:typeof t.nonce=="string"?t.nonce:void 0})}},_.preinitModule=function(i,t){if(typeof i=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var c=T(t.as,t.crossOrigin);y.d.M(i,{crossOrigin:c,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&y.d.M(i)},_.preload=function(i,t){if(typeof i=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var c=t.as,v=T(c,t.crossOrigin);y.d.L(i,c,{crossOrigin:v,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}},_.preloadModule=function(i,t){if(typeof i=="string")if(t){var c=T(t.as,t.crossOrigin);y.d.m(i,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:c,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else y.d.m(i)},_.requestFormReset=function(i){y.d.r(i)},_.unstable_batchedUpdates=function(i,t){return i(t)},_.useFormState=function(i,t,c){return m.H.useFormState(i,t,c)},_.useFormStatus=function(){return m.H.useHostTransitionStatus()},_.version="19.2.4",_}var X;function ie(){if(X)return $.exports;X=1;function p(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(p)}catch(R){console.error(R)}}return p(),$.exports=ne(),$.exports}export{ie as a,ue as c,oe as g,re as r};
@@ -1 +0,0 @@
1
- var we=e=>{throw TypeError(e)};var Yt=(e,t,s)=>t.has(e)||we("Cannot "+s);var r=(e,t,s)=>(Yt(e,t,"read from private field"),s?s.call(e):t.get(e)),c=(e,t,s)=>t.has(e)?we("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),o=(e,t,s,i)=>(Yt(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),y=(e,t,s)=>(Yt(e,t,"access private method"),s);var Wt=(e,t,s,i)=>({set _(n){o(e,t,n,s)},get _(){return r(e,t,i)}});import{r as x,j as ss}from"./tanstack-router-Btjy0MKq.js";var qt=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},is={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},it,ye,xe,rs=(xe=class{constructor(){c(this,it,is);c(this,ye,!1)}setTimeoutProvider(e){o(this,it,e)}setTimeout(e,t){return r(this,it).setTimeout(e,t)}clearTimeout(e){r(this,it).clearTimeout(e)}setInterval(e,t){return r(this,it).setInterval(e,t)}clearInterval(e){r(this,it).clearInterval(e)}},it=new WeakMap,ye=new WeakMap,xe),ft=new rs;function ns(e){setTimeout(e,0)}var Ot=typeof window>"u"||"Deno"in globalThis;function q(){}function as(e,t){return typeof e=="function"?e(t):e}function te(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ge(e,t){return Math.max(e+(t||0)-Date.now(),0)}function dt(e,t){return typeof e=="function"?e(t):e}function H(e,t){return typeof e=="function"?e(t):e}function Se(e,t){const{type:s="all",exact:i,fetchStatus:n,predicate:a,queryKey:h,stale:u}=e;if(h){if(i){if(t.queryHash!==pe(h,t.options))return!1}else if(!kt(t.queryKey,h))return!1}if(s!=="all"){const p=t.isActive();if(s==="active"&&!p||s==="inactive"&&p)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||n&&n!==t.state.fetchStatus||a&&!a(t))}function Oe(e,t){const{exact:s,status:i,predicate:n,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(s){if(Pt(t.options.mutationKey)!==Pt(a))return!1}else if(!kt(t.options.mutationKey,a))return!1}return!(i&&t.state.status!==i||n&&!n(t))}function pe(e,t){return((t==null?void 0:t.queryKeyHashFn)||Pt)(e)}function Pt(e){return JSON.stringify(e,(t,s)=>ee(s)?Object.keys(s).sort().reduce((i,n)=>(i[n]=s[n],i),{}):s)}function kt(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(s=>kt(e[s],t[s])):!1}var os=Object.prototype.hasOwnProperty;function Be(e,t,s=0){if(e===t)return e;if(s>500)return t;const i=Pe(e)&&Pe(t);if(!i&&!(ee(e)&&ee(t)))return t;const a=(i?e:Object.keys(e)).length,h=i?t:Object.keys(t),u=h.length,p=i?new Array(u):{};let m=0;for(let v=0;v<u;v++){const f=i?v:h[v],g=e[f],d=t[f];if(g===d){p[f]=g,(i?v<a:os.call(e,f))&&m++;continue}if(g===null||d===null||typeof g!="object"||typeof d!="object"){p[f]=d;continue}const E=Be(g,d,s+1);p[f]=E,E===g&&m++}return a===u&&m===a?e:p}function Zt(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}function Pe(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ee(e){if(!Re(e))return!1;const t=e.constructor;if(t===void 0)return!0;const s=t.prototype;return!(!Re(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Re(e){return Object.prototype.toString.call(e)==="[object Object]"}function us(e){return new Promise(t=>{ft.setTimeout(t,e)})}function se(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?Be(e,t):t}function hs(e,t,s=0){const i=[...e,t];return s&&i.length>s?i.slice(1):i}function cs(e,t,s=0){const i=[t,...e];return s&&i.length>s?i.slice(0,-1):i}var me=Symbol();function ze(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===me?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ve(e,t){return typeof e=="function"?e(...t):!!e}function ls(e,t,s){let i=!1,n;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(n??(n=t()),i||(i=!0,n.aborted?s():n.addEventListener("abort",s,{once:!0})),n)}),e}var yt,rt,Rt,Ae,ds=(Ae=class extends qt{constructor(){super();c(this,yt);c(this,rt);c(this,Rt);o(this,Rt,t=>{if(!Ot&&window.addEventListener){const s=()=>t();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){r(this,rt)||this.setEventListener(r(this,Rt))}onUnsubscribe(){var t;this.hasListeners()||((t=r(this,rt))==null||t.call(this),o(this,rt,void 0))}setEventListener(t){var s;o(this,Rt,t),(s=r(this,rt))==null||s.call(this),o(this,rt,t(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(t){r(this,yt)!==t&&(o(this,yt,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(s=>{s(t)})}isFocused(){var t;return typeof r(this,yt)=="boolean"?r(this,yt):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},yt=new WeakMap,rt=new WeakMap,Rt=new WeakMap,Ae),be=new ds;function ie(){let e,t;const s=new Promise((n,a)=>{e=n,t=a});s.status="pending",s.catch(()=>{});function i(n){Object.assign(s,n),delete s.resolve,delete s.reject}return s.resolve=n=>{i({status:"fulfilled",value:n}),e(n)},s.reject=n=>{i({status:"rejected",reason:n}),t(n)},s}var fs=ns;function ys(){let e=[],t=0,s=u=>{u()},i=u=>{u()},n=fs;const a=u=>{t?e.push(u):n(()=>{s(u)})},h=()=>{const u=e;e=[],u.length&&n(()=>{i(()=>{u.forEach(p=>{s(p)})})})};return{batch:u=>{let p;t++;try{p=u()}finally{t--,t||h()}return p},batchCalls:u=>(...p)=>{a(()=>{u(...p)})},schedule:a,setNotifyFunction:u=>{s=u},setBatchNotifyFunction:u=>{i=u},setScheduler:u=>{n=u}}}var M=ys(),Et,nt,Ft,je,ps=(je=class extends qt{constructor(){super();c(this,Et,!0);c(this,nt);c(this,Ft);o(this,Ft,t=>{if(!Ot&&window.addEventListener){const s=()=>t(!0),i=()=>t(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",i)}}})}onSubscribe(){r(this,nt)||this.setEventListener(r(this,Ft))}onUnsubscribe(){var t;this.hasListeners()||((t=r(this,nt))==null||t.call(this),o(this,nt,void 0))}setEventListener(t){var s;o(this,Ft,t),(s=r(this,nt))==null||s.call(this),o(this,nt,t(this.setOnline.bind(this)))}setOnline(t){r(this,Et)!==t&&(o(this,Et,t),this.listeners.forEach(i=>{i(t)}))}isOnline(){return r(this,Et)}},Et=new WeakMap,nt=new WeakMap,Ft=new WeakMap,je),Xt=new ps;function ms(e){return Math.min(1e3*2**e,3e4)}function Ve(e){return(e??"online")==="online"?Xt.isOnline():!0}var re=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function We(e){let t=!1,s=0,i;const n=ie(),a=()=>n.status!=="pending",h=C=>{var w;if(!a()){const P=new re(C);g(P),(w=e.onCancel)==null||w.call(e,P)}},u=()=>{t=!0},p=()=>{t=!1},m=()=>be.isFocused()&&(e.networkMode==="always"||Xt.isOnline())&&e.canRun(),v=()=>Ve(e.networkMode)&&e.canRun(),f=C=>{a()||(i==null||i(),n.resolve(C))},g=C=>{a()||(i==null||i(),n.reject(C))},d=()=>new Promise(C=>{var w;i=P=>{(a()||m())&&C(P)},(w=e.onPause)==null||w.call(e)}).then(()=>{var C;i=void 0,a()||(C=e.onContinue)==null||C.call(e)}),E=()=>{if(a())return;let C;const w=s===0?e.initialPromise:void 0;try{C=w??e.fn()}catch(P){C=Promise.reject(P)}Promise.resolve(C).then(f).catch(P=>{var K;if(a())return;const Q=e.retry??(Ot?0:3),R=e.retryDelay??ms,l=typeof R=="function"?R(s,P):R,I=Q===!0||typeof Q=="number"&&s<Q||typeof Q=="function"&&Q(s,P);if(t||!I){g(P);return}s++,(K=e.onFail)==null||K.call(e,s,P),us(l).then(()=>m()?void 0:d()).then(()=>{t?g(P):E()})})};return{promise:n,status:()=>n.status,cancel:h,continue:()=>(i==null||i(),n),cancelRetry:u,continueRetry:p,canStart:v,start:()=>(v()?E():d().then(E),n)}}var pt,Ue,$e=(Ue=class{constructor(){c(this,pt)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),te(this.gcTime)&&o(this,pt,ft.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ot?1/0:5*60*1e3))}clearGcTimeout(){r(this,pt)&&(ft.clearTimeout(r(this,pt)),o(this,pt,void 0))}},pt=new WeakMap,Ue),mt,Mt,_,vt,D,Lt,bt,N,W,qe,vs=(qe=class extends $e{constructor(t){super();c(this,N);c(this,mt);c(this,Mt);c(this,_);c(this,vt);c(this,D);c(this,Lt);c(this,bt);o(this,bt,!1),o(this,Lt,t.defaultOptions),this.setOptions(t.options),this.observers=[],o(this,vt,t.client),o(this,_,r(this,vt).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,o(this,mt,Fe(this.options)),this.state=t.state??r(this,mt),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=r(this,D))==null?void 0:t.promise}setOptions(t){if(this.options={...r(this,Lt),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=Fe(this.options);s.data!==void 0&&(this.setState(Ee(s.data,s.dataUpdatedAt)),o(this,mt,s))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&r(this,_).remove(this)}setData(t,s){const i=se(this.state.data,t,this.options);return y(this,N,W).call(this,{data:i,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),i}setState(t,s){y(this,N,W).call(this,{type:"setState",state:t,setStateOptions:s})}cancel(t){var i,n;const s=(i=r(this,D))==null?void 0:i.promise;return(n=r(this,D))==null||n.cancel(t),s?s.then(q).catch(q):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(r(this,mt))}isActive(){return this.observers.some(t=>H(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===me||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>dt(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Ge(this.state.dataUpdatedAt,t)}onFocus(){var s;const t=this.observers.find(i=>i.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(s=r(this,D))==null||s.continue()}onOnline(){var s;const t=this.observers.find(i=>i.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(s=r(this,D))==null||s.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),r(this,_).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(s=>s!==t),this.observers.length||(r(this,D)&&(r(this,bt)?r(this,D).cancel({revert:!0}):r(this,D).cancelRetry()),this.scheduleGc()),r(this,_).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||y(this,N,W).call(this,{type:"invalidate"})}async fetch(t,s){var p,m,v,f,g,d,E,C,w,P,Q,R;if(this.state.fetchStatus!=="idle"&&((p=r(this,D))==null?void 0:p.status())!=="rejected"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(r(this,D))return r(this,D).continueRetry(),r(this,D).promise}if(t&&this.setOptions(t),!this.options.queryFn){const l=this.observers.find(I=>I.options.queryFn);l&&this.setOptions(l.options)}const i=new AbortController,n=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(o(this,bt,!0),i.signal)})},a=()=>{const l=ze(this.options,s),K=(()=>{const tt={client:r(this,vt),queryKey:this.queryKey,meta:this.meta};return n(tt),tt})();return o(this,bt,!1),this.options.persister?this.options.persister(l,K,this):l(K)},u=(()=>{const l={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:r(this,vt),state:this.state,fetchFn:a};return n(l),l})();(m=this.options.behavior)==null||m.onFetch(u,this),o(this,Mt,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((v=u.fetchOptions)==null?void 0:v.meta))&&y(this,N,W).call(this,{type:"fetch",meta:(f=u.fetchOptions)==null?void 0:f.meta}),o(this,D,We({initialPromise:s==null?void 0:s.initialPromise,fn:u.fetchFn,onCancel:l=>{l instanceof re&&l.revert&&this.setState({...r(this,Mt),fetchStatus:"idle"}),i.abort()},onFail:(l,I)=>{y(this,N,W).call(this,{type:"failed",failureCount:l,error:I})},onPause:()=>{y(this,N,W).call(this,{type:"pause"})},onContinue:()=>{y(this,N,W).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const l=await r(this,D).start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),(d=(g=r(this,_).config).onSuccess)==null||d.call(g,l,this),(C=(E=r(this,_).config).onSettled)==null||C.call(E,l,this.state.error,this),l}catch(l){if(l instanceof re){if(l.silent)return r(this,D).promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw y(this,N,W).call(this,{type:"error",error:l}),(P=(w=r(this,_).config).onError)==null||P.call(w,l,this),(R=(Q=r(this,_).config).onSettled)==null||R.call(Q,this.state.data,l,this),l}finally{this.scheduleGc()}}},mt=new WeakMap,Mt=new WeakMap,_=new WeakMap,vt=new WeakMap,D=new WeakMap,Lt=new WeakMap,bt=new WeakMap,N=new WeakSet,W=function(t){const s=i=>{switch(t.type){case"failed":return{...i,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...Je(i.data,this.options),fetchMeta:t.meta??null};case"success":const n={...i,...Ee(t.data,t.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return o(this,Mt,t.manual?n:void 0),n;case"error":const a=t.error;return{...i,error:a,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...t.state}}};this.state=s(this.state),M.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),r(this,_).notify({query:this,type:"updated",action:t})})},qe);function Je(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ve(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Ee(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Fe(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,s=t!==void 0,i=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var k,b,_t,U,gt,Qt,$,at,Ht,It,Tt,Ct,wt,ot,Dt,S,Kt,ne,ae,oe,ue,he,ce,le,Ze,Ke,bs=(Ke=class extends qt{constructor(t,s){super();c(this,S);c(this,k);c(this,b);c(this,_t);c(this,U);c(this,gt);c(this,Qt);c(this,$);c(this,at);c(this,Ht);c(this,It);c(this,Tt);c(this,Ct);c(this,wt);c(this,ot);c(this,Dt,new Set);this.options=s,o(this,k,t),o(this,at,null),o(this,$,ie()),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(r(this,b).addObserver(this),Me(r(this,b),this.options)?y(this,S,Kt).call(this):this.updateResult(),y(this,S,ue).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return de(r(this,b),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return de(r(this,b),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,y(this,S,he).call(this),y(this,S,ce).call(this),r(this,b).removeObserver(this)}setOptions(t){const s=this.options,i=r(this,b);if(this.options=r(this,k).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof H(this.options.enabled,r(this,b))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");y(this,S,le).call(this),r(this,b).setOptions(this.options),s._defaulted&&!Zt(this.options,s)&&r(this,k).getQueryCache().notify({type:"observerOptionsUpdated",query:r(this,b),observer:this});const n=this.hasListeners();n&&Qe(r(this,b),i,this.options,s)&&y(this,S,Kt).call(this),this.updateResult(),n&&(r(this,b)!==i||H(this.options.enabled,r(this,b))!==H(s.enabled,r(this,b))||dt(this.options.staleTime,r(this,b))!==dt(s.staleTime,r(this,b)))&&y(this,S,ne).call(this);const a=y(this,S,ae).call(this);n&&(r(this,b)!==i||H(this.options.enabled,r(this,b))!==H(s.enabled,r(this,b))||a!==r(this,ot))&&y(this,S,oe).call(this,a)}getOptimisticResult(t){const s=r(this,k).getQueryCache().build(r(this,k),t),i=this.createResult(s,t);return Cs(this,i)&&(o(this,U,i),o(this,Qt,this.options),o(this,gt,r(this,b).state)),i}getCurrentResult(){return r(this,U)}trackResult(t,s){return new Proxy(t,{get:(i,n)=>(this.trackProp(n),s==null||s(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&r(this,$).status==="pending"&&r(this,$).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,n))})}trackProp(t){r(this,Dt).add(t)}getCurrentQuery(){return r(this,b)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const s=r(this,k).defaultQueryOptions(t),i=r(this,k).getQueryCache().build(r(this,k),s);return i.fetch().then(()=>this.createResult(i,s))}fetch(t){return y(this,S,Kt).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),r(this,U)))}createResult(t,s){var T;const i=r(this,b),n=this.options,a=r(this,U),h=r(this,gt),u=r(this,Qt),m=t!==i?t.state:r(this,_t),{state:v}=t;let f={...v},g=!1,d;if(s._optimisticResults){const j=this.hasListeners(),et=!j&&Me(t,s),Bt=j&&Qe(t,i,s,n);(et||Bt)&&(f={...f,...Je(v.data,t.options)}),s._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:E,errorUpdatedAt:C,status:w}=f;d=f.data;let P=!1;if(s.placeholderData!==void 0&&d===void 0&&w==="pending"){let j;a!=null&&a.isPlaceholderData&&s.placeholderData===(u==null?void 0:u.placeholderData)?(j=a.data,P=!0):j=typeof s.placeholderData=="function"?s.placeholderData((T=r(this,Tt))==null?void 0:T.state.data,r(this,Tt)):s.placeholderData,j!==void 0&&(w="success",d=se(a==null?void 0:a.data,j,s),g=!0)}if(s.select&&d!==void 0&&!P)if(a&&d===(h==null?void 0:h.data)&&s.select===r(this,Ht))d=r(this,It);else try{o(this,Ht,s.select),d=s.select(d),d=se(a==null?void 0:a.data,d,s),o(this,It,d),o(this,at,null)}catch(j){o(this,at,j)}r(this,at)&&(E=r(this,at),d=r(this,It),C=Date.now(),w="error");const Q=f.fetchStatus==="fetching",R=w==="pending",l=w==="error",I=R&&Q,K=d!==void 0,O={status:w,fetchStatus:f.fetchStatus,isPending:R,isSuccess:w==="success",isError:l,isInitialLoading:I,isLoading:I,data:d,dataUpdatedAt:f.dataUpdatedAt,error:E,errorUpdatedAt:C,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>m.dataUpdateCount||f.errorUpdateCount>m.errorUpdateCount,isFetching:Q,isRefetching:Q&&!R,isLoadingError:l&&!K,isPaused:f.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:l&&K,isStale:ge(t,s),refetch:this.refetch,promise:r(this,$),isEnabled:H(s.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const j=O.data!==void 0,et=O.status==="error"&&!j,Bt=Vt=>{et?Vt.reject(O.error):j&&Vt.resolve(O.data)},Ce=()=>{const Vt=o(this,$,O.promise=ie());Bt(Vt)},zt=r(this,$);switch(zt.status){case"pending":t.queryHash===i.queryHash&&Bt(zt);break;case"fulfilled":(et||O.data!==zt.value)&&Ce();break;case"rejected":(!et||O.error!==zt.reason)&&Ce();break}}return O}updateResult(){const t=r(this,U),s=this.createResult(r(this,b),this.options);if(o(this,gt,r(this,b).state),o(this,Qt,this.options),r(this,gt).data!==void 0&&o(this,Tt,r(this,b)),Zt(s,t))return;o(this,U,s);const i=()=>{if(!t)return!0;const{notifyOnChangeProps:n}=this.options,a=typeof n=="function"?n():n;if(a==="all"||!a&&!r(this,Dt).size)return!0;const h=new Set(a??r(this,Dt));return this.options.throwOnError&&h.add("error"),Object.keys(r(this,U)).some(u=>{const p=u;return r(this,U)[p]!==t[p]&&h.has(p)})};y(this,S,Ze).call(this,{listeners:i()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&y(this,S,ue).call(this)}},k=new WeakMap,b=new WeakMap,_t=new WeakMap,U=new WeakMap,gt=new WeakMap,Qt=new WeakMap,$=new WeakMap,at=new WeakMap,Ht=new WeakMap,It=new WeakMap,Tt=new WeakMap,Ct=new WeakMap,wt=new WeakMap,ot=new WeakMap,Dt=new WeakMap,S=new WeakSet,Kt=function(t){y(this,S,le).call(this);let s=r(this,b).fetch(this.options,t);return t!=null&&t.throwOnError||(s=s.catch(q)),s},ne=function(){y(this,S,he).call(this);const t=dt(this.options.staleTime,r(this,b));if(Ot||r(this,U).isStale||!te(t))return;const i=Ge(r(this,U).dataUpdatedAt,t)+1;o(this,Ct,ft.setTimeout(()=>{r(this,U).isStale||this.updateResult()},i))},ae=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(r(this,b)):this.options.refetchInterval)??!1},oe=function(t){y(this,S,ce).call(this),o(this,ot,t),!(Ot||H(this.options.enabled,r(this,b))===!1||!te(r(this,ot))||r(this,ot)===0)&&o(this,wt,ft.setInterval(()=>{(this.options.refetchIntervalInBackground||be.isFocused())&&y(this,S,Kt).call(this)},r(this,ot)))},ue=function(){y(this,S,ne).call(this),y(this,S,oe).call(this,y(this,S,ae).call(this))},he=function(){r(this,Ct)&&(ft.clearTimeout(r(this,Ct)),o(this,Ct,void 0))},ce=function(){r(this,wt)&&(ft.clearInterval(r(this,wt)),o(this,wt,void 0))},le=function(){const t=r(this,k).getQueryCache().build(r(this,k),this.options);if(t===r(this,b))return;const s=r(this,b);o(this,b,t),o(this,_t,t.state),this.hasListeners()&&(s==null||s.removeObserver(this),t.addObserver(this))},Ze=function(t){M.batch(()=>{t.listeners&&this.listeners.forEach(s=>{s(r(this,U))}),r(this,k).getQueryCache().notify({query:r(this,b),type:"observerResultsUpdated"})})},Ke);function gs(e,t){return H(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Me(e,t){return gs(e,t)||e.state.data!==void 0&&de(e,t,t.refetchOnMount)}function de(e,t,s){if(H(t.enabled,e)!==!1&&dt(t.staleTime,e)!=="static"){const i=typeof s=="function"?s(e):s;return i==="always"||i!==!1&&ge(e,t)}return!1}function Qe(e,t,s,i){return(e!==t||H(i.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&ge(e,s)}function ge(e,t){return H(t.enabled,e)!==!1&&e.isStaleByTime(dt(t.staleTime,e))}function Cs(e,t){return!Zt(e.getCurrentResult(),t)}function Ie(e){return{onFetch:(t,s)=>{var v,f,g,d,E;const i=t.options,n=(g=(f=(v=t.fetchOptions)==null?void 0:v.meta)==null?void 0:f.fetchMore)==null?void 0:g.direction,a=((d=t.state.data)==null?void 0:d.pages)||[],h=((E=t.state.data)==null?void 0:E.pageParams)||[];let u={pages:[],pageParams:[]},p=0;const m=async()=>{let C=!1;const w=R=>{ls(R,()=>t.signal,()=>C=!0)},P=ze(t.options,t.fetchOptions),Q=async(R,l,I)=>{if(C)return Promise.reject();if(l==null&&R.pages.length)return Promise.resolve(R);const tt=(()=>{const et={client:t.client,queryKey:t.queryKey,pageParam:l,direction:I?"backward":"forward",meta:t.options.meta};return w(et),et})(),O=await P(tt),{maxPages:T}=t.options,j=I?cs:hs;return{pages:j(R.pages,O,T),pageParams:j(R.pageParams,l,T)}};if(n&&a.length){const R=n==="backward",l=R?ws:Te,I={pages:a,pageParams:h},K=l(i,I);u=await Q(I,K,R)}else{const R=e??a.length;do{const l=p===0?h[0]??i.initialPageParam:Te(i,u);if(p>0&&l==null)break;u=await Q(u,l),p++}while(p<R)}return u};t.options.persister?t.fetchFn=()=>{var C,w;return(w=(C=t.options).persister)==null?void 0:w.call(C,m,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s)}:t.fetchFn=m}}}function Te(e,{pages:t,pageParams:s}){const i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,s[i],s):void 0}function ws(e,{pages:t,pageParams:s}){var i;return t.length>0?(i=e.getPreviousPageParam)==null?void 0:i.call(e,t[0],t,s[0],s):void 0}var Nt,B,A,St,z,st,ke,Ss=(ke=class extends $e{constructor(t){super();c(this,z);c(this,Nt);c(this,B);c(this,A);c(this,St);o(this,Nt,t.client),this.mutationId=t.mutationId,o(this,A,t.mutationCache),o(this,B,[]),this.state=t.state||Xe(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){r(this,B).includes(t)||(r(this,B).push(t),this.clearGcTimeout(),r(this,A).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){o(this,B,r(this,B).filter(s=>s!==t)),this.scheduleGc(),r(this,A).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){r(this,B).length||(this.state.status==="pending"?this.scheduleGc():r(this,A).remove(this))}continue(){var t;return((t=r(this,St))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var h,u,p,m,v,f,g,d,E,C,w,P,Q,R,l,I,K,tt;const s=()=>{y(this,z,st).call(this,{type:"continue"})},i={client:r(this,Nt),meta:this.options.meta,mutationKey:this.options.mutationKey};o(this,St,We({fn:()=>this.options.mutationFn?this.options.mutationFn(t,i):Promise.reject(new Error("No mutationFn found")),onFail:(O,T)=>{y(this,z,st).call(this,{type:"failed",failureCount:O,error:T})},onPause:()=>{y(this,z,st).call(this,{type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>r(this,A).canRun(this)}));const n=this.state.status==="pending",a=!r(this,St).canStart();try{if(n)s();else{y(this,z,st).call(this,{type:"pending",variables:t,isPaused:a}),r(this,A).config.onMutate&&await r(this,A).config.onMutate(t,this,i);const T=await((u=(h=this.options).onMutate)==null?void 0:u.call(h,t,i));T!==this.state.context&&y(this,z,st).call(this,{type:"pending",context:T,variables:t,isPaused:a})}const O=await r(this,St).start();return await((m=(p=r(this,A).config).onSuccess)==null?void 0:m.call(p,O,t,this.state.context,this,i)),await((f=(v=this.options).onSuccess)==null?void 0:f.call(v,O,t,this.state.context,i)),await((d=(g=r(this,A).config).onSettled)==null?void 0:d.call(g,O,null,this.state.variables,this.state.context,this,i)),await((C=(E=this.options).onSettled)==null?void 0:C.call(E,O,null,t,this.state.context,i)),y(this,z,st).call(this,{type:"success",data:O}),O}catch(O){try{await((P=(w=r(this,A).config).onError)==null?void 0:P.call(w,O,t,this.state.context,this,i))}catch(T){Promise.reject(T)}try{await((R=(Q=this.options).onError)==null?void 0:R.call(Q,O,t,this.state.context,i))}catch(T){Promise.reject(T)}try{await((I=(l=r(this,A).config).onSettled)==null?void 0:I.call(l,void 0,O,this.state.variables,this.state.context,this,i))}catch(T){Promise.reject(T)}try{await((tt=(K=this.options).onSettled)==null?void 0:tt.call(K,void 0,O,t,this.state.context,i))}catch(T){Promise.reject(T)}throw y(this,z,st).call(this,{type:"error",error:O}),O}finally{r(this,A).runNext(this)}}},Nt=new WeakMap,B=new WeakMap,A=new WeakMap,St=new WeakMap,z=new WeakSet,st=function(t){const s=i=>{switch(t.type){case"failed":return{...i,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...i,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:t.error,failureCount:i.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=s(this.state),M.batch(()=>{r(this,B).forEach(i=>{i.onMutationUpdate(t)}),r(this,A).notify({mutation:this,type:"updated",action:t})})},ke);function Xe(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var J,G,Gt,Le,Os=(Le=class extends qt{constructor(t={}){super();c(this,J);c(this,G);c(this,Gt);this.config=t,o(this,J,new Set),o(this,G,new Map),o(this,Gt,0)}build(t,s,i){const n=new Ss({client:t,mutationCache:this,mutationId:++Wt(this,Gt)._,options:t.defaultMutationOptions(s),state:i});return this.add(n),n}add(t){r(this,J).add(t);const s=$t(t);if(typeof s=="string"){const i=r(this,G).get(s);i?i.push(t):r(this,G).set(s,[t])}this.notify({type:"added",mutation:t})}remove(t){if(r(this,J).delete(t)){const s=$t(t);if(typeof s=="string"){const i=r(this,G).get(s);if(i)if(i.length>1){const n=i.indexOf(t);n!==-1&&i.splice(n,1)}else i[0]===t&&r(this,G).delete(s)}}this.notify({type:"removed",mutation:t})}canRun(t){const s=$t(t);if(typeof s=="string"){const i=r(this,G).get(s),n=i==null?void 0:i.find(a=>a.state.status==="pending");return!n||n===t}else return!0}runNext(t){var i;const s=$t(t);if(typeof s=="string"){const n=(i=r(this,G).get(s))==null?void 0:i.find(a=>a!==t&&a.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}else return Promise.resolve()}clear(){M.batch(()=>{r(this,J).forEach(t=>{this.notify({type:"removed",mutation:t})}),r(this,J).clear(),r(this,G).clear()})}getAll(){return Array.from(r(this,J))}find(t){const s={exact:!0,...t};return this.getAll().find(i=>Oe(s,i))}findAll(t={}){return this.getAll().filter(s=>Oe(t,s))}notify(t){M.batch(()=>{this.listeners.forEach(s=>{s(t)})})}resumePausedMutations(){const t=this.getAll().filter(s=>s.state.isPaused);return M.batch(()=>Promise.all(t.map(s=>s.continue().catch(q))))}},J=new WeakMap,G=new WeakMap,Gt=new WeakMap,Le);function $t(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Z,ut,L,X,Y,Jt,fe,_e,Ps=(_e=class extends qt{constructor(t,s){super();c(this,Y);c(this,Z);c(this,ut);c(this,L);c(this,X);o(this,Z,t),this.setOptions(s),this.bindMethods(),y(this,Y,Jt).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var i;const s=this.options;this.options=r(this,Z).defaultMutationOptions(t),Zt(this.options,s)||r(this,Z).getMutationCache().notify({type:"observerOptionsUpdated",mutation:r(this,L),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&Pt(s.mutationKey)!==Pt(this.options.mutationKey)?this.reset():((i=r(this,L))==null?void 0:i.state.status)==="pending"&&r(this,L).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=r(this,L))==null||t.removeObserver(this)}onMutationUpdate(t){y(this,Y,Jt).call(this),y(this,Y,fe).call(this,t)}getCurrentResult(){return r(this,ut)}reset(){var t;(t=r(this,L))==null||t.removeObserver(this),o(this,L,void 0),y(this,Y,Jt).call(this),y(this,Y,fe).call(this)}mutate(t,s){var i;return o(this,X,s),(i=r(this,L))==null||i.removeObserver(this),o(this,L,r(this,Z).getMutationCache().build(r(this,Z),this.options)),r(this,L).addObserver(this),r(this,L).execute(t)}},Z=new WeakMap,ut=new WeakMap,L=new WeakMap,X=new WeakMap,Y=new WeakSet,Jt=function(){var s;const t=((s=r(this,L))==null?void 0:s.state)??Xe();o(this,ut,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},fe=function(t){M.batch(()=>{var s,i,n,a,h,u,p,m;if(r(this,X)&&this.hasListeners()){const v=r(this,ut).variables,f=r(this,ut).context,g={client:r(this,Z),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(i=(s=r(this,X)).onSuccess)==null||i.call(s,t.data,v,f,g)}catch(d){Promise.reject(d)}try{(a=(n=r(this,X)).onSettled)==null||a.call(n,t.data,null,v,f,g)}catch(d){Promise.reject(d)}}else if((t==null?void 0:t.type)==="error"){try{(u=(h=r(this,X)).onError)==null||u.call(h,t.error,v,f,g)}catch(d){Promise.reject(d)}try{(m=(p=r(this,X)).onSettled)==null||m.call(p,void 0,t.error,v,f,g)}catch(d){Promise.reject(d)}}}this.listeners.forEach(v=>{v(r(this,ut))})})},_e),V,He,Rs=(He=class extends qt{constructor(t={}){super();c(this,V);this.config=t,o(this,V,new Map)}build(t,s,i){const n=s.queryKey,a=s.queryHash??pe(n,s);let h=this.get(a);return h||(h=new vs({client:t,queryKey:n,queryHash:a,options:t.defaultQueryOptions(s),state:i,defaultOptions:t.getQueryDefaults(n)}),this.add(h)),h}add(t){r(this,V).has(t.queryHash)||(r(this,V).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const s=r(this,V).get(t.queryHash);s&&(t.destroy(),s===t&&r(this,V).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){M.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return r(this,V).get(t)}getAll(){return[...r(this,V).values()]}find(t){const s={exact:!0,...t};return this.getAll().find(i=>Se(s,i))}findAll(t={}){const s=this.getAll();return Object.keys(t).length>0?s.filter(i=>Se(t,i)):s}notify(t){M.batch(()=>{this.listeners.forEach(s=>{s(t)})})}onFocus(){M.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){M.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},V=new WeakMap,He),F,ht,ct,xt,At,lt,jt,Ut,Ne,ks=(Ne=class{constructor(e={}){c(this,F);c(this,ht);c(this,ct);c(this,xt);c(this,At);c(this,lt);c(this,jt);c(this,Ut);o(this,F,e.queryCache||new Rs),o(this,ht,e.mutationCache||new Os),o(this,ct,e.defaultOptions||{}),o(this,xt,new Map),o(this,At,new Map),o(this,lt,0)}mount(){Wt(this,lt)._++,r(this,lt)===1&&(o(this,jt,be.subscribe(async e=>{e&&(await this.resumePausedMutations(),r(this,F).onFocus())})),o(this,Ut,Xt.subscribe(async e=>{e&&(await this.resumePausedMutations(),r(this,F).onOnline())})))}unmount(){var e,t;Wt(this,lt)._--,r(this,lt)===0&&((e=r(this,jt))==null||e.call(this),o(this,jt,void 0),(t=r(this,Ut))==null||t.call(this),o(this,Ut,void 0))}isFetching(e){return r(this,F).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return r(this,ht).findAll({...e,status:"pending"}).length}getQueryData(e){var s;const t=this.defaultQueryOptions({queryKey:e});return(s=r(this,F).get(t.queryHash))==null?void 0:s.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),s=r(this,F).build(this,t),i=s.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(dt(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return r(this,F).findAll(e).map(({queryKey:t,state:s})=>{const i=s.data;return[t,i]})}setQueryData(e,t,s){const i=this.defaultQueryOptions({queryKey:e}),n=r(this,F).get(i.queryHash),a=n==null?void 0:n.state.data,h=as(t,a);if(h!==void 0)return r(this,F).build(this,i).setData(h,{...s,manual:!0})}setQueriesData(e,t,s){return M.batch(()=>r(this,F).findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,t,s)]))}getQueryState(e){var s;const t=this.defaultQueryOptions({queryKey:e});return(s=r(this,F).get(t.queryHash))==null?void 0:s.state}removeQueries(e){const t=r(this,F);M.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=r(this,F);return M.batch(()=>(s.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const s={revert:!0,...t},i=M.batch(()=>r(this,F).findAll(e).map(n=>n.cancel(s)));return Promise.all(i).then(q).catch(q)}invalidateQueries(e,t={}){return M.batch(()=>(r(this,F).findAll(e).forEach(s=>{s.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const s={...t,cancelRefetch:t.cancelRefetch??!0},i=M.batch(()=>r(this,F).findAll(e).filter(n=>!n.isDisabled()&&!n.isStatic()).map(n=>{let a=n.fetch(void 0,s);return s.throwOnError||(a=a.catch(q)),n.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(i).then(q)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=r(this,F).build(this,t);return s.isStaleByTime(dt(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(q).catch(q)}fetchInfiniteQuery(e){return e.behavior=Ie(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(q).catch(q)}ensureInfiniteQueryData(e){return e.behavior=Ie(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Xt.isOnline()?r(this,ht).resumePausedMutations():Promise.resolve()}getQueryCache(){return r(this,F)}getMutationCache(){return r(this,ht)}getDefaultOptions(){return r(this,ct)}setDefaultOptions(e){o(this,ct,e)}setQueryDefaults(e,t){r(this,xt).set(Pt(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...r(this,xt).values()],s={};return t.forEach(i=>{kt(e,i.queryKey)&&Object.assign(s,i.defaultOptions)}),s}setMutationDefaults(e,t){r(this,At).set(Pt(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...r(this,At).values()],s={};return t.forEach(i=>{kt(e,i.mutationKey)&&Object.assign(s,i.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const t={...r(this,ct).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=pe(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===me&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...r(this,ct).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){r(this,F).clear(),r(this,ht).clear()}},F=new WeakMap,ht=new WeakMap,ct=new WeakMap,xt=new WeakMap,At=new WeakMap,lt=new WeakMap,jt=new WeakMap,Ut=new WeakMap,Ne),Ye=x.createContext(void 0),ts=e=>{const t=x.useContext(Ye);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Ls=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),ss.jsx(Ye.Provider,{value:e,children:t})),es=x.createContext(!1),Es=()=>x.useContext(es);es.Provider;function Fs(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ms=x.createContext(Fs()),Qs=()=>x.useContext(Ms),Is=(e,t,s)=>{const i=s!=null&&s.state.error&&typeof e.throwOnError=="function"?ve(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||i)&&(t.isReset()||(e.retryOnMount=!1))},Ts=e=>{x.useEffect(()=>{e.clearReset()},[e])},Ds=({result:e,errorResetBoundary:t,throwOnError:s,query:i,suspense:n})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(n&&e.data===void 0||ve(s,[e.error,i])),xs=e=>{if(e.suspense){const s=n=>n==="static"?n:Math.max(n??1e3,1e3),i=e.staleTime;e.staleTime=typeof i=="function"?(...n)=>s(i(...n)):s(i),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},As=(e,t)=>e.isLoading&&e.isFetching&&!t,js=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,De=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function Us(e,t,s){var g,d,E,C;const i=Es(),n=Qs(),a=ts(),h=a.defaultQueryOptions(e);(d=(g=a.getDefaultOptions().queries)==null?void 0:g._experimental_beforeQuery)==null||d.call(g,h);const u=a.getQueryCache().get(h.queryHash);h._optimisticResults=i?"isRestoring":"optimistic",xs(h),Is(h,n,u),Ts(n);const p=!a.getQueryCache().get(h.queryHash),[m]=x.useState(()=>new t(a,h)),v=m.getOptimisticResult(h),f=!i&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(w=>{const P=f?m.subscribe(M.batchCalls(w)):q;return m.updateResult(),P},[m,f]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),x.useEffect(()=>{m.setOptions(h)},[h,m]),js(h,v))throw De(h,m,n);if(Ds({result:v,errorResetBoundary:n,throwOnError:h.throwOnError,query:u,suspense:h.suspense}))throw v.error;if((C=(E=a.getDefaultOptions().queries)==null?void 0:E._experimental_afterQuery)==null||C.call(E,h,v),h.experimental_prefetchInRender&&!Ot&&As(v,i)){const w=p?De(h,m,n):u==null?void 0:u.promise;w==null||w.catch(q).finally(()=>{m.updateResult()})}return h.notifyOnChangeProps?v:m.trackResult(v)}function _s(e,t){return Us(e,bs)}function Hs(e,t){const s=ts(),[i]=x.useState(()=>new Ps(s,e));x.useEffect(()=>{i.setOptions(e)},[i,e]);const n=x.useSyncExternalStore(x.useCallback(h=>i.subscribe(M.batchCalls(h)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),a=x.useCallback((h,u)=>{i.mutate(h,u).catch(q)},[i]);if(n.error&&ve(i.options.throwOnError,[n.error]))throw n.error;return{...n,mutate:a,mutateAsync:n.mutate}}export{ks as Q,ts as a,Hs as b,Ls as c,_s as u};
@@ -1,25 +0,0 @@
1
- import{r as gt,g as Bn,a as An}from"./react-vendor--Eh9ivFN.js";var Ze={exports:{}},Se={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var jt;function jn(){if(jt)return Se;jt=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function t(s,r,o){var i=null;if(o!==void 0&&(i=""+o),r.key!==void 0&&(i=""+r.key),"key"in r){o={};for(var a in r)a!=="key"&&(o[a]=r[a])}else o=r;return r=o.ref,{$$typeof:e,type:s,key:i,ref:r!==void 0?r:null,props:o}}return Se.Fragment=n,Se.jsx=t,Se.jsxs=t,Se}var Dt;function Dn(){return Dt||(Dt=1,Ze.exports=jn()),Ze.exports}var w=Dn(),M=gt();const Ce=Bn(M),dt=new WeakMap,Nn=new WeakMap,Ne={current:[]};let Qe=!1,Le=0;const we=new Set,Fe=new Map;function cn(e){for(const n of e){if(Ne.current.includes(n))continue;Ne.current.push(n),n.recompute();const t=Nn.get(n);if(t)for(const s of t){const r=dt.get(s);r!=null&&r.length&&cn(r)}}}function Un(e){const n={prevVal:e.prevState,currentVal:e.state};for(const t of e.listeners)t(n)}function $n(e){const n={prevVal:e.prevState,currentVal:e.state};for(const t of e.listeners)t(n)}function ln(e){if(Le>0&&!Fe.has(e)&&Fe.set(e,e.prevState),we.add(e),!(Le>0)&&!Qe)try{for(Qe=!0;we.size>0;){const n=Array.from(we);we.clear();for(const t of n){const s=Fe.get(t)??t.prevState;t.prevState=s,Un(t)}for(const t of n){const s=dt.get(t);s&&(Ne.current.push(t),cn(s))}for(const t of n){const s=dt.get(t);if(s)for(const r of s)$n(r)}}}finally{Qe=!1,Ne.current=[],Fe.clear()}}function Vn(e){Le++;try{e()}finally{if(Le--,Le===0){const n=we.values().next().value;n&&ln(n)}}}function Wn(e){return typeof e=="function"}class zn{constructor(n,t){this.listeners=new Set,this.subscribe=s=>{var r,o;this.listeners.add(s);const i=(o=(r=this.options)==null?void 0:r.onSubscribe)==null?void 0:o.call(r,s,this);return()=>{this.listeners.delete(s),i==null||i()}},this.prevState=n,this.state=n,this.options=t}setState(n){var t,s,r;this.prevState=this.state,(t=this.options)!=null&&t.updateFn?this.state=this.options.updateFn(this.prevState)(n):Wn(n)?this.state=n(this.prevState):this.state=n,(r=(s=this.options)==null?void 0:s.onUpdate)==null||r.call(s),ln(this)}}const se="__TSR_index",Nt="popstate",Ut="beforeunload";function Hn(e){let n=e.getLocation();const t=new Set,s=i=>{n=e.getLocation(),t.forEach(a=>a({location:n,action:i}))},r=i=>{e.notifyOnIndexChange??!0?s(i):n=e.getLocation()},o=async({task:i,navigateOpts:a,...c})=>{var l,d;if((a==null?void 0:a.ignoreBlocker)??!1){i();return}const f=((l=e.getBlockers)==null?void 0:l.call(e))??[],u=c.type==="PUSH"||c.type==="REPLACE";if(typeof document<"u"&&f.length&&u)for(const m of f){const p=Ue(c.path,c.state);if(await m.blockerFn({currentLocation:n,nextLocation:p,action:c.type})){(d=e.onBlocked)==null||d.call(e);return}}i()};return{get location(){return n},get length(){return e.getLength()},subscribers:t,subscribe:i=>(t.add(i),()=>{t.delete(i)}),push:(i,a,c)=>{const h=n.state[se];a=$t(h+1,a),o({task:()=>{e.pushState(i,a),s({type:"PUSH"})},navigateOpts:c,type:"PUSH",path:i,state:a})},replace:(i,a,c)=>{const h=n.state[se];a=$t(h,a),o({task:()=>{e.replaceState(i,a),s({type:"REPLACE"})},navigateOpts:c,type:"REPLACE",path:i,state:a})},go:(i,a)=>{o({task:()=>{e.go(i),r({type:"GO",index:i})},navigateOpts:a,type:"GO"})},back:i=>{o({task:()=>{e.back((i==null?void 0:i.ignoreBlocker)??!1),r({type:"BACK"})},navigateOpts:i,type:"BACK"})},forward:i=>{o({task:()=>{e.forward((i==null?void 0:i.ignoreBlocker)??!1),r({type:"FORWARD"})},navigateOpts:i,type:"FORWARD"})},canGoBack:()=>n.state[se]!==0,createHref:i=>e.createHref(i),block:i=>{var c;if(!e.setBlockers)return()=>{};const a=((c=e.getBlockers)==null?void 0:c.call(e))??[];return e.setBlockers([...a,i]),()=>{var f,u;const h=((f=e.getBlockers)==null?void 0:f.call(e))??[];(u=e.setBlockers)==null||u.call(e,h.filter(l=>l!==i))}},flush:()=>{var i;return(i=e.flush)==null?void 0:i.call(e)},destroy:()=>{var i;return(i=e.destroy)==null?void 0:i.call(e)},notify:s}}function $t(e,n){n||(n={});const t=yt();return{...n,key:t,__TSR_key:t,[se]:e}}function Kn(e){var k,C;const n=typeof document<"u"?window:void 0,t=n.history.pushState,s=n.history.replaceState;let r=[];const o=()=>r,i=y=>r=y,a=y=>y,c=()=>Ue(`${n.location.pathname}${n.location.search}${n.location.hash}`,n.history.state);if(!((k=n.history.state)!=null&&k.__TSR_key)&&!((C=n.history.state)!=null&&C.key)){const y=yt();n.history.replaceState({[se]:0,key:y,__TSR_key:y},"")}let h=c(),f,u=!1,l=!1,d=!1,m=!1;const p=()=>h;let g,S;const v=()=>{g&&(R._ignoreSubscribers=!0,(g.isPush?n.history.pushState:n.history.replaceState)(g.state,"",g.href),R._ignoreSubscribers=!1,g=void 0,S=void 0,f=void 0)},L=(y,_,T)=>{const F=a(_);S||(f=h),h=Ue(_,T),g={href:F,state:T,isPush:(g==null?void 0:g.isPush)||y==="push"},S||(S=Promise.resolve().then(()=>v()))},P=y=>{h=c(),R.notify({type:y})},x=async()=>{if(l){l=!1;return}const y=c(),_=y.state[se]-h.state[se],T=_===1,F=_===-1,D=!T&&!F||u;u=!1;const I=D?"GO":F?"BACK":"FORWARD",b=D?{type:"GO",index:_}:{type:F?"BACK":"FORWARD"};if(d)d=!1;else{const O=o();if(typeof document<"u"&&O.length){for(const A of O)if(await A.blockerFn({currentLocation:h,nextLocation:y,action:I})){l=!0,n.history.go(1),R.notify(b);return}}}h=c(),R.notify(b)},E=y=>{if(m){m=!1;return}let _=!1;const T=o();if(typeof document<"u"&&T.length)for(const F of T){const D=F.enableBeforeUnload??!0;if(D===!0){_=!0;break}if(typeof D=="function"&&D()===!0){_=!0;break}}if(_)return y.preventDefault(),y.returnValue=""},R=Hn({getLocation:p,getLength:()=>n.history.length,pushState:(y,_)=>L("push",y,_),replaceState:(y,_)=>L("replace",y,_),back:y=>(y&&(d=!0),m=!0,n.history.back()),forward:y=>{y&&(d=!0),m=!0,n.history.forward()},go:y=>{u=!0,n.history.go(y)},createHref:y=>a(y),flush:v,destroy:()=>{n.history.pushState=t,n.history.replaceState=s,n.removeEventListener(Ut,E,{capture:!0}),n.removeEventListener(Nt,x)},onBlocked:()=>{f&&h!==f&&(h=f)},getBlockers:o,setBlockers:i,notifyOnIndexChange:!1});return n.addEventListener(Ut,E,{capture:!0}),n.addEventListener(Nt,x),n.history.pushState=function(...y){const _=t.apply(n.history,y);return R._ignoreSubscribers||P("PUSH"),_},n.history.replaceState=function(...y){const _=s.apply(n.history,y);return R._ignoreSubscribers||P("REPLACE"),_},R}function Gn(e){let n=e.replace(/[\x00-\x1f\x7f]/g,"");return n.startsWith("//")&&(n="/"+n.replace(/^\/+/,"")),n}function Ue(e,n){const t=Gn(e),s=t.indexOf("#"),r=t.indexOf("?"),o=yt();return{href:t,pathname:t.substring(0,s>0?r>0?Math.min(s,r):s:r>0?r:t.length),hash:s>-1?t.substring(s):"",search:r>-1?t.slice(r,s===-1?void 0:s):"",state:n||{[se]:0,key:o,__TSR_key:o}}}function yt(){return(Math.random()+1).toString(36).substring(7)}const qn=!1;function be(e){let n;return Vn(()=>{n=e()}),n}function ke(e){return e[e.length-1]}function Jn(e){return typeof e=="function"}function te(e,n){return Jn(e)?e(n):e}const Yn=Object.prototype.hasOwnProperty,Vt=Object.prototype.propertyIsEnumerable;function $(e,n,t=0){if(e===n)return e;if(t>500)return n;const s=n,r=Ht(e)&&Ht(s);if(!r&&!($e(e)&&$e(s)))return s;const o=r?e:Wt(e);if(!o)return s;const i=r?s:Wt(s);if(!i)return s;const a=o.length,c=i.length,h=r?new Array(c):{};let f=0;for(let u=0;u<c;u++){const l=r?u:i[u],d=e[l],m=s[l];if(d===m){h[l]=d,(r?u<a:Yn.call(e,l))&&f++;continue}if(d===null||m===null||typeof d!="object"||typeof m!="object"){h[l]=m;continue}const p=$(d,m,t+1);h[l]=p,p===d&&f++}return a===c&&f===a?e:h}function Wt(e){const n=Object.getOwnPropertyNames(e);for(const r of n)if(!Vt.call(e,r))return!1;const t=Object.getOwnPropertySymbols(e);if(t.length===0)return n;const s=n;for(const r of t){if(!Vt.call(e,r))return!1;s.push(r)}return s}function $e(e){if(!zt(e))return!1;const n=e.constructor;if(typeof n>"u")return!0;const t=n.prototype;return!(!zt(t)||!t.hasOwnProperty("isPrototypeOf"))}function zt(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ht(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ae(e,n,t){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return!1;for(let s=0,r=e.length;s<r;s++)if(!ae(e[s],n[s],t))return!1;return!0}if($e(e)&&$e(n)){const s=(t==null?void 0:t.ignoreUndefined)??!0;if(t!=null&&t.partial){for(const i in n)if((!s||n[i]!==void 0)&&!ae(e[i],n[i],t))return!1;return!0}let r=0;if(!s)r=Object.keys(e).length;else for(const i in e)e[i]!==void 0&&r++;let o=0;for(const i in n)if((!s||n[i]!==void 0)&&(o++,o>r||!ae(e[i],n[i],t)))return!1;return r===o}return!1}function pe(e){let n,t;const s=new Promise((r,o)=>{n=r,t=o});return s.status="pending",s.resolve=r=>{s.status="resolved",s.value=r,n(r),e==null||e(r)},s.reject=r=>{s.status="rejected",t(r)},s}function de(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function Xn(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function Kt(e){let n;try{n=decodeURI(e)}catch{n=e.replaceAll(/%[0-9A-F]{2}/gi,t=>{try{return decodeURI(t)}catch{return t}})}return Xn(n)}const un=["http:","https:","mailto:","tel:"];function Ve(e){if(!e)return!1;try{const n=new URL(e);return!un.includes(n.protocol)}catch{return!1}}function Pe(e,n){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return e;const t=/%25|%5C/gi;let s=0,r="",o;for(;(o=t.exec(e))!==null;)r+=Kt(e.slice(s,o.index))+o[0],s=t.lastIndex;return r=r+Kt(s?e.slice(s):e),r.startsWith("//")&&(r="/"+r.replace(/^\/+/,"")),r}function Zn(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var Qn="Invariant failed";function Q(e,n){if(!e)throw new Error(Qn)}function We(e){const n=new Map;let t,s;const r=o=>{o.next&&(o.prev?(o.prev.next=o.next,o.next.prev=o.prev,o.next=void 0,s&&(s.next=o,o.prev=s)):(o.next.prev=void 0,t=o.next,o.next=void 0,s&&(o.prev=s,s.next=o)),s=o)};return{get(o){const i=n.get(o);if(i)return r(i),i.value},set(o,i){if(n.size>=e&&t){const c=t;n.delete(c.key),c.next&&(t=c.next,c.next.prev=void 0),c===s&&(s=void 0)}const a=n.get(o);if(a)a.value=i,r(a);else{const c={key:o,value:i,prev:s};s&&(s.next=c),s=c,t||(t=c),n.set(o,c)}},clear(){n.clear(),t=void 0,s=void 0}}}const ge=0,le=1,ue=2,Me=3,oe=4,hn=5;function es(e){const n=e.indexOf("{");if(n===-1)return null;const t=e.indexOf("}",n);return t===-1||n+1>=e.length?null:[n,t]}function St(e,n,t=new Uint16Array(6)){const s=e.indexOf("/",n),r=s===-1?e.length:s,o=e.substring(n,r);if(!o||!o.includes("$"))return t[0]=ge,t[1]=n,t[2]=n,t[3]=r,t[4]=r,t[5]=r,t;if(o==="$"){const a=e.length;return t[0]=ue,t[1]=n,t[2]=n,t[3]=a,t[4]=a,t[5]=a,t}if(o.charCodeAt(0)===36)return t[0]=le,t[1]=n,t[2]=n+1,t[3]=r,t[4]=r,t[5]=r,t;const i=es(o);if(i){const[a,c]=i,h=o.charCodeAt(a+1);if(h===45){if(a+2<o.length&&o.charCodeAt(a+2)===36){const f=a+3,u=c;if(f<u)return t[0]=Me,t[1]=n+a,t[2]=n+f,t[3]=n+u,t[4]=n+c+1,t[5]=r,t}}else if(h===36){const f=a+1,u=a+2;return u===c?(t[0]=ue,t[1]=n+a,t[2]=n+f,t[3]=n+u,t[4]=n+c+1,t[5]=e.length,t):(t[0]=le,t[1]=n+a,t[2]=n+u,t[3]=n+c,t[4]=n+c+1,t[5]=r,t)}}return t[0]=ge,t[1]=n,t[2]=n,t[3]=r,t[4]=r,t[5]=r,t}function Ge(e,n,t,s,r,o,i){var c,h,f,u,l,d,m,p,g,S,v,L,P;i==null||i(t);let a=s;{const x=t.fullPath??t.from,E=x.length,R=((c=t.options)==null?void 0:c.caseSensitive)??e,k=!!((f=(h=t.options)==null?void 0:h.params)!=null&&f.parse&&((l=(u=t.options)==null?void 0:u.skipRouteOnParseError)!=null&&l.params));for(;a<E;){const y=St(x,a,n);let _;const T=a,F=y[5];switch(a=F+1,o++,y[0]){case ge:{const I=x.substring(y[2],y[3]);if(R){const b=(d=r.static)==null?void 0:d.get(I);if(b)_=b;else{r.static??(r.static=new Map);const O=ie(t.fullPath??t.from);O.parent=r,O.depth=o,_=O,r.static.set(I,O)}}else{const b=I.toLowerCase(),O=(m=r.staticInsensitive)==null?void 0:m.get(b);if(O)_=O;else{r.staticInsensitive??(r.staticInsensitive=new Map);const A=ie(t.fullPath??t.from);A.parent=r,A.depth=o,_=A,r.staticInsensitive.set(b,A)}}break}case le:{const I=x.substring(T,y[1]),b=x.substring(y[4],F),O=R&&!!(I||b),A=I?O?I:I.toLowerCase():void 0,N=b?O?b:b.toLowerCase():void 0,V=!k&&((p=r.dynamic)==null?void 0:p.find(j=>!j.skipOnParamError&&j.caseSensitive===O&&j.prefix===A&&j.suffix===N));if(V)_=V;else{const j=tt(le,t.fullPath??t.from,O,A,N);_=j,j.depth=o,j.parent=r,r.dynamic??(r.dynamic=[]),r.dynamic.push(j)}break}case Me:{const I=x.substring(T,y[1]),b=x.substring(y[4],F),O=R&&!!(I||b),A=I?O?I:I.toLowerCase():void 0,N=b?O?b:b.toLowerCase():void 0,V=!k&&((g=r.optional)==null?void 0:g.find(j=>!j.skipOnParamError&&j.caseSensitive===O&&j.prefix===A&&j.suffix===N));if(V)_=V;else{const j=tt(Me,t.fullPath??t.from,O,A,N);_=j,j.parent=r,j.depth=o,r.optional??(r.optional=[]),r.optional.push(j)}break}case ue:{const I=x.substring(T,y[1]),b=x.substring(y[4],F),O=R&&!!(I||b),A=I?O?I:I.toLowerCase():void 0,N=b?O?b:b.toLowerCase():void 0,V=tt(ue,t.fullPath??t.from,O,A,N);_=V,V.parent=r,V.depth=o,r.wildcard??(r.wildcard=[]),r.wildcard.push(V)}}r=_}if(k&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf("/")+1)===95){const y=ie(t.fullPath??t.from);y.kind=hn,y.parent=r,o++,y.depth=o,r.pathless??(r.pathless=[]),r.pathless.push(y),r=y}const C=(t.path||!t.children)&&!t.isRoot;if(C&&x.endsWith("/")){const y=ie(t.fullPath??t.from);y.kind=oe,y.parent=r,o++,y.depth=o,r.index=y,r=y}r.parse=((v=(S=t.options)==null?void 0:S.params)==null?void 0:v.parse)??null,r.skipOnParamError=k,r.parsingPriority=((P=(L=t.options)==null?void 0:L.skipRouteOnParseError)==null?void 0:P.priority)??0,C&&!r.route&&(r.route=t,r.fullPath=t.fullPath??t.from)}if(t.children)for(const x of t.children)Ge(e,n,x,a,r,o,i)}function et(e,n){if(e.skipOnParamError&&!n.skipOnParamError)return-1;if(!e.skipOnParamError&&n.skipOnParamError)return 1;if(e.skipOnParamError&&n.skipOnParamError&&(e.parsingPriority||n.parsingPriority))return n.parsingPriority-e.parsingPriority;if(e.prefix&&n.prefix&&e.prefix!==n.prefix){if(e.prefix.startsWith(n.prefix))return-1;if(n.prefix.startsWith(e.prefix))return 1}if(e.suffix&&n.suffix&&e.suffix!==n.suffix){if(e.suffix.endsWith(n.suffix))return-1;if(n.suffix.endsWith(e.suffix))return 1}return e.prefix&&!n.prefix?-1:!e.prefix&&n.prefix?1:e.suffix&&!n.suffix?-1:!e.suffix&&n.suffix?1:e.caseSensitive&&!n.caseSensitive?-1:!e.caseSensitive&&n.caseSensitive?1:0}function ee(e){var n,t,s;if(e.pathless)for(const r of e.pathless)ee(r);if(e.static)for(const r of e.static.values())ee(r);if(e.staticInsensitive)for(const r of e.staticInsensitive.values())ee(r);if((n=e.dynamic)!=null&&n.length){e.dynamic.sort(et);for(const r of e.dynamic)ee(r)}if((t=e.optional)!=null&&t.length){e.optional.sort(et);for(const r of e.optional)ee(r)}if((s=e.wildcard)!=null&&s.length){e.wildcard.sort(et);for(const r of e.wildcard)ee(r)}}function ie(e){return{kind:ge,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function tt(e,n,t,s,r){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:n,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:t,prefix:s,suffix:r}}function ts(e,n){const t=ie("/"),s=new Uint16Array(6);for(const r of e)Ge(!1,s,r,1,t,0);ee(t),n.masksTree=t,n.flatCache=We(1e3)}function ns(e,n){e||(e="/");const t=n.flatCache.get(e);if(t)return t;const s=Pt(e,n.masksTree);return n.flatCache.set(e,s),s}function ss(e,n,t,s,r){e||(e="/"),s||(s="/");const o=n?`case\0${e}`:e;let i=r.singleCache.get(o);if(!i){i=ie("/");const a=new Uint16Array(6);Ge(n,a,{from:e},1,i,0),r.singleCache.set(o,i)}return Pt(s,i,t)}function rs(e,n,t=!1){const s=t?e:`nofuzz\0${e}`,r=n.matchCache.get(s);if(r!==void 0)return r;e||(e="/");let o;try{o=Pt(e,n.segmentTree,t)}catch(i){if(i instanceof URIError)o=null;else throw i}return o&&(o.branch=as(o.route)),n.matchCache.set(s,o),o}function os(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function is(e,n=!1,t){const s=ie(e.fullPath),r=new Uint16Array(6),o={},i={};let a=0;return Ge(n,r,e,1,s,0,h=>{if(t==null||t(h,a),Q(!(h.id in o),`Duplicate routes found with id: ${String(h.id)}`),o[h.id]=h,a!==0&&h.path){const f=os(h.fullPath);(!i[f]||h.fullPath.endsWith("/"))&&(i[f]=h)}a++}),ee(s),{processedTree:{segmentTree:s,singleCache:We(1e3),matchCache:We(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:i}}function Pt(e,n,t=!1){const s=e.split("/"),r=ls(e,s,n,t);if(!r)return null;const[o]=fn(e,s,r);return{route:r.node.route,rawParams:o,parsedParams:r.parsedParams}}function fn(e,n,t){var f,u,l,d,m,p,g,S,v,L;const s=cs(t.node);let r=null;const o={};let i=((f=t.extract)==null?void 0:f.part)??0,a=((u=t.extract)==null?void 0:u.node)??0,c=((l=t.extract)==null?void 0:l.path)??0,h=((d=t.extract)==null?void 0:d.segment)??0;for(;a<s.length;i++,a++,c++,h++){const P=s[a];if(P.kind===oe)break;if(P.kind===hn){h--,i--,c--;continue}const x=n[i],E=c;if(x&&(c+=x.length),P.kind===le){r??(r=t.node.fullPath.split("/"));const R=r[h],k=((m=P.prefix)==null?void 0:m.length)??0;if(R.charCodeAt(k)===123){const y=((p=P.suffix)==null?void 0:p.length)??0,_=R.substring(k+2,R.length-y-1),T=x.substring(k,x.length-y);o[_]=decodeURIComponent(T)}else{const y=R.substring(1);o[y]=decodeURIComponent(x)}}else if(P.kind===Me){if(t.skipped&1<<a){i--,c=E-1;continue}r??(r=t.node.fullPath.split("/"));const R=r[h],k=((g=P.prefix)==null?void 0:g.length)??0,C=((S=P.suffix)==null?void 0:S.length)??0,y=R.substring(k+3,R.length-C-1),_=P.suffix||P.prefix?x.substring(k,x.length-C):x;_&&(o[y]=decodeURIComponent(_))}else if(P.kind===ue){const R=P,k=e.substring(E+(((v=R.prefix)==null?void 0:v.length)??0),e.length-(((L=R.suffix)==null?void 0:L.length)??0)),C=decodeURIComponent(k);o["*"]=C,o._splat=C;break}}return t.rawParams&&Object.assign(o,t.rawParams),[o,{part:i,node:a,path:c,segment:h}]}function as(e){const n=[e];for(;e.parentRoute;)e=e.parentRoute,n.push(e);return n.reverse(),n}function cs(e){const n=Array(e.depth+1);do n[e.depth]=e,e=e.parent;while(e);return n}function ls(e,n,t,s){if(e==="/"&&t.index)return{node:t.index,skipped:0};const r=!ke(n),o=r&&e!=="/",i=n.length-(r?1:0),a=[{node:t,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let c=null,h=null,f=null;for(;a.length;){const u=a.pop(),{node:l,index:d,skipped:m,depth:p,statics:g,dynamics:S,optionals:v}=u;let{extract:L,rawParams:P,parsedParams:x}=u;if(l.skipOnParamError){if(!nt(e,n,u))continue;P=u.rawParams,L=u.extract,x=u.parsedParams}s&&l.route&&l.kind!==oe&&ve(h,u)&&(h=u);const E=d===i;if(E&&(l.route&&!o&&ve(f,u)&&(f=u),!l.optional&&!l.wildcard&&!l.index&&!l.pathless))continue;const R=E?void 0:n[d];let k;if(E&&l.index){const C={node:l.index,index:d,skipped:m,depth:p+1,statics:g,dynamics:S,optionals:v,extract:L,rawParams:P,parsedParams:x};let y=!0;if(l.index.skipOnParamError&&(nt(e,n,C)||(y=!1)),y){if(g===i&&!S&&!v&&!m)return C;ve(f,C)&&(f=C)}}if(l.wildcard&&ve(c,u))for(const C of l.wildcard){const{prefix:y,suffix:_}=C;if(y&&(E||!(C.caseSensitive?R:k??(k=R.toLowerCase())).startsWith(y)))continue;if(_){if(E)continue;const F=n.slice(d).join("/").slice(-_.length);if((C.caseSensitive?F:F.toLowerCase())!==_)continue}const T={node:C,index:i,skipped:m,depth:p,statics:g,dynamics:S,optionals:v,extract:L,rawParams:P,parsedParams:x};if(!(C.skipOnParamError&&!nt(e,n,T))){c=T;break}}if(l.optional){const C=m|1<<p,y=p+1;for(let _=l.optional.length-1;_>=0;_--){const T=l.optional[_];a.push({node:T,index:d,skipped:C,depth:y,statics:g,dynamics:S,optionals:v,extract:L,rawParams:P,parsedParams:x})}if(!E)for(let _=l.optional.length-1;_>=0;_--){const T=l.optional[_],{prefix:F,suffix:D}=T;if(F||D){const I=T.caseSensitive?R:k??(k=R.toLowerCase());if(F&&!I.startsWith(F)||D&&!I.endsWith(D))continue}a.push({node:T,index:d+1,skipped:m,depth:y,statics:g,dynamics:S,optionals:v+1,extract:L,rawParams:P,parsedParams:x})}}if(!E&&l.dynamic&&R)for(let C=l.dynamic.length-1;C>=0;C--){const y=l.dynamic[C],{prefix:_,suffix:T}=y;if(_||T){const F=y.caseSensitive?R:k??(k=R.toLowerCase());if(_&&!F.startsWith(_)||T&&!F.endsWith(T))continue}a.push({node:y,index:d+1,skipped:m,depth:p+1,statics:g,dynamics:S+1,optionals:v,extract:L,rawParams:P,parsedParams:x})}if(!E&&l.staticInsensitive){const C=l.staticInsensitive.get(k??(k=R.toLowerCase()));C&&a.push({node:C,index:d+1,skipped:m,depth:p+1,statics:g+1,dynamics:S,optionals:v,extract:L,rawParams:P,parsedParams:x})}if(!E&&l.static){const C=l.static.get(R);C&&a.push({node:C,index:d+1,skipped:m,depth:p+1,statics:g+1,dynamics:S,optionals:v,extract:L,rawParams:P,parsedParams:x})}if(l.pathless){const C=p+1;for(let y=l.pathless.length-1;y>=0;y--){const _=l.pathless[y];a.push({node:_,index:d,skipped:m,depth:C,statics:g,dynamics:S,optionals:v,extract:L,rawParams:P,parsedParams:x})}}}if(f&&c)return ve(c,f)?f:c;if(f)return f;if(c)return c;if(s&&h){let u=h.index;for(let d=0;d<h.index;d++)u+=n[d].length;const l=u===e.length?"/":e.slice(u);return h.rawParams??(h.rawParams={}),h.rawParams["**"]=decodeURIComponent(l),h}return null}function nt(e,n,t){try{const[s,r]=fn(e,n,t);t.rawParams=s,t.extract=r;const o=t.node.parse(s);return t.parsedParams=Object.assign({},t.parsedParams,o),!0}catch{return null}}function ve(e,n){return e?n.statics>e.statics||n.statics===e.statics&&(n.dynamics>e.dynamics||n.dynamics===e.dynamics&&(n.optionals>e.optionals||n.optionals===e.optionals&&((n.node.kind===oe)>(e.node.kind===oe)||n.node.kind===oe==(e.node.kind===oe)&&n.depth>e.depth))):!0}function Ae(e){return vt(e.filter(n=>n!==void 0).join("/"))}function vt(e){return e.replace(/\/{2,}/g,"/")}function dn(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Z(e){const n=e.length;return n>1&&e[n-1]==="/"?e.replace(/\/{1,}$/,""):e}function mn(e){return Z(dn(e))}function ze(e,n){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${n}/`?e.slice(0,-1):e}function us(e,n,t){return ze(e,t)===ze(n,t)}function hs({base:e,to:n,trailingSlash:t="never",cache:s}){const r=n.startsWith("/"),o=!r&&n===".";let i;if(s){i=r?n:o?e:e+"\0"+n;const u=s.get(i);if(u)return u}let a;if(o)a=e.split("/");else if(r)a=n.split("/");else{for(a=e.split("/");a.length>1&&ke(a)==="";)a.pop();const u=n.split("/");for(let l=0,d=u.length;l<d;l++){const m=u[l];m===""?l?l===d-1&&a.push(m):a=[m]:m===".."?a.pop():m==="."||a.push(m)}}a.length>1&&(ke(a)===""?t==="never"&&a.pop():t==="always"&&a.push(""));let c,h="";for(let u=0;u<a.length;u++){u>0&&(h+="/");const l=a[u];if(!l)continue;c=St(l,0,c);const d=c[0];if(d===ge){h+=l;continue}const m=c[5],p=l.substring(0,c[1]),g=l.substring(c[4],m),S=l.substring(c[2],c[3]);d===le?h+=p||g?`${p}{$${S}}${g}`:`$${S}`:d===ue?h+=p||g?`${p}{$}${g}`:"$":h+=`${p}{-$${S}}${g}`}h=vt(h);const f=h||"/";return i&&s&&s.set(i,f),f}function fs(e){const n=new Map(e.map(r=>[encodeURIComponent(r),r])),t=Array.from(n.keys()).map(r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),s=new RegExp(t,"g");return r=>r.replace(s,o=>n.get(o)??o)}function st(e,n,t){const s=n[e];return typeof s!="string"?s:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(s)?s:s.split("/").map(r=>Gt(r,t)).join("/"):Gt(s,t)}function rt({path:e,params:n,decoder:t,server:s}){let r=!1;const o={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:o,isMissingParams:r};if(!e.includes("$"))return{interpolatedPath:e,usedParams:o,isMissingParams:r};const i=e.length;let a=0,c,h="";for(;a<i;){const u=a;c=St(e,u,c);const l=c[5];if(a=l+1,u===l)continue;const d=c[0];if(d===ge){h+="/"+e.substring(u,l);continue}if(d===ue){const m=n._splat;o._splat=m,o["*"]=m;const p=e.substring(u,c[1]),g=e.substring(c[4],l);if(!m){r=!0,(p||g)&&(h+="/"+p+g);continue}const S=st("_splat",n,t);h+="/"+p+S+g;continue}if(d===le){const m=e.substring(c[2],c[3]);!r&&!(m in n)&&(r=!0),o[m]=n[m];const p=e.substring(u,c[1]),g=e.substring(c[4],l),S=st(m,n,t)??"undefined";h+="/"+p+S+g;continue}if(d===Me){const m=e.substring(c[2],c[3]),p=n[m];if(p==null)continue;o[m]=p;const g=e.substring(u,c[1]),S=e.substring(c[4],l),v=st(m,n,t)??"";h+="/"+g+v+S;continue}}return e.endsWith("/")&&(h+="/"),{usedParams:o,interpolatedPath:h||"/",isMissingParams:r}}function Gt(e,n){const t=encodeURIComponent(e);return(n==null?void 0:n(t))??t}function W(e){return!!(e!=null&&e.isNotFound)}function ds(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const mt="tsr-scroll-restoration-v1_3",ms=(e,n)=>{let t;return(...s)=>{t||(t=setTimeout(()=>{e(...s),t=null},n))}};function ps(){const e=ds();if(!e)return null;const n=e.getItem(mt);let t=n?JSON.parse(n):{};return{state:t,set:s=>{t=te(s,t)||t;try{e.setItem(mt,JSON.stringify(t))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Oe=ps(),gs=e=>e.state.__TSR_key||e.href;function ys(e){const n=[];let t;for(;t=e.parentNode;)n.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(t.children,e)+1})`),e=t;return`${n.reverse().join(" > ")}`.toLowerCase()}let He=!1;function Ss({storageKey:e,key:n,behavior:t,shouldScrollRestoration:s,scrollToTopSelectors:r,location:o}){var h,f;let i;try{i=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(u){console.error(u);return}const a=n||((h=window.history.state)==null?void 0:h.__TSR_key),c=i[a];He=!0;e:{if(s&&c&&Object.keys(c).length>0){for(const d in c){const m=c[d];if(d==="window")window.scrollTo({top:m.scrollY,left:m.scrollX,behavior:t});else if(d){const p=document.querySelector(d);p&&(p.scrollLeft=m.scrollX,p.scrollTop=m.scrollY)}}break e}const u=(o??window.location).hash.split("#",2)[1];if(u){const d=((f=window.history.state)==null?void 0:f.__hashScrollIntoViewOptions)??!0;if(d){const m=document.getElementById(u);m&&m.scrollIntoView(d)}break e}const l={top:0,left:0,behavior:t};if(window.scrollTo(l),r)for(const d of r){if(d==="window")continue;const m=typeof d=="function"?d():document.querySelector(d);m&&m.scrollTo(l)}}He=!1}function Ps(e,n){if(!Oe||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Oe))return;e.isScrollRestorationSetup=!0,He=!1;const s=e.options.getScrollRestorationKey||gs;window.history.scrollRestoration="manual";const r=o=>{if(He||!e.isScrollRestoring)return;let i="";if(o.target===document||o.target===window)i="window";else{const c=o.target.getAttribute("data-scroll-restoration-id");c?i=`[data-scroll-restoration-id="${c}"]`:i=ys(o.target)}const a=s(e.state.location);Oe.set(c=>{const h=c[a]||(c[a]={}),f=h[i]||(h[i]={});if(i==="window")f.scrollX=window.scrollX||0,f.scrollY=window.scrollY||0;else if(i){const u=document.querySelector(i);u&&(f.scrollX=u.scrollLeft||0,f.scrollY=u.scrollTop||0)}return c})};typeof document<"u"&&document.addEventListener("scroll",ms(r,100),!0),e.subscribe("onRendered",o=>{const i=s(o.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(Ss({storageKey:mt,key:i,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Oe.set(a=>(a[i]||(a[i]={}),a)))})}function vs(e){if(typeof document<"u"&&document.querySelector){const n=e.state.location.state.__hashScrollIntoViewOptions??!0;if(n&&e.state.location.hash!==""){const t=document.getElementById(e.state.location.hash);t&&t.scrollIntoView(n)}}}function Rs(e,n=String){const t=new URLSearchParams;for(const s in e){const r=e[s];r!==void 0&&t.set(s,n(r))}return t.toString()}function ot(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function _s(e){const n=new URLSearchParams(e),t={};for(const[s,r]of n.entries()){const o=t[s];o==null?t[s]=ot(r):Array.isArray(o)?o.push(ot(r)):t[s]=[o,ot(r)]}return t}const xs=Ls(JSON.parse),ws=bs(JSON.stringify,JSON.parse);function Ls(e){return n=>{n[0]==="?"&&(n=n.substring(1));const t=_s(n);for(const s in t){const r=t[s];if(typeof r=="string")try{t[s]=e(r)}catch{}}return t}}function bs(e,n){const t=typeof n=="function";function s(r){if(typeof r=="object"&&r!==null)try{return e(r)}catch{}else if(t&&typeof r=="string")try{return n(r),e(r)}catch{}return r}return r=>{const o=Rs(r,s);return o?`?${o}`:""}}const K="__root__";function Cs(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&typeof e.href=="string"&&Ve(e.href))throw new Error(`Redirect blocked: unsafe protocol in href "${e.href}". Only ${un.join(", ")} protocols are allowed.`);if(!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const n=new Headers(e.headers);e.href&&n.get("Location")===null&&n.set("Location",e.href);const t=new Response(null,{status:e.statusCode,headers:n});if(t.options=e,e.throw)throw t;return t}function G(e){return e instanceof Response&&!!e.options}const je=e=>{var n;if(!e.rendered)return e.rendered=!0,(n=e.onReady)==null?void 0:n.call(e)},qe=(e,n)=>!!(e.preload&&!e.router.state.matches.some(t=>t.id===n)),me=(e,n,t=!0)=>{const s={...e.router.options.context??{}},r=t?n:n-1;for(let o=0;o<=r;o++){const i=e.matches[o];if(!i)continue;const a=e.router.getMatch(i.id);a&&Object.assign(s,a.__routeContext,a.__beforeLoadContext)}return s},pn=(e,n)=>{var r;const t=e.router.routesById[n.routeId??""]??e.router.routeTree;!t.options.notFoundComponent&&((r=e.router.options)!=null&&r.defaultNotFoundComponent)&&(t.options.notFoundComponent=e.router.options.defaultNotFoundComponent),Q(t.options.notFoundComponent);const s=e.matches.find(o=>o.routeId===t.id);Q(s,"Could not find match for route: "+t.id),e.updateMatch(s.id,o=>({...o,status:"notFound",error:n,isFetching:!1})),n.routerCode==="BEFORE_LOAD"&&t.parentRoute&&(n.routeId=t.parentRoute.id,pn(e,n))},ne=(e,n,t)=>{var s,r,o;if(!(!G(t)&&!W(t))){if(G(t)&&t.redirectHandled&&!t.options.reloadDocument)throw t;if(n){(s=n._nonReactive.beforeLoadPromise)==null||s.resolve(),(r=n._nonReactive.loaderPromise)==null||r.resolve(),n._nonReactive.beforeLoadPromise=void 0,n._nonReactive.loaderPromise=void 0;const i=G(t)?"redirected":"notFound";n._nonReactive.error=t,e.updateMatch(n.id,a=>({...a,status:i,context:me(e,n.index),isFetching:!1,error:t})),W(t)&&!t.routeId&&(t.routeId=n.routeId),(o=n._nonReactive.loadPromise)==null||o.resolve()}throw G(t)?(e.rendered=!0,t.options._fromLocation=e.location,t.redirectHandled=!0,t=e.router.resolveRedirect(t),t):(pn(e,t),t)}},gn=(e,n)=>!!e.router.getMatch(n)._nonReactive.dehydrated,Re=(e,n,t,s)=>{var a,c;const{id:r,routeId:o}=e.matches[n],i=e.router.looseRoutesById[o];if(t instanceof Promise)throw t;t.routerCode=s,e.firstBadMatchIndex??(e.firstBadMatchIndex=n),ne(e,e.router.getMatch(r),t);try{(c=(a=i.options).onError)==null||c.call(a,t)}catch(h){t=h,ne(e,e.router.getMatch(r),t)}e.updateMatch(r,h=>{var f,u;return(f=h._nonReactive.beforeLoadPromise)==null||f.resolve(),h._nonReactive.beforeLoadPromise=void 0,(u=h._nonReactive.loadPromise)==null||u.resolve(),{...h,error:t,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}})},yn=(e,n,t,s)=>{var i;if(s._nonReactive.pendingTimeout!==void 0)return;const r=t.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!qe(e,n)&&(t.options.loader||t.options.beforeLoad||vn(t))&&typeof r=="number"&&r!==1/0&&(t.options.pendingComponent??((i=e.router.options)==null?void 0:i.defaultPendingComponent)))){const a=setTimeout(()=>{je(e)},r);s._nonReactive.pendingTimeout=a}},ks=(e,n,t)=>{const s=e.router.getMatch(n);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;yn(e,n,t,s);const r=()=>{const o=e.router.getMatch(n);o.preload&&(o.status==="redirected"||o.status==="notFound")&&ne(e,o,o.error)};return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(r):r()},Ms=(e,n,t,s)=>{const r=e.router.getMatch(n),o=r._nonReactive.loadPromise;r._nonReactive.loadPromise=pe(()=>{o==null||o.resolve()});const{paramsError:i,searchError:a}=r;i&&Re(e,t,i,"PARSE_PARAMS"),a&&Re(e,t,a,"VALIDATE_SEARCH"),yn(e,n,s,r);const c=new AbortController;let h=!1;const f=()=>{h||(h=!0,e.updateMatch(n,P=>({...P,isFetching:"beforeLoad",fetchCount:P.fetchCount+1,abortController:c})))},u=()=>{var P;(P=r._nonReactive.beforeLoadPromise)==null||P.resolve(),r._nonReactive.beforeLoadPromise=void 0,e.updateMatch(n,x=>({...x,isFetching:!1}))};if(!s.options.beforeLoad){be(()=>{f(),u()});return}r._nonReactive.beforeLoadPromise=pe();const l={...me(e,t,!1),...r.__routeContext},{search:d,params:m,cause:p}=r,g=qe(e,n),S={search:d,abortController:c,params:m,preload:g,context:l,location:e.location,navigate:P=>e.router.navigate({...P,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?"preload":p,matches:e.matches,...e.router.options.additionalContext},v=P=>{if(P===void 0){be(()=>{f(),u()});return}(G(P)||W(P))&&(f(),Re(e,t,P,"BEFORE_LOAD")),be(()=>{f(),e.updateMatch(n,x=>({...x,__beforeLoadContext:P})),u()})};let L;try{if(L=s.options.beforeLoad(S),de(L))return f(),L.catch(P=>{Re(e,t,P,"BEFORE_LOAD")}).then(v)}catch(P){f(),Re(e,t,P,"BEFORE_LOAD")}v(L)},Es=(e,n)=>{const{id:t,routeId:s}=e.matches[n],r=e.router.looseRoutesById[s],o=()=>a(),i=()=>Ms(e,t,n,r),a=()=>{if(gn(e,t))return;const c=ks(e,t,r);return de(c)?c.then(i):i()};return o()},Ts=(e,n,t)=>{var o,i,a,c,h,f;const s=e.router.getMatch(n);if(!s||!t.options.head&&!t.options.scripts&&!t.options.headers)return;const r={ssr:e.router.options.ssr,matches:e.matches,match:s,params:s.params,loaderData:s.loaderData};return Promise.all([(i=(o=t.options).head)==null?void 0:i.call(o,r),(c=(a=t.options).scripts)==null?void 0:c.call(a,r),(f=(h=t.options).headers)==null?void 0:f.call(h,r)]).then(([u,l,d])=>{const m=u==null?void 0:u.meta,p=u==null?void 0:u.links,g=u==null?void 0:u.scripts,S=u==null?void 0:u.styles;return{meta:m,links:p,headScripts:g,headers:d,scripts:l,styles:S}})},Sn=(e,n,t,s)=>{const r=e.matchPromises[t-1],{params:o,loaderDeps:i,abortController:a,cause:c}=e.router.getMatch(n),h=me(e,t),f=qe(e,n);return{params:o,deps:i,preload:!!f,parentMatchPromise:r,abortController:a,context:h,location:e.location,navigate:u=>e.router.navigate({...u,_fromLocation:e.location}),cause:f?"preload":c,route:s,...e.router.options.additionalContext}},qt=async(e,n,t,s)=>{var r,o,i,a,c,h;try{const f=e.router.getMatch(n);try{(!(qn??e.router.isServer)||f.ssr===!0)&&Pn(s);const u=(o=(r=s.options).loader)==null?void 0:o.call(r,Sn(e,n,t,s)),l=s.options.loader&&de(u);if(!!(l||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||f._nonReactive.minPendingPromise)&&e.updateMatch(n,p=>({...p,isFetching:"loader"})),s.options.loader){const p=l?await u:u;ne(e,e.router.getMatch(n),p),p!==void 0&&e.updateMatch(n,g=>({...g,loaderData:p}))}s._lazyPromise&&await s._lazyPromise;const m=f._nonReactive.minPendingPromise;m&&await m,s._componentsPromise&&await s._componentsPromise,e.updateMatch(n,p=>({...p,error:void 0,context:me(e,t),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(u){let l=u;if((l==null?void 0:l.name)==="AbortError"){e.updateMatch(n,m=>({...m,status:m.status==="pending"?"success":m.status,isFetching:!1,context:me(e,t)}));return}const d=f._nonReactive.minPendingPromise;d&&await d,W(u)&&await((a=(i=s.options.notFoundComponent)==null?void 0:i.preload)==null?void 0:a.call(i)),ne(e,e.router.getMatch(n),u);try{(h=(c=s.options).onError)==null||h.call(c,u)}catch(m){l=m,ne(e,e.router.getMatch(n),m)}e.updateMatch(n,m=>({...m,error:l,context:me(e,t),status:"error",isFetching:!1}))}}catch(f){const u=e.router.getMatch(n);u&&(u._nonReactive.loaderPromise=void 0),ne(e,u,f)}},Is=async(e,n)=>{var h,f;const{id:t,routeId:s}=e.matches[n];let r=!1,o=!1;const i=e.router.looseRoutesById[s];if(!gn(e,t)){const u=e.router.getMatch(t);if(u._nonReactive.loaderPromise){if(u.status==="success"&&!e.sync&&!u.preload)return u;await u._nonReactive.loaderPromise;const l=e.router.getMatch(t),d=l._nonReactive.error||l.error;d&&ne(e,l,d)}else{const l=Date.now()-u.updatedAt,d=qe(e,t),m=d?i.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:i.options.staleTime??e.router.options.defaultStaleTime??0,p=i.options.shouldReload,g=typeof p=="function"?p(Sn(e,t,n,i)):p,S=!!d&&!e.router.state.matches.some(x=>x.id===t),v=e.router.getMatch(t);v._nonReactive.loaderPromise=pe(),S!==v.preload&&e.updateMatch(t,x=>({...x,preload:S}));const{status:L,invalid:P}=v;r=L==="success"&&(P||(g??l>m)),d&&i.options.preload===!1||(r&&!e.sync?(o=!0,(async()=>{var x,E;try{await qt(e,t,n,i);const R=e.router.getMatch(t);(x=R._nonReactive.loaderPromise)==null||x.resolve(),(E=R._nonReactive.loadPromise)==null||E.resolve(),R._nonReactive.loaderPromise=void 0}catch(R){G(R)&&await e.router.navigate(R.options)}})()):(L!=="success"||r&&e.sync)&&await qt(e,t,n,i))}}const a=e.router.getMatch(t);o||((h=a._nonReactive.loaderPromise)==null||h.resolve(),(f=a._nonReactive.loadPromise)==null||f.resolve()),clearTimeout(a._nonReactive.pendingTimeout),a._nonReactive.pendingTimeout=void 0,o||(a._nonReactive.loaderPromise=void 0),a._nonReactive.dehydrated=void 0;const c=o?a.isFetching:!1;return c!==a.isFetching||a.invalid!==!1?(e.updateMatch(t,u=>({...u,isFetching:c,invalid:!1})),e.router.getMatch(t)):a};async function Jt(e){const n=Object.assign(e,{matchPromises:[]});n.router.state.matches.some(t=>t._forcePending)&&je(n);try{for(let a=0;a<n.matches.length;a++){const c=Es(n,a);de(c)&&await c}const t=n.firstBadMatchIndex??n.matches.length;for(let a=0;a<t;a++)n.matchPromises.push(Is(n,a));const r=(await Promise.allSettled(n.matchPromises)).filter(a=>a.status==="rejected").map(a=>a.reason);let o;for(const a of r){if(G(a))throw a;!o&&W(a)&&(o=a)}for(const a of n.matches){const{id:c,routeId:h}=a,f=n.router.looseRoutesById[h];try{const u=Ts(n,c,f);if(u){const l=await u;n.updateMatch(c,d=>({...d,...l}))}}catch(u){console.error(`Error executing head for route ${h}:`,u)}}if(o)throw o;const i=je(n);de(i)&&await i}catch(t){if(W(t)&&!n.preload){const s=je(n);throw de(s)&&await s,t}if(G(t))throw t}return n.matches}async function Pn(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(n=>{const{id:t,...s}=n.options;Object.assign(e.options,s),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const n=()=>{var s;const t=[];for(const r of Rn){const o=(s=e.options[r])==null?void 0:s.preload;o&&t.push(o())}if(t.length)return Promise.all(t).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(n):n()}return e._componentsPromise}function vn(e){var n;for(const t of Rn)if((n=e.options[t])!=null&&n.preload)return!0;return!1}const Rn=["component","errorComponent","pendingComponent","notFoundComponent"];function Fs(e){return{input:({url:n})=>{for(const t of e)n=pt(t,n);return n},output:({url:n})=>{for(let t=e.length-1;t>=0;t--)n=_n(e[t],n);return n}}}function Os(e){const n=mn(e.basepath),t=`/${n}`,s=`${t}/`,r=e.caseSensitive?t:t.toLowerCase(),o=e.caseSensitive?s:s.toLowerCase();return{input:({url:i})=>{const a=e.caseSensitive?i.pathname:i.pathname.toLowerCase();return a===r?i.pathname="/":a.startsWith(o)&&(i.pathname=i.pathname.slice(t.length)),i},output:({url:i})=>(i.pathname=Ae(["/",n,i.pathname]),i)}}function pt(e,n){var s;const t=(s=e==null?void 0:e.input)==null?void 0:s.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function _n(e,n){var s;const t=(s=e==null?void 0:e.output)==null?void 0:s.call(e,{url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function ce(e){const n=e.resolvedLocation,t=e.location,s=(n==null?void 0:n.pathname)!==t.pathname,r=(n==null?void 0:n.href)!==t.href,o=(n==null?void 0:n.hash)!==t.hash;return{fromLocation:n,toLocation:t,pathChanged:s,hrefChanged:r,hashChanged:o}}class Bs{constructor(n){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=t=>t(),this.update=t=>{var l;t.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const s=this.options,r=this.basepath??(s==null?void 0:s.basepath)??"/",o=this.basepath===void 0,i=s==null?void 0:s.rewrite;if(this.options={...s,...t},this.isServer=this.options.isServer??typeof document>"u",this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=fs(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Kn()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let d;this.resolvePathCache=We(1e3),d=this.buildRouteTree(),this.setRoutes(d)}!this.__store&&this.latestLocation&&(this.__store=new zn(js(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(d=>!["redirected"].includes(d.status))}}}),Ps(this));let a=!1;const c=this.options.basepath??"/",h=this.options.rewrite;if(o||r!==c||i!==h){this.basepath=c;const d=[],m=mn(c);m&&m!=="/"&&d.push(Os({basepath:c})),h&&d.push(h),this.rewrite=d.length===0?void 0:d.length===1?d[0]:Fs(d),this.history&&this.updateLatestLocation(),a=!0}a&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof((l=window.CSS)==null?void 0:l.supports)=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=is(this.routeTree,this.options.caseSensitive,(s,r)=>{s.init({originalIndex:r})});return this.options.routeMasks&&ts(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,s)=>{const r={eventType:t,fn:s};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}},this.emit=t=>{this.subscribers.forEach(s=>{s.eventType===t.type&&s.fn(t)})},this.parseLocation=(t,s)=>{const r=({pathname:c,search:h,hash:f,href:u,state:l})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(c)){const v=this.options.parseSearch(h),L=this.options.stringifySearch(v);return{href:c+L+f,publicHref:u,pathname:Pe(c),external:!1,searchStr:L,search:$(s==null?void 0:s.search,v),hash:Pe(f.slice(1)),state:$(s==null?void 0:s.state,l)}}const d=new URL(u,this.origin),m=pt(this.rewrite,d),p=this.options.parseSearch(m.search),g=this.options.stringifySearch(p);return m.search=g,{href:m.href.replace(m.origin,""),publicHref:u,pathname:Pe(m.pathname),external:!!this.rewrite&&m.origin!==this.origin,searchStr:g,search:$(s==null?void 0:s.search,p),hash:Pe(m.hash.slice(1)),state:$(s==null?void 0:s.state,l)}},o=r(t),{__tempLocation:i,__tempKey:a}=o.state;if(i&&(!a||a===this.tempLocationKey)){const c=r(i);return c.state.key=o.state.key,c.state.__TSR_key=o.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:o}}return o},this.resolvePathWithBase=(t,s)=>hs({base:t,to:vt(s),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,s,r)=>typeof t=="string"?this.matchRoutesInternal({pathname:t,search:s},r):this.matchRoutesInternal(t,s),this.getMatchedRoutes=t=>Ds({pathname:t,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=t=>{const s=this.getMatch(t);s&&(s.abortController.abort(),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const t=this.state.matches.filter(o=>o.status==="pending"),s=this.state.matches.filter(o=>o.isFetching==="loader");new Set([...this.state.pendingMatches??[],...t,...s]).forEach(o=>{this.cancelMatch(o.id)})},this.buildLocation=t=>{const s=(o={})=>{var F,D;const i=o._fromLocation||this.pendingBuiltLocation||this.latestLocation,a=this.matchRoutesLightweight(i);o.from;const c=o.unsafeRelative==="path"?i.pathname:o.from??a.fullPath,h=this.resolvePathWithBase(c,"."),f=a.search,u={...a.params},l=o.to?this.resolvePathWithBase(h,`${o.to}`):this.resolvePathWithBase(h,"."),d=o.params===!1||o.params===null?{}:(o.params??!0)===!0?u:Object.assign(u,te(o.params,u)),m=rt({path:l,params:d,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath,p=this.getMatchedRoutes(m);let g=p.matchedRoutes;(p.foundRoute?p.foundRoute.path!=="/"&&p.routeParams["**"]:Z(m))&&this.options.notFoundRoute&&(g=[...g,this.options.notFoundRoute]);let v=!1;if(Object.keys(d).length>0)for(const I of g){const b=((F=I.options.params)==null?void 0:F.stringify)??I.options.stringifyParams;b&&(v=!0,Object.assign(d,b(d)))}const L=t.leaveParams?l:Pe(v?rt({path:l,params:d,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath:m);let P=f;if(t._includeValidateSearch&&((D=this.options.search)!=null&&D.strict)){const I={};g.forEach(b=>{if(b.options.validateSearch)try{Object.assign(I,De(b.options.validateSearch,{...I,...P}))}catch{}}),P=I}P=Ns({search:P,dest:o,destRoutes:g,_includeValidateSearch:t._includeValidateSearch}),P=$(f,P);const x=this.options.stringifySearch(P),E=o.hash===!0?i.hash:o.hash?te(o.hash,i.hash):void 0,R=E?`#${E}`:"";let k=o.state===!0?i.state:o.state?te(o.state,i.state):{};k=$(i.state,k);const C=`${L}${x}${R}`;let y,_,T=!1;if(this.rewrite){const I=new URL(C,this.origin),b=_n(this.rewrite,I);y=I.href.replace(I.origin,""),b.origin!==this.origin?(_=b.href,T=!0):_=b.pathname+b.search+b.hash}else y=Zn(C),_=y;return{publicHref:_,href:y,pathname:L,search:P,searchStr:x,state:k,hash:E??"",external:T,unmaskOnReload:o.unmaskOnReload}},r=(o={},i)=>{const a=s(o);let c=i?s(i):void 0;if(!c){const h={};if(this.options.routeMasks){const f=ns(a.pathname,this.processedTree);if(f){Object.assign(h,f.rawParams);const{from:u,params:l,...d}=f.route,m=l===!1||l===null?{}:(l??!0)===!0?h:Object.assign(h,te(l,h));i={from:t.from,...d,params:m},c=s(i)}}}return c&&(a.maskedLocation=c),a};return t.mask?r(t,{from:t.from,...t.mask}):r(t)},this.commitLocation=async({viewTransition:t,ignoreBlocker:s,...r})=>{const o=()=>{const c=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];c.forEach(f=>{r.state[f]=this.latestLocation.state[f]});const h=ae(r.state,this.latestLocation.state);return c.forEach(f=>{delete r.state[f]}),h},i=Z(this.latestLocation.href)===Z(r.href),a=this.commitLocationPromise;if(this.commitLocationPromise=pe(()=>{a==null||a.resolve()}),i&&o())this.load();else{let{maskedLocation:c,hashScrollIntoView:h,...f}=r;c&&(f={...c,state:{...c.state,__tempKey:void 0,__tempLocation:{...f,search:f.searchStr,state:{...f.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(f.unmaskOnReload??this.options.unmaskOnReload??!1)&&(f.state.__tempKey=this.tempLocationKey)),f.state.__hashScrollIntoViewOptions=h??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[r.replace?"replace":"push"](f.publicHref,f.state,{ignoreBlocker:s})}return this.resetNextScroll=r.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:t,resetScroll:s,hashScrollIntoView:r,viewTransition:o,ignoreBlocker:i,href:a,...c}={})=>{if(a){const u=this.history.location.state.__TSR_index,l=Ue(a,{__TSR_index:t?u:u+1}),d=new URL(l.pathname,this.origin),m=pt(this.rewrite,d);c.to=m.pathname,c.search=this.options.parseSearch(l.search),c.hash=l.hash.slice(1)}const h=this.buildLocation({...c,_includeValidateSearch:!0});this.pendingBuiltLocation=h;const f=this.commitLocation({...h,viewTransition:o,replace:t,resetScroll:s,hashScrollIntoView:r,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===h&&(this.pendingBuiltLocation=void 0)}),f},this.navigate=async({to:t,reloadDocument:s,href:r,publicHref:o,...i})=>{var c;let a=!1;if(r)try{new URL(`${r}`),a=!0}catch{}if(a&&!s&&(s=!0),s){if(t!==void 0||!r){const f=this.buildLocation({to:t,...i});r=r??f.publicHref,o=o??f.publicHref}const h=!a&&o?o:r;if(Ve(h))return Promise.resolve();if(!i.ignoreBlocker){const f=this.history,u=((c=f.getBlockers)==null?void 0:c.call(f))??[];for(const l of u)if(l!=null&&l.blockerFn&&await l.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return i.replace?window.location.replace(h):window.location.href=h,Promise.resolve()}return this.buildAndCommitLocation({...i,href:r,to:t,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const t=this.matchRoutes(this.latestLocation);this.__store.setState(s=>({...s,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:t,cachedMatches:s.cachedMatches.filter(r=>!t.some(o=>o.id===r.id))}))},this.load=async t=>{let s,r,o;for(o=new Promise(a=>{this.startTransition(async()=>{var c;try{this.beforeLoad();const h=this.latestLocation,f=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...ce({resolvedLocation:f,location:h})}),this.emit({type:"onBeforeLoad",...ce({resolvedLocation:f,location:h})}),await Jt({router:this,sync:t==null?void 0:t.sync,matches:this.state.pendingMatches,location:h,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let u=[],l=[],d=[];be(()=>{this.__store.setState(m=>{const p=m.matches,g=m.pendingMatches||m.matches;return u=p.filter(S=>!g.some(v=>v.id===S.id)),l=g.filter(S=>!p.some(v=>v.id===S.id)),d=g.filter(S=>p.some(v=>v.id===S.id)),{...m,isLoading:!1,loadedAt:Date.now(),matches:g,pendingMatches:void 0,cachedMatches:[...m.cachedMatches,...u.filter(S=>S.status!=="error"&&S.status!=="notFound")]}}),this.clearExpiredCache()}),[[u,"onLeave"],[l,"onEnter"],[d,"onStay"]].forEach(([m,p])=>{m.forEach(g=>{var S,v;(v=(S=this.looseRoutesById[g.routeId].options)[p])==null||v.call(S,g)})})})})}})}catch(h){G(h)?(s=h,this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):W(h)&&(r=h),this.__store.setState(f=>({...f,statusCode:s?s.status:r?404:f.matches.some(u=>u.status==="error")?500:200,redirect:s}))}this.latestLoadPromise===o&&((c=this.commitLocationPromise)==null||c.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),a()})}),this.latestLoadPromise=o,await o;this.latestLoadPromise&&o!==this.latestLoadPromise;)await this.latestLoadPromise;let i;this.hasNotFoundMatch()?i=404:this.__store.state.matches.some(a=>a.status==="error")&&(i=500),i!==void 0&&this.__store.setState(a=>({...a,statusCode:i}))},this.startViewTransition=t=>{const s=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let r;if(typeof s=="object"&&this.isViewTransitionTypesSupported){const o=this.latestLocation,i=this.state.resolvedLocation,a=typeof s.types=="function"?s.types(ce({resolvedLocation:i,location:o})):s.types;if(a===!1){t();return}r={update:t,types:a}}else r=t;document.startViewTransition(r)}else t()},this.updateMatch=(t,s)=>{this.startTransition(()=>{var o;const r=(o=this.state.pendingMatches)!=null&&o.some(i=>i.id===t)?"pendingMatches":this.state.matches.some(i=>i.id===t)?"matches":this.state.cachedMatches.some(i=>i.id===t)?"cachedMatches":"";r&&this.__store.setState(i=>{var a;return{...i,[r]:(a=i[r])==null?void 0:a.map(c=>c.id===t?s(c):c)}})})},this.getMatch=t=>{var r;const s=o=>o.id===t;return this.state.cachedMatches.find(s)??((r=this.state.pendingMatches)==null?void 0:r.find(s))??this.state.matches.find(s)},this.invalidate=t=>{const s=r=>{var o;return((o=t==null?void 0:t.filter)==null?void 0:o.call(t,r))??!0?{...r,invalid:!0,...t!=null&&t.forcePending||r.status==="error"||r.status==="notFound"?{status:"pending",error:void 0}:void 0}:r};return this.__store.setState(r=>{var o;return{...r,matches:r.matches.map(s),cachedMatches:r.cachedMatches.map(s),pendingMatches:(o=r.pendingMatches)==null?void 0:o.map(s)}}),this.shouldViewTransition=!1,this.load({sync:t==null?void 0:t.sync})},this.getParsedLocationHref=t=>t.publicHref||"/",this.resolveRedirect=t=>{const s=t.headers.get("Location");if(!t.options.href||t.options._builtLocation){const r=t.options._builtLocation??this.buildLocation(t.options),o=this.getParsedLocationHref(r);t.options.href=o,t.headers.set("Location",o)}else if(s)try{const r=new URL(s);if(this.origin&&r.origin===this.origin){const o=r.pathname+r.search+r.hash;t.options.href=o,t.headers.set("Location",o)}}catch{}return t.headers.get("Location")||t.headers.set("Location",t.options.href),t},this.clearCache=t=>{const s=t==null?void 0:t.filter;s!==void 0?this.__store.setState(r=>({...r,cachedMatches:r.cachedMatches.filter(o=>!s(o))})):this.__store.setState(r=>({...r,cachedMatches:[]}))},this.clearExpiredCache=()=>{const t=s=>{const r=this.looseRoutesById[s.routeId];if(!r.options.loader)return!0;const o=(s.preload?r.options.preloadGcTime??this.options.defaultPreloadGcTime:r.options.gcTime??this.options.defaultGcTime)??5*60*1e3;return s.status==="error"?!0:Date.now()-s.updatedAt>=o};this.clearCache({filter:t})},this.loadRouteChunk=Pn,this.preloadRoute=async t=>{const s=this.buildLocation(t);let r=this.matchRoutes(s,{throwOnError:!0,preload:!0,dest:t});const o=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(a=>a.id)),i=new Set([...o,...this.state.cachedMatches.map(a=>a.id)]);be(()=>{r.forEach(a=>{i.has(a.id)||this.__store.setState(c=>({...c,cachedMatches:[...c.cachedMatches,a]}))})});try{return r=await Jt({router:this,matches:r,location:s,preload:!0,updateMatch:(a,c)=>{o.has(a)?r=r.map(h=>h.id===a?c(h):h):this.updateMatch(a,c)}}),r}catch(a){if(G(a))return a.options.reloadDocument?void 0:await this.preloadRoute({...a.options,_fromLocation:s});W(a)||console.error(a);return}},this.matchRoute=(t,s)=>{const r={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},o=this.buildLocation(r);if(s!=null&&s.pending&&this.state.status!=="pending")return!1;const a=((s==null?void 0:s.pending)===void 0?!this.state.isLoading:s.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,c=ss(o.pathname,(s==null?void 0:s.caseSensitive)??!1,(s==null?void 0:s.fuzzy)??!1,a.pathname,this.processedTree);return!c||t.params&&!ae(c.rawParams,t.params,{partial:!0})?!1:(s==null?void 0:s.includeSearch)??!0?ae(a.search,o.search,{partial:!0})?c.rawParams:!1:c.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(t=>t.status==="notFound"||t.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...n,caseSensitive:n.caseSensitive??!1,notFoundMode:n.notFoundMode??"fuzzy",stringifySearch:n.stringifySearch??ws,parseSearch:n.parseSearch??xs}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:n,routesByPath:t,processedTree:s}){this.routesById=n,this.routesByPath=t,this.processedTree=s;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}matchRoutesInternal(n,t){const s=this.getMatchedRoutes(n.pathname),{foundRoute:r,routeParams:o,parsedParams:i}=s;let{matchedRoutes:a}=s,c=!1;(r?r.path!=="/"&&o["**"]:Z(n.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:c=!0);const h=c?$s(this.options.notFoundMode,a):void 0,f=[],u=l=>(l==null?void 0:l.id)?l.context??this.options.context??void 0:this.options.context??void 0;return a.forEach((l,d)=>{var D,I;const m=f[d-1],[p,g,S]=(()=>{const b=(m==null?void 0:m.search)??n.search,O=(m==null?void 0:m._strictSearch)??void 0;try{const A=De(l.options.validateSearch,{...b})??void 0;return[{...b,...A},{...O,...A},void 0]}catch(A){let N=A;if(A instanceof Ke||(N=new Ke(A.message,{cause:A})),t!=null&&t.throwOnError)throw N;return[b,{},N]}})(),v=((I=(D=l.options).loaderDeps)==null?void 0:I.call(D,{search:p}))??"",L=v?JSON.stringify(v):"",{interpolatedPath:P,usedParams:x}=rt({path:l.fullPath,params:o,decoder:this.pathParamsDecoder,server:this.isServer}),E=l.id+P+L,R=this.getMatch(E),k=this.state.matches.find(b=>b.routeId===l.id),C=(R==null?void 0:R._strictParams)??x;let y;if(!R)try{Yt(l,x,i,C)}catch(b){if(W(b)||G(b)?y=b:y=new As(b.message,{cause:b}),t!=null&&t.throwOnError)throw y}Object.assign(o,C);const _=k?"stay":"enter";let T;if(R)T={...R,cause:_,params:k?$(k.params,o):o,_strictParams:C,search:$(k?k.search:R.search,p),_strictSearch:g};else{const b=l.options.loader||l.options.beforeLoad||l.lazyFn||vn(l)?"pending":"success";T={id:E,ssr:l.options.ssr,index:d,routeId:l.id,params:k?$(k.params,o):o,_strictParams:C,pathname:P,updatedAt:Date.now(),search:k?$(k.search,p):p,_strictSearch:g,searchError:void 0,status:b,isFetching:!1,error:void 0,paramsError:y,__routeContext:void 0,_nonReactive:{loadPromise:pe()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:_,loaderDeps:k?$(k.loaderDeps,v):v,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:l.options.staticData||{},fullPath:l.fullPath}}t!=null&&t.preload||(T.globalNotFound=h===l.id),T.searchError=S;const F=u(m);T.context={...F,...T.__routeContext,...T.__beforeLoadContext},f.push(T)}),f.forEach((l,d)=>{const m=this.looseRoutesById[l.routeId];if(!this.getMatch(l.id)){const g=f[d-1],S=u(g);if(m.options.context){const v={deps:l.loaderDeps,params:l.params,context:S??{},location:n,navigate:L=>this.navigate({...L,_fromLocation:n}),buildLocation:this.buildLocation,cause:l.cause,abortController:l.abortController,preload:!!l.preload,matches:f};l.__routeContext=m.options.context(v)??void 0}l.context={...S,...l.__routeContext,...l.__beforeLoadContext}}}),f}matchRoutesLightweight(n){const{matchedRoutes:t,routeParams:s,parsedParams:r}=this.getMatchedRoutes(n.pathname),o=ke(t),i={...n.search};for(const f of t)try{Object.assign(i,De(f.options.validateSearch,i))}catch{}const a=ke(this.state.matches),c=a&&a.routeId===o.id&&n.pathname===this.state.location.pathname;let h;if(c)h=a.params;else{const f={...s};for(const u of t)try{Yt(u,s,r??{},f)}catch{}h=f}return{matchedRoutes:t,fullPath:o.fullPath,search:i,params:h}}}class Ke extends Error{}class As extends Error{}function js(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function De(e,n){if(e==null)return{};if("~standard"in e){const t=e["~standard"].validate(n);if(t instanceof Promise)throw new Ke("Async validation not supported");if(t.issues)throw new Ke(JSON.stringify(t.issues,void 0,2),{cause:t});return t.value}return"parse"in e?e.parse(n):typeof e=="function"?e(n):{}}function Ds({pathname:e,routesById:n,processedTree:t}){const s={},r=Z(e);let o,i;const a=rs(r,t,!0);return a&&(o=a.route,Object.assign(s,a.rawParams),i=Object.assign({},a.parsedParams)),{matchedRoutes:(a==null?void 0:a.branch)||[n[K]],routeParams:s,foundRoute:o,parsedParams:i}}function Ns({search:e,dest:n,destRoutes:t,_includeValidateSearch:s}){return Us(t)(e,n,s??!1)}function Us(e){var r;const n={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const o of e){if("search"in o.options)(r=o.options.search)!=null&&r.middlewares&&n.middlewares.push(...o.options.search.middlewares);else if(o.options.preSearchFilters||o.options.postSearchFilters){const i=({search:a,next:c})=>{let h=a;"preSearchFilters"in o.options&&o.options.preSearchFilters&&(h=o.options.preSearchFilters.reduce((u,l)=>l(u),a));const f=c(h);return"postSearchFilters"in o.options&&o.options.postSearchFilters?o.options.postSearchFilters.reduce((u,l)=>l(u),f):f};n.middlewares.push(i)}if(o.options.validateSearch){const i=({search:a,next:c})=>{const h=c(a);if(!n._includeValidateSearch)return h;try{return{...h,...De(o.options.validateSearch,h)??void 0}}catch{return h}};n.middlewares.push(i)}}const t=({search:o})=>{const i=n.dest;return i.search?i.search===!0?o:te(i.search,o):{}};n.middlewares.push(t);const s=(o,i,a)=>{if(o>=a.length)return i;const c=a[o];return c({search:i,next:f=>s(o+1,f,a)})};return function(i,a,c){return n.dest=a,n._includeValidateSearch=c,s(0,i,n.middlewares)}}function $s(e,n){if(e!=="root")for(let t=n.length-1;t>=0;t--){const s=n[t];if(s.children)return s.id}return K}function Yt(e,n,t,s){var o;const r=((o=e.options.params)==null?void 0:o.parse)??e.options.parseParams;if(r)if(e.options.skipRouteOnParseError)for(const i in n)i in t&&(s[i]=t[i]);else{const i=r(s);Object.assign(s,i)}}const Vs="Error preloading route! ☝️";class xn{constructor(n){if(this.init=t=>{var h,f;this.originalIndex=t.originalIndex;const s=this.options,r=!(s!=null&&s.path)&&!(s!=null&&s.id);this.parentRoute=(f=(h=this.options).getParentRoute)==null?void 0:f.call(h),r?this._path=K:this.parentRoute||Q(!1);let o=r?K:s==null?void 0:s.path;o&&o!=="/"&&(o=dn(o));const i=(s==null?void 0:s.id)||o;let a=r?K:Ae([this.parentRoute.id===K?"":this.parentRoute.id,i]);o===K&&(o="/"),a!==K&&(a=Ae(["/",a]));const c=a===K?"/":Ae([this.parentRoute.fullPath,o]);this._path=o,this._id=a,this._fullPath=c,this._to=Z(c)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>Cs({from:this.fullPath,...t}),this.options=n||{},this.isRoot=!(n!=null&&n.getParentRoute),n!=null&&n.id&&(n!=null&&n.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class Ws extends xn{constructor(n){super(n)}}const Be=typeof window<"u"?M.useLayoutEffect:M.useEffect;function it(e){const n=M.useRef({value:e,prev:null}),t=n.current.value;return e!==t&&(n.current={value:e,prev:t}),n.current.prev}function zs(e,n,t={},s={}){M.useEffect(()=>{if(!e.current||s.disabled||typeof IntersectionObserver!="function")return;const r=new IntersectionObserver(([o])=>{n(o)},t);return r.observe(e.current),()=>{r.disconnect()}},[n,t,s.disabled,e])}function Hs(e){const n=M.useRef(null);return M.useImperativeHandle(e,()=>n.current,[]),n}function Rt(e){const n=e.errorComponent??_t;return w.jsx(Ks,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:t,reset:s})=>t?M.createElement(n,{error:t,reset:s}):e.children})}class Ks extends M.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(n){return{resetKey:n.getResetKey()}}static getDerivedStateFromError(n){return{error:n}}reset(){this.setState({error:null})}componentDidUpdate(n,t){t.error&&t.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(n,t){this.props.onCatch&&this.props.onCatch(n,t)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function _t({error:e}){const[n,t]=M.useState(!1);return w.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[w.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[w.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),w.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>t(s=>!s),children:n?"Hide Error":"Show Error"})]}),w.jsx("div",{style:{height:".25rem"}}),n?w.jsx("div",{children:w.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?w.jsx("code",{children:e.message}):null})}):null]})}function Gs({children:e,fallback:n=null}){return wn()?w.jsx(Ce.Fragment,{children:e}):w.jsx(Ce.Fragment,{children:n})}function wn(){return Ce.useSyncExternalStore(qs,()=>!0,()=>!1)}function qs(){return()=>{}}var at={exports:{}},ct={},lt={exports:{}},ut={};/**
10
- * @license React
11
- * use-sync-external-store-shim.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Xt;function Js(){if(Xt)return ut;Xt=1;var e=gt();function n(u,l){return u===l&&(u!==0||1/u===1/l)||u!==u&&l!==l}var t=typeof Object.is=="function"?Object.is:n,s=e.useState,r=e.useEffect,o=e.useLayoutEffect,i=e.useDebugValue;function a(u,l){var d=l(),m=s({inst:{value:d,getSnapshot:l}}),p=m[0].inst,g=m[1];return o(function(){p.value=d,p.getSnapshot=l,c(p)&&g({inst:p})},[u,d,l]),r(function(){return c(p)&&g({inst:p}),u(function(){c(p)&&g({inst:p})})},[u]),i(d),d}function c(u){var l=u.getSnapshot;u=u.value;try{var d=l();return!t(u,d)}catch{return!0}}function h(u,l){return l()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:a;return ut.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,ut}var Zt;function Ys(){return Zt||(Zt=1,lt.exports=Js()),lt.exports}/**
18
- * @license React
19
- * use-sync-external-store-shim/with-selector.production.js
20
- *
21
- * Copyright (c) Meta Platforms, Inc. and affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var Qt;function Xs(){if(Qt)return ct;Qt=1;var e=gt(),n=Ys();function t(h,f){return h===f&&(h!==0||1/h===1/f)||h!==h&&f!==f}var s=typeof Object.is=="function"?Object.is:t,r=n.useSyncExternalStore,o=e.useRef,i=e.useEffect,a=e.useMemo,c=e.useDebugValue;return ct.useSyncExternalStoreWithSelector=function(h,f,u,l,d){var m=o(null);if(m.current===null){var p={hasValue:!1,value:null};m.current=p}else p=m.current;m=a(function(){function S(E){if(!v){if(v=!0,L=E,E=l(E),d!==void 0&&p.hasValue){var R=p.value;if(d(R,E))return P=R}return P=E}if(R=P,s(L,E))return R;var k=l(E);return d!==void 0&&d(R,k)?(L=E,R):(L=E,P=k)}var v=!1,L,P,x=u===void 0?null:u;return[function(){return S(f())},x===null?void 0:function(){return S(x())}]},[f,u,l,d]);var g=r(h,m[0],m[1]);return i(function(){p.hasValue=!0,p.value=g},[g]),c(g),g},ct}var en;function Zs(){return en||(en=1,at.exports=Xs()),at.exports}var Qs=Zs();function er(e,n=s=>s,t={}){const s=t.equal??tr;return Qs.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,n,s)}function tr(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[s,r]of e)if(!n.has(s)||!Object.is(r,n.get(s)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const s of e)if(!n.has(s))return!1;return!0}if(e instanceof Date&&n instanceof Date)return e.getTime()===n.getTime();const t=tn(e);if(t.length!==tn(n).length)return!1;for(let s=0;s<t.length;s++)if(!Object.prototype.hasOwnProperty.call(n,t[s])||!Object.is(e[t[s]],n[t[s]]))return!1;return!0}function tn(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const ht=M.createContext(null);function Ln(){return typeof document>"u"?ht:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=ht,ht)}function H(e){const n=M.useContext(Ln());return e==null||e.warn,n}function z(e){const n=H({warn:(e==null?void 0:e.router)===void 0}),t=(e==null?void 0:e.router)||n,s=M.useRef(void 0);return er(t.__store,r=>{if(e!=null&&e.select){if(e.structuralSharing??t.options.defaultStructuralSharing){const o=$(s.current,e.select(r));return s.current=o,o}return e.select(r)}return r})}const Je=M.createContext(void 0),nr=M.createContext(void 0);function Y(e){const n=M.useContext(e.from?nr:Je);return z({select:s=>{const r=s.matches.find(o=>e.from?e.from===o.routeId:o.id===n);if(Q(!((e.shouldThrow??!0)&&!r),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),r!==void 0)return e.select?e.select(r):r},structuralSharing:e.structuralSharing})}function xt(e){return Y({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.loaderData):n.loaderData})}function wt(e){const{select:n,...t}=e;return Y({...t,select:s=>n?n(s.loaderDeps):s.loaderDeps})}function Lt(e){return Y({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:n=>{const t=e.strict===!1?n.params:n._strictParams;return e.select?e.select(t):t}})}function bt(e){return Y({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.search):n.search})}function Ct(e){const n=H();return M.useCallback(t=>n.navigate({...t,from:t.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,n])}var sr=An();function rr(e,n){const t=H(),s=Hs(n),{activeProps:r,inactiveProps:o,activeOptions:i,to:a,preload:c,preloadDelay:h,hashScrollIntoView:f,replace:u,startTransition:l,resetScroll:d,viewTransition:m,children:p,target:g,disabled:S,style:v,className:L,onClick:P,onFocus:x,onMouseEnter:E,onMouseLeave:R,onTouchStart:k,ignoreBlocker:C,params:y,search:_,hash:T,state:F,mask:D,reloadDocument:I,unsafeRelative:b,from:O,_fromLocation:A,...N}=e,V=wn(),j=z({select:B=>B.location.search,structuralSharing:!0}),kt=e.from,ye=M.useMemo(()=>({...e,from:kt}),[t,j,kt,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),J=M.useMemo(()=>t.buildLocation({...ye}),[t,ye]),Mt=J.maskedLocation?J.maskedLocation.publicHref:J.publicHref,Et=J.maskedLocation?J.maskedLocation.external:J.external,X=M.useMemo(()=>ur(Mt,Et,t.history,S),[S,Et,Mt,t.history]),Ee=M.useMemo(()=>{if(X!=null&&X.external)return Ve(X.href)?void 0:X.href;if(!hr(a)&&!(typeof a!="string"||a.indexOf(":")===-1))try{return new URL(a),Ve(a)?void 0:a}catch{}},[a,X]),Ye=z({select:B=>{if(Ee)return!1;if(i!=null&&i.exact){if(!us(B.location.pathname,J.pathname,t.basepath))return!1}else{const U=ze(B.location.pathname,t.basepath),q=ze(J.pathname,t.basepath);if(!(U.startsWith(q)&&(U.length===q.length||U[q.length]==="/")))return!1}return((i==null?void 0:i.includeSearch)??!0)&&!ae(B.location.search,J.search,{partial:!(i!=null&&i.exact),ignoreUndefined:!(i!=null&&i.explicitUndefined)})?!1:i!=null&&i.includeHash?V&&B.location.hash===J.hash:!0}}),Te=Ye?te(r,{})??or:ft,Ie=Ye?ft:te(o,{})??ft,Tt=[L,Te.className,Ie.className].filter(Boolean).join(" "),It=(v||Te.style||Ie.style)&&{...v,...Te.style,...Ie.style},[Mn,Ft]=M.useState(!1),Ot=M.useRef(!1),he=e.reloadDocument||Ee?!1:c??t.options.defaultPreload,Xe=h??t.options.defaultPreloadDelay??0,re=M.useCallback(()=>{t.preloadRoute({...ye}).catch(B=>{console.warn(B),console.warn(Vs)})},[t,ye]),En=M.useCallback(B=>{B!=null&&B.isIntersecting&&re()},[re]);zs(s,En,lr,{disabled:!!S||he!=="viewport"}),M.useEffect(()=>{Ot.current||!S&&he==="render"&&(re(),Ot.current=!0)},[S,re,he]);const Tn=B=>{const U=B.currentTarget.getAttribute("target"),q=g!==void 0?g:U;if(!S&&!fr(B)&&!B.defaultPrevented&&(!q||q==="_self")&&B.button===0){B.preventDefault(),sr.flushSync(()=>{Ft(!0)});const At=t.subscribe("onResolved",()=>{At(),Ft(!1)});t.navigate({...ye,replace:u,resetScroll:d,hashScrollIntoView:f,startTransition:l,viewTransition:m,ignoreBlocker:C})}};if(Ee)return{...N,ref:s,href:Ee,...p&&{children:p},...g&&{target:g},...S&&{disabled:S},...v&&{style:v},...L&&{className:L},...P&&{onClick:P},...x&&{onFocus:x},...E&&{onMouseEnter:E},...R&&{onMouseLeave:R},...k&&{onTouchStart:k}};const Bt=B=>{S||he&&re()},In=Bt,Fn=B=>{if(!(S||!he))if(!Xe)re();else{const U=B.target;if(_e.has(U))return;const q=setTimeout(()=>{_e.delete(U),re()},Xe);_e.set(U,q)}},On=B=>{if(S||!he||!Xe)return;const U=B.target,q=_e.get(U);q&&(clearTimeout(q),_e.delete(U))};return{...N,...Te,...Ie,href:X==null?void 0:X.href,ref:s,onClick:xe([P,Tn]),onFocus:xe([x,Bt]),onMouseEnter:xe([E,Fn]),onMouseLeave:xe([R,On]),onTouchStart:xe([k,In]),disabled:!!S,target:g,...It&&{style:It},...Tt&&{className:Tt},...S&&ir,...Ye&&ar,...V&&Mn&&cr}}const ft={},or={className:"active"},ir={role:"link","aria-disabled":!0},ar={"data-status":"active","aria-current":"page"},cr={"data-transitioning":"transitioning"},_e=new WeakMap,lr={rootMargin:"100px"},xe=e=>n=>{for(const t of e)if(t){if(n.defaultPrevented)return;t(n)}};function ur(e,n,t,s){if(!s)return n?{href:e,external:!0}:{href:t.createHref(e)||"/",external:!1}}function hr(e){if(typeof e!="string")return!1;const n=e.charCodeAt(0);return n===47?e.charCodeAt(1)!==47:n===46}const bn=M.forwardRef((e,n)=>{const{_asChild:t,...s}=e,{type:r,...o}=rr(s,n),i=typeof s.children=="function"?s.children({isActive:o["data-status"]==="active"}):s.children;if(!t){const{disabled:a,...c}=o;return M.createElement("a",c,i)}return M.createElement(t,o,i)});function fr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class dr extends xn{constructor(n){super(n),this.useMatch=t=>Y({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>Y({...t,from:this.id,select:s=>t!=null&&t.select?t.select(s.context):s.context}),this.useSearch=t=>bt({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Lt({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>wt({...t,from:this.id}),this.useLoaderData=t=>xt({...t,from:this.id}),this.useNavigate=()=>Ct({from:this.fullPath}),this.Link=Ce.forwardRef((t,s)=>w.jsx(bn,{ref:s,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}}function mr(e){return new dr(e)}function kr(){return e=>gr(e)}class pr extends Ws{constructor(n){super(n),this.useMatch=t=>Y({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>Y({...t,from:this.id,select:s=>t!=null&&t.select?t.select(s.context):s.context}),this.useSearch=t=>bt({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Lt({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>wt({...t,from:this.id}),this.useLoaderData=t=>xt({...t,from:this.id}),this.useNavigate=()=>Ct({from:this.fullPath}),this.Link=Ce.forwardRef((t,s)=>w.jsx(bn,{ref:s,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}}function gr(e){return new pr(e)}function nn(e){return typeof e=="object"?new sn(e,{silent:!0}).createRoute(e):new sn(e,{silent:!0}).createRoute}class sn{constructor(n,t){this.path=n,this.createRoute=s=>{this.silent;const r=mr(s);return r.isRoot=!1,r},this.silent=t==null?void 0:t.silent}}class rn{constructor(n){this.useMatch=t=>Y({select:t==null?void 0:t.select,from:this.options.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>Y({from:this.options.id,select:s=>t!=null&&t.select?t.select(s.context):s.context}),this.useSearch=t=>bt({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.options.id}),this.useParams=t=>Lt({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>wt({...t,from:this.options.id}),this.useLoaderData=t=>xt({...t,from:this.options.id}),this.useNavigate=()=>{const t=H();return Ct({from:t.routesById[this.options.id].fullPath})},this.options=n,this.$$typeof=Symbol.for("react.memo")}}function on(e){return typeof e=="object"?new rn(e):n=>new rn({id:e,...n})}function yr(){const e=H(),n=M.useRef({router:e,mounted:!1}),[t,s]=M.useState(!1),{hasPendingMatches:r,isLoading:o}=z({select:u=>({isLoading:u.isLoading,hasPendingMatches:u.matches.some(l=>l.status==="pending")}),structuralSharing:!0}),i=it(o),a=o||t||r,c=it(a),h=o||r,f=it(h);return e.startTransition=u=>{s(!0),M.startTransition(()=>{u(),s(!1)})},M.useEffect(()=>{const u=e.history.subscribe(e.load),l=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Z(e.latestLocation.publicHref)!==Z(l.publicHref)&&e.commitLocation({...l,replace:!0}),()=>{u()}},[e,e.history]),Be(()=>{if(typeof window<"u"&&e.ssr||n.current.router===e&&n.current.mounted)return;n.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(l){console.error(l)}})()},[e]),Be(()=>{i&&!o&&e.emit({type:"onLoad",...ce(e.state)})},[i,e,o]),Be(()=>{f&&!h&&e.emit({type:"onBeforeRouteMount",...ce(e.state)})},[h,f,e]),Be(()=>{if(c&&!a){const u=ce(e.state);e.emit({type:"onResolved",...u}),e.__store.setState(l=>({...l,status:"idle",resolvedLocation:l.location})),u.hrefChanged&&vs(e)}},[a,c,e]),null}function Sr(e){const n=z({select:t=>`not-found-${t.location.pathname}-${t.status}`});return w.jsx(Rt,{getResetKey:()=>n,onCatch:(t,s)=>{var r;if(W(t))(r=e.onCatch)==null||r.call(e,t,s);else throw t},errorComponent:({error:t})=>{var s;if(W(t))return(s=e.fallback)==null?void 0:s.call(e,t);throw t},children:e.children})}function Pr(){return w.jsx("p",{children:"Not Found"})}function fe(e){return w.jsx(w.Fragment,{children:e.children})}function Cn(e,n,t){return n.options.notFoundComponent?w.jsx(n.options.notFoundComponent,{...t}):e.options.defaultNotFoundComponent?w.jsx(e.options.defaultNotFoundComponent,{...t}):w.jsx(Pr,{})}function vr(){return H().isScrollRestoring,null}const kn=M.memo(function({matchId:n}){var p,g;const t=H(),s=z({select:S=>{var P;const v=S.matches.findIndex(x=>x.id===n),L=S.matches[v];return Q(L),{routeId:L.routeId,ssr:L.ssr,_displayPending:L._displayPending,resetKey:S.loadedAt,parentRouteId:(P=S.matches[v-1])==null?void 0:P.routeId}},structuralSharing:!0}),r=t.routesById[s.routeId],o=r.options.pendingComponent??t.options.defaultPendingComponent,i=o?w.jsx(o,{}):null,a=r.options.errorComponent??t.options.defaultErrorComponent,c=r.options.onCatch??t.options.defaultOnCatch,h=r.isRoot?r.options.notFoundComponent??((p=t.options.notFoundRoute)==null?void 0:p.options.component):r.options.notFoundComponent,f=s.ssr===!1||s.ssr==="data-only",u=(!r.isRoot||r.options.wrapInSuspense||f)&&(r.options.wrapInSuspense??o??(((g=r.options.errorComponent)==null?void 0:g.preload)||f))?M.Suspense:fe,l=a?Rt:fe,d=h?Sr:fe,m=r.isRoot?r.options.shellComponent??fe:fe;return w.jsxs(m,{children:[w.jsx(Je.Provider,{value:n,children:w.jsx(u,{fallback:i,children:w.jsx(l,{getResetKey:()=>s.resetKey,errorComponent:a||_t,onCatch:(S,v)=>{if(W(S))throw S;c==null||c(S,v)},children:w.jsx(d,{fallback:S=>{if(!h||S.routeId&&S.routeId!==s.routeId||!S.routeId&&!r.isRoot)throw S;return M.createElement(h,S)},children:f||s._displayPending?w.jsx(Gs,{fallback:i,children:w.jsx(an,{matchId:n})}):w.jsx(an,{matchId:n})})})})}),s.parentRouteId===K&&t.options.scrollRestoration?w.jsxs(w.Fragment,{children:[w.jsx(Rr,{}),w.jsx(vr,{})]}):null]})});function Rr(){const e=H(),n=M.useRef(void 0);return w.jsx("script",{suppressHydrationWarning:!0,ref:t=>{t&&(n.current===void 0||n.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...ce(e.state)}),n.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const an=M.memo(function({matchId:n}){var c,h,f,u;const t=H(),{match:s,key:r,routeId:o}=z({select:l=>{const d=l.matches.find(v=>v.id===n),m=d.routeId,p=t.routesById[m].options.remountDeps??t.options.defaultRemountDeps,g=p==null?void 0:p({routeId:m,loaderDeps:d.loaderDeps,params:d._strictParams,search:d._strictSearch});return{key:g?JSON.stringify(g):void 0,routeId:m,match:{id:d.id,status:d.status,error:d.error,invalid:d.invalid,_forcePending:d._forcePending,_displayPending:d._displayPending}}},structuralSharing:!0}),i=t.routesById[o],a=M.useMemo(()=>{const l=i.options.component??t.options.defaultComponent;return l?w.jsx(l,{},r):w.jsx(_r,{})},[r,i.options.component,t.options.defaultComponent]);if(s._displayPending)throw(c=t.getMatch(s.id))==null?void 0:c._nonReactive.displayPendingPromise;if(s._forcePending)throw(h=t.getMatch(s.id))==null?void 0:h._nonReactive.minPendingPromise;if(s.status==="pending"){const l=i.options.pendingMinMs??t.options.defaultPendingMinMs;if(l){const d=t.getMatch(s.id);if(d&&!d._nonReactive.minPendingPromise){const m=pe();d._nonReactive.minPendingPromise=m,setTimeout(()=>{m.resolve(),d._nonReactive.minPendingPromise=void 0},l)}}throw(f=t.getMatch(s.id))==null?void 0:f._nonReactive.loadPromise}if(s.status==="notFound")return Q(W(s.error)),Cn(t,i,s.error);if(s.status==="redirected")throw Q(G(s.error)),(u=t.getMatch(s.id))==null?void 0:u._nonReactive.loadPromise;if(s.status==="error")throw s.error;return a}),_r=M.memo(function(){const n=H(),t=M.useContext(Je),s=z({select:h=>{var f;return(f=h.matches.find(u=>u.id===t))==null?void 0:f.routeId}}),r=n.routesById[s],o=z({select:h=>{const u=h.matches.find(l=>l.id===t);return Q(u),u.globalNotFound}}),i=z({select:h=>{var l;const f=h.matches,u=f.findIndex(d=>d.id===t);return(l=f[u+1])==null?void 0:l.id}}),a=n.options.defaultPendingComponent?w.jsx(n.options.defaultPendingComponent,{}):null;if(o)return Cn(n,r,void 0);if(!i)return null;const c=w.jsx(kn,{matchId:i});return s===K?w.jsx(M.Suspense,{fallback:a,children:c}):c});function xr(){const e=H(),t=e.routesById[K].options.pendingComponent??e.options.defaultPendingComponent,s=t?w.jsx(t,{}):null,r=typeof document<"u"&&e.ssr?fe:M.Suspense,o=w.jsxs(r,{fallback:s,children:[w.jsx(yr,{}),w.jsx(wr,{})]});return e.options.InnerWrap?w.jsx(e.options.InnerWrap,{children:o}):o}function wr(){const e=H(),n=z({select:r=>{var o;return(o=r.matches[0])==null?void 0:o.id}}),t=z({select:r=>r.loadedAt}),s=n?w.jsx(kn,{matchId:n}):null;return w.jsx(Je.Provider,{value:n,children:e.options.disableGlobalCatchBoundary?s:w.jsx(Rt,{getResetKey:()=>t,errorComponent:_t,onCatch:r=>{r.message||r.toString()},children:s})})}function Mr(){const e=H();return z({select:n=>{var t;return[n.location.href,(t=n.resolvedLocation)==null?void 0:t.href,n.status]},structuralSharing:!0}),M.useCallback(n=>{const{pending:t,caseSensitive:s,fuzzy:r,includeSearch:o,...i}=n;return e.matchRoute(i,{pending:t,caseSensitive:s,fuzzy:r,includeSearch:o})},[e])}const Er=e=>new Lr(e);class Lr extends Bs{constructor(n){super(n)}}typeof globalThis<"u"?(globalThis.createFileRoute=nn,globalThis.createLazyFileRoute=on):typeof window<"u"&&(window.createFileRoute=nn,window.createLazyFileRoute=on);function br({router:e,children:n,...t}){Object.keys(t).length>0&&e.update({...e.options,...t,context:{...e.options.context,...t.context}});const s=Ln(),r=w.jsx(s.Provider,{value:e,children:n});return e.options.Wrap?w.jsx(e.options.Wrap,{children:r}):r}function Tr({router:e,...n}){return w.jsx(br,{router:e,...n,children:w.jsx(xr,{})})}export{bn as L,_r as O,Ce as R,Ct as a,nn as b,kr as c,Er as d,Tr as e,Q as i,w as j,M as r,Mr as u};