@hitachivantara/app-shell-vite-plugin 0.17.4 → 0.17.6

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