@janus-idp/backstage-plugin-jfrog-artifactory
Version:
The Jfrog Artifactory plugin displays information about your container images within the Jfrog Artifactory registry.
3 lines • 47.7 kB
JavaScript
/*! For license information please see 1613.ef600aa1.chunk.js.LICENSE.txt */
;(self.webpackChunkjanus_idp_backstage_plugin_jfrog_artifactory=self.webpackChunkjanus_idp_backstage_plugin_jfrog_artifactory||[]).push([[1613],{21613:(e,t,r)=>{function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},a.apply(this,arguments)}var o;r.d(t,{AO:()=>f,B6:()=>C,G3:()=>le,Gh:()=>B,HS:()=>H,HW:()=>se,Oi:()=>c,Pq:()=>q,Rr:()=>p,Sk:()=>G,TM:()=>l,V2:()=>X,VV:()=>Q,aE:()=>he,o1:()=>O,pX:()=>Z,pb:()=>U,rc:()=>o,ro:()=>w,sC:()=>i,tH:()=>K,tW:()=>_,ue:()=>b,v6:()=>V,yD:()=>W,zR:()=>s}),function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(o||(o={}));const n="popstate";function i(e){void 0===e&&(e={});let t,{initialEntries:r=["/"],initialIndex:a,v5Compat:n=!1}=e;t=r.map(((e,t)=>m(e,"string"==typeof e?null:e.state,0===t?"default":void 0)));let i=c(null==a?t.length-1:a),s=o.Pop,l=null;function c(e){return Math.min(Math.max(e,0),t.length-1)}function u(){return t[i]}function m(e,r,a){void 0===r&&(r=null);let o=h(t?u().pathname:"/",e,r,a);return d("/"===o.pathname.charAt(0),"relative pathnames are not supported in memory history: "+JSON.stringify(e)),o}function y(e){return"string"==typeof e?e:f(e)}return{get index(){return i},get action(){return s},get location(){return u()},createHref:y,createURL:e=>new URL(y(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?p(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,r){s=o.Push;let a=m(e,r);i+=1,t.splice(i,t.length,a),n&&l&&l({action:s,location:a,delta:1})},replace(e,r){s=o.Replace;let a=m(e,r);t[i]=a,n&&l&&l({action:s,location:a,delta:0})},go(e){s=o.Pop;let r=c(i+e),a=t[r];i=r,l&&l({action:s,location:a,delta:e})},listen:e=>(l=e,()=>{l=null})}}function s(e){return void 0===e&&(e={}),m((function(e,t){let{pathname:r,search:a,hash:o}=e.location;return h("",{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:f(t)}),null,e)}function l(e){return void 0===e&&(e={}),m((function(e,t){let{pathname:r="/",search:a="",hash:o=""}=p(e.location.hash.substr(1));return r.startsWith("/")||r.startsWith(".")||(r="/"+r),h("",{pathname:r,search:a,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let r=e.document.querySelector("base"),a="";if(r&&r.getAttribute("href")){let t=e.location.href,r=t.indexOf("#");a=-1===r?t:t.slice(0,r)}return a+"#"+("string"==typeof t?t:f(t))}),(function(e,t){d("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),e)}function c(e,t){if(!1===e||null==e)throw new Error(t)}function d(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function u(e,t){return{usr:e.state,key:e.key,idx:t}}function h(e,t,r,o){return void 0===r&&(r=null),a({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?p(t):t,{state:r,key:t&&t.key||o||Math.random().toString(36).substr(2,8)})}function f(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 p(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}function m(e,t,r,i){void 0===i&&(i={});let{window:s=document.defaultView,v5Compat:l=!1}=i,d=s.history,p=o.Pop,m=null,y=v();function v(){return(d.state||{idx:null}).idx}function g(){p=o.Pop;let e=v(),t=null==e?null:e-y;y=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:f(e);return r=r.replace(/ $/,"%20"),c(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)}null==y&&(y=0,d.replaceState(a({},d.state,{idx:y}),""));let w={get action(){return p},get location(){return e(s,d)},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=>t(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=o.Push;let a=h(w.location,e,t);r&&r(a,e),y=v()+1;let n=u(a,y),i=w.createHref(a);try{d.pushState(n,"",i)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;s.location.assign(i)}l&&m&&m({action:p,location:w.location,delta:1})},replace:function(e,t){p=o.Replace;let a=h(w.location,e,t);r&&r(a,e),y=v();let n=u(a,y),i=w.createHref(a);d.replaceState(n,"",i),l&&m&&m({action:p,location:w.location,delta:0})},go:e=>d.go(e)};return w}var y;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(y||(y={}));const v=new Set(["lazy","caseSensitive","path","id","index","children"]);function g(e,t,r,o){return void 0===r&&(r=[]),void 0===o&&(o={}),e.map(((e,n)=>{let i=[...r,n],s="string"==typeof e.id?e.id:i.join("-");if(c(!0!==e.index||!e.children,"Cannot specify children on an index route"),c(!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 r=a({},e,t(e),{id:s});return o[s]=r,r}{let r=a({},e,t(e),{id:s,children:void 0});return o[s]=r,e.children&&(r.children=g(e.children,t,i,o)),r}}))}function b(e,t,r){void 0===r&&(r="/");let a=U(("string"==typeof t?p(t):t).pathname||"/",r);if(null==a)return null;let o=S(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)))))}(o);let n=null;for(let e=0;null==n&&e<o.length;++e){let t=T(a);n=j(o[e],t)}return n}function w(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}}function S(e,t,r,a){void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===a&&(a="");let o=(e,o,n)=>{let i={relativePath:void 0===n?e.path||"":n,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};i.relativePath.startsWith("/")&&(c(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 s=H([a,i.relativePath]),l=r.concat(i);e.children&&e.children.length>0&&(c(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+s+'".'),S(e.children,t,l,s)),(null!=e.path||e.index)&&t.push({path:s,score:A(s,e.index),routesMeta:l})};return e.forEach(((e,t)=>{var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?"))for(let r of D(e.path))o(e,t,r);else o(e,t)})),t}function D(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=D(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 E=/^:[\w-]+$/,R=3,x=2,P=1,k=10,L=-2,M=e=>"*"===e;function A(e,t){let r=e.split("/"),a=r.length;return r.some(M)&&(a+=L),t&&(a+=x),r.filter((e=>!M(e))).reduce(((e,t)=>e+(E.test(t)?R:""===t?P:k)),a)}function j(e,t){let{routesMeta:r}=e,a={},o="/",n=[];for(let e=0;e<r.length;++e){let i=r[e],s=e===r.length-1,l="/"===o?t:t.slice(o.length)||"/",c=C({path:i.relativePath,caseSensitive:i.caseSensitive,end:s},l);if(!c)return null;Object.assign(a,c.params);let d=i.route;n.push({params:a,pathname:H([o,c.pathname]),pathnameBase:$(H([o,c.pathnameBase])),route:d}),"/"!==c.pathnameBase&&(o=H([o,c.pathnameBase]))}return n}function _(e,t){void 0===t&&(t={});let r=e;r.endsWith("*")&&"*"!==r&&!r.endsWith("/*")&&(d(!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 a=r.startsWith("/")?"/":"",o=e=>null==e?"":"string"==typeof e?e:String(e);return a+r.split(/\/+/).map(((e,r,a)=>{if(r===a.length-1&&"*"===e)return o(t["*"]);const n=e.match(/^:([\w-]+)(\??)$/);if(n){const[,e,r]=n;let a=t[e];return c("?"===r||null!=a,'Missing ":'+e+'" param'),o(a)}return e.replace(/\?$/g,"")})).filter((e=>!!e)).join("/")}function C(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=function(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!0),d("*"===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 a=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,r)=>(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 T(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return d(!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 U(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)||"/"}function O(e,t){void 0===t&&(t="/");let{pathname:r,search:a="",hash:o=""}="string"==typeof e?p(e):e,n=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:n,search:F(a),hash:N(o)}}function z(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 <Link to="..."> and the router will parse it for you.'}function I(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function W(e,t){let r=I(e);return t?r.map(((t,r)=>r===e.length-1?t.pathname:t.pathnameBase)):r.map((e=>e.pathnameBase))}function B(e,t,r,o){let n;void 0===o&&(o=!1),"string"==typeof e?n=p(e):(n=a({},e),c(!n.pathname||!n.pathname.includes("?"),z("?","pathname","search",n)),c(!n.pathname||!n.pathname.includes("#"),z("#","pathname","hash",n)),c(!n.search||!n.search.includes("#"),z("#","search","hash",n)));let i,s=""===e||""===n.pathname,l=s?"/":n.pathname;if(null==l)i=r;else{let e=t.length-1;if(!o&&l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;n.pathname=t.join("/")}i=e>=0?t[e]:"/"}let d=O(n,i),u=l&&"/"!==l&&l.endsWith("/"),h=(s||"."===l)&&r.endsWith("/");return d.pathname.endsWith("/")||!u&&!h||(d.pathname+="/"),d}const H=e=>e.join("/").replace(/\/\/+/g,"/"),$=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),F=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",N=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",q=function(e,t){void 0===t&&(t={});let r="number"==typeof t?{status:t}:t,o=new Headers(r.headers);return o.has("Content-Type")||o.set("Content-Type","application/json; charset=utf-8"),new Response(JSON.stringify(e),a({},r,{headers:o}))};class K extends Error{}class J{constructor(e,t){let r;this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],c(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 a=()=>r(new K("Deferred data aborted"));this.unlistenAbortSignal=()=>this.controller.signal.removeEventListener("abort",a),this.controller.signal.addEventListener("abort",a),this.data=Object.entries(e).reduce(((e,t)=>{let[r,a]=t;return Object.assign(e,{[r]:this.trackPromise(r,a)})}),{}),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,a){if(this.controller.signal.aborted&&r instanceof K)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===a){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===a?(Object.defineProperty(e,"_error",{get:()=>r}),this.emit(!1,t),Promise.reject(r)):(Object.defineProperty(e,"_data",{get:()=>a}),this.emit(!1,t),a)}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((a=>{e.removeEventListener("abort",r),(a||this.done)&&t(a)}))}))}return t}get done(){return 0===this.pendingKeysSet.size}get unwrappedData(){return c(null!==this.data&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce(((e,t)=>{let[r,a]=t;return Object.assign(e,{[r]:Y(a)})}),{})}get pendingKeys(){return Array.from(this.pendingKeysSet)}}function Y(e){if(!function(e){return e instanceof Promise&&!0===e._tracked}(e))return e;if(e._error)throw e._error;return e._data}const V=function(e,t){return void 0===t&&(t={}),new J(e,"number"==typeof t?{status:t}:t)},X=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}))},G=(e,t)=>{let r=X(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r};class Q{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 Z(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}const ee=["post","put","patch","delete"],te=new Set(ee),re=["get",...ee],ae=new Set(re),oe=new Set([301,302,303,307,308]),ne=new Set([307,308]),ie={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},se={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},le={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ce=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,de=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),ue="remix-router-transitions";function he(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(c(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=de;let s,l,u={},f=g(e.routes,i,void 0,u),p=e.basename||"/",m=e.unstable_dataStrategy||be,v=a({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,unstable_skipActionErrorRevalidation:!1},e.future),S=null,D=new Set,E=null,R=null,x=null,P=null!=e.hydrationData,k=b(f,e.history.location,p),L=null;if(null==k){let t=Ae(404,{pathname:e.history.location.pathname}),{matches:r,route:a}=Me(f);k=r,L={[a.id]:t}}let M,A=k.some((e=>e.route.lazy)),j=k.some((e=>e.route.loader));if(A)l=!1;else if(j)if(v.v7_partialHydration){let t=e.hydrationData?e.hydrationData.loaderData:null,r=e.hydrationData?e.hydrationData.errors:null,a=e=>!e.route.loader||("function"!=typeof e.route.loader||!0!==e.route.loader.hydrate)&&(t&&void 0!==t[e.route.id]||r&&void 0!==r[e.route.id]);if(r){let e=k.findIndex((e=>void 0!==r[e.route.id]));l=k.slice(0,e+1).every(a)}else l=k.every(a)}else l=null!=e.hydrationData;else l=!0;let _,C={historyAction:e.history.action,location:e.history.location,matches:k,initialized:l,navigation:ie,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||L,fetchers:new Map,blockers:new Map},T=o.Pop,O=!1,z=!1,I=new Map,W=null,B=!1,H=!1,$=[],F=[],N=new Map,q=0,K=-1,J=new Map,Y=new Set,V=new Map,X=new Map,G=new Set,ee=new Map,te=new Map,re=!1;function ae(e,t){void 0===t&&(t={}),C=a({},C,e);let r=[],o=[];v.v7_fetcherPersist&&C.fetchers.forEach(((e,t)=>{"idle"===e.state&&(G.has(t)?o.push(t):r.push(t))})),[...D].forEach((e=>e(C,{deletedFetchers:o,unstable_viewTransitionOpts:t.viewTransitionOpts,unstable_flushSync:!0===t.flushSync}))),v.v7_fetcherPersist&&(r.forEach((e=>C.fetchers.delete(e))),o.forEach((e=>Ye(e))))}function he(t,r,n){var i,l;let c,{flushSync:d}=void 0===n?{}:n,u=null!=C.actionData&&null!=C.navigation.formMethod&&ze(C.navigation.formMethod)&&"loading"===C.navigation.state&&!0!==(null==(i=t.state)?void 0:i._isRedirect);c=r.actionData?Object.keys(r.actionData).length>0?r.actionData:null:u?C.actionData:null;let h=r.loaderData?Pe(C.loaderData,r.loaderData,r.matches||[],r.errors):C.loaderData,p=C.blockers;p.size>0&&(p=new Map(p),p.forEach(((e,t)=>p.set(t,le))));let m,y=!0===O||null!=C.navigation.formMethod&&ze(C.navigation.formMethod)&&!0!==(null==(l=t.state)?void 0:l._isRedirect);if(s&&(f=s,s=void 0),B||T===o.Pop||(T===o.Push?e.history.push(t,t.state):T===o.Replace&&e.history.replace(t,t.state)),T===o.Pop){let e=I.get(C.location.pathname);e&&e.has(t.pathname)?m={currentLocation:C.location,nextLocation:t}:I.has(t.pathname)&&(m={currentLocation:t,nextLocation:C.location})}else if(z){let e=I.get(C.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),I.set(C.location.pathname,e)),m={currentLocation:C.location,nextLocation:t}}ae(a({},r,{actionData:c,loaderData:h,historyAction:T,location:t,initialized:!0,navigation:ie,revalidation:"idle",restoreScrollPosition:ot(t,r.matches||C.matches),preventScrollReset:y,blockers:p}),{viewTransitionOpts:m,flushSync:!0===d}),T=o.Pop,O=!1,z=!1,B=!1,H=!1,$=[],F=[]}async function ye(t,r,n){_&&_.abort(),_=null,T=t,B=!0===(n&&n.startUninterruptedRevalidation),function(e,t){if(E&&x){let r=at(e,t);E[r]=x()}}(C.location,C.matches),O=!0===(n&&n.preventScrollReset),z=!0===(n&&n.enableViewTransition);let i=s||f,l=n&&n.overrideNavigation,c=b(i,r,p),d=!0===(n&&n.flushSync);if(!c){let e=Ae(404,{pathname:r.pathname}),{matches:t,route:a}=Me(i);return rt(),void he(r,{matches:t,loaderData:{},errors:{[a.id]:e}},{flushSync:d})}if(C.initialized&&!H&&(u=C.location,h=r,u.pathname===h.pathname&&u.search===h.search&&(""===u.hash?""!==h.hash:u.hash===h.hash||""!==h.hash))&&!(n&&n.submission&&ze(n.submission.formMethod)))return void he(r,{matches:c},{flushSync:d});var u,h;_=new AbortController;let m,g=De(e.history,r,_.signal,n&&n.submission);if(n&&n.pendingError)m=[Le(c).route.id,{type:y.error,error:n.pendingError}];else if(n&&n.submission&&ze(n.submission.formMethod)){let t=await async function(e,t,r,a,n){void 0===n&&(n={}),_e();let i,s=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}}(t,r);ae({navigation:s},{flushSync:!0===n.flushSync});let l=He(a,t);if(l.route.action||l.route.lazy){if(i=(await Ee("action",e,[l],a))[0],e.signal.aborted)return{shortCircuited:!0}}else i={type:y.error,error:Ae(405,{method:e.method,pathname:t.pathname,routeId:l.route.id})};if(Ue(i)){let t;return t=n&&null!=n.replace?n.replace:Se(i.response.headers.get("Location"),new URL(e.url),p)===C.location.pathname+C.location.search,await ve(e,i,{submission:r,replace:t}),{shortCircuited:!0}}if(Ce(i))throw Ae(400,{type:"defer-action"});if(Te(i)){let e=Le(a,l.route.id);return!0!==(n&&n.replace)&&(T=o.Push),{pendingActionResult:[e.route.id,i]}}return{pendingActionResult:[l.route.id,i]}}(g,r,n.submission,c,{replace:n.replace,flushSync:d});if(t.shortCircuited)return;m=t.pendingActionResult,l=Fe(r,n.submission),d=!1,g=De(e.history,g.url,g.signal)}let{shortCircuited:w,loaderData:S,errors:D}=await async function(t,r,o,n,i,l,c,d,u,h){let m=n||Fe(r,i),y=i||l||$e(m),g=s||f,[b,w]=me(e.history,C,o,y,r,v.v7_partialHydration&&!0===d,v.unstable_skipActionErrorRevalidation,H,$,F,G,V,Y,g,p,h);if(rt((e=>!(o&&o.some((t=>t.route.id===e)))||b&&b.some((t=>t.route.id===e)))),K=++q,0===b.length&&0===w.length){let e=Ge();return he(r,a({matches:o,loaderData:{},errors:h&&Te(h[1])?{[h[0]]:h[1].error}:null},ke(h),e?{fetchers:new Map(C.fetchers)}:{}),{flushSync:u}),{shortCircuited:!0}}if(!(B||v.v7_partialHydration&&d)){let e;w.forEach((e=>{let t=C.fetchers.get(e.key),r=Ne(void 0,t?t.data:void 0);C.fetchers.set(e.key,r)})),h&&!Te(h[1])?e={[h[0]]:h[1].data}:C.actionData&&(e=0===Object.keys(C.actionData).length?null:C.actionData),ae(a({navigation:m},void 0!==e?{actionData:e}:{},w.length>0?{fetchers:new Map(C.fetchers)}:{}),{flushSync:u})}w.forEach((e=>{N.has(e.key)&&Ve(e.key),e.controller&&N.set(e.key,e.controller)}));let S=()=>w.forEach((e=>Ve(e.key)));_&&_.signal.addEventListener("abort",S);let{loaderResults:D,fetcherResults:E}=await Re(C.matches,o,b,w,t);if(t.signal.aborted)return{shortCircuited:!0};_&&_.signal.removeEventListener("abort",S),w.forEach((e=>N.delete(e.key)));let R=je([...D,...E]);if(R){if(R.idx>=b.length){let e=w[R.idx-b.length].key;Y.add(e)}return await ve(t,R.result,{replace:c}),{shortCircuited:!0}}let{loaderData:x,errors:P}=xe(C,o,b,D,h,w,E,ee);ee.forEach(((e,t)=>{e.subscribe((r=>{(r||e.done)&&ee.delete(t)}))})),v.v7_partialHydration&&d&&C.errors&&Object.entries(C.errors).filter((e=>{let[t]=e;return!b.some((e=>e.route.id===t))})).forEach((e=>{let[t,r]=e;P=Object.assign(P||{},{[t]:r})}));let k=Ge(),L=Qe(K),M=k||L||w.length>0;return a({loaderData:x,errors:P},M?{fetchers:new Map(C.fetchers)}:{})}(g,r,c,l,n&&n.submission,n&&n.fetcherSubmission,n&&n.replace,n&&!0===n.initialHydration,d,m);w||(_=null,he(r,a({matches:c},ke(m),{loaderData:S,errors:D})))}async function ve(n,i,s){let{submission:l,fetcherSubmission:d,replace:u}=void 0===s?{}:s;i.response.headers.has("X-Remix-Revalidate")&&(H=!0);let f=i.response.headers.get("Location");c(f,"Expected a Location header on the redirect Response"),f=Se(f,new URL(n.url),p);let m=h(C.location,f,{_isRedirect:!0});if(r){let r=!1;if(i.response.headers.has("X-Remix-Reload-Document"))r=!0;else if(ce.test(f)){const a=e.history.createURL(f);r=a.origin!==t.location.origin||null==U(a.pathname,p)}if(r)return void(u?t.location.replace(f):t.location.assign(f))}_=null;let y=!0===u?o.Replace:o.Push,{formMethod:v,formAction:g,formEncType:b}=C.navigation;!l&&!d&&v&&g&&b&&(l=$e(C.navigation));let w=l||d;if(ne.has(i.response.status)&&w&&ze(w.formMethod))await ye(y,m,{submission:a({},w,{formAction:f}),preventScrollReset:O});else{let e=Fe(m,l);await ye(y,m,{overrideNavigation:e,fetcherSubmission:d,preventScrollReset:O})}}async function Ee(e,t,r,o){try{let n=await async function(e,t,r,o,n,i,s,l){let d=o.reduce(((e,t)=>e.add(t.route.id)),new Set),u=new Set,h=await e({matches:n.map((e=>{let o=d.has(e.route.id);return a({},e,{shouldLoad:o,resolve:a=>(u.add(e.route.id),o?async function(e,t,r,a,o,n,i){let s,l,d=a=>{let o,s=new Promise(((e,t)=>o=t));l=()=>o(),t.signal.addEventListener("abort",l);let c,d=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:i},...void 0!==o?[o]:[]);return c=n?n((e=>d(e))):(async()=>{try{return{type:"data",result:await d()}}catch(e){return{type:"error",result:e}}})(),Promise.race([c,s])};try{let n=r.route[e];if(r.route.lazy)if(n){let e,[t]=await Promise.all([d(n).catch((t=>{e=t})),ge(r.route,o,a)]);if(void 0!==e)throw e;s=t}else{if(await ge(r.route,o,a),n=r.route[e],!n){if("action"===e){let e=new URL(t.url),a=e.pathname+e.search;throw Ae(405,{method:t.method,pathname:a,routeId:r.route.id})}return{type:y.data,result:void 0}}s=await d(n)}else{if(!n){let e=new URL(t.url);throw Ae(404,{pathname:e.pathname+e.search})}s=await d(n)}c(void 0!==s.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:y.error,result:e}}finally{l&&t.signal.removeEventListener("abort",l)}return s}(t,r,e,i,s,a,l):Promise.resolve({type:y.data,result:void 0}))})})),request:r,params:n[0].params,context:l});return n.forEach((e=>c(u.has(e.route.id),'`match.resolve()` was not called for route id "'+e.route.id+'". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.'))),h.filter(((e,t)=>d.has(n[t].route.id)))}(m,e,t,r,o,u,i);return await Promise.all(n.map(((e,a)=>{if(function(e){return Oe(e.result)&&oe.has(e.result.status)}(e)){let n=e.result;return{type:y.redirect,response:we(n,t,r[a].route.id,o,p,v.v7_relativeSplatPath)}}return async function(e){let{result:t,type:r,status:a}=e;if(Oe(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:y.error,error:e}}return r===y.error?{type:y.error,error:new Q(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:y.data,data:e,statusCode:t.status,headers:t.headers}}return r===y.error?{type:y.error,error:t,statusCode:Z(t)?t.status:a}: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:y.deferred,deferredData:t,statusCode:null==(o=t.init)?void 0:o.status,headers:(null==(n=t.init)?void 0:n.headers)&&new Headers(t.init.headers)}:{type:y.data,data:t,statusCode:a};var o,n}(e)})))}catch(e){return r.map((()=>({type:y.error,error:e})))}}async function Re(t,r,a,o,n){let[i,...s]=await Promise.all([a.length?Ee("loader",n,a,r):[],...o.map((t=>t.matches&&t.match&&t.controller?Ee("loader",De(e.history,t.path,t.controller.signal),[t.match],t.matches).then((e=>e[0])):Promise.resolve({type:y.error,error:Ae(404,{pathname:t.path})})))]);return await Promise.all([Ie(t,a,i,i.map((()=>n.signal)),!1,C.loaderData),Ie(t,o.map((e=>e.match)),s,o.map((e=>e.controller?e.controller.signal:null)),!0)]),{loaderResults:i,fetcherResults:s}}function _e(){H=!0,$.push(...rt()),V.forEach(((e,t)=>{N.has(t)&&(F.push(t),Ve(t))}))}function Be(e,t,r){void 0===r&&(r={}),C.fetchers.set(e,t),ae({fetchers:new Map(C.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function Ke(e,t,r,a){void 0===a&&(a={});let o=Le(C.matches,t);Ye(e),ae({errors:{[o.route.id]:r},fetchers:new Map(C.fetchers)},{flushSync:!0===(a&&a.flushSync)})}function Je(e){return v.v7_fetcherPersist&&(X.set(e,(X.get(e)||0)+1),G.has(e)&&G.delete(e)),C.fetchers.get(e)||se}function Ye(e){let t=C.fetchers.get(e);!N.has(e)||t&&"loading"===t.state&&J.has(e)||Ve(e),V.delete(e),J.delete(e),Y.delete(e),G.delete(e),C.fetchers.delete(e)}function Ve(e){let t=N.get(e);c(t,"Expected fetch controller: "+e),t.abort(),N.delete(e)}function Xe(e){for(let t of e){let e=qe(Je(t).data);C.fetchers.set(t,e)}}function Ge(){let e=[],t=!1;for(let r of Y){let a=C.fetchers.get(r);c(a,"Expected fetcher: "+r),"loading"===a.state&&(Y.delete(r),e.push(r),t=!0)}return Xe(e),t}function Qe(e){let t=[];for(let[r,a]of J)if(a<e){let e=C.fetchers.get(r);c(e,"Expected fetcher: "+r),"loading"===e.state&&(Ve(r),J.delete(r),t.push(r))}return Xe(t),t.length>0}function Ze(e){C.blockers.delete(e),te.delete(e)}function et(e,t){let r=C.blockers.get(e)||le;c("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(C.blockers);a.set(e,t),ae({blockers:a})}function tt(e){let{currentLocation:t,nextLocation:r,historyAction:a}=e;if(0===te.size)return;te.size>1&&d(!1,"A router only supports one blocker at a time");let o=Array.from(te.entries()),[n,i]=o[o.length-1],s=C.blockers.get(n);return s&&"proceeding"===s.state?void 0:i({currentLocation:t,nextLocation:r,historyAction:a})?n:void 0}function rt(e){let t=[];return ee.forEach(((r,a)=>{e&&!e(a)||(r.cancel(),t.push(a),ee.delete(a))})),t}function at(e,t){return R&&R(e,t.map((e=>w(e,C.loaderData))))||e.key}function ot(e,t){if(E){let r=at(e,t),a=E[r];if("number"==typeof a)return a}return null}return M={get basename(){return p},get future(){return v},get state(){return C},get routes(){return f},get window(){return t},initialize:function(){if(S=e.history.listen((t=>{let{action:r,location:a,delta:o}=t;if(re)return void(re=!1);d(0===te.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=tt({currentLocation:C.location,nextLocation:a,historyAction:r});return n&&null!=o?(re=!0,e.history.go(-1*o),void et(n,{state:"blocked",location:a,proceed(){et(n,{state:"proceeding",proceed:void 0,reset:void 0,location:a}),e.history.go(o)},reset(){let e=new Map(C.blockers);e.set(n,le),ae({blockers:e})}})):ye(r,a)})),r){!function(e,t){try{let r=e.sessionStorage.getItem(ue);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,I);let e=()=>function(e,t){if(t.size>0){let r={};for(let[e,a]of t)r[e]=[...a];try{e.sessionStorage.setItem(ue,JSON.stringify(r))}catch(e){d(!1,"Failed to save applied view transitions in sessionStorage ("+e+").")}}}(t,I);t.addEventListener("pagehide",e),W=()=>t.removeEventListener("pagehide",e)}return C.initialized||ye(o.Pop,C.location,{initialHydration:!0}),M},subscribe:function(e){return D.add(e),()=>D.delete(e)},enableScrollRestoration:function(e,t,r){if(E=e,x=t,R=r||null,!P&&C.navigation===ie){P=!0;let e=ot(C.location,C.matches);null!=e&&ae({restoreScrollPosition:e})}return()=>{E=null,x=null,R=null}},navigate:async function t(r,n){if("number"==typeof r)return void e.history.go(r);let i=fe(C.location,C.matches,p,v.v7_prependBasename,r,v.v7_relativeSplatPath,null==n?void 0:n.fromRouteId,null==n?void 0:n.relative),{path:s,submission:l,error:c}=pe(v.v7_normalizeFormMethod,!1,i,n),d=C.location,u=h(C.location,s,n&&n.state);u=a({},u,e.history.encodeLocation(u));let f=n&&null!=n.replace?n.replace:void 0,m=o.Push;!0===f?m=o.Replace:!1===f||null!=l&&ze(l.formMethod)&&l.formAction===C.location.pathname+C.location.search&&(m=o.Replace);let y=n&&"preventScrollReset"in n?!0===n.preventScrollReset:void 0,g=!0===(n&&n.unstable_flushSync),b=tt({currentLocation:d,nextLocation:u,historyAction:m});if(!b)return await ye(m,u,{submission:l,pendingError:c,preventScrollReset:y,replace:n&&n.replace,enableViewTransition:n&&n.unstable_viewTransition,flushSync:g});et(b,{state:"blocked",location:u,proceed(){et(b,{state:"proceeding",proceed:void 0,reset:void 0,location:u}),t(r,n)},reset(){let e=new Map(C.blockers);e.set(b,le),ae({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.");N.has(t)&&Ve(t);let i=!0===(o&&o.unstable_flushSync),l=s||f,d=fe(C.location,C.matches,p,v.v7_prependBasename,a,v.v7_relativeSplatPath,r,null==o?void 0:o.relative),u=b(l,d,p);if(!u)return void Ke(t,r,Ae(404,{pathname:d}),{flushSync:i});let{path:h,submission:m,error:y}=pe(v.v7_normalizeFormMethod,!0,d,o);if(y)return void Ke(t,r,y,{flushSync:i});let g=He(u,h);O=!0===(o&&o.preventScrollReset),m&&ze(m.formMethod)?async function(t,r,a,o,n,i,l){if(_e(),V.delete(t),!o.route.action&&!o.route.lazy){let e=Ae(405,{method:l.formMethod,pathname:a,routeId:r});return void Ke(t,r,e,{flushSync:i})}let d=C.fetchers.get(t);Be(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}}(l,d),{flushSync:i});let u=new AbortController,h=De(e.history,a,u.signal,l);N.set(t,u);let m=q,y=(await Ee("action",h,[o],n))[0];if(h.signal.aborted)return void(N.get(t)===u&&N.delete(t));if(v.v7_fetcherPersist&&G.has(t)){if(Ue(y)||Te(y))return void Be(t,qe(void 0))}else{if(Ue(y))return N.delete(t),K>m?void Be(t,qe(void 0)):(Y.add(t),Be(t,Ne(l)),ve(h,y,{fetcherSubmission:l}));if(Te(y))return void Ke(t,r,y.error)}if(Ce(y))throw Ae(400,{type:"defer-action"});let g=C.navigation.location||C.location,w=De(e.history,g,u.signal),S=s||f,D="idle"!==C.navigation.state?b(S,C.navigation.location,p):C.matches;c(D,"Didn't find any matches after fetcher action");let E=++q;J.set(t,E);let R=Ne(l,y.data);C.fetchers.set(t,R);let[x,P]=me(e.history,C,D,l,g,!1,v.unstable_skipActionErrorRevalidation,H,$,F,G,V,Y,S,p,[o.route.id,y]);P.filter((e=>e.key!==t)).forEach((e=>{let t=e.key,r=C.fetchers.get(t),a=Ne(void 0,r?r.data:void 0);C.fetchers.set(t,a),N.has(t)&&Ve(t),e.controller&&N.set(t,e.controller)})),ae({fetchers:new Map(C.fetchers)});let k=()=>P.forEach((e=>Ve(e.key)));u.signal.addEventListener("abort",k);let{loaderResults:L,fetcherResults:M}=await Re(C.matches,D,x,P,w);if(u.signal.aborted)return;u.signal.removeEventListener("abort",k),J.delete(t),N.delete(t),P.forEach((e=>N.delete(e.key)));let A=je([...L,...M]);if(A){if(A.idx>=x.length){let e=P[A.idx-x.length].key;Y.add(e)}return ve(w,A.result)}let{loaderData:j,errors:U}=xe(C,C.matches,x,L,void 0,P,M,ee);if(C.fetchers.has(t)){let e=qe(y.data);C.fetchers.set(t,e)}Qe(E),"loading"===C.navigation.state&&E>K?(c(T,"Expected pending action"),_&&_.abort(),he(C.navigation.location,{matches:D,loaderData:j,errors:U,fetchers:new Map(C.fetchers)})):(ae({errors:U,loaderData:Pe(C.loaderData,j,D,U),fetchers:new Map(C.fetchers)}),H=!1)}(t,r,h,g,u,i,m):(V.set(t,{routeId:r,path:h}),async function(t,r,a,o,n,i,s){let l=C.fetchers.get(t);Be(t,Ne(s,l?l.data:void 0),{flushSync:i});let d=new AbortController,u=De(e.history,a,d.signal);N.set(t,d);let h=q,f=(await Ee("loader",u,[o],n))[0];if(Ce(f)&&(f=await We(f,u.signal,!0)||f),N.get(t)===d&&N.delete(t),!u.signal.aborted){if(!G.has(t))return Ue(f)?K>h?void Be(t,qe(void 0)):(Y.add(t),void await ve(u,f)):void(Te(f)?Ke(t,r,f.error):(c(!Ce(f),"Unhandled fetcher deferred data"),Be(t,qe(f.data))));Be(t,qe(void 0))}}(t,r,h,g,u,i,m))},revalidate:function(){_e(),ae({revalidation:"loading"}),"submitting"!==C.navigation.state&&("idle"!==C.navigation.state?ye(T||C.historyAction,C.navigation.location,{overrideNavigation:C.navigation}):ye(C.historyAction,C.location,{startUninterruptedRevalidation:!0}))},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Je,deleteFetcher:function(e){if(v.v7_fetcherPersist){let t=(X.get(e)||0)-1;t<=0?(X.delete(e),G.add(e)):X.set(e,t)}else Ye(e);ae({fetchers:new Map(C.fetchers)})},dispose:function(){S&&S(),W&&W(),D.clear(),_&&_.abort(),C.fetchers.forEach(((e,t)=>Ye(t))),C.blockers.forEach(((e,t)=>Ze(t)))},getBlocker:function(e,t){let r=C.blockers.get(e)||le;return te.get(e)!==t&&te.set(e,t),r},deleteBlocker:Ze,_internalFetchControllers:N,_internalActiveDeferreds:ee,_internalSetRoutes:function(e){u={},s=g(e,i,void 0,u)}},M}function fe(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=B(o||".",W(l,n),U(e.pathname,r)||e.pathname,"path"===s);return null==o&&(d.search=e.search,d.hash=e.hash),null!=o&&""!==o&&"."!==o||!c||!c.route.index||Be(d.search)||(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),a&&"/"!==r&&(d.pathname="/"===d.pathname?r:H([r,d.pathname])),f(d)}function pe(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,!ae.has(o.toLowerCase())))return{path:r,error:Ae(405,{method:a.formMethod})};var o;let n,i,s=()=>({path:r,error:Ae(400,{type:"invalid-body"})}),l=a.formMethod||"get",d=e?l.toUpperCase():l.toLowerCase(),u=_e(r);if(void 0!==a.body){if("text/plain"===a.formEncType){if(!ze(d))return s();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:u,formEncType:a.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===a.formEncType){if(!ze(d))return s();try{let e="string"==typeof a.body?JSON.parse(a.body):a.body;return{path:r,submission:{formMethod:d,formAction:u,formEncType:a.formEncType,formData:void 0,json:e,text:void 0}}}catch(e){return s()}}}if(c("function"==typeof FormData,"FormData is not available in this environment"),a.formData)n=Ee(a.formData),i=a.formData;else if(a.body instanceof FormData)n=Ee(a.body),i=a.body;else if(a.body instanceof URLSearchParams)n=a.body,i=Re(n);else if(null==a.body)n=new URLSearchParams,i=new FormData;else try{n=new URLSearchParams(a.body),i=Re(n)}catch(e){return s()}let h={formMethod:d,formAction:u,formEncType:a&&a.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(ze(h.formMethod))return{path:r,submission:h};let m=p(r);return t&&m.search&&Be(m.search)&&n.append("index",""),m.search="?"+n,{path:f(m),submission:h}}function me(e,t,r,o,n,i,s,l,c,d,u,h,f,p,m,y){let v=y?Te(y[1])?y[1].error:y[1].data:void 0,g=e.createURL(t.location),w=e.createURL(n),S=y&&Te(y[1])?y[0]:void 0,D=S?function(e,t){let r=e;if(t){let a=e.findIndex((e=>e.route.id===t));a>=0&&(r=e.slice(0,a))}return r}(r,S):r,E=y?y[1].statusCode:void 0,R=s&&E&&E>=400,x=D.filter(((e,r)=>{let{route:n}=e;if(n.lazy)return!0;if(null==n.loader)return!1;if(i)return!("function"==typeof n.loader&&!n.loader.hydrate&&(void 0!==t.loaderData[n.id]||t.errors&&void 0!==t.errors[n.id]));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 ve(e,a({currentUrl:g,currentParams:s.params,nextUrl:w,nextParams:d.params},o,{actionResult:v,unstable_actionStatus:E,defaultShouldRevalidate:!R&&(l||g.pathname+g.search===w.pathname+w.search||g.search!==w.search||ye(s,d))}))})),P=[];return h.forEach(((e,n)=>{if(i||!r.some((t=>t.route.id===e.routeId))||u.has(n))return;let s=b(p,e.path,m);if(!s)return void P.push({key:n,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});let c=t.fetchers.get(n),h=He(s,e.path),y=!1;y=!f.has(n)&&(!!d.includes(n)||(c&&"idle"!==c.state&&void 0===c.data?l:ve(h,a({currentUrl:g,currentParams:t.matches[t.matches.length-1].params,nextUrl:w,nextParams:r[r.length-1].params},o,{actionResult:v,unstable_actionStatus:E,defaultShouldRevalidate:!R&&l})))),y&&P.push({key:n,routeId:e.routeId,path:e.path,matches:s,match:h,controller:new AbortController})})),[x,P]}function ye(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function ve(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}async function ge(e,t,r){if(!e.lazy)return;let o=await e.lazy();if(!e.lazy)return;let n=r[e.id];c(n,"No route found in manifest");let i={};for(let e in o){let t=void 0!==n[e]&&"hasErrorBoundary"!==e;d(!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||v.has(e)||(i[e]=o[e])}Object.assign(n,i),Object.assign(n,a({},t(n),{lazy:void 0}))}function be(e){return Promise.all(e.matches.map((e=>e.resolve())))}function we(e,t,r,a,o,n){let i=e.headers.get("Location");if(c(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!ce.test(i)){let s=a.slice(0,a.findIndex((e=>e.route.id===r))+1);i=fe(new URL(t.url),s,o,!0,i,n),e.headers.set("Location",i)}return e}function Se(e,t,r){if(ce.test(e)){let a=e,o=a.startsWith("//")?new URL(t.protocol+a):new URL(a),n=null!=U(o.pathname,r);if(o.origin===t.origin&&n)return o.pathname+o.search+o.hash}return e}function De(e,t,r,a){let o=e.createURL(_e(t)).toString(),n={signal:r};if(a&&ze(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=Ee(a.formData):n.body=a.formData}return new Request(o,n)}function Ee(e){let t=new URLSearchParams;for(let[r,a]of e.entries())t.append(r,"string"==typeof a?a:a.name);return t}function Re(e){let t=new FormData;for(let[r,a]of e.entries())t.append(r,a);return t}function xe(e,t,r,o,n,i,s,l){let{loaderData:d,errors:u}=function(e,t,r,a,o,n){let i,s={},l=null,d=!1,u={},h=a&&Te(a[1])?a[1].error:void 0;return r.forEach(((r,a)=>{let f=t[a].route.id;if(c(!Ue(r),"Cannot handle redirect results in processLoaderData"),Te(r)){let t=r.error;if(void 0!==h&&(t=h,h=void 0),l=l||{},n)l[f]=t;else{let r=Le(e,f);null==l[r.route.id]&&(l[r.route.id]=t)}s[f]=void 0,d||(d=!0,i=Z(r.error)?r.error.status:500),r.headers&&(u[f]=r.headers)}else Ce(r)?(o.set(f,r.deferredData),s[f]=r.deferredData.data,null==r.statusCode||200===r.statusCode||d||(i=r.statusCode),r.headers&&(u[f]=r.headers)):(s[f]=r.data,r.statusCode&&200!==r.statusCode&&!d&&(i=r.statusCode),r.headers&&(u[f]=r.headers))})),void 0!==h&&a&&(l={[a[0]]:h},s[a[0]]=void 0),{loaderData:s,errors:l,statusCode:i||200,loaderHeaders:u}}(t,r,o,n,l,!1);for(let t=0;t<i.length;t++){let{key:r,match:o,controller:n}=i[t];c(void 0!==s&&void 0!==s[t],"Did not find corresponding fetcher result");let l=s[t];if(!n||!n.signal.aborted)if(Te(l)){let t=Le(e.matches,null==o?void 0:o.route.id);u&&u[t.route.id]||(u=a({},u,{[t.route.id]:l.error})),e.fetchers.delete(r)}else if(Ue(l))c(!1,"Unhandled fetcher revalidation redirect");else if(Ce(l))c(!1,"Unhandled fetcher deferred data");else{let t=qe(l.data);e.fetchers.set(r,t)}}return{loaderData:d,errors:u}}function Pe(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 ke(e){return e?Te(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Le(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 Me(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 Ae(e,t){let{pathname:r,routeId:a,method:o,type:n}=void 0===t?{}:t,i="Unknown Server Error",s="Unknown @remix-run/router error";return 400===e?(i="Bad Request",o&&r&&a?s="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?s="defer() is not supported in actions":"invalid-body"===n&&(s="Unable to encode submission body")):403===e?(i="Forbidden",s='Route "'+a+'" does not match URL "'+r+'"'):404===e?(i="Not Found",s='No route matches URL "'+r+'"'):405===e&&(i="Method Not Allowed",o&&r&&a?s="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&&(s='Invalid request method "'+o.toUpperCase()+'"')),new Q(e||500,i,new Error(s),!0)}function je(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(Ue(r))return{result:r,idx:t}}}function _e(e){return f(a({},"string"==typeof e?p(e):e,{hash:""}))}function Ce(e){return e.type===y.deferred}function Te(e){return e.type===y.error}function Ue(e){return(e&&e.type)===y.redirect}function Oe(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"==typeof e.headers&&void 0!==e.body}function ze(e){return te.has(e.toLowerCase())}async function Ie(e,t,r,a,o,n){for(let i=0;i<r.length;i++){let s=r[i],l=t[i];if(!l)continue;let d=e.find((e=>e.route.id===l.route.id)),u=null!=d&&!ye(d,l)&&void 0!==(n&&n[l.route.id]);if(Ce(s)&&(o||u)){let e=a[i];c(e,"Expected an AbortSignal for revalidating fetcher deferred result"),await We(s,e,o).then((e=>{e&&(r[i]=e||r[i])}))}}}async function We(e,t,r){if(void 0===r&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:y.data,data:e.deferredData.unwrappedData}}catch(e){return{type:y.error,error:e}}return{type:y.data,data:e.deferredData.data}}}function Be(e){return new URLSearchParams(e).getAll("index").some((e=>""===e))}function He(e,t){let r="string"==typeof t?p(t).search:t.search;if(e[e.length-1].route.index&&Be(r||""))return e[e.length-1];let a=I(e);return a[a.length-1]}function $e(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 Fe(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 Ne(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 qe(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")}}]);
//# sourceMappingURL=1613.ef600aa1.chunk.js.map