/*! For license information please see lib-router.dd86e7a1.js.LICENSE.txt */ "use strict";(self.webpackChunkclient=self.webpackChunkclient||[]).push([["9535"],{18096:function(e,t,r){r.d(t,{AO:()=>f,BV:()=>tM,Gy:()=>t3,N_:()=>t4,Ys:()=>t0,Zp:()=>to,kc:()=>t8,ok:()=>t5,pg:()=>tP,qh:()=>t$,wQ:()=>tr,zy:()=>tt});var n,a,o=r(60175),i=e=>{throw TypeError(e)},l=(e,t,r)=>(t.has(e)||i("Cannot read from private field"),r?r.call(e):t.get(e)),s="popstate";function u(e,t){if(!1===e||null==e)throw Error(t)}function c(e,t){if(!e){"u">typeof console&&console.warn(t);try{throw Error(t)}catch(e){}}}function d(e,t){return{usr:e.state,key:e.key,idx:t}}function h(e,t,r=null,n){return{pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?p(t):t,state:r,key:t&&t.key||n||Math.random().toString(36).substring(2,10)}}function f({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 p(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function m(e,t=!1){let r="http://localhost";"u">typeof window&&(r="null"!==window.location.origin?window.location.origin:window.location.href),u(r,"No window.location.(origin|href) available to create URL");let n="string"==typeof e?e:f(e);return n=n.replace(/ $/,"%20"),!t&&n.startsWith("//")&&(n=r+n),new URL(n,r)}var y=class{constructor(e){if(((e,t,r)=>t.has(e)?i("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r))(this,a,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(l(this,a).has(e))return l(this,a).get(e);if(void 0!==e.defaultValue)return e.defaultValue;throw Error("No value found for context")}set(e,t){l(this,a).set(e,t)}};a=new WeakMap;var v=new Set(["lazy","caseSensitive","path","id","index","children"]),g=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function w(e,t,r=[],n={},a=!1){return e.map((e,o)=>{let i=[...r,String(o)],l="string"==typeof e.id?e.id:i.join("-");if(u(!0!==e.index||!e.children,"Cannot specify children on an index route"),u(a||!n[l],`Found a route id collision on id "${l}". Route id's must be globally unique within Data Router usages`),!0===e.index){let r={...e,id:l};return n[l]=b(r,t(r)),r}{let r={...e,id:l,children:void 0};return n[l]=b(r,t(r)),e.children&&(r.children=w(e.children,t,i,n,a)),r}})}function b(e,t){return Object.assign(e,{...t,..."object"==typeof t.lazy&&null!=t.lazy?{lazy:{...e.lazy,...t.lazy}}:{}})}function E(e,t,r="/"){return R(e,t,r,!1)}function R(e,t,r,n){let a=P(("string"==typeof t?p(t):t).pathname||"/",r);if(null==a)return null;let o=function e(t,r=[],n=[],a="",o=!1){let i=(t,i,l=o,s)=>{var c,d;let h,f,p={relativePath:void 0===s?t.path||"":s,caseSensitive:!0===t.caseSensitive,childrenIndex:i,route:t};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(a)&&l)return;u(p.relativePath.startsWith(a),`Absolute route path "${p.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(a.length)}let m=j([a,p.relativePath]),y=n.concat(p);t.children&&t.children.length>0&&(u(!0!==t.index,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),e(t.children,r,y,m,l)),(null!=t.path||t.index)&&r.push({path:m,score:(c=m,d=t.index,f=(h=c.split("/")).length,h.some(C)&&(f+=-2),d&&(f+=2),h.filter(e=>!C(e)).reduce((e,t)=>e+(S.test(t)?3:""===t?1:10),f)),routesMeta:y})};return t.forEach((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let r of function e(t){let r=t.split("/");if(0===r.length)return[];let[n,...a]=r,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(0===a.length)return o?[i,""]:[i];let l=e(a.join("/")),s=[];return s.push(...l.map(e=>""===e?i:[i,e].join("/"))),o&&s.push(...l),s.map(e=>t.startsWith("/")&&""===e?"/":e)}(e.path))i(e,t,!0,r);else i(e,t)}),r}(e);o.sort((e,t)=>{var r,n;return e.score!==t.score?t.score-e.score:(r=e.routesMeta.map(e=>e.childrenIndex),n=t.routesMeta.map(e=>e.childrenIndex),r.length===n.length&&r.slice(0,-1).every((e,t)=>e===n[t])?r[r.length-1]-n[n.length-1]:0)});let i=null;for(let e=0;null==i&&edecodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return c(!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}}(a);i=function(e,t,r=!1){let{routesMeta:n}=e,a={},o="/",i=[];for(let e=0;e"*"===e;function k(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=function(e,t=!1,r=!0){c("*"===e||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,r)=>(n.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let o=a[0],i=o.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce((e,{paramName:t,isOptional:r},n)=>{if("*"===t){let e=l[n]||"";i=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}let a=l[n];return r&&!a?e[t]=void 0:e[t]=(a||"").replace(/%2F/g,"/"),e},{}),pathname:o,pathnameBase:i,pattern:e}}function P(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&"/"!==n?null:e.slice(r)||"/"}var L=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function D(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)}),r.length>1?r.join("/"):"/"}function $(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function T(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function M(e){let t=T(e);return t.map((e,r)=>r===t.length-1?e.pathname:e.pathnameBase)}function O(e,t,r,n=!1){let a,o;"string"==typeof e?a=p(e):(u(!(a={...e}).pathname||!a.pathname.includes("?"),$("?","pathname","search",a)),u(!a.pathname||!a.pathname.includes("#"),$("#","pathname","hash",a)),u(!a.search||!a.search.includes("#"),$("#","search","hash",a)));let i=""===e||""===a.pathname,l=i?"/":a.pathname;if(null==l)o=r;else{let e=t.length-1;if(!n&&l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}o=e>=0?t[e]:"/"}let s=function(e,t="/"){let r,{pathname:n,search:a="",hash:o=""}="string"==typeof e?p(e):e;if(n){let e;if(e=n,L.test(e))r=n;else{if(n.includes("//")){let e=n;n=n.replace(/\/\/+/g,"/"),c(!1,`Pathnames cannot have embedded double slashes - normalizing ${e} -> ${n}`)}r=n.startsWith("/")?D(n.substring(1),"/"):D(n,t)}}else r=t;return{pathname:r,search:z(a),hash:U(o)}}(a,o),d=l&&"/"!==l&&l.endsWith("/"),h=(i||"."===l)&&r.endsWith("/");return!s.pathname.endsWith("/")&&(d||h)&&(s.pathname+="/"),s}var j=e=>e.join("/").replace(/\/\/+/g,"/"),A=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),z=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",U=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",_=class{constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function F(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}function N(e){return e.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var H="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function B(e,t){let r=e;if("string"!=typeof r||!L.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,a=!1;if(H)try{let e=new URL(window.location.href),n=new URL(r.startsWith("//")?e.protocol+r:r),o=P(n.pathname,t);n.origin===e.origin&&null!=o?r=o+n.search+n.hash:a=!0}catch(e){c(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:a,to:r}}var I=Symbol("Uninstrumented");function W(e,t,r){return 0===e.length?null:async(...n)=>{let a=await Y(e,r(...n),()=>t(...n),e.length-1);if("error"===a.type)throw a.value;return a.value}}async function Y(e,t,r,n){let a,o=e[n];if(o){let i,l=async()=>(i?console.error("You cannot call instrumented handlers more than once"):i=Y(e,t,r,n-1),u(a=await i,"Expected a result"),"error"===a.type&&a.value instanceof Error)?{status:"error",error:a.value}:{status:"success",error:void 0};try{await o(l,t)}catch(e){console.error("An instrumentation function threw an error:",e)}i||await l(),await i}else try{let e=await r();a={type:"success",value:e}}catch(e){a={type:"error",value:e}}return a||{type:"error",value:Error("No result assigned in instrumentation chain.")}}function q(e){var t;let{request:r,context:n,params:a,unstable_pattern:o}=e;return{request:{method:(t=r).method,url:t.url,headers:{get:(...e)=>t.headers.get(...e)}},params:{...a},unstable_pattern:o,context:function(e){if(!function(e){if(null===e||"object"!=typeof e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||null===t||Object.getOwnPropertyNames(t).sort().join("\0")===J}(e))return{get:t=>e.get(t)};{let t={...e};return Object.freeze(t),t}}(n)}}function V(e,t){return{currentUrl:f(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}:{}}}var J=Object.getOwnPropertyNames(Object.prototype).sort().join("\0"),K=["POST","PUT","PATCH","DELETE"],X=new Set(K),G=new Set(["GET",...K]),Q=new Set([301,302,303,307,308]),Z=new Set([307,308]),ee={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},et={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},er={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},en=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),ea="remix-router-transitions",eo=Symbol("ResetLoaderData");function ei(e,t,r,n,a,o){let i,l;if(a){for(let e of(i=[],t))if(i.push(e),e.route.id===a){l=e;break}}else i=t,l=t[t.length-1];let s=O(n||".",M(i),P(e.pathname,r)||e.pathname,"path"===o);if(null==n&&(s.search=e.search,s.hash=e.hash),(null==n||""===n||"."===n)&&l){let e=eq(s.search);if(l.route.index&&!e)s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index";else if(!l.route.index&&e){let e=new URLSearchParams(s.search),t=e.getAll("index");e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let r=e.toString();s.search=r?`?${r}`:""}}return"/"!==r&&(s.pathname=function({basename:e,pathname:t}){return"/"===t?e:j([e,t])}({basename:r,pathname:s.pathname})),f(s)}function el(e,t,r){var n;let a,o;if(!r||!(null!=r&&("formData"in r&&null!=r.formData||"body"in r&&void 0!==r.body)))return{path:t};if(r.formMethod&&(n=r.formMethod,!G.has(n.toUpperCase())))return{path:t,error:eU(405,{method:r.formMethod})};let i=()=>({path:t,error:eU(400,{type:"invalid-body"})}),l=(r.formMethod||"get").toUpperCase(),s=eF(t);if(void 0!==r.body){if("text/plain"===r.formEncType){if(!eY(l))return i();let e="string"==typeof r.body?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((e,[t,r])=>`${e}${t}=${r} `,""):String(r.body);return{path:t,submission:{formMethod:l,formAction:s,formEncType:r.formEncType,formData:void 0,json:void 0,text:e}}}else if("application/json"===r.formEncType){if(!eY(l))return i();try{let e="string"==typeof r.body?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:l,formAction:s,formEncType:r.formEncType,formData:void 0,json:e,text:void 0}}}catch(e){return i()}}}if(u("function"==typeof FormData,"FormData is not available in this environment"),r.formData)a=e$(r.formData),o=r.formData;else if(r.body instanceof FormData)a=e$(r.body),o=r.body;else if(r.body instanceof URLSearchParams)o=eT(a=r.body);else if(null==r.body)a=new URLSearchParams,o=new FormData;else try{a=new URLSearchParams(r.body),o=eT(a)}catch(e){return i()}let c={formMethod:l,formAction:s,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:o,json:void 0,text:void 0};if(eY(c.formMethod))return{path:t,submission:c};let d=p(t);return e&&d.search&&eq(d.search)&&a.append("index",""),d.search=`?${a}`,{path:f(d),submission:c}}function es(e,t,r,n,a,o,i,l,s,u,c,d,h,f,p,m,y,v,g,w,b){let R,x=w?eH(w[1])?w[1].error:w[1].data:void 0,S=a.createURL(o.location),C=a.createURL(s);if(c&&o.errors){let e=Object.keys(o.errors)[0];R=i.findIndex(t=>t.route.id===e)}else if(w&&eH(w[1])){let e=w[0];R=i.findIndex(t=>t.route.id===e)-1}let k=w?w[1].statusCode:void 0,P=k&&k>=400,L={currentUrl:S,currentParams:o.matches[0]?.params||{},nextUrl:C,nextParams:i[0].params,...l,actionResult:x,actionStatus:k},D=N(i),$=i.map((a,i)=>{var l,s,h,f,p;let m,y,v,{route:g}=a,w=null;if(null!=R&&i>R?w=!1:g.lazy?w=!0:eu(g)?c?w=ec(g,o.loaderData,o.errors):(l=o.loaderData,s=o.matches[i],h=a,m=!s||h.route.id!==s.route.id,y=!l.hasOwnProperty(h.route.id),(m||y)&&(w=!0)):w=!1,null!==w)return eR(r,n,e,D,a,u,t,w);let E=!1;"boolean"==typeof b?E=b:P?E=!1:d||S.pathname+S.search===C.pathname+C.search||S.search!==C.search?E=!0:(f=o.matches[i],p=a,v=f.route.path,(f.pathname!==p.pathname||null!=v&&v.endsWith("*")&&f.params["*"]!==p.params["*"])&&(E=!0));let x={...L,defaultShouldRevalidate:E},k=ed(a,x);return eR(r,n,e,D,a,u,t,k,x,b)}),T=[];return p.forEach((e,l)=>{if(c||!i.some(t=>t.route.id===e.routeId)||f.has(l))return;let s=o.fetchers.get(l),p=s&&"idle"!==s.state&&void 0===s.data,w=E(y,e.path,v);if(!w){if(g&&p)return;T.push({key:l,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(m.has(l))return;let R=eV(w,e.path),x=new AbortController,S=eD(a,e.path,x.signal),C=null;if(h.has(l))h.delete(l),C=ex(r,n,S,w,R,u,t);else if(p)d&&(C=ex(r,n,S,w,R,u,t));else{let e={...L,defaultShouldRevalidate:"boolean"==typeof b?b:!P&&d};ed(R,e)&&(C=ex(r,n,S,w,R,u,t,e))}C&&T.push({key:l,routeId:e.routeId,path:e.path,matches:C,match:R,request:S,controller:x})}),{dsMatches:$,revalidatingFetchers:T}}function eu(e){return null!=e.loader||null!=e.middleware&&e.middleware.length>0}function ec(e,t,r){if(e.lazy)return!0;if(!eu(e))return!1;let n=null!=t&&e.id in t,a=null!=r&&void 0!==r[e.id];return(!!n||!a)&&("function"==typeof e.loader&&!0===e.loader.hydrate||!n&&!a)}function ed(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}function eh(e,t,r,n,a,o){let i;if(e){let t=n[e];u(t,`No route found to patch children into: routeId = ${e}`),t.children||(t.children=[]),i=t.children}else i=r;let l=[],s=[];if(t.forEach(e=>{let t=i.find(t=>(function e(t,r){return"id"in t&&"id"in r&&t.id===r.id||t.index===r.index&&t.path===r.path&&t.caseSensitive===r.caseSensitive&&((!t.children||0===t.children.length)&&(!r.children||0===r.children.length)||t.children.every((t,n)=>r.children?.some(r=>e(t,r))))})(e,t));t?s.push({existingRoute:t,newRoute:e}):l.push(e)}),l.length>0){let t=w(l,a,[e||"_","patch",String(i?.length||"0")],n);i.push(...t)}if(o&&s.length>0)for(let e=0;e{let a=r[t.id];if(u(a,"No route found in manifest"),!a.lazy||"object"!=typeof a.lazy)return;let o=a.lazy[e];if(!o)return;let i=ef.get(a);i||(i={},ef.set(a,i));let l=i[e];if(l)return l;let s=(async()=>{let t=v.has(e),r=void 0!==a[e]&&"hasErrorBoundary"!==e;if(t)c(!t,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),i[e]=Promise.resolve();else if(r)c(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await o();null!=t&&(Object.assign(a,{[e]:t}),Object.assign(a,n(a)))}"object"==typeof a.lazy&&(a.lazy[e]=void 0,Object.values(a.lazy).every(e=>void 0===e)&&(a.lazy=void 0))})();return i[e]=s,s},em=new WeakMap;async function ey(e){let t=e.matches.filter(e=>e.shouldLoad),r={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,n)=>{r[t[n].route.id]=e}),r}async function ev(e){return e.matches.some(e=>e.route.middleware)?eg(e,()=>ey(e)):ey(e)}function eg(e,t){return ew(e,t,e=>{var t,r;if(eW(t=e)&&(r=t.status,Q.has(r))&&t.headers.has("Location"))throw e;return e},eN,function(t,r,n){if(n)return Promise.resolve(Object.assign(n.value,{[r]:{type:"error",result:t}}));{let{matches:n}=e,a=Math.min(Math.max(n.findIndex(e=>e.route.id===r),0),Math.max(n.findIndex(e=>e.shouldCallHandler()),0));return Promise.resolve({[eA(n,n[a].route.id).route.id]:{type:"error",result:t}})}})}async function ew(e,t,r,n,a){let{matches:o,request:i,params:l,context:s,unstable_pattern:u}=e,c=o.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]);return await eb({request:i,params:l,context:s,unstable_pattern:u},c,t,r,n,a)}async function eb(e,t,r,n,a,o,i=0){let l,{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let u=t[i];if(!u)return await r();let[c,d]=u,h=async()=>{if(l)throw Error("You may only call `next()` once per middleware");try{return(l={value:await eb(e,t,r,n,a,o,i+1)}).value}catch(e){return(l={value:await o(e,c,l)}).value}};try{let t=await d(e,h),r=null!=t?n(t):void 0;if(a(r))return r;if(l)return r??l.value;return(l={value:await h()}).value}catch(e){return await o(e,c,l)}}function eE(e,t,r,n,a){let o=ep({key:"middleware",route:n.route,manifest:t,mapRouteProperties:e}),i=function(e,t,r,n,a){let o,i=r[e.id];if(u(i,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if("function"==typeof e.lazy){let t=em.get(i);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let r=(async()=>{u("function"==typeof e.lazy,"No lazy route function found");let t=await e.lazy(),r={};for(let e in t){let n=t[e];if(void 0===n)continue;let a=g.has(e),o=void 0!==i[e]&&"hasErrorBoundary"!==e;a?c(!a,"Route property "+e+" is not a supported property to be returned from a lazy route function. This property will be ignored."):o?c(!o,`Route "${i.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):r[e]=n}Object.assign(i,r),Object.assign(i,{...n(i),lazy:void 0})})();return em.set(i,r),r.catch(()=>{}),{lazyRoutePromise:r,lazyHandlerPromise:r}}let l=Object.keys(e.lazy),s=[];for(let i of l){if(a&&a.includes(i))continue;let l=ep({key:i,route:e,manifest:r,mapRouteProperties:n});l&&(s.push(l),i===t&&(o=l))}let d=s.length>0?Promise.all(s).then(()=>{}):void 0;return d?.catch(()=>{}),o?.catch(()=>{}),{lazyRoutePromise:d,lazyHandlerPromise:o}}(n.route,eY(r.method)?"action":"loader",t,e,a);return{middleware:o,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function eR(e,t,r,n,a,o,i,l,s=null,u){let c=!1,d=eE(e,t,r,a,o);return{...a,_lazyPromises:d,shouldLoad:l,shouldRevalidateArgs:s,shouldCallHandler:e=>(c=!0,s)?"boolean"==typeof u?ed(a,{...s,defaultShouldRevalidate:u}):"boolean"==typeof e?ed(a,{...s,defaultShouldRevalidate:e}):ed(a,s):l,resolve(e){let{lazy:t,loader:o,middleware:s}=a.route,u=c||l||e&&!eY(r.method)&&(t||o),h=s&&s.length>0&&!o&&!t;return u&&(eY(r.method)||!h)?eC({request:r,unstable_pattern:n,match:a,lazyHandlerPromise:d?.handler,lazyRoutePromise:d?.route,handlerOverride:e,scopedContext:i}):Promise.resolve({type:"data",result:void 0})}}}function ex(e,t,r,n,a,o,i,l=null){return n.map(s=>s.route.id!==a.route.id?{...s,shouldLoad:!1,shouldRevalidateArgs:l,shouldCallHandler:()=>!1,_lazyPromises:eE(e,t,r,s,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:eR(e,t,r,N(n),s,o,i,!0,l))}async function eS(e,t,r,n,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let i={request:t,unstable_pattern:N(r),params:r[0].params,context:a,matches:r},l=o?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>eg(i,()=>e({...i,fetcherKey:n,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}})),s=await e({...i,fetcherKey:n,runClientMiddleware:l});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch(e){}return s}async function eC({request:e,unstable_pattern:t,match:r,lazyHandlerPromise:n,lazyRoutePromise:a,handlerOverride:o,scopedContext:i}){let l,s,u=eY(e.method),c=u?"action":"loader",d=n=>{let a,l=new Promise((e,t)=>a=t);s=()=>a(),e.signal.addEventListener("abort",s);let u=a=>"function"!=typeof n?Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${c}" [routeId: ${r.route.id}]`)):n({request:e,unstable_pattern:t,params:r.params,context:i},...void 0!==a?[a]:[]);return Promise.race([(async()=>{try{let e=await (o?o(e=>u(e)):u());return{type:"data",result:e}}catch(e){return{type:"error",result:e}}})(),l])};try{let t=u?r.route.action:r.route.loader;if(n||a)if(t){let e,[r]=await Promise.all([d(t).catch(t=>{e=t}),n,a]);if(void 0!==e)throw e;l=r}else{await n;let t=u?r.route.action:r.route.loader;if(t)[l]=await Promise.all([d(t),a]);else{if("action"!==c)return{type:"data",result:void 0};let t=new URL(e.url),n=t.pathname+t.search;throw eU(405,{method:e.method,pathname:n,routeId:r.route.id})}}else if(t)l=await d(t);else{let t=new URL(e.url),r=t.pathname+t.search;throw eU(404,{pathname:r})}}catch(e){return{type:"error",result:e}}finally{s&&e.signal.removeEventListener("abort",s)}return l}async function ek(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?null==e.body?null:e.json():e.text()}async function eP(e){let{result:t,type:r}=e;if(eW(t)){let e;try{e=await ek(t)}catch(e){return{type:"error",error:e}}return"error"===r?{type:"error",error:new _(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:"data",data:e,statusCode:t.status,headers:t.headers}}if("error"===r){if(eI(t)){var n;return 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:(n=t,new _(n.init?.status??500,n.init?.statusText??"Internal Server Error",n.data)),statusCode:F(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}}return{type:"error",error:t,statusCode:F(t)?t.status:void 0}}return eI(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 eL(e,t,r,n){let a=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(L.test(e)){let n=new URL(e.startsWith("//")?t.protocol+e:e);if(a.includes(n.protocol))throw Error("Invalid redirect location");let o=null!=P(n.pathname,r);if(n.origin===t.origin&&o)return n.pathname+n.search+n.hash}try{let t=n.createURL(e);if(a.includes(t.protocol))throw Error("Invalid redirect location")}catch(e){}return e}function eD(e,t,r,n){let a=e.createURL(eF(t)).toString(),o={signal:r};if(n&&eY(n.formMethod)){let{formMethod:e,formEncType:t}=n;o.method=e.toUpperCase(),"application/json"===t?(o.headers=new Headers({"Content-Type":t}),o.body=JSON.stringify(n.json)):"text/plain"===t?o.body=n.text:"application/x-www-form-urlencoded"===t&&n.formData?o.body=e$(n.formData):o.body=n.formData}return new Request(a,o)}function e$(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"==typeof n?n:n.name);return t}function eT(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function eM(e,t,r,n,a,o){let{loaderData:i,errors:l}=function(e,t,r,n=!1,a=!1){let o,i={},l=null,s=!1,c={},d=r&&eH(r[1])?r[1].error:void 0;return e.forEach(r=>{if(!(r.route.id in t))return;let h=r.route.id,f=t[h];if(u(!eB(f),"Cannot handle redirect results in processLoaderData"),eH(f)){let t=f.error;if(void 0!==d&&(t=d,d=void 0),l=l||{},a)l[h]=t;else{let r=eA(e,h);null==l[r.route.id]&&(l[r.route.id]=t)}n||(i[h]=eo),s||(s=!0,o=F(f.error)?f.error.status:500),f.headers&&(c[h]=f.headers)}else i[h]=f.data,f.statusCode&&200!==f.statusCode&&!s&&(o=f.statusCode),f.headers&&(c[h]=f.headers)}),void 0!==d&&r&&(l={[r[0]]:d},r[2]&&(i[r[2]]=void 0)),{loaderData:i,errors:l,statusCode:o||200,loaderHeaders:c}}(t,r,n);return a.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:r,match:n,controller:a}=t;if(a&&a.signal.aborted)return;let i=o[r];if(u(i,"Did not find corresponding fetcher result"),eH(i)){let t=eA(e.matches,n?.route.id);l&&l[t.route.id]||(l={...l,[t.route.id]:i.error}),e.fetchers.delete(r)}else if(eB(i))u(!1,"Unhandled fetcher revalidation redirect");else{let t=eG(i.data);e.fetchers.set(r,t)}}),{loaderData:i,errors:l}}function eO(e,t,r,n){let a=Object.entries(t).filter(([,e])=>e!==eo).reduce((e,[t,r])=>(e[t]=r,e),{});for(let o of r){let r=o.route.id;if(!t.hasOwnProperty(r)&&e.hasOwnProperty(r)&&o.route.loader&&(a[r]=e[r]),n&&n.hasOwnProperty(r))break}return a}function ej(e){return e?eH(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function eA(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>!0===e.route.hasErrorBoundary)||e[0]}function ez(e){let t=1===e.length?e[0]:e.find(e=>e.index||!e.path||"/"===e.path)||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function eU(e,{pathname:t,routeId:r,method:n,type:a,message:o}={}){let i="Unknown Server Error",l="Unknown @remix-run/router error";return 400===e?(i="Bad Request",n&&t&&r?l=`You made a ${n} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:"invalid-body"===a&&(l="Unable to encode submission body")):403===e?(i="Forbidden",l=`Route "${r}" does not match URL "${t}"`):404===e?(i="Not Found",l=`No route matches URL "${t}"`):405===e&&(i="Method Not Allowed",n&&t&&r?l=`You made a ${n.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:n&&(l=`Invalid request method "${n.toUpperCase()}"`)),new _(e||500,i,Error(l),!0)}function e_(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[r,n]=t[e];if(eB(n))return{key:r,result:n}}}function eF(e){return f({..."string"==typeof e?p(e):e,hash:""})}function eN(e){return null!=e&&"object"==typeof e&&Object.entries(e).every(([e,t])=>{var r;return"string"==typeof e&&null!=(r=t)&&"object"==typeof r&&"type"in r&&"result"in r&&("data"===r.type||"error"===r.type)})}function eH(e){return"error"===e.type}function eB(e){return"redirect"===(e&&e.type)}function eI(e){return"object"==typeof e&&null!=e&&"type"in e&&"data"in e&&"init"in e&&"DataWithResponseInit"===e.type}function eW(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"==typeof e.headers&&void 0!==e.body}function eY(e){return X.has(e.toUpperCase())}function eq(e){return new URLSearchParams(e).getAll("index").some(e=>""===e)}function eV(e,t){let r="string"==typeof t?p(t).search:t.search;if(e[e.length-1].route.index&&eq(r||""))return e[e.length-1];let n=T(e);return n[n.length-1]}function eJ(e){let{formMethod:t,formAction:r,formEncType:n,text:a,formData:o,json:i}=e;if(t&&r&&n){if(null!=a)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:a};else if(null!=o)return{formMethod:t,formAction:r,formEncType:n,formData:o,json:void 0,text:void 0};else if(void 0!==i)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function eK(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 eX(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 eG(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 eQ(){let e,t,r=new Promise((n,a)=>{e=async e=>{n(e);try{await r}catch(e){}},t=async e=>{a(e);try{await r}catch(e){}}});return{promise:r,resolve:e,reject:t}}var eZ=o.createContext(null);eZ.displayName="DataRouter";var e0=o.createContext(null);e0.displayName="DataRouterState";var e1=o.createContext(!1);function e4(){return o.useContext(e1)}var e2=o.createContext({isTransitioning:!1});e2.displayName="ViewTransition";var e3=o.createContext(new Map);e3.displayName="Fetchers",o.createContext(null).displayName="Await";var e5=o.createContext(null);e5.displayName="Navigation";var e7=o.createContext(null);e7.displayName="Location";var e8=o.createContext({outlet:null,matches:[],isDataRoute:!1});e8.displayName="Route";var e9=o.createContext(null);e9.displayName="RouteError";var e6="REACT_ROUTER_ERROR";function te(){return null!=o.useContext(e7)}function tt(){return u(te(),"useLocation() may be used only in the context of a component."),o.useContext(e7).location}function tr(){return o.useContext(e7).navigationType}var tn="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ta(e){o.useContext(e5).static||o.useLayoutEffect(e)}function to(){let{isDataRoute:e}=o.useContext(e8);return e?function(){let{router:e}=tp("useNavigate"),t=ty("useNavigate"),r=o.useRef(!1);return ta(()=>{r.current=!0}),o.useCallback(async(n,a={})=>{c(r.current,tn),r.current&&("number"==typeof n?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...a}))},[e,t])}():function(){u(te(),"useNavigate() may be used only in the context of a component.");let e=o.useContext(eZ),{basename:t,navigator:r}=o.useContext(e5),{matches:n}=o.useContext(e8),{pathname:a}=tt(),i=JSON.stringify(M(n)),l=o.useRef(!1);return ta(()=>{l.current=!0}),o.useCallback((n,o={})=>{if(c(l.current,tn),!l.current)return;if("number"==typeof n)return void r.go(n);let s=O(n,JSON.parse(i),a,"path"===o.relative);null==e&&"/"!==t&&(s.pathname="/"===s.pathname?t:j([t,s.pathname])),(o.replace?r.replace:r.push)(s,o.state,o)},[t,r,i,a,e])}()}function ti(e,{relative:t}={}){let{matches:r}=o.useContext(e8),{pathname:n}=tt(),a=JSON.stringify(M(r));return o.useMemo(()=>O(e,JSON.parse(a),n,"path"===t),[e,a,n,t])}function tl(e,t,r,n,a){let i;u(te(),"useRoutes() may be used only in the context of a component.");let{navigator:l}=o.useContext(e5),{matches:s}=o.useContext(e8),d=s[s.length-1],h=d?d.params:{},f=d?d.pathname:"/",m=d?d.pathnameBase:"/",y=d&&d.route;{let e=y&&y.path||"";tw(f,!y||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${f}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. Please change the parent to .`)}let v=tt();if(t){let e="string"==typeof t?p(t):t;u("/"===m||e.pathname?.startsWith(m),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${e.pathname}" was given in the \`location\` prop.`),i=e}else i=v;let g=i.pathname||"/",w=g;if("/"!==m){let e=m.replace(/^\//,"").split("/");w="/"+g.replace(/^\//,"").split("/").slice(e.length).join("/")}let b=E(e,{pathname:w});c(y||null!=b,`No routes matched location "${i.pathname}${i.search}${i.hash}" `),c(null==b||void 0!==b[b.length-1].route.element||void 0!==b[b.length-1].route.Component||void 0!==b[b.length-1].route.lazy,`Matched leaf route at location "${i.pathname}${i.search}${i.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let R=function(e,t=[],r=null,n=null,a=null){if(null==e){if(!r)return null;if(r.errors)e=r.matches;else{if(0!==t.length||r.initialized||!(r.matches.length>0))return null;e=r.matches}}let i=e,l=r?.errors;if(null!=l){let e=i.findIndex(e=>e.route.id&&l?.[e.route.id]!==void 0);u(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),i=i.slice(0,Math.min(i.length,e+1))}let s=!1,c=-1;if(r)for(let e=0;e=0?i.slice(0,c+1):[i[0]];break}}}let d=r&&n?(e,t)=>{n(e,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:N(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,a)=>{let u,h=!1,f=null,p=null;r&&(u=l&&n.route.id?l[n.route.id]:void 0,f=n.route.errorElement||ts,s&&(c<0&&0===a?(tw("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),h=!0,p=null):c===a&&(h=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,a+1)),y=()=>{let t;return t=u?f:h?p:n.route.Component?o.createElement(n.route.Component,null):n.route.element?n.route.element:e,o.createElement(th,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:null!=r},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||0===a)?o.createElement(tu,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:y(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:d}):y()},null)}(b&&b.map(e=>Object.assign({},e,{params:Object.assign({},h,e.params),pathname:j([m,l.encodeLocation?l.encodeLocation(e.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?m:j([m,l.encodeLocation?l.encodeLocation(e.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathnameBase])})),s,r,n,a);return t&&R?o.createElement(e7.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...i},navigationType:"POP"}},R):R}o.createContext(null);var ts=o.createElement(function(){let e,t,r,n=(e=o.useContext(e9),t=tm("useRouteError"),r=ty("useRouteError"),void 0!==e?e:t.errors?.[r]),a=F(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),i=n instanceof Error?n.stack:null,l="rgba(200,200,200, 0.5)",s={padding:"2px 4px",backgroundColor:l},u=null;return console.error("Error handled by React Router default ErrorBoundary:",n),u=o.createElement(o.Fragment,null,o.createElement("p",null,"\uD83D\uDCBF Hey developer \uD83D\uDC4B"),o.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",o.createElement("code",{style:s},"ErrorBoundary")," or"," ",o.createElement("code",{style:s},"errorElement")," prop on your route.")),o.createElement(o.Fragment,null,o.createElement("h2",null,"Unexpected Application Error!"),o.createElement("h3",{style:{fontStyle:"italic"}},a),i?o.createElement("pre",{style:{padding:"0.5rem",backgroundColor:l}},i):null,u)},null),tu=class extends o.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||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&"object"==typeof e&&e&&"digest"in e&&"string"==typeof e.digest){let t=function(e){if(e.startsWith(`${e6}:ROUTE_ERROR_RESPONSE:{`))try{let t=JSON.parse(e.slice(40));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText)return new _(t.status,t.statusText,t.data)}catch{}}(e.digest);t&&(e=t)}let t=void 0!==e?o.createElement(e8.Provider,{value:this.props.routeContext},o.createElement(e9.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?o.createElement(td,{error:e},t):t}};tu.contextType=e1;var tc=new WeakMap;function td({children:e,error:t}){let{basename:r}=o.useContext(e5);if("object"==typeof t&&t&&"digest"in t&&"string"==typeof t.digest){let e=function(e){if(e.startsWith(`${e6}:REDIRECT:{`))try{let t=JSON.parse(e.slice(28));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText&&"string"==typeof t.location&&"boolean"==typeof t.reloadDocument&&"boolean"==typeof t.replace)return t}catch{}}(t.digest);if(e){let n=tc.get(t);if(n)throw n;let a=B(e.location,r);if(H&&!tc.get(t))if(a.isExternal||e.reloadDocument)window.location.href=a.absoluteURL||a.to;else{let r=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw tc.set(t,r),r}return o.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function th({routeContext:e,match:t,children:r}){let n=o.useContext(eZ);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),o.createElement(e8.Provider,{value:e},r)}function tf(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function tp(e){let t=o.useContext(eZ);return u(t,tf(e)),t}function tm(e){let t=o.useContext(e0);return u(t,tf(e)),t}function ty(e){let t,r=(u(t=o.useContext(e8),tf(e)),t),n=r.matches[r.matches.length-1];return u(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}var tv=0,tg={};function tw(e,t,r){t||tg[e]||(tg[e]=!0,c(!1,r))}var tb={};function tE(e,t){e||tb[t]||(tb[t]=!0,console.warn(t))}var tR=(n||(n=r.t(o,2))).useOptimistic,tx=()=>void 0;function tS(e){let t={hasErrorBoundary:e.hasErrorBoundary||null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&(e.element&&c(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:o.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&c(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:o.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&c(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:o.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var tC=["HydrateFallback","hydrateFallbackElement"],tk=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=t=>{"pending"===this.status&&(this.status="resolved",e(t))},this.reject=e=>{"pending"===this.status&&(this.status="rejected",t(e))}})}};function tP({router:e,flushSync:t,onError:r,unstable_useTransitions:n}){n=e4()||n;let[a,i]=o.useState(e.state),[l,s]=tR?tR(a):[a,tx],[u,c]=o.useState(),[d,h]=o.useState({isTransitioning:!1}),[f,p]=o.useState(),[m,y]=o.useState(),[v,g]=o.useState(),w=o.useRef(new Map),b=o.useCallback((a,{deletedFetchers:l,newErrors:u,flushSync:d,viewTransitionOpts:v})=>{u&&r&&Object.values(u).forEach(e=>r(e,{location:a.location,params:a.matches[0]?.params??{},unstable_pattern:N(a.matches)})),a.fetchers.forEach((e,t)=>{void 0!==e.data&&w.current.set(t,e.data)}),l.forEach(e=>w.current.delete(e)),tE(!1===d||null!=t,'You provided the `flushSync` option to a router update, but you are not using the `` 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 b=null!=e.window&&null!=e.window.document&&"function"==typeof e.window.document.startViewTransition;if(tE(null==v||b,"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."),!v||!b)return void(t&&d?t(()=>i(a)):!1===n?i(a):o.startTransition(()=>{!0===n&&s(e=>tL(e,a)),i(a)}));if(t&&d){t(()=>{m&&(f?.resolve(),m.skipTransition()),h({isTransitioning:!0,flushSync:!0,currentLocation:v.currentLocation,nextLocation:v.nextLocation})});let r=e.window.document.startViewTransition(()=>{t(()=>i(a))});r.finished.finally(()=>{t(()=>{p(void 0),y(void 0),c(void 0),h({isTransitioning:!1})})}),t(()=>y(r));return}m?(f?.resolve(),m.skipTransition(),g({state:a,currentLocation:v.currentLocation,nextLocation:v.nextLocation})):(c(a),h({isTransitioning:!0,flushSync:!1,currentLocation:v.currentLocation,nextLocation:v.nextLocation}))},[e.window,t,m,f,n,s,r]);o.useLayoutEffect(()=>e.subscribe(b),[e,b]),o.useEffect(()=>{d.isTransitioning&&!d.flushSync&&p(new tk)},[d]),o.useEffect(()=>{if(f&&u&&e.window){let t=f.promise,r=e.window.document.startViewTransition(async()=>{!1===n?i(u):o.startTransition(()=>{!0===n&&s(e=>tL(e,u)),i(u)}),await t});r.finished.finally(()=>{p(void 0),y(void 0),c(void 0),h({isTransitioning:!1})}),y(r)}},[u,f,e.window,n,s]),o.useEffect(()=>{f&&u&&l.location.key===u.location.key&&f.resolve()},[f,m,l.location,u]),o.useEffect(()=>{!d.isTransitioning&&v&&(c(v.state),h({isTransitioning:!0,flushSync:!1,currentLocation:v.currentLocation,nextLocation:v.nextLocation}),g(void 0))},[d.isTransitioning,v]);let E=o.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,r,n)=>e.navigate(t,{state:r,preventScrollReset:n?.preventScrollReset}),replace:(t,r,n)=>e.navigate(t,{replace:!0,state:r,preventScrollReset:n?.preventScrollReset})}),[e]),R=e.basename||"/",x=o.useMemo(()=>({router:e,navigator:E,static:!1,basename:R,onError:r}),[e,E,R,r]);return o.createElement(o.Fragment,null,o.createElement(eZ.Provider,{value:x},o.createElement(e0.Provider,{value:l},o.createElement(e3.Provider,{value:w.current},o.createElement(e2.Provider,{value:d},o.createElement(tT,{basename:R,location:l.location,navigationType:l.historyAction,navigator:E,unstable_useTransitions:n},o.createElement(tD,{routes:e.routes,future:e.future,state:l,onError:r})))))),null)}function tL(e,t){return{...e,navigation:"idle"!==t.navigation.state?t.navigation:e.navigation,revalidation:"idle"!==t.revalidation?t.revalidation:e.revalidation,actionData:"submitting"!==t.navigation.state?t.actionData:e.actionData,fetchers:t.fetchers}}var tD=o.memo(function({routes:e,future:t,state:r,onError:n}){return tl(e,void 0,r,n,t)});function t$(e){u(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function tT({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:a,static:i=!1,unstable_useTransitions:l}){u(!te(),"You cannot render a inside another . You should never have more than one in your app.");let s=e.replace(/^\/*/,"/"),d=o.useMemo(()=>({basename:s,navigator:a,static:i,unstable_useTransitions:l,future:{}}),[s,a,i,l]);"string"==typeof r&&(r=p(r));let{pathname:h="/",search:f="",hash:m="",state:y=null,key:v="default"}=r,g=o.useMemo(()=>{let e=P(h,s);return null==e?null:{location:{pathname:e,search:f,hash:m,state:y,key:v},navigationType:n}},[s,h,f,m,y,v,n]);return(c(null!=g,` is not able to match the URL "${h}${f}${m}" because it does not start with the basename, so the won't render anything.`),null==g)?null:o.createElement(e5.Provider,{value:d},o.createElement(e7.Provider,{children:t,value:g}))}function tM({children:e,location:t}){return tl(function e(t,r=[]){let n=[];return o.Children.forEach(t,(t,a)=>{if(!o.isValidElement(t))return;let i=[...r,a];if(t.type===o.Fragment)return void n.push.apply(n,e(t.props.children,i));u(t.type===t$,`[${"string"==typeof t.type?t.type:t.type.name}] is not a component. All component children of must be a or `),u(!t.props.index||!t.props.children,"An index route cannot have child routes.");let l={id:t.props.id||i.join("-"),caseSensitive:t.props.caseSensitive,element:t.props.element,Component:t.props.Component,index:t.props.index,path:t.props.path,middleware:t.props.middleware,loader:t.props.loader,action:t.props.action,hydrateFallbackElement:t.props.hydrateFallbackElement,HydrateFallback:t.props.HydrateFallback,errorElement:t.props.errorElement,ErrorBoundary:t.props.ErrorBoundary,hasErrorBoundary:!0===t.props.hasErrorBoundary||null!=t.props.ErrorBoundary||null!=t.props.errorElement,shouldRevalidate:t.props.shouldRevalidate,handle:t.props.handle,lazy:t.props.lazy};t.props.children&&(l.children=e(t.props.children,i)),n.push(l)}),n}(e),t)}o.Component;var tO="get",tj="application/x-www-form-urlencoded";function tA(e){return"u">typeof HTMLElement&&e instanceof HTMLElement}function tz(e=""){return new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(e=>[r,e]):[[r,n]])},[]))}var tU=null,t_=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function tF(e){return null==e||t_.has(e)?e:(c(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${tj}"`),null)}Object.getOwnPropertyNames(Object.prototype).sort().join("\0"),"u">typeof window&&window;function tN(e,t){if(!1===e||null==e)throw Error(t)}async function tH(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(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function tB(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}async function tI(e,t,r){var n;let a,o;return n=(await Promise.all(e.map(async e=>{let n=t.routes[e.route.id];if(n){let e=await tH(n,r);return e.links?e.links():[]}return[]}))).flat(1).filter(tB).filter(e=>"stylesheet"===e.rel||"preload"===e.rel).map(e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"}),a=new Set,o=new Set(void 0),n.reduce((e,t)=>{!1;let r=JSON.stringify(function(e){let t={};for(let r of Object.keys(e).sort())t[r]=e[r];return t}(t));return a.has(r)||(a.add(r),e.push({key:r,link:t})),e},[])}function tW(e,t,r,n,a,o){let i=(e,t)=>!r[t]||e.route.id!==r[t].route.id,l=(e,t)=>r[t].pathname!==e.pathname||r[t].route.path?.endsWith("*")&&r[t].params["*"]!==e.params["*"];return"assets"===o?t.filter((e,t)=>i(e,t)||l(e,t)):"data"===o?t.filter((t,o)=>{let s=n.routes[t.route.id];if(!s||!s.hasLoader)return!1;if(i(t,o)||l(t,o))return!0;if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof n)return n}return!0}):[]}function tY(e,t,{includeHydrateFallback:r}={}){return[...new Set(e.map(e=>{let n=t.routes[e.route.id];if(!n)return[];let a=[n.module];return n.clientActionModule&&(a=a.concat(n.clientActionModule)),n.clientLoaderModule&&(a=a.concat(n.clientLoaderModule)),r&&n.hydrateFallbackModule&&(a=a.concat(n.hydrateFallbackModule)),n.imports&&(a=a.concat(n.imports)),a}).flat(1))]}function tq(){let e=o.useContext(eZ);return tN(e,"You must render this element inside a element"),e}function tV(){let e=o.useContext(e0);return tN(e,"You must render this element inside a element"),e}Symbol("SingleFetchRedirect");var tJ=o.createContext(void 0);function tK(){let e=o.useContext(tJ);return tN(e,"You must render this element inside a element"),e}function tX(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function tG({page:e,...t}){let{router:r}=tq(),n=o.useMemo(()=>E(r.routes,e,r.basename),[r.routes,e,r.basename]);return n?o.createElement(tQ,{page:e,matches:n,...t}):null}function tQ({page:e,matches:t,...r}){let n=tt(),{future:a,manifest:i,routeModules:l}=tK(),{basename:s}=tq(),{loaderData:u,matches:c}=tV(),d=o.useMemo(()=>tW(e,t,c,i,n,"data"),[e,t,c,i,n]),h=o.useMemo(()=>tW(e,t,c,i,n,"assets"),[e,t,c,i,n]),f=o.useMemo(()=>{var r,o;let c;if(e===n.pathname+n.search+n.hash)return[];let h=new Set,f=!1;if(t.forEach(e=>{let t=i.routes[e.route.id];t&&t.hasLoader&&(!d.some(t=>t.route.id===e.route.id)&&e.route.id in u&&l[e.route.id]?.shouldRevalidate||t.hasClientLoader?f=!0:h.add(e.route.id))}),0===h.size)return[];let p=(r=a.unstable_trailingSlashAwareDataRequests,o="data",c="string"==typeof e?new URL(e,"u"0&&p.searchParams.set("_routes",t.filter(e=>h.has(e.route.id)).map(e=>e.route.id).join(",")),[p.pathname+p.search]},[s,a.unstable_trailingSlashAwareDataRequests,u,n,i,d,t,e,l]),p=o.useMemo(()=>tY(h,i),[h,i]),m=function(e){let{manifest:t,routeModules:r}=tK(),[n,a]=o.useState([]);return o.useEffect(()=>{let n=!1;return tI(e,t,r).then(e=>{n||a(e)}),()=>{n=!0}},[e,t,r]),n}(h);return o.createElement(o.Fragment,null,f.map(e=>o.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...r})),p.map(e=>o.createElement("link",{key:e,rel:"modulepreload",href:e,...r})),m.map(({key:e,link:t})=>o.createElement("link",{key:e,nonce:r.nonce,...t})))}tJ.displayName="FrameworkContext";o.Component;var tZ="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{tZ&&(window.__reactRouterVersion="7.12.0")}catch(e){}function t0(e,t){let r;return(function(e){let t,r,n,a,o,i=e.window?e.window:"u">typeof window?window:void 0,l=void 0!==i&&void 0!==i.document&&void 0!==i.document.createElement;u(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let s=e.hydrationRouteProperties||[],d=e.mapRouteProperties||en,p=d;if(e.unstable_instrumentations){let t=e.unstable_instrumentations;p=e=>({...d(e),...function(e,t){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){for(let t of Object.keys(r))e[t]&&r[t].push(e[t])}}));let n={};if("function"==typeof t.lazy&&r.lazy.length>0){let e=W(r.lazy,t.lazy,()=>void 0);e&&(n.lazy=e)}if("object"==typeof t.lazy){let e=t.lazy;["middleware","loader","action"].forEach(t=>{let a=e[t],o=r[`lazy.${t}`];if("function"==typeof a&&o.length>0){let e=W(o,a,()=>void 0);e&&(n.lazy=Object.assign(n.lazy||{},{[t]:e}))}})}return["loader","action"].forEach(e=>{let a=t[e];if("function"==typeof a&&r[e].length>0){let t=a[I]??a,o=W(r[e],t,(...e)=>q(e[0]));o&&("loader"===e&&!0===t.hydrate&&(o.hydrate=!0),o[I]=t,n[e]=o)}}),t.middleware&&t.middleware.length>0&&r.middleware.length>0&&(n.middleware=t.middleware.map(e=>{let t=e[I]??e,n=W(r.middleware,t,(...e)=>q(e[0]));return n?(n[I]=t,n):e})),n}(t.map(e=>e.route).filter(Boolean),e)})}let v={},g=w(e.routes,p,void 0,v),b=e.basename||"/";b.startsWith("/")||(b=`/${b}`);let S=e.dataStrategy||ev,C={...e.future},k=null,D=new Set,$=null,T=null,M=null,O=null!=e.hydrationData,j=E(g,e.history.location,b),A=!1,z=null;if(null!=j||e.patchRoutesOnNavigation)if(j&&!e.hydrationData&&tl(j,g,e.history.location.pathname).active&&(j=null),j)if(j.some(e=>e.route.lazy))r=!1;else if(j.some(e=>eu(e.route))){let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null;if(n){let e=j.findIndex(e=>void 0!==n[e.route.id]);r=j.slice(0,e+1).every(e=>!ec(e.route,t,n))}else r=j.every(e=>!ec(e.route,t,n))}else r=!0;else{r=!1,j=[];let t=tl(null,g,e.history.location.pathname);t.active&&t.matches&&(A=!0,j=t.matches)}else{let t=eU(404,{pathname:e.history.location.pathname}),{matches:n,route:a}=ez(g);r=!0,j=n,z={[a.id]:t}}let U={historyAction:e.history.action,location:e.history.location,matches:j,initialized:r,navigation:ee,restoreScrollPosition:null==e.hydrationData&&null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||z,fetchers:new Map,blockers:new Map},_="POP",N=null,H=!1,B=!1,Y=new Map,J=null,K=!1,X=!1,G=new Set,eo=new Map,ed=0,ef=-1,ep=new Map,em=new Set,ey=new Map,eg=new Map,ew=new Set,eb=new Map,eE=null;function eR(e,t={}){e.matches&&(e.matches=e.matches.map(e=>{let t=v[e.route.id],r=e.route;return r.element!==t.element||r.errorElement!==t.errorElement||r.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}));let r=[],n=[];(U={...U,...e}).fetchers.forEach((e,t)=>{"idle"===e.state&&(ew.has(t)?r.push(t):n.push(t))}),ew.forEach(e=>{U.fetchers.has(e)||eo.has(e)||r.push(e)}),[...D].forEach(n=>n(U,{deletedFetchers:r,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:!0===t.flushSync})),r.forEach(e=>e7(e)),n.forEach(e=>U.fetchers.delete(e))}function eC(r,n,{flushSync:a}={}){let o,i,l=null!=U.actionData&&null!=U.navigation.formMethod&&eY(U.navigation.formMethod)&&"loading"===U.navigation.state&&r.state?._isRedirect!==!0;o=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:l?U.actionData:null;let s=n.loaderData?eO(U.loaderData,n.loaderData,n.matches||[],n.errors):U.loaderData,u=U.blockers;u.size>0&&(u=new Map(u)).forEach((e,t)=>u.set(t,er));let c=!K&&ti(r,n.matches||U.matches),d=!0===H||null!=U.navigation.formMethod&&eY(U.navigation.formMethod)&&r.state?._isRedirect!==!0;if(t&&(g=t,t=void 0),K||"POP"===_||("PUSH"===_?e.history.push(r,r.state):"REPLACE"===_&&e.history.replace(r,r.state)),"POP"===_){let e=Y.get(U.location.pathname);e&&e.has(r.pathname)?i={currentLocation:U.location,nextLocation:r}:Y.has(r.pathname)&&(i={currentLocation:r,nextLocation:U.location})}else if(B){let e=Y.get(U.location.pathname);e?e.add(r.pathname):(e=new Set([r.pathname]),Y.set(U.location.pathname,e)),i={currentLocation:U.location,nextLocation:r}}eR({...n,actionData:o,loaderData:s,historyAction:_,location:r,initialized:!0,navigation:ee,revalidation:"idle",restoreScrollPosition:c,preventScrollReset:d,blockers:u},{viewTransitionOpts:i,flushSync:!0===a}),_="POP",H=!1,B=!1,K=!1,X=!1,N?.resolve(),N=null,eE?.resolve(),eE=null}async function ek(t,r){if(N?.resolve(),N=null,"number"==typeof t){N||(N=eQ());let r=N.promise;return e.history.go(t),r}let{path:n,submission:a,error:o}=el(!1,ei(U.location,U.matches,b,t,r?.fromRouteId,r?.relative),r),i=U.location,l=h(U.location,n,r&&r.state);l={...l,...e.history.encodeLocation(l)};let s=r&&null!=r.replace?r.replace:void 0,u="PUSH";!0===s?u="REPLACE":!1===s||null!=a&&eY(a.formMethod)&&a.formAction===U.location.pathname+U.location.search&&(u="REPLACE");let c=r&&"preventScrollReset"in r?!0===r.preventScrollReset:void 0,d=!0===(r&&r.flushSync),f=tn({currentLocation:i,nextLocation:l,historyAction:u});f?tr(f,{state:"blocked",location:l,proceed(){tr(f,{state:"proceeding",proceed:void 0,reset:void 0,location:l}),ek(t,r)},reset(){let e=new Map(U.blockers);e.set(f,er),eR({blockers:e})}}):await e$(u,l,{submission:a,pendingError:o,preventScrollReset:c,replace:r&&r.replace,enableViewTransition:r&&r.viewTransition,flushSync:d,callSiteDefaultShouldRevalidate:r&&r.unstable_defaultShouldRevalidate})}async function e$(r,n,o){var i,l,s,u;let c;a&&a.abort(),a=null,_=r,K=!0===(o&&o.startUninterruptedRevalidation),i=U.location,l=U.matches,$&&M&&($[to(i,l)]=M()),H=!0===(o&&o.preventScrollReset),B=!0===(o&&o.enableViewTransition);let d=t||g,h=o&&o.overrideNavigation,f=o?.initialHydration&&U.matches&&U.matches.length>0&&!A?U.matches:E(d,n,b),p=!0===(o&&o.flushSync);if(f&&U.initialized&&!X&&(s=U.location,u=n,s.pathname===u.pathname&&s.search===u.search&&(""===s.hash?""!==u.hash:s.hash===u.hash||""!==u.hash||!1))&&!(o&&o.submission&&eY(o.submission.formMethod)))return void eC(n,{matches:f},{flushSync:p});let m=tl(f,d,n.pathname);if(m.active&&m.matches&&(f=m.matches),!f){let{error:e,notFoundMatches:t,route:r}=ta(n.pathname);eC(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:p});return}a=new AbortController;let v=eD(e.history,n,a.signal,o&&o.submission),w=e.getContext?await e.getContext():new y;if(o&&o.pendingError)c=[eA(f).route.id,{type:"error",error:o.pendingError}];else if(o&&o.submission&&eY(o.submission.formMethod)){let t=await eT(v,n,o.submission,f,w,m.active,o&&!0===o.initialHydration,{replace:o.replace,flushSync:p});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,r]=t.pendingActionResult;if(eH(r)&&F(r.error)&&404===r.error.status){a=null,eC(n,{matches:t.matches,loaderData:{},errors:{[e]:r.error}});return}}f=t.matches||f,c=t.pendingActionResult,h=eK(n,o.submission),p=!1,m.active=!1,v=eD(e.history,v.url,v.signal)}let{shortCircuited:R,matches:x,loaderData:S,errors:C}=await eF(v,n,f,w,m.active,h,o&&o.submission,o&&o.fetcherSubmission,o&&o.replace,o&&!0===o.initialHydration,p,c,o&&o.callSiteDefaultShouldRevalidate);R||(a=null,eC(n,{matches:x||f,...ej(c),loaderData:S,errors:C}))}async function eT(t,r,n,a,o,i,l,u={}){var c;let d;if(e4(),eR({navigation:{state:"submitting",location:r,formMethod:(c=n).formMethod,formAction:c.formAction,formEncType:c.formEncType,formData:c.formData,json:c.json,text:c.text}},{flushSync:!0===u.flushSync}),i){let e=await ts(a,r.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){if(0===e.partialMatches.length){let{matches:t,route:r}=ez(g);return{matches:t,pendingActionResult:[r.id,{type:"error",error:e.error}]}}let t=eA(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:"error",error:e.error}]}}if(e.matches)a=e.matches;else{let{notFoundMatches:e,error:t,route:n}=ta(r.pathname);return{matches:e,pendingActionResult:[n.id,{type:"error",error:t}]}}}let h=eV(a,r);if(h.route.action||h.route.lazy){let e=ex(p,v,t,a,h,l?[]:s,o),r=await e0(t,e,o,null);if(!(d=r[h.route.id])){for(let e of a)if(r[e.route.id]){d=r[e.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}else d={type:"error",error:eU(405,{method:t.method,pathname:r.pathname,routeId:h.route.id})};if(eB(d)){let r;return r=u&&null!=u.replace?u.replace:eL(d.response.headers.get("Location"),new URL(t.url),b,e.history)===U.location.pathname+U.location.search,await eZ(t,d,!0,{submission:n,replace:r}),{shortCircuited:!0}}if(eH(d)){let e=eA(a,h.route.id);return!0!==(u&&u.replace)&&(_="PUSH"),{matches:a,pendingActionResult:[e.route.id,d,h.route.id]}}return{matches:a,pendingActionResult:[h.route.id,d]}}async function eF(r,n,o,i,l,u,c,d,h,f,m,y,w){let E=u||eK(n,c),R=c||d||eJ(E),x=!K&&!f;if(l){if(x){let e=eN(y);eR({navigation:E,...void 0!==e?{actionData:e}:{}},{flushSync:m})}let e=await ts(o,n.pathname,r.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){if(0===e.partialMatches.length){let{matches:t,route:r}=ez(g);return{matches:t,loaderData:{},errors:{[r.id]:e.error}}}let t=eA(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)o=e.matches;else{let{error:e,notFoundMatches:t,route:r}=ta(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let S=t||g,{dsMatches:C,revalidatingFetchers:k}=es(r,i,p,v,e.history,U,o,R,n,f?[]:s,!0===f,X,G,ew,ey,em,S,b,null!=e.patchRoutesOnNavigation,y,w);if(ef=++ed,!e.dataStrategy&&!C.some(e=>e.shouldLoad)&&!C.some(e=>e.route.middleware&&e.route.middleware.length>0)&&0===k.length){let e=e6();return eC(n,{matches:o,loaderData:{},errors:y&&eH(y[1])?{[y[0]]:y[1].error}:null,...ej(y),...e?{fetchers:new Map(U.fetchers)}:{}},{flushSync:m}),{shortCircuited:!0}}if(x){let e={};if(!l){e.navigation=E;let t=eN(y);void 0!==t&&(e.actionData=t)}k.length>0&&(k.forEach(e=>{let t=U.fetchers.get(e.key),r=eX(void 0,t?t.data:void 0);U.fetchers.set(e.key,r)}),e.fetchers=new Map(U.fetchers)),eR(e,{flushSync:m})}k.forEach(e=>{e8(e.key),e.controller&&eo.set(e.key,e.controller)});let P=()=>k.forEach(e=>e8(e.key));a&&a.signal.addEventListener("abort",P);let{loaderResults:L,fetcherResults:D}=await e1(C,k,r,i);if(r.signal.aborted)return{shortCircuited:!0};a&&a.signal.removeEventListener("abort",P),k.forEach(e=>eo.delete(e.key));let $=e_(L);if($)return await eZ(r,$.result,!0,{replace:h}),{shortCircuited:!0};if($=e_(D))return em.add($.key),await eZ(r,$.result,!0,{replace:h}),{shortCircuited:!0};let{loaderData:T,errors:M}=eM(U,o,L,y,k,D);f&&U.errors&&(M={...U.errors,...M});let O=e6(),j=te(ef);return{matches:o,loaderData:T,errors:M,...O||j||k.length>0?{fetchers:new Map(U.fetchers)}:{}}}function eN(e){if(e&&!eH(e[1]))return{[e[0]]:e[1].data};if(U.actionData)if(0===Object.keys(U.actionData).length)return null;else return U.actionData}async function eI(r,n,o,i,l,c,d,h,f,m){var y,w;e4(),ey.delete(r);let R=U.fetchers.get(r);e2(r,(y=f,w=R,{state:"submitting",formMethod:y.formMethod,formAction:y.formAction,formEncType:y.formEncType,formData:y.formData,json:y.json,text:y.text,data:w?w.data:void 0}),{flushSync:d});let x=new AbortController,S=eD(e.history,o,x.signal,f);if(c){let e=await ts(i,new URL(S.url).pathname,S.signal,r);if("aborted"===e.type)return;if("error"===e.type)return void e3(r,n,e.error,{flushSync:d});if(!e.matches)return void e3(r,n,eU(404,{pathname:o}),{flushSync:d});i=e.matches}let C=eV(i,o);if(!C.route.action&&!C.route.lazy){let e=eU(405,{method:f.formMethod,pathname:o,routeId:n});e3(r,n,e,{flushSync:d});return}eo.set(r,x);let k=ed,P=ex(p,v,S,i,C,s,l),L=await e0(S,P,l,r),D=L[C.route.id];if(!D){for(let e of P)if(L[e.route.id]){D=L[e.route.id];break}}if(S.signal.aborted){eo.get(r)===x&&eo.delete(r);return}if(ew.has(r)){if(eB(D)||eH(D))return void e2(r,eG(void 0))}else{if(eB(D))return(eo.delete(r),ef>k)?void e2(r,eG(void 0)):(em.add(r),e2(r,eX(f)),eZ(S,D,!1,{fetcherSubmission:f,preventScrollReset:h}));if(eH(D))return void e3(r,n,D.error)}let $=U.navigation.location||U.location,T=eD(e.history,$,x.signal),M=t||g,O="idle"!==U.navigation.state?E(M,U.navigation.location,b):U.matches;u(O,"Didn't find any matches after fetcher action");let j=++ed;ep.set(r,j);let A=eX(f,D.data);U.fetchers.set(r,A);let{dsMatches:z,revalidatingFetchers:F}=es(T,l,p,v,e.history,U,O,f,$,s,!1,X,G,ew,ey,em,M,b,null!=e.patchRoutesOnNavigation,[C.route.id,D],m);F.filter(e=>e.key!==r).forEach(e=>{let t=e.key,r=U.fetchers.get(t),n=eX(void 0,r?r.data:void 0);U.fetchers.set(t,n),e8(t),e.controller&&eo.set(t,e.controller)}),eR({fetchers:new Map(U.fetchers)});let N=()=>F.forEach(e=>e8(e.key));x.signal.addEventListener("abort",N);let{loaderResults:H,fetcherResults:B}=await e1(z,F,T,l);if(x.signal.aborted)return;if(x.signal.removeEventListener("abort",N),ep.delete(r),eo.delete(r),F.forEach(e=>eo.delete(e.key)),U.fetchers.has(r)){let e=eG(D.data);U.fetchers.set(r,e)}let I=e_(H);if(I)return eZ(T,I.result,!1,{preventScrollReset:h});if(I=e_(B))return em.add(I.key),eZ(T,I.result,!1,{preventScrollReset:h});let{loaderData:W,errors:Y}=eM(U,O,H,void 0,F,B);te(j),"loading"===U.navigation.state&&j>ef?(u(_,"Expected pending action"),a&&a.abort(),eC(U.navigation.location,{matches:O,loaderData:W,errors:Y,fetchers:new Map(U.fetchers)})):(eR({errors:Y,loaderData:eO(U.loaderData,W,O,Y),fetchers:new Map(U.fetchers)}),X=!1)}async function eq(t,r,n,a,o,i,l,u,c){let d=U.fetchers.get(t);e2(t,eX(c,d?d.data:void 0),{flushSync:l});let h=new AbortController,f=eD(e.history,n,h.signal);if(i){let e=await ts(a,new URL(f.url).pathname,f.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void e3(t,r,e.error,{flushSync:l});if(!e.matches)return void e3(t,r,eU(404,{pathname:n}),{flushSync:l});a=e.matches}let m=eV(a,n);eo.set(t,h);let y=ed,g=ex(p,v,f,a,m,s,o),w=(await e0(f,g,o,t))[m.route.id];if(eo.get(t)===h&&eo.delete(t),!f.signal.aborted){if(ew.has(t))return void e2(t,eG(void 0));if(eB(w))if(ef>y)return void e2(t,eG(void 0));else{em.add(t),await eZ(f,w,!1,{preventScrollReset:u});return}if(eH(w))return void e3(t,r,w.error);e2(t,eG(w.data))}}async function eZ(t,r,n,{submission:o,fetcherSubmission:s,preventScrollReset:c,replace:d}={}){n||(N?.resolve(),N=null),r.response.headers.has("X-Remix-Revalidate")&&(X=!0);let f=r.response.headers.get("Location");u(f,"Expected a Location header on the redirect Response"),f=eL(f,new URL(t.url),b,e.history);let p=h(U.location,f,{_isRedirect:!0});if(l){let e=!1;if(r.response.headers.has("X-Remix-Reload-Document"))e=!0;else{let t;if(t=f,L.test(t)){let t=m(f,!0);e=t.origin!==i.location.origin||null==P(t.pathname,b)}}if(e)return void(d?i.location.replace(f):i.location.assign(f))}a=null;let y=!0===d||r.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:v,formAction:g,formEncType:w}=U.navigation;!o&&!s&&v&&g&&w&&(o=eJ(U.navigation));let E=o||s;if(Z.has(r.response.status)&&E&&eY(E.formMethod))await e$(y,p,{submission:{...E,formAction:f},preventScrollReset:c||H,enableViewTransition:n?B:void 0});else{let e=eK(p,o);await e$(y,p,{overrideNavigation:e,fetcherSubmission:s,preventScrollReset:c||H,enableViewTransition:n?B:void 0})}}async function e0(e,t,r,n){let a,o={};try{a=await eS(S,e,t,n,r,!1)}catch(e){return t.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:"error",error:e}}),o}if(e.signal.aborted)return o;if(!eY(e.method))for(let e of t){if(a[e.route.id]?.type==="error")break;!a.hasOwnProperty(e.route.id)&&!U.loaderData.hasOwnProperty(e.route.id)&&(!U.errors||!U.errors.hasOwnProperty(e.route.id))&&e.shouldCallHandler()&&(a[e.route.id]={type:"error",result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[r,n]of Object.entries(a)){var i;if(eW((i=n).result)&&Q.has(i.result.status)){let a=n.result;o[r]={type:"redirect",response:function(e,t,r,n,a){let o,i=e.headers.get("Location");if(u(i,"Redirects returned/thrown from loaders/actions must have a Location header"),o=i,!L.test(o)){let o=n.slice(0,n.findIndex(e=>e.route.id===r)+1);i=ei(new URL(t.url),o,a,i),e.headers.set("Location",i)}return e}(a,e,r,t,b)}}else o[r]=await eP(n)}return o}async function e1(e,t,r,n){let a=e0(r,e,n,null),o=Promise.all(t.map(async e=>{if(!e.matches||!e.match||!e.request||!e.controller)return Promise.resolve({[e.key]:{type:"error",error:eU(404,{pathname:e.path})}});{let t=(await e0(e.request,e.matches,n,e.key))[e.match.route.id];return{[e.key]:t}}}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function e4(){X=!0,ey.forEach((e,t)=>{eo.has(t)&&G.add(t),e8(t)})}function e2(e,t,r={}){U.fetchers.set(e,t),eR({fetchers:new Map(U.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function e3(e,t,r,n={}){let a=eA(U.matches,t);e7(e),eR({errors:{[a.route.id]:r},fetchers:new Map(U.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function e5(e){return eg.set(e,(eg.get(e)||0)+1),ew.has(e)&&ew.delete(e),U.fetchers.get(e)||et}function e7(e){let t=U.fetchers.get(e);eo.has(e)&&!(t&&"loading"===t.state&&ep.has(e))&&e8(e),ey.delete(e),ep.delete(e),em.delete(e),ew.delete(e),G.delete(e),U.fetchers.delete(e)}function e8(e,t){let r=eo.get(e);r&&(r.abort(t),eo.delete(e))}function e9(e){for(let t of e){let e=eG(e5(t).data);U.fetchers.set(t,e)}}function e6(){let e=[],t=!1;for(let r of em){let n=U.fetchers.get(r);u(n,`Expected fetcher: ${r}`),"loading"===n.state&&(em.delete(r),e.push(r),t=!0)}return e9(e),t}function te(e){let t=[];for(let[r,n]of ep)if(n0}function tt(e){U.blockers.delete(e),eb.delete(e)}function tr(e,t){let r=U.blockers.get(e)||er;u("unblocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"proceeding"===t.state||"blocked"===r.state&&"unblocked"===t.state||"proceeding"===r.state&&"unblocked"===t.state,`Invalid blocker state transition: ${r.state} -> ${t.state}`);let n=new Map(U.blockers);n.set(e,t),eR({blockers:n})}function tn({currentLocation:e,nextLocation:t,historyAction:r}){if(0===eb.size)return;eb.size>1&&c(!1,"A router only supports one blocker at a time");let n=Array.from(eb.entries()),[a,o]=n[n.length-1],i=U.blockers.get(a);if((!i||"proceeding"!==i.state)&&o({currentLocation:e,nextLocation:t,historyAction:r}))return a}function ta(e){let r=eU(404,{pathname:e}),{matches:n,route:a}=ez(t||g);return{notFoundMatches:n,route:a,error:r}}function to(e,t){return T&&T(e,t.map(e=>x(e,U.loaderData)))||e.key}function ti(e,t){if($){let r=$[to(e,t)];if("number"==typeof r)return r}return null}function tl(t,r,n){if(e.patchRoutesOnNavigation){if(!t)return{active:!0,matches:R(r,n,b,!0)||[]};else if(Object.keys(t[0].params).length>0)return{active:!0,matches:R(r,n,b,!0)}}return{active:!1,matches:null}}async function ts(r,n,a,o){if(!e.patchRoutesOnNavigation)return{type:"success",matches:r};let i=r;for(;;){let r=null==t,l=t||g,s=v;try{await e.patchRoutesOnNavigation({signal:a,path:n,matches:i,fetcherKey:o,patch:(e,t)=>{a.aborted||eh(e,t,l,s,p,!1)}})}catch(e){return{type:"error",error:e,partialMatches:i}}finally{r&&!a.aborted&&(g=[...g])}if(a.aborted)return{type:"aborted"};let u=E(l,n,b),c=null;if(u){if(0===Object.keys(u[0].params).length)return{type:"success",matches:u};else if(!((c=R(l,n,b,!0))&&i.lengthe.route.id===t[r].route.id)}return n={get basename(){return b},get future(){return C},get state(){return U},get routes(){return g},get window(){return i},initialize:function(){if(k=e.history.listen(({action:t,location:r,delta:n})=>{if(o){o(),o=void 0;return}c(0===eb.size||null!=n,"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 a=tn({currentLocation:U.location,nextLocation:r,historyAction:t});if(a&&null!=n){let t=new Promise(e=>{o=e});e.history.go(-1*n),tr(a,{state:"blocked",location:r,proceed(){tr(a,{state:"proceeding",proceed:void 0,reset:void 0,location:r}),t.then(()=>e.history.go(n))},reset(){let e=new Map(U.blockers);e.set(a,er),eR({blockers:e})}}),N?.resolve(),N=null;return}return e$(t,r)}),l){var t=i,r=Y;try{let e=t.sessionStorage.getItem(ea);if(e){let t=JSON.parse(e);for(let[e,n]of Object.entries(t||{}))n&&Array.isArray(n)&&r.set(e,new Set(n||[]))}}catch(e){}let e=()=>(function(e,t){if(t.size>0){let r={};for(let[e,n]of t)r[e]=[...n];try{e.sessionStorage.setItem(ea,JSON.stringify(r))}catch(e){c(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}})(i,Y);i.addEventListener("pagehide",e),J=()=>i.removeEventListener("pagehide",e)}return U.initialized||e$("POP",U.location,{initialHydration:!0}),n},subscribe:function(e){return D.add(e),()=>D.delete(e)},enableScrollRestoration:function(e,t,r){if($=e,M=t,T=r||null,!O&&U.navigation===ee){O=!0;let e=ti(U.location,U.matches);null!=e&&eR({restoreScrollPosition:e})}return()=>{$=null,M=null,T=null}},navigate:ek,fetch:async function r(r,n,a,o){e8(r);let i=!0===(o&&o.flushSync),l=t||g,s=ei(U.location,U.matches,b,a,n,o?.relative),u=E(l,s,b),c=tl(u,l,s);if(c.active&&c.matches&&(u=c.matches),!u)return void e3(r,n,eU(404,{pathname:s}),{flushSync:i});let{path:d,submission:h,error:f}=el(!0,s,o);if(f)return void e3(r,n,f,{flushSync:i});let p=e.getContext?await e.getContext():new y,m=!0===(o&&o.preventScrollReset);h&&eY(h.formMethod)?await eI(r,n,d,u,p,c.active,i,m,h,o&&o.unstable_defaultShouldRevalidate):(ey.set(r,{routeId:n,path:d}),await eq(r,n,d,u,p,c.active,i,m,h))},revalidate:function(){eE||(eE=eQ()),e4(),eR({revalidation:"loading"});let e=eE.promise;return"submitting"===U.navigation.state||("idle"===U.navigation.state?e$(U.historyAction,U.location,{startUninterruptedRevalidation:!0}):e$(_||U.historyAction,U.navigation.location,{overrideNavigation:U.navigation,enableViewTransition:!0===B})),e},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:e5,resetFetcher:function(e,t){e8(e,t?.reason),e2(e,eG(null))},deleteFetcher:function(e){let t=(eg.get(e)||0)-1;t<=0?(eg.delete(e),ew.add(e)):eg.set(e,t),eR({fetchers:new Map(U.fetchers)})},dispose:function(){k&&k(),J&&J(),D.clear(),a&&a.abort(),U.fetchers.forEach((e,t)=>e7(t)),U.blockers.forEach((e,t)=>tt(t))},getBlocker:function(e,t){let r=U.blockers.get(e)||er;return eb.get(e)!==t&&eb.set(e,t),r},deleteBlocker:tt,patchRoutes:function(e,r,n=!1){let a=null==t;eh(e,r,t||g,v,p,n),a&&(g=[...g],eR({}))},_internalFetchControllers:eo,_internalSetRoutes:function(e){t=w(e,p,void 0,v={})},_internalSetStateDoNotUseOrYouWillBreakYourApp(e){eR(e)}},e.unstable_instrumentations&&(n=function(e,t){let r={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){for(let t of Object.keys(e))e[t]&&r[t].push(e[t])}})),r.navigate.length>0){let t=e.navigate[I]??e.navigate,n=W(r.navigate,t,(...t)=>{let[r,n]=t;return{to:"number"==typeof r||"string"==typeof r?r:r?f(r):".",...V(e,n??{})}});n&&(n[I]=t,e.navigate=n)}if(r.fetch.length>0){let t=e.fetch[I]??e.fetch,n=W(r.fetch,t,(...t)=>{let[r,,n,a]=t;return{href:n??".",fetcherKey:r,...V(e,a??{})}});n&&(n[I]=t,e.fetch=n)}return e}(n,e.unstable_instrumentations.map(e=>e.router).filter(Boolean))),n})({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:function(e={}){return function(e,t,r,n={}){let{window:a=document.defaultView,v5Compat:o=!1}=n,i=a.history,l="POP",u=null,c=f();function f(){return(i.state||{idx:null}).idx}function p(){l="POP";let e=f(),t=null==e?null:e-c;c=e,u&&u({action:l,location:y.location,delta:t})}null==c&&(c=0,i.replaceState({...i.state,idx:c},""));let y={get action(){return l},get location(){return e(a,i)},listen(e){if(u)throw Error("A history only accepts one active listener");return a.addEventListener(s,p),u=e,()=>{a.removeEventListener(s,p),u=null}},createHref:e=>t(a,e),createURL:function(e){return m(e)},encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){l="PUSH";let r=h(y.location,e,t);let n=d(r,c=f()+1),s=y.createHref(r);try{i.pushState(n,"",s)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;a.location.assign(s)}o&&u&&u({action:l,location:y.location,delta:1})},replace:function(e,t){l="REPLACE";let r=h(y.location,e,t);let n=d(r,c=f()),a=y.createHref(r);i.replaceState(n,"",a),o&&u&&u({action:l,location:y.location,delta:0})},go:e=>i.go(e)};return y}(function(e,t){let{pathname:r,search:n,hash:a}=e.location;return h("",{pathname:r,search:n,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){return"string"==typeof t?t:f(t)},null,e)}({window:t?.window}),hydrationData:t?.hydrationData||((r=window?.__staticRouterHydrationData)&&r.errors&&(r={...r,errors:function(e){if(!e)return null;let t=Object.entries(e),r={};for(let[e,n]of t)if(n&&"RouteErrorResponse"===n.__type)r[e]=new _(n.status,n.statusText,n.data,!0===n.internal);else if(n&&"Error"===n.__type){if(n.__subType){let t=window[n.__subType];if("function"==typeof t)try{let a=new t(n.message);a.stack="",r[e]=a}catch(e){}}if(null==r[e]){let t=Error(n.message);t.stack="",r[e]=t}}else r[e]=n;return r}(r.errors)}),r),routes:e,mapRouteProperties:tS,hydrationRouteProperties:tC,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}var t1=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,t4=o.forwardRef(function({onClick:e,discover:t="render",prefetch:r="none",relative:n,reloadDocument:a,replace:i,state:l,target:s,to:c,preventScrollReset:d,viewTransition:h,unstable_defaultShouldRevalidate:f,...p},m){let{basename:y,unstable_useTransitions:v}=o.useContext(e5),g="string"==typeof c&&t1.test(c),w=B(c,y),b=function(e,{relative:t}={}){u(te(),"useHref() may be used only in the context of a component.");let{basename:r,navigator:n}=o.useContext(e5),{hash:a,pathname:i,search:l}=ti(e,{relative:t}),s=i;return"/"!==r&&(s="/"===i?r:j([r,i])),n.createHref({pathname:s,search:l,hash:a})}(c=w.to,{relative:n}),[E,R,x]=function(e,t){let r=o.useContext(tJ),[n,a]=o.useState(!1),[i,l]=o.useState(!1),{onFocus:s,onBlur:u,onMouseEnter:c,onMouseLeave:d,onTouchStart:h}=t,f=o.useRef(null);o.useEffect(()=>{if("render"===e&&l(!0),"viewport"===e){let e=new IntersectionObserver(e=>{e.forEach(e=>{l(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),o.useEffect(()=>{if(n){let e=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(e)}}},[n]);let p=()=>{a(!0)},m=()=>{a(!1),l(!1)};return r?"intent"!==e?[i,f,{}]:[i,f,{onFocus:tX(s,p),onBlur:tX(u,m),onMouseEnter:tX(c,p),onMouseLeave:tX(d,m),onTouchStart:tX(h,p)}]:[!1,f,{}]}(r,p),S=t3(c,{replace:i,state:l,target:s,preventScrollReset:d,relative:n,viewTransition:h,unstable_defaultShouldRevalidate:f,unstable_useTransitions:v}),C=o.createElement("a",{...p,...x,href:w.absoluteURL||b,onClick:w.isExternal||a?e:function(t){e&&e(t),t.defaultPrevented||S(t)},ref:function(...e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}(m,R),target:s,"data-discover":g||"render"!==t?void 0:"true"});return E&&!g?o.createElement(o.Fragment,null,C,o.createElement(tG,{page:b})):C});t4.displayName="Link",o.forwardRef(function({"aria-current":e="page",caseSensitive:t=!1,className:r="",end:n=!1,style:a,to:i,viewTransition:l,children:s,...c},d){let h,f=ti(i,{relative:c.relative}),p=tt(),m=o.useContext(e0),{navigator:y,basename:v}=o.useContext(e5),g=null!=m&&function(e,{relative:t}={}){let r=o.useContext(e2);u(null!=r,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=t2("useViewTransitionState"),a=ti(e,{relative:t});if(!r.isTransitioning)return!1;let i=P(r.currentLocation.pathname,n)||r.currentLocation.pathname,l=P(r.nextLocation.pathname,n)||r.nextLocation.pathname;return null!=k(a.pathname,l)||null!=k(a.pathname,i)}(f)&&!0===l,w=y.encodeLocation?y.encodeLocation(f).pathname:f.pathname,b=p.pathname,E=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;t||(b=b.toLowerCase(),E=E?E.toLowerCase():null,w=w.toLowerCase()),E&&v&&(E=P(E,v)||E);let R="/"!==w&&w.endsWith("/")?w.length-1:w.length,x=b===w||!n&&b.startsWith(w)&&"/"===b.charAt(R),S=null!=E&&(E===w||!n&&E.startsWith(w)&&"/"===E.charAt(w.length)),C={isActive:x,isPending:S,isTransitioning:g},L=x?e:void 0;h="function"==typeof r?r(C):[r,x?"active":null,S?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let D="function"==typeof a?a(C):a;return o.createElement(t4,{...c,"aria-current":L,className:h,ref:d,style:D,to:i,viewTransition:l},"function"==typeof s?s(C):s)}).displayName="NavLink",o.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:a,state:i,method:l=tO,action:s,onSubmit:c,relative:d,preventScrollReset:h,viewTransition:p,unstable_defaultShouldRevalidate:m,...y},v)=>{let{unstable_useTransitions:g}=o.useContext(e5),w=function(){let{router:e}=t2("useSubmit"),{basename:t}=o.useContext(e5),r=ty("useRouteId"),n=e.fetch,a=e.navigate;return o.useCallback(async(e,o={})=>{let{action:i,method:l,encType:s,formData:u,body:c}=function(e,t){let r,n,a,o,i;if(tA(e)&&"form"===e.tagName.toLowerCase()){let i=e.getAttribute("action");n=i?P(i,t):null,r=e.getAttribute("method")||tO,a=tF(e.getAttribute("enctype"))||tj,o=new FormData(e)}else if(tA(e)&&"button"===e.tagName.toLowerCase()||tA(e)&&"input"===e.tagName.toLowerCase()&&("submit"===e.type||"image"===e.type)){let i=e.form;if(null==i)throw Error('Cannot submit a