/*! For license information please see bundles.915764f9.js.LICENSE.txt */ "use strict";(self.webpackChunkalvanon_analytics_platform_frontend=self.webpackChunkalvanon_analytics_platform_frontend||[]).push([[2059],{45588(e,t,r){function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;tu,B6:()=>E,Gh:()=>C,HS:()=>T,Oi:()=>s,Rr:()=>h,V2:()=>I,VV:()=>H,aE:()=>Z,pX:()=>F,pb:()=>M,rc:()=>o,tH:()=>z,ue:()=>v,yD:()=>j,zR:()=>i}),function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(o||(o={}));const n="popstate";function i(e){return void 0===e&&(e={}),function(e,t,r,i){void 0===i&&(i={});let{window:l=document.defaultView,v5Compat:h=!1}=i,f=l.history,p=o.Pop,m=null,v=y();function y(){return(f.state||{idx:null}).idx}function g(){p=o.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"!==l.location.origin?l.location.origin:l.location.href,r="string"==typeof e?e:u(e);return r=r.replace(/ $/,"%20"),s(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)}null==v&&(v=0,f.replaceState(a({},f.state,{idx:v}),""));let w={get action(){return p},get location(){return e(l,f)},listen(e){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener(n,g),m=e,()=>{l.removeEventListener(n,g),m=null}},createHref:e=>t(l,e),createURL:b,encodeLocation(e){let t=b(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){p=o.Push;let a=d(w.location,e,t);r&&r(a,e),v=y()+1;let n=c(a,v),i=w.createHref(a);try{f.pushState(n,"",i)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;l.location.assign(i)}h&&m&&m({action:p,location:w.location,delta:1})},replace:function(e,t){p=o.Replace;let a=d(w.location,e,t);r&&r(a,e),v=y();let n=c(a,v),i=w.createHref(a);f.replaceState(n,"",i),h&&m&&m({action:p,location:w.location,delta:0})},go:e=>f.go(e)};return w}(function(e,t){let{pathname:r,search:a,hash:o}=e.location;return d("",{pathname:r,search:a,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){return"string"==typeof t?t:u(t)},null,e)}function s(e,t){if(!1===e||null==e)throw new Error(t)}function l(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 d(e,t,r,o){return void 0===r&&(r=null),a({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?h(t):t,{state:r,key:t&&t.key||o||Math.random().toString(36).substr(2,8)})}function u(e){let{pathname:t="/",search:r="",hash:a=""}=e;return r&&"?"!==r&&(t+="?"===r.charAt(0)?r:"?"+r),a&&"#"!==a&&(t+="#"===a.charAt(0)?a:"#"+a),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 a=e.indexOf("?");a>=0&&(t.search=e.substr(a),e=e.substr(0,a)),e&&(t.pathname=e)}return t}var f;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(f||(f={}));const p=new Set(["lazy","caseSensitive","path","id","index","children"]);function m(e,t,r,o){return void 0===r&&(r=[]),void 0===o&&(o={}),e.map((e,n)=>{let i=[...r,String(n)],l="string"==typeof e.id?e.id:i.join("-");if(s(!0!==e.index||!e.children,"Cannot specify children on an index route"),s(!o[l],'Found a route id collision on id "'+l+"\". Route id's must be globally unique within Data Router usages"),function(e){return!0===e.index}(e)){let r=a({},e,t(e),{id:l});return o[l]=r,r}{let r=a({},e,t(e),{id:l,children:void 0});return o[l]=r,e.children&&(r.children=m(e.children,t,i,o)),r}})}function v(e,t,r){return void 0===r&&(r="/"),y(e,t,r,!1)}function y(e,t,r,a){let o=M(("string"==typeof t?h(t):t).pathname||"/",r);if(null==o)return null;let n=g(e);!function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every((e,r)=>e===t[r])?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(n);let i=null;for(let e=0;null==i&&e{let i={relativePath:void 0===n?e.path||"":n,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};i.relativePath.startsWith("/")&&(s(i.relativePath.startsWith(a),'Absolute route path "'+i.relativePath+'" nested under path "'+a+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),i.relativePath=i.relativePath.slice(a.length));let l=T([a,i.relativePath]),c=r.concat(i);e.children&&e.children.length>0&&(s(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+l+'".'),g(e.children,t,c,l)),(null!=e.path||e.index)&&t.push({path:l,score:D(l,e.index),routesMeta:c})};return e.forEach((e,t)=>{var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?"))for(let r of b(e.path))o(e,t,r);else o(e,t)}),t}function b(e){let t=e.split("/");if(0===t.length)return[];let[r,...a]=t,o=r.endsWith("?"),n=r.replace(/\?$/,"");if(0===a.length)return o?[n,""]:[n];let i=b(a.join("/")),s=[];return s.push(...i.map(e=>""===e?n:[n,e].join("/"))),o&&s.push(...i),s.map(t=>e.startsWith("/")&&""===t?"/":t)}const w=/^:[\w-]+$/,S=e=>"*"===e;function D(e,t){let r=e.split("/"),a=r.length;return r.some(S)&&(a+=-2),t&&(a+=2),r.filter(e=>!S(e)).reduce((e,t)=>e+(w.test(t)?3:""===t?1:10),a)}function R(e,t,r){void 0===r&&(r=!1);let{routesMeta:a}=e,o={},n="/",i=[];for(let e=0;e(a.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(a.push({paramName:"*"}),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),a]}(e.path,e.caseSensitive,e.end),o=t.match(r);if(!o)return null;let n=o[0],i=n.replace(/(.)\/+$/,"$1"),s=o.slice(1);return{params:a.reduce((e,t,r)=>{let{paramName:a,isOptional:o}=t;if("*"===a){let e=s[r]||"";i=n.slice(0,n.length-e.length).replace(/(.)\/+$/,"$1")}const l=s[r];return e[a]=o&&!l?void 0:(l||"").replace(/%2F/g,"/"),e},{}),pathname:n,pathnameBase:i,pattern:e}}function x(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return l(!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,a=e.charAt(r);return a&&"/"!==a?null:e.slice(r)||"/"}const k=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function L(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("/"):"/"}function P(e,t,r,a){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(a)+"]. Please separate it out to the `to."+r+'` field. Alternatively you may provide the full path as a string in and the router will parse it for you.'}function A(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function j(e,t){let r=A(e);return t?r.map((e,t)=>t===r.length-1?e.pathname:e.pathnameBase):r.map(e=>e.pathnameBase)}function C(e,t,r,o){let n;void 0===o&&(o=!1),"string"==typeof e?n=h(e):(n=a({},e),s(!n.pathname||!n.pathname.includes("?"),P("?","pathname","search",n)),s(!n.pathname||!n.pathname.includes("#"),P("#","pathname","hash",n)),s(!n.search||!n.search.includes("#"),P("#","search","hash",n)));let i,c=""===e||""===n.pathname,d=c?"/":n.pathname;if(null==d)i=r;else{let e=t.length-1;if(!o&&d.startsWith("..")){let t=d.split("/");for(;".."===t[0];)t.shift(),e-=1;n.pathname=t.join("/")}i=e>=0?t[e]:"/"}let u=function(e,t){void 0===t&&(t="/");let r,{pathname:a,search:o="",hash:n=""}="string"==typeof e?h(e):e;if(a)if(i=a,k.test(i))r=a;else{if(a.includes("//")){let e=a;a=a.replace(/\/\/+/g,"/"),l(!1,"Pathnames cannot have embedded double slashes - normalizing "+e+" -> "+a)}r=a.startsWith("/")?L(a.substring(1),"/"):L(a,t)}else r=t;var i;return{pathname:r,search:_(o),hash:O(n)}}(n,i),f=d&&"/"!==d&&d.endsWith("/"),p=(c||"."===d)&&r.endsWith("/");return u.pathname.endsWith("/")||!f&&!p||(u.pathname+="/"),u}const T=e=>e.join("/").replace(/\/\/+/g,"/"),U=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),_=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",O=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";class z extends Error{}const I=function(e,t){void 0===t&&(t=302);let r=t;"number"==typeof r?r={status:r}:void 0===r.status&&(r.status=302);let o=new Headers(r.headers);return o.set("Location",e),new Response(null,a({},r,{headers:o}))};class H{constructor(e,t,r,a){void 0===a&&(a=!1),this.status=e,this.statusText=t||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function F(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}const B=["post","put","patch","delete"],W=new Set(B),N=["get",...B],$=new Set(N),q=new Set([301,302,303,307,308]),V=new Set([307,308]),Y={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},J={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},X={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},G=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,K=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),Q="remix-router-transitions";function Z(e){const t=e.window?e.window:"undefined"!=typeof window?window:void 0,r=void 0!==t&&void 0!==t.document&&void 0!==t.document.createElement,n=!r;let i;if(s(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=K;let c,u,h,g={},b=m(e.routes,i,void 0,g),w=e.basename||"/",S=e.dataStrategy||ce,D=e.patchRoutesOnNavigation,R=a({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),E=null,x=new Set,k=null,L=null,P=null,A=null!=e.hydrationData,j=v(b,e.history.location,w),C=!1,T=null;if(null==j&&!D){let t=Se(404,{pathname:e.history.location.pathname}),{matches:r,route:a}=we(b);j=r,T={[a.id]:t}}if(j&&!e.hydrationData&&ct(j,b,e.history.location.pathname).active&&(j=null),j)if(j.some(e=>e.route.lazy))u=!1;else if(j.some(e=>e.route.loader))if(R.v7_partialHydration){let t=e.hydrationData?e.hydrationData.loaderData:null,r=e.hydrationData?e.hydrationData.errors:null;if(r){let e=j.findIndex(e=>void 0!==r[e.route.id]);u=j.slice(0,e+1).every(e=>!oe(e.route,t,r))}else u=j.every(e=>!oe(e.route,t,r))}else u=null!=e.hydrationData;else u=!0;else if(u=!1,j=[],R.v7_partialHydration){let t=ct(null,b,e.history.location.pathname);t.active&&t.matches&&(C=!0,j=t.matches)}let U,_,O={historyAction:e.history.action,location:e.history.location,matches:j,initialized:u,navigation:Y,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||T,fetchers:new Map,blockers:new Map},z=o.Pop,I=!1,H=!1,B=new Map,W=null,N=!1,$=!1,q=[],Z=new Set,re=new Map,ne=0,ie=-1,le=new Map,pe=new Set,me=new Map,Re=new Map,Le=new Set,Pe=new Map,Ue=new Map;function Fe(e,t){void 0===t&&(t={}),O=a({},O,e);let r=[],o=[];R.v7_fetcherPersist&&O.fetchers.forEach((e,t)=>{"idle"===e.state&&(Le.has(t)?o.push(t):r.push(t))}),Le.forEach(e=>{O.fetchers.has(e)||re.has(e)||o.push(e)}),[...x].forEach(e=>e(O,{deletedFetchers:o,viewTransitionOpts:t.viewTransitionOpts,flushSync:!0===t.flushSync})),R.v7_fetcherPersist?(r.forEach(e=>O.fetchers.delete(e)),o.forEach(e=>Ke(e))):o.forEach(e=>Le.delete(e))}function Be(t,r,n){var i,s;let l,{flushSync:d}=void 0===n?{}:n,u=null!=O.actionData&&null!=O.navigation.formMethod&&Ae(O.navigation.formMethod)&&"loading"===O.navigation.state&&!0!==(null==(i=t.state)?void 0:i._isRedirect);l=r.actionData?Object.keys(r.actionData).length>0?r.actionData:null:u?O.actionData:null;let h=r.loaderData?ye(O.loaderData,r.loaderData,r.matches||[],r.errors):O.loaderData,f=O.blockers;f.size>0&&(f=new Map(f),f.forEach((e,t)=>f.set(t,X)));let p,m=!0===I||null!=O.navigation.formMethod&&Ae(O.navigation.formMethod)&&!0!==(null==(s=t.state)?void 0:s._isRedirect);if(c&&(b=c,c=void 0),N||z===o.Pop||(z===o.Push?e.history.push(t,t.state):z===o.Replace&&e.history.replace(t,t.state)),z===o.Pop){let e=B.get(O.location.pathname);e&&e.has(t.pathname)?p={currentLocation:O.location,nextLocation:t}:B.has(t.pathname)&&(p={currentLocation:t,nextLocation:O.location})}else if(H){let e=B.get(O.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),B.set(O.location.pathname,e)),p={currentLocation:O.location,nextLocation:t}}Fe(a({},r,{actionData:l,loaderData:h,historyAction:z,location:t,initialized:!0,navigation:Y,revalidation:"idle",restoreScrollPosition:lt(t,r.matches||O.matches),preventScrollReset:m,blockers:f}),{viewTransitionOpts:p,flushSync:!0===d}),z=o.Pop,I=!1,H=!1,N=!1,$=!1,q=[]}async function We(t,r,n){U&&U.abort(),U=null,z=t,N=!0===(n&&n.startUninterruptedRevalidation),function(e,t){if(k&&P){let r=st(e,t);k[r]=P()}}(O.location,O.matches),I=!0===(n&&n.preventScrollReset),H=!0===(n&&n.enableViewTransition);let i=c||b,s=n&&n.overrideNavigation,l=null!=n&&n.initialHydration&&O.matches&&O.matches.length>0&&!C?O.matches:v(i,r,w),d=!0===(n&&n.flushSync);if(l&&O.initialized&&!$&&(u=O.location,h=r,u.pathname===h.pathname&&u.search===h.search&&(""===u.hash?""!==h.hash:u.hash===h.hash||""!==h.hash))&&!(n&&n.submission&&Ae(n.submission.formMethod)))return void Be(r,{matches:l},{flushSync:d});var u,h;let p=ct(l,i,r.pathname);if(p.active&&p.matches&&(l=p.matches),!l){let{error:e,notFoundMatches:t,route:a}=nt(r.pathname);return void Be(r,{matches:t,loaderData:{},errors:{[a.id]:e}},{flushSync:d})}U=new AbortController;let m,y=fe(e.history,r,U.signal,n&&n.submission);if(n&&n.pendingError)m=[be(l).route.id,{type:f.error,error:n.pendingError}];else if(n&&n.submission&&Ae(n.submission.formMethod)){let t=await async function(t,r,a,n,i,s){void 0===s&&(s={}),Ye();let l,c=function(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}(r,a);if(Fe({navigation:c},{flushSync:!0===s.flushSync}),i){let e=await dt(n,r.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){let t=be(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:f.error,error:e.error}]}}if(!e.matches){let{notFoundMatches:e,error:t,route:a}=nt(r.pathname);return{matches:e,pendingActionResult:[a.id,{type:f.error,error:t}]}}n=e.matches}let d=_e(n,r);if(d.route.action||d.route.lazy){if(l=(await qe("action",O,t,[d],n,null))[d.route.id],t.signal.aborted)return{shortCircuited:!0}}else l={type:f.error,error:Se(405,{method:t.method,pathname:r.pathname,routeId:d.route.id})};if(ke(l)){let r;return r=s&&null!=s.replace?s.replace:he(l.response.headers.get("Location"),new URL(t.url),w,e.history)===O.location.pathname+O.location.search,await $e(t,l,!0,{submission:a,replace:r}),{shortCircuited:!0}}if(xe(l))throw Se(400,{type:"defer-action"});if(Me(l)){let e=be(n,d.route.id);return!0!==(s&&s.replace)&&(z=o.Push),{matches:n,pendingActionResult:[e.route.id,l]}}return{matches:n,pendingActionResult:[d.route.id,l]}}(y,r,n.submission,l,p.active,{replace:n.replace,flushSync:d});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,a]=t.pendingActionResult;if(Me(a)&&F(a.error)&&404===a.error.status)return U=null,void Be(r,{matches:t.matches,loaderData:{},errors:{[e]:a.error}})}l=t.matches||l,m=t.pendingActionResult,s=ze(r,n.submission),d=!1,p.active=!1,y=fe(e.history,y.url,y.signal)}let{shortCircuited:g,matches:S,loaderData:D,errors:E}=await async function(t,r,o,n,i,s,l,d,u,h,f){let p=i||ze(r,s),m=s||l||Oe(p),v=!(N||R.v7_partialHydration&&u);if(n){if(v){let e=Ne(f);Fe(a({navigation:p},void 0!==e?{actionData:e}:{}),{flushSync:h})}let e=await dt(o,r.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){let t=be(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(!e.matches){let{error:e,notFoundMatches:t,route:a}=nt(r.pathname);return{matches:t,loaderData:{},errors:{[a.id]:e}}}o=e.matches}let y=c||b,[g,S]=ae(e.history,O,o,m,r,R.v7_partialHydration&&!0===u,R.v7_skipActionErrorRevalidation,$,q,Z,Le,me,pe,y,w,f);if(it(e=>!(o&&o.some(t=>t.route.id===e))||g&&g.some(t=>t.route.id===e)),ie=++ne,0===g.length&&0===S.length){let e=et();return Be(r,a({matches:o,loaderData:{},errors:f&&Me(f[1])?{[f[0]]:f[1].error}:null},ge(f),e?{fetchers:new Map(O.fetchers)}:{}),{flushSync:h}),{shortCircuited:!0}}if(v){let e={};if(!n){e.navigation=p;let t=Ne(f);void 0!==t&&(e.actionData=t)}S.length>0&&(e.fetchers=function(e){return e.forEach(e=>{let t=O.fetchers.get(e.key),r=Ie(void 0,t?t.data:void 0);O.fetchers.set(e.key,r)}),new Map(O.fetchers)}(S)),Fe(e,{flushSync:h})}S.forEach(e=>{Qe(e.key),e.controller&&re.set(e.key,e.controller)});let D=()=>S.forEach(e=>Qe(e.key));U&&U.signal.addEventListener("abort",D);let{loaderResults:E,fetcherResults:x}=await Ve(O,o,g,S,t);if(t.signal.aborted)return{shortCircuited:!0};U&&U.signal.removeEventListener("abort",D),S.forEach(e=>re.delete(e.key));let M=De(E);if(M)return await $e(t,M.result,!0,{replace:d}),{shortCircuited:!0};if(M=De(x),M)return pe.add(M.key),await $e(t,M.result,!0,{replace:d}),{shortCircuited:!0};let{loaderData:k,errors:L}=ve(O,o,E,f,S,x,Pe);Pe.forEach((e,t)=>{e.subscribe(r=>{(r||e.done)&&Pe.delete(t)})}),R.v7_partialHydration&&u&&O.errors&&(L=a({},O.errors,L));let P=et(),A=tt(ie),j=P||A||S.length>0;return a({matches:o,loaderData:k,errors:L},j?{fetchers:new Map(O.fetchers)}:{})}(y,r,l,p.active,s,n&&n.submission,n&&n.fetcherSubmission,n&&n.replace,n&&!0===n.initialHydration,d,m);g||(U=null,Be(r,a({matches:S||l},ge(m),{loaderData:D,errors:E})))}function Ne(e){return e&&!Me(e[1])?{[e[0]]:e[1].data}:O.actionData?0===Object.keys(O.actionData).length?null:O.actionData:void 0}async function $e(n,i,l,c){let{submission:u,fetcherSubmission:h,preventScrollReset:f,replace:p}=void 0===c?{}:c;i.response.headers.has("X-Remix-Revalidate")&&($=!0);let m=i.response.headers.get("Location");s(m,"Expected a Location header on the redirect Response"),m=he(m,new URL(n.url),w,e.history);let v=d(O.location,m,{_isRedirect:!0});if(r){let r=!1;if(i.response.headers.has("X-Remix-Reload-Document"))r=!0;else if(G.test(m)){const a=e.history.createURL(m);r=a.origin!==t.location.origin||null==M(a.pathname,w)}if(r)return void(p?t.location.replace(m):t.location.assign(m))}U=null;let y=!0===p||i.response.headers.has("X-Remix-Replace")?o.Replace:o.Push,{formMethod:g,formAction:b,formEncType:S}=O.navigation;!u&&!h&&g&&b&&S&&(u=Oe(O.navigation));let D=u||h;if(V.has(i.response.status)&&D&&Ae(D.formMethod))await We(y,v,{submission:a({},D,{formAction:m}),preventScrollReset:f||I,enableViewTransition:l?H:void 0});else{let e=ze(v,u);await We(y,v,{overrideNavigation:e,fetcherSubmission:h,preventScrollReset:f||I,enableViewTransition:l?H:void 0})}}async function qe(e,t,r,o,n,c){let d,u={};try{d=await async function(e,t,r,o,n,i,c,d,u,h){let m=i.map(e=>e.route.lazy?async function(e,t,r){if(!e.lazy)return;let o=await e.lazy();if(!e.lazy)return;let n=r[e.id];s(n,"No route found in manifest");let i={};for(let e in o){let t=void 0!==n[e]&&"hasErrorBoundary"!==e;l(!t,'Route "'+n.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||p.has(e)||(i[e]=o[e])}Object.assign(n,i),Object.assign(n,a({},t(n),{lazy:void 0}))}(e.route,u,d):void 0),v=i.map((e,r)=>{let i=m[r],l=n.some(t=>t.route.id===e.route.id);return a({},e,{shouldLoad:l,resolve:async r=>(r&&"GET"===o.method&&(e.route.lazy||e.route.loader)&&(l=!0),l?async function(e,t,r,a,o,n){let i,l,c=a=>{let i,s=new Promise((e,t)=>i=t);l=()=>i(),t.signal.addEventListener("abort",l);let c=o=>"function"!=typeof a?Promise.reject(new Error('You cannot call the handler for a route which defines a boolean "'+e+'" [routeId: '+r.route.id+"]")):a({request:t,params:r.params,context:n},...void 0!==o?[o]:[]),d=(async()=>{try{return{type:"data",result:await(o?o(e=>c(e)):c())}}catch(e){return{type:"error",result:e}}})();return Promise.race([d,s])};try{let o=r.route[e];if(a)if(o){let e,[t]=await Promise.all([c(o).catch(t=>{e=t}),a]);if(void 0!==e)throw e;i=t}else{if(await a,o=r.route[e],!o){if("action"===e){let e=new URL(t.url),a=e.pathname+e.search;throw Se(405,{method:t.method,pathname:a,routeId:r.route.id})}return{type:f.data,result:void 0}}i=await c(o)}else{if(!o){let e=new URL(t.url);throw Se(404,{pathname:e.pathname+e.search})}i=await c(o)}s(void 0!==i.result,"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){return{type:f.error,result:e}}finally{l&&t.signal.removeEventListener("abort",l)}return i}(t,o,e,i,r,h):Promise.resolve({type:f.data,result:void 0}))})}),y=await e({matches:v,request:o,params:i[0].params,fetcherKey:c,context:h});try{await Promise.all(m)}catch(e){}return y}(S,e,0,r,o,n,c,g,i)}catch(e){return o.forEach(t=>{u[t.route.id]={type:f.error,error:e}}),u}for(let[e,t]of Object.entries(d))if(Ee(t)){let a=t.result;u[e]={type:f.redirect,response:ue(a,r,e,n,w,R.v7_relativeSplatPath)}}else u[e]=await de(t);return u}async function Ve(t,r,a,o,n){let i=t.matches,s=qe("loader",0,n,a,r,null),l=Promise.all(o.map(async t=>{if(t.matches&&t.match&&t.controller){let r=(await qe("loader",0,fe(e.history,t.path,t.controller.signal),[t.match],t.matches,t.key))[t.match.route.id];return{[t.key]:r}}return Promise.resolve({[t.key]:{type:f.error,error:Se(404,{pathname:t.path})}})})),c=await s,d=(await l).reduce((e,t)=>Object.assign(e,t),{});return await Promise.all([je(r,c,n.signal,i,t.loaderData),Ce(r,d,o)]),{loaderResults:c,fetcherResults:d}}function Ye(){$=!0,q.push(...it()),me.forEach((e,t)=>{re.has(t)&&Z.add(t),Qe(t)})}function Je(e,t,r){void 0===r&&(r={}),O.fetchers.set(e,t),Fe({fetchers:new Map(O.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function Xe(e,t,r,a){void 0===a&&(a={});let o=be(O.matches,t);Ke(e),Fe({errors:{[o.route.id]:r},fetchers:new Map(O.fetchers)},{flushSync:!0===(a&&a.flushSync)})}function Ge(e){return Re.set(e,(Re.get(e)||0)+1),Le.has(e)&&Le.delete(e),O.fetchers.get(e)||J}function Ke(e){let t=O.fetchers.get(e);!re.has(e)||t&&"loading"===t.state&&le.has(e)||Qe(e),me.delete(e),le.delete(e),pe.delete(e),R.v7_fetcherPersist&&Le.delete(e),Z.delete(e),O.fetchers.delete(e)}function Qe(e){let t=re.get(e);t&&(t.abort(),re.delete(e))}function Ze(e){for(let t of e){let e=He(Ge(t).data);O.fetchers.set(t,e)}}function et(){let e=[],t=!1;for(let r of pe){let a=O.fetchers.get(r);s(a,"Expected fetcher: "+r),"loading"===a.state&&(pe.delete(r),e.push(r),t=!0)}return Ze(e),t}function tt(e){let t=[];for(let[r,a]of le)if(a0}function rt(e){O.blockers.delete(e),Ue.delete(e)}function at(e,t){let r=O.blockers.get(e)||X;s("unblocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"proceeding"===t.state||"blocked"===r.state&&"unblocked"===t.state||"proceeding"===r.state&&"unblocked"===t.state,"Invalid blocker state transition: "+r.state+" -> "+t.state);let a=new Map(O.blockers);a.set(e,t),Fe({blockers:a})}function ot(e){let{currentLocation:t,nextLocation:r,historyAction:a}=e;if(0===Ue.size)return;Ue.size>1&&l(!1,"A router only supports one blocker at a time");let o=Array.from(Ue.entries()),[n,i]=o[o.length-1],s=O.blockers.get(n);return s&&"proceeding"===s.state?void 0:i({currentLocation:t,nextLocation:r,historyAction:a})?n:void 0}function nt(e){let t=Se(404,{pathname:e}),r=c||b,{matches:a,route:o}=we(r);return it(),{notFoundMatches:a,route:o,error:t}}function it(e){let t=[];return Pe.forEach((r,a)=>{e&&!e(a)||(r.cancel(),t.push(a),Pe.delete(a))}),t}function st(e,t){return L&&L(e,t.map(e=>function(e,t){let{route:r,pathname:a,params:o}=e;return{id:r.id,pathname:a,params:o,data:t[r.id],handle:r.handle}}(e,O.loaderData)))||e.key}function lt(e,t){if(k){let r=st(e,t),a=k[r];if("number"==typeof a)return a}return null}function ct(e,t,r){if(D){if(!e)return{active:!0,matches:y(t,r,w,!0)||[]};if(Object.keys(e[0].params).length>0)return{active:!0,matches:y(t,r,w,!0)}}return{active:!1,matches:null}}async function dt(e,t,r,a){if(!D)return{type:"success",matches:e};let o=e;for(;;){let e=null==c,n=c||b,s=g;try{await D({signal:r,path:t,matches:o,fetcherKey:a,patch:(e,t)=>{r.aborted||se(e,t,n,s,i)}})}catch(e){return{type:"error",error:e,partialMatches:o}}finally{e&&!r.aborted&&(b=[...b])}if(r.aborted)return{type:"aborted"};let l=v(n,t,w);if(l)return{type:"success",matches:l};let d=y(n,t,w,!0);if(!d||o.length===d.length&&o.every((e,t)=>e.route.id===d[t].route.id))return{type:"success",matches:null};o=d}}return h={get basename(){return w},get future(){return R},get state(){return O},get routes(){return b},get window(){return t},initialize:function(){if(E=e.history.listen(t=>{let{action:r,location:a,delta:o}=t;if(_)return _(),void(_=void 0);l(0===Ue.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 n=ot({currentLocation:O.location,nextLocation:a,historyAction:r});if(n&&null!=o){let t=new Promise(e=>{_=e});return e.history.go(-1*o),void at(n,{state:"blocked",location:a,proceed(){at(n,{state:"proceeding",proceed:void 0,reset:void 0,location:a}),t.then(()=>e.history.go(o))},reset(){let e=new Map(O.blockers);e.set(n,X),Fe({blockers:e})}})}return We(r,a)}),r){!function(e,t){try{let r=e.sessionStorage.getItem(Q);if(r){let e=JSON.parse(r);for(let[r,a]of Object.entries(e||{}))a&&Array.isArray(a)&&t.set(r,new Set(a||[]))}}catch(e){}}(t,B);let e=()=>function(e,t){if(t.size>0){let r={};for(let[e,a]of t)r[e]=[...a];try{e.sessionStorage.setItem(Q,JSON.stringify(r))}catch(e){l(!1,"Failed to save applied view transitions in sessionStorage ("+e+").")}}}(t,B);t.addEventListener("pagehide",e),W=()=>t.removeEventListener("pagehide",e)}return O.initialized||We(o.Pop,O.location,{initialHydration:!0}),h},subscribe:function(e){return x.add(e),()=>x.delete(e)},enableScrollRestoration:function(e,t,r){if(k=e,P=t,L=r||null,!A&&O.navigation===Y){A=!0;let e=lt(O.location,O.matches);null!=e&&Fe({restoreScrollPosition:e})}return()=>{k=null,P=null,L=null}},navigate:async function t(r,n){if("number"==typeof r)return void e.history.go(r);let i=ee(O.location,O.matches,w,R.v7_prependBasename,r,R.v7_relativeSplatPath,null==n?void 0:n.fromRouteId,null==n?void 0:n.relative),{path:s,submission:l,error:c}=te(R.v7_normalizeFormMethod,!1,i,n),u=O.location,h=d(O.location,s,n&&n.state);h=a({},h,e.history.encodeLocation(h));let f=n&&null!=n.replace?n.replace:void 0,p=o.Push;!0===f?p=o.Replace:!1===f||null!=l&&Ae(l.formMethod)&&l.formAction===O.location.pathname+O.location.search&&(p=o.Replace);let m=n&&"preventScrollReset"in n?!0===n.preventScrollReset:void 0,v=!0===(n&&n.flushSync),y=ot({currentLocation:u,nextLocation:h,historyAction:p});if(!y)return await We(p,h,{submission:l,pendingError:c,preventScrollReset:m,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:v});at(y,{state:"blocked",location:h,proceed(){at(y,{state:"proceeding",proceed:void 0,reset:void 0,location:h}),t(r,n)},reset(){let e=new Map(O.blockers);e.set(y,X),Fe({blockers:e})}})},fetch:function(t,r,a,o){if(n)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.");Qe(t);let i=!0===(o&&o.flushSync),l=c||b,d=ee(O.location,O.matches,w,R.v7_prependBasename,a,R.v7_relativeSplatPath,r,null==o?void 0:o.relative),u=v(l,d,w),h=ct(u,l,d);if(h.active&&h.matches&&(u=h.matches),!u)return void Xe(t,r,Se(404,{pathname:d}),{flushSync:i});let{path:f,submission:p,error:m}=te(R.v7_normalizeFormMethod,!0,d,o);if(m)return void Xe(t,r,m,{flushSync:i});let y=_e(u,f),g=!0===(o&&o.preventScrollReset);p&&Ae(p.formMethod)?async function(t,r,a,o,n,i,l,d,u){function h(e){if(!e.route.action&&!e.route.lazy){let e=Se(405,{method:u.formMethod,pathname:a,routeId:r});return Xe(t,r,e,{flushSync:l}),!0}return!1}if(Ye(),me.delete(t),!i&&h(o))return;let f=O.fetchers.get(t);Je(t,function(e,t){return{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}}(u,f),{flushSync:l});let p=new AbortController,m=fe(e.history,a,p.signal,u);if(i){let e=await dt(n,new URL(m.url).pathname,m.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void Xe(t,r,e.error,{flushSync:l});if(!e.matches)return void Xe(t,r,Se(404,{pathname:a}),{flushSync:l});if(h(o=_e(n=e.matches,a)))return}re.set(t,p);let y=ne,g=(await qe("action",0,m,[o],n,t))[o.route.id];if(m.signal.aborted)return void(re.get(t)===p&&re.delete(t));if(R.v7_fetcherPersist&&Le.has(t)){if(ke(g)||Me(g))return void Je(t,He(void 0))}else{if(ke(g))return re.delete(t),ie>y?void Je(t,He(void 0)):(pe.add(t),Je(t,Ie(u)),$e(m,g,!1,{fetcherSubmission:u,preventScrollReset:d}));if(Me(g))return void Xe(t,r,g.error)}if(xe(g))throw Se(400,{type:"defer-action"});let S=O.navigation.location||O.location,D=fe(e.history,S,p.signal),E=c||b,x="idle"!==O.navigation.state?v(E,O.navigation.location,w):O.matches;s(x,"Didn't find any matches after fetcher action");let M=++ne;le.set(t,M);let k=Ie(u,g.data);O.fetchers.set(t,k);let[L,P]=ae(e.history,O,x,u,S,!1,R.v7_skipActionErrorRevalidation,$,q,Z,Le,me,pe,E,w,[o.route.id,g]);P.filter(e=>e.key!==t).forEach(e=>{let t=e.key,r=O.fetchers.get(t),a=Ie(void 0,r?r.data:void 0);O.fetchers.set(t,a),Qe(t),e.controller&&re.set(t,e.controller)}),Fe({fetchers:new Map(O.fetchers)});let A=()=>P.forEach(e=>Qe(e.key));p.signal.addEventListener("abort",A);let{loaderResults:j,fetcherResults:C}=await Ve(O,x,L,P,D);if(p.signal.aborted)return;p.signal.removeEventListener("abort",A),le.delete(t),re.delete(t),P.forEach(e=>re.delete(e.key));let T=De(j);if(T)return $e(D,T.result,!1,{preventScrollReset:d});if(T=De(C),T)return pe.add(T.key),$e(D,T.result,!1,{preventScrollReset:d});let{loaderData:_,errors:I}=ve(O,x,j,void 0,P,C,Pe);if(O.fetchers.has(t)){let e=He(g.data);O.fetchers.set(t,e)}tt(M),"loading"===O.navigation.state&&M>ie?(s(z,"Expected pending action"),U&&U.abort(),Be(O.navigation.location,{matches:x,loaderData:_,errors:I,fetchers:new Map(O.fetchers)})):(Fe({errors:I,loaderData:ye(O.loaderData,_,x,I),fetchers:new Map(O.fetchers)}),$=!1)}(t,r,f,y,u,h.active,i,g,p):(me.set(t,{routeId:r,path:f}),async function(t,r,a,o,n,i,l,c,d){let u=O.fetchers.get(t);Je(t,Ie(d,u?u.data:void 0),{flushSync:l});let h=new AbortController,f=fe(e.history,a,h.signal);if(i){let e=await dt(n,new URL(f.url).pathname,f.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void Xe(t,r,e.error,{flushSync:l});if(!e.matches)return void Xe(t,r,Se(404,{pathname:a}),{flushSync:l});o=_e(n=e.matches,a)}re.set(t,h);let p=ne,m=(await qe("loader",0,f,[o],n,t))[o.route.id];if(xe(m)&&(m=await Te(m,f.signal,!0)||m),re.get(t)===h&&re.delete(t),!f.signal.aborted){if(!Le.has(t))return ke(m)?ie>p?void Je(t,He(void 0)):(pe.add(t),void await $e(f,m,!1,{preventScrollReset:c})):void(Me(m)?Xe(t,r,m.error):(s(!xe(m),"Unhandled fetcher deferred data"),Je(t,He(m.data))));Je(t,He(void 0))}}(t,r,f,y,u,h.active,i,g,p))},revalidate:function(){Ye(),Fe({revalidation:"loading"}),"submitting"!==O.navigation.state&&("idle"!==O.navigation.state?We(z||O.historyAction,O.navigation.location,{overrideNavigation:O.navigation,enableViewTransition:!0===H}):We(O.historyAction,O.location,{startUninterruptedRevalidation:!0}))},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Ge,deleteFetcher:function(e){let t=(Re.get(e)||0)-1;t<=0?(Re.delete(e),Le.add(e),R.v7_fetcherPersist||Ke(e)):Re.set(e,t),Fe({fetchers:new Map(O.fetchers)})},dispose:function(){E&&E(),W&&W(),x.clear(),U&&U.abort(),O.fetchers.forEach((e,t)=>Ke(t)),O.blockers.forEach((e,t)=>rt(t))},getBlocker:function(e,t){let r=O.blockers.get(e)||X;return Ue.get(e)!==t&&Ue.set(e,t),r},deleteBlocker:rt,patchRoutes:function(e,t){let r=null==c;se(e,t,c||b,g,i),r&&(b=[...b],Fe({}))},_internalFetchControllers:re,_internalActiveDeferreds:Pe,_internalSetRoutes:function(e){g={},c=m(e,i,void 0,g)}},h}function ee(e,t,r,a,o,n,i,s){let l,c;if(i){l=[];for(let e of t)if(l.push(e),e.route.id===i){c=e;break}}else l=t,c=t[t.length-1];let d=C(o||".",j(l,n),M(e.pathname,r)||e.pathname,"path"===s);if(null==o&&(d.search=e.search,d.hash=e.hash),(null==o||""===o||"."===o)&&c){let e=Ue(d.search);if(c.route.index&&!e)d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index";else if(!c.route.index&&e){let e=new URLSearchParams(d.search),t=e.getAll("index");e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let r=e.toString();d.search=r?"?"+r:""}}return a&&"/"!==r&&(d.pathname="/"===d.pathname?r:T([r,d.pathname])),u(d)}function te(e,t,r,a){if(!a||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(a))return{path:r};if(a.formMethod&&(o=a.formMethod,!$.has(o.toLowerCase())))return{path:r,error:Se(405,{method:a.formMethod})};var o;let n,i,l=()=>({path:r,error:Se(400,{type:"invalid-body"})}),c=a.formMethod||"get",d=e?c.toUpperCase():c.toLowerCase(),f=Re(r);if(void 0!==a.body){if("text/plain"===a.formEncType){if(!Ae(d))return l();let e="string"==typeof a.body?a.body:a.body instanceof FormData||a.body instanceof URLSearchParams?Array.from(a.body.entries()).reduce((e,t)=>{let[r,a]=t;return""+e+r+"="+a+"\n"},""):String(a.body);return{path:r,submission:{formMethod:d,formAction:f,formEncType:a.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===a.formEncType){if(!Ae(d))return l();try{let e="string"==typeof a.body?JSON.parse(a.body):a.body;return{path:r,submission:{formMethod:d,formAction:f,formEncType:a.formEncType,formData:void 0,json:e,text:void 0}}}catch(e){return l()}}}if(s("function"==typeof FormData,"FormData is not available in this environment"),a.formData)n=pe(a.formData),i=a.formData;else if(a.body instanceof FormData)n=pe(a.body),i=a.body;else if(a.body instanceof URLSearchParams)n=a.body,i=me(n);else if(null==a.body)n=new URLSearchParams,i=new FormData;else try{n=new URLSearchParams(a.body),i=me(n)}catch(e){return l()}let p={formMethod:d,formAction:f,formEncType:a&&a.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(Ae(p.formMethod))return{path:r,submission:p};let m=h(r);return t&&m.search&&Ue(m.search)&&n.append("index",""),m.search="?"+n,{path:u(m),submission:p}}function re(e,t,r){void 0===r&&(r=!1);let a=e.findIndex(e=>e.route.id===t);return a>=0?e.slice(0,r?a+1:a):e}function ae(e,t,r,o,n,i,s,l,c,d,u,h,f,p,m,y){let g=y?Me(y[1])?y[1].error:y[1].data:void 0,b=e.createURL(t.location),w=e.createURL(n),S=r;i&&t.errors?S=re(r,Object.keys(t.errors)[0],!0):y&&Me(y[1])&&(S=re(r,y[0]));let D=y?y[1].statusCode:void 0,R=s&&D&&D>=400,E=S.filter((e,r)=>{let{route:n}=e;if(n.lazy)return!0;if(null==n.loader)return!1;if(i)return oe(n,t.loaderData,t.errors);if(function(e,t,r){let a=!t||r.route.id!==t.route.id,o=void 0===e[r.route.id];return a||o}(t.loaderData,t.matches[r],e)||c.some(t=>t===e.route.id))return!0;let s=t.matches[r],d=e;return ie(e,a({currentUrl:b,currentParams:s.params,nextUrl:w,nextParams:d.params},o,{actionResult:g,actionStatus:D,defaultShouldRevalidate:!R&&(l||b.pathname+b.search===w.pathname+w.search||b.search!==w.search||ne(s,d))}))}),x=[];return h.forEach((e,n)=>{if(i||!r.some(t=>t.route.id===e.routeId)||u.has(n))return;let s=v(p,e.path,m);if(!s)return void x.push({key:n,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});let c=t.fetchers.get(n),h=_e(s,e.path),y=!1;f.has(n)?y=!1:d.has(n)?(d.delete(n),y=!0):y=c&&"idle"!==c.state&&void 0===c.data?l:ie(h,a({currentUrl:b,currentParams:t.matches[t.matches.length-1].params,nextUrl:w,nextParams:r[r.length-1].params},o,{actionResult:g,actionStatus:D,defaultShouldRevalidate:!R&&l})),y&&x.push({key:n,routeId:e.routeId,path:e.path,matches:s,match:h,controller:new AbortController})}),[E,x]}function oe(e,t,r){if(e.lazy)return!0;if(!e.loader)return!1;let a=null!=t&&void 0!==t[e.id],o=null!=r&&void 0!==r[e.id];return!(!a&&o)&&("function"==typeof e.loader&&!0===e.loader.hydrate||!a&&!o)}function ne(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function ie(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}function se(e,t,r,a,o){var n;let i;if(e){let t=a[e];s(t,"No route found to patch children into: routeId = "+e),t.children||(t.children=[]),i=t.children}else i=r;let l=m(t.filter(e=>!i.some(t=>le(e,t))),o,[e||"_","patch",String((null==(n=i)?void 0:n.length)||"0")],a);i.push(...l)}function le(e,t){return"id"in e&&"id"in t&&e.id===t.id||e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive&&(!(e.children&&0!==e.children.length||t.children&&0!==t.children.length)||e.children.every((e,r)=>{var a;return null==(a=t.children)?void 0:a.some(t=>le(e,t))}))}async function ce(e){let{matches:t}=e,r=t.filter(e=>e.shouldLoad);return(await Promise.all(r.map(e=>e.resolve()))).reduce((e,t,a)=>Object.assign(e,{[r[a].route.id]:t}),{})}async function de(e){let{result:t,type:r}=e;if(Pe(t)){let e;try{let r=t.headers.get("Content-Type");e=r&&/\bapplication\/json\b/.test(r)?null==t.body?null:await t.json():await t.text()}catch(e){return{type:f.error,error:e}}return r===f.error?{type:f.error,error:new H(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:f.data,data:e,statusCode:t.status,headers:t.headers}}var a,o,n,i,s,l,c,d;return r===f.error?Le(t)?t.data instanceof Error?{type:f.error,error:t.data,statusCode:null==(n=t.init)?void 0:n.status,headers:null!=(i=t.init)&&i.headers?new Headers(t.init.headers):void 0}:{type:f.error,error:new H((null==(a=t.init)?void 0:a.status)||500,void 0,t.data),statusCode:F(t)?t.status:void 0,headers:null!=(o=t.init)&&o.headers?new Headers(t.init.headers):void 0}:{type:f.error,error:t,statusCode:F(t)?t.status:void 0}: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}(t)?{type:f.deferred,deferredData:t,statusCode:null==(s=t.init)?void 0:s.status,headers:(null==(l=t.init)?void 0:l.headers)&&new Headers(t.init.headers)}:Le(t)?{type:f.data,data:t.data,statusCode:null==(c=t.init)?void 0:c.status,headers:null!=(d=t.init)&&d.headers?new Headers(t.init.headers):void 0}:{type:f.data,data:t}}function ue(e,t,r,a,o,n){let i=e.headers.get("Location");if(s(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!G.test(i)){let s=a.slice(0,a.findIndex(e=>e.route.id===r)+1);i=ee(new URL(t.url),s,o,!0,i,n),e.headers.set("Location",i)}return e}function he(e,t,r,a){let o=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(G.test(e)){let a=e,n=a.startsWith("//")?new URL(t.protocol+a):new URL(a);if(o.includes(n.protocol))throw new Error("Invalid redirect location");let i=null!=M(n.pathname,r);if(n.origin===t.origin&&i)return n.pathname+n.search+n.hash}try{let t=a.createURL(e);if(o.includes(t.protocol))throw new Error("Invalid redirect location")}catch(e){}return e}function fe(e,t,r,a){let o=e.createURL(Re(t)).toString(),n={signal:r};if(a&&Ae(a.formMethod)){let{formMethod:e,formEncType:t}=a;n.method=e.toUpperCase(),"application/json"===t?(n.headers=new Headers({"Content-Type":t}),n.body=JSON.stringify(a.json)):"text/plain"===t?n.body=a.text:"application/x-www-form-urlencoded"===t&&a.formData?n.body=pe(a.formData):n.body=a.formData}return new Request(o,n)}function pe(e){let t=new URLSearchParams;for(let[r,a]of e.entries())t.append(r,"string"==typeof a?a:a.name);return t}function me(e){let t=new FormData;for(let[r,a]of e.entries())t.append(r,a);return t}function ve(e,t,r,o,n,i,l){let{loaderData:c,errors:d}=function(e,t,r,a,o){let n,i={},l=null,c=!1,d={},u=r&&Me(r[1])?r[1].error:void 0;return e.forEach(r=>{if(!(r.route.id in t))return;let h=r.route.id,f=t[h];if(s(!ke(f),"Cannot handle redirect results in processLoaderData"),Me(f)){let t=f.error;if(void 0!==u&&(t=u,u=void 0),l=l||{},o)l[h]=t;else{let r=be(e,h);null==l[r.route.id]&&(l[r.route.id]=t)}i[h]=void 0,c||(c=!0,n=F(f.error)?f.error.status:500),f.headers&&(d[h]=f.headers)}else xe(f)?(a.set(h,f.deferredData),i[h]=f.deferredData.data,null==f.statusCode||200===f.statusCode||c||(n=f.statusCode),f.headers&&(d[h]=f.headers)):(i[h]=f.data,f.statusCode&&200!==f.statusCode&&!c&&(n=f.statusCode),f.headers&&(d[h]=f.headers))}),void 0!==u&&r&&(l={[r[0]]:u},i[r[0]]=void 0),{loaderData:i,errors:l,statusCode:n||200,loaderHeaders:d}}(t,r,o,l,!1);return n.forEach(t=>{let{key:r,match:o,controller:n}=t,l=i[r];if(s(l,"Did not find corresponding fetcher result"),!n||!n.signal.aborted)if(Me(l)){let t=be(e.matches,null==o?void 0:o.route.id);d&&d[t.route.id]||(d=a({},d,{[t.route.id]:l.error})),e.fetchers.delete(r)}else if(ke(l))s(!1,"Unhandled fetcher revalidation redirect");else if(xe(l))s(!1,"Unhandled fetcher deferred data");else{let t=He(l.data);e.fetchers.set(r,t)}}),{loaderData:c,errors:d}}function ye(e,t,r,o){let n=a({},t);for(let a of r){let r=a.route.id;if(t.hasOwnProperty(r)?void 0!==t[r]&&(n[r]=t[r]):void 0!==e[r]&&a.route.loader&&(n[r]=e[r]),o&&o.hasOwnProperty(r))break}return n}function ge(e){return e?Me(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function be(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>!0===e.route.hasErrorBoundary)||e[0]}function we(e){let t=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:a,method:o,type:n,message:i}=void 0===t?{}:t,s="Unknown Server Error",l="Unknown @remix-run/router error";return 400===e?(s="Bad Request",o&&r&&a?l="You made a "+o+' request to "'+r+'" but did not provide a `loader` for route "'+a+'", so there is no way to handle the request.':"defer-action"===n?l="defer() is not supported in actions":"invalid-body"===n&&(l="Unable to encode submission body")):403===e?(s="Forbidden",l='Route "'+a+'" does not match URL "'+r+'"'):404===e?(s="Not Found",l='No route matches URL "'+r+'"'):405===e&&(s="Method Not Allowed",o&&r&&a?l="You made a "+o.toUpperCase()+' request to "'+r+'" but did not provide an `action` for route "'+a+'", so there is no way to handle the request.':o&&(l='Invalid request method "'+o.toUpperCase()+'"')),new H(e||500,s,new Error(l),!0)}function De(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[r,a]=t[e];if(ke(a))return{key:r,result:a}}}function Re(e){return u(a({},"string"==typeof e?h(e):e,{hash:""}))}function Ee(e){return Pe(e.result)&&q.has(e.result.status)}function xe(e){return e.type===f.deferred}function Me(e){return e.type===f.error}function ke(e){return(e&&e.type)===f.redirect}function Le(e){return"object"==typeof e&&null!=e&&"type"in e&&"data"in e&&"init"in e&&"DataWithResponseInit"===e.type}function Pe(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"==typeof e.headers&&void 0!==e.body}function Ae(e){return W.has(e.toLowerCase())}async function je(e,t,r,a,o){let n=Object.entries(t);for(let i=0;i(null==e?void 0:e.route.id)===s);if(!c)continue;let d=a.find(e=>e.route.id===c.route.id),u=null!=d&&!ne(d,c)&&void 0!==(o&&o[c.route.id]);xe(l)&&u&&await Te(l,r,!1).then(e=>{e&&(t[s]=e)})}}async function Ce(e,t,r){for(let a=0;a(null==e?void 0:e.route.id)===n)&&xe(l)&&(s(i,"Expected an AbortController for revalidating fetcher deferred result"),await Te(l,i.signal,!0).then(e=>{e&&(t[o]=e)}))}}async function Te(e,t,r){if(void 0===r&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:f.data,data:e.deferredData.unwrappedData}}catch(e){return{type:f.error,error:e}}return{type:f.data,data:e.deferredData.data}}}function Ue(e){return new URLSearchParams(e).getAll("index").some(e=>""===e)}function _e(e,t){let r="string"==typeof t?h(t).search:t.search;if(e[e.length-1].route.index&&Ue(r||""))return e[e.length-1];let a=A(e);return a[a.length-1]}function Oe(e){let{formMethod:t,formAction:r,formEncType:a,text:o,formData:n,json:i}=e;if(t&&r&&a)return null!=o?{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:void 0,text:o}:null!=n?{formMethod:t,formAction:r,formEncType:a,formData:n,json:void 0,text:void 0}:void 0!==i?{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:i,text:void 0}:void 0}function ze(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Ie(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function He(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}Symbol("deferred")}}]);