import{r as w}from"./jsx-runtime-DaAkiwFt.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c0334e1b-8c00-4048-8219-7cd23f0bcff3",e._sentryDebugIdIdentifier="sentry-dbid-c0334e1b-8c00-4048-8219-7cd23f0bcff3")}catch{}})();/**
 * @remix-run/router v1.16.1
 *
 * 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
 */function O(){return O=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},O.apply(this,arguments)}var A;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(A||(A={}));const Nt="popstate";function Hn(e){e===void 0&&(e={});function t(n,a){let{pathname:l,search:i,hash:d}=n.location;return We("",{pathname:l,search:i,hash:d},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:Ve(a)}return _r(t,r,null,e)}function L(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function je(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Lr(){return Math.random().toString(36).substr(2,8)}function At(e,t){return{usr:e.state,key:e.key,idx:t}}function We(e,t,r,n){return r===void 0&&(r=null),O({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ce(t):t,{state:r,key:t&&t.key||n||Lr()})}function Ve(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function ce(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function _r(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:l=!1}=n,i=a.history,d=A.Pop,u=null,v=h();v==null&&(v=0,i.replaceState(O({},i.state,{idx:v}),""));function h(){return(i.state||{idx:null}).idx}function m(){d=A.Pop;let x=h(),U=x==null?null:x-v;v=x,u&&u({action:d,location:E.location,delta:U})}function g(x,U){d=A.Push;let T=We(E.location,x,U);r&&r(T,x),v=h()+1;let B=At(T,v),he=E.createHref(T);try{i.pushState(B,"",he)}catch(ne){if(ne instanceof DOMException&&ne.name==="DataCloneError")throw ne;a.location.assign(he)}l&&u&&u({action:d,location:E.location,delta:1})}function _(x,U){d=A.Replace;let T=We(E.location,x,U);r&&r(T,x),v=h();let B=At(T,v),he=E.createHref(T);i.replaceState(B,"",he),l&&u&&u({action:d,location:E.location,delta:0})}function P(x){let U=a.location.origin!=="null"?a.location.origin:a.location.href,T=typeof x=="string"?x:Ve(x);return T=T.replace(/ $/,"%20"),L(U,"No window.location.(origin|href) available to create URL for href: "+T),new URL(T,U)}let E={get action(){return d},get location(){return e(a,i)},listen(x){if(u)throw new Error("A history only accepts one active listener");return a.addEventListener(Nt,m),u=x,()=>{a.removeEventListener(Nt,m),u=null}},createHref(x){return t(a,x)},createURL:P,encodeLocation(x){let U=P(x);return{pathname:U.pathname,search:U.search,hash:U.hash}},push:g,replace:_,go(x){return i.go(x)}};return E}var N;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(N||(N={}));const jr=new Set(["lazy","caseSensitive","path","id","index","children"]);function Ur(e){return e.index===!0}function ht(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((a,l)=>{let i=[...r,l],d=typeof a.id=="string"?a.id:i.join("-");if(L(a.index!==!0||!a.children,"Cannot specify children on an index route"),L(!n[d],'Found a route id collision on id "'+d+`".  Route id's must be globally unique within Data Router usages`),Ur(a)){let u=O({},a,t(a),{id:d});return n[d]=u,u}else{let u=O({},a,t(a),{id:d,children:void 0});return n[d]=u,a.children&&(u.children=ht(a.children,t,i,n)),u}})}function _e(e,t,r){r===void 0&&(r="/");let n=typeof t=="string"?ce(t):t,a=Je(n.pathname||"/",r);if(a==null)return null;let l=tr(e);Fr(l);let i=null;for(let d=0;i==null&&d<l.length;++d){let u=$r(a);i=Kr(l[d],u)}return i}function er(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],handle:r.handle}}function tr(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(l,i,d)=>{let u={relativePath:d===void 0?l.path||"":d,caseSensitive:l.caseSensitive===!0,childrenIndex:i,route:l};u.relativePath.startsWith("/")&&(L(u.relativePath.startsWith(n),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(n.length));let v=ue([n,u.relativePath]),h=r.concat(u);l.children&&l.children.length>0&&(L(l.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+v+'".')),tr(l.children,t,h,v)),!(l.path==null&&!l.index)&&t.push({path:v,score:zr(v,l.index),routesMeta:h})};return e.forEach((l,i)=>{var d;if(l.path===""||!((d=l.path)!=null&&d.includes("?")))a(l,i);else for(let u of rr(l.path))a(l,i,u)}),t}function rr(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),l=r.replace(/\?$/,"");if(n.length===0)return a?[l,""]:[l];let i=rr(n.join("/")),d=[];return d.push(...i.map(u=>u===""?l:[l,u].join("/"))),a&&d.push(...i),d.map(u=>e.startsWith("/")&&u===""?"/":u)}function Fr(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:kr(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const Tr=/^:[\w-]+$/,Ir=3,Or=2,Nr=1,Ar=10,Br=-2,Bt=e=>e==="*";function zr(e,t){let r=e.split("/"),n=r.length;return r.some(Bt)&&(n+=Br),t&&(n+=Or),r.filter(a=>!Bt(a)).reduce((a,l)=>a+(Tr.test(l)?Ir:l===""?Nr:Ar),n)}function kr(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function Kr(e,t){let{routesMeta:r}=e,n={},a="/",l=[];for(let i=0;i<r.length;++i){let d=r[i],u=i===r.length-1,v=a==="/"?t:t.slice(a.length)||"/",h=Hr({path:d.relativePath,caseSensitive:d.caseSensitive,end:u},v);if(!h)return null;Object.assign(n,h.params);let m=d.route;l.push({params:n,pathname:ue([a,h.pathname]),pathnameBase:Yr(ue([a,h.pathnameBase])),route:m}),h.pathnameBase!=="/"&&(a=ue([a,h.pathnameBase]))}return l}function Hr(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=Wr(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let l=a[0],i=l.replace(/(.)\/+$/,"$1"),d=a.slice(1);return{params:n.reduce((v,h,m)=>{let{paramName:g,isOptional:_}=h;if(g==="*"){let E=d[m]||"";i=l.slice(0,l.length-E.length).replace(/(.)\/+$/,"$1")}const P=d[m];return _&&!P?v[g]=void 0:v[g]=(P||"").replace(/%2F/g,"/"),v},{}),pathname:l,pathnameBase:i,pattern:e}}function Wr(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),je(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 n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,d,u)=>(n.push({paramName:d,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function $r(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return je(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Je(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function Vr(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?ce(e):e;return{pathname:r?r.startsWith("/")?r:Jr(r,t):t,search:Gr(n),hash:Xr(a)}}function Jr(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function ut(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"].  Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function nr(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function yt(e,t){let r=nr(e);return t?r.map((n,a)=>a===e.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function bt(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=ce(e):(a=O({},e),L(!a.pathname||!a.pathname.includes("?"),ut("?","pathname","search",a)),L(!a.pathname||!a.pathname.includes("#"),ut("#","pathname","hash",a)),L(!a.search||!a.search.includes("#"),ut("#","search","hash",a)));let l=e===""||a.pathname==="",i=l?"/":a.pathname,d;if(i==null)d=r;else{let m=t.length-1;if(!n&&i.startsWith("..")){let g=i.split("/");for(;g[0]==="..";)g.shift(),m-=1;a.pathname=g.join("/")}d=m>=0?t[m]:"/"}let u=Vr(a,d),v=i&&i!=="/"&&i.endsWith("/"),h=(l||i===".")&&r.endsWith("/");return!u.pathname.endsWith("/")&&(v||h)&&(u.pathname+="/"),u}const ue=e=>e.join("/").replace(/\/\/+/g,"/"),Yr=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Gr=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Xr=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class mt extends Error{}class Wn{constructor(t,r){this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],L(t&&typeof t=="object"&&!Array.isArray(t),"defer() only accepts plain objects");let n;this.abortPromise=new Promise((l,i)=>n=i),this.controller=new AbortController;let a=()=>n(new mt("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",a),this.controller.signal.addEventListener("abort",a),this.data=Object.entries(t).reduce((l,i)=>{let[d,u]=i;return Object.assign(l,{[d]:this.trackPromise(d,u)})},{}),this.done&&this.unlistenAbortSignal(),this.init=r}trackPromise(t,r){if(!(r instanceof Promise))return r;this.deferredKeys.push(t),this.pendingKeysSet.add(t);let n=Promise.race([r,this.abortPromise]).then(a=>this.onSettle(n,t,void 0,a),a=>this.onSettle(n,t,a));return n.catch(()=>{}),Object.defineProperty(n,"_tracked",{get:()=>!0}),n}onSettle(t,r,n,a){if(this.controller.signal.aborted&&n instanceof mt)return this.unlistenAbortSignal(),Object.defineProperty(t,"_error",{get:()=>n}),Promise.reject(n);if(this.pendingKeysSet.delete(r),this.done&&this.unlistenAbortSignal(),n===void 0&&a===void 0){let l=new Error('Deferred data for key "'+r+'" resolved/rejected with `undefined`, you must resolve/reject with a value or `null`.');return Object.defineProperty(t,"_error",{get:()=>l}),this.emit(!1,r),Promise.reject(l)}return a===void 0?(Object.defineProperty(t,"_error",{get:()=>n}),this.emit(!1,r),Promise.reject(n)):(Object.defineProperty(t,"_data",{get:()=>a}),this.emit(!1,r),a)}emit(t,r){this.subscribers.forEach(n=>n(t,r))}subscribe(t){return this.subscribers.add(t),()=>this.subscribers.delete(t)}cancel(){this.controller.abort(),this.pendingKeysSet.forEach((t,r)=>this.pendingKeysSet.delete(r)),this.emit(!0)}async resolveData(t){let r=!1;if(!this.done){let n=()=>this.cancel();t.addEventListener("abort",n),r=await new Promise(a=>{this.subscribe(l=>{t.removeEventListener("abort",n),(l||this.done)&&a(l)})})}return r}get done(){return this.pendingKeysSet.size===0}get unwrappedData(){return L(this.data!==null&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce((t,r)=>{let[n,a]=r;return Object.assign(t,{[n]:Qr(a)})},{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function qr(e){return e instanceof Promise&&e._tracked===!0}function Qr(e){if(!qr(e))return e;if(e._error)throw e._error;return e._data}const $n=function(t,r){r===void 0&&(r=302);let n=r;typeof n=="number"?n={status:n}:typeof n.status>"u"&&(n.status=302);let a=new Headers(n.headers);return a.set("Location",t),new Response(null,O({},n,{headers:a}))};class ar{constructor(t,r,n,a){a===void 0&&(a=!1),this.status=t,this.statusText=r||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function wt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const or=["post","put","patch","delete"],Zr=new Set(or),en=["get",...or],tn=new Set(en),rn=new Set([301,302,303,307,308]),nn=new Set([307,308]),ct={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},an={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ke={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Et=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,on=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),ir="remix-router-transitions";function Vn(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",n=!r;L(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a;if(e.mapRouteProperties)a=e.mapRouteProperties;else if(e.detectErrorBoundary){let o=e.detectErrorBoundary;a=s=>({hasErrorBoundary:o(s)})}else a=on;let l={},i=ht(e.routes,a,void 0,l),d,u=e.basename||"/",v=e.unstable_dataStrategy||un,h=O({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,unstable_skipActionErrorRevalidation:!1},e.future),m=null,g=new Set,_=null,P=null,E=null,x=e.hydrationData!=null,U=_e(i,e.history.location,u),T=null;if(U==null){let o=ee(404,{pathname:e.history.location.pathname}),{matches:s,route:c}=Gt(i);U=s,T={[c.id]:o}}let B,he=U.some(o=>o.route.lazy),ne=U.some(o=>o.route.loader);if(he)B=!1;else if(!ne)B=!0;else if(h.v7_partialHydration){let o=e.hydrationData?e.hydrationData.loaderData:null,s=e.hydrationData?e.hydrationData.errors:null,c=p=>p.route.loader?typeof p.route.loader=="function"&&p.route.loader.hydrate===!0?!1:o&&o[p.route.id]!==void 0||s&&s[p.route.id]!==void 0:!0;if(s){let p=U.findIndex(y=>s[y.route.id]!==void 0);B=U.slice(0,p+1).every(c)}else B=U.every(c)}else B=e.hydrationData!=null;let Re,f={historyAction:e.history.action,location:e.history.location,matches:U,initialized:B,navigation:ct,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||T,fetchers:new Map,blockers:new Map},J=A.Pop,z=!1,F,Y=!1,G=new Map,ie=null,q=!1,le=!1,Xe=[],qe=[],k=new Map,Qe=0,Fe=-1,Pe=new Map,se=new Set,De=new Map,Te=new Map,de=new Set,ye=new Map,be=new Map,lt=!1;function mr(){if(m=e.history.listen(o=>{let{action:s,location:c,delta:p}=o;if(lt){lt=!1;return}je(be.size===0||p!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs.  This can also happen if you are using createHashRouter and the user manually changes the URL.");let y=Ft({currentLocation:f.location,nextLocation:c,historyAction:s});if(y&&p!=null){lt=!0,e.history.go(p*-1),et(y,{state:"blocked",location:c,proceed(){et(y,{state:"proceeding",proceed:void 0,reset:void 0,location:c}),e.history.go(p)},reset(){let C=new Map(f.blockers);C.set(y,ke),X({blockers:C})}});return}return we(s,c)}),r){xn(t,G);let o=()=>Rn(t,G);t.addEventListener("pagehide",o),ie=()=>t.removeEventListener("pagehide",o)}return f.initialized||we(A.Pop,f.location,{initialHydration:!0}),Re}function pr(){m&&m(),ie&&ie(),g.clear(),F&&F.abort(),f.fetchers.forEach((o,s)=>Ze(s)),f.blockers.forEach((o,s)=>Ut(s))}function gr(o){return g.add(o),()=>g.delete(o)}function X(o,s){s===void 0&&(s={}),f=O({},f,o);let c=[],p=[];h.v7_fetcherPersist&&f.fetchers.forEach((y,C)=>{y.state==="idle"&&(de.has(C)?p.push(C):c.push(C))}),[...g].forEach(y=>y(f,{deletedFetchers:p,unstable_viewTransitionOpts:s.viewTransitionOpts,unstable_flushSync:s.flushSync===!0})),h.v7_fetcherPersist&&(c.forEach(y=>f.fetchers.delete(y)),p.forEach(y=>Ze(y)))}function Ie(o,s,c){var p,y;let{flushSync:C}=c===void 0?{}:c,R=f.actionData!=null&&f.navigation.formMethod!=null&&re(f.navigation.formMethod)&&f.navigation.state==="loading"&&((p=o.state)==null?void 0:p._isRedirect)!==!0,b;s.actionData?Object.keys(s.actionData).length>0?b=s.actionData:b=null:R?b=f.actionData:b=null;let M=s.loaderData?Jt(f.loaderData,s.loaderData,s.matches||[],s.errors):f.loaderData,S=f.blockers;S.size>0&&(S=new Map(S),S.forEach((D,I)=>S.set(I,ke)));let H=z===!0||f.navigation.formMethod!=null&&re(f.navigation.formMethod)&&((y=o.state)==null?void 0:y._isRedirect)!==!0;d&&(i=d,d=void 0),q||J===A.Pop||(J===A.Push?e.history.push(o,o.state):J===A.Replace&&e.history.replace(o,o.state));let W;if(J===A.Pop){let D=G.get(f.location.pathname);D&&D.has(o.pathname)?W={currentLocation:f.location,nextLocation:o}:G.has(o.pathname)&&(W={currentLocation:o,nextLocation:f.location})}else if(Y){let D=G.get(f.location.pathname);D?D.add(o.pathname):(D=new Set([o.pathname]),G.set(f.location.pathname,D)),W={currentLocation:f.location,nextLocation:o}}X(O({},s,{actionData:b,loaderData:M,historyAction:J,location:o,initialized:!0,navigation:ct,revalidation:"idle",restoreScrollPosition:It(o,s.matches||f.matches),preventScrollReset:H,blockers:S}),{viewTransitionOpts:W,flushSync:C===!0}),J=A.Pop,z=!1,Y=!1,q=!1,le=!1,Xe=[],qe=[]}async function St(o,s){if(typeof o=="number"){e.history.go(o);return}let c=pt(f.location,f.matches,u,h.v7_prependBasename,o,h.v7_relativeSplatPath,s==null?void 0:s.fromRouteId,s==null?void 0:s.relative),{path:p,submission:y,error:C}=zt(h.v7_normalizeFormMethod,!1,c,s),R=f.location,b=We(f.location,p,s&&s.state);b=O({},b,e.history.encodeLocation(b));let M=s&&s.replace!=null?s.replace:void 0,S=A.Push;M===!0?S=A.Replace:M===!1||y!=null&&re(y.formMethod)&&y.formAction===f.location.pathname+f.location.search&&(S=A.Replace);let H=s&&"preventScrollReset"in s?s.preventScrollReset===!0:void 0,W=(s&&s.unstable_flushSync)===!0,D=Ft({currentLocation:R,nextLocation:b,historyAction:S});if(D){et(D,{state:"blocked",location:b,proceed(){et(D,{state:"proceeding",proceed:void 0,reset:void 0,location:b}),St(o,s)},reset(){let I=new Map(f.blockers);I.set(D,ke),X({blockers:I})}});return}return await we(S,b,{submission:y,pendingError:C,preventScrollReset:H,replace:s&&s.replace,enableViewTransition:s&&s.unstable_viewTransition,flushSync:W})}function vr(){if(st(),X({revalidation:"loading"}),f.navigation.state!=="submitting"){if(f.navigation.state==="idle"){we(f.historyAction,f.location,{startUninterruptedRevalidation:!0});return}we(J||f.historyAction,f.navigation.location,{overrideNavigation:f.navigation})}}async function we(o,s,c){F&&F.abort(),F=null,J=o,q=(c&&c.startUninterruptedRevalidation)===!0,Sr(f.location,f.matches),z=(c&&c.preventScrollReset)===!0,Y=(c&&c.enableViewTransition)===!0;let p=d||i,y=c&&c.overrideNavigation,C=_e(p,s,u),R=(c&&c.flushSync)===!0;if(!C){let D=ee(404,{pathname:s.pathname}),{matches:I,route:K}=Gt(p);dt(),Ie(s,{matches:I,loaderData:{},errors:{[K.id]:D}},{flushSync:R});return}if(f.initialized&&!le&&gn(f.location,s)&&!(c&&c.submission&&re(c.submission.formMethod))){Ie(s,{matches:C},{flushSync:R});return}F=new AbortController;let b=Le(e.history,s,F.signal,c&&c.submission),M;if(c&&c.pendingError)M=[He(C).route.id,{type:N.error,error:c.pendingError}];else if(c&&c.submission&&re(c.submission.formMethod)){let D=await yr(b,s,c.submission,C,{replace:c.replace,flushSync:R});if(D.shortCircuited)return;M=D.pendingActionResult,y=ft(s,c.submission),R=!1,b=Le(e.history,b.url,b.signal)}let{shortCircuited:S,loaderData:H,errors:W}=await br(b,s,C,y,c&&c.submission,c&&c.fetcherSubmission,c&&c.replace,c&&c.initialHydration===!0,R,M);S||(F=null,Ie(s,O({matches:C},Yt(M),{loaderData:H,errors:W})))}async function yr(o,s,c,p,y){y===void 0&&(y={}),st();let C=wn(s,c);X({navigation:C},{flushSync:y.flushSync===!0});let R,b=vt(p,s);if(!b.route.action&&!b.route.lazy)R={type:N.error,error:ee(405,{method:o.method,pathname:s.pathname,routeId:b.route.id})};else if(R=(await Ne("action",o,[b],p))[0],o.signal.aborted)return{shortCircuited:!0};if(xe(R)){let M;return y&&y.replace!=null?M=y.replace:M=Wt(R.response.headers.get("Location"),new URL(o.url),u)===f.location.pathname+f.location.search,await Oe(o,R,{submission:c,replace:M}),{shortCircuited:!0}}if(Ee(R))throw ee(400,{type:"defer-action"});if(te(R)){let M=He(p,b.route.id);return(y&&y.replace)!==!0&&(J=A.Push),{pendingActionResult:[M.route.id,R]}}return{pendingActionResult:[b.route.id,R]}}async function br(o,s,c,p,y,C,R,b,M,S){let H=p||ft(s,y),W=y||C||Qt(H),D=d||i,[I,K]=kt(e.history,f,c,W,s,h.v7_partialHydration&&b===!0,h.unstable_skipActionErrorRevalidation,le,Xe,qe,de,De,se,D,u,S);if(dt(j=>!(c&&c.some(V=>V.route.id===j))||I&&I.some(V=>V.route.id===j)),Fe=++Qe,I.length===0&&K.length===0){let j=_t();return Ie(s,O({matches:c,loaderData:{},errors:S&&te(S[1])?{[S[0]]:S[1].error}:null},Yt(S),j?{fetchers:new Map(f.fetchers)}:{}),{flushSync:M}),{shortCircuited:!0}}if(!q&&(!h.v7_partialHydration||!b)){K.forEach(V=>{let Q=f.fetchers.get(V.key),$=Ke(void 0,Q?Q.data:void 0);f.fetchers.set(V.key,$)});let j;S&&!te(S[1])?j={[S[0]]:S[1].data}:f.actionData&&(Object.keys(f.actionData).length===0?j=null:j=f.actionData),X(O({navigation:H},j!==void 0?{actionData:j}:{},K.length>0?{fetchers:new Map(f.fetchers)}:{}),{flushSync:M})}K.forEach(j=>{k.has(j.key)&&pe(j.key),j.controller&&k.set(j.key,j.controller)});let Be=()=>K.forEach(j=>pe(j.key));F&&F.signal.addEventListener("abort",Be);let{loaderResults:ge,fetcherResults:Se}=await Ct(f.matches,c,I,K,o);if(o.signal.aborted)return{shortCircuited:!0};F&&F.signal.removeEventListener("abort",Be),K.forEach(j=>k.delete(j.key));let Ce=Xt([...ge,...Se]);if(Ce){if(Ce.idx>=I.length){let j=K[Ce.idx-I.length].key;se.add(j)}return await Oe(o,Ce.result,{replace:R}),{shortCircuited:!0}}let{loaderData:Me,errors:ae}=Vt(f,c,I,ge,S,K,Se,ye);ye.forEach((j,V)=>{j.subscribe(Q=>{(Q||j.done)&&ye.delete(V)})}),h.v7_partialHydration&&b&&f.errors&&Object.entries(f.errors).filter(j=>{let[V]=j;return!I.some(Q=>Q.route.id===V)}).forEach(j=>{let[V,Q]=j;ae=Object.assign(ae||{},{[V]:Q})});let tt=_t(),rt=jt(Fe),nt=tt||rt||K.length>0;return O({loaderData:Me,errors:ae},nt?{fetchers:new Map(f.fetchers)}:{})}function wr(o,s,c,p){if(n)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");k.has(o)&&pe(o);let y=(p&&p.unstable_flushSync)===!0,C=d||i,R=pt(f.location,f.matches,u,h.v7_prependBasename,c,h.v7_relativeSplatPath,s,p==null?void 0:p.relative),b=_e(C,R,u);if(!b){Ae(o,s,ee(404,{pathname:R}),{flushSync:y});return}let{path:M,submission:S,error:H}=zt(h.v7_normalizeFormMethod,!0,R,p);if(H){Ae(o,s,H,{flushSync:y});return}let W=vt(b,M);if(z=(p&&p.preventScrollReset)===!0,S&&re(S.formMethod)){Er(o,s,M,W,b,y,S);return}De.set(o,{routeId:s,path:M}),xr(o,s,M,W,b,y,S)}async function Er(o,s,c,p,y,C,R){if(st(),De.delete(o),!p.route.action&&!p.route.lazy){let $=ee(405,{method:R.formMethod,pathname:c,routeId:s});Ae(o,s,$,{flushSync:C});return}let b=f.fetchers.get(o);me(o,En(R,b),{flushSync:C});let M=new AbortController,S=Le(e.history,c,M.signal,R);k.set(o,M);let H=Qe,D=(await Ne("action",S,[p],y))[0];if(S.signal.aborted){k.get(o)===M&&k.delete(o);return}if(h.v7_fetcherPersist&&de.has(o)){if(xe(D)||te(D)){me(o,ve(void 0));return}}else{if(xe(D))if(k.delete(o),Fe>H){me(o,ve(void 0));return}else return se.add(o),me(o,Ke(R)),Oe(S,D,{fetcherSubmission:R});if(te(D)){Ae(o,s,D.error);return}}if(Ee(D))throw ee(400,{type:"defer-action"});let I=f.navigation.location||f.location,K=Le(e.history,I,M.signal),Be=d||i,ge=f.navigation.state!=="idle"?_e(Be,f.navigation.location,u):f.matches;L(ge,"Didn't find any matches after fetcher action");let Se=++Qe;Pe.set(o,Se);let Ce=Ke(R,D.data);f.fetchers.set(o,Ce);let[Me,ae]=kt(e.history,f,ge,R,I,!1,h.unstable_skipActionErrorRevalidation,le,Xe,qe,de,De,se,Be,u,[p.route.id,D]);ae.filter($=>$.key!==o).forEach($=>{let ze=$.key,Ot=f.fetchers.get(ze),Mr=Ke(void 0,Ot?Ot.data:void 0);f.fetchers.set(ze,Mr),k.has(ze)&&pe(ze),$.controller&&k.set(ze,$.controller)}),X({fetchers:new Map(f.fetchers)});let tt=()=>ae.forEach($=>pe($.key));M.signal.addEventListener("abort",tt);let{loaderResults:rt,fetcherResults:nt}=await Ct(f.matches,ge,Me,ae,K);if(M.signal.aborted)return;M.signal.removeEventListener("abort",tt),Pe.delete(o),k.delete(o),ae.forEach($=>k.delete($.key));let j=Xt([...rt,...nt]);if(j){if(j.idx>=Me.length){let $=ae[j.idx-Me.length].key;se.add($)}return Oe(K,j.result)}let{loaderData:V,errors:Q}=Vt(f,f.matches,Me,rt,void 0,ae,nt,ye);if(f.fetchers.has(o)){let $=ve(D.data);f.fetchers.set(o,$)}jt(Se),f.navigation.state==="loading"&&Se>Fe?(L(J,"Expected pending action"),F&&F.abort(),Ie(f.navigation.location,{matches:ge,loaderData:V,errors:Q,fetchers:new Map(f.fetchers)})):(X({errors:Q,loaderData:Jt(f.loaderData,V,ge,Q),fetchers:new Map(f.fetchers)}),le=!1)}async function xr(o,s,c,p,y,C,R){let b=f.fetchers.get(o);me(o,Ke(R,b?b.data:void 0),{flushSync:C});let M=new AbortController,S=Le(e.history,c,M.signal);k.set(o,M);let H=Qe,D=(await Ne("loader",S,[p],y))[0];if(Ee(D)&&(D=await ur(D,S.signal,!0)||D),k.get(o)===M&&k.delete(o),!S.signal.aborted){if(de.has(o)){me(o,ve(void 0));return}if(xe(D))if(Fe>H){me(o,ve(void 0));return}else{se.add(o),await Oe(S,D);return}if(te(D)){Ae(o,s,D.error);return}L(!Ee(D),"Unhandled fetcher deferred data"),me(o,ve(D.data))}}async function Oe(o,s,c){let{submission:p,fetcherSubmission:y,replace:C}=c===void 0?{}:c;s.response.headers.has("X-Remix-Revalidate")&&(le=!0);let R=s.response.headers.get("Location");L(R,"Expected a Location header on the redirect Response"),R=Wt(R,new URL(o.url),u);let b=We(f.location,R,{_isRedirect:!0});if(r){let I=!1;if(s.response.headers.has("X-Remix-Reload-Document"))I=!0;else if(Et.test(R)){const K=e.history.createURL(R);I=K.origin!==t.location.origin||Je(K.pathname,u)==null}if(I){C?t.location.replace(R):t.location.assign(R);return}}F=null;let M=C===!0?A.Replace:A.Push,{formMethod:S,formAction:H,formEncType:W}=f.navigation;!p&&!y&&S&&H&&W&&(p=Qt(f.navigation));let D=p||y;if(nn.has(s.response.status)&&D&&re(D.formMethod))await we(M,b,{submission:O({},D,{formAction:R}),preventScrollReset:z});else{let I=ft(b,p);await we(M,b,{overrideNavigation:I,fetcherSubmission:y,preventScrollReset:z})}}async function Ne(o,s,c,p){try{let y=await cn(v,o,s,c,p,l,a);return await Promise.all(y.map((C,R)=>{if(vn(C)){let b=C.result;return{type:N.redirect,response:mn(b,s,c[R].route.id,p,u,h.v7_relativeSplatPath)}}return hn(C)}))}catch(y){return c.map(()=>({type:N.error,error:y}))}}async function Ct(o,s,c,p,y){let[C,...R]=await Promise.all([c.length?Ne("loader",y,c,s):[],...p.map(b=>{if(b.matches&&b.match&&b.controller){let M=Le(e.history,b.path,b.controller.signal);return Ne("loader",M,[b.match],b.matches).then(S=>S[0])}else return Promise.resolve({type:N.error,error:ee(404,{pathname:b.path})})})]);return await Promise.all([qt(o,c,C,C.map(()=>y.signal),!1,f.loaderData),qt(o,p.map(b=>b.match),R,p.map(b=>b.controller?b.controller.signal:null),!0)]),{loaderResults:C,fetcherResults:R}}function st(){le=!0,Xe.push(...dt()),De.forEach((o,s)=>{k.has(s)&&(qe.push(s),pe(s))})}function me(o,s,c){c===void 0&&(c={}),f.fetchers.set(o,s),X({fetchers:new Map(f.fetchers)},{flushSync:(c&&c.flushSync)===!0})}function Ae(o,s,c,p){p===void 0&&(p={});let y=He(f.matches,s);Ze(o),X({errors:{[y.route.id]:c},fetchers:new Map(f.fetchers)},{flushSync:(p&&p.flushSync)===!0})}function Mt(o){return h.v7_fetcherPersist&&(Te.set(o,(Te.get(o)||0)+1),de.has(o)&&de.delete(o)),f.fetchers.get(o)||an}function Ze(o){let s=f.fetchers.get(o);k.has(o)&&!(s&&s.state==="loading"&&Pe.has(o))&&pe(o),De.delete(o),Pe.delete(o),se.delete(o),de.delete(o),f.fetchers.delete(o)}function Rr(o){if(h.v7_fetcherPersist){let s=(Te.get(o)||0)-1;s<=0?(Te.delete(o),de.add(o)):Te.set(o,s)}else Ze(o);X({fetchers:new Map(f.fetchers)})}function pe(o){let s=k.get(o);L(s,"Expected fetch controller: "+o),s.abort(),k.delete(o)}function Lt(o){for(let s of o){let c=Mt(s),p=ve(c.data);f.fetchers.set(s,p)}}function _t(){let o=[],s=!1;for(let c of se){let p=f.fetchers.get(c);L(p,"Expected fetcher: "+c),p.state==="loading"&&(se.delete(c),o.push(c),s=!0)}return Lt(o),s}function jt(o){let s=[];for(let[c,p]of Pe)if(p<o){let y=f.fetchers.get(c);L(y,"Expected fetcher: "+c),y.state==="loading"&&(pe(c),Pe.delete(c),s.push(c))}return Lt(s),s.length>0}function Pr(o,s){let c=f.blockers.get(o)||ke;return be.get(o)!==s&&be.set(o,s),c}function Ut(o){f.blockers.delete(o),be.delete(o)}function et(o,s){let c=f.blockers.get(o)||ke;L(c.state==="unblocked"&&s.state==="blocked"||c.state==="blocked"&&s.state==="blocked"||c.state==="blocked"&&s.state==="proceeding"||c.state==="blocked"&&s.state==="unblocked"||c.state==="proceeding"&&s.state==="unblocked","Invalid blocker state transition: "+c.state+" -> "+s.state);let p=new Map(f.blockers);p.set(o,s),X({blockers:p})}function Ft(o){let{currentLocation:s,nextLocation:c,historyAction:p}=o;if(be.size===0)return;be.size>1&&je(!1,"A router only supports one blocker at a time");let y=Array.from(be.entries()),[C,R]=y[y.length-1],b=f.blockers.get(C);if(!(b&&b.state==="proceeding")&&R({currentLocation:s,nextLocation:c,historyAction:p}))return C}function dt(o){let s=[];return ye.forEach((c,p)=>{(!o||o(p))&&(c.cancel(),s.push(p),ye.delete(p))}),s}function Dr(o,s,c){if(_=o,E=s,P=c||null,!x&&f.navigation===ct){x=!0;let p=It(f.location,f.matches);p!=null&&X({restoreScrollPosition:p})}return()=>{_=null,E=null,P=null}}function Tt(o,s){return P&&P(o,s.map(p=>er(p,f.loaderData)))||o.key}function Sr(o,s){if(_&&E){let c=Tt(o,s);_[c]=E()}}function It(o,s){if(_){let c=Tt(o,s),p=_[c];if(typeof p=="number")return p}return null}function Cr(o){l={},d=ht(o,a,void 0,l)}return Re={get basename(){return u},get future(){return h},get state(){return f},get routes(){return i},get window(){return t},initialize:mr,subscribe:gr,enableScrollRestoration:Dr,navigate:St,fetch:wr,revalidate:vr,createHref:o=>e.history.createHref(o),encodeLocation:o=>e.history.encodeLocation(o),getFetcher:Mt,deleteFetcher:Rr,dispose:pr,getBlocker:Pr,deleteBlocker:Ut,_internalFetchControllers:k,_internalActiveDeferreds:ye,_internalSetRoutes:Cr},Re}function ln(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function pt(e,t,r,n,a,l,i,d){let u,v;if(i){u=[];for(let m of t)if(u.push(m),m.route.id===i){v=m;break}}else u=t,v=t[t.length-1];let h=bt(a||".",yt(u,l),Je(e.pathname,r)||e.pathname,d==="path");return a==null&&(h.search=e.search,h.hash=e.hash),(a==null||a===""||a===".")&&v&&v.route.index&&!xt(h.search)&&(h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index"),n&&r!=="/"&&(h.pathname=h.pathname==="/"?r:ue([r,h.pathname])),Ve(h)}function zt(e,t,r,n){if(!n||!ln(n))return{path:r};if(n.formMethod&&!bn(n.formMethod))return{path:r,error:ee(405,{method:n.formMethod})};let a=()=>({path:r,error:ee(400,{type:"invalid-body"})}),l=n.formMethod||"get",i=e?l.toUpperCase():l.toLowerCase(),d=sr(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!re(i))return a();let g=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((_,P)=>{let[E,x]=P;return""+_+E+"="+x+`
`},""):String(n.body);return{path:r,submission:{formMethod:i,formAction:d,formEncType:n.formEncType,formData:void 0,json:void 0,text:g}}}else if(n.formEncType==="application/json"){if(!re(i))return a();try{let g=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:i,formAction:d,formEncType:n.formEncType,formData:void 0,json:g,text:void 0}}}catch{return a()}}}L(typeof FormData=="function","FormData is not available in this environment");let u,v;if(n.formData)u=gt(n.formData),v=n.formData;else if(n.body instanceof FormData)u=gt(n.body),v=n.body;else if(n.body instanceof URLSearchParams)u=n.body,v=$t(u);else if(n.body==null)u=new URLSearchParams,v=new FormData;else try{u=new URLSearchParams(n.body),v=$t(u)}catch{return a()}let h={formMethod:i,formAction:d,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:v,json:void 0,text:void 0};if(re(h.formMethod))return{path:r,submission:h};let m=ce(r);return t&&m.search&&xt(m.search)&&u.append("index",""),m.search="?"+u,{path:Ve(m),submission:h}}function sn(e,t){let r=e;if(t){let n=e.findIndex(a=>a.route.id===t);n>=0&&(r=e.slice(0,n))}return r}function kt(e,t,r,n,a,l,i,d,u,v,h,m,g,_,P,E){let x=E?te(E[1])?E[1].error:E[1].data:void 0,U=e.createURL(t.location),T=e.createURL(a),B=E&&te(E[1])?E[0]:void 0,he=B?sn(r,B):r,ne=E?E[1].statusCode:void 0,Re=i&&ne&&ne>=400,f=he.filter((z,F)=>{let{route:Y}=z;if(Y.lazy)return!0;if(Y.loader==null)return!1;if(l)return typeof Y.loader!="function"||Y.loader.hydrate?!0:t.loaderData[Y.id]===void 0&&(!t.errors||t.errors[Y.id]===void 0);if(dn(t.loaderData,t.matches[F],z)||u.some(q=>q===z.route.id))return!0;let G=t.matches[F],ie=z;return Kt(z,O({currentUrl:U,currentParams:G.params,nextUrl:T,nextParams:ie.params},n,{actionResult:x,unstable_actionStatus:ne,defaultShouldRevalidate:Re?!1:d||U.pathname+U.search===T.pathname+T.search||U.search!==T.search||lr(G,ie)}))}),J=[];return m.forEach((z,F)=>{if(l||!r.some(le=>le.route.id===z.routeId)||h.has(F))return;let Y=_e(_,z.path,P);if(!Y){J.push({key:F,routeId:z.routeId,path:z.path,matches:null,match:null,controller:null});return}let G=t.fetchers.get(F),ie=vt(Y,z.path),q=!1;g.has(F)?q=!1:v.includes(F)?q=!0:G&&G.state!=="idle"&&G.data===void 0?q=d:q=Kt(ie,O({currentUrl:U,currentParams:t.matches[t.matches.length-1].params,nextUrl:T,nextParams:r[r.length-1].params},n,{actionResult:x,unstable_actionStatus:ne,defaultShouldRevalidate:Re?!1:d})),q&&J.push({key:F,routeId:z.routeId,path:z.path,matches:Y,match:ie,controller:new AbortController})}),[f,J]}function dn(e,t,r){let n=!t||r.route.id!==t.route.id,a=e[r.route.id]===void 0;return n||a}function lr(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function Kt(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}async function Ht(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];L(a,"No route found in manifest");let l={};for(let i in n){let u=a[i]!==void 0&&i!=="hasErrorBoundary";je(!u,'Route "'+a.id+'" has a static property "'+i+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+i+'" will be ignored.')),!u&&!jr.has(i)&&(l[i]=n[i])}Object.assign(a,l),Object.assign(a,O({},t(a),{lazy:void 0}))}function un(e){return Promise.all(e.matches.map(t=>t.resolve()))}async function cn(e,t,r,n,a,l,i,d){let u=n.reduce((m,g)=>m.add(g.route.id),new Set),v=new Set,h=await e({matches:a.map(m=>{let g=u.has(m.route.id);return O({},m,{shouldLoad:g,resolve:P=>(v.add(m.route.id),g?fn(t,r,m,l,i,P,d):Promise.resolve({type:N.data,result:void 0}))})}),request:r,params:a[0].params,context:d});return a.forEach(m=>L(v.has(m.route.id),'`match.resolve()` was not called for route id "'+m.route.id+'". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.')),h.filter((m,g)=>u.has(a[g].route.id))}async function fn(e,t,r,n,a,l,i){let d,u,v=h=>{let m,g=new Promise((E,x)=>m=x);u=()=>m(),t.signal.addEventListener("abort",u);let _=E=>typeof h!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+r.route.id+"]"))):h({request:t,params:r.params,context:i},...E!==void 0?[E]:[]),P;return l?P=l(E=>_(E)):P=(async()=>{try{return{type:"data",result:await _()}}catch(E){return{type:"error",result:E}}})(),Promise.race([P,g])};try{let h=r.route[e];if(r.route.lazy)if(h){let m,[g]=await Promise.all([v(h).catch(_=>{m=_}),Ht(r.route,a,n)]);if(m!==void 0)throw m;d=g}else if(await Ht(r.route,a,n),h=r.route[e],h)d=await v(h);else if(e==="action"){let m=new URL(t.url),g=m.pathname+m.search;throw ee(405,{method:t.method,pathname:g,routeId:r.route.id})}else return{type:N.data,result:void 0};else if(h)d=await v(h);else{let m=new URL(t.url),g=m.pathname+m.search;throw ee(404,{pathname:g})}L(d.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(h){return{type:N.error,result:h}}finally{u&&t.signal.removeEventListener("abort",u)}return d}async function hn(e){let{result:t,type:r,status:n}=e;if(dr(t)){let i;try{let d=t.headers.get("Content-Type");d&&/\bapplication\/json\b/.test(d)?t.body==null?i=null:i=await t.json():i=await t.text()}catch(d){return{type:N.error,error:d}}return r===N.error?{type:N.error,error:new ar(t.status,t.statusText,i),statusCode:t.status,headers:t.headers}:{type:N.data,data:i,statusCode:t.status,headers:t.headers}}if(r===N.error)return{type:N.error,error:t,statusCode:wt(t)?t.status:n};if(yn(t)){var a,l;return{type:N.deferred,deferredData:t,statusCode:(a=t.init)==null?void 0:a.status,headers:((l=t.init)==null?void 0:l.headers)&&new Headers(t.init.headers)}}return{type:N.data,data:t,statusCode:n}}function mn(e,t,r,n,a,l){let i=e.headers.get("Location");if(L(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!Et.test(i)){let d=n.slice(0,n.findIndex(u=>u.route.id===r)+1);i=pt(new URL(t.url),d,a,!0,i,l),e.headers.set("Location",i)}return e}function Wt(e,t,r){if(Et.test(e)){let n=e,a=n.startsWith("//")?new URL(t.protocol+n):new URL(n),l=Je(a.pathname,r)!=null;if(a.origin===t.origin&&l)return a.pathname+a.search+a.hash}return e}function Le(e,t,r,n){let a=e.createURL(sr(t)).toString(),l={signal:r};if(n&&re(n.formMethod)){let{formMethod:i,formEncType:d}=n;l.method=i.toUpperCase(),d==="application/json"?(l.headers=new Headers({"Content-Type":d}),l.body=JSON.stringify(n.json)):d==="text/plain"?l.body=n.text:d==="application/x-www-form-urlencoded"&&n.formData?l.body=gt(n.formData):l.body=n.formData}return new Request(a,l)}function gt(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function $t(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function pn(e,t,r,n,a,l){let i={},d=null,u,v=!1,h={},m=n&&te(n[1])?n[1].error:void 0;return r.forEach((g,_)=>{let P=t[_].route.id;if(L(!xe(g),"Cannot handle redirect results in processLoaderData"),te(g)){let E=g.error;if(m!==void 0&&(E=m,m=void 0),d=d||{},l)d[P]=E;else{let x=He(e,P);d[x.route.id]==null&&(d[x.route.id]=E)}i[P]=void 0,v||(v=!0,u=wt(g.error)?g.error.status:500),g.headers&&(h[P]=g.headers)}else Ee(g)?(a.set(P,g.deferredData),i[P]=g.deferredData.data,g.statusCode!=null&&g.statusCode!==200&&!v&&(u=g.statusCode),g.headers&&(h[P]=g.headers)):(i[P]=g.data,g.statusCode&&g.statusCode!==200&&!v&&(u=g.statusCode),g.headers&&(h[P]=g.headers))}),m!==void 0&&n&&(d={[n[0]]:m},i[n[0]]=void 0),{loaderData:i,errors:d,statusCode:u||200,loaderHeaders:h}}function Vt(e,t,r,n,a,l,i,d){let{loaderData:u,errors:v}=pn(t,r,n,a,d,!1);for(let h=0;h<l.length;h++){let{key:m,match:g,controller:_}=l[h];L(i!==void 0&&i[h]!==void 0,"Did not find corresponding fetcher result");let P=i[h];if(!(_&&_.signal.aborted))if(te(P)){let E=He(e.matches,g==null?void 0:g.route.id);v&&v[E.route.id]||(v=O({},v,{[E.route.id]:P.error})),e.fetchers.delete(m)}else if(xe(P))L(!1,"Unhandled fetcher revalidation redirect");else if(Ee(P))L(!1,"Unhandled fetcher deferred data");else{let E=ve(P.data);e.fetchers.set(m,E)}}return{loaderData:u,errors:v}}function Jt(e,t,r,n){let a=O({},t);for(let l of r){let i=l.route.id;if(t.hasOwnProperty(i)?t[i]!==void 0&&(a[i]=t[i]):e[i]!==void 0&&l.route.loader&&(a[i]=e[i]),n&&n.hasOwnProperty(i))break}return a}function Yt(e){return e?te(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function He(e,t){return(t?e.slice(0,e.findIndex(n=>n.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function Gt(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function ee(e,t){let{pathname:r,routeId:n,method:a,type:l}=t===void 0?{}:t,i="Unknown Server Error",d="Unknown @remix-run/router error";return e===400?(i="Bad Request",a&&r&&n?d="You made a "+a+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":l==="defer-action"?d="defer() is not supported in actions":l==="invalid-body"&&(d="Unable to encode submission body")):e===403?(i="Forbidden",d='Route "'+n+'" does not match URL "'+r+'"'):e===404?(i="Not Found",d='No route matches URL "'+r+'"'):e===405&&(i="Method Not Allowed",a&&r&&n?d="You made a "+a.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":a&&(d='Invalid request method "'+a.toUpperCase()+'"')),new ar(e||500,i,new Error(d),!0)}function Xt(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(xe(r))return{result:r,idx:t}}}function sr(e){let t=typeof e=="string"?ce(e):e;return Ve(O({},t,{hash:""}))}function gn(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function vn(e){return dr(e.result)&&rn.has(e.result.status)}function Ee(e){return e.type===N.deferred}function te(e){return e.type===N.error}function xe(e){return(e&&e.type)===N.redirect}function yn(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function dr(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function bn(e){return tn.has(e.toLowerCase())}function re(e){return Zr.has(e.toLowerCase())}async function qt(e,t,r,n,a,l){for(let i=0;i<r.length;i++){let d=r[i],u=t[i];if(!u)continue;let v=e.find(m=>m.route.id===u.route.id),h=v!=null&&!lr(v,u)&&(l&&l[u.route.id])!==void 0;if(Ee(d)&&(a||h)){let m=n[i];L(m,"Expected an AbortSignal for revalidating fetcher deferred result"),await ur(d,m,a).then(g=>{g&&(r[i]=g||r[i])})}}}async function ur(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:N.data,data:e.deferredData.unwrappedData}}catch(a){return{type:N.error,error:a}}return{type:N.data,data:e.deferredData.data}}}function xt(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function vt(e,t){let r=typeof t=="string"?ce(t).search:t.search;if(e[e.length-1].route.index&&xt(r||""))return e[e.length-1];let n=nr(e);return n[n.length-1]}function Qt(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:l,json:i}=e;if(!(!t||!r||!n)){if(a!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(l!=null)return{formMethod:t,formAction:r,formEncType:n,formData:l,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function ft(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function wn(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Ke(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function En(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function ve(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function xn(e,t){try{let r=e.sessionStorage.getItem(ir);if(r){let n=JSON.parse(r);for(let[a,l]of Object.entries(n||{}))l&&Array.isArray(l)&&t.set(a,new Set(l||[]))}}catch{}}function Rn(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(ir,JSON.stringify(r))}catch(n){je(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}/**
 * React Router v6.23.1
 *
 * 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
 */function $e(){return $e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$e.apply(this,arguments)}const Rt=w.createContext(null),Pn=w.createContext(null),at=w.createContext(null),Ue=w.createContext(null),ot=w.createContext(null),fe=w.createContext({outlet:null,matches:[],isDataRoute:!1}),cr=w.createContext(null);function Jn(e,t){let{relative:r}=t===void 0?{}:t;Ye()||L(!1);let{basename:n,navigator:a}=w.useContext(Ue),{hash:l,pathname:i,search:d}=Mn(e,{relative:r}),u=i;return n!=="/"&&(u=i==="/"?n:ue([n,i])),a.createHref({pathname:u,search:d,hash:l})}function Ye(){return w.useContext(ot)!=null}function Pt(){return Ye()||L(!1),w.useContext(ot).location}function fr(e){w.useContext(Ue).static||w.useLayoutEffect(e)}function Yn(){let{isDataRoute:e}=w.useContext(fe);return e?Nn():Dn()}function Dn(){Ye()||L(!1);let e=w.useContext(Rt),{basename:t,future:r,navigator:n}=w.useContext(Ue),{matches:a}=w.useContext(fe),{pathname:l}=Pt(),i=JSON.stringify(yt(a,r.v7_relativeSplatPath)),d=w.useRef(!1);return fr(()=>{d.current=!0}),w.useCallback(function(v,h){if(h===void 0&&(h={}),!d.current)return;if(typeof v=="number"){n.go(v);return}let m=bt(v,JSON.parse(i),l,h.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:ue([t,m.pathname])),(h.replace?n.replace:n.push)(m,h.state,h)},[t,n,i,l,e])}const Sn=w.createContext(null);function Cn(e){let t=w.useContext(fe).outlet;return t&&w.createElement(Sn.Provider,{value:e},t)}function Gn(){let{matches:e}=w.useContext(fe),t=e[e.length-1];return t?t.params:{}}function Mn(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=w.useContext(Ue),{matches:a}=w.useContext(fe),{pathname:l}=Pt(),i=JSON.stringify(yt(a,n.v7_relativeSplatPath));return w.useMemo(()=>bt(e,JSON.parse(i),l,r==="path"),[e,i,l,r])}function Xn(e,t,r,n){Ye()||L(!1);let{navigator:a}=w.useContext(Ue),{matches:l}=w.useContext(fe),i=l[l.length-1],d=i?i.params:{};i&&i.pathname;let u=i?i.pathnameBase:"/";i&&i.route;let v=Pt(),h;if(t){var m;let x=typeof t=="string"?ce(t):t;u==="/"||(m=x.pathname)!=null&&m.startsWith(u)||L(!1),h=x}else h=v;let g=h.pathname||"/",_=g;if(u!=="/"){let x=u.replace(/^\//,"").split("/");_="/"+g.replace(/^\//,"").split("/").slice(x.length).join("/")}let P=_e(e,{pathname:_}),E=Fn(P&&P.map(x=>Object.assign({},x,{params:Object.assign({},d,x.params),pathname:ue([u,a.encodeLocation?a.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?u:ue([u,a.encodeLocation?a.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),l,r,n);return t&&E?w.createElement(ot.Provider,{value:{location:$e({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:A.Pop}},E):E}function Ln(){let e=In(),t=wt(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},t),r?w.createElement("pre",{style:a},r):null,null)}const _n=w.createElement(Ln,null);class jn extends w.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?w.createElement(fe.Provider,{value:this.props.routeContext},w.createElement(cr.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Un(e){let{routeContext:t,match:r,children:n}=e,a=w.useContext(Rt);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),w.createElement(fe.Provider,{value:t},n)}function Fn(e,t,r,n){var a;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var l;if((l=r)!=null&&l.errors)e=r.matches;else return null}let i=e,d=(a=r)==null?void 0:a.errors;if(d!=null){let h=i.findIndex(m=>m.route.id&&(d==null?void 0:d[m.route.id])!==void 0);h>=0||L(!1),i=i.slice(0,Math.min(i.length,h+1))}let u=!1,v=-1;if(r&&n&&n.v7_partialHydration)for(let h=0;h<i.length;h++){let m=i[h];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(v=h),m.route.id){let{loaderData:g,errors:_}=r,P=m.route.loader&&g[m.route.id]===void 0&&(!_||_[m.route.id]===void 0);if(m.route.lazy||P){u=!0,v>=0?i=i.slice(0,v+1):i=[i[0]];break}}}return i.reduceRight((h,m,g)=>{let _,P=!1,E=null,x=null;r&&(_=d&&m.route.id?d[m.route.id]:void 0,E=m.route.errorElement||_n,u&&(v<0&&g===0?(An("route-fallback",!1),P=!0,x=null):v===g&&(P=!0,x=m.route.hydrateFallbackElement||null)));let U=t.concat(i.slice(0,g+1)),T=()=>{let B;return _?B=E:P?B=x:m.route.Component?B=w.createElement(m.route.Component,null):m.route.element?B=m.route.element:B=h,w.createElement(Un,{match:m,routeContext:{outlet:h,matches:U,isDataRoute:r!=null},children:B})};return r&&(m.route.ErrorBoundary||m.route.errorElement||g===0)?w.createElement(jn,{location:r.location,revalidation:r.revalidation,component:E,error:_,children:T(),routeContext:{outlet:null,matches:U,isDataRoute:!0}}):T()},null)}var Dt=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Dt||{}),oe=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(oe||{});function hr(e){let t=w.useContext(Rt);return t||L(!1),t}function Ge(e){let t=w.useContext(Pn);return t||L(!1),t}function Tn(e){let t=w.useContext(fe);return t||L(!1),t}function it(e){let t=Tn(),r=t.matches[t.matches.length-1];return r.route.id||L(!1),r.route.id}function qn(){return it(oe.UseRouteId)}function Qn(){return Ge(oe.UseNavigation).navigation}function Zn(){let e=hr(Dt.UseRevalidator),t=Ge(oe.UseRevalidator);return w.useMemo(()=>({revalidate:e.router.revalidate,state:t.revalidation}),[e.router.revalidate,t.revalidation])}function ea(){let{matches:e,loaderData:t}=Ge(oe.UseMatches);return w.useMemo(()=>e.map(r=>er(r,t)),[e,t])}function ta(){let e=Ge(oe.UseLoaderData),t=it(oe.UseLoaderData);if(e.errors&&e.errors[t]!=null){console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")");return}return e.loaderData[t]}function In(){var e;let t=w.useContext(cr),r=Ge(oe.UseRouteError),n=it(oe.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function On(){let e=w.useContext(at);return e==null?void 0:e._data}function ra(){let e=w.useContext(at);return e==null?void 0:e._error}function Nn(){let{router:e}=hr(Dt.UseNavigateStable),t=it(oe.UseNavigateStable),r=w.useRef(!1);return fr(()=>{r.current=!0}),w.useCallback(function(a,l){l===void 0&&(l={}),r.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,$e({fromRouteId:t},l)))},[e,t])}const Zt={};function An(e,t,r){!t&&!Zt[e]&&(Zt[e]=!0)}function na(e){return Cn(e.context)}function aa(e){let{basename:t="/",children:r=null,location:n,navigationType:a=A.Pop,navigator:l,static:i=!1,future:d}=e;Ye()&&L(!1);let u=t.replace(/^\/*/,"/"),v=w.useMemo(()=>({basename:u,navigator:l,static:i,future:$e({v7_relativeSplatPath:!1},d)}),[u,d,l,i]);typeof n=="string"&&(n=ce(n));let{pathname:h="/",search:m="",hash:g="",state:_=null,key:P="default"}=n,E=w.useMemo(()=>{let x=Je(h,u);return x==null?null:{location:{pathname:x,search:m,hash:g,state:_,key:P},navigationType:a}},[u,h,m,g,_,P,a]);return E==null?null:w.createElement(Ue.Provider,{value:v},w.createElement(ot.Provider,{children:r,value:E}))}function oa(e){let{children:t,errorElement:r,resolve:n}=e;return w.createElement(zn,{resolve:n,errorElement:r},w.createElement(kn,null,t))}var Z=function(e){return e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error",e}(Z||{});const Bn=new Promise(()=>{});class zn extends w.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,r){console.error("<Await> caught the following error during render",t,r)}render(){let{children:t,errorElement:r,resolve:n}=this.props,a=null,l=Z.pending;if(!(n instanceof Promise))l=Z.success,a=Promise.resolve(),Object.defineProperty(a,"_tracked",{get:()=>!0}),Object.defineProperty(a,"_data",{get:()=>n});else if(this.state.error){l=Z.error;let i=this.state.error;a=Promise.reject().catch(()=>{}),Object.defineProperty(a,"_tracked",{get:()=>!0}),Object.defineProperty(a,"_error",{get:()=>i})}else n._tracked?(a=n,l="_error"in a?Z.error:"_data"in a?Z.success:Z.pending):(l=Z.pending,Object.defineProperty(n,"_tracked",{get:()=>!0}),a=n.then(i=>Object.defineProperty(n,"_data",{get:()=>i}),i=>Object.defineProperty(n,"_error",{get:()=>i})));if(l===Z.error&&a._error instanceof mt)throw Bn;if(l===Z.error&&!r)throw a._error;if(l===Z.error)return w.createElement(at.Provider,{value:a,children:r});if(l===Z.success)return w.createElement(at.Provider,{value:a,children:t});throw a}}function kn(e){let{children:t}=e,r=On(),n=typeof t=="function"?t(r):t;return w.createElement(w.Fragment,null,n)}export{mt as A,Vn as B,Hn as C,Rt as D,ar as E,an as I,Ue as N,na as O,fe as R,Gn as a,In as b,Qn as c,Pt as d,qn as e,L as f,Mn as g,Ve as h,wt as i,ue as j,Pn as k,aa as l,Xn as m,Jn as n,ea as o,Hr as p,ce as q,Wn as r,Je as s,$n as t,Yn as u,_e as v,ra as w,ta as x,oa as y,Zn as z};
//# sourceMappingURL=index-rFVW6WLf.js.map
