db-studio 1.5.0 → 1.6.2
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.
- package/README.md +44 -0
- package/dist/core-dist/assets/_pathlessLayout-C6DihnsN.js +1 -0
- package/dist/core-dist/assets/_queryId-Dp0aC9mO.js +1 -0
- package/dist/core-dist/assets/_table-D-Om_ZWr.js +8 -0
- package/dist/core-dist/assets/_table-oMebxIBG.js +39 -0
- package/dist/core-dist/assets/{cdoe-editor-CsnVz62S.js → cdoe-editor-SdZQ1WiR.js} +1 -1
- package/dist/core-dist/assets/{dialog-C7B5v45l.js → dialog-jogVSiaL.js} +1 -1
- package/dist/core-dist/assets/icons-B2mES2Qq.js +1 -0
- package/dist/core-dist/assets/{index-BKJZ_DtH.js → index-C7KJNEv-.js} +1 -1
- package/dist/core-dist/assets/index-C9jsi0UO.js +1 -0
- package/dist/core-dist/assets/index-CJ0NUCyi.js +58 -0
- package/dist/core-dist/assets/index-CTFnCamQ.js +1 -0
- package/dist/core-dist/assets/index-CVuaUgmF.js +1 -0
- package/dist/core-dist/assets/index-DQOVykiS.js +1 -0
- package/dist/core-dist/assets/{indexes-chzZ9aUc.js → indexes-DESnDRwn.js} +1 -1
- package/dist/core-dist/assets/logs-DKdQRaOz.js +1 -0
- package/dist/core-dist/assets/{queries.store-kf8rwRRK.js → queries.store-Cfzf5198.js} +1 -1
- package/dist/core-dist/assets/{radix-ui-DdSZPsGt.js → radix-ui-c-7GrHMM.js} +1 -1
- package/dist/core-dist/assets/{react-dom-CFlhbIUR.js → react-dom-BcUZDRtY.js} +1 -1
- package/dist/core-dist/assets/runner-tab-C3hNjCPD.js +3 -0
- package/dist/core-dist/assets/{scroll-area-CGOQphQG.js → scroll-area-BqJhlKZJ.js} +1 -1
- package/dist/core-dist/assets/{tanstack-VIQ5XZ7a.js → tanstack-BaWakKkc.js} +1 -1
- package/dist/core-dist/assets/{tooltip-eBZ2rltH.js → tooltip-BoaJ5LJp.js} +1 -1
- package/dist/core-dist/assets/{use-delete-column-CqTA9IkF.js → use-delete-column-Bg30Zigo.js} +1 -1
- package/dist/core-dist/assets/{visualizer-CW4V7-VL.js → visualizer-CQGMZpWZ.js} +1 -1
- package/dist/core-dist/index.html +5 -5
- package/dist/index.js +398 -182
- package/dist/index.js.map +1 -1
- package/package.json +16 -14
- package/dist/core-dist/assets/_pathlessLayout-BSFx2CpL.js +0 -1
- package/dist/core-dist/assets/_queryId-CgXpSMOd.js +0 -1
- package/dist/core-dist/assets/_table-7G_H-EMC.js +0 -8
- package/dist/core-dist/assets/_table-BD8P3EpN.js +0 -39
- package/dist/core-dist/assets/icons-BTbp9JOE.js +0 -1
- package/dist/core-dist/assets/index-BbUfG55J.js +0 -1
- package/dist/core-dist/assets/index-C0XbK31u.js +0 -58
- package/dist/core-dist/assets/index-CywuOneB.js +0 -1
- package/dist/core-dist/assets/index-CzPkrj7Y.js +0 -1
- package/dist/core-dist/assets/index-DpF8uPY5.js +0 -1
- package/dist/core-dist/assets/logs-BC5WPG0r.js +0 -1
- package/dist/core-dist/assets/runner-tab-D2PzASo9.js +0 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as P,a as ke,b as ls}from"./icons-BTbp9JOE.js";import{j as M}from"./radix-ui-DdSZPsGt.js";import{r as us}from"./react-dom-CFlhbIUR.js";var Me=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(){}},so={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)},oo=class{#e=so;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,n){return this.#e.setTimeout(e,n)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,n){return this.#e.setInterval(e,n)}clearInterval(e){this.#e.clearInterval(e)}},ce=new oo;function io(e){setTimeout(e,0)}var ge=typeof window>"u"||"Deno"in globalThis;function V(){}function ro(e,n){return typeof e=="function"?e(n):e}function Vt(e){return typeof e=="number"&&e>=0&&e!==1/0}function cs(e,n){return Math.max(e+(n||0)-Date.now(),0)}function oe(e,n){return typeof e=="function"?e(n):e}function N(e,n){return typeof e=="function"?e(n):e}function Pn(e,n){const{type:t="all",exact:s,fetchStatus:o,predicate:i,queryKey:r,stale:a}=e;if(r){if(s){if(n.queryHash!==Jt(r,n.options))return!1}else if(!Ve(n.queryKey,r))return!1}if(t!=="all"){const l=n.isActive();if(t==="active"&&!l||t==="inactive"&&l)return!1}return!(typeof a=="boolean"&&n.isStale()!==a||o&&o!==n.state.fetchStatus||i&&!i(n))}function xn(e,n){const{exact:t,status:s,predicate:o,mutationKey:i}=e;if(i){if(!n.options.mutationKey)return!1;if(t){if(pe(n.options.mutationKey)!==pe(i))return!1}else if(!Ve(n.options.mutationKey,i))return!1}return!(s&&n.state.status!==s||o&&!o(n))}function Jt(e,n){return(n?.queryKeyHashFn||pe)(e)}function pe(e){return JSON.stringify(e,(n,t)=>zt(t)?Object.keys(t).sort().reduce((s,o)=>(s[o]=t[o],s),{}):t)}function Ve(e,n){return e===n?!0:typeof e!=typeof n?!1:e&&n&&typeof e=="object"&&typeof n=="object"?Object.keys(n).every(t=>Ve(e[t],n[t])):!1}var ao=Object.prototype.hasOwnProperty;function ds(e,n,t=0){if(e===n)return e;if(t>500)return n;const s=Mn(e)&&Mn(n);if(!s&&!(zt(e)&&zt(n)))return n;const i=(s?e:Object.keys(e)).length,r=s?n:Object.keys(n),a=r.length,l=s?new Array(a):{};let u=0;for(let d=0;d<a;d++){const h=s?d:r[d],c=e[h],f=n[h];if(c===f){l[h]=c,(s?d<i:ao.call(e,h))&&u++;continue}if(c===null||f===null||typeof c!="object"||typeof f!="object"){l[h]=f;continue}const g=ds(c,f,t+1);l[h]=g,g===c&&u++}return i===a&&u===i?e:l}function et(e,n){if(!n||Object.keys(e).length!==Object.keys(n).length)return!1;for(const t in e)if(e[t]!==n[t])return!1;return!0}function Mn(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function zt(e){if(!Fn(e))return!1;const n=e.constructor;if(n===void 0)return!0;const t=n.prototype;return!(!Fn(t)||!t.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Fn(e){return Object.prototype.toString.call(e)==="[object Object]"}function lo(e){return new Promise(n=>{ce.setTimeout(n,e)})}function Bt(e,n,t){return typeof t.structuralSharing=="function"?t.structuralSharing(e,n):t.structuralSharing!==!1?ds(e,n):n}function uo(e,n,t=0){const s=[...e,n];return t&&s.length>t?s.slice(1):s}function co(e,n,t=0){const s=[n,...e];return t&&s.length>t?s.slice(0,-1):s}var Zt=Symbol();function hs(e,n){return!e.queryFn&&n?.initialPromise?()=>n.initialPromise:!e.queryFn||e.queryFn===Zt?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function en(e,n){return typeof e=="function"?e(...n):!!e}function ho(e,n,t){let s=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=n(),s||(s=!0,o.aborted?t():o.addEventListener("abort",t,{once:!0})),o)}),e}var fo=class extends Me{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!ge&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},tn=new fo;function jt(){let e,n;const t=new Promise((o,i)=>{e=o,n=i});t.status="pending",t.catch(()=>{});function s(o){Object.assign(t,o),delete t.resolve,delete t.reject}return t.resolve=o=>{s({status:"fulfilled",value:o}),e(o)},t.reject=o=>{s({status:"rejected",reason:o}),n(o)},t}function ba(e){return e.state.status==="success"}var go=io;function po(){let e=[],n=0,t=a=>{a()},s=a=>{a()},o=go;const i=a=>{n?e.push(a):o(()=>{t(a)})},r=()=>{const a=e;e=[],a.length&&o(()=>{s(()=>{a.forEach(l=>{t(l)})})})};return{batch:a=>{let l;n++;try{l=a()}finally{n--,n||r()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{t=a},setBatchNotifyFunction:a=>{s=a},setScheduler:a=>{o=a}}}var T=po(),mo=class extends Me{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!ge&&window.addEventListener){const n=()=>e(!0),t=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",t,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}},tt=new mo;function vo(e){return Math.min(1e3*2**e,3e4)}function fs(e){return(e??"online")==="online"?tt.isOnline():!0}var Ht=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function gs(e){let n=!1,t=0,s;const o=jt(),i=()=>o.status!=="pending",r=p=>{if(!i()){const v=new Ht(p);c(v),e.onCancel?.(v)}},a=()=>{n=!0},l=()=>{n=!1},u=()=>tn.isFocused()&&(e.networkMode==="always"||tt.isOnline())&&e.canRun(),d=()=>fs(e.networkMode)&&e.canRun(),h=p=>{i()||(s?.(),o.resolve(p))},c=p=>{i()||(s?.(),o.reject(p))},f=()=>new Promise(p=>{s=v=>{(i()||u())&&p(v)},e.onPause?.()}).then(()=>{s=void 0,i()||e.onContinue?.()}),g=()=>{if(i())return;let p;const v=t===0?e.initialPromise:void 0;try{p=v??e.fn()}catch(m){p=Promise.reject(m)}Promise.resolve(p).then(h).catch(m=>{if(i())return;const S=e.retry??(ge?0:3),y=e.retryDelay??vo,w=typeof y=="function"?y(t,m):y,x=S===!0||typeof S=="number"&&t<S||typeof S=="function"&&S(t,m);if(n||!x){c(m);return}t++,e.onFail?.(t,m),lo(w).then(()=>u()?void 0:f()).then(()=>{n?c(m):g()})})};return{promise:o,status:()=>o.status,cancel:r,continue:()=>(s?.(),o),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?g():f().then(g),o)}}var ps=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Vt(this.gcTime)&&(this.#e=ce.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ge?1/0:300*1e3))}clearGcTimeout(){this.#e&&(ce.clearTimeout(this.#e),this.#e=void 0)}},So=class extends ps{#e;#t;#n;#o;#s;#r;#a;constructor(e){super(),this.#a=!1,this.#r=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#o=e.client,this.#n=this.#o.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=bn(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#s?.promise}setOptions(e){if(this.options={...this.#r,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=bn(this.options);n.data!==void 0&&(this.setState(In(n.data,n.dataUpdatedAt)),this.#e=n)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,n){const t=Bt(this.state.data,e,this.options);return this.#i({data:t,type:"success",dataUpdatedAt:n?.updatedAt,manual:n?.manual}),t}setState(e,n){this.#i({type:"setState",state:e,setStateOptions:n})}cancel(e){const n=this.#s?.promise;return this.#s?.cancel(e),n?n.then(V).catch(V):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>N(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Zt||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>oe(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!cs(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(n=>n.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#s?.continue()}onOnline(){this.observers.find(n=>n.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#s?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(this.#s&&(this.#a?this.#s.cancel({revert:!0}):this.#s.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,n){if(this.state.fetchStatus!=="idle"&&this.#s?.status()!=="rejected"){if(this.state.data!==void 0&&n?.cancelRefetch)this.cancel({silent:!0});else if(this.#s)return this.#s.continueRetry(),this.#s.promise}if(e&&this.setOptions(e),!this.options.queryFn){const a=this.observers.find(l=>l.options.queryFn);a&&this.setOptions(a.options)}const t=new AbortController,s=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(this.#a=!0,t.signal)})},o=()=>{const a=hs(this.options,n),u=(()=>{const d={client:this.#o,queryKey:this.queryKey,meta:this.meta};return s(d),d})();return this.#a=!1,this.options.persister?this.options.persister(a,u,this):a(u)},r=(()=>{const a={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:this.#o,state:this.state,fetchFn:o};return s(a),a})();this.options.behavior?.onFetch(r,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==r.fetchOptions?.meta)&&this.#i({type:"fetch",meta:r.fetchOptions?.meta}),this.#s=gs({initialPromise:n?.initialPromise,fn:r.fetchFn,onCancel:a=>{a instanceof Ht&&a.revert&&this.setState({...this.#t,fetchStatus:"idle"}),t.abort()},onFail:(a,l)=>{this.#i({type:"failed",failureCount:a,error:l})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:r.options.retry,retryDelay:r.options.retryDelay,networkMode:r.options.networkMode,canRun:()=>!0});try{const a=await this.#s.start();if(a===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(a),this.#n.config.onSuccess?.(a,this),this.#n.config.onSettled?.(a,this.state.error,this),a}catch(a){if(a instanceof Ht){if(a.silent)return this.#s.promise;if(a.revert){if(this.state.data===void 0)throw a;return this.state.data}}throw this.#i({type:"error",error:a}),this.#n.config.onError?.(a,this),this.#n.config.onSettled?.(this.state.data,a,this),a}finally{this.scheduleGc()}}#i(e){const n=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...ms(t.data,this.options),fetchMeta:e.meta??null};case"success":const s={...t,...In(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?s:void 0,s;case"error":const o=e.error;return{...t,error:o,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=n(this.state),T.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function ms(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:fs(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function In(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function bn(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,t=n!==void 0,s=t?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:t?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}var yo=class extends Me{constructor(e,n){super(),this.options=n,this.#e=e,this.#i=null,this.#a=jt(),this.bindMethods(),this.setOptions(n)}#e;#t=void 0;#n=void 0;#o=void 0;#s;#r;#a;#i;#p;#h;#f;#u;#c;#l;#g=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),En(this.#t,this.options)?this.#d():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ut(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ut(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#w(),this.#R(),this.#t.removeObserver(this)}setOptions(e){const n=this.options,t=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof N(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#C(),this.#t.setOptions(this.options),n._defaulted&&!et(this.options,n)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&Ln(this.#t,t,this.options,n)&&this.#d(),this.updateResult(),s&&(this.#t!==t||N(this.options.enabled,this.#t)!==N(n.enabled,this.#t)||oe(this.options.staleTime,this.#t)!==oe(n.staleTime,this.#t))&&this.#m();const o=this.#v();s&&(this.#t!==t||N(this.options.enabled,this.#t)!==N(n.enabled,this.#t)||o!==this.#l)&&this.#S(o)}getOptimisticResult(e){const n=this.#e.getQueryCache().build(this.#e,e),t=this.createResult(n,e);return Ro(this,t)&&(this.#o=t,this.#r=this.options,this.#s=this.#t.state),t}getCurrentResult(){return this.#o}trackResult(e,n){return new Proxy(e,{get:(t,s)=>(this.trackProp(s),n?.(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(t,s))})}trackProp(e){this.#g.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=this.#e.defaultQueryOptions(e),t=this.#e.getQueryCache().build(this.#e,n);return t.fetch().then(()=>this.createResult(t,n))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#o))}#d(e){this.#C();let n=this.#t.fetch(this.options,e);return e?.throwOnError||(n=n.catch(V)),n}#m(){this.#w();const e=oe(this.options.staleTime,this.#t);if(ge||this.#o.isStale||!Vt(e))return;const t=cs(this.#o.dataUpdatedAt,e)+1;this.#u=ce.setTimeout(()=>{this.#o.isStale||this.updateResult()},t)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#S(e){this.#R(),this.#l=e,!(ge||N(this.options.enabled,this.#t)===!1||!Vt(this.#l)||this.#l===0)&&(this.#c=ce.setInterval(()=>{(this.options.refetchIntervalInBackground||tn.isFocused())&&this.#d()},this.#l))}#y(){this.#m(),this.#S(this.#v())}#w(){this.#u&&(ce.clearTimeout(this.#u),this.#u=void 0)}#R(){this.#c&&(ce.clearInterval(this.#c),this.#c=void 0)}createResult(e,n){const t=this.#t,s=this.options,o=this.#o,i=this.#s,r=this.#r,l=e!==t?e.state:this.#n,{state:u}=e;let d={...u},h=!1,c;if(n._optimisticResults){const C=this.hasListeners(),F=!C&&En(e,n),E=C&&Ln(e,t,n,s);(F||E)&&(d={...d,...ms(u.data,e.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:f,errorUpdatedAt:g,status:p}=d;c=d.data;let v=!1;if(n.placeholderData!==void 0&&c===void 0&&p==="pending"){let C;o?.isPlaceholderData&&n.placeholderData===r?.placeholderData?(C=o.data,v=!0):C=typeof n.placeholderData=="function"?n.placeholderData(this.#f?.state.data,this.#f):n.placeholderData,C!==void 0&&(p="success",c=Bt(o?.data,C,n),h=!0)}if(n.select&&c!==void 0&&!v)if(o&&c===i?.data&&n.select===this.#p)c=this.#h;else try{this.#p=n.select,c=n.select(c),c=Bt(o?.data,c,n),this.#h=c,this.#i=null}catch(C){this.#i=C}this.#i&&(f=this.#i,c=this.#h,g=Date.now(),p="error");const m=d.fetchStatus==="fetching",S=p==="pending",y=p==="error",w=S&&m,x=c!==void 0,_={status:p,fetchStatus:d.fetchStatus,isPending:S,isSuccess:p==="success",isError:y,isInitialLoading:w,isLoading:w,data:c,dataUpdatedAt:d.dataUpdatedAt,error:f,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:m,isRefetching:m&&!S,isLoadingError:y&&!x,isPaused:d.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:y&&x,isStale:nn(e,n),refetch:this.refetch,promise:this.#a,isEnabled:N(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const C=_.data!==void 0,F=_.status==="error"&&!C,E=D=>{F?D.reject(_.error):C&&D.resolve(_.data)},L=()=>{const D=this.#a=_.promise=jt();E(D)},$=this.#a;switch($.status){case"pending":e.queryHash===t.queryHash&&E($);break;case"fulfilled":(F||_.data!==$.value)&&L();break;case"rejected":(!F||_.error!==$.reason)&&L();break}}return _}updateResult(){const e=this.#o,n=this.createResult(this.#t,this.options);if(this.#s=this.#t.state,this.#r=this.options,this.#s.data!==void 0&&(this.#f=this.#t),et(n,e))return;this.#o=n;const t=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!this.#g.size)return!0;const i=new Set(o??this.#g);return this.options.throwOnError&&i.add("error"),Object.keys(this.#o).some(r=>{const a=r;return this.#o[a]!==e[a]&&i.has(a)})};this.#_({listeners:t()})}#C(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const n=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(n?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#_(e){T.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(this.#o)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function wo(e,n){return N(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&n.retryOnMount===!1)}function En(e,n){return wo(e,n)||e.state.data!==void 0&&Ut(e,n,n.refetchOnMount)}function Ut(e,n,t){if(N(n.enabled,e)!==!1&&oe(n.staleTime,e)!=="static"){const s=typeof t=="function"?t(e):t;return s==="always"||s!==!1&&nn(e,n)}return!1}function Ln(e,n,t,s){return(e!==n||N(s.enabled,e)===!1)&&(!t.suspense||e.state.status!=="error")&&nn(e,t)}function nn(e,n){return N(n.enabled,e)!==!1&&e.isStaleByTime(oe(n.staleTime,e))}function Ro(e,n){return!et(e.getCurrentResult(),n)}function On(e){return{onFetch:(n,t)=>{const s=n.options,o=n.fetchOptions?.meta?.fetchMore?.direction,i=n.state.data?.pages||[],r=n.state.data?.pageParams||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let d=!1;const h=g=>{ho(g,()=>n.signal,()=>d=!0)},c=hs(n.options,n.fetchOptions),f=async(g,p,v)=>{if(d)return Promise.reject();if(p==null&&g.pages.length)return Promise.resolve(g);const S=(()=>{const R={client:n.client,queryKey:n.queryKey,pageParam:p,direction:v?"backward":"forward",meta:n.options.meta};return h(R),R})(),y=await c(S),{maxPages:w}=n.options,x=v?co:uo;return{pages:x(g.pages,y,w),pageParams:x(g.pageParams,p,w)}};if(o&&i.length){const g=o==="backward",p=g?Co:Tn,v={pages:i,pageParams:r},m=p(s,v);a=await f(v,m,g)}else{const g=e??i.length;do{const p=l===0?r[0]??s.initialPageParam:Tn(s,a);if(l>0&&p==null)break;a=await f(a,p),l++}while(l<g)}return a};n.options.persister?n.fetchFn=()=>n.options.persister?.(u,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},t):n.fetchFn=u}}}function Tn(e,{pages:n,pageParams:t}){const s=n.length-1;return n.length>0?e.getNextPageParam(n[s],n,t[s],t):void 0}function Co(e,{pages:n,pageParams:t}){return n.length>0?e.getPreviousPageParam?.(n[0],n,t[0],t):void 0}var _o=class extends ps{#e;#t;#n;#o;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||vs(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(n=>n!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#o?.continue()??this.execute(this.state.variables)}async execute(e){const n=()=>{this.#s({type:"continue"})},t={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#o=gs({fn:()=>this.options.mutationFn?this.options.mutationFn(e,t):Promise.reject(new Error("No mutationFn found")),onFail:(i,r)=>{this.#s({type:"failed",failureCount:i,error:r})},onPause:()=>{this.#s({type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const s=this.state.status==="pending",o=!this.#o.canStart();try{if(s)n();else{this.#s({type:"pending",variables:e,isPaused:o}),await this.#n.config.onMutate?.(e,this,t);const r=await this.options.onMutate?.(e,t);r!==this.state.context&&this.#s({type:"pending",context:r,variables:e,isPaused:o})}const i=await this.#o.start();return await this.#n.config.onSuccess?.(i,e,this.state.context,this,t),await this.options.onSuccess?.(i,e,this.state.context,t),await this.#n.config.onSettled?.(i,null,this.state.variables,this.state.context,this,t),await this.options.onSettled?.(i,null,e,this.state.context,t),this.#s({type:"success",data:i}),i}catch(i){try{await this.#n.config.onError?.(i,e,this.state.context,this,t)}catch(r){Promise.reject(r)}try{await this.options.onError?.(i,e,this.state.context,t)}catch(r){Promise.reject(r)}try{await this.#n.config.onSettled?.(void 0,i,this.state.variables,this.state.context,this,t)}catch(r){Promise.reject(r)}try{await this.options.onSettled?.(void 0,i,e,this.state.context,t)}catch(r){Promise.reject(r)}throw this.#s({type:"error",error:i}),i}finally{this.#n.runNext(this)}}#s(e){const n=t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),T.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function vs(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Po=class extends Me{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,n,t){const s=new _o({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(n),state:t});return this.add(s),s}add(e){this.#e.add(e);const n=Ge(e);if(typeof n=="string"){const t=this.#t.get(n);t?t.push(e):this.#t.set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const n=Ge(e);if(typeof n=="string"){const t=this.#t.get(n);if(t)if(t.length>1){const s=t.indexOf(e);s!==-1&&t.splice(s,1)}else t[0]===e&&this.#t.delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Ge(e);if(typeof n=="string"){const s=this.#t.get(n)?.find(o=>o.state.status==="pending");return!s||s===e}else return!0}runNext(e){const n=Ge(e);return typeof n=="string"?this.#t.get(n)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){T.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const n={exact:!0,...e};return this.getAll().find(t=>xn(n,t))}findAll(e={}){return this.getAll().filter(n=>xn(e,n))}notify(e){T.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return T.batch(()=>Promise.all(e.map(n=>n.continue().catch(V))))}};function Ge(e){return e.options.scope?.id}var xo=class extends Me{#e;#t=void 0;#n;#o;constructor(e,n){super(),this.#e=e,this.setOptions(n),this.bindMethods(),this.#s()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const n=this.options;this.options=this.#e.defaultMutationOptions(e),et(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&pe(n.mutationKey)!==pe(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#s(),this.#r(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#s(),this.#r()}mutate(e,n){return this.#o=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#s(){const e=this.#n?.state??vs();this.#t={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#r(e){T.batch(()=>{if(this.#o&&this.hasListeners()){const n=this.#t.variables,t=this.#t.context,s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#o.onSuccess?.(e.data,n,t,s)}catch(o){Promise.reject(o)}try{this.#o.onSettled?.(e.data,null,n,t,s)}catch(o){Promise.reject(o)}}else if(e?.type==="error"){try{this.#o.onError?.(e.error,n,t,s)}catch(o){Promise.reject(o)}try{this.#o.onSettled?.(void 0,e.error,n,t,s)}catch(o){Promise.reject(o)}}}this.listeners.forEach(n=>{n(this.#t)})})}},Mo=class extends Me{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,n,t){const s=n.queryKey,o=n.queryHash??Jt(s,n);let i=this.get(o);return i||(i=new So({client:e,queryKey:s,queryHash:o,options:e.defaultQueryOptions(n),state:t,defaultOptions:e.getQueryDefaults(s)}),this.add(i)),i}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=this.#e.get(e.queryHash);n&&(e.destroy(),n===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){T.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const n={exact:!0,...e};return this.getAll().find(t=>Pn(n,t))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(t=>Pn(e,t)):n}notify(e){T.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){T.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){T.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ea=class{#e;#t;#n;#o;#s;#r;#a;#i;constructor(e={}){this.#e=e.queryCache||new Mo,this.#t=e.mutationCache||new Po,this.#n=e.defaultOptions||{},this.#o=new Map,this.#s=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#a=tn.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=tt.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#a?.(),this.#a=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),t=this.#e.build(this,n),s=t.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&t.isStaleByTime(oe(n.staleTime,t))&&this.prefetchQuery(n),Promise.resolve(s))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:n,state:t})=>{const s=t.data;return[n,s]})}setQueryData(e,n,t){const s=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(s.queryHash)?.state.data,r=ro(n,i);if(r!==void 0)return this.#e.build(this,s).setData(r,{...t,manual:!0})}setQueriesData(e,n,t){return T.batch(()=>this.#e.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,n,t)]))}getQueryState(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state}removeQueries(e){const n=this.#e;T.batch(()=>{n.findAll(e).forEach(t=>{n.remove(t)})})}resetQueries(e,n){const t=this.#e;return T.batch(()=>(t.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},n)))}cancelQueries(e,n={}){const t={revert:!0,...n},s=T.batch(()=>this.#e.findAll(e).map(o=>o.cancel(t)));return Promise.all(s).then(V).catch(V)}invalidateQueries(e,n={}){return T.batch(()=>(this.#e.findAll(e).forEach(t=>{t.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},n)))}refetchQueries(e,n={}){const t={...n,cancelRefetch:n.cancelRefetch??!0},s=T.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let i=o.fetch(void 0,t);return t.throwOnError||(i=i.catch(V)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(s).then(V)}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const t=this.#e.build(this,n);return t.isStaleByTime(oe(n.staleTime,t))?t.fetch(n):Promise.resolve(t.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(V).catch(V)}fetchInfiniteQuery(e){return e.behavior=On(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(V).catch(V)}ensureInfiniteQueryData(e){return e.behavior=On(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return tt.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,n){this.#o.set(pe(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...this.#o.values()],t={};return n.forEach(s=>{Ve(e,s.queryKey)&&Object.assign(t,s.defaultOptions)}),t}setMutationDefaults(e,n){this.#s.set(pe(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...this.#s.values()],t={};return n.forEach(s=>{Ve(e,s.mutationKey)&&Object.assign(t,s.defaultOptions)}),t}defaultQueryOptions(e){if(e._defaulted)return e;const n={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=Jt(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===Zt&&(n.enabled=!1),n}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Ss=P.createContext(void 0),ys=e=>{const n=P.useContext(Ss);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},La=({client:e,children:n})=>(P.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),M.jsx(Ss.Provider,{value:e,children:n})),ws=P.createContext(!1),Fo=()=>P.useContext(ws);ws.Provider;function Io(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var bo=P.createContext(Io()),Eo=()=>P.useContext(bo),Lo=(e,n,t)=>{const s=t?.state.error&&typeof e.throwOnError=="function"?en(e.throwOnError,[t.state.error,t]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||s)&&(n.isReset()||(e.retryOnMount=!1))},Oo=e=>{P.useEffect(()=>{e.clearReset()},[e])},To=({result:e,errorResetBoundary:n,throwOnError:t,query:s,suspense:o})=>e.isError&&!n.isReset()&&!e.isFetching&&s&&(o&&e.data===void 0||en(t,[e.error,s])),$o=e=>{if(e.suspense){const t=o=>o==="static"?o:Math.max(o??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...o)=>t(s(...o)):t(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Do=(e,n)=>e.isLoading&&e.isFetching&&!n,Ao=(e,n)=>e?.suspense&&n.isPending,$n=(e,n,t)=>n.fetchOptimistic(e).catch(()=>{t.clearReset()});function ko(e,n,t){const s=Fo(),o=Eo(),i=ys(),r=i.defaultQueryOptions(e);i.getDefaultOptions().queries?._experimental_beforeQuery?.(r);const a=i.getQueryCache().get(r.queryHash);r._optimisticResults=s?"isRestoring":"optimistic",$o(r),Lo(r,o,a),Oo(o);const l=!i.getQueryCache().get(r.queryHash),[u]=P.useState(()=>new n(i,r)),d=u.getOptimisticResult(r),h=!s&&e.subscribed!==!1;if(P.useSyncExternalStore(P.useCallback(c=>{const f=h?u.subscribe(T.batchCalls(c)):V;return u.updateResult(),f},[u,h]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),P.useEffect(()=>{u.setOptions(r)},[r,u]),Ao(r,d))throw $n(r,u,o);if(To({result:d,errorResetBoundary:o,throwOnError:r.throwOnError,query:a,suspense:r.suspense}))throw d.error;return i.getDefaultOptions().queries?._experimental_afterQuery?.(r,d),r.experimental_prefetchInRender&&!ge&&Do(d,s)&&(l?$n(r,u,o):a?.promise)?.catch(V).finally(()=>{u.updateResult()}),r.notifyOnChangeProps?d:u.trackResult(d)}function Oa(e,n){return ko(e,yo)}function Ta(e,n){const t=ys(),[s]=P.useState(()=>new xo(t,e));P.useEffect(()=>{s.setOptions(e)},[s,e]);const o=P.useSyncExternalStore(P.useCallback(r=>s.subscribe(T.batchCalls(r)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),i=P.useCallback((r,a)=>{s.mutate(r,a).catch(V)},[s]);if(o.error&&en(s.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:i,mutateAsync:o.mutate}}const Gt=new WeakMap,Vo=new WeakMap,nt={current:[]};let St=!1,$e=0;const Te=new Set,Ne=new Map;function Rs(e){for(const n of e){if(nt.current.includes(n))continue;nt.current.push(n),n.recompute();const t=Vo.get(n);if(t)for(const s of t){const o=Gt.get(s);o?.length&&Rs(o)}}}function zo(e){const n={prevVal:e.prevState,currentVal:e.state};for(const t of e.listeners)t(n)}function Bo(e){const n={prevVal:e.prevState,currentVal:e.state};for(const t of e.listeners)t(n)}function Cs(e){if($e>0&&!Ne.has(e)&&Ne.set(e,e.prevState),Te.add(e),!($e>0)&&!St)try{for(St=!0;Te.size>0;){const n=Array.from(Te);Te.clear();for(const t of n){const s=Ne.get(t)??t.prevState;t.prevState=s,zo(t)}for(const t of n){const s=Gt.get(t);s&&(nt.current.push(t),Rs(s))}for(const t of n){const s=Gt.get(t);if(s)for(const o of s)Bo(o)}}}finally{St=!1,nt.current=[],Ne.clear()}}function De(e){$e++;try{e()}finally{if($e--,$e===0){const n=Te.values().next().value;n&&Cs(n)}}}function jo(e){return typeof e=="function"}class Ho{constructor(n,t){this.listeners=new Set,this.subscribe=s=>{var o,i;this.listeners.add(s);const r=(i=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:i.call(o,s,this);return()=>{this.listeners.delete(s),r?.()}},this.prevState=n,this.state=n,this.options=t}setState(n){var t,s,o;this.prevState=this.state,(t=this.options)!=null&&t.updateFn?this.state=this.options.updateFn(this.prevState)(n):jo(n)?this.state=n(this.prevState):this.state=n,(o=(s=this.options)==null?void 0:s.onUpdate)==null||o.call(s),Cs(this)}}const ie="__TSR_index",Dn="popstate",An="beforeunload";function Uo(e){let n=e.getLocation();const t=new Set,s=r=>{n=e.getLocation(),t.forEach(a=>a({location:n,action:r}))},o=r=>{e.notifyOnIndexChange??!0?s(r):n=e.getLocation()},i=async({task:r,navigateOpts:a,...l})=>{if(a?.ignoreBlocker??!1){r();return}const d=e.getBlockers?.()??[],h=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&d.length&&h)for(const c of d){const f=st(l.path,l.state);if(await c.blockerFn({currentLocation:n,nextLocation:f,action:l.type})){e.onBlocked?.();return}}r()};return{get location(){return n},get length(){return e.getLength()},subscribers:t,subscribe:r=>(t.add(r),()=>{t.delete(r)}),push:(r,a,l)=>{const u=n.state[ie];a=kn(u+1,a),i({task:()=>{e.pushState(r,a),s({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:r,state:a})},replace:(r,a,l)=>{const u=n.state[ie];a=kn(u,a),i({task:()=>{e.replaceState(r,a),s({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:r,state:a})},go:(r,a)=>{i({task:()=>{e.go(r),o({type:"GO",index:r})},navigateOpts:a,type:"GO"})},back:r=>{i({task:()=>{e.back(r?.ignoreBlocker??!1),o({type:"BACK"})},navigateOpts:r,type:"BACK"})},forward:r=>{i({task:()=>{e.forward(r?.ignoreBlocker??!1),o({type:"FORWARD"})},navigateOpts:r,type:"FORWARD"})},canGoBack:()=>n.state[ie]!==0,createHref:r=>e.createHref(r),block:r=>{if(!e.setBlockers)return()=>{};const a=e.getBlockers?.()??[];return e.setBlockers([...a,r]),()=>{const l=e.getBlockers?.()??[];e.setBlockers?.(l.filter(u=>u!==r))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:s}}function kn(e,n){n||(n={});const t=sn();return{...n,key:t,__TSR_key:t,[ie]:e}}function Go(e){const n=typeof document<"u"?window:void 0,t=n.history.pushState,s=n.history.replaceState;let o=[];const i=()=>o,r=C=>o=C,a=(C=>C),l=(()=>st(`${n.location.pathname}${n.location.search}${n.location.hash}`,n.history.state));if(!n.history.state?.__TSR_key&&!n.history.state?.key){const C=sn();n.history.replaceState({[ie]:0,key:C,__TSR_key:C},"")}let u=l(),d,h=!1,c=!1,f=!1,g=!1;const p=()=>u;let v,m;const S=()=>{v&&(_._ignoreSubscribers=!0,(v.isPush?n.history.pushState:n.history.replaceState)(v.state,"",v.href),_._ignoreSubscribers=!1,v=void 0,m=void 0,d=void 0)},y=(C,F,E)=>{const L=a(F);m||(d=u),u=st(F,E),v={href:L,state:E,isPush:v?.isPush||C==="push"},m||(m=Promise.resolve().then(()=>S()))},w=C=>{u=l(),_.notify({type:C})},x=async()=>{if(c){c=!1;return}const C=l(),F=C.state[ie]-u.state[ie],E=F===1,L=F===-1,$=!E&&!L||h;h=!1;const D=$?"GO":L?"BACK":"FORWARD",K=$?{type:"GO",index:F}:{type:L?"BACK":"FORWARD"};if(f)f=!1;else{const W=i();if(typeof document<"u"&&W.length){for(const Se of W)if(await Se.blockerFn({currentLocation:u,nextLocation:C,action:D})){c=!0,n.history.go(1),_.notify(K);return}}}u=l(),_.notify(K)},R=C=>{if(g){g=!1;return}let F=!1;const E=i();if(typeof document<"u"&&E.length)for(const L of E){const $=L.enableBeforeUnload??!0;if($===!0){F=!0;break}if(typeof $=="function"&&$()===!0){F=!0;break}}if(F)return C.preventDefault(),C.returnValue=""},_=Uo({getLocation:p,getLength:()=>n.history.length,pushState:(C,F)=>y("push",C,F),replaceState:(C,F)=>y("replace",C,F),back:C=>(C&&(f=!0),g=!0,n.history.back()),forward:C=>{C&&(f=!0),g=!0,n.history.forward()},go:C=>{h=!0,n.history.go(C)},createHref:C=>a(C),flush:S,destroy:()=>{n.history.pushState=t,n.history.replaceState=s,n.removeEventListener(An,R,{capture:!0}),n.removeEventListener(Dn,x)},onBlocked:()=>{d&&u!==d&&(u=d)},getBlockers:i,setBlockers:r,notifyOnIndexChange:!1});return n.addEventListener(An,R,{capture:!0}),n.addEventListener(Dn,x),n.history.pushState=function(...C){const F=t.apply(n.history,C);return _._ignoreSubscribers||w("PUSH"),F},n.history.replaceState=function(...C){const F=s.apply(n.history,C);return _._ignoreSubscribers||w("REPLACE"),F},_}function No(e){let n=e.replace(/[\x00-\x1f\x7f]/g,"");return n.startsWith("//")&&(n="/"+n.replace(/^\/+/,"")),n}function st(e,n){const t=No(e),s=t.indexOf("#"),o=t.indexOf("?"),i=sn();return{href:t,pathname:t.substring(0,s>0?o>0?Math.min(s,o):s:o>0?o:t.length),hash:s>-1?t.substring(s):"",search:o>-1?t.slice(o,s===-1?void 0:s):"",state:n||{[ie]:0,key:i,__TSR_key:i}}}function sn(){return(Math.random()+1).toString(36).substring(7)}function ot(e){return e[e.length-1]}function qo(e){return typeof e=="function"}function te(e,n){return qo(e)?e(n):e}const Ko=Object.prototype.hasOwnProperty;function G(e,n){if(e===n)return e;const t=n,s=Bn(e)&&Bn(t);if(!s&&!(it(e)&&it(t)))return t;const o=s?e:Vn(e);if(!o)return t;const i=s?t:Vn(t);if(!i)return t;const r=o.length,a=i.length,l=s?new Array(a):{};let u=0;for(let d=0;d<a;d++){const h=s?d:i[d],c=e[h],f=t[h];if(c===f){l[h]=c,(s?d<r:Ko.call(e,h))&&u++;continue}if(c===null||f===null||typeof c!="object"||typeof f!="object"){l[h]=f;continue}const g=G(c,f);l[h]=g,g===c&&u++}return r===a&&u===r?e:l}function Vn(e){const n=[],t=Object.getOwnPropertyNames(e);for(const o of t){if(!Object.prototype.propertyIsEnumerable.call(e,o))return!1;n.push(o)}const s=Object.getOwnPropertySymbols(e);for(const o of s){if(!Object.prototype.propertyIsEnumerable.call(e,o))return!1;n.push(o)}return n}function it(e){if(!zn(e))return!1;const n=e.constructor;if(typeof n>"u")return!0;const t=n.prototype;return!(!zn(t)||!t.hasOwnProperty("isPrototypeOf"))}function zn(e){return Object.prototype.toString.call(e)==="[object Object]"}function Bn(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function de(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,o=e.length;s<o;s++)if(!de(e[s],n[s],t))return!1;return!0}if(it(e)&&it(n)){const s=t?.ignoreUndefined??!0;if(t?.partial){for(const r in n)if((!s||n[r]!==void 0)&&!de(e[r],n[r],t))return!1;return!0}let o=0;if(!s)o=Object.keys(e).length;else for(const r in e)e[r]!==void 0&&o++;let i=0;for(const r in n)if((!s||n[r]!==void 0)&&(i++,i>o||!de(e[r],n[r],t)))return!1;return o===i}return!1}function Pe(e){let n,t;const s=new Promise((o,i)=>{n=o,t=i});return s.status="pending",s.resolve=o=>{s.status="resolved",s.value=o,n(o),e?.(o)},s.reject=o=>{s.status="rejected",t(o)},s}function Wo(e){return typeof e?.message!="string"?!1:e.message.startsWith("Failed to fetch dynamically imported module")||e.message.startsWith("error loading dynamically imported module")||e.message.startsWith("Importing a module script failed")}function re(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function Qo(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function jn(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 Qo(n)}function Hn(e,n){if(!e)return e;const t=/%25|%5C/gi;let s=0,o="",i;for(;(i=t.exec(e))!==null;)o+=jn(e.slice(s,i.index))+i[0],s=t.lastIndex;return o=o+jn(s?e.slice(s):e),o.startsWith("//")&&(o="/"+o.replace(/^\/+/,"")),o}var Xo="Invariant failed";function ee(e,n){if(!e)throw new Error(Xo)}function rt(e){const n=new Map;let t,s;const o=i=>{i.next&&(i.prev?(i.prev.next=i.next,i.next.prev=i.prev,i.next=void 0,s&&(s.next=i,i.prev=s)):(i.next.prev=void 0,t=i.next,i.next=void 0,s&&(i.prev=s,s.next=i)),s=i)};return{get(i){const r=n.get(i);if(r)return o(r),r.value},set(i,r){if(n.size>=e&&t){const l=t;n.delete(l.key),l.next&&(t=l.next,l.next.prev=void 0),l===s&&(s=void 0)}const a=n.get(i);if(a)a.value=r,o(a);else{const l={key:i,value:r,prev:s};s&&(s.next=l),s=l,t||(t=l),n.set(i,l)}},clear(){n.clear(),t=void 0,s=void 0}}}const xe=0,me=1,ve=2,ze=3,Ce=4,Yo=/^([^{]*)\{\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,Jo=/^([^{]*)\{-\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,Zo=/^([^{]*)\{\$\}([^}]*)$/;function on(e,n,t=new Uint16Array(6)){const s=e.indexOf("/",n),o=s===-1?e.length:s,i=e.substring(n,o);if(!i||!i.includes("$"))return t[0]=xe,t[1]=n,t[2]=n,t[3]=o,t[4]=o,t[5]=o,t;if(i==="$"){const u=e.length;return t[0]=ve,t[1]=n,t[2]=n,t[3]=u,t[4]=u,t[5]=u,t}if(i.charCodeAt(0)===36)return t[0]=me,t[1]=n,t[2]=n+1,t[3]=o,t[4]=o,t[5]=o,t;const r=i.match(Zo);if(r){const d=r[1].length;return t[0]=ve,t[1]=n+d,t[2]=n+d+1,t[3]=n+d+2,t[4]=n+d+3,t[5]=e.length,t}const a=i.match(Jo);if(a){const u=a[1],d=a[2],h=a[3],c=u.length;return t[0]=ze,t[1]=n+c,t[2]=n+c+3,t[3]=n+c+3+d.length,t[4]=o-h.length,t[5]=o,t}const l=i.match(Yo);if(l){const u=l[1],d=l[2],h=l[3],c=u.length;return t[0]=me,t[1]=n+c,t[2]=n+c+2,t[3]=n+c+2+d.length,t[4]=o-h.length,t[5]=o,t}return t[0]=xe,t[1]=n,t[2]=n,t[3]=o,t[4]=o,t[5]=o,t}function dt(e,n,t,s,o,i,r){r?.(t);let a=s;{const l=t.fullPath??t.from,u=l.length,d=t.options?.caseSensitive??e;for(;a<u;){const c=on(l,a,n);let f;const g=a,p=c[5];switch(a=p+1,i++,c[0]){case xe:{const m=l.substring(c[2],c[3]);if(d){const S=o.static?.get(m);if(S)f=S;else{o.static??=new Map;const y=_e(t.fullPath??t.from);y.parent=o,y.depth=i,f=y,o.static.set(m,y)}}else{const S=m.toLowerCase(),y=o.staticInsensitive?.get(S);if(y)f=y;else{o.staticInsensitive??=new Map;const w=_e(t.fullPath??t.from);w.parent=o,w.depth=i,f=w,o.staticInsensitive.set(S,w)}}break}case me:{const m=l.substring(g,c[1]),S=l.substring(c[4],p),y=d&&!!(m||S),w=m?y?m:m.toLowerCase():void 0,x=S?y?S:S.toLowerCase():void 0,R=o.dynamic?.find(_=>_.caseSensitive===y&&_.prefix===w&&_.suffix===x);if(R)f=R;else{const _=wt(me,t.fullPath??t.from,y,w,x);f=_,_.depth=i,_.parent=o,o.dynamic??=[],o.dynamic.push(_)}break}case ze:{const m=l.substring(g,c[1]),S=l.substring(c[4],p),y=d&&!!(m||S),w=m?y?m:m.toLowerCase():void 0,x=S?y?S:S.toLowerCase():void 0,R=o.optional?.find(_=>_.caseSensitive===y&&_.prefix===w&&_.suffix===x);if(R)f=R;else{const _=wt(ze,t.fullPath??t.from,y,w,x);f=_,_.parent=o,_.depth=i,o.optional??=[],o.optional.push(_)}break}case ve:{const m=l.substring(g,c[1]),S=l.substring(c[4],p),y=d&&!!(m||S),w=m?y?m:m.toLowerCase():void 0,x=S?y?S:S.toLowerCase():void 0,R=wt(ve,t.fullPath??t.from,y,w,x);f=R,R.parent=o,R.depth=i,o.wildcard??=[],o.wildcard.push(R)}}o=f}const h=(t.path||!t.children)&&!t.isRoot;if(h&&l.endsWith("/")){const c=_e(t.fullPath??t.from);c.kind=Ce,c.parent=o,i++,c.depth=i,o.index=c,o=c}h&&!o.route&&(o.route=t,o.fullPath=t.fullPath??t.from)}if(t.children)for(const l of t.children)dt(e,n,l,a,o,i,r)}function yt(e,n){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 ue(e){if(e.static)for(const n of e.static.values())ue(n);if(e.staticInsensitive)for(const n of e.staticInsensitive.values())ue(n);if(e.dynamic?.length){e.dynamic.sort(yt);for(const n of e.dynamic)ue(n)}if(e.optional?.length){e.optional.sort(yt);for(const n of e.optional)ue(n)}if(e.wildcard?.length){e.wildcard.sort(yt);for(const n of e.wildcard)ue(n)}}function _e(e){return{kind:xe,depth:0,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null}}function wt(e,n,t,s,o){return{kind:e,depth:0,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:n,parent:null,caseSensitive:t,prefix:s,suffix:o}}function ei(e,n){const t=_e("/"),s=new Uint16Array(6);for(const o of e)dt(!1,s,o,1,t,0);ue(t),n.masksTree=t,n.flatCache=rt(1e3)}function ti(e,n){e||="/";const t=n.flatCache.get(e);if(t)return t;const s=rn(e,n.masksTree);return n.flatCache.set(e,s),s}function ni(e,n,t,s,o){e||="/",s||="/";const i=n?`case\0${e}`:e;let r=o.singleCache.get(i);if(!r){r=_e("/");const a=new Uint16Array(6);dt(n,a,{from:e},1,r,0),o.singleCache.set(i,r)}return rn(s,r,t)}function si(e,n,t=!1){const s=t?e:`nofuzz\0${e}`,o=n.matchCache.get(s);if(o!==void 0)return o;e||="/";const i=rn(e,n.segmentTree,t);return i&&(i.branch=ai(i.route)),n.matchCache.set(s,i),i}function oi(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function ii(e,n=!1,t){const s=_e(e.fullPath),o=new Uint16Array(6),i={},r={};let a=0;return dt(n,o,e,1,s,0,u=>{if(t?.(u,a),ee(!(u.id in i),`Duplicate routes found with id: ${String(u.id)}`),i[u.id]=u,a!==0&&u.path){const d=oi(u.fullPath);(!r[d]||u.fullPath.endsWith("/"))&&(r[d]=u)}a++}),ue(s),{processedTree:{segmentTree:s,singleCache:rt(1e3),matchCache:rt(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:r}}function rn(e,n,t=!1){const s=e.split("/"),o=ui(e,s,n,t);if(!o)return null;const i=ri(e,s,o);return"**"in o&&(i["**"]=o["**"]),{route:o.node.route,params:i}}function ri(e,n,t){const s=li(t.node);let o=null;const i={};for(let r=0,a=0,l=0;a<s.length;r++,a++,l++){const u=s[a],d=n[r],h=l;if(d&&(l+=d.length),u.kind===me){o??=t.node.fullPath.split("/");const c=o[a],f=u.prefix?.length??0;if(c.charCodeAt(f)===123){const p=u.suffix?.length??0,v=c.substring(f+2,c.length-p-1),m=d.substring(f,d.length-p);i[v]=decodeURIComponent(m)}else{const p=c.substring(1);i[p]=decodeURIComponent(d)}}else if(u.kind===ze){if(t.skipped&1<<a){r--;continue}o??=t.node.fullPath.split("/");const c=o[a],f=u.prefix?.length??0,g=u.suffix?.length??0,p=c.substring(f+3,c.length-g-1),v=u.suffix||u.prefix?d.substring(f,d.length-g):d;v&&(i[p]=decodeURIComponent(v))}else if(u.kind===ve){const c=u,f=e.substring(h+(c.prefix?.length??0),e.length-(c.suffix?.length??0)),g=decodeURIComponent(f);i["*"]=g,i._splat=g;break}}return i}function ai(e){const n=[e];for(;e.parentRoute;)e=e.parentRoute,n.push(e);return n.reverse(),n}function li(e){const n=Array(e.depth+1);do n[e.depth]=e,e=e.parent;while(e);return n}function ui(e,n,t,s){if(e==="/"&&t.index)return{node:t.index,skipped:0};const o=!ot(n),i=o&&e!=="/",r=n.length-(o?1:0),a=[{node:t,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let l=null,u=null,d=null;for(;a.length;){const h=a.pop();let{node:c,index:f,skipped:g,depth:p,statics:v,dynamics:m,optionals:S}=h;s&&c.route&&c.kind!==Ce&&Ie(u,h)&&(u=h);const y=f===r;if(y&&(c.route&&!i&&Ie(d,h)&&(d=h),!c.optional&&!c.wildcard&&!c.index))continue;const w=y?void 0:n[f];let x;if(y&&c.index){const R={node:c.index,index:f,skipped:g,depth:p+1,statics:v,dynamics:m,optionals:S};if(v===r&&!m&&!S&&!g)return R;Ie(d,R)&&(d=R)}if(c.wildcard&&Ie(l,h))for(const R of c.wildcard){const{prefix:_,suffix:C}=R;if(!(_&&(y||!(R.caseSensitive?w:x??=w.toLowerCase()).startsWith(_)))){if(C){if(y)continue;const F=n.slice(f).join("/").slice(-C.length);if((R.caseSensitive?F:F.toLowerCase())!==C)continue}l={node:R,index:r,skipped:g,depth:p,statics:v,dynamics:m,optionals:S};break}}if(c.optional){const R=g|1<<p,_=p+1;for(let C=c.optional.length-1;C>=0;C--){const F=c.optional[C];a.push({node:F,index:f,skipped:R,depth:_,statics:v,dynamics:m,optionals:S})}if(!y)for(let C=c.optional.length-1;C>=0;C--){const F=c.optional[C],{prefix:E,suffix:L}=F;if(E||L){const $=F.caseSensitive?w:x??=w.toLowerCase();if(E&&!$.startsWith(E)||L&&!$.endsWith(L))continue}a.push({node:F,index:f+1,skipped:g,depth:_,statics:v,dynamics:m,optionals:S+1})}}if(!y&&c.dynamic&&w)for(let R=c.dynamic.length-1;R>=0;R--){const _=c.dynamic[R],{prefix:C,suffix:F}=_;if(C||F){const E=_.caseSensitive?w:x??=w.toLowerCase();if(C&&!E.startsWith(C)||F&&!E.endsWith(F))continue}a.push({node:_,index:f+1,skipped:g,depth:p+1,statics:v,dynamics:m+1,optionals:S})}if(!y&&c.staticInsensitive){const R=c.staticInsensitive.get(x??=w.toLowerCase());R&&a.push({node:R,index:f+1,skipped:g,depth:p+1,statics:v+1,dynamics:m,optionals:S})}if(!y&&c.static){const R=c.static.get(w);R&&a.push({node:R,index:f+1,skipped:g,depth:p+1,statics:v+1,dynamics:m,optionals:S})}}if(d&&l)return Ie(l,d)?d:l;if(d)return d;if(l)return l;if(s&&u){let h=u.index;for(let f=0;f<u.index;f++)h+=n[f].length;const c=h===e.length?"/":e.slice(h);return{node:u.node,skipped:u.skipped,"**":decodeURIComponent(c)}}return null}function Ie(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===Ce)>(e.node.kind===Ce)||n.node.kind===Ce==(e.node.kind===Ce)&&n.depth>e.depth))):!0}function Je(e){return an(e.filter(n=>n!==void 0).join("/"))}function an(e){return e.replace(/\/{2,}/g,"/")}function _s(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function he(e){const n=e.length;return n>1&&e[n-1]==="/"?e.replace(/\/{1,}$/,""):e}function Ps(e){return he(_s(e))}function at(e,n){return e?.endsWith("/")&&e!=="/"&&e!==`${n}/`?e.slice(0,-1):e}function ci(e,n,t){return at(e,t)===at(n,t)}function di({base:e,to:n,trailingSlash:t="never",cache:s}){const o=n.startsWith("/"),i=!o&&n===".";let r;if(s){r=o?n:i?e:e+"\0"+n;const h=s.get(r);if(h)return h}let a;if(i)a=e.split("/");else if(o)a=n.split("/");else{for(a=e.split("/");a.length>1&&ot(a)==="";)a.pop();const h=n.split("/");for(let c=0,f=h.length;c<f;c++){const g=h[c];g===""?c?c===f-1&&a.push(g):a=[g]:g===".."?a.pop():g==="."||a.push(g)}}a.length>1&&(ot(a)===""?t==="never"&&a.pop():t==="always"&&a.push(""));let l,u="";for(let h=0;h<a.length;h++){h>0&&(u+="/");const c=a[h];if(!c)continue;l=on(c,0,l);const f=l[0];if(f===xe){u+=c;continue}const g=l[5],p=c.substring(0,l[1]),v=c.substring(l[4],g),m=c.substring(l[2],l[3]);f===me?u+=p||v?`${p}{$${m}}${v}`:`$${m}`:f===ve?u+=p||v?`${p}{$}${v}`:"$":u+=`${p}{-$${m}}${v}`}u=an(u);const d=u||"/";return r&&s&&s.set(r,d),d}function Rt(e,n,t){const s=n[e];return typeof s!="string"?s:e==="_splat"?encodeURI(s):hi(s,t)}function Ct({path:e,params:n,decodeCharMap:t}){let s=!1;const o={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:o,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:o,isMissingParams:s};const i=e.length;let r=0,a,l="";for(;r<i;){const d=r;a=on(e,d,a);const h=a[5];if(r=h+1,d===h)continue;const c=a[0];if(c===xe){l+="/"+e.substring(d,h);continue}if(c===ve){const f=n._splat;o._splat=f,o["*"]=f;const g=e.substring(d,a[1]),p=e.substring(a[4],h);if(!f){s=!0,(g||p)&&(l+="/"+g+p);continue}const v=Rt("_splat",n,t);l+="/"+g+v+p;continue}if(c===me){const f=e.substring(a[2],a[3]);!s&&!(f in n)&&(s=!0),o[f]=n[f];const g=e.substring(d,a[1]),p=e.substring(a[4],h),v=Rt(f,n,t)??"undefined";l+="/"+g+v+p;continue}if(c===ze){const f=e.substring(a[2],a[3]),g=n[f];if(g==null)continue;o[f]=g;const p=e.substring(d,a[1]),v=e.substring(a[4],h),m=Rt(f,n,t)??"";l+="/"+p+m+v;continue}}return e.endsWith("/")&&(l+="/"),{usedParams:o,interpolatedPath:l||"/",isMissingParams:s}}function hi(e,n){let t=encodeURIComponent(e);if(n)for(const[s,o]of n)t=t.replaceAll(s,o);return t}function j(e){return!!e?.isNotFound}function fi(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const lt="tsr-scroll-restoration-v1_3",gi=(e,n)=>{let t;return(...s)=>{t||(t=setTimeout(()=>{e(...s),t=null},n))}};function pi(){const e=fi();if(!e)return null;const n=e.getItem(lt);let t=n?JSON.parse(n):{};return{state:t,set:s=>{t=te(s,t)||t;try{e.setItem(lt,JSON.stringify(t))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const qe=pi(),Nt=e=>e.state.__TSR_key||e.href;function mi(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 ut=!1;function xs({storageKey:e,key:n,behavior:t,shouldScrollRestoration:s,scrollToTopSelectors:o,location:i}){let r;try{r=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(u){console.error(u);return}const a=n||window.history.state?.__TSR_key,l=r[a];ut=!0;e:{if(s&&l&&Object.keys(l).length>0){for(const h in l){const c=l[h];if(h==="window")window.scrollTo({top:c.scrollY,left:c.scrollX,behavior:t});else if(h){const f=document.querySelector(h);f&&(f.scrollLeft=c.scrollX,f.scrollTop=c.scrollY)}}break e}const u=(i??window.location).hash.split("#",2)[1];if(u){const h=window.history.state?.__hashScrollIntoViewOptions??!0;if(h){const c=document.getElementById(u);c&&c.scrollIntoView(h)}break e}const d={top:0,left:0,behavior:t};if(window.scrollTo(d),o)for(const h of o){if(h==="window")continue;const c=typeof h=="function"?h():document.querySelector(h);c&&c.scrollTo(d)}}ut=!1}function vi(e,n){if(!qe&&!e.isServer||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isServer||e.isScrollRestorationSetup||!qe))return;e.isScrollRestorationSetup=!0,ut=!1;const s=e.options.getScrollRestorationKey||Nt;window.history.scrollRestoration="manual";const o=i=>{if(ut||!e.isScrollRestoring)return;let r="";if(i.target===document||i.target===window)r="window";else{const l=i.target.getAttribute("data-scroll-restoration-id");l?r=`[data-scroll-restoration-id="${l}"]`:r=mi(i.target)}const a=s(e.state.location);qe.set(l=>{const u=l[a]||={},d=u[r]||={};if(r==="window")d.scrollX=window.scrollX||0,d.scrollY=window.scrollY||0;else if(r){const h=document.querySelector(r);h&&(d.scrollX=h.scrollLeft||0,d.scrollY=h.scrollTop||0)}return l})};typeof document<"u"&&document.addEventListener("scroll",gi(o,100),!0),e.subscribe("onRendered",i=>{const r=s(i.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(xs({storageKey:lt,key:r,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&qe.set(a=>(a[r]||={},a)))})}function Si(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 yi(e,n=String){const t=new URLSearchParams;for(const s in e){const o=e[s];o!==void 0&&t.set(s,n(o))}return t.toString()}function _t(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function wi(e){const n=new URLSearchParams(e),t={};for(const[s,o]of n.entries()){const i=t[s];i==null?t[s]=_t(o):Array.isArray(i)?i.push(_t(o)):t[s]=[i,_t(o)]}return t}const Ri=_i(JSON.parse),Ci=Pi(JSON.stringify,JSON.parse);function _i(e){return n=>{n[0]==="?"&&(n=n.substring(1));const t=wi(n);for(const s in t){const o=t[s];if(typeof o=="string")try{t[s]=e(o)}catch{}}return t}}function Pi(e,n){const t=typeof n=="function";function s(o){if(typeof o=="object"&&o!==null)try{return e(o)}catch{}else if(t&&typeof o=="string")try{return n(o),e(o)}catch{}return o}return o=>{const i=yi(o,s);return i?`?${i}`:""}}const B="__root__";function xi(e){if(e.statusCode=e.statusCode||e.code||307,!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 q(e){return e instanceof Response&&!!e.options}const Ze=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},ht=(e,n)=>!!(e.preload&&!e.router.state.matches.some(t=>t.id===n)),ln=(e,n,t=!0)=>{const s={...e.router.options.context??{}},o=t?n:n-1;for(let i=0;i<=o;i++){const r=e.matches[i];if(!r)continue;const a=e.router.getMatch(r.id);a&&Object.assign(s,a.__routeContext,a.__beforeLoadContext)}return s},Ms=(e,n)=>{const t=e.router.routesById[n.routeId??""]??e.router.routeTree;!t.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(t.options.notFoundComponent=e.router.options.defaultNotFoundComponent),ee(t.options.notFoundComponent);const s=e.matches.find(o=>o.routeId===t.id);ee(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,Ms(e,n))},ne=(e,n,t)=>{if(!(!q(t)&&!j(t))){if(q(t)&&t.redirectHandled&&!t.options.reloadDocument)throw t;if(n){n._nonReactive.beforeLoadPromise?.resolve(),n._nonReactive.loaderPromise?.resolve(),n._nonReactive.beforeLoadPromise=void 0,n._nonReactive.loaderPromise=void 0;const s=q(t)?"redirected":"notFound";n._nonReactive.error=t,e.updateMatch(n.id,o=>({...o,status:s,isFetching:!1,error:t})),j(t)&&!t.routeId&&(t.routeId=n.routeId),n._nonReactive.loadPromise?.resolve()}throw q(t)?(e.rendered=!0,t.options._fromLocation=e.location,t.redirectHandled=!0,t=e.router.resolveRedirect(t),t):(Ms(e,t),t)}},Fs=(e,n)=>{const t=e.router.getMatch(n);return!!(!e.router.isServer&&t._nonReactive.dehydrated||e.router.isServer&&t.ssr===!1)},be=(e,n,t,s)=>{const{id:o,routeId:i}=e.matches[n],r=e.router.looseRoutesById[i];if(t instanceof Promise)throw t;t.routerCode=s,e.firstBadMatchIndex??=n,ne(e,e.router.getMatch(o),t);try{r.options.onError?.(t)}catch(a){t=a,ne(e,e.router.getMatch(o),t)}e.updateMatch(o,a=>(a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,a._nonReactive.loadPromise?.resolve(),{...a,error:t,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},Mi=(e,n,t,s)=>{const o=e.router.getMatch(n),i=e.matches[t-1]?.id,r=i?e.router.getMatch(i):void 0;if(e.router.isShell()){o.ssr=s.id===B;return}if(r?.ssr===!1){o.ssr=!1;return}const a=f=>f===!0&&r?.ssr==="data-only"?"data-only":f,l=e.router.options.defaultSsr??!0;if(s.options.ssr===void 0){o.ssr=a(l);return}if(typeof s.options.ssr!="function"){o.ssr=a(s.options.ssr);return}const{search:u,params:d}=o,h={search:Ke(u,o.searchError),params:Ke(d,o.paramsError),location:e.location,matches:e.matches.map(f=>({index:f.index,pathname:f.pathname,fullPath:f.fullPath,staticData:f.staticData,id:f.id,routeId:f.routeId,search:Ke(f.search,f.searchError),params:Ke(f.params,f.paramsError),ssr:f.ssr}))},c=s.options.ssr(h);if(re(c))return c.then(f=>{o.ssr=a(f??l)});o.ssr=a(c??l)},Is=(e,n,t,s)=>{if(s._nonReactive.pendingTimeout!==void 0)return;const o=t.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!e.router.isServer&&!ht(e,n)&&(t.options.loader||t.options.beforeLoad||Ls(t))&&typeof o=="number"&&o!==1/0&&(t.options.pendingComponent??e.router.options?.defaultPendingComponent))){const r=setTimeout(()=>{Ze(e)},o);s._nonReactive.pendingTimeout=r}},Fi=(e,n,t)=>{const s=e.router.getMatch(n);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;Is(e,n,t,s);const o=()=>{const i=e.router.getMatch(n);i.preload&&(i.status==="redirected"||i.status==="notFound")&&ne(e,i,i.error)};return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(o):o()},Ii=(e,n,t,s)=>{const o=e.router.getMatch(n),i=o._nonReactive.loadPromise;o._nonReactive.loadPromise=Pe(()=>{i?.resolve()});const{paramsError:r,searchError:a}=o;r&&be(e,t,r,"PARSE_PARAMS"),a&&be(e,t,a,"VALIDATE_SEARCH"),Is(e,n,s,o);const l=new AbortController,u=e.matches[t-1]?.id;(u?e.router.getMatch(u):void 0)?.context??e.router.options.context;let h=!1;const c=()=>{h||(h=!0,e.updateMatch(n,R=>({...R,isFetching:"beforeLoad",fetchCount:R.fetchCount+1,abortController:l})))},f=()=>{o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,e.updateMatch(n,R=>({...R,isFetching:!1}))};if(!s.options.beforeLoad){De(()=>{c(),f()});return}o._nonReactive.beforeLoadPromise=Pe();const g={...ln(e,t,!1),...o.__routeContext},{search:p,params:v,cause:m}=o,S=ht(e,n),y={search:p,abortController:l,params:v,preload:S,context:g,location:e.location,navigate:R=>e.router.navigate({...R,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:S?"preload":m,matches:e.matches,...e.router.options.additionalContext},w=R=>{if(R===void 0){De(()=>{c(),f()});return}(q(R)||j(R))&&(c(),be(e,t,R,"BEFORE_LOAD")),De(()=>{c(),e.updateMatch(n,_=>({..._,__beforeLoadContext:R})),f()})};let x;try{if(x=s.options.beforeLoad(y),re(x))return c(),x.catch(R=>{be(e,t,R,"BEFORE_LOAD")}).then(w)}catch(R){c(),be(e,t,R,"BEFORE_LOAD")}w(x)},bi=(e,n)=>{const{id:t,routeId:s}=e.matches[n],o=e.router.looseRoutesById[s],i=()=>{if(e.router.isServer){const l=Mi(e,t,n,o);if(re(l))return l.then(a)}return a()},r=()=>Ii(e,t,n,o),a=()=>{if(Fs(e,t))return;const l=Fi(e,t,o);return re(l)?l.then(r):r()};return i()},Ei=(e,n,t)=>{const s=e.router.getMatch(n);if(!s||!t.options.head&&!t.options.scripts&&!t.options.headers)return;const o={matches:e.matches,match:s,params:s.params,loaderData:s.loaderData};return Promise.all([t.options.head?.(o),t.options.scripts?.(o),t.options.headers?.(o)]).then(([i,r,a])=>{const l=i?.meta,u=i?.links,d=i?.scripts,h=i?.styles;return{meta:l,links:u,headScripts:d,headers:a,scripts:r,styles:h}})},bs=(e,n,t,s)=>{const o=e.matchPromises[t-1],{params:i,loaderDeps:r,abortController:a,cause:l}=e.router.getMatch(n),u=ln(e,t),d=ht(e,n);return{params:i,deps:r,preload:!!d,parentMatchPromise:o,abortController:a,context:u,location:e.location,navigate:h=>e.router.navigate({...h,_fromLocation:e.location}),cause:d?"preload":l,route:s,...e.router.options.additionalContext}},Un=async(e,n,t,s)=>{try{const o=e.router.getMatch(n);try{(!e.router.isServer||o.ssr===!0)&&Es(s);const i=s.options.loader?.(bs(e,n,t,s)),r=s.options.loader&&re(i);if((r||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||o._nonReactive.minPendingPromise)&&e.updateMatch(n,u=>({...u,isFetching:"loader"})),s.options.loader){const u=r?await i:i;ne(e,e.router.getMatch(n),u),u!==void 0&&e.updateMatch(n,d=>({...d,loaderData:u}))}s._lazyPromise&&await s._lazyPromise;const l=o._nonReactive.minPendingPromise;l&&await l,s._componentsPromise&&await s._componentsPromise,e.updateMatch(n,u=>({...u,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(i){let r=i;const a=o._nonReactive.minPendingPromise;a&&await a,j(i)&&await s.options.notFoundComponent?.preload?.(),ne(e,e.router.getMatch(n),i);try{s.options.onError?.(i)}catch(l){r=l,ne(e,e.router.getMatch(n),l)}e.updateMatch(n,l=>({...l,error:r,status:"error",isFetching:!1}))}}catch(o){const i=e.router.getMatch(n);i&&(i._nonReactive.loaderPromise=void 0),ne(e,i,o)}},Li=async(e,n)=>{const{id:t,routeId:s}=e.matches[n];let o=!1,i=!1;const r=e.router.looseRoutesById[s],a=()=>{e.updateMatch(t,d=>({...d,context:ln(e,n)}))};if(Fs(e,t)){if(e.router.isServer)return e.router.getMatch(t)}else{const d=e.router.getMatch(t);if(d._nonReactive.loaderPromise){if(d.status==="success"&&!e.sync&&!d.preload)return d;await d._nonReactive.loaderPromise;const h=e.router.getMatch(t),c=h._nonReactive.error||h.error;c&&ne(e,h,c)}else{const h=Date.now()-d.updatedAt,c=ht(e,t),f=c?r.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:r.options.staleTime??e.router.options.defaultStaleTime??0,g=r.options.shouldReload,p=typeof g=="function"?g(bs(e,t,n,r)):g,v=!!c&&!e.router.state.matches.some(w=>w.id===t),m=e.router.getMatch(t);m._nonReactive.loaderPromise=Pe(),v!==m.preload&&e.updateMatch(t,w=>({...w,preload:v}));const{status:S,invalid:y}=m;o=S==="success"&&(y||(p??h>f)),c&&r.options.preload===!1||(o&&!e.sync?(i=!0,(async()=>{try{await Un(e,t,n,r),a();const w=e.router.getMatch(t);w._nonReactive.loaderPromise?.resolve(),w._nonReactive.loadPromise?.resolve(),w._nonReactive.loaderPromise=void 0}catch(w){q(w)&&await e.router.navigate(w.options)}})()):(S!=="success"||o&&e.sync)&&await Un(e,t,n,r))}}const l=e.router.getMatch(t);i||(l._nonReactive.loaderPromise?.resolve(),l._nonReactive.loadPromise?.resolve()),clearTimeout(l._nonReactive.pendingTimeout),l._nonReactive.pendingTimeout=void 0,i||(l._nonReactive.loaderPromise=void 0),l._nonReactive.dehydrated=void 0,i||a();const u=i?l.isFetching:!1;return u!==l.isFetching||l.invalid!==!1?(e.updateMatch(t,d=>({...d,isFetching:u,invalid:!1})),e.router.getMatch(t)):l};async function Gn(e){const n=Object.assign(e,{matchPromises:[]});!n.router.isServer&&n.router.state.matches.some(t=>t._forcePending)&&Ze(n);try{for(let a=0;a<n.matches.length;a++){const l=bi(n,a);re(l)&&await l}const t=n.firstBadMatchIndex??n.matches.length;for(let a=0;a<t;a++)n.matchPromises.push(Li(n,a));const o=(await Promise.allSettled(n.matchPromises)).filter(a=>a.status==="rejected").map(a=>a.reason);let i;for(const a of o){if(q(a))throw a;!i&&j(a)&&(i=a)}for(const a of n.matches){const{id:l,routeId:u}=a,d=n.router.looseRoutesById[u];try{const h=Ei(n,l,d);if(h){const c=await h;n.updateMatch(l,f=>({...f,...c}))}}catch(h){console.error(`Error executing head for route ${u}:`,h)}}if(i)throw i;const r=Ze(n);re(r)&&await r}catch(t){if(j(t)&&!n.preload){const s=Ze(n);throw re(s)&&await s,t}if(q(t))throw t}return n.matches}async function Es(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=()=>{const t=[];for(const s of Os){const o=e.options[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 Ke(e,n){return n?{status:"error",error:n}:{status:"success",value:e}}function Ls(e){for(const n of Os)if(e.options[n]?.preload)return!0;return!1}const Os=["component","errorComponent","pendingComponent","notFoundComponent"];function Oi(e){return{input:({url:n})=>{for(const t of e)n=Ts(t,n);return n},output:({url:n})=>{for(let t=e.length-1;t>=0;t--)n=$s(e[t],n);return n}}}function Ti(e){const n=Ps(e.basepath),t=`/${n}`,s=`${t}/`,o=e.caseSensitive?t:t.toLowerCase(),i=e.caseSensitive?s:s.toLowerCase();return{input:({url:r})=>{const a=e.caseSensitive?r.pathname:r.pathname.toLowerCase();return a===o?r.pathname="/":a.startsWith(i)&&(r.pathname=r.pathname.slice(t.length)),r},output:({url:r})=>(r.pathname=Je(["/",n,r.pathname]),r)}}function Ts(e,n){const t=e?.input?.({url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function $s(e,n){const t=e?.output?.({url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function fe(e){const n=e.resolvedLocation,t=e.location,s=n?.pathname!==t.pathname,o=n?.href!==t.href,i=n?.hash!==t.hash;return{fromLocation:n,toLocation:t,pathChanged:s,hrefChanged:o,hashChanged:i}}class $i{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=>{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,o=this.basepath??s?.basepath??"/",i=this.basepath===void 0,r=s?.rewrite;this.options={...s,...t},this.isServer=this.options.isServer??typeof document>"u",this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(c=>[encodeURIComponent(c),c])):void 0,(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.isServer||(this.history=Go())),this.origin=this.options.origin,this.origin||(!this.isServer&&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,this.buildRouteTree()),!this.__store&&this.latestLocation&&(this.__store=new Ho(Ai(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(c=>!["redirected"].includes(c.status))}}}),vi(this));let a=!1;const l=this.options.basepath??"/",u=this.options.rewrite;if(i||o!==l||r!==u){this.basepath=l;const c=[];Ps(l)!==""&&c.push(Ti({basepath:l})),u&&c.push(u),this.rewrite=c.length===0?void 0:c.length===1?c[0]:Oi(c),this.history&&this.updateLatestLocation(),a=!0}a&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.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{routesById:t,routesByPath:s,processedTree:o}=ii(this.routeTree,this.options.caseSensitive,(r,a)=>{r.init({originalIndex:a})});this.options.routeMasks&&ei(this.options.routeMasks,o),this.routesById=t,this.routesByPath=s,this.processedTree=o;const i=this.options.notFoundRoute;i&&(i.init({originalIndex:99999999999}),this.routesById[i.id]=i)},this.subscribe=(t,s)=>{const o={eventType:t,fn:s};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=t=>{this.subscribers.forEach(s=>{s.eventType===t.type&&s.fn(t)})},this.parseLocation=(t,s)=>{const o=({href:l,state:u})=>{const d=new URL(l,this.origin),h=Ts(this.rewrite,d),c=this.options.parseSearch(h.search),f=this.options.stringifySearch(c);return h.search=f,{href:h.href.replace(h.origin,""),publicHref:l,url:h,pathname:Hn(h.pathname),searchStr:f,search:G(s?.search,c),hash:h.hash.split("#").reverse()[0]??"",state:G(s?.state,u)}},i=o(t),{__tempLocation:r,__tempKey:a}=i.state;if(r&&(!a||a===this.tempLocationKey)){const l=o(r);return l.state.key=i.state.key,l.state.__TSR_key=i.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:i}}return i},this.resolvePathCache=rt(1e3),this.resolvePathWithBase=(t,s)=>di({base:t,to:an(s),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,s,o)=>typeof t=="string"?this.matchRoutesInternal({pathname:t,search:s},o):this.matchRoutesInternal(t,s),this.getMatchedRoutes=t=>ki({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(i=>i.status==="pending"),s=this.state.matches.filter(i=>i.isFetching==="loader");new Set([...this.state.pendingMatches??[],...t,...s]).forEach(i=>{this.cancelMatch(i.id)})},this.buildLocation=t=>{const s=(i={})=>{const r=i._fromLocation||this.pendingBuiltLocation||this.latestLocation,a=this.matchRoutes(r,{_buildLocation:!0}),l=ot(a);i.from;const u=i.unsafeRelative==="path"?r.pathname:i.from??l.fullPath,d=this.resolvePathWithBase(u,"."),h=l.search,c={...l.params},f=i.to?this.resolvePathWithBase(d,`${i.to}`):this.resolvePathWithBase(d,"."),g=i.params===!1||i.params===null?{}:(i.params??!0)===!0?c:Object.assign(c,te(i.params,c)),p=Ct({path:f,params:g}).interpolatedPath,v=this.matchRoutes(p,void 0,{_buildLocation:!0}).map(E=>this.looseRoutesById[E.routeId]);if(Object.keys(g).length>0)for(const E of v){const L=E.options.params?.stringify??E.options.stringifyParams;L&&Object.assign(g,L(g))}const m=t.leaveParams?f:Hn(Ct({path:f,params:g,decodeCharMap:this.pathParamsDecodeCharMap}).interpolatedPath);let S=h;if(t._includeValidateSearch&&this.options.search?.strict){const E={};v.forEach(L=>{if(L.options.validateSearch)try{Object.assign(E,qt(L.options.validateSearch,{...E,...S}))}catch{}}),S=E}S=Vi({search:S,dest:i,destRoutes:v,_includeValidateSearch:t._includeValidateSearch}),S=G(h,S);const y=this.options.stringifySearch(S),w=i.hash===!0?r.hash:i.hash?te(i.hash,r.hash):void 0,x=w?`#${w}`:"";let R=i.state===!0?r.state:i.state?te(i.state,r.state):{};R=G(r.state,R);const _=`${m}${y}${x}`,C=new URL(_,this.origin),F=$s(this.rewrite,C);return{publicHref:F.pathname+F.search+F.hash,href:_,url:F,pathname:m,search:S,searchStr:y,state:R,hash:w??"",unmaskOnReload:i.unmaskOnReload}},o=(i={},r)=>{const a=s(i);let l=r?s(r):void 0;if(!l){const u={};if(this.options.routeMasks){const d=ti(a.pathname,this.processedTree);if(d){Object.assign(u,d.params);const{from:h,params:c,...f}=d.route,g=c===!1||c===null?{}:(c??!0)===!0?u:Object.assign(u,te(c,u));r={from:t.from,...f,params:g},l=s(r)}}}return l&&(a.maskedLocation=l),a};return t.mask?o(t,{from:t.from,...t.mask}):o(t)},this.commitLocation=({viewTransition:t,ignoreBlocker:s,...o})=>{const i=()=>{const l=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];l.forEach(d=>{o.state[d]=this.latestLocation.state[d]});const u=de(o.state,this.latestLocation.state);return l.forEach(d=>{delete o.state[d]}),u},r=he(this.latestLocation.href)===he(o.href),a=this.commitLocationPromise;if(this.commitLocationPromise=Pe(()=>{a?.resolve()}),r&&i())this.load();else{let{maskedLocation:l,hashScrollIntoView:u,url:d,...h}=o;l&&(h={...l,state:{...l.state,__tempKey:void 0,__tempLocation:{...h,search:h.searchStr,state:{...h.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(h.unmaskOnReload??this.options.unmaskOnReload??!1)&&(h.state.__tempKey=this.tempLocationKey)),h.state.__hashScrollIntoViewOptions=u??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[o.replace?"replace":"push"](h.publicHref,h.state,{ignoreBlocker:s})}return this.resetNextScroll=o.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:t,resetScroll:s,hashScrollIntoView:o,viewTransition:i,ignoreBlocker:r,href:a,...l}={})=>{if(a){const h=this.history.location.state.__TSR_index,c=st(a,{__TSR_index:t?h:h+1});l.to=c.pathname,l.search=this.options.parseSearch(c.search),l.hash=c.hash.slice(1)}const u=this.buildLocation({...l,_includeValidateSearch:!0});this.pendingBuiltLocation=u;const d=this.commitLocation({...u,viewTransition:i,replace:t,resetScroll:s,hashScrollIntoView:o,ignoreBlocker:r});return Promise.resolve().then(()=>{this.pendingBuiltLocation===u&&(this.pendingBuiltLocation=void 0)}),d},this.navigate=async({to:t,reloadDocument:s,href:o,publicHref:i,...r})=>{let a=!1;if(o)try{new URL(`${o}`),a=!0}catch{}if(a&&!s&&(s=!0),s){if(!o||!i&&!a){const u=this.buildLocation({to:t,...r});o=o??u.url.href,i=i??u.url.href}const l=!a&&i?i:o;if(!r.ignoreBlocker){const d=this.history.getBlockers?.()??[];for(const h of d)if(h?.blockerFn&&await h.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return r.replace?window.location.replace(l):window.location.href=l,Promise.resolve()}return this.buildAndCommitLocation({...r,href:o,to:t,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),this.isServer){const s=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(this.latestLocation.publicHref!==s.publicHref||s.url.origin!==this.origin){const o=this.getParsedLocationHref(s);throw xi({href:o})}}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(o=>!t.some(i=>i.id===o.id))}))},this.load=async t=>{let s,o,i;for(i=new Promise(a=>{this.startTransition(async()=>{try{this.beforeLoad();const l=this.latestLocation,u=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...fe({resolvedLocation:u,location:l})}),this.emit({type:"onBeforeLoad",...fe({resolvedLocation:u,location:l})}),await Gn({router:this,sync:t?.sync,matches:this.state.pendingMatches,location:l,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let d=[],h=[],c=[];De(()=>{this.__store.setState(f=>{const g=f.matches,p=f.pendingMatches||f.matches;return d=g.filter(v=>!p.some(m=>m.id===v.id)),h=p.filter(v=>!g.some(m=>m.id===v.id)),c=p.filter(v=>g.some(m=>m.id===v.id)),{...f,isLoading:!1,loadedAt:Date.now(),matches:p,pendingMatches:void 0,cachedMatches:[...f.cachedMatches,...d.filter(v=>v.status!=="error"&&v.status!=="notFound")]}}),this.clearExpiredCache()}),[[d,"onLeave"],[h,"onEnter"],[c,"onStay"]].forEach(([f,g])=>{f.forEach(p=>{this.looseRoutesById[p.routeId].options[g]?.(p)})})})})}})}catch(l){q(l)?(s=l,this.isServer||this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):j(l)&&(o=l),this.__store.setState(u=>({...u,statusCode:s?s.status:o?404:u.matches.some(d=>d.status==="error")?500:200,redirect:s}))}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),a()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let r;this.hasNotFoundMatch()?r=404:this.__store.state.matches.some(a=>a.status==="error")&&(r=500),r!==void 0&&this.__store.setState(a=>({...a,statusCode:r}))},this.startViewTransition=t=>{const s=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let o;if(typeof s=="object"&&this.isViewTransitionTypesSupported){const i=this.latestLocation,r=this.state.resolvedLocation,a=typeof s.types=="function"?s.types(fe({resolvedLocation:r,location:i})):s.types;if(a===!1){t();return}o={update:t,types:a}}else o=t;document.startViewTransition(o)}else t()},this.updateMatch=(t,s)=>{this.startTransition(()=>{const o=this.state.pendingMatches?.some(i=>i.id===t)?"pendingMatches":this.state.matches.some(i=>i.id===t)?"matches":this.state.cachedMatches.some(i=>i.id===t)?"cachedMatches":"";o&&this.__store.setState(i=>({...i,[o]:i[o]?.map(r=>r.id===t?s(r):r)}))})},this.getMatch=t=>{const s=o=>o.id===t;return this.state.cachedMatches.find(s)??this.state.pendingMatches?.find(s)??this.state.matches.find(s)},this.invalidate=t=>{const s=o=>t?.filter?.(o)??!0?{...o,invalid:!0,...t?.forcePending||o.status==="error"||o.status==="notFound"?{status:"pending",error:void 0}:void 0}:o;return this.__store.setState(o=>({...o,matches:o.matches.map(s),cachedMatches:o.cachedMatches.map(s),pendingMatches:o.pendingMatches?.map(s)})),this.shouldViewTransition=!1,this.load({sync:t?.sync})},this.getParsedLocationHref=t=>{let s=t.url.href;return this.origin&&t.url.origin===this.origin&&(s=s.replace(this.origin,"")||"/"),s},this.resolveRedirect=t=>{if(!t.options.href){const s=this.buildLocation(t.options),o=this.getParsedLocationHref(s);t.options.href=s.href,t.headers.set("Location",o)}return t.headers.get("Location")||t.headers.set("Location",t.options.href),t},this.clearCache=t=>{const s=t?.filter;s!==void 0?this.__store.setState(o=>({...o,cachedMatches:o.cachedMatches.filter(i=>!s(i))})):this.__store.setState(o=>({...o,cachedMatches:[]}))},this.clearExpiredCache=()=>{const t=s=>{const o=this.looseRoutesById[s.routeId];if(!o.options.loader)return!0;const i=(s.preload?o.options.preloadGcTime??this.options.defaultPreloadGcTime:o.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:Date.now()-s.updatedAt>=i};this.clearCache({filter:t})},this.loadRouteChunk=Es,this.preloadRoute=async t=>{const s=this.buildLocation(t);let o=this.matchRoutes(s,{throwOnError:!0,preload:!0,dest:t});const i=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(a=>a.id)),r=new Set([...i,...this.state.cachedMatches.map(a=>a.id)]);De(()=>{o.forEach(a=>{r.has(a.id)||this.__store.setState(l=>({...l,cachedMatches:[...l.cachedMatches,a]}))})});try{return o=await Gn({router:this,matches:o,location:s,preload:!0,updateMatch:(a,l)=>{i.has(a)?o=o.map(u=>u.id===a?l(u):u):this.updateMatch(a,l)}}),o}catch(a){if(q(a))return a.options.reloadDocument?void 0:await this.preloadRoute({...a.options,_fromLocation:s});j(a)||console.error(a);return}},this.matchRoute=(t,s)=>{const o={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},i=this.buildLocation(o);if(s?.pending&&this.state.status!=="pending")return!1;const a=(s?.pending===void 0?!this.state.isLoading:s.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,l=ni(i.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,a.pathname,this.processedTree);return!l||t.params&&!de(l.params,t.params,{partial:!0})?!1:s?.includeSearch??!0?de(a.search,i.search,{partial:!0})?l.params:!1:l.params},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??Ci,parseSearch:n.parseSearch??Ri}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(n,t){const s=this.getMatchedRoutes(n.pathname),{foundRoute:o,routeParams:i}=s;let{matchedRoutes:r}=s,a=!1;(o?o.path!=="/"&&i["**"]:he(n.pathname))&&(this.options.notFoundRoute?r=[...r,this.options.notFoundRoute]:a=!0);const l=(()=>{if(a){if(this.options.notFoundMode!=="root")for(let h=r.length-1;h>=0;h--){const c=r[h];if(c.children)return c.id}return B}})(),u=[],d=h=>h?.id?h.context??this.options.context??void 0:this.options.context??void 0;return r.forEach((h,c)=>{const f=u[c-1],[g,p,v]=(()=>{const D=f?.search??n.search,K=f?._strictSearch??void 0;try{const W=qt(h.options.validateSearch,{...D})??void 0;return[{...D,...W},{...K,...W},void 0]}catch(W){let Se=W;if(W instanceof ct||(Se=new ct(W.message,{cause:W})),t?.throwOnError)throw Se;return[D,{},Se]}})(),m=h.options.loaderDeps?.({search:g})??"",S=m?JSON.stringify(m):"",{interpolatedPath:y,usedParams:w}=Ct({path:h.fullPath,params:i,decodeCharMap:this.pathParamsDecodeCharMap}),x=h.id+y+S,R=this.getMatch(x),_=this.state.matches.find(D=>D.routeId===h.id),C=R?._strictParams??w;let F;if(!R){const D=h.options.params?.parse??h.options.parseParams;if(D)try{Object.assign(C,D(C))}catch(K){if(j(K)||q(K)?F=K:F=new Di(K.message,{cause:K}),t?.throwOnError)throw F}}Object.assign(i,C);const E=_?"stay":"enter";let L;if(R)L={...R,cause:E,params:_?G(_.params,i):i,_strictParams:C,search:G(_?_.search:R.search,g),_strictSearch:p};else{const D=h.options.loader||h.options.beforeLoad||h.lazyFn||Ls(h)?"pending":"success";L={id:x,ssr:this.isServer?void 0:h.options.ssr,index:c,routeId:h.id,params:_?G(_.params,i):i,_strictParams:C,pathname:y,updatedAt:Date.now(),search:_?G(_.search,g):g,_strictSearch:p,searchError:void 0,status:D,isFetching:!1,error:void 0,paramsError:F,__routeContext:void 0,_nonReactive:{loadPromise:Pe()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:E,loaderDeps:_?G(_.loaderDeps,m):m,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:h.options.staticData||{},fullPath:h.fullPath}}t?.preload||(L.globalNotFound=l===h.id),L.searchError=v;const $=d(f);L.context={...$,...L.__routeContext,...L.__beforeLoadContext},u.push(L)}),u.forEach((h,c)=>{const f=this.looseRoutesById[h.routeId];if(!this.getMatch(h.id)&&t?._buildLocation!==!0){const p=u[c-1],v=d(p);if(f.options.context){const m={deps:h.loaderDeps,params:h.params,context:v??{},location:n,navigate:S=>this.navigate({...S,_fromLocation:n}),buildLocation:this.buildLocation,cause:h.cause,abortController:h.abortController,preload:!!h.preload,matches:u};h.__routeContext=f.options.context(m)??void 0}h.context={...v,...h.__routeContext,...h.__beforeLoadContext}}}),u}}class ct extends Error{}class Di extends Error{}function Ai(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function qt(e,n){if(e==null)return{};if("~standard"in e){const t=e["~standard"].validate(n);if(t instanceof Promise)throw new ct("Async validation not supported");if(t.issues)throw new ct(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 ki({pathname:e,routesById:n,processedTree:t}){const s={},o=he(e);let i;const r=si(o,t,!0);return r&&(i=r.route,Object.assign(s,r.params)),{matchedRoutes:r?.branch||[n[B]],routeParams:s,foundRoute:i}}function Vi({search:e,dest:n,destRoutes:t,_includeValidateSearch:s}){const o=t.reduce((a,l)=>{const u=[];if("search"in l.options)l.options.search?.middlewares&&u.push(...l.options.search.middlewares);else if(l.options.preSearchFilters||l.options.postSearchFilters){const d=({search:h,next:c})=>{let f=h;"preSearchFilters"in l.options&&l.options.preSearchFilters&&(f=l.options.preSearchFilters.reduce((p,v)=>v(p),h));const g=c(f);return"postSearchFilters"in l.options&&l.options.postSearchFilters?l.options.postSearchFilters.reduce((p,v)=>v(p),g):g};u.push(d)}if(s&&l.options.validateSearch){const d=({search:h,next:c})=>{const f=c(h);try{return{...f,...qt(l.options.validateSearch,f)??void 0}}catch{return f}};u.push(d)}return a.concat(u)},[])??[],i=({search:a})=>n.search?n.search===!0?a:te(n.search,a):{};o.push(i);const r=(a,l)=>{if(a>=o.length)return l;const u=o[a];return u({search:l,next:h=>r(a+1,h)})};return r(0,e)}const zi="Error preloading route! ☝️";class Ds{constructor(n){if(this.init=t=>{this.originalIndex=t.originalIndex;const s=this.options,o=!s?.path&&!s?.id;this.parentRoute=this.options.getParentRoute?.(),o?this._path=B:this.parentRoute||ee(!1);let i=o?B:s?.path;i&&i!=="/"&&(i=_s(i));const r=s?.id||i;let a=o?B:Je([this.parentRoute.id===B?"":this.parentRoute.id,r]);i===B&&(i="/"),a!==B&&(a=Je(["/",a]));const l=a===B?"/":Je([this.parentRoute.fullPath,i]);this._path=i,this._id=a,this._fullPath=l,this._to=l},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.options=n||{},this.isRoot=!n?.getParentRoute,n?.id&&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 Bi extends Ds{constructor(n){super(n)}}function un(e){const n=e.errorComponent??ft;return M.jsx(ji,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:t,reset:s})=>t?P.createElement(n,{error:t,reset:s}):e.children})}class ji extends P.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 ft({error:e}){const[n,t]=P.useState(!1);return M.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[M.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[M.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),M.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"})]}),M.jsx("div",{style:{height:".25rem"}}),n?M.jsx("div",{children:M.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?M.jsx("code",{children:e.message}):null})}):null]})}function Hi({children:e,fallback:n=null}){return Ui()?M.jsx(ke.Fragment,{children:e}):M.jsx(ke.Fragment,{children:n})}function Ui(){return ke.useSyncExternalStore(Gi,()=>!0,()=>!1)}function Gi(){return()=>{}}var Pt={exports:{}},xt={},Mt={exports:{}},Ft={};var Nn;function Ni(){if(Nn)return Ft;Nn=1;var e=ls();function n(h,c){return h===c&&(h!==0||1/h===1/c)||h!==h&&c!==c}var t=typeof Object.is=="function"?Object.is:n,s=e.useState,o=e.useEffect,i=e.useLayoutEffect,r=e.useDebugValue;function a(h,c){var f=c(),g=s({inst:{value:f,getSnapshot:c}}),p=g[0].inst,v=g[1];return i(function(){p.value=f,p.getSnapshot=c,l(p)&&v({inst:p})},[h,f,c]),o(function(){return l(p)&&v({inst:p}),h(function(){l(p)&&v({inst:p})})},[h]),r(f),f}function l(h){var c=h.getSnapshot;h=h.value;try{var f=c();return!t(h,f)}catch{return!0}}function u(h,c){return c()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return Ft.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,Ft}var qn;function qi(){return qn||(qn=1,Mt.exports=Ni()),Mt.exports}var Kn;function Ki(){if(Kn)return xt;Kn=1;var e=ls(),n=qi();function t(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var s=typeof Object.is=="function"?Object.is:t,o=n.useSyncExternalStore,i=e.useRef,r=e.useEffect,a=e.useMemo,l=e.useDebugValue;return xt.useSyncExternalStoreWithSelector=function(u,d,h,c,f){var g=i(null);if(g.current===null){var p={hasValue:!1,value:null};g.current=p}else p=g.current;g=a(function(){function m(R){if(!S){if(S=!0,y=R,R=c(R),f!==void 0&&p.hasValue){var _=p.value;if(f(_,R))return w=_}return w=R}if(_=w,s(y,R))return _;var C=c(R);return f!==void 0&&f(_,C)?(y=R,_):(y=R,w=C)}var S=!1,y,w,x=h===void 0?null:h;return[function(){return m(d())},x===null?void 0:function(){return m(x())}]},[d,h,c,f]);var v=o(u,g[0],g[1]);return r(function(){p.hasValue=!0,p.value=v},[v]),l(v),v},xt}var Wn;function Wi(){return Wn||(Wn=1,Pt.exports=Ki()),Pt.exports}var Qi=Wi();function Xi(e,n=s=>s,t={}){const s=t.equal??Yi;return Qi.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,n,s)}function Yi(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,o]of e)if(!n.has(s)||!Object.is(o,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=Qn(e);if(t.length!==Qn(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 Qn(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const It=P.createContext(null);function As(){return typeof document>"u"?It:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=It,It)}function U(e){const n=P.useContext(As());return e?.warn,n}function z(e){const n=U({warn:e?.router===void 0}),t=e?.router||n,s=P.useRef(void 0);return Xi(t.__store,o=>{if(e?.select){if(e.structuralSharing??t.options.defaultStructuralSharing){const i=G(s.current,e.select(o));return s.current=i,i}return e.select(o)}return o})}const gt=P.createContext(void 0),Ji=P.createContext(void 0);function Y(e){const n=P.useContext(e.from?Ji:gt);return z({select:s=>{const o=s.matches.find(i=>e.from?e.from===i.routeId:i.id===n);if(ee(!((e.shouldThrow??!0)&&!o),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),o!==void 0)return e.select?e.select(o):o},structuralSharing:e.structuralSharing})}function cn(e){return Y({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.loaderData):n.loaderData})}function dn(e){const{select:n,...t}=e;return Y({...t,select:s=>n?n(s.loaderDeps):s.loaderDeps})}function hn(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 fn(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})}const We=typeof window<"u"?P.useLayoutEffect:P.useEffect;function bt(e){const n=P.useRef({value:e,prev:null}),t=n.current.value;return e!==t&&(n.current={value:e,prev:t}),n.current.prev}function Zi(e,n,t={},s={}){P.useEffect(()=>{if(!e.current||s.disabled||typeof IntersectionObserver!="function")return;const o=new IntersectionObserver(([i])=>{n(i)},t);return o.observe(e.current),()=>{o.disconnect()}},[n,t,s.disabled,e])}function er(e){const n=P.useRef(null);return P.useImperativeHandle(e,()=>n.current,[]),n}function gn(e){const n=U();return P.useCallback(t=>n.navigate({...t,from:t.from??e?.from}),[e?.from,n])}function tr(e,n){const t=U(),[s,o]=P.useState(!1),i=P.useRef(!1),r=er(n),{activeProps:a,inactiveProps:l,activeOptions:u,to:d,preload:h,preloadDelay:c,hashScrollIntoView:f,replace:g,startTransition:p,resetScroll:v,viewTransition:m,children:S,target:y,disabled:w,style:x,className:R,onClick:_,onFocus:C,onMouseEnter:F,onMouseLeave:E,onTouchStart:L,ignoreBlocker:$,params:D,search:K,hash:W,state:Se,mask:Xs,reloadDocument:Ca,unsafeRelative:_a,from:Pa,_fromLocation:xa,...Sn}=e,Ys=z({select:O=>O.location.search,structuralSharing:!0}),yn=e.from,Fe=P.useMemo(()=>({...e,from:yn}),[t,Ys,yn,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),J=P.useMemo(()=>t.buildLocation({...Fe}),[t,Fe]),Be=P.useMemo(()=>{if(w)return;let O=J.maskedLocation?J.maskedLocation.url.href:J.url.href,A=!1;return t.origin&&(O.startsWith(t.origin)?O=t.history.createHref(O.replace(t.origin,""))||"/":A=!0),{href:O,external:A}},[w,J.maskedLocation,J.url,t.origin,t.history]),je=P.useMemo(()=>{if(Be?.external)return Be.href;try{return new URL(d),d}catch{}},[d,Be]),ye=e.reloadDocument||je?!1:h??t.options.defaultPreload,mt=c??t.options.defaultPreloadDelay??0,vt=z({select:O=>{if(je)return!1;if(u?.exact){if(!ci(O.location.pathname,J.pathname,t.basepath))return!1}else{const A=at(O.location.pathname,t.basepath),Q=at(J.pathname,t.basepath);if(!(A.startsWith(Q)&&(A.length===Q.length||A[Q.length]==="/")))return!1}return(u?.includeSearch??!0)&&!de(O.location.search,J.search,{partial:!u?.exact,ignoreUndefined:!u?.explicitUndefined})?!1:u?.includeHash?O.location.hash===J.hash:!0}}),le=P.useCallback(()=>{t.preloadRoute({...Fe}).catch(O=>{console.warn(O),console.warn(zi)})},[t,Fe]),Js=P.useCallback(O=>{O?.isIntersecting&&le()},[le]);Zi(r,Js,rr,{disabled:!!w||ye!=="viewport"}),P.useEffect(()=>{i.current||!w&&ye==="render"&&(le(),i.current=!0)},[w,le,ye]);const Zs=O=>{const A=O.currentTarget.getAttribute("target"),Q=y!==void 0?y:A;if(!w&&!ar(O)&&!O.defaultPrevented&&(!Q||Q==="_self")&&O.button===0){O.preventDefault(),us.flushSync(()=>{o(!0)});const _n=t.subscribe("onResolved",()=>{_n(),o(!1)});t.navigate({...Fe,replace:g,resetScroll:v,hashScrollIntoView:f,startTransition:p,viewTransition:m,ignoreBlocker:$})}};if(je)return{...Sn,ref:r,href:je,...S&&{children:S},...y&&{target:y},...w&&{disabled:w},...x&&{style:x},...R&&{className:R},..._&&{onClick:_},...C&&{onFocus:C},...F&&{onMouseEnter:F},...E&&{onMouseLeave:E},...L&&{onTouchStart:L}};const wn=O=>{w||ye&&le()},eo=wn,to=O=>{if(!(w||!ye))if(!mt)le();else{const A=O.target;if(Ee.has(A))return;const Q=setTimeout(()=>{Ee.delete(A),le()},mt);Ee.set(A,Q)}},no=O=>{if(w||!ye||!mt)return;const A=O.target,Q=Ee.get(A);Q&&(clearTimeout(Q),Ee.delete(A))},He=vt?te(a,{})??nr:Et,Ue=vt?Et:te(l,{})??Et,Rn=[R,He.className,Ue.className].filter(Boolean).join(" "),Cn=(x||He.style||Ue.style)&&{...x,...He.style,...Ue.style};return{...Sn,...He,...Ue,href:Be?.href,ref:r,onClick:Le([_,Zs]),onFocus:Le([C,wn]),onMouseEnter:Le([F,to]),onMouseLeave:Le([E,no]),onTouchStart:Le([L,eo]),disabled:!!w,target:y,...Cn&&{style:Cn},...Rn&&{className:Rn},...w&&sr,...vt&&or,...s&&ir}}const Et={},nr={className:"active"},sr={role:"link","aria-disabled":!0},or={"data-status":"active","aria-current":"page"},ir={"data-transitioning":"transitioning"},Ee=new WeakMap,rr={rootMargin:"100px"},Le=e=>n=>{for(const t of e)if(t){if(n.defaultPrevented)return;t(n)}},ks=P.forwardRef((e,n)=>{const{_asChild:t,...s}=e,{type:o,ref:i,...r}=tr(s,n),a=typeof s.children=="function"?s.children({isActive:r["data-status"]==="active"}):s.children;return t===void 0&&delete r.disabled,P.createElement(t||"a",{...r,ref:i},a)});function ar(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class lr extends Ds{constructor(n){super(n),this.useMatch=t=>Y({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Y({...t,from:this.id,select:s=>t?.select?t.select(s.context):s.context}),this.useSearch=t=>fn({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>hn({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>dn({...t,from:this.id}),this.useLoaderData=t=>cn({...t,from:this.id}),this.useNavigate=()=>gn({from:this.fullPath}),this.Link=ke.forwardRef((t,s)=>M.jsx(ks,{ref:s,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}}function ur(e){return new lr(e)}class cr extends Bi{constructor(n){super(n),this.useMatch=t=>Y({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Y({...t,from:this.id,select:s=>t?.select?t.select(s.context):s.context}),this.useSearch=t=>fn({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>hn({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>dn({...t,from:this.id}),this.useLoaderData=t=>cn({...t,from:this.id}),this.useNavigate=()=>gn({from:this.fullPath}),this.Link=ke.forwardRef((t,s)=>M.jsx(ks,{ref:s,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}}function $a(e){return new cr(e)}function Xn(e){return typeof e=="object"?new Yn(e,{silent:!0}).createRoute(e):new Yn(e,{silent:!0}).createRoute}class Yn{constructor(n,t){this.path=n,this.createRoute=s=>{this.silent;const o=ur(s);return o.isRoot=!1,o},this.silent=t?.silent}}class Jn{constructor(n){this.useMatch=t=>Y({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Y({from:this.options.id,select:s=>t?.select?t.select(s.context):s.context}),this.useSearch=t=>fn({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>hn({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>dn({...t,from:this.options.id}),this.useLoaderData=t=>cn({...t,from:this.options.id}),this.useNavigate=()=>{const t=U();return gn({from:t.routesById[this.options.id].fullPath})},this.options=n,this.$$typeof=Symbol.for("react.memo")}}function Zn(e){return typeof e=="object"?new Jn(e):n=>new Jn({id:e,...n})}function Da(e,n){let t,s,o,i;const r=()=>(t||(t=e().then(l=>{t=void 0,s=l[n]}).catch(l=>{if(o=l,Wo(o)&&o instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const u=`tanstack_router_reload:${o.message}`;sessionStorage.getItem(u)||(sessionStorage.setItem(u,"1"),i=!0)}})),t),a=function(u){if(i)throw window.location.reload(),new Promise(()=>{});if(o)throw o;if(!s)if(P.use)P.use(r());else throw r();return P.createElement(s,u)};return a.preload=r,a}function dr(){const e=U(),n=P.useRef({router:e,mounted:!1}),[t,s]=P.useState(!1),{hasPendingMatches:o,isLoading:i}=z({select:h=>({isLoading:h.isLoading,hasPendingMatches:h.matches.some(c=>c.status==="pending")}),structuralSharing:!0}),r=bt(i),a=i||t||o,l=bt(a),u=i||o,d=bt(u);return e.startTransition=h=>{s(!0),P.startTransition(()=>{h(),s(!1)})},P.useEffect(()=>{const h=e.history.subscribe(e.load),c=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return he(e.latestLocation.publicHref)!==he(c.publicHref)&&e.commitLocation({...c,replace:!0}),()=>{h()}},[e,e.history]),We(()=>{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(c){console.error(c)}})()},[e]),We(()=>{r&&!i&&e.emit({type:"onLoad",...fe(e.state)})},[r,e,i]),We(()=>{d&&!u&&e.emit({type:"onBeforeRouteMount",...fe(e.state)})},[u,d,e]),We(()=>{if(l&&!a){const h=fe(e.state);e.emit({type:"onResolved",...h}),e.__store.setState(c=>({...c,status:"idle",resolvedLocation:c.location})),h.hrefChanged&&Si(e)}},[a,l,e]),null}function hr(e){const n=z({select:t=>`not-found-${t.location.pathname}-${t.status}`});return M.jsx(un,{getResetKey:()=>n,onCatch:(t,s)=>{if(j(t))e.onCatch?.(t,s);else throw t},errorComponent:({error:t})=>{if(j(t))return e.fallback?.(t);throw t},children:e.children})}function fr(){return M.jsx("p",{children:"Not Found"})}function Re(e){return M.jsx(M.Fragment,{children:e.children})}function Vs(e,n,t){return n.options.notFoundComponent?M.jsx(n.options.notFoundComponent,{...t}):e.options.defaultNotFoundComponent?M.jsx(e.options.defaultNotFoundComponent,{...t}):M.jsx(fr,{})}function gr({children:e}){const n=U();return n.isServer?M.jsx("script",{nonce:n.options.ssr?.nonce,dangerouslySetInnerHTML:{__html:e+";document.currentScript.remove()"}}):null}function pr(){const e=U();if(!e.isScrollRestoring||!e.isServer||typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return null;const t=(e.options.getScrollRestorationKey||Nt)(e.latestLocation),s=t!==Nt(e.latestLocation)?t:void 0,o={storageKey:lt,shouldScrollRestoration:!0};return s&&(o.key=s),M.jsx(gr,{children:`(${xs.toString()})(${JSON.stringify(o)})`})}const zs=P.memo(function({matchId:n}){const t=U(),s=z({select:m=>{const S=m.matches.find(y=>y.id===n);return ee(S),{routeId:S.routeId,ssr:S.ssr,_displayPending:S._displayPending}},structuralSharing:!0}),o=t.routesById[s.routeId],i=o.options.pendingComponent??t.options.defaultPendingComponent,r=i?M.jsx(i,{}):null,a=o.options.errorComponent??t.options.defaultErrorComponent,l=o.options.onCatch??t.options.defaultOnCatch,u=o.isRoot?o.options.notFoundComponent??t.options.notFoundRoute?.options.component:o.options.notFoundComponent,d=s.ssr===!1||s.ssr==="data-only",h=(!o.isRoot||o.options.wrapInSuspense||d)&&(o.options.wrapInSuspense??i??(o.options.errorComponent?.preload||d))?P.Suspense:Re,c=a?un:Re,f=u?hr:Re,g=z({select:m=>m.loadedAt}),p=z({select:m=>{const S=m.matches.findIndex(y=>y.id===n);return m.matches[S-1]?.routeId}}),v=o.isRoot?o.options.shellComponent??Re:Re;return M.jsxs(v,{children:[M.jsx(gt.Provider,{value:n,children:M.jsx(h,{fallback:r,children:M.jsx(c,{getResetKey:()=>g,errorComponent:a||ft,onCatch:(m,S)=>{if(j(m))throw m;l?.(m,S)},children:M.jsx(f,{fallback:m=>{if(!u||m.routeId&&m.routeId!==s.routeId||!m.routeId&&!o.isRoot)throw m;return P.createElement(u,m)},children:d||s._displayPending?M.jsx(Hi,{fallback:r,children:M.jsx(es,{matchId:n})}):M.jsx(es,{matchId:n})})})})}),p===B&&t.options.scrollRestoration?M.jsxs(M.Fragment,{children:[M.jsx(mr,{}),M.jsx(pr,{})]}):null]})});function mr(){const e=U(),n=P.useRef(void 0);return M.jsx("script",{suppressHydrationWarning:!0,ref:t=>{t&&(n.current===void 0||n.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...fe(e.state)}),n.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const es=P.memo(function({matchId:n}){const t=U(),{match:s,key:o,routeId:i}=z({select:l=>{const u=l.matches.find(g=>g.id===n),d=u.routeId,c=(t.routesById[d].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:d,loaderDeps:u.loaderDeps,params:u._strictParams,search:u._strictSearch});return{key:c?JSON.stringify(c):void 0,routeId:d,match:{id:u.id,status:u.status,error:u.error,invalid:u.invalid,_forcePending:u._forcePending,_displayPending:u._displayPending}}},structuralSharing:!0}),r=t.routesById[i],a=P.useMemo(()=>{const l=r.options.component??t.options.defaultComponent;return l?M.jsx(l,{},o):M.jsx(vr,{})},[o,r.options.component,t.options.defaultComponent]);if(s._displayPending)throw t.getMatch(s.id)?._nonReactive.displayPendingPromise;if(s._forcePending)throw t.getMatch(s.id)?._nonReactive.minPendingPromise;if(s.status==="pending"){const l=r.options.pendingMinMs??t.options.defaultPendingMinMs;if(l){const u=t.getMatch(s.id);if(u&&!u._nonReactive.minPendingPromise&&!t.isServer){const d=Pe();u._nonReactive.minPendingPromise=d,setTimeout(()=>{d.resolve(),u._nonReactive.minPendingPromise=void 0},l)}}throw t.getMatch(s.id)?._nonReactive.loadPromise}if(s.status==="notFound")return ee(j(s.error)),Vs(t,r,s.error);if(s.status==="redirected")throw ee(q(s.error)),t.getMatch(s.id)?._nonReactive.loadPromise;if(s.status==="error"){if(t.isServer){const l=(r.options.errorComponent??t.options.defaultErrorComponent)||ft;return M.jsx(l,{error:s.error,reset:void 0,info:{componentStack:""}})}throw s.error}return a}),vr=P.memo(function(){const n=U(),t=P.useContext(gt),s=z({select:u=>u.matches.find(d=>d.id===t)?.routeId}),o=n.routesById[s],i=z({select:u=>{const h=u.matches.find(c=>c.id===t);return ee(h),h.globalNotFound}}),r=z({select:u=>{const d=u.matches,h=d.findIndex(c=>c.id===t);return d[h+1]?.id}}),a=n.options.defaultPendingComponent?M.jsx(n.options.defaultPendingComponent,{}):null;if(i)return Vs(n,o,void 0);if(!r)return null;const l=M.jsx(zs,{matchId:r});return s===B?M.jsx(P.Suspense,{fallback:a,children:l}):l});function Sr(){const e=U(),t=e.routesById[B].options.pendingComponent??e.options.defaultPendingComponent,s=t?M.jsx(t,{}):null,o=e.isServer||typeof document<"u"&&e.ssr?Re:P.Suspense,i=M.jsxs(o,{fallback:s,children:[!e.isServer&&M.jsx(dr,{}),M.jsx(yr,{})]});return e.options.InnerWrap?M.jsx(e.options.InnerWrap,{children:i}):i}function yr(){const e=U(),n=z({select:o=>o.matches[0]?.id}),t=z({select:o=>o.loadedAt}),s=n?M.jsx(zs,{matchId:n}):null;return M.jsx(gt.Provider,{value:n,children:e.options.disableGlobalCatchBoundary?s:M.jsx(un,{getResetKey:()=>t,errorComponent:ft,onCatch:o=>{o.message||o.toString()},children:s})})}const Aa=e=>new wr(e);class wr extends $i{constructor(n){super(n)}}typeof globalThis<"u"?(globalThis.createFileRoute=Xn,globalThis.createLazyFileRoute=Zn):typeof window<"u"&&(window.createFileRoute=Xn,window.createLazyFileRoute=Zn);function Rr({router:e,children:n,...t}){Object.keys(t).length>0&&e.update({...e.options,...t,context:{...e.options.context,...t.context}});const s=As(),o=M.jsx(s.Provider,{value:e,children:n});return e.options.Wrap?M.jsx(e.options.Wrap,{children:o}):o}function ka({router:e,...n}){return M.jsx(Rr,{router:e,...n,children:M.jsx(Sr,{})})}function Va(e){return z({select:n=>n.location})}function se(e,n){return typeof e=="function"?e(n):e}function H(e,n){return t=>{n.setState(s=>({...s,[e]:se(t,s[e])}))}}function pt(e){return e instanceof Function}function Cr(e){return Array.isArray(e)&&e.every(n=>typeof n=="number")}function _r(e,n){const t=[],s=o=>{o.forEach(i=>{t.push(i);const r=n(i);r!=null&&r.length&&s(r)})};return s(e),t}function I(e,n,t){let s=[],o;return i=>{let r;t.key&&t.debug&&(r=Date.now());const a=e(i);if(!(a.length!==s.length||a.some((d,h)=>s[h]!==d)))return o;s=a;let u;if(t.key&&t.debug&&(u=Date.now()),o=n(...a),t==null||t.onChange==null||t.onChange(o),t.key&&t.debug&&t!=null&&t.debug()){const d=Math.round((Date.now()-r)*100)/100,h=Math.round((Date.now()-u)*100)/100,c=h/16,f=(g,p)=>{for(g=String(g);g.length<p;)g=" "+g;return g};console.info(`%c⏱ ${f(h,5)} /${f(d,5)} ms`,`
|
|
1
|
+
import{r as P,a as ke,b as ls}from"./icons-B2mES2Qq.js";import{j as M}from"./radix-ui-c-7GrHMM.js";import{r as us}from"./react-dom-BcUZDRtY.js";var Me=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(){}},so={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)},oo=class{#e=so;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,n){return this.#e.setTimeout(e,n)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,n){return this.#e.setInterval(e,n)}clearInterval(e){this.#e.clearInterval(e)}},ce=new oo;function io(e){setTimeout(e,0)}var ge=typeof window>"u"||"Deno"in globalThis;function V(){}function ro(e,n){return typeof e=="function"?e(n):e}function Vt(e){return typeof e=="number"&&e>=0&&e!==1/0}function cs(e,n){return Math.max(e+(n||0)-Date.now(),0)}function oe(e,n){return typeof e=="function"?e(n):e}function N(e,n){return typeof e=="function"?e(n):e}function Pn(e,n){const{type:t="all",exact:s,fetchStatus:o,predicate:i,queryKey:r,stale:a}=e;if(r){if(s){if(n.queryHash!==Jt(r,n.options))return!1}else if(!Ve(n.queryKey,r))return!1}if(t!=="all"){const l=n.isActive();if(t==="active"&&!l||t==="inactive"&&l)return!1}return!(typeof a=="boolean"&&n.isStale()!==a||o&&o!==n.state.fetchStatus||i&&!i(n))}function xn(e,n){const{exact:t,status:s,predicate:o,mutationKey:i}=e;if(i){if(!n.options.mutationKey)return!1;if(t){if(pe(n.options.mutationKey)!==pe(i))return!1}else if(!Ve(n.options.mutationKey,i))return!1}return!(s&&n.state.status!==s||o&&!o(n))}function Jt(e,n){return(n?.queryKeyHashFn||pe)(e)}function pe(e){return JSON.stringify(e,(n,t)=>zt(t)?Object.keys(t).sort().reduce((s,o)=>(s[o]=t[o],s),{}):t)}function Ve(e,n){return e===n?!0:typeof e!=typeof n?!1:e&&n&&typeof e=="object"&&typeof n=="object"?Object.keys(n).every(t=>Ve(e[t],n[t])):!1}var ao=Object.prototype.hasOwnProperty;function ds(e,n,t=0){if(e===n)return e;if(t>500)return n;const s=Mn(e)&&Mn(n);if(!s&&!(zt(e)&&zt(n)))return n;const i=(s?e:Object.keys(e)).length,r=s?n:Object.keys(n),a=r.length,l=s?new Array(a):{};let u=0;for(let d=0;d<a;d++){const h=s?d:r[d],c=e[h],f=n[h];if(c===f){l[h]=c,(s?d<i:ao.call(e,h))&&u++;continue}if(c===null||f===null||typeof c!="object"||typeof f!="object"){l[h]=f;continue}const g=ds(c,f,t+1);l[h]=g,g===c&&u++}return i===a&&u===i?e:l}function et(e,n){if(!n||Object.keys(e).length!==Object.keys(n).length)return!1;for(const t in e)if(e[t]!==n[t])return!1;return!0}function Mn(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function zt(e){if(!Fn(e))return!1;const n=e.constructor;if(n===void 0)return!0;const t=n.prototype;return!(!Fn(t)||!t.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Fn(e){return Object.prototype.toString.call(e)==="[object Object]"}function lo(e){return new Promise(n=>{ce.setTimeout(n,e)})}function Bt(e,n,t){return typeof t.structuralSharing=="function"?t.structuralSharing(e,n):t.structuralSharing!==!1?ds(e,n):n}function uo(e,n,t=0){const s=[...e,n];return t&&s.length>t?s.slice(1):s}function co(e,n,t=0){const s=[n,...e];return t&&s.length>t?s.slice(0,-1):s}var Zt=Symbol();function hs(e,n){return!e.queryFn&&n?.initialPromise?()=>n.initialPromise:!e.queryFn||e.queryFn===Zt?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function en(e,n){return typeof e=="function"?e(...n):!!e}function ho(e,n,t){let s=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=n(),s||(s=!0,o.aborted?t():o.addEventListener("abort",t,{once:!0})),o)}),e}var fo=class extends Me{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!ge&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},tn=new fo;function jt(){let e,n;const t=new Promise((o,i)=>{e=o,n=i});t.status="pending",t.catch(()=>{});function s(o){Object.assign(t,o),delete t.resolve,delete t.reject}return t.resolve=o=>{s({status:"fulfilled",value:o}),e(o)},t.reject=o=>{s({status:"rejected",reason:o}),n(o)},t}function ba(e){return e.state.status==="success"}var go=io;function po(){let e=[],n=0,t=a=>{a()},s=a=>{a()},o=go;const i=a=>{n?e.push(a):o(()=>{t(a)})},r=()=>{const a=e;e=[],a.length&&o(()=>{s(()=>{a.forEach(l=>{t(l)})})})};return{batch:a=>{let l;n++;try{l=a()}finally{n--,n||r()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{t=a},setBatchNotifyFunction:a=>{s=a},setScheduler:a=>{o=a}}}var T=po(),mo=class extends Me{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!ge&&window.addEventListener){const n=()=>e(!0),t=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",t,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}},tt=new mo;function vo(e){return Math.min(1e3*2**e,3e4)}function fs(e){return(e??"online")==="online"?tt.isOnline():!0}var Ht=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function gs(e){let n=!1,t=0,s;const o=jt(),i=()=>o.status!=="pending",r=p=>{if(!i()){const v=new Ht(p);c(v),e.onCancel?.(v)}},a=()=>{n=!0},l=()=>{n=!1},u=()=>tn.isFocused()&&(e.networkMode==="always"||tt.isOnline())&&e.canRun(),d=()=>fs(e.networkMode)&&e.canRun(),h=p=>{i()||(s?.(),o.resolve(p))},c=p=>{i()||(s?.(),o.reject(p))},f=()=>new Promise(p=>{s=v=>{(i()||u())&&p(v)},e.onPause?.()}).then(()=>{s=void 0,i()||e.onContinue?.()}),g=()=>{if(i())return;let p;const v=t===0?e.initialPromise:void 0;try{p=v??e.fn()}catch(m){p=Promise.reject(m)}Promise.resolve(p).then(h).catch(m=>{if(i())return;const S=e.retry??(ge?0:3),y=e.retryDelay??vo,w=typeof y=="function"?y(t,m):y,x=S===!0||typeof S=="number"&&t<S||typeof S=="function"&&S(t,m);if(n||!x){c(m);return}t++,e.onFail?.(t,m),lo(w).then(()=>u()?void 0:f()).then(()=>{n?c(m):g()})})};return{promise:o,status:()=>o.status,cancel:r,continue:()=>(s?.(),o),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?g():f().then(g),o)}}var ps=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Vt(this.gcTime)&&(this.#e=ce.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ge?1/0:300*1e3))}clearGcTimeout(){this.#e&&(ce.clearTimeout(this.#e),this.#e=void 0)}},So=class extends ps{#e;#t;#n;#o;#s;#r;#a;constructor(e){super(),this.#a=!1,this.#r=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#o=e.client,this.#n=this.#o.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=bn(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#s?.promise}setOptions(e){if(this.options={...this.#r,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=bn(this.options);n.data!==void 0&&(this.setState(In(n.data,n.dataUpdatedAt)),this.#e=n)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,n){const t=Bt(this.state.data,e,this.options);return this.#i({data:t,type:"success",dataUpdatedAt:n?.updatedAt,manual:n?.manual}),t}setState(e,n){this.#i({type:"setState",state:e,setStateOptions:n})}cancel(e){const n=this.#s?.promise;return this.#s?.cancel(e),n?n.then(V).catch(V):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>N(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Zt||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>oe(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!cs(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(n=>n.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#s?.continue()}onOnline(){this.observers.find(n=>n.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#s?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(this.#s&&(this.#a?this.#s.cancel({revert:!0}):this.#s.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,n){if(this.state.fetchStatus!=="idle"&&this.#s?.status()!=="rejected"){if(this.state.data!==void 0&&n?.cancelRefetch)this.cancel({silent:!0});else if(this.#s)return this.#s.continueRetry(),this.#s.promise}if(e&&this.setOptions(e),!this.options.queryFn){const a=this.observers.find(l=>l.options.queryFn);a&&this.setOptions(a.options)}const t=new AbortController,s=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(this.#a=!0,t.signal)})},o=()=>{const a=hs(this.options,n),u=(()=>{const d={client:this.#o,queryKey:this.queryKey,meta:this.meta};return s(d),d})();return this.#a=!1,this.options.persister?this.options.persister(a,u,this):a(u)},r=(()=>{const a={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:this.#o,state:this.state,fetchFn:o};return s(a),a})();this.options.behavior?.onFetch(r,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==r.fetchOptions?.meta)&&this.#i({type:"fetch",meta:r.fetchOptions?.meta}),this.#s=gs({initialPromise:n?.initialPromise,fn:r.fetchFn,onCancel:a=>{a instanceof Ht&&a.revert&&this.setState({...this.#t,fetchStatus:"idle"}),t.abort()},onFail:(a,l)=>{this.#i({type:"failed",failureCount:a,error:l})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:r.options.retry,retryDelay:r.options.retryDelay,networkMode:r.options.networkMode,canRun:()=>!0});try{const a=await this.#s.start();if(a===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(a),this.#n.config.onSuccess?.(a,this),this.#n.config.onSettled?.(a,this.state.error,this),a}catch(a){if(a instanceof Ht){if(a.silent)return this.#s.promise;if(a.revert){if(this.state.data===void 0)throw a;return this.state.data}}throw this.#i({type:"error",error:a}),this.#n.config.onError?.(a,this),this.#n.config.onSettled?.(this.state.data,a,this),a}finally{this.scheduleGc()}}#i(e){const n=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...ms(t.data,this.options),fetchMeta:e.meta??null};case"success":const s={...t,...In(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?s:void 0,s;case"error":const o=e.error;return{...t,error:o,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=n(this.state),T.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function ms(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:fs(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function In(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function bn(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,t=n!==void 0,s=t?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:t?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}var yo=class extends Me{constructor(e,n){super(),this.options=n,this.#e=e,this.#i=null,this.#a=jt(),this.bindMethods(),this.setOptions(n)}#e;#t=void 0;#n=void 0;#o=void 0;#s;#r;#a;#i;#p;#h;#f;#u;#c;#l;#g=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),En(this.#t,this.options)?this.#d():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ut(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ut(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#w(),this.#R(),this.#t.removeObserver(this)}setOptions(e){const n=this.options,t=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof N(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#C(),this.#t.setOptions(this.options),n._defaulted&&!et(this.options,n)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&Ln(this.#t,t,this.options,n)&&this.#d(),this.updateResult(),s&&(this.#t!==t||N(this.options.enabled,this.#t)!==N(n.enabled,this.#t)||oe(this.options.staleTime,this.#t)!==oe(n.staleTime,this.#t))&&this.#m();const o=this.#v();s&&(this.#t!==t||N(this.options.enabled,this.#t)!==N(n.enabled,this.#t)||o!==this.#l)&&this.#S(o)}getOptimisticResult(e){const n=this.#e.getQueryCache().build(this.#e,e),t=this.createResult(n,e);return Ro(this,t)&&(this.#o=t,this.#r=this.options,this.#s=this.#t.state),t}getCurrentResult(){return this.#o}trackResult(e,n){return new Proxy(e,{get:(t,s)=>(this.trackProp(s),n?.(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(t,s))})}trackProp(e){this.#g.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=this.#e.defaultQueryOptions(e),t=this.#e.getQueryCache().build(this.#e,n);return t.fetch().then(()=>this.createResult(t,n))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#o))}#d(e){this.#C();let n=this.#t.fetch(this.options,e);return e?.throwOnError||(n=n.catch(V)),n}#m(){this.#w();const e=oe(this.options.staleTime,this.#t);if(ge||this.#o.isStale||!Vt(e))return;const t=cs(this.#o.dataUpdatedAt,e)+1;this.#u=ce.setTimeout(()=>{this.#o.isStale||this.updateResult()},t)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#S(e){this.#R(),this.#l=e,!(ge||N(this.options.enabled,this.#t)===!1||!Vt(this.#l)||this.#l===0)&&(this.#c=ce.setInterval(()=>{(this.options.refetchIntervalInBackground||tn.isFocused())&&this.#d()},this.#l))}#y(){this.#m(),this.#S(this.#v())}#w(){this.#u&&(ce.clearTimeout(this.#u),this.#u=void 0)}#R(){this.#c&&(ce.clearInterval(this.#c),this.#c=void 0)}createResult(e,n){const t=this.#t,s=this.options,o=this.#o,i=this.#s,r=this.#r,l=e!==t?e.state:this.#n,{state:u}=e;let d={...u},h=!1,c;if(n._optimisticResults){const C=this.hasListeners(),F=!C&&En(e,n),E=C&&Ln(e,t,n,s);(F||E)&&(d={...d,...ms(u.data,e.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:f,errorUpdatedAt:g,status:p}=d;c=d.data;let v=!1;if(n.placeholderData!==void 0&&c===void 0&&p==="pending"){let C;o?.isPlaceholderData&&n.placeholderData===r?.placeholderData?(C=o.data,v=!0):C=typeof n.placeholderData=="function"?n.placeholderData(this.#f?.state.data,this.#f):n.placeholderData,C!==void 0&&(p="success",c=Bt(o?.data,C,n),h=!0)}if(n.select&&c!==void 0&&!v)if(o&&c===i?.data&&n.select===this.#p)c=this.#h;else try{this.#p=n.select,c=n.select(c),c=Bt(o?.data,c,n),this.#h=c,this.#i=null}catch(C){this.#i=C}this.#i&&(f=this.#i,c=this.#h,g=Date.now(),p="error");const m=d.fetchStatus==="fetching",S=p==="pending",y=p==="error",w=S&&m,x=c!==void 0,_={status:p,fetchStatus:d.fetchStatus,isPending:S,isSuccess:p==="success",isError:y,isInitialLoading:w,isLoading:w,data:c,dataUpdatedAt:d.dataUpdatedAt,error:f,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:m,isRefetching:m&&!S,isLoadingError:y&&!x,isPaused:d.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:y&&x,isStale:nn(e,n),refetch:this.refetch,promise:this.#a,isEnabled:N(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const C=_.data!==void 0,F=_.status==="error"&&!C,E=D=>{F?D.reject(_.error):C&&D.resolve(_.data)},L=()=>{const D=this.#a=_.promise=jt();E(D)},$=this.#a;switch($.status){case"pending":e.queryHash===t.queryHash&&E($);break;case"fulfilled":(F||_.data!==$.value)&&L();break;case"rejected":(!F||_.error!==$.reason)&&L();break}}return _}updateResult(){const e=this.#o,n=this.createResult(this.#t,this.options);if(this.#s=this.#t.state,this.#r=this.options,this.#s.data!==void 0&&(this.#f=this.#t),et(n,e))return;this.#o=n;const t=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!this.#g.size)return!0;const i=new Set(o??this.#g);return this.options.throwOnError&&i.add("error"),Object.keys(this.#o).some(r=>{const a=r;return this.#o[a]!==e[a]&&i.has(a)})};this.#_({listeners:t()})}#C(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const n=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(n?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#_(e){T.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(this.#o)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function wo(e,n){return N(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&n.retryOnMount===!1)}function En(e,n){return wo(e,n)||e.state.data!==void 0&&Ut(e,n,n.refetchOnMount)}function Ut(e,n,t){if(N(n.enabled,e)!==!1&&oe(n.staleTime,e)!=="static"){const s=typeof t=="function"?t(e):t;return s==="always"||s!==!1&&nn(e,n)}return!1}function Ln(e,n,t,s){return(e!==n||N(s.enabled,e)===!1)&&(!t.suspense||e.state.status!=="error")&&nn(e,t)}function nn(e,n){return N(n.enabled,e)!==!1&&e.isStaleByTime(oe(n.staleTime,e))}function Ro(e,n){return!et(e.getCurrentResult(),n)}function On(e){return{onFetch:(n,t)=>{const s=n.options,o=n.fetchOptions?.meta?.fetchMore?.direction,i=n.state.data?.pages||[],r=n.state.data?.pageParams||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let d=!1;const h=g=>{ho(g,()=>n.signal,()=>d=!0)},c=hs(n.options,n.fetchOptions),f=async(g,p,v)=>{if(d)return Promise.reject();if(p==null&&g.pages.length)return Promise.resolve(g);const S=(()=>{const R={client:n.client,queryKey:n.queryKey,pageParam:p,direction:v?"backward":"forward",meta:n.options.meta};return h(R),R})(),y=await c(S),{maxPages:w}=n.options,x=v?co:uo;return{pages:x(g.pages,y,w),pageParams:x(g.pageParams,p,w)}};if(o&&i.length){const g=o==="backward",p=g?Co:Tn,v={pages:i,pageParams:r},m=p(s,v);a=await f(v,m,g)}else{const g=e??i.length;do{const p=l===0?r[0]??s.initialPageParam:Tn(s,a);if(l>0&&p==null)break;a=await f(a,p),l++}while(l<g)}return a};n.options.persister?n.fetchFn=()=>n.options.persister?.(u,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},t):n.fetchFn=u}}}function Tn(e,{pages:n,pageParams:t}){const s=n.length-1;return n.length>0?e.getNextPageParam(n[s],n,t[s],t):void 0}function Co(e,{pages:n,pageParams:t}){return n.length>0?e.getPreviousPageParam?.(n[0],n,t[0],t):void 0}var _o=class extends ps{#e;#t;#n;#o;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||vs(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(n=>n!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#o?.continue()??this.execute(this.state.variables)}async execute(e){const n=()=>{this.#s({type:"continue"})},t={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#o=gs({fn:()=>this.options.mutationFn?this.options.mutationFn(e,t):Promise.reject(new Error("No mutationFn found")),onFail:(i,r)=>{this.#s({type:"failed",failureCount:i,error:r})},onPause:()=>{this.#s({type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const s=this.state.status==="pending",o=!this.#o.canStart();try{if(s)n();else{this.#s({type:"pending",variables:e,isPaused:o}),await this.#n.config.onMutate?.(e,this,t);const r=await this.options.onMutate?.(e,t);r!==this.state.context&&this.#s({type:"pending",context:r,variables:e,isPaused:o})}const i=await this.#o.start();return await this.#n.config.onSuccess?.(i,e,this.state.context,this,t),await this.options.onSuccess?.(i,e,this.state.context,t),await this.#n.config.onSettled?.(i,null,this.state.variables,this.state.context,this,t),await this.options.onSettled?.(i,null,e,this.state.context,t),this.#s({type:"success",data:i}),i}catch(i){try{await this.#n.config.onError?.(i,e,this.state.context,this,t)}catch(r){Promise.reject(r)}try{await this.options.onError?.(i,e,this.state.context,t)}catch(r){Promise.reject(r)}try{await this.#n.config.onSettled?.(void 0,i,this.state.variables,this.state.context,this,t)}catch(r){Promise.reject(r)}try{await this.options.onSettled?.(void 0,i,e,this.state.context,t)}catch(r){Promise.reject(r)}throw this.#s({type:"error",error:i}),i}finally{this.#n.runNext(this)}}#s(e){const n=t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),T.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function vs(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Po=class extends Me{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,n,t){const s=new _o({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(n),state:t});return this.add(s),s}add(e){this.#e.add(e);const n=Ge(e);if(typeof n=="string"){const t=this.#t.get(n);t?t.push(e):this.#t.set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const n=Ge(e);if(typeof n=="string"){const t=this.#t.get(n);if(t)if(t.length>1){const s=t.indexOf(e);s!==-1&&t.splice(s,1)}else t[0]===e&&this.#t.delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Ge(e);if(typeof n=="string"){const s=this.#t.get(n)?.find(o=>o.state.status==="pending");return!s||s===e}else return!0}runNext(e){const n=Ge(e);return typeof n=="string"?this.#t.get(n)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){T.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const n={exact:!0,...e};return this.getAll().find(t=>xn(n,t))}findAll(e={}){return this.getAll().filter(n=>xn(e,n))}notify(e){T.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return T.batch(()=>Promise.all(e.map(n=>n.continue().catch(V))))}};function Ge(e){return e.options.scope?.id}var xo=class extends Me{#e;#t=void 0;#n;#o;constructor(e,n){super(),this.#e=e,this.setOptions(n),this.bindMethods(),this.#s()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const n=this.options;this.options=this.#e.defaultMutationOptions(e),et(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&pe(n.mutationKey)!==pe(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#s(),this.#r(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#s(),this.#r()}mutate(e,n){return this.#o=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#s(){const e=this.#n?.state??vs();this.#t={...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset}}#r(e){T.batch(()=>{if(this.#o&&this.hasListeners()){const n=this.#t.variables,t=this.#t.context,s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#o.onSuccess?.(e.data,n,t,s)}catch(o){Promise.reject(o)}try{this.#o.onSettled?.(e.data,null,n,t,s)}catch(o){Promise.reject(o)}}else if(e?.type==="error"){try{this.#o.onError?.(e.error,n,t,s)}catch(o){Promise.reject(o)}try{this.#o.onSettled?.(void 0,e.error,n,t,s)}catch(o){Promise.reject(o)}}}this.listeners.forEach(n=>{n(this.#t)})})}},Mo=class extends Me{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,n,t){const s=n.queryKey,o=n.queryHash??Jt(s,n);let i=this.get(o);return i||(i=new So({client:e,queryKey:s,queryHash:o,options:e.defaultQueryOptions(n),state:t,defaultOptions:e.getQueryDefaults(s)}),this.add(i)),i}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=this.#e.get(e.queryHash);n&&(e.destroy(),n===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){T.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const n={exact:!0,...e};return this.getAll().find(t=>Pn(n,t))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(t=>Pn(e,t)):n}notify(e){T.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){T.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){T.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ea=class{#e;#t;#n;#o;#s;#r;#a;#i;constructor(e={}){this.#e=e.queryCache||new Mo,this.#t=e.mutationCache||new Po,this.#n=e.defaultOptions||{},this.#o=new Map,this.#s=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#a=tn.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=tt.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#a?.(),this.#a=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),t=this.#e.build(this,n),s=t.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&t.isStaleByTime(oe(n.staleTime,t))&&this.prefetchQuery(n),Promise.resolve(s))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:n,state:t})=>{const s=t.data;return[n,s]})}setQueryData(e,n,t){const s=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(s.queryHash)?.state.data,r=ro(n,i);if(r!==void 0)return this.#e.build(this,s).setData(r,{...t,manual:!0})}setQueriesData(e,n,t){return T.batch(()=>this.#e.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,n,t)]))}getQueryState(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state}removeQueries(e){const n=this.#e;T.batch(()=>{n.findAll(e).forEach(t=>{n.remove(t)})})}resetQueries(e,n){const t=this.#e;return T.batch(()=>(t.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},n)))}cancelQueries(e,n={}){const t={revert:!0,...n},s=T.batch(()=>this.#e.findAll(e).map(o=>o.cancel(t)));return Promise.all(s).then(V).catch(V)}invalidateQueries(e,n={}){return T.batch(()=>(this.#e.findAll(e).forEach(t=>{t.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},n)))}refetchQueries(e,n={}){const t={...n,cancelRefetch:n.cancelRefetch??!0},s=T.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let i=o.fetch(void 0,t);return t.throwOnError||(i=i.catch(V)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(s).then(V)}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const t=this.#e.build(this,n);return t.isStaleByTime(oe(n.staleTime,t))?t.fetch(n):Promise.resolve(t.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(V).catch(V)}fetchInfiniteQuery(e){return e.behavior=On(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(V).catch(V)}ensureInfiniteQueryData(e){return e.behavior=On(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return tt.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,n){this.#o.set(pe(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...this.#o.values()],t={};return n.forEach(s=>{Ve(e,s.queryKey)&&Object.assign(t,s.defaultOptions)}),t}setMutationDefaults(e,n){this.#s.set(pe(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...this.#s.values()],t={};return n.forEach(s=>{Ve(e,s.mutationKey)&&Object.assign(t,s.defaultOptions)}),t}defaultQueryOptions(e){if(e._defaulted)return e;const n={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=Jt(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===Zt&&(n.enabled=!1),n}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Ss=P.createContext(void 0),ys=e=>{const n=P.useContext(Ss);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},La=({client:e,children:n})=>(P.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),M.jsx(Ss.Provider,{value:e,children:n})),ws=P.createContext(!1),Fo=()=>P.useContext(ws);ws.Provider;function Io(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var bo=P.createContext(Io()),Eo=()=>P.useContext(bo),Lo=(e,n,t)=>{const s=t?.state.error&&typeof e.throwOnError=="function"?en(e.throwOnError,[t.state.error,t]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||s)&&(n.isReset()||(e.retryOnMount=!1))},Oo=e=>{P.useEffect(()=>{e.clearReset()},[e])},To=({result:e,errorResetBoundary:n,throwOnError:t,query:s,suspense:o})=>e.isError&&!n.isReset()&&!e.isFetching&&s&&(o&&e.data===void 0||en(t,[e.error,s])),$o=e=>{if(e.suspense){const t=o=>o==="static"?o:Math.max(o??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...o)=>t(s(...o)):t(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Do=(e,n)=>e.isLoading&&e.isFetching&&!n,Ao=(e,n)=>e?.suspense&&n.isPending,$n=(e,n,t)=>n.fetchOptimistic(e).catch(()=>{t.clearReset()});function ko(e,n,t){const s=Fo(),o=Eo(),i=ys(),r=i.defaultQueryOptions(e);i.getDefaultOptions().queries?._experimental_beforeQuery?.(r);const a=i.getQueryCache().get(r.queryHash);r._optimisticResults=s?"isRestoring":"optimistic",$o(r),Lo(r,o,a),Oo(o);const l=!i.getQueryCache().get(r.queryHash),[u]=P.useState(()=>new n(i,r)),d=u.getOptimisticResult(r),h=!s&&e.subscribed!==!1;if(P.useSyncExternalStore(P.useCallback(c=>{const f=h?u.subscribe(T.batchCalls(c)):V;return u.updateResult(),f},[u,h]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),P.useEffect(()=>{u.setOptions(r)},[r,u]),Ao(r,d))throw $n(r,u,o);if(To({result:d,errorResetBoundary:o,throwOnError:r.throwOnError,query:a,suspense:r.suspense}))throw d.error;return i.getDefaultOptions().queries?._experimental_afterQuery?.(r,d),r.experimental_prefetchInRender&&!ge&&Do(d,s)&&(l?$n(r,u,o):a?.promise)?.catch(V).finally(()=>{u.updateResult()}),r.notifyOnChangeProps?d:u.trackResult(d)}function Oa(e,n){return ko(e,yo)}function Ta(e,n){const t=ys(),[s]=P.useState(()=>new xo(t,e));P.useEffect(()=>{s.setOptions(e)},[s,e]);const o=P.useSyncExternalStore(P.useCallback(r=>s.subscribe(T.batchCalls(r)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),i=P.useCallback((r,a)=>{s.mutate(r,a).catch(V)},[s]);if(o.error&&en(s.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:i,mutateAsync:o.mutate}}const Gt=new WeakMap,Vo=new WeakMap,nt={current:[]};let St=!1,$e=0;const Te=new Set,Ne=new Map;function Rs(e){for(const n of e){if(nt.current.includes(n))continue;nt.current.push(n),n.recompute();const t=Vo.get(n);if(t)for(const s of t){const o=Gt.get(s);o?.length&&Rs(o)}}}function zo(e){const n={prevVal:e.prevState,currentVal:e.state};for(const t of e.listeners)t(n)}function Bo(e){const n={prevVal:e.prevState,currentVal:e.state};for(const t of e.listeners)t(n)}function Cs(e){if($e>0&&!Ne.has(e)&&Ne.set(e,e.prevState),Te.add(e),!($e>0)&&!St)try{for(St=!0;Te.size>0;){const n=Array.from(Te);Te.clear();for(const t of n){const s=Ne.get(t)??t.prevState;t.prevState=s,zo(t)}for(const t of n){const s=Gt.get(t);s&&(nt.current.push(t),Rs(s))}for(const t of n){const s=Gt.get(t);if(s)for(const o of s)Bo(o)}}}finally{St=!1,nt.current=[],Ne.clear()}}function De(e){$e++;try{e()}finally{if($e--,$e===0){const n=Te.values().next().value;n&&Cs(n)}}}function jo(e){return typeof e=="function"}class Ho{constructor(n,t){this.listeners=new Set,this.subscribe=s=>{var o,i;this.listeners.add(s);const r=(i=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:i.call(o,s,this);return()=>{this.listeners.delete(s),r?.()}},this.prevState=n,this.state=n,this.options=t}setState(n){var t,s,o;this.prevState=this.state,(t=this.options)!=null&&t.updateFn?this.state=this.options.updateFn(this.prevState)(n):jo(n)?this.state=n(this.prevState):this.state=n,(o=(s=this.options)==null?void 0:s.onUpdate)==null||o.call(s),Cs(this)}}const ie="__TSR_index",Dn="popstate",An="beforeunload";function Uo(e){let n=e.getLocation();const t=new Set,s=r=>{n=e.getLocation(),t.forEach(a=>a({location:n,action:r}))},o=r=>{e.notifyOnIndexChange??!0?s(r):n=e.getLocation()},i=async({task:r,navigateOpts:a,...l})=>{if(a?.ignoreBlocker??!1){r();return}const d=e.getBlockers?.()??[],h=l.type==="PUSH"||l.type==="REPLACE";if(typeof document<"u"&&d.length&&h)for(const c of d){const f=st(l.path,l.state);if(await c.blockerFn({currentLocation:n,nextLocation:f,action:l.type})){e.onBlocked?.();return}}r()};return{get location(){return n},get length(){return e.getLength()},subscribers:t,subscribe:r=>(t.add(r),()=>{t.delete(r)}),push:(r,a,l)=>{const u=n.state[ie];a=kn(u+1,a),i({task:()=>{e.pushState(r,a),s({type:"PUSH"})},navigateOpts:l,type:"PUSH",path:r,state:a})},replace:(r,a,l)=>{const u=n.state[ie];a=kn(u,a),i({task:()=>{e.replaceState(r,a),s({type:"REPLACE"})},navigateOpts:l,type:"REPLACE",path:r,state:a})},go:(r,a)=>{i({task:()=>{e.go(r),o({type:"GO",index:r})},navigateOpts:a,type:"GO"})},back:r=>{i({task:()=>{e.back(r?.ignoreBlocker??!1),o({type:"BACK"})},navigateOpts:r,type:"BACK"})},forward:r=>{i({task:()=>{e.forward(r?.ignoreBlocker??!1),o({type:"FORWARD"})},navigateOpts:r,type:"FORWARD"})},canGoBack:()=>n.state[ie]!==0,createHref:r=>e.createHref(r),block:r=>{if(!e.setBlockers)return()=>{};const a=e.getBlockers?.()??[];return e.setBlockers([...a,r]),()=>{const l=e.getBlockers?.()??[];e.setBlockers?.(l.filter(u=>u!==r))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:s}}function kn(e,n){n||(n={});const t=sn();return{...n,key:t,__TSR_key:t,[ie]:e}}function Go(e){const n=typeof document<"u"?window:void 0,t=n.history.pushState,s=n.history.replaceState;let o=[];const i=()=>o,r=C=>o=C,a=(C=>C),l=(()=>st(`${n.location.pathname}${n.location.search}${n.location.hash}`,n.history.state));if(!n.history.state?.__TSR_key&&!n.history.state?.key){const C=sn();n.history.replaceState({[ie]:0,key:C,__TSR_key:C},"")}let u=l(),d,h=!1,c=!1,f=!1,g=!1;const p=()=>u;let v,m;const S=()=>{v&&(_._ignoreSubscribers=!0,(v.isPush?n.history.pushState:n.history.replaceState)(v.state,"",v.href),_._ignoreSubscribers=!1,v=void 0,m=void 0,d=void 0)},y=(C,F,E)=>{const L=a(F);m||(d=u),u=st(F,E),v={href:L,state:E,isPush:v?.isPush||C==="push"},m||(m=Promise.resolve().then(()=>S()))},w=C=>{u=l(),_.notify({type:C})},x=async()=>{if(c){c=!1;return}const C=l(),F=C.state[ie]-u.state[ie],E=F===1,L=F===-1,$=!E&&!L||h;h=!1;const D=$?"GO":L?"BACK":"FORWARD",K=$?{type:"GO",index:F}:{type:L?"BACK":"FORWARD"};if(f)f=!1;else{const W=i();if(typeof document<"u"&&W.length){for(const Se of W)if(await Se.blockerFn({currentLocation:u,nextLocation:C,action:D})){c=!0,n.history.go(1),_.notify(K);return}}}u=l(),_.notify(K)},R=C=>{if(g){g=!1;return}let F=!1;const E=i();if(typeof document<"u"&&E.length)for(const L of E){const $=L.enableBeforeUnload??!0;if($===!0){F=!0;break}if(typeof $=="function"&&$()===!0){F=!0;break}}if(F)return C.preventDefault(),C.returnValue=""},_=Uo({getLocation:p,getLength:()=>n.history.length,pushState:(C,F)=>y("push",C,F),replaceState:(C,F)=>y("replace",C,F),back:C=>(C&&(f=!0),g=!0,n.history.back()),forward:C=>{C&&(f=!0),g=!0,n.history.forward()},go:C=>{h=!0,n.history.go(C)},createHref:C=>a(C),flush:S,destroy:()=>{n.history.pushState=t,n.history.replaceState=s,n.removeEventListener(An,R,{capture:!0}),n.removeEventListener(Dn,x)},onBlocked:()=>{d&&u!==d&&(u=d)},getBlockers:i,setBlockers:r,notifyOnIndexChange:!1});return n.addEventListener(An,R,{capture:!0}),n.addEventListener(Dn,x),n.history.pushState=function(...C){const F=t.apply(n.history,C);return _._ignoreSubscribers||w("PUSH"),F},n.history.replaceState=function(...C){const F=s.apply(n.history,C);return _._ignoreSubscribers||w("REPLACE"),F},_}function No(e){let n=e.replace(/[\x00-\x1f\x7f]/g,"");return n.startsWith("//")&&(n="/"+n.replace(/^\/+/,"")),n}function st(e,n){const t=No(e),s=t.indexOf("#"),o=t.indexOf("?"),i=sn();return{href:t,pathname:t.substring(0,s>0?o>0?Math.min(s,o):s:o>0?o:t.length),hash:s>-1?t.substring(s):"",search:o>-1?t.slice(o,s===-1?void 0:s):"",state:n||{[ie]:0,key:i,__TSR_key:i}}}function sn(){return(Math.random()+1).toString(36).substring(7)}function ot(e){return e[e.length-1]}function qo(e){return typeof e=="function"}function te(e,n){return qo(e)?e(n):e}const Ko=Object.prototype.hasOwnProperty;function G(e,n){if(e===n)return e;const t=n,s=Bn(e)&&Bn(t);if(!s&&!(it(e)&&it(t)))return t;const o=s?e:Vn(e);if(!o)return t;const i=s?t:Vn(t);if(!i)return t;const r=o.length,a=i.length,l=s?new Array(a):{};let u=0;for(let d=0;d<a;d++){const h=s?d:i[d],c=e[h],f=t[h];if(c===f){l[h]=c,(s?d<r:Ko.call(e,h))&&u++;continue}if(c===null||f===null||typeof c!="object"||typeof f!="object"){l[h]=f;continue}const g=G(c,f);l[h]=g,g===c&&u++}return r===a&&u===r?e:l}function Vn(e){const n=[],t=Object.getOwnPropertyNames(e);for(const o of t){if(!Object.prototype.propertyIsEnumerable.call(e,o))return!1;n.push(o)}const s=Object.getOwnPropertySymbols(e);for(const o of s){if(!Object.prototype.propertyIsEnumerable.call(e,o))return!1;n.push(o)}return n}function it(e){if(!zn(e))return!1;const n=e.constructor;if(typeof n>"u")return!0;const t=n.prototype;return!(!zn(t)||!t.hasOwnProperty("isPrototypeOf"))}function zn(e){return Object.prototype.toString.call(e)==="[object Object]"}function Bn(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function de(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,o=e.length;s<o;s++)if(!de(e[s],n[s],t))return!1;return!0}if(it(e)&&it(n)){const s=t?.ignoreUndefined??!0;if(t?.partial){for(const r in n)if((!s||n[r]!==void 0)&&!de(e[r],n[r],t))return!1;return!0}let o=0;if(!s)o=Object.keys(e).length;else for(const r in e)e[r]!==void 0&&o++;let i=0;for(const r in n)if((!s||n[r]!==void 0)&&(i++,i>o||!de(e[r],n[r],t)))return!1;return o===i}return!1}function Pe(e){let n,t;const s=new Promise((o,i)=>{n=o,t=i});return s.status="pending",s.resolve=o=>{s.status="resolved",s.value=o,n(o),e?.(o)},s.reject=o=>{s.status="rejected",t(o)},s}function Wo(e){return typeof e?.message!="string"?!1:e.message.startsWith("Failed to fetch dynamically imported module")||e.message.startsWith("error loading dynamically imported module")||e.message.startsWith("Importing a module script failed")}function re(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function Qo(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function jn(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 Qo(n)}function Hn(e,n){if(!e)return e;const t=/%25|%5C/gi;let s=0,o="",i;for(;(i=t.exec(e))!==null;)o+=jn(e.slice(s,i.index))+i[0],s=t.lastIndex;return o=o+jn(s?e.slice(s):e),o.startsWith("//")&&(o="/"+o.replace(/^\/+/,"")),o}var Xo="Invariant failed";function ee(e,n){if(!e)throw new Error(Xo)}function rt(e){const n=new Map;let t,s;const o=i=>{i.next&&(i.prev?(i.prev.next=i.next,i.next.prev=i.prev,i.next=void 0,s&&(s.next=i,i.prev=s)):(i.next.prev=void 0,t=i.next,i.next=void 0,s&&(i.prev=s,s.next=i)),s=i)};return{get(i){const r=n.get(i);if(r)return o(r),r.value},set(i,r){if(n.size>=e&&t){const l=t;n.delete(l.key),l.next&&(t=l.next,l.next.prev=void 0),l===s&&(s=void 0)}const a=n.get(i);if(a)a.value=r,o(a);else{const l={key:i,value:r,prev:s};s&&(s.next=l),s=l,t||(t=l),n.set(i,l)}},clear(){n.clear(),t=void 0,s=void 0}}}const xe=0,me=1,ve=2,ze=3,Ce=4,Yo=/^([^{]*)\{\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,Jo=/^([^{]*)\{-\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,Zo=/^([^{]*)\{\$\}([^}]*)$/;function on(e,n,t=new Uint16Array(6)){const s=e.indexOf("/",n),o=s===-1?e.length:s,i=e.substring(n,o);if(!i||!i.includes("$"))return t[0]=xe,t[1]=n,t[2]=n,t[3]=o,t[4]=o,t[5]=o,t;if(i==="$"){const u=e.length;return t[0]=ve,t[1]=n,t[2]=n,t[3]=u,t[4]=u,t[5]=u,t}if(i.charCodeAt(0)===36)return t[0]=me,t[1]=n,t[2]=n+1,t[3]=o,t[4]=o,t[5]=o,t;const r=i.match(Zo);if(r){const d=r[1].length;return t[0]=ve,t[1]=n+d,t[2]=n+d+1,t[3]=n+d+2,t[4]=n+d+3,t[5]=e.length,t}const a=i.match(Jo);if(a){const u=a[1],d=a[2],h=a[3],c=u.length;return t[0]=ze,t[1]=n+c,t[2]=n+c+3,t[3]=n+c+3+d.length,t[4]=o-h.length,t[5]=o,t}const l=i.match(Yo);if(l){const u=l[1],d=l[2],h=l[3],c=u.length;return t[0]=me,t[1]=n+c,t[2]=n+c+2,t[3]=n+c+2+d.length,t[4]=o-h.length,t[5]=o,t}return t[0]=xe,t[1]=n,t[2]=n,t[3]=o,t[4]=o,t[5]=o,t}function dt(e,n,t,s,o,i,r){r?.(t);let a=s;{const l=t.fullPath??t.from,u=l.length,d=t.options?.caseSensitive??e;for(;a<u;){const c=on(l,a,n);let f;const g=a,p=c[5];switch(a=p+1,i++,c[0]){case xe:{const m=l.substring(c[2],c[3]);if(d){const S=o.static?.get(m);if(S)f=S;else{o.static??=new Map;const y=_e(t.fullPath??t.from);y.parent=o,y.depth=i,f=y,o.static.set(m,y)}}else{const S=m.toLowerCase(),y=o.staticInsensitive?.get(S);if(y)f=y;else{o.staticInsensitive??=new Map;const w=_e(t.fullPath??t.from);w.parent=o,w.depth=i,f=w,o.staticInsensitive.set(S,w)}}break}case me:{const m=l.substring(g,c[1]),S=l.substring(c[4],p),y=d&&!!(m||S),w=m?y?m:m.toLowerCase():void 0,x=S?y?S:S.toLowerCase():void 0,R=o.dynamic?.find(_=>_.caseSensitive===y&&_.prefix===w&&_.suffix===x);if(R)f=R;else{const _=wt(me,t.fullPath??t.from,y,w,x);f=_,_.depth=i,_.parent=o,o.dynamic??=[],o.dynamic.push(_)}break}case ze:{const m=l.substring(g,c[1]),S=l.substring(c[4],p),y=d&&!!(m||S),w=m?y?m:m.toLowerCase():void 0,x=S?y?S:S.toLowerCase():void 0,R=o.optional?.find(_=>_.caseSensitive===y&&_.prefix===w&&_.suffix===x);if(R)f=R;else{const _=wt(ze,t.fullPath??t.from,y,w,x);f=_,_.parent=o,_.depth=i,o.optional??=[],o.optional.push(_)}break}case ve:{const m=l.substring(g,c[1]),S=l.substring(c[4],p),y=d&&!!(m||S),w=m?y?m:m.toLowerCase():void 0,x=S?y?S:S.toLowerCase():void 0,R=wt(ve,t.fullPath??t.from,y,w,x);f=R,R.parent=o,R.depth=i,o.wildcard??=[],o.wildcard.push(R)}}o=f}const h=(t.path||!t.children)&&!t.isRoot;if(h&&l.endsWith("/")){const c=_e(t.fullPath??t.from);c.kind=Ce,c.parent=o,i++,c.depth=i,o.index=c,o=c}h&&!o.route&&(o.route=t,o.fullPath=t.fullPath??t.from)}if(t.children)for(const l of t.children)dt(e,n,l,a,o,i,r)}function yt(e,n){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 ue(e){if(e.static)for(const n of e.static.values())ue(n);if(e.staticInsensitive)for(const n of e.staticInsensitive.values())ue(n);if(e.dynamic?.length){e.dynamic.sort(yt);for(const n of e.dynamic)ue(n)}if(e.optional?.length){e.optional.sort(yt);for(const n of e.optional)ue(n)}if(e.wildcard?.length){e.wildcard.sort(yt);for(const n of e.wildcard)ue(n)}}function _e(e){return{kind:xe,depth:0,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null}}function wt(e,n,t,s,o){return{kind:e,depth:0,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:n,parent:null,caseSensitive:t,prefix:s,suffix:o}}function ei(e,n){const t=_e("/"),s=new Uint16Array(6);for(const o of e)dt(!1,s,o,1,t,0);ue(t),n.masksTree=t,n.flatCache=rt(1e3)}function ti(e,n){e||="/";const t=n.flatCache.get(e);if(t)return t;const s=rn(e,n.masksTree);return n.flatCache.set(e,s),s}function ni(e,n,t,s,o){e||="/",s||="/";const i=n?`case\0${e}`:e;let r=o.singleCache.get(i);if(!r){r=_e("/");const a=new Uint16Array(6);dt(n,a,{from:e},1,r,0),o.singleCache.set(i,r)}return rn(s,r,t)}function si(e,n,t=!1){const s=t?e:`nofuzz\0${e}`,o=n.matchCache.get(s);if(o!==void 0)return o;e||="/";const i=rn(e,n.segmentTree,t);return i&&(i.branch=ai(i.route)),n.matchCache.set(s,i),i}function oi(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function ii(e,n=!1,t){const s=_e(e.fullPath),o=new Uint16Array(6),i={},r={};let a=0;return dt(n,o,e,1,s,0,u=>{if(t?.(u,a),ee(!(u.id in i),`Duplicate routes found with id: ${String(u.id)}`),i[u.id]=u,a!==0&&u.path){const d=oi(u.fullPath);(!r[d]||u.fullPath.endsWith("/"))&&(r[d]=u)}a++}),ue(s),{processedTree:{segmentTree:s,singleCache:rt(1e3),matchCache:rt(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:r}}function rn(e,n,t=!1){const s=e.split("/"),o=ui(e,s,n,t);if(!o)return null;const i=ri(e,s,o);return"**"in o&&(i["**"]=o["**"]),{route:o.node.route,params:i}}function ri(e,n,t){const s=li(t.node);let o=null;const i={};for(let r=0,a=0,l=0;a<s.length;r++,a++,l++){const u=s[a],d=n[r],h=l;if(d&&(l+=d.length),u.kind===me){o??=t.node.fullPath.split("/");const c=o[a],f=u.prefix?.length??0;if(c.charCodeAt(f)===123){const p=u.suffix?.length??0,v=c.substring(f+2,c.length-p-1),m=d.substring(f,d.length-p);i[v]=decodeURIComponent(m)}else{const p=c.substring(1);i[p]=decodeURIComponent(d)}}else if(u.kind===ze){if(t.skipped&1<<a){r--;continue}o??=t.node.fullPath.split("/");const c=o[a],f=u.prefix?.length??0,g=u.suffix?.length??0,p=c.substring(f+3,c.length-g-1),v=u.suffix||u.prefix?d.substring(f,d.length-g):d;v&&(i[p]=decodeURIComponent(v))}else if(u.kind===ve){const c=u,f=e.substring(h+(c.prefix?.length??0),e.length-(c.suffix?.length??0)),g=decodeURIComponent(f);i["*"]=g,i._splat=g;break}}return i}function ai(e){const n=[e];for(;e.parentRoute;)e=e.parentRoute,n.push(e);return n.reverse(),n}function li(e){const n=Array(e.depth+1);do n[e.depth]=e,e=e.parent;while(e);return n}function ui(e,n,t,s){if(e==="/"&&t.index)return{node:t.index,skipped:0};const o=!ot(n),i=o&&e!=="/",r=n.length-(o?1:0),a=[{node:t,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let l=null,u=null,d=null;for(;a.length;){const h=a.pop();let{node:c,index:f,skipped:g,depth:p,statics:v,dynamics:m,optionals:S}=h;s&&c.route&&c.kind!==Ce&&Ie(u,h)&&(u=h);const y=f===r;if(y&&(c.route&&!i&&Ie(d,h)&&(d=h),!c.optional&&!c.wildcard&&!c.index))continue;const w=y?void 0:n[f];let x;if(y&&c.index){const R={node:c.index,index:f,skipped:g,depth:p+1,statics:v,dynamics:m,optionals:S};if(v===r&&!m&&!S&&!g)return R;Ie(d,R)&&(d=R)}if(c.wildcard&&Ie(l,h))for(const R of c.wildcard){const{prefix:_,suffix:C}=R;if(!(_&&(y||!(R.caseSensitive?w:x??=w.toLowerCase()).startsWith(_)))){if(C){if(y)continue;const F=n.slice(f).join("/").slice(-C.length);if((R.caseSensitive?F:F.toLowerCase())!==C)continue}l={node:R,index:r,skipped:g,depth:p,statics:v,dynamics:m,optionals:S};break}}if(c.optional){const R=g|1<<p,_=p+1;for(let C=c.optional.length-1;C>=0;C--){const F=c.optional[C];a.push({node:F,index:f,skipped:R,depth:_,statics:v,dynamics:m,optionals:S})}if(!y)for(let C=c.optional.length-1;C>=0;C--){const F=c.optional[C],{prefix:E,suffix:L}=F;if(E||L){const $=F.caseSensitive?w:x??=w.toLowerCase();if(E&&!$.startsWith(E)||L&&!$.endsWith(L))continue}a.push({node:F,index:f+1,skipped:g,depth:_,statics:v,dynamics:m,optionals:S+1})}}if(!y&&c.dynamic&&w)for(let R=c.dynamic.length-1;R>=0;R--){const _=c.dynamic[R],{prefix:C,suffix:F}=_;if(C||F){const E=_.caseSensitive?w:x??=w.toLowerCase();if(C&&!E.startsWith(C)||F&&!E.endsWith(F))continue}a.push({node:_,index:f+1,skipped:g,depth:p+1,statics:v,dynamics:m+1,optionals:S})}if(!y&&c.staticInsensitive){const R=c.staticInsensitive.get(x??=w.toLowerCase());R&&a.push({node:R,index:f+1,skipped:g,depth:p+1,statics:v+1,dynamics:m,optionals:S})}if(!y&&c.static){const R=c.static.get(w);R&&a.push({node:R,index:f+1,skipped:g,depth:p+1,statics:v+1,dynamics:m,optionals:S})}}if(d&&l)return Ie(l,d)?d:l;if(d)return d;if(l)return l;if(s&&u){let h=u.index;for(let f=0;f<u.index;f++)h+=n[f].length;const c=h===e.length?"/":e.slice(h);return{node:u.node,skipped:u.skipped,"**":decodeURIComponent(c)}}return null}function Ie(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===Ce)>(e.node.kind===Ce)||n.node.kind===Ce==(e.node.kind===Ce)&&n.depth>e.depth))):!0}function Je(e){return an(e.filter(n=>n!==void 0).join("/"))}function an(e){return e.replace(/\/{2,}/g,"/")}function _s(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function he(e){const n=e.length;return n>1&&e[n-1]==="/"?e.replace(/\/{1,}$/,""):e}function Ps(e){return he(_s(e))}function at(e,n){return e?.endsWith("/")&&e!=="/"&&e!==`${n}/`?e.slice(0,-1):e}function ci(e,n,t){return at(e,t)===at(n,t)}function di({base:e,to:n,trailingSlash:t="never",cache:s}){const o=n.startsWith("/"),i=!o&&n===".";let r;if(s){r=o?n:i?e:e+"\0"+n;const h=s.get(r);if(h)return h}let a;if(i)a=e.split("/");else if(o)a=n.split("/");else{for(a=e.split("/");a.length>1&&ot(a)==="";)a.pop();const h=n.split("/");for(let c=0,f=h.length;c<f;c++){const g=h[c];g===""?c?c===f-1&&a.push(g):a=[g]:g===".."?a.pop():g==="."||a.push(g)}}a.length>1&&(ot(a)===""?t==="never"&&a.pop():t==="always"&&a.push(""));let l,u="";for(let h=0;h<a.length;h++){h>0&&(u+="/");const c=a[h];if(!c)continue;l=on(c,0,l);const f=l[0];if(f===xe){u+=c;continue}const g=l[5],p=c.substring(0,l[1]),v=c.substring(l[4],g),m=c.substring(l[2],l[3]);f===me?u+=p||v?`${p}{$${m}}${v}`:`$${m}`:f===ve?u+=p||v?`${p}{$}${v}`:"$":u+=`${p}{-$${m}}${v}`}u=an(u);const d=u||"/";return r&&s&&s.set(r,d),d}function Rt(e,n,t){const s=n[e];return typeof s!="string"?s:e==="_splat"?encodeURI(s):hi(s,t)}function Ct({path:e,params:n,decodeCharMap:t}){let s=!1;const o={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:o,isMissingParams:s};if(!e.includes("$"))return{interpolatedPath:e,usedParams:o,isMissingParams:s};const i=e.length;let r=0,a,l="";for(;r<i;){const d=r;a=on(e,d,a);const h=a[5];if(r=h+1,d===h)continue;const c=a[0];if(c===xe){l+="/"+e.substring(d,h);continue}if(c===ve){const f=n._splat;o._splat=f,o["*"]=f;const g=e.substring(d,a[1]),p=e.substring(a[4],h);if(!f){s=!0,(g||p)&&(l+="/"+g+p);continue}const v=Rt("_splat",n,t);l+="/"+g+v+p;continue}if(c===me){const f=e.substring(a[2],a[3]);!s&&!(f in n)&&(s=!0),o[f]=n[f];const g=e.substring(d,a[1]),p=e.substring(a[4],h),v=Rt(f,n,t)??"undefined";l+="/"+g+v+p;continue}if(c===ze){const f=e.substring(a[2],a[3]),g=n[f];if(g==null)continue;o[f]=g;const p=e.substring(d,a[1]),v=e.substring(a[4],h),m=Rt(f,n,t)??"";l+="/"+p+m+v;continue}}return e.endsWith("/")&&(l+="/"),{usedParams:o,interpolatedPath:l||"/",isMissingParams:s}}function hi(e,n){let t=encodeURIComponent(e);if(n)for(const[s,o]of n)t=t.replaceAll(s,o);return t}function j(e){return!!e?.isNotFound}function fi(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const lt="tsr-scroll-restoration-v1_3",gi=(e,n)=>{let t;return(...s)=>{t||(t=setTimeout(()=>{e(...s),t=null},n))}};function pi(){const e=fi();if(!e)return null;const n=e.getItem(lt);let t=n?JSON.parse(n):{};return{state:t,set:s=>{t=te(s,t)||t;try{e.setItem(lt,JSON.stringify(t))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const qe=pi(),Nt=e=>e.state.__TSR_key||e.href;function mi(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 ut=!1;function xs({storageKey:e,key:n,behavior:t,shouldScrollRestoration:s,scrollToTopSelectors:o,location:i}){let r;try{r=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(u){console.error(u);return}const a=n||window.history.state?.__TSR_key,l=r[a];ut=!0;e:{if(s&&l&&Object.keys(l).length>0){for(const h in l){const c=l[h];if(h==="window")window.scrollTo({top:c.scrollY,left:c.scrollX,behavior:t});else if(h){const f=document.querySelector(h);f&&(f.scrollLeft=c.scrollX,f.scrollTop=c.scrollY)}}break e}const u=(i??window.location).hash.split("#",2)[1];if(u){const h=window.history.state?.__hashScrollIntoViewOptions??!0;if(h){const c=document.getElementById(u);c&&c.scrollIntoView(h)}break e}const d={top:0,left:0,behavior:t};if(window.scrollTo(d),o)for(const h of o){if(h==="window")continue;const c=typeof h=="function"?h():document.querySelector(h);c&&c.scrollTo(d)}}ut=!1}function vi(e,n){if(!qe&&!e.isServer||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isServer||e.isScrollRestorationSetup||!qe))return;e.isScrollRestorationSetup=!0,ut=!1;const s=e.options.getScrollRestorationKey||Nt;window.history.scrollRestoration="manual";const o=i=>{if(ut||!e.isScrollRestoring)return;let r="";if(i.target===document||i.target===window)r="window";else{const l=i.target.getAttribute("data-scroll-restoration-id");l?r=`[data-scroll-restoration-id="${l}"]`:r=mi(i.target)}const a=s(e.state.location);qe.set(l=>{const u=l[a]||={},d=u[r]||={};if(r==="window")d.scrollX=window.scrollX||0,d.scrollY=window.scrollY||0;else if(r){const h=document.querySelector(r);h&&(d.scrollX=h.scrollLeft||0,d.scrollY=h.scrollTop||0)}return l})};typeof document<"u"&&document.addEventListener("scroll",gi(o,100),!0),e.subscribe("onRendered",i=>{const r=s(i.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(xs({storageKey:lt,key:r,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&qe.set(a=>(a[r]||={},a)))})}function Si(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 yi(e,n=String){const t=new URLSearchParams;for(const s in e){const o=e[s];o!==void 0&&t.set(s,n(o))}return t.toString()}function _t(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function wi(e){const n=new URLSearchParams(e),t={};for(const[s,o]of n.entries()){const i=t[s];i==null?t[s]=_t(o):Array.isArray(i)?i.push(_t(o)):t[s]=[i,_t(o)]}return t}const Ri=_i(JSON.parse),Ci=Pi(JSON.stringify,JSON.parse);function _i(e){return n=>{n[0]==="?"&&(n=n.substring(1));const t=wi(n);for(const s in t){const o=t[s];if(typeof o=="string")try{t[s]=e(o)}catch{}}return t}}function Pi(e,n){const t=typeof n=="function";function s(o){if(typeof o=="object"&&o!==null)try{return e(o)}catch{}else if(t&&typeof o=="string")try{return n(o),e(o)}catch{}return o}return o=>{const i=yi(o,s);return i?`?${i}`:""}}const B="__root__";function xi(e){if(e.statusCode=e.statusCode||e.code||307,!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 q(e){return e instanceof Response&&!!e.options}const Ze=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},ht=(e,n)=>!!(e.preload&&!e.router.state.matches.some(t=>t.id===n)),ln=(e,n,t=!0)=>{const s={...e.router.options.context??{}},o=t?n:n-1;for(let i=0;i<=o;i++){const r=e.matches[i];if(!r)continue;const a=e.router.getMatch(r.id);a&&Object.assign(s,a.__routeContext,a.__beforeLoadContext)}return s},Ms=(e,n)=>{const t=e.router.routesById[n.routeId??""]??e.router.routeTree;!t.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(t.options.notFoundComponent=e.router.options.defaultNotFoundComponent),ee(t.options.notFoundComponent);const s=e.matches.find(o=>o.routeId===t.id);ee(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,Ms(e,n))},ne=(e,n,t)=>{if(!(!q(t)&&!j(t))){if(q(t)&&t.redirectHandled&&!t.options.reloadDocument)throw t;if(n){n._nonReactive.beforeLoadPromise?.resolve(),n._nonReactive.loaderPromise?.resolve(),n._nonReactive.beforeLoadPromise=void 0,n._nonReactive.loaderPromise=void 0;const s=q(t)?"redirected":"notFound";n._nonReactive.error=t,e.updateMatch(n.id,o=>({...o,status:s,isFetching:!1,error:t})),j(t)&&!t.routeId&&(t.routeId=n.routeId),n._nonReactive.loadPromise?.resolve()}throw q(t)?(e.rendered=!0,t.options._fromLocation=e.location,t.redirectHandled=!0,t=e.router.resolveRedirect(t),t):(Ms(e,t),t)}},Fs=(e,n)=>{const t=e.router.getMatch(n);return!!(!e.router.isServer&&t._nonReactive.dehydrated||e.router.isServer&&t.ssr===!1)},be=(e,n,t,s)=>{const{id:o,routeId:i}=e.matches[n],r=e.router.looseRoutesById[i];if(t instanceof Promise)throw t;t.routerCode=s,e.firstBadMatchIndex??=n,ne(e,e.router.getMatch(o),t);try{r.options.onError?.(t)}catch(a){t=a,ne(e,e.router.getMatch(o),t)}e.updateMatch(o,a=>(a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,a._nonReactive.loadPromise?.resolve(),{...a,error:t,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},Mi=(e,n,t,s)=>{const o=e.router.getMatch(n),i=e.matches[t-1]?.id,r=i?e.router.getMatch(i):void 0;if(e.router.isShell()){o.ssr=s.id===B;return}if(r?.ssr===!1){o.ssr=!1;return}const a=f=>f===!0&&r?.ssr==="data-only"?"data-only":f,l=e.router.options.defaultSsr??!0;if(s.options.ssr===void 0){o.ssr=a(l);return}if(typeof s.options.ssr!="function"){o.ssr=a(s.options.ssr);return}const{search:u,params:d}=o,h={search:Ke(u,o.searchError),params:Ke(d,o.paramsError),location:e.location,matches:e.matches.map(f=>({index:f.index,pathname:f.pathname,fullPath:f.fullPath,staticData:f.staticData,id:f.id,routeId:f.routeId,search:Ke(f.search,f.searchError),params:Ke(f.params,f.paramsError),ssr:f.ssr}))},c=s.options.ssr(h);if(re(c))return c.then(f=>{o.ssr=a(f??l)});o.ssr=a(c??l)},Is=(e,n,t,s)=>{if(s._nonReactive.pendingTimeout!==void 0)return;const o=t.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!e.router.isServer&&!ht(e,n)&&(t.options.loader||t.options.beforeLoad||Ls(t))&&typeof o=="number"&&o!==1/0&&(t.options.pendingComponent??e.router.options?.defaultPendingComponent))){const r=setTimeout(()=>{Ze(e)},o);s._nonReactive.pendingTimeout=r}},Fi=(e,n,t)=>{const s=e.router.getMatch(n);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;Is(e,n,t,s);const o=()=>{const i=e.router.getMatch(n);i.preload&&(i.status==="redirected"||i.status==="notFound")&&ne(e,i,i.error)};return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(o):o()},Ii=(e,n,t,s)=>{const o=e.router.getMatch(n),i=o._nonReactive.loadPromise;o._nonReactive.loadPromise=Pe(()=>{i?.resolve()});const{paramsError:r,searchError:a}=o;r&&be(e,t,r,"PARSE_PARAMS"),a&&be(e,t,a,"VALIDATE_SEARCH"),Is(e,n,s,o);const l=new AbortController,u=e.matches[t-1]?.id;(u?e.router.getMatch(u):void 0)?.context??e.router.options.context;let h=!1;const c=()=>{h||(h=!0,e.updateMatch(n,R=>({...R,isFetching:"beforeLoad",fetchCount:R.fetchCount+1,abortController:l})))},f=()=>{o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,e.updateMatch(n,R=>({...R,isFetching:!1}))};if(!s.options.beforeLoad){De(()=>{c(),f()});return}o._nonReactive.beforeLoadPromise=Pe();const g={...ln(e,t,!1),...o.__routeContext},{search:p,params:v,cause:m}=o,S=ht(e,n),y={search:p,abortController:l,params:v,preload:S,context:g,location:e.location,navigate:R=>e.router.navigate({...R,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:S?"preload":m,matches:e.matches,...e.router.options.additionalContext},w=R=>{if(R===void 0){De(()=>{c(),f()});return}(q(R)||j(R))&&(c(),be(e,t,R,"BEFORE_LOAD")),De(()=>{c(),e.updateMatch(n,_=>({..._,__beforeLoadContext:R})),f()})};let x;try{if(x=s.options.beforeLoad(y),re(x))return c(),x.catch(R=>{be(e,t,R,"BEFORE_LOAD")}).then(w)}catch(R){c(),be(e,t,R,"BEFORE_LOAD")}w(x)},bi=(e,n)=>{const{id:t,routeId:s}=e.matches[n],o=e.router.looseRoutesById[s],i=()=>{if(e.router.isServer){const l=Mi(e,t,n,o);if(re(l))return l.then(a)}return a()},r=()=>Ii(e,t,n,o),a=()=>{if(Fs(e,t))return;const l=Fi(e,t,o);return re(l)?l.then(r):r()};return i()},Ei=(e,n,t)=>{const s=e.router.getMatch(n);if(!s||!t.options.head&&!t.options.scripts&&!t.options.headers)return;const o={matches:e.matches,match:s,params:s.params,loaderData:s.loaderData};return Promise.all([t.options.head?.(o),t.options.scripts?.(o),t.options.headers?.(o)]).then(([i,r,a])=>{const l=i?.meta,u=i?.links,d=i?.scripts,h=i?.styles;return{meta:l,links:u,headScripts:d,headers:a,scripts:r,styles:h}})},bs=(e,n,t,s)=>{const o=e.matchPromises[t-1],{params:i,loaderDeps:r,abortController:a,cause:l}=e.router.getMatch(n),u=ln(e,t),d=ht(e,n);return{params:i,deps:r,preload:!!d,parentMatchPromise:o,abortController:a,context:u,location:e.location,navigate:h=>e.router.navigate({...h,_fromLocation:e.location}),cause:d?"preload":l,route:s,...e.router.options.additionalContext}},Un=async(e,n,t,s)=>{try{const o=e.router.getMatch(n);try{(!e.router.isServer||o.ssr===!0)&&Es(s);const i=s.options.loader?.(bs(e,n,t,s)),r=s.options.loader&&re(i);if((r||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||o._nonReactive.minPendingPromise)&&e.updateMatch(n,u=>({...u,isFetching:"loader"})),s.options.loader){const u=r?await i:i;ne(e,e.router.getMatch(n),u),u!==void 0&&e.updateMatch(n,d=>({...d,loaderData:u}))}s._lazyPromise&&await s._lazyPromise;const l=o._nonReactive.minPendingPromise;l&&await l,s._componentsPromise&&await s._componentsPromise,e.updateMatch(n,u=>({...u,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(i){let r=i;const a=o._nonReactive.minPendingPromise;a&&await a,j(i)&&await s.options.notFoundComponent?.preload?.(),ne(e,e.router.getMatch(n),i);try{s.options.onError?.(i)}catch(l){r=l,ne(e,e.router.getMatch(n),l)}e.updateMatch(n,l=>({...l,error:r,status:"error",isFetching:!1}))}}catch(o){const i=e.router.getMatch(n);i&&(i._nonReactive.loaderPromise=void 0),ne(e,i,o)}},Li=async(e,n)=>{const{id:t,routeId:s}=e.matches[n];let o=!1,i=!1;const r=e.router.looseRoutesById[s],a=()=>{e.updateMatch(t,d=>({...d,context:ln(e,n)}))};if(Fs(e,t)){if(e.router.isServer)return e.router.getMatch(t)}else{const d=e.router.getMatch(t);if(d._nonReactive.loaderPromise){if(d.status==="success"&&!e.sync&&!d.preload)return d;await d._nonReactive.loaderPromise;const h=e.router.getMatch(t),c=h._nonReactive.error||h.error;c&&ne(e,h,c)}else{const h=Date.now()-d.updatedAt,c=ht(e,t),f=c?r.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:r.options.staleTime??e.router.options.defaultStaleTime??0,g=r.options.shouldReload,p=typeof g=="function"?g(bs(e,t,n,r)):g,v=!!c&&!e.router.state.matches.some(w=>w.id===t),m=e.router.getMatch(t);m._nonReactive.loaderPromise=Pe(),v!==m.preload&&e.updateMatch(t,w=>({...w,preload:v}));const{status:S,invalid:y}=m;o=S==="success"&&(y||(p??h>f)),c&&r.options.preload===!1||(o&&!e.sync?(i=!0,(async()=>{try{await Un(e,t,n,r),a();const w=e.router.getMatch(t);w._nonReactive.loaderPromise?.resolve(),w._nonReactive.loadPromise?.resolve(),w._nonReactive.loaderPromise=void 0}catch(w){q(w)&&await e.router.navigate(w.options)}})()):(S!=="success"||o&&e.sync)&&await Un(e,t,n,r))}}const l=e.router.getMatch(t);i||(l._nonReactive.loaderPromise?.resolve(),l._nonReactive.loadPromise?.resolve()),clearTimeout(l._nonReactive.pendingTimeout),l._nonReactive.pendingTimeout=void 0,i||(l._nonReactive.loaderPromise=void 0),l._nonReactive.dehydrated=void 0,i||a();const u=i?l.isFetching:!1;return u!==l.isFetching||l.invalid!==!1?(e.updateMatch(t,d=>({...d,isFetching:u,invalid:!1})),e.router.getMatch(t)):l};async function Gn(e){const n=Object.assign(e,{matchPromises:[]});!n.router.isServer&&n.router.state.matches.some(t=>t._forcePending)&&Ze(n);try{for(let a=0;a<n.matches.length;a++){const l=bi(n,a);re(l)&&await l}const t=n.firstBadMatchIndex??n.matches.length;for(let a=0;a<t;a++)n.matchPromises.push(Li(n,a));const o=(await Promise.allSettled(n.matchPromises)).filter(a=>a.status==="rejected").map(a=>a.reason);let i;for(const a of o){if(q(a))throw a;!i&&j(a)&&(i=a)}for(const a of n.matches){const{id:l,routeId:u}=a,d=n.router.looseRoutesById[u];try{const h=Ei(n,l,d);if(h){const c=await h;n.updateMatch(l,f=>({...f,...c}))}}catch(h){console.error(`Error executing head for route ${u}:`,h)}}if(i)throw i;const r=Ze(n);re(r)&&await r}catch(t){if(j(t)&&!n.preload){const s=Ze(n);throw re(s)&&await s,t}if(q(t))throw t}return n.matches}async function Es(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=()=>{const t=[];for(const s of Os){const o=e.options[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 Ke(e,n){return n?{status:"error",error:n}:{status:"success",value:e}}function Ls(e){for(const n of Os)if(e.options[n]?.preload)return!0;return!1}const Os=["component","errorComponent","pendingComponent","notFoundComponent"];function Oi(e){return{input:({url:n})=>{for(const t of e)n=Ts(t,n);return n},output:({url:n})=>{for(let t=e.length-1;t>=0;t--)n=$s(e[t],n);return n}}}function Ti(e){const n=Ps(e.basepath),t=`/${n}`,s=`${t}/`,o=e.caseSensitive?t:t.toLowerCase(),i=e.caseSensitive?s:s.toLowerCase();return{input:({url:r})=>{const a=e.caseSensitive?r.pathname:r.pathname.toLowerCase();return a===o?r.pathname="/":a.startsWith(i)&&(r.pathname=r.pathname.slice(t.length)),r},output:({url:r})=>(r.pathname=Je(["/",n,r.pathname]),r)}}function Ts(e,n){const t=e?.input?.({url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function $s(e,n){const t=e?.output?.({url:n});if(t){if(typeof t=="string")return new URL(t);if(t instanceof URL)return t}return n}function fe(e){const n=e.resolvedLocation,t=e.location,s=n?.pathname!==t.pathname,o=n?.href!==t.href,i=n?.hash!==t.hash;return{fromLocation:n,toLocation:t,pathChanged:s,hrefChanged:o,hashChanged:i}}class $i{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=>{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,o=this.basepath??s?.basepath??"/",i=this.basepath===void 0,r=s?.rewrite;this.options={...s,...t},this.isServer=this.options.isServer??typeof document>"u",this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(c=>[encodeURIComponent(c),c])):void 0,(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.isServer||(this.history=Go())),this.origin=this.options.origin,this.origin||(!this.isServer&&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,this.buildRouteTree()),!this.__store&&this.latestLocation&&(this.__store=new Ho(Ai(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(c=>!["redirected"].includes(c.status))}}}),vi(this));let a=!1;const l=this.options.basepath??"/",u=this.options.rewrite;if(i||o!==l||r!==u){this.basepath=l;const c=[];Ps(l)!==""&&c.push(Ti({basepath:l})),u&&c.push(u),this.rewrite=c.length===0?void 0:c.length===1?c[0]:Oi(c),this.history&&this.updateLatestLocation(),a=!0}a&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.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{routesById:t,routesByPath:s,processedTree:o}=ii(this.routeTree,this.options.caseSensitive,(r,a)=>{r.init({originalIndex:a})});this.options.routeMasks&&ei(this.options.routeMasks,o),this.routesById=t,this.routesByPath=s,this.processedTree=o;const i=this.options.notFoundRoute;i&&(i.init({originalIndex:99999999999}),this.routesById[i.id]=i)},this.subscribe=(t,s)=>{const o={eventType:t,fn:s};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=t=>{this.subscribers.forEach(s=>{s.eventType===t.type&&s.fn(t)})},this.parseLocation=(t,s)=>{const o=({href:l,state:u})=>{const d=new URL(l,this.origin),h=Ts(this.rewrite,d),c=this.options.parseSearch(h.search),f=this.options.stringifySearch(c);return h.search=f,{href:h.href.replace(h.origin,""),publicHref:l,url:h,pathname:Hn(h.pathname),searchStr:f,search:G(s?.search,c),hash:h.hash.split("#").reverse()[0]??"",state:G(s?.state,u)}},i=o(t),{__tempLocation:r,__tempKey:a}=i.state;if(r&&(!a||a===this.tempLocationKey)){const l=o(r);return l.state.key=i.state.key,l.state.__TSR_key=i.state.__TSR_key,delete l.state.__tempLocation,{...l,maskedLocation:i}}return i},this.resolvePathCache=rt(1e3),this.resolvePathWithBase=(t,s)=>di({base:t,to:an(s),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,s,o)=>typeof t=="string"?this.matchRoutesInternal({pathname:t,search:s},o):this.matchRoutesInternal(t,s),this.getMatchedRoutes=t=>ki({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(i=>i.status==="pending"),s=this.state.matches.filter(i=>i.isFetching==="loader");new Set([...this.state.pendingMatches??[],...t,...s]).forEach(i=>{this.cancelMatch(i.id)})},this.buildLocation=t=>{const s=(i={})=>{const r=i._fromLocation||this.pendingBuiltLocation||this.latestLocation,a=this.matchRoutes(r,{_buildLocation:!0}),l=ot(a);i.from;const u=i.unsafeRelative==="path"?r.pathname:i.from??l.fullPath,d=this.resolvePathWithBase(u,"."),h=l.search,c={...l.params},f=i.to?this.resolvePathWithBase(d,`${i.to}`):this.resolvePathWithBase(d,"."),g=i.params===!1||i.params===null?{}:(i.params??!0)===!0?c:Object.assign(c,te(i.params,c)),p=Ct({path:f,params:g}).interpolatedPath,v=this.matchRoutes(p,void 0,{_buildLocation:!0}).map(E=>this.looseRoutesById[E.routeId]);if(Object.keys(g).length>0)for(const E of v){const L=E.options.params?.stringify??E.options.stringifyParams;L&&Object.assign(g,L(g))}const m=t.leaveParams?f:Hn(Ct({path:f,params:g,decodeCharMap:this.pathParamsDecodeCharMap}).interpolatedPath);let S=h;if(t._includeValidateSearch&&this.options.search?.strict){const E={};v.forEach(L=>{if(L.options.validateSearch)try{Object.assign(E,qt(L.options.validateSearch,{...E,...S}))}catch{}}),S=E}S=Vi({search:S,dest:i,destRoutes:v,_includeValidateSearch:t._includeValidateSearch}),S=G(h,S);const y=this.options.stringifySearch(S),w=i.hash===!0?r.hash:i.hash?te(i.hash,r.hash):void 0,x=w?`#${w}`:"";let R=i.state===!0?r.state:i.state?te(i.state,r.state):{};R=G(r.state,R);const _=`${m}${y}${x}`,C=new URL(_,this.origin),F=$s(this.rewrite,C);return{publicHref:F.pathname+F.search+F.hash,href:_,url:F,pathname:m,search:S,searchStr:y,state:R,hash:w??"",unmaskOnReload:i.unmaskOnReload}},o=(i={},r)=>{const a=s(i);let l=r?s(r):void 0;if(!l){const u={};if(this.options.routeMasks){const d=ti(a.pathname,this.processedTree);if(d){Object.assign(u,d.params);const{from:h,params:c,...f}=d.route,g=c===!1||c===null?{}:(c??!0)===!0?u:Object.assign(u,te(c,u));r={from:t.from,...f,params:g},l=s(r)}}}return l&&(a.maskedLocation=l),a};return t.mask?o(t,{from:t.from,...t.mask}):o(t)},this.commitLocation=({viewTransition:t,ignoreBlocker:s,...o})=>{const i=()=>{const l=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];l.forEach(d=>{o.state[d]=this.latestLocation.state[d]});const u=de(o.state,this.latestLocation.state);return l.forEach(d=>{delete o.state[d]}),u},r=he(this.latestLocation.href)===he(o.href),a=this.commitLocationPromise;if(this.commitLocationPromise=Pe(()=>{a?.resolve()}),r&&i())this.load();else{let{maskedLocation:l,hashScrollIntoView:u,url:d,...h}=o;l&&(h={...l,state:{...l.state,__tempKey:void 0,__tempLocation:{...h,search:h.searchStr,state:{...h.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(h.unmaskOnReload??this.options.unmaskOnReload??!1)&&(h.state.__tempKey=this.tempLocationKey)),h.state.__hashScrollIntoViewOptions=u??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[o.replace?"replace":"push"](h.publicHref,h.state,{ignoreBlocker:s})}return this.resetNextScroll=o.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:t,resetScroll:s,hashScrollIntoView:o,viewTransition:i,ignoreBlocker:r,href:a,...l}={})=>{if(a){const h=this.history.location.state.__TSR_index,c=st(a,{__TSR_index:t?h:h+1});l.to=c.pathname,l.search=this.options.parseSearch(c.search),l.hash=c.hash.slice(1)}const u=this.buildLocation({...l,_includeValidateSearch:!0});this.pendingBuiltLocation=u;const d=this.commitLocation({...u,viewTransition:i,replace:t,resetScroll:s,hashScrollIntoView:o,ignoreBlocker:r});return Promise.resolve().then(()=>{this.pendingBuiltLocation===u&&(this.pendingBuiltLocation=void 0)}),d},this.navigate=async({to:t,reloadDocument:s,href:o,publicHref:i,...r})=>{let a=!1;if(o)try{new URL(`${o}`),a=!0}catch{}if(a&&!s&&(s=!0),s){if(!o||!i&&!a){const u=this.buildLocation({to:t,...r});o=o??u.url.href,i=i??u.url.href}const l=!a&&i?i:o;if(!r.ignoreBlocker){const d=this.history.getBlockers?.()??[];for(const h of d)if(h?.blockerFn&&await h.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return r.replace?window.location.replace(l):window.location.href=l,Promise.resolve()}return this.buildAndCommitLocation({...r,href:o,to:t,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),this.isServer){const s=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(this.latestLocation.publicHref!==s.publicHref||s.url.origin!==this.origin){const o=this.getParsedLocationHref(s);throw xi({href:o})}}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(o=>!t.some(i=>i.id===o.id))}))},this.load=async t=>{let s,o,i;for(i=new Promise(a=>{this.startTransition(async()=>{try{this.beforeLoad();const l=this.latestLocation,u=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...fe({resolvedLocation:u,location:l})}),this.emit({type:"onBeforeLoad",...fe({resolvedLocation:u,location:l})}),await Gn({router:this,sync:t?.sync,matches:this.state.pendingMatches,location:l,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let d=[],h=[],c=[];De(()=>{this.__store.setState(f=>{const g=f.matches,p=f.pendingMatches||f.matches;return d=g.filter(v=>!p.some(m=>m.id===v.id)),h=p.filter(v=>!g.some(m=>m.id===v.id)),c=p.filter(v=>g.some(m=>m.id===v.id)),{...f,isLoading:!1,loadedAt:Date.now(),matches:p,pendingMatches:void 0,cachedMatches:[...f.cachedMatches,...d.filter(v=>v.status!=="error"&&v.status!=="notFound")]}}),this.clearExpiredCache()}),[[d,"onLeave"],[h,"onEnter"],[c,"onStay"]].forEach(([f,g])=>{f.forEach(p=>{this.looseRoutesById[p.routeId].options[g]?.(p)})})})})}})}catch(l){q(l)?(s=l,this.isServer||this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):j(l)&&(o=l),this.__store.setState(u=>({...u,statusCode:s?s.status:o?404:u.matches.some(d=>d.status==="error")?500:200,redirect:s}))}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),a()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let r;this.hasNotFoundMatch()?r=404:this.__store.state.matches.some(a=>a.status==="error")&&(r=500),r!==void 0&&this.__store.setState(a=>({...a,statusCode:r}))},this.startViewTransition=t=>{const s=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let o;if(typeof s=="object"&&this.isViewTransitionTypesSupported){const i=this.latestLocation,r=this.state.resolvedLocation,a=typeof s.types=="function"?s.types(fe({resolvedLocation:r,location:i})):s.types;if(a===!1){t();return}o={update:t,types:a}}else o=t;document.startViewTransition(o)}else t()},this.updateMatch=(t,s)=>{this.startTransition(()=>{const o=this.state.pendingMatches?.some(i=>i.id===t)?"pendingMatches":this.state.matches.some(i=>i.id===t)?"matches":this.state.cachedMatches.some(i=>i.id===t)?"cachedMatches":"";o&&this.__store.setState(i=>({...i,[o]:i[o]?.map(r=>r.id===t?s(r):r)}))})},this.getMatch=t=>{const s=o=>o.id===t;return this.state.cachedMatches.find(s)??this.state.pendingMatches?.find(s)??this.state.matches.find(s)},this.invalidate=t=>{const s=o=>t?.filter?.(o)??!0?{...o,invalid:!0,...t?.forcePending||o.status==="error"||o.status==="notFound"?{status:"pending",error:void 0}:void 0}:o;return this.__store.setState(o=>({...o,matches:o.matches.map(s),cachedMatches:o.cachedMatches.map(s),pendingMatches:o.pendingMatches?.map(s)})),this.shouldViewTransition=!1,this.load({sync:t?.sync})},this.getParsedLocationHref=t=>{let s=t.url.href;return this.origin&&t.url.origin===this.origin&&(s=s.replace(this.origin,"")||"/"),s},this.resolveRedirect=t=>{if(!t.options.href){const s=this.buildLocation(t.options),o=this.getParsedLocationHref(s);t.options.href=s.href,t.headers.set("Location",o)}return t.headers.get("Location")||t.headers.set("Location",t.options.href),t},this.clearCache=t=>{const s=t?.filter;s!==void 0?this.__store.setState(o=>({...o,cachedMatches:o.cachedMatches.filter(i=>!s(i))})):this.__store.setState(o=>({...o,cachedMatches:[]}))},this.clearExpiredCache=()=>{const t=s=>{const o=this.looseRoutesById[s.routeId];if(!o.options.loader)return!0;const i=(s.preload?o.options.preloadGcTime??this.options.defaultPreloadGcTime:o.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:Date.now()-s.updatedAt>=i};this.clearCache({filter:t})},this.loadRouteChunk=Es,this.preloadRoute=async t=>{const s=this.buildLocation(t);let o=this.matchRoutes(s,{throwOnError:!0,preload:!0,dest:t});const i=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(a=>a.id)),r=new Set([...i,...this.state.cachedMatches.map(a=>a.id)]);De(()=>{o.forEach(a=>{r.has(a.id)||this.__store.setState(l=>({...l,cachedMatches:[...l.cachedMatches,a]}))})});try{return o=await Gn({router:this,matches:o,location:s,preload:!0,updateMatch:(a,l)=>{i.has(a)?o=o.map(u=>u.id===a?l(u):u):this.updateMatch(a,l)}}),o}catch(a){if(q(a))return a.options.reloadDocument?void 0:await this.preloadRoute({...a.options,_fromLocation:s});j(a)||console.error(a);return}},this.matchRoute=(t,s)=>{const o={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},i=this.buildLocation(o);if(s?.pending&&this.state.status!=="pending")return!1;const a=(s?.pending===void 0?!this.state.isLoading:s.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,l=ni(i.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,a.pathname,this.processedTree);return!l||t.params&&!de(l.params,t.params,{partial:!0})?!1:s?.includeSearch??!0?de(a.search,i.search,{partial:!0})?l.params:!1:l.params},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??Ci,parseSearch:n.parseSearch??Ri}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(n,t){const s=this.getMatchedRoutes(n.pathname),{foundRoute:o,routeParams:i}=s;let{matchedRoutes:r}=s,a=!1;(o?o.path!=="/"&&i["**"]:he(n.pathname))&&(this.options.notFoundRoute?r=[...r,this.options.notFoundRoute]:a=!0);const l=(()=>{if(a){if(this.options.notFoundMode!=="root")for(let h=r.length-1;h>=0;h--){const c=r[h];if(c.children)return c.id}return B}})(),u=[],d=h=>h?.id?h.context??this.options.context??void 0:this.options.context??void 0;return r.forEach((h,c)=>{const f=u[c-1],[g,p,v]=(()=>{const D=f?.search??n.search,K=f?._strictSearch??void 0;try{const W=qt(h.options.validateSearch,{...D})??void 0;return[{...D,...W},{...K,...W},void 0]}catch(W){let Se=W;if(W instanceof ct||(Se=new ct(W.message,{cause:W})),t?.throwOnError)throw Se;return[D,{},Se]}})(),m=h.options.loaderDeps?.({search:g})??"",S=m?JSON.stringify(m):"",{interpolatedPath:y,usedParams:w}=Ct({path:h.fullPath,params:i,decodeCharMap:this.pathParamsDecodeCharMap}),x=h.id+y+S,R=this.getMatch(x),_=this.state.matches.find(D=>D.routeId===h.id),C=R?._strictParams??w;let F;if(!R){const D=h.options.params?.parse??h.options.parseParams;if(D)try{Object.assign(C,D(C))}catch(K){if(j(K)||q(K)?F=K:F=new Di(K.message,{cause:K}),t?.throwOnError)throw F}}Object.assign(i,C);const E=_?"stay":"enter";let L;if(R)L={...R,cause:E,params:_?G(_.params,i):i,_strictParams:C,search:G(_?_.search:R.search,g),_strictSearch:p};else{const D=h.options.loader||h.options.beforeLoad||h.lazyFn||Ls(h)?"pending":"success";L={id:x,ssr:this.isServer?void 0:h.options.ssr,index:c,routeId:h.id,params:_?G(_.params,i):i,_strictParams:C,pathname:y,updatedAt:Date.now(),search:_?G(_.search,g):g,_strictSearch:p,searchError:void 0,status:D,isFetching:!1,error:void 0,paramsError:F,__routeContext:void 0,_nonReactive:{loadPromise:Pe()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:E,loaderDeps:_?G(_.loaderDeps,m):m,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:h.options.staticData||{},fullPath:h.fullPath}}t?.preload||(L.globalNotFound=l===h.id),L.searchError=v;const $=d(f);L.context={...$,...L.__routeContext,...L.__beforeLoadContext},u.push(L)}),u.forEach((h,c)=>{const f=this.looseRoutesById[h.routeId];if(!this.getMatch(h.id)&&t?._buildLocation!==!0){const p=u[c-1],v=d(p);if(f.options.context){const m={deps:h.loaderDeps,params:h.params,context:v??{},location:n,navigate:S=>this.navigate({...S,_fromLocation:n}),buildLocation:this.buildLocation,cause:h.cause,abortController:h.abortController,preload:!!h.preload,matches:u};h.__routeContext=f.options.context(m)??void 0}h.context={...v,...h.__routeContext,...h.__beforeLoadContext}}}),u}}class ct extends Error{}class Di extends Error{}function Ai(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function qt(e,n){if(e==null)return{};if("~standard"in e){const t=e["~standard"].validate(n);if(t instanceof Promise)throw new ct("Async validation not supported");if(t.issues)throw new ct(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 ki({pathname:e,routesById:n,processedTree:t}){const s={},o=he(e);let i;const r=si(o,t,!0);return r&&(i=r.route,Object.assign(s,r.params)),{matchedRoutes:r?.branch||[n[B]],routeParams:s,foundRoute:i}}function Vi({search:e,dest:n,destRoutes:t,_includeValidateSearch:s}){const o=t.reduce((a,l)=>{const u=[];if("search"in l.options)l.options.search?.middlewares&&u.push(...l.options.search.middlewares);else if(l.options.preSearchFilters||l.options.postSearchFilters){const d=({search:h,next:c})=>{let f=h;"preSearchFilters"in l.options&&l.options.preSearchFilters&&(f=l.options.preSearchFilters.reduce((p,v)=>v(p),h));const g=c(f);return"postSearchFilters"in l.options&&l.options.postSearchFilters?l.options.postSearchFilters.reduce((p,v)=>v(p),g):g};u.push(d)}if(s&&l.options.validateSearch){const d=({search:h,next:c})=>{const f=c(h);try{return{...f,...qt(l.options.validateSearch,f)??void 0}}catch{return f}};u.push(d)}return a.concat(u)},[])??[],i=({search:a})=>n.search?n.search===!0?a:te(n.search,a):{};o.push(i);const r=(a,l)=>{if(a>=o.length)return l;const u=o[a];return u({search:l,next:h=>r(a+1,h)})};return r(0,e)}const zi="Error preloading route! ☝️";class Ds{constructor(n){if(this.init=t=>{this.originalIndex=t.originalIndex;const s=this.options,o=!s?.path&&!s?.id;this.parentRoute=this.options.getParentRoute?.(),o?this._path=B:this.parentRoute||ee(!1);let i=o?B:s?.path;i&&i!=="/"&&(i=_s(i));const r=s?.id||i;let a=o?B:Je([this.parentRoute.id===B?"":this.parentRoute.id,r]);i===B&&(i="/"),a!==B&&(a=Je(["/",a]));const l=a===B?"/":Je([this.parentRoute.fullPath,i]);this._path=i,this._id=a,this._fullPath=l,this._to=l},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.options=n||{},this.isRoot=!n?.getParentRoute,n?.id&&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 Bi extends Ds{constructor(n){super(n)}}function un(e){const n=e.errorComponent??ft;return M.jsx(ji,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:t,reset:s})=>t?P.createElement(n,{error:t,reset:s}):e.children})}class ji extends P.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 ft({error:e}){const[n,t]=P.useState(!1);return M.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[M.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[M.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),M.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"})]}),M.jsx("div",{style:{height:".25rem"}}),n?M.jsx("div",{children:M.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?M.jsx("code",{children:e.message}):null})}):null]})}function Hi({children:e,fallback:n=null}){return Ui()?M.jsx(ke.Fragment,{children:e}):M.jsx(ke.Fragment,{children:n})}function Ui(){return ke.useSyncExternalStore(Gi,()=>!0,()=>!1)}function Gi(){return()=>{}}var Pt={exports:{}},xt={},Mt={exports:{}},Ft={};var Nn;function Ni(){if(Nn)return Ft;Nn=1;var e=ls();function n(h,c){return h===c&&(h!==0||1/h===1/c)||h!==h&&c!==c}var t=typeof Object.is=="function"?Object.is:n,s=e.useState,o=e.useEffect,i=e.useLayoutEffect,r=e.useDebugValue;function a(h,c){var f=c(),g=s({inst:{value:f,getSnapshot:c}}),p=g[0].inst,v=g[1];return i(function(){p.value=f,p.getSnapshot=c,l(p)&&v({inst:p})},[h,f,c]),o(function(){return l(p)&&v({inst:p}),h(function(){l(p)&&v({inst:p})})},[h]),r(f),f}function l(h){var c=h.getSnapshot;h=h.value;try{var f=c();return!t(h,f)}catch{return!0}}function u(h,c){return c()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return Ft.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,Ft}var qn;function qi(){return qn||(qn=1,Mt.exports=Ni()),Mt.exports}var Kn;function Ki(){if(Kn)return xt;Kn=1;var e=ls(),n=qi();function t(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var s=typeof Object.is=="function"?Object.is:t,o=n.useSyncExternalStore,i=e.useRef,r=e.useEffect,a=e.useMemo,l=e.useDebugValue;return xt.useSyncExternalStoreWithSelector=function(u,d,h,c,f){var g=i(null);if(g.current===null){var p={hasValue:!1,value:null};g.current=p}else p=g.current;g=a(function(){function m(R){if(!S){if(S=!0,y=R,R=c(R),f!==void 0&&p.hasValue){var _=p.value;if(f(_,R))return w=_}return w=R}if(_=w,s(y,R))return _;var C=c(R);return f!==void 0&&f(_,C)?(y=R,_):(y=R,w=C)}var S=!1,y,w,x=h===void 0?null:h;return[function(){return m(d())},x===null?void 0:function(){return m(x())}]},[d,h,c,f]);var v=o(u,g[0],g[1]);return r(function(){p.hasValue=!0,p.value=v},[v]),l(v),v},xt}var Wn;function Wi(){return Wn||(Wn=1,Pt.exports=Ki()),Pt.exports}var Qi=Wi();function Xi(e,n=s=>s,t={}){const s=t.equal??Yi;return Qi.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,n,s)}function Yi(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,o]of e)if(!n.has(s)||!Object.is(o,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=Qn(e);if(t.length!==Qn(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 Qn(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const It=P.createContext(null);function As(){return typeof document>"u"?It:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=It,It)}function U(e){const n=P.useContext(As());return e?.warn,n}function z(e){const n=U({warn:e?.router===void 0}),t=e?.router||n,s=P.useRef(void 0);return Xi(t.__store,o=>{if(e?.select){if(e.structuralSharing??t.options.defaultStructuralSharing){const i=G(s.current,e.select(o));return s.current=i,i}return e.select(o)}return o})}const gt=P.createContext(void 0),Ji=P.createContext(void 0);function Y(e){const n=P.useContext(e.from?Ji:gt);return z({select:s=>{const o=s.matches.find(i=>e.from?e.from===i.routeId:i.id===n);if(ee(!((e.shouldThrow??!0)&&!o),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),o!==void 0)return e.select?e.select(o):o},structuralSharing:e.structuralSharing})}function cn(e){return Y({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:n=>e.select?e.select(n.loaderData):n.loaderData})}function dn(e){const{select:n,...t}=e;return Y({...t,select:s=>n?n(s.loaderDeps):s.loaderDeps})}function hn(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 fn(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})}const We=typeof window<"u"?P.useLayoutEffect:P.useEffect;function bt(e){const n=P.useRef({value:e,prev:null}),t=n.current.value;return e!==t&&(n.current={value:e,prev:t}),n.current.prev}function Zi(e,n,t={},s={}){P.useEffect(()=>{if(!e.current||s.disabled||typeof IntersectionObserver!="function")return;const o=new IntersectionObserver(([i])=>{n(i)},t);return o.observe(e.current),()=>{o.disconnect()}},[n,t,s.disabled,e])}function er(e){const n=P.useRef(null);return P.useImperativeHandle(e,()=>n.current,[]),n}function gn(e){const n=U();return P.useCallback(t=>n.navigate({...t,from:t.from??e?.from}),[e?.from,n])}function tr(e,n){const t=U(),[s,o]=P.useState(!1),i=P.useRef(!1),r=er(n),{activeProps:a,inactiveProps:l,activeOptions:u,to:d,preload:h,preloadDelay:c,hashScrollIntoView:f,replace:g,startTransition:p,resetScroll:v,viewTransition:m,children:S,target:y,disabled:w,style:x,className:R,onClick:_,onFocus:C,onMouseEnter:F,onMouseLeave:E,onTouchStart:L,ignoreBlocker:$,params:D,search:K,hash:W,state:Se,mask:Xs,reloadDocument:Ca,unsafeRelative:_a,from:Pa,_fromLocation:xa,...Sn}=e,Ys=z({select:O=>O.location.search,structuralSharing:!0}),yn=e.from,Fe=P.useMemo(()=>({...e,from:yn}),[t,Ys,yn,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),J=P.useMemo(()=>t.buildLocation({...Fe}),[t,Fe]),Be=P.useMemo(()=>{if(w)return;let O=J.maskedLocation?J.maskedLocation.url.href:J.url.href,A=!1;return t.origin&&(O.startsWith(t.origin)?O=t.history.createHref(O.replace(t.origin,""))||"/":A=!0),{href:O,external:A}},[w,J.maskedLocation,J.url,t.origin,t.history]),je=P.useMemo(()=>{if(Be?.external)return Be.href;try{return new URL(d),d}catch{}},[d,Be]),ye=e.reloadDocument||je?!1:h??t.options.defaultPreload,mt=c??t.options.defaultPreloadDelay??0,vt=z({select:O=>{if(je)return!1;if(u?.exact){if(!ci(O.location.pathname,J.pathname,t.basepath))return!1}else{const A=at(O.location.pathname,t.basepath),Q=at(J.pathname,t.basepath);if(!(A.startsWith(Q)&&(A.length===Q.length||A[Q.length]==="/")))return!1}return(u?.includeSearch??!0)&&!de(O.location.search,J.search,{partial:!u?.exact,ignoreUndefined:!u?.explicitUndefined})?!1:u?.includeHash?O.location.hash===J.hash:!0}}),le=P.useCallback(()=>{t.preloadRoute({...Fe}).catch(O=>{console.warn(O),console.warn(zi)})},[t,Fe]),Js=P.useCallback(O=>{O?.isIntersecting&&le()},[le]);Zi(r,Js,rr,{disabled:!!w||ye!=="viewport"}),P.useEffect(()=>{i.current||!w&&ye==="render"&&(le(),i.current=!0)},[w,le,ye]);const Zs=O=>{const A=O.currentTarget.getAttribute("target"),Q=y!==void 0?y:A;if(!w&&!ar(O)&&!O.defaultPrevented&&(!Q||Q==="_self")&&O.button===0){O.preventDefault(),us.flushSync(()=>{o(!0)});const _n=t.subscribe("onResolved",()=>{_n(),o(!1)});t.navigate({...Fe,replace:g,resetScroll:v,hashScrollIntoView:f,startTransition:p,viewTransition:m,ignoreBlocker:$})}};if(je)return{...Sn,ref:r,href:je,...S&&{children:S},...y&&{target:y},...w&&{disabled:w},...x&&{style:x},...R&&{className:R},..._&&{onClick:_},...C&&{onFocus:C},...F&&{onMouseEnter:F},...E&&{onMouseLeave:E},...L&&{onTouchStart:L}};const wn=O=>{w||ye&&le()},eo=wn,to=O=>{if(!(w||!ye))if(!mt)le();else{const A=O.target;if(Ee.has(A))return;const Q=setTimeout(()=>{Ee.delete(A),le()},mt);Ee.set(A,Q)}},no=O=>{if(w||!ye||!mt)return;const A=O.target,Q=Ee.get(A);Q&&(clearTimeout(Q),Ee.delete(A))},He=vt?te(a,{})??nr:Et,Ue=vt?Et:te(l,{})??Et,Rn=[R,He.className,Ue.className].filter(Boolean).join(" "),Cn=(x||He.style||Ue.style)&&{...x,...He.style,...Ue.style};return{...Sn,...He,...Ue,href:Be?.href,ref:r,onClick:Le([_,Zs]),onFocus:Le([C,wn]),onMouseEnter:Le([F,to]),onMouseLeave:Le([E,no]),onTouchStart:Le([L,eo]),disabled:!!w,target:y,...Cn&&{style:Cn},...Rn&&{className:Rn},...w&&sr,...vt&&or,...s&&ir}}const Et={},nr={className:"active"},sr={role:"link","aria-disabled":!0},or={"data-status":"active","aria-current":"page"},ir={"data-transitioning":"transitioning"},Ee=new WeakMap,rr={rootMargin:"100px"},Le=e=>n=>{for(const t of e)if(t){if(n.defaultPrevented)return;t(n)}},ks=P.forwardRef((e,n)=>{const{_asChild:t,...s}=e,{type:o,ref:i,...r}=tr(s,n),a=typeof s.children=="function"?s.children({isActive:r["data-status"]==="active"}):s.children;return t===void 0&&delete r.disabled,P.createElement(t||"a",{...r,ref:i},a)});function ar(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class lr extends Ds{constructor(n){super(n),this.useMatch=t=>Y({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Y({...t,from:this.id,select:s=>t?.select?t.select(s.context):s.context}),this.useSearch=t=>fn({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>hn({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>dn({...t,from:this.id}),this.useLoaderData=t=>cn({...t,from:this.id}),this.useNavigate=()=>gn({from:this.fullPath}),this.Link=ke.forwardRef((t,s)=>M.jsx(ks,{ref:s,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}}function ur(e){return new lr(e)}class cr extends Bi{constructor(n){super(n),this.useMatch=t=>Y({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Y({...t,from:this.id,select:s=>t?.select?t.select(s.context):s.context}),this.useSearch=t=>fn({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>hn({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>dn({...t,from:this.id}),this.useLoaderData=t=>cn({...t,from:this.id}),this.useNavigate=()=>gn({from:this.fullPath}),this.Link=ke.forwardRef((t,s)=>M.jsx(ks,{ref:s,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}}function $a(e){return new cr(e)}function Xn(e){return typeof e=="object"?new Yn(e,{silent:!0}).createRoute(e):new Yn(e,{silent:!0}).createRoute}class Yn{constructor(n,t){this.path=n,this.createRoute=s=>{this.silent;const o=ur(s);return o.isRoot=!1,o},this.silent=t?.silent}}class Jn{constructor(n){this.useMatch=t=>Y({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>Y({from:this.options.id,select:s=>t?.select?t.select(s.context):s.context}),this.useSearch=t=>fn({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>hn({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>dn({...t,from:this.options.id}),this.useLoaderData=t=>cn({...t,from:this.options.id}),this.useNavigate=()=>{const t=U();return gn({from:t.routesById[this.options.id].fullPath})},this.options=n,this.$$typeof=Symbol.for("react.memo")}}function Zn(e){return typeof e=="object"?new Jn(e):n=>new Jn({id:e,...n})}function Da(e,n){let t,s,o,i;const r=()=>(t||(t=e().then(l=>{t=void 0,s=l[n]}).catch(l=>{if(o=l,Wo(o)&&o instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const u=`tanstack_router_reload:${o.message}`;sessionStorage.getItem(u)||(sessionStorage.setItem(u,"1"),i=!0)}})),t),a=function(u){if(i)throw window.location.reload(),new Promise(()=>{});if(o)throw o;if(!s)if(P.use)P.use(r());else throw r();return P.createElement(s,u)};return a.preload=r,a}function dr(){const e=U(),n=P.useRef({router:e,mounted:!1}),[t,s]=P.useState(!1),{hasPendingMatches:o,isLoading:i}=z({select:h=>({isLoading:h.isLoading,hasPendingMatches:h.matches.some(c=>c.status==="pending")}),structuralSharing:!0}),r=bt(i),a=i||t||o,l=bt(a),u=i||o,d=bt(u);return e.startTransition=h=>{s(!0),P.startTransition(()=>{h(),s(!1)})},P.useEffect(()=>{const h=e.history.subscribe(e.load),c=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return he(e.latestLocation.publicHref)!==he(c.publicHref)&&e.commitLocation({...c,replace:!0}),()=>{h()}},[e,e.history]),We(()=>{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(c){console.error(c)}})()},[e]),We(()=>{r&&!i&&e.emit({type:"onLoad",...fe(e.state)})},[r,e,i]),We(()=>{d&&!u&&e.emit({type:"onBeforeRouteMount",...fe(e.state)})},[u,d,e]),We(()=>{if(l&&!a){const h=fe(e.state);e.emit({type:"onResolved",...h}),e.__store.setState(c=>({...c,status:"idle",resolvedLocation:c.location})),h.hrefChanged&&Si(e)}},[a,l,e]),null}function hr(e){const n=z({select:t=>`not-found-${t.location.pathname}-${t.status}`});return M.jsx(un,{getResetKey:()=>n,onCatch:(t,s)=>{if(j(t))e.onCatch?.(t,s);else throw t},errorComponent:({error:t})=>{if(j(t))return e.fallback?.(t);throw t},children:e.children})}function fr(){return M.jsx("p",{children:"Not Found"})}function Re(e){return M.jsx(M.Fragment,{children:e.children})}function Vs(e,n,t){return n.options.notFoundComponent?M.jsx(n.options.notFoundComponent,{...t}):e.options.defaultNotFoundComponent?M.jsx(e.options.defaultNotFoundComponent,{...t}):M.jsx(fr,{})}function gr({children:e}){const n=U();return n.isServer?M.jsx("script",{nonce:n.options.ssr?.nonce,dangerouslySetInnerHTML:{__html:e+";document.currentScript.remove()"}}):null}function pr(){const e=U();if(!e.isScrollRestoring||!e.isServer||typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return null;const t=(e.options.getScrollRestorationKey||Nt)(e.latestLocation),s=t!==Nt(e.latestLocation)?t:void 0,o={storageKey:lt,shouldScrollRestoration:!0};return s&&(o.key=s),M.jsx(gr,{children:`(${xs.toString()})(${JSON.stringify(o)})`})}const zs=P.memo(function({matchId:n}){const t=U(),s=z({select:m=>{const S=m.matches.find(y=>y.id===n);return ee(S),{routeId:S.routeId,ssr:S.ssr,_displayPending:S._displayPending}},structuralSharing:!0}),o=t.routesById[s.routeId],i=o.options.pendingComponent??t.options.defaultPendingComponent,r=i?M.jsx(i,{}):null,a=o.options.errorComponent??t.options.defaultErrorComponent,l=o.options.onCatch??t.options.defaultOnCatch,u=o.isRoot?o.options.notFoundComponent??t.options.notFoundRoute?.options.component:o.options.notFoundComponent,d=s.ssr===!1||s.ssr==="data-only",h=(!o.isRoot||o.options.wrapInSuspense||d)&&(o.options.wrapInSuspense??i??(o.options.errorComponent?.preload||d))?P.Suspense:Re,c=a?un:Re,f=u?hr:Re,g=z({select:m=>m.loadedAt}),p=z({select:m=>{const S=m.matches.findIndex(y=>y.id===n);return m.matches[S-1]?.routeId}}),v=o.isRoot?o.options.shellComponent??Re:Re;return M.jsxs(v,{children:[M.jsx(gt.Provider,{value:n,children:M.jsx(h,{fallback:r,children:M.jsx(c,{getResetKey:()=>g,errorComponent:a||ft,onCatch:(m,S)=>{if(j(m))throw m;l?.(m,S)},children:M.jsx(f,{fallback:m=>{if(!u||m.routeId&&m.routeId!==s.routeId||!m.routeId&&!o.isRoot)throw m;return P.createElement(u,m)},children:d||s._displayPending?M.jsx(Hi,{fallback:r,children:M.jsx(es,{matchId:n})}):M.jsx(es,{matchId:n})})})})}),p===B&&t.options.scrollRestoration?M.jsxs(M.Fragment,{children:[M.jsx(mr,{}),M.jsx(pr,{})]}):null]})});function mr(){const e=U(),n=P.useRef(void 0);return M.jsx("script",{suppressHydrationWarning:!0,ref:t=>{t&&(n.current===void 0||n.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...fe(e.state)}),n.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const es=P.memo(function({matchId:n}){const t=U(),{match:s,key:o,routeId:i}=z({select:l=>{const u=l.matches.find(g=>g.id===n),d=u.routeId,c=(t.routesById[d].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:d,loaderDeps:u.loaderDeps,params:u._strictParams,search:u._strictSearch});return{key:c?JSON.stringify(c):void 0,routeId:d,match:{id:u.id,status:u.status,error:u.error,invalid:u.invalid,_forcePending:u._forcePending,_displayPending:u._displayPending}}},structuralSharing:!0}),r=t.routesById[i],a=P.useMemo(()=>{const l=r.options.component??t.options.defaultComponent;return l?M.jsx(l,{},o):M.jsx(vr,{})},[o,r.options.component,t.options.defaultComponent]);if(s._displayPending)throw t.getMatch(s.id)?._nonReactive.displayPendingPromise;if(s._forcePending)throw t.getMatch(s.id)?._nonReactive.minPendingPromise;if(s.status==="pending"){const l=r.options.pendingMinMs??t.options.defaultPendingMinMs;if(l){const u=t.getMatch(s.id);if(u&&!u._nonReactive.minPendingPromise&&!t.isServer){const d=Pe();u._nonReactive.minPendingPromise=d,setTimeout(()=>{d.resolve(),u._nonReactive.minPendingPromise=void 0},l)}}throw t.getMatch(s.id)?._nonReactive.loadPromise}if(s.status==="notFound")return ee(j(s.error)),Vs(t,r,s.error);if(s.status==="redirected")throw ee(q(s.error)),t.getMatch(s.id)?._nonReactive.loadPromise;if(s.status==="error"){if(t.isServer){const l=(r.options.errorComponent??t.options.defaultErrorComponent)||ft;return M.jsx(l,{error:s.error,reset:void 0,info:{componentStack:""}})}throw s.error}return a}),vr=P.memo(function(){const n=U(),t=P.useContext(gt),s=z({select:u=>u.matches.find(d=>d.id===t)?.routeId}),o=n.routesById[s],i=z({select:u=>{const h=u.matches.find(c=>c.id===t);return ee(h),h.globalNotFound}}),r=z({select:u=>{const d=u.matches,h=d.findIndex(c=>c.id===t);return d[h+1]?.id}}),a=n.options.defaultPendingComponent?M.jsx(n.options.defaultPendingComponent,{}):null;if(i)return Vs(n,o,void 0);if(!r)return null;const l=M.jsx(zs,{matchId:r});return s===B?M.jsx(P.Suspense,{fallback:a,children:l}):l});function Sr(){const e=U(),t=e.routesById[B].options.pendingComponent??e.options.defaultPendingComponent,s=t?M.jsx(t,{}):null,o=e.isServer||typeof document<"u"&&e.ssr?Re:P.Suspense,i=M.jsxs(o,{fallback:s,children:[!e.isServer&&M.jsx(dr,{}),M.jsx(yr,{})]});return e.options.InnerWrap?M.jsx(e.options.InnerWrap,{children:i}):i}function yr(){const e=U(),n=z({select:o=>o.matches[0]?.id}),t=z({select:o=>o.loadedAt}),s=n?M.jsx(zs,{matchId:n}):null;return M.jsx(gt.Provider,{value:n,children:e.options.disableGlobalCatchBoundary?s:M.jsx(un,{getResetKey:()=>t,errorComponent:ft,onCatch:o=>{o.message||o.toString()},children:s})})}const Aa=e=>new wr(e);class wr extends $i{constructor(n){super(n)}}typeof globalThis<"u"?(globalThis.createFileRoute=Xn,globalThis.createLazyFileRoute=Zn):typeof window<"u"&&(window.createFileRoute=Xn,window.createLazyFileRoute=Zn);function Rr({router:e,children:n,...t}){Object.keys(t).length>0&&e.update({...e.options,...t,context:{...e.options.context,...t.context}});const s=As(),o=M.jsx(s.Provider,{value:e,children:n});return e.options.Wrap?M.jsx(e.options.Wrap,{children:o}):o}function ka({router:e,...n}){return M.jsx(Rr,{router:e,...n,children:M.jsx(Sr,{})})}function Va(e){return z({select:n=>n.location})}function se(e,n){return typeof e=="function"?e(n):e}function H(e,n){return t=>{n.setState(s=>({...s,[e]:se(t,s[e])}))}}function pt(e){return e instanceof Function}function Cr(e){return Array.isArray(e)&&e.every(n=>typeof n=="number")}function _r(e,n){const t=[],s=o=>{o.forEach(i=>{t.push(i);const r=n(i);r!=null&&r.length&&s(r)})};return s(e),t}function I(e,n,t){let s=[],o;return i=>{let r;t.key&&t.debug&&(r=Date.now());const a=e(i);if(!(a.length!==s.length||a.some((d,h)=>s[h]!==d)))return o;s=a;let u;if(t.key&&t.debug&&(u=Date.now()),o=n(...a),t==null||t.onChange==null||t.onChange(o),t.key&&t.debug&&t!=null&&t.debug()){const d=Math.round((Date.now()-r)*100)/100,h=Math.round((Date.now()-u)*100)/100,c=h/16,f=(g,p)=>{for(g=String(g);g.length<p;)g=" "+g;return g};console.info(`%c⏱ ${f(h,5)} /${f(d,5)} ms`,`
|
|
2
2
|
font-size: .6rem;
|
|
3
3
|
font-weight: bold;
|
|
4
4
|
color: hsl(${Math.max(0,Math.min(120-120*c,120))}deg 100% 31%);`,t?.key)}return o}}function b(e,n,t,s){return{debug:()=>{var o;return(o=e?.debugAll)!=null?o:e[n]},key:!1,onChange:s}}function Pr(e,n,t,s){const o=()=>{var r;return(r=i.getValue())!=null?r:e.options.renderFallbackValue},i={id:`${n.id}_${t.id}`,row:n,column:t,getValue:()=>n.getValue(s),renderValue:o,getContext:I(()=>[e,t,n,i],(r,a,l,u)=>({table:r,column:a,row:l,cell:u,getValue:u.getValue,renderValue:u.renderValue}),b(e.options,"debugCells"))};return e._features.forEach(r=>{r.createCell==null||r.createCell(i,t,n,e)},{}),i}function xr(e,n,t,s){var o,i;const a={...e._getDefaultColumnDef(),...n},l=a.accessorKey;let u=(o=(i=a.id)!=null?i:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,d;if(a.accessorFn?d=a.accessorFn:l&&(l.includes(".")?d=c=>{let f=c;for(const p of l.split(".")){var g;f=(g=f)==null?void 0:g[p]}return f}:d=c=>c[a.accessorKey]),!u)throw new Error;let h={id:`${String(u)}`,accessorFn:d,parent:s,depth:t,columnDef:a,columns:[],getFlatColumns:I(()=>[!0],()=>{var c;return[h,...(c=h.columns)==null?void 0:c.flatMap(f=>f.getFlatColumns())]},b(e.options,"debugColumns")),getLeafColumns:I(()=>[e._getOrderColumnsFn()],c=>{var f;if((f=h.columns)!=null&&f.length){let g=h.columns.flatMap(p=>p.getLeafColumns());return c(g)}return[h]},b(e.options,"debugColumns"))};for(const c of e._features)c.createColumn==null||c.createColumn(h,e);return h}const k="debugHeaders";function ts(e,n,t){var s;let i={id:(s=t.id)!=null?s:n.id,column:n,index:t.index,isPlaceholder:!!t.isPlaceholder,placeholderId:t.placeholderId,depth:t.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const r=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),r.push(l)};return a(i),r},getContext:()=>({table:e,header:i,column:n})};return e._features.forEach(r=>{r.createHeader==null||r.createHeader(i,e)}),i}const Mr={createTable:e=>{e.getHeaderGroups=I(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,t,s,o)=>{var i,r;const a=(i=s?.map(h=>t.find(c=>c.id===h)).filter(Boolean))!=null?i:[],l=(r=o?.map(h=>t.find(c=>c.id===h)).filter(Boolean))!=null?r:[],u=t.filter(h=>!(s!=null&&s.includes(h.id))&&!(o!=null&&o.includes(h.id)));return Qe(n,[...a,...u,...l],e)},b(e.options,k)),e.getCenterHeaderGroups=I(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,t,s,o)=>(t=t.filter(i=>!(s!=null&&s.includes(i.id))&&!(o!=null&&o.includes(i.id))),Qe(n,t,e,"center")),b(e.options,k)),e.getLeftHeaderGroups=I(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(n,t,s)=>{var o;const i=(o=s?.map(r=>t.find(a=>a.id===r)).filter(Boolean))!=null?o:[];return Qe(n,i,e,"left")},b(e.options,k)),e.getRightHeaderGroups=I(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(n,t,s)=>{var o;const i=(o=s?.map(r=>t.find(a=>a.id===r)).filter(Boolean))!=null?o:[];return Qe(n,i,e,"right")},b(e.options,k)),e.getFooterGroups=I(()=>[e.getHeaderGroups()],n=>[...n].reverse(),b(e.options,k)),e.getLeftFooterGroups=I(()=>[e.getLeftHeaderGroups()],n=>[...n].reverse(),b(e.options,k)),e.getCenterFooterGroups=I(()=>[e.getCenterHeaderGroups()],n=>[...n].reverse(),b(e.options,k)),e.getRightFooterGroups=I(()=>[e.getRightHeaderGroups()],n=>[...n].reverse(),b(e.options,k)),e.getFlatHeaders=I(()=>[e.getHeaderGroups()],n=>n.map(t=>t.headers).flat(),b(e.options,k)),e.getLeftFlatHeaders=I(()=>[e.getLeftHeaderGroups()],n=>n.map(t=>t.headers).flat(),b(e.options,k)),e.getCenterFlatHeaders=I(()=>[e.getCenterHeaderGroups()],n=>n.map(t=>t.headers).flat(),b(e.options,k)),e.getRightFlatHeaders=I(()=>[e.getRightHeaderGroups()],n=>n.map(t=>t.headers).flat(),b(e.options,k)),e.getCenterLeafHeaders=I(()=>[e.getCenterFlatHeaders()],n=>n.filter(t=>{var s;return!((s=t.subHeaders)!=null&&s.length)}),b(e.options,k)),e.getLeftLeafHeaders=I(()=>[e.getLeftFlatHeaders()],n=>n.filter(t=>{var s;return!((s=t.subHeaders)!=null&&s.length)}),b(e.options,k)),e.getRightLeafHeaders=I(()=>[e.getRightFlatHeaders()],n=>n.filter(t=>{var s;return!((s=t.subHeaders)!=null&&s.length)}),b(e.options,k)),e.getLeafHeaders=I(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(n,t,s)=>{var o,i,r,a,l,u;return[...(o=(i=n[0])==null?void 0:i.headers)!=null?o:[],...(r=(a=t[0])==null?void 0:a.headers)!=null?r:[],...(l=(u=s[0])==null?void 0:u.headers)!=null?l:[]].map(d=>d.getLeafHeaders()).flat()},b(e.options,k))}};function Qe(e,n,t,s){var o,i;let r=0;const a=function(c,f){f===void 0&&(f=1),r=Math.max(r,f),c.filter(g=>g.getIsVisible()).forEach(g=>{var p;(p=g.columns)!=null&&p.length&&a(g.columns,f+1)},0)};a(e);let l=[];const u=(c,f)=>{const g={depth:f,id:[s,`${f}`].filter(Boolean).join("_"),headers:[]},p=[];c.forEach(v=>{const m=[...p].reverse()[0],S=v.column.depth===g.depth;let y,w=!1;if(S&&v.column.parent?y=v.column.parent:(y=v.column,w=!0),m&&m?.column===y)m.subHeaders.push(v);else{const x=ts(t,y,{id:[s,f,y.id,v?.id].filter(Boolean).join("_"),isPlaceholder:w,placeholderId:w?`${p.filter(R=>R.column===y).length}`:void 0,depth:f,index:p.length});x.subHeaders.push(v),p.push(x)}g.headers.push(v),v.headerGroup=g}),l.push(g),f>0&&u(p,f-1)},d=n.map((c,f)=>ts(t,c,{depth:r,index:f}));u(d,r-1),l.reverse();const h=c=>c.filter(g=>g.column.getIsVisible()).map(g=>{let p=0,v=0,m=[0];g.subHeaders&&g.subHeaders.length?(m=[],h(g.subHeaders).forEach(y=>{let{colSpan:w,rowSpan:x}=y;p+=w,m.push(x)})):p=1;const S=Math.min(...m);return v=v+S,g.colSpan=p,g.rowSpan=v,{colSpan:p,rowSpan:v}});return h((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const Fr=(e,n,t,s,o,i,r)=>{let a={id:n,index:s,original:t,depth:o,parentId:r,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const u=e.getColumn(l);if(u!=null&&u.accessorFn)return a._valuesCache[l]=u.accessorFn(a.original,s),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const u=e.getColumn(l);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=u.columnDef.getUniqueValues(a.original,s),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var u;return(u=a.getValue(l))!=null?u:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>_r(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],u=a;for(;;){const d=u.getParentRow();if(!d)break;l.push(d),u=d}return l.reverse()},getAllCells:I(()=>[e.getAllLeafColumns()],l=>l.map(u=>Pr(e,a,u,u.id)),b(e.options,"debugRows")),_getAllCellsByColumnId:I(()=>[a.getAllCells()],l=>l.reduce((u,d)=>(u[d.column.id]=d,u),{}),b(e.options,"debugRows"))};for(let l=0;l<e._features.length;l++){const u=e._features[l];u==null||u.createRow==null||u.createRow(a,e)}return a},Ir={createColumn:(e,n)=>{e._getFacetedRowModel=n.options.getFacetedRowModel&&n.options.getFacetedRowModel(n,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():n.getPreFilteredRowModel(),e._getFacetedUniqueValues=n.options.getFacetedUniqueValues&&n.options.getFacetedUniqueValues(n,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=n.options.getFacetedMinMaxValues&&n.options.getFacetedMinMaxValues(n,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},Bs=(e,n,t)=>{var s,o;const i=t==null||(s=t.toString())==null?void 0:s.toLowerCase();return!!(!((o=e.getValue(n))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(i))};Bs.autoRemove=e=>X(e);const js=(e,n,t)=>{var s;return!!(!((s=e.getValue(n))==null||(s=s.toString())==null)&&s.includes(t))};js.autoRemove=e=>X(e);const Hs=(e,n,t)=>{var s;return((s=e.getValue(n))==null||(s=s.toString())==null?void 0:s.toLowerCase())===t?.toLowerCase()};Hs.autoRemove=e=>X(e);const Us=(e,n,t)=>{var s;return(s=e.getValue(n))==null?void 0:s.includes(t)};Us.autoRemove=e=>X(e);const Gs=(e,n,t)=>!t.some(s=>{var o;return!((o=e.getValue(n))!=null&&o.includes(s))});Gs.autoRemove=e=>X(e)||!(e!=null&&e.length);const Ns=(e,n,t)=>t.some(s=>{var o;return(o=e.getValue(n))==null?void 0:o.includes(s)});Ns.autoRemove=e=>X(e)||!(e!=null&&e.length);const qs=(e,n,t)=>e.getValue(n)===t;qs.autoRemove=e=>X(e);const Ks=(e,n,t)=>e.getValue(n)==t;Ks.autoRemove=e=>X(e);const pn=(e,n,t)=>{let[s,o]=t;const i=e.getValue(n);return i>=s&&i<=o};pn.resolveFilterValue=e=>{let[n,t]=e,s=typeof n!="number"?parseFloat(n):n,o=typeof t!="number"?parseFloat(t):t,i=n===null||Number.isNaN(s)?-1/0:s,r=t===null||Number.isNaN(o)?1/0:o;if(i>r){const a=i;i=r,r=a}return[i,r]};pn.autoRemove=e=>X(e)||X(e[0])&&X(e[1]);const Z={includesString:Bs,includesStringSensitive:js,equalsString:Hs,arrIncludes:Us,arrIncludesAll:Gs,arrIncludesSome:Ns,equals:qs,weakEquals:Ks,inNumberRange:pn};function X(e){return e==null||e===""}const br={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:H("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,n)=>{e.getAutoFilterFn=()=>{const t=n.getCoreRowModel().flatRows[0],s=t?.getValue(e.id);return typeof s=="string"?Z.includesString:typeof s=="number"?Z.inNumberRange:typeof s=="boolean"||s!==null&&typeof s=="object"?Z.equals:Array.isArray(s)?Z.arrIncludes:Z.weakEquals},e.getFilterFn=()=>{var t,s;return pt(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(t=(s=n.options.filterFns)==null?void 0:s[e.columnDef.filterFn])!=null?t:Z[e.columnDef.filterFn]},e.getCanFilter=()=>{var t,s,o;return((t=e.columnDef.enableColumnFilter)!=null?t:!0)&&((s=n.options.enableColumnFilters)!=null?s:!0)&&((o=n.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var t;return(t=n.getState().columnFilters)==null||(t=t.find(s=>s.id===e.id))==null?void 0:t.value},e.getFilterIndex=()=>{var t,s;return(t=(s=n.getState().columnFilters)==null?void 0:s.findIndex(o=>o.id===e.id))!=null?t:-1},e.setFilterValue=t=>{n.setColumnFilters(s=>{const o=e.getFilterFn(),i=s?.find(d=>d.id===e.id),r=se(t,i?i.value:void 0);if(ns(o,r,e)){var a;return(a=s?.filter(d=>d.id!==e.id))!=null?a:[]}const l={id:e.id,value:r};if(i){var u;return(u=s?.map(d=>d.id===e.id?l:d))!=null?u:[]}return s!=null&&s.length?[...s,l]:[l]})}},createRow:(e,n)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=n=>{const t=e.getAllLeafColumns(),s=o=>{var i;return(i=se(n,o))==null?void 0:i.filter(r=>{const a=t.find(l=>l.id===r.id);if(a){const l=a.getFilterFn();if(ns(l,r.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(s)},e.resetColumnFilters=n=>{var t,s;e.setColumnFilters(n?[]:(t=(s=e.initialState)==null?void 0:s.columnFilters)!=null?t:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function ns(e,n,t){return(e&&e.autoRemove?e.autoRemove(n,t):!1)||typeof n>"u"||typeof n=="string"&&!n}const Er=(e,n,t)=>t.reduce((s,o)=>{const i=o.getValue(e);return s+(typeof i=="number"?i:0)},0),Lr=(e,n,t)=>{let s;return t.forEach(o=>{const i=o.getValue(e);i!=null&&(s>i||s===void 0&&i>=i)&&(s=i)}),s},Or=(e,n,t)=>{let s;return t.forEach(o=>{const i=o.getValue(e);i!=null&&(s<i||s===void 0&&i>=i)&&(s=i)}),s},Tr=(e,n,t)=>{let s,o;return t.forEach(i=>{const r=i.getValue(e);r!=null&&(s===void 0?r>=r&&(s=o=r):(s>r&&(s=r),o<r&&(o=r)))}),[s,o]},$r=(e,n)=>{let t=0,s=0;if(n.forEach(o=>{let i=o.getValue(e);i!=null&&(i=+i)>=i&&(++t,s+=i)}),t)return s/t},Dr=(e,n)=>{if(!n.length)return;const t=n.map(i=>i.getValue(e));if(!Cr(t))return;if(t.length===1)return t[0];const s=Math.floor(t.length/2),o=t.sort((i,r)=>i-r);return t.length%2!==0?o[s]:(o[s-1]+o[s])/2},Ar=(e,n)=>Array.from(new Set(n.map(t=>t.getValue(e))).values()),kr=(e,n)=>new Set(n.map(t=>t.getValue(e))).size,Vr=(e,n)=>n.length,Lt={sum:Er,min:Lr,max:Or,extent:Tr,mean:$r,median:Dr,unique:Ar,uniqueCount:kr,count:Vr},zr={getDefaultColumnDef:()=>({aggregatedCell:e=>{var n,t;return(n=(t=e.getValue())==null||t.toString==null?void 0:t.toString())!=null?n:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:H("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,n)=>{e.toggleGrouping=()=>{n.setGrouping(t=>t!=null&&t.includes(e.id)?t.filter(s=>s!==e.id):[...t??[],e.id])},e.getCanGroup=()=>{var t,s;return((t=e.columnDef.enableGrouping)!=null?t:!0)&&((s=n.options.enableGrouping)!=null?s:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var t;return(t=n.getState().grouping)==null?void 0:t.includes(e.id)},e.getGroupedIndex=()=>{var t;return(t=n.getState().grouping)==null?void 0:t.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const t=n.getCoreRowModel().flatRows[0],s=t?.getValue(e.id);if(typeof s=="number")return Lt.sum;if(Object.prototype.toString.call(s)==="[object Date]")return Lt.extent},e.getAggregationFn=()=>{var t,s;if(!e)throw new Error;return pt(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(t=(s=n.options.aggregationFns)==null?void 0:s[e.columnDef.aggregationFn])!=null?t:Lt[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=n=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(n),e.resetGrouping=n=>{var t,s;e.setGrouping(n?[]:(t=(s=e.initialState)==null?void 0:s.grouping)!=null?t:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,n)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=t=>{if(e._groupingValuesCache.hasOwnProperty(t))return e._groupingValuesCache[t];const s=n.getColumn(t);return s!=null&&s.columnDef.getGroupingValue?(e._groupingValuesCache[t]=s.columnDef.getGroupingValue(e.original),e._groupingValuesCache[t]):e.getValue(t)},e._groupingValuesCache={}},createCell:(e,n,t,s)=>{e.getIsGrouped=()=>n.getIsGrouped()&&n.id===t.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&n.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=t.subRows)!=null&&o.length)}}};function Br(e,n,t){if(!(n!=null&&n.length)||!t)return e;const s=e.filter(i=>!n.includes(i.id));return t==="remove"?s:[...n.map(i=>e.find(r=>r.id===i)).filter(Boolean),...s]}const jr={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:H("columnOrder",e)}),createColumn:(e,n)=>{e.getIndex=I(t=>[Ae(n,t)],t=>t.findIndex(s=>s.id===e.id),b(n.options,"debugColumns")),e.getIsFirstColumn=t=>{var s;return((s=Ae(n,t)[0])==null?void 0:s.id)===e.id},e.getIsLastColumn=t=>{var s;const o=Ae(n,t);return((s=o[o.length-1])==null?void 0:s.id)===e.id}},createTable:e=>{e.setColumnOrder=n=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(n),e.resetColumnOrder=n=>{var t;e.setColumnOrder(n?[]:(t=e.initialState.columnOrder)!=null?t:[])},e._getOrderColumnsFn=I(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(n,t,s)=>o=>{let i=[];if(!(n!=null&&n.length))i=o;else{const r=[...n],a=[...o];for(;a.length&&r.length;){const l=r.shift(),u=a.findIndex(d=>d.id===l);u>-1&&i.push(a.splice(u,1)[0])}i=[...i,...a]}return Br(i,t,s)},b(e.options,"debugTable"))}},Ot=()=>({left:[],right:[]}),Hr={getInitialState:e=>({columnPinning:Ot(),...e}),getDefaultOptions:e=>({onColumnPinningChange:H("columnPinning",e)}),createColumn:(e,n)=>{e.pin=t=>{const s=e.getLeafColumns().map(o=>o.id).filter(Boolean);n.setColumnPinning(o=>{var i,r;if(t==="right"){var a,l;return{left:((a=o?.left)!=null?a:[]).filter(h=>!(s!=null&&s.includes(h))),right:[...((l=o?.right)!=null?l:[]).filter(h=>!(s!=null&&s.includes(h))),...s]}}if(t==="left"){var u,d;return{left:[...((u=o?.left)!=null?u:[]).filter(h=>!(s!=null&&s.includes(h))),...s],right:((d=o?.right)!=null?d:[]).filter(h=>!(s!=null&&s.includes(h)))}}return{left:((i=o?.left)!=null?i:[]).filter(h=>!(s!=null&&s.includes(h))),right:((r=o?.right)!=null?r:[]).filter(h=>!(s!=null&&s.includes(h)))}})},e.getCanPin=()=>e.getLeafColumns().some(s=>{var o,i,r;return((o=s.columnDef.enablePinning)!=null?o:!0)&&((i=(r=n.options.enableColumnPinning)!=null?r:n.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const t=e.getLeafColumns().map(a=>a.id),{left:s,right:o}=n.getState().columnPinning,i=t.some(a=>s?.includes(a)),r=t.some(a=>o?.includes(a));return i?"left":r?"right":!1},e.getPinnedIndex=()=>{var t,s;const o=e.getIsPinned();return o?(t=(s=n.getState().columnPinning)==null||(s=s[o])==null?void 0:s.indexOf(e.id))!=null?t:-1:0}},createRow:(e,n)=>{e.getCenterVisibleCells=I(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left,n.getState().columnPinning.right],(t,s,o)=>{const i=[...s??[],...o??[]];return t.filter(r=>!i.includes(r.column.id))},b(n.options,"debugRows")),e.getLeftVisibleCells=I(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left],(t,s)=>(s??[]).map(i=>t.find(r=>r.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),b(n.options,"debugRows")),e.getRightVisibleCells=I(()=>[e._getAllVisibleCells(),n.getState().columnPinning.right],(t,s)=>(s??[]).map(i=>t.find(r=>r.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),b(n.options,"debugRows"))},createTable:e=>{e.setColumnPinning=n=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(n),e.resetColumnPinning=n=>{var t,s;return e.setColumnPinning(n?Ot():(t=(s=e.initialState)==null?void 0:s.columnPinning)!=null?t:Ot())},e.getIsSomeColumnsPinned=n=>{var t;const s=e.getState().columnPinning;if(!n){var o,i;return!!((o=s.left)!=null&&o.length||(i=s.right)!=null&&i.length)}return!!((t=s[n])!=null&&t.length)},e.getLeftLeafColumns=I(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(n,t)=>(t??[]).map(s=>n.find(o=>o.id===s)).filter(Boolean),b(e.options,"debugColumns")),e.getRightLeafColumns=I(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(n,t)=>(t??[]).map(s=>n.find(o=>o.id===s)).filter(Boolean),b(e.options,"debugColumns")),e.getCenterLeafColumns=I(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,t,s)=>{const o=[...t??[],...s??[]];return n.filter(i=>!o.includes(i.id))},b(e.options,"debugColumns"))}};function Ur(e){return e||(typeof document<"u"?document:null)}const Xe={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Tt=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Gr={getDefaultColumnDef:()=>Xe,getInitialState:e=>({columnSizing:{},columnSizingInfo:Tt(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:H("columnSizing",e),onColumnSizingInfoChange:H("columnSizingInfo",e)}),createColumn:(e,n)=>{e.getSize=()=>{var t,s,o;const i=n.getState().columnSizing[e.id];return Math.min(Math.max((t=e.columnDef.minSize)!=null?t:Xe.minSize,(s=i??e.columnDef.size)!=null?s:Xe.size),(o=e.columnDef.maxSize)!=null?o:Xe.maxSize)},e.getStart=I(t=>[t,Ae(n,t),n.getState().columnSizing],(t,s)=>s.slice(0,e.getIndex(t)).reduce((o,i)=>o+i.getSize(),0),b(n.options,"debugColumns")),e.getAfter=I(t=>[t,Ae(n,t),n.getState().columnSizing],(t,s)=>s.slice(e.getIndex(t)+1).reduce((o,i)=>o+i.getSize(),0),b(n.options,"debugColumns")),e.resetSize=()=>{n.setColumnSizing(t=>{let{[e.id]:s,...o}=t;return o})},e.getCanResize=()=>{var t,s;return((t=e.columnDef.enableResizing)!=null?t:!0)&&((s=n.options.enableColumnResizing)!=null?s:!0)},e.getIsResizing=()=>n.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,n)=>{e.getSize=()=>{let t=0;const s=o=>{if(o.subHeaders.length)o.subHeaders.forEach(s);else{var i;t+=(i=o.column.getSize())!=null?i:0}};return s(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=t=>{const s=n.getColumn(e.column.id),o=s?.getCanResize();return i=>{if(!s||!o||(i.persist==null||i.persist(),$t(i)&&i.touches&&i.touches.length>1))return;const r=e.getSize(),a=e?e.getLeafHeaders().map(m=>[m.column.id,m.column.getSize()]):[[s.id,s.getSize()]],l=$t(i)?Math.round(i.touches[0].clientX):i.clientX,u={},d=(m,S)=>{typeof S=="number"&&(n.setColumnSizingInfo(y=>{var w,x;const R=n.options.columnResizeDirection==="rtl"?-1:1,_=(S-((w=y?.startOffset)!=null?w:0))*R,C=Math.max(_/((x=y?.startSize)!=null?x:0),-.999999);return y.columnSizingStart.forEach(F=>{let[E,L]=F;u[E]=Math.round(Math.max(L+L*C,0)*100)/100}),{...y,deltaOffset:_,deltaPercentage:C}}),(n.options.columnResizeMode==="onChange"||m==="end")&&n.setColumnSizing(y=>({...y,...u})))},h=m=>d("move",m),c=m=>{d("end",m),n.setColumnSizingInfo(S=>({...S,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},f=Ur(t),g={moveHandler:m=>h(m.clientX),upHandler:m=>{f?.removeEventListener("mousemove",g.moveHandler),f?.removeEventListener("mouseup",g.upHandler),c(m.clientX)}},p={moveHandler:m=>(m.cancelable&&(m.preventDefault(),m.stopPropagation()),h(m.touches[0].clientX),!1),upHandler:m=>{var S;f?.removeEventListener("touchmove",p.moveHandler),f?.removeEventListener("touchend",p.upHandler),m.cancelable&&(m.preventDefault(),m.stopPropagation()),c((S=m.touches[0])==null?void 0:S.clientX)}},v=Nr()?{passive:!1}:!1;$t(i)?(f?.addEventListener("touchmove",p.moveHandler,v),f?.addEventListener("touchend",p.upHandler,v)):(f?.addEventListener("mousemove",g.moveHandler,v),f?.addEventListener("mouseup",g.upHandler,v)),n.setColumnSizingInfo(m=>({...m,startOffset:l,startSize:r,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:s.id}))}}},createTable:e=>{e.setColumnSizing=n=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(n),e.setColumnSizingInfo=n=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(n),e.resetColumnSizing=n=>{var t;e.setColumnSizing(n?{}:(t=e.initialState.columnSizing)!=null?t:{})},e.resetHeaderSizeInfo=n=>{var t;e.setColumnSizingInfo(n?Tt():(t=e.initialState.columnSizingInfo)!=null?t:Tt())},e.getTotalSize=()=>{var n,t;return(n=(t=e.getHeaderGroups()[0])==null?void 0:t.headers.reduce((s,o)=>s+o.getSize(),0))!=null?n:0},e.getLeftTotalSize=()=>{var n,t;return(n=(t=e.getLeftHeaderGroups()[0])==null?void 0:t.headers.reduce((s,o)=>s+o.getSize(),0))!=null?n:0},e.getCenterTotalSize=()=>{var n,t;return(n=(t=e.getCenterHeaderGroups()[0])==null?void 0:t.headers.reduce((s,o)=>s+o.getSize(),0))!=null?n:0},e.getRightTotalSize=()=>{var n,t;return(n=(t=e.getRightHeaderGroups()[0])==null?void 0:t.headers.reduce((s,o)=>s+o.getSize(),0))!=null?n:0}}};let Ye=null;function Nr(){if(typeof Ye=="boolean")return Ye;let e=!1;try{const n={get passive(){return e=!0,!1}},t=()=>{};window.addEventListener("test",t,n),window.removeEventListener("test",t)}catch{e=!1}return Ye=e,Ye}function $t(e){return e.type==="touchstart"}const qr={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:H("columnVisibility",e)}),createColumn:(e,n)=>{e.toggleVisibility=t=>{e.getCanHide()&&n.setColumnVisibility(s=>({...s,[e.id]:t??!e.getIsVisible()}))},e.getIsVisible=()=>{var t,s;const o=e.columns;return(t=o.length?o.some(i=>i.getIsVisible()):(s=n.getState().columnVisibility)==null?void 0:s[e.id])!=null?t:!0},e.getCanHide=()=>{var t,s;return((t=e.columnDef.enableHiding)!=null?t:!0)&&((s=n.options.enableHiding)!=null?s:!0)},e.getToggleVisibilityHandler=()=>t=>{e.toggleVisibility==null||e.toggleVisibility(t.target.checked)}},createRow:(e,n)=>{e._getAllVisibleCells=I(()=>[e.getAllCells(),n.getState().columnVisibility],t=>t.filter(s=>s.column.getIsVisible()),b(n.options,"debugRows")),e.getVisibleCells=I(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(t,s,o)=>[...t,...s,...o],b(n.options,"debugRows"))},createTable:e=>{const n=(t,s)=>I(()=>[s(),s().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),b(e.options,"debugColumns"));e.getVisibleFlatColumns=n("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=n("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=n("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=n("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=n("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var s;e.setColumnVisibility(t?{}:(s=e.initialState.columnVisibility)!=null?s:{})},e.toggleAllColumnsVisible=t=>{var s;t=(s=t)!=null?s:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,i)=>({...o,[i.id]:t||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(t=>!(t.getIsVisible!=null&&t.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(t=>t.getIsVisible==null?void 0:t.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var s;e.toggleAllColumnsVisible((s=t.target)==null?void 0:s.checked)}}};function Ae(e,n){return n?n==="center"?e.getCenterVisibleLeafColumns():n==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const Kr={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},Wr={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:H("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:n=>{var t;const s=(t=e.getCoreRowModel().flatRows[0])==null||(t=t._getAllCellsByColumnId()[n.id])==null?void 0:t.getValue();return typeof s=="string"||typeof s=="number"}}),createColumn:(e,n)=>{e.getCanGlobalFilter=()=>{var t,s,o,i;return((t=e.columnDef.enableGlobalFilter)!=null?t:!0)&&((s=n.options.enableGlobalFilter)!=null?s:!0)&&((o=n.options.enableFilters)!=null?o:!0)&&((i=n.options.getColumnCanGlobalFilter==null?void 0:n.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Z.includesString,e.getGlobalFilterFn=()=>{var n,t;const{globalFilterFn:s}=e.options;return pt(s)?s:s==="auto"?e.getGlobalAutoFilterFn():(n=(t=e.options.filterFns)==null?void 0:t[s])!=null?n:Z[s]},e.setGlobalFilter=n=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(n)},e.resetGlobalFilter=n=>{e.setGlobalFilter(n?void 0:e.initialState.globalFilter)}}},Qr={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:H("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let n=!1,t=!1;e._autoResetExpanded=()=>{var s,o;if(!n){e._queue(()=>{n=!0});return}if((s=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?s:!e.options.manualExpanding){if(t)return;t=!0,e._queue(()=>{e.resetExpanded(),t=!1})}},e.setExpanded=s=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(s),e.toggleAllRowsExpanded=s=>{s??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=s=>{var o,i;e.setExpanded(s?{}:(o=(i=e.initialState)==null?void 0:i.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(s=>s.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>s=>{s.persist==null||s.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const s=e.getState().expanded;return s===!0||Object.values(s).some(Boolean)},e.getIsAllRowsExpanded=()=>{const s=e.getState().expanded;return typeof s=="boolean"?s===!0:!(!Object.keys(s).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let s=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const r=i.split(".");s=Math.max(s,r.length)}),s},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,n)=>{e.toggleExpanded=t=>{n.setExpanded(s=>{var o;const i=s===!0?!0:!!(s!=null&&s[e.id]);let r={};if(s===!0?Object.keys(n.getRowModel().rowsById).forEach(a=>{r[a]=!0}):r=s,t=(o=t)!=null?o:!i,!i&&t)return{...r,[e.id]:!0};if(i&&!t){const{[e.id]:a,...l}=r;return l}return s})},e.getIsExpanded=()=>{var t;const s=n.getState().expanded;return!!((t=n.options.getIsRowExpanded==null?void 0:n.options.getIsRowExpanded(e))!=null?t:s===!0||s?.[e.id])},e.getCanExpand=()=>{var t,s,o;return(t=n.options.getRowCanExpand==null?void 0:n.options.getRowCanExpand(e))!=null?t:((s=n.options.enableExpanding)!=null?s:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let t=!0,s=e;for(;t&&s.parentId;)s=n.getRow(s.parentId,!0),t=s.getIsExpanded();return t},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},Kt=0,Wt=10,Dt=()=>({pageIndex:Kt,pageSize:Wt}),Xr={getInitialState:e=>({...e,pagination:{...Dt(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:H("pagination",e)}),createTable:e=>{let n=!1,t=!1;e._autoResetPageIndex=()=>{var s,o;if(!n){e._queue(()=>{n=!0});return}if((s=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?s:!e.options.manualPagination){if(t)return;t=!0,e._queue(()=>{e.resetPageIndex(),t=!1})}},e.setPagination=s=>{const o=i=>se(s,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=s=>{var o;e.setPagination(s?Dt():(o=e.initialState.pagination)!=null?o:Dt())},e.setPageIndex=s=>{e.setPagination(o=>{let i=se(s,o.pageIndex);const r=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,r)),{...o,pageIndex:i}})},e.resetPageIndex=s=>{var o,i;e.setPageIndex(s?Kt:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:Kt)},e.resetPageSize=s=>{var o,i;e.setPageSize(s?Wt:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:Wt)},e.setPageSize=s=>{e.setPagination(o=>{const i=Math.max(1,se(s,o.pageSize)),r=o.pageSize*o.pageIndex,a=Math.floor(r/i);return{...o,pageIndex:a,pageSize:i}})},e.setPageCount=s=>e.setPagination(o=>{var i;let r=se(s,(i=e.options.pageCount)!=null?i:-1);return typeof r=="number"&&(r=Math.max(-1,r)),{...o,pageCount:r}}),e.getPageOptions=I(()=>[e.getPageCount()],s=>{let o=[];return s&&s>0&&(o=[...new Array(s)].fill(null).map((i,r)=>r)),o},b(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:s}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:s<o-1},e.previousPage=()=>e.setPageIndex(s=>s-1),e.nextPage=()=>e.setPageIndex(s=>s+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var s;return(s=e.options.pageCount)!=null?s:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var s;return(s=e.options.rowCount)!=null?s:e.getPrePaginationRowModel().rows.length}}},At=()=>({top:[],bottom:[]}),Yr={getInitialState:e=>({rowPinning:At(),...e}),getDefaultOptions:e=>({onRowPinningChange:H("rowPinning",e)}),createRow:(e,n)=>{e.pin=(t,s,o)=>{const i=s?e.getLeafRows().map(l=>{let{id:u}=l;return u}):[],r=o?e.getParentRows().map(l=>{let{id:u}=l;return u}):[],a=new Set([...r,e.id,...i]);n.setRowPinning(l=>{var u,d;if(t==="bottom"){var h,c;return{top:((h=l?.top)!=null?h:[]).filter(p=>!(a!=null&&a.has(p))),bottom:[...((c=l?.bottom)!=null?c:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)]}}if(t==="top"){var f,g;return{top:[...((f=l?.top)!=null?f:[]).filter(p=>!(a!=null&&a.has(p))),...Array.from(a)],bottom:((g=l?.bottom)!=null?g:[]).filter(p=>!(a!=null&&a.has(p)))}}return{top:((u=l?.top)!=null?u:[]).filter(p=>!(a!=null&&a.has(p))),bottom:((d=l?.bottom)!=null?d:[]).filter(p=>!(a!=null&&a.has(p)))}})},e.getCanPin=()=>{var t;const{enableRowPinning:s,enablePinning:o}=n.options;return typeof s=="function"?s(e):(t=s??o)!=null?t:!0},e.getIsPinned=()=>{const t=[e.id],{top:s,bottom:o}=n.getState().rowPinning,i=t.some(a=>s?.includes(a)),r=t.some(a=>o?.includes(a));return i?"top":r?"bottom":!1},e.getPinnedIndex=()=>{var t,s;const o=e.getIsPinned();if(!o)return-1;const i=(t=o==="top"?n.getTopRows():n.getBottomRows())==null?void 0:t.map(r=>{let{id:a}=r;return a});return(s=i?.indexOf(e.id))!=null?s:-1}},createTable:e=>{e.setRowPinning=n=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(n),e.resetRowPinning=n=>{var t,s;return e.setRowPinning(n?At():(t=(s=e.initialState)==null?void 0:s.rowPinning)!=null?t:At())},e.getIsSomeRowsPinned=n=>{var t;const s=e.getState().rowPinning;if(!n){var o,i;return!!((o=s.top)!=null&&o.length||(i=s.bottom)!=null&&i.length)}return!!((t=s[n])!=null&&t.length)},e._getPinnedRows=(n,t,s)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(t??[]).map(r=>{const a=e.getRow(r,!0);return a.getIsAllParentsExpanded()?a:null}):(t??[]).map(r=>n.find(a=>a.id===r))).filter(Boolean).map(r=>({...r,position:s}))},e.getTopRows=I(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(n,t)=>e._getPinnedRows(n,t,"top"),b(e.options,"debugRows")),e.getBottomRows=I(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(n,t)=>e._getPinnedRows(n,t,"bottom"),b(e.options,"debugRows")),e.getCenterRows=I(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(n,t,s)=>{const o=new Set([...t??[],...s??[]]);return n.filter(i=>!o.has(i.id))},b(e.options,"debugRows"))}},Jr={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:H("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=n=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(n),e.resetRowSelection=n=>{var t;return e.setRowSelection(n?{}:(t=e.initialState.rowSelection)!=null?t:{})},e.toggleAllRowsSelected=n=>{e.setRowSelection(t=>{n=typeof n<"u"?n:!e.getIsAllRowsSelected();const s={...t},o=e.getPreGroupedRowModel().flatRows;return n?o.forEach(i=>{i.getCanSelect()&&(s[i.id]=!0)}):o.forEach(i=>{delete s[i.id]}),s})},e.toggleAllPageRowsSelected=n=>e.setRowSelection(t=>{const s=typeof n<"u"?n:!e.getIsAllPageRowsSelected(),o={...t};return e.getRowModel().rows.forEach(i=>{Qt(o,i.id,s,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=I(()=>[e.getState().rowSelection,e.getCoreRowModel()],(n,t)=>Object.keys(n).length?kt(e,t):{rows:[],flatRows:[],rowsById:{}},b(e.options,"debugTable")),e.getFilteredSelectedRowModel=I(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(n,t)=>Object.keys(n).length?kt(e,t):{rows:[],flatRows:[],rowsById:{}},b(e.options,"debugTable")),e.getGroupedSelectedRowModel=I(()=>[e.getState().rowSelection,e.getSortedRowModel()],(n,t)=>Object.keys(n).length?kt(e,t):{rows:[],flatRows:[],rowsById:{}},b(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const n=e.getFilteredRowModel().flatRows,{rowSelection:t}=e.getState();let s=!!(n.length&&Object.keys(t).length);return s&&n.some(o=>o.getCanSelect()&&!t[o.id])&&(s=!1),s},e.getIsAllPageRowsSelected=()=>{const n=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:t}=e.getState();let s=!!n.length;return s&&n.some(o=>!t[o.id])&&(s=!1),s},e.getIsSomeRowsSelected=()=>{var n;const t=Object.keys((n=e.getState().rowSelection)!=null?n:{}).length;return t>0&&t<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const n=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:n.filter(t=>t.getCanSelect()).some(t=>t.getIsSelected()||t.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>n=>{e.toggleAllRowsSelected(n.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>n=>{e.toggleAllPageRowsSelected(n.target.checked)}},createRow:(e,n)=>{e.toggleSelected=(t,s)=>{const o=e.getIsSelected();n.setRowSelection(i=>{var r;if(t=typeof t<"u"?t:!o,e.getCanSelect()&&o===t)return i;const a={...i};return Qt(a,e.id,t,(r=s?.selectChildren)!=null?r:!0,n),a})},e.getIsSelected=()=>{const{rowSelection:t}=n.getState();return mn(e,t)},e.getIsSomeSelected=()=>{const{rowSelection:t}=n.getState();return Xt(e,t)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:t}=n.getState();return Xt(e,t)==="all"},e.getCanSelect=()=>{var t;return typeof n.options.enableRowSelection=="function"?n.options.enableRowSelection(e):(t=n.options.enableRowSelection)!=null?t:!0},e.getCanSelectSubRows=()=>{var t;return typeof n.options.enableSubRowSelection=="function"?n.options.enableSubRowSelection(e):(t=n.options.enableSubRowSelection)!=null?t:!0},e.getCanMultiSelect=()=>{var t;return typeof n.options.enableMultiRowSelection=="function"?n.options.enableMultiRowSelection(e):(t=n.options.enableMultiRowSelection)!=null?t:!0},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return s=>{var o;t&&e.toggleSelected((o=s.target)==null?void 0:o.checked)}}}},Qt=(e,n,t,s,o)=>{var i;const r=o.getRow(n,!0);t?(r.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),r.getCanSelect()&&(e[n]=!0)):delete e[n],s&&(i=r.subRows)!=null&&i.length&&r.getCanSelectSubRows()&&r.subRows.forEach(a=>Qt(e,a.id,t,s,o))};function kt(e,n){const t=e.getState().rowSelection,s=[],o={},i=function(r,a){return r.map(l=>{var u;const d=mn(l,t);if(d&&(s.push(l),o[l.id]=l),(u=l.subRows)!=null&&u.length&&(l={...l,subRows:i(l.subRows)}),d)return l}).filter(Boolean)};return{rows:i(n.rows),flatRows:s,rowsById:o}}function mn(e,n){var t;return(t=n[e.id])!=null?t:!1}function Xt(e,n,t){var s;if(!((s=e.subRows)!=null&&s.length))return!1;let o=!0,i=!1;return e.subRows.forEach(r=>{if(!(i&&!o)&&(r.getCanSelect()&&(mn(r,n)?i=!0:o=!1),r.subRows&&r.subRows.length)){const a=Xt(r,n);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const Yt=/([0-9]+)/gm,Zr=(e,n,t)=>Ws(ae(e.getValue(t)).toLowerCase(),ae(n.getValue(t)).toLowerCase()),ea=(e,n,t)=>Ws(ae(e.getValue(t)),ae(n.getValue(t))),ta=(e,n,t)=>vn(ae(e.getValue(t)).toLowerCase(),ae(n.getValue(t)).toLowerCase()),na=(e,n,t)=>vn(ae(e.getValue(t)),ae(n.getValue(t))),sa=(e,n,t)=>{const s=e.getValue(t),o=n.getValue(t);return s>o?1:s<o?-1:0},oa=(e,n,t)=>vn(e.getValue(t),n.getValue(t));function vn(e,n){return e===n?0:e>n?1:-1}function ae(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Ws(e,n){const t=e.split(Yt).filter(Boolean),s=n.split(Yt).filter(Boolean);for(;t.length&&s.length;){const o=t.shift(),i=s.shift(),r=parseInt(o,10),a=parseInt(i,10),l=[r,a].sort();if(isNaN(l[0])){if(o>i)return 1;if(i>o)return-1;continue}if(isNaN(l[1]))return isNaN(r)?-1:1;if(r>a)return 1;if(a>r)return-1}return t.length-s.length}const Oe={alphanumeric:Zr,alphanumericCaseSensitive:ea,text:ta,textCaseSensitive:na,datetime:sa,basic:oa},ia={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:H("sorting",e),isMultiSortEvent:n=>n.shiftKey}),createColumn:(e,n)=>{e.getAutoSortingFn=()=>{const t=n.getFilteredRowModel().flatRows.slice(10);let s=!1;for(const o of t){const i=o?.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return Oe.datetime;if(typeof i=="string"&&(s=!0,i.split(Yt).length>1))return Oe.alphanumeric}return s?Oe.text:Oe.basic},e.getAutoSortDir=()=>{const t=n.getFilteredRowModel().flatRows[0];return typeof t?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var t,s;if(!e)throw new Error;return pt(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(t=(s=n.options.sortingFns)==null?void 0:s[e.columnDef.sortingFn])!=null?t:Oe[e.columnDef.sortingFn]},e.toggleSorting=(t,s)=>{const o=e.getNextSortingOrder(),i=typeof t<"u"&&t!==null;n.setSorting(r=>{const a=r?.find(f=>f.id===e.id),l=r?.findIndex(f=>f.id===e.id);let u=[],d,h=i?t:o==="desc";if(r!=null&&r.length&&e.getCanMultiSort()&&s?a?d="toggle":d="add":r!=null&&r.length&&l!==r.length-1?d="replace":a?d="toggle":d="replace",d==="toggle"&&(i||o||(d="remove")),d==="add"){var c;u=[...r,{id:e.id,desc:h}],u.splice(0,u.length-((c=n.options.maxMultiSortColCount)!=null?c:Number.MAX_SAFE_INTEGER))}else d==="toggle"?u=r.map(f=>f.id===e.id?{...f,desc:h}:f):d==="remove"?u=r.filter(f=>f.id!==e.id):u=[{id:e.id,desc:h}];return u})},e.getFirstSortDir=()=>{var t,s;return((t=(s=e.columnDef.sortDescFirst)!=null?s:n.options.sortDescFirst)!=null?t:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=t=>{var s,o;const i=e.getFirstSortDir(),r=e.getIsSorted();return r?r!==i&&((s=n.options.enableSortingRemoval)==null||s)&&(!(t&&(o=n.options.enableMultiRemove)!=null)||o)?!1:r==="desc"?"asc":"desc":i},e.getCanSort=()=>{var t,s;return((t=e.columnDef.enableSorting)!=null?t:!0)&&((s=n.options.enableSorting)!=null?s:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var t,s;return(t=(s=e.columnDef.enableMultiSort)!=null?s:n.options.enableMultiSort)!=null?t:!!e.accessorFn},e.getIsSorted=()=>{var t;const s=(t=n.getState().sorting)==null?void 0:t.find(o=>o.id===e.id);return s?s.desc?"desc":"asc":!1},e.getSortIndex=()=>{var t,s;return(t=(s=n.getState().sorting)==null?void 0:s.findIndex(o=>o.id===e.id))!=null?t:-1},e.clearSorting=()=>{n.setSorting(t=>t!=null&&t.length?t.filter(s=>s.id!==e.id):[])},e.getToggleSortingHandler=()=>{const t=e.getCanSort();return s=>{t&&(s.persist==null||s.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?n.options.isMultiSortEvent==null?void 0:n.options.isMultiSortEvent(s):!1))}}},createTable:e=>{e.setSorting=n=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(n),e.resetSorting=n=>{var t,s;e.setSorting(n?[]:(t=(s=e.initialState)==null?void 0:s.sorting)!=null?t:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},ra=[Mr,qr,jr,Hr,Ir,br,Kr,Wr,ia,zr,Qr,Xr,Yr,Jr,Gr];function aa(e){var n,t;const s=[...ra,...(n=e._features)!=null?n:[]];let o={_features:s};const i=o._features.reduce((c,f)=>Object.assign(c,f.getDefaultOptions==null?void 0:f.getDefaultOptions(o)),{}),r=c=>o.options.mergeOptions?o.options.mergeOptions(i,c):{...i,...c};let l={...{},...(t=e.initialState)!=null?t:{}};o._features.forEach(c=>{var f;l=(f=c.getInitialState==null?void 0:c.getInitialState(l))!=null?f:l});const u=[];let d=!1;const h={_features:s,options:{...i,...e},initialState:l,_queue:c=>{u.push(c),d||(d=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();d=!1}).catch(f=>setTimeout(()=>{throw f})))},reset:()=>{o.setState(o.initialState)},setOptions:c=>{const f=se(c,o.options);o.options=r(f)},getState:()=>o.options.state,setState:c=>{o.options.onStateChange==null||o.options.onStateChange(c)},_getRowId:(c,f,g)=>{var p;return(p=o.options.getRowId==null?void 0:o.options.getRowId(c,f,g))!=null?p:`${g?[g.id,f].join("."):f}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(c,f)=>{let g=(f?o.getPrePaginationRowModel():o.getRowModel()).rowsById[c];if(!g&&(g=o.getCoreRowModel().rowsById[c],!g))throw new Error;return g},_getDefaultColumnDef:I(()=>[o.options.defaultColumn],c=>{var f;return c=(f=c)!=null?f:{},{header:g=>{const p=g.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:g=>{var p,v;return(p=(v=g.renderValue())==null||v.toString==null?void 0:v.toString())!=null?p:null},...o._features.reduce((g,p)=>Object.assign(g,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...c}},b(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:I(()=>[o._getColumnDefs()],c=>{const f=function(g,p,v){return v===void 0&&(v=0),g.map(m=>{const S=xr(o,m,v,p),y=m;return S.columns=y.columns?f(y.columns,S,v+1):[],S})};return f(c)},b(e,"debugColumns")),getAllFlatColumns:I(()=>[o.getAllColumns()],c=>c.flatMap(f=>f.getFlatColumns()),b(e,"debugColumns")),_getAllFlatColumnsById:I(()=>[o.getAllFlatColumns()],c=>c.reduce((f,g)=>(f[g.id]=g,f),{}),b(e,"debugColumns")),getAllLeafColumns:I(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(c,f)=>{let g=c.flatMap(p=>p.getLeafColumns());return f(g)},b(e,"debugColumns")),getColumn:c=>o._getAllFlatColumnsById()[c]};Object.assign(o,h);for(let c=0;c<o._features.length;c++){const f=o._features[c];f==null||f.createTable==null||f.createTable(o)}return o}function za(){return e=>I(()=>[e.options.data],n=>{const t={rows:[],flatRows:[],rowsById:{}},s=function(o,i,r){i===void 0&&(i=0);const a=[];for(let u=0;u<o.length;u++){const d=Fr(e,e._getRowId(o[u],u,r),o[u],u,i,void 0,r?.id);if(t.flatRows.push(d),t.rowsById[d.id]=d,a.push(d),e.options.getSubRows){var l;d.originalSubRows=e.options.getSubRows(o[u],u),(l=d.originalSubRows)!=null&&l.length&&(d.subRows=s(d.originalSubRows,i+1,d))}}return a};return t.rows=s(n),t},b(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Ba(){return e=>I(()=>[e.getState().sorting,e.getPreSortedRowModel()],(n,t)=>{if(!t.rows.length||!(n!=null&&n.length))return t;const s=e.getState().sorting,o=[],i=s.filter(l=>{var u;return(u=e.getColumn(l.id))==null?void 0:u.getCanSort()}),r={};i.forEach(l=>{const u=e.getColumn(l.id);u&&(r[l.id]={sortUndefined:u.columnDef.sortUndefined,invertSorting:u.columnDef.invertSorting,sortingFn:u.getSortingFn()})});const a=l=>{const u=l.map(d=>({...d}));return u.sort((d,h)=>{for(let f=0;f<i.length;f+=1){var c;const g=i[f],p=r[g.id],v=p.sortUndefined,m=(c=g?.desc)!=null?c:!1;let S=0;if(v){const y=d.getValue(g.id),w=h.getValue(g.id),x=y===void 0,R=w===void 0;if(x||R){if(v==="first")return x?-1:1;if(v==="last")return x?1:-1;S=x&&R?0:x?v:-v}}if(S===0&&(S=p.sortingFn(d,h,g.id)),S!==0)return m&&(S*=-1),p.invertSorting&&(S*=-1),S}return d.index-h.index}),u.forEach(d=>{var h;o.push(d),(h=d.subRows)!=null&&h.length&&(d.subRows=a(d.subRows))}),u};return{rows:a(t.rows),flatRows:o,rowsById:t.rowsById}},b(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function ja(e,n){return e?la(e)?P.createElement(e,n):e:null}function la(e){return ua(e)||typeof e=="function"||ca(e)}function ua(e){return typeof e=="function"&&(()=>{const n=Object.getPrototypeOf(e);return n.prototype&&n.prototype.isReactComponent})()}function ca(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Ha(e){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[t]=P.useState(()=>({current:aa(n)})),[s,o]=P.useState(()=>t.current.initialState);return t.current.setOptions(i=>({...i,...e,state:{...s,...e.state},onStateChange:r=>{o(r),e.onStateChange==null||e.onStateChange(r)}})),t.current}function we(e,n,t){let s=t.initialDeps??[],o,i=!0;function r(){var a,l,u;let d;t.key&&((a=t.debug)!=null&&a.call(t))&&(d=Date.now());const h=e();if(!(h.length!==s.length||h.some((g,p)=>s[p]!==g)))return o;s=h;let f;if(t.key&&((l=t.debug)!=null&&l.call(t))&&(f=Date.now()),o=n(...h),t.key&&((u=t.debug)!=null&&u.call(t))){const g=Math.round((Date.now()-d)*100)/100,p=Math.round((Date.now()-f)*100)/100,v=p/16,m=(S,y)=>{for(S=String(S);S.length<y;)S=" "+S;return S};console.info(`%c⏱ ${m(p,5)} /${m(g,5)} ms`,`
|