var is=Object.defineProperty;var ls=(De,se,He)=>se in De?is(De,se,{enumerable:!0,configurable:!0,writable:!0,value:He}):De[se]=He;var qt=(De,se,He)=>ls(De,typeof se!="symbol"?se+"":se,He);import*as d from"https://assets.finn.no/npm/react/v18/react.production.min.js";import ss from"https://assets.finn.no/npm/react/v18/react.production.min.js";import*as us from"https://assets.finn.no/npm/react-dom/v18/react-dom.production.js";let ha,ma,pa,Le,jr,ya,va,Tr,ga,Kt,Mr,V,Xt,fe,Ar,wa,ba,Yt,Ea,ke,Ae,Sa,Ur,yt,ve,xa,Ra,_a,La,ka,Nr,Da,Ca,Pa,Oa,Ue,Vt,ja,cs=(async()=>{var De={exports:{}},se={},He=ss,Ta=Symbol.for("react.element"),Ma=Symbol.for("react.fragment"),Aa=Object.prototype.hasOwnProperty,Ua=He.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Na={key:!0,ref:!0,__self:!0,__source:!0};function $r(e,t,r){var n,a={},i=null,o=null;r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(n in t)Aa.call(t,n)&&!Na.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)a[n]===void 0&&(a[n]=t[n]);return{$$typeof:Ta,type:e,key:i,ref:o,props:a,_owner:Ua.current}}se.Fragment=Ma,se.jsx=$r,se.jsxs=$r,De.exports=se,Sa=De.exports;function X(){return X=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},X.apply(this,arguments)}var Q;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Q||(Q={}));const Ir="popstate";Ra=function(e){e===void 0&&(e={});function t(n,a){let{pathname:i,search:o,hash:s}=n.location;return tt("",{pathname:i,search:o,hash:s},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:Ce(a)}return Ia(t,r,null,e)};function M(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Be(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function $a(){return Math.random().toString(36).substr(2,8)}function Fr(e,t){return{usr:e.state,key:e.key,idx:t}}function tt(e,t,r,n){return r===void 0&&(r=null),X({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ee(t):t,{state:r,key:t&&t.key||n||$a()})}function Ce(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 Ee(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 Ia(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:i=!1}=n,o=a.history,s=Q.Pop,l=null,u=f();u==null&&(u=0,o.replaceState(X({},o.state,{idx:u}),""));function f(){return(o.state||{idx:null}).idx}function c(){s=Q.Pop;let x=f(),_=x==null?null:x-u;u=x,l&&l({action:s,location:E.location,delta:_})}function p(x,_){s=Q.Push;let L=tt(E.location,x,_);u=f()+1;let D=Fr(L,u),S=E.createHref(L);try{o.pushState(D,"",S)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;a.location.assign(S)}i&&l&&l({action:s,location:E.location,delta:1})}function w(x,_){s=Q.Replace;let L=tt(E.location,x,_);u=f();let D=Fr(L,u),S=E.createHref(L);o.replaceState(D,"",S),i&&l&&l({action:s,location:E.location,delta:0})}function g(x){let _=a.location.origin!=="null"?a.location.origin:a.location.href,L=typeof x=="string"?x:Ce(x);return L=L.replace(/ $/,"%20"),M(_,"No window.location.(origin|href) available to create URL for href: "+L),new URL(L,_)}let E={get action(){return s},get location(){return e(a,o)},listen(x){if(l)throw new Error("A history only accepts one active listener");return a.addEventListener(Ir,c),l=x,()=>{a.removeEventListener(Ir,c),l=null}},createHref(x){return t(a,x)},createURL:g,encodeLocation(x){let _=g(x);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:p,replace:w,go(x){return o.go(x)}};return E}var W;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(W||(W={}));const Fa=new Set(["lazy","caseSensitive","path","id","index","children"]);function za(e){return e.index===!0}function rt(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((a,i)=>{let o=[...r,String(i)],s=typeof a.id=="string"?a.id:o.join("-");if(M(a.index!==!0||!a.children,"Cannot specify children on an index route"),M(!n[s],'Found a route id collision on id "'+s+`".  Route id's must be globally unique within Data Router usages`),za(a)){let l=X({},a,t(a),{id:s});return n[s]=l,l}else{let l=X({},a,t(a),{id:s,children:void 0});return n[s]=l,a.children&&(l.children=rt(a.children,t,o,n)),l}})}ve=function(e,t,r){return r===void 0&&(r="/"),vt(e,t,r,!1)};function vt(e,t,r,n){let a=typeof t=="string"?Ee(t):t,i=ue(a.pathname||"/",r);if(i==null)return null;let o=Hr(e);Ha(o);let s=null;for(let l=0;s==null&&l<o.length;++l){let u=Za(i);s=Ga(o[l],u,n)}return s}function zr(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 Hr(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(i,o,s)=>{let l={relativePath:s===void 0?i.path||"":s,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};l.relativePath.startsWith("/")&&(M(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=ge([n,l.relativePath]),f=r.concat(l);i.children&&i.children.length>0&&(M(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Hr(i.children,t,f,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:Ya(u,i.index),routesMeta:f})};return e.forEach((i,o)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))a(i,o);else for(let l of Br(i.path))a(i,o,l)}),t}function Br(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return a?[i,""]:[i];let o=Br(n.join("/")),s=[];return s.push(...o.map(l=>l===""?i:[i,l].join("/"))),a&&s.push(...o),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function Ha(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Va(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const Ba=/^:[\w-]+$/,Ja=3,Wa=2,qa=1,Ka=10,Xa=-2,Jr=e=>e==="*";function Ya(e,t){let r=e.split("/"),n=r.length;return r.some(Jr)&&(n+=Xa),t&&(n+=Wa),r.filter(a=>!Jr(a)).reduce((a,i)=>a+(Ba.test(i)?Ja:i===""?qa:Ka),n)}function Va(e,t){return e.length===t.length&&e.slice(0,-1).every((r,n)=>r===t[n])?e[e.length-1]-t[t.length-1]:0}function Ga(e,t,r){r===void 0&&(r=!1);let{routesMeta:n}=e,a={},i="/",o=[];for(let s=0;s<n.length;++s){let l=n[s],u=s===n.length-1,f=i==="/"?t:t.slice(i.length)||"/",c=gt({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},f),p=l.route;if(!c&&u&&r&&!n[n.length-1].route.index&&(c=gt({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},f)),!c)return null;Object.assign(a,c.params),o.push({params:a,pathname:ge([i,c.pathname]),pathnameBase:ro(ge([i,c.pathnameBase])),route:p}),c.pathnameBase!=="/"&&(i=ge([i,c.pathnameBase]))}return o}function gt(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=Qa(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let i=a[0],o=i.replace(/(.)\/+$/,"$1"),s=a.slice(1);return{params:n.reduce((l,u,f)=>{let{paramName:c,isOptional:p}=u;if(c==="*"){let g=s[f]||"";o=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const w=s[f];return p&&!w?l[c]=void 0:l[c]=(w||"").replace(/%2F/g,"/"),l},{}),pathname:i,pathnameBase:o,pattern:e}}function Qa(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),Be(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,o,s)=>(n.push({paramName:o,isOptional:s!=null}),s?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function Za(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Be(!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 ue(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 eo(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?Ee(e):e;return{pathname:r?r.startsWith("/")?r:to(r,t):t,search:no(n),hash:ao(a)}}function to(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 Gt(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 Wr(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Qt(e,t){let r=Wr(e);return t?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Zt(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=Ee(e):(a=X({},e),M(!a.pathname||!a.pathname.includes("?"),Gt("?","pathname","search",a)),M(!a.pathname||!a.pathname.includes("#"),Gt("#","pathname","hash",a)),M(!a.search||!a.search.includes("#"),Gt("#","search","hash",a)));let i=e===""||a.pathname==="",o=i?"/":a.pathname,s;if(o==null)s=r;else{let c=t.length-1;if(!n&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),c-=1;a.pathname=p.join("/")}s=c>=0?t[c]:"/"}let l=eo(a,s),u=o&&o!=="/"&&o.endsWith("/"),f=(i||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||f)&&(l.pathname+="/"),l}const ge=e=>e.join("/").replace(/\/\/+/g,"/"),ro=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),no=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ao=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class oo{constructor(t,r){this.type="DataWithResponseInit",this.data=t,this.init=r||null}}function io(e,t){return new oo(e,typeof t=="number"?{status:t}:t)}class wt extends Error{}class lo{constructor(t,r){this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],M(t&&typeof t=="object"&&!Array.isArray(t),"defer() only accepts plain objects");let n;this.abortPromise=new Promise((i,o)=>n=o),this.controller=new AbortController;let a=()=>n(new wt("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",a),this.controller.signal.addEventListener("abort",a),this.data=Object.entries(t).reduce((i,o)=>{let[s,l]=o;return Object.assign(i,{[s]:this.trackPromise(s,l)})},{}),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 wt)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 i=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:()=>i}),this.emit(!1,r),Promise.reject(i)}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(i=>{t.removeEventListener("abort",n),(i||this.done)&&a(i)})})}return r}get done(){return this.pendingKeysSet.size===0}get unwrappedData(){return M(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]:uo(a)})},{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function so(e){return e instanceof Promise&&e._tracked===!0}function uo(e){if(!so(e))return e;if(e._error)throw e._error;return e._data}const qr=function(e,t){t===void 0&&(t=302);let r=t;typeof r=="number"?r={status:r}:typeof r.status>"u"&&(r.status=302);let n=new Headers(r.headers);return n.set("Location",e),new Response(null,X({},r,{headers:n}))};Le=class{constructor(e,t,r,n){n===void 0&&(n=!1),this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}},Ae=function(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e};const Kr=["post","put","patch","delete"],co=new Set(Kr),fo=["get",...Kr],ho=new Set(fo),mo=new Set([301,302,303,307,308]),po=new Set([307,308]),er={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Xr={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},nt={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},tr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,yo=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Yr="remix-router-transitions";xa=function(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;M(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 h=e.detectErrorBoundary;a=m=>({hasErrorBoundary:h(m)})}else a=yo;let i={},o=rt(e.routes,a,void 0,i),s,l=e.basename||"/",u=e.unstable_dataStrategy||Eo,f=e.unstable_patchRoutesOnNavigation,c=X({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),p=null,w=new Set,g=1e3,E=new Set,x=null,_=null,L=null,D=e.hydrationData!=null,S=ve(o,e.history.location,l),O=null;if(S==null&&!f){let h=ae(404,{pathname:e.history.location.pathname}),{matches:m,route:v}=sn(o);S=m,O={[v.id]:h}}S&&!e.hydrationData&&zt(S,o,e.history.location.pathname).active&&(S=null);let k;if(S)if(S.some(h=>h.route.lazy))k=!1;else if(!S.some(h=>h.route.loader))k=!0;else if(c.v7_partialHydration){let h=e.hydrationData?e.hydrationData.loaderData:null,m=e.hydrationData?e.hydrationData.errors:null,v=b=>b.route.loader?typeof b.route.loader=="function"&&b.route.loader.hydrate===!0?!1:h&&h[b.route.id]!==void 0||m&&m[b.route.id]!==void 0:!0;if(m){let b=S.findIndex(C=>m[C.route.id]!==void 0);k=S.slice(0,b+1).every(v)}else k=S.every(v)}else k=e.hydrationData!=null;else if(k=!1,S=[],c.v7_partialHydration){let h=zt(null,o,e.history.location.pathname);h.active&&h.matches&&(S=h.matches)}let N,y={historyAction:e.history.action,location:e.history.location,matches:S,initialized:k,navigation:er,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||O,fetchers:new Map,blockers:new Map},T=Q.Pop,z=!1,$,K=!1,ne=new Map,G=null,re=!1,pe=!1,At=[],Ut=new Set,Z=new Map,Nt=0,ft=-1,Ye=new Map,Se=new Set,Ve=new Map,ht=new Map,xe=new Set,Ie=new Map,Fe=new Map,Hl=new Map,Dr=!1;function Bl(){if(p=e.history.listen(h=>{let{action:m,location:v,delta:b}=h;if(Dr){Dr=!1;return}Be(Fe.size===0||b!=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 C=sa({currentLocation:y.location,nextLocation:v,historyAction:m});if(C&&b!=null){Dr=!0,e.history.go(b*-1),It(C,{state:"blocked",location:v,proceed(){It(C,{state:"proceeding",proceed:void 0,reset:void 0,location:v}),e.history.go(b)},reset(){let P=new Map(y.blockers);P.set(C,nt),oe({blockers:P})}});return}return ze(m,v)}),r){Mo(t,ne);let h=()=>Ao(t,ne);t.addEventListener("pagehide",h),G=()=>t.removeEventListener("pagehide",h)}return y.initialized||ze(Q.Pop,y.location,{initialHydration:!0}),N}function Jl(){p&&p(),G&&G(),w.clear(),$&&$.abort(),y.fetchers.forEach((h,m)=>$t(m)),y.blockers.forEach((h,m)=>la(m))}function Wl(h){return w.add(h),()=>w.delete(h)}function oe(h,m){m===void 0&&(m={}),y=X({},y,h);let v=[],b=[];c.v7_fetcherPersist&&y.fetchers.forEach((C,P)=>{C.state==="idle"&&(xe.has(P)?b.push(P):v.push(P))}),[...w].forEach(C=>C(y,{deletedFetchers:b,unstable_viewTransitionOpts:m.viewTransitionOpts,unstable_flushSync:m.flushSync===!0})),c.v7_fetcherPersist&&(v.forEach(C=>y.fetchers.delete(C)),b.forEach(C=>$t(C)))}function Ge(h,m,v){var b,C;let{flushSync:P}=v===void 0?{}:v,A=y.actionData!=null&&y.navigation.formMethod!=null&&he(y.navigation.formMethod)&&y.navigation.state==="loading"&&((b=h.state)==null?void 0:b._isRedirect)!==!0,R;m.actionData?Object.keys(m.actionData).length>0?R=m.actionData:R=null:A?R=y.actionData:R=null;let U=m.loaderData?on(y.loaderData,m.loaderData,m.matches||[],m.errors):y.loaderData,j=y.blockers;j.size>0&&(j=new Map(j),j.forEach((F,B)=>j.set(B,nt)));let I=z===!0||y.navigation.formMethod!=null&&he(y.navigation.formMethod)&&((C=h.state)==null?void 0:C._isRedirect)!==!0;s&&(o=s,s=void 0),re||T===Q.Pop||(T===Q.Push?e.history.push(h,h.state):T===Q.Replace&&e.history.replace(h,h.state));let q;if(T===Q.Pop){let F=ne.get(y.location.pathname);F&&F.has(h.pathname)?q={currentLocation:y.location,nextLocation:h}:ne.has(h.pathname)&&(q={currentLocation:h,nextLocation:y.location})}else if(K){let F=ne.get(y.location.pathname);F?F.add(h.pathname):(F=new Set([h.pathname]),ne.set(y.location.pathname,F)),q={currentLocation:y.location,nextLocation:h}}oe(X({},m,{actionData:R,loaderData:U,historyAction:T,location:h,initialized:!0,navigation:er,revalidation:"idle",restoreScrollPosition:ca(h,m.matches||y.matches),preventScrollReset:I,blockers:j}),{viewTransitionOpts:q,flushSync:P===!0}),T=Q.Pop,z=!1,K=!1,re=!1,pe=!1,At=[]}async function ea(h,m){if(typeof h=="number"){e.history.go(h);return}let v=rr(y.location,y.matches,l,c.v7_prependBasename,h,c.v7_relativeSplatPath,m==null?void 0:m.fromRouteId,m==null?void 0:m.relative),{path:b,submission:C,error:P}=Vr(c.v7_normalizeFormMethod,!1,v,m),A=y.location,R=tt(y.location,b,m&&m.state);R=X({},R,e.history.encodeLocation(R));let U=m&&m.replace!=null?m.replace:void 0,j=Q.Push;U===!0?j=Q.Replace:U===!1||C!=null&&he(C.formMethod)&&C.formAction===y.location.pathname+y.location.search&&(j=Q.Replace);let I=m&&"preventScrollReset"in m?m.preventScrollReset===!0:void 0,q=(m&&m.unstable_flushSync)===!0,F=sa({currentLocation:A,nextLocation:R,historyAction:j});if(F){It(F,{state:"blocked",location:R,proceed(){It(F,{state:"proceeding",proceed:void 0,reset:void 0,location:R}),ea(h,m)},reset(){let B=new Map(y.blockers);B.set(F,nt),oe({blockers:B})}});return}return await ze(j,R,{submission:C,pendingError:P,preventScrollReset:I,replace:m&&m.replace,enableViewTransition:m&&m.unstable_viewTransition,flushSync:q})}function ql(){if(Cr(),oe({revalidation:"loading"}),y.navigation.state!=="submitting"){if(y.navigation.state==="idle"){ze(y.historyAction,y.location,{startUninterruptedRevalidation:!0});return}ze(T||y.historyAction,y.navigation.location,{overrideNavigation:y.navigation})}}async function ze(h,m,v){$&&$.abort(),$=null,T=h,re=(v&&v.startUninterruptedRevalidation)===!0,rs(y.location,y.matches),z=(v&&v.preventScrollReset)===!0,K=(v&&v.enableViewTransition)===!0;let b=s||o,C=v&&v.overrideNavigation,P=ve(b,m,l),A=(v&&v.flushSync)===!0,R=zt(P,b,m.pathname);if(R.active&&R.matches&&(P=R.matches),!P){let{error:te,notFoundMatches:ie,route:ee}=Pr(m.pathname);Ge(m,{matches:ie,loaderData:{},errors:{[ee.id]:te}},{flushSync:A});return}if(y.initialized&&!pe&&ko(y.location,m)&&!(v&&v.submission&&he(v.submission.formMethod))){Ge(m,{matches:P},{flushSync:A});return}$=new AbortController;let U=Je(e.history,m,$.signal,v&&v.submission),j;if(v&&v.pendingError)j=[We(P).route.id,{type:W.error,error:v.pendingError}];else if(v&&v.submission&&he(v.submission.formMethod)){let te=await Kl(U,m,v.submission,P,R.active,{replace:v.replace,flushSync:A});if(te.shortCircuited)return;if(te.pendingActionResult){let[ie,ee]=te.pendingActionResult;if(le(ee)&&Ae(ee.error)&&ee.error.status===404){$=null,Ge(m,{matches:te.matches,loaderData:{},errors:{[ie]:ee.error}});return}}P=te.matches||P,j=te.pendingActionResult,C=or(m,v.submission),A=!1,R.active=!1,U=Je(e.history,U.url,U.signal)}let{shortCircuited:I,matches:q,loaderData:F,errors:B}=await Xl(U,m,P,R.active,C,v&&v.submission,v&&v.fetcherSubmission,v&&v.replace,v&&v.initialHydration===!0,A,j);I||($=null,Ge(m,X({matches:q||P},ln(j),{loaderData:F,errors:B})))}async function Kl(h,m,v,b,C,P){P===void 0&&(P={}),Cr();let A=jo(m,v);if(oe({navigation:A},{flushSync:P.flushSync===!0}),C){let j=await Ht(b,m.pathname,h.signal);if(j.type==="aborted")return{shortCircuited:!0};if(j.type==="error"){let{boundaryId:I,error:q}=Ft(m.pathname,j);return{matches:j.partialMatches,pendingActionResult:[I,{type:W.error,error:q}]}}else if(j.matches)b=j.matches;else{let{notFoundMatches:I,error:q,route:F}=Pr(m.pathname);return{matches:I,pendingActionResult:[F.id,{type:W.error,error:q}]}}}let R,U=at(b,m);if(!U.route.action&&!U.route.lazy)R={type:W.error,error:ae(405,{method:h.method,pathname:m.pathname,routeId:U.route.id})};else if(R=(await pt("action",h,[U],b))[0],h.signal.aborted)return{shortCircuited:!0};if($e(R)){let j;return P&&P.replace!=null?j=P.replace:j=rn(R.response.headers.get("Location"),new URL(h.url),l)===y.location.pathname+y.location.search,await mt(h,R,{submission:v,replace:j}),{shortCircuited:!0}}if(Ne(R))throw ae(400,{type:"defer-action"});if(le(R)){let j=We(b,U.route.id);return(P&&P.replace)!==!0&&(T=Q.Push),{matches:b,pendingActionResult:[j.route.id,R]}}return{matches:b,pendingActionResult:[U.route.id,R]}}async function Xl(h,m,v,b,C,P,A,R,U,j,I){let q=C||or(m,P),F=P||A||pn(q),B=!re&&(!c.v7_partialHydration||!U);if(b){if(B){let Y=ta(I);oe(X({navigation:q},Y!==void 0?{actionData:Y}:{}),{flushSync:j})}let H=await Ht(v,m.pathname,h.signal);if(H.type==="aborted")return{shortCircuited:!0};if(H.type==="error"){let{boundaryId:Y,error:J}=Ft(m.pathname,H);return{matches:H.partialMatches,loaderData:{},errors:{[Y]:J}}}else if(H.matches)v=H.matches;else{let{error:Y,notFoundMatches:J,route:ye}=Pr(m.pathname);return{matches:J,loaderData:{},errors:{[ye.id]:Y}}}}let te=s||o,[ie,ee]=Gr(e.history,y,v,F,m,c.v7_partialHydration&&U===!0,c.v7_skipActionErrorRevalidation,pe,At,Ut,xe,Ve,Se,te,l,I);if(Or(H=>!(v&&v.some(Y=>Y.route.id===H))||ie&&ie.some(Y=>Y.route.id===H)),ft=++Nt,ie.length===0&&ee.length===0){let H=oa();return Ge(m,X({matches:v,loaderData:{},errors:I&&le(I[1])?{[I[0]]:I[1].error}:null},ln(I),H?{fetchers:new Map(y.fetchers)}:{}),{flushSync:j}),{shortCircuited:!0}}if(B){let H={};if(!b){H.navigation=q;let Y=ta(I);Y!==void 0&&(H.actionData=Y)}ee.length>0&&(H.fetchers=Yl(ee)),oe(H,{flushSync:j})}ee.forEach(H=>{Z.has(H.key)&&je(H.key),H.controller&&Z.set(H.key,H.controller)});let Te=()=>ee.forEach(H=>je(H.key));$&&$.signal.addEventListener("abort",Te);let{loaderResults:Qe,fetcherResults:Bt}=await ra(y.matches,v,ie,ee,h);if(h.signal.aborted)return{shortCircuited:!0};$&&$.signal.removeEventListener("abort",Te),ee.forEach(H=>Z.delete(H.key));let _e=un([...Qe,...Bt]);if(_e){if(_e.idx>=ie.length){let H=ee[_e.idx-ie.length].key;Se.add(H)}return await mt(h,_e.result,{replace:R}),{shortCircuited:!0}}let{loaderData:Me,errors:Ze}=an(y,v,ie,Qe,I,ee,Bt,Ie);Ie.forEach((H,Y)=>{H.subscribe(J=>{(J||H.done)&&Ie.delete(Y)})}),c.v7_partialHydration&&U&&y.errors&&Object.entries(y.errors).filter(H=>{let[Y]=H;return!ie.some(J=>J.route.id===Y)}).forEach(H=>{let[Y,J]=H;Ze=Object.assign(Ze||{},{[Y]:J})});let Jt=oa(),Wt=ia(ft),et=Jt||Wt||ee.length>0;return X({matches:v,loaderData:Me,errors:Ze},et?{fetchers:new Map(y.fetchers)}:{})}function ta(h){if(h&&!le(h[1]))return{[h[0]]:h[1].data};if(y.actionData)return Object.keys(y.actionData).length===0?null:y.actionData}function Yl(h){return h.forEach(m=>{let v=y.fetchers.get(m.key),b=ot(void 0,v?v.data:void 0);y.fetchers.set(m.key,b)}),new Map(y.fetchers)}function Vl(h,m,v,b){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.");Z.has(h)&&je(h);let C=(b&&b.unstable_flushSync)===!0,P=s||o,A=rr(y.location,y.matches,l,c.v7_prependBasename,v,c.v7_relativeSplatPath,m,b==null?void 0:b.relative),R=ve(P,A,l),U=zt(R,P,A);if(U.active&&U.matches&&(R=U.matches),!R){Re(h,m,ae(404,{pathname:A}),{flushSync:C});return}let{path:j,submission:I,error:q}=Vr(c.v7_normalizeFormMethod,!0,A,b);if(q){Re(h,m,q,{flushSync:C});return}let F=at(R,j);if(z=(b&&b.preventScrollReset)===!0,I&&he(I.formMethod)){Gl(h,m,j,F,R,U.active,C,I);return}Ve.set(h,{routeId:m,path:j}),Ql(h,m,j,F,R,U.active,C,I)}async function Gl(h,m,v,b,C,P,A,R){Cr(),Ve.delete(h);function U(J){if(!J.route.action&&!J.route.lazy){let ye=ae(405,{method:R.formMethod,pathname:v,routeId:m});return Re(h,m,ye,{flushSync:A}),!0}return!1}if(!P&&U(b))return;let j=y.fetchers.get(h);Oe(h,To(R,j),{flushSync:A});let I=new AbortController,q=Je(e.history,v,I.signal,R);if(P){let J=await Ht(C,v,q.signal);if(J.type==="aborted")return;if(J.type==="error"){let{error:ye}=Ft(v,J);Re(h,m,ye,{flushSync:A});return}else if(J.matches){if(C=J.matches,b=at(C,v),U(b))return}else{Re(h,m,ae(404,{pathname:v}),{flushSync:A});return}}Z.set(h,I);let F=Nt,B=(await pt("action",q,[b],C))[0];if(q.signal.aborted){Z.get(h)===I&&Z.delete(h);return}if(c.v7_fetcherPersist&&xe.has(h)){if($e(B)||le(B)){Oe(h,Pe(void 0));return}}else{if($e(B))if(Z.delete(h),ft>F){Oe(h,Pe(void 0));return}else return Se.add(h),Oe(h,ot(R)),mt(q,B,{fetcherSubmission:R});if(le(B)){Re(h,m,B.error);return}}if(Ne(B))throw ae(400,{type:"defer-action"});let te=y.navigation.location||y.location,ie=Je(e.history,te,I.signal),ee=s||o,Te=y.navigation.state!=="idle"?ve(ee,y.navigation.location,l):y.matches;M(Te,"Didn't find any matches after fetcher action");let Qe=++Nt;Ye.set(h,Qe);let Bt=ot(R,B.data);y.fetchers.set(h,Bt);let[_e,Me]=Gr(e.history,y,Te,R,te,!1,c.v7_skipActionErrorRevalidation,pe,At,Ut,xe,Ve,Se,ee,l,[b.route.id,B]);Me.filter(J=>J.key!==h).forEach(J=>{let ye=J.key,fa=y.fetchers.get(ye),os=ot(void 0,fa?fa.data:void 0);y.fetchers.set(ye,os),Z.has(ye)&&je(ye),J.controller&&Z.set(ye,J.controller)}),oe({fetchers:new Map(y.fetchers)});let Ze=()=>Me.forEach(J=>je(J.key));I.signal.addEventListener("abort",Ze);let{loaderResults:Jt,fetcherResults:Wt}=await ra(y.matches,Te,_e,Me,ie);if(I.signal.aborted)return;I.signal.removeEventListener("abort",Ze),Ye.delete(h),Z.delete(h),Me.forEach(J=>Z.delete(J.key));let et=un([...Jt,...Wt]);if(et){if(et.idx>=_e.length){let J=Me[et.idx-_e.length].key;Se.add(J)}return mt(ie,et.result)}let{loaderData:H,errors:Y}=an(y,y.matches,_e,Jt,void 0,Me,Wt,Ie);if(y.fetchers.has(h)){let J=Pe(B.data);y.fetchers.set(h,J)}ia(Qe),y.navigation.state==="loading"&&Qe>ft?(M(T,"Expected pending action"),$&&$.abort(),Ge(y.navigation.location,{matches:Te,loaderData:H,errors:Y,fetchers:new Map(y.fetchers)})):(oe({errors:Y,loaderData:on(y.loaderData,H,Te,Y),fetchers:new Map(y.fetchers)}),pe=!1)}async function Ql(h,m,v,b,C,P,A,R){let U=y.fetchers.get(h);Oe(h,ot(R,U?U.data:void 0),{flushSync:A});let j=new AbortController,I=Je(e.history,v,j.signal);if(P){let B=await Ht(C,v,I.signal);if(B.type==="aborted")return;if(B.type==="error"){let{error:te}=Ft(v,B);Re(h,m,te,{flushSync:A});return}else if(B.matches)C=B.matches,b=at(C,v);else{Re(h,m,ae(404,{pathname:v}),{flushSync:A});return}}Z.set(h,j);let q=Nt,F=(await pt("loader",I,[b],C))[0];if(Ne(F)&&(F=await mn(F,I.signal,!0)||F),Z.get(h)===j&&Z.delete(h),!I.signal.aborted){if(xe.has(h)){Oe(h,Pe(void 0));return}if($e(F))if(ft>q){Oe(h,Pe(void 0));return}else{Se.add(h),await mt(I,F);return}if(le(F)){Re(h,m,F.error);return}M(!Ne(F),"Unhandled fetcher deferred data"),Oe(h,Pe(F.data))}}async function mt(h,m,v){let{submission:b,fetcherSubmission:C,replace:P}=v===void 0?{}:v;m.response.headers.has("X-Remix-Revalidate")&&(pe=!0);let A=m.response.headers.get("Location");M(A,"Expected a Location header on the redirect Response"),A=rn(A,new URL(h.url),l);let R=tt(y.location,A,{_isRedirect:!0});if(r){let B=!1;if(m.response.headers.has("X-Remix-Reload-Document"))B=!0;else if(tr.test(A)){const te=e.history.createURL(A);B=te.origin!==t.location.origin||ue(te.pathname,l)==null}if(B){P?t.location.replace(A):t.location.assign(A);return}}$=null;let U=P===!0||m.response.headers.has("X-Remix-Replace")?Q.Replace:Q.Push,{formMethod:j,formAction:I,formEncType:q}=y.navigation;!b&&!C&&j&&I&&q&&(b=pn(y.navigation));let F=b||C;if(po.has(m.response.status)&&F&&he(F.formMethod))await ze(U,R,{submission:X({},F,{formAction:A}),preventScrollReset:z});else{let B=or(R,b);await ze(U,R,{overrideNavigation:B,fetcherSubmission:C,preventScrollReset:z})}}async function pt(h,m,v,b){try{let C=await So(u,h,m,v,b,i,a);return await Promise.all(C.map((P,A)=>{if(Co(P)){let R=P.result;return{type:W.redirect,response:_o(R,m,v[A].route.id,b,l,c.v7_relativeSplatPath)}}return Ro(P)}))}catch(C){return v.map(()=>({type:W.error,error:C}))}}async function ra(h,m,v,b,C){let[P,...A]=await Promise.all([v.length?pt("loader",C,v,m):[],...b.map(R=>{if(R.matches&&R.match&&R.controller){let U=Je(e.history,R.path,R.controller.signal);return pt("loader",U,[R.match],R.matches).then(j=>j[0])}else return Promise.resolve({type:W.error,error:ae(404,{pathname:R.path})})})]);return await Promise.all([hn(h,v,P,P.map(()=>C.signal),!1,y.loaderData),hn(h,b.map(R=>R.match),A,b.map(R=>R.controller?R.controller.signal:null),!0)]),{loaderResults:P,fetcherResults:A}}function Cr(){pe=!0,At.push(...Or()),Ve.forEach((h,m)=>{Z.has(m)&&(Ut.add(m),je(m))})}function Oe(h,m,v){v===void 0&&(v={}),y.fetchers.set(h,m),oe({fetchers:new Map(y.fetchers)},{flushSync:(v&&v.flushSync)===!0})}function Re(h,m,v,b){b===void 0&&(b={});let C=We(y.matches,m);$t(h),oe({errors:{[C.route.id]:v},fetchers:new Map(y.fetchers)},{flushSync:(b&&b.flushSync)===!0})}function na(h){return c.v7_fetcherPersist&&(ht.set(h,(ht.get(h)||0)+1),xe.has(h)&&xe.delete(h)),y.fetchers.get(h)||Xr}function $t(h){let m=y.fetchers.get(h);Z.has(h)&&!(m&&m.state==="loading"&&Ye.has(h))&&je(h),Ve.delete(h),Ye.delete(h),Se.delete(h),xe.delete(h),Ut.delete(h),y.fetchers.delete(h)}function Zl(h){if(c.v7_fetcherPersist){let m=(ht.get(h)||0)-1;m<=0?(ht.delete(h),xe.add(h)):ht.set(h,m)}else $t(h);oe({fetchers:new Map(y.fetchers)})}function je(h){let m=Z.get(h);M(m,"Expected fetch controller: "+h),m.abort(),Z.delete(h)}function aa(h){for(let m of h){let v=na(m),b=Pe(v.data);y.fetchers.set(m,b)}}function oa(){let h=[],m=!1;for(let v of Se){let b=y.fetchers.get(v);M(b,"Expected fetcher: "+v),b.state==="loading"&&(Se.delete(v),h.push(v),m=!0)}return aa(h),m}function ia(h){let m=[];for(let[v,b]of Ye)if(b<h){let C=y.fetchers.get(v);M(C,"Expected fetcher: "+v),C.state==="loading"&&(je(v),Ye.delete(v),m.push(v))}return aa(m),m.length>0}function es(h,m){let v=y.blockers.get(h)||nt;return Fe.get(h)!==m&&Fe.set(h,m),v}function la(h){y.blockers.delete(h),Fe.delete(h)}function It(h,m){let v=y.blockers.get(h)||nt;M(v.state==="unblocked"&&m.state==="blocked"||v.state==="blocked"&&m.state==="blocked"||v.state==="blocked"&&m.state==="proceeding"||v.state==="blocked"&&m.state==="unblocked"||v.state==="proceeding"&&m.state==="unblocked","Invalid blocker state transition: "+v.state+" -> "+m.state);let b=new Map(y.blockers);b.set(h,m),oe({blockers:b})}function sa(h){let{currentLocation:m,nextLocation:v,historyAction:b}=h;if(Fe.size===0)return;Fe.size>1&&Be(!1,"A router only supports one blocker at a time");let C=Array.from(Fe.entries()),[P,A]=C[C.length-1],R=y.blockers.get(P);if(!(R&&R.state==="proceeding")&&A({currentLocation:m,nextLocation:v,historyAction:b}))return P}function Pr(h){let m=ae(404,{pathname:h}),v=s||o,{matches:b,route:C}=sn(v);return Or(),{notFoundMatches:b,route:C,error:m}}function Ft(h,m){return{boundaryId:We(m.partialMatches).route.id,error:ae(400,{type:"route-discovery",pathname:h,message:m.error!=null&&"message"in m.error?m.error:String(m.error)})}}function Or(h){let m=[];return Ie.forEach((v,b)=>{(!h||h(b))&&(v.cancel(),m.push(b),Ie.delete(b))}),m}function ts(h,m,v){if(x=h,L=m,_=v||null,!D&&y.navigation===er){D=!0;let b=ca(y.location,y.matches);b!=null&&oe({restoreScrollPosition:b})}return()=>{x=null,L=null,_=null}}function ua(h,m){return _&&_(h,m.map(v=>zr(v,y.loaderData)))||h.key}function rs(h,m){if(x&&L){let v=ua(h,m);x[v]=L()}}function ca(h,m){if(x){let v=ua(h,m),b=x[v];if(typeof b=="number")return b}return null}function zt(h,m,v){if(f){if(E.has(v))return{active:!1,matches:h};if(h){if(Object.keys(h[0].params).length>0)return{active:!0,matches:vt(m,v,l,!0)}}else return{active:!0,matches:vt(m,v,l,!0)||[]}}return{active:!1,matches:null}}async function Ht(h,m,v){let b=h;for(;;){let C=s==null,P=s||o;try{await bo(f,m,b,P,i,a,Hl,v)}catch(U){return{type:"error",error:U,partialMatches:b}}finally{C&&(o=[...o])}if(v.aborted)return{type:"aborted"};let A=ve(P,m,l);if(A)return da(m,E),{type:"success",matches:A};let R=vt(P,m,l,!0);if(!R||b.length===R.length&&b.every((U,j)=>U.route.id===R[j].route.id))return da(m,E),{type:"success",matches:null};b=R}}function da(h,m){if(m.size>=g){let v=m.values().next().value;m.delete(v)}m.add(h)}function ns(h){i={},s=rt(h,a,void 0,i)}function as(h,m){let v=s==null;en(h,m,s||o,i,a),v&&(o=[...o],oe({}))}return N={get basename(){return l},get future(){return c},get state(){return y},get routes(){return o},get window(){return t},initialize:Bl,subscribe:Wl,enableScrollRestoration:ts,navigate:ea,fetch:Vl,revalidate:ql,createHref:h=>e.history.createHref(h),encodeLocation:h=>e.history.encodeLocation(h),getFetcher:na,deleteFetcher:Zl,dispose:Jl,getBlocker:es,deleteBlocker:la,patchRoutes:as,_internalFetchControllers:Z,_internalActiveDeferreds:Ie,_internalSetRoutes:ns},N};function vo(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function rr(e,t,r,n,a,i,o,s){let l,u;if(o){l=[];for(let c of t)if(l.push(c),c.route.id===o){u=c;break}}else l=t,u=t[t.length-1];let f=Zt(a||".",Qt(l,i),ue(e.pathname,r)||e.pathname,s==="path");return a==null&&(f.search=e.search,f.hash=e.hash),(a==null||a===""||a===".")&&u&&u.route.index&&!ar(f.search)&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),n&&r!=="/"&&(f.pathname=f.pathname==="/"?r:ge([r,f.pathname])),Ce(f)}function Vr(e,t,r,n){if(!n||!vo(n))return{path:r};if(n.formMethod&&!Oo(n.formMethod))return{path:r,error:ae(405,{method:n.formMethod})};let a=()=>({path:r,error:ae(400,{type:"invalid-body"})}),i=n.formMethod||"get",o=e?i.toUpperCase():i.toLowerCase(),s=cn(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!he(o))return a();let p=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((w,g)=>{let[E,x]=g;return""+w+E+"="+x+`
`},""):String(n.body);return{path:r,submission:{formMethod:o,formAction:s,formEncType:n.formEncType,formData:void 0,json:void 0,text:p}}}else if(n.formEncType==="application/json"){if(!he(o))return a();try{let p=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:o,formAction:s,formEncType:n.formEncType,formData:void 0,json:p,text:void 0}}}catch{return a()}}}M(typeof FormData=="function","FormData is not available in this environment");let l,u;if(n.formData)l=nr(n.formData),u=n.formData;else if(n.body instanceof FormData)l=nr(n.body),u=n.body;else if(n.body instanceof URLSearchParams)l=n.body,u=nn(l);else if(n.body==null)l=new URLSearchParams,u=new FormData;else try{l=new URLSearchParams(n.body),u=nn(l)}catch{return a()}let f={formMethod:o,formAction:s,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(he(f.formMethod))return{path:r,submission:f};let c=Ee(r);return t&&c.search&&ar(c.search)&&l.append("index",""),c.search="?"+l,{path:Ce(c),submission:f}}function go(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 Gr(e,t,r,n,a,i,o,s,l,u,f,c,p,w,g,E){let x=E?le(E[1])?E[1].error:E[1].data:void 0,_=e.createURL(t.location),L=e.createURL(a),D=E&&le(E[1])?E[0]:void 0,S=D?go(r,D):r,O=E?E[1].statusCode:void 0,k=o&&O&&O>=400,N=S.filter((T,z)=>{let{route:$}=T;if($.lazy)return!0;if($.loader==null)return!1;if(i)return typeof $.loader!="function"||$.loader.hydrate?!0:t.loaderData[$.id]===void 0&&(!t.errors||t.errors[$.id]===void 0);if(wo(t.loaderData,t.matches[z],T)||l.some(G=>G===T.route.id))return!0;let K=t.matches[z],ne=T;return Zr(T,X({currentUrl:_,currentParams:K.params,nextUrl:L,nextParams:ne.params},n,{actionResult:x,actionStatus:O,defaultShouldRevalidate:k?!1:s||_.pathname+_.search===L.pathname+L.search||_.search!==L.search||Qr(K,ne)}))}),y=[];return c.forEach((T,z)=>{if(i||!r.some(re=>re.route.id===T.routeId)||f.has(z))return;let $=ve(w,T.path,g);if(!$){y.push({key:z,routeId:T.routeId,path:T.path,matches:null,match:null,controller:null});return}let K=t.fetchers.get(z),ne=at($,T.path),G=!1;p.has(z)?G=!1:u.has(z)?(u.delete(z),G=!0):K&&K.state!=="idle"&&K.data===void 0?G=s:G=Zr(ne,X({currentUrl:_,currentParams:t.matches[t.matches.length-1].params,nextUrl:L,nextParams:r[r.length-1].params},n,{actionResult:x,actionStatus:O,defaultShouldRevalidate:k?!1:s})),G&&y.push({key:z,routeId:T.routeId,path:T.path,matches:$,match:ne,controller:new AbortController})}),[N,y]}function wo(e,t,r){let n=!t||r.route.id!==t.route.id,a=e[r.route.id]===void 0;return n||a}function Qr(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function Zr(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}async function bo(e,t,r,n,a,i,o,s){let l=[t,...r.map(u=>u.route.id)].join("-");try{let u=o.get(l);u||(u=e({path:t,matches:r,patch:(f,c)=>{s.aborted||en(f,c,n,a,i)}}),o.set(l,u)),u&&Do(u)&&await u}finally{o.delete(l)}}function en(e,t,r,n,a){if(e){var i;let o=n[e];M(o,"No route found to patch children into: routeId = "+e);let s=rt(t,a,[e,"patch",String(((i=o.children)==null?void 0:i.length)||"0")],n);o.children?o.children.push(...s):o.children=s}else{let o=rt(t,a,["patch",String(r.length||"0")],n);r.push(...o)}}async function tn(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let a=r[e.id];M(a,"No route found in manifest");let i={};for(let o in n){let s=a[o]!==void 0&&o!=="hasErrorBoundary";Be(!s,'Route "'+a.id+'" has a static property "'+o+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+o+'" will be ignored.')),!s&&!Fa.has(o)&&(i[o]=n[o])}Object.assign(a,i),Object.assign(a,X({},t(a),{lazy:void 0}))}function Eo(e){return Promise.all(e.matches.map(t=>t.resolve()))}async function So(e,t,r,n,a,i,o,s){let l=n.reduce((c,p)=>c.add(p.route.id),new Set),u=new Set,f=await e({matches:a.map(c=>{let p=l.has(c.route.id);return X({},c,{shouldLoad:p,resolve:w=>(u.add(c.route.id),p?xo(t,r,c,i,o,w,s):Promise.resolve({type:W.data,result:void 0}))})}),request:r,params:a[0].params,context:s});return a.forEach(c=>M(u.has(c.route.id),'`match.resolve()` was not called for route id "'+c.route.id+'". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.')),f.filter((c,p)=>l.has(a[p].route.id))}async function xo(e,t,r,n,a,i,o){let s,l,u=f=>{let c,p=new Promise((E,x)=>c=x);l=()=>c(),t.signal.addEventListener("abort",l);let w=E=>typeof f!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+r.route.id+"]"))):f({request:t,params:r.params,context:o},...E!==void 0?[E]:[]),g;return i?g=i(E=>w(E)):g=(async()=>{try{return{type:"data",result:await w()}}catch(E){return{type:"error",result:E}}})(),Promise.race([g,p])};try{let f=r.route[e];if(r.route.lazy)if(f){let c,[p]=await Promise.all([u(f).catch(w=>{c=w}),tn(r.route,a,n)]);if(c!==void 0)throw c;s=p}else if(await tn(r.route,a,n),f=r.route[e],f)s=await u(f);else if(e==="action"){let c=new URL(t.url),p=c.pathname+c.search;throw ae(405,{method:t.method,pathname:p,routeId:r.route.id})}else return{type:W.data,result:void 0};else if(f)s=await u(f);else{let c=new URL(t.url),p=c.pathname+c.search;throw ae(404,{pathname:p})}M(s.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(f){return{type:W.error,result:f}}finally{l&&t.signal.removeEventListener("abort",l)}return s}async function Ro(e){let{result:t,type:r}=e;if(fn(t)){let u;try{let f=t.headers.get("Content-Type");f&&/\bapplication\/json\b/.test(f)?t.body==null?u=null:u=await t.json():u=await t.text()}catch(f){return{type:W.error,error:f}}return r===W.error?{type:W.error,error:new Le(t.status,t.statusText,u),statusCode:t.status,headers:t.headers}:{type:W.data,data:u,statusCode:t.status,headers:t.headers}}if(r===W.error){if(dn(t)){var n;if(t.data instanceof Error){var a;return{type:W.error,error:t.data,statusCode:(a=t.init)==null?void 0:a.status}}t=new Le(((n=t.init)==null?void 0:n.status)||500,void 0,t.data)}return{type:W.error,error:t,statusCode:Ae(t)?t.status:void 0}}if(Po(t)){var i,o;return{type:W.deferred,deferredData:t,statusCode:(i=t.init)==null?void 0:i.status,headers:((o=t.init)==null?void 0:o.headers)&&new Headers(t.init.headers)}}if(dn(t)){var s,l;return{type:W.data,data:t.data,statusCode:(s=t.init)==null?void 0:s.status,headers:(l=t.init)!=null&&l.headers?new Headers(t.init.headers):void 0}}return{type:W.data,data:t}}function _o(e,t,r,n,a,i){let o=e.headers.get("Location");if(M(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!tr.test(o)){let s=n.slice(0,n.findIndex(l=>l.route.id===r)+1);o=rr(new URL(t.url),s,a,!0,o,i),e.headers.set("Location",o)}return e}function rn(e,t,r){if(tr.test(e)){let n=e,a=n.startsWith("//")?new URL(t.protocol+n):new URL(n),i=ue(a.pathname,r)!=null;if(a.origin===t.origin&&i)return a.pathname+a.search+a.hash}return e}function Je(e,t,r,n){let a=e.createURL(cn(t)).toString(),i={signal:r};if(n&&he(n.formMethod)){let{formMethod:o,formEncType:s}=n;i.method=o.toUpperCase(),s==="application/json"?(i.headers=new Headers({"Content-Type":s}),i.body=JSON.stringify(n.json)):s==="text/plain"?i.body=n.text:s==="application/x-www-form-urlencoded"&&n.formData?i.body=nr(n.formData):i.body=n.formData}return new Request(a,i)}function nr(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function nn(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function Lo(e,t,r,n,a,i){let o={},s=null,l,u=!1,f={},c=n&&le(n[1])?n[1].error:void 0;return r.forEach((p,w)=>{let g=t[w].route.id;if(M(!$e(p),"Cannot handle redirect results in processLoaderData"),le(p)){let E=p.error;c!==void 0&&(E=c,c=void 0),s=s||{};{let x=We(e,g);s[x.route.id]==null&&(s[x.route.id]=E)}o[g]=void 0,u||(u=!0,l=Ae(p.error)?p.error.status:500),p.headers&&(f[g]=p.headers)}else Ne(p)?(a.set(g,p.deferredData),o[g]=p.deferredData.data,p.statusCode!=null&&p.statusCode!==200&&!u&&(l=p.statusCode),p.headers&&(f[g]=p.headers)):(o[g]=p.data,p.statusCode&&p.statusCode!==200&&!u&&(l=p.statusCode),p.headers&&(f[g]=p.headers))}),c!==void 0&&n&&(s={[n[0]]:c},o[n[0]]=void 0),{loaderData:o,errors:s,statusCode:l||200,loaderHeaders:f}}function an(e,t,r,n,a,i,o,s){let{loaderData:l,errors:u}=Lo(t,r,n,a,s);for(let f=0;f<i.length;f++){let{key:c,match:p,controller:w}=i[f];M(o!==void 0&&o[f]!==void 0,"Did not find corresponding fetcher result");let g=o[f];if(!(w&&w.signal.aborted))if(le(g)){let E=We(e.matches,p==null?void 0:p.route.id);u&&u[E.route.id]||(u=X({},u,{[E.route.id]:g.error})),e.fetchers.delete(c)}else if($e(g))M(!1,"Unhandled fetcher revalidation redirect");else if(Ne(g))M(!1,"Unhandled fetcher deferred data");else{let E=Pe(g.data);e.fetchers.set(c,E)}}return{loaderData:l,errors:u}}function on(e,t,r,n){let a=X({},t);for(let i of r){let o=i.route.id;if(t.hasOwnProperty(o)?t[o]!==void 0&&(a[o]=t[o]):e[o]!==void 0&&i.route.loader&&(a[o]=e[o]),n&&n.hasOwnProperty(o))break}return a}function ln(e){return e?le(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function We(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function sn(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 ae(e,t){let{pathname:r,routeId:n,method:a,type:i,message:o}=t===void 0?{}:t,s="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(s="Bad Request",i==="route-discovery"?l='Unable to match URL "'+r+'" - the `unstable_patchRoutesOnNavigation()` '+(`function threw the following error:
`+o):a&&r&&n?l="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.":i==="defer-action"?l="defer() is not supported in actions":i==="invalid-body"&&(l="Unable to encode submission body")):e===403?(s="Forbidden",l='Route "'+n+'" does not match URL "'+r+'"'):e===404?(s="Not Found",l='No route matches URL "'+r+'"'):e===405&&(s="Method Not Allowed",a&&r&&n?l="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&&(l='Invalid request method "'+a.toUpperCase()+'"')),new Le(e||500,s,new Error(l),!0)}function un(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if($e(r))return{result:r,idx:t}}}function cn(e){let t=typeof e=="string"?Ee(e):e;return Ce(X({},t,{hash:""}))}function ko(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Do(e){return typeof e=="object"&&e!=null&&"then"in e}function Co(e){return fn(e.result)&&mo.has(e.result.status)}function Ne(e){return e.type===W.deferred}function le(e){return e.type===W.error}function $e(e){return(e&&e.type)===W.redirect}function dn(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Po(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 fn(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Oo(e){return ho.has(e.toLowerCase())}function he(e){return co.has(e.toLowerCase())}async function hn(e,t,r,n,a,i){for(let o=0;o<r.length;o++){let s=r[o],l=t[o];if(!l)continue;let u=e.find(c=>c.route.id===l.route.id),f=u!=null&&!Qr(u,l)&&(i&&i[l.route.id])!==void 0;if(Ne(s)&&(a||f)){let c=n[o];M(c,"Expected an AbortSignal for revalidating fetcher deferred result"),await mn(s,c,a).then(p=>{p&&(r[o]=p||r[o])})}}}async function mn(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:W.data,data:e.deferredData.unwrappedData}}catch(n){return{type:W.error,error:n}}return{type:W.data,data:e.deferredData.data}}}function ar(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function at(e,t){let r=typeof t=="string"?Ee(t).search:t.search;if(e[e.length-1].route.index&&ar(r||""))return e[e.length-1];let n=Wr(e);return n[n.length-1]}function pn(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:i,json:o}=e;if(!(!t||!r||!n)){if(a!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};if(i!=null)return{formMethod:t,formAction:r,formEncType:n,formData:i,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:o,text:void 0}}}function or(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 jo(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 ot(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 To(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 Pe(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 Mo(e,t){try{let r=e.sessionStorage.getItem(Yr);if(r){let n=JSON.parse(r);for(let[a,i]of Object.entries(n||{}))i&&Array.isArray(i)&&t.set(a,new Set(i||[]))}}catch{}}function Ao(e,t){if(t.size>0){let r={};for(let[n,a]of t)r[n]=[...a];try{e.sessionStorage.setItem(Yr,JSON.stringify(r))}catch(n){Be(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}function bt(){return bt=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},bt.apply(this,arguments)}const qe=d.createContext(null),it=d.createContext(null),Et=d.createContext(null),me=d.createContext(null),ir=d.createContext(null),we=d.createContext({outlet:null,matches:[],isDataRoute:!1}),yn=d.createContext(null);function lr(e,t){let{relative:r}=t===void 0?{}:t;lt()||M(!1);let{basename:n,navigator:a}=d.useContext(me),{hash:i,pathname:o,search:s}=st(e,{relative:r}),l=o;return n!=="/"&&(l=o==="/"?n:ge([n,o])),a.createHref({pathname:l,search:s,hash:i})}function lt(){return d.useContext(ir)!=null}fe=function(){return lt()||M(!1),d.useContext(ir).location};function vn(e){d.useContext(me).static||d.useLayoutEffect(e)}Yt=function(){let{isDataRoute:e}=d.useContext(we);return e?ei():Uo()};function Uo(){lt()||M(!1);let e=d.useContext(qe),{basename:t,future:r,navigator:n}=d.useContext(me),{matches:a}=d.useContext(we),{pathname:i}=fe(),o=JSON.stringify(Qt(a,r.v7_relativeSplatPath)),s=d.useRef(!1);return vn(()=>{s.current=!0}),d.useCallback(function(l,u){if(u===void 0&&(u={}),!s.current)return;if(typeof l=="number"){n.go(l);return}let f=Zt(l,JSON.parse(o),i,u.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:ge([t,f.pathname])),(u.replace?n.replace:n.push)(f,u.state,u)},[t,n,o,i,e])}const No=d.createContext(null);function $o(e){let t=d.useContext(we).outlet;return t&&d.createElement(No.Provider,{value:e},t)}function st(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=d.useContext(me),{matches:a}=d.useContext(we),{pathname:i}=fe(),o=JSON.stringify(Qt(a,n.v7_relativeSplatPath));return d.useMemo(()=>Zt(e,JSON.parse(o),i,r==="path"),[e,o,i,r])}function Io(e,t,r,n){lt()||M(!1);let{navigator:a}=d.useContext(me),{matches:i}=d.useContext(we),o=i[i.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=fe(),f;f=u;let c=f.pathname||"/",p=c;if(l!=="/"){let g=l.replace(/^\//,"").split("/");p="/"+c.replace(/^\//,"").split("/").slice(g.length).join("/")}let w=ve(e,{pathname:p});return Jo(w&&w.map(g=>Object.assign({},g,{params:Object.assign({},s,g.params),pathname:ge([l,a.encodeLocation?a.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?l:ge([l,a.encodeLocation?a.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),i,r,n)}function Fo(){let e=Xt(),t=Ae(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return d.createElement(d.Fragment,null,d.createElement("h2",null,"Unexpected Application Error!"),d.createElement("h3",{style:{fontStyle:"italic"}},t),r?d.createElement("pre",{style:n},r):null,null)}const zo=d.createElement(Fo,null);class Ho extends d.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?d.createElement(we.Provider,{value:this.props.routeContext},d.createElement(yn.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Bo(e){let{routeContext:t,match:r,children:n}=e,a=d.useContext(qe);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),d.createElement(we.Provider,{value:t},n)}function Jo(e,t,r,n){var a;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var i;if(!r)return null;if(r.errors)e=r.matches;else if((i=n)!=null&&i.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,s=(a=r)==null?void 0:a.errors;if(s!=null){let f=o.findIndex(c=>c.route.id&&(s==null?void 0:s[c.route.id])!==void 0);f>=0||M(!1),o=o.slice(0,Math.min(o.length,f+1))}let l=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let f=0;f<o.length;f++){let c=o[f];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(u=f),c.route.id){let{loaderData:p,errors:w}=r,g=c.route.loader&&p[c.route.id]===void 0&&(!w||w[c.route.id]===void 0);if(c.route.lazy||g){l=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((f,c,p)=>{let w,g=!1,E=null,x=null;r&&(w=s&&c.route.id?s[c.route.id]:void 0,E=c.route.errorElement||zo,l&&(u<0&&p===0?(g=!0,x=null):u===p&&(g=!0,x=c.route.hydrateFallbackElement||null)));let _=t.concat(o.slice(0,p+1)),L=()=>{let D;return w?D=E:g?D=x:c.route.Component?D=d.createElement(c.route.Component,null):c.route.element?D=c.route.element:D=f,d.createElement(Bo,{match:c,routeContext:{outlet:f,matches:_,isDataRoute:r!=null},children:D})};return r&&(c.route.ErrorBoundary||c.route.errorElement||p===0)?d.createElement(Ho,{location:r.location,revalidation:r.revalidation,component:E,error:w,children:L(),routeContext:{outlet:null,matches:_,isDataRoute:!0}}):L()},null)}var gn=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(gn||{}),ce=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}(ce||{});function Wo(e){let t=d.useContext(qe);return t||M(!1),t}function Ke(e){let t=d.useContext(it);return t||M(!1),t}function qo(e){let t=d.useContext(we);return t||M(!1),t}function ut(e){let t=qo(),r=t.matches[t.matches.length-1];return r.route.id||M(!1),r.route.id}function Ko(){return ut(ce.UseRouteId)}function Xo(){return Ke(ce.UseNavigation).navigation}Vt=function(){let{matches:e,loaderData:t}=Ke(ce.UseMatches);return d.useMemo(()=>e.map(r=>zr(r,t)),[e,t])};function Yo(){let e=Ke(ce.UseLoaderData),t=ut(ce.UseLoaderData);if(e.errors&&e.errors[t]!=null){console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")");return}return e.loaderData[t]}function Vo(e){return Ke(ce.UseRouteLoaderData).loaderData[e]}function Go(){let e=Ke(ce.UseActionData),t=ut(ce.UseLoaderData);return e.actionData?e.actionData[t]:void 0}Xt=function(){var e;let t=d.useContext(yn),r=Ke(ce.UseRouteError),n=ut(ce.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]};function Qo(){let e=d.useContext(Et);return e==null?void 0:e._data}function Zo(){let e=d.useContext(Et);return e==null?void 0:e._error}function ei(){let{router:e}=Wo(gn.UseNavigateStable),t=ut(ce.UseNavigateStable),r=d.useRef(!1);return vn(()=>{r.current=!0}),d.useCallback(function(n,a){a===void 0&&(a={}),r.current&&(typeof n=="number"?e.navigate(n):e.navigate(n,bt({fromRouteId:t},a)))},[e,t])}ga=function(e){return $o(e.context)};function ti(e){let{basename:t="/",children:r=null,location:n,navigationType:a=Q.Pop,navigator:i,static:o=!1,future:s}=e;lt()&&M(!1);let l=t.replace(/^\/*/,"/"),u=d.useMemo(()=>({basename:l,navigator:i,static:o,future:bt({v7_relativeSplatPath:!1},s)}),[l,s,i,o]);typeof n=="string"&&(n=Ee(n));let{pathname:f="/",search:c="",hash:p="",state:w=null,key:g="default"}=n,E=d.useMemo(()=>{let x=ue(f,l);return x==null?null:{location:{pathname:x,search:c,hash:p,state:w,key:g},navigationType:a}},[l,f,c,p,w,g,a]);return E==null?null:d.createElement(me.Provider,{value:u},d.createElement(ir.Provider,{children:r,value:E}))}function ri(e){let{children:t,errorElement:r,resolve:n}=e;return d.createElement(ai,{resolve:n,errorElement:r},d.createElement(oi,null,t))}var de=function(e){return e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error",e}(de||{});const ni=new Promise(()=>{});class ai extends d.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,i=de.pending;if(!(n instanceof Promise))i=de.success,a=Promise.resolve(),Object.defineProperty(a,"_tracked",{get:()=>!0}),Object.defineProperty(a,"_data",{get:()=>n});else if(this.state.error){i=de.error;let o=this.state.error;a=Promise.reject().catch(()=>{}),Object.defineProperty(a,"_tracked",{get:()=>!0}),Object.defineProperty(a,"_error",{get:()=>o})}else n._tracked?(a=n,i="_error"in a?de.error:"_data"in a?de.success:de.pending):(i=de.pending,Object.defineProperty(n,"_tracked",{get:()=>!0}),a=n.then(o=>Object.defineProperty(n,"_data",{get:()=>o}),o=>Object.defineProperty(n,"_error",{get:()=>o})));if(i===de.error&&a._error instanceof wt)throw ni;if(i===de.error&&!r)throw a._error;if(i===de.error)return d.createElement(Et.Provider,{value:a,children:r});if(i===de.success)return d.createElement(Et.Provider,{value:a,children:t});throw a}}function oi(e){let{children:t}=e,r=Qo(),n=typeof t=="function"?t(r):t;return d.createElement(d.Fragment,null,n)}_a=function(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:d.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:d.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:d.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t};function be(){return be=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},be.apply(this,arguments)}function sr(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}const St="get",ur="application/x-www-form-urlencoded";function xt(e){return e!=null&&typeof e.tagName=="string"}function ii(e){return xt(e)&&e.tagName.toLowerCase()==="button"}function li(e){return xt(e)&&e.tagName.toLowerCase()==="form"}function si(e){return xt(e)&&e.tagName.toLowerCase()==="input"}function ui(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ci(e,t){return e.button===0&&(!t||t==="_self")&&!ui(e)}function cr(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(a=>[r,a]):[[r,n]])},[]))}function di(e,t){let r=cr(e);return t&&t.forEach((n,a)=>{r.has(a)||t.getAll(a).forEach(i=>{r.append(a,i)})}),r}let Rt=null;function fi(){if(Rt===null)try{new FormData(document.createElement("form"),0),Rt=!1}catch{Rt=!0}return Rt}const hi=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function dr(e){return e!=null&&!hi.has(e)?null:e}function mi(e,t){let r,n,a,i,o;if(li(e)){let s=e.getAttribute("action");n=s?ue(s,t):null,r=e.getAttribute("method")||St,a=dr(e.getAttribute("enctype"))||ur,i=new FormData(e)}else if(ii(e)||si(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||s.getAttribute("action");if(n=l?ue(l,t):null,r=e.getAttribute("formmethod")||s.getAttribute("method")||St,a=dr(e.getAttribute("formenctype"))||dr(s.getAttribute("enctype"))||ur,i=new FormData(s,e),!fi()){let{name:u,type:f,value:c}=e;if(f==="image"){let p=u?u+".":"";i.append(p+"x","0"),i.append(p+"y","0")}else u&&i.append(u,c)}}else{if(xt(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=St,n=null,a=ur,o=e}return i&&a==="text/plain"&&(o=i,i=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:i,body:o}}const pi=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],yi=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],vi=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"],gi="6";try{window.__reactRouterVersion=gi}catch{}const wn=d.createContext({isTransitioning:!1}),bn=d.createContext(new Map),wi="startTransition",En=d[wi],bi="flushSync",Sn=us[bi],Ei="useId",xn=d[Ei];function Si(e){En?En(e):e()}function ct(e){Sn?Sn(e):e()}let xi=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",t(r))}})}};Oa=function(e){let{fallbackElement:t,router:r,future:n}=e,[a,i]=d.useState(r.state),[o,s]=d.useState(),[l,u]=d.useState({isTransitioning:!1}),[f,c]=d.useState(),[p,w]=d.useState(),[g,E]=d.useState(),x=d.useRef(new Map),{v7_startTransition:_}=n||{},L=d.useCallback(y=>{_?Si(y):y()},[_]),D=d.useCallback((y,T)=>{let{deletedFetchers:z,unstable_flushSync:$,unstable_viewTransitionOpts:K}=T;z.forEach(G=>x.current.delete(G)),y.fetchers.forEach((G,re)=>{G.data!==void 0&&x.current.set(re,G.data)});let ne=r.window==null||r.window.document==null||typeof r.window.document.startViewTransition!="function";if(!K||ne){$?ct(()=>i(y)):L(()=>i(y));return}if($){ct(()=>{p&&(f&&f.resolve(),p.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:K.currentLocation,nextLocation:K.nextLocation})});let G=r.window.document.startViewTransition(()=>{ct(()=>i(y))});G.finished.finally(()=>{ct(()=>{c(void 0),w(void 0),s(void 0),u({isTransitioning:!1})})}),ct(()=>w(G));return}p?(f&&f.resolve(),p.skipTransition(),E({state:y,currentLocation:K.currentLocation,nextLocation:K.nextLocation})):(s(y),u({isTransitioning:!0,flushSync:!1,currentLocation:K.currentLocation,nextLocation:K.nextLocation}))},[r.window,p,f,x,L]);d.useLayoutEffect(()=>r.subscribe(D),[r,D]),d.useEffect(()=>{l.isTransitioning&&!l.flushSync&&c(new xi)},[l]),d.useEffect(()=>{if(f&&o&&r.window){let y=o,T=f.promise,z=r.window.document.startViewTransition(async()=>{L(()=>i(y)),await T});z.finished.finally(()=>{c(void 0),w(void 0),s(void 0),u({isTransitioning:!1})}),w(z)}},[L,o,f,r.window]),d.useEffect(()=>{f&&o&&a.location.key===o.location.key&&f.resolve()},[f,p,a.location,o]),d.useEffect(()=>{!l.isTransitioning&&g&&(s(g.state),u({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),E(void 0))},[l.isTransitioning,g]),d.useEffect(()=>{},[]);let S=d.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:y=>r.navigate(y),push:(y,T,z)=>r.navigate(y,{state:T,preventScrollReset:z==null?void 0:z.preventScrollReset}),replace:(y,T,z)=>r.navigate(y,{replace:!0,state:T,preventScrollReset:z==null?void 0:z.preventScrollReset})}),[r]),O=r.basename||"/",k=d.useMemo(()=>({router:r,navigator:S,static:!1,basename:O}),[r,S,O]),N=d.useMemo(()=>({v7_relativeSplatPath:r.future.v7_relativeSplatPath}),[r.future.v7_relativeSplatPath]);return d.createElement(d.Fragment,null,d.createElement(qe.Provider,{value:k},d.createElement(it.Provider,{value:a},d.createElement(bn.Provider,{value:x.current},d.createElement(wn.Provider,{value:l},d.createElement(ti,{basename:O,location:a.location,navigationType:a.historyAction,navigator:S,future:N},a.initialized||r.future.v7_partialHydration?d.createElement(Ri,{routes:r.routes,future:r.future,state:a}):t))))),null)};const Ri=d.memo(_i);function _i(e){let{routes:t,future:r,state:n}=e;return Io(t,void 0,n,r)}const Li=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ki=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Rn=d.forwardRef(function(e,t){let{onClick:r,relative:n,reloadDocument:a,replace:i,state:o,target:s,to:l,preventScrollReset:u,unstable_viewTransition:f}=e,c=sr(e,pi),{basename:p}=d.useContext(me),w,g=!1;if(typeof l=="string"&&ki.test(l)&&(w=l,Li))try{let L=new URL(window.location.href),D=l.startsWith("//")?new URL(L.protocol+l):new URL(l),S=ue(D.pathname,p);D.origin===L.origin&&S!=null?l=S+D.search+D.hash:g=!0}catch{}let E=lr(l,{relative:n}),x=Ci(l,{replace:i,state:o,target:s,preventScrollReset:u,relative:n,unstable_viewTransition:f});function _(L){r&&r(L),L.defaultPrevented||x(L)}return d.createElement("a",be({},c,{href:w||E,onClick:g||a?r:_,ref:t,target:s}))}),Di=d.forwardRef(function(e,t){let{"aria-current":r="page",caseSensitive:n=!1,className:a="",end:i=!1,style:o,to:s,unstable_viewTransition:l,children:u}=e,f=sr(e,yi),c=st(s,{relative:f.relative}),p=fe(),w=d.useContext(it),{navigator:g,basename:E}=d.useContext(me),x=w!=null&&Ai(c)&&l===!0,_=g.encodeLocation?g.encodeLocation(c).pathname:c.pathname,L=p.pathname,D=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;n||(L=L.toLowerCase(),D=D?D.toLowerCase():null,_=_.toLowerCase()),D&&E&&(D=ue(D,E)||D);const S=_!=="/"&&_.endsWith("/")?_.length-1:_.length;let O=L===_||!i&&L.startsWith(_)&&L.charAt(S)==="/",k=D!=null&&(D===_||!i&&D.startsWith(_)&&D.charAt(_.length)==="/"),N={isActive:O,isPending:k,isTransitioning:x},y=O?r:void 0,T;typeof a=="function"?T=a(N):T=[a,O?"active":null,k?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let z=typeof o=="function"?o(N):o;return d.createElement(Rn,be({},f,{"aria-current":y,className:T,ref:t,style:z,to:s,unstable_viewTransition:l}),typeof u=="function"?u(N):u)}),_n=d.forwardRef((e,t)=>{let{fetcherKey:r,navigate:n,reloadDocument:a,replace:i,state:o,method:s=St,action:l,onSubmit:u,relative:f,preventScrollReset:c,unstable_viewTransition:p}=e,w=sr(e,vi),g=Dn(),E=ji(l,{relative:f}),x=s.toLowerCase()==="get"?"get":"post",_=L=>{if(u&&u(L),L.defaultPrevented)return;L.preventDefault();let D=L.nativeEvent.submitter,S=(D==null?void 0:D.getAttribute("formmethod"))||s;g(D||L.currentTarget,{fetcherKey:r,method:S,navigate:n,replace:i,state:o,relative:f,preventScrollReset:c,unstable_viewTransition:p})};return d.createElement("form",be({ref:t,method:x,action:E,onSubmit:a?u:_},w))});var Xe;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Xe||(Xe={}));var _t;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(_t||(_t={}));function Lt(e){let t=d.useContext(qe);return t||M(!1),t}function Ln(e){let t=d.useContext(it);return t||M(!1),t}function Ci(e,t){let{target:r,replace:n,state:a,preventScrollReset:i,relative:o,unstable_viewTransition:s}=t===void 0?{}:t,l=Yt(),u=fe(),f=st(e,{relative:o});return d.useCallback(c=>{if(ci(c,r)){c.preventDefault();let p=n!==void 0?n:Ce(u)===Ce(f);l(e,{replace:p,state:a,preventScrollReset:i,relative:o,unstable_viewTransition:s})}},[u,l,f,n,a,r,e,i,o,s])}ba=function(e){let t=d.useRef(cr(e)),r=d.useRef(!1),n=fe(),a=d.useMemo(()=>di(n.search,r.current?null:t.current),[n.search]),i=Yt(),o=d.useCallback((s,l)=>{const u=cr(typeof s=="function"?s(a):s);r.current=!0,i("?"+u,l)},[i,a]);return[a,o]};function Pi(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let Oi=0,kn=()=>"__"+String(++Oi)+"__";function Dn(){let{router:e}=Lt(Xe.UseSubmit),{basename:t}=d.useContext(me),r=Ko();return d.useCallback(function(n,a){a===void 0&&(a={}),Pi();let{action:i,method:o,encType:s,formData:l,body:u}=mi(n,t);if(a.navigate===!1){let f=a.fetcherKey||kn();e.fetch(f,r,a.action||i,{preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||o,formEncType:a.encType||s,unstable_flushSync:a.unstable_flushSync})}else e.navigate(a.action||i,{preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||o,formEncType:a.encType||s,replace:a.replace,state:a.state,fromRouteId:r,unstable_flushSync:a.unstable_flushSync,unstable_viewTransition:a.unstable_viewTransition})},[e,t,r])}function ji(e,t){let{relative:r}=t===void 0?{}:t,{basename:n}=d.useContext(me),a=d.useContext(we);a||M(!1);let[i]=a.matches.slice(-1),o=be({},st(e||".",{relative:r})),s=fe();if(e==null){o.search=s.search;let l=new URLSearchParams(o.search);l.has("index")&&l.get("index")===""&&(l.delete("index"),o.search=l.toString()?"?"+l.toString():"")}return(!e||e===".")&&i.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:ge([n,o.pathname])),Ce(o)}function Ti(e){var t;let{key:r}=e===void 0?{}:e,{router:n}=Lt(Xe.UseFetcher),a=Ln(_t.UseFetcher),i=d.useContext(bn),o=d.useContext(we),s=(t=o.matches[o.matches.length-1])==null?void 0:t.route.id;i||M(!1),o||M(!1),s==null&&M(!1);let l=xn?xn():"",[u,f]=d.useState(r||l);r&&r!==u?f(r):u||f(kn()),d.useEffect(()=>(n.getFetcher(u),()=>{n.deleteFetcher(u)}),[n,u]);let c=d.useCallback((_,L)=>{s||M(!1),n.fetch(u,s,_,L)},[u,s,n]),p=Dn(),w=d.useCallback((_,L)=>{p(_,be({},L,{navigate:!1,fetcherKey:u}))},[u,p]),g=d.useMemo(()=>d.forwardRef((_,L)=>d.createElement(_n,be({},_,{navigate:!1,fetcherKey:u,ref:L}))),[u]),E=a.fetchers.get(u)||Xr,x=i.get(u);return d.useMemo(()=>be({Form:g,submit:w,load:c},E,{data:x}),[g,w,c,E,x])}const Cn="react-router-scroll-positions";let kt={};ja=function(e){let{getKey:t,storageKey:r}=e===void 0?{}:e,{router:n}=Lt(Xe.UseScrollRestoration),{restoreScrollPosition:a,preventScrollReset:i}=Ln(_t.UseScrollRestoration),{basename:o}=d.useContext(me),s=fe(),l=Vt(),u=Xo();d.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),Mi(d.useCallback(()=>{if(u.state==="idle"){let f=(t?t(s,l):null)||s.key;kt[f]=window.scrollY}try{sessionStorage.setItem(r||Cn,JSON.stringify(kt))}catch{}window.history.scrollRestoration="auto"},[r,t,u.state,s,l])),typeof document<"u"&&(d.useLayoutEffect(()=>{try{let f=sessionStorage.getItem(r||Cn);f&&(kt=JSON.parse(f))}catch{}},[r]),d.useLayoutEffect(()=>{let f=t&&o!=="/"?(p,w)=>t(be({},p,{pathname:ue(p.pathname,o)||p.pathname}),w):t,c=n==null?void 0:n.enableScrollRestoration(kt,()=>window.scrollY,f);return()=>c&&c()},[n,o,t]),d.useLayoutEffect(()=>{if(a!==!1){if(typeof a=="number"){window.scrollTo(0,a);return}if(s.hash){let f=document.getElementById(decodeURIComponent(s.hash.slice(1)));if(f){f.scrollIntoView();return}}i!==!0&&window.scrollTo(0,0)}},[s,a,i]))};function Mi(e,t){let{capture:r}={};d.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,n),()=>{window.removeEventListener("pagehide",e,n)}},[e,r])}function Ai(e,t){t===void 0&&(t={});let r=d.useContext(wn);r==null&&M(!1);let{basename:n}=Lt(Xe.useViewTransitionState),a=st(e,{relative:t.relative});if(!r.isTransitioning)return!1;let i=ue(r.currentLocation.pathname,n)||r.currentLocation.pathname,o=ue(r.nextLocation.pathname,n)||r.nextLocation.pathname;return gt(a.pathname,o)!=null||gt(a.pathname,i)!=null}var Ui=-1,Ni=-2,$i=-3,Ii=-4,Fi=-5,zi=-6,Hi=-7,Bi="B",Ji="D",Pn="E",Wi="M",qi="N",On="P",Ki="R",Xi="S",Yi="Y",Vi="U",Gi="Z",jn=class{constructor(){qt(this,"promise");qt(this,"resolve");qt(this,"reject");this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}};function Qi(){const e=new TextDecoder;let t="";return new TransformStream({transform(r,n){const a=e.decode(r,{stream:!0}),i=(t+a).split(`
`);t=i.pop()||"";for(const o of i)n.enqueue(o)},flush(r){t&&r.enqueue(t)}})}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var fr=typeof window<"u"?window:typeof globalThis<"u"?globalThis:void 0;function hr(e){const{hydrated:t,values:r}=this;if(typeof e=="number")return Tn.call(this,e);if(!Array.isArray(e)||!e.length)throw new SyntaxError;const n=r.length;for(const a of e)r.push(a);return t.length=r.length,Tn.call(this,n)}function Tn(e){const{hydrated:t,values:r,deferred:n,plugins:a}=this;let i;const o=[[e,l=>{i=l}]];let s=[];for(;o.length>0;){const[l,u]=o.pop();switch(l){case Hi:u(void 0);continue;case Fi:u(null);continue;case Ni:u(NaN);continue;case zi:u(1/0);continue;case $i:u(-1/0);continue;case Ii:u(-0);continue}if(t[l]){u(t[l]);continue}const f=r[l];if(!f||typeof f!="object"){t[l]=f,u(f);continue}if(Array.isArray(f))if(typeof f[0]=="string"){const[c,p,w]=f;switch(c){case Ji:u(t[l]=new Date(p));continue;case Vi:u(t[l]=new URL(p));continue;case Bi:u(t[l]=BigInt(p));continue;case Ki:u(t[l]=new RegExp(p,w));continue;case Yi:u(t[l]=Symbol.for(p));continue;case Xi:const g=new Set;t[l]=g;for(let S=1;S<f.length;S++)o.push([f[S],O=>{g.add(O)}]);u(g);continue;case Wi:const E=new Map;t[l]=E;for(let S=1;S<f.length;S+=2){const O=[];o.push([f[S+1],k=>{O[1]=k}]),o.push([f[S],k=>{O[0]=k}]),s.push(()=>{E.set(O[0],O[1])})}u(E);continue;case qi:const x=Object.create(null);t[l]=x;for(const S of Object.keys(p).reverse()){const O=[];o.push([p[S],k=>{O[1]=k}]),o.push([Number(S.slice(1)),k=>{O[0]=k}]),s.push(()=>{x[O[0]]=O[1]})}u(x);continue;case On:if(t[p])u(t[l]=t[p]);else{const S=new jn;n[p]=S,u(t[l]=S.promise)}continue;case Pn:const[,_,L]=f;let D=L&&fr&&fr[L]?new fr[L](_):new Error(_);t[l]=D,u(D);continue;case Gi:u(t[l]=t[p]);continue;default:if(Array.isArray(a)){const S=[],O=f.slice(1);for(let k=0;k<O.length;k++){const N=O[k];o.push([N,y=>{S[k]=y}])}s.push(()=>{for(const k of a){const N=k(f[0],...S);if(N){u(t[l]=N.value);return}}throw new SyntaxError});continue}throw new SyntaxError}}else{const c=[];t[l]=c;for(let p=0;p<f.length;p++){const w=f[p];w!==Ui&&o.push([w,g=>{c[p]=g}])}u(c);continue}else{const c={};t[l]=c;for(const p of Object.keys(f).reverse()){const w=[];o.push([f[p],g=>{w[1]=g}]),o.push([Number(p.slice(1)),g=>{w[0]=g}]),s.push(()=>{c[w[0]]=w[1]})}u(c);continue}}for(;s.length>0;)s.pop()();return i}async function Zi(e,t){const{plugins:r}=t??{},n=new jn,a=e.pipeThrough(Qi()).getReader(),i={values:[],hydrated:[],deferred:{},plugins:r},o=await el.call(i,a);let s=n.promise;return o.done?n.resolve():s=tl.call(i,a).then(n.resolve).catch(l=>{for(const u of Object.values(i.deferred))u.reject(l);n.reject(l)}),{done:s.then(()=>a.closed),value:o.value}}async function el(e){const t=await e.read();if(!t.value)throw new SyntaxError;let r;try{r=JSON.parse(t.value)}catch{throw new SyntaxError}return{done:t.done,value:hr.call(this,r)}}async function tl(e){let t=await e.read();for(;!t.done;){if(!t.value)continue;const r=t.value;switch(r[0]){case On:{const n=r.indexOf(":"),a=Number(r.slice(1,n)),i=this.deferred[a];if(!i)throw new Error(`Deferred ID ${a} not found in stream`);const o=r.slice(n+1);let s;try{s=JSON.parse(o)}catch{throw new SyntaxError}const l=hr.call(this,s);i.resolve(l);break}case Pn:{const n=r.indexOf(":"),a=Number(r.slice(1,n)),i=this.deferred[a];if(!i)throw new Error(`Deferred ID ${a} not found in stream`);const o=r.slice(n+1);let s;try{s=JSON.parse(o)}catch{throw new SyntaxError}const l=hr.call(this,s);i.reject(l);break}default:throw new SyntaxError}t=await e.read()}}const Mn=Symbol("SingleFetchRedirect");V=function(){return V=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},V.apply(this,arguments)},ke=function(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)};async function An(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module).then(async n=>(await n.__tla,n));return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__remixContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function rl(e,t,r){let n=e.map(i=>{var o;let s=t[i.route.id],l=r.routes[i.route.id];return[l.css?l.css.map(u=>({rel:"stylesheet",href:u})):[],(s==null||(o=s.links)===null||o===void 0?void 0:o.call(s))||[]]}).flat(2),a=sl(e,r);return $n(n,a)}async function Un(e,t){var r,n;if(!e.css&&!t.links||!cl())return;let a=[((r=e.css)===null||r===void 0?void 0:r.map(s=>({rel:"stylesheet",href:s})))??[],((n=t.links)===null||n===void 0?void 0:n.call(t))??[]].flat(1);if(a.length===0)return;let i=[];for(let s of a)!mr(s)&&s.rel==="stylesheet"&&i.push({...s,rel:"preload",as:"style"});let o=i.filter(s=>(!s.media||window.matchMedia(s.media).matches)&&!document.querySelector(`link[rel="stylesheet"][href="${s.href}"]`));await Promise.all(o.map(nl))}async function nl(e){return new Promise(t=>{let r=document.createElement("link");Object.assign(r,e);function n(){document.head.contains(r)&&document.head.removeChild(r)}r.onload=()=>{n(),t()},r.onerror=()=>{n(),t()},document.head.appendChild(r)})}function mr(e){return e!=null&&typeof e.page=="string"}function al(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function ol(e,t,r){let n=await Promise.all(e.map(async a=>{let i=await An(t.routes[a.route.id],r);return i.links?i.links():[]}));return $n(n.flat(1).filter(al).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function Nn(e,t,r,n,a,i){let o=In(e),s=(u,f)=>r[f]?u.route.id!==r[f].route.id:!0,l=(u,f)=>{var c;return r[f].pathname!==u.pathname||((c=r[f].route.path)===null||c===void 0?void 0:c.endsWith("*"))&&r[f].params["*"]!==u.params["*"]};return i==="data"&&a.search!==o.search?t.filter((u,f)=>{if(!n.routes[u.route.id].hasLoader)return!1;if(s(u,f)||l(u,f))return!0;if(u.route.shouldRevalidate){var c;let p=u.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((c=r[0])===null||c===void 0?void 0:c.params)||{},nextUrl:new URL(e,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):t.filter((u,f)=>{let c=n.routes[u.route.id];return(i==="assets"||c.hasLoader)&&(s(u,f)||l(u,f))})}function il(e,t,r){let n=In(e);return pr(t.filter(a=>r.routes[a.route.id].hasLoader&&!r.routes[a.route.id].hasClientLoader).map(a=>{let{pathname:i,search:o}=n,s=new URLSearchParams(o);return s.set("_data",a.route.id),`${i}?${s}`}))}function ll(e,t){return pr(e.map(r=>{let n=t.routes[r.route.id],a=[n.module];return n.imports&&(a=a.concat(n.imports)),a}).flat(1))}function sl(e,t){return pr(e.map(r=>{let n=t.routes[r.route.id],a=[n.module];return n.imports&&(a=a.concat(n.imports)),a}).flat(1))}function pr(e){return[...new Set(e)]}function ul(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}function $n(e,t){let r=new Set,n=new Set(t);return e.reduce((a,i)=>{if(t&&!mr(i)&&i.as==="script"&&i.href&&n.has(i.href))return a;let o=JSON.stringify(ul(i));return r.has(o)||(r.add(o),a.push({key:o,link:i})),a},[])}function In(e){let t=Ee(e);return t.search===void 0&&(t.search=""),t}let Dt;function cl(){if(Dt!==void 0)return Dt;let e=document.createElement("link");return Dt=e.relList.supports("preload"),e=null,Dt}const dl={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},fl=/[&><\u2028\u2029]/g;function Ct(e){return e.replace(fl,t=>dl[t])}function Fn(e){return{__html:e}}function hl(e){return e.headers.get("X-Remix-Catch")!=null}function ml(e){return e.headers.get("X-Remix-Error")!=null}function pl(e){return yr(e)&&e.status>=400&&e.headers.get("X-Remix-Error")==null&&e.headers.get("X-Remix-Catch")==null&&e.headers.get("X-Remix-Response")==null}function yl(e){return e.headers.get("X-Remix-Redirect")!=null}function vl(e){var t;return!!((t=e.headers.get("Content-Type"))!==null&&t!==void 0&&t.match(/text\/remix-deferred/))}function yr(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function gl(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"}async function zn(e,t,r=0){let n=new URL(e.url);n.searchParams.set("_data",t),r>0&&await new Promise(s=>setTimeout(s,5**r*10));let a=await vr(e),i=window.__remixRevalidation,o=await fetch(n.href,a).catch(s=>{if(typeof i=="number"&&i===window.__remixRevalidation&&(s==null?void 0:s.name)==="TypeError"&&r<3)return zn(e,t,r+1);throw s});if(ml(o)){let s=await o.json(),l=new Error(s.message);return l.stack=s.stack,l}if(pl(o)){let s=await o.text(),l=new Error(s);return l.stack=void 0,l}return o}async function vr(e){let t={signal:e.signal};if(e.method!=="GET"){t.method=e.method;let r=e.headers.get("Content-Type");r&&/\bapplication\/json\b/.test(r)?(t.headers={"Content-Type":r},t.body=JSON.stringify(await e.json())):r&&/\btext\/plain\b/.test(r)?(t.headers={"Content-Type":r},t.body=await e.text()):r&&/\bapplication\/x-www-form-urlencoded\b/.test(r)?t.body=new URLSearchParams(await e.text()):t.body=await e.formData()}return t}const wl="__deferred_promise:";async function bl(e){if(!e)throw new Error("parseDeferredReadableStream requires stream argument");let t,r={};try{let n=El(e),a=(await n.next()).value;if(!a)throw new Error("no critical data");let i=JSON.parse(a);if(typeof i=="object"&&i!==null)for(let[o,s]of Object.entries(i))typeof s!="string"||!s.startsWith(wl)||(t=t||{},t[o]=new Promise((l,u)=>{r[o]={resolve:f=>{l(f),delete r[o]},reject:f=>{u(f),delete r[o]}}}));return(async()=>{try{for await(let o of n){let[s,...l]=o.split(":"),u=l.join(":"),f=JSON.parse(u);if(s==="data")for(let[c,p]of Object.entries(f))r[c]&&r[c].resolve(p);else if(s==="error")for(let[c,p]of Object.entries(f)){let w=new Error(p.message);w.stack=p.stack,r[c]&&r[c].reject(w)}}for(let[o,s]of Object.entries(r))s.reject(new wt(`Deferred ${o} will never be resolved`))}catch(o){for(let s of Object.values(r))s.reject(o)}})(),new lo({...i,...t})}catch(n){for(let a of Object.values(r))a.reject(n);throw n}}async function*El(e){let t=e.getReader(),r=[],n=[],a=!1,i=new TextEncoder,o=new TextDecoder,s=async()=>{if(n.length>0)return n.shift();for(;!a&&n.length===0;){let u=await t.read();if(u.done){a=!0;break}r.push(u.value);try{let f=o.decode(Hn(...r)).split(`

`);if(f.length>=2&&(n.push(...f.slice(0,-1)),r=[i.encode(f.slice(-1).join(`

`))]),n.length>0)break}catch{continue}}return n.length>0||r.length>0&&(n=o.decode(Hn(...r)).split(`

`).filter(u=>u),r=[]),n.shift()},l=await s();for(;l;)yield l,l=await s()}function Hn(...e){let t=new Uint8Array(e.reduce((n,a)=>n+a.length,0)),r=0;for(let n of e)t.set(n,r),r+=n.length;return t}La=function(e,t){return async({request:r,matches:n})=>r.method!=="GET"?Sl(r,n):xl(e,t,r,n)};function Sl(e,t){return Promise.all(t.map(async r=>{let n,a=await r.resolve(async i=>({type:"data",result:await i(async()=>{let o=gr(e.url),s=await vr(e),{data:l,status:u}=await wr(o,s);return n=u,br(l,r.route.id)})}));return yr(a.result)||Ae(a.result)?a:{type:a.type,result:io(a.result,n)}}))}function xl(e,t,r,n){let a;return Promise.all(n.map(async i=>i.resolve(async o=>{let s,l=Rl(gr(r.url)),u=await vr(r);return e.routes[i.route.id].hasClientLoader?s=await o(async()=>{l.searchParams.set("_routes",i.route.id);let{data:f}=await wr(l,u);return Jn(f,i.route.id)}):s=await o(async()=>{a||(l=Bn(e,t,n.map(c=>c.route),n.filter(c=>c.shouldLoad).map(c=>c.route),l),a=wr(l,u).then(({data:c})=>c));let f=await a;return Jn(f,i.route.id)}),{type:"data",result:s}})))}function Rl(e){let t=e.searchParams.getAll("index");e.searchParams.delete("index");let r=[];for(let n of t)n&&r.push(n);for(let n of r)e.searchParams.append("index",n);return e}function Bn(e,t,r,n,a){let i=l=>l.filter(u=>e.routes[u].hasLoader).join(",");if(!r.some(l=>{var u,f;return((u=t[l.id])===null||u===void 0?void 0:u.shouldRevalidate)||((f=e.routes[l.id])===null||f===void 0?void 0:f.hasClientLoader)}))return a;let o=i(r.map(l=>l.id)),s=i(n.filter(l=>{var u;return!((u=e.routes[l.id])!==null&&u!==void 0&&u.hasClientLoader)}).map(l=>l.id));return o!==s&&a.searchParams.set("_routes",s),a}function gr(e){let t=typeof e=="string"?new URL(e,window.location.origin):e;return t.pathname==="/"?t.pathname="_root.data":t.pathname=`${t.pathname.replace(/\/$/,"")}.data`,t}async function wr(e,t){let r=await fetch(e,t);ke(r.body,"No response body to decode");try{let n=await Ur(r.body,window);return{status:r.status,data:n.value}}catch(n){throw console.error(n),new Error(`Unable to decode turbo-stream response from URL: ${e.toString()}`)}}Ur=function(e,t){return Zi(e,{plugins:[(r,...n)=>{if(r==="SanitizedError"){let[a,i,o]=n,s=Error;a&&a in t&&typeof t[a]=="function"&&(s=t[a]);let l=new s(i);return l.stack=o,{value:l}}if(r==="ErrorResponse"){let[a,i,o]=n;return{value:new Le(i,o,a)}}if(r==="SingleFetchRedirect")return{value:{[Mn]:n[0]}}}]})};function Jn(e,t){let r=e[Mn];return r?br(r,t):e[t]!==void 0?br(e[t],t):null}function br(e,t){if("error"in e)throw e.error;if("redirect"in e){let r={};return e.revalidate&&(r["X-Remix-Revalidate"]="yes"),e.reload&&(r["X-Remix-Reload-Document"]="yes"),e.replace&&(r["X-Remix-Replace"]="yes"),qr(e.redirect,{status:e.status,headers:r})}else{if("data"in e)return e.data;throw new Error(`No response found for routeId "${t}"`)}}Pa=class extends d.Component{constructor(e){super(e),this.state={error:e.error||null,location:e.location}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:e.error||null,location:e.location}:{error:e.error||t.error,location:t.location}}render(){return this.state.error?d.createElement(Wn,{error:this.state.error,isOutsideRemixApp:!0}):this.props.children}};function Wn({error:e,isOutsideRemixApp:t}){console.error(e);let r=d.createElement("script",{dangerouslySetInnerHTML:{__html:`
        console.log(
          "\u{1F4BF} Hey developer \u{1F44B}. You can provide a way better UX than this when your app throws errors. Check out https://remix.run/guides/errors for more information."
        );
      `}});if(Ae(e))return d.createElement(Er,{title:"Unhandled Thrown Response!"},d.createElement("h1",{style:{fontSize:"24px"}},e.status," ",e.statusText),r);let n;if(e instanceof Error)n=e;else{let a=e==null?"Unknown Error":typeof e=="object"&&"toString"in e?e.toString():JSON.stringify(e);n=new Error(a)}return d.createElement(Er,{title:"Application Error!",isOutsideRemixApp:t},d.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),d.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},n.stack),r)}function Er({title:e,renderScripts:t,isOutsideRemixApp:r,children:n}){var a;let{routeModules:i}=Ue();return(a=i.root)!==null&&a!==void 0&&a.Layout&&!r?n:d.createElement("html",{lang:"en"},d.createElement("head",null,d.createElement("meta",{charSet:"utf-8"}),d.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),d.createElement("title",null,e)),d.createElement("body",null,d.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},n,t?d.createElement(Mr,null):null)))}function _l(){return d.createElement(Er,{title:"Loading...",renderScripts:!0},d.createElement("script",{dangerouslySetInnerHTML:{__html:`
              console.log(
                "\u{1F4BF} Hey developer \u{1F44B}. You can provide a way better UX than this " +
                "when your app is running \`clientLoader\` functions on hydration. " +
                "Check out https://remix.run/route/hydrate-fallback for more information."
              );
            `}}))}function qn(e){let t={};return Object.values(e).forEach(r=>{let n=r.parentId||"";t[n]||(t[n]=[]),t[n].push(r)}),t}function Ll(e,t,r){let n=Xn(t),a=t.HydrateFallback&&(!r||e.id==="root")?t.HydrateFallback:e.id==="root"?_l:void 0,i=t.ErrorBoundary?t.ErrorBoundary:e.id==="root"?()=>d.createElement(Wn,{error:Xt()}):void 0;return e.id==="root"&&t.Layout?{...n?{element:d.createElement(t.Layout,null,d.createElement(n,null))}:{Component:n},...i?{errorElement:d.createElement(t.Layout,null,d.createElement(i,null))}:{ErrorBoundary:i},...a?{hydrateFallbackElement:d.createElement(t.Layout,null,d.createElement(a,null))}:{HydrateFallback:a}}:{Component:n,ErrorBoundary:i,HydrateFallback:a}}Ea=function(e,t,r,n,a,i){return yt(t,r,n,a,i,"",qn(t),e)};function Pt(e,t,r){if(r){let a=`You cannot call ${e==="action"?"serverAction()":"serverLoader()"} in SPA Mode (routeId: "${t.id}")`;throw console.error(a),new Le(400,"Bad Request",new Error(a),!0)}let n=`You are trying to call ${e==="action"?"serverAction()":"serverLoader()"} on a route that does not have a server ${e} (routeId: "${t.id}")`;if(e==="loader"&&!t.hasLoader||e==="action"&&!t.hasAction)throw console.error(n),new Le(400,"Bad Request",new Error(n),!0)}function Sr(e,t){let r=e==="clientAction"?"a":"an",n=`Route "${t}" does not have ${r} ${e}, but you are trying to submit to it. To fix this, please add ${r} \`${e}\` function to the route`;throw console.error(n),new Le(405,"Method Not Allowed",new Error(n),!0)}yt=function(e,t,r,n,a,i="",o=qn(e),s){return(o[i]||[]).map(l=>{let u=t[l.id];async function f(D,S,O){if(typeof O=="function")return await O();let k=await Dl(D,l);return S?Cl(k):k}function c(D,S,O){return l.hasLoader?f(D,S,O):Promise.resolve(null)}function p(D,S,O){if(!l.hasAction)throw Sr("action",l.id);return f(D,S,O)}async function w(D){let S=t[l.id],O=S?Un(l,S):Promise.resolve();try{return D()}finally{await O}}let g={id:l.id,index:l.index,path:l.path};if(u){var E,x,_;Object.assign(g,{...g,...Ll(l,u,a),handle:u.handle,shouldRevalidate:s?Kn(l.id,u.shouldRevalidate,s):u.shouldRevalidate});let D=r==null||(E=r.loaderData)===null||E===void 0?void 0:E[l.id],S=r==null||(x=r.errors)===null||x===void 0?void 0:x[l.id],O=s==null&&(((_=u.clientLoader)===null||_===void 0?void 0:_.hydrate)===!0||!l.hasLoader);g.loader=async({request:k,params:N},y)=>{try{return await w(async()=>(ke(u,"No `routeModule` available for critical-route loader"),u.clientLoader?u.clientLoader({request:k,params:N,async serverLoader(){if(Pt("loader",l,a),O){if(S!==void 0)throw S;return D}return c(k,!0,y)}}):a?null:c(k,!1,y)))}finally{O=!1}},g.loader.hydrate=Nr(l,u,a),g.action=({request:k,params:N},y)=>w(async()=>{if(ke(u,"No `routeModule` available for critical-route action"),!u.clientAction){if(a)throw Sr("clientAction",l.id);return p(k,!1,y)}return u.clientAction({request:k,params:N,async serverAction(){return Pt("action",l,a),p(k,!0,y)}})})}else l.hasClientLoader||(g.loader=({request:D},S)=>w(()=>a?Promise.resolve(null):c(D,!1,S))),l.hasClientAction||(g.action=({request:D},S)=>w(()=>{if(a)throw Sr("clientAction",l.id);return p(D,!1,S)})),g.lazy=async()=>{let D=await kl(l,t),S={...D};if(D.clientLoader){let O=D.clientLoader;S.loader=(k,N)=>O({...k,async serverLoader(){return Pt("loader",l,a),c(k.request,!0,N)}})}if(D.clientAction){let O=D.clientAction;S.action=(k,N)=>O({...k,async serverAction(){return Pt("action",l,a),p(k.request,!0,N)}})}return s&&(S.shouldRevalidate=Kn(l.id,D.shouldRevalidate,s)),{...S.loader?{loader:S.loader}:{},...S.action?{action:S.action}:{},hasErrorBoundary:S.hasErrorBoundary,shouldRevalidate:S.shouldRevalidate,handle:S.handle,Component:S.Component,ErrorBoundary:S.ErrorBoundary}};let L=yt(e,t,r,n,a,l.id,o,s);return L.length>0&&(g.children=L),g})};function Kn(e,t,r){let n=!1;return a=>n?t?t(a):a.defaultShouldRevalidate:(n=!0,r.has(e))}async function kl(e,t){let r=await An(e,t);return await Un(e,r),{Component:Xn(r),ErrorBoundary:r.ErrorBoundary,clientAction:r.clientAction,clientLoader:r.clientLoader,handle:r.handle,links:r.links,meta:r.meta,shouldRevalidate:r.shouldRevalidate}}async function Dl(e,t){let r=await zn(e,t.id);if(r instanceof Error)throw r;if(yl(r))throw Pl(r);if(hl(r))throw r;return vl(r)&&r.body?await bl(r.body):r}function Cl(e){if(gl(e))return e.data;if(yr(e)){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.json():e.text()}return e}function Pl(e){let t=parseInt(e.headers.get("X-Remix-Status"),10)||302,r=e.headers.get("X-Remix-Redirect"),n={},a=e.headers.get("X-Remix-Revalidate");a&&(n["X-Remix-Revalidate"]=a);let i=e.headers.get("X-Remix-Reload-Document");i&&(n["X-Remix-Reload-Document"]=i);let o=e.headers.get("X-Remix-Replace");return o&&(n["X-Remix-Replace"]=o),qr(r,{status:t,headers:n})}function Xn(e){if(e.default!=null&&!(typeof e.default=="object"&&Object.keys(e.default).length===0))return e.default}Nr=function(e,t,r){return r&&e.id!=="root"||t.clientLoader!=null&&(t.clientLoader.hydrate===!0||e.hasLoader!==!0)};const Ot=new Set,Ol=1e3,jt=new Set,jl=7680;function xr(e,t){return e.unstable_lazyRouteDiscovery===!0&&!t}function Tl(e,t){let r=new Set(t.state.matches.map(o=>o.route.id)),n=t.state.location.pathname.split("/").filter(Boolean),a=["/"];for(n.pop();n.length>0;)a.push(`/${n.join("/")}`),n.pop();a.forEach(o=>{let s=ve(t.routes,o,t.basename);s&&s.forEach(l=>r.add(l.route.id))});let i=[...r].reduce((o,s)=>Object.assign(o,{[s]:e.routes[s]}),{});return{...e,routes:i}}ka=function(e,t,r,n,a){if(xr(r,n))return async({path:i,patch:o})=>{jt.has(i)||await Yn([i],e,t,r,n,a,o)}},Da=function(e,t,r,n,a){d.useEffect(()=>{var i;if(!xr(n,a)||((i=navigator.connection)===null||i===void 0?void 0:i.saveData)===!0)return;function o(c){let p=c.tagName==="FORM"?c.getAttribute("action"):c.getAttribute("href");if(!p)return;let w=new URL(p,window.location.origin);jt.has(w.pathname)||Ot.add(w.pathname)}async function s(){let c=Array.from(Ot.keys()).filter(p=>jt.has(p)?(Ot.delete(p),!1):!0);if(c.length!==0)try{await Yn(c,t,r,n,a,e.basename,e.patchRoutes)}catch(p){console.error("Failed to fetch manifest patches",p)}}document.body.querySelectorAll("a[data-discover], form[data-discover]").forEach(c=>o(c)),s();let l=Al(s,100);function u(c){return c.nodeType===Node.ELEMENT_NODE}let f=new MutationObserver(c=>{let p=new Set;c.forEach(w=>{[w.target,...w.addedNodes].forEach(g=>{u(g)&&((g.tagName==="A"&&g.getAttribute("data-discover")||g.tagName==="FORM"&&g.getAttribute("data-discover"))&&p.add(g),g.tagName!=="A"&&g.querySelectorAll("a[data-discover], form[data-discover]").forEach(E=>p.add(E)))})}),p.forEach(w=>o(w)),l()});return f.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["data-discover","href","action"]}),()=>f.disconnect()},[n,a,t,r,e])};async function Yn(e,t,r,n,a,i,o){let s=`${i??"/"}/__manifest`.replace(/\/+/g,"/"),l=new URL(s,window.location.origin);if(l.searchParams.set("version",t.version),e.forEach(g=>l.searchParams.append("p",g)),l.toString().length>jl){Ot.clear();return}let u=await fetch(l);if(u.ok){if(u.status>=400)throw new Error(await u.text())}else throw new Error(`${u.status} ${u.statusText}`);let f=await u.json(),c=new Set(Object.keys(t.routes)),p=Object.values(f).reduce((g,E)=>c.has(E.id)?g:Object.assign(g,{[E.id]:E}),{});Object.assign(t.routes,p),e.forEach(g=>Ml(g,jt));let w=new Set;Object.values(p).forEach(g=>{(!g.parentId||!p[g.parentId])&&w.add(g.parentId)}),w.forEach(g=>o(g||null,yt(p,r,null,n,a,g)))}function Ml(e,t){if(t.size>=Ol){let r=t.values().next().value;t.delete(r)}t.add(e)}function Al(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}}function Vn(){let e=d.useContext(qe);return ke(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Tt(){let e=d.useContext(it);return ke(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}Kt=d.createContext(void 0),Kt.displayName="Remix",Ue=function(){let e=d.useContext(Kt);return ke(e,"You must render this element inside a <Remix> element"),e};function Gn(e,t){let[r,n]=d.useState(!1),[a,i]=d.useState(!1),{onFocus:o,onBlur:s,onMouseEnter:l,onMouseLeave:u,onTouchStart:f}=t,c=d.useRef(null);d.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let g=x=>{x.forEach(_=>{i(_.isIntersecting)})},E=new IntersectionObserver(g,{threshold:.5});return c.current&&E.observe(c.current),()=>{E.disconnect()}}},[e]);let p=()=>{e==="intent"&&n(!0)},w=()=>{e==="intent"&&(n(!1),i(!1))};return d.useEffect(()=>{if(r){let g=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(g)}}},[r]),[a,c,{onFocus:dt(o,p),onBlur:dt(s,w),onMouseEnter:dt(l,p),onMouseLeave:dt(u,w),onTouchStart:dt(f,p)}]}const Rr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function _r(e,t,r){return e==="render"&&!t&&!r?"true":void 0}Tr=d.forwardRef(({to:e,prefetch:t="none",discover:r="render",...n},a)=>{let i=typeof e=="string"&&Rr.test(e),o=lr(e),[s,l,u]=Gn(t,n);return d.createElement(d.Fragment,null,d.createElement(Di,V({},n,u,{ref:Zn(a,l),to:e,"data-discover":_r(r,i,n.reloadDocument)})),s&&!i?d.createElement(kr,{page:o}):null)}),Tr.displayName="NavLink",Ar=d.forwardRef(({to:e,prefetch:t="none",discover:r="render",...n},a)=>{let i=typeof e=="string"&&Rr.test(e),o=lr(e),[s,l,u]=Gn(t,n);return d.createElement(d.Fragment,null,d.createElement(Rn,V({},n,u,{ref:Zn(a,l),to:e,"data-discover":_r(r,i,n.reloadDocument)})),s&&!i?d.createElement(kr,{page:o}):null)}),Ar.displayName="Link",jr=d.forwardRef(({discover:e="render",...t},r)=>{let n=typeof t.action=="string"&&Rr.test(t.action);return d.createElement(_n,V({},t,{ref:r,"data-discover":_r(e,n,t.reloadDocument)}))}),jr.displayName="Form";function dt(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Lr(e,t,r){if(r&&!Mt)return[e[0]];if(t){let n=e.findIndex(a=>t[a.route.id]!==void 0);return e.slice(0,n+1)}return e}ya=function(){let{isSpaMode:e,manifest:t,routeModules:r,criticalCss:n}=Ue(),{errors:a,matches:i}=Tt(),o=Lr(i,a,e),s=d.useMemo(()=>rl(o,r,t),[o,r,t]);return d.createElement(d.Fragment,null,n?d.createElement("style",{dangerouslySetInnerHTML:{__html:n}}):null,s.map(({key:l,link:u})=>mr(u)?d.createElement(kr,V({key:l},u)):d.createElement("link",V({key:l},u))))};function kr({page:e,...t}){let{router:r}=Vn(),n=d.useMemo(()=>ve(r.routes,e,r.basename),[r.routes,e,r.basename]);return n?d.createElement(Nl,V({page:e,matches:n},t)):(console.warn(`Tried to prefetch ${e} but no routes matched.`),null)}function Ul(e){let{manifest:t,routeModules:r}=Ue(),[n,a]=d.useState([]);return d.useEffect(()=>{let i=!1;return ol(e,t,r).then(o=>{i||a(o)}),()=>{i=!0}},[e,t,r]),n}function Nl({page:e,matches:t,...r}){let n=fe(),{future:a,manifest:i,routeModules:o}=Ue(),{matches:s}=Tt(),l=d.useMemo(()=>Nn(e,t,s,i,n,"data"),[e,t,s,i,n]),u=d.useMemo(()=>Nn(e,t,s,i,n,"assets"),[e,t,s,i,n]),f=d.useMemo(()=>il(e,l,i),[l,e,i]),c=d.useMemo(()=>ll(u,i),[u,i]),p=Ul(u),w=null;if(!a.unstable_singleFetch)w=f.map(g=>d.createElement("link",V({key:g,rel:"prefetch",as:"fetch",href:g},r)));else if(l.length>0){let g=Bn(i,o,t.map(E=>E.route),l.map(E=>E.route),gr(e));g.searchParams.get("_routes")!==""&&(w=d.createElement("link",V({key:g.pathname+g.search,rel:"prefetch",as:"fetch",href:g.pathname+g.search},r)))}return d.createElement(d.Fragment,null,w,c.map(g=>d.createElement("link",V({key:g,rel:"modulepreload",href:g},r))),p.map(({key:g,link:E})=>d.createElement("link",V({key:g},E))))}va=function(){let{isSpaMode:e,routeModules:t}=Ue(),{errors:r,matches:n,loaderData:a}=Tt(),i=fe(),o=Lr(n,r,e),s=null;r&&(s=r[o[o.length-1].route.id]);let l=[],u=null,f=[];for(let c=0;c<o.length;c++){let p=o[c],w=p.route.id,g=a[w],E=p.params,x=t[w],_=[],L={id:w,data:g,meta:[],params:p.params,pathname:p.pathname,handle:p.route.handle,error:s};if(f[c]=L,x!=null&&x.meta?_=typeof x.meta=="function"?x.meta({data:g,params:E,location:i,matches:f,error:s}):Array.isArray(x.meta)?[...x.meta]:x.meta:u&&(_=[...u]),_=_||[],!Array.isArray(_))throw new Error("The route at "+p.route.path+` returns an invalid value. All route meta functions must return an array of meta objects.

To reference the meta function API, see https://remix.run/route/meta`);L.meta=_,f[c]=L,l=[..._],u=l}return d.createElement(d.Fragment,null,l.flat().map(c=>{if(!c)return null;if("tagName"in c){let{tagName:p,...w}=c;if(!$l(p))return console.warn(`A meta object uses an invalid tagName: ${p}. Expected either 'link' or 'meta'`),null;let g=p;return d.createElement(g,V({key:JSON.stringify(w)},w))}if("title"in c)return d.createElement("title",{key:"title"},String(c.title));if("charset"in c&&(c.charSet??(c.charSet=c.charset),delete c.charset),"charSet"in c&&c.charSet!=null)return typeof c.charSet=="string"?d.createElement("meta",{key:"charSet",charSet:c.charSet}):null;if("script:ld+json"in c)try{let p=JSON.stringify(c["script:ld+json"]);return d.createElement("script",{key:`script:ld+json:${p}`,type:"application/ld+json",dangerouslySetInnerHTML:{__html:p}})}catch{return null}return d.createElement("meta",V({key:JSON.stringify(c)},c))}))};function $l(e){return typeof e=="string"&&/^(meta|link)$/.test(e)}function Il(e){return d.createElement(ri,e)}let Mt=!1;Mr=function(e){let{manifest:t,serverHandoffString:r,abortDelay:n,serializeError:a,isSpaMode:i,future:o,renderMeta:s}=Ue(),{router:l,static:u,staticContext:f}=Vn(),{matches:c}=Tt(),p=xr(o,i);s&&(s.didRenderScripts=!0);let w=Lr(c,null,i);d.useEffect(()=>{Mt=!0},[]);let g=(k,N)=>{let y;return a&&N instanceof Error?y=a(N):y=N,`${JSON.stringify(k)}:__remixContext.p(!1, ${Ct(JSON.stringify(y))})`},E=(k,N,y)=>{let T;try{T=JSON.stringify(y)}catch(z){return g(N,z)}return`${JSON.stringify(N)}:__remixContext.p(${Ct(T)})`},x=(k,N,y)=>{let T;return a&&y instanceof Error?T=a(y):T=y,`__remixContext.r(${JSON.stringify(k)}, ${JSON.stringify(N)}, !1, ${Ct(JSON.stringify(T))})`},_=(k,N,y)=>{let T;try{T=JSON.stringify(y)}catch(z){return x(k,N,z)}return`__remixContext.r(${JSON.stringify(k)}, ${JSON.stringify(N)}, ${Ct(T)})`},L=[],D=d.useMemo(()=>{var k;let N=o.unstable_singleFetch?"window.__remixContext.stream = new ReadableStream({start(controller){window.__remixContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());":"",y=f?`window.__remixContext = ${r};${N}`:" ",T=o.unstable_singleFetch||f==null?void 0:f.activeDeferreds;y+=T?["__remixContext.p = function(v,e,p,x) {","  if (typeof e !== 'undefined') {",`    x=new Error("Unexpected Server Error");
    x.stack=undefined;`,"    p=Promise.reject(x);","  } else {","    p=Promise.resolve(v);","  }","  return p;","};","__remixContext.n = function(i,k) {","  __remixContext.t = __remixContext.t || {};","  __remixContext.t[i] = __remixContext.t[i] || {};","  let p = new Promise((r, e) => {__remixContext.t[i][k] = {r:(v)=>{r(v);},e:(v)=>{e(v);}};});",typeof n=="number"?`setTimeout(() => {if(typeof p._error !== "undefined" || typeof p._data !== "undefined"){return;} __remixContext.t[i][k].e(new Error("Server timeout."))}, ${n});`:"","  return p;","};","__remixContext.r = function(i,k,v,e,p,x) {","  p = __remixContext.t[i][k];","  if (typeof e !== 'undefined') {",`    x=new Error("Unexpected Server Error");
    x.stack=undefined;`,"    p.e(x);","  } else {","    p.r(v);","  }","};"].join(`
`)+Object.entries(T).map(([$,K])=>{let ne=new Set(K.pendingKeys),G=K.deferredKeys.map(re=>{if(ne.has(re))return L.push(d.createElement(Qn,{key:`${$} | ${re}`,deferredData:K,routeId:$,dataKey:re,scriptProps:e,serializeData:_,serializeError:x})),`${JSON.stringify(re)}:__remixContext.n(${JSON.stringify($)}, ${JSON.stringify(re)})`;{let pe=K.data[re];return typeof pe._error<"u"?g(re,pe._error):E($,re,pe._data)}}).join(`,
`);return`Object.assign(__remixContext.state.loaderData[${JSON.stringify($)}], {${G}});`}).join(`
`)+(L.length>0?`__remixContext.a=${L.length};`:""):"";let z=u?`${(k=t.hmr)!==null&&k!==void 0&&k.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:""}${p?"":`import ${JSON.stringify(t.url)}`};
${w.map(($,K)=>`import * as route${K} from ${JSON.stringify(t.routes[$.route.id].module)};`).join(`
`)}
${p?`window.__remixManifest = ${JSON.stringify(Tl(t,l),null,2)};`:""}
window.__remixRouteModules = {${w.map(($,K)=>`${JSON.stringify($.route.id)}:route${K}`).join(",")}};

import(${JSON.stringify(t.entry.module)});`:" ";return d.createElement(d.Fragment,null,d.createElement("script",V({},e,{suppressHydrationWarning:!0,dangerouslySetInnerHTML:Fn(y),type:void 0})),d.createElement("script",V({},e,{suppressHydrationWarning:!0,dangerouslySetInnerHTML:Fn(z),type:"module",async:!0})))},[]);if(!u&&typeof __remixContext=="object"&&__remixContext.a)for(let k=0;k<__remixContext.a;k++)L.push(d.createElement(Qn,{key:k,scriptProps:e,serializeData:_,serializeError:x}));let S=w.map(k=>{let N=t.routes[k.route.id];return(N.imports||[]).concat([N.module])}).flat(1),O=Mt?[]:t.entry.imports.concat(S);return Mt?null:d.createElement(d.Fragment,null,p?null:d.createElement("link",{rel:"modulepreload",href:t.url,crossOrigin:e.crossOrigin}),d.createElement("link",{rel:"modulepreload",href:t.entry.module,crossOrigin:e.crossOrigin}),zl(O).map(k=>d.createElement("link",{key:k,rel:"modulepreload",href:k,crossOrigin:e.crossOrigin})),D,L)};function Qn({dataKey:e,deferredData:t,routeId:r,scriptProps:n,serializeData:a,serializeError:i}){return typeof document>"u"&&t&&e&&r&&ke(t.pendingKeys.includes(e),`Deferred data for route ${r} with key ${e} was not pending but tried to render a script for it.`),d.createElement(d.Suspense,{fallback:typeof document>"u"&&t&&e&&r?null:d.createElement("script",V({},n,{async:!0,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:" "}}))},typeof document>"u"&&t&&e&&r?d.createElement(Il,{resolve:t.data[e],errorElement:d.createElement(Fl,{dataKey:e,routeId:r,scriptProps:n,serializeError:i}),children:o=>d.createElement("script",V({},n,{async:!0,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:a(r,e,o)}}))}):d.createElement("script",V({},n,{async:!0,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:" "}})))}function Fl({dataKey:e,routeId:t,scriptProps:r,serializeError:n}){let a=Zo();return d.createElement("script",V({},r,{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:n(t,e,a)}}))}function zl(e){return[...new Set(e)]}wa=function(){return Vt()},Ca=function(){return Yo()},ha=function(e){return Vo(e)},ma=function(){return Go()},pa=function(e={}){return Ti(e)};function Zn(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}})();export{ha as A,ma as B,pa as C,Le as E,jr as F,ya as L,va as M,Tr as N,ga as O,Kt as R,Mr as S,V as _,cs as __tla,Xt as a,fe as b,Ar as c,wa as d,ba as e,Yt as f,Ea as g,ke as h,Ae as i,Sa as j,Ur as k,yt as l,ve as m,xa as n,Ra as o,_a as p,La as q,ka as r,Nr as s,Da as t,Ca as u,Pa as v,Oa as w,Ue as x,Vt as y,ja as z};
