1import{a as e,b as t}from"./react-query-DbGahily.js";import{r}from"./notifications-2QZES2T9.js"; 2/** 3 * react-router v7.18.2 4 * 5 * Copyright (c) Remix Software Inc. 6 * 7 * This source code is licensed under the MIT license found in the 8 * LICENSE.md file in the root directory of this source tree. 9 * 10 * @license MIT 11 */var a=e=>{throw TypeError(e)},n=(e,t,r)=>t.has(e)||a("Cannot "+r),o=(e,t,r)=>(n(e,t,"read from private field"),r?r.call(e):t.get(e)),i=(e,t,r)=>t.has(e)?a("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),l=(e,t,r,a)=>(n(e,t,"write to private field"),t.set(e,r),r),s=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,u=/^[\\/]{2}/;function c(e,t){return t+e.replace(/\\/g,"/")}var d,h="popstate";function f(e){return"object"==typeof e&&null!=e&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function p(e={}){return function(e,t,r,a={}){let{window:n=document.defaultView,v5Compat:o=!1}=a,i=n.history,l="POP",s=null,u=c();null==u&&(u=0,i.replaceState({...i.state,idx:u},""));function c(){return(i.state||{idx:null}).idx}function d(){l="POP";let e=c(),t=null==e?null:e-u;u=e,s&&s({action:l,location:w.location,delta:t})}function p(e,t){l="PUSH";let r=f(e)?e:g(w.location,e,t);u=c()+1;let a=v(r,u),d=w.createHref(r.mask||r);try{i.pushState(a,"",d)}catch(h){if(h instanceof DOMException&&"DataCloneError"===h.name)throw h;n.location.assign(d)}o&&s&&s({action:l,location:w.location,delta:1})}function m(e,t){l="REPLACE";let r=f(e)?e:g(w.location,e,t);u=c();let a=v(r,u),n=w.createHref(r.mask||r);i.replaceState(a,"",n),o&&s&&s({action:l,location:w.location,delta:0})}function y(e){return R(n,e)}let w={get action(){return l},get location(){return e(n,i)},listen(e){if(s)throw new Error("A history only accepts one active listener");return n.addEventListener(h,d),s=e,()=>{n.removeEventListener(h,d),s=null}},createHref:e=>t(n,e),createURL:y,encodeLocation(e){let t=y(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:p,replace:m,go:e=>i.go(e)};return w}(function(e,t){let r=t.state?.masked,{pathname:a,search:n,hash:o}=r||e.location;return g("",{pathname:a,search:n,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default",r?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)},function(e,t){return"string"==typeof t?t:w(t)},0,e)}function m(e,t){if(!1===e||null==e)throw new Error(t)}function y(e,t){if(!e)try{throw new Error(t)}catch(r){}}function v(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function g(e,t,r=null,a,n){return{pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?b(t):t,state:r,key:t&&t.key||a||Math.random().toString(36).substring(2,10),mask:n}}function w({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 b(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 R(e,t,r=!1){let a="http://localhost";e&&(a="null"!==e.location.origin?e.location.origin:e.location.href),m(a,"No window.location.(origin|href) available to create URL");let n="string"==typeof t?t:w(t);return n=n.replace(/ $/,"%20"),!r&&u.test(n)&&(n=a+n),new URL(n,a)}var E=class{constructor(e){if(i(this,d,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(o(this,d).has(e))return o(this,d).get(e);if(void 0!==e.defaultValue)return e.defaultValue;throw new Error("No value found for context")}set(e,t){o(this,d).set(e,t)}};d=new WeakMap;var S=new Set(["lazy","caseSensitive","path","id","index","children"]);var x=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function k(e){return x.has(e)}function C(e,t,r=[],a={},n=!1){return e.map((e,o)=>{let i=[...r,String(o)],l="string"==typeof e.id?e.id:i.join("-");if(m(!0!==e.index||!e.children,"Cannot specify children on an index route"),m(n||!a[l],`Found a route id collision on i
11d "${l}". Route id's must be globally unique within Data Router usages`),function(e){return!0===e.index}(e)){let r={...e,id:l};return a[l]=L(r,t(r)),r}{let r={...e,id:l,children:void 0};return a[l]=L(r,t(r)),e.children&&(r.children=C(e.children,t,i,a,n)),r}})}function L(e,t){return Object.assign(e,{...t,..."object"==typeof t.lazy&&null!=t.lazy?{lazy:{...e.lazy,...t.lazy}}:{}})}function P(e,t,r="/"){return D(e,t,r,!1)}function D(e,t,r,a,n){let o=q(("string"==typeof t?b(t):t).pathname||"/",r);if(null==o)return null;let i=n??T(e),l=null,s=function(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return y(!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}}(o);for(let u=0;null==l&&u<i.length;++u)l=_(i[u],s,a);return l}function T(e){let t=M(e);return function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let r=e.length===t.length&&e.slice(0,-1).every((e,r)=>e===t[r]);return r?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(t),t}function M(e,t=[],r=[],a="",n=!1){let o=(e,o,i=n,l)=>{let s={relativePath:void 0===l?e.path||"":l,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};if(s.relativePath.startsWith("/")){if(!s.relativePath.startsWith(a)&&i)return;m(s.relativePath.startsWith(a),`Absolute route path "${s.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),s.relativePath=s.relativePath.slice(a.length)}let u=Z([a,s.relativePath]),c=r.concat(s);e.children&&e.children.length>0&&(m(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${u}".`),M(e.children,t,c,u,i)),(null!=e.path||e.index)&&t.push({path:u,score:H(u,e.index),routesMeta:c.map((e,t)=>{let[r,a]=W(e.relativePath,e.caseSensitive,t===c.length-1);return{...e,matcher:r,compiledParams:a}})})};return e.forEach((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let r of O(e.path))o(e,t,!0,r);else o(e,t)}),t}function O(e){let t=e.split("/");if(0===t.length)return[];let[r,...a]=t,n=r.endsWith("?"),o=r.replace(/\?$/,"");if(0===a.length)return n?[o,""]:[o];let i=O(a.join("/")),l=[];return l.push(...i.map(e=>""===e?o:[o,e].join("/"))),n&&l.push(...i),l.map(t=>e.startsWith("/")&&""===t?"/":t)}var $=/^:[\w-]+$/,A=3,j=2,z=1,F=10,U=-2,N=e=>"*"===e;function H(e,t){let r=e.split("/"),a=r.length;return r.some(N)&&(a+=U),t&&(a+=j),r.filter(e=>!N(e)).reduce((e,t)=>e+($.test(t)?A:""===t?z:F),a)}function _(e,t,r=!1){let{routesMeta:a}=e,n={},o="/",i=[];for(let l=0;l<a.length;++l){let e=a[l],s=l===a.length-1,u="/"===o?t:t.slice(o.length)||"/",c={path:e.relativePath,caseSensitive:e.caseSensitive,end:s},d=e.matcher&&e.compiledParams?B(c,u,e.matcher,e.compiledParams):I(c,u),h=e.route;if(!d&&s&&r&&!a[a.length-1].route.index&&(d=I({path:e.relativePath,caseSensitive:e.caseSensitive,end:!1},u)),!d)return null;
11Object.assign(n,d.params),i.push({params:n,pathname:Z([o,d.pathname]),pathnameBase:te(Z([o,d.pathnameBase])),route:h}),"/"!==d.pathnameBase&&(o=Z([o,d.pathnameBase]))}return i}function I(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=W(e.path,e.caseSensitive,e.end);return B(e,t,r,a)}function B(e,t,r,a){let n=t.match(r);if(!n)return null;let o=n[0],i=o.replace(/(.)\/+$/,"$1"),l=n.slice(1);return{params:a.reduce((e,{paramName:t,isOptional:r},a)=>{if("*"===t){let e=l[a]||"";i=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const n=l[a];return e[t]=r&&!n?void 0:(n||"").replace(/%2F/g,"/"),e},{}),pathname:o,pathnameBase:i,pattern:e}}function W(e,t=!1,r=!0){y("*"===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,(e,t,r,n,o)=>{if(a.push({paramName:t,isOptional:null!=r}),r){let t=o.charAt(n+e.length);return t&&"/"!==t?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).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 q(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&"/"!==a?null:e.slice(r)||"/"}var Y=e=>s.test(e);function V(e,t){let r=ee(t).split("/");return e.split("/").forEach(e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)}),r.length>1?r.join("/"):"/"}function J(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 K(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function X(e){let t=K(e);return t.map((e,r)=>r===t.length-1?e.pathname:e.pathnameBase)}function G(e,t,r,a=!1){let n;"string"==typeof e?n=b(e):(n={...e},m(!n.pathname||!n.pathname.includes("?"),J("?","pathname","search",n)),m(!n.pathname||!n.pathname.includes("#"),J("#","pathname","hash",n)),m(!n.search||!n.search.includes("#"),J("#","search","hash",n)));let o,i=""===e||""===n.pathname,l=i?"/":n.pathname;if(null==l)o=r;else{let e=t.length-1;if(!a&&l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;n.pathname=t.join("/")}o=e>=0?t[e]:"/"}let s=function(e,t="/"){let r,{pathname:a,search:n="",hash:o=""}="string"==typeof e?b(e):e;return a?(a=Q(a),r=a.startsWith("/")?V(a.substring(1),"/"):V(a,t)):r=t,{pathname:r,search:re(n),hash:ae(o)}}(n,o),u=l&&"/"!==l&&l.endsWith("/"),c=(i||"."===l)&&r.endsWith("/");return s.pathname.endsWith("/")||!u&&!c||(s.pathname+="/"),s}var Q=e=>e.replace(/[\\/]{2,}/g,"/"),Z=e=>Q(e.join("/")),ee=e=>e.replace(/\/+$/,""),te=e=>ee(e).replace(/^\/*/,"/"),re=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",ae=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",ne=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],oe=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 ie(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}function le(e){let t=e.map(e=>e.route.path).filter(Boolean);return Z(t)||"/"}var se="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function ue(e,t){let r=e;if("string"!=typeof r||!s.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,n=!1;if(se)try{let e=new URL(window.location.href),a=u.test(r)?new URL(c(r,e.protocol)):new URL(r),o=q(a.pathname,t);a.origin===e.origin&&null!=o?r=o+a.search+a.hash:n=!0}catch(o){y(!1,`<Link to="${r}">
11 contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:n,to:r}}var ce=Symbol("Uninstrumented");function de(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){let t=Object.keys(r);for(let a of t)e[a]&&r[a].push(e[a])}}));let a={};if("function"==typeof t.lazy&&r.lazy.length>0){let e=he(r.lazy,t.lazy,()=>{});e&&(a.lazy=e)}if("object"==typeof t.lazy){let e=t.lazy;["middleware","loader","action"].forEach(t=>{let n=e[t],o=r[`lazy.${t}`];if("function"==typeof n&&o.length>0){let e=he(o,n,()=>{});e&&(a.lazy=Object.assign(a.lazy||{},{[t]:e}))}})}return["loader","action"].forEach(e=>{let n=t[e];if("function"==typeof n&&r[e].length>0){let t=n[ce]??n,o=he(r[e],t,(...e)=>pe(e[0]));o&&("loader"===e&&!0===t.hydrate&&(o.hydrate=!0),o[ce]=t,a[e]=o)}}),t.middleware&&t.middleware.length>0&&r.middleware.length>0&&(a.middleware=t.middleware.map(e=>{let t=e[ce]??e,a=he(r.middleware,t,(...e)=>pe(e[0]));return a?(a[ce]=t,a):e})),a}function he(e,t,r){return 0===e.length?null:async(...a)=>{let n=await fe(e,r(...a),()=>t(...a),e.length-1);if("error"===n.type)throw n.value;return n.value}}async function fe(e,t,r,a){let n,o=e[a];if(o){let l,s=async()=>(l||(l=fe(e,t,r,a-1)),n=await l,m(n,"Expected a result"),"error"===n.type&&n.value instanceof Error?{status:"error",error:n.value}:{status:"success",error:void 0});try{await o(s,t)}catch(i){}l||await s(),await l}else try{let e=await r();n={type:"success",value:e}}catch(i){n={type:"error",value:i}}return n||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function pe(e){let{request:t,context:r,params:a,pattern:n}=e;return{request:ye(t),params:{...a},pattern:n,context:ve(r)}}function me(e,t){return{currentUrl:w(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 ye(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function ve(e){if(function(e){if(null===e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t||Object.getOwnPropertyNames(t).sort().join("\0")===ge}(e)){let t={...e};return Object.freeze(t),t}return{get:t=>e.get(t)}}var ge=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var we,be,Re,Ee,Se=["POST","PUT","PATCH","DELETE"],xe=new Set(Se),ke=["GET",...Se],Ce=new Set(ke),Le=new Set([301,302,303,307,308]),Pe=new Set([307,308]),De={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Te={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Me={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Oe=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),$e="remix-router-transitions",Ae=Symbol("ResetLoaderData"),je=class{constructor(e){i(this,we),i(this,be),i(this,Re),i(this,Ee),l(this,we,e),l(this,be,T(e))}get stableRoutes(){return o(this,we)}get activeRoutes(){return o(this,Re)??o(this,we)}get branches(){return o(this,Ee)??o(this,be)}get hasHMRRoutes(){return null!=o(this,Re)}setRoutes(e){l(this,we,e),l(this,be,T(e))}
11setHmrRoutes(e){l(this,Re,e),l(this,Ee,T(e))}commitHmrRoutes(){o(this,Re)&&(l(this,we,o(this,Re)),l(this,be,o(this,Ee)),l(this,Re,void 0),l(this,Ee,void 0))}};function ze(e){const t=e.window?e.window:"undefined"!=typeof window?window:void 0,r=void 0!==t&&void 0!==t.document&&void 0!==t.document.createElement;m(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a=e.hydrationRouteProperties||[],n=e.mapRouteProperties||Oe,o=n;if(e.instrumentations){let t=e.instrumentations;o=e=>({...n(e),...de(t.map(e=>e.route).filter(Boolean),e)})}let i={},l=new je(C(e.routes,o,void 0,i)),s=e.basename||"/";s.startsWith("/")||(s=`/${s}`);let u,c,d,h=e.dataStrategy||Ke,f={...e.future},p=null,v=new Set,S=null,x=null,k=null,L=null,P=null!=e.hydrationData,T=D(l.activeRoutes,e.history.location,s,!1,l.branches),M=!1,O=null;if(null!=T||e.patchRoutesOnNavigation){if(T&&!e.hydrationData){Ie(T,l.activeRoutes,e.history.location.pathname).active&&(T=null)}if(T)if(T.some(e=>e.route.lazy))u=!1,c=!u;else if(T.some(e=>He(e.route))){let t=e.hydrationData?e.hydrationData.loaderData:null,r=e.hydrationData?e.hydrationData.errors:null,a=T;if(r){let e=T.findIndex(e=>void 0!==r[e.route.id]);a=a.slice(0,e+1)}c=!1,u=!0,a.forEach(e=>{let a=_e(e.route,t,r);c=c||a.renderFallback,u=u&&!a.shouldLoad})}else u=!0,c=!u;else{u=!1,c=!u,T=[];let t=Ie(null,l.activeRoutes,e.history.location.pathname);t.active&&t.matches&&(M=!0,T=t.matches)}}else{let t=mt(404,{pathname:e.history.location.pathname}),{matches:r,route:a}=pt(l.activeRoutes);u=!0,c=!u,T=r,O={[a.id]:t}}let $,A,j={historyAction:e.history.action,location:e.history.location,matches:T,initialized:u,renderFallback:c,navigation:De,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||O,fetchers:new Map,blockers:new Map},z="POP",F=null,U=!1,N=!1,H=new Map,_=null,I=!1,B=!1,W=new Set,V=new Map,J=0,K=-1,X=new Map,G=new Set,Q=new Map,Z=new Map,ee=new Set,te=new Map,re=null;function ae(e,t={}){e.matches&&(e.matches=e.matches.map(e=>{let t=i[e.route.id],r=e.route;return r.element!==t.element||r.errorElement!==t.errorElement||r.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e})),j={...j,...e};let r=[],a=[];j.fetchers.forEach((e,t)=>{"idle"===e.state&&(ee.has(t)?r.push(t):a.push(t))}),ee.forEach(e=>{j.fetchers.has(e)||V.has(e)||r.push(e)}),0===v.size&&(S={newErrors:e.errors??null}),[...v].forEach(a=>a(j,{deletedFetchers:r,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:!0===t.flushSync})),r.forEach(e=>we(j.fetchers,e)),a.forEach(e=>j.fetchers.delete(e))}function ne(t,r,{flushSync:a}={}){let n,o=null!=j.actionData&&null!=j.navigation.formMethod&&xt(j.navigation.formMethod)&&"loading"===j.navigation.state&&!0!==t.state?._isRedirect;n=r.actionData?Object.keys(r.actionData).length>0?r.actionData:null:o?j.actionData:null;let i=r.loaderData?dt(j.loaderData,r.loaderData,r.matches||[],r.errors):j.loaderData,s=j.blockers;s.size>
110&&(s=new Map(s),s.forEach((e,t)=>s.set(t,Me)));let u,c=!I&&ze(t,r.matches||j.matches),d=!0===U||null!=j.navigation.formMethod&&xt(j.navigation.formMethod)&&!0!==t.state?._isRedirect;if(l.commitHmrRoutes(),I||"POP"===z||("PUSH"===z?e.history.push(t,t.state):"REPLACE"===z&&e.history.replace(t,t.state)),"POP"===z){let e=H.get(j.location.pathname);e&&e.has(t.pathname)?u={currentLocation:j.location,nextLocation:t}:H.has(t.pathname)&&(u={currentLocation:t,nextLocation:j.location})}else if(N){let e=H.get(j.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),H.set(j.location.pathname,e)),u={currentLocation:j.location,nextLocation:t}}ae({...r,actionData:n,loaderData:i,historyAction:z,location:t,initialized:!0,renderFallback:!1,navigation:De,revalidation:"idle",restoreScrollPosition:c,preventScrollReset:d,blockers:s},{viewTransitionOpts:u,flushSync:!0===a}),z="POP",U=!1,N=!1,I=!1,B=!1,F?.resolve(),F=null,re?.resolve(),re=null}async function oe(t,r,n){$&&$.abort(),$=null,z=t,I=!0===(n&&n.startUninterruptedRevalidation),function(e,t){if(x&&L){let r=Ae(e,t);x[r]=L()}}(j.location,j.matches),U=!0===(n&&n.preventScrollReset),N=!0===(n&&n.enableViewTransition);let u=l.activeRoutes,c=n?.initialHydration&&j.matches&&j.matches.length>0&&!M?j.matches:D(u,r,s,!1,l.branches),d=!0===(n&&n.flushSync);if(c&&j.initialized&&!B&&function(e,t){if(e.pathname!==t.pathname||e.search!==t.search)return!1;if(""===e.hash)return""!==t.hash;if(e.hash===t.hash)return!0;if(""!==t.hash)return!0;return!1}(j.location,r)&&!(n&&n.submission&&xt(n.submission.formMethod)))return void ne(r,{matches:c},{flushSync:d});let h=Ie(c,u,r.pathname);if(h.active&&h.matches&&(c=h.matches),!c){let{error:e,notFoundMatches:t,route:a}=Le(r.pathname);return void ne(r,{matches:t,loaderData:{},errors:{[a.id]:e}},{flushSync:d})}let f=n&&n.overrideNavigation?{...n.overrideNavigation,matches:c,historyAction:t}:void 0;$=new AbortController;let p,m=it(e.history,r,$.signal,n&&n.submission),y=e.getContext?await e.getContext():new E;if(n&&n.pendingError)p=[ft(c).route.id,{type:"error",error:n.pendingError}];else if(n&&n.submission&&xt(n.submission.formMethod)){let u=await async function(t,r,n,u,c,d,h,f,p={}){ye();let m,y=function(e,t,r,a){let n={state:"submitting",location:e,matches:t,historyAction:r,formMethod:a.formMethod,formAction:a.formAction,formEncType:a.formEncType,formData:a.formData,json:a.json,text:a.text};return n}(r,u,c,n);if(ae({navigation:y},{flushSync:!0===p.flushSync}),h){let e=await We(u,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}=pt(l.activeRoutes);return{matches:t,pendingActionResult:[r.id,{type:"error",error:e.error}]}}let t=ft(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:"error",error:e.error}]}}if(!e.matches){let{notFoundMatches:e,error:t,route:a}=Le(r.pathname);return{matches:e,pendingActionResult:[a.id,{type:"error",error:t}]}}u=e.matches}let v=Ct(u,r);if(v.route.action||v.route.lazy){let e=et(o,i,t,r,u,v,f?[]:a,d),n=await fe(t,r,e,d,null);if(m=n[v.route.id],!m)for(let t of u)if(n[t.route.id]){m=n[t.route.id];break}if(t.signal.aborted)return{shortCircuited:!0}}else m={type:"error",error:mt(405,{method:t.method,pathname:r.pathname,routeId:v.route.id})};if(Rt(m)){let r;if(p&&null!=p.replace)r=p.replace;else{r=ot(m.response.headers.get("Location"),new URL(t.url),s,e.history)===j.location.pathname+j.location.search}return await ue(t,m,!0,{submission:n,replace:r}),{shortCircuited:!0}}if(bt(m)){let e=ft(u,v.route.id);return!0!==(p&&p.replace)&&(z="PUSH"),{matches:u,pendingActionResult:[e.route.id,m,v.route.id]}}return{matches:u,pendingActionResult:[v.route.id,m]}}(m,r,n.submission,c,t,y,h.active,n&&!0===n.initialHydration,{replace:n.replace,flushSync:d});if(u.shortCircuited)return;if(u.pendingActionResult){let[e,t]=u.pendingActionResult;if(bt(t)&&ie(t.error)&&404===t.error.status)return $=null,void ne(r,{matches:u.matches,loaderData:{},errors:{[e]:t.error}})}c=u.matches||c,p=u.pendingActionResult,f=Pt(r,c,t,n.submission),d=!1,h.active=!1,m=it(e.history,m.url,m.signal)}let{shortCircuited:v,matches:g,loaderData:w,errors:b,workingFetchers:R}=await async function(t,r,n,u,c,d,h,f,p,m,y,v,g,w){let b=h||Pt(r,n,u,f),R=f||p||Lt(b),E=!I&&!y;if(d){if(E){let e=se(g);ae({navigation:b,...void 0!==e?{actionData:e}:{}},{flushSync:v})}let e=await We(n,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}=pt(l.activeRoutes);return{matches:t,loaderData:{},errors:{[r.id]:e.error}}}let t=ft(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(!e.matches){let{error:e,notFoundMatches:t,route:a}=Le(r.pathname);return{matches:t,loaderData:{},errors:{[a.id]:e}}}n=e.matches}let S=l.activeRoutes,{dsMatches:x,revalidatingFetchers:k}=Ne(t,c,o,i,e.history,j,n,R,r,y?[]:a,!0===y,B,W,ee,Q,G,S,s,null!=e.patchRoutesOnNavigation,l.branches,g,w
11);if(K=++J,!e.dataStrategy&&!x.some(e=>e.shouldLoad)&&!x.some(e=>e.route.middleware&&e.route.middleware.length>0)&&0===k.length){let e=new Map(j.fetchers),t=Ee(e);return ne(r,{matches:n,loaderData:{},errors:g&&bt(g[1])?{[g[0]]:g[1].error}:null,...ht(g),...t?{fetchers:e}:{}},{flushSync:v}),{shortCircuited:!0}}if(E){let e={};if(!d){e.navigation=b;let t=se(g);void 0!==t&&(e.actionData=t)}k.length>0&&(e.fetchers=function(e){let t=new Map(j.fetchers);return e.forEach(e=>{let r=t.get(e.key),a=Dt(void 0,r?r.data:void 0);t.set(e.key,a)}),t}(k)),ae(e,{flushSync:v})}k.forEach(e=>{be(e.key),e.controller&&V.set(e.key,e.controller)});let C=()=>k.forEach(e=>be(e.key));$&&$.signal.addEventListener("abort",C);let{loaderResults:L,fetcherResults:P}=await pe(x,k,t,r,c);if(t.signal.aborted)return{shortCircuited:!0};$&&$.signal.removeEventListener("abort",C);k.forEach(e=>V.delete(e.key));let D=yt(L);if(D)return await ue(t,D.result,!0,{replace:m}),{shortCircuited:!0};if(D=yt(P),D)return G.add(D.key),await ue(t,D.result,!0,{replace:m}),{shortCircuited:!0};let T=new Map(j.fetchers),{loaderData:M,errors:O}=ct(j,n,L,g,k,P,T);y&&j.errors&&(O={...j.errors,...O});let A=Ee(T),z=Se(K,T),F=A||z||k.length>0;return{matches:n,loaderData:M,errors:O,...F?{workingFetchers:T}:{}}}(m,r,c,t,y,h.active,f,n&&n.submission,n&&n.fetcherSubmission,n&&n.replace,n&&!0===n.initialHydration,d,p,n&&n.callSiteDefaultShouldRevalidate);v||($=null,ne(r,{matches:g||c,...ht(p),loaderData:w,errors:b,...R?{fetchers:R}:{}}))}function se(e){return e&&!bt(e[1])?{[e[0]]:e[1].data}:j.actionData?0===Object.keys(j.actionData).length?null:j.actionData:void 0}async function ue(a,n,o,{submission:i,fetcherSubmission:l,preventScrollReset:u,replace:c}={}){o||(F?.resolve(),F=null),n.response.headers.has("X-Remix-Revalidate")&&(B=!0);let d=n.response.headers.get("Location");m(d,"Expected a Location header on the redirect Response"),d=ot(d,new URL(a.url),s,e.history);let h=g(j.location,d,{_isRedirect:!0});if(r){let e=!1;if(n.response.headers.has("X-Remix-Reload-Document"))e=!0;else if(Y(d)){const r=R(t,d,!0);e=r.origin!==t.location.origin||null==q(r.pathname,s)}if(e)return void(c?t.location.replace(d):t.location.assign(d))}$=null;let f=!0===c||n.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:p,formAction:y,formEncType:v}=j.navigation;!i&&!l&&p&&y&&v&&(i=Lt(j.navigation));let w=i||l;if(Pe.has(n.response.status)&&w&&xt(w.formMethod))await oe(f,h,{submission:{...w,formAction:d},preventScrollReset:u||U,enableViewTransition:o?N:void 0});else{let e=Pt(h,[],f,i);await oe(f,h,{overrideNavigation:e,fetcherSubmission:l,preventScrollReset:u||U,enableViewTransition:o?N:void 0})}}async function fe(e,t,r,a,n){let o,i={};try{o=await async function(e,t,r,a,n,o){a.some(e=>e._lazyPromises?.middleware)&&await Promise.all(a.map(e=>e._lazyPromises?.middleware));let i={request:t,url:lt(t,r),pattern:le(a),params:a[0].params,context:o,matches:a},l=e=>{let t=i;return Xe(t,()=>e({...t,fetcherKey:n,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},s=await e({...i,fetcherKey:n,runClientMiddleware:l});try{await Promise.all(a.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch(u){}return s}(h,e,t,r,n,a)}catch(l){return r.filter(e=>e.shouldLoad).forEach(e=>{i[e.route.id]={type:"error",error:l}}),i}if(e.signal.aborted)return i;if(!xt(e.method))for(let s of r){if("error"===o[s.route.id]?.type)break;o.hasOwnProperty(s.route.id)||j.loaderData.hasOwnProperty(s.route.id)||j.errors&&j.errors.hasOwnProperty(s.route.id)||!s.shouldCallHandler()||(o[s.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${s.route.id}`)})}for(let[u,c]of Object.entries(o))if(wt(c)){let t=c.result;i[u]={type:"redirect",response:rt(t,e,u,r,s)}}else i[u]=await tt(c);return i}async function pe(e,t,r,a,n){let o=fe(r,a,e,n,null),i=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await fe(e.request,e.path,e.matches,n,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:"error",error:mt(404,{pathname:e.path})}})}));return{loaderResults:await o,fetcherResults:(await i).reduce((e,t)=>
11Object.assign(e,t),{})}}function ye(){B=!0,Q.forEach((e,t)=>{V.has(t)&&W.add(t),be(t)})}function ve(e,t,r={}){let a=new Map(j.fetchers);a.set(e,t),ae({fetchers:a},{flushSync:!0===(r&&r.flushSync)})}function ge(e,t,r,a={}){let n=ft(j.matches,t),o=new Map(j.fetchers);we(o,e),ae({errors:{[n.route.id]:r},fetchers:o},{flushSync:!0===(a&&a.flushSync)})}function we(e,t){let r=j.fetchers.get(t);!V.has(t)||r&&"loading"===r.state&&X.has(t)||be(t),Q.delete(t),X.delete(t),G.delete(t),ee.delete(t),W.delete(t),e.delete(t)}function be(e,t){let r=V.get(e);r&&(r.abort(t),V.delete(e))}function Re(e,t){for(let r of e){let e=t.get(r);m(e,`Expected fetcher: ${r}`);let a=Tt(e.data);t.set(r,a)}}function Ee(e){let t=[],r=!1;for(let a of G){let n=e.get(a);m(n,`Expected fetcher: ${a}`),"loading"===n.state&&(G.delete(a),t.push(a),r=!0)}return Re(t,e),r}function Se(e,t){let r=[];for(let[a,n]of X)if(n<e){let e=t.get(a);m(e,`Expected fetcher: ${a}`),"loading"===e.state&&(be(a),X.delete(a),r.push(a))}return Re(r,t),r.length>0}function xe(e){j.blockers.delete(e),te.delete(e)}function ke(e,t){let r=j.blockers.get(e)||Me;m("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 a=new Map(j.blockers);a.set(e,t),ae({blockers:a})}function Ce({currentLocation:e,nextLocation:t,historyAction:r}){if(0===te.size)return;te.size>1&&y(!1,"A router only supports one blocker at a time");let a=Array.from(te.entries()),[n,o]=a[a.length-1],i=j.blockers.get(n);return i&&"proceeding"===i.state?void 0:o({currentLocation:e,nextLocation:t,historyAction:r})?n:void 0}function Le(e){let t=mt(404,{pathname:e}),r=l.activeRoutes,{matches:a,route:n}=pt(r);return{notFoundMatches:a,route:n,error:t}}function Ae(e,t){if(k){return k(e,t.map(e=>function(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}}(e,j.loaderData)))||e.key}return e.key}function ze(e,t){if(x){let r=Ae(e,t),a=x[r];if("number"==typeof a)return a}return null}function Ie(t,r,a){if(e.patchRoutesOnNavigation){let e=l.branches;if(!t){return{active:!0,matches:D(r,a,s,!0,e)||[]}}if(Object.keys(t[0].params).length>0){return{active:!0,matches:D(r,a,s,!0,e)}}}return{active:!1,matches:null}}async function We(t,r,a,n){if(!e.patchRoutesOnNavigation)return{type:"success",matches:t};let u=t;for(;;){let t=i;try{await e.patchRoutesOnNavigation({signal:a,path:r,matches:u,fetcherKey:n,patch:(e,r)=>{a.aborted||Be(e,r,l,t,o,!1)}})}catch(c){return{type:"error",error:c,partialMatches:u}}if(a.aborted)return{type:"aborted"};let d=l.branches,h=D(l.activeRoutes,r,s,!1,d),f=null;if(h){if(0===Object.keys(h[0].params).length)return{type:"success",matches:h};if(f=D(l.activeRoutes,r,s,!0,d),!(f&&u.length<f.length&&qe(u,f.slice(0,u.length))))return{type:"success",matches:h}}if(f||(f=D(l.activeRoutes,r,s,!0,d)),!f||qe(u,f))return{type:"success",matches:null};u=f}}function qe(e,t){return e.length===t.length&&e.every((e,r)=>e.route.id===t[r].route.id)}return d={get basename(){return s},get future(){return f},get state(){return j},get routes(){return l.stableRoutes},get branches(){return l.branches},get manifest(){return i},get window(){return t},initialize:function(){if(p=e.history.listen(({action:t,location:r,delta:a})=>{if(A)return A(),void(A=void 0);y(0===te.size||null!=a,"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 n=Ce({currentLocation:j.location,nextLocation:r,historyAction:t});if(n&&null!=a){let t=new Promise(e=>{A=e});return e.history.go(-1*a),ke(n,{state:"blocked",location:r,proceed(){ke(n,{state:"proceeding",proceed:void 0,reset:void 0,location:r}),t.then(()=>e.history.go(a))},reset(){let e=new Map(j.blockers);e.set(n,Me),ae({blockers:e})}}),F?.resolve(),void(F=null)}return oe(t,r)}),r){!function(e,t){try{let r=e.sessionStorage.getItem($e);if(r){let e=JSON.parse(r);for(let[r,a]of Object.entries(e||{}))a&&Array.isArray(a)&&t.set(r,new Set(a||[]))}}catch(r){}}(t,H);let e=()=>function(e,t){if(t.size>0){let a={};for(let[e,r]of t)a[e]=[...r];try{e.sessionStorage.setItem($e,JSON.stringify(a))}catch(r){y(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}(t,H);t.addEventListener("pagehide",e),_=()=>t.removeEventListener("pagehide",e)}return j.initialized||oe("POP",j.location,{initialHydration:!0}),d},subscribe:function(e){if(v.add(e),S){let{newErrors:t}=S;S=null,e(j,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>v.delete(e)},enableScrollRestoration:function(e,t,r){if(x=e,L=t,k=r||null,!P&&j.navigation===De){P=!0;let e=ze(j.location,j.matches);null!=e&&ae({restoreScrollPosition:e})}return()=>{x=null,L=null,k=null}},navigate:async function t(r,a){if(F?.resolve(),F=null,"number"==typeof r){F||(F=Mt());let t=F.promise;return e.history.go(r),t}let n,o=Fe(j.location,j.matches,s,r,a?.fromRouteId,a?.relative),{path:i,submission:l,error:u}=Ue(!1,o,a);if(a?.mask){n={pathname:"",search:"",hash:"",..."string"==typeof a.mask?b(a.mask):{...j.location.mask,...a.mask}}}let c=j.location,d=g(c,i,a&&a.state,void 0,n);d={...d,...e.history.encodeLocation(d)};let h=a&&null!=a.replace?a.replace:void 0,f="PUSH";!0===h?f="REPLACE":!1===h||null!=l&&xt(l.formMethod)&&l.formAction===j.location.pathname+j.location.search&&(f="REPLACE");let p=a&&"preventScrollReset"in a?!0===a.preventScrollReset:void 0,m=!0===(a&&a.flushSync),y=Ce({currentLocation:c,nextLocation:d,historyAction:f});y?ke(y,{state:"blocked",location:d,proceed(){ke(y,{state:"proceeding",proceed:void 0,reset:void 0,location:d}),t(r,a)},reset(){let e=new Map(j.blockers);e.set(y,Me),ae({blockers:e})}}):await oe(f,d,{submission:l,pendingError:u,preventScrollReset:p,replace:a&&a.replace,enableViewTransition:a&&a.viewTransition,flushSync:m,callSiteDefaultShouldRevalidate:a&&a.defaultShouldRevalidate})},fetch:async function(t,r,n,u){be(t);let c=!0===(u&&u.flushSync),d=l.activeRoutes,h=Fe(j.location,j.matches,s,n,r,u?.relative),f=D(d,h,s,!1,l.branches),p=Ie(f,d,h);if(p.active&&p.matches&&(f=p.matches),!f)return void ge(t,r,mt(404,{pathname:h}),{flushSync:c});let{path:y,submission:v,error:g}=Ue(!0,h,u);if(g)return void ge(t,r,g,{flushSync:c});let w=e.getContext?await e.getContext():new E,b=!0===(u&&u.preventScrollReset);v&&xt(v.formMethod)?await async function(t,r,n,u,c,d,h,f,p,y){ye(),Q.delete(t);let v=j.fetchers.get(t);ve(t,function(e,t){let r={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};return r}(p,v),{flushSync:h});let g=new AbortController,w=it(e.history,n,g.signal,p);if(d){let e=await We(u,new URL(w.url).pathname,w.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void ge(t,r,e.error,{flushSync:h});if(!e.matches)return void ge(t,r,mt(404,{pathname:n}),{flushSync:h});u=e.matches}let b=Ct(u,n);if(!b.route.action&&!b.route.lazy){let e=mt(405,{method:p.formMethod,pathname:n,routeId:r});return void ge(t,r,e,{flushSync:h})}V.set(t,g);let R=J,E=et(o,i,w,n,u,b,a,c),S=await fe(w,n,E,c,t),x=S[b.route.id];if(!x)for(let e of E)if(S[e.route.id]){x=S[e.route.id];break}if(w.signal.aborted)return void(V.get(t)===g&&V.delete(t));if(ee.has(t)){if(Rt(x)||bt(x))return void ve(t,Tt(void 0))}else{if(Rt(x))return V.delete(t),K>R?void ve(t,Tt(void 0)):(G.add(t),ve(t,Dt(p)),ue(w,x,!1,{fetcherSubmission:p,preventScrollReset:f}));if(bt(x))return void ge(t,r,x.error)}let k=j.navigation.location||j.location,C=it(e.history,k,g.signal),L=l.activeRoutes,P="idle"!==j.navigation.state?D(L,j.navigation.location,s,!1,l.branches):j.matches;m(P,"Didn't find any matches after fetcher action");let T=++J;X.set(t,T);let{dsMatches:M,revalidatingFetchers:O}=Ne(C,c,o,i,e.history,j,P,p,k,a,!1,B,W,ee,Q,G,L,s,null!=e.patchRoutesOnNavigation,l.branches,[b.route.id,x],y),A=Dt(p,x.data),F=new Map(j.fetchers);F.set(t,A),O.filter(e=>
11e.key!==t).forEach(e=>{let t=e.key,r=F.get(t),a=Dt(void 0,r?r.data:void 0);F.set(t,a),be(t),e.controller&&V.set(t,e.controller)}),ae({fetchers:F});let U=()=>O.forEach(e=>be(e.key));g.signal.addEventListener("abort",U);let{loaderResults:N,fetcherResults:H}=await pe(M,O,C,k,c);if(g.signal.aborted)return;g.signal.removeEventListener("abort",U),X.delete(t),V.delete(t),O.forEach(e=>V.delete(e.key));let _=j.fetchers.has(t),I=e=>{if(!_)return e;let r=new Map(e.fetchers);return r.set(t,Tt(x.data)),{...e,fetchers:r}},q=yt(N);if(q)return j=I(j),ue(C,q.result,!1,{preventScrollReset:f});if(q=yt(H),q)return G.add(q.key),j=I(j),ue(C,q.result,!1,{preventScrollReset:f});let Y=new Map(j.fetchers);_&&Y.set(t,Tt(x.data));let{loaderData:Z,errors:te}=ct(j,P,N,void 0,O,H,Y);Se(T,Y),"loading"===j.navigation.state&&T>K?(m(z,"Expected pending action"),$&&$.abort(),ne(j.navigation.location,{matches:P,loaderData:Z,errors:te,fetchers:Y})):(ae({errors:te,loaderData:dt(j.loaderData,Z,P,te),fetchers:Y}),B=!1)}(t,r,y,f,w,p.active,c,b,v,u&&u.defaultShouldRevalidate):(Q.set(t,{routeId:r,path:y}),await async function(t,r,n,l,s,u,c,d,h){let f=j.fetchers.get(t);ve(t,Dt(h,f?f.data:void 0),{flushSync:c});let p=new AbortController,m=it(e.history,n,p.signal);if(u){let e=await We(l,new URL(m.url).pathname,m.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void ge(t,r,e.error,{flushSync:c});if(!e.matches)return void ge(t,r,mt(404,{pathname:n}),{flushSync:c});l=e.matches}let y=Ct(l,n);V.set(t,p);let v=J,g=et(o,i,m,n,l,y,a,s),w=await fe(m,n,g,s,t),b=w[y.route.id];if(!b)for(let e of l)if(w[e.route.id]){b=w[e.route.id];break}V.get(t)===p&&V.delete(t);if(m.signal.aborted)return;if(ee.has(t))return void ve(t,Tt(void 0));if(Rt(b))return K>v?void ve(t,Tt(void 0)):(G.add(t),void(await ue(m,b,!1,{preventScrollReset:d})));if(bt(b))return void ge(t,r,b.error);ve(t,Tt(b.data))}(t,r,y,f,w,p.active,c,b,v))},revalidate:function(){re||(re=Mt()),ye(),ae({revalidation:"loading"});let e=re.promise;return"submitting"===j.navigation.state?e:"idle"===j.navigation.state?(oe(j.historyAction,j.location,{startUninterruptedRevalidation:!0}),e):(oe(z||j.historyAction,j.navigation.location,{overrideNavigation:j.navigation,enableViewTransition:!0===N}),e)},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:function(e){return Z.set(e,(Z.get(e)||0)+1),ee.has(e)&&ee.delete(e),j.fetchers.get(e)||Te},resetFetcher:function(e,t){be(e,t?.reason),ve(e,Tt(null))},deleteFetcher:function(e){let t=(Z.get(e)||0)-1;t<=0?(Z.delete(e),ee.add(e)):Z.set(e,t),ae({fetchers:new Map(j.fetchers)})},dispose:function(){p&&p(),_&&_(),v.clear(),$&&$.abort(),j.fetchers.forEach((e,t)=>we(j.fetchers,t)),j.blockers.forEach((e,t)=>xe(t))},getBlocker:function(e,t){let r=j.blockers.get(e)||Me;return te.get(e)!==t&&te.set(e,t),r},deleteBlocker:xe,patchRoutes:function(e,t,r=!1){Be(e,t,l,i,o,r),l.hasHMRRoutes||ae({})},_internalFetchControllers:V,_internalSetRoutes:function(e){i={},l.setHmrRoutes(C(e,o,void 0,i))},_internalSetStateDoNotUseOrYouWillBreakYourApp(e){ae(e)}},e.instrumentations&&(d=function(e,t){let r={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){let t=Object.keys(e);for(let a of t)e[a]&&r[a].push(e[a])}})),r.navigate.length>0){let t=e.navigate[ce]??e.navigate,a=he(r.navigate,t,(...t)=>{let[r,a]=t;return{to:"number"==typeof r||"string"==typeof r?r:r?w(r):".",...me(e,a??{})}});a&&(a[ce]=t,e.navigate=a)}if(r.fetch.length>0){let t=e.fetch[ce]??e.fetch,a=he(r.fetch,t,(...t)=>{let[r,,a,n]=t;return{href:a??".",fetcherKey:r,...me(e,n??{})}});a&&(a[ce]=t,e.fetch=a)}return e}(d,e.instrumentations.map(e=>e.router).filter(Boolean))),d}function Fe(e,t,r,a,n,o){let i,l;if(n){i=[];for(let e of t)if(i.push(e),e.route.id===n){l=e;break}}else i=t,l=t[t.length-1];let s=G(a||".",X(i),q(e.pathname,r)||e.pathname,"path"===o);if(null==a&&(s.search=e.search,s.hash=e.hash),(null==a||""===a||"."===a)&&l){let e=kt(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:Z([e,t])}({basename:r,pathname:s.pathname})),w(s)}function Ue(e,t,r){if(!r||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(r))return{path:t};if(r.formMethod&&(a=r.formMethod,!Ce.has(a.toUpperCase())))return{path:t,error:mt(405,{method:r.formMethod})};var a;let n,o,i=()=>({path:t,error:mt(400,{type:"invalid-body"})}),l=(r.formMethod||"get").toUpperCase(),s=vt(t);if(void 0!==r.body){if("text/plain"===r.formEncType){if(!xt(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}\n`,""):String(r.body);return{path:t,submission:{formMethod:l,formAction:s,formEncType:r.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===r.formEncType){if(!xt(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(d){return i()}}}if(m("function"==typeof FormData,"FormData is not available in this environment"),r.formData)n=st(r.formData),o=r.formData;else if(r.body instanceof FormData)n=st(r.body),o=r.body;else if(r.body instanceof URLSearchParams)n=r.body,o=ut(n);else if(null==r.body)n=new URLSearchParams,o=new FormData;else try{n=new URLSearchParams(r.body),o=ut(n)}catch(d){return i()}let u={formMethod:l,formAction:s,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:o,json:void 0,text:void 0};if(xt(u.formMethod))return{path:t,submission:u};let c=b(t);return e&&c.search&&kt(c.search)&&n.append("index",""),c.search=`?${n}`,{path:w(c),submission:u}}function Ne(e,t,r,a,n,o,i,l,s,u,c,d,h,f,p,m,y,v,g,w,b,R){let E,S=b?bt(b[1])?b[1].error:b[1].data:void 0,x=n.createURL(o.location),k=n.createURL(s);if(c&&o.errors){let e=Object.keys(o.errors)[0];E=i.findIndex(t=>t.route.id===e)}else if(b&&bt(b[1])){let e=b[0];E=i.findIndex(t=>t.route.id===e)-1}let C=b?b[1].statusCode:void 0,L=C&&C>
11=400,P={currentUrl:x,currentParams:o.matches[0]?.params||{},nextUrl:k,nextParams:i[0].params,...l,actionResult:S,actionStatus:C},T=le(i),M=i.map((n,i)=>{let{route:l}=n,h=null;if(null!=E&&i>E)h=!1;else if(l.lazy)h=!0;else if(He(l))if(c){let{shouldLoad:e}=_e(l,o.loaderData,o.errors);h=e}else(function(e,t,r){let a=!t||r.route.id!==t.route.id,n=!e.hasOwnProperty(r.route.id);return a||n})(o.loaderData,o.matches[i],n)&&(h=!0);else h=!1;if(null!==h)return Ze(r,a,e,s,T,n,u,t,h);let f=!1;"boolean"==typeof R?f=R:L?f=!1:(d||x.pathname+x.search===k.pathname+k.search||x.search!==k.search||function(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}(o.matches[i],n))&&(f=!0);let p={...P,defaultShouldRevalidate:f},m=Ie(n,p);return Ze(r,a,e,s,T,n,u,t,m,p,R)}),O=[];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,b=D(y,e.path,v??"/",!1,w);if(!b){if(g&&p)return;return void O.push({key:l,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null})}if(m.has(l))return;let E=Ct(b,e.path),S=new AbortController,x=it(n,e.path,S.signal),k=null;if(h.has(l))h.delete(l),k=et(r,a,x,e.path,b,E,u,t);else if(p)d&&(k=et(r,a,x,e.path,b,E,u,t));else{let n;n="boolean"==typeof R?R:!L&&d;let o={...P,defaultShouldRevalidate:n};Ie(E,o)&&(k=et(r,a,x,e.path,b,E,u,t,o))}k&&O.push({key:l,routeId:e.routeId,path:e.path,matches:k,match:E,request:x,controller:S})}),{dsMatches:M,revalidatingFetchers:O}}function He(e){return null!=e.loader||null!=e.middleware&&e.middleware.length>0}function _e(e,t,r){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!He(e))return{shouldLoad:!1,renderFallback:!1};let a=null!=t&&e.id in t,n=null!=r&&void 0!==r[e.id];if(!a&&n)return{shouldLoad:!1,renderFallback:!1};if("function"==typeof e.loader&&!0===e.loader.hydrate)return{shouldLoad:!0,renderFallback:!a};let o=!a&&!n;return{shouldLoad:o,renderFallback:o}}function Ie(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}function Be(e,t,r,a,n,o){let i;if(e){let t=a[e];m(t,`No route found to patch children into: routeId = ${e}`),t.children||(t.children=[]),i=t.children}else i=r.activeRoutes;let l=[],s=[];if(t.forEach(e=>{let t=i.find(t=>We(e,t));t?s.push({existingRoute:t,newRoute:e}):l.push(e)}),l.length>0){let t=C(l,n,[e||"_","patch",String(i?.length||"0")],a);i.push(...t)}if(o&&s.length>0)for(let u=0;u<s.length;u++){let{existingRoute:e,newRoute:t}=s[u],r=e,[a]=C([t],n,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}r.hasHMRRoutes||r.setRoutes([...r.activeRoutes])}function We(e,t){return"id"in e&&"id"in t&&e.id===t.id||e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive&&(!(e.children&&0!==e.children.length||t.children&&0!==t.children.length)||(e.children?.every((e,r)=>t.children?.some(t=>We(e,t)))??!1))}we=new WeakMap,be=new WeakMap,Re=new WeakMap,Ee=new WeakMap;var qe=new WeakMap,Ye=({key:e,route:t,manifest:r,mapRouteProperties:a})=>{let n=r[t.id];if(m(n,"No route found in manifest"),!n.lazy||"object"!=typeof n.lazy)return;let o=n.lazy[e];if(!o)return;let i=qe.get(n);i||(i={},qe.set(n,i));let l=i[e];if(l)return l;let s=(async()=>{let t=function(e){return S.has(e)}(e),r=void 0!==n[e]&&"hasErrorBoundary"!==e;if(t)y(!t,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),i[e]=Promise.resolve();else if(r)y(!1,`Route "${n.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await o();null!=t&&(Object.assign(n,{[e]:t}),Object.assign(n,a(n)))}"object"==typeof n.lazy&&(n.lazy[e]=void 0,Object.values(n.lazy).every(e=>void 0===e)&&(n.lazy=void 0))})();return i[e]=s,s},Ve=new WeakMap;async function Je(e){let t=e.matches.filter(e=>e.shouldLoad),r={};return(await Promise.all(t.map(e=>
11e.resolve()))).forEach((e,a)=>{r[t[a].route.id]=e}),r}async function Ke(e){return e.matches.some(e=>e.route.middleware)?Xe(e,()=>Je(e)):Je(e)}function Xe(e,t){return async function(e,t,r,a,n){let{matches:o,...i}=e,l=o.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),s=await Ge(i,l,t,r,a,n);return s}(e,t,e=>{if(St(t=e)&&(r=t.status,Le.has(r))&&t.headers.has("Location"))throw e;var t,r;return e},gt,function(t,r,a){if(a)return Promise.resolve(Object.assign(a.value,{[r]:{type:"error",result:t}}));{let{matches:a}=e,n=Math.min(Math.max(a.findIndex(e=>e.route.id===r),0),Math.max(a.findIndex(e=>e.shouldCallHandler()),0)),o=ft(a,a[n].route.id).route.id;return Promise.resolve({[o]:{type:"error",result:t}})}})}async function Ge(e,t,r,a,n,o,i=0){let{request:l}=e;if(l.signal.aborted)throw l.signal.reason??new Error(`Request aborted: ${l.method} ${l.url}`);let s=t[i];if(!s){return await r()}let u,[c,d]=s,h=async()=>{if(u)throw new Error("You may only call `next()` once per middleware");try{let l=await Ge(e,t,r,a,n,o,i+1);return u={value:l},u.value}catch(l){return u={value:await o(l,c,u)},u.value}};try{let t=await d(e,h),r=null!=t?a(t):void 0;return n(r)?r:u?r??u.value:(u={value:await h()},u.value)}catch(f){return await o(f,c,u)}}function Qe(e,t,r,a,n){let o=Ye({key:"middleware",route:a.route,manifest:t,mapRouteProperties:e}),i=function(e,t,r,a,n){let o=r[e.id];if(m(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if("function"==typeof e.lazy){let t=Ve.get(o);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let r=(async()=>{m("function"==typeof e.lazy,"No lazy route function found");let t=await e.lazy(),r={};for(let e in t){let a=t[e];if(void 0===a)continue;let n=k(e),i=void 0!==o[e]&&"hasErrorBoundary"!==e;n?y(!n,"Route property "+e+" is not a supported property to be returned from a lazy route function. This property will be ignored."):i?y(!i,`Route "${o.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]=a}Object.assign(o,r),Object.assign(o,{...a(o),lazy:void 0})})();return Ve.set(o,r),r.catch(()=>{}),{lazyRoutePromise:r,lazyHandlerPromise:r}}let i,l=Object.keys(e.lazy),s=[];for(let c of l){if(n&&n.includes(c))continue;let o=Ye({key:c,route:e,manifest:r,mapRouteProperties:a});o&&(s.push(o),c===t&&(i=o))}let u=s.length>0?Promise.all(s).then(()=>{}):void 0;return u?.catch(()=>{}),i?.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:i}}(a.route,xt(r.method)?"action":"loader",t,e,n);return{middleware:o,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function Ze(e,t,r,a,n,o,i,l,s,u=null,c){let d=!1,h=Qe(e,t,r,o,i);return{...o,_lazyPromises:h,shouldLoad:s,shouldRevalidateArgs:u,shouldCallHandler:e=>(d=!0,u?Ie(o,"boolean"==typeof c?{...u,defaultShouldRevalidate:c}:"boolean"==typeof e?{...u,defaultShouldRevalidate:e}:u):s),resolve(e){let{lazy:t,loader:i,middleware:u}=o.route,c=d||s||e&&!xt(r.method)&&(t||i),f=u&&u.length>0&&!i&&!t;return!c||!xt(r.method)&&f?Promise.resolve({type:"data",result:void 0}):async function({request:e,path:t,pattern:r,match:a,lazyHandlerPromise:n,lazyRoutePromise:o,handlerOverride:i,scopedContext:l}){let s,u,c=xt(e.method),d=c?"action":"loader",h=n=>{let o,s=new Promise((e,t)=>o=t);u=()=>o(),e.signal.addEventListener("abort",u);let c=o=>"function"!=typeof n?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${a.route.id}]`)):n({request:e,url:lt(e,t),pattern:r,params:a.params,context:l},...void 0!==o?[o]:[]),h=(async()=>{try{return{type:"data",result:await(i?i(e=>c(e)):c())}}catch(e){return{type:"error",result:e}}})();return Promise.race([h,s])};try{let t=c?a.route.action:a.route.loader;if(n||o)if(t){let e,[r]=await Promise.all([h(t).catch(t=>{e=t}),n,o]);if(void 0!==e)throw e;s=r}else{await n;let t=c?a.route.action:a.route.loader;if(!t){if("action"===d){let t=new URL(e.url),r=t.pathname+t.search;throw mt(405,{method:e.method,pathname:r,routeId:a.route.id})}return{type:"data",result:void 0}}[s]=await Promise.all([h(t),o])}else{if(!t){let t=new URL(e.url);throw mt(404,{pathname:t.pathname+t.search})}s=await h(t)}}catch(f){return{type:"error",result:f}}finally{u&&e.signal.removeEventListener("abort",u)}return s}({request:r,path:a,pattern:n,match:o,lazyHandlerPromise:h?.handler,lazyRoutePromise:h?.route,handlerOverride:e,scopedContext:l})}}}function et(e,t,r,a,n,o,i,l,s=null){return n.map(u=>u.route.id!==o.route.id?{...u,shouldLoad:!1,shouldRevalidateArgs:s,shouldCallHandler:()=>!1,_lazyPromises:Qe(e,t,r,u,i),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Ze(e,t,r,a,le(n),u,i,l,!0,s))}async function tt(e){let{result:t,type:r}=e;if(St(t)){let e;try{e=await async function(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?null==e.body?null:e.json():e.text()}(t)}catch(n){return{type:"error",error:n}}return"error"===r?{type:"error",error:new oe(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:"data",data:e,statusCode:t.status,headers:t.headers}}return"error"===r?Et(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:(a=t,new oe(a.init?.status??500,a.init?.statusText??"Internal Server Error",a.data)),statusCode:ie(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:ie(t)?t.status:void 0}:Et(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};var a}function rt(e,t,r,a,n){let o=e.headers.get("Location");if(m(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!Y(o)){let i=a.slice(0,a.findIndex(e=>e.route.id===r)+1);
11o=Fe(new URL(t.url),i,n,o),e.headers.set("Location",o)}return e}var at=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function nt(e){try{return at.includes(new URL(e).protocol)}catch{return!1}}function ot(e,t,r,a){if(Y(e)){let a=e,n=u.test(a)?new URL(c(a,t.protocol)):new URL(a);if(nt(n.toString()))throw new Error("Invalid redirect location");let o=null!=q(n.pathname,r);if(n.origin===t.origin&&o)return Q(n.pathname)+n.search+n.hash}try{if(nt(a.createURL(e).toString()))throw new Error("Invalid redirect location")}catch(n){}return e}function it(e,t,r,a){let n=e.createURL(vt(t)).toString(),o={signal:r};if(a&&xt(a.formMethod)){let{formMethod:e,formEncType:t}=a;o.method=e.toUpperCase(),"application/json"===t?(o.headers=new Headers({"Content-Type":t}),o.body=JSON.stringify(a.json)):"text/plain"===t?o.body=a.text:"application/x-www-form-urlencoded"===t&&a.formData?o.body=st(a.formData):o.body=a.formData}return new Request(n,o)}function lt(e,t){let r=new URL(e.url),a="string"==typeof t?b(t):t;if(r.pathname=a.pathname||"/",a.search){let e=new URLSearchParams(a.search),t=e.getAll("index");e.delete("index");for(let r of t.filter(Boolean))e.append("index",r);r.search=e.size?`?${e.toString()}`:""}else r.search="";return r.hash=a.hash||"",r}function st(e){let t=new URLSearchParams;for(let[r,a]of e.entries())t.append(r,"string"==typeof a?a:a.name);return t}function ut(e){let t=new FormData;for(let[r,a]of e.entries())t.append(r,a);return t}function ct(e,t,r,a,n,o,i){let{loaderData:l,errors:s}=function(e,t,r,a=!1,n=!1){let o,i={},l=null,s=!1,u={},c=r&&bt(r[1])?r[1].error:void 0;return e.forEach(r=>{if(!(r.route.id in t))return;let d=r.route.id,h=t[d];if(m(!Rt(h),"Cannot handle redirect results in processLoaderData"),bt(h)){let t=h.error;if(void 0!==c&&(t=c,c=void 0),l=l||{},n)l[d]=t;else{let r=ft(e,d);null==l[r.route.id]&&(l[r.route.id]=t)}a||(i[d]=Ae),s||(s=!0,o=ie(h.error)?h.error.status:500),h.headers&&(u[d]=h.headers)}else i[d]=h.data,h.statusCode&&200!==h.statusCode&&!s&&(o=h.statusCode),h.headers&&(u[d]=h.headers)}),void 0!==c&&r&&(l={[r[0]]:c},r[2]&&(i[r[2]]=void 0)),{loaderData:i,errors:l,statusCode:o||200,loaderHeaders:u}}(t,r,a);return n.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:r,match:a,controller:n}=t;if(n&&n.signal.aborted)return;let l=o[r];if(m(l,"Did not find corresponding fetcher result"),bt(l)){let t=ft(e.matches,a?.route.id);s&&s[t.route.id]||(s={...s,[t.route.id]:l.error}),i.delete(r)}else if(Rt(l))m(!1,"Unhandled fetcher revalidation redirect");else{let e=Tt(l.data);i.set(r,e)}}),{loaderData:l,errors:s}}function dt(e,t,r,a){let n=Object.entries(t).filter(([,e])=>e!==Ae).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&&(n[r]=e[r]),a&&a.hasOwnProperty(r))break}return n}function ht(e){return e?bt(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function ft(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 pt(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 mt(e,{pathname:t,routeId:r,method:a,type:n,message:o}={}){let i="Unknown Server Error",l="Unknown @remix-run/router error";return 400===e?(i="Bad Request",a&&t&&r?l=`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.`:"invalid-body"===n&&(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",a&&t&&r?l=`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&&(l=`Invalid request method "${a.toUpperCase()}"`)),new oe(e||500,i,new Error(l),!0)}function yt(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[e,a]=t[r];if(Rt(a))return{key:e,result:a}}}function vt(e){return w({..."string"==typeof e?b(e):e,hash:""})}function gt(e){return null!=e&&"object"==typeof e&&Object.entries(e).every(([e,t])=>"string"==typeof e&&function(e){return null!=e&&"object"==typeof e&&"type"in e&&"result"in e&&("data"===e.type||"error"===e.type)}(t))}function wt(e){return St(e.result)&&Le.has(e.result.status)}function bt(e){return"error"===e.type}function Rt(e){return"redirect"===(e&&e.type)}function Et(e){return"object"==typeof e&&null!=e&&"type"in e&&"data"in e&&"init"in e&&"DataWithResponseInit"===e.type}function St(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"==typeof e.headers&&void 0!==e.body}function xt(e){return xe.has(e.toUpperCase())}function kt(e){return new URLSearchParams(e).getAll("index").some(e=>""===e)}function Ct(e,t){let r="string"==typeof t?b(t).search:t.search;if(e[e.length-1].route.index&&kt(r||""))return e[e.length-1];let a=K(e);return a[a.length-1]}function Lt(e){let{formMethod:t,formAction:r,formEncType:a,text:n,formData:o,json:i}=e;if(t&&r&&a)return null!=n?{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:void 0,text:n}:null!=o?{formMethod:t,formAction:r,formEncType:a,formData:o,json:void 0,text:void 0}:void 0!==i?{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:i,text:void 0}:void 0}function Pt(e,t,r,a){if(a){return{state:"loading",location:e,matches:t,historyAction:r,formMethod:a.formMethod,formAction:a.formAction,formEncType:a.formEncType,formData:a.formData,json:a.json,text:a.text}}return{state:"loading",location:e,matches:t,historyAction:r,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Dt(e,t){if(e){return{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}}return{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Tt(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 Mt(){let e,t,r=new Promise((a,n)=>{e=async e=>{a(e);try{await r}catch(t){}},t=async e=>{n(e);try{await r}catch(t){}}});return{promise:r,resolve:e,reject:t}}var Ot=e.createContext(null);Ot.displayName="DataRouter";var $t=e.createContext(null);$t.displayName="DataRouterState";var At=e.createContext(!1);function jt(){return e.useContext(At)}var zt=e.createContext({isTransitioning:!1});zt.displayName="ViewTransition";var Ft=e.createContext(new Map);Ft.displayName="Fetchers",e.createContext(null).displayName="Await";var Ut=e.createContext(null);Ut.displayName="Navigation";var Nt=e.createContext(null);Nt.displayName="Location";var Ht=e.createContext({outlet:null,matches:[],isDataRoute:!1});Ht.displayName="Route";var _t=e.createContext(null);_t.displayName="RouteError";var It="REACT_ROUTER_ERROR";function Bt(){return null!=e.useContext(Nt)}function Wt(){return m(Bt(),"useLocation() may be used only in the context of a <Router> component."),e.useContext(Nt).location}function qt(){return e.useContext(Nt).navigationType}var Yt="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Vt(t){e.useContext(Ut).static||e.useLayoutEffect(t)}function Jt(){let{isDataRoute:t}=e.useContext(Ht);return t?function(){let{router:t}=function(t){let r=e.useContext(Ot);return m(r,ir(t)),r}("useNavigate"),r=lr("useNavigate"),a=e.useRef(!1);return Vt(()=>{a.current=!0}),e.useCallback(async(e,n={})=>{y(a.current,Yt),a.current&&("number"==typeof e?await t.navigate(e):await t.navigate(e,{fromRouteId:r,...n}))},[t,r])}():function(){m(Bt(),"useNavigate() may be used only in the context of a <Router> component.");let t=e.useContext(Ot),{basename:r,navigator:a}=e.useContext(Ut),{matches:n}=e.useContext(Ht),{pathname:o}=Wt(),i=JSON.stringify(X(n)),l=e.useRef(!1);return Vt(()=>{l.current=!0}),e.useCallback((e,n={})=>
11{if(y(l.current,Yt),!l.current)return;if("number"==typeof e)return void a.go(e);let s=G(e,JSON.parse(i),o,"path"===n.relative);null==t&&"/"!==r&&(s.pathname="/"===s.pathname?r:Z([r,s.pathname])),(n.replace?a.replace:a.push)(s,n.state,n)},[r,a,i,o,t])}()}var Kt=e.createContext(null);function Xt(){return e.useContext(Kt)}function Gt(){let{matches:t}=e.useContext(Ht),r=t[t.length-1];return r?.params??{}}function Qt(t,{relative:r}={}){let{matches:a}=e.useContext(Ht),{pathname:n}=Wt(),o=JSON.stringify(X(a));return e.useMemo(()=>G(t,JSON.parse(o),n,"path"===r),[t,o,n,r])}function Zt(t,r,a){m(Bt(),"useRoutes() may be used only in the context of a <Router> component.");let n,{navigator:o}=e.useContext(Ut),{matches:i}=e.useContext(Ht),l=i[i.length-1],s=l?l.params:{},u=l?l.pathname:"/",c=l?l.pathnameBase:"/",d=l&&l.route;{let e=d&&d.path||"";cr(u,!d||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${e}">) 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.\n\nPlease change the parent <Route path="${e}"> to <Route path="${"/"===e?"*":`${e}/*`}">.`)}n=Wt();let h=n.pathname||"/",f=h;if("/"!==c){let e=c.replace(/^\//,"").split("/");f="/"+h.replace(/^\//,"").split("/").slice(e.length).join("/")}let p=a&&a.state.matches.length?a.state.matches.map(e=>Object.assign(e,{route:a.manifest[e.route.id]||e.route})):P(t,{pathname:f});y(d||null!=p,`No routes matched location "${n.pathname}${n.search}${n.hash}" `),y(null==p||void 0!==p[p.length-1].route.element||void 0!==p[p.length-1].route.Component||void 0!==p[p.length-1].route.lazy,`Matched leaf route at location "${n.pathname}${n.search}${n.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.`);let v=function(t,r=[],a){let n=a?.state;if(null==t){if(!n)return null;if(n.errors)t=n.matches;else{if(0!==r.length||n.initialized||!(n.matches.length>0))return null;t=n.matches}}let o=t,i=n?.errors;if(null!=i){let e=o.findIndex(e=>e.route.id&&void 0!==i?.[e.route.id]);m(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,e+1))}let l=!1,s=-1;if(a&&n){l=n.renderFallback;for(let e=0;e<o.length;e++){let t=o[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:r}=n,i=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!r||void 0===r[t.route.id]);if(t.route.lazy||i){a.isStatic&&(l=!0),o=s>=0?o.slice(0,s+1):[o[0]];break}}}}let u=a?.onError,c=n&&u?(e,t)=>{u(e,{location:n.location,params:n.matches?.[0]?.params??{},pattern:le(n.matches),errorInfo:t})}:void 0;return o.reduceRight((t,a,u)=>{let d,h=!1,f=null,p=null;n&&(d=i&&a.route.id?i[a.route.id]:void 0,f=a.route.errorElement||tr,l&&(s<0&&0===u?(cr("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),h=!0,p=null):s===u&&(h=!0,p=a.route.hydrateFallbackElement||null)));let m=r.concat(o.slice(0,u+1)),y=()=>{let r;return r=d?f:h?p:a.route.Component?e.createElement(a.route.Component,null):a.route.element?a.route.element:t,e.createElement(or,{match:a,routeContext:{outlet:t,matches:m,isDataRoute:null!=n},children:r})};return n&&(a.route.ErrorBoundary||a.route.errorElement||0===u)?e.createElement(rr,{location:n.location,revalidation:n.revalidation,component:f,error:d,children:y(),routeC
11ontext:{outlet:null,matches:m,isDataRoute:!0},onError:c}):y()},null)}(p&&p.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:Z([c,o.encodeLocation?o.encodeLocation(e.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?c:Z([c,o.encodeLocation?o.encodeLocation(e.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathnameBase])})),i,a);return v}function er(){let t=sr(),r=ie(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),a=t instanceof Error?t.stack:null,n="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:n},i={padding:"2px 4px",backgroundColor:n},l=null;return l=e.createElement(e.Fragment,null,e.createElement("p",null,"ð¿ Hey developer ð"),e.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",e.createElement("code",{style:i},"ErrorBoundary")," or"," ",e.createElement("code",{style:i},"errorElement")," prop on your route.")),e.createElement(e.Fragment,null,e.createElement("h2",null,"Unexpected Application Error!"),e.createElement("h3",{style:{fontStyle:"italic"}},r),a?e.createElement("pre",{style:o},a):null,l)}var tr=e.createElement(er,null),rr=class extends e.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)}render(){let t=this.state.error;if(this.context&&"object"==typeof t&&t&&"digest"in t&&"string"==typeof t.digest){const e=function(e){if(e.startsWith(`${It}: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 oe(t.status,t.statusText,t.data)}catch{}}(t.digest);e&&(t=e)}let r=void 0!==t?e.createElement(Ht.Provider,{value:this.props.routeContext},e.createElement(_t.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?e.createElement(nr,{error:t},r):r}};rr.contextType=At;var ar=new WeakMap;function nr({children:t,error:r}){let{basename:a}=e.useContext(Ut);if("object"==typeof r&&r&&"digest"in r&&"string"==typeof r.digest){let t=function(e){if(e.startsWith(`${It}: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{}}(r.digest);if(t){let n=ar.get(r);if(n)throw n;let o=ue(t.location,a),i=o.absoluteURL||o.to;if(nt(i))throw new Error("Invalid redirect location");if(se&&!ar.get(r)){if(!o.isExternal&&!t.reloadDocument){const e=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:t.replace}));throw ar.set(r,e),e}window.location.href=i}return e.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i}`})}}return t}function or({routeContext:t,match:r,children:a}){let n=e.useContext(Ot);return n&&n.static&&n.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=r.route.id),e.createElement(Ht.Provider,{value:t},a)}function ir(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function lr(t){let r=function(t){let r=e.useContext(Ht);return m(r,ir(t)),r}(t),a=r.matches[r.matches.length-1];return m(a.route.id,`${t} can only be used on routes that contain a unique "id"`),a.route.id}function sr(){let t=e.useContext(_t),r=function(t){let r=e.useContext($t);return m(r,ir(t)),r}("useRouteError"),a=lr("useRouteError");return void 0!==t?t:r.errors?.[a]}var ur={};function cr(e,t,r){t||ur[e]||(ur[e]=!0,y(!1,r))}var dr={};function hr(e,t){e||dr[t]||(dr[t]=!0)}var fr=t.useOptimistic,pr=()=>{};function mr(t){let r={hasErrorBoundary:t.hasErrorBoundary||null!=t.ErrorBoundary||null!=t.errorElement};return t.Component&&(t.element&&y(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(r,{element:e.createElement(t.Component),Component:void 0})),t.HydrateFallback&&(t.hydrateFallbackElement&&y(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(r,{hydrateFallbackElement:e.createElement(t.HydrateFallback),HydrateFallback:void 0})),t.ErrorBoundary&&(t.errorElement&&y(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(r,{errorElement:e.createElement(t.ErrorBoundary),ErrorBoundary:void 0})),r}var yr=["HydrateFallback","hydrateFallbackElement"],vr=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>
11{this.resolve=t=>{"pending"===this.status&&(this.status="resolved",e(t))},this.reject=e=>{"pending"===this.status&&(this.status="rejected",t(e))}})}};function gr({router:t,flushSync:r,onError:a,useTransitions:n}){let o=jt();n=o||n;let[i,l]=e.useState(t.state),[s,u]=(c=i,fr?fr(c):[c,pr]);var c;let[d,h]=e.useState(),[f,p]=e.useState({isTransitioning:!1}),[m,y]=e.useState(),[v,g]=e.useState(),[w,b]=e.useState(),R=e.useRef(new Map),E=e.useCallback((o,{deletedFetchers:i,newErrors:s,flushSync:c,viewTransitionOpts:d})=>{s&&a&&Object.values(s).forEach(e=>a(e,{location:o.location,params:o.matches[0]?.params??{},pattern:le(o.matches)})),o.fetchers.forEach((e,t)=>{void 0!==e.data&&R.current.set(t,e.data)}),i.forEach(e=>R.current.delete(e)),hr(!1===c||null!=r,'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 f=null!=t.window&&null!=t.window.document&&"function"==typeof t.window.document.startViewTransition;if(hr(null==d||f,"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."),d&&f){if(r&&c){r(()=>{v&&(m?.resolve(),v.skipTransition()),p({isTransitioning:!0,flushSync:!0,currentLocation:d.currentLocation,nextLocation:d.nextLocation})});let e=t.window.document.startViewTransition(()=>{r(()=>l(o))});return e.finished.finally(()=>{r(()=>{y(void 0),g(void 0),h(void 0),p({isTransitioning:!1})})}),void r(()=>g(e))}v?(m?.resolve(),v.skipTransition(),b({state:o,currentLocation:d.currentLocation,nextLocation:d.nextLocation})):(h(o),p({isTransitioning:!0,flushSync:!1,currentLocation:d.currentLocation,nextLocation:d.nextLocation}))}else r&&c?r(()=>l(o)):!1===n?l(o):e.startTransition(()=>{!0===n&&u(e=>wr(e,o)),l(o)})},[t.window,r,v,m,n,u,a]);e.useLayoutEffect(()=>t.subscribe(E),[t,E]),e.useEffect(()=>{f.isTransitioning&&!f.flushSync&&y(new vr)},[f]),e.useEffect(()=>{if(m&&d&&t.window){let r=d,a=m.promise,o=t.window.document.startViewTransition(async()=>{!1===n?l(r):e.startTransition(()=>{!0===n&&u(e=>wr(e,r)),l(r)}),await a});o.finished.finally(()=>{y(void 0),g(void 0),h(void 0),p({isTransitioning:!1})}),g(o)}},[d,m,t.window,n,u]),e.useEffect(()=>{m&&d&&s.location.key===d.location.key&&m.resolve()},[m,v,s.location,d]),e.useEffect(()=>{!f.isTransitioning&&w&&(h(w.state),p({isTransitioning:!0,flushSync:!1,currentLocation:w.currentLocation,nextLocation:w.nextLocation}),b(void 0))},[f.isTransitioning,w]);let S=e.useMemo(()=>({createHref:t.createHref,encodeLocation:t.encodeLocation,go:e=>t.navigate(e),push:(e,r,a)=>t.navigate(e,{state:r,preventScrollReset:a?.preventScrollReset}),replace:(e,r,a)=>t.navigate(e,{replace:!0,state:r,preventScrollReset:a?.preventScrollReset})}),[t]),x=t.basename||"/",k=e.useMemo(()=>({router:t,navigator:S,static:!1,basename:x,onError:a}),[t,S,x,a]);return e.createElement(e.Fragment,null,e.createElement(Ot.Provider,{value:k},e.createElement($t.Provider,{value:s},e.createElement(Ft.Provider,{value:R.current},e.createElement(zt.Provider,{value:f},e.createElement(xr,{basename:x,location:s.location,navigationType:s.historyAction,navigator:S,useTransitions:n},e.createElement(br,{routes:t.routes,manifest:t.manifest,future:t.future,state:s,isStatic:!1,onError:a})))))),null)}function wr(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 br=e.memo(function({routes:e,manifest:t,future:r,state:a,isStatic:n,onError:o}){return Zt(e,0,{manifest:t,state:a,isStatic:n,onError:o})});function Rr({to:t,replace:r,state:a,relative:n}){m(Bt(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=e.useContext(Ut);y(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:i}=e.useContext(Ht),{pathname:l}=Wt(),s=Jt(),u=G(t,X(i),l,"path"===n),c=JSON.stringify(u);return e.useEffect(()=>{s(JSON.parse(c),{replace:r,state:a,relative:n})},[s,c,n,r,a]),null}function Er(t){return function(t){let r=e.useContext(Ht).outlet;return e.useMemo(()=>r&&e.createElement(Kt.Provider,{value:t},r),[r,t])}(t.context)}function Sr(e){m(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function xr({basename:t="/",children:r=null,location:a,navigationType:n="POP",navigator:o,static:i=!1,useTransitions:l}){m(!Bt(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let s=t.replace(/^\/*/,"/"),u=e.useMemo(()=>({basename:s,navigator:o,static:i,useTransitions:l,future:{}}),[s,o,i,l]);"string"==typeof a&&(a=b(a));let{pathname:c="/",search:d="",hash:h="",state:f=null,key:p="default",mask:v}=a,g=e.useMemo(()=>{let e=q(c,s);return null==e?null:{location:{pathname:e,search:d,hash:h,state:f,key:p,mask:v},navigationType:n}},[s,c,d,h,f,p,n,v]);
11return y(null!=g,`<Router basename="${s}"> is not able to match the URL "${c}${d}${h}" because it does not start with the basename, so the <Router> won't render anything.`),null==g?null:e.createElement(Ut.Provider,{value:u},e.createElement(Nt.Provider,{children:r,value:g}))}var kr=function t(r,a=[]){let n=[];return e.Children.forEach(r,(r,o)=>{if(!e.isValidElement(r))return;let i=[...a,o];if(r.type===e.Fragment)return void n.push.apply(n,t(r.props.children,i));m(r.type===Sr,`[${"string"==typeof r.type?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),m(!r.props.index||!r.props.children,"An index route cannot have child routes.");let l={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:!0===r.props.hasErrorBoundary||null!=r.props.ErrorBoundary||null!=r.props.errorElement,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=t(r.props.children,i)),n.push(l)}),n},Cr="get",Lr="application/x-www-form-urlencoded";function Pr(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement}function Dr(e=""){return new URLSearchParams("string"==typeof e||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(e=>[r,e]):[[r,a]])},[]))}var Tr=null;var Mr=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Or(e){return null==e||Mr.has(e)?e:(y(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Lr}"`),null)}function $r(e,t){let r,a,n,o,i;if(Pr(l=e)&&"form"===l.tagName.toLowerCase()){let i=e.getAttribute("action");a=i?q(i,t):null,r=e.getAttribute("method")||Cr,n=Or(e.getAttribute("enctype"))||Lr,o=new FormData(e)}else if(function(e){return Pr(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return Pr(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let i=e.form;if(null==i)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||i.getAttribute("action");if(a=l?q(l,t):null,r=e.getAttribute("formmethod")||i.getAttribute("method")||Cr,n=Or(e.getAttribute("formenctype"))||Or(i.getAttribute("enctype"))||Lr,o=new FormData(i,e),!function(){if(null===Tr)try{new FormData(document.createElement("form"),0),Tr=!1}catch(e){Tr=!0}return Tr}()){let{name:t,type:r,value:a}=e;if("image"===r){let e=t?`${t}.`:"";o.append(`${e}x`,"0"),o.append(`${e}y`,"0")}else t&&o.append(t,a)}}else{if(Pr(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Cr,a=null,n=Lr,i=e}var l;return o&&"text/plain"===n&&(i=o,o=void 0),{action:a,method:r.toLowerCase(),encType:n,formData:o,body:i}}function Ar(e,t){if(!1===e||null==e)throw new Error(t)}function jr(e,t,r,a){let n="string"==typeof e?new URL(e,"undefined"==typeof window?"server://singlefetch/":window.location.origin):e;return r?n.pathname.endsWith("/")?n.pathname=`${n.pathname}_.${a}`:n.pathname=`${n.pathname}.${a}`:"/"===n.pathname?n.pathname=`_root.${a}`:t&&"/"===q(n.pathname,t)?n.pathname=`${ee(t)}/_root.${a}`:n.pathname=`${ee(n.pathname)}.${a}`,n}function zr(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 Fr(e,t,r){return function(e,t){let r=new Set;return new Set(t),e.reduce((e,t)=>{let a=JSON.stringify(function(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}(t));return r.has(a)||(r.add(a),e.push({key:a,link:t})),e},[])}((await Promise.all(e.map(async e=>{let a=t.routes[e.route.id];if(a){let e=await async function(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 window.__reactRouterContext&&window.__reactRouterContext.
11isSpaMode,window.location.reload(),new Promise(()=>{})}}(a,r);return e.links?e.links():[]}return[]}))).flat(1).filter(zr).filter(e=>"stylesheet"===e.rel||"preload"===e.rel).map(e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"}))}function Ur(e,t,r,a,n,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=a.routes[t.route.id];if(!s||!s.hasLoader)return!1;if(i(t,o)||l(t,o))return!0;if(t.route.shouldRevalidate){let a=t.route.shouldRevalidate({currentUrl:new URL(n.pathname+n.search+n.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof a)return a}return!0}):[]}function Nr(e,t,{includeHydrateFallback:r}={}){return a=e.map(e=>{let a=t.routes[e.route.id];if(!a)return[];let n=[a.module];return a.clientActionModule&&(n=n.concat(a.clientActionModule)),a.clientLoaderModule&&(n=n.concat(a.clientLoaderModule)),r&&a.hydrateFallbackModule&&(n=n.concat(a.hydrateFallbackModule)),a.imports&&(n=n.concat(a.imports)),n}
11).flat(1),[...new Set(a)];var a}function Hr(){let t=e.useContext(Ot);return Ar(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var _r=e.createContext(void 0);function Ir(){let t=e.useContext(_r);return Ar(t,"You must render this element inside a <HydratedRouter> element"),t}function Br(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Wr({page:t,...r}){let a=jt(),{nonce:n}=Ir(),{router:o}=Hr(),i=e.useMemo(()=>P(o.routes,t,o.basename),[o.routes,t,o.basename]);return i?(null==r.nonce&&n&&(r={...r,nonce:n}),a?e.createElement(qr,{page:t,matches:i,...r}):e.createElement(Yr,{page:t,matches:i,...r})):null}function qr({page:t,matches:r,...a}){let n=Wt(),{future:o}=Ir(),{basename:i}=Hr(),l=e.useMemo(()=>{if(t===n.pathname+n.search+n.hash)return[];let e=jr(t,i,o.v8_trailingSlashAwareDataRequests,"rsc"),a=!1,l=[];for(let t of r)"function"==typeof t.route.shouldRevalidate?a=!0:l.push(t.route.id);return a&&l.length>0&&e.searchParams.set("_routes",l.join(",")),[e.pathname+e.search]},[i,o.v8_trailingSlashAwareDataRequests,t,n,r]);return e.createElement(e.Fragment,null,l.map(t=>e.createElement("link",{key:t,rel:"prefetch",as:"fetch",href:t,...a})))}function Yr({page:t,matches:r,...a}){let n=Wt(),{future:o,manifest:i,routeModules:l}=Ir(),{basename:s}=Hr(),{loaderData:u,matches:c}=function(){let t=e.useContext($t);return Ar(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}(),d=e.useMemo(()=>Ur(t,r,c,i,n,"data"),[t,r,c,i,n]),h=e.useMemo(()=>Ur(t,r,c,i,n,"assets"),[t,r,c,i,n]),f=e.useMemo(()=>{if(t===n.pathname+n.search+n.hash)return[];let e=new Set,a=!1;if(r.forEach(t=>{let r=i.routes[t.route.id];r&&r.hasLoader&&(!d.some(e=>e.route.id===t.route.id)&&t.route.id in u&&l[t.route.id]?.shouldRevalidate||r.hasClientLoader?a=!0:e.add(t.route.id))}),0===e.size)return[];let c=jr(t,s,o.v8_trailingSlashAwareDataRequests,"data");return a&&e.size>0&&c.searchParams.set("_routes",r.filter(t=>e.has(t.route.id)).map(e=>e.route.id).join(",")),[c.pathname+c.search]},[s,o.v8_trailingSlashAwareDataRequests,u,n,i,d,r,t,l]),p=e.useMemo(()=>Nr(h,i),[h,i]),m=function(t){let{manifest:r,routeModules:a}=Ir(),[n,o]=e.useState([]);return e.useEffect(()=>{let e=!1;return Fr(t,r,a).then(t=>{e||o(t)}),()=>{e=!0}},[t,r,a]),n}(h);return e.createElement(e.Fragment,null,f.map(t=>e.createElement("link",{key:t,rel:"prefetch",as:"fetch",href:t,...a})),p.map(t=>e.createElement("link",{key:t,rel:"modulepreload",href:t,...a})),m.map(({key:t,link:r})=>e.createElement("link",{key:t,nonce:a.nonce,...r,crossOrigin:r.crossOrigin??a.crossOrigin})))}function Vr(...e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}_r.displayName="FrameworkContext";var Jr="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{Jr&&(window.__reactRouterVersion="7.18.2")}catch(na){}function Kr(e,t){return ze({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:p({window:t?.window}),hydrationData:Xr(),routes:e,mapRouteProperties:mr,hydrationRouteProperties:yr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function Xr(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:Gr(e.errors)}),e}function Gr(e){if(!e)return null;let t=Object.entries(e),r={};for(let[a,n]of t)if(n&&"RouteErrorResponse"===n.__type)r[a]=new oe(n.status,n.statusText,n.data,!0===n.internal);else if(n&&"Error"===n.__type){if("string"==typeof n.__subType&&ne.includes(n.__subType)){let e=window[n.__subType];if("function"==typeof e)try{let t=new e(n.message);t.stack="",r[a]=t}catch(na){}}if(null==r[a]){let e=new Error(n.message);e.stack="",r[a]=e}}else r[a]=n;return r}var Qr=e.forwardRef(function({onClick:t,discover:r="render",prefetch:a="none",relative:n,reloadDocument:o,replace:i,mask:l,state:u,target:c,to:d,preventScrollReset:h,viewTransition:f,defaultShouldRevalidate:p,...y},v){let{basename:g,navigator:b,useTransitions:R}=e.useContext(Ut),E="string"==typeof d&&s.test(d),S=ue(d,g),x=function(t,{relative:r}={}){m(Bt(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:n}=e.useContext(Ut),{hash:o,pathname:i,search:l}=Qt(t,{relative:r}),s=i;return"/"!==a&&(s="/"===i?a:Z([a,i])),n.createHref({pathname:s,search:l,hash:o})}(d=S.to,{relative:n}),k=Wt(),C=null;if(l){let e=G(l,[],k.mask?k.mask.pathname:"/",!0);"/"!==g&&(e.pathname="/"===e.pathname?g:Z([g,e.pathname])),C=b.createHref(e)}let[L,P,D]=function(t,r){let a=e.useContext(_r),[n,o]=e.useState(!1),[i,l]=e.useState(!1),{onFocus:s,onBlur:u,onMouseEnter:c,onMouseLeave:d,onTouchStart:h}=r,f=e.useRef(null);e.useEffect(()=>{if("render"===t&&l(!0),"viewport"===t){let e=new IntersectionObserver(e=>
11{e.forEach(e=>{l(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[t]),e.useEffect(()=>{if(n){let e=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(e)}}},[n]);let p=()=>{o(!0)},m=()=>{o(!1),l(!1)};return a?"intent"!==t?[i,f,{}]:[i,f,{onFocus:Br(s,p),onBlur:Br(u,m),onMouseEnter:Br(c,p),onMouseLeave:Br(d,m),onTouchStart:Br(h,p)}]:[!1,f,{}]}(a,y),T=function(t,{target:r,replace:a,mask:n,state:o,preventScrollReset:i,relative:l,viewTransition:s,defaultShouldRevalidate:u,useTransitions:c}={}){let d=Jt(),h=Wt(),f=Qt(t,{relative:l});return e.useCallback(p=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(p,r)){p.preventDefault();let r=void 0!==a?a:w(h)===w(f),m=()=>d(t,{replace:r,mask:n,state:o,preventScrollReset:i,relative:l,viewTransition:s,defaultShouldRevalidate:u});c?e.startTransition(()=>m()):m()}},[h,d,f,a,n,o,r,t,i,l,s,u,c])}(d,{replace:i,mask:l,state:u,target:c,preventScrollReset:h,relative:n,viewTransition:f,defaultShouldRevalidate:p,useTransitions:R});let M=!(S.isExternal||o),O=e.createElement("a",{...y,...D,href:(M?C:void 0)||S.absoluteURL||x,onClick:M?function(e){t&&t(e),e.defaultPrevented||T(e)}:t,ref:Vr(v,P),target:c,"data-discover":E||"render"!==r?void 0:"true"});return L&&!E?e.createElement(e.Fragment,null,O,e.createElement(Wr,{page:x})):O});function Zr(t){let r=e.useContext(Ot);return m(r,function(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}(t)),r}function ea(t){y("undefined"!=typeof URLSearchParams,"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 r=e.useRef(Dr(t)),a=e.useRef(!1),n=Wt(),o=e.useMemo(()=>function(e,t){let r=Dr(e);return t&&t.forEach((e,a)=>{r.has(a)||t.getAll(a).forEach(e=>{r.append(a,e)})}),r}(n.search,a.current?null:r.current),[n.search]),i=Jt(),l=e.useCallback((e,t)=>{const r=Dr("function"==typeof e?e(new URLSearchParams(o)):e);a.current=!0,i("?"+r,t)},[i,o]);return[o,l]}Qr.displayName="Link",e.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:a="",end:n=!1,style:o,to:i,viewTransition:l,children:s,...u},c){let d=Qt(i,{relative:u.relative}),h=Wt(),f=e.useContext($t),{navigator:p,basename:y}=e.useContext(Ut),v=null!=f&&function(t,{relative:r}={}){let a=e.useContext(zt);m(null!=a,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=Zr("useViewTransitionState"),o=Qt(t,{relative:r});if(!a.isTransitioning)return!1;let i=q(a.currentLocation.pathname,n)||a.currentLocation.pathname,l=q(a.nextLocation.pathname,n)||a.nextLocation.pathname;return null!=I(o.pathname,l)||null!=I(o.pathname,i)}(d)&&!0===l,g=p.encodeLocation?p.encodeLocation(d).pathname:d.pathname,w=h.pathname,b=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;r||(w=w.toLowerCase(),b=b?b.toLowerCase():null,g=g.toLowerCase()),b&&y&&(b=q(b,y)||b);const R="/"!==g&&g.endsWith("/")?g.length-1:g.length;let E,S=w===g||!n&&w.startsWith(g)&&"/"===w.charAt(R),x=null!=b&&(b===g||!n&&b.startsWith(g)&&"/"===b.charAt(g.length)),k={isActive:S,isPending:x,isTransitioning:v},C=S?t:void 0;E="function"==typeof a?a(k):[a,S?"active":null,x?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let L="function"==typeof o?o(k):o;return e.createElement(Qr,{...u,"aria-current":C,className:E,ref:c,style:L,to:i,viewTransition:l},"function"==typeof s?s(k):s)}).displayName="NavLink",e.forwardRef(({discover:t="render",fetcherKey:r,navigate:a,reloadDocument:n,replace:o,state:i,method:l=Cr,action:u,onSubmit:c,relative:d,preventScrollReset:h,viewTransition:f,defaultShouldRevalidate:p,...y},v)=>{let{useTransitions:g}=e.useContext(Ut),b=function(){let{router:t}=Zr("useSubmit"),{basename:r}=e.useContext(Ut),a=lr("useRouteId"),n=t.fetch,o=t.navigate;return e.useCallback(async(e,t={})=>{let{action:i,method:l,encType:s,formData:u,body:c}=$r(e,r);if(!1===t.navigate){let e=t.fetcherKey||ra();await n(e,a,t.action||i,{defaultShouldRevalidate:t.defaultShouldRevalidate,preventScrollReset:t.preventScrollReset,formData:u,body:c,formMethod:t.method||l,formEncType:t.encType||s,flushSync:t.flushSync})}else await o(t.action||i,{defaultShouldRevalidate:t.defaultShouldRevalidate,preventScrollReset:t.preventScrollReset,formData:u,body:c,formMethod:t.method||l,formEncType:t.encType||s,replace:t.replace,state:t.state,fromRouteId:a,flushSync:t.flushSync,viewTransition:t.viewTransition})},[n,o,r,a])}(),R=function(t,{relative:r}={}){let{basename:a}=e.useContext(Ut),n=e.useContext(Ht);m(n,"useFormAction must be used inside a RouteContext");let[o]=n.matches.slice(-1),i={...Qt(t||".",{relative:r})},l=Wt();if(null==t){i.search=l.search;let e=new URLSearchParams(i.search),t=e.getAll("index");if(t.some(e=>""===e)){e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let r=e.toString();i.search=r?`?${r}`:""}}t&&"."!==t||!o.route.index||(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index");"/"!==a&&(i.pathname="/"===i.pathname?a:Z([a,i.pathname]));return w(i)}(u,{relative:d}),E="get"===l.toLowerCase()?"get":"post",S="string"==typeof u&&s.test(u);return e.createElement("form",{ref:v,method:E,action:R,onSubmit:n?c:t=>{if(c&&c(t),t.defaultPrevented)return;t.preventDefault();let n=t.nativeEvent.submitter,s=n?.getAttribute("formmethod")||l,u=()=>b(n||t.currentTarget,{fetcherKey:r,method:s,navigate:a,replace:o,state:i,relative:d,preventScrollReset:h,viewTransition:f,defaultShouldRevalidate:p});g&&!1!==a?e.startTransition(()=>u()):u()},...y,"data-discover":S||"render"!==t?void 0:"true"})}).displayName="Form";var ta=0,ra=()=>`__${String(++ta)}__`;function aa(t){return e.createElement(gr,{flushSync:r.flushSync,...t})}export{Qr as L,Rr as N,Er as O,Sr as R,sr as a,ea as b,Gt as c,Wt as d,Xt as e,qt as f,
11Kr as g,kr as h,aa as i,I as m,Jt as u};
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.