@hitachivantara/app-shell-vite-plugin 0.6.0 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  /* @preserve react-router-dom esm bundle generated by Hitachi Vantara - Boba Fett team */
2
2
  import*as e from"react";
3
3
  /**
4
- * @remix-run/router v1.5.0
4
+ * @remix-run/router v1.6.1
5
5
  *
6
6
  * Copyright (c) Remix Software Inc.
7
7
  *
@@ -9,9 +9,9 @@ import*as e from"react";
9
9
  * LICENSE.md file in the root directory of this source tree.
10
10
  *
11
11
  * @license MIT
12
- */function t(){return t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},t.apply(this,arguments)}var r;!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(r||(r={}));const n="popstate";function o(e){void 0===e&&(e={});let t,{initialEntries:n=["/"],initialIndex:o,v5Compat:a=!1}=e;t=n.map(((e,t)=>m(e,"string"==typeof e?null:e.state,0===t?"default":void 0)));let i=f(null==o?t.length-1:o),l=r.Pop,c=null;function f(e){return Math.min(Math.max(e,0),t.length-1)}function p(){return t[i]}function m(e,r,n){void 0===r&&(r=null);let o=u(t?p().pathname:"/",e,r,n);return s("/"===o.pathname.charAt(0),"relative pathnames are not supported in memory history: "+JSON.stringify(e)),o}function v(e){return"string"==typeof e?e:d(e)}return{get index(){return i},get action(){return l},get location(){return p()},createHref:v,createURL:e=>new URL(v(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?h(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,n){l=r.Push;let o=m(e,n);i+=1,t.splice(i,t.length,o),a&&c&&c({action:l,location:o,delta:1})},replace(e,n){l=r.Replace;let o=m(e,n);t[i]=o,a&&c&&c({action:l,location:o,delta:0})},go(e){l=r.Pop;let n=f(i+e),o=t[n];i=n,c&&c({action:l,location:o,delta:e})},listen:e=>(c=e,()=>{c=null})}}function a(e){return void 0===e&&(e={}),f((function(e,t){let{pathname:r,search:n,hash:o}=e.location;return u("",{pathname:r,search:n,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"==typeof t?t:d(t)}),null,e)}function i(e){return void 0===e&&(e={}),f((function(e,t){let{pathname:r="/",search:n="",hash:o=""}=h(e.location.hash.substr(1));return u("",{pathname:r,search:n,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let r=e.document.querySelector("base"),n="";if(r&&r.getAttribute("href")){let t=e.location.href,r=t.indexOf("#");n=-1===r?t:t.slice(0,r)}return n+"#"+("string"==typeof t?t:d(t))}),(function(e,t){s("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),e)}function l(e,t){if(!1===e||null==e)throw new Error(t)}function s(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function c(e,t){return{usr:e.state,key:e.key,idx:t}}function u(e,r,n,o){return void 0===n&&(n=null),t({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof r?h(r):r,{state:n,key:r&&r.key||o||Math.random().toString(36).substr(2,8)})}function d(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&"?"!==r&&(t+="?"===r.charAt(0)?r:"?"+r),n&&"#"!==n&&(t+="#"===n.charAt(0)?n:"#"+n),t}function h(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function f(e,o,a,i){void 0===i&&(i={});let{window:s=document.defaultView,v5Compat:h=!1}=i,f=s.history,p=r.Pop,m=null,v=g();function g(){return(f.state||{idx:null}).idx}function y(){p=r.Pop;let e=g(),t=null==e?null:e-v;v=e,m&&m({action:p,location:w.location,delta:t})}function b(e){let t="null"!==s.location.origin?s.location.origin:s.location.href,r="string"==typeof e?e:d(e);return l(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)}null==v&&(v=0,f.replaceState(t({},f.state,{idx:v}),""));let w={get action(){return p},get location(){return e(s,f)},listen(e){if(m)throw new Error("A history only accepts one active listener");return s.addEventListener(n,y),m=e,()=>{s.removeEventListener(n,y),m=null}},createHref:e=>o(s,e),createURL:b,encodeLocation(e){let t=b(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){p=r.Push;let n=u(w.location,e,t);a&&a(n,e),v=g()+1;let o=c(n,v),i=w.createHref(n);try{f.pushState(o,"",i)}catch(e){s.location.assign(i)}h&&m&&m({action:p,location:w.location,delta:1})},replace:function(e,t){p=r.Replace;let n=u(w.location,e,t);a&&a(n,e),v=g();let o=c(n,v),i=w.createHref(n);f.replaceState(o,"",i),h&&m&&m({action:p,location:w.location,delta:0})},go:e=>f.go(e)};return w}var p;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(p||(p={}));const m=new Set(["lazy","caseSensitive","path","id","index","children"]);function v(e,r,n,o){return void 0===n&&(n=[]),void 0===o&&(o={}),e.map(((e,a)=>{let i=[...n,a],s="string"==typeof e.id?e.id:i.join("-");if(l(!0!==e.index||!e.children,"Cannot specify children on an index route"),l(!o[s],'Found a route id collision on id "'+s+"\". Route id's must be globally unique within Data Router usages"),function(e){return!0===e.index}(e)){let n=t({},e,{hasErrorBoundary:r(e),id:s});return o[s]=n,n}{let n=t({},e,{id:s,hasErrorBoundary:r(e),children:void 0});return o[s]=n,e.children&&(n.children=v(e.children,r,i,o)),n}}))}function g(e,t,r){void 0===r&&(r="/");let n=M(("string"==typeof t?h(t):t).pathname||"/",r);if(null==n)return null;let o=y(e);!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)))))}(o);let a=null;for(let e=0;null==a&&e<o.length;++e)a=P(o[e],U(n));return a}function y(e,t,r,n){void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===n&&(n="");let o=(e,o,a)=>{let i={relativePath:void 0===a?e.path||"":a,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};i.relativePath.startsWith("/")&&(l(i.relativePath.startsWith(n),'Absolute route path "'+i.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),i.relativePath=i.relativePath.slice(n.length));let s=B([n,i.relativePath]),c=r.concat(i);e.children&&e.children.length>0&&(l(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+s+'".'),y(e.children,t,c,s)),(null!=e.path||e.index)&&t.push({path:s,score:A(s,e.index),routesMeta:c})};return e.forEach(((e,t)=>{var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?"))for(let r of b(e.path))o(e,t,r);else o(e,t)})),t}function b(e){let t=e.split("/");if(0===t.length)return[];let[r,...n]=t,o=r.endsWith("?"),a=r.replace(/\?$/,"");if(0===n.length)return o?[a,""]:[a];let i=b(n.join("/")),l=[];return l.push(...i.map((e=>""===e?a:[a,e].join("/")))),o&&l.push(...i),l.map((t=>e.startsWith("/")&&""===t?"/":t))}const w=/^:\w+$/,E=3,R=2,S=1,D=10,x=-2,C=e=>"*"===e;function A(e,t){let r=e.split("/"),n=r.length;return r.some(C)&&(n+=x),t&&(n+=R),r.filter((e=>!C(e))).reduce(((e,t)=>e+(w.test(t)?E:""===t?S:D)),n)}function P(e,t){let{routesMeta:r}=e,n={},o="/",a=[];for(let e=0;e<r.length;++e){let i=r[e],l=e===r.length-1,s="/"===o?t:t.slice(o.length)||"/",c=L({path:i.relativePath,caseSensitive:i.caseSensitive,end:l},s);if(!c)return null;Object.assign(n,c.params);let u=i.route;a.push({params:n,pathname:B([o,c.pathname]),pathnameBase:F(B([o,c.pathnameBase])),route:u}),"/"!==c.pathnameBase&&(o=B([o,c.pathnameBase]))}return a}function k(e,t){void 0===t&&(t={});let r=e;r.endsWith("*")&&"*"!==r&&!r.endsWith("/*")&&(s(!1,'Route path "'+r+'" will be treated as if it were "'+r.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+r.replace(/\*$/,"/*")+'".'),r=r.replace(/\*$/,"/*"));return(r.startsWith("/")?"/":"")+r.split(/\/+/).map(((e,r,n)=>{if(r===n.length-1&&"*"===e){return t["*"]}const o=e.match(/^:(\w+)(\??)$/);if(o){const[,e,r]=o;let n=t[e];return"?"===r?null==n?"":n:(null==n&&l(!1,'Missing ":'+e+'" param'),n)}return e.replace(/\?$/g,"")})).filter((e=>!!e)).join("/")}function L(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=function(e,t,r){void 0===t&&(t=!1);void 0===r&&(r=!0);s("*"===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=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,((e,t)=>(n.push(t),"/([^\\/]+)")));e.endsWith("*")?(n.push("*"),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))");let a=new RegExp(o,t?void 0:"i");return[a,n]}(e.path,e.caseSensitive,e.end),o=t.match(r);if(!o)return null;let a=o[0],i=a.replace(/(.)\/+$/,"$1"),l=o.slice(1);return{params:n.reduce(((e,t,r)=>{if("*"===t){let e=l[r]||"";i=a.slice(0,a.length-e.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e,t){try{return decodeURIComponent(e)}catch(r){return s(!1,'The value for the URL param "'+t+'" will not be decoded because the string "'+e+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+r+")."),e}}(l[r]||"",t),e}),{}),pathname:a,pathnameBase:i,pattern:e}}function U(e){try{return decodeURI(e)}catch(t){return s(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function M(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&"/"!==n?null:e.slice(r)||"/"}function O(e,t){void 0===t&&(t="/");let{pathname:r,search:n="",hash:o=""}="string"==typeof e?h(e):e,a=r?r.startsWith("/")?r:function(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("/"):"/"}(r,t):t;return{pathname:a,search:N(n),hash:I(o)}}function j(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the `to."+r+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function T(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function _(e,r,n,o){let a;void 0===o&&(o=!1),"string"==typeof e?a=h(e):(a=t({},e),l(!a.pathname||!a.pathname.includes("?"),j("?","pathname","search",a)),l(!a.pathname||!a.pathname.includes("#"),j("#","pathname","hash",a)),l(!a.search||!a.search.includes("#"),j("#","search","hash",a)));let i,s=""===e||""===a.pathname,c=s?"/":a.pathname;if(o||null==c)i=n;else{let e=r.length-1;if(c.startsWith("..")){let t=c.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}i=e>=0?r[e]:"/"}let u=O(a,i),d=c&&"/"!==c&&c.endsWith("/"),f=(s||"."===c)&&n.endsWith("/");return u.pathname.endsWith("/")||!d&&!f||(u.pathname+="/"),u}const B=e=>e.join("/").replace(/\/\/+/g,"/"),F=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),N=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",I=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",z=function(e,r){void 0===r&&(r={});let n="number"==typeof r?{status:r}:r,o=new Headers(n.headers);return o.has("Content-Type")||o.set("Content-Type","application/json; charset=utf-8"),new Response(JSON.stringify(e),t({},n,{headers:o}))};class W extends Error{}class K{constructor(e,t){let r;this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],l(e&&"object"==typeof e&&!Array.isArray(e),"defer() only accepts plain objects"),this.abortPromise=new Promise(((e,t)=>r=t)),this.controller=new AbortController;let n=()=>r(new W("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",n),this.controller.signal.addEventListener("abort",n),this.data=Object.entries(e).reduce(((e,t)=>{let[r,n]=t;return Object.assign(e,{[r]:this.trackPromise(r,n)})}),{}),this.done&&this.unlistenAbortSignal(),this.init=t}trackPromise(e,t){if(!(t instanceof Promise))return t;this.deferredKeys.push(e),this.pendingKeysSet.add(e);let r=Promise.race([t,this.abortPromise]).then((t=>this.onSettle(r,e,null,t)),(t=>this.onSettle(r,e,t)));return r.catch((()=>{})),Object.defineProperty(r,"_tracked",{get:()=>!0}),r}onSettle(e,t,r,n){return this.controller.signal.aborted&&r instanceof W?(this.unlistenAbortSignal(),Object.defineProperty(e,"_error",{get:()=>r}),Promise.reject(r)):(this.pendingKeysSet.delete(t),this.done&&this.unlistenAbortSignal(),r?(Object.defineProperty(e,"_error",{get:()=>r}),this.emit(!1,t),Promise.reject(r)):(Object.defineProperty(e,"_data",{get:()=>n}),this.emit(!1,t),n))}emit(e,t){this.subscribers.forEach((r=>r(e,t)))}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}cancel(){this.controller.abort(),this.pendingKeysSet.forEach(((e,t)=>this.pendingKeysSet.delete(t))),this.emit(!0)}async resolveData(e){let t=!1;if(!this.done){let r=()=>this.cancel();e.addEventListener("abort",r),t=await new Promise((t=>{this.subscribe((n=>{e.removeEventListener("abort",r),(n||this.done)&&t(n)}))}))}return t}get done(){return 0===this.pendingKeysSet.size}get unwrappedData(){return l(null!==this.data&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce(((e,t)=>{let[r,n]=t;return Object.assign(e,{[r]:$(n)})}),{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function $(e){if(!function(e){return e instanceof Promise&&!0===e._tracked}(e))return e;if(e._error)throw e._error;return e._data}const H=function(e,t){return void 0===t&&(t={}),new K(e,"number"==typeof t?{status:t}:t)},q=function(e,r){void 0===r&&(r=302);let n=r;"number"==typeof n?n={status:n}:void 0===n.status&&(n.status=302);let o=new Headers(n.headers);return o.set("Location",e),new Response(null,t({},n,{headers:o}))};class J{constructor(e,t,r,n){void 0===n&&(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 Y(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}const V=["post","put","patch","delete"],X=new Set(V),G=["get",...V],Q=new Set(G),Z=new Set([301,302,303,307,308]),ee=new Set([307,308]),te={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},re={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},ne={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},oe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ae="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,ie=!ae,le=e=>Boolean(e.hasErrorBoundary);function se(e){l(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let n,o=e.detectErrorBoundary||le,a={},i=v(e.routes,o,void 0,a),c=t({v7_normalizeFormMethod:!1},e.future),d=null,h=new Set,f=null,m=null,y=null,b=null!=e.hydrationData,w=g(i,e.history.location,e.basename),E=null;if(null==w){let t=Ee(404,{pathname:e.history.location.pathname}),{matches:r,route:n}=we(i);w=r,E={[n.id]:t}}let R,S,D=!(w.some((e=>e.route.lazy))||w.some((e=>e.route.loader))&&null==e.hydrationData),x={historyAction:e.history.action,location:e.history.location,matches:w,initialized:D,navigation:te,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||E,fetchers:new Map,blockers:new Map},C=r.Pop,A=!1,P=!1,k=!1,L=[],U=[],O=new Map,j=0,T=-1,_=new Map,B=new Set,F=new Map,N=new Map,I=new Map,z=!1;function W(e){x=t({},x,e),h.forEach((e=>e(x)))}function K(o,a){var l,s;let c,u=null!=x.actionData&&null!=x.navigation.formMethod&&Ae(x.navigation.formMethod)&&"loading"===x.navigation.state&&!0!==(null==(l=o.state)?void 0:l._isRedirect);c=a.actionData?Object.keys(a.actionData).length>0?a.actionData:null:u?x.actionData:null;let d=a.loaderData?ye(x.loaderData,a.loaderData,a.matches||[],a.errors):x.loaderData;for(let[e]of I)se(e);let h=!0===A||null!=x.navigation.formMethod&&Ae(x.navigation.formMethod)&&!0!==(null==(s=o.state)?void 0:s._isRedirect);n&&(i=n,n=void 0),W(t({},a,{actionData:c,loaderData:d,historyAction:C,location:o,initialized:!0,navigation:te,revalidation:"idle",restoreScrollPosition:ve(o,a.matches||x.matches),preventScrollReset:h,blockers:new Map(x.blockers)})),P||C===r.Pop||(C===r.Push?e.history.push(o,o.state):C===r.Replace&&e.history.replace(o,o.state)),C=r.Pop,A=!1,P=!1,k=!1,L=[],U=[]}async function $(s,c,u){S&&S.abort(),S=null,C=s,P=!0===(u&&u.startUninterruptedRevalidation),function(e,t){if(f&&m&&y){let r=t.map((e=>Ue(e,x.loaderData))),n=m(e,r)||e.key;f[n]=y()}}(x.location,x.matches),A=!0===(u&&u.preventScrollReset);let d=n||i,h=u&&u.overrideNavigation,v=g(d,c,e.basename);if(!v){let e=Ee(404,{pathname:c.pathname}),{matches:t,route:r}=we(d);return fe(),void K(c,{matches:t,loaderData:{},errors:{[r.id]:e}})}if(!(b=x.location,w=c,b.pathname!==w.pathname||b.search!==w.search||b.hash===w.hash||u&&u.submission&&Ae(u.submission.formMethod)))return void K(c,{matches:v});var b,w;S=new AbortController;let E,D,M=me(e.history,c,S.signal,u&&u.submission);if(u&&u.pendingError)D={[be(v).route.id]:u.pendingError};else if(u&&u.submission&&Ae(u.submission.formMethod)){let e=await async function(e,n,i,l,s){Y();let c,u=t({state:"submitting",location:n},i);W({navigation:u});let d=Me(l,n);if(d.route.action||d.route.lazy){if(c=await pe("action",e,d,l,a,o,R.basename),e.signal.aborted)return{shortCircuited:!0}}else c={type:p.error,error:Ee(405,{method:e.method,pathname:n.pathname,routeId:d.route.id})};if(Ce(c)){let e;return e=s&&null!=s.replace?s.replace:c.location===x.location.pathname+x.location.search,await q(x,c,{submission:i,replace:e}),{shortCircuited:!0}}if(xe(c)){let e=be(l,d.route.id);return!0!==(s&&s.replace)&&(C=r.Push),{pendingActionData:{},pendingActionError:{[e.route.id]:c.error}}}if(De(c))throw Ee(400,{type:"defer-action"});return{pendingActionData:{[d.route.id]:c.data}}}(M,c,u.submission,v,{replace:u.replace});if(e.shortCircuited)return;E=e.pendingActionData,D=e.pendingActionError,h=t({state:"loading",location:c},u.submission),M=new Request(M.url,{signal:M.signal})}let{shortCircuited:_,loaderData:I,errors:z}=await async function(r,o,a,s,c,u,d,h,f){let p=s;if(!p){p=t({state:"loading",location:o,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},c)}let m=c||u?c||u:p.formMethod&&p.formAction&&p.formData&&p.formEncType?{formMethod:p.formMethod,formAction:p.formAction,formData:p.formData,formEncType:p.formEncType}:void 0,v=n||i,[g,y]=ue(e.history,x,a,m,o,k,L,U,F,v,e.basename,h,f);if(fe((e=>!(a&&a.some((t=>t.route.id===e)))||g&&g.some((t=>t.route.id===e)))),0===g.length&&0===y.length)return K(o,t({matches:a,loaderData:{},errors:f||null},h?{actionData:h}:{})),{shortCircuited:!0};if(!P){y.forEach((e=>{let t=x.fetchers.get(e.key),r={state:"loading",data:t&&t.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};x.fetchers.set(e.key,r)}));let e=h||x.actionData;W(t({navigation:p},e?0===Object.keys(e).length?{actionData:null}:{actionData:e}:{},y.length>0?{fetchers:new Map(x.fetchers)}:{}))}T=++j,y.forEach((e=>O.set(e.key,S)));let{results:b,loaderResults:w,fetcherResults:E}=await J(x.matches,a,g,y,r);if(r.signal.aborted)return{shortCircuited:!0};y.forEach((e=>O.delete(e.key)));let R=Re(b);if(R)return await q(x,R,{replace:d}),{shortCircuited:!0};let{loaderData:D,errors:C}=ge(x,a,g,w,f,y,E,N);N.forEach(((e,t)=>{e.subscribe((r=>{(r||e.done)&&N.delete(t)}))})),function(){let e=[];for(let t of B){let r=x.fetchers.get(t);l(r,"Expected fetcher: "+t),"loading"===r.state&&(B.delete(t),e.push(t))}Q(e)}();let A=Z(T);return t({loaderData:D,errors:C},A||y.length>0?{fetchers:new Map(x.fetchers)}:{})}(M,c,v,h,u&&u.submission,u&&u.fetcherSubmission,u&&u.replace,E,D);_||(S=null,K(c,t({matches:v},E?{actionData:E}:{},{loaderData:I,errors:z})))}function H(e){return x.fetchers.get(e)||re}async function q(n,o,a){var i;let{submission:s,replace:c,isFetchActionRedirect:d}=void 0===a?{}:a;o.revalidate&&(k=!0);let h=u(n.location,o.location,t({_isRedirect:!0},d?{_isFetchActionRedirect:!0}:{}));if(l(h,"Expected a location on the redirect navigation"),oe.test(o.location)&&ae&&void 0!==(null==(i=window)?void 0:i.location)){let t=e.history.createURL(o.location),r=null==M(t.pathname,e.basename||"/");if(window.location.origin!==t.origin||r)return void(c?window.location.replace(o.location):window.location.assign(o.location))}S=null;let f=!0===c?r.Replace:r.Push,{formMethod:p,formAction:m,formEncType:v,formData:g}=n.navigation;!s&&p&&m&&g&&v&&(s={formMethod:p,formAction:m,formEncType:v,formData:g}),ee.has(o.status)&&s&&Ae(s.formMethod)?await $(f,h,{submission:t({},s,{formAction:o.location}),preventScrollReset:A}):d?await $(f,h,{overrideNavigation:{state:"loading",location:h,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},fetcherSubmission:s,preventScrollReset:A}):await $(f,h,{overrideNavigation:{state:"loading",location:h,formMethod:s?s.formMethod:void 0,formAction:s?s.formAction:void 0,formEncType:s?s.formEncType:void 0,formData:s?s.formData:void 0},preventScrollReset:A})}async function J(t,r,n,i,l){let s=await Promise.all([...n.map((e=>pe("loader",l,e,r,a,o,R.basename))),...i.map((t=>{if(t.matches&&t.match)return pe("loader",me(e.history,t.path,l.signal),t.match,t.matches,a,o,R.basename);return{type:p.error,error:Ee(404,{pathname:t.path})}}))]),c=s.slice(0,n.length),u=s.slice(n.length);return await Promise.all([Pe(t,n,c,l.signal,!1,x.loaderData),Pe(t,i.map((e=>e.match)),u,l.signal,!0)]),{results:s,loaderResults:c,fetcherResults:u}}function Y(){k=!0,L.push(...fe()),F.forEach(((e,t)=>{O.has(t)&&(U.push(t),G(t))}))}function V(e,t,r){let n=be(x.matches,t);X(e),W({errors:{[n.route.id]:r},fetchers:new Map(x.fetchers)})}function X(e){O.has(e)&&G(e),F.delete(e),_.delete(e),B.delete(e),x.fetchers.delete(e)}function G(e){let t=O.get(e);l(t,"Expected fetch controller: "+e),t.abort(),O.delete(e)}function Q(e){for(let t of e){let e={state:"idle",data:H(t).data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};x.fetchers.set(t,e)}}function Z(e){let t=[];for(let[r,n]of _)if(n<e){let e=x.fetchers.get(r);l(e,"Expected fetcher: "+r),"loading"===e.state&&(G(r),_.delete(r),t.push(r))}return Q(t),t.length>0}function se(e){x.blockers.delete(e),I.delete(e)}function de(e,t){let r=x.blockers.get(e)||ne;l("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),x.blockers.set(e,t),W({blockers:new Map(x.blockers)})}function he(e){let{currentLocation:t,nextLocation:r,historyAction:n}=e;if(0===I.size)return;I.size>1&&s(!1,"A router only supports one blocker at a time");let o=Array.from(I.entries()),[a,i]=o[o.length-1],l=x.blockers.get(a);return l&&"proceeding"===l.state?void 0:i({currentLocation:t,nextLocation:r,historyAction:n})?a:void 0}function fe(e){let t=[];return N.forEach(((r,n)=>{e&&!e(n)||(r.cancel(),t.push(n),N.delete(n))})),t}function ve(e,t){if(f&&m&&y){let r=t.map((e=>Ue(e,x.loaderData))),n=m(e,r)||e.key,o=f[n];if("number"==typeof o)return o}return null}return R={get basename(){return e.basename},get state(){return x},get routes(){return i},initialize:function(){return d=e.history.listen((t=>{let{action:r,location:n,delta:o}=t;if(z)return void(z=!1);s(0===I.size||null!=o,"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=he({currentLocation:x.location,nextLocation:n,historyAction:r});return a&&null!=o?(z=!0,e.history.go(-1*o),void de(a,{state:"blocked",location:n,proceed(){de(a,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),e.history.go(o)},reset(){se(a),W({blockers:new Map(R.state.blockers)})}})):$(r,n)})),x.initialized||$(r.Pop,x.location),R},subscribe:function(e){return h.add(e),()=>h.delete(e)},enableScrollRestoration:function(e,t,r){if(f=e,y=t,m=r||(e=>e.key),!b&&x.navigation===te){b=!0;let e=ve(x.location,x.matches);null!=e&&W({restoreScrollPosition:e})}return()=>{f=null,y=null,m=null}},navigate:async function n(o,a){if("number"==typeof o)return void e.history.go(o);let{path:i,submission:l,error:s}=ce(o,c,a),d=x.location,h=u(x.location,i,a&&a.state);h=t({},h,e.history.encodeLocation(h));let f=a&&null!=a.replace?a.replace:void 0,p=r.Push;!0===f?p=r.Replace:!1===f||null!=l&&Ae(l.formMethod)&&l.formAction===x.location.pathname+x.location.search&&(p=r.Replace);let m=a&&"preventScrollReset"in a?!0===a.preventScrollReset:void 0,v=he({currentLocation:d,nextLocation:h,historyAction:p});if(!v)return await $(p,h,{submission:l,pendingError:s,preventScrollReset:m,replace:a&&a.replace});de(v,{state:"blocked",location:h,proceed(){de(v,{state:"proceeding",proceed:void 0,reset:void 0,location:h}),n(o,a)},reset(){se(v),W({blockers:new Map(x.blockers)})}})},fetch:function(r,s,u,d){if(ie)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");O.has(r)&&G(r);let h=g(n||i,u,e.basename);if(!h)return void V(r,s,Ee(404,{pathname:u}));let{path:f,submission:p}=ce(u,c,d,!0),m=Me(h,f);A=!0===(d&&d.preventScrollReset),p&&Ae(p.formMethod)?async function(r,s,c,u,d,h){if(Y(),F.delete(r),!u.route.action&&!u.route.lazy){let e=Ee(405,{method:h.formMethod,pathname:c,routeId:s});return void V(r,s,e)}let f=x.fetchers.get(r),p=t({state:"submitting"},h,{data:f&&f.data," _hasFetcherDoneAnything ":!0});x.fetchers.set(r,p),W({fetchers:new Map(x.fetchers)});let m=new AbortController,v=me(e.history,c,m.signal,h);O.set(r,m);let y=await pe("action",v,u,d,a,o,R.basename);if(v.signal.aborted)return void(O.get(r)===m&&O.delete(r));if(Ce(y)){O.delete(r),B.add(r);let e=t({state:"loading"},h,{data:void 0," _hasFetcherDoneAnything ":!0});return x.fetchers.set(r,e),W({fetchers:new Map(x.fetchers)}),q(x,y,{submission:h,isFetchActionRedirect:!0})}if(xe(y))return void V(r,s,y.error);if(De(y))throw Ee(400,{type:"defer-action"});let b=x.navigation.location||x.location,w=me(e.history,b,m.signal),E=n||i,D="idle"!==x.navigation.state?g(E,x.navigation.location,e.basename):x.matches;l(D,"Didn't find any matches after fetcher action");let A=++j;_.set(r,A);let P=t({state:"loading",data:y.data},h,{" _hasFetcherDoneAnything ":!0});x.fetchers.set(r,P);let[M,I]=ue(e.history,x,D,h,b,k,L,U,F,E,e.basename,{[u.route.id]:y.data},void 0);I.filter((e=>e.key!==r)).forEach((e=>{let t=e.key,r=x.fetchers.get(t),n={state:"loading",data:r&&r.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};x.fetchers.set(t,n),O.set(t,m)})),W({fetchers:new Map(x.fetchers)});let{results:z,loaderResults:$,fetcherResults:H}=await J(x.matches,D,M,I,w);if(m.signal.aborted)return;_.delete(r),O.delete(r),I.forEach((e=>O.delete(e.key)));let X=Re(z);if(X)return q(x,X);let{loaderData:G,errors:Q}=ge(x,x.matches,M,$,void 0,I,H,N),ee={state:"idle",data:y.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};x.fetchers.set(r,ee);let te=Z(A);"loading"===x.navigation.state&&A>T?(l(C,"Expected pending action"),S&&S.abort(),K(x.navigation.location,{matches:D,loaderData:G,errors:Q,fetchers:new Map(x.fetchers)})):(W(t({errors:Q,loaderData:ye(x.loaderData,G,D,Q)},te?{fetchers:new Map(x.fetchers)}:{})),k=!1)}(r,s,f,m,h,p):(F.set(r,{routeId:s,path:f}),async function(r,n,i,s,c,u){let d=x.fetchers.get(r),h=t({state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},u,{data:d&&d.data," _hasFetcherDoneAnything ":!0});x.fetchers.set(r,h),W({fetchers:new Map(x.fetchers)});let f=new AbortController,p=me(e.history,i,f.signal);O.set(r,f);let m=await pe("loader",p,s,c,a,o,R.basename);De(m)&&(m=await ke(m,p.signal,!0)||m);O.get(r)===f&&O.delete(r);if(p.signal.aborted)return;if(Ce(m))return void await q(x,m);if(xe(m)){let e=be(x.matches,n);return x.fetchers.delete(r),void W({fetchers:new Map(x.fetchers),errors:{[e.route.id]:m.error}})}l(!De(m),"Unhandled fetcher deferred data");let v={state:"idle",data:m.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};x.fetchers.set(r,v),W({fetchers:new Map(x.fetchers)})}(r,s,f,m,h,p))},revalidate:function(){Y(),W({revalidation:"loading"}),"submitting"!==x.navigation.state&&("idle"!==x.navigation.state?$(C||x.historyAction,x.navigation.location,{overrideNavigation:x.navigation}):$(x.historyAction,x.location,{startUninterruptedRevalidation:!0}))},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:H,deleteFetcher:X,dispose:function(){d&&d(),h.clear(),S&&S.abort(),x.fetchers.forEach(((e,t)=>X(t))),x.blockers.forEach(((e,t)=>se(t)))},getBlocker:function(e,t){let r=x.blockers.get(e)||ne;return I.get(e)!==t&&I.set(e,t),r},deleteBlocker:se,_internalFetchControllers:O,_internalActiveDeferreds:N,_internalSetRoutes:function(e){n=e}},R}function ce(e,t,r,n){void 0===n&&(n=!1);let o="string"==typeof e?e:d(e);if(!r||!function(e){return null!=e&&"formData"in e}(r))return{path:o};if(r.formMethod&&(a=r.formMethod,!Q.has(a.toLowerCase())))return{path:o,error:Ee(405,{method:r.formMethod})};var a;let i;if(r.formData){let e=r.formMethod||"get";if(i={formMethod:t.v7_normalizeFormMethod?e.toUpperCase():e.toLowerCase(),formAction:Se(o),formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:r.formData},Ae(i.formMethod))return{path:o,submission:i}}let l=h(o),s=ve(r.formData);return n&&l.search&&Le(l.search)&&s.append("index",""),l.search="?"+s,{path:d(l),submission:i}}function ue(e,r,n,o,a,i,l,s,c,u,d,h,f){let p=f?Object.values(f)[0]:h?Object.values(h)[0]:void 0,m=e.createURL(r.location),v=e.createURL(a),y=i||m.toString()===v.toString()||m.search!==v.search,b=f?Object.keys(f)[0]:void 0,w=function(e,t){let r=e;if(t){let n=e.findIndex((e=>e.route.id===t));n>=0&&(r=e.slice(0,n))}return r}(n,b),E=w.filter(((e,n)=>{if(e.route.lazy)return!0;if(null==e.route.loader)return!1;if(function(e,t,r){let n=!t||r.route.id!==t.route.id,o=void 0===e[r.route.id];return n||o}(r.loaderData,r.matches[n],e)||l.some((t=>t===e.route.id)))return!0;let a=r.matches[n],i=e;return he(e,t({currentUrl:m,currentParams:a.params,nextUrl:v,nextParams:i.params},o,{actionResult:p,defaultShouldRevalidate:y||de(a,i)}))})),R=[];return c.forEach(((e,a)=>{if(!n.some((t=>t.route.id===e.routeId)))return;let i=g(u,e.path,d);if(!i)return void R.push(t({key:a},e,{matches:null,match:null}));let l=Me(i,e.path);(s.includes(a)||he(l,t({currentUrl:m,currentParams:r.matches[r.matches.length-1].params,nextUrl:v,nextParams:n[n.length-1].params},o,{actionResult:p,defaultShouldRevalidate:y})))&&R.push(t({key:a,matches:i,match:l},e))})),[E,R]}function de(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function he(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}async function fe(e,r,n){if(!e.lazy)return;let o=await e.lazy();if(!e.lazy)return;let a=n[e.id];l(a,"No route found in manifest");let i={};for(let e in o){let t=void 0!==a[e]&&"hasErrorBoundary"!==e;s(!t,'Route "'+a.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.'),t||m.has(e)||(i[e]=o[e])}Object.assign(a,i),Object.assign(a,{hasErrorBoundary:r(t({},a)),lazy:void 0})}async function pe(e,t,r,n,o,a,i,s,c,u){let h,f,m;void 0===i&&(i="/"),void 0===s&&(s=!1),void 0===c&&(c=!1);let v=e=>{let n,o=new Promise(((e,t)=>n=t));return m=()=>n(),t.signal.addEventListener("abort",m),Promise.race([e({request:t,params:r.params,context:u}),o])};try{let n=r.route[e];if(r.route.lazy)if(n){f=(await Promise.all([v(n),fe(r.route,a,o)]))[0]}else{if(await fe(r.route,a,o),n=r.route[e],!n){if("action"===e)throw Ee(405,{method:t.method,pathname:new URL(t.url).pathname,routeId:r.route.id});return{type:p.data,data:void 0}}f=await v(n)}else l(n,"Could not find the "+e+' to run on the "'+r.route.id+'" route'),f=await v(n);l(void 0!==f,"You defined "+("action"===e?"an action":"a loader")+' for route "'+r.route.id+"\" but didn't return anything from your `"+e+"` function. Please return a value or `null`.")}catch(e){h=p.error,f=e}finally{m&&t.signal.removeEventListener("abort",m)}if(null!=(g=f)&&"number"==typeof g.status&&"string"==typeof g.statusText&&"object"==typeof g.headers&&void 0!==g.body){let e,o=f.status;if(Z.has(o)){let e=f.headers.get("Location");if(l(e,"Redirects returned/thrown from loaders/actions must have a Location header"),oe.test(e)){if(!s){let r=new URL(t.url),n=e.startsWith("//")?new URL(r.protocol+e):new URL(e),o=null!=M(n.pathname,i);n.origin===r.origin&&o&&(e=n.pathname+n.search+n.hash)}}else{let o=_(e,T(n.slice(0,n.indexOf(r)+1)).map((e=>e.pathnameBase)),new URL(t.url).pathname);if(l(d(o),"Unable to resolve redirect location: "+e),i){let e=o.pathname;o.pathname="/"===e?i:B([i,e])}e=d(o)}if(s)throw f.headers.set("Location",e),f;return{type:p.redirect,status:o,location:e,revalidate:null!==f.headers.get("X-Remix-Revalidate")}}if(c)throw{type:h||p.data,response:f};let a=f.headers.get("Content-Type");return e=a&&/\bapplication\/json\b/.test(a)?await f.json():await f.text(),h===p.error?{type:h,error:new J(o,f.statusText,e),headers:f.headers}:{type:p.data,data:e,statusCode:f.status,headers:f.headers}}var g,y,b;return h===p.error?{type:h,error:f}:function(e){let t=e;return t&&"object"==typeof t&&"object"==typeof t.data&&"function"==typeof t.subscribe&&"function"==typeof t.cancel&&"function"==typeof t.resolveData}(f)?{type:p.deferred,deferredData:f,statusCode:null==(y=f.init)?void 0:y.status,headers:(null==(b=f.init)?void 0:b.headers)&&new Headers(f.init.headers)}:{type:p.data,data:f}}function me(e,t,r,n){let o=e.createURL(Se(t)).toString(),a={signal:r};if(n&&Ae(n.formMethod)){let{formMethod:e,formEncType:t,formData:r}=n;a.method=e.toUpperCase(),a.body="application/x-www-form-urlencoded"===t?ve(r):r}return new Request(o,a)}function ve(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,n instanceof File?n.name:n);return t}function ge(e,r,n,o,a,i,s,c){let{loaderData:u,errors:d}=function(e,t,r,n,o){let a,i={},s=null,c=!1,u={};return r.forEach(((r,d)=>{let h=t[d].route.id;if(l(!Ce(r),"Cannot handle redirect results in processLoaderData"),xe(r)){let t=be(e,h),o=r.error;n&&(o=Object.values(n)[0],n=void 0),s=s||{},null==s[t.route.id]&&(s[t.route.id]=o),i[h]=void 0,c||(c=!0,a=Y(r.error)?r.error.status:500),r.headers&&(u[h]=r.headers)}else De(r)?(o.set(h,r.deferredData),i[h]=r.deferredData.data):i[h]=r.data,null==r.statusCode||200===r.statusCode||c||(a=r.statusCode),r.headers&&(u[h]=r.headers)})),n&&(s=n,i[Object.keys(n)[0]]=void 0),{loaderData:i,errors:s,statusCode:a||200,loaderHeaders:u}}(r,n,o,a,c);for(let r=0;r<i.length;r++){let{key:n,match:o}=i[r];l(void 0!==s&&void 0!==s[r],"Did not find corresponding fetcher result");let a=s[r];if(xe(a)){let r=be(e.matches,null==o?void 0:o.route.id);d&&d[r.route.id]||(d=t({},d,{[r.route.id]:a.error})),e.fetchers.delete(n)}else if(Ce(a))l(!1,"Unhandled fetcher revalidation redirect");else if(De(a))l(!1,"Unhandled fetcher deferred data");else{let t={state:"idle",data:a.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};e.fetchers.set(n,t)}}return{loaderData:u,errors:d}}function ye(e,r,n,o){let a=t({},r);for(let t of n){let n=t.route.id;if(r.hasOwnProperty(n)?void 0!==r[n]&&(a[n]=r[n]):void 0!==e[n]&&t.route.loader&&(a[n]=e[n]),o&&o.hasOwnProperty(n))break}return a}function be(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 we(e){let t=e.find((e=>e.index||!e.path||"/"===e.path))||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Ee(e,t){let{pathname:r,routeId:n,method:o,type:a}=void 0===t?{}:t,i="Unknown Server Error",l="Unknown @remix-run/router error";return 400===e?(i="Bad Request",o&&r&&n?l="You made a "+o+' request to "'+r+'" but did not provide a `loader` for route "'+n+'", so there is no way to handle the request.':"defer-action"===a&&(l="defer() is not supported in actions")):403===e?(i="Forbidden",l='Route "'+n+'" does not match URL "'+r+'"'):404===e?(i="Not Found",l='No route matches URL "'+r+'"'):405===e&&(i="Method Not Allowed",o&&r&&n?l="You made a "+o.toUpperCase()+' request to "'+r+'" but did not provide an `action` for route "'+n+'", so there is no way to handle the request.':o&&(l='Invalid request method "'+o.toUpperCase()+'"')),new J(e||500,i,new Error(l),!0)}function Re(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(Ce(r))return r}}function Se(e){return d(t({},"string"==typeof e?h(e):e,{hash:""}))}function De(e){return e.type===p.deferred}function xe(e){return e.type===p.error}function Ce(e){return(e&&e.type)===p.redirect}function Ae(e){return X.has(e.toLowerCase())}async function Pe(e,t,r,n,o,a){for(let i=0;i<r.length;i++){let l=r[i],s=t[i];if(!s)continue;let c=e.find((e=>e.route.id===s.route.id)),u=null!=c&&!de(c,s)&&void 0!==(a&&a[s.route.id]);De(l)&&(o||u)&&await ke(l,n,o).then((e=>{e&&(r[i]=e||r[i])}))}}async function ke(e,t,r){if(void 0===r&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:p.data,data:e.deferredData.unwrappedData}}catch(e){return{type:p.error,error:e}}return{type:p.data,data:e.deferredData.data}}}function Le(e){return new URLSearchParams(e).getAll("index").some((e=>""===e))}function Ue(e,t){let{route:r,pathname:n,params:o}=e;return{id:r.id,pathname:n,params:o,data:t[r.id],handle:r.handle}}function Me(e,t){let r="string"==typeof t?h(t).search:t.search;if(e[e.length-1].route.index&&Le(r||""))return e[e.length-1];let n=T(e);return n[n.length-1]}
12
+ */function t(){return t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},t.apply(this,arguments)}var r;!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(r||(r={}));const n="popstate";function a(e){void 0===e&&(e={});let t,{initialEntries:n=["/"],initialIndex:a,v5Compat:o=!1}=e;t=n.map(((e,t)=>m(e,"string"==typeof e?null:e.state,0===t?"default":void 0)));let i=f(null==a?t.length-1:a),l=r.Pop,c=null;function f(e){return Math.min(Math.max(e,0),t.length-1)}function p(){return t[i]}function m(e,r,n){void 0===r&&(r=null);let a=u(t?p().pathname:"/",e,r,n);return s("/"===a.pathname.charAt(0),"relative pathnames are not supported in memory history: "+JSON.stringify(e)),a}function v(e){return"string"==typeof e?e:d(e)}return{get index(){return i},get action(){return l},get location(){return p()},createHref:v,createURL:e=>new URL(v(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?h(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,n){l=r.Push;let a=m(e,n);i+=1,t.splice(i,t.length,a),o&&c&&c({action:l,location:a,delta:1})},replace(e,n){l=r.Replace;let a=m(e,n);t[i]=a,o&&c&&c({action:l,location:a,delta:0})},go(e){l=r.Pop;let n=f(i+e),a=t[n];i=n,c&&c({action:l,location:a,delta:e})},listen:e=>(c=e,()=>{c=null})}}function o(e){return void 0===e&&(e={}),f((function(e,t){let{pathname:r,search:n,hash:a}=e.location;return u("",{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:d(t)}),null,e)}function i(e){return void 0===e&&(e={}),f((function(e,t){let{pathname:r="/",search:n="",hash:a=""}=h(e.location.hash.substr(1));return u("",{pathname:r,search:n,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let r=e.document.querySelector("base"),n="";if(r&&r.getAttribute("href")){let t=e.location.href,r=t.indexOf("#");n=-1===r?t:t.slice(0,r)}return n+"#"+("string"==typeof t?t:d(t))}),(function(e,t){s("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),e)}function l(e,t){if(!1===e||null==e)throw new Error(t)}function s(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function c(e,t){return{usr:e.state,key:e.key,idx:t}}function u(e,r,n,a){return void 0===n&&(n=null),t({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof r?h(r):r,{state:n,key:r&&r.key||a||Math.random().toString(36).substr(2,8)})}function d(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&"?"!==r&&(t+="?"===r.charAt(0)?r:"?"+r),n&&"#"!==n&&(t+="#"===n.charAt(0)?n:"#"+n),t}function h(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function f(e,a,o,i){void 0===i&&(i={});let{window:s=document.defaultView,v5Compat:h=!1}=i,f=s.history,p=r.Pop,m=null,v=g();function g(){return(f.state||{idx:null}).idx}function y(){p=r.Pop;let e=g(),t=null==e?null:e-v;v=e,m&&m({action:p,location:w.location,delta:t})}function b(e){let t="null"!==s.location.origin?s.location.origin:s.location.href,r="string"==typeof e?e:d(e);return l(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)}null==v&&(v=0,f.replaceState(t({},f.state,{idx:v}),""));let w={get action(){return p},get location(){return e(s,f)},listen(e){if(m)throw new Error("A history only accepts one active listener");return s.addEventListener(n,y),m=e,()=>{s.removeEventListener(n,y),m=null}},createHref:e=>a(s,e),createURL:b,encodeLocation(e){let t=b(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){p=r.Push;let n=u(w.location,e,t);o&&o(n,e),v=g()+1;let a=c(n,v),i=w.createHref(n);try{f.pushState(a,"",i)}catch(e){s.location.assign(i)}h&&m&&m({action:p,location:w.location,delta:1})},replace:function(e,t){p=r.Replace;let n=u(w.location,e,t);o&&o(n,e),v=g();let a=c(n,v),i=w.createHref(n);f.replaceState(a,"",i),h&&m&&m({action:p,location:w.location,delta:0})},go:e=>f.go(e)};return w}var p;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(p||(p={}));const m=new Set(["lazy","caseSensitive","path","id","index","children"]);function v(e,r,n,a){return void 0===n&&(n=[]),void 0===a&&(a={}),e.map(((e,o)=>{let i=[...n,o],s="string"==typeof e.id?e.id:i.join("-");if(l(!0!==e.index||!e.children,"Cannot specify children on an index route"),l(!a[s],'Found a route id collision on id "'+s+"\". Route id's must be globally unique within Data Router usages"),function(e){return!0===e.index}(e)){let n=t({},e,r(e),{id:s});return a[s]=n,n}{let n=t({},e,r(e),{id:s,children:void 0});return a[s]=n,e.children&&(n.children=v(e.children,r,i,a)),n}}))}function g(e,t,r){void 0===r&&(r="/");let n=M(("string"==typeof t?h(t):t).pathname||"/",r);if(null==n)return null;let a=y(e);!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)))))}(a);let o=null;for(let e=0;null==o&&e<a.length;++e)o=P(a[e],U(n));return o}function y(e,t,r,n){void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===n&&(n="");let a=(e,a,o)=>{let i={relativePath:void 0===o?e.path||"":o,caseSensitive:!0===e.caseSensitive,childrenIndex:a,route:e};i.relativePath.startsWith("/")&&(l(i.relativePath.startsWith(n),'Absolute route path "'+i.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),i.relativePath=i.relativePath.slice(n.length));let s=B([n,i.relativePath]),c=r.concat(i);e.children&&e.children.length>0&&(l(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+s+'".'),y(e.children,t,c,s)),(null!=e.path||e.index)&&t.push({path:s,score:A(s,e.index),routesMeta:c})};return e.forEach(((e,t)=>{var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?"))for(let r of b(e.path))a(e,t,r);else a(e,t)})),t}function b(e){let t=e.split("/");if(0===t.length)return[];let[r,...n]=t,a=r.endsWith("?"),o=r.replace(/\?$/,"");if(0===n.length)return a?[o,""]:[o];let i=b(n.join("/")),l=[];return l.push(...i.map((e=>""===e?o:[o,e].join("/")))),a&&l.push(...i),l.map((t=>e.startsWith("/")&&""===t?"/":t))}const w=/^:\w+$/,E=3,R=2,D=1,S=10,x=-2,C=e=>"*"===e;function A(e,t){let r=e.split("/"),n=r.length;return r.some(C)&&(n+=x),t&&(n+=R),r.filter((e=>!C(e))).reduce(((e,t)=>e+(w.test(t)?E:""===t?D:S)),n)}function P(e,t){let{routesMeta:r}=e,n={},a="/",o=[];for(let e=0;e<r.length;++e){let i=r[e],l=e===r.length-1,s="/"===a?t:t.slice(a.length)||"/",c=L({path:i.relativePath,caseSensitive:i.caseSensitive,end:l},s);if(!c)return null;Object.assign(n,c.params);let u=i.route;o.push({params:n,pathname:B([a,c.pathname]),pathnameBase:F(B([a,c.pathnameBase])),route:u}),"/"!==c.pathnameBase&&(a=B([a,c.pathnameBase]))}return o}function k(e,t){void 0===t&&(t={});let r=e;r.endsWith("*")&&"*"!==r&&!r.endsWith("/*")&&(s(!1,'Route path "'+r+'" will be treated as if it were "'+r.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+r.replace(/\*$/,"/*")+'".'),r=r.replace(/\*$/,"/*"));return(r.startsWith("/")?"/":"")+r.split(/\/+/).map(((e,r,n)=>{if(r===n.length-1&&"*"===e){return t["*"]}const a=e.match(/^:(\w+)(\??)$/);if(a){const[,e,r]=a;let n=t[e];return"?"===r?null==n?"":n:(null==n&&l(!1,'Missing ":'+e+'" param'),n)}return e.replace(/\?$/g,"")})).filter((e=>!!e)).join("/")}function L(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=function(e,t,r){void 0===t&&(t=!1);void 0===r&&(r=!0);s("*"===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)=>(n.push(t),"/([^\\/]+)")));e.endsWith("*")?(n.push("*"),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))");let o=new RegExp(a,t?void 0:"i");return[o,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,t,r)=>{if("*"===t){let e=l[r]||"";i=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e,t){try{return decodeURIComponent(e)}catch(r){return s(!1,'The value for the URL param "'+t+'" will not be decoded because the string "'+e+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+r+")."),e}}(l[r]||"",t),e}),{}),pathname:o,pathnameBase:i,pattern:e}}function U(e){try{return decodeURI(e)}catch(t){return s(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function M(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&"/"!==n?null:e.slice(r)||"/"}function _(e,t){void 0===t&&(t="/");let{pathname:r,search:n="",hash:a=""}="string"==typeof e?h(e):e,o=r?r.startsWith("/")?r:function(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("/"):"/"}(r,t):t;return{pathname:o,search:N(n),hash:I(a)}}function O(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the `to."+r+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function j(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function T(e,r,n,a){let o;void 0===a&&(a=!1),"string"==typeof e?o=h(e):(o=t({},e),l(!o.pathname||!o.pathname.includes("?"),O("?","pathname","search",o)),l(!o.pathname||!o.pathname.includes("#"),O("#","pathname","hash",o)),l(!o.search||!o.search.includes("#"),O("#","search","hash",o)));let i,s=""===e||""===o.pathname,c=s?"/":o.pathname;if(a||null==c)i=n;else{let e=r.length-1;if(c.startsWith("..")){let t=c.split("/");for(;".."===t[0];)t.shift(),e-=1;o.pathname=t.join("/")}i=e>=0?r[e]:"/"}let u=_(o,i),d=c&&"/"!==c&&c.endsWith("/"),f=(s||"."===c)&&n.endsWith("/");return u.pathname.endsWith("/")||!d&&!f||(u.pathname+="/"),u}const B=e=>e.join("/").replace(/\/\/+/g,"/"),F=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),N=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",I=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",z=function(e,r){void 0===r&&(r={});let n="number"==typeof r?{status:r}:r,a=new Headers(n.headers);return a.has("Content-Type")||a.set("Content-Type","application/json; charset=utf-8"),new Response(JSON.stringify(e),t({},n,{headers:a}))};class W extends Error{}class K{constructor(e,t){let r;this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],l(e&&"object"==typeof e&&!Array.isArray(e),"defer() only accepts plain objects"),this.abortPromise=new Promise(((e,t)=>r=t)),this.controller=new AbortController;let n=()=>r(new W("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",n),this.controller.signal.addEventListener("abort",n),this.data=Object.entries(e).reduce(((e,t)=>{let[r,n]=t;return Object.assign(e,{[r]:this.trackPromise(r,n)})}),{}),this.done&&this.unlistenAbortSignal(),this.init=t}trackPromise(e,t){if(!(t instanceof Promise))return t;this.deferredKeys.push(e),this.pendingKeysSet.add(e);let r=Promise.race([t,this.abortPromise]).then((t=>this.onSettle(r,e,null,t)),(t=>this.onSettle(r,e,t)));return r.catch((()=>{})),Object.defineProperty(r,"_tracked",{get:()=>!0}),r}onSettle(e,t,r,n){return this.controller.signal.aborted&&r instanceof W?(this.unlistenAbortSignal(),Object.defineProperty(e,"_error",{get:()=>r}),Promise.reject(r)):(this.pendingKeysSet.delete(t),this.done&&this.unlistenAbortSignal(),r?(Object.defineProperty(e,"_error",{get:()=>r}),this.emit(!1,t),Promise.reject(r)):(Object.defineProperty(e,"_data",{get:()=>n}),this.emit(!1,t),n))}emit(e,t){this.subscribers.forEach((r=>r(e,t)))}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}cancel(){this.controller.abort(),this.pendingKeysSet.forEach(((e,t)=>this.pendingKeysSet.delete(t))),this.emit(!0)}async resolveData(e){let t=!1;if(!this.done){let r=()=>this.cancel();e.addEventListener("abort",r),t=await new Promise((t=>{this.subscribe((n=>{e.removeEventListener("abort",r),(n||this.done)&&t(n)}))}))}return t}get done(){return 0===this.pendingKeysSet.size}get unwrappedData(){return l(null!==this.data&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce(((e,t)=>{let[r,n]=t;return Object.assign(e,{[r]:$(n)})}),{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function $(e){if(!function(e){return e instanceof Promise&&!0===e._tracked}(e))return e;if(e._error)throw e._error;return e._data}const H=function(e,t){return void 0===t&&(t={}),new K(e,"number"==typeof t?{status:t}:t)},J=function(e,r){void 0===r&&(r=302);let n=r;"number"==typeof n?n={status:n}:void 0===n.status&&(n.status=302);let a=new Headers(n.headers);return a.set("Location",e),new Response(null,t({},n,{headers:a}))};class q{constructor(e,t,r,n){void 0===n&&(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 Y(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}const V=["post","put","patch","delete"],X=new Set(V),G=["get",...V],Q=new Set(G),Z=new Set([301,302,303,307,308]),ee=new Set([307,308]),te={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},re={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},ne={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ae=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,oe="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,ie=!oe,le=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)});function se(e){let n;if(l(e.routes.length>0,"You must provide a non-empty routes array to createRouter"),e.mapRouteProperties)n=e.mapRouteProperties;else if(e.detectErrorBoundary){let t=e.detectErrorBoundary;n=e=>({hasErrorBoundary:t(e)})}else n=le;let a,o={},i=v(e.routes,n,void 0,o),c=e.basename||"/",d=t({v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),h=null,f=new Set,m=null,y=null,b=null,w=null!=e.hydrationData,E=g(i,e.history.location,c),R=null;if(null==E){let t=Re(404,{pathname:e.history.location.pathname}),{matches:r,route:n}=Ee(i);E=r,R={[n.id]:t}}let D,S,x=!(E.some((e=>e.route.lazy))||E.some((e=>e.route.loader))&&null==e.hydrationData),C={historyAction:e.history.action,location:e.history.location,matches:E,initialized:x,navigation:te,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||R,fetchers:new Map,blockers:new Map},A=r.Pop,P=!1,k=!1,L=!1,U=[],_=[],O=new Map,j=0,T=-1,B=new Map,F=new Set,N=new Map,I=new Map,z=new Map,W=!1;function K(e){C=t({},C,e),f.forEach((e=>e(C)))}function $(n,o){var l,s;let c,u=null!=C.actionData&&null!=C.navigation.formMethod&&Pe(C.navigation.formMethod)&&"loading"===C.navigation.state&&!0!==(null==(l=n.state)?void 0:l._isRedirect);c=o.actionData?Object.keys(o.actionData).length>0?o.actionData:null:u?C.actionData:null;let d=o.loaderData?be(C.loaderData,o.loaderData,o.matches||[],o.errors):C.loaderData;for(let[e]of z)fe(e);let h=!0===P||null!=C.navigation.formMethod&&Pe(C.navigation.formMethod)&&!0!==(null==(s=n.state)?void 0:s._isRedirect);a&&(i=a,a=void 0),K(t({},o,{actionData:c,loaderData:d,historyAction:A,location:n,initialized:!0,navigation:te,revalidation:"idle",restoreScrollPosition:Ue(n,o.matches||C.matches),preventScrollReset:h,blockers:new Map(C.blockers)})),k||A===r.Pop||(A===r.Push?e.history.push(n,n.state):A===r.Replace&&e.history.replace(n,n.state)),A=r.Pop,P=!1,k=!1,L=!1,U=[],_=[]}async function H(l,s,u){S&&S.abort(),S=null,A=l,k=!0===(u&&u.startUninterruptedRevalidation),function(e,t){if(m&&y&&b){let r=t.map((e=>Me(e,C.loaderData))),n=y(e,r)||e.key;m[n]=b()}}(C.location,C.matches),P=!0===(u&&u.preventScrollReset);let d=a||i,h=u&&u.overrideNavigation,f=g(d,s,c);if(!f){let e=Re(404,{pathname:s.pathname}),{matches:t,route:r}=Ee(d);return Se(),void $(s,{matches:t,loaderData:{},errors:{[r.id]:e}})}if(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}(C.location,s)&&!(u&&u.submission&&Pe(u.submission.formMethod)))return void $(s,{matches:f});S=new AbortController;let v,w,E=ve(e.history,s,S.signal,u&&u.submission);if(u&&u.pendingError)w={[we(f).route.id]:u.pendingError};else if(u&&u.submission&&Pe(u.submission.formMethod)){let e=await async function(e,a,i,l,s){V();let u,d=t({state:"submitting",location:a},i);K({navigation:d});let h=_e(l,a);if(h.route.action||h.route.lazy){if(u=await me("action",e,h,l,o,n,c),e.signal.aborted)return{shortCircuited:!0}}else u={type:p.error,error:Re(405,{method:e.method,pathname:a.pathname,routeId:h.route.id})};if(Ae(u)){let e;return e=s&&null!=s.replace?s.replace:u.location===C.location.pathname+C.location.search,await q(C,u,{submission:i,replace:e}),{shortCircuited:!0}}if(Ce(u)){let e=we(l,h.route.id);return!0!==(s&&s.replace)&&(A=r.Push),{pendingActionData:{},pendingActionError:{[e.route.id]:u.error}}}if(xe(u))throw Re(400,{type:"defer-action"});return{pendingActionData:{[h.route.id]:u.data}}}(E,s,u.submission,f,{replace:u.replace});if(e.shortCircuited)return;v=e.pendingActionData,w=e.pendingActionError,h=t({state:"loading",location:s},u.submission),E=new Request(E.url,{signal:E.signal})}let{shortCircuited:R,loaderData:D,errors:x}=await async function(r,n,o,l,s,u,d,h,f){let p=l;if(!p){p=t({state:"loading",location:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},s)}let m=s||u?s||u:p.formMethod&&p.formAction&&p.formData&&p.formEncType?{formMethod:p.formMethod,formAction:p.formAction,formData:p.formData,formEncType:p.formEncType}:void 0,v=a||i,[g,y]=de(e.history,C,o,m,n,L,U,_,N,v,c,h,f);if(Se((e=>!(o&&o.some((t=>t.route.id===e)))||g&&g.some((t=>t.route.id===e)))),0===g.length&&0===y.length){let e=se();return $(n,t({matches:o,loaderData:{},errors:f||null},h?{actionData:h}:{},e?{fetchers:new Map(C.fetchers)}:{})),{shortCircuited:!0}}if(!k){y.forEach((e=>{let t=C.fetchers.get(e.key),r={state:"loading",data:t&&t.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};C.fetchers.set(e.key,r)}));let e=h||C.actionData;K(t({navigation:p},e?0===Object.keys(e).length?{actionData:null}:{actionData:e}:{},y.length>0?{fetchers:new Map(C.fetchers)}:{}))}T=++j,y.forEach((e=>{e.controller&&O.set(e.key,e.controller)}));let b=()=>y.forEach((e=>Q(e.key)));S&&S.signal.addEventListener("abort",b);let{results:w,loaderResults:E,fetcherResults:R}=await Y(C.matches,o,g,y,r);if(r.signal.aborted)return{shortCircuited:!0};S&&S.signal.removeEventListener("abort",b);y.forEach((e=>O.delete(e.key)));let D=De(w);if(D)return await q(C,D,{replace:d}),{shortCircuited:!0};let{loaderData:x,errors:A}=ye(C,o,g,E,f,y,R,I);I.forEach(((e,t)=>{e.subscribe((r=>{(r||e.done)&&I.delete(t)}))}));let P=se(),M=he(T),B=P||M||y.length>0;return t({loaderData:x,errors:A},B?{fetchers:new Map(C.fetchers)}:{})}(E,s,f,h,u&&u.submission,u&&u.fetcherSubmission,u&&u.replace,v,w);R||(S=null,$(s,t({matches:f},v?{actionData:v}:{},{loaderData:D,errors:x})))}function J(e){return C.fetchers.get(e)||re}async function q(n,a,o){var i;let{submission:s,replace:d,isFetchActionRedirect:h}=void 0===o?{}:o;a.revalidate&&(L=!0);let f=u(n.location,a.location,t({_isRedirect:!0},h?{_isFetchActionRedirect:!0}:{}));if(l(f,"Expected a location on the redirect navigation"),ae.test(a.location)&&oe&&void 0!==(null==(i=window)?void 0:i.location)){let t=e.history.createURL(a.location),r=null==M(t.pathname,c);if(window.location.origin!==t.origin||r)return void(d?window.location.replace(a.location):window.location.assign(a.location))}S=null;let p=!0===d?r.Replace:r.Push,{formMethod:m,formAction:v,formEncType:g,formData:y}=n.navigation;!s&&m&&v&&y&&g&&(s={formMethod:m,formAction:v,formEncType:g,formData:y}),ee.has(a.status)&&s&&Pe(s.formMethod)?await H(p,f,{submission:t({},s,{formAction:a.location}),preventScrollReset:P}):h?await H(p,f,{overrideNavigation:{state:"loading",location:f,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},fetcherSubmission:s,preventScrollReset:P}):await H(p,f,{overrideNavigation:{state:"loading",location:f,formMethod:s?s.formMethod:void 0,formAction:s?s.formAction:void 0,formEncType:s?s.formEncType:void 0,formData:s?s.formData:void 0},preventScrollReset:P})}async function Y(t,r,a,i,l){let s=await Promise.all([...a.map((e=>me("loader",l,e,r,o,n,c))),...i.map((t=>{if(t.matches&&t.match&&t.controller)return me("loader",ve(e.history,t.path,t.controller.signal),t.match,t.matches,o,n,c);return{type:p.error,error:Re(404,{pathname:t.path})}}))]),u=s.slice(0,a.length),d=s.slice(a.length);return await Promise.all([ke(t,a,u,u.map((()=>l.signal)),!1,C.loaderData),ke(t,i.map((e=>e.match)),d,i.map((e=>e.controller?e.controller.signal:null)),!0)]),{results:s,loaderResults:u,fetcherResults:d}}function V(){L=!0,U.push(...Se()),N.forEach(((e,t)=>{O.has(t)&&(_.push(t),Q(t))}))}function X(e,t,r){let n=we(C.matches,t);G(e),K({errors:{[n.route.id]:r},fetchers:new Map(C.fetchers)})}function G(e){O.has(e)&&Q(e),N.delete(e),B.delete(e),F.delete(e),C.fetchers.delete(e)}function Q(e){let t=O.get(e);l(t,"Expected fetch controller: "+e),t.abort(),O.delete(e)}function Z(e){for(let t of e){let e={state:"idle",data:J(t).data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};C.fetchers.set(t,e)}}function se(){let e=[],t=!1;for(let r of F){let n=C.fetchers.get(r);l(n,"Expected fetcher: "+r),"loading"===n.state&&(F.delete(r),e.push(r),t=!0)}return Z(e),t}function he(e){let t=[];for(let[r,n]of B)if(n<e){let e=C.fetchers.get(r);l(e,"Expected fetcher: "+r),"loading"===e.state&&(Q(r),B.delete(r),t.push(r))}return Z(t),t.length>0}function fe(e){C.blockers.delete(e),z.delete(e)}function pe(e,t){let r=C.blockers.get(e)||ne;l("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),C.blockers.set(e,t),K({blockers:new Map(C.blockers)})}function ge(e){let{currentLocation:t,nextLocation:r,historyAction:n}=e;if(0===z.size)return;z.size>1&&s(!1,"A router only supports one blocker at a time");let a=Array.from(z.entries()),[o,i]=a[a.length-1],l=C.blockers.get(o);return l&&"proceeding"===l.state?void 0:i({currentLocation:t,nextLocation:r,historyAction:n})?o:void 0}function Se(e){let t=[];return I.forEach(((r,n)=>{e&&!e(n)||(r.cancel(),t.push(n),I.delete(n))})),t}function Ue(e,t){if(m&&y&&b){let r=t.map((e=>Me(e,C.loaderData))),n=y(e,r)||e.key,a=m[n];if("number"==typeof a)return a}return null}return D={get basename(){return c},get state(){return C},get routes(){return i},initialize:function(){return h=e.history.listen((t=>{let{action:r,location:n,delta:a}=t;if(W)return void(W=!1);s(0===z.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 o=ge({currentLocation:C.location,nextLocation:n,historyAction:r});return o&&null!=a?(W=!0,e.history.go(-1*a),void pe(o,{state:"blocked",location:n,proceed(){pe(o,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),e.history.go(a)},reset(){fe(o),K({blockers:new Map(D.state.blockers)})}})):H(r,n)})),C.initialized||H(r.Pop,C.location),D},subscribe:function(e){return f.add(e),()=>f.delete(e)},enableScrollRestoration:function(e,t,r){if(m=e,b=t,y=r||(e=>e.key),!w&&C.navigation===te){w=!0;let e=Ue(C.location,C.matches);null!=e&&K({restoreScrollPosition:e})}return()=>{m=null,b=null,y=null}},navigate:async function n(a,o){if("number"==typeof a)return void e.history.go(a);let i=ce(C.location,C.matches,c,d.v7_prependBasename,a,null==o?void 0:o.fromRouteId,null==o?void 0:o.relative),{path:l,submission:s,error:h}=ue(d.v7_normalizeFormMethod,!1,i,o),f=C.location,p=u(C.location,l,o&&o.state);p=t({},p,e.history.encodeLocation(p));let m=o&&null!=o.replace?o.replace:void 0,v=r.Push;!0===m?v=r.Replace:!1===m||null!=s&&Pe(s.formMethod)&&s.formAction===C.location.pathname+C.location.search&&(v=r.Replace);let g=o&&"preventScrollReset"in o?!0===o.preventScrollReset:void 0,y=ge({currentLocation:f,nextLocation:p,historyAction:v});if(!y)return await H(v,p,{submission:s,pendingError:h,preventScrollReset:g,replace:o&&o.replace});pe(y,{state:"blocked",location:p,proceed(){pe(y,{state:"proceeding",proceed:void 0,reset:void 0,location:p}),n(a,o)},reset(){fe(y),K({blockers:new Map(C.blockers)})}})},fetch:function(r,s,u,h){if(ie)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");O.has(r)&&Q(r);let f=a||i,p=ce(C.location,C.matches,c,d.v7_prependBasename,u,s,null==h?void 0:h.relative),m=g(f,p,c);if(!m)return void X(r,s,Re(404,{pathname:p}));let{path:v,submission:y}=ue(d.v7_normalizeFormMethod,!0,p,h),b=_e(m,v);P=!0===(h&&h.preventScrollReset),y&&Pe(y.formMethod)?async function(r,s,u,d,h,f){if(V(),N.delete(r),!d.route.action&&!d.route.lazy){let e=Re(405,{method:f.formMethod,pathname:u,routeId:s});return void X(r,s,e)}let p=C.fetchers.get(r),m=t({state:"submitting"},f,{data:p&&p.data," _hasFetcherDoneAnything ":!0});C.fetchers.set(r,m),K({fetchers:new Map(C.fetchers)});let v=new AbortController,y=ve(e.history,u,v.signal,f);O.set(r,v);let b=await me("action",y,d,h,o,n,c);if(y.signal.aborted)return void(O.get(r)===v&&O.delete(r));if(Ae(b)){O.delete(r),F.add(r);let e=t({state:"loading"},f,{data:void 0," _hasFetcherDoneAnything ":!0});return C.fetchers.set(r,e),K({fetchers:new Map(C.fetchers)}),q(C,b,{submission:f,isFetchActionRedirect:!0})}if(Ce(b))return void X(r,s,b.error);if(xe(b))throw Re(400,{type:"defer-action"});let w=C.navigation.location||C.location,E=ve(e.history,w,v.signal),R=a||i,D="idle"!==C.navigation.state?g(R,C.navigation.location,c):C.matches;l(D,"Didn't find any matches after fetcher action");let x=++j;B.set(r,x);let P=t({state:"loading",data:b.data},f,{" _hasFetcherDoneAnything ":!0});C.fetchers.set(r,P);let[k,M]=de(e.history,C,D,f,w,L,U,_,N,R,c,{[d.route.id]:b.data},void 0);M.filter((e=>e.key!==r)).forEach((e=>{let t=e.key,r=C.fetchers.get(t),n={state:"loading",data:r&&r.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};C.fetchers.set(t,n),e.controller&&O.set(t,e.controller)})),K({fetchers:new Map(C.fetchers)});let z=()=>M.forEach((e=>Q(e.key)));v.signal.addEventListener("abort",z);let{results:W,loaderResults:H,fetcherResults:J}=await Y(C.matches,D,k,M,E);if(v.signal.aborted)return;v.signal.removeEventListener("abort",z),B.delete(r),O.delete(r),M.forEach((e=>O.delete(e.key)));let G=De(W);if(G)return q(C,G);let{loaderData:Z,errors:ee}=ye(C,C.matches,k,H,void 0,M,J,I),te={state:"idle",data:b.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};C.fetchers.set(r,te);let re=he(x);"loading"===C.navigation.state&&x>T?(l(A,"Expected pending action"),S&&S.abort(),$(C.navigation.location,{matches:D,loaderData:Z,errors:ee,fetchers:new Map(C.fetchers)})):(K(t({errors:ee,loaderData:be(C.loaderData,Z,D,ee)},re?{fetchers:new Map(C.fetchers)}:{})),L=!1)}(r,s,v,b,m,y):(N.set(r,{routeId:s,path:v}),async function(r,a,i,s,u,d){let h=C.fetchers.get(r),f=t({state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0},d,{data:h&&h.data," _hasFetcherDoneAnything ":!0});C.fetchers.set(r,f),K({fetchers:new Map(C.fetchers)});let p=new AbortController,m=ve(e.history,i,p.signal);O.set(r,p);let v=await me("loader",m,s,u,o,n,c);xe(v)&&(v=await Le(v,m.signal,!0)||v);O.get(r)===p&&O.delete(r);if(m.signal.aborted)return;if(Ae(v))return F.add(r),void await q(C,v);if(Ce(v)){let e=we(C.matches,a);return C.fetchers.delete(r),void K({fetchers:new Map(C.fetchers),errors:{[e.route.id]:v.error}})}l(!xe(v),"Unhandled fetcher deferred data");let g={state:"idle",data:v.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};C.fetchers.set(r,g),K({fetchers:new Map(C.fetchers)})}(r,s,v,b,m,y))},revalidate:function(){V(),K({revalidation:"loading"}),"submitting"!==C.navigation.state&&("idle"!==C.navigation.state?H(A||C.historyAction,C.navigation.location,{overrideNavigation:C.navigation}):H(C.historyAction,C.location,{startUninterruptedRevalidation:!0}))},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:J,deleteFetcher:G,dispose:function(){h&&h(),f.clear(),S&&S.abort(),C.fetchers.forEach(((e,t)=>G(t))),C.blockers.forEach(((e,t)=>fe(t)))},getBlocker:function(e,t){let r=C.blockers.get(e)||ne;return z.get(e)!==t&&z.set(e,t),r},deleteBlocker:fe,_internalFetchControllers:O,_internalActiveDeferreds:I,_internalSetRoutes:function(e){a=e}},D}function ce(e,t,r,n,a,o,i){let l,s;if(null!=o&&"path"!==i){l=[];for(let e of t)if(l.push(e),e.route.id===o){s=e;break}}else l=t,s=t[t.length-1];let c=T(a||".",j(l).map((e=>e.pathnameBase)),M(e.pathname,r)||e.pathname,"path"===i);return null==a&&(c.search=e.search,c.hash=e.hash),null!=a&&""!==a&&"."!==a||!s||!s.route.index||Ue(c.search)||(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),n&&"/"!==r&&(c.pathname="/"===c.pathname?r:B([r,c.pathname])),d(c)}function ue(e,t,r,n){if(!n||!function(e){return null!=e&&"formData"in e}(n))return{path:r};if(n.formMethod&&(a=n.formMethod,!Q.has(a.toLowerCase())))return{path:r,error:Re(405,{method:n.formMethod})};var a;let o;if(n.formData){let t=n.formMethod||"get";if(o={formMethod:e?t.toUpperCase():t.toLowerCase(),formAction:Se(r),formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:n.formData},Pe(o.formMethod))return{path:r,submission:o}}let i=h(r),l=ge(n.formData);return t&&i.search&&Ue(i.search)&&l.append("index",""),i.search="?"+l,{path:d(i),submission:o}}function de(e,r,n,a,o,i,l,s,c,u,d,h,f){let p=f?Object.values(f)[0]:h?Object.values(h)[0]:void 0,m=e.createURL(r.location),v=e.createURL(o),y=f?Object.keys(f)[0]:void 0,b=function(e,t){let r=e;if(t){let n=e.findIndex((e=>e.route.id===t));n>=0&&(r=e.slice(0,n))}return r}(n,y),w=b.filter(((e,n)=>{if(e.route.lazy)return!0;if(null==e.route.loader)return!1;if(function(e,t,r){let n=!t||r.route.id!==t.route.id,a=void 0===e[r.route.id];return n||a}(r.loaderData,r.matches[n],e)||l.some((t=>t===e.route.id)))return!0;let o=r.matches[n],s=e;return fe(e,t({currentUrl:m,currentParams:o.params,nextUrl:v,nextParams:s.params},a,{actionResult:p,defaultShouldRevalidate:i||m.pathname+m.search===v.pathname+v.search||m.search!==v.search||he(o,s)}))})),E=[];return c.forEach(((e,o)=>{if(!n.some((t=>t.route.id===e.routeId)))return;let l=g(u,e.path,d);if(!l)return void E.push({key:o,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});let c=_e(l,e.path);(s.includes(o)||fe(c,t({currentUrl:m,currentParams:r.matches[r.matches.length-1].params,nextUrl:v,nextParams:n[n.length-1].params},a,{actionResult:p,defaultShouldRevalidate:i})))&&E.push({key:o,routeId:e.routeId,path:e.path,matches:l,match:c,controller:new AbortController})})),[w,E]}function he(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function fe(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}async function pe(e,r,n){if(!e.lazy)return;let a=await e.lazy();if(!e.lazy)return;let o=n[e.id];l(o,"No route found in manifest");let i={};for(let e in a){let t=void 0!==o[e]&&"hasErrorBoundary"!==e;s(!t,'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.'),t||m.has(e)||(i[e]=a[e])}Object.assign(o,i),Object.assign(o,t({},r(o),{lazy:void 0}))}async function me(e,t,r,n,a,o,i,s,c,u){let d,h,f;void 0===s&&(s=!1),void 0===c&&(c=!1);let m=e=>{let n,a=new Promise(((e,t)=>n=t));return f=()=>n(),t.signal.addEventListener("abort",f),Promise.race([e({request:t,params:r.params,context:u}),a])};try{let n=r.route[e];if(r.route.lazy)if(n){h=(await Promise.all([m(n),pe(r.route,o,a)]))[0]}else{if(await pe(r.route,o,a),n=r.route[e],!n){if("action"===e){let e=new URL(t.url),n=e.pathname+e.search;throw Re(405,{method:t.method,pathname:n,routeId:r.route.id})}return{type:p.data,data:void 0}}h=await m(n)}else{if(!n){let e=new URL(t.url);throw Re(404,{pathname:e.pathname+e.search})}h=await m(n)}l(void 0!==h,"You defined "+("action"===e?"an action":"a loader")+' for route "'+r.route.id+"\" but didn't return anything from your `"+e+"` function. Please return a value or `null`.")}catch(e){d=p.error,h=e}finally{f&&t.signal.removeEventListener("abort",f)}if(null!=(v=h)&&"number"==typeof v.status&&"string"==typeof v.statusText&&"object"==typeof v.headers&&void 0!==v.body){let e,a=h.status;if(Z.has(a)){let e=h.headers.get("Location");if(l(e,"Redirects returned/thrown from loaders/actions must have a Location header"),ae.test(e)){if(!s){let r=new URL(t.url),n=e.startsWith("//")?new URL(r.protocol+e):new URL(e),a=null!=M(n.pathname,i);n.origin===r.origin&&a&&(e=n.pathname+n.search+n.hash)}}else e=ce(new URL(t.url),n.slice(0,n.indexOf(r)+1),i,!0,e);if(s)throw h.headers.set("Location",e),h;return{type:p.redirect,status:a,location:e,revalidate:null!==h.headers.get("X-Remix-Revalidate")}}if(c)throw{type:d||p.data,response:h};let o=h.headers.get("Content-Type");return e=o&&/\bapplication\/json\b/.test(o)?await h.json():await h.text(),d===p.error?{type:d,error:new q(a,h.statusText,e),headers:h.headers}:{type:p.data,data:e,statusCode:h.status,headers:h.headers}}var v,g,y;return d===p.error?{type:d,error:h}:function(e){let t=e;return t&&"object"==typeof t&&"object"==typeof t.data&&"function"==typeof t.subscribe&&"function"==typeof t.cancel&&"function"==typeof t.resolveData}(h)?{type:p.deferred,deferredData:h,statusCode:null==(g=h.init)?void 0:g.status,headers:(null==(y=h.init)?void 0:y.headers)&&new Headers(h.init.headers)}:{type:p.data,data:h}}function ve(e,t,r,n){let a=e.createURL(Se(t)).toString(),o={signal:r};if(n&&Pe(n.formMethod)){let{formMethod:e,formEncType:t,formData:r}=n;o.method=e.toUpperCase(),o.body="application/x-www-form-urlencoded"===t?ge(r):r}return new Request(a,o)}function ge(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,n instanceof File?n.name:n);return t}function ye(e,r,n,a,o,i,s,c){let{loaderData:u,errors:d}=function(e,t,r,n,a){let o,i={},s=null,c=!1,u={};return r.forEach(((r,d)=>{let h=t[d].route.id;if(l(!Ae(r),"Cannot handle redirect results in processLoaderData"),Ce(r)){let t=we(e,h),a=r.error;n&&(a=Object.values(n)[0],n=void 0),s=s||{},null==s[t.route.id]&&(s[t.route.id]=a),i[h]=void 0,c||(c=!0,o=Y(r.error)?r.error.status:500),r.headers&&(u[h]=r.headers)}else xe(r)?(a.set(h,r.deferredData),i[h]=r.deferredData.data):i[h]=r.data,null==r.statusCode||200===r.statusCode||c||(o=r.statusCode),r.headers&&(u[h]=r.headers)})),n&&(s=n,i[Object.keys(n)[0]]=void 0),{loaderData:i,errors:s,statusCode:o||200,loaderHeaders:u}}(r,n,a,o,c);for(let r=0;r<i.length;r++){let{key:n,match:a,controller:o}=i[r];l(void 0!==s&&void 0!==s[r],"Did not find corresponding fetcher result");let c=s[r];if(!o||!o.signal.aborted)if(Ce(c)){let r=we(e.matches,null==a?void 0:a.route.id);d&&d[r.route.id]||(d=t({},d,{[r.route.id]:c.error})),e.fetchers.delete(n)}else if(Ae(c))l(!1,"Unhandled fetcher revalidation redirect");else if(xe(c))l(!1,"Unhandled fetcher deferred data");else{let t={state:"idle",data:c.data,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0," _hasFetcherDoneAnything ":!0};e.fetchers.set(n,t)}}return{loaderData:u,errors:d}}function be(e,r,n,a){let o=t({},r);for(let t of n){let n=t.route.id;if(r.hasOwnProperty(n)?void 0!==r[n]&&(o[n]=r[n]):void 0!==e[n]&&t.route.loader&&(o[n]=e[n]),a&&a.hasOwnProperty(n))break}return o}function we(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 Ee(e){let t=e.find((e=>e.index||!e.path||"/"===e.path))||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Re(e,t){let{pathname:r,routeId:n,method:a,type:o}=void 0===t?{}:t,i="Unknown Server Error",l="Unknown @remix-run/router error";return 400===e?(i="Bad Request",a&&r&&n?l="You made a "+a+' request to "'+r+'" but did not provide a `loader` for route "'+n+'", so there is no way to handle the request.':"defer-action"===o&&(l="defer() is not supported in actions")):403===e?(i="Forbidden",l='Route "'+n+'" does not match URL "'+r+'"'):404===e?(i="Not Found",l='No route matches URL "'+r+'"'):405===e&&(i="Method Not Allowed",a&&r&&n?l="You made a "+a.toUpperCase()+' request to "'+r+'" but did not provide an `action` for route "'+n+'", so there is no way to handle the request.':a&&(l='Invalid request method "'+a.toUpperCase()+'"')),new q(e||500,i,new Error(l),!0)}function De(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(Ae(r))return r}}function Se(e){return d(t({},"string"==typeof e?h(e):e,{hash:""}))}function xe(e){return e.type===p.deferred}function Ce(e){return e.type===p.error}function Ae(e){return(e&&e.type)===p.redirect}function Pe(e){return X.has(e.toLowerCase())}async function ke(e,t,r,n,a,o){for(let i=0;i<r.length;i++){let s=r[i],c=t[i];if(!c)continue;let u=e.find((e=>e.route.id===c.route.id)),d=null!=u&&!he(u,c)&&void 0!==(o&&o[c.route.id]);if(xe(s)&&(a||d)){let e=n[i];l(e,"Expected an AbortSignal for revalidating fetcher deferred result"),await Le(s,e,a).then((e=>{e&&(r[i]=e||r[i])}))}}}async function Le(e,t,r){if(void 0===r&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:p.data,data:e.deferredData.unwrappedData}}catch(e){return{type:p.error,error:e}}return{type:p.data,data:e.deferredData.data}}}function Ue(e){return new URLSearchParams(e).getAll("index").some((e=>""===e))}function Me(e,t){let{route:r,pathname:n,params:a}=e;return{id:r.id,pathname:n,params:a,data:t[r.id],handle:r.handle}}function _e(e,t){let r="string"==typeof t?h(t).search:t.search;if(e[e.length-1].route.index&&Ue(r||""))return e[e.length-1];let n=j(e);return n[n.length-1]}
13
13
  /**
14
- * React Router v6.10.0
14
+ * React Router v6.11.1
15
15
  *
16
16
  * Copyright (c) Remix Software Inc.
17
17
  *
@@ -19,9 +19,9 @@ import*as e from"react";
19
19
  * LICENSE.md file in the root directory of this source tree.
20
20
  *
21
21
  * @license MIT
22
- */const Oe="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},{useState:je,useEffect:Te,useLayoutEffect:_e,useDebugValue:Be}=e;function Fe(e){const t=e.getSnapshot,r=e.value;try{const e=t();return!Oe(r,e)}catch(e){return!0}}const Ne=!!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement)?function(e,t,r){return t()}:function(e,t,r){const n=t(),[{inst:o},a]=je({inst:{value:n,getSnapshot:t}});return _e((()=>{o.value=n,o.getSnapshot=t,Fe(o)&&a({inst:o})}),[e,n,t]),Te((()=>{Fe(o)&&a({inst:o});return e((()=>{Fe(o)&&a({inst:o})}))}),[e]),Be(n),n},Ie="useSyncExternalStore"in e?e.useSyncExternalStore:Ne,ze=e.createContext(null),We=e.createContext(null),Ke=e.createContext(null),$e=e.createContext(null),He=e.createContext(null),qe=e.createContext({outlet:null,matches:[]}),Je=e.createContext(null);function Ye(){return Ye=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ye.apply(this,arguments)}function Ve(t,r){let{relative:n}=void 0===r?{}:r;Xe()||l(!1);let{basename:o,navigator:a}=e.useContext($e),{hash:i,pathname:s,search:c}=at(t,{relative:n}),u=s;return"/"!==o&&(u="/"===s?o:B([o,s])),a.createHref({pathname:u,search:c,hash:i})}function Xe(){return null!=e.useContext(He)}function Ge(){return Xe()||l(!1),e.useContext(He).location}function Qe(){return e.useContext(He).navigationType}function Ze(t){Xe()||l(!1);let{pathname:r}=Ge();return e.useMemo((()=>L(t,r)),[r,t])}function et(){Xe()||l(!1);let{basename:t,navigator:r}=e.useContext($e),{matches:n}=e.useContext(qe),{pathname:o}=Ge(),a=JSON.stringify(T(n).map((e=>e.pathnameBase))),i=e.useRef(!1);return e.useEffect((()=>{i.current=!0})),e.useCallback((function(e,n){if(void 0===n&&(n={}),!i.current)return;if("number"==typeof e)return void r.go(e);let l=_(e,JSON.parse(a),o,"path"===n.relative);"/"!==t&&(l.pathname="/"===l.pathname?t:B([t,l.pathname])),(n.replace?r.replace:r.push)(l,n.state,n)}),[t,r,a,o])}const tt=e.createContext(null);function rt(){return e.useContext(tt)}function nt(t){let r=e.useContext(qe).outlet;return r?e.createElement(tt.Provider,{value:t},r):r}function ot(){let{matches:t}=e.useContext(qe),r=t[t.length-1];return r?r.params:{}}function at(t,r){let{relative:n}=void 0===r?{}:r,{matches:o}=e.useContext(qe),{pathname:a}=Ge(),i=JSON.stringify(T(o).map((e=>e.pathnameBase)));return e.useMemo((()=>_(t,JSON.parse(i),a,"path"===n)),[t,i,a,n])}function it(t,n){Xe()||l(!1);let{navigator:o}=e.useContext($e),a=e.useContext(We),{matches:i}=e.useContext(qe),s=i[i.length-1],c=s?s.params:{};!s||s.pathname;let u=s?s.pathnameBase:"/";s&&s.route;let d,f=Ge();if(n){var p;let e="string"==typeof n?h(n):n;"/"===u||(null==(p=e.pathname)?void 0:p.startsWith(u))||l(!1),d=e}else d=f;let m=d.pathname||"/",v=g(t,{pathname:"/"===u?m:m.slice(u.length)||"/"}),y=ut(v&&v.map((e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:B([u,o.encodeLocation?o.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?u:B([u,o.encodeLocation?o.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),i,a||void 0);return n&&y?e.createElement(He.Provider,{value:{location:Ye({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:r.Pop}},y):y}function lt(){let t=Rt(),r=Y(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return e.createElement(e.Fragment,null,e.createElement("h2",null,"Unexpected Application Error!"),e.createElement("h3",{style:{fontStyle:"italic"}},r),n?e.createElement("pre",{style:o},n):null,null)}class st extends e.Component{constructor(e){super(e),this.state={location:e.location,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:e.error,location:e.location}:{error:e.error||t.error,location:t.location}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error?e.createElement(qe.Provider,{value:this.props.routeContext},e.createElement(Je.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ct(t){let{routeContext:r,match:n,children:o}=t,a=e.useContext(ze);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),e.createElement(qe.Provider,{value:r},o)}function ut(t,r,n){if(void 0===r&&(r=[]),null==t){if(null==n||!n.errors)return null;t=n.matches}let o=t,a=null==n?void 0:n.errors;if(null!=a){let e=o.findIndex((e=>e.route.id&&(null==a?void 0:a[e.route.id])));e>=0||l(!1),o=o.slice(0,Math.min(o.length,e+1))}return o.reduceRight(((t,i,l)=>{let s=i.route.id?null==a?void 0:a[i.route.id]:null,c=null;n&&(c=i.route.ErrorBoundary?e.createElement(i.route.ErrorBoundary,null):i.route.errorElement?i.route.errorElement:e.createElement(lt,null));let u=r.concat(o.slice(0,l+1)),d=()=>{let r=t;return s?r=c:i.route.Component?r=e.createElement(i.route.Component,null):i.route.element&&(r=i.route.element),e.createElement(ct,{match:i,routeContext:{outlet:t,matches:u},children:r})};return n&&(i.route.ErrorBoundary||i.route.errorElement||0===l)?e.createElement(st,{location:n.location,component:c,error:s,children:d(),routeContext:{outlet:null,matches:u}}):d()}),null)}var dt,ht;function ft(t){let r=e.useContext(ze);return r||l(!1),r}function pt(t){let r=e.useContext(We);return r||l(!1),r}function mt(t){let r=function(t){let r=e.useContext(qe);return r||l(!1),r}(),n=r.matches[r.matches.length-1];return n.route.id||l(!1),n.route.id}function vt(){return pt(ht.UseNavigation).navigation}function gt(){let e=ft(dt.UseRevalidator),t=pt(ht.UseRevalidator);return{revalidate:e.router.revalidate,state:t.revalidation}}function yt(){let{matches:t,loaderData:r}=pt(ht.UseMatches);return e.useMemo((()=>t.map((e=>{let{pathname:t,params:n}=e;return{id:e.route.id,pathname:t,params:n,data:r[e.route.id],handle:e.route.handle}}))),[t,r])}function bt(){let e=pt(ht.UseLoaderData),t=mt(ht.UseLoaderData);if(!e.errors||null==e.errors[t])return e.loaderData[t];console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")")}function wt(e){return pt(ht.UseRouteLoaderData).loaderData[e]}function Et(){let t=pt(ht.UseActionData);return e.useContext(qe)||l(!1),Object.values((null==t?void 0:t.actionData)||{})[0]}function Rt(){var t;let r=e.useContext(Je),n=pt(ht.UseRouteError),o=mt(ht.UseRouteError);return r||(null==(t=n.errors)?void 0:t[o])}function St(){let t=e.useContext(Ke);return null==t?void 0:t._data}function Dt(){let t=e.useContext(Ke);return null==t?void 0:t._error}!function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator"}(dt||(dt={})),function(e){e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator"}(ht||(ht={}));let xt=0;function Ct(t){let{router:r}=ft(dt.UseBlocker),n=pt(ht.UseBlocker),[o]=e.useState((()=>String(++xt))),a=e.useCallback((e=>"function"==typeof t?!!t(e):!!t),[t]),i=r.getBlocker(o,a);return e.useEffect((()=>()=>r.deleteBlocker(o)),[r,o]),n.blockers.get(o)||i}function At(t){let{fallbackElement:r,router:n}=t,o=e.useCallback((()=>n.state),[n]),a=Ie(n.subscribe,o,o),i=e.useMemo((()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:e=>n.navigate(e),push:(e,t,r)=>n.navigate(e,{state:t,preventScrollReset:null==r?void 0:r.preventScrollReset}),replace:(e,t,r)=>n.navigate(e,{replace:!0,state:t,preventScrollReset:null==r?void 0:r.preventScrollReset})})),[n]),l=n.basename||"/",s=e.useMemo((()=>({router:n,navigator:i,static:!1,basename:l})),[n,i,l]);return e.createElement(e.Fragment,null,e.createElement(ze.Provider,{value:s},e.createElement(We.Provider,{value:a},e.createElement(Mt,{basename:n.basename,location:n.state.location,navigationType:n.state.historyAction,navigator:i},n.state.initialized?e.createElement(Ot,null):r))),null)}function Pt(t){let{basename:r,children:n,initialEntries:a,initialIndex:i}=t,l=e.useRef();null==l.current&&(l.current=o({initialEntries:a,initialIndex:i,v5Compat:!0}));let s=l.current,[c,u]=e.useState({action:s.action,location:s.location});return e.useLayoutEffect((()=>s.listen(u)),[s]),e.createElement(Mt,{basename:r,children:n,location:c.location,navigationType:c.action,navigator:s})}function kt(t){let{to:r,replace:n,state:o,relative:a}=t;Xe()||l(!1);let i=e.useContext(We),s=et();return e.useEffect((()=>{i&&"idle"!==i.navigation.state||s(r,{replace:n,state:o,relative:a})})),null}function Lt(e){return nt(e.context)}function Ut(e){l(!1)}function Mt(t){let{basename:n="/",children:o=null,location:a,navigationType:i=r.Pop,navigator:s,static:c=!1}=t;Xe()&&l(!1);let u=n.replace(/^\/*/,"/"),d=e.useMemo((()=>({basename:u,navigator:s,static:c})),[u,s,c]);"string"==typeof a&&(a=h(a));let{pathname:f="/",search:p="",hash:m="",state:v=null,key:g="default"}=a,y=e.useMemo((()=>{let e=M(f,u);return null==e?null:{location:{pathname:e,search:p,hash:m,state:v,key:g},navigationType:i}}),[u,f,p,m,v,g,i]);return null==y?null:e.createElement($e.Provider,{value:d},e.createElement(He.Provider,{children:o,value:y}))}function Ot(t){let{children:r,location:n}=t,o=e.useContext(ze);return it(o&&!r?o.router.routes:Nt(r),n)}function jt(t){let{children:r,errorElement:n,resolve:o}=t;return e.createElement(Bt,{resolve:o,errorElement:n},e.createElement(Ft,null,r))}var Tt;!function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"}(Tt||(Tt={}));const _t=new Promise((()=>{}));class Bt extends e.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("<Await> caught the following error during render",e,t)}render(){let{children:t,errorElement:r,resolve:n}=this.props,o=null,a=Tt.pending;if(n instanceof Promise)if(this.state.error){a=Tt.error;let e=this.state.error;o=Promise.reject().catch((()=>{})),Object.defineProperty(o,"_tracked",{get:()=>!0}),Object.defineProperty(o,"_error",{get:()=>e})}else n._tracked?(o=n,a=void 0!==o._error?Tt.error:void 0!==o._data?Tt.success:Tt.pending):(a=Tt.pending,Object.defineProperty(n,"_tracked",{get:()=>!0}),o=n.then((e=>Object.defineProperty(n,"_data",{get:()=>e})),(e=>Object.defineProperty(n,"_error",{get:()=>e}))));else a=Tt.success,o=Promise.resolve(),Object.defineProperty(o,"_tracked",{get:()=>!0}),Object.defineProperty(o,"_data",{get:()=>n});if(a===Tt.error&&o._error instanceof W)throw _t;if(a===Tt.error&&!r)throw o._error;if(a===Tt.error)return e.createElement(Ke.Provider,{value:o,children:r});if(a===Tt.success)return e.createElement(Ke.Provider,{value:o,children:t});throw o}}function Ft(t){let{children:r}=t,n=St(),o="function"==typeof r?r(n):r;return e.createElement(e.Fragment,null,o)}function Nt(t,r){void 0===r&&(r=[]);let n=[];return e.Children.forEach(t,((t,o)=>{if(!e.isValidElement(t))return;let a=[...r,o];if(t.type===e.Fragment)return void n.push.apply(n,Nt(t.props.children,a));t.type!==Ut&&l(!1),t.props.index&&t.props.children&&l(!1);let i={id:t.props.id||a.join("-"),caseSensitive:t.props.caseSensitive,element:t.props.element,Component:t.props.Component,index:t.props.index,path:t.props.path,loader:t.props.loader,action:t.props.action,errorElement:t.props.errorElement,ErrorBoundary:t.props.ErrorBoundary,hasErrorBoundary:null!=t.props.ErrorBoundary||null!=t.props.errorElement,shouldRevalidate:t.props.shouldRevalidate,handle:t.props.handle,lazy:t.props.lazy};t.props.children&&(i.children=Nt(t.props.children,a)),n.push(i)})),n}function It(e){return ut(e)}function zt(e){return Boolean(e.ErrorBoundary)||Boolean(e.errorElement)}function Wt(e,t){return se({basename:null==t?void 0:t.basename,future:null==t?void 0:t.future,history:o({initialEntries:null==t?void 0:t.initialEntries,initialIndex:null==t?void 0:t.initialIndex}),hydrationData:null==t?void 0:t.hydrationData,routes:e,detectErrorBoundary:zt}).initialize()}
22
+ */function Oe(){return Oe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Oe.apply(this,arguments)}const je=e.createContext(null),Te=e.createContext(null),Be=e.createContext(null),Fe=e.createContext(null),Ne=e.createContext(null),Ie=e.createContext({outlet:null,matches:[],isDataRoute:!1}),ze=e.createContext(null);function We(t,r){let{relative:n}=void 0===r?{}:r;Ke()||l(!1);let{basename:a,navigator:o}=e.useContext(Fe),{hash:i,pathname:s,search:c}=Ze(t,{relative:n}),u=s;return"/"!==a&&(u="/"===s?a:B([a,s])),o.createHref({pathname:u,search:c,hash:i})}function Ke(){return null!=e.useContext(Ne)}function $e(){return Ke()||l(!1),e.useContext(Ne).location}function He(){return e.useContext(Ne).navigationType}function Je(t){Ke()||l(!1);let{pathname:r}=$e();return e.useMemo((()=>L(t,r)),[r,t])}function qe(t){e.useContext(Fe).static||e.useLayoutEffect(t)}function Ye(){let{isDataRoute:t}=e.useContext(Ie);return t?function(){let{router:t}=ct(lt.UseNavigateStable),r=dt(st.UseNavigateStable),n=e.useRef(!1);return qe((()=>{n.current=!0})),e.useCallback((function(e,a){void 0===a&&(a={}),n.current&&("number"==typeof e?t.navigate(e):t.navigate(e,Oe({fromRouteId:r},a)))}),[t,r])}():function(){Ke()||l(!1);let{basename:t,navigator:r}=e.useContext(Fe),{matches:n}=e.useContext(Ie),{pathname:a}=$e(),o=JSON.stringify(j(n).map((e=>e.pathnameBase))),i=e.useRef(!1);return qe((()=>{i.current=!0})),e.useCallback((function(e,n){if(void 0===n&&(n={}),!i.current)return;if("number"==typeof e)return void r.go(e);let l=T(e,JSON.parse(o),a,"path"===n.relative);"/"!==t&&(l.pathname="/"===l.pathname?t:B([t,l.pathname])),(n.replace?r.replace:r.push)(l,n.state,n)}),[t,r,o,a])}()}const Ve=e.createContext(null);function Xe(){return e.useContext(Ve)}function Ge(t){let r=e.useContext(Ie).outlet;return r?e.createElement(Ve.Provider,{value:t},r):r}function Qe(){let{matches:t}=e.useContext(Ie),r=t[t.length-1];return r?r.params:{}}function Ze(t,r){let{relative:n}=void 0===r?{}:r,{matches:a}=e.useContext(Ie),{pathname:o}=$e(),i=JSON.stringify(j(a).map((e=>e.pathnameBase)));return e.useMemo((()=>T(t,JSON.parse(i),o,"path"===n)),[t,i,o,n])}function et(e,t){return tt(e,t)}function tt(t,n,a){Ke()||l(!1);let{navigator:o}=e.useContext(Fe),{matches:i}=e.useContext(Ie),s=i[i.length-1],c=s?s.params:{};!s||s.pathname;let u=s?s.pathnameBase:"/";s&&s.route;let d,f=$e();if(n){var p;let e="string"==typeof n?h(n):n;"/"===u||(null==(p=e.pathname)?void 0:p.startsWith(u))||l(!1),d=e}else d=f;let m=d.pathname||"/",v=g(t,{pathname:"/"===u?m:m.slice(u.length)||"/"}),y=it(v&&v.map((e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:B([u,o.encodeLocation?o.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?u:B([u,o.encodeLocation?o.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),i,a);return n&&y?e.createElement(Ne.Provider,{value:{location:Oe({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:r.Pop}},y):y}function rt(){let t=bt(),r=Y(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return e.createElement(e.Fragment,null,e.createElement("h2",null,"Unexpected Application Error!"),e.createElement("h3",{style:{fontStyle:"italic"}},r),n?e.createElement("pre",{style:a},n):null,null)}const nt=e.createElement(rt,null);class at 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:e.error||t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error?e.createElement(Ie.Provider,{value:this.props.routeContext},e.createElement(ze.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ot(t){let{routeContext:r,match:n,children:a}=t,o=e.useContext(je);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),e.createElement(Ie.Provider,{value:r},a)}function it(t,r,n){var a;if(void 0===r&&(r=[]),void 0===n&&(n=null),null==t){var o;if(null==(o=n)||!o.errors)return null;t=n.matches}let i=t,s=null==(a=n)?void 0:a.errors;if(null!=s){let e=i.findIndex((e=>e.route.id&&(null==s?void 0:s[e.route.id])));e>=0||l(!1),i=i.slice(0,Math.min(i.length,e+1))}return i.reduceRight(((t,a,o)=>{let l=a.route.id?null==s?void 0:s[a.route.id]:null,c=null;n&&(c=a.route.errorElement||nt);let u=r.concat(i.slice(0,o+1)),d=()=>{let r;return r=l?c:a.route.Component?e.createElement(a.route.Component,null):a.route.element?a.route.element:t,e.createElement(ot,{match:a,routeContext:{outlet:t,matches:u,isDataRoute:null!=n},children:r})};return n&&(a.route.ErrorBoundary||a.route.errorElement||0===o)?e.createElement(at,{location:n.location,revalidation:n.revalidation,component:c,error:l,children:d(),routeContext:{outlet:null,matches:u,isDataRoute:!0}}):d()}),null)}var lt,st;function ct(t){let r=e.useContext(je);return r||l(!1),r}function ut(t){let r=e.useContext(Te);return r||l(!1),r}function dt(t){let r=function(t){let r=e.useContext(Ie);return r||l(!1),r}(),n=r.matches[r.matches.length-1];return n.route.id||l(!1),n.route.id}function ht(){return dt(st.UseRouteId)}function ft(){return ut(st.UseNavigation).navigation}function pt(){let e=ct(lt.UseRevalidator),t=ut(st.UseRevalidator);return{revalidate:e.router.revalidate,state:t.revalidation}}function mt(){let{matches:t,loaderData:r}=ut(st.UseMatches);return e.useMemo((()=>t.map((e=>{let{pathname:t,params:n}=e;return{id:e.route.id,pathname:t,params:n,data:r[e.route.id],handle:e.route.handle}}))),[t,r])}function vt(){let e=ut(st.UseLoaderData),t=dt(st.UseLoaderData);if(!e.errors||null==e.errors[t])return e.loaderData[t];console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")")}function gt(e){return ut(st.UseRouteLoaderData).loaderData[e]}function yt(){let t=ut(st.UseActionData);return e.useContext(Ie)||l(!1),Object.values((null==t?void 0:t.actionData)||{})[0]}function bt(){var t;let r=e.useContext(ze),n=ut(st.UseRouteError),a=dt(st.UseRouteError);return r||(null==(t=n.errors)?void 0:t[a])}function wt(){let t=e.useContext(Be);return null==t?void 0:t._data}function Et(){let t=e.useContext(Be);return null==t?void 0:t._error}!function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate"}(lt||(lt={})),function(e){e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId"}(st||(st={}));let Rt=0;function Dt(t){let{router:r}=ct(lt.UseBlocker),n=ut(st.UseBlocker),[a]=e.useState((()=>String(++Rt))),o=e.useCallback((e=>"function"==typeof t?!!t(e):!!t),[t]),i=r.getBlocker(a,o);return e.useEffect((()=>()=>r.deleteBlocker(a)),[r,a]),n.blockers.get(a)||i}function St(t){let{fallbackElement:r,router:n}=t,[a,o]=e.useState(n.state);e.useLayoutEffect((()=>n.subscribe(o)),[n,o]);let i=e.useMemo((()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:e=>n.navigate(e),push:(e,t,r)=>n.navigate(e,{state:t,preventScrollReset:null==r?void 0:r.preventScrollReset}),replace:(e,t,r)=>n.navigate(e,{replace:!0,state:t,preventScrollReset:null==r?void 0:r.preventScrollReset})})),[n]),l=n.basename||"/",s=e.useMemo((()=>({router:n,navigator:i,static:!1,basename:l})),[n,i,l]);return e.createElement(e.Fragment,null,e.createElement(je.Provider,{value:s},e.createElement(Te.Provider,{value:a},e.createElement(Lt,{basename:n.basename,location:n.state.location,navigationType:n.state.historyAction,navigator:i},n.state.initialized?e.createElement(xt,{routes:n.routes,state:a}):r))),null)}function xt(e){let{routes:t,state:r}=e;return tt(t,void 0,r)}function Ct(t){let{basename:r,children:n,initialEntries:o,initialIndex:i}=t,l=e.useRef();null==l.current&&(l.current=a({initialEntries:o,initialIndex:i,v5Compat:!0}));let s=l.current,[c,u]=e.useState({action:s.action,location:s.location});return e.useLayoutEffect((()=>s.listen(u)),[s]),e.createElement(Lt,{basename:r,children:n,location:c.location,navigationType:c.action,navigator:s})}function At(t){let{to:r,replace:n,state:a,relative:o}=t;Ke()||l(!1);let{matches:i}=e.useContext(Ie),{pathname:s}=$e(),c=Ye(),u=T(r,j(i).map((e=>e.pathnameBase)),s,"path"===o),d=JSON.stringify(u);return e.useEffect((()=>c(JSON.parse(d),{replace:n,state:a,relative:o})),[c,d,o,n,a]),null}function Pt(e){return Ge(e.context)}function kt(e){l(!1)}function Lt(t){let{basename:n="/",children:a=null,location:o,navigationType:i=r.Pop,navigator:s,static:c=!1}=t;Ke()&&l(!1);let u=n.replace(/^\/*/,"/"),d=e.useMemo((()=>({basename:u,navigator:s,static:c})),[u,s,c]);"string"==typeof o&&(o=h(o));let{pathname:f="/",search:p="",hash:m="",state:v=null,key:g="default"}=o,y=e.useMemo((()=>{let e=M(f,u);return null==e?null:{location:{pathname:e,search:p,hash:m,state:v,key:g},navigationType:i}}),[u,f,p,m,v,g,i]);return null==y?null:e.createElement(Fe.Provider,{value:d},e.createElement(Ne.Provider,{children:a,value:y}))}function Ut(e){let{children:t,location:r}=e;return et(Bt(t),r)}function Mt(t){let{children:r,errorElement:n,resolve:a}=t;return e.createElement(jt,{resolve:a,errorElement:n},e.createElement(Tt,null,r))}var _t;!function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"}(_t||(_t={}));const Ot=new Promise((()=>{}));class jt extends e.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("<Await> caught the following error during render",e,t)}render(){let{children:t,errorElement:r,resolve:n}=this.props,a=null,o=_t.pending;if(n instanceof Promise)if(this.state.error){o=_t.error;let e=this.state.error;a=Promise.reject().catch((()=>{})),Object.defineProperty(a,"_tracked",{get:()=>!0}),Object.defineProperty(a,"_error",{get:()=>e})}else n._tracked?(a=n,o=void 0!==a._error?_t.error:void 0!==a._data?_t.success:_t.pending):(o=_t.pending,Object.defineProperty(n,"_tracked",{get:()=>!0}),a=n.then((e=>Object.defineProperty(n,"_data",{get:()=>e})),(e=>Object.defineProperty(n,"_error",{get:()=>e}))));else o=_t.success,a=Promise.resolve(),Object.defineProperty(a,"_tracked",{get:()=>!0}),Object.defineProperty(a,"_data",{get:()=>n});if(o===_t.error&&a._error instanceof W)throw Ot;if(o===_t.error&&!r)throw a._error;if(o===_t.error)return e.createElement(Be.Provider,{value:a,children:r});if(o===_t.success)return e.createElement(Be.Provider,{value:a,children:t});throw a}}function Tt(t){let{children:r}=t,n=wt(),a="function"==typeof r?r(n):r;return e.createElement(e.Fragment,null,a)}function Bt(t,r){void 0===r&&(r=[]);let n=[];return e.Children.forEach(t,((t,a)=>{if(!e.isValidElement(t))return;let o=[...r,a];if(t.type===e.Fragment)return void n.push.apply(n,Bt(t.props.children,o));t.type!==kt&&l(!1),t.props.index&&t.props.children&&l(!1);let i={id:t.props.id||o.join("-"),caseSensitive:t.props.caseSensitive,element:t.props.element,Component:t.props.Component,index:t.props.index,path:t.props.path,loader:t.props.loader,action:t.props.action,errorElement:t.props.errorElement,ErrorBoundary:t.props.ErrorBoundary,hasErrorBoundary:null!=t.props.ErrorBoundary||null!=t.props.errorElement,shouldRevalidate:t.props.shouldRevalidate,handle:t.props.handle,lazy:t.props.lazy};t.props.children&&(i.children=Bt(t.props.children,o)),n.push(i)})),n}function Ft(e){return it(e)}function Nt(t){let r={hasErrorBoundary:null!=t.ErrorBoundary||null!=t.errorElement};return t.Component&&Object.assign(r,{element:e.createElement(t.Component),Component:void 0}),t.ErrorBoundary&&Object.assign(r,{errorElement:e.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),r}function It(e,t){return se({basename:null==t?void 0:t.basename,future:Oe({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:a({initialEntries:null==t?void 0:t.initialEntries,initialIndex:null==t?void 0:t.initialIndex}),hydrationData:null==t?void 0:t.hydrationData,routes:e,mapRouteProperties:Nt}).initialize()}
23
23
  /**
24
- * React Router DOM v6.10.0
24
+ * React Router DOM v6.11.1
25
25
  *
26
26
  * Copyright (c) Remix Software Inc.
27
27
  *
@@ -29,5 +29,5 @@ import*as e from"react";
29
29
  * LICENSE.md file in the root directory of this source tree.
30
30
  *
31
31
  * @license MIT
32
- */function Kt(){return Kt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Kt.apply(this,arguments)}function $t(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}const Ht="get",qt="application/x-www-form-urlencoded";function Jt(e){return null!=e&&"string"==typeof e.tagName}function Yt(e){return void 0===e&&(e=""),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]])}),[]))}function Vt(e,t,r){let n,o,a,i;if(Jt(l=e)&&"form"===l.tagName.toLowerCase()){let l=r.submissionTrigger;n=r.method||e.getAttribute("method")||Ht,o=r.action||e.getAttribute("action")||t,a=r.encType||e.getAttribute("enctype")||qt,i=new FormData(e),l&&l.name&&i.append(l.name,l.value)}else if(function(e){return Jt(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return Jt(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let l=e.form;if(null==l)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');n=r.method||e.getAttribute("formmethod")||l.getAttribute("method")||Ht,o=r.action||e.getAttribute("formaction")||l.getAttribute("action")||t,a=r.encType||e.getAttribute("formenctype")||l.getAttribute("enctype")||qt,i=new FormData(l),e.name&&i.append(e.name,e.value)}else{if(Jt(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');if(n=r.method||Ht,o=r.action||t,a=r.encType||qt,e instanceof FormData)i=e;else if(i=new FormData,e instanceof URLSearchParams)for(let[t,r]of e)i.append(t,r);else if(null!=e)for(let t of Object.keys(e))i.append(t,e[t])}var l;let{protocol:s,host:c}=window.location;return{url:new URL(o,s+"//"+c),method:n.toLowerCase(),encType:a,formData:i}}const Xt=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],Gt=["aria-current","caseSensitive","className","end","style","to","children"],Qt=["reloadDocument","replace","method","action","onSubmit","fetcherKey","routeId","relative","preventScrollReset"];function Zt(e,t){return se({basename:null==t?void 0:t.basename,future:null==t?void 0:t.future,history:a({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||tr(),routes:e,detectErrorBoundary:zt}).initialize()}function er(e,t){return se({basename:null==t?void 0:t.basename,future:null==t?void 0:t.future,history:i({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||tr(),routes:e,detectErrorBoundary:zt}).initialize()}function tr(){var e;let t=null==(e=window)?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Kt({},t,{errors:rr(t.errors)})),t}function rr(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 J(n.status,n.statusText,n.data,!0===n.internal);else if(n&&"Error"===n.__type){let t=new Error(n.message);t.stack="",r[e]=t}else r[e]=n;return r}function nr(t){let{basename:r,children:n,window:o}=t,i=e.useRef();null==i.current&&(i.current=a({window:o,v5Compat:!0}));let l=i.current,[s,c]=e.useState({action:l.action,location:l.location});return e.useLayoutEffect((()=>l.listen(c)),[l]),e.createElement(Mt,{basename:r,children:n,location:s.location,navigationType:s.action,navigator:l})}function or(t){let{basename:r,children:n,window:o}=t,a=e.useRef();null==a.current&&(a.current=i({window:o,v5Compat:!0}));let l=a.current,[s,c]=e.useState({action:l.action,location:l.location});return e.useLayoutEffect((()=>l.listen(c)),[l]),e.createElement(Mt,{basename:r,children:n,location:s.location,navigationType:s.action,navigator:l})}function ar(t){let{basename:r,children:n,history:o}=t;const[a,i]=e.useState({action:o.action,location:o.location});return e.useLayoutEffect((()=>o.listen(i)),[o]),e.createElement(Mt,{basename:r,children:n,location:a.location,navigationType:a.action,navigator:o})}const ir="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,lr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,sr=e.forwardRef((function(t,r){let n,{onClick:o,relative:a,reloadDocument:i,replace:l,state:s,target:c,to:u,preventScrollReset:d}=t,h=$t(t,Xt),{basename:f}=e.useContext($e),p=!1;if("string"==typeof u&&lr.test(u)&&(n=u,ir)){let e=new URL(window.location.href),t=u.startsWith("//")?new URL(e.protocol+u):new URL(u),r=M(t.pathname,f);t.origin===e.origin&&null!=r?u=r+t.search+t.hash:p=!0}let m=Ve(u,{relative:a}),v=gr(u,{replace:l,state:s,target:c,preventScrollReset:d,relative:a});return e.createElement("a",Kt({},h,{href:n||m,onClick:p||i?o:function(e){o&&o(e),e.defaultPrevented||v(e)},ref:r,target:c}))})),cr=e.forwardRef((function(t,r){let{"aria-current":n="page",caseSensitive:o=!1,className:a="",end:i=!1,style:l,to:s,children:c}=t,u=$t(t,Gt),d=at(s,{relative:u.relative}),h=Ge(),f=e.useContext(We),{navigator:p}=e.useContext($e),m=p.encodeLocation?p.encodeLocation(d).pathname:d.pathname,v=h.pathname,g=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;o||(v=v.toLowerCase(),g=g?g.toLowerCase():null,m=m.toLowerCase());let y,b=v===m||!i&&v.startsWith(m)&&"/"===v.charAt(m.length),w=null!=g&&(g===m||!i&&g.startsWith(m)&&"/"===g.charAt(m.length)),E=b?n:void 0;y="function"==typeof a?a({isActive:b,isPending:w}):[a,b?"active":null,w?"pending":null].filter(Boolean).join(" ");let R="function"==typeof l?l({isActive:b,isPending:w}):l;return e.createElement(sr,Kt({},u,{"aria-current":E,className:y,ref:r,style:R,to:s}),"function"==typeof c?c({isActive:b,isPending:w}):c)})),ur=e.forwardRef(((t,r)=>e.createElement(dr,Kt({},t,{ref:r})))),dr=e.forwardRef(((t,r)=>{let{reloadDocument:n,replace:o,method:a=Ht,action:i,onSubmit:l,fetcherKey:s,routeId:c,relative:u,preventScrollReset:d}=t,h=$t(t,Qt),f=wr(s,c),p="get"===a.toLowerCase()?"get":"post",m=Er(i,{relative:u});return e.createElement("form",Kt({ref:r,method:p,action:m,onSubmit:n?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let t=e.nativeEvent.submitter,r=(null==t?void 0:t.getAttribute("formmethod"))||a;f(t||e.currentTarget,{method:r,replace:o,relative:u,preventScrollReset:d})}},h))}));function hr(e){let{getKey:t,storageKey:r}=e;return Ar({getKey:t,storageKey:r}),null}var fr,pr;function mr(t){let r=e.useContext(ze);return r||l(!1),r}function vr(t){let r=e.useContext(We);return r||l(!1),r}function gr(t,r){let{target:n,replace:o,state:a,preventScrollReset:i,relative:l}=void 0===r?{}:r,s=et(),c=Ge(),u=at(t,{relative:l});return e.useCallback((e=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(e,n)){e.preventDefault();let r=void 0!==o?o:d(c)===d(u);s(t,{replace:r,state:a,preventScrollReset:i,relative:l})}}),[c,s,u,o,a,n,t,i,l])}function yr(t){let r=e.useRef(Yt(t)),n=e.useRef(!1),o=Ge(),a=e.useMemo((()=>function(e,t){let r=Yt(e);if(t)for(let e of t.keys())r.has(e)||t.getAll(e).forEach((t=>{r.append(e,t)}));return r}(o.search,n.current?null:r.current)),[o.search]),i=et(),l=e.useCallback(((e,t)=>{const r=Yt("function"==typeof e?e(a):e);n.current=!0,i("?"+r,t)}),[i,a]);return[a,l]}function br(){return wr()}function wr(t,r){let{router:n}=mr(fr.UseSubmitImpl),o=Er();return e.useCallback((function(e,a){if(void 0===a&&(a={}),"undefined"==typeof document)throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.");let{method:i,encType:s,formData:c,url:u}=Vt(e,o,a),d=u.pathname+u.search,h={replace:a.replace,preventScrollReset:a.preventScrollReset,formData:c,formMethod:i,formEncType:s};t?(null==r&&l(!1),n.fetch(t,r,d,h)):n.navigate(d,h)}),[o,n,t,r])}function Er(t,r){let{relative:n}=void 0===r?{}:r,{basename:o}=e.useContext($e),a=e.useContext(qe);a||l(!1);let[i]=a.matches.slice(-1),s=Kt({},at(t||".",{relative:n})),c=Ge();if(null==t&&(s.search=c.search,s.hash=c.hash,i.route.index)){let e=new URLSearchParams(s.search);e.delete("index"),s.search=e.toString()?"?"+e.toString():""}return t&&"."!==t||!i.route.index||(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),"/"!==o&&(s.pathname="/"===s.pathname?o:B([o,s.pathname])),d(s)}!function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmitImpl="useSubmitImpl",e.UseFetcher="useFetcher"}(fr||(fr={})),function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(pr||(pr={}));let Rr=0;function Sr(){var t;let{router:r}=mr(fr.UseFetcher),n=e.useContext(qe);n||l(!1);let o=null==(t=n.matches[n.matches.length-1])?void 0:t.route.id;null==o&&l(!1);let[a]=e.useState((()=>String(++Rr))),[i]=e.useState((()=>(o||l(!1),function(t,r){return e.forwardRef(((n,o)=>e.createElement(dr,Kt({},n,{ref:o,fetcherKey:t,routeId:r}))))}(a,o)))),[s]=e.useState((()=>e=>{r||l(!1),o||l(!1),r.fetch(a,o,e)})),c=wr(a,o),u=r.getFetcher(a),d=e.useMemo((()=>Kt({Form:i,submit:c,load:s},u)),[u,i,c,s]);return e.useEffect((()=>()=>{r?r.deleteFetcher(a):console.warn("No fetcher available to clean up from useFetcher()")}),[r,a]),d}function Dr(){return[...vr(pr.UseFetchers).fetchers.values()]}const xr="react-router-scroll-positions";let Cr={};function Ar(t){let{getKey:r,storageKey:n}=void 0===t?{}:t,{router:o}=mr(fr.UseScrollRestoration),{restoreScrollPosition:a,preventScrollReset:i}=vr(pr.UseScrollRestoration),l=Ge(),s=yt(),c=vt();e.useEffect((()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"})),[]),function(t,r){let{capture:n}=r||{};e.useEffect((()=>{let e=null!=n?{capture:n}:void 0;return window.addEventListener("pagehide",t,e),()=>{window.removeEventListener("pagehide",t,e)}}),[t,n])}(e.useCallback((()=>{if("idle"===c.state){let e=(r?r(l,s):null)||l.key;Cr[e]=window.scrollY}sessionStorage.setItem(n||xr,JSON.stringify(Cr)),window.history.scrollRestoration="auto"}),[n,r,c.state,l,s])),"undefined"!=typeof document&&(e.useLayoutEffect((()=>{try{let e=sessionStorage.getItem(n||xr);e&&(Cr=JSON.parse(e))}catch(e){}}),[n]),e.useLayoutEffect((()=>{let e=null==o?void 0:o.enableScrollRestoration(Cr,(()=>window.scrollY),r);return()=>e&&e()}),[o,r]),e.useLayoutEffect((()=>{if(!1!==a)if("number"!=typeof a){if(l.hash){let e=document.getElementById(l.hash.slice(1));if(e)return void e.scrollIntoView()}!0!==i&&window.scrollTo(0,0)}else window.scrollTo(0,a)}),[l,a,i]))}function Pr(t,r){let{capture:n}=r||{};e.useEffect((()=>{let e=null!=n?{capture:n}:void 0;return window.addEventListener("beforeunload",t,e),()=>{window.removeEventListener("beforeunload",t,e)}}),[t,n])}function kr(t){let{when:r,message:n}=t,o=Ct(r);e.useEffect((()=>{"blocked"!==o.state||r||o.reset()}),[o,r]),e.useEffect((()=>{if("blocked"===o.state){window.confirm(n)?setTimeout(o.proceed,0):o.reset()}}),[o,n])}export{W as AbortedDeferredError,jt as Await,nr as BrowserRouter,ur as Form,or as HashRouter,sr as Link,Pt as MemoryRouter,cr as NavLink,kt as Navigate,r as NavigationType,Lt as Outlet,Ut as Route,Mt as Router,At as RouterProvider,Ot as Routes,hr as ScrollRestoration,ze as UNSAFE_DataRouterContext,We as UNSAFE_DataRouterStateContext,He as UNSAFE_LocationContext,$e as UNSAFE_NavigationContext,qe as UNSAFE_RouteContext,Ar as UNSAFE_useScrollRestoration,Zt as createBrowserRouter,er as createHashRouter,Wt as createMemoryRouter,d as createPath,Nt as createRoutesFromChildren,Nt as createRoutesFromElements,Yt as createSearchParams,H as defer,k as generatePath,Y as isRouteErrorResponse,z as json,L as matchPath,g as matchRoutes,h as parsePath,q as redirect,It as renderMatches,O as resolvePath,ar as unstable_HistoryRouter,Ct as unstable_useBlocker,kr as unstable_usePrompt,Et as useActionData,Dt as useAsyncError,St as useAsyncValue,Pr as useBeforeUnload,Sr as useFetcher,Dr as useFetchers,Er as useFormAction,Ve as useHref,Xe as useInRouterContext,gr as useLinkClickHandler,bt as useLoaderData,Ge as useLocation,Ze as useMatch,yt as useMatches,et as useNavigate,vt as useNavigation,Qe as useNavigationType,nt as useOutlet,rt as useOutletContext,ot as useParams,at as useResolvedPath,gt as useRevalidator,Rt as useRouteError,wt as useRouteLoaderData,it as useRoutes,yr as useSearchParams,br as useSubmit};
32
+ */function zt(){return zt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zt.apply(this,arguments)}function Wt(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}const Kt="get",$t="application/x-www-form-urlencoded";function Ht(e){return null!=e&&"string"==typeof e.tagName}function Jt(e){return void 0===e&&(e=""),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]])}),[]))}function qt(e,t,r){let n,a,o,i=null;if(Ht(l=e)&&"form"===l.tagName.toLowerCase()){let l=t.submissionTrigger;if(t.action)i=t.action;else{let t=e.getAttribute("action");i=t?M(t,r):null}n=t.method||e.getAttribute("method")||Kt,a=t.encType||e.getAttribute("enctype")||$t,o=new FormData(e),l&&l.name&&o.append(l.name,l.value)}else if(function(e){return Ht(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return Ht(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let l=e.form;if(null==l)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');if(t.action)i=t.action;else{let t=e.getAttribute("formaction")||l.getAttribute("action");i=t?M(t,r):null}n=t.method||e.getAttribute("formmethod")||l.getAttribute("method")||Kt,a=t.encType||e.getAttribute("formenctype")||l.getAttribute("enctype")||$t,o=new FormData(l),e.name&&o.append(e.name,e.value)}else{if(Ht(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');if(n=t.method||Kt,i=t.action||null,a=t.encType||$t,e instanceof FormData)o=e;else if(o=new FormData,e instanceof URLSearchParams)for(let[t,r]of e)o.append(t,r);else if(null!=e)for(let t of Object.keys(e))o.append(t,e[t])}var l;return{action:i,method:n.toLowerCase(),encType:a,formData:o}}const Yt=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],Vt=["aria-current","caseSensitive","className","end","style","to","children"],Xt=["reloadDocument","replace","method","action","onSubmit","fetcherKey","routeId","relative","preventScrollReset"];function Gt(e,t){return se({basename:null==t?void 0:t.basename,future:zt({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:o({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||Zt(),routes:e,mapRouteProperties:Nt}).initialize()}function Qt(e,t){return se({basename:null==t?void 0:t.basename,future:zt({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:i({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||Zt(),routes:e,mapRouteProperties:Nt}).initialize()}function Zt(){var e;let t=null==(e=window)?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=zt({},t,{errors:er(t.errors)})),t}function er(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 q(n.status,n.statusText,n.data,!0===n.internal);else if(n&&"Error"===n.__type){let t=new Error(n.message);t.stack="",r[e]=t}else r[e]=n;return r}function tr(t){let{basename:r,children:n,window:a}=t,i=e.useRef();null==i.current&&(i.current=o({window:a,v5Compat:!0}));let l=i.current,[s,c]=e.useState({action:l.action,location:l.location});return e.useLayoutEffect((()=>l.listen(c)),[l]),e.createElement(Lt,{basename:r,children:n,location:s.location,navigationType:s.action,navigator:l})}function rr(t){let{basename:r,children:n,window:a}=t,o=e.useRef();null==o.current&&(o.current=i({window:a,v5Compat:!0}));let l=o.current,[s,c]=e.useState({action:l.action,location:l.location});return e.useLayoutEffect((()=>l.listen(c)),[l]),e.createElement(Lt,{basename:r,children:n,location:s.location,navigationType:s.action,navigator:l})}function nr(t){let{basename:r,children:n,history:a}=t;const[o,i]=e.useState({action:a.action,location:a.location});return e.useLayoutEffect((()=>a.listen(i)),[a]),e.createElement(Lt,{basename:r,children:n,location:o.location,navigationType:o.action,navigator:a})}const ar="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,or=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ir=e.forwardRef((function(t,r){let n,{onClick:a,relative:o,reloadDocument:i,replace:l,state:s,target:c,to:u,preventScrollReset:d}=t,h=Wt(t,Yt),{basename:f}=e.useContext(Fe),p=!1;if("string"==typeof u&&or.test(u)&&(n=u,ar))try{let e=new URL(window.location.href),t=u.startsWith("//")?new URL(e.protocol+u):new URL(u),r=M(t.pathname,f);t.origin===e.origin&&null!=r?u=r+t.search+t.hash:p=!0}catch(e){}let m=We(u,{relative:o}),v=mr(u,{replace:l,state:s,target:c,preventScrollReset:d,relative:o});return e.createElement("a",zt({},h,{href:n||m,onClick:p||i?a:function(e){a&&a(e),e.defaultPrevented||v(e)},ref:r,target:c}))})),lr=e.forwardRef((function(t,r){let{"aria-current":n="page",caseSensitive:a=!1,className:o="",end:i=!1,style:l,to:s,children:c}=t,u=Wt(t,Vt),d=Ze(s,{relative:u.relative}),h=$e(),f=e.useContext(Te),{navigator:p}=e.useContext(Fe),m=p.encodeLocation?p.encodeLocation(d).pathname:d.pathname,v=h.pathname,g=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;a||(v=v.toLowerCase(),g=g?g.toLowerCase():null,m=m.toLowerCase());let y,b=v===m||!i&&v.startsWith(m)&&"/"===v.charAt(m.length),w=null!=g&&(g===m||!i&&g.startsWith(m)&&"/"===g.charAt(m.length)),E=b?n:void 0;y="function"==typeof o?o({isActive:b,isPending:w}):[o,b?"active":null,w?"pending":null].filter(Boolean).join(" ");let R="function"==typeof l?l({isActive:b,isPending:w}):l;return e.createElement(ir,zt({},u,{"aria-current":E,className:y,ref:r,style:R,to:s}),"function"==typeof c?c({isActive:b,isPending:w}):c)})),sr=e.forwardRef(((t,r)=>e.createElement(cr,zt({},t,{ref:r})))),cr=e.forwardRef(((t,r)=>{let{reloadDocument:n,replace:a,method:o=Kt,action:i,onSubmit:l,fetcherKey:s,routeId:c,relative:u,preventScrollReset:d}=t,h=Wt(t,Xt),f=yr(s,c),p="get"===o.toLowerCase()?"get":"post",m=br(i,{relative:u});return e.createElement("form",zt({ref:r,method:p,action:m,onSubmit:n?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let t=e.nativeEvent.submitter,r=(null==t?void 0:t.getAttribute("formmethod"))||o;f(t||e.currentTarget,{method:r,replace:a,relative:u,preventScrollReset:d})}},h))}));function ur(e){let{getKey:t,storageKey:r}=e;return xr({getKey:t,storageKey:r}),null}var dr,hr;function fr(t){let r=e.useContext(je);return r||l(!1),r}function pr(t){let r=e.useContext(Te);return r||l(!1),r}function mr(t,r){let{target:n,replace:a,state:o,preventScrollReset:i,relative:l}=void 0===r?{}:r,s=Ye(),c=$e(),u=Ze(t,{relative:l});return e.useCallback((e=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(e,n)){e.preventDefault();let r=void 0!==a?a:d(c)===d(u);s(t,{replace:r,state:o,preventScrollReset:i,relative:l})}}),[c,s,u,a,o,n,t,i,l])}function vr(t){let r=e.useRef(Jt(t)),n=e.useRef(!1),a=$e(),o=e.useMemo((()=>function(e,t){let r=Jt(e);if(t)for(let e of t.keys())r.has(e)||t.getAll(e).forEach((t=>{r.append(e,t)}));return r}(a.search,n.current?null:r.current)),[a.search]),i=Ye(),l=e.useCallback(((e,t)=>{const r=Jt("function"==typeof e?e(o):e);n.current=!0,i("?"+r,t)}),[i,o]);return[o,l]}function gr(){return yr()}function yr(t,r){let{router:n}=fr(dr.UseSubmitImpl),{basename:a}=e.useContext(Fe),o=ht();return e.useCallback((function(e,i){if(void 0===i&&(i={}),"undefined"==typeof document)throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.");let{action:s,method:c,encType:u,formData:d}=qt(e,i,a),h={preventScrollReset:i.preventScrollReset,formData:d,formMethod:c,formEncType:u};t?(null==r&&l(!1),n.fetch(t,r,s,h)):n.navigate(s,zt({},h,{replace:i.replace,fromRouteId:o}))}),[n,a,t,r,o])}function br(t,r){let{relative:n}=void 0===r?{}:r,{basename:a}=e.useContext(Fe),o=e.useContext(Ie);o||l(!1);let[i]=o.matches.slice(-1),s=zt({},Ze(t||".",{relative:n})),c=$e();if(null==t&&(s.search=c.search,s.hash=c.hash,i.route.index)){let e=new URLSearchParams(s.search);e.delete("index"),s.search=e.toString()?"?"+e.toString():""}return t&&"."!==t||!i.route.index||(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),"/"!==a&&(s.pathname="/"===s.pathname?a:B([a,s.pathname])),d(s)}!function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmitImpl="useSubmitImpl",e.UseFetcher="useFetcher"}(dr||(dr={})),function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(hr||(hr={}));let wr=0;function Er(){var t;let{router:r}=fr(dr.UseFetcher),n=e.useContext(Ie);n||l(!1);let a=null==(t=n.matches[n.matches.length-1])?void 0:t.route.id;null==a&&l(!1);let[o]=e.useState((()=>String(++wr))),[i]=e.useState((()=>(a||l(!1),function(t,r){return e.forwardRef(((n,a)=>e.createElement(cr,zt({},n,{ref:a,fetcherKey:t,routeId:r}))))}(o,a)))),[s]=e.useState((()=>e=>{r||l(!1),a||l(!1),r.fetch(o,a,e)})),c=yr(o,a),u=r.getFetcher(o),d=e.useMemo((()=>zt({Form:i,submit:c,load:s},u)),[u,i,c,s]);return e.useEffect((()=>()=>{r?r.deleteFetcher(o):console.warn("No router available to clean up from useFetcher()")}),[r,o]),d}function Rr(){return[...pr(hr.UseFetchers).fetchers.values()]}const Dr="react-router-scroll-positions";let Sr={};function xr(t){let{getKey:r,storageKey:n}=void 0===t?{}:t,{router:a}=fr(dr.UseScrollRestoration),{restoreScrollPosition:o,preventScrollReset:i}=pr(hr.UseScrollRestoration),l=$e(),s=mt(),c=ft();e.useEffect((()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"})),[]),function(t,r){let{capture:n}=r||{};e.useEffect((()=>{let e=null!=n?{capture:n}:void 0;return window.addEventListener("pagehide",t,e),()=>{window.removeEventListener("pagehide",t,e)}}),[t,n])}(e.useCallback((()=>{if("idle"===c.state){let e=(r?r(l,s):null)||l.key;Sr[e]=window.scrollY}sessionStorage.setItem(n||Dr,JSON.stringify(Sr)),window.history.scrollRestoration="auto"}),[n,r,c.state,l,s])),"undefined"!=typeof document&&(e.useLayoutEffect((()=>{try{let e=sessionStorage.getItem(n||Dr);e&&(Sr=JSON.parse(e))}catch(e){}}),[n]),e.useLayoutEffect((()=>{let e=null==a?void 0:a.enableScrollRestoration(Sr,(()=>window.scrollY),r);return()=>e&&e()}),[a,r]),e.useLayoutEffect((()=>{if(!1!==o)if("number"!=typeof o){if(l.hash){let e=document.getElementById(l.hash.slice(1));if(e)return void e.scrollIntoView()}!0!==i&&window.scrollTo(0,0)}else window.scrollTo(0,o)}),[l,o,i]))}function Cr(t,r){let{capture:n}=r||{};e.useEffect((()=>{let e=null!=n?{capture:n}:void 0;return window.addEventListener("beforeunload",t,e),()=>{window.removeEventListener("beforeunload",t,e)}}),[t,n])}function Ar(t){let{when:r,message:n}=t,a=Dt(r);e.useEffect((()=>{"blocked"!==a.state||r||a.reset()}),[a,r]),e.useEffect((()=>{if("blocked"===a.state){window.confirm(n)?setTimeout(a.proceed,0):a.reset()}}),[a,n])}export{W as AbortedDeferredError,Mt as Await,tr as BrowserRouter,sr as Form,rr as HashRouter,ir as Link,Ct as MemoryRouter,lr as NavLink,At as Navigate,r as NavigationType,Pt as Outlet,kt as Route,Lt as Router,St as RouterProvider,Ut as Routes,ur as ScrollRestoration,je as UNSAFE_DataRouterContext,Te as UNSAFE_DataRouterStateContext,Ne as UNSAFE_LocationContext,Fe as UNSAFE_NavigationContext,Ie as UNSAFE_RouteContext,ht as UNSAFE_useRouteId,xr as UNSAFE_useScrollRestoration,Gt as createBrowserRouter,Qt as createHashRouter,It as createMemoryRouter,d as createPath,Bt as createRoutesFromChildren,Bt as createRoutesFromElements,Jt as createSearchParams,H as defer,k as generatePath,Y as isRouteErrorResponse,z as json,L as matchPath,g as matchRoutes,h as parsePath,J as redirect,Ft as renderMatches,_ as resolvePath,nr as unstable_HistoryRouter,Dt as unstable_useBlocker,Ar as unstable_usePrompt,yt as useActionData,Et as useAsyncError,wt as useAsyncValue,Cr as useBeforeUnload,Er as useFetcher,Rr as useFetchers,br as useFormAction,We as useHref,Ke as useInRouterContext,mr as useLinkClickHandler,vt as useLoaderData,$e as useLocation,Je as useMatch,mt as useMatches,Ye as useNavigate,ft as useNavigation,He as useNavigationType,Ge as useOutlet,Xe as useOutletContext,Qe as useParams,Ze as useResolvedPath,pt as useRevalidator,bt as useRouteError,gt as useRouteLoaderData,et as useRoutes,vr as useSearchParams,gr as useSubmit};
33
33
  //# sourceMappingURL=react-router-dom.production.min.js.map