@hitachivantara/app-shell-vite-plugin 0.9.1 → 0.10.0

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
- /* @preserve react-router-dom@6.11.2 esm bundle generated by Hitachi Vantara - Boba Fett team */
1
+ /* @preserve react-router-dom@6.14.2 esm bundle generated by Hitachi Vantara - Boba Fett team */
2
2
  import*as e from"react";
3
3
  /**
4
- * @remix-run/router v1.6.2
4
+ * @remix-run/router v1.7.2
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 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(C.initialized&&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){o={},a=v(e,n,void 0,o)}},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]}
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=y();function y(){return(f.state||{idx:null}).idx}function g(){p=r.Pop;let e=y(),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,g),m=e,()=>{s.removeEventListener(n,g),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=y()+1;let o=c(n,v),i=w.createHref(n);try{f.pushState(o,"",i)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw 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=y();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,r(e),{id:s});return o[s]=n,n}{let n=t({},e,r(e),{id:s,children:void 0});return o[s]=n,e.children&&(n.children=v(e.children,r,i,o)),n}}))}function y(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=g(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 g(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+'".'),g(e.children,t,c,s)),(null!=e.path||e.index)&&t.push({path:s,score:k(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,x=1,S=10,D=-2,C=e=>"*"===e;function k(e,t){let r=e.split("/"),n=r.length;return r.some(C)&&(n+=D),t&&(n+=R),r.filter((e=>!C(e))).reduce(((e,t)=>e+(w.test(t)?E:""===t?x:S)),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=A({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 L(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(/\*$/,"/*"));const n=r.startsWith("/")?"/":"",o=e=>null==e?"":"string"==typeof e?e:String(e);return n+r.split(/\/+/).map(((e,r,n)=>{if(r===n.length-1&&"*"===e){return o(t["*"])}const a=e.match(/^:(\w+)(\??)$/);if(a){const[,e,r]=a;let n=t[e];return l("?"===r||null!=n,'Missing ":'+e+'" param'),o(n)}return e.replace(/\?$/g,"")})).filter((e=>!!e)).join("/")}function A(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 j(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 T(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 _(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function O(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("?"),T("?","pathname","search",a)),l(!a.pathname||!a.pathname.includes("#"),T("#","pathname","hash",a)),l(!a.search||!a.search.includes("#"),T("#","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=j(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 ${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,void 0,t)),(t=>this.onSettle(r,e,t)));return r.catch((()=>{})),Object.defineProperty(r,"_tracked",{get:()=>!0}),r}onSettle(e,t,r,n){if(this.controller.signal.aborted&&r instanceof W)return this.unlistenAbortSignal(),Object.defineProperty(e,"_error",{get:()=>r}),Promise.reject(r);if(this.pendingKeysSet.delete(t),this.done&&this.unlistenAbortSignal(),void 0===r&&void 0===n){let r=new Error('Deferred data for key "'+t+'" resolved/rejected with `undefined`, you must resolve/reject with a value or `null`.');return Object.defineProperty(e,"_error",{get:()=>r}),this.emit(!1,t),Promise.reject(r)}return void 0===n?(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]:K(n)})}),{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function K(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 $(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,json:void 0,text:void 0},re={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ne={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},oe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ae=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)});function ie(e){const n=e.window?e.window:"undefined"!=typeof window?window:void 0,o=void 0!==n&&void 0!==n.document&&void 0!==n.document.createElement,a=!o;let i;if(l(e.routes.length>0,"You must provide a non-empty routes array to createRouter"),e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let t=e.detectErrorBoundary;i=e=>({hasErrorBoundary:t(e)})}else i=ae;let c,d={},h=v(e.routes,i,void 0,d),f=e.basename||"/",m=t({v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),g=null,b=new Set,w=null,E=null,R=null,x=null!=e.hydrationData,S=y(h,e.history.location,f),D=null;if(null==S){let t=Ee(404,{pathname:e.history.location.pathname}),{matches:r,route:n}=we(h);S=r,D={[n.id]:t}}let C,k,P=!(S.some((e=>e.route.lazy))||S.some((e=>e.route.loader))&&null==e.hydrationData),L={historyAction:e.history.action,location:e.history.location,matches:S,initialized:P,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||D,fetchers:new Map,blockers:new Map},A=r.Pop,U=!1,j=!1,T=!1,_=[],O=[],B=new Map,F=0,N=-1,I=new Map,z=new Set,W=new Map,$=new Map,K=new Map,H=!1;function q(e){L=t({},L,e),b.forEach((e=>e(L)))}function J(n,o){var a,i;let l,s=null!=L.actionData&&null!=L.navigation.formMethod&&ke(L.navigation.formMethod)&&"loading"===L.navigation.state&&!0!==(null==(a=n.state)?void 0:a._isRedirect);l=o.actionData?Object.keys(o.actionData).length>0?o.actionData:null:s?L.actionData:null;let u=o.loaderData?ge(L.loaderData,o.loaderData,o.matches||[],o.errors):L.loaderData,d=L.blockers;d.size>0&&(d=new Map(d),d.forEach(((e,t)=>d.set(t,ne))));let f=!0===U||null!=L.navigation.formMethod&&ke(L.navigation.formMethod)&&!0!==(null==(i=n.state)?void 0:i._isRedirect);c&&(h=c,c=void 0),j||A===r.Pop||(A===r.Push?e.history.push(n,n.state):A===r.Replace&&e.history.replace(n,n.state)),q(t({},o,{actionData:l,loaderData:u,historyAction:A,location:n,initialized:!0,navigation:te,revalidation:"idle",restoreScrollPosition:Fe(n,o.matches||L.matches),preventScrollReset:f,blockers:d})),A=r.Pop,U=!1,j=!1,T=!1,_=[],O=[]}async function Y(n,o,a){k&&k.abort(),k=null,A=n,j=!0===(a&&a.startUninterruptedRevalidation),function(e,t){if(w&&R){let r=Be(e,t);w[r]=R()}}(L.location,L.matches),U=!0===(a&&a.preventScrollReset);let l=c||h,s=a&&a.overrideNavigation,u=y(l,o,f);if(!u){let e=Ee(404,{pathname:o.pathname}),{matches:t,route:r}=we(l);return Oe(),void J(o,{matches:t,loaderData:{},errors:{[r.id]:e}})}if(L.initialized&&!T&&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}(L.location,o)&&!(a&&a.submission&&ke(a.submission.formMethod)))return void J(o,{matches:u});k=new AbortController;let m,v,g=pe(e.history,o,k.signal,a&&a.submission);if(a&&a.pendingError)v={[be(u).route.id]:a.pendingError};else if(a&&a.submission&&ke(a.submission.formMethod)){let e=await async function(e,t,n,o,a){void 0===a&&(a={});Q();let l,s=function(e,t){let r={state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text};return r}(t,n);q({navigation:s});let c=Ue(o,t);if(c.route.action||c.route.lazy){if(l=await fe("action",e,c,o,d,i,f),e.signal.aborted)return{shortCircuited:!0}}else l={type:p.error,error:Ee(405,{method:e.method,pathname:t.pathname,routeId:c.route.id})};if(Ce(l)){let e;return e=a&&null!=a.replace?a.replace:l.location===L.location.pathname+L.location.search,await X(L,l,{submission:n,replace:e}),{shortCircuited:!0}}if(De(l)){let e=be(o,c.route.id);return!0!==(a&&a.replace)&&(A=r.Push),{pendingActionData:{},pendingActionError:{[e.route.id]:l.error}}}if(Se(l))throw Ee(400,{type:"defer-action"});return{pendingActionData:{[c.route.id]:l.data}}}(g,o,a.submission,u,{replace:a.replace});if(e.shortCircuited)return;m=e.pendingActionData,v=e.pendingActionError,s=je(o,a.submission),g=new Request(g.url,{signal:g.signal})}let{shortCircuited:b,loaderData:E,errors:x}=await async function(r,n,o,a,i,l,s,u,d){let p=a||je(n,i),m=i||l||Me(p),v=c||h,[y,g]=ce(e.history,L,o,m,n,T,_,O,W,z,v,f,u,d);if(Oe((e=>!(o&&o.some((t=>t.route.id===e)))||y&&y.some((t=>t.route.id===e)))),N=++F,0===y.length&&0===g.length){let e=he();return J(n,t({matches:o,loaderData:{},errors:d||null},u?{actionData:u}:{},e?{fetchers:new Map(L.fetchers)}:{})),{shortCircuited:!0}}if(!j){g.forEach((e=>{let t=L.fetchers.get(e.key),r=Te(void 0,t?t.data:void 0);L.fetchers.set(e.key,r)}));let e=u||L.actionData;q(t({navigation:p},e?0===Object.keys(e).length?{actionData:null}:{actionData:e}:{},g.length>0?{fetchers:new Map(L.fetchers)}:{}))}g.forEach((e=>{B.has(e.key)&&ue(e.key),e.controller&&B.set(e.key,e.controller)}));let b=()=>g.forEach((e=>ue(e.key)));k&&k.signal.addEventListener("abort",b);let{results:w,loaderResults:E,fetcherResults:R}=await G(L.matches,o,y,g,r);if(r.signal.aborted)return{shortCircuited:!0};k&&k.signal.removeEventListener("abort",b);g.forEach((e=>B.delete(e.key)));let x=Re(w);if(x){if(x.idx>=y.length){let e=g[x.idx-y.length].key;z.add(e)}return await X(L,x.result,{replace:s}),{shortCircuited:!0}}let{loaderData:S,errors:D}=ye(L,o,y,E,d,g,R,$);$.forEach(((e,t)=>{e.subscribe((r=>{(r||e.done)&&$.delete(t)}))}));let C=he(),P=me(N),A=C||P||g.length>0;return t({loaderData:S,errors:D},A?{fetchers:new Map(L.fetchers)}:{})}(g,o,u,s,a&&a.submission,a&&a.fetcherSubmission,a&&a.replace,m,v);b||(k=null,J(o,t({matches:u},m?{actionData:m}:{},{loaderData:E,errors:x})))}function V(e){return L.fetchers.get(e)||re}async function X(a,i,s){let{submission:c,replace:d,isFetchActionRedirect:h}=void 0===s?{}:s;i.revalidate&&(T=!0);let p=u(a.location,i.location,t({_isRedirect:!0},h?{_isFetchActionRedirect:!0}:{}));if(l(p,"Expected a location on the redirect navigation"),oe.test(i.location)&&o){let t=e.history.createURL(i.location),r=null==M(t.pathname,f);if(n.location.origin!==t.origin||r)return void(d?n.location.replace(i.location):n.location.assign(i.location))}k=null;let m=!0===d?r.Replace:r.Push,v=c||Me(a.navigation);if(ee.has(i.status)&&v&&ke(v.formMethod))await Y(m,p,{submission:t({},v,{formAction:i.location}),preventScrollReset:U});else if(h)await Y(m,p,{overrideNavigation:je(p),fetcherSubmission:v,preventScrollReset:U});else{let e=je(p,v);await Y(m,p,{overrideNavigation:e,preventScrollReset:U})}}async function G(t,r,n,o,a){let l=await Promise.all([...n.map((e=>fe("loader",a,e,r,d,i,f))),...o.map((t=>{if(t.matches&&t.match&&t.controller)return fe("loader",pe(e.history,t.path,t.controller.signal),t.match,t.matches,d,i,f);return{type:p.error,error:Ee(404,{pathname:t.path})}}))]),s=l.slice(0,n.length),c=l.slice(n.length);return await Promise.all([Pe(t,n,s,s.map((()=>a.signal)),!1,L.loaderData),Pe(t,o.map((e=>e.match)),c,o.map((e=>e.controller?e.controller.signal:null)),!0)]),{results:l,loaderResults:s,fetcherResults:c}}function Q(){T=!0,_.push(...Oe()),W.forEach(((e,t)=>{B.has(t)&&(O.push(t),ue(t))}))}function Z(e,t,r){let n=be(L.matches,t);ie(e),q({errors:{[n.route.id]:r},fetchers:new Map(L.fetchers)})}function ie(e){let t=L.fetchers.get(e);!B.has(e)||t&&"loading"===t.state&&I.has(e)||ue(e),W.delete(e),I.delete(e),z.delete(e),L.fetchers.delete(e)}function ue(e){let t=B.get(e);l(t,"Expected fetch controller: "+e),t.abort(),B.delete(e)}function de(e){for(let t of e){let e=_e(V(t).data);L.fetchers.set(t,e)}}function he(){let e=[],t=!1;for(let r of z){let n=L.fetchers.get(r);l(n,"Expected fetcher: "+r),"loading"===n.state&&(z.delete(r),e.push(r),t=!0)}return de(e),t}function me(e){let t=[];for(let[r,n]of I)if(n<e){let e=L.fetchers.get(r);l(e,"Expected fetcher: "+r),"loading"===e.state&&(ue(r),I.delete(r),t.push(r))}return de(t),t.length>0}function ve(e){L.blockers.delete(e),K.delete(e)}function xe(e,t){let r=L.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);let n=new Map(L.blockers);n.set(e,t),q({blockers:n})}function Ae(e){let{currentLocation:t,nextLocation:r,historyAction:n}=e;if(0===K.size)return;K.size>1&&s(!1,"A router only supports one blocker at a time");let o=Array.from(K.entries()),[a,i]=o[o.length-1],l=L.blockers.get(a);return l&&"proceeding"===l.state?void 0:i({currentLocation:t,nextLocation:r,historyAction:n})?a:void 0}function Oe(e){let t=[];return $.forEach(((r,n)=>{e&&!e(n)||(r.cancel(),t.push(n),$.delete(n))})),t}function Be(e,t){if(E){return E(e,t.map((e=>function(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}}(e,L.loaderData))))||e.key}return e.key}function Fe(e,t){if(w){let r=Be(e,t),n=w[r];if("number"==typeof n)return n}return null}return C={get basename(){return f},get state(){return L},get routes(){return h},initialize:function(){return g=e.history.listen((t=>{let{action:r,location:n,delta:o}=t;if(H)return void(H=!1);s(0===K.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=Ae({currentLocation:L.location,nextLocation:n,historyAction:r});return a&&null!=o?(H=!0,e.history.go(-1*o),void xe(a,{state:"blocked",location:n,proceed(){xe(a,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),e.history.go(o)},reset(){let e=new Map(L.blockers);e.set(a,ne),q({blockers:e})}})):Y(r,n)})),L.initialized||Y(r.Pop,L.location),C},subscribe:function(e){return b.add(e),()=>b.delete(e)},enableScrollRestoration:function(e,t,r){if(w=e,R=t,E=r||null,!x&&L.navigation===te){x=!0;let e=Fe(L.location,L.matches);null!=e&&q({restoreScrollPosition:e})}return()=>{w=null,R=null,E=null}},navigate:async function n(o,a){if("number"==typeof o)return void e.history.go(o);let i=le(L.location,L.matches,f,m.v7_prependBasename,o,null==a?void 0:a.fromRouteId,null==a?void 0:a.relative),{path:l,submission:s,error:c}=se(m.v7_normalizeFormMethod,!1,i,a),d=L.location,h=u(L.location,l,a&&a.state);h=t({},h,e.history.encodeLocation(h));let p=a&&null!=a.replace?a.replace:void 0,v=r.Push;!0===p?v=r.Replace:!1===p||null!=s&&ke(s.formMethod)&&s.formAction===L.location.pathname+L.location.search&&(v=r.Replace);let y=a&&"preventScrollReset"in a?!0===a.preventScrollReset:void 0,g=Ae({currentLocation:d,nextLocation:h,historyAction:v});if(!g)return await Y(v,h,{submission:s,pendingError:c,preventScrollReset:y,replace:a&&a.replace});xe(g,{state:"blocked",location:h,proceed(){xe(g,{state:"proceeding",proceed:void 0,reset:void 0,location:h}),n(o,a)},reset(){let e=new Map(L.blockers);e.set(g,ne),q({blockers:e})}})},fetch:function(r,n,o,s){if(a)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.");B.has(r)&&ue(r);let u=c||h,p=le(L.location,L.matches,f,m.v7_prependBasename,o,n,null==s?void 0:s.relative),v=y(u,p,f);if(!v)return void Z(r,n,Ee(404,{pathname:p}));let{path:g,submission:b,error:w}=se(m.v7_normalizeFormMethod,!0,p,s);if(w)return void Z(r,n,w);let E=Ue(v,g);U=!0===(s&&s.preventScrollReset),b&&ke(b.formMethod)?async function(r,n,o,a,s,u){if(Q(),W.delete(r),!a.route.action&&!a.route.lazy){let e=Ee(405,{method:u.formMethod,pathname:o,routeId:n});return void Z(r,n,e)}let p=L.fetchers.get(r),m=function(e,t){let r={state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0," _hasFetcherDoneAnything ":!0};return r}(u,p);L.fetchers.set(r,m),q({fetchers:new Map(L.fetchers)});let v=new AbortController,g=pe(e.history,o,v.signal,u);B.set(r,v);let b=F,w=await fe("action",g,a,s,d,i,f);if(g.signal.aborted)return void(B.get(r)===v&&B.delete(r));if(Ce(w)){if(B.delete(r),N>b){let e=_e(void 0);return L.fetchers.set(r,e),void q({fetchers:new Map(L.fetchers)})}{z.add(r);let e=Te(u);return L.fetchers.set(r,e),q({fetchers:new Map(L.fetchers)}),X(L,w,{submission:u,isFetchActionRedirect:!0})}}if(De(w))return void Z(r,n,w.error);if(Se(w))throw Ee(400,{type:"defer-action"});let E=L.navigation.location||L.location,R=pe(e.history,E,v.signal),x=c||h,S="idle"!==L.navigation.state?y(x,L.navigation.location,f):L.matches;l(S,"Didn't find any matches after fetcher action");let D=++F;I.set(r,D);let C=Te(u,w.data);L.fetchers.set(r,C);let[P,U]=ce(e.history,L,S,u,E,T,_,O,W,z,x,f,{[a.route.id]:w.data},void 0);U.filter((e=>e.key!==r)).forEach((e=>{let t=e.key,r=L.fetchers.get(t),n=Te(void 0,r?r.data:void 0);L.fetchers.set(t,n),B.has(t)&&ue(t),e.controller&&B.set(t,e.controller)})),q({fetchers:new Map(L.fetchers)});let M=()=>U.forEach((e=>ue(e.key)));v.signal.addEventListener("abort",M);let{results:j,loaderResults:K,fetcherResults:H}=await G(L.matches,S,P,U,R);if(v.signal.aborted)return;v.signal.removeEventListener("abort",M),I.delete(r),B.delete(r),U.forEach((e=>B.delete(e.key)));let Y=Re(j);if(Y){if(Y.idx>=P.length){let e=U[Y.idx-P.length].key;z.add(e)}return X(L,Y.result)}let{loaderData:V,errors:ee}=ye(L,L.matches,P,K,void 0,U,H,$);if(L.fetchers.has(r)){let e=_e(w.data);L.fetchers.set(r,e)}let te=me(D);"loading"===L.navigation.state&&D>N?(l(A,"Expected pending action"),k&&k.abort(),J(L.navigation.location,{matches:S,loaderData:V,errors:ee,fetchers:new Map(L.fetchers)})):(q(t({errors:ee,loaderData:ge(L.loaderData,V,S,ee)},te||U.length>0?{fetchers:new Map(L.fetchers)}:{})),T=!1)}(r,n,g,E,v,b):(W.set(r,{routeId:n,path:g}),async function(t,r,n,o,a,s){let c=L.fetchers.get(t),u=Te(s,c?c.data:void 0);L.fetchers.set(t,u),q({fetchers:new Map(L.fetchers)});let h=new AbortController,p=pe(e.history,n,h.signal);B.set(t,h);let m=F,v=await fe("loader",p,o,a,d,i,f);Se(v)&&(v=await Le(v,p.signal,!0)||v);B.get(t)===h&&B.delete(t);if(p.signal.aborted)return;if(Ce(v)){if(N>m){let e=_e(void 0);return L.fetchers.set(t,e),void q({fetchers:new Map(L.fetchers)})}return z.add(t),void await X(L,v)}if(De(v)){let e=be(L.matches,r);return L.fetchers.delete(t),void q({fetchers:new Map(L.fetchers),errors:{[e.route.id]:v.error}})}l(!Se(v),"Unhandled fetcher deferred data");let y=_e(v.data);L.fetchers.set(t,y),q({fetchers:new Map(L.fetchers)})}(r,n,g,E,v,b))},revalidate:function(){Q(),q({revalidation:"loading"}),"submitting"!==L.navigation.state&&("idle"!==L.navigation.state?Y(A||L.historyAction,L.navigation.location,{overrideNavigation:L.navigation}):Y(L.historyAction,L.location,{startUninterruptedRevalidation:!0}))},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:V,deleteFetcher:ie,dispose:function(){g&&g(),b.clear(),k&&k.abort(),L.fetchers.forEach(((e,t)=>ie(t))),L.blockers.forEach(((e,t)=>ve(t)))},getBlocker:function(e,t){let r=L.blockers.get(e)||ne;return K.get(e)!==t&&K.set(e,t),r},deleteBlocker:ve,_internalFetchControllers:B,_internalActiveDeferreds:$,_internalSetRoutes:function(e){d={},c=v(e,i,void 0,d)}},C}function le(e,t,r,n,o,a,i){let l,s;if(null!=a&&"path"!==i){l=[];for(let e of t)if(l.push(e),e.route.id===a){s=e;break}}else l=t,s=t[t.length-1];let c=O(o||".",_(l).map((e=>e.pathnameBase)),M(e.pathname,r)||e.pathname,"path"===i);return null==o&&(c.search=e.search,c.hash=e.hash),null!=o&&""!==o&&"."!==o||!s||!s.route.index||Ae(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 se(e,t,r,n){if(!n||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(n))return{path:r};if(n.formMethod&&(o=n.formMethod,!Q.has(o.toLowerCase())))return{path:r,error:Ee(405,{method:n.formMethod})};var o;let a,i,s=()=>({path:r,error:Ee(400,{type:"invalid-body"})}),c=n.formMethod||"get",u=e?c.toUpperCase():c.toLowerCase(),f=xe(r);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!ke(u))return s();let e="string"==typeof n.body?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce(((e,t)=>{let[r,n]=t;return""+e+r+"="+n+"\n"}),""):String(n.body);return{path:r,submission:{formMethod:u,formAction:f,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===n.formEncType){if(!ke(u))return s();try{let e="string"==typeof n.body?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:u,formAction:f,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch(e){return s()}}}if(l("function"==typeof FormData,"FormData is not available in this environment"),n.formData)a=me(n.formData),i=n.formData;else if(n.body instanceof FormData)a=me(n.body),i=n.body;else if(n.body instanceof URLSearchParams)a=n.body,i=ve(a);else if(null==n.body)a=new URLSearchParams,i=new FormData;else try{a=new URLSearchParams(n.body),i=ve(a)}catch(e){return s()}let p={formMethod:u,formAction:f,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(ke(p.formMethod))return{path:r,submission:p};let m=h(r);return t&&m.search&&Ae(m.search)&&a.append("index",""),m.search="?"+a,{path:d(m),submission:p}}function ce(e,r,n,o,a,i,l,s,c,u,d,h,f,p){let m=p?Object.values(p)[0]:f?Object.values(f)[0]:void 0,v=e.createURL(r.location),g=e.createURL(a),b=p?Object.keys(p)[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],s=e;return de(e,t({currentUrl:v,currentParams:a.params,nextUrl:g,nextParams:s.params},o,{actionResult:m,defaultShouldRevalidate:i||v.pathname+v.search===g.pathname+g.search||v.search!==g.search||ue(a,s)}))})),R=[];return c.forEach(((e,a)=>{if(!n.some((t=>t.route.id===e.routeId)))return;let l=y(d,e.path,h);if(!l)return void R.push({key:a,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});let c=r.fetchers.get(a),f=Ue(l,e.path),p=!1;p=!u.has(a)&&(!!s.includes(a)||(c&&"idle"!==c.state&&void 0===c.data?i:de(f,t({currentUrl:v,currentParams:r.matches[r.matches.length-1].params,nextUrl:g,nextParams:n[n.length-1].params},o,{actionResult:m,defaultShouldRevalidate:i})))),p&&R.push({key:a,routeId:e.routeId,path:e.path,matches:l,match:f,controller:new AbortController})})),[E,R]}function ue(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function de(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}async function he(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,t({},r(a),{lazy:void 0}))}async function fe(e,t,r,n,o,a,i,s){let c,u,d;void 0===s&&(s={});let h=e=>{let n,o=new Promise(((e,t)=>n=t));return d=()=>n(),t.signal.addEventListener("abort",d),Promise.race([e({request:t,params:r.params,context:s.requestContext}),o])};try{let n=r.route[e];if(r.route.lazy)if(n){u=(await Promise.all([h(n),he(r.route,a,o)]))[0]}else{if(await he(r.route,a,o),n=r.route[e],!n){if("action"===e){let e=new URL(t.url),n=e.pathname+e.search;throw Ee(405,{method:t.method,pathname:n,routeId:r.route.id})}return{type:p.data,data:void 0}}u=await h(n)}else{if(!n){let e=new URL(t.url);throw Ee(404,{pathname:e.pathname+e.search})}u=await h(n)}l(void 0!==u,"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){c=p.error,u=e}finally{d&&t.signal.removeEventListener("abort",d)}if(null!=(f=u)&&"number"==typeof f.status&&"string"==typeof f.statusText&&"object"==typeof f.headers&&void 0!==f.body){let e,o=u.status;if(Z.has(o)){let e=u.headers.get("Location");if(l(e,"Redirects returned/thrown from loaders/actions must have a Location header"),oe.test(e)){if(!s.isStaticRequest){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 e=le(new URL(t.url),n.slice(0,n.indexOf(r)+1),i,!0,e);if(s.isStaticRequest)throw u.headers.set("Location",e),u;return{type:p.redirect,status:o,location:e,revalidate:null!==u.headers.get("X-Remix-Revalidate")}}if(s.isRouteRequest)throw{type:c||p.data,response:u};let a=u.headers.get("Content-Type");return e=a&&/\bapplication\/json\b/.test(a)?await u.json():await u.text(),c===p.error?{type:c,error:new J(o,u.statusText,e),headers:u.headers}:{type:p.data,data:e,statusCode:u.status,headers:u.headers}}var f,m,v;return c===p.error?{type:c,error:u}: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}(u)?{type:p.deferred,deferredData:u,statusCode:null==(m=u.init)?void 0:m.status,headers:(null==(v=u.init)?void 0:v.headers)&&new Headers(u.init.headers)}:{type:p.data,data:u}}function pe(e,t,r,n){let o=e.createURL(xe(t)).toString(),a={signal:r};if(n&&ke(n.formMethod)){let{formMethod:e,formEncType:t}=n;a.method=e.toUpperCase(),"application/json"===t?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(n.json)):"text/plain"===t?a.body=n.text:"application/x-www-form-urlencoded"===t&&n.formData?a.body=me(n.formData):a.body=n.formData}return new Request(o,a)}function me(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"==typeof n?n:n.name);return t}function ve(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function ye(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"),De(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 Se(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,controller:a}=i[r];l(void 0!==s&&void 0!==s[r],"Did not find corresponding fetcher result");let c=s[r];if(!a||!a.signal.aborted)if(De(c)){let r=be(e.matches,null==o?void 0:o.route.id);d&&d[r.route.id]||(d=t({},d,{[r.route.id]:c.error})),e.fetchers.delete(n)}else if(Ce(c))l(!1,"Unhandled fetcher revalidation redirect");else if(Se(c))l(!1,"Unhandled fetcher deferred data");else{let t=_e(c.data);e.fetchers.set(n,t)}}return{loaderData:u,errors:d}}function ge(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":"invalid-body"===a&&(l="Unable to encode submission body")):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{result:r,idx:t}}}function xe(e){return d(t({},"string"==typeof e?h(e):e,{hash:""}))}function Se(e){return e.type===p.deferred}function De(e){return e.type===p.error}function Ce(e){return(e&&e.type)===p.redirect}function ke(e){return X.has(e.toLowerCase())}async function Pe(e,t,r,n,o,a){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&&!ue(u,c)&&void 0!==(a&&a[c.route.id]);if(Se(s)&&(o||d)){let e=n[i];l(e,"Expected an AbortSignal for revalidating fetcher deferred result"),await Le(s,e,o).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 Ae(e){return new URLSearchParams(e).getAll("index").some((e=>""===e))}function Ue(e,t){let r="string"==typeof t?h(t).search:t.search;if(e[e.length-1].route.index&&Ae(r||""))return e[e.length-1];let n=_(e);return n[n.length-1]}function Me(e){let{formMethod:t,formAction:r,formEncType:n,text:o,formData:a,json:i}=e;if(t&&r&&n)return null!=o?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:o}:null!=a?{formMethod:t,formAction:r,formEncType:n,formData:a,json:void 0,text:void 0}:void 0!==i?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}:void 0}function je(e,t){if(t){return{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}return{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Te(e,t){if(e){return{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t," _hasFetcherDoneAnything ":!0}}return{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t," _hasFetcherDoneAnything ":!0}}function _e(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e," _hasFetcherDoneAnything ":!0}}
13
13
  /**
14
- * React Router v6.11.2
14
+ * React Router v6.14.2
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
- */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 t=e.useContext(je),{basename:r,navigator:n}=e.useContext(Fe),{matches:a}=e.useContext(Ie),{pathname:o}=$e(),i=JSON.stringify(j(a).map((e=>e.pathnameBase))),s=e.useRef(!1);return qe((()=>{s.current=!0})),e.useCallback((function(e,a){if(void 0===a&&(a={}),!s.current)return;if("number"==typeof e)return void n.go(e);let l=T(e,JSON.parse(i),o,"path"===a.relative);null==t&&"/"!==r&&(l.pathname="/"===l.pathname?r:B([r,l.pathname])),(a.replace?n.replace:n.push)(l,a.state,a)}),[r,n,i,o,t])}()}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()}
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 Be=e.createContext(null),Fe=e.createContext(null),Ne=e.createContext(null),Ie=e.createContext(null),ze=e.createContext(null),We=e.createContext({outlet:null,matches:[],isDataRoute:!1}),$e=e.createContext(null);function Ke(t,r){let{relative:n}=void 0===r?{}:r;He()||l(!1);let{basename:o,navigator:a}=e.useContext(Ie),{hash:i,pathname:s,search:c}=tt(t,{relative:n}),u=s;return"/"!==o&&(u="/"===s?o:B([o,s])),a.createHref({pathname:u,search:c,hash:i})}function He(){return null!=e.useContext(ze)}function qe(){return He()||l(!1),e.useContext(ze).location}function Je(){return e.useContext(ze).navigationType}function Ye(t){He()||l(!1);let{pathname:r}=qe();return e.useMemo((()=>A(t,r)),[r,t])}function Ve(t){e.useContext(Ie).static||e.useLayoutEffect(t)}function Xe(){let{isDataRoute:t}=e.useContext(We);return t?function(){let{router:t}=dt(ct.UseNavigateStable),r=ft(ut.UseNavigateStable),n=e.useRef(!1);return Ve((()=>{n.current=!0})),e.useCallback((function(e,o){void 0===o&&(o={}),n.current&&("number"==typeof e?t.navigate(e):t.navigate(e,Oe({fromRouteId:r},o)))}),[t,r])}():function(){He()||l(!1);let t=e.useContext(Be),{basename:r,navigator:n}=e.useContext(Ie),{matches:o}=e.useContext(We),{pathname:a}=qe(),i=JSON.stringify(_(o).map((e=>e.pathnameBase))),s=e.useRef(!1);return Ve((()=>{s.current=!0})),e.useCallback((function(e,o){if(void 0===o&&(o={}),!s.current)return;if("number"==typeof e)return void n.go(e);let l=O(e,JSON.parse(i),a,"path"===o.relative);null==t&&"/"!==r&&(l.pathname="/"===l.pathname?r:B([r,l.pathname])),(o.replace?n.replace:n.push)(l,o.state,o)}),[r,n,i,a,t])}()}const Ge=e.createContext(null);function Qe(){return e.useContext(Ge)}function Ze(t){let r=e.useContext(We).outlet;return r?e.createElement(Ge.Provider,{value:t},r):r}function et(){let{matches:t}=e.useContext(We),r=t[t.length-1];return r?r.params:{}}function tt(t,r){let{relative:n}=void 0===r?{}:r,{matches:o}=e.useContext(We),{pathname:a}=qe(),i=JSON.stringify(_(o).map((e=>e.pathnameBase)));return e.useMemo((()=>O(t,JSON.parse(i),a,"path"===n)),[t,i,a,n])}function rt(e,t){return nt(e,t)}function nt(t,n,o){He()||l(!1);let{navigator:a}=e.useContext(Ie),{matches:i}=e.useContext(We),s=i[i.length-1],c=s?s.params:{};!s||s.pathname;let u=s?s.pathnameBase:"/";s&&s.route;let d,f=qe();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=y(t,{pathname:"/"===u?m:m.slice(u.length)||"/"}),g=st(v&&v.map((e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:B([u,a.encodeLocation?a.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?u:B([u,a.encodeLocation?a.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),i,o);return n&&g?e.createElement(ze.Provider,{value:{location:Oe({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:r.Pop}},g):g}function ot(){let t=Et(),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)}const at=e.createElement(ot,null);class it 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(We.Provider,{value:this.props.routeContext},e.createElement($e.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function lt(t){let{routeContext:r,match:n,children:o}=t,a=e.useContext(Be);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),e.createElement(We.Provider,{value:r},o)}function st(t,r,n){var o;if(void 0===r&&(r=[]),void 0===n&&(n=null),null==t){var a;if(null==(a=n)||!a.errors)return null;t=n.matches}let i=t,s=null==(o=n)?void 0:o.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,o,a)=>{let l=o.route.id?null==s?void 0:s[o.route.id]:null,c=null;n&&(c=o.route.errorElement||at);let u=r.concat(i.slice(0,a+1)),d=()=>{let r;return r=l?c:o.route.Component?e.createElement(o.route.Component,null):o.route.element?o.route.element:t,e.createElement(lt,{match:o,routeContext:{outlet:t,matches:u,isDataRoute:null!=n},children:r})};return n&&(o.route.ErrorBoundary||o.route.errorElement||0===a)?e.createElement(it,{location:n.location,revalidation:n.revalidation,component:c,error:l,children:d(),routeContext:{outlet:null,matches:u,isDataRoute:!0}}):d()}),null)}var ct,ut;function dt(t){let r=e.useContext(Be);return r||l(!1),r}function ht(t){let r=e.useContext(Fe);return r||l(!1),r}function ft(t){let r=function(t){let r=e.useContext(We);return r||l(!1),r}(),n=r.matches[r.matches.length-1];return n.route.id||l(!1),n.route.id}function pt(){return ft(ut.UseRouteId)}function mt(){return ht(ut.UseNavigation).navigation}function vt(){let e=dt(ct.UseRevalidator),t=ht(ut.UseRevalidator);return{revalidate:e.router.revalidate,state:t.revalidation}}function yt(){let{matches:t,loaderData:r}=ht(ut.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 gt(){let e=ht(ut.UseLoaderData),t=ft(ut.UseLoaderData);if(!e.errors||null==e.errors[t])return e.loaderData[t];console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")")}function bt(e){return ht(ut.UseRouteLoaderData).loaderData[e]}function wt(){let t=ht(ut.UseActionData);return e.useContext(We)||l(!1),Object.values((null==t?void 0:t.actionData)||{})[0]}function Et(){var t;let r=e.useContext($e),n=ht(ut.UseRouteError),o=ft(ut.UseRouteError);return r||(null==(t=n.errors)?void 0:t[o])}function Rt(){let t=e.useContext(Ne);return null==t?void 0:t._data}function xt(){let t=e.useContext(Ne);return null==t?void 0:t._error}!function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate"}(ct||(ct={})),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"}(ut||(ut={}));let St=0;function Dt(t){let{router:r,basename:n}=dt(ct.UseBlocker),o=ht(ut.UseBlocker),[a,i]=e.useState(""),l=e.useCallback((e=>{if("function"!=typeof t)return!!t;if("/"===n)return t(e);let{currentLocation:r,nextLocation:o,historyAction:a}=e;return t({currentLocation:Oe({},r,{pathname:M(r.pathname,n)||r.pathname}),nextLocation:Oe({},o,{pathname:M(o.pathname,n)||o.pathname}),historyAction:a})}),[n,t]);return e.useEffect((()=>{let e=String(++St);return i(e),()=>r.deleteBlocker(e)}),[r]),e.useEffect((()=>{""!==a&&r.getBlocker(a,l)}),[r,a,l]),a&&o.blockers.has(a)?o.blockers.get(a):ne}const Ct=e.startTransition;function kt(t){let{fallbackElement:r,router:n,future:o}=t,[a,i]=e.useState(n.state),{v7_startTransition:l}=o||{},s=e.useCallback((e=>{l&&Ct?Ct((()=>i(e))):i(e)}),[i,l]);e.useLayoutEffect((()=>n.subscribe(s)),[n,s]);let c=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]),u=n.basename||"/",d=e.useMemo((()=>({router:n,navigator:c,static:!1,basename:u})),[n,c,u]);return e.createElement(e.Fragment,null,e.createElement(Be.Provider,{value:d},e.createElement(Fe.Provider,{value:a},e.createElement(jt,{basename:u,location:a.location,navigationType:a.historyAction,navigator:c},a.initialized?e.createElement(Pt,{routes:n.routes,state:a}):r))),null)}function Pt(e){let{routes:t,state:r}=e;return nt(t,void 0,r)}function Lt(t){let{basename:r,children:n,initialEntries:a,initialIndex:i,future:l}=t,s=e.useRef();null==s.current&&(s.current=o({initialEntries:a,initialIndex:i,v5Compat:!0}));let c=s.current,[u,d]=e.useState({action:c.action,location:c.location}),{v7_startTransition:h}=l||{},f=e.useCallback((e=>{h&&Ct?Ct((()=>d(e))):d(e)}),[d,h]);return e.useLayoutEffect((()=>c.listen(f)),[c,f]),e.createElement(jt,{basename:r,children:n,location:u.location,navigationType:u.action,navigator:c})}function At(t){let{to:r,replace:n,state:o,relative:a}=t;He()||l(!1);let{matches:i}=e.useContext(We),{pathname:s}=qe(),c=Xe(),u=O(r,_(i).map((e=>e.pathnameBase)),s,"path"===a),d=JSON.stringify(u);return e.useEffect((()=>c(JSON.parse(d),{replace:n,state:o,relative:a})),[c,d,a,n,o]),null}function Ut(e){return Ze(e.context)}function Mt(e){l(!1)}function jt(t){let{basename:n="/",children:o=null,location:a,navigationType:i=r.Pop,navigator:s,static:c=!1}=t;He()&&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:y="default"}=a,g=e.useMemo((()=>{let e=M(f,u);return null==e?null:{location:{pathname:e,search:p,hash:m,state:v,key:y},navigationType:i}}),[u,f,p,m,v,y,i]);return null==g?null:e.createElement(Ie.Provider,{value:d},e.createElement(ze.Provider,{children:o,value:g}))}function Tt(e){let{children:t,location:r}=e;return rt(It(t),r)}function _t(t){let{children:r,errorElement:n,resolve:o}=t;return e.createElement(Ft,{resolve:o,errorElement:n},e.createElement(Nt,null,r))}var Ot;!function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"}(Ot||(Ot={}));const Bt=new Promise((()=>{}));class Ft 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=Ot.pending;if(n instanceof Promise)if(this.state.error){a=Ot.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?Ot.error:void 0!==o._data?Ot.success:Ot.pending):(a=Ot.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=Ot.success,o=Promise.resolve(),Object.defineProperty(o,"_tracked",{get:()=>!0}),Object.defineProperty(o,"_data",{get:()=>n});if(a===Ot.error&&o._error instanceof W)throw Bt;if(a===Ot.error&&!r)throw o._error;if(a===Ot.error)return e.createElement(Ne.Provider,{value:o,children:r});if(a===Ot.success)return e.createElement(Ne.Provider,{value:o,children:t});throw o}}function Nt(t){let{children:r}=t,n=Rt(),o="function"==typeof r?r(n):r;return e.createElement(e.Fragment,null,o)}function It(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,It(t.props.children,a));t.type!==Mt&&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=It(t.props.children,a)),n.push(i)})),n}function zt(e){return st(e)}function Wt(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 $t(e,t){return ie({basename:null==t?void 0:t.basename,future:Oe({},null==t?void 0:t.future,{v7_prependBasename:!0}),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,mapRouteProperties:Wt}).initialize()}
23
23
  /**
24
- * React Router DOM v6.11.2
24
+ * React Router DOM v6.14.2
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 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};
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 Ht(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 qt="get",Jt="application/x-www-form-urlencoded";function Yt(e){return null!=e&&"string"==typeof e.tagName}function Vt(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]])}),[]))}let Xt=null;const Gt=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Qt(e){return null==e||Gt.has(e)?e:null}function Zt(e,t){let r,n,o,a,i;if(Yt(l=e)&&"form"===l.tagName.toLowerCase()){let i=e.getAttribute("action");n=i?M(i,t):null,r=e.getAttribute("method")||qt,o=Qt(e.getAttribute("enctype"))||Jt,a=new FormData(e)}else if(function(e){return Yt(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return Yt(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let i=e.form;if(null==i)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||i.getAttribute("action");if(n=l?M(l,t):null,r=e.getAttribute("formmethod")||i.getAttribute("method")||qt,o=Qt(e.getAttribute("formenctype"))||Qt(i.getAttribute("enctype"))||Jt,a=new FormData(i,e),!function(){if(null===Xt)try{new FormData(document.createElement("form"),0),Xt=!1}catch(e){Xt=!0}return Xt}()){let{name:t,type:r,value:n}=e;if("image"===r){let e=t?t+".":"";a.append(e+"x","0"),a.append(e+"y","0")}else t&&a.append(t,n)}}else{if(Yt(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=qt,n=null,o=Jt,i=e}var l;return a&&"text/plain"===o&&(i=a,a=void 0),{action:n,method:r.toLowerCase(),encType:o,formData:a,body:i}}const er=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"],tr=["aria-current","caseSensitive","className","end","style","to","children"],rr=["reloadDocument","replace","state","method","action","onSubmit","submit","relative","preventScrollReset"];function nr(e,t){return ie({basename:null==t?void 0:t.basename,future:Kt({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:a({window:null==t?void 0:t.window}),hydrationData:(null==t?void 0:t.hydrationData)||ar(),routes:e,mapRouteProperties:Wt}).initialize()}function or(e,t){return ie({basename:null==t?void 0:t.basename,future:Kt({},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)||ar(),routes:e,mapRouteProperties:Wt}).initialize()}function ar(){var e;let t=null==(e=window)?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Kt({},t,{errors:ir(t.errors)})),t}function ir(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){if(n.__subType){let t=window[n.__subType];if("function"==typeof t)try{let o=new t(n.message);o.stack="",r[e]=o}catch(e){}}if(null==r[e]){let t=new Error(n.message);t.stack="",r[e]=t}}else r[e]=n;return r}const lr=e.startTransition;function sr(t){let{basename:r,children:n,future:o,window:i}=t,l=e.useRef();null==l.current&&(l.current=a({window:i,v5Compat:!0}));let s=l.current,[c,u]=e.useState({action:s.action,location:s.location}),{v7_startTransition:d}=o||{},h=e.useCallback((e=>{d&&lr?lr((()=>u(e))):u(e)}),[u,d]);return e.useLayoutEffect((()=>s.listen(h)),[s,h]),e.createElement(jt,{basename:r,children:n,location:c.location,navigationType:c.action,navigator:s})}function cr(t){let{basename:r,children:n,future:o,window:a}=t,l=e.useRef();null==l.current&&(l.current=i({window:a,v5Compat:!0}));let s=l.current,[c,u]=e.useState({action:s.action,location:s.location}),{v7_startTransition:d}=o||{},h=e.useCallback((e=>{d&&lr?lr((()=>u(e))):u(e)}),[u,d]);return e.useLayoutEffect((()=>s.listen(h)),[s,h]),e.createElement(jt,{basename:r,children:n,location:c.location,navigationType:c.action,navigator:s})}function ur(t){let{basename:r,children:n,future:o,history:a}=t,[i,l]=e.useState({action:a.action,location:a.location}),{v7_startTransition:s}=o||{},c=e.useCallback((e=>{s&&lr?lr((()=>l(e))):l(e)}),[l,s]);return e.useLayoutEffect((()=>a.listen(c)),[a,c]),e.createElement(jt,{basename:r,children:n,location:i.location,navigationType:i.action,navigator:a})}const dr="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,hr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,fr=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=Ht(t,er),{basename:f}=e.useContext(Ie),p=!1;if("string"==typeof u&&hr.test(u)&&(n=u,dr))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=Ke(u,{relative:a}),v=Rr(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}))})),pr=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=Ht(t,tr),d=tt(s,{relative:u.relative}),h=qe(),f=e.useContext(Fe),{navigator:p}=e.useContext(Ie),m=p.encodeLocation?p.encodeLocation(d).pathname:d.pathname,v=h.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;o||(v=v.toLowerCase(),y=y?y.toLowerCase():null,m=m.toLowerCase());let g,b=v===m||!i&&v.startsWith(m)&&"/"===v.charAt(m.length),w=null!=y&&(y===m||!i&&y.startsWith(m)&&"/"===y.charAt(m.length)),E=b?n:void 0;g="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(fr,Kt({},u,{"aria-current":E,className:g,ref:r,style:R,to:s}),"function"==typeof c?c({isActive:b,isPending:w}):c)})),mr=e.forwardRef(((t,r)=>{let n=Dr();return e.createElement(vr,Kt({},t,{submit:n,ref:r}))})),vr=e.forwardRef(((t,r)=>{let{reloadDocument:n,replace:o,state:a,method:i=qt,action:l,onSubmit:s,submit:c,relative:u,preventScrollReset:d}=t,h=Ht(t,rr),f="get"===i.toLowerCase()?"get":"post",p=kr(l,{relative:u});return e.createElement("form",Kt({ref:r,method:f,action:p,onSubmit:n?s:e=>{if(s&&s(e),e.defaultPrevented)return;e.preventDefault();let t=e.nativeEvent.submitter,r=(null==t?void 0:t.getAttribute("formmethod"))||i;c(t||e.currentTarget,{method:r,replace:o,state:a,relative:u,preventScrollReset:d})}},h))}));function yr(e){let{getKey:t,storageKey:r}=e;return jr({getKey:t,storageKey:r}),null}var gr,br;function wr(t){let r=e.useContext(Be);return r||l(!1),r}function Er(t){let r=e.useContext(Fe);return r||l(!1),r}function Rr(t,r){let{target:n,replace:o,state:a,preventScrollReset:i,relative:l}=void 0===r?{}:r,s=Xe(),c=qe(),u=tt(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 xr(t){let r=e.useRef(Vt(t)),n=e.useRef(!1),o=qe(),a=e.useMemo((()=>function(e,t){let r=Vt(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=Xe(),l=e.useCallback(((e,t)=>{const r=Vt("function"==typeof e?e(a):e);n.current=!0,i("?"+r,t)}),[i,a]);return[a,l]}function Sr(){if("undefined"==typeof document)throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}function Dr(){let{router:t}=wr(gr.UseSubmit),{basename:r}=e.useContext(Ie),n=pt();return e.useCallback((function(e,o){void 0===o&&(o={}),Sr();let{action:a,method:i,encType:l,formData:s,body:c}=Zt(e,r);t.navigate(o.action||a,{preventScrollReset:o.preventScrollReset,formData:s,body:c,formMethod:o.method||i,formEncType:o.encType||l,replace:o.replace,state:o.state,fromRouteId:n})}),[t,r,n])}function Cr(t,r){let{router:n}=wr(gr.UseSubmitFetcher),{basename:o}=e.useContext(Ie);return e.useCallback((function(e,a){void 0===a&&(a={}),Sr();let{action:i,method:s,encType:c,formData:u,body:d}=Zt(e,o);null==r&&l(!1),n.fetch(t,r,a.action||i,{preventScrollReset:a.preventScrollReset,formData:u,body:d,formMethod:a.method||s,formEncType:a.encType||c})}),[n,o,t,r])}function kr(t,r){let{relative:n}=void 0===r?{}:r,{basename:o}=e.useContext(Ie),a=e.useContext(We);a||l(!1);let[i]=a.matches.slice(-1),s=Kt({},tt(t||".",{relative:n})),c=qe();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.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher"}(gr||(gr={})),function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(br||(br={}));let Pr=0;function Lr(){var t;let{router:r}=wr(gr.UseFetcher),n=e.useContext(We);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(++Pr))),[i]=e.useState((()=>(o||l(!1),function(t,r){return e.forwardRef(((n,o)=>{let a=Cr(t,r);return e.createElement(vr,Kt({},n,{ref:o,submit:a}))}))}(a,o)))),[s]=e.useState((()=>e=>{r||l(!1),o||l(!1),r.fetch(a,o,e)})),c=Cr(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 router available to clean up from useFetcher()")}),[r,a]),d}function Ar(){return[...Er(br.UseFetchers).fetchers.values()]}const Ur="react-router-scroll-positions";let Mr={};function jr(t){let{getKey:r,storageKey:n}=void 0===t?{}:t,{router:o}=wr(gr.UseScrollRestoration),{restoreScrollPosition:a,preventScrollReset:i}=Er(br.UseScrollRestoration),{basename:l}=e.useContext(Ie),s=qe(),c=yt(),u=mt();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"===u.state){let e=(r?r(s,c):null)||s.key;Mr[e]=window.scrollY}sessionStorage.setItem(n||Ur,JSON.stringify(Mr)),window.history.scrollRestoration="auto"}),[n,r,u.state,s,c])),"undefined"!=typeof document&&(e.useLayoutEffect((()=>{try{let e=sessionStorage.getItem(n||Ur);e&&(Mr=JSON.parse(e))}catch(e){}}),[n]),e.useLayoutEffect((()=>{let e=r&&"/"!==l?(e,t)=>r(Kt({},e,{pathname:M(e.pathname,l)||e.pathname}),t):r,t=null==o?void 0:o.enableScrollRestoration(Mr,(()=>window.scrollY),e);return()=>t&&t()}),[o,l,r]),e.useLayoutEffect((()=>{if(!1!==a)if("number"!=typeof a){if(s.hash){let e=document.getElementById(decodeURIComponent(s.hash.slice(1)));if(e)return void e.scrollIntoView()}!0!==i&&window.scrollTo(0,0)}else window.scrollTo(0,a)}),[s,a,i]))}function Tr(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 _r(t){let{when:r,message:n}=t,o=Dt(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,_t as Await,sr as BrowserRouter,mr as Form,cr as HashRouter,fr as Link,Lt as MemoryRouter,pr as NavLink,At as Navigate,r as NavigationType,Ut as Outlet,Mt as Route,jt as Router,kt as RouterProvider,Tt as Routes,yr as ScrollRestoration,Be as UNSAFE_DataRouterContext,Fe as UNSAFE_DataRouterStateContext,ze as UNSAFE_LocationContext,Ie as UNSAFE_NavigationContext,We as UNSAFE_RouteContext,pt as UNSAFE_useRouteId,jr as UNSAFE_useScrollRestoration,nr as createBrowserRouter,or as createHashRouter,$t as createMemoryRouter,d as createPath,It as createRoutesFromChildren,It as createRoutesFromElements,Vt as createSearchParams,H as defer,L as generatePath,Y as isRouteErrorResponse,z as json,A as matchPath,y as matchRoutes,h as parsePath,q as redirect,zt as renderMatches,j as resolvePath,ur as unstable_HistoryRouter,Dt as unstable_useBlocker,_r as unstable_usePrompt,wt as useActionData,xt as useAsyncError,Rt as useAsyncValue,Tr as useBeforeUnload,Lr as useFetcher,Ar as useFetchers,kr as useFormAction,Ke as useHref,He as useInRouterContext,Rr as useLinkClickHandler,gt as useLoaderData,qe as useLocation,Ye as useMatch,yt as useMatches,Xe as useNavigate,mt as useNavigation,Je as useNavigationType,Ze as useOutlet,Qe as useOutletContext,et as useParams,tt as useResolvedPath,vt as useRevalidator,Et as useRouteError,bt as useRouteLoaderData,rt as useRoutes,xr as useSearchParams,Dr as useSubmit};
33
33
  //# sourceMappingURL=react-router-dom.production.min.js.map