var Ss=e=>{throw TypeError(e)};var Wt=(e,t,r)=>t.has(e)||Ss("Cannot "+r);var u=(e,t,r)=>(Wt(e,t,"read from private field"),r?r.call(e):t.get(e)),A=(e,t,r)=>t.has(e)?Ss("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),C=(e,t,r,a)=>(Wt(e,t,"write to private field"),a?a.call(e,r):t.set(e,r),r),R=(e,t,r)=>(Wt(e,t,"access private method"),r);var Nt=(e,t,r,a)=>({set _(n){C(e,t,n,r)},get _(){return u(e,t,a)}});import{a as c,j as s,M as sr,L as Jt,E as Vt,b as it,U as lt,P as ot,S as Tt,c as rr,d as ar,e as nr,f as ir,g as lr,F as Wr,I as Hr,T as zr,A as Kr,C as Gr,h as Jr,i as or,k as Lt,l as Vr,m as fs,n as Yr,o as Dt,p as Xr,H as Zr,q as ea,s as nt,D as Yt,X as we,t as At,u as cr,v as ta}from"./ui-dcZpisbl.js";import{r as sa}from"./vendor-AYf95Hug.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))a(n);new MutationObserver(n=>{for(const i of n)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&a(l)}).observe(document,{childList:!0,subtree:!0});function r(n){const i={};return n.integrity&&(i.integrity=n.integrity),n.referrerPolicy&&(i.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?i.credentials="include":n.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function a(n){if(n.ep)return;n.ep=!0;const i=r(n);fetch(n.href,i)}})();var Et={},As;function ra(){if(As)return Et;As=1;var e=sa();return Et.createRoot=e.createRoot,Et.hydrateRoot=e.hydrateRoot,Et}var aa=ra(),bt=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(){}},Pe,xe,$e,zs,na=(zs=class extends bt{constructor(){super();A(this,Pe);A(this,xe);A(this,$e);C(this,$e,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){u(this,xe)||this.setEventListener(u(this,$e))}onUnsubscribe(){var t;this.hasListeners()||((t=u(this,xe))==null||t.call(this),C(this,xe,void 0))}setEventListener(t){var r;C(this,$e,t),(r=u(this,xe))==null||r.call(this),C(this,xe,t(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(t){u(this,Pe)!==t&&(C(this,Pe,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof u(this,Pe)=="boolean"?u(this,Pe):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Pe=new WeakMap,xe=new WeakMap,$e=new WeakMap,zs),gs=new na,ia={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},fe,xs,Ks,la=(Ks=class{constructor(){A(this,fe,ia);A(this,xs,!1)}setTimeoutProvider(e){C(this,fe,e)}setTimeout(e,t){return u(this,fe).setTimeout(e,t)}clearTimeout(e){u(this,fe).clearTimeout(e)}setInterval(e,t){return u(this,fe).setInterval(e,t)}clearInterval(e){u(this,fe).clearInterval(e)}},fe=new WeakMap,xs=new WeakMap,Ks),Ae=new la;function oa(e){setTimeout(e,0)}var ca=typeof window>"u"||"Deno"in globalThis;function G(){}function da(e,t){return typeof e=="function"?e(t):e}function Xt(e){return typeof e=="number"&&e>=0&&e!==1/0}function dr(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ne(e,t){return typeof e=="function"?e(t):e}function V(e,t){return typeof e=="function"?e(t):e}function Fs(e,t){const{type:r="all",exact:a,fetchStatus:n,predicate:i,queryKey:l,stale:d}=e;if(l){if(a){if(t.queryHash!==ps(l,t.options))return!1}else if(!dt(t.queryKey,l))return!1}if(r!=="all"){const o=t.isActive();if(r==="active"&&!o||r==="inactive"&&o)return!1}return!(typeof d=="boolean"&&t.isStale()!==d||n&&n!==t.state.fetchStatus||i&&!i(t))}function Ps(e,t){const{exact:r,status:a,predicate:n,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if(ct(t.options.mutationKey)!==ct(i))return!1}else if(!dt(t.options.mutationKey,i))return!1}return!(a&&t.state.status!==a||n&&!n(t))}function ps(e,t){return((t==null?void 0:t.queryKeyHashFn)||ct)(e)}function ct(e){return JSON.stringify(e,(t,r)=>es(r)?Object.keys(r).sort().reduce((a,n)=>(a[n]=r[n],a),{}):r)}function dt(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>dt(e[r],t[r])):!1}var ua=Object.prototype.hasOwnProperty;function ur(e,t,r=0){if(e===t)return e;if(r>500)return t;const a=Rs(e)&&Rs(t);if(!a&&!(es(e)&&es(t)))return t;const i=(a?e:Object.keys(e)).length,l=a?t:Object.keys(t),d=l.length,o=a?new Array(d):{};let h=0;for(let m=0;m{Ae.setTimeout(t,e)})}function ts(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?ur(e,t):t}function ma(e,t,r=0){const a=[...e,t];return r&&a.length>r?a.slice(1):a}function xa(e,t,r=0){const a=[t,...e];return r&&a.length>r?a.slice(0,-1):a}var ys=Symbol();function hr(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===ys?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function mr(e,t){return typeof e=="function"?e(...t):!!e}function fa(e,t,r){let a=!1,n;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(n??(n=t()),a||(a=!0,n.aborted?r():n.addEventListener("abort",r,{once:!0})),n)}),e}var ut=(()=>{let e=()=>ca;return{isServer(){return e()},setIsServer(t){e=t}}})();function ss(){let e,t;const r=new Promise((n,i)=>{e=n,t=i});r.status="pending",r.catch(()=>{});function a(n){Object.assign(r,n),delete r.resolve,delete r.reject}return r.resolve=n=>{a({status:"fulfilled",value:n}),e(n)},r.reject=n=>{a({status:"rejected",reason:n}),t(n)},r}var ga=oa;function pa(){let e=[],t=0,r=d=>{d()},a=d=>{d()},n=ga;const i=d=>{t?e.push(d):n(()=>{r(d)})},l=()=>{const d=e;e=[],d.length&&n(()=>{a(()=>{d.forEach(o=>{r(o)})})})};return{batch:d=>{let o;t++;try{o=d()}finally{t--,t||l()}return o},batchCalls:d=>(...o)=>{i(()=>{d(...o)})},schedule:i,setNotifyFunction:d=>{r=d},setBatchNotifyFunction:d=>{a=d},setScheduler:d=>{n=d}}}var Q=pa(),_e,ge,Qe,Gs,ya=(Gs=class extends bt{constructor(){super();A(this,_e,!0);A(this,ge);A(this,Qe);C(this,Qe,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t(!0),a=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",a)}}})}onSubscribe(){u(this,ge)||this.setEventListener(u(this,Qe))}onUnsubscribe(){var t;this.hasListeners()||((t=u(this,ge))==null||t.call(this),C(this,ge,void 0))}setEventListener(t){var r;C(this,Qe,t),(r=u(this,ge))==null||r.call(this),C(this,ge,t(this.setOnline.bind(this)))}setOnline(t){u(this,_e)!==t&&(C(this,_e,t),this.listeners.forEach(a=>{a(t)}))}isOnline(){return u(this,_e)}},_e=new WeakMap,ge=new WeakMap,Qe=new WeakMap,Gs),Ot=new ya;function ba(e){return Math.min(1e3*2**e,3e4)}function xr(e){return(e??"online")==="online"?Ot.isOnline():!0}var rs=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function fr(e){let t=!1,r=0,a;const n=ss(),i=()=>n.status!=="pending",l=y=>{var N;if(!i()){const w=new rs(y);p(w),(N=e.onCancel)==null||N.call(e,w)}},d=()=>{t=!0},o=()=>{t=!1},h=()=>gs.isFocused()&&(e.networkMode==="always"||Ot.isOnline())&&e.canRun(),m=()=>xr(e.networkMode)&&e.canRun(),f=y=>{i()||(a==null||a(),n.resolve(y))},p=y=>{i()||(a==null||a(),n.reject(y))},b=()=>new Promise(y=>{var N;a=w=>{(i()||h())&&y(w)},(N=e.onPause)==null||N.call(e)}).then(()=>{var y;a=void 0,i()||(y=e.onContinue)==null||y.call(e)}),v=()=>{if(i())return;let y;const N=r===0?e.initialPromise:void 0;try{y=N??e.fn()}catch(w){y=Promise.reject(w)}Promise.resolve(y).then(f).catch(w=>{var F;if(i())return;const j=e.retry??(ut.isServer()?0:3),x=e.retryDelay??ba,g=typeof x=="function"?x(r,w):x,E=j===!0||typeof j=="number"&&rh()?void 0:b()).then(()=>{t?p(w):v()})})};return{promise:n,status:()=>n.status,cancel:l,continue:()=>(a==null||a(),n),cancelRetry:d,continueRetry:o,canStart:m,start:()=>(m()?v():b().then(v),n)}}var Re,Js,gr=(Js=class{constructor(){A(this,Re)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Xt(this.gcTime)&&C(this,Re,Ae.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ut.isServer()?1/0:300*1e3))}clearGcTimeout(){u(this,Re)!==void 0&&(Ae.clearTimeout(u(this,Re)),C(this,Re,void 0))}},Re=new WeakMap,Js);function va(e){return{onFetch:(t,r)=>{var m,f,p,b,v;const a=t.options,n=(p=(f=(m=t.fetchOptions)==null?void 0:m.meta)==null?void 0:f.fetchMore)==null?void 0:p.direction,i=((b=t.state.data)==null?void 0:b.pages)||[],l=((v=t.state.data)==null?void 0:v.pageParams)||[];let d={pages:[],pageParams:[]},o=0;const h=async()=>{let y=!1;const N=x=>{fa(x,()=>t.signal,()=>y=!0)},w=hr(t.options,t.fetchOptions),j=async(x,g,E)=>{if(y)return Promise.reject(t.signal.reason);if(g==null&&x.pages.length)return Promise.resolve(x);const B=(()=>{const z={client:t.client,queryKey:t.queryKey,pageParam:g,direction:E?"backward":"forward",meta:t.options.meta};return N(z),z})(),S=await w(B),{maxPages:P}=t.options,O=E?xa:ma;return{pages:O(x.pages,S,P),pageParams:O(x.pageParams,g,P)}};if(n&&i.length){const x=n==="backward",g=x?ja:Os,E={pages:i,pageParams:l},F=g(a,E);d=await j(E,F,x)}else{const x=e??i.length;do{const g=o===0?l[0]??a.initialPageParam:Os(a,d);if(o>0&&g==null)break;d=await j(d,g),o++}while(o{var y,N;return(N=(y=t.options).persister)==null?void 0:N.call(y,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=h}}}function Os(e,{pages:t,pageParams:r}){const a=t.length-1;return t.length>0?e.getNextPageParam(t[a],t,r[a],r):void 0}function ja(e,{pages:t,pageParams:r}){var a;return t.length>0?(a=e.getPreviousPageParam)==null?void 0:a.call(e,t[0],t,r[0],r):void 0}var qe,De,We,Z,Oe,_,xt,Ie,J,pr,ie,Vs,wa=(Vs=class extends gr{constructor(t){super();A(this,J);A(this,qe);A(this,De);A(this,We);A(this,Z);A(this,Oe);A(this,_);A(this,xt);A(this,Ie);C(this,Ie,!1),C(this,xt,t.defaultOptions),this.setOptions(t.options),this.observers=[],C(this,Oe,t.client),C(this,Z,u(this,Oe).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,C(this,De,Bs(this.options)),this.state=t.state??u(this,De),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return u(this,qe)}get promise(){var t;return(t=u(this,_))==null?void 0:t.promise}setOptions(t){if(this.options={...u(this,xt),...t},t!=null&&t._type&&C(this,qe,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=Bs(this.options);r.data!==void 0&&(this.setState(Is(r.data,r.dataUpdatedAt)),C(this,De,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&u(this,Z).remove(this)}setData(t,r){const a=ts(this.state.data,t,this.options);return R(this,J,ie).call(this,{data:a,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),a}setState(t){R(this,J,ie).call(this,{type:"setState",state:t})}cancel(t){var a,n;const r=(a=u(this,_))==null?void 0:a.promise;return(n=u(this,_))==null||n.cancel(t),r?r.then(G).catch(G):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return u(this,De)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>V(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ys||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ne(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!dr(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(a=>a.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=u(this,_))==null||r.continue()}onOnline(){var r;const t=this.observers.find(a=>a.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=u(this,_))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),u(this,Z).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(u(this,_)&&(u(this,Ie)||R(this,J,pr).call(this)?u(this,_).cancel({revert:!0}):u(this,_).cancelRetry()),this.scheduleGc()),u(this,Z).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||R(this,J,ie).call(this,{type:"invalidate"})}async fetch(t,r){var h,m,f,p,b,v,y,N,w,j,x;if(this.state.fetchStatus!=="idle"&&((h=u(this,_))==null?void 0:h.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(u(this,_))return u(this,_).continueRetry(),u(this,_).promise}if(t&&this.setOptions(t),!this.options.queryFn){const g=this.observers.find(E=>E.options.queryFn);g&&this.setOptions(g.options)}const a=new AbortController,n=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(C(this,Ie,!0),a.signal)})},i=()=>{const g=hr(this.options,r),F=(()=>{const B={client:u(this,Oe),queryKey:this.queryKey,meta:this.meta};return n(B),B})();return C(this,Ie,!1),this.options.persister?this.options.persister(g,F,this):g(F)},d=(()=>{const g={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:u(this,Oe),state:this.state,fetchFn:i};return n(g),g})(),o=u(this,qe)==="infinite"?va(this.options.pages):this.options.behavior;o==null||o.onFetch(d,this),C(this,We,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=d.fetchOptions)==null?void 0:m.meta))&&R(this,J,ie).call(this,{type:"fetch",meta:(f=d.fetchOptions)==null?void 0:f.meta}),C(this,_,fr({initialPromise:r==null?void 0:r.initialPromise,fn:d.fetchFn,onCancel:g=>{g instanceof rs&&g.revert&&this.setState({...u(this,We),fetchStatus:"idle"}),a.abort()},onFail:(g,E)=>{R(this,J,ie).call(this,{type:"failed",failureCount:g,error:E})},onPause:()=>{R(this,J,ie).call(this,{type:"pause"})},onContinue:()=>{R(this,J,ie).call(this,{type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0}));try{const g=await u(this,_).start();if(g===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(g),(b=(p=u(this,Z).config).onSuccess)==null||b.call(p,g,this),(y=(v=u(this,Z).config).onSettled)==null||y.call(v,g,this.state.error,this),g}catch(g){if(g instanceof rs){if(g.silent)return u(this,_).promise;if(g.revert){if(this.state.data===void 0)throw g;return this.state.data}}throw R(this,J,ie).call(this,{type:"error",error:g}),(w=(N=u(this,Z).config).onError)==null||w.call(N,g,this),(x=(j=u(this,Z).config).onSettled)==null||x.call(j,this.state.data,g,this),g}finally{this.scheduleGc()}}},qe=new WeakMap,De=new WeakMap,We=new WeakMap,Z=new WeakMap,Oe=new WeakMap,_=new WeakMap,xt=new WeakMap,Ie=new WeakMap,J=new WeakSet,pr=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ie=function(t){const r=a=>{switch(t.type){case"failed":return{...a,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,...yr(a.data,this.options),fetchMeta:t.meta??null};case"success":const n={...a,...Is(t.data,t.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return C(this,We,t.manual?n:void 0),n;case"error":const i=t.error;return{...a,error:i,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...t.state}}};this.state=r(this.state),Q.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),u(this,Z).notify({query:this,type:"updated",action:t})})},Vs);function yr(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:xr(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Is(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Bs(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,a=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var K,D,ft,H,Be,He,le,pe,gt,ze,Ke,Te,Le,ye,Ge,I,at,as,ns,is,ls,os,cs,ds,br,Ys,Na=(Ys=class extends bt{constructor(t,r){super();A(this,I);A(this,K);A(this,D);A(this,ft);A(this,H);A(this,Be);A(this,He);A(this,le);A(this,pe);A(this,gt);A(this,ze);A(this,Ke);A(this,Te);A(this,Le);A(this,ye);A(this,Ge,new Set);this.options=r,C(this,K,t),C(this,pe,null),C(this,le,ss()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(u(this,D).addObserver(this),Ts(u(this,D),this.options)?R(this,I,at).call(this):this.updateResult(),R(this,I,ls).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return us(u(this,D),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return us(u(this,D),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,R(this,I,os).call(this),R(this,I,cs).call(this),u(this,D).removeObserver(this)}setOptions(t){const r=this.options,a=u(this,D);if(this.options=u(this,K).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof V(this.options.enabled,u(this,D))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");R(this,I,ds).call(this),u(this,D).setOptions(this.options),r._defaulted&&!Zt(this.options,r)&&u(this,K).getQueryCache().notify({type:"observerOptionsUpdated",query:u(this,D),observer:this});const n=this.hasListeners();n&&Ls(u(this,D),a,this.options,r)&&R(this,I,at).call(this),this.updateResult(),n&&(u(this,D)!==a||V(this.options.enabled,u(this,D))!==V(r.enabled,u(this,D))||Ne(this.options.staleTime,u(this,D))!==Ne(r.staleTime,u(this,D)))&&R(this,I,as).call(this);const i=R(this,I,ns).call(this);n&&(u(this,D)!==a||V(this.options.enabled,u(this,D))!==V(r.enabled,u(this,D))||i!==u(this,ye))&&R(this,I,is).call(this,i)}getOptimisticResult(t){const r=u(this,K).getQueryCache().build(u(this,K),t),a=this.createResult(r,t);return ka(this,a)&&(C(this,H,a),C(this,He,this.options),C(this,Be,u(this,D).state)),a}getCurrentResult(){return u(this,H)}trackResult(t,r){return new Proxy(t,{get:(a,n)=>(this.trackProp(n),r==null||r(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&u(this,le).status==="pending"&&u(this,le).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,n))})}trackProp(t){u(this,Ge).add(t)}getCurrentQuery(){return u(this,D)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=u(this,K).defaultQueryOptions(t),a=u(this,K).getQueryCache().build(u(this,K),r);return a.fetch().then(()=>this.createResult(a,r))}fetch(t){return R(this,I,at).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),u(this,H)))}createResult(t,r){var P;const a=u(this,D),n=this.options,i=u(this,H),l=u(this,Be),d=u(this,He),h=t!==a?t.state:u(this,ft),{state:m}=t;let f={...m},p=!1,b;if(r._optimisticResults){const O=this.hasListeners(),z=!O&&Ts(t,r),Se=O&&Ls(t,a,r,n);(z||Se)&&(f={...f,...yr(m.data,t.options)}),r._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:v,errorUpdatedAt:y,status:N}=f;b=f.data;let w=!1;if(r.placeholderData!==void 0&&b===void 0&&N==="pending"){let O;i!=null&&i.isPlaceholderData&&r.placeholderData===(d==null?void 0:d.placeholderData)?(O=i.data,w=!0):O=typeof r.placeholderData=="function"?r.placeholderData((P=u(this,Ke))==null?void 0:P.state.data,u(this,Ke)):r.placeholderData,O!==void 0&&(N="success",b=ts(i==null?void 0:i.data,O,r),p=!0)}if(r.select&&b!==void 0&&!w)if(i&&b===(l==null?void 0:l.data)&&r.select===u(this,gt))b=u(this,ze);else try{C(this,gt,r.select),b=r.select(b),b=ts(i==null?void 0:i.data,b,r),C(this,ze,b),C(this,pe,null)}catch(O){C(this,pe,O)}u(this,pe)&&(v=u(this,pe),b=u(this,ze),y=Date.now(),N="error");const j=f.fetchStatus==="fetching",x=N==="pending",g=N==="error",E=x&&j,F=b!==void 0,S={status:N,fetchStatus:f.fetchStatus,isPending:x,isSuccess:N==="success",isError:g,isInitialLoading:E,isLoading:E,data:b,dataUpdatedAt:f.dataUpdatedAt,error:v,errorUpdatedAt:y,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:f.dataUpdateCount>h.dataUpdateCount||f.errorUpdateCount>h.errorUpdateCount,isFetching:j,isRefetching:j&&!x,isLoadingError:g&&!F,isPaused:f.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:g&&F,isStale:bs(t,r),refetch:this.refetch,promise:u(this,le),isEnabled:V(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const O=S.data!==void 0,z=S.status==="error"&&!O,Se=$=>{z?$.reject(S.error):O&&$.resolve(S.data)},k=()=>{const $=C(this,le,S.promise=ss());Se($)},T=u(this,le);switch(T.status){case"pending":t.queryHash===a.queryHash&&Se(T);break;case"fulfilled":(z||S.data!==T.value)&&k();break;case"rejected":(!z||S.error!==T.reason)&&k();break}}return S}updateResult(){const t=u(this,H),r=this.createResult(u(this,D),this.options);if(C(this,Be,u(this,D).state),C(this,He,this.options),u(this,Be).data!==void 0&&C(this,Ke,u(this,D)),Zt(r,t))return;C(this,H,r);const a=()=>{if(!t)return!0;const{notifyOnChangeProps:n}=this.options,i=typeof n=="function"?n():n;if(i==="all"||!i&&!u(this,Ge).size)return!0;const l=new Set(i??u(this,Ge));return this.options.throwOnError&&l.add("error"),Object.keys(u(this,H)).some(d=>{const o=d;return u(this,H)[o]!==t[o]&&l.has(o)})};R(this,I,br).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&R(this,I,ls).call(this)}},K=new WeakMap,D=new WeakMap,ft=new WeakMap,H=new WeakMap,Be=new WeakMap,He=new WeakMap,le=new WeakMap,pe=new WeakMap,gt=new WeakMap,ze=new WeakMap,Ke=new WeakMap,Te=new WeakMap,Le=new WeakMap,ye=new WeakMap,Ge=new WeakMap,I=new WeakSet,at=function(t){R(this,I,ds).call(this);let r=u(this,D).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(G)),r},as=function(){R(this,I,os).call(this);const t=Ne(this.options.staleTime,u(this,D));if(ut.isServer()||u(this,H).isStale||!Xt(t))return;const a=dr(u(this,H).dataUpdatedAt,t)+1;C(this,Te,Ae.setTimeout(()=>{u(this,H).isStale||this.updateResult()},a))},ns=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(u(this,D)):this.options.refetchInterval)??!1},is=function(t){R(this,I,cs).call(this),C(this,ye,t),!(ut.isServer()||V(this.options.enabled,u(this,D))===!1||!Xt(u(this,ye))||u(this,ye)===0)&&C(this,Le,Ae.setInterval(()=>{(this.options.refetchIntervalInBackground||gs.isFocused())&&R(this,I,at).call(this)},u(this,ye)))},ls=function(){R(this,I,as).call(this),R(this,I,is).call(this,R(this,I,ns).call(this))},os=function(){u(this,Te)!==void 0&&(Ae.clearTimeout(u(this,Te)),C(this,Te,void 0))},cs=function(){u(this,Le)!==void 0&&(Ae.clearInterval(u(this,Le)),C(this,Le,void 0))},ds=function(){const t=u(this,K).getQueryCache().build(u(this,K),this.options);if(t===u(this,D))return;const r=u(this,D);C(this,D,t),C(this,ft,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},br=function(t){Q.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(u(this,H))}),u(this,K).getQueryCache().notify({query:u(this,D),type:"observerResultsUpdated"})})},Ys);function Ea(e,t){return V(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&V(t.retryOnMount,e)===!1)}function Ts(e,t){return Ea(e,t)||e.state.data!==void 0&&us(e,t,t.refetchOnMount)}function us(e,t,r){if(V(t.enabled,e)!==!1&&Ne(t.staleTime,e)!=="static"){const a=typeof r=="function"?r(e):r;return a==="always"||a!==!1&&bs(e,t)}return!1}function Ls(e,t,r,a){return(e!==t||V(a.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&bs(e,r)}function bs(e,t){return V(t.enabled,e)!==!1&&e.isStaleByTime(Ne(t.staleTime,e))}function ka(e,t){return!Zt(e.getCurrentResult(),t)}var pt,re,W,Me,ae,me,Xs,Ca=(Xs=class extends gr{constructor(t){super();A(this,ae);A(this,pt);A(this,re);A(this,W);A(this,Me);C(this,pt,t.client),this.mutationId=t.mutationId,C(this,W,t.mutationCache),C(this,re,[]),this.state=t.state||Sa(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){u(this,re).includes(t)||(u(this,re).push(t),this.clearGcTimeout(),u(this,W).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){C(this,re,u(this,re).filter(r=>r!==t)),this.scheduleGc(),u(this,W).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){u(this,re).length||(this.state.status==="pending"?this.scheduleGc():u(this,W).remove(this))}continue(){var t;return((t=u(this,Me))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,d,o,h,m,f,p,b,v,y,N,w,j,x,g,E,F,B;const r=()=>{R(this,ae,me).call(this,{type:"continue"})},a={client:u(this,pt),meta:this.options.meta,mutationKey:this.options.mutationKey};C(this,Me,fr({fn:()=>this.options.mutationFn?this.options.mutationFn(t,a):Promise.reject(new Error("No mutationFn found")),onFail:(S,P)=>{R(this,ae,me).call(this,{type:"failed",failureCount:S,error:P})},onPause:()=>{R(this,ae,me).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>u(this,W).canRun(this)}));const n=this.state.status==="pending",i=!u(this,Me).canStart();try{if(n)r();else{R(this,ae,me).call(this,{type:"pending",variables:t,isPaused:i}),u(this,W).config.onMutate&&await u(this,W).config.onMutate(t,this,a);const P=await((d=(l=this.options).onMutate)==null?void 0:d.call(l,t,a));P!==this.state.context&&R(this,ae,me).call(this,{type:"pending",context:P,variables:t,isPaused:i})}const S=await u(this,Me).start();return await((h=(o=u(this,W).config).onSuccess)==null?void 0:h.call(o,S,t,this.state.context,this,a)),await((f=(m=this.options).onSuccess)==null?void 0:f.call(m,S,t,this.state.context,a)),await((b=(p=u(this,W).config).onSettled)==null?void 0:b.call(p,S,null,this.state.variables,this.state.context,this,a)),await((y=(v=this.options).onSettled)==null?void 0:y.call(v,S,null,t,this.state.context,a)),R(this,ae,me).call(this,{type:"success",data:S}),S}catch(S){try{await((w=(N=u(this,W).config).onError)==null?void 0:w.call(N,S,t,this.state.context,this,a))}catch(P){Promise.reject(P)}try{await((x=(j=this.options).onError)==null?void 0:x.call(j,S,t,this.state.context,a))}catch(P){Promise.reject(P)}try{await((E=(g=u(this,W).config).onSettled)==null?void 0:E.call(g,void 0,S,this.state.variables,this.state.context,this,a))}catch(P){Promise.reject(P)}try{await((B=(F=this.options).onSettled)==null?void 0:B.call(F,void 0,S,t,this.state.context,a))}catch(P){Promise.reject(P)}throw R(this,ae,me).call(this,{type:"error",error:S}),S}finally{u(this,W).runNext(this)}}},pt=new WeakMap,re=new WeakMap,W=new WeakMap,Me=new WeakMap,ae=new WeakSet,me=function(t){const r=a=>{switch(t.type){case"failed":return{...a,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...a,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:t.error,failureCount:a.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Q.batch(()=>{u(this,re).forEach(a=>{a.onMutationUpdate(t)}),u(this,W).notify({mutation:this,type:"updated",action:t})})},Xs);function Sa(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var oe,ee,yt,Zs,Aa=(Zs=class extends bt{constructor(t={}){super();A(this,oe);A(this,ee);A(this,yt);this.config=t,C(this,oe,new Set),C(this,ee,new Map),C(this,yt,0)}build(t,r,a){const n=new Ca({client:t,mutationCache:this,mutationId:++Nt(this,yt)._,options:t.defaultMutationOptions(r),state:a});return this.add(n),n}add(t){u(this,oe).add(t);const r=kt(t);if(typeof r=="string"){const a=u(this,ee).get(r);a?a.push(t):u(this,ee).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(u(this,oe).delete(t)){const r=kt(t);if(typeof r=="string"){const a=u(this,ee).get(r);if(a)if(a.length>1){const n=a.indexOf(t);n!==-1&&a.splice(n,1)}else a[0]===t&&u(this,ee).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=kt(t);if(typeof r=="string"){const a=u(this,ee).get(r),n=a==null?void 0:a.find(i=>i.state.status==="pending");return!n||n===t}else return!0}runNext(t){var a;const r=kt(t);if(typeof r=="string"){const n=(a=u(this,ee).get(r))==null?void 0:a.find(i=>i!==t&&i.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Q.batch(()=>{u(this,oe).forEach(t=>{this.notify({type:"removed",mutation:t})}),u(this,oe).clear(),u(this,ee).clear()})}getAll(){return Array.from(u(this,oe))}find(t){const r={exact:!0,...t};return this.getAll().find(a=>Ps(r,a))}findAll(t={}){return this.getAll().filter(r=>Ps(t,r))}notify(t){Q.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Q.batch(()=>Promise.all(t.map(r=>r.continue().catch(G))))}},oe=new WeakMap,ee=new WeakMap,yt=new WeakMap,Zs);function kt(e){var t;return(t=e.options.scope)==null?void 0:t.id}var ne,er,Fa=(er=class extends bt{constructor(t={}){super();A(this,ne);this.config=t,C(this,ne,new Map)}build(t,r,a){const n=r.queryKey,i=r.queryHash??ps(n,r);let l=this.get(i);return l||(l=new wa({client:t,queryKey:n,queryHash:i,options:t.defaultQueryOptions(r),state:a,defaultOptions:t.getQueryDefaults(n)}),this.add(l)),l}add(t){u(this,ne).has(t.queryHash)||(u(this,ne).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=u(this,ne).get(t.queryHash);r&&(t.destroy(),r===t&&u(this,ne).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Q.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return u(this,ne).get(t)}getAll(){return[...u(this,ne).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(a=>Fs(r,a))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(a=>Fs(t,a)):r}notify(t){Q.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Q.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Q.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ne=new WeakMap,er),U,be,ve,Je,Ve,je,Ye,Xe,tr,Pa=(tr=class{constructor(e={}){A(this,U);A(this,be);A(this,ve);A(this,Je);A(this,Ve);A(this,je);A(this,Ye);A(this,Xe);C(this,U,e.queryCache||new Fa),C(this,be,e.mutationCache||new Aa),C(this,ve,e.defaultOptions||{}),C(this,Je,new Map),C(this,Ve,new Map),C(this,je,0)}mount(){Nt(this,je)._++,u(this,je)===1&&(C(this,Ye,gs.subscribe(async e=>{e&&(await this.resumePausedMutations(),u(this,U).onFocus())})),C(this,Xe,Ot.subscribe(async e=>{e&&(await this.resumePausedMutations(),u(this,U).onOnline())})))}unmount(){var e,t;Nt(this,je)._--,u(this,je)===0&&((e=u(this,Ye))==null||e.call(this),C(this,Ye,void 0),(t=u(this,Xe))==null||t.call(this),C(this,Xe,void 0))}isFetching(e){return u(this,U).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return u(this,be).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=u(this,U).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=u(this,U).build(this,t),a=r.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Ne(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return u(this,U).findAll(e).map(({queryKey:t,state:r})=>{const a=r.data;return[t,a]})}setQueryData(e,t,r){const a=this.defaultQueryOptions({queryKey:e}),n=u(this,U).get(a.queryHash),i=n==null?void 0:n.state.data,l=da(t,i);if(l!==void 0)return u(this,U).build(this,a).setData(l,{...r,manual:!0})}setQueriesData(e,t,r){return Q.batch(()=>u(this,U).findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=u(this,U).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=u(this,U);Q.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=u(this,U);return Q.batch(()=>(r.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},a=Q.batch(()=>u(this,U).findAll(e).map(n=>n.cancel(r)));return Promise.all(a).then(G).catch(G)}invalidateQueries(e,t={}){return Q.batch(()=>(u(this,U).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},a=Q.batch(()=>u(this,U).findAll(e).filter(n=>!n.isDisabled()&&!n.isStatic()).map(n=>{let i=n.fetch(void 0,r);return r.throwOnError||(i=i.catch(G)),n.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(a).then(G)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=u(this,U).build(this,t);return r.isStaleByTime(Ne(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(G).catch(G)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(G).catch(G)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Ot.isOnline()?u(this,be).resumePausedMutations():Promise.resolve()}getQueryCache(){return u(this,U)}getMutationCache(){return u(this,be)}getDefaultOptions(){return u(this,ve)}setDefaultOptions(e){C(this,ve,e)}setQueryDefaults(e,t){u(this,Je).set(ct(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...u(this,Je).values()],r={};return t.forEach(a=>{dt(e,a.queryKey)&&Object.assign(r,a.defaultOptions)}),r}setMutationDefaults(e,t){u(this,Ve).set(ct(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...u(this,Ve).values()],r={};return t.forEach(a=>{dt(e,a.mutationKey)&&Object.assign(r,a.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...u(this,ve).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ps(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===ys&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...u(this,ve).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){u(this,U).clear(),u(this,be).clear()}},U=new WeakMap,be=new WeakMap,ve=new WeakMap,Je=new WeakMap,Ve=new WeakMap,je=new WeakMap,Ye=new WeakMap,Xe=new WeakMap,tr),vr=c.createContext(void 0),Ra=e=>{const t=c.useContext(vr);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Da=({client:e,children:t})=>(c.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(vr.Provider,{value:e,children:t})),jr=c.createContext(!1),Oa=()=>c.useContext(jr);jr.Provider;function Ia(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ba=c.createContext(Ia()),Ta=()=>c.useContext(Ba),La=(e,t,r)=>{const a=r!=null&&r.state.error&&typeof e.throwOnError=="function"?mr(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},Ma=e=>{c.useEffect(()=>{e.clearReset()},[e])},Ua=({result:e,errorResetBoundary:t,throwOnError:r,query:a,suspense:n})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(n&&e.data===void 0||mr(r,[e.error,a])),$a=e=>{if(e.suspense){const r=n=>n==="static"?n:Math.max(n??1e3,1e3),a=e.staleTime;e.staleTime=typeof a=="function"?(...n)=>r(a(...n)):r(a),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},_a=(e,t)=>e.isLoading&&e.isFetching&&!t,Qa=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Ms=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function qa(e,t,r){var b,v,y,N;const a=Oa(),n=Ta(),i=Ra(),l=i.defaultQueryOptions(e);(v=(b=i.getDefaultOptions().queries)==null?void 0:b._experimental_beforeQuery)==null||v.call(b,l);const d=i.getQueryCache().get(l.queryHash),o=e.subscribed!==!1;l._optimisticResults=a?"isRestoring":o?"optimistic":void 0,$a(l),La(l,n,d),Ma(n);const h=!i.getQueryCache().get(l.queryHash),[m]=c.useState(()=>new t(i,l)),f=m.getOptimisticResult(l),p=!a&&o;if(c.useSyncExternalStore(c.useCallback(w=>{const j=p?m.subscribe(Q.batchCalls(w)):G;return m.updateResult(),j},[m,p]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),c.useEffect(()=>{m.setOptions(l)},[l,m]),Qa(l,f))throw Ms(l,m,n);if(Ua({result:f,errorResetBoundary:n,throwOnError:l.throwOnError,query:d,suspense:l.suspense}))throw f.error;if((N=(y=i.getDefaultOptions().queries)==null?void 0:y._experimental_afterQuery)==null||N.call(y,l,f),l.experimental_prefetchInRender&&!ut.isServer()&&_a(f,a)){const w=h?Ms(l,m,n):d==null?void 0:d.promise;w==null||w.catch(G).finally(()=>{m.updateResult()})}return l.notifyOnChangeProps?f:m.trackResult(f)}function Ht(e,t){return qa(e,Na)}/** * react-router v7.13.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */var Us="popstate";function Wa(e={}){function t(a,n){let{pathname:i,search:l,hash:d}=a.location;return hs("",{pathname:i,search:l,hash:d},n.state&&n.state.usr||null,n.state&&n.state.key||"default")}function r(a,n){return typeof n=="string"?n:ht(n)}return za(t,r,null,e)}function M(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function te(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Ha(){return Math.random().toString(36).substring(2,10)}function $s(e,t){return{usr:e.state,key:e.key,idx:t}}function hs(e,t,r=null,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ze(t):t,state:r,key:t&&t.key||a||Ha()}}function ht({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Ze(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function za(e,t,r,a={}){let{window:n=document.defaultView,v5Compat:i=!1}=a,l=n.history,d="POP",o=null,h=m();h==null&&(h=0,l.replaceState({...l.state,idx:h},""));function m(){return(l.state||{idx:null}).idx}function f(){d="POP";let N=m(),w=N==null?null:N-h;h=N,o&&o({action:d,location:y.location,delta:w})}function p(N,w){d="PUSH";let j=hs(y.location,N,w);h=m()+1;let x=$s(j,h),g=y.createHref(j);try{l.pushState(x,"",g)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;n.location.assign(g)}i&&o&&o({action:d,location:y.location,delta:1})}function b(N,w){d="REPLACE";let j=hs(y.location,N,w);h=m();let x=$s(j,h),g=y.createHref(j);l.replaceState(x,"",g),i&&o&&o({action:d,location:y.location,delta:0})}function v(N){return Ka(N)}let y={get action(){return d},get location(){return e(n,l)},listen(N){if(o)throw new Error("A history only accepts one active listener");return n.addEventListener(Us,f),o=N,()=>{n.removeEventListener(Us,f),o=null}},createHref(N){return t(n,N)},createURL:v,encodeLocation(N){let w=v(N);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:p,replace:b,go(N){return l.go(N)}};return y}function Ka(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),M(r,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:ht(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=r+a),new URL(a,r)}function wr(e,t,r="/"){return Ga(e,t,r,!1)}function Ga(e,t,r,a){let n=typeof t=="string"?Ze(t):t,i=de(n.pathname||"/",r);if(i==null)return null;let l=Nr(e);Ja(l);let d=null;for(let o=0;d==null&&o{let m={relativePath:h===void 0?l.path||"":h,caseSensitive:l.caseSensitive===!0,childrenIndex:d,route:l};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(a)&&o)return;M(m.relativePath.startsWith(a),`Absolute route path "${m.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(a.length)}let f=ce([a,m.relativePath]),p=r.concat(m);l.children&&l.children.length>0&&(M(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),Nr(l.children,t,p,f,o)),!(l.path==null&&!l.index)&&t.push({path:f,score:sn(f,l.index),routesMeta:p})};return e.forEach((l,d)=>{var o;if(l.path===""||!((o=l.path)!=null&&o.includes("?")))i(l,d);else for(let h of Er(l.path))i(l,d,!0,h)}),t}function Er(e){let t=e.split("/");if(t.length===0)return[];let[r,...a]=t,n=r.endsWith("?"),i=r.replace(/\?$/,"");if(a.length===0)return n?[i,""]:[i];let l=Er(a.join("/")),d=[];return d.push(...l.map(o=>o===""?i:[i,o].join("/"))),n&&d.push(...l),d.map(o=>e.startsWith("/")&&o===""?"/":o)}function Ja(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:rn(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var Va=/^:[\w-]+$/,Ya=3,Xa=2,Za=1,en=10,tn=-2,_s=e=>e==="*";function sn(e,t){let r=e.split("/"),a=r.length;return r.some(_s)&&(a+=tn),t&&(a+=Xa),r.filter(n=>!_s(n)).reduce((n,i)=>n+(Va.test(i)?Ya:i===""?Za:en),a)}function rn(e,t){return e.length===t.length&&e.slice(0,-1).every((a,n)=>a===t[n])?e[e.length-1]-t[t.length-1]:0}function an(e,t,r=!1){let{routesMeta:a}=e,n={},i="/",l=[];for(let d=0;d{if(m==="*"){let v=d[p]||"";l=i.slice(0,i.length-v.length).replace(/(.)\/+$/,"$1")}const b=d[p];return f&&!b?h[m]=void 0:h[m]=(b||"").replace(/%2F/g,"/"),h},{}),pathname:i,pathnameBase:l,pattern:e}}function nn(e,t=!1,r=!0){te(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,d,o)=>(a.push({paramName:d,isOptional:o!=null}),o?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),n+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":e!==""&&e!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,t?void 0:"i"),a]}function ln(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return te(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function de(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}var on=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function cn(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?Ze(e):e,i;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?i=Qs(r.substring(1),"/"):i=Qs(r,t)):i=t,{pathname:i,search:hn(a),hash:mn(n)}}function Qs(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function zt(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function dn(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function vs(e){let t=dn(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function js(e,t,r,a=!1){let n;typeof e=="string"?n=Ze(e):(n={...e},M(!n.pathname||!n.pathname.includes("?"),zt("?","pathname","search",n)),M(!n.pathname||!n.pathname.includes("#"),zt("#","pathname","hash",n)),M(!n.search||!n.search.includes("#"),zt("#","search","hash",n)));let i=e===""||n.pathname==="",l=i?"/":n.pathname,d;if(l==null)d=r;else{let f=t.length-1;if(!a&&l.startsWith("..")){let p=l.split("/");for(;p[0]==="..";)p.shift(),f-=1;n.pathname=p.join("/")}d=f>=0?t[f]:"/"}let o=cn(n,d),h=l&&l!=="/"&&l.endsWith("/"),m=(i||l===".")&&r.endsWith("/");return!o.pathname.endsWith("/")&&(h||m)&&(o.pathname+="/"),o}var ce=e=>e.join("/").replace(/\/\/+/g,"/"),un=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),hn=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,mn=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,xn=class{constructor(e,t,r,a=!1){this.status=e,this.statusText=t||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function fn(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function gn(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var kr=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Cr(e,t){let r=e;if(typeof r!="string"||!on.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,n=!1;if(kr)try{let i=new URL(window.location.href),l=r.startsWith("//")?new URL(i.protocol+r):new URL(r),d=de(l.pathname,t);l.origin===i.origin&&d!=null?r=d+l.search+l.hash:n=!0}catch{te(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:n,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Sr=["POST","PUT","PATCH","DELETE"];new Set(Sr);var pn=["GET",...Sr];new Set(pn);var et=c.createContext(null);et.displayName="DataRouter";var Mt=c.createContext(null);Mt.displayName="DataRouterState";var yn=c.createContext(!1),Ar=c.createContext({isTransitioning:!1});Ar.displayName="ViewTransition";var bn=c.createContext(new Map);bn.displayName="Fetchers";var vn=c.createContext(null);vn.displayName="Await";var Y=c.createContext(null);Y.displayName="Navigation";var vt=c.createContext(null);vt.displayName="Location";var se=c.createContext({outlet:null,matches:[],isDataRoute:!1});se.displayName="Route";var ws=c.createContext(null);ws.displayName="RouteError";var Fr="REACT_ROUTER_ERROR",jn="REDIRECT",wn="ROUTE_ERROR_RESPONSE";function Nn(e){if(e.startsWith(`${Fr}:${jn}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function En(e){if(e.startsWith(`${Fr}:${wn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new xn(t.status,t.statusText,t.data)}catch{}}function kn(e,{relative:t}={}){M(tt(),"useHref() may be used only in the context of a component.");let{basename:r,navigator:a}=c.useContext(Y),{hash:n,pathname:i,search:l}=jt(e,{relative:t}),d=i;return r!=="/"&&(d=i==="/"?r:ce([r,i])),a.createHref({pathname:d,search:l,hash:n})}function tt(){return c.useContext(vt)!=null}function ue(){return M(tt(),"useLocation() may be used only in the context of a component."),c.useContext(vt).location}var Pr="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Rr(e){c.useContext(Y).static||c.useLayoutEffect(e)}function Ce(){let{isDataRoute:e}=c.useContext(se);return e?Un():Cn()}function Cn(){M(tt(),"useNavigate() may be used only in the context of a component.");let e=c.useContext(et),{basename:t,navigator:r}=c.useContext(Y),{matches:a}=c.useContext(se),{pathname:n}=ue(),i=JSON.stringify(vs(a)),l=c.useRef(!1);return Rr(()=>{l.current=!0}),c.useCallback((o,h={})=>{if(te(l.current,Pr),!l.current)return;if(typeof o=="number"){r.go(o);return}let m=js(o,JSON.parse(i),n,h.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:ce([t,m.pathname])),(h.replace?r.replace:r.push)(m,h.state,h)},[t,r,i,n,e])}c.createContext(null);function Sn(){let{matches:e}=c.useContext(se),t=e[e.length-1];return t?t.params:{}}function jt(e,{relative:t}={}){let{matches:r}=c.useContext(se),{pathname:a}=ue(),n=JSON.stringify(vs(r));return c.useMemo(()=>js(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function An(e,t){return Dr(e,t)}function Dr(e,t,r,a,n){var j;M(tt(),"useRoutes() may be used only in the context of a component.");let{navigator:i}=c.useContext(Y),{matches:l}=c.useContext(se),d=l[l.length-1],o=d?d.params:{},h=d?d.pathname:"/",m=d?d.pathnameBase:"/",f=d&&d.route;{let x=f&&f.path||"";Ir(h,!f||x.endsWith("*")||x.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${h}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. Please change the parent to .`)}let p=ue(),b;if(t){let x=typeof t=="string"?Ze(t):t;M(m==="/"||((j=x.pathname)==null?void 0:j.startsWith(m)),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${x.pathname}" was given in the \`location\` prop.`),b=x}else b=p;let v=b.pathname||"/",y=v;if(m!=="/"){let x=m.replace(/^\//,"").split("/");y="/"+v.replace(/^\//,"").split("/").slice(x.length).join("/")}let N=wr(e,{pathname:y});te(f||N!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),te(N==null||N[N.length-1].route.element!==void 0||N[N.length-1].route.Component!==void 0||N[N.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let w=On(N&&N.map(x=>Object.assign({},x,{params:Object.assign({},o,x.params),pathname:ce([m,i.encodeLocation?i.encodeLocation(x.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?m:ce([m,i.encodeLocation?i.encodeLocation(x.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:x.pathnameBase])})),l,r,a,n);return t&&w?c.createElement(vt.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...b},navigationType:"POP"}},w):w}function Fn(){let e=Mn(),t=fn(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",n={padding:"0.5rem",backgroundColor:a},i={padding:"2px 4px",backgroundColor:a},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=c.createElement(c.Fragment,null,c.createElement("p",null,"💿 Hey developer 👋"),c.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",c.createElement("code",{style:i},"ErrorBoundary")," or"," ",c.createElement("code",{style:i},"errorElement")," prop on your route.")),c.createElement(c.Fragment,null,c.createElement("h2",null,"Unexpected Application Error!"),c.createElement("h3",{style:{fontStyle:"italic"}},t),r?c.createElement("pre",{style:n},r):null,l)}var Pn=c.createElement(Fn,null),Or=class extends c.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=En(e.digest);r&&(e=r)}let t=e!==void 0?c.createElement(se.Provider,{value:this.props.routeContext},c.createElement(ws.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?c.createElement(Rn,{error:e},t):t}};Or.contextType=yn;var Kt=new WeakMap;function Rn({children:e,error:t}){let{basename:r}=c.useContext(Y);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=Nn(t.digest);if(a){let n=Kt.get(t);if(n)throw n;let i=Cr(a.location,r);if(kr&&!Kt.get(t))if(i.isExternal||a.reloadDocument)window.location.href=i.absoluteURL||i.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:a.replace}));throw Kt.set(t,l),l}return c.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i.absoluteURL||i.to}`})}}return e}function Dn({routeContext:e,match:t,children:r}){let a=c.useContext(et);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),c.createElement(se.Provider,{value:e},r)}function On(e,t=[],r=null,a=null,n=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,l=r==null?void 0:r.errors;if(l!=null){let m=i.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);M(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),i=i.slice(0,Math.min(i.length,m+1))}let d=!1,o=-1;if(r)for(let m=0;m=0?i=i.slice(0,o+1):i=[i[0]];break}}}let h=r&&a?(m,f)=>{var p,b;a(m,{location:r.location,params:((b=(p=r.matches)==null?void 0:p[0])==null?void 0:b.params)??{},unstable_pattern:gn(r.matches),errorInfo:f})}:void 0;return i.reduceRight((m,f,p)=>{let b,v=!1,y=null,N=null;r&&(b=l&&f.route.id?l[f.route.id]:void 0,y=f.route.errorElement||Pn,d&&(o<0&&p===0?(Ir("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,N=null):o===p&&(v=!0,N=f.route.hydrateFallbackElement||null)));let w=t.concat(i.slice(0,p+1)),j=()=>{let x;return b?x=y:v?x=N:f.route.Component?x=c.createElement(f.route.Component,null):f.route.element?x=f.route.element:x=m,c.createElement(Dn,{match:f,routeContext:{outlet:m,matches:w,isDataRoute:r!=null},children:x})};return r&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?c.createElement(Or,{location:r.location,revalidation:r.revalidation,component:y,error:b,children:j(),routeContext:{outlet:null,matches:w,isDataRoute:!0},onError:h}):j()},null)}function Ns(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function In(e){let t=c.useContext(et);return M(t,Ns(e)),t}function Bn(e){let t=c.useContext(Mt);return M(t,Ns(e)),t}function Tn(e){let t=c.useContext(se);return M(t,Ns(e)),t}function Es(e){let t=Tn(e),r=t.matches[t.matches.length-1];return M(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Ln(){return Es("useRouteId")}function Mn(){var a;let e=c.useContext(ws),t=Bn("useRouteError"),r=Es("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[r]}function Un(){let{router:e}=In("useNavigate"),t=Es("useNavigate"),r=c.useRef(!1);return Rr(()=>{r.current=!0}),c.useCallback(async(n,i={})=>{te(r.current,Pr),r.current&&(typeof n=="number"?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...i}))},[e,t])}var qs={};function Ir(e,t,r){!t&&!qs[e]&&(qs[e]=!0,te(!1,r))}c.memo($n);function $n({routes:e,future:t,state:r,onError:a}){return Dr(e,void 0,r,a,t)}function mt({to:e,replace:t,state:r,relative:a}){M(tt()," may be used only in the context of a component.");let{static:n}=c.useContext(Y);te(!n," must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.");let{matches:i}=c.useContext(se),{pathname:l}=ue(),d=Ce(),o=js(e,vs(i),l,a==="path"),h=JSON.stringify(o);return c.useEffect(()=>{d(JSON.parse(h),{replace:t,state:r,relative:a})},[d,h,a,t,r]),null}function X(e){M(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function _n({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:n,static:i=!1,unstable_useTransitions:l}){M(!tt(),"You cannot render a inside another . You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),o=c.useMemo(()=>({basename:d,navigator:n,static:i,unstable_useTransitions:l,future:{}}),[d,n,i,l]);typeof r=="string"&&(r=Ze(r));let{pathname:h="/",search:m="",hash:f="",state:p=null,key:b="default"}=r,v=c.useMemo(()=>{let y=de(h,d);return y==null?null:{location:{pathname:y,search:m,hash:f,state:p,key:b},navigationType:a}},[d,h,m,f,p,b,a]);return te(v!=null,` is not able to match the URL "${h}${m}${f}" because it does not start with the basename, so the won't render anything.`),v==null?null:c.createElement(Y.Provider,{value:o},c.createElement(vt.Provider,{children:t,value:v}))}function Qn({children:e,location:t}){return An(ms(e),t)}function ms(e,t=[]){let r=[];return c.Children.forEach(e,(a,n)=>{if(!c.isValidElement(a))return;let i=[...t,n];if(a.type===c.Fragment){r.push.apply(r,ms(a.props.children,i));return}M(a.type===X,`[${typeof a.type=="string"?a.type:a.type.name}] is not a component. All component children of must be a or `),M(!a.props.index||!a.props.children,"An index route cannot have child routes.");let l={id:a.props.id||i.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(l.children=ms(a.props.children,i)),r.push(l)}),r}var Ft="get",Pt="application/x-www-form-urlencoded";function Ut(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function qn(e){return Ut(e)&&e.tagName.toLowerCase()==="button"}function Wn(e){return Ut(e)&&e.tagName.toLowerCase()==="form"}function Hn(e){return Ut(e)&&e.tagName.toLowerCase()==="input"}function zn(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Kn(e,t){return e.button===0&&(!t||t==="_self")&&!zn(e)}var Ct=null;function Gn(){if(Ct===null)try{new FormData(document.createElement("form"),0),Ct=!1}catch{Ct=!0}return Ct}var Jn=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Gt(e){return e!=null&&!Jn.has(e)?(te(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${Pt}"`),null):e}function Vn(e,t){let r,a,n,i,l;if(Wn(e)){let d=e.getAttribute("action");a=d?de(d,t):null,r=e.getAttribute("method")||Ft,n=Gt(e.getAttribute("enctype"))||Pt,i=new FormData(e)}else if(qn(e)||Hn(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a