@hitachivantara/app-shell-vite-plugin 0.17.8 → 0.17.10

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.16.0 esm bundle generated by Hitachi Vantara - Boba Fett team */
1
+ /* @preserve react-router-dom@6.17.0 esm bundle generated by Hitachi Vantara - Boba Fett team */
2
2
  import*as e from"react";
3
3
  /**
4
- * @remix-run/router v1.9.0
4
+ * @remix-run/router v1.10.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=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}}
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=g();function g(){return(f.state||{idx:null}).idx}function y(){p=r.Pop;let e=g(),t=null==e?null:e-v;v=e,m&&m({action:p,location:w.location,delta:t})}function b(e){let t="null"!==s.location.origin?s.location.origin:s.location.href,r="string"==typeof e?e:d(e);return l(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)}null==v&&(v=0,f.replaceState(t({},f.state,{idx:v}),""));let w={get action(){return p},get location(){return e(s,f)},listen(e){if(m)throw new Error("A history only accepts one active listener");return s.addEventListener(n,y),m=e,()=>{s.removeEventListener(n,y),m=null}},createHref:e=>o(s,e),createURL:b,encodeLocation(e){let t=b(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){p=r.Push;let n=u(w.location,e,t);a&&a(n,e),v=g()+1;let o=c(n,v),i=w.createHref(n);try{f.pushState(o,"",i)}catch(e){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=g();let o=c(n,v),i=w.createHref(n);f.replaceState(o,"",i),h&&m&&m({action:p,location:w.location,delta:0})},go:e=>f.go(e)};return w}var p;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(p||(p={}));const m=new Set(["lazy","caseSensitive","path","id","index","children"]);function v(e,r,n,o){return void 0===n&&(n=[]),void 0===o&&(o={}),e.map(((e,a)=>{let i=[...n,a],s="string"==typeof e.id?e.id:i.join("-");if(l(!0!==e.index||!e.children,"Cannot specify children on an index route"),l(!o[s],'Found a route id collision on id "'+s+"\". Route id's must be globally unique within Data Router usages"),function(e){return!0===e.index}(e)){let n=t({},e,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 g(e,t,r){void 0===r&&(r="/");let n=M(("string"==typeof t?h(t):t).pathname||"/",r);if(null==n)return null;let o=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=T(o[e],U(n));return a}function y(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: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 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+$/,x=3,R=2,S=1,D=10,C=-2,L=e=>"*"===e;function k(e,t){let r=e.split("/"),n=r.length;return r.some(L)&&(n+=C),t&&(n+=R),r.filter((e=>!L(e))).reduce(((e,t)=>e+(E.test(t)?x:""===t?S:D)),n)}function T(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:N([o,c.pathname]),pathnameBase:F(N([o,c.pathnameBase])),route:u}),"/"!==c.pathnameBase&&(o=N([o,c.pathnameBase]))}return a}function P(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:I(n),hash:z(o)}}function _(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the `to."+r+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function O(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("?"),_("?","pathname","search",a)),l(!a.pathname||!a.pathname.includes("#"),_("#","pathname","hash",a)),l(!a.search||!a.search.includes("#"),_("#","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 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 J=function(e,t){return void 0===t&&(t={}),new K(e,"number"==typeof t?{status:t}:t)},q=function(e,r){void 0===r&&(r=302);let n=r;"number"==typeof n?n={status:n}:void 0===n.status&&(n.status=302);let o=new Headers(n.headers);return o.set("Location",e),new Response(null,t({},n,{headers:o}))},V=(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 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)}),se="remix-router-transitions";function ce(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,x=null,R=null,S=null!=e.hydrationData,D=g(h,e.history.location,f),C=null;if(null==D){let t=Se(404,{pathname:e.history.location.pathname}),{matches:r,route:n}=Re(h);D=r,C={[n.id]:t}}let L,k,T=!(D.some((e=>e.route.lazy))||D.some((e=>e.route.loader))&&null==e.hydrationData),P={historyAction:e.history.action,location:e.history.location,matches:D,initialized:T,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},A=r.Pop,U=!1,j=!1,_=new Map,O=null,B=!1,N=!1,F=[],I=[],z=new Map,W=0,$=-1,K=new Map,H=new Set,J=new Map,q=new Map,V=new Map,Y=!1;function X(e,r){P=t({},P,e),w.forEach((e=>e(P,{unstable_viewTransitionOpts:r})))}function G(n,o){var a,i;let l,s=null!=P.actionData&&null!=P.navigation.formMethod&&Pe(P.navigation.formMethod)&&"loading"===P.navigation.state&&!0!==(null==(a=n.state)?void 0:a._isRedirect);l=o.actionData?Object.keys(o.actionData).length>0?o.actionData:null:s?P.actionData:null;let u=o.loaderData?Ee(P.loaderData,o.loaderData,o.matches||[],o.errors):P.loaderData,d=P.blockers;d.size>0&&(d=new Map(d),d.forEach(((e,t)=>d.set(t,ae))));let f,p=!0===U||null!=P.navigation.formMethod&&Pe(P.navigation.formMethod)&&!0!==(null==(i=n.state)?void 0:i._isRedirect);if(c&&(h=c,c=void 0),B||A===r.Pop||(A===r.Push?e.history.push(n,n.state):A===r.Replace&&e.history.replace(n,n.state)),A===r.Pop){let e=_.get(P.location.pathname);e&&e.has(n.pathname)?f={currentLocation:P.location,nextLocation:n}:_.has(n.pathname)&&(f={currentLocation:n,nextLocation:P.location})}else if(j){let e=_.get(P.location.pathname);e?e.add(n.pathname):(e=new Set([n.pathname]),_.set(P.location.pathname,e)),f={currentLocation:P.location,nextLocation:n}}X(t({},o,{actionData:l,loaderData:u,historyAction:A,location:n,initialized:!0,navigation:ne,revalidation:"idle",restoreScrollPosition:$e(n,o.matches||P.matches),preventScrollReset:p,blockers:d}),f),A=r.Pop,U=!1,j=!1,B=!1,N=!1,F=[],I=[]}async function Q(n,o,a){k&&k.abort(),k=null,A=n,B=!0===(a&&a.startUninterruptedRevalidation),function(e,t){if(E&&R){let r=We(e,t);E[r]=R()}}(P.location,P.matches),U=!0===(a&&a.preventScrollReset),j=!0===(a&&a.enableViewTransition);let l=c||h,s=a&&a.overrideNavigation,u=g(l,o,f);if(!u){let e=Se(404,{pathname:o.pathname}),{matches:t,route:r}=Re(l);return ze(),void G(o,{matches:t,loaderData:{},errors:{[r.id]:e}})}if(P.initialized&&!N&&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}(P.location,o)&&!(a&&a.submission&&Pe(a.submission.formMethod)))return void G(o,{matches:u});k=new AbortController;let m,v,y=ge(e.history,o,k.signal,a&&a.submission);if(a&&a.pendingError)v={[xe(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={});ce();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);X({navigation:s});let c=je(o,t);if(c.route.action||c.route.lazy){if(l=await ve("action",e,c,o,d,i,f),e.signal.aborted)return{shortCircuited:!0}}else l={type:p.error,error:Se(405,{method:e.method,pathname:t.pathname,routeId:c.route.id})};if(Te(l)){let e;return e=a&&null!=a.replace?a.replace:l.location===P.location.pathname+P.location.search,await ee(P,l,{submission:n,replace:e}),{shortCircuited:!0}}if(ke(l)){let e=xe(o,c.route.id);return!0!==(a&&a.replace)&&(A=r.Push),{pendingActionData:{},pendingActionError:{[e.route.id]:l.error}}}if(Le(l))throw Se(400,{type:"defer-action"});return{pendingActionData:{[c.route.id]:l.data}}}(y,o,a.submission,u,{replace:a.replace});if(e.shortCircuited)return;m=e.pendingActionData,v=e.pendingActionError,s=Oe(o,a.submission),y=new Request(y.url,{signal:y.signal})}let{shortCircuited:b,loaderData:w,errors:x}=await async function(r,n,o,a,i,l,s,u,d){let p=a||Oe(n,i),m=i||l||_e(p),v=c||h,[g,y]=he(e.history,P,o,m,n,N,F,I,J,H,v,f,u,d);if(ze((e=>!(o&&o.some((t=>t.route.id===e)))||g&&g.some((t=>t.route.id===e)))),$=++W,0===g.length&&0===y.length){let e=be();return G(n,t({matches:o,loaderData:{},errors:d||null},u?{actionData:u}:{},e?{fetchers:new Map(P.fetchers)}:{})),{shortCircuited:!0}}if(!B){y.forEach((e=>{let t=P.fetchers.get(e.key),r=Be(void 0,t?t.data:void 0);P.fetchers.set(e.key,r)}));let e=u||P.actionData;X(t({navigation:p},e?0===Object.keys(e).length?{actionData:null}:{actionData:e}:{},y.length>0?{fetchers:new Map(P.fetchers)}:{}))}y.forEach((e=>{z.has(e.key)&&me(e.key),e.controller&&z.set(e.key,e.controller)}));let b=()=>y.forEach((e=>me(e.key)));k&&k.signal.addEventListener("abort",b);let{results:w,loaderResults:E,fetcherResults:x}=await te(P.matches,o,g,y,r);if(r.signal.aborted)return{shortCircuited:!0};k&&k.signal.removeEventListener("abort",b);y.forEach((e=>z.delete(e.key)));let R=De(w);if(R){if(R.idx>=g.length){let e=y[R.idx-g.length].key;H.add(e)}return await ee(P,R.result,{replace:s}),{shortCircuited:!0}}let{loaderData:S,errors:D}=we(P,o,g,E,d,y,x,q);q.forEach(((e,t)=>{e.subscribe((r=>{(r||e.done)&&q.delete(t)}))}));let C=be(),L=Ce($),T=C||L||y.length>0;return t({loaderData:S,errors:D},T?{fetchers:new Map(P.fetchers)}:{})}(y,o,u,s,a&&a.submission,a&&a.fetcherSubmission,a&&a.replace,m,v);b||(k=null,G(o,t({matches:u},m?{actionData:m}:{},{loaderData:w,errors:x})))}function Z(e){return P.fetchers.get(e)||oe}async function ee(a,i,s){let{submission:c,fetcherSubmission:d,replace:h}=void 0===s?{}:s;i.revalidate&&(N=!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==M(r.pathname,f)}if(t)return void(h?n.location.replace(i.location):n.location.assign(i.location))}k=null;let m=!0===h?r.Replace:r.Push,{formMethod:v,formAction:g,formEncType:y}=a.navigation;!c&&!d&&v&&g&&y&&(c=_e(a.navigation));let b=c||d;if(re.has(i.status)&&b&&Pe(b.formMethod))await Q(m,p,{submission:t({},b,{formAction:i.location}),preventScrollReset:U});else{let e=Oe(p,c);await Q(m,p,{overrideNavigation:e,fetcherSubmission:d,preventScrollReset:U})}}async function te(t,r,n,o,a){let l=await Promise.all([...n.map((e=>ve("loader",a,e,r,d,i,f))),...o.map((t=>{if(t.matches&&t.match&&t.controller)return ve("loader",ge(e.history,t.path,t.controller.signal),t.match,t.matches,d,i,f);return{type:p.error,error:Se(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,P.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 ce(){N=!0,F.push(...ze()),J.forEach(((e,t)=>{z.has(t)&&(I.push(t),me(t))}))}function fe(e,t,r){let n=xe(P.matches,t);pe(e),X({errors:{[n.route.id]:r},fetchers:new Map(P.fetchers)})}function pe(e){let t=P.fetchers.get(e);!z.has(e)||t&&"loading"===t.state&&K.has(e)||me(e),J.delete(e),K.delete(e),H.delete(e),P.fetchers.delete(e)}function me(e){let t=z.get(e);l(t,"Expected fetch controller: "+e),t.abort(),z.delete(e)}function ye(e){for(let t of e){let e=Ne(Z(t).data);P.fetchers.set(t,e)}}function be(){let e=[],t=!1;for(let r of H){let n=P.fetchers.get(r);l(n,"Expected fetcher: "+r),"loading"===n.state&&(H.delete(r),e.push(r),t=!0)}return ye(e),t}function Ce(e){let t=[];for(let[r,n]of K)if(n<e){let e=P.fetchers.get(r);l(e,"Expected fetcher: "+r),"loading"===e.state&&(me(r),K.delete(r),t.push(r))}return ye(t),t.length>0}function Me(e){P.blockers.delete(e),V.delete(e)}function Fe(e,t){let r=P.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(P.blockers);n.set(e,t),X({blockers:n})}function Ie(e){let{currentLocation:t,nextLocation:r,historyAction:n}=e;if(0===V.size)return;V.size>1&&s(!1,"A router only supports one blocker at a time");let o=Array.from(V.entries()),[a,i]=o[o.length-1],l=P.blockers.get(a);return l&&"proceeding"===l.state?void 0:i({currentLocation:t,nextLocation:r,historyAction:n})?a:void 0}function ze(e){let t=[];return q.forEach(((r,n)=>{e&&!e(n)||(r.cancel(),t.push(n),q.delete(n))})),t}function We(e,t){if(x){return x(e,t.map((e=>y(e,P.loaderData))))||e.key}return e.key}function $e(e,t){if(E){let r=We(e,t),n=E[r];if("number"==typeof n)return n}return null}return L={get basename(){return f},get state(){return P},get routes(){return h},get window(){return n},initialize:function(){if(b=e.history.listen((t=>{let{action:r,location:n,delta:o}=t;if(Y)return void(Y=!1);s(0===V.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=Ie({currentLocation:P.location,nextLocation:n,historyAction:r});return a&&null!=o?(Y=!0,e.history.go(-1*o),void Fe(a,{state:"blocked",location:n,proceed(){Fe(a,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),e.history.go(o)},reset(){let e=new Map(P.blockers);e.set(a,ae),X({blockers:e})}})):Q(r,n)})),o){!function(e,t){try{let r=e.sessionStorage.getItem(se);if(r){let e=JSON.parse(r);for(let[r,n]of Object.entries(e||{}))n&&Array.isArray(n)&&t.set(r,new Set(n||[]))}}catch(e){}}(n,_);let e=()=>function(e,t){if(t.size>0){let r={};for(let[e,n]of t)r[e]=[...n];try{e.sessionStorage.setItem(se,JSON.stringify(r))}catch(e){s(!1,"Failed to save applied view transitions in sessionStorage ("+e+").")}}}
13
13
  /**
14
- * React Router v6.16.0
14
+ * React Router v6.17.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 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()}
22
+ */(n,_);n.addEventListener("pagehide",e),O=()=>n.removeEventListener("pagehide",e)}return P.initialized||Q(r.Pop,P.location),L},subscribe:function(e){return w.add(e),()=>w.delete(e)},enableScrollRestoration:function(e,t,r){if(E=e,R=t,x=r||null,!S&&P.navigation===ne){S=!0;let e=$e(P.location,P.matches);null!=e&&X({restoreScrollPosition:e})}return()=>{E=null,R=null,x=null}},navigate:async function n(o,a){if("number"==typeof o)return void e.history.go(o);let i=ue(P.location,P.matches,f,m.v7_prependBasename,o,null==a?void 0:a.fromRouteId,null==a?void 0:a.relative),{path:l,submission:s,error:c}=de(m.v7_normalizeFormMethod,!1,i,a),d=P.location,h=u(P.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===P.location.pathname+P.location.search&&(v=r.Replace);let g=a&&"preventScrollReset"in a?!0===a.preventScrollReset:void 0,y=Ie({currentLocation:d,nextLocation:h,historyAction:v});if(!y)return await Q(v,h,{submission:s,pendingError:c,preventScrollReset:g,replace:a&&a.replace,enableViewTransition:a&&a.unstable_viewTransition});Fe(y,{state:"blocked",location:h,proceed(){Fe(y,{state:"proceeding",proceed:void 0,reset:void 0,location:h}),n(o,a)},reset(){let e=new Map(P.blockers);e.set(y,ae),X({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.");z.has(r)&&me(r);let u=c||h,p=ue(P.location,P.matches,f,m.v7_prependBasename,o,n,null==s?void 0:s.relative),v=g(u,p,f);if(!v)return void fe(r,n,Se(404,{pathname:p}));let{path:y,submission:b,error:w}=de(m.v7_normalizeFormMethod,!0,p,s);if(w)return void fe(r,n,w);let E=je(v,y);U=!0===(s&&s.preventScrollReset),b&&Pe(b.formMethod)?async function(r,n,o,a,s,u){if(ce(),J.delete(r),!a.route.action&&!a.route.lazy){let e=Se(405,{method:u.formMethod,pathname:o,routeId:n});return void fe(r,n,e)}let p=P.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);P.fetchers.set(r,m),X({fetchers:new Map(P.fetchers)});let v=new AbortController,y=ge(e.history,o,v.signal,u);z.set(r,v);let b=W,w=await ve("action",y,a,s,d,i,f);if(y.signal.aborted)return void(z.get(r)===v&&z.delete(r));if(Te(w)){if(z.delete(r),$>b){let e=Ne(void 0);return P.fetchers.set(r,e),void X({fetchers:new Map(P.fetchers)})}{H.add(r);let e=Be(u);return P.fetchers.set(r,e),X({fetchers:new Map(P.fetchers)}),ee(P,w,{fetcherSubmission:u})}}if(ke(w))return void fe(r,n,w.error);if(Le(w))throw Se(400,{type:"defer-action"});let E=P.navigation.location||P.location,x=ge(e.history,E,v.signal),R=c||h,S="idle"!==P.navigation.state?g(R,P.navigation.location,f):P.matches;l(S,"Didn't find any matches after fetcher action");let D=++W;K.set(r,D);let C=Be(u,w.data);P.fetchers.set(r,C);let[L,T]=he(e.history,P,S,u,E,N,F,I,J,H,R,f,{[a.route.id]:w.data},void 0);T.filter((e=>e.key!==r)).forEach((e=>{let t=e.key,r=P.fetchers.get(t),n=Be(void 0,r?r.data:void 0);P.fetchers.set(t,n),z.has(t)&&me(t),e.controller&&z.set(t,e.controller)})),X({fetchers:new Map(P.fetchers)});let U=()=>T.forEach((e=>me(e.key)));v.signal.addEventListener("abort",U);let{results:M,loaderResults:j,fetcherResults:_}=await te(P.matches,S,L,T,x);if(v.signal.aborted)return;v.signal.removeEventListener("abort",U),K.delete(r),z.delete(r),T.forEach((e=>z.delete(e.key)));let O=De(M);if(O){if(O.idx>=L.length){let e=T[O.idx-L.length].key;H.add(e)}return ee(P,O.result)}let{loaderData:B,errors:V}=we(P,P.matches,L,j,void 0,T,_,q);if(P.fetchers.has(r)){let e=Ne(w.data);P.fetchers.set(r,e)}let Y=Ce(D);"loading"===P.navigation.state&&D>$?(l(A,"Expected pending action"),k&&k.abort(),G(P.navigation.location,{matches:S,loaderData:B,errors:V,fetchers:new Map(P.fetchers)})):(X(t({errors:V,loaderData:Ee(P.loaderData,B,S,V)},Y||T.length>0?{fetchers:new Map(P.fetchers)}:{})),N=!1)}(r,n,y,E,v,b):(J.set(r,{routeId:n,path:y}),async function(t,r,n,o,a,s){let c=P.fetchers.get(t),u=Be(s,c?c.data:void 0);P.fetchers.set(t,u),X({fetchers:new Map(P.fetchers)});let h=new AbortController,p=ge(e.history,n,h.signal);z.set(t,h);let m=W,v=await ve("loader",p,o,a,d,i,f);Le(v)&&(v=await Ue(v,p.signal,!0)||v);z.get(t)===h&&z.delete(t);if(p.signal.aborted)return;if(Te(v)){if($>m){let e=Ne(void 0);return P.fetchers.set(t,e),void X({fetchers:new Map(P.fetchers)})}return H.add(t),void await ee(P,v)}if(ke(v)){let e=xe(P.matches,r);return P.fetchers.delete(t),void X({fetchers:new Map(P.fetchers),errors:{[e.route.id]:v.error}})}l(!Le(v),"Unhandled fetcher deferred data");let g=Ne(v.data);P.fetchers.set(t,g),X({fetchers:new Map(P.fetchers)})}(r,n,y,E,v,b))},revalidate:function(){ce(),X({revalidation:"loading"}),"submitting"!==P.navigation.state&&("idle"!==P.navigation.state?Q(A||P.historyAction,P.navigation.location,{overrideNavigation:P.navigation}):Q(P.historyAction,P.location,{startUninterruptedRevalidation:!0}))},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Z,deleteFetcher:pe,dispose:function(){b&&b(),O&&O(),w.clear(),k&&k.abort(),P.fetchers.forEach(((e,t)=>pe(t))),P.blockers.forEach(((e,t)=>Me(t)))},getBlocker:function(e,t){let r=P.blockers.get(e)||ae;return V.get(e)!==t&&V.set(e,t),r},deleteBlocker:Me,_internalFetchControllers:z,_internalActiveDeferreds:q,_internalSetRoutes:function(e){d={},c=v(e,i,void 0,d)}},L}function ue(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||".",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||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 de(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:Se(405,{method:n.formMethod})};var o;let a,i,s=()=>({path:r,error:Se(400,{type:"invalid-body"})}),c=n.formMethod||"get",u=e?c.toUpperCase():c.toLowerCase(),f=Ce(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=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=be(a);else if(null==n.body)a=new URLSearchParams,i=new FormData;else try{a=new URLSearchParams(n.body),i=be(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&&Me(m.search)&&a.append("index",""),m.search="?"+a,{path:d(m),submission:p}}function he(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),y=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 pe(e,t({currentUrl:v,currentParams:a.params,nextUrl:y,nextParams:s.params},o,{actionResult:m,defaultShouldRevalidate:i||v.pathname+v.search===y.pathname+y.search||v.search!==y.search||fe(a,s)}))})),x=[];return c.forEach(((e,a)=>{if(!n.some((t=>t.route.id===e.routeId)))return;let l=g(d,e.path,h);if(!l)return void x.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:pe(f,t({currentUrl:v,currentParams:r.matches[r.matches.length-1].params,nextUrl:y,nextParams:n[n.length-1].params},o,{actionResult:m,defaultShouldRevalidate:i})))),p&&x.push({key:a,routeId:e.routeId,path:e.path,matches:l,match:f,controller:new AbortController})})),[E,x]}function fe(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function pe(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}async function me(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 ve(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})),me(r.route,a,o)]);if(e)throw e;u=t[0]}else{if(await me(r.route,a,o),n=r.route[e],!n){if("action"===e){let e=new URL(t.url),n=e.pathname+e.search;throw Se(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 Se(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!=M(n.pathname,i);n.origin===r.origin&&o&&(e=n.pathname+n.search+n.hash)}}else e=ue(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 ge(e,t,r,n){let o=e.createURL(Ce(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=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 be(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function we(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(!Te(r),"Cannot handle redirect results in processLoaderData"),ke(r)){let t=xe(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 Le(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=xe(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(Te(c))l(!1,"Unhandled fetcher revalidation redirect");else if(Le(c))l(!1,"Unhandled fetcher deferred data");else{let t=Ne(c.data);e.fetchers.set(n,t)}}return{loaderData:u,errors:d}}function Ee(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 xe(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=1===e.length?e[0]:e.find((e=>e.index||!e.path||"/"===e.path))||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Se(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 De(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(Te(r))return{result:r,idx:t}}}function Ce(e){return d(t({},"string"==typeof e?h(e):e,{hash:""}))}function Le(e){return e.type===p.deferred}function ke(e){return e.type===p.error}function Te(e){return(e&&e.type)===p.redirect}function Pe(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&&!fe(u,c)&&void 0!==(a&&a[c.route.id]);if(Le(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=O(e);return n[n.length-1]}function _e(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 Be(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 Ne(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Fe(){return Fe=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},Fe.apply(this,arguments)}const Ie=e.createContext(null),ze=e.createContext(null),We=e.createContext(null),$e=e.createContext(null),Ke=e.createContext(null),He=e.createContext({outlet:null,matches:[],isDataRoute:!1}),Je=e.createContext(null);function qe(t,r){let{relative:n}=void 0===r?{}:r;Ve()||l(!1);let{basename:o,navigator:a}=e.useContext($e),{hash:i,pathname:s,search:c}=ot(t,{relative:n}),u=s;return"/"!==o&&(u="/"===s?o:N([o,s])),a.createHref({pathname:u,search:c,hash:i})}function Ve(){return null!=e.useContext(Ke)}function Ye(){return Ve()||l(!1),e.useContext(Ke).location}function Xe(){return e.useContext(Ke).navigationType}function Ge(t){Ve()||l(!1);let{pathname:r}=Ye();return e.useMemo((()=>A(t,r)),[r,t])}function Qe(t){e.useContext($e).static||e.useLayoutEffect(t)}function Ze(){let{isDataRoute:t}=e.useContext(He);return t?function(){let{router:t}=pt(ht.UseNavigateStable),r=vt(ft.UseNavigateStable),n=e.useRef(!1);return Qe((()=>{n.current=!0})),e.useCallback((function(e,o){void 0===o&&(o={}),n.current&&("number"==typeof e?t.navigate(e):t.navigate(e,Fe({fromRouteId:r},o)))}),[t,r])}():function(){Ve()||l(!1);let t=e.useContext(Ie),{basename:r,navigator:n}=e.useContext($e),{matches:o}=e.useContext(He),{pathname:a}=Ye(),i=JSON.stringify(O(o).map((e=>e.pathnameBase))),s=e.useRef(!1);return Qe((()=>{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 et=e.createContext(null);function tt(){return e.useContext(et)}function rt(t){let r=e.useContext(He).outlet;return r?e.createElement(et.Provider,{value:t},r):r}function nt(){let{matches:t}=e.useContext(He),r=t[t.length-1];return r?r.params:{}}function ot(t,r){let{relative:n}=void 0===r?{}:r,{matches:o}=e.useContext(He),{pathname:a}=Ye(),i=JSON.stringify(O(o).map((e=>e.pathnameBase)));return e.useMemo((()=>B(t,JSON.parse(i),a,"path"===n)),[t,i,a,n])}function at(e,t){return it(e,t)}function it(t,n,o){Ve()||l(!1);let{navigator:a}=e.useContext($e),{matches:i}=e.useContext(He),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=g(t,{pathname:"/"===u?m:m.slice(u.length)||"/"}),y=dt(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&&y?e.createElement(Ke.Provider,{value:{location:Fe({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:r.Pop}},y):y}function lt(){let t=St(),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 st=e.createElement(lt,null);class ct 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(He.Provider,{value:this.props.routeContext},e.createElement(Je.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ut(t){let{routeContext:r,match:n,children:o}=t,a=e.useContext(Ie);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),e.createElement(He.Provider,{value:r},o)}function dt(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||st);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(ut,{match:o,routeContext:{outlet:t,matches:u,isDataRoute:null!=n},children:r})};return n&&(o.route.ErrorBoundary||o.route.errorElement||0===a)?e.createElement(ct,{location:n.location,revalidation:n.revalidation,component:c,error:l,children:d(),routeContext:{outlet:null,matches:u,isDataRoute:!0}}):d()}),null)}var ht=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(ht||{}),ft=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}(ft||{});function pt(t){let r=e.useContext(Ie);return r||l(!1),r}function mt(t){let r=e.useContext(ze);return r||l(!1),r}function vt(t){let r=function(t){let r=e.useContext(He);return r||l(!1),r}(),n=r.matches[r.matches.length-1];return n.route.id||l(!1),n.route.id}function gt(){return vt(ft.UseRouteId)}function yt(){return mt(ft.UseNavigation).navigation}function bt(){let t=pt(ht.UseRevalidator),r=mt(ft.UseRevalidator);return e.useMemo((()=>({revalidate:t.router.revalidate,state:r.revalidation})),[t.router.revalidate,r.revalidation])}function wt(){let{matches:t,loaderData:r}=mt(ft.UseMatches);return e.useMemo((()=>t.map((e=>y(e,r)))),[t,r])}function Et(){let e=mt(ft.UseLoaderData),t=vt(ft.UseLoaderData);if(!e.errors||null==e.errors[t])return e.loaderData[t];console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")")}function xt(e){return mt(ft.UseRouteLoaderData).loaderData[e]}function Rt(){let t=mt(ft.UseActionData);return e.useContext(He)||l(!1),Object.values((null==t?void 0:t.actionData)||{})[0]}function St(){var t;let r=e.useContext(Je),n=mt(ft.UseRouteError),o=vt(ft.UseRouteError);return r||(null==(t=n.errors)?void 0:t[o])}function Dt(){let t=e.useContext(We);return null==t?void 0:t._data}function Ct(){let t=e.useContext(We);return null==t?void 0:t._error}let Lt=0;function kt(t){let{router:r,basename:n}=pt(ht.UseBlocker),o=mt(ft.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:Fe({},r,{pathname:M(r.pathname,n)||r.pathname}),nextLocation:Fe({},o,{pathname:M(o.pathname,n)||o.pathname}),historyAction:a})}),[n,t]);return e.useEffect((()=>{let e=String(++Lt);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 Tt=e.startTransition;function Pt(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&&Tt?Tt((()=>d(e))):d(e)}),[d,h]);return e.useLayoutEffect((()=>c.listen(f)),[c,f]),e.createElement(jt,{basename:r,children:n,location:u.location,navigationType:u.action,navigator:c})}function At(t){let{to:r,replace:n,state:o,relative:a}=t;Ve()||l(!1);let{matches:i}=e.useContext(He),{pathname:s}=Ye(),c=Ze(),u=B(r,O(i).map((e=>e.pathnameBase)),s,"path"===a),d=JSON.stringify(u);return e.useEffect((()=>c(JSON.parse(d),{replace:n,state:o,relative:a})),[c,d,a,n,o]),null}function Ut(e){return rt(e.context)}function Mt(e){l(!1)}function jt(t){let{basename:n="/",children:o=null,location:a,navigationType:i=r.Pop,navigator:s,static:c=!1}=t;Ve()&&l(!1);let u=n.replace(/^\/*/,"/"),d=e.useMemo((()=>({basename:u,navigator:s,static:c})),[u,s,c]);"string"==typeof a&&(a=h(a));let{pathname:f="/",search:p="",hash:m="",state:v=null,key:g="default"}=a,y=e.useMemo((()=>{let e=M(f,u);return null==e?null:{location:{pathname:e,search:p,hash:m,state:v,key:g},navigationType:i}}),[u,f,p,m,v,g,i]);return null==y?null:e.createElement($e.Provider,{value:d},e.createElement(Ke.Provider,{children:o,value:y}))}function _t(e){let{children:t,location:r}=e;return at(zt(t),r)}function Ot(t){let{children:r,errorElement:n,resolve:o}=t;return e.createElement(Ft,{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 Nt=new Promise((()=>{}));class Ft extends e.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("<Await> caught the following error during render",e,t)}render(){let{children:t,errorElement:r,resolve:n}=this.props,o=null,a=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 $)throw Nt;if(a===Bt.error&&!r)throw o._error;if(a===Bt.error)return e.createElement(We.Provider,{value:o,children:r});if(a===Bt.success)return e.createElement(We.Provider,{value:o,children:t});throw o}}function It(t){let{children:r}=t,n=Dt(),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!==Mt&&l(!1),t.props.index&&t.props.children&&l(!1);let i={id:t.props.id||a.join("-"),caseSensitive:t.props.caseSensitive,element:t.props.element,Component:t.props.Component,index:t.props.index,path:t.props.path,loader:t.props.loader,action:t.props.action,errorElement:t.props.errorElement,ErrorBoundary:t.props.ErrorBoundary,hasErrorBoundary:null!=t.props.ErrorBoundary||null!=t.props.errorElement,shouldRevalidate:t.props.shouldRevalidate,handle:t.props.handle,lazy:t.props.lazy};t.props.children&&(i.children=zt(t.props.children,a)),n.push(i)})),n}function Wt(e){return dt(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 ce({basename:null==t?void 0:t.basename,future:Fe({},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()}
23
23
  /**
24
- * React Router DOM v6.16.0
24
+ * React Router DOM v6.17.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 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};
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 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 qt="get",Vt="application/x-www-form-urlencoded";function Yt(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(Yt(l=e)&&"form"===l.tagName.toLowerCase()){let i=e.getAttribute("action");n=i?M(i,t):null,r=e.getAttribute("method")||qt,o=Zt(e.getAttribute("enctype"))||Vt,a=new FormData(e)}else if(function(e){return Yt(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return Yt(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let i=e.form;if(null==i)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||i.getAttribute("action");if(n=l?M(l,t):null,r=e.getAttribute("formmethod")||i.getAttribute("method")||qt,o=Zt(e.getAttribute("formenctype"))||Zt(i.getAttribute("enctype"))||Vt,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(Yt(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=qt,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 tr=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],rr=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],nr=["reloadDocument","replace","state","method","action","onSubmit","submit","relative","preventScrollReset","unstable_viewTransition"];function or(e,t){return ce({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,window:null==t?void 0:t.window}).initialize()}function ar(e,t){return ce({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,window:null==t?void 0:t.window}).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.createContext({isTransitioning:!1}),cr=e.startTransition;class ur{constructor(){this.status="pending",this.promise=new Promise(((e,t)=>{this.resolve=t=>{"pending"===this.status&&(this.status="resolved",e(t))},this.reject=e=>{"pending"===this.status&&(this.status="rejected",t(e))}}))}}function dr(t){let{fallbackElement:r,router:n,future:o}=t,[a,i]=e.useState(n.state),[l,s]=e.useState(),[c,u]=e.useState({isTransitioning:!1}),[d,h]=e.useState(),[f,p]=e.useState(),[m,v]=e.useState(),{v7_startTransition:g}=o||{},y=e.useCallback((e=>{g?function(e){cr?cr(e):e()}(e):e()}),[g]),b=e.useCallback(((e,t)=>{let{unstable_viewTransitionOpts:r}=t;r&&null!=n.window&&"function"==typeof n.window.document.startViewTransition?f&&d?(d.resolve(),f.skipTransition(),v({state:e,currentLocation:r.currentLocation,nextLocation:r.nextLocation})):(s(e),u({isTransitioning:!0,currentLocation:r.currentLocation,nextLocation:r.nextLocation})):y((()=>i(e)))}),[y,f,d,n.window]);e.useLayoutEffect((()=>n.subscribe(b)),[n,b]),e.useEffect((()=>{c.isTransitioning&&h(new ur)}),[c.isTransitioning]),e.useEffect((()=>{if(d&&l&&n.window){let e=l,t=d.promise,r=n.window.document.startViewTransition((async()=>{y((()=>i(e))),await t}));r.finished.finally((()=>{h(void 0),p(void 0),s(void 0),u({isTransitioning:!1})})),p(r)}}),[y,l,d,n.window]),e.useEffect((()=>{d&&l&&a.location.key===l.location.key&&d.resolve()}),[d,f,a.location,l]),e.useEffect((()=>{!c.isTransitioning&&m&&(s(m.state),u({isTransitioning:!0,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),v(void 0))}),[c.isTransitioning,m]);let w=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]),E=n.basename||"/",x=e.useMemo((()=>({router:n,navigator:w,static:!1,basename:E})),[n,w,E]);return e.createElement(e.Fragment,null,e.createElement(Ie.Provider,{value:x},e.createElement(ze.Provider,{value:a},e.createElement(sr.Provider,{value:c},e.createElement(jt,{basename:E,location:a.location,navigationType:a.historyAction,navigator:w},a.initialized?e.createElement(hr,{routes:n.routes,state:a}):r)))),null)}function hr(e){let{routes:t,state:r}=e;return it(t,void 0,r)}function fr(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(jt,{basename:r,children:n,location:c.location,navigationType:c.action,navigator:s})}function pr(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(jt,{basename:r,children:n,location:c.location,navigationType:c.action,navigator:s})}function mr(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(jt,{basename:r,children:n,location:i.location,navigationType:i.action,navigator:a})}const vr="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,gr=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,yr=e.forwardRef((function(t,r){let n,{onClick:o,relative:a,reloadDocument:i,replace:l,state:s,target:c,to:u,preventScrollReset:d,unstable_viewTransition:h}=t,f=Jt(t,tr),{basename:p}=e.useContext($e),m=!1;if("string"==typeof u&&gr.test(u)&&(n=u,vr))try{let e=new URL(window.location.href),t=u.startsWith("//")?new URL(e.protocol+u):new URL(u),r=M(t.pathname,p);t.origin===e.origin&&null!=r?u=r+t.search+t.hash:m=!0}catch(e){}let v=qe(u,{relative:a}),g=Lr(u,{replace:l,state:s,target:c,preventScrollReset:d,relative:a,unstable_viewTransition:h});return e.createElement("a",Ht({},f,{href:n||v,onClick:m||i?o:function(e){o&&o(e),e.defaultPrevented||g(e)},ref:r,target:c}))})),br=e.forwardRef((function(t,r){let{"aria-current":n="page",caseSensitive:o=!1,className:a="",end:i=!1,style:l,to:s,unstable_viewTransition:c,children:u}=t,d=Jt(t,rr),h=ot(s,{relative:d.relative}),f=Ye(),p=e.useContext(ze),{navigator:m}=e.useContext($e),v=null!=p&&zr(h)&&!0===c,g=m.encodeLocation?m.encodeLocation(h).pathname:h.pathname,y=f.pathname,b=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;o||(y=y.toLowerCase(),b=b?b.toLowerCase():null,g=g.toLowerCase());let w,E=y===g||!i&&y.startsWith(g)&&"/"===y.charAt(g.length),x=null!=b&&(b===g||!i&&b.startsWith(g)&&"/"===b.charAt(g.length)),R={isActive:E,isPending:x,isTransitioning:v},S=E?n:void 0;w="function"==typeof a?a(R):[a,E?"active":null,x?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let D="function"==typeof l?l(R):l;return e.createElement(yr,Ht({},d,{"aria-current":S,className:w,ref:r,style:D,to:s,unstable_viewTransition:c}),"function"==typeof u?u(R):u)})),wr=e.forwardRef(((t,r)=>{let n=Pr();return e.createElement(Er,Ht({},t,{submit:n,ref:r}))})),Er=e.forwardRef(((t,r)=>{let{reloadDocument:n,replace:o,state:a,method:i=qt,action:l,onSubmit:s,submit:c,relative:u,preventScrollReset:d,unstable_viewTransition:h}=t,f=Jt(t,nr),p="get"===i.toLowerCase()?"get":"post",m=Ur(l,{relative:u});return e.createElement("form",Ht({ref:r,method:p,action:m,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,unstable_viewTransition:h})}},f))}));function xr(e){let{getKey:t,storageKey:r}=e;return Nr({getKey:t,storageKey:r}),null}var Rr,Sr;function Dr(t){let r=e.useContext(Ie);return r||l(!1),r}function Cr(t){let r=e.useContext(ze);return r||l(!1),r}function Lr(t,r){let{target:n,replace:o,state:a,preventScrollReset:i,relative:l,unstable_viewTransition:s}=void 0===r?{}:r,c=Ze(),u=Ye(),h=ot(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(u)===d(h);c(t,{replace:r,state:a,preventScrollReset:i,relative:l,unstable_viewTransition:s})}}),[u,c,h,o,a,n,t,i,l,s])}function kr(t){let r=e.useRef(Xt(t)),n=e.useRef(!1),o=Ye(),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=Ze(),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 Tr(){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 Pr(){let{router:t}=Dr(Rr.UseSubmit),{basename:r}=e.useContext($e),n=gt();return e.useCallback((function(e,o){void 0===o&&(o={}),Tr();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,unstable_viewTransition:o.unstable_viewTransition})}),[t,r,n])}function Ar(t,r){let{router:n}=Dr(Rr.UseSubmitFetcher),{basename:o}=e.useContext($e);return e.useCallback((function(e,a){void 0===a&&(a={}),Tr();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 Ur(t,r){let{relative:n}=void 0===r?{}:r,{basename:o}=e.useContext($e),a=e.useContext(He);a||l(!1);let[i]=a.matches.slice(-1),s=Ht({},ot(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",e.useViewTransitionState="useViewTransitionState"}(Rr||(Rr={})),function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(Sr||(Sr={}));let Mr=0;function jr(){var t;let{router:r}=Dr(Rr.UseFetcher),n=e.useContext(He);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(++Mr))),[i]=e.useState((()=>(o||l(!1),function(t,r){return e.forwardRef(((n,o)=>{let a=Ar(t,r);return e.createElement(Er,Ht({},n,{ref:o,submit:a}))}))}(a,o)))),[s]=e.useState((()=>e=>{r||l(!1),o||l(!1),r.fetch(a,o,e)})),c=Ar(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 _r(){return[...Cr(Sr.UseFetchers).fetchers.values()]}const Or="react-router-scroll-positions";let Br={};function Nr(t){let{getKey:r,storageKey:n}=void 0===t?{}:t,{router:o}=Dr(Rr.UseScrollRestoration),{restoreScrollPosition:a,preventScrollReset:i}=Cr(Sr.UseScrollRestoration),{basename:l}=e.useContext($e),s=Ye(),c=wt(),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;Br[e]=window.scrollY}try{sessionStorage.setItem(n||Or,JSON.stringify(Br))}catch(e){}window.history.scrollRestoration="auto"}),[n,r,u.state,s,c])),"undefined"!=typeof document&&(e.useLayoutEffect((()=>{try{let e=sessionStorage.getItem(n||Or);e&&(Br=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(Br,(()=>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 Fr(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 Ir(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])}function zr(t,r){void 0===r&&(r={});let n=e.useContext(sr);null==n&&l(!1);let{basename:o}=Dr(Rr.useViewTransitionState),a=ot(t,{relative:r.relative});if(!n.isTransitioning)return!1;let i=M(n.currentLocation.pathname,o)||n.currentLocation.pathname,s=M(n.nextLocation.pathname,o)||n.nextLocation.pathname;return null!=A(a.pathname,s)||null!=A(a.pathname,i)}export{$ as AbortedDeferredError,Ot as Await,fr as BrowserRouter,wr as Form,pr as HashRouter,yr as Link,Pt as MemoryRouter,br as NavLink,At as Navigate,r as NavigationType,Ut as Outlet,Mt as Route,jt as Router,dr as RouterProvider,_t as Routes,xr as ScrollRestoration,Ie as UNSAFE_DataRouterContext,ze as UNSAFE_DataRouterStateContext,Ke as UNSAFE_LocationContext,$e as UNSAFE_NavigationContext,He as UNSAFE_RouteContext,sr as UNSAFE_ViewTransitionContext,gt as UNSAFE_useRouteId,Nr as UNSAFE_useScrollRestoration,or as createBrowserRouter,ar as createHashRouter,Kt as createMemoryRouter,d as createPath,zt as createRoutesFromChildren,zt as createRoutesFromElements,Xt as createSearchParams,J as defer,P as generatePath,X as isRouteErrorResponse,W as json,A as matchPath,g as matchRoutes,h as parsePath,q as redirect,V as redirectDocument,Wt as renderMatches,j as resolvePath,mr as unstable_HistoryRouter,kt as unstable_useBlocker,Ir as unstable_usePrompt,zr as unstable_useViewTransitionState,Rt as useActionData,Ct as useAsyncError,Dt as useAsyncValue,Fr as useBeforeUnload,jr as useFetcher,_r as useFetchers,Ur as useFormAction,qe as useHref,Ve as useInRouterContext,Lr as useLinkClickHandler,Et as useLoaderData,Ye as useLocation,Ge as useMatch,wt as useMatches,Ze as useNavigate,yt as useNavigation,Xe as useNavigationType,rt as useOutlet,tt as useOutletContext,nt as useParams,ot as useResolvedPath,bt as useRevalidator,St as useRouteError,xt as useRouteLoaderData,at as useRoutes,kr as useSearchParams,Pr as useSubmit};
33
33
  //# sourceMappingURL=react-router-dom.production.min.js.map