1import{r as d}from"./index-DMDFfyop.js";var pa=e=>{throw TypeError(e)},Cn=(e,t,r)=>t.has(e)||pa("Cannot "+r),Ht=(e,t,r)=>(Cn(e,t,"read from private field"),r?r.call(e):t.get(e)),Mn=(e,t,r)=>t.has(e)?pa("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Hr="popstate";function Oi(e={}){function t(a,n){let{pathname:o,search:l,hash:s}=a.location;return ot("",{pathname:o,search:l,hash:s},n.state&&n.state.usr||null,n.state&&n.state.key||"default")}function r(a,n){return typeof n=="string"?n:Re(n)}return Tn(t,r,null,e)}function _(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function X(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Dn(){return Math.random().toString(36).substring(2,10)}function Br(e,t){return{usr:e.state,key:e.key,idx:t}}function ot(e,t,r=null,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Fe(t):t,state:r,key:t&&t.key||a||Dn()}}function Re({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Fe(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function Tn(e,t,r,a={}){let{window:n=document.defaultView,v5Compat:o=!1}=a,l=n.history,s="POP",i=null,u=h();u==null&&(u=0,l.replaceState({...l.state,idx:u},""));function h(){return(l.state||{idx:null}).idx}function f(){s="POP";let E=h(),R=E==null?null:E-u;u=E,i&&i({action:s,location:x.location,delta:R})}function p(E,R){s="PUSH";let b=ot(x.location,E,R);u=h()+1;let C=Br(b,u),M=x.createHref(b);try{l.pushState(C,"",M)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;n.location.assign(M)}o&&i&&i({action:s,location:x.location,delta:1})}function v(E,R){s="REPLACE";let b=ot(x.location,E,R);u=h();let C=Br(b,u),M=x.createHref(b);l.replaceState(C,"",M),o&&i&&i({action:s,location:x.location,delta:0})}function w(E){return ya(E)}let x={get action(){return s},get location(){return e(n,l)},listen(E){if(i)throw new Error("A history only accepts one active listener");return n.addEventListener(Hr,f),i=E,()=>{n.removeEventListener(Hr,f),i=null}},createHref(E){return t(n,E)},createURL:w,encodeLocation(E){let R=w(E);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:p,replace:v,go(E){return l.go(E)}};return x}function ya(e,t=!1){let r="http://localhost";
1typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),_(r,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:Re(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=r+a),new URL(a,r)}function ki(e){return{defaultValue:e}}var at,Wr=class{constructor(e){if(Mn(this,at,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(Ht(this,at).has(e))return Ht(this,at).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Ht(this,at).set(e,t)}};at=new WeakMap;var Fn=new Set(["lazy","caseSensitive","path","id","index","children"]);function On(e){return Fn.has(e)}var kn=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function Nn(e){return kn.has(e)}function In(e){return e.index===!0}function lt(e,t,r=[],a={},n=!1){return e.map((o,l)=>{let s=[...r,String(l)],i=typeof o.id=="string"?o.id:s.join("-");if(_(o.index!==!0||!o.children,"Cannot specify children on an index route"),_(n||!a[i],`Found a route id collision on i
1d "${i}". Route id's must be globally unique within Data Router usages`),In(o)){let u={...o,id:i};return a[i]=Vr(u,t(u)),u}else{let u={...o,id:i,children:void 0};return a[i]=Vr(u,t(u)),o.children&&(u.children=lt(o.children,t,s,a,n)),u}})}function Vr(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Ce(e,t,r="/"){return nt(e,t,r,!1)}function nt(e,t,r,a){let n=typeof t=="string"?Fe(t):t,o=oe(n.pathname||"/",r);if(o==null)return null;let l=ga(e);An(l);let s=null;for(let i=0;s==null&&i<l.length;++i){let u=Yn(o);s=Vn(l[i],u,a)}return s}function va(e,t){let{route:r,pathname:a,params:n}=e;return{id:r.id,pathname:a,params:n,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function ga(e,t=[],r=[],a="",n=!1){let o=(l,s,i=n,u)=>{let h={relativePath:u===void 0?l.path||"":u,caseSensitive:l.caseSensitive===!0,childrenIndex:s,route:l};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(a)&&i)return;_(h.relativePath.startsWith(a),`Absolute route path "${h.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(a.length)}let f=be([a,h.relativePath]),p=r.concat(h);l.children&&l.children.length>0&&(_(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),ga(l.children,t,p,f,i)),!(l.path==null&&!l.index)&&t.push({path:f,score:Bn(f,l.index),routesMeta:p})};return e.forEach((l,s)=>{if(l.path===""||!l.path?.includes("?"))o(l,s);else for(let i of wa(l.path))o(l,s,!0,i)}),t}function wa(e){let t=e.split("/");if(t.length===0)return[];let[r,...a]=t,n=r.endsWith("?"),o=r.replace(/\?$/,"");if(a.length===0)return n?[o,""]:[o];let l=wa(a.join("/")),s=[];return s.push(...l.map(i=>i===""?o:[o,i].join("/"))),n&&s.push(...l),s.map(i=>e.startsWith("/")&&i===""?"/":i)}function An(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Wn(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var $n=/^:[\w-]+$/,_n=3,jn=2,Un=1,zn=10,Hn=-2,Yr=e=>e==="*";function Bn(e,t){let r=e.split("/"),a=r.length;return r.some(Yr)&&(a+=Hn),t&&(a+=jn),r.filter(n=>!Yr(n)).reduce((n,o)=>n+($n.test(o)?_n:o===""?Un:zn),a)}function Wn(e,t){return e.length===t.length&&e.slice(0,-1).every((a,n)=>a===t[n])?e[e.length-1]-t[t.length-1]:0}function Vn(e,t,r=!1){let{routesMeta:a}=e,n={},o="/",l=[];for(let s=0;s<a.length;++s){let i=a[s],u=s===a.length-1,h=o==="/"?t:t.slice(o.length)||"/",f=Mt({path:i.relativePath,caseSensitive:i.caseSensitive,end:u},h),p=i.route;if(!f&&u&&r&&!a[a.length-1].route.index&&(f=Mt({path:i.relativePath,caseSensitive:i.caseSensitive,end:!1},h)),!f)return null;
1Object.assign(n,f.params),l.push({params:n,pathname:be([o,f.pathname]),pathnameBase:Gn(be([o,f.pathnameBase])),route:p}),f.pathnameBase!=="/"&&(o=be([o,f.pathnameBase]))}return l}function Mt(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=Ea(e.path,e.caseSensitive,e.end),n=t.match(r);if(!n)return null;let o=n[0],l=o.replace(/(.)\/+$/,"$1"),s=n.slice(1);return{params:a.reduce((u,{paramName:h,isOptional:f},p)=>{if(h==="*"){let w=s[p]||"";l=o.slice(0,o.length-w.length).replace(/(.)\/+$/,"$1")}const v=s[p];return f&&!v?u[h]=void 0:u[h]=(v||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:l,pattern:e}}function Ea(e,t=!1,r=!0){X(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,s,i)=>(a.push({paramName:s,isOptional:i!=null}),i?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),n+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":e!==""&&e!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,t?void 0:"i"),a]}function Yn(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return X(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function oe(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}function Jn({basename:e,pathname:t}){return t==="/"?e:be([e,t])}var Kn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ot=e=>Kn.test(e);function Xn(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?Fe(e):e,o;if(r)if(Ot(r))o=r;else{if(r.includes("//")){let l=r;r=r.replace(/\/\/+/g,"/"),X(!1,`Pathnames cannot have embedded double slashes - normalizing ${l} -> ${r}`)}r.startsWith("/")?o=Jr(r.substring(1),"/"):o=Jr(r,t)}else o=t;return{pathname:o,search:Qn(a),hash:qn(n)}}function Jr(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 Bt(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function ba(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function sr(e){let t=ba(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function ur(e,t,r,a=!1){let n;typeof e=="string"?n=Fe(e):(n={...e},_(!n.pathname||!n.pathname.includes("?"),Bt("?","pathname","search",n)),_(!n.pathname||!n.pathname.includes("#"),Bt("#","pathname","hash",n)),_(!n.search||!n.search.includes("#"),Bt("#","search","hash",n)));let o=e===""||n.pathname==="",l=o?"/":n.pathname,s;if(l==null)s=r;else{let f=t.length-1;if(!a&&l.startsWith("..")){let p=l.split("/");for(;p[0]==="..";)p.shift(),f-=1;n.pathname=p.join("/")}s=f>=0?t[f]:"/"}let i=Xn(n,s),u=l&&l!=="/"&&l.endsWith("/"),h=(o||l===".")&&r.endsWith("/");return!i.pathname.endsWith("/")&&(u||h)&&(i.pathname+="/"),i}var be=e=>e.join("/").replace(/\/\/+/g,"/"),Gn=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Qn=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,qn=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Zn=class{constructor(e,t){this.type="DataWithResponseInit",this.data=e,this.init=t||null}};function eo(e,t){return new Zn(e,typeof t=="number"?{status:t}:t)}var Ra=(e,t=302)=>{let r=t;typeof r=="number"?r={status:r}:typeof r.status>"u"&&(r.status=302);let a=new Headers(r.headers);return a.set("Location",e),new Response(null,{...r,headers:a})},Ni=(e,t)=>{let r=Ra(e,t);return r.headers.set("X-Remix-Replace","true"),r},je=class{constructor(e,t,r,a=!1){this.status=e,this.statusText=t||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Ue(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function cr(e){return e.filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Te=Symbol("Uninstrumented");function to(e,t){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(n=>n({id:t.id,index:t.index,path:t.path,instrument(o){let l=Object.keys(r);for(let s of l)o[s]&&r[s].push(o[s])}}));let a={};if(typeof t.lazy=="function"&&r.lazy.length>0){let n=Je(r.lazy,t.lazy,()=>{});n&&(a.lazy=n)}if(typeof t.lazy=="object"){let n=t.lazy;["middleware","loader","action"].forEach(o=>{let l=n[o],s=r[`lazy.${o}`];if(typeof l=="function"&&s.length>0){let i=Je(s,l,()=>{});i&&(a.lazy=Object.assign(a.lazy||{},{[o]:i}))}})}return["loader","action"].forEach(n=>{let o=t[n];if(typeof o=="function"&&r[n].length>0){let l=o[Te]??o,s=Je(r[n],l,(...i)=>Kr(i[0]));s&&(s[Te]=l,a[n]=s)}}),t.middleware&&t.middleware.length>0&&r.middleware.length>0&&(a.middleware=t.middleware.map(n=>{let o=n[Te]??n,l=Je(r.middleware,o,(...s)=>Kr(s[0]));return l?(l[Te]=o,l):n})),a}function ro(e,t){let r={navigate:[],fetch:[]};if(t.forEach(a=>a({instrument(n){let o=Object.keys(n);for(let l of o)n[l]&&r[l].push(n[l])}})),r.navigate.length>
10){let a=e.navigate[Te]??e.navigate,n=Je(r.navigate,a,(...o)=>{let[l,s]=o;return{to:typeof l=="number"||typeof l=="string"?l:l?Re(l):".",...Xr(e,s??{})}});n&&(n[Te]=a,e.navigate=n)}if(r.fetch.length>0){let a=e.fetch[Te]??e.fetch,n=Je(r.fetch,a,(...o)=>{let[l,,s,i]=o;return{href:s??".",fetcherKey:l,...Xr(e,i??{})}});n&&(n[Te]=a,e.fetch=n)}return e}function Je(e,t,r){return e.length===0?null:async(...a)=>{let n=await Sa(e,r(...a),()=>t(...a),e.length-1);if(n.type==="error")throw n.value;return n.value}}async function Sa(e,t,r,a){let n=e[a],o;if(n){let l,s=async()=>(l?console.error("You cannot call instrumented handlers more than once"):l=Sa(e,t,r,a-1),o=await l,_(o,"Expected a result"),o.type==="error"&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0});try{await n(s,t)}catch(i){console.error("An instrumentation function threw an error:",i)}l||await s(),await l}else try{o={type:"success",value:await r()}}catch(l){o={type:"error",value:l}}return o||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Kr(e){let{request:t,context:r,params:a,unstable_pattern:n}=e;return{request:ao(t),params:{...a},unstable_pattern:n,context:no(r)}}function Xr(e,t){return{currentUrl:Re(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function ao(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function no(e){if(lo(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var oo=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function lo(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===oo}var xa=["POST","PUT","PATCH","DELETE"],io=new Set(xa),so=["GET",...xa],uo=new Set(so),co=new Set([301,302,303,307,308]),fo=new Set([307,308]),Wt={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},La={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ve={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ho=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Pa="remix-router-transitions",Ca=Symbol("ResetLoaderData");function Ii(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";_(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a=e.hydrationRouteProperties||[],n=e.mapRouteProperties||ho,o=n;if(e.unstable_instrumentations){let c=e.unstable_instrumentations;o=m=>({...n(m),...to(c.map(g=>g.route).filter(Boolean),m)})}let l={},s=lt(e.routes,o,void 0,l),i,u=e.basename||"/";u.startsWith("/")||(u=`/${u}`);let h=e.dataStrategy||go,f={...e.future},p=null,v=new Set,w=null,x=null,E=null,R=e.hydrationData!=null,b=Ce(s,e.history.location,u),C=!1,M=null,L;if(b==null&&!e.patchRoutesOnNavigation){let c=fe(404,{pathname:e.history.location.pathname}),{matches:m,route:g}=gt(s);L=!0,b=m,M={[g.id]:c}}else if(b&&!e.hydrationData&&ht(b,s,e.history.location.pathname).active&&(b=null),b)if(b.some(c=>c.route.lazy))L=!1;else if(!b.some(c=>
1dr(c.route)))L=!0;else{let c=e.hydrationData?e.hydrationData.loaderData:null,m=e.hydrationData?e.hydrationData.errors:null;if(m){let g=b.findIndex(S=>m[S.route.id]!==void 0);L=b.slice(0,g+1).every(S=>!Qt(S.route,c,m))}else L=b.every(g=>!Qt(g.route,c,m))}else{L=!1,b=[];let c=ht(null,s,e.history.location.pathname);c.active&&c.matches&&(C=!0,b=c.matches)}let T,y={historyAction:e.history.action,location:e.history.location,matches:b,initialized:L,navigation:Wt,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||M,fetchers:new Map,blockers:new Map},$="POP",H=!1,j,G=!1,ue=new Map,pe=null,B=!1,V=!1,ee=new Set,W=new Map,ce=0,le=-1,ye=new Map,ie=new Set,de=new Map,ge=new Map,we=new Set,Oe=new Map,dt,Qe=null;function un(){if(p=e.history.listen(({action:c,location:m,delta:g})=>{if(dt){dt(),dt=void 0;return}X(Oe.size===0||g!=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 S=$r({currentLocation:y.location,nextLocation:m,historyAction:c});if(S&&g!=null){let P=new Promise(F=>{dt=F});e.history.go(g*-1),ft(S,{state:"blocked",location:m,proceed(){ft(S,{state:"proceeding",proceed:void 0,reset:void 0,location:m}),P.then(()=>e.history.go(g))},reset(){let F=new Map(y.blockers);F.set(S,Ve),te({blockers:F})}});return}return ke(c,m)}),r){ko(t,ue);let c=()=>No(t,ue);t.addEventListener("pagehide",c),pe=()=>t.removeEventListener("pagehide",c)}return y.initialized||ke("POP",y.location,{initialHydration:!0}),T}function cn(){p&&p(),pe&&pe(),v.clear(),j&&j.abort(),y.fetchers.forEach((c,m)=>jt(m)),y.blockers.forEach((c,m)=>Ar(m))}function dn(c){return v.add(c),()=>v.delete(c)}function te(c,m={}){c.matches&&(c.matches=c.matches.map(P=>{let F=l[P.route.id],O=P.route;return O.element!==F.element||O.errorElement!==F.errorElement||O.hydrateFallbackElement!==F.hydrateFallbackElement?{...P,route:F}:P})),y={...y,...c};let g=[],S=[];y.fetchers.forEach((P,F)=>{P.state==="idle"&&(we.has(F)?g.push(F):S.push(F))}),we.forEach(P=>{!y.fetchers.has(P)&&!W.has(P)&&g.push(P)}),[...v].forEach(P=>P(y,{deletedFetchers:g,viewTransitionOpts:m.viewTransitionOpts,flushSync:m.flushSync===!0})),g.forEach(P=>jt(P)),S.forEach(P=>y.fetchers.delete(P))}function Be(c,m,{flushSync:g}={}){let S=y.actionData!=null&&y.navigation.formMethod!=null&&ae(y.navigation.formMethod)&&y.navigation.state==="loading"&&c.state?._isRedirect!==!0,P;m.actionData?Object.keys(m.actionData).length>0?P=m.actionData:P=null:S?P=y.actionData:P=null;let F=m.loaderData?oa(y.loaderData,m.loaderData,m.matches||[],m.errors):y.loaderData,O=y.blockers;O.size>0&&(O=new Map(O),O.forEach((N,I)=>O.set(I,Ve)));let D=B?!1:jr(c,m.matches||y.matches),k=H===!0||y.navigation.formMethod!=null&&ae(y.navigation.formMethod)&&c.state?._isRedirect!==!0;i&&(s=i,i=void 0),B||$==="POP"||($==="PUSH"?e.history.push(c,c.state):$==="REPLACE"&&e.history.replace(c,c.state));let A;if($==="POP"){let N=ue.get(y.location.pathname);N&&N.has(c.pathname)?A={currentLocation:y.location,nextLocation:c}:ue.has(c.pathname)&&(A={currentLocation:c,nextLocation:y.location})}else if(G){let N=ue.get(y.location.pathname);N?N.add(c.pathname):(N=new Set([c.pathname]),ue.set(y.location.pathname,N)),A={currentLocation:y.location,nextLocation:c}}te({...m,actionData:P,loaderData:F,historyAction:$,location:c,initialized:!0,navigation:Wt,revalidation:"idle",restoreScrollPosition:D,preventScrollReset:k,blockers:O},{viewTransitionOpts:A,flushSync:g===!0}),$="POP",H=!1,G=!1,B=!1,V=!1,Qe?.resolve(),Qe=null}async function Dr(c,m){if(typeof c=="number"){e.history.go(c);return}let g=Gt(y.location,y.matches,u,c,m?.fromRouteId,m?.relative),{path:S,submission:P,error:F}=Gr(!1,g,m),O=y.location,D=ot(y.location,S,m&&m.state);D={...D,...e.history.encodeLocation(D)};let k=m&&m.replace!=null?m.replace:void 0,A="PUSH";k===!0?A="REPLACE":k===!1||P!=null&&ae(P.formMethod)&&P.formAction===y.location.pathname+y.location.search&&(A="REPLACE");let N=m&&"preventScrollReset"in m?m.preventScrollReset===!0:void 0,I=(m&&m.flushSync)===!0,U=$r({currentLocation:O,nextLocation:D,historyAction:A});if(U){ft(U,{state:"blocked",location:D,proceed(){ft(U,{state:"proceeding",proceed:void 0,reset:void 0,location:D}),Dr(c,m)},reset(){let K=new Map(y.blockers);K.set(U,Ve),te({blockers:K})}});return}await ke(A,D,{submission:P,pendingError:F,preventScrollReset:N,replace:m&&m.replace,enableViewTransition:m&&m.viewTransition,flushSync:I})}function fn(){Qe||(Qe=Io()),_t(),te({revalidation:"loading"});let c=Qe.promise;return y.navigation.state==="submitting"?c:y.navigation.state==="idle"?(ke(y.historyAction,y.location,{startUninterruptedRevalidation:!0}
1),c):(ke($||y.historyAction,y.navigation.location,{overrideNavigation:y.navigation,enableViewTransition:G===!0}),c)}async function ke(c,m,g){j&&j.abort(),j=null,$=c,B=(g&&g.startUninterruptedRevalidation)===!0,Sn(y.location,y.matches),H=(g&&g.preventScrollReset)===!0,G=(g&&g.enableViewTransition)===!0;let S=i||s,P=g&&g.overrideNavigation,F=g?.initialHydration&&y.matches&&y.matches.length>0&&!C?y.matches:Ce(S,m,u),O=(g&&g.flushSync)===!0;if(F&&y.initialized&&!V&&Po(y.location,m)&&!(g&&g.submission&&ae(g.submission.formMethod))){Be(m,{matches:F},{flushSync:O});return}let D=ht(F,S,m.pathname);if(D.active&&D.matches&&(F=D.matches),!F){let{error:Z,notFoundMatches:Y,route:J}=Ut(m.pathname);Be(m,{matches:Y,loaderData:{},errors:{[J.id]:Z}},{flushSync:O});return}j=new AbortController;let k=Ye(e.history,m,j.signal,g&&g.submission),A=e.getContext?await e.getContext():new Wr,N;if(g&&g.pendingError)N=[De(F).route.id,{type:"error",error:g.pendingError}];else if(g&&g.submission&&ae(g.submission.formMethod)){let Z=await hn(k,m,g.submission,F,A,D.active,g&&g.initialHydration===!0,{replace:g.replace,flushSync:O});if(Z.shortCircuited)return;if(Z.pendingActionResult){let[Y,J]=Z.pendingActionResult;if(se(J)&&Ue(J.error)&&J.error.status===404){j=null,Be(m,{matches:Z.matches,loaderData:{},errors:{[Y]:J.error}});return}}F=Z.matches||F,N=Z.pendingActionResult,P=Vt(m,g.submission),O=!1,D.active=!1,k=Ye(e.history,k.url,k.signal)}let{shortCircuited:I,matches:U,loaderData:K,errors:q}=await mn(k,m,F,A,D.active,P,g&&g.submission,g&&g.fetcherSubmission,g&&g.replace,g&&g.initialHydration===!0,O,N);I||(j=null,Be(m,{matches:U||F,...la(N),loaderData:K,errors:q}))}async function hn(c,m,g,S,P,F,O,D={}){_t();let k=Fo(m,g);if(te({navigation:k},{flushSync:D.flushSync===!0}),F){let I=await mt(S,m.pathname,c.signal);if(I.type==="aborted")return{shortCircuited:!0};if(I.type==="error"){if(I.partialMatches.length===0){let{matches:K,route:q}=gt(s);return{matches:K,pendingActionResult:[q.id,{type:"error",error:I.error}]}}let U=De(I.partialMatches).route.id;return{matches:I.partialMatches,pendingActionResult:[U,{type:"error",error:I.error}]}}else if(I.matches)S=I.matches;else{let{notFoundMatches:U,error:K,route:q}=Ut(m.pathname);return{matches:U,pendingActionResult:[q.id,{type:"error",error:K}]}}}let A,N=xt(S,m);if(!N.route.action&&!N.route.lazy)A={type:"error",error:fe(405,{method:c.method,pathname:m.pathname,routeId:N.route.id})};else{let I=Ke(o,l,c,S,N,O?[]:a,P),U=await qe(c,I,P,null);if(A=U[N.route.id],!A){for(let K of S)if(U[K.route.id]){A=U[K.route.id];break}}if(c.signal.aborted)return{shortCircuited:!0}}if(_e(A)){let I;return D&&D.replace!=null?I=D.replace:I=ra(A.response.headers.get("Location"),new URL(c.url),u)===y.location.pathname+y.location.search,await Ne(c,A,!0,{submission:g,replace:I}),{shortCircuited:!0}}if(se(A)){let I=De(S,N.route.id);return(D&&D.replace)!==!0&&($="PUSH"),{matches:S,pendingActionResult:[I.route.id,A,N.route.id]}}return{matches:S,pendingActionResult:[N.route.id,A]}}async function mn(c,m,g,S,P,F,O,D,k,A,N,I){let U=F||Vt(m,O),K=O||D||ia(U),q=!B&&!A;if(P){if(q){let re=Tr(I);te({navigation:U,...re!==void 0?{actionData:re}:{}},{flushSync:N})}let z=await mt(g,m.pathname,c.signal);if(z.type==="aborted")return{shortCircuited:!0};if(z.type==="error"){if(z.partialMatches.length===0){let{matches:We,route:$e}=gt(s);return{matches:We,loaderData:{},errors:{[$e.id]:z.error}}}let re=De(z.partialMatches).route.id;return{matches:z.partialMatches,loaderData:{},errors:{[re]:z.error}}}else if(z.matches)g=z.matches;else{let{error:re,notFoundMatches:We,route:$e}=Ut(m.pathname);return{matches:We,loaderData:{},errors:{[$e.id]:re}}}}let Z=i||s,{dsMatches:Y,revalidatingFetchers:J}=Qr(c,S,o,l,e.history,y,g,K,m,A?[]:a,A===!0,V,ee,we,de,ie,Z,u,e.patchRoutesOnNavigation!=null,I);if(le=++ce,!e.dataStrategy&&!Y.some(z=>z.shouldLoad)&&!Y.some(z=>z.route.middleware&&z.route.middleware.length>0)&&J.length===0){let z=Nr();return Be(m,{matches:g,loaderData:{},errors:I&&se(I[1])?{[I[0]]:I[1].error}:null,...la(I),...z?{fetchers:new Map(y.fetchers)}:{}},{flushSync:N}),{shortCircuited:!0}}if(q){let z={};if(!P){z.navigation=U;let re=Tr(I);re!==void 0&&(z.actionData=re)}J.length>0&&(z.fetchers=pn(J)),te(z,{flushSync:N})}J.forEach(z=>{Le(z.key),z.controller&&W.set(z.key,z.controller)});let Ie=()=>J.forEach(z=>Le(z.key));j&&j.signal.addEventListener("abort",Ie);let{loaderResults:Ze,fetcherResults:Me}=await Fr(Y,J,c,S);if(c.signal.aborted)return{shortCircuited:!0};j&&j.signal.removeEventListener("abort",Ie),J.forEach(z=>W.delete(z.key));let Ee=wt(Ze);if(Ee)return await Ne(c,Ee.result,!0,{replace:k}),{shortCircuited:!0};if(Ee=wt(Me),Ee)return ie.add(Ee.key),await Ne(c,Ee.result,!0,{replace:k}),{shortCircuited:!0};let{loaderData:zt,errors:et}=na(y,g,Ze,I,J,Me);A&&y.errors&&(et={...y.errors,...et});let Ae=Nr(),pt=Ir(le),yt=Ae||pt||J.length>0;return{matches:g,loaderData:zt,errors:et,...yt?{fetchers:new Map(y.fetchers)}:{}}}function Tr(c){if(c&&!se(c[1]))return{[c[0]]:c[1].data};if(y.actionData)return Object.keys(y.actionData).length===0?null:y.actionData}
1function pn(c){return c.forEach(m=>{let g=y.fetchers.get(m.key),S=tt(void 0,g?g.data:void 0);y.fetchers.set(m.key,S)}),new Map(y.fetchers)}async function yn(c,m,g,S){Le(c);let P=(S&&S.flushSync)===!0,F=i||s,O=Gt(y.location,y.matches,u,g,m,S?.relative),D=Ce(F,O,u),k=ht(D,F,O);if(k.active&&k.matches&&(D=k.matches),!D){xe(c,m,fe(404,{pathname:O}),{flushSync:P});return}let{path:A,submission:N,error:I}=Gr(!0,O,S);if(I){xe(c,m,I,{flushSync:P});return}let U=e.getContext?await e.getContext():new Wr,K=(S&&S.preventScrollReset)===!0;if(N&&ae(N.formMethod)){await vn(c,m,A,D,U,k.active,P,K,N);return}de.set(c,{routeId:m,path:A}),await gn(c,m,A,D,U,k.active,P,K,N)}async function vn(c,m,g,S,P,F,O,D,k){_t(),de.delete(c);let A=y.fetchers.get(c);Se(c,Oo(k,A),{flushSync:O});let N=new AbortController,I=Ye(e.history,g,N.signal,k);if(F){let Q=await mt(S,new URL(I.url).pathname,I.signal,c);if(Q.type==="aborted")return;if(Q.type==="error"){xe(c,m,Q.error,{flushSync:O});return}else if(Q.matches)S=Q.matches;else{xe(c,m,fe(404,{pathname:g}),{flushSync:O});return}}let U=xt(S,g);if(!U.route.action&&!U.route.lazy){let Q=fe(405,{method:k.formMethod,pathname:g,routeId:m});xe(c,m,Q,{flushSync:O});return}W.set(c,N);let K=ce,q=Ke(o,l,I,S,U,a,P),Z=await qe(I,q,P,c),Y=Z[U.route.id];if(!Y){for(let Q of q)if(Z[Q.route.id]){Y=Z[Q.route.id];break}}if(I.signal.aborted){W.get(c)===N&&W.delete(c);return}if(we.has(c)){if(_e(Y)||se(Y)){Se(c,Pe(void 0));return}}else{if(_e(Y))if(W.delete(c),le>K){Se(c,Pe(void 0));return}else return ie.add(c),Se(c,tt(k)),Ne(I,Y,!1,{fetcherSubmission:k,preventScrollReset:D});if(se(Y)){xe(c,m,Y.error);return}}let J=y.navigation.location||y.location,Ie=Ye(e.history,J,N.signal),Ze=i||s,Me=y.navigation.state!=="idle"?Ce(Ze,y.navigation.location,u):y.matches;_(Me,"Didn't find any matches after fetcher action");let Ee=++ce;ye.set(c,Ee);let zt=tt(k,Y.data);y.fetchers.set(c,zt);let{dsMatches:et,revalidatingFetchers:Ae}=Qr(Ie,P,o,l,e.history,y,Me,k,J,a,!1,V,ee,we,de,ie,Ze,u,e.patchRoutesOnNavigation!=null,[U.route.id,Y]);Ae.filter(Q=>Q.key!==c).forEach(Q=>{let vt=Q.key,zr=y.fetchers.get(vt),Pn=tt(void 0,zr?zr.data:void 0);y.fetchers.set(vt,Pn),Le(vt),Q.controller&&W.set(vt,Q.controller)}),te({fetchers:new Map(y.fetchers)});let pt=()=>Ae.forEach(Q=>Le(Q.key));N.signal.addEventListener("abort",pt);let{loaderResults:yt,fetcherResults:z}=await Fr(et,Ae,Ie,P);if(N.signal.aborted)return;if(N.signal.removeEventListener("abort",pt),ye.delete(c),W.delete(c),Ae.forEach(Q=>W.delete(Q.key)),y.fetchers.has(c)){let Q=Pe(Y.data);y.fetchers.set(c,Q)}let re=wt(yt);if(re)return Ne(Ie,re.result,!1,{preventScrollReset:D});if(re=wt(z),re)return ie.add(re.key),Ne(Ie,re.result,!1,{preventScrollReset:D});let{loaderData:We,errors:$e}=na(y,Me,yt,void 0,Ae,z);Ir(Ee),y.navigation.state==="loading"&&Ee>le?(_($,"Expected pending action"),j&&j.abort(),Be(y.navigation.location,{matches:Me,loaderData:We,errors:$e,fetchers:new Map(y.fetchers)})):(te({errors:$e,loaderData:oa(y.loaderData,We,Me,$e),fetchers:new Map(y.fetchers)}),V=!1)}async function gn(c,m,g,S,P,F,O,D,k){let A=y.fetchers.get(c);Se(c,tt(k,A?A.data:void 0),{flushSync:O});let N=new AbortController,I=Ye(e.history,g,N.signal);if(F){let J=await mt(S,new URL(I.url).pathname,I.signal,c);if(J.type==="aborted")return;if(J.type==="error"){xe(c,m,J.error,{flushSync:O});return}else if(J.matches)S=J.matches;else{xe(c,m,fe(404,{pathname:g}),{flushSync:O});return}}let U=xt(S,g);W.set(c,N);let K=ce,q=Ke(o,l,I,S,U,a,P),Y=(await qe(I,q,P,c))[U.route.id];if(W.get(c)===N&&W.delete(c),!I.signal.aborted){if(we.has(c)){Se(c,Pe(void 0));return}if(_e(Y))if(le>K){Se(c,Pe(void 0));return}else{ie.add(c),await Ne(I,Y,!1,{preventScrollReset:D});return}if(se(Y)){xe(c,m,Y.error);return}Se(c,Pe(Y.data))}}async function Ne(c,m,g,{submission:S,fetcherSubmission:P,preventScrollReset:F,replace:O}={}){m.response.headers.has("X-Remix-Revalidate")&&(V=!0);let D=m.response.headers.get("Location");_(D,"Expected a Location header on the redirect Response"),D=ra(D,new URL(c.url),u);let k=ot(y.location,D,{_isRedirect:!0});if(r){let q=!1;if(m.response.headers.has("X-Remix-Reload-Document"))q=!0;else if(Ot(D)){const Z=ya(D,!0);q=Z.origin!==t.location.origin||oe(Z.pathname,u)==null}if(q){O?t.location.replace(D):t.location.assign(D);return}}j=null;let A=O===!0||m.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:N,formAction:I,formEncType:U}=y.navigation;!S&&!P&&N&&I&&U&&(S=ia(y.navigation));let K=S||P;if(fo.has(m.response.status)&&K&&ae(K.formMethod))await ke(A,k,{submission:{...K,formAction:D},preventScrollReset:F||H,enableViewTransition:g?G:void 0});else{let q=Vt(k,S);await ke(A,k,{overrideNavigation:q,fetcherSubmission:P,preventScrollReset:F||H,enableViewTransition:g?G:void 0})}}async function qe(c,m,g,S){let P,F={};try{P=await Eo(h,c,m,S,g,!1)}catch(O){return m.filter(D=>
1D.shouldLoad).forEach(D=>{F[D.route.id]={type:"error",error:O}}),F}if(c.signal.aborted)return F;for(let[O,D]of Object.entries(P))if(Do(D)){let k=D.result;F[O]={type:"redirect",response:xo(k,c,O,m,u)}}else F[O]=await So(D);return F}async function Fr(c,m,g,S){let P=qe(g,c,S,null),F=Promise.all(m.map(async k=>{if(k.matches&&k.match&&k.request&&k.controller){let N=(await qe(k.request,k.matches,S,k.key))[k.match.route.id];return{[k.key]:N}}else return Promise.resolve({[k.key]:{type:"error",error:fe(404,{pathname:k.path})}})})),O=await P,D=(await F).reduce((k,A)=>Object.assign(k,A),{});return{loaderResults:O,fetcherResults:D}}function _t(){V=!0,de.forEach((c,m)=>{W.has(m)&&ee.add(m),Le(m)})}function Se(c,m,g={}){y.fetchers.set(c,m),te({fetchers:new Map(y.fetchers)},{flushSync:(g&&g.flushSync)===!0})}function xe(c,m,g,S={}){let P=De(y.matches,m);jt(c),te({errors:{[P.route.id]:g},fetchers:new Map(y.fetchers)},{flushSync:(S&&S.flushSync)===!0})}function Or(c){return ge.set(c,(ge.get(c)||0)+1),we.has(c)&&we.delete(c),y.fetchers.get(c)||La}function wn(c,m){Le(c,m?.reason),Se(c,Pe(null))}function jt(c){let m=y.fetchers.get(c);W.has(c)&&!(m&&m.state==="loading"&&ye.has(c))&&Le(c),de.delete(c),ye.delete(c),ie.delete(c),we.delete(c),ee.delete(c),y.fetchers.delete(c)}function En(c){let m=(ge.get(c)||0)-1;m<=0?(ge.delete(c),we.add(c)):ge.set(c,m),te({fetchers:new Map(y.fetchers)})}function Le(c,m){let g=W.get(c);g&&(g.abort(m),W.delete(c))}function kr(c){for(let m of c){let g=Or(m),S=Pe(g.data);y.fetchers.set(m,S)}}function Nr(){let c=[],m=!1;for(let g of ie){let S=y.fetchers.get(g);_(S,`Expected fetcher: ${g}`),S.state==="loading"&&(ie.delete(g),c.push(g),m=!0)}return kr(c),m}function Ir(c){let m=[];for(let[g,S]of ye)if(S<c){let P=y.fetchers.get(g);_(P,`Expected fetcher: ${g}`),P.state==="loading"&&(Le(g),ye.delete(g),m.push(g))}return kr(m),m.length>0}function bn(c,m){let g=y.blockers.get(c)||Ve;return Oe.get(c)!==m&&Oe.set(c,m),g}function Ar(c){y.blockers.delete(c),Oe.delete(c)}function ft(c,m){let g=y.blockers.get(c)||Ve;_(g.state==="unblocked"&&m.state==="blocked"||g.state==="blocked"&&m.state==="blocked"||g.state==="blocked"&&m.state==="proceeding"||g.state==="blocked"&&m.state==="unblocked"||g.state==="proceeding"&&m.state==="unblocked",`Invalid blocker state transition: ${g.state} -> ${m.state}`);let S=new Map(y.blockers);S.set(c,m),te({blockers:S})}function $r({currentLocation:c,nextLocation:m,historyAction:g}){if(Oe.size===0)return;Oe.size>1&&X(!1,"A router only supports one blocker at a time");let S=Array.from(Oe.entries()),[P,F]=S[S.length-1],O=y.blockers.get(P);if(!(O&&O.state==="proceeding")&&F({currentLocation:c,nextLocation:m,historyAction:g}))return P}function Ut(c){let m=fe(404,{pathname:c}),g=i||s,{matches:S,route:P}=gt(g);return{notFoundMatches:S,route:P,error:m}}function Rn(c,m,g){if(w=c,E=m,x=g||null,!R&&y.navigation===Wt){R=!0;let S=jr(y.location,y.matches);S!=null&&te({restoreScrollPosition:S})}return()=>{w=null,E=null,x=null}}function _r(c,m){return x&&x(c,m.map(S=>va(S,y.loaderData)))||c.key}function Sn(c,m){if(w&&E){let g=_r(c,m);w[g]=E()}}function jr(c,m){if(w){let g=_r(c,m),S=w[g];if(typeof S=="number")return S}return null}function ht(c,m,g){if(e.patchRoutesOnNavigation)if(c){if(Object.keys(c[0].params).length>0)return{active:!0,matches:nt(m,g,u,!0)}}else return{active:!0,matches:nt(m,g,u,!0)||[]};return{active:!1,matches:null}}async function mt(c,m,g,S){if(!e.patchRoutesOnNavigation)return{type:"success",matches:c};let P=c;for(;;){let F=i==null,O=i||s,D=l;try{await e.patchRoutesOnNavigation({signal:g,path:m,matches:P,fetcherKey:S,patch:(N,I)=>{g.aborted||qr(N,I,O,D,o,!1)}})}catch(N){return{type:"error",error:N,partialMatches:P}}finally{F&&!g.aborted&&(s=[...s])}if(g.aborted)return{type:"aborted"};let k=Ce(O,m,u),A=null;if(k){if(Object.keys(k[0].params).length===0)return{type:"success",matches:k};if(A=nt(O,m,u,!0),!(A&&P.length<A.length&&Ur(P,A.slice(0,P.length))))return{type:"success",matches:k}}if(A||(A=nt(O,m,u,!0)),!A||Ur(P,A))return{type:"success",matches:null};P=A}}function Ur(c,m){return c.length===m.length&&c.every((g,S)=>g.route.id===m[S].route.id)}function xn(c){l={},i=lt(c,o,void 0,l)}function Ln(c,m,g=!1){let S=i==null;qr(c,m,i||s,l,o,g),S&&(s=[...s],te({}))}return T={get basename(){return u},get future(){return f},get state(){return y},get routes(){return s},get window(){return t},initialize:un,subscribe:dn,enableScrollRestoration:Rn,navigate:Dr,fetch:yn,revalidate:fn,createHref:c=>e.history.createHref(c),encodeLocation:c=>e.history.encodeLocation(c),getFetcher:Or,resetFetcher:wn,deleteFetcher:En,dispose:cn,getBlocker:bn,deleteBlocker:Ar,patchRoutes:Ln,_internalFetchControllers:W,_internalSetRoutes:xn,_internalSetStateDoNotUseOrYouWillBreakYourApp(c){te(c)}},e.unstable_instrumentations&&(T=ro(T,e.unstable_instrumentations.map(c=>
1c.router).filter(Boolean))),T}function mo(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Gt(e,t,r,a,n,o){let l,s;if(n){l=[];for(let u of t)if(l.push(u),u.route.id===n){s=u;break}}else l=t,s=t[t.length-1];let i=ur(a||".",sr(l),oe(e.pathname,r)||e.pathname,o==="path");if(a==null&&(i.search=e.search,i.hash=e.hash),(a==null||a===""||a===".")&&s){let u=hr(i.search);if(s.route.index&&!u)i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index";else if(!s.route.index&&u){let h=new URLSearchParams(i.search),f=h.getAll("index");h.delete("index"),f.filter(v=>v).forEach(v=>h.append("index",v));let p=h.toString();i.search=p?`?${p}`:""}}return r!=="/"&&(i.pathname=Jn({basename:r,pathname:i.pathname})),Re(i)}function Gr(e,t,r){if(!r||!mo(r))return{path:t};if(r.formMethod&&!To(r.formMethod))return{path:t,error:fe(405,{method:r.formMethod})};let a=()=>({path:t,error:fe(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),l=ka(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!ae(o))return a();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((p,[v,w])=>`${p}${v}=${w} 2`,""):String(r.body);return{path:t,submission:{formMethod:o,formAction:l,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!ae(o))return a();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:o,formAction:l,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return a()}}}_(typeof FormData=="function","FormData is not available in this environment");let s,i;if(r.formData)s=Zt(r.formData),i=r.formData;else if(r.body instanceof FormData)s=Zt(r.body),i=r.body;else if(r.body instanceof URLSearchParams)s=r.body,i=aa(s);else if(r.body==null)s=new URLSearchParams,i=new FormData;else try{s=new URLSearchParams(r.body),i=aa(s)}catch{return a()}let u={formMethod:o,formAction:l,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(ae(u.formMethod))return{path:t,submission:u};let h=Fe(t);return e&&h.search&&hr(h.search)&&s.append("index",""),h.search=`?${s}`,{path:Re(h),submission:u}}function Qr(e,t,r,a,n,o,l,s,i,u,h,f,p,v,w,x,E,R,b,C){let M=C?se(C[1])?C[1].error:C[1].data:void 0,L=n.createURL(o.location),T=n.createURL(i),y;if(h&&o.errors){let B=Object.keys(o.errors)[0];y=l.findIndex(V=>V.route.id===B)}else if(C&&se(C[1])){let B=C[0];y=l.findIndex(V=>V.route.id===B)-1}let $=C?C[1].statusCode:void 0,H=$&&$>=400,j={currentUrl:L,currentParams:o.matches[0]?.params||{},nextUrl:T,nextParams:l[0].params,...s,actionResult:M,actionStatus:$},G=cr(l.map(B=>B.route.path)),ue=l.map((B,V)=>{let{route:ee}=B,W=null;if(y!=null&&V>y?W=!1:ee.lazy?W=!0:dr(ee)?h?W=Qt(ee,o.loaderData,o.errors):po(o.loaderData,o.matches[V],B)&&(W=!0):W=!1,W!==null)return qt(r,a,e,G,B,u,t,W);let ce=H?!1:f||L.pathname+L.search===T.pathname+T.search||L.search!==T.search||yo(o.matches[V],B),le={...j,defaultShouldRevalidate:ce},ye=Dt(B,le);return qt(r,a,e,G,B,u,t,ye,le)}),pe=[];return w.forEach((B,V)=>{if(h||!l.some(ge=>ge.route.id===B.routeId)||v.has(V))return;let ee=o.fetchers.get(V),W=ee&&ee.state!=="idle"&&ee.data===void 0,ce=Ce(E,B.path,R);if(!ce){if(b&&W)return;pe.push({key:V,routeId:B.routeId,path:B.path,matches:null,match:null,request:null,controller:null});return}if(x.has(V))return;let le=xt(ce,B.path),ye=new AbortController,ie=Ye(n,B.path,ye.signal),de=null;if(p.has(V))p.delete(V),de=Ke(r,a,ie,ce,le,u,t);else if(W)f&&(de=Ke(r,a,ie,ce,le,u,t));else{let ge={...j,defaultShouldRevalidate:H?!1:f};Dt(le,ge)&&(de=Ke(r,a,ie,ce,le,u,t,ge))}de&&pe.push({key:V,routeId:B.routeId,path:B.path,matches:de,match:le,request:ie,controller:ye})}),{dsMatches:ue,revalidatingFetchers:pe}}function dr(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Qt(e,t,r){if(e.lazy)return!0;if(!dr(e))return!1;let a=t!=null&&e.id in t,n=r!=null&&r[e.id]!==void 0;return!a&&n?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!a&&!n}function po(e,t,r){let a=!t||r.route.id!==t.route.id,n=!e.hasOwnProperty(r.route.id);return a||n}function yo(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function Dt(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function qr(e,t,r,a,n,o){let l;if(e){let u=a[e];_(u,`No route found to patch children into: routeId = ${e}`),u.children||(u.children=[]),l=u.children}else l=r;let s=[],i=[];if(t.forEach(u=>{let h=l.find(f=>Ma(u,f));h?i.push({existingRoute:h,newRoute:u}):s.push(u)}),s.length>0){let u=lt(s,n,[e||"_","patch",String(l?.length||"0")],a);l.push(...u)}if(o&&i.length>0)for(let u=0;u<i.length;u++){let{existingRoute:h,newRoute:f}=i[u],p=h,[v]=lt([f],n,[],{},!0);Object.assign(p,{element:v.element?v.element:p.element,errorElement:v.errorElement?v.errorElement:p.errorElement,hydrateFallbackElement:v.hydrateFallbackElement?v.hydrateFallbackElement:p.hydrateFallbackElement})}}function Ma(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((r,a)=>t.children?.some(n=>Ma(r,n))):!1}var Zr=new WeakMap,Da=({key:e,route:t,manifest:r,mapRouteProperties:a})=>{let n=r[t.id];
2if(_(n,"No route found in manifest"),!n.lazy||typeof n.lazy!="object")return;let o=n.lazy[e];if(!o)return;let l=Zr.get(n);l||(l={},Zr.set(n,l));let s=l[e];if(s)return s;let i=(async()=>{let u=On(e),f=n[e]!==void 0&&e!=="hasErrorBoundary";if(u)X(!u,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),l[e]=Promise.resolve();else if(f)X(!1,`Route "${n.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let p=await o();p!=null&&(Object.assign(n,{[e]:p}),Object.assign(n,a(n)))}typeof n.lazy=="object"&&(n.lazy[e]=void 0,Object.values(n.lazy).every(p=>p===void 0)&&(n.lazy=void 0))})();return l[e]=i,i},ea=new WeakMap;function vo(e,t,r,a,n){let o=r[e.id];if(_(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let h=ea.get(o);if(h)return{lazyRoutePromise:h,lazyHandlerPromise:h};let f=(async()=>{_(typeof e.lazy=="function","No lazy route function found");let p=await e.lazy(),v={};for(let w in p){let x=p[w];if(x===void 0)continue;let E=Nn(w),b=o[w]!==void 0&&w!=="hasErrorBoundary";E?X(!E,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):b?X(!b,`Route "${o.id}" has a static property "${w}" defined but its lazy function is also returning a value for this property. The lazy route property "${w}" will be ignored.`):v[w]=x}Object.assign(o,v),Object.assign(o,{...a(o),lazy:void 0})})();return ea.set(o,f),f.catch(()=>{}),{lazyRoutePromise:f,lazyHandlerPromise:f}}let l=Object.keys(e.lazy),s=[],i;for(let h of l){if(n&&n.includes(h))continue;let f=Da({key:h,route:e,manifest:r,mapRouteProperties:a});f&&(s.push(f),h===t&&(i=f))}let u=s.length>0?Promise.all(s).then(()=>{}):void 0;return u?.catch(()=>{}),i?.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:i}}async function ta(e){let t=e.matches.filter(n=>n.shouldLoad),r={};return(await Promise.all(t.map(n=>n.resolve()))).forEach((n,o)=>{r[t[o].route.id]=n}),r}async function go(e){return e.matches.some(t=>t.route.middleware)?Ta(e,()=>ta(e)):ta(e)}function Ta(e,t){return wo(e,t,a=>a,Co,r);function r(a,n,o){if(o)return Promise.resolve(Object.assign(o.value,{[n]:{type:"error",result:a}}));{let{matches:l}=e,s=Math.min(Math.max(l.findIndex(u=>u.route.id===n),0),Math.max(l.findIndex(u=>u.unstable_shouldCallHandler()),0)),i=De(l,l[s].route.id).route.id;return Promise.resolve({[i]:{type:"error",result:a}})}}}async function wo(e,t,r,a,n){let{matches:o,request:l,params:s,context:i,unstable_pattern:u}=e,h=o.flatMap(p=>p.route.middleware?p.route.middleware.map(v=>[p.route.id,v]):[]);return await Fa({request:l,params:s,context:i,unstable_pattern:u},h,t,r,a,n)}async function Fa(e,t,r,a,n,o,l=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??new Error(`Request aborted: ${s.method} ${s.url}`);let i=t[l];if(!i)return await r();let[u,h]=i,f,p=async()=>{if(f)throw new Error("You may only call `next()` once per middleware");try{return f={value:await Fa(e,t,r,a,n,o,l+1)},f.value}catch(v){return f={value:await o(v,u,f)},f.value}};try{let v=await h(e,p),w=v!=null?a(v):void 0;return n(w)?w:f?w??f.value:(f={value:await p()},f.value)}catch(v){return await o(v,u,f)}}function Oa(e,t,r,a,n){let o=Da({key:"middleware",route:a.route,manifest:t,mapRouteProperties:e}),l=vo(a.route,ae(r.method)?"action":"loader",t,e,n);return{middleware:o,route:l.lazyRoutePromise,handler:l.lazyHandlerPromise}}function qt(e,t,r,a,n,o,l,s,i=null){let u=!1,h=Oa(e,t,r,n,o);return{...n,_lazyPromises:h,shouldLoad:s,unstable_shouldRevalidateArgs:i,unstable_shouldCallHandler(f){return u=!0,i?typeof f=="boolean"?Dt(n,{...i,defaultShouldRevalidate:f}):Dt(n,i):s},resolve(f){let{lazy:p,loader:v,middleware:w}=n.route,x=u||s||f&&!ae(r.method)&&(p||v),E=w&&w.length>0&&!v&&!p;return x&&(ae(r.method)||!E)?bo({request:r,unstable_pattern:a,match:n,lazyHandlerPromise:h?.handler,lazyRoutePromise:h?.route,handlerOverride:f,scopedContext:l}):Promise.resolve({type:"data",result:void 0})}}}function Ke(e,t,r,a,n,o,l,s=null){return a.map(i=>i.route.id!==n.route.id?{...i,shouldLoad:!1,unstable_shouldRevalidateArgs:s,unstable_shouldCallHandler:()=>!1,_lazyPromises:Oa(e,t,r,i,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:qt(e,t,r,cr(a.map(u=>u.route.path)),i,o,l,!0,s))}async function Eo(e,t,r,a,n,o){r.some(u=>u._lazyPromises?.middleware)&&await Promise.all(r.map(u=>u._lazyPromises?.middleware));let l={request:t,unstable_pattern:cr(r.map(u=>u.route.path)),params:r[0].params,context:n,matches:r},i=await e({...l,fetcherKey:a,runClientMiddleware:u=>{let h=l;return Ta(h,()=>u({...h,fetcherKey:a,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(r.flatMap(u=>[u._lazyPromises?.handler,u._lazyPromises?.route]))}catch{}return i}async function bo({request:e,unstable_pattern:t,match:r,lazyHandlerPromise:a,lazyRoutePromise:n,handlerOverride:o,scopedContext:l}){let s,i,u=ae(e.method),h=u?"action":"loader",f=p=>{let v,w=new Promise((R,b)=>v=b);i=()=>v(),e.signal.addEventListener("abort",i);let x=R=>typeof p!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${h}" [routeId: ${r.route.id}]`)):p({request:e,unstable_pattern:t,params:r.params,context:l},...R!==void 0?[R]:[]),E=(async()=>{try{return{type:"data",result:await(o?o(b=>x(b)):x())}}catch(R){return{type:"error",result:R}}})();return Promise.race([E,w])};try{let p=u?r.route.action:r.route.loader;if(a||n)if(p){let v,[w]=await Promise.all([f(p).catch(x=>{v=x}),a,n]);if(v!==void 0)throw v;s=w}else{await a;let v=u?r.route.action:r.route.loader;if(v)[s]=await Promise.all([f(v),n]);else if(h==="action"){let w=new URL(e.url),x=w.pathname+w.search;throw fe(405,{method:e.method,pathname:x,routeId:r.route.id})}else return{type:"data",result:void 0}}else if(p)s=await f(p);else{let v=new URL(e.url),w=v.pathname+v.search;throw fe(404,{pathname:w})}}catch(p){return{type:"error",result:p}}finally{i&&e.signal.removeEventListener("abort",i)}return s}async function Ro(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function So(e){let{result:t,type:r}=e;if(fr(t)){let a;try{a=await Ro(t)}catch(n){return{type:"error",error:n}}return r==="error"?{type:"error",error:new je(t.status,t.statusText,a),statusCode:t.status,headers:t.headers}:{type:"data",data:a,statusCode:t.status,headers:t.headers}}return r==="error"?er(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new je(t.init?.status||500,void 0,t.data),statusCode:Ue(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Ue(t)?t.status:void 0}:er(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function xo(e,t,r,a,n){let o=e.headers.get("Location");if(_(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!Ot(o)){let l=a.slice(0,a.findIndex(s=>s.route.id===r)+1);o=Gt(new URL(t.url),l,n,o),e.headers.set("Location",o)}return e}function ra(e,t,r){if(Ot(e)){let a=e,n=a.startsWith("//")?new URL(t.protocol+a):new URL(a),o=oe(n.pathname,r)!=null;if(n.origin===t.origin&&o)return n.pathname+n.search+n.hash}return e}function Ye(e,t,r,a){let n=e.createURL(ka(t)).toString(),o={signal:r};if(a&&ae(a.formMethod)){let{formMethod:l,formEncType:s}=a;o.method=l.toUpperCase(),s==="application/json"?(o.headers=new Headers({"Content-Type":s}),o.body=JSON.stringify(a.json)):s==="text/plain"?o.body=a.text:s==="application/x-www-form-urlencoded"&&a.formData?o.body=Zt(a.formData):o.body=a.formData}
2return new Request(n,o)}function Zt(e){let t=new URLSearchParams;for(let[r,a]of e.entries())t.append(r,typeof a=="string"?a:a.name);return t}function aa(e){let t=new FormData;for(let[r,a]of e.entries())t.append(r,a);return t}function Lo(e,t,r,a=!1,n=!1){let o={},l=null,s,i=!1,u={},h=r&&se(r[1])?r[1].error:void 0;return e.forEach(f=>{if(!(f.route.id in t))return;let p=f.route.id,v=t[p];if(_(!_e(v),"Cannot handle redirect results in processLoaderData"),se(v)){let w=v.error;if(h!==void 0&&(w=h,h=void 0),l=l||{},n)l[p]=w;else{let x=De(e,p);l[x.route.id]==null&&(l[x.route.id]=w)}a||(o[p]=Ca),i||(i=!0,s=Ue(v.error)?v.error.status:500),v.headers&&(u[p]=v.headers)}else o[p]=v.data,v.statusCode&&v.statusCode!==200&&!i&&(s=v.statusCode),v.headers&&(u[p]=v.headers)}),h!==void 0&&r&&(l={[r[0]]:h},r[2]&&(o[r[2]]=void 0)),{loaderData:o,errors:l,statusCode:s||200,loaderHeaders:u}}function na(e,t,r,a,n,o){let{loaderData:l,errors:s}=Lo(t,r,a);return n.filter(i=>!i.matches||i.matches.some(u=>u.shouldLoad)).forEach(i=>{let{key:u,match:h,controller:f}=i;if(f&&f.signal.aborted)return;let p=o[u];if(_(p,"Did not find corresponding fetcher result"),se(p)){let v=De(e.matches,h?.route.id);s&&s[v.route.id]||(s={...s,[v.route.id]:p.error}),e.fetchers.delete(u)}else if(_e(p))_(!1,"Unhandled fetcher revalidation redirect");else{let v=Pe(p.data);e.fetchers.set(u,v)}}),{loaderData:l,errors:s}}function oa(e,t,r,a){let n=Object.entries(t).filter(([,o])=>o!==Ca).reduce((o,[l,s])=>(o[l]=s,o),{});for(let o of r){let l=o.route.id;if(!t.hasOwnProperty(l)&&e.hasOwnProperty(l)&&o.route.loader&&(n[l]=e[l]),a&&a.hasOwnProperty(l))break}return n}function la(e){return e?se(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function De(e,t){return(t?e.slice(0,e.findIndex(a=>a.route.id===t)+1):[...e]).reverse().find(a=>a.route.hasErrorBoundary===!0)||e[0]}function gt(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function fe(e,{pathname:t,routeId:r,method:a,type:n,message:o}={}){let l="Unknown Server Error",s="Unknown @remix-run/router error";return e===400?(l="Bad Request",a&&t&&r?s=`You made a ${a} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:n==="invalid-body"&&(s="Unable to encode submission body")):e===403?(l="Forbidden",s=`Route "${r}" does not match URL "${t}"`):e===404?(l="Not Found",s=`No route matches URL "${t}"`):e===405&&(l="Method Not Allowed",a&&t&&r?s=`You made a ${a.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:a&&(s=`Invalid request method "${a.toUpperCase()}"`)),new je(e||500,l,new Error(s),!0)}function wt(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[a,n]=t[r];if(_e(n))return{key:a,result:n}}}function ka(e){let t=typeof e=="string"?Fe(e):e;return Re({...t,hash:""})}function Po(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Co(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,r])=>typeof t=="string"&&Mo(r))}function Mo(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function Do(e){return fr(e.result)&&co.has(e.result.status)}function se(e){return e.type==="error"}function _e(e){return(e&&e.type)==="redirect"}function er(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function fr(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function To(e){return uo.has(e.toUpperCase())}function ae(e){return io.has(e.toUpperCase())}function hr(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function xt(e,t){let r=typeof t=="string"?Fe(t).search:t.search;if(e[e.length-1].route.index&&hr(r||""))return e[e.length-1];let a=ba(e);return a[a.length-1]}function ia(e){let{formMethod:t,formAction:r,formEncType:a,text:n,formData:o,json:l}=e;if(!(!t||!r||!a)){if(n!=null)return{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:void 0,text:n};if(o!=null)return{formMethod:t,formAction:r,formEncType:a,formData:o,json:void 0,text:void 0};if(l!==void 0)return{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:l,text:void 0}}}function Vt(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 Fo(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 tt(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 Oo(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 ko(e,t){try{let r=e.sessionStorage.getItem(Pa);if(r){let a=JSON.parse(r);for(let[n,o]of Object.entries(a||{}))o&&Array.isArray(o)&&t.set(n,new Set(o||[]))}}catch{}}function No(e,t){if(t.size>0){let r={};for(let[a,n]of t)r[a]=[...n];try{e.sessionStorage.setItem(Pa,JSON.stringify(r))}catch(a){X(!1,`Failed to save applied view transitions in sessionStorage (${a}).`)}}}function Io(){let e,t,r=new Promise((a,n)=>{e=async o=>{a(o);try{await r}catch{}},t=async o=>
2{n(o);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}var ze=d.createContext(null);ze.displayName="DataRouter";var Xe=d.createContext(null);Xe.displayName="DataRouterState";var Ao=d.createContext(!1);function $o(){return d.useContext(Ao)}var mr=d.createContext({isTransitioning:!1});mr.displayName="ViewTransition";var pr=d.createContext(new Map);pr.displayName="Fetchers";var _o=d.createContext(null);_o.displayName="Await";var he=d.createContext(null);he.displayName="Navigation";var kt=d.createContext(null);kt.displayName="Location";var me=d.createContext({outlet:null,matches:[],isDataRoute:!1});me.displayName="Route";var yr=d.createContext(null);yr.displayName="RouteError";function jo(e,{relative:t}={}){_(st(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=d.useContext(he),{hash:n,pathname:o,search:l}=ut(e,{relative:t}),s=o;return r!=="/"&&(s=o==="/"?r:be([r,o])),a.createHref({pathname:s,search:l,hash:n})}function st(){return d.useContext(kt)!=null}function ve(){return _(st(),"useLocation() may be used only in the context of a <Router> component."),d.useContext(kt).location}var Na="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ia(e){d.useContext(he).static||d.useLayoutEffect(e)}function Aa(){let{isDataRoute:e}=d.useContext(me);return e?qo():Uo()}function Uo(){_(st(),"useNavigate() may be used only in the context of a <Router> component.");let e=d.useContext(ze),{basename:t,navigator:r}=d.useContext(he),{matches:a}=d.useContext(me),{pathname:n}=ve(),o=JSON.stringify(sr(a)),l=d.useRef(!1);return Ia(()=>{l.current=!0}),d.useCallback((i,u={})=>{if(X(l.current,Na),!l.current)return;if(typeof i=="number"){r.go(i);return}let h=ur(i,JSON.parse(o),n,u.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:be([t,h.pathname])),(u.replace?r.replace:r.push)(h,u.state,u)},[t,r,o,n,e])}var $a=d.createContext(null);function Ai(){return d.useContext($a)}function zo(e){let t=d.useContext(me).outlet;return d.useMemo(()=>t&&d.createElement($a.Provider,{value:e},t),[t,e])}function vr(){let{matches:e}=d.useContext(me),t=e[e.length-1];return t?t.params:{}}function ut(e,{relative:t}={}){let{matches:r}=d.useContext(me),{pathname:a}=ve(),n=JSON.stringify(sr(r));return d.useMemo(()=>ur(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function Ho(e,t,r,a,n){_(st(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=d.useContext(he),{matches:l}=d.useContext(me),s=l[l.length-1],i=s?s.params:{},u=s?s.pathname:"/",h=s?s.pathnameBase:"/",f=s&&s.route;{let b=f&&f.path||"";ja(u,!f||b.endsWith("*")||b.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${b}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. 3 4Please change the parent <Route path="${b}"> to <Route path="${b==="/"?"*":`${b}/*`}">.`)}let p=ve(),v;v=p;let w=v.pathname||"/",x=w;if(h!=="/"){let b=h.replace(/^\//,"").split("/");x="/"+w.replace(/^\//,"").split("/").slice(b.length).join("/")}let E=Ce(e,{pathname:x});return X(f||E!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),X(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),Jo(E&&E.map(b=>Object.assign({},b,{params:Object.assign({},i,b.params),pathname:be([h,o.encodeLocation?o.encodeLocation(b.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?h:be([h,o.encodeLocation?o.encodeLocation(b.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:b.pathnameBase])})),l,r,a,n)}function Bo(){let e=Rr(),t=Ue(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",n={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=d.createElement(d.Fragment,null,d.createElement("p",null,"ð¿ Hey developer ð"),d.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",d.createElement("code",{style:o},"ErrorBoundary")," or"," ",d.createElement("code",{style:o},"errorElement")," prop on your route.")),d.createElement(d.Fragment,null,d.createElement("h2",null,"Unexpected Application
4Error!"),d.createElement("h3",{style:{fontStyle:"italic"}},t),r?d.createElement("pre",{style:n},r):null,l)}var Wo=d.createElement(Bo,null),Vo=class extends d.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?d.createElement(me.Provider,{value:this.props.routeContext},d.createElement(yr.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Yo({routeContext:e,match:t,children:r}){let a=d.useContext(ze);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),d.createElement(me.Provider,{value:e},r)}function Jo(e,t=[],r=null,a=null,n=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,l=r?.errors;if(l!=null){let h=o.findIndex(f=>f.route.id&&l?.[f.route.id]!==void 0);_(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),o=o.slice(0,Math.min(o.length,h+1))}let s=!1,i=-1;if(r)for(let h=0;h<o.length;h++){let f=o[h];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(i=h),f.route.id){let{loaderData:p,errors:v}=r,w=f.route.loader&&!p.hasOwnProperty(f.route.id)&&(!v||v[f.route.id]===void 0);if(f.route.lazy||w){s=!0,i>=0?o=o.slice(0,i+1):o=[o[0]];break}}}let u=r&&a?(h,f)=>{a(h,{location:r.location,params:r.matches?.[0]?.params??{},errorInfo:f})}:void 0;return o.reduceRight((h,f,p)=>{let v,w=!1,x=null,E=null;r&&(v=l&&f.route.id?l[f.route.id]:void 0,x=f.route.errorElement||Wo,s&&(i<0&&p===0?(ja("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,E=null):i===p&&(w=!0,E=f.route.hydrateFallbackElement||null)));let R=t.concat(o.slice(0,p+1)),b=()=>{let C;return v?C=x:w?C=E:f.route.Component?C=d.createElement(f.route.Component,null):f.route.element?C=f.route.element:C=h,d.createElement(Yo,{match:f,routeContext:{outlet:h,matches:R,isDataRoute:r!=null},children:C})};return r&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?d.createElement(Vo,{location:r.location,revalidation:r.revalidation,component:x,error:v,children:b(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:u}):b()},null)}function gr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function _a(e){let t=d.useContext(ze);return _(t,gr(e)),t}function He(e){let t=d.useContext(Xe);return _(t,gr(e)),t}function Ko(e){let t=d.useContext(me);return _(t,gr(e)),t}function ct(e){let t=Ko(e),r=t.matches[t.matches.length-1];return _(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Xo(){return ct("useRouteId")}function Go(){return He("useNavigation").navigation}function wr(){let{matches:e,loaderData:t}=He("useMatches");return d.useMemo(()=>e.map(r=>va(r,t)),[e,t])}function Er(){let e=He("useLoaderData"),t=ct("useLoaderData");return e.loaderData[t]}function $i(e){return He("useRouteLoaderData").loaderData[e]}function br(){let e=He("useActionData"),t=ct("useLoaderData");return e.actionData?e.actionData[t]:void 0}function Rr(){let e=d.useContext(yr),t=He("useRouteError"),r=ct("useRouteError");return e!==void 0?e:t.errors?.[r]}var Qo=0;function _i(e){let{router:t,basename:r}=_a("useBlocker"),a=He("useBlocker"),[n,o]=d.useState(""),l=d.useCallback(s=>{if(typeof e!="function")return!!e;if(r==="/")return e(s);let{currentLocation:i,nextLocation:u,historyAction:h}=s;return e({currentLocation:{...i,pathname:oe(i.pathname,r)||i.pathname},nextLocation:{...u,pathname:oe(u.pathname,r)||u.pathname},historyAction:h})},[r,e]);return d.useEffect(()=>{let s=String(++Qo);return o(s),()=>t.deleteBlocker(s)},[t]),d.useEffect(()=>{n!==""&&t.getBlocker(n,l)},[t,n,l]),n&&a.blockers.has(n)?a.blockers.get(n):Ve}function qo(){let{router:e}=_a("useNavigate"),t=ct("useNavigate"),r=d.useRef(!1);return Ia(()=>{r.current=!0}),d.useCallback(async(n,o={})=>{X(r.current,Na),r.current&&(typeof n=="number"?e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}var sa={};function ja(e,t,r){!t&&!sa[e]&&(sa[e]=!0,X(!1,r))}var ua={};function tr(e,t){!e&&!ua[t]&&(ua[t]=!0,console.warn(t))}function ji(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&X(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:d.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&X(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:d.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&X(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:d.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Ui=["HydrateFallback","hydrateFallbackElement"],Zo=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>
4{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",t(r))}})}};function zi({router:e,flushSync:t,unstable_onError:r}){let[a,n]=d.useState(e.state),[o,l]=d.useState(),[s,i]=d.useState({isTransitioning:!1}),[u,h]=d.useState(),[f,p]=d.useState(),[v,w]=d.useState(),x=d.useRef(new Map),E=d.useCallback(L=>{n(T=>(L.errors&&r&&Object.entries(L.errors).forEach(([y,$])=>{T.errors?.[y]!==$&&r($,{location:L.location,params:L.matches[0]?.params??{}})}),L))},[r]),R=d.useCallback((L,{deletedFetchers:T,flushSync:y,viewTransitionOpts:$})=>{L.fetchers.forEach((j,G)=>{j.data!==void 0&&x.current.set(G,j.data)}),T.forEach(j=>x.current.delete(j)),tr(y===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let H=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(tr($==null||H,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!$||!H){t&&y?t(()=>E(L)):d.startTransition(()=>E(L));return}if(t&&y){t(()=>{f&&(u&&u.resolve(),f.skipTransition()),i({isTransitioning:!0,flushSync:!0,currentLocation:$.currentLocation,nextLocation:$.nextLocation})});let j=e.window.document.startViewTransition(()=>{t(()=>E(L))});j.finished.finally(()=>{t(()=>{h(void 0),p(void 0),l(void 0),i({isTransitioning:!1})})}),t(()=>p(j));return}f?(u&&u.resolve(),f.skipTransition(),w({state:L,currentLocation:$.currentLocation,nextLocation:$.nextLocation})):(l(L),i({isTransitioning:!0,flushSync:!1,currentLocation:$.currentLocation,nextLocation:$.nextLocation}))},[e.window,t,f,u,E]);d.useLayoutEffect(()=>e.subscribe(R),[e,R]),d.useEffect(()=>{s.isTransitioning&&!s.flushSync&&h(new Zo)},[s]),d.useEffect(()=>{if(u&&o&&e.window){let L=o,T=u.promise,y=e.window.document.startViewTransition(async()=>{d.startTransition(()=>E(L)),await T});y.finished.finally(()=>{h(void 0),p(void 0),l(void 0),i({isTransitioning:!1})}),p(y)}},[o,u,e.window,E]),d.useEffect(()=>{u&&o&&a.location.key===o.location.key&&u.resolve()},[u,f,a.location,o]),d.useEffect(()=>{!s.isTransitioning&&v&&(l(v.state),i({isTransitioning:!0,flushSync:!1,currentLocation:v.currentLocation,nextLocation:v.nextLocation}),w(void 0))},[s.isTransitioning,v]);let b=d.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:L=>e.navigate(L),push:(L,T,y)=>e.navigate(L,{state:T,preventScrollReset:y?.preventScrollReset}),replace:(L,T,y)=>e.navigate(L,{replace:!0,state:T,preventScrollReset:y?.preventScrollReset})}),[e]),C=e.basename||"/",M=d.useMemo(()=>({router:e,navigator:b,static:!1,basename:C,unstable_onError:r}),[e,b,C,r]);return d.createElement(d.Fragment,null,d.createElement(ze.Provider,{value:M},d.createElement(Xe.Provider,{value:a},d.createElement(pr.Provider,{value:x.current},d.createElement(mr.Provider,{value:s},d.createElement(rl,{basename:C,location:a.location,navigationType:a.historyAction,navigator:b},d.createElement(el,{routes:e.routes,future:e.future,state:a,unstable_onError:r})))))),null)}var el=d.memo(tl);function tl({routes:e,future:t,state:r,unstable_onError:a}){return Ho(e,void 0,r,a,t)}function Hi(e){return zo(e.context)}function rl({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:n,static:o=!1}){_(!st(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=d.useMemo(()=>({basename:l,navigator:n,static:o,future:{}}),[l,n,o]);typeof r=="string"&&(r=Fe(r));let{pathname:i="/",search:u="",hash:h="",state:f=null,key:p="default"}=r,v=d.useMemo(()=>{let w=oe(i,l);return w==null?null:{location:{pathname:w,search:u,hash:h,state:f,key:p},navigationType:a}},[l,i,u,h,f,p,a]);
4return X(v!=null,`<Router basename="${l}"> is not able to match the URL "${i}${u}${h}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:d.createElement(he.Provider,{value:s},d.createElement(kt.Provider,{children:t,value:v}))}function al(){return{params:vr(),loaderData:Er(),actionData:br(),matches:wr()}}function Bi(e){return function(){const r=al();return d.createElement(e,r)}}function nl(){return{params:vr(),loaderData:Er(),actionData:br()}}function Wi(e){return function(){const r=nl();return d.createElement(e,r)}}function ol(){return{params:vr(),loaderData:Er(),actionData:br(),error:Rr()}}function Vi(e){return function(){const r=ol();return d.createElement(e,r)}}var Lt="get",Pt="application/x-www-form-urlencoded";function Nt(e){return e!=null&&typeof e.tagName=="string"}function ll(e){return Nt(e)&&e.tagName.toLowerCase()==="button"}function il(e){return Nt(e)&&e.tagName.toLowerCase()==="form"}function sl(e){return Nt(e)&&e.tagName.toLowerCase()==="input"}function ul(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function cl(e,t){return e.button===0&&(!t||t==="_self")&&!ul(e)}function rr(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let a=e[r];return t.concat(Array.isArray(a)?a.map(n=>[r,n]):[[r,a]])},[]))}function dl(e,t){let r=rr(e);return t&&t.forEach((a,n)=>{r.has(n)||t.getAll(n).forEach(o=>{r.append(n,o)})}),r}var Et=null;function fl(){if(Et===null)try{new FormData(document.createElement("form"),0),Et=!1}catch{Et=!0}return Et}var hl=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Yt(e){return e!=null&&!hl.has(e)?(X(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Pt}"`),null):e}function ml(e,t){let r,a,n,o,l;if(il(e)){let s=e.getAttribute("action");a=s?oe(s,t):null,r=e.getAttribute("method")||Lt,n=Yt(e.getAttribute("enctype"))||Pt,o=new FormData(e)}else if(ll(e)||sl(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 i=e.getAttribute("formaction")||s.getAttribute("action");if(a=i?oe(i,t):null,r=e.getAttribute("formmethod")||s.getAttribute("method")||Lt,n=Yt(e.getAttribute("formenctype"))||Yt(s.getAttribute("enctype"))||Pt,o=new FormData(s,e),!fl()){let{name:u,type:h,value:f}=e;if(h==="image"){let p=u?`${u}.`:"";o.append(`${p}x`,"0"),o.append(`${p}y`,"0")}else u&&o.append(u,f)}}else{if(Nt(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Lt,a=null,n=Pt,l=e}return o&&n==="text/plain"&&(l=o,o=void 0),{action:a,method:r.toLowerCase(),encType:n,formData:o,body:l}}var pl=-1,yl=-2,vl=-3,gl=-4,wl=-5,El=-6,bl=-7,Rl="B",Sl="D",Ua="E",xl="M",Ll="N",za="P",Pl="R",Cl="S",Ml="Y",Dl="U",Tl="Z",Ha=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}};function Fl(){const e=new TextDecoder;let t="";return new TransformStream({transform(r,a){const n=e.decode(r,{stream:!0}),o=(t+n).split(` 5`);t=o.pop()||"";for(const l of o)a.enqueue(l)},flush(r){t&&r.enqueue(t)}})}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Jt=typeof window<"u"?window:typeof globalThis<"u"?globalThis:void 0;function ar(e){const{hydrated:t,values:r}=this;if(typeof e=="number")return ca.call(this,e);if(!Array.isArray(e)||!e.length)throw new SyntaxError;const a=r.length;for(const n of e)r.push(n);return t.length=r.length,ca.call(this,a)}function ca(e){const{hydrated:t,values:r,deferred:a,plugins:n}=this;let o;const l=[[e,i=>{o=i}]];let s=[];for(;l.length>0;){const[i,u]=l.pop();switch(i){case bl:u(void 0);continue;case wl:u(null);continue;case yl:u(NaN);continue;case El:u(1/0);continue;case vl:u(-1/0);continue;case gl:u(-0);continue}if(t[i]){u(t[i]);continue}const h=r[i];if(!h||typeof h!="object"){t[i]=h,u(h);continue}if(Array.isArray(h))if(typeof h[0]=="string"){const[f,p,v]=h;switch(f){case Sl:u(t[i]=new Date(p));continue;case Dl:u(t[i]=new URL(p));continue;case Rl:u(t[i]=BigInt(p));continue;case Pl:u(t[i]=new RegExp(p,v));continue;case Ml:u(t[i]=Symbol.for(p));continue;case Cl:const w=new Set;t[i]=w;for(let M=h.length-1;M>0;M--)l.push([h[M],L=>{w.add(L)}]);u(w);continue;case xl:const x=new Map;t[i]=x;for(let M=h.length-2;M>0;M-=2){const L=[];l.push([h[M+1],T=>{L[1]=T}]),l.push([h[M],T=>{L[0]=T}]),s.push(()=>{x.set(L[0],L[1])})}u(x);continue;case Ll:const E=Object.create(null);t[i]=E;for(const M of Object.keys(p).reverse()){const L=[];l.push([p[M],T=>{L[1]=T}]),l.push([Number(M.slice(1)),T=>{L[0]=T}]),s.push(()=>{E[L[0]]=L[1]})}u(E);continue;case za:if(t[p])u(t[i]=t[p]);else{const M=new Ha;a[p]=M,u(t[i]=M.promise)}continue;case Ua:const[,R,b]=h;let C=b&&Jt&&Jt[b]?new Jt[b](R):new Error(R);t[i]=C,u(C);continue;case Tl:u(t[i]=t[p]);continue;default:if(Array.isArray(n)){const M=[],L=h.slice(1);for(let T=0;T<L.length;T++){const y=L[T];l.push([y,$=>{M[T]=$}])}s.push(()=>{for(const T of n){const y=T(h[0],...M);if(y){u(t[i]=y.value);return}}throw new SyntaxError});continue}throw new SyntaxError}}else{const f=[];t[i]=f;for(let p=0;p<h.length;p++){const v=h[p];v!==pl&&l.push([v,w=>{f[p]=w}])}u(f);continue}else{const f={};t[i]=f;for(const p of Object.keys(h).reverse()){const v=[];l.push([h[p],w=>{v[1]=w}]),l.push([Number(p.slice(1)),w=>{v[0]=w}]),s.push(()=>{f[v[0]]=v[1]})}u(f);continue}}for(;s.length>0;)s.pop()();return o}async function Ol(e,t){const{plugins:r}=t??{},a=new Ha,n=e.pipeThrough(Fl()).getReader(),o={values:[],hydrated:[],deferred:{},plugins:r},l=await kl.call(o,n);let s=a.promise;
5return l.done?a.resolve():s=Nl.call(o,n).then(a.resolve).catch(i=>{for(const u of Object.values(o.deferred))u.reject(i);a.reject(i)}),{done:s.then(()=>n.closed),value:l.value}}async function kl(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:ar.call(this,r)}}async function Nl(e){let t=await e.read();for(;!t.done;){if(!t.value)continue;const r=t.value;switch(r[0]){case za:{const a=r.indexOf(":"),n=Number(r.slice(1,a)),o=this.deferred[n];if(!o)throw new Error(`Deferred ID ${n} not found in stream`);const l=r.slice(a+1);let s;try{s=JSON.parse(l)}catch{throw new SyntaxError}const i=ar.call(this,s);o.resolve(i);break}case Ua:{const a=r.indexOf(":"),n=Number(r.slice(1,a)),o=this.deferred[n];if(!o)throw new Error(`Deferred ID ${n} not found in stream`);const l=r.slice(a+1);let s;try{s=JSON.parse(l)}catch{throw new SyntaxError}const i=ar.call(this,s);o.reject(i);break}default:throw new SyntaxError}t=await e.read()}}async function Il(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}var Al={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},$l=/[&><\u2028\u2029]/g;function _l(e){return e.replace($l,t=>Al[t])}function ne(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}var nr=Symbol("SingleFetchRedirect"),Ba=class extends Error{},jl=202,Ul=new Set([100,101,204,205]);function Yi(e,t,r,a,n){let o=zl(e,l=>{let s=t.routes[l.route.id];ne(s,"Route not found in manifest");let i=r[l.route.id];return{hasLoader:s.hasLoader,hasClientLoader:s.hasClientLoader,hasS
5houldRevalidate:!!i?.shouldRevalidate}},Kl,a,n);return async l=>l.runClientMiddleware(o)}function zl(e,t,r,a,n,o=()=>!0){return async l=>{let{request:s,matches:i,fetcherKey:u}=l,h=e();if(s.method!=="GET")return Hl(l,r,n);let f=i.some(p=>{let{hasLoader:v,hasClientLoader:w}=t(p);return p.unstable_shouldCallHandler()&&v&&!w});return!a&&!f?Bl(l,t,r,n):u?Yl(l,r,n):Wl(l,h,t,r,a,n,o)}}async function Hl(e,t,r){let a=e.matches.find(l=>l.unstable_shouldCallHandler());ne(a,"No action match found");let n,o=await a.resolve(async l=>await l(async()=>{let{data:i,status:u}=await t(e,r,[a.route.id]);return n=u,it(i,a.route.id)}));return fr(o.result)||Ue(o.result)||er(o.result)?{[a.route.id]:o}:{[a.route.id]:{type:o.type,result:eo(o.result,n)}}}async function Bl(e,t,r,a){let n=e.matches.filter(l=>l.unstable_shouldCallHandler()),o={};return await Promise.all(n.map(l=>l.resolve(async s=>{try{let{hasClientLoader:i}=t(l),u=l.route.id,h=i?await s(async()=>{let{data:f}=await r(e,a,[u]);return it(f,u)}):await s();o[l.route.id]={type:"data",result:h}}catch(i){o[l.route.id]={type:"error",result:i}}}))),o}async function Wl(e,t,r,a,n,o,l=()=>!0){let s=new Set,i=!1,u=e.matches.map(()=>da()),h=da(),f={},p=Promise.all(e.matches.map(async(w,x)=>w.resolve(async E=>{u[x].resolve();let R=w.route.id,{hasLoader:b,hasClientLoader:C,hasShouldRevalidate:M}=r(w),L=!w.unstable_shouldRevalidateArgs||w.unstable_shouldRevalidateArgs.actionStatus==null||w.unstable_shouldRevalidateArgs.actionStatus<400;if(!w.unstable_shouldCallHandler(L)){i||(i=w.unstable_shouldRevalidateArgs!=null&&b&&M===!0);return}if(l(w)&&C){b&&(i=!0);try{let y=await E(async()=>{let{data:$}=await a(e,o,[R]);return it($,R)});f[R]={type:"data",result:y}}catch(y){f[R]={type:"error",result:y}}return}b&&s.add(R);try{let y=await E(async()=>{let $=await h.promise;return it($,R)});f[R]={type:"data",result:y}}catch(y){f[R]={type:"error",result:y}}})));if(await Promise.all(u.map(w=>w.promise)),(!t.state.initialized&&t.state.navigation.state==="idle"||s.size===0)&&!window.__reactRouterHdrActive)h.resolve({routes:{}});else{let w=n&&i&&s.size>0?[...s.keys()]:void 0;try{let x=await a(e,o,w);h.resolve(x.data)}catch(x){h.reject(x)}}return await p,await Vl(h.promise,e.matches,s,f),f}async function Vl(e,t,r,a){try{let n,o=await e;if("routes"in o){for(let l of t)if(l.route.id in o.routes){let s=o.routes[l.route.id];if("error"in s){n=s.error,a[l.route.id]?.result==null&&(a[l.route.id]={type:"error",result:n});break}}}n!==void 0&&Array.from(r.values()).forEach(l=>{a[l].result instanceof Ba&&(a[l].result=n)})}catch{}}async function Yl(e,t,r){let a=e.matches.find(l=>l.unstable_shouldCallHandler());ne(a,"No fetcher match found");let n=a.route.id,o=await a.resolve(async l=>l(async()=>{let{data:s}=await t(e,r,[n]);return it(s,n)}));return{[a.route.id]:o}}function Jl(e){let t=e.searchParams.getAll("index");e.searchParams.delete("index");let r=[];for(let a of t)a&&r.push(a);for(let a of r)e.searchParams.append("index",a);return e}function Wa(e,t,r){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return a.pathname==="/"?a.pathname=`_root.${r}`:t&&oe(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${r}`,a}async function Kl(e,t,r){let{request:a}=e,n=Wa(a.url,t,"data");a.method==="GET"&&(n=Jl(n),r&&n.searchParams.set("_routes",r.join(",")));let o=await fetch(n,await Il(a));if(o.status>=400&&!o.headers.has("X-Remix-Response"))throw new je(o.status,o.statusText,await o.text());if(o.status===204&&o.headers.has("X-Remix-Redirect"))return{status:jl,data:{redirect:{redirect:o.headers.get("X-Remix-Redirect"),status:Number(o.headers.get("X-Remix-Status")||"302"),revalidate:o.headers.get("X-Remix-Revalidate")==="true",reload:o.headers.get("X-Remix-Reload-Document")==="true",replace:o.headers.get("X-Remix-Replace")==="true"}}};if(Ul.has(o.status)){let l={};return r&&a.method!=="GET"&&(l[r[0]]={data:void 0}),{status:o.status,data:{routes:l}}}ne(o.body,"No response body to decode");try{let l=await Xl(o.body,window),s;if(a.method==="GET"){let i=l.value;nr in i?s={redirect:i[nr]}:s={routes:i}}else{let i=l.value,u=r?.[0];ne(u,"No routeId found for single fetch call decoding"),"redirect"in i?s={redirect:i}:s={routes:{[u]:i}}}return{status:o.status,data:s}}catch{throw new Error("Unable to decode turbo-stream response")}}function Xl(e,t){return Ol(e,{plugins:[(r,...a)=>{if(r==="SanitizedError"){let[n,o,l]=a,s=Error;n&&n in t&&typeof t[n]=="function"&&(s=t[n]);let i=new s(o);return i.stack=l,{value:i}}if(r==="ErrorResponse"){let[n,o,l]=a;return{value:new je(o,l,n)}}if(r==="SingleFetchRedirect")return{value:{[nr]:a[0]}};if(r==="SingleFetchClassInstance")return{value:a[0]};if(r==="SingleFetchFallback")return{value:void 0}}]})}function it(e,t){if("redirect"in e){let{redirect:a,revalidate:n,reload:o,replace:l,status:s}=e.redirect;throw Ra(a,{status:s,headers:{...n?{"X-Remix-Revalidate":"yes"}:null,...o?{"X-Remix-Reload-Document":"yes"}:null,...l?{"X-Remix-Replace":"yes"}:null}})}let r=e.routes[t];if(r==null)throw new Ba(`No result found for routeId "${t}"`);if("error"in r)throw r.error;if("data"in r)return r.data;throw new Error(`Invalid response found for routeId "${t}"`)}function da(){let e,t,r=new Promise((a,n)=>{e=async o=>{a(o);try{await r}catch{}},t=async o=>
5{n(o);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}async function Va(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Gl(e,t,r){let a=e.map(o=>{let l=t[o.route.id],s=r.routes[o.route.id];return[s&&s.css?s.css.map(i=>({rel:"stylesheet",href:i})):[],l?.links?.()||[]]}).flat(2),n=xr(e,r);return Xa(a,n)}function Ya(e){return e.css?e.css.map(t=>({rel:"stylesheet",href:t})):[]}async function Ql(e){if(!e.css)return;let t=Ya(e);await Promise.all(t.map(Ka))}async function Ja(e,t){if(!e.css&&!t.links||!ri())return;let r=[];if(e.css&&r.push(...Ya(e)),t.links&&r.push(...t.links()),r.length===0)return;let a=[];for(let n of r)!Sr(n)&&n.rel==="stylesheet"&&a.push({...n,rel:"preload",as:"style"});await Promise.all(a.map(Ka))}async function Ka(e){return new Promise(t=>{if(e.media&&!window.matchMedia(e.media).matches||document.querySelector(`link[rel="stylesheet"][href="${e.href}"]`))return t();let r=document.createElement("link");Object.assign(r,e);function a(){document.head.contains(r)&&document.head.removeChild(r)}r.onload=()=>{a(),t()},r.onerror=()=>{a(),t()},document.head.appendChild(r)})}function Sr(e){return e!=null&&typeof e.page=="string"}function ql(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 Zl(e,t,r){let a=await Promise.all(e.map(async n=>{let o=t.routes[n.route.id];if(o){let l=await Va(o,r);return l.links?l.links():[]}return[]}));return Xa(a.flat(1).filter(ql).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?{...n,rel:"prefetch",as:"style"}:{...n,rel:"prefetch"}))}function fa(e,t,r,a,n,o){let l=(i,u)=>r[u]?i.route.id!==r[u].route.id:!0,s=(i,u)=>r[u].pathname!==i.pathname||r[u].route.path?.endsWith("*")&&r[u].params["*"]!==i.params["*"];return o==="assets"?t.filter((i,u)=>l(i,u)||s(i,u)):o==="data"?t.filter((i,u)=>{let h=a.routes[i.route.id];if(!h||!h.hasLoader)return!1;if(l(i,u)||s(i,u))return!0;if(i.route.shouldRevalidate){let f=i.route.shouldRevalidate({currentUrl:new URL(n.pathname+n.search+n.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:i.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}function xr(e,t,{includeHydrateFallback:r}={}){return ei(e.map(a=>{let n=t.routes[a.route.id];if(!n)return[];let o=[n.module];return n.clientActionModule&&(o=o.concat(n.clientActionModule)),n.clientLoaderModule&&(o=o.concat(n.clientLoaderModule)),r&&n.hydrateFallbackModule&&(o=o.concat(n.hydrateFallbackModule)),n.imports&&(o=o.concat(n.imports)),o}).flat(1))}function ei(e){return[...new Set(e)]}function ti(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}function Xa(e,t){let r=new Set,a=new Set(t);return e.reduce((n,o)=>{if(t&&!Sr(o)&&o.as==="script"&&o.href&&a.has(o.href))return n;let s=JSON.stringify(ti(o));return r.has(s)||(r.add(s),n.push({key:s,link:o})),n},[])}var bt;function ri(){if(bt!==void 0)return bt;let e=document.createElement("link");return bt=e.relList.supports("preload"),e=null,bt}function ai(){return d.createElement(or,{title:"Loading...",renderScripts:!0},d.createElement("script",{dangerouslySetInnerHTML:{__html:` 6 console.log( 7 "ð¿ Hey developer ð. You can provide a way better UX than this " + 8 "when your app is loading JS modules and/or running \`clientLoader\` " + 9 "functions. Check out https://reactrouter.com/start/framework/route-module#hydratefallback " + 10 "for more information." 11 ); 12 `}}))}function Ga(e){let t={};return Object.values(e).forEach(r=>{if(r){let a=r.parentId||"";t[a]||(t[a]=[]),t[a].push(r)}}),t}function ni(e,t,r){let a=Qa(t),n=t.HydrateFallback&&(!r||e.id==="root")?t.HydrateFallback:e.id==="root"?ai:void 0,o=t.ErrorBoundary?t.ErrorBoundary:e.id==="root"?()=>d.createElement(en,{error:Rr()}):void 0;return e.id==="root"&&t.Layout?{...a?{element:d.createElement(t.Layout,null,d.createElement(a,null))}:{Component:a},...o?{errorElement:d.createElement(t.Layout,null,d.createElement(o,null))}:{ErrorBoundary:o},...n?{hydrateFallbackElement:d.createElement(t.Layout,null,d.createElement(n,null))}:{HydrateFallback:n}}:{Component:a,ErrorBoundary:o,HydrateFallback:n}}function Ji(e,t,r,a,n,o){return Lr(t,r,a,n,o,"",Ga(t),e)}function Rt(e,t){if(e==="loader"&&!t.hasLoader||e==="action"&&!t.hasAction){let a=`You are trying to call ${e==="action"?"serverAction()":"serverLoader()"} on a route that does not have a server ${e} (routeId: "${t.id}")`;throw console.error(a),new je(400,"Bad Request",new Error(a),!0)}}function Kt(e,t){let r=e==="clientAction"?"a":"an",a=`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(a),new je(405,"Method Not Allowed",new Error(a),!0)}function Lr(e,t,r,a,n,o="",l=Ga(e),s){return(l[o]||[]).map(i=>{let u=t[i.id];function h(b){return ne(typeof b=="function","No single fetch function available for route handler"),b()}function f(b){return i.hasLoader?h(b):Promise.resolve(null)}function p(b){if(!i.hasAction)throw Kt("action",i.id);return h(b)}function v(b){import(b)}function w(b){b.clientActionModule&&v(b.clientActionModule),b.clientLoaderModule&&v(b.clientLoaderModule)}async function x(b){let C=t[i.id],M=C?Ja(i,C):Promise.resolve();try{return b()}finally{await M}}let E={id:i.id,index:i.index,path:i.path};if(u){Object.assign(E,{...E,...ni(i,u,n),middleware:u.clientMiddleware,handle:u.handle,shouldRevalidate:ha(E.path,u,i,a,s)});let b=r&&r.loaderData&&i.id in r.loaderData,C=b?r?.loaderData?.[i.id]:void 0,M=r&&r.errors&&i.id in r.errors,L=M?r?.errors?.[i.id]:void 0,T=s==null&&(u.clientLoader?.hydrate===!0||!i.hasLoader);E.loader=async({request:y,params:$,context:H,unstable_pattern:j},G)=>{try{return await x(async()=>(ne(u,"No `routeModule` available for critical-route loader"),u.clientLoader?u.clientLoader({request:y,params:$,context:H,unstable_pattern:j,async serverLoader(){if
12(Rt("loader",i),T){if(b)return C;if(M)throw L}return f(G)}}):f(G)))}finally{T=!1}},E.loader.hydrate=ii(i.id,u.clientLoader,i.hasLoader,n),E.action=({request:y,params:$,context:H,unstable_pattern:j},G)=>x(async()=>{if(ne(u,"No `routeModule` available for critical-route action"),!u.clientAction){if(n)throw Kt("clientAction",i.id);return p(G)}return u.clientAction({request:y,params:$,context:H,unstable_pattern:j,async serverAction(){return Rt("action",i),p(G)}})})}else{i.hasClientLoader||(E.loader=(M,L)=>x(()=>f(L))),i.hasClientAction||(E.action=(M,L)=>x(()=>{if(n)throw Kt("clientAction",i.id);return p(L)}));let b;async function C(){return b?await b:(b=(async()=>{(i.clientLoaderModule||i.clientActionModule)&&await new Promise(L=>setTimeout(L,0));let M=li(i,t);return w(i),await M})(),await b)}E.lazy={loader:i.hasClientLoader?async()=>{let{clientLoader:M}=i.clientLoaderModule?await import(i.clientLoaderModule):await C();return ne(M,"No `clientLoader` export found"),(L,T)=>M({...L,async serverLoader(){return Rt("loader",i),f(T)}})}:void 0,action:i.hasClientAction?async()=>{let M=i.clientActionModule?import(i.clientActionModule):C();w(i);let{clientAction:L}=await M;return ne(L,"No `clientAction` export found"),(T,y)=>L({...T,async serverAction(){return Rt("action",i),p(y)}})}
12:void 0,middleware:i.hasClientMiddleware?async()=>{let{clientMiddleware:M}=i.clientMiddlewareModule?await import(i.clientMiddlewareModule):await C();return ne(M,"No `clientMiddleware` export found"),M}:void 0,shouldRevalidate:async()=>{let M=await C();return ha(E.path,M,i,a,s)},handle:async()=>(await C()).handle,Component:async()=>(await C()).Component,ErrorBoundary:i.hasErrorBoundary?async()=>(await C()).ErrorBoundary:void 0}}let R=Lr(e,t,r,a,n,i.id,l,s);return R.length>0&&(E.children=R),E})}function ha(e,t,r,a,n){if(n)return oi(r.id,t.shouldRevalidate,n);if(!a&&r.hasLoader&&!r.hasClientLoader){let o=e?Ea(e)[1].map(s=>s.paramName):[];const l=s=>o.some(i=>s.currentParams[i]!==s.nextParams[i]);if(t.shouldRevalidate){let s=t.shouldRevalidate;return i=>s({...i,defaultShouldRevalidate:l(i)})}else return s=>l(s)}if(a&&t.shouldRevalidate){let o=t.shouldRevalidate;return l=>o({...l,defaultShouldRevalidate:!0})}return t.shouldRevalidate}function oi(e,t,r){let a=!1;return n=>a?t?t(n):n.defaultShouldRevalidate:(a=!0,r.has(e))}async function li(e,t){let r=Va(e,t),a=Ql(e),n=await r;return await Promise.all([a,Ja(e,n)]),{Component:Qa(n),ErrorBoundary:n.ErrorBoundary,clientMiddleware:n.clientMiddleware,clientAction:n.clientAction,clientLoader:n.clientLoader,handle:n.handle,links:n.links,meta:n.meta,shouldRevalidate:n.shouldRevalidate}}function Qa(e){if(e.default==null)return;if(!(typeof e.default=="object"&&Object.keys(e.default).length===0))return e.default}function ii(e,t,r,a){return a&&e!=="root"||t!=null&&(t.hydrate===!0||r!==!0)}var Ct=new Set,si=1e3,Tt=new Set,ui=7680;function Pr(e,t){return e.mode==="lazy"&&t===!0}function ci({sri:e,...t},r){let a=new Set(r.state.matches.map(s=>s.route.id)),n=r.state.location.pathname.split("/").filter(Boolean),o=["/"];for(n.pop();n.length>0;)o.push(`/${n.join("/")}`),n.pop();o.forEach(s=>{let i=Ce(r.routes,s,r.basename);i&&i.forEach(u=>a.add(u.route.id))});let l=[...a].reduce((s,i)=>Object.assign(s,{[i]:t.routes[i]}),{});return{...t,routes:l,sri:e?!0:void 0}}function Ki(e,t,r,a,n,o){if(Pr(a,r))return async({path:l,patch:s,signal:i,fetcherKey:u})=>{Tt.has(l)||await qa([l],u?window.location.href:l,e,t,r,n,o,a.manifestPath,s,i)}}function Xi(e,t,r,a,n,o){d.useEffect(()=>{if(!Pr(n,a)||window.navigator?.connection?.saveData===!0)return;function l(h){let f=h.tagName==="FORM"?h.getAttribute("action"):h.getAttribute("href");if(!f)return;let p=h.tagName==="A"?h.pathname:new URL(f,window.location.origin).pathname;Tt.has(p)||Ct.add(p)}async function s(){document.querySelectorAll("a[data-discover], form[data-discover]").forEach(l);let h=Array.from(Ct.keys()).filter(f=>Tt.has(f)?(Ct.delete(f),!1):!0);if(h.length!==0)try{await qa(h,null,t,r,a,o,e.basename,n.manifestPath,e.patchRoutes)}catch(f){console.error("Failed to fetch manifest patches",f)}}let i=hi(s,100);s();let u=new MutationObserver(()=>i());return u.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["data-discover","href","action"]}),()=>u.disconnect()},[a,o,t,r,e,n])}function di(e,t){let r=e||"/__manifest";return t==null?r:`${t}${r}`.replace(/\/+/g,"/")}var Xt="react-router-manifest-version";async function qa(e,t,r,a,n,o,l,s,i,u){const h=new URLSearchParams;h.set("paths",e.sort().join(",")),h.set("version",r.version);let f=new URL(di(s,l),window.location.origin);if(f.search=h.toString(),f.toString().length>ui){Ct.clear();return}let p;try{let E=await fetch(f,{signal:u});if(E.ok){if(E.status===204&&E.headers.has("X-Remix-Reload-Document")){if(!t){console.warn("Detected a manifest version mismatch during eager route discovery. The next navigation/fetch to an undiscovered route will result in a new document navigation to sync up with the latest manifest.");return}try{if(sessionStorage.getItem(Xt)===r.version){console.error("Unable to discover routes due to manifest version mismatch.");return}sessionStorage.setItem(Xt,r.version)}catch{}window.location.href=t,console.warn("Detected manifest version mismatch, reloading..."),await new Promise(()=>{})}else if(E.status>=400)throw new Error(await E.text())}else throw new Error(`${E.status} ${E.statusText}`);try{sessionStorage.removeItem(Xt)}catch{}p=await E.json()}
12catch(E){if(u?.aborted)return;throw E}let v=new Set(Object.keys(r.routes)),w=Object.values(p).reduce((E,R)=>(R&&!v.has(R.id)&&(E[R.id]=R),E),{});Object.assign(r.routes,w),e.forEach(E=>fi(E,Tt));let x=new Set;Object.values(w).forEach(E=>{E&&(!E.parentId||!w[E.parentId])&&x.add(E.parentId)}),x.forEach(E=>i(E||null,Lr(w,a,null,n,o,E)))}function fi(e,t){if(t.size>=si){let r=t.values().next().value;t.delete(r)}t.add(e)}function hi(e,t){let r;return(...a)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...a),t)}}function Cr(){let e=d.useContext(ze);return ne(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function It(){let e=d.useContext(Xe);return ne(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var At=d.createContext(void 0);At.displayName="FrameworkContext";function Ge(){let e=d.useContext(At);return ne(e,"You must render this element inside a <HydratedRouter> element"),e}function mi(e,t){let r=d.useContext(At),[a,n]=d.useState(!1),[o,l]=d.useState(!1),{onFocus:s,onBlur:i,onMouseEnter:u,onMouseLeave:h,onTouchStart:f}=t,p=d.useRef(null);d.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let x=R=>{R.forEach(b=>{l(b.isIntersecting)})},E=new IntersectionObserver(x,{threshold:.5});return p.current&&E.observe(p.current),()=>{E.disconnect()}}},[e]),d.useEffect(()=>{if(a){let x=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(x)}}},[a]);let v=()=>{n(!0)},w=()=>{n(!1),l(!1)};return r?e!=="intent"?[o,p,{}]:[o,p,{onFocus:rt(s,v),onBlur:rt(i,w),onMouseEnter:rt(u,v),onMouseLeave:rt(h,w),onTouchStart:rt(f,v)}]:[!1,p,{}]}function rt(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Mr(e,t,r){if(r&&!Ft)return[e[0]];if(t){let a=e.findIndex(n=>t[n.route.id]!==void 0);return e.slice(0,a+1)}return e}var ma="data-react-router-critical-css";function Gi({nonce:e}){let{isSpaMode:t,manifest:r,routeModules:a,criticalCss:n}=Ge(),{errors:o,matches:l}=It(),s=Mr(l,o,t),i=d.useMemo(()=>Gl(s,a,r),[s,a,r]);return d.createElement(d.Fragment,null,typeof n=="string"?d.createElement("style",{[ma]:"",dangerouslySetInnerHTML:{__html:n}}):null,typeof n=="object"?d.createElement("link",{[ma]:"",rel:"stylesheet",href:n.href,nonce:e}):null,i.map(({key:u,link:h})=>Sr(h)?d.createElement(Za,{key:u,nonce:e,...h}):d.createElement("link",{key:u,nonce:e,...h})))}function Za({page:e,...t}){let{router:r}=Cr(),a=d.useMemo(()=>Ce(r.routes,e,r.basename),[r.routes,e,r.basename]);return a?d.createElement(yi,{page:e,matches:a,...t}):null}function pi(e){let{manifest:t,routeModules:r}=Ge(),[a,n]=d.useState([]);return d.useEffect(()=>{let o=!1;return Zl(e,t,r).then(l=>{o||n(l)}),()=>{o=!0}},[e,t,r]),a}function yi({page:e,matches:t,...r}){let a=ve(),{manifest:n,routeModules:o}=Ge(),{basename:l}=Cr(),{loaderData:s,matches:i}=It(),u=d.useMemo(()=>fa(e,t,i,n,a,"data"),[e,t,i,n,a]),h=d.useMemo(()=>fa(e,t,i,n,a,"assets"),[e,t,i,n,a]),f=d.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let w=new Set,x=!1;if(t.forEach(R=>{let b=n.routes[R.route.id];!b||!b.hasLoader||(!u.some(C=>C.route.id===R.route.id)&&R.route.id in s&&o[R.route.id]?.shouldRevalidate||b.hasClientLoader?x=!0:w.add(R.route.id))}),w.size===0)return[];let E=Wa(e,l,"data");return x&&w.size>0&&E.searchParams.set("_routes",t.filter(R=>w.has(R.route.id)).map(R=>R.route.id).join(",")),[E.pathname+E.search]},[l,s,a,n,u,t,e,o]),p=d.useMemo(()=>xr(h,n),[h,n]),v=pi(h);return d.createElement(d.Fragment,null,f.map(w=>d.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...r})),p.map(w=>d.createElement("link",{key:w,rel:"modulepreload",href:w,...r})),v.map(({key:w,link:x})=>d.createElement("link",{key:w,nonce:r.nonce,...x})))}function Qi(){let{isSpaMode:e,routeModules:t}=Ge(),{errors:r,matches:a,loaderData:n}=It(),o=ve(),l=Mr(a,r,e),s=null;r&&(s=r[l[l.length-1].route.id]);let i=[],u=null,h=[];for(let f=0;f<l.length;f++){let p=l[f],v=p.route.id,w=n[v],x=p.params,E=t[v],R=[],b={id:v,data:w,loaderData:w,meta:[],params:p.params,pathname:p.pathname,handle:p.route.handle,error:s};if(h[f]=b,E?.meta?R=typeof E.meta=="function"?E.meta({data:w,loaderData:w,params:x,location:o,matches:h,error:s}):Array.isArray(E.meta)?[...E.meta]:E.meta:u&&(R=[...u]),R=R||[],!Array.isArray(R))throw new Error("The route at "+p.route.path+` returns an invali
12d value. All route meta functions must return an array of meta objects. 13 14To reference the meta function API, see https://remix.run/route/meta`);b.meta=R,h[f]=b,i=[...R],u=i}return d.createElement(d.Fragment,null,i.flat().map(f=>{if(!f)return null;if("tagName"in f){let{tagName:p,...v}=f;if(!vi(p))return console.warn(`A meta object uses an invalid tagName: ${p}. Expected either 'link' or 'meta'`),null;let w=p;return d.createElement(w,{key:JSON.stringify(v),...v})}if("title"in f)return d.createElement("title",{key:"title"},String(f.title));if("charset"in f&&(f.charSet??(f.charSet=f.charset),delete f.charset),"charSet"in f&&f.charSet!=null)return typeof f.charSet=="string"?d.createElement("meta",{key:"charSet",charSet:f.charSet}):null;if("script:ld+json"in f)try{let p=JSON.stringify(f["script:ld+json"]);return d.createElement("script",{key:`script:ld+json:${p}`,type:"application/ld+json",dangerouslySetInnerHTML:{__html:_l(p)}})}catch{return null}return d.createElement("meta",{key:JSON.stringify(f),...f})}))}function vi(e){return typeof e=="string"&&/^(meta|link)$/.test(e)}var Ft=!1;function gi(){Ft=!0}function wi(e){let{manifest:t,serverHandoffString:r,isSpaMode:a,renderMeta:n,routeDiscovery:o,ssr:l}=Ge(),{router:s,static:i,staticContext:u}=Cr(),{matches:h}=It(),f=$o(),p=Pr(o,l);
14n&&(n.didRenderScripts=!0);let v=Mr(h,null,a);d.useEffect(()=>{gi()},[]);let w=d.useMemo(()=>{if(f)return null;let b=u?`window.__reactRouterContext = ${r};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:" ",C=i?`${t.hmr?.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:""}${p?"":`import ${JSON.stringify(t.url)}`}; 15${v.map((M,L)=>{let T=`route${L}`,y=t.routes[M.route.id];ne(y,`Route ${M.route.id} not found in manifest`);let{clientActionModule:$,clientLoaderModule:H,clientMiddlewareModule:j,hydrateFallbackModule:G,module:ue}=y,pe=[...$?[{module:$,varName:`${T}_clientAction`}]:[],...H?[{module:H,varName:`${T}_clientLoader`}]:[],...j?[{module:j,varName:`${T}_clientMiddleware`}]:[],...G?[{module:G,varName:`${T}_HydrateFallback`}]:[],{module:ue,varName:`${T}_main`}];if(pe.length===1)return`import * as ${T} from ${JSON.stringify(ue)};`;let B=pe.map(ee=>`import * as ${ee.varName} from "${ee.module}";`).join(` 16`),V=`const ${T} = {${pe.map(ee=>`...${ee.varName}`).join(",")}};`;return[B,V].join(` 17`)}).join(` 18`)} 19 ${p?`window.__reactRouterManifest = ${JSON.stringify(ci(t,s),null,2)};`:""} 20 window.__reactRouterRouteModules = {${v.map((M,L)=>`${JSON.stringify(M.route.id)}:route${L}`).join(",")}}; 21 22import(${JSON.stringify(t.entry.module)});`:" ";return d.createElement(d.Fragment,null,d.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:b},type:void 0}),d.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:C},type:"module",async:!0}))},[]),x=Ft||f?[]:Ei(t.entry.imports.concat(xr(v,t,{includeHydrateFallback:!0}))),E=typeof t.sri=="object"?t.sri:{};return tr(!f,"The <Scripts /> element is a no-op when using RSC and can be safely removed."),Ft||f?null:d.createElement(d.Fragment,null,typeof t.sri=="object"?d.createElement("script",{"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:E})}}):null,p?null:d.createElement("link",{rel:"modulepreload",href:t.url,crossOrigin:e.crossOrigin,integrity:E[t.url],suppressHydrationWarning:!0}),d.createElement("link",{rel:"modulepreload",href:t.entry.module,crossOrigin:e.crossOrigin,integrity:E[t.entry.module],suppressHydrationWarning:!0}),x.map(R=>d.createElement("link",{key:R,rel:"modulepreload",href:R,crossOrigin:e.crossOrigin,integrity:E[R],suppressHydrationWarning:!0})),w)}function Ei(e){return[...new Set(e)]}function bi(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var qi=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(en,{error:this.state.error,isOutsideRemixApp:!0}):this.props.children}};function en({error:e,isOutsideRemixApp:t}){console.error(e);let r=d.createElement("script",{dangerouslySetInnerHTML:{__html:` 23 console.log( 24 "ð¿ Hey developer ð. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information." 25 ); 26 `}});if(Ue(e))return d.createElement(or,{title:"Unhandled Thrown Response!"},d.createElement("h1",{style:{fontSize:"24px"}},e.status," ",e.statusText),r);let a;if(e instanceof Error)a=e;else{let n=e==null?"Unknown Error":typeof e=="object"&&"toString"in e?e.toString():JSON.stringify(e);a=new Error(n)}return d.createElement(or,{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"}},a.stack),r)}function or({title:e,renderScripts:t,isOutsideRemixApp:r,children:a}){let{routeModules:n}=Ge();return n.root?.Layout&&!r?a: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"}},a,t?d.createElement(wi,null):null)))}var tn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{tn&&(window.__reactRouterVersion="7.9.6")}catch{}var rn=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,an=d.forwardRef(function({onClick:t,discover:r="render",prefetch:a="none",relative:n,reloadDocument:o,replace:l,state:s,target:i,to:u,preventScrollReset:h,viewTransition:f,...p},v){let{basename:w}=d.useContext(he),x=typeof u=="string"&&rn.test(u),E,R=!1;if(typeof u=="string"&&x&&(E=u,tn))try{let H=new URL(window.location.href),j=u.startsWith("//")?new URL(H.protocol+u):new URL(u),G=oe(j.pathname,w);j.origin===H.origin&&G!=null?u=G+j.search+j.hash:R=!0}catch{X(!1,`<Link to="${u}">
26 contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let b=jo(u,{relative:n}),[C,M,L]=mi(a,p),T=xi(u,{replace:l,state:s,target:i,preventScrollReset:h,relative:n,viewTransition:f});function y(H){t&&t(H),H.defaultPrevented||T(H)}let $=d.createElement("a",{...p,...L,href:E||b,onClick:R||o?t:y,ref:bi(v,M),target:i,"data-discover":!x&&r==="render"?"true":void 0});return C&&!x?d.createElement(d.Fragment,null,$,d.createElement(Za,{page:b})):$});an.displayName="Link";var Ri=d.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:a="",end:n=!1,style:o,to:l,viewTransition:s,children:i,...u},h){let f=ut(l,{relative:u.relative}),p=ve(),v=d.useContext(Xe),{navigator:w,basename:x}=d.useContext(he),E=v!=null&&Ti(f)&&s===!0,R=w.encodeLocation?w.encodeLocation(f).pathname:f.pathname,b=p.pathname,C=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;r||(b=b.toLowerCase(),C=C?C.toLowerCase():null,R=R.toLowerCase()),C&&x&&(C=oe(C,x)||C);const M=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let L=b===R||!n&&b.startsWith(R)&&b.charAt(M)==="/",T=C!=null&&(C===R||!n&&C.startsWith(R)&&C.charAt(R.length)==="/"),y={isActive:L,isPending:T,isTransitioning:E},$=L?t:void 0,H;typeof a=="function"?H=a(y):H=[a,L?"active":null,T?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let j=typeof o=="function"?o(y):o;return d.createElement(an,{...u,"aria-current":$,className:H,ref:h,style:j,to:l,viewTransition:s},typeof i=="function"?i(y):i)});Ri.displayName="NavLink";var nn=d.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:a,replace:n,state:o,method:l=Lt,action:s,onSubmit:i,relative:u,preventScrollReset:h,viewTransition:f,...p},v)=>{let w=sn(),x=Ci(s,{relative:u}),E=l.toLowerCase()==="get"?"get":"post",R=typeof s=="string"&&rn.test(s),b=C=>{if(i&&i(C),C.defaultPrevented)return;C.preventDefault();let M=C.nativeEvent.submitter,L=M?.getAttribute("formmethod")||l;w(M||C.currentTarget,{fetcherKey:t,method:L,navigate:r,replace:n,state:o,relative:u,preventScrollReset:h,viewTransition:f})};return d.createElement("form",{ref:v,method:E,action:x,onSubmit:a?i:b,...p,"data-discover":!R&&e==="render"?"true":void 0})});nn.displayName="Form";function Si({getKey:e,storageKey:t,...r}){let a=d.useContext(At),{basename:n}=d.useContext(he),o=ve(),l=wr();Mi({getKey:e,storageKey:t});let s=d.useMemo(()=>{if(!a||!e)return null;let u=ir(o,l,n,e);return u!==o.key?u:null},[]);if(!a||a.isSpaMode)return null;let i=((u,h)=>{if(!window.history.state||!window.history.state.key){let f=Math.random().toString(32).slice(2);window.history.replaceState({key:f},"")}try{let p=JSON.parse(sessionStorage.getItem(u)||"{}")[h||window.history.state.key];typeof p=="number"&&window.scrollTo(0,p)}catch(f){console.error(f),sessionStorage.removeItem(u)}}).toString();return d.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${i})(${JSON.stringify(t||lr)}, ${JSON.stringify(s)})`}})}Si.displayName="ScrollRestoration";function on(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function $t(e){let t=d.useContext(ze);return _(t,on(e)),t}function ln(e){let t=d.useContext(Xe);return _(t,on(e)),t}function xi(e,{target:t,replace:r,state:a,preventScrollReset:n,relative:o,viewTransition:l}={}){let s=Aa(),i=ve(),u=ut(e,{relative:o});return d.useCallback(h=>{if(cl(h,t)){h.preventDefault();let f=r!==void 0?r:Re(i)===Re(u);s(e,{replace:f,state:a,preventScrollReset:n,relative:o,viewTransition:l})}},[i,s,u,r,a,t,e,n,o,l])}function Zi(e){X(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=d.useRef(rr(e)),r=d.useRef(!1),a=ve(),n=d.useMemo(()=>dl(a.search,r.current?null:t.current),[a.search]),o=Aa(),l=d.useCallback((s,i)=>{const u=rr(typeof s=="function"?s(new URLSearchParams(n)):s);r.current=!0,o("?"+u,i)},[o,n]);return[n,l]}var Li=0,Pi=()=>`__${String(++Li)}__`;function sn(){let{router:e}=$t("useSubmit"),{basename:t}=d.useContext(he),r=Xo();return d.useCallback(async(a,n={})=>{let{action:o,method:l,encType:s,formData:i,body:u}=ml(a,t);if(n.navigate===!1){let h=n.fetcherKey||Pi();await e.fetch(h,r,n.action||o,{preventScrollReset:n.preventScrollReset,formData:i,body:u,formMethod:n.method||l,formEncType:n.encType||s,flushSync:n.flushSync})}else await e.navigate(n.action||o,{preventScrollReset:n.preventScrollReset,formData:i,body:u,formMethod:n.method||l,formEncType:n.encType||s,replace:n.replace,state:n.state,fromRouteId:r,flushSync:n.flushSync,viewTransition:n.viewTransition})},[e,t,r])}function Ci(e,{relative:t}={}){let{basename:r}=d.useContext(he),a=d.useContext(me);_(a,"useFormAction must be used inside a RouteContext");let[n]=a.matches.slice(-1),o={...ut(e||".",{relative:t})},l=ve();if(e==null){o.search=l.search;let s=new URLSearchParams(o.search),i=s.getAll("index");if(i.some(h=>h==="")){s.delete("index"),i.filter(f=>f).forEach(f=>s.append("index",f));let h=s.toString();o.search=h?`?${h}`:""}}return(!e||e===".")&&n.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:be([r,o.pathname])),Re(o
26)}function es({key:e}={}){let{router:t}=$t("useFetcher"),r=ln("useFetcher"),a=d.useContext(pr),n=d.useContext(me),o=n.matches[n.matches.length-1]?.route.id;_(a,"useFetcher must be used inside a FetchersContext"),_(n,"useFetcher must be used inside a RouteContext"),_(o!=null,'useFetcher can only be used on routes that contain a unique "id"');let l=d.useId(),[s,i]=d.useState(e||l);e&&e!==s&&i(e),d.useEffect(()=>(t.getFetcher(s),()=>t.deleteFetcher(s)),[t,s]);let u=d.useCallback(async(R,b)=>{_(o,"No routeId available for fetcher.load()"),await t.fetch(s,o,R,b)},[s,o,t]),h=sn(),f=d.useCallback(async(R,b)=>{await h(R,{...b,navigate:!1,fetcherKey:s})},[s,h]),p=d.useCallback(R=>t.resetFetcher(s,R),[t,s]),v=d.useMemo(()=>{let R=d.forwardRef((b,C)=>d.createElement(nn,{...b,navigate:!1,fetcherKey:s,ref:C}));return R.displayName="fetcher.Form",R},[s]),w=r.fetchers.get(s)||La,x=a.get(s);return d.useMemo(()=>({Form:v,submit:f,load:u,unstable_reset:p,...w,data:x}),[v,f,u,p,w,x])}var lr="react-router-scroll-positions",St={};function ir(e,t,r,a){let n=null;return a&&(r!=="/"?n=a({...e,pathname:oe(e.pathname,r)||e.pathname},t):n=a(e,t)),n==null&&(n=e.key),n}function Mi({getKey:e,storageKey:t}={}){let{router:r}=$t("useScrollRestoration"),{restoreScrollPosition:a,preventScrollReset:n}=ln("useScrollRestoration"),{basename:o}=d.useContext(he),l=ve(),s=wr(),i=Go();d.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),Di(d.useCallback(()=>{if(i.state==="idle"){let u=ir(l,s,o,e);St[u]=window.scrollY}try{sessionStorage.setItem(t||lr,JSON.stringify(St))}catch(u){X(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[i.state,e,o,l,s,t])),typeof document<"u"&&(d.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||lr);u&&(St=JSON.parse(u))}catch{}},[t]),d.useLayoutEffect(()=>{let u=r?.enableScrollRestoration(St,()=>window.scrollY,e?(h,f)=>ir(h,f,o,e):void 0);return()=>u&&u()},[r,o,e]),d.useLayoutEffect(()=>{if(a!==!1){if(typeof a=="number"){window.scrollTo(0,a);return}try{if(l.hash){let u=document.getElementById(decodeURIComponent(l.hash.slice(1)));if(u){u.scrollIntoView();return}}}catch{X(!1,`"${l.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}n!==!0&&window.scrollTo(0,0)}},[l,a,n]))}function Di(e,t){let{capture:r}={};d.useEffect(()=>{let a=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,a),()=>{window.removeEventListener("pagehide",e,a)}},[e,r])}function Ti(e,{relative:t}={}){let r=d.useContext(mr);_(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=$t("useViewTransitionState"),n=ut(e,{relative:t});if(!r.isTransitioning)return!1;let o=oe(r.currentLocation.pathname,a)||r.currentLocation.pathname,l=oe(r.nextLocation.pathname,a)||r.nextLocation.pathname;return Mt(n.pathname,l)!=null||Mt(n.pathname,o)!=null}export{Xi as A,zi as B,Xl as C,Lr as D,je as E,At as F,Ii as G,Ki as H,Yi as I,Oi as J,Ji as K,an as L,Qi as M,Ri as N,Hi as O,ji as P,Ui as Q,qi as R,Si as S,Ai as a,Go as b,Wi as c,eo as d,Aa as e,Ni as f,es as g,ve as h,ki as i,vr as j,sn as k,_i as l,wr as m,Vi as n,$i as o,Gi as p,wi as q,Ra as r,Ue as s,Er as t,Zi as u,Ce as v,Bi as w,ii as x,Ul as y,_ as z};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.