@epcare/esm-referral-laboratory-app
Version:
Laboratory microfrontend for OpenMRS 3.x
2 lines • 107 kB
JavaScript
/*! For license information please see 26.js.LICENSE.txt */
"use strict";(globalThis.webpackChunk_epcare_esm_referral_laboratory_app=globalThis.webpackChunk_epcare_esm_referral_laboratory_app||[]).push([[26],{1026:(e,t,r)=>{r.r(t),r.d(t,{AbortedDeferredError:()=>we,Await:()=>Nr,BrowserRouter:()=>xn,Form:()=>jn,HashRouter:()=>kn,Link:()=>An,MemoryRouter:()=>jr,NavLink:()=>Tn,Navigate:()=>Or,NavigationType:()=>n,Outlet:()=>Mr,Route:()=>Ur,Router:()=>Fr,RouterProvider:()=>Sn,Routes:()=>Ir,ScrollRestoration:()=>On,UNSAFE_DataRouterContext:()=>Bt,UNSAFE_DataRouterStateContext:()=>zt,UNSAFE_ErrorResponseImpl:()=>Pe,UNSAFE_FetchersContext:()=>pn,UNSAFE_LocationContext:()=>Kt,UNSAFE_NavigationContext:()=>Wt,UNSAFE_RouteContext:()=>$t,UNSAFE_ViewTransitionContext:()=>vn,UNSAFE_useRouteId:()=>yr,UNSAFE_useScrollRestoration:()=>Jn,createBrowserRouter:()=>ln,createHashRouter:()=>fn,createMemoryRouter:()=>Jr,createPath:()=>I,createRoutesFromChildren:()=>Kr,createRoutesFromElements:()=>Kr,createSearchParams:()=>rn,defer:()=>Ee,generatePath:()=>ne,isRouteErrorResponse:()=>Ce,json:()=>ge,matchPath:()=>ae,matchRoutes:()=>W,parsePath:()=>N,redirect:()=>Re,redirectDocument:()=>xe,renderMatches:()=>$r,replace:()=>ke,resolvePath:()=>ce,unstable_HistoryRouter:()=>Pn,unstable_usePrompt:()=>Yn,useActionData:()=>Rr,useAsyncError:()=>Pr,useAsyncValue:()=>kr,useBeforeUnload:()=>qn,useBlocker:()=>Dr,useFetcher:()=>Wn,useFetchers:()=>Kn,useFormAction:()=>Hn,useHref:()=>Jt,useInRouterContext:()=>qt,useLinkClickHandler:()=>Fn,useLoaderData:()=>Sr,useLocation:()=>Yt,useMatch:()=>Gt,useMatches:()=>wr,useNavigate:()=>Zt,useNavigation:()=>br,useNavigationType:()=>Xt,useOutlet:()=>rr,useOutletContext:()=>tr,useParams:()=>nr,useResolvedPath:()=>ar,useRevalidator:()=>gr,useRouteError:()=>xr,useRouteLoaderData:()=>Er,useRoutes:()=>or,useSearchParams:()=>In,useSubmit:()=>zn,useViewTransitionState:()=>Xn});var n,a=r(318),o=r(2934),i=r.t(o,2);function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function s(e){if(Array.isArray(e))return e}function c(e,t,r,n,a,o,i){try{var u=e[o](i),s=u.value}catch(e){return void r(e)}u.done?t(s):Promise.resolve(s).then(n,a)}function l(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var o=e.apply(t,r);function i(e){c(o,n,a,i,u,"next",e)}function u(e){c(o,n,a,i,u,"throw",e)}i(void 0)})}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t,r){return d=k()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var a=new(Function.bind.apply(e,n));return r&&g(a,r.prototype),a},d.apply(null,arguments)}function h(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function v(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function m(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function y(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function b(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g(e,t){return g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},g(e,t)}function w(e,t){return s(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,o=[],i=!0,u=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);i=!0);}catch(e){u=!0,a=e}finally{try{i||null==r.return||r.return()}finally{if(u)throw a}}return o}}(e,t)||R(e,t)||b()}function S(e){return function(e){if(Array.isArray(e))return u(e)}(e)||y(e)||R(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function E(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function R(e,t){if(e){if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}function x(e){var t="function"==typeof Map?new Map:void 0;return x=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return d(e,arguments,p(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),g(n,e)},x(e)}function k(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(k=function(){return!!e})()}function P(e,t){var r,n,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=u(0),i.throw=u(1),i.return=u(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(s){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(o=0)),o;)try{if(r=1,n&&(a=2&u[0]?n.return:u[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,u[1])).done)return a;switch(n=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(6===u[0]&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],n=0}finally{r=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,s])}}}function C(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},D.apply(this,arguments)}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(n||(n={}));var L,_="popstate";function A(e){void 0===e&&(e={});var t,r=e.initialEntries,a=void 0===r?["/"]:r,o=e.initialIndex,i=e.v5Compat,u=void 0!==i&&i;t=a.map(function(e,t){return h(e,"string"==typeof e?null:e.state,0===t?"default":void 0)});var s=f(null==o?t.length-1:o),c=n.Pop,l=null;function f(e){return Math.min(Math.max(e,0),t.length-1)}function d(){return t[s]}function h(e,r,n){void 0===r&&(r=null);var a=F(t?d().pathname:"/",e,r,n);return M("/"===a.pathname.charAt(0),"relative pathnames are not supported in memory history: "+JSON.stringify(e)),a}function v(e){return"string"==typeof e?e:I(e)}return{get index(){return s},get action(){return c},get location(){return d()},createHref:v,createURL:function(e){return new URL(v(e),"http://localhost")},encodeLocation:function(e){var t="string"==typeof e?N(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push:function(e,r){c=n.Push;var a=h(e,r);s+=1,t.splice(s,t.length,a),u&&l&&l({action:c,location:a,delta:1})},replace:function(e,r){c=n.Replace;var a=h(e,r);t[s]=a,u&&l&&l({action:c,location:a,delta:0})},go:function(e){c=n.Pop;var r=f(s+e),a=t[r];s=r,l&&l({action:c,location:a,delta:e})},listen:function(e){return l=e,function(){l=null}}}}function T(e){return void 0===e&&(e={}),B(function(e,t){var r=e.location;return F("",{pathname:r.pathname,search:r.search,hash:r.hash},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){return"string"==typeof t?t:I(t)},null,e)}function j(e){return void 0===e&&(e={}),B(function(e,t){var r=N(e.location.hash.substr(1)),n=r.pathname,a=void 0===n?"/":n,o=r.search,i=void 0===o?"":o,u=r.hash,s=void 0===u?"":u;return a.startsWith("/")||a.startsWith(".")||(a="/"+a),F("",{pathname:a,search:i,hash:s},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){var r=e.document.querySelector("base"),n="";if(r&&r.getAttribute("href")){var a=e.location.href,o=a.indexOf("#");n=-1===o?a:a.slice(0,o)}return n+"#"+("string"==typeof t?t:I(t))},function(e,t){M("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")},e)}function O(e,t){if(!1===e||null==e)throw new Error(t)}function M(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 F(e,t,r,n){return void 0===r&&(r=null),D({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?N(t):t,{state:r,key:t&&t.key||n||Math.random().toString(36).substr(2,8)})}function I(e){var t=e.pathname,r=void 0===t?"/":t,n=e.search,a=void 0===n?"":n,o=e.hash,i=void 0===o?"":o;return a&&"?"!==a&&(r+="?"===a.charAt(0)?a:"?"+a),i&&"#"!==i&&(r+="#"===i.charAt(0)?i:"#"+i),r}function N(e){var t={};if(e){var r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));var n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function B(e,t,r,a){void 0===a&&(a={});var o=a.window,i=void 0===o?document.defaultView:o,u=a.v5Compat,s=void 0!==u&&u,c=i.history,l=n.Pop,f=null,d=h();function h(){return(c.state||{idx:null}).idx}function v(){l=n.Pop;var e=h(),t=null==e?null:e-d;d=e,f&&f({action:l,location:y.location,delta:t})}function p(e){var t="null"!==i.location.origin?i.location.origin:i.location.href,r="string"==typeof e?e:I(e);return O(t,"No window.location.(origin|href) available to create URL for href: "+(r=r.replace(/ $/,"%20"))),new URL(r,t)}null==d&&(d=0,c.replaceState(D({},c.state,{idx:d}),""));var y={get action(){return l},get location(){return e(i,c)},listen:function(e){if(f)throw new Error("A history only accepts one active listener");return i.addEventListener(_,v),f=e,function(){i.removeEventListener(_,v),f=null}},createHref:function(e){return t(i,e)},createURL:p,encodeLocation:function(e){var t=p(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){l=n.Push;var a=F(y.location,e,t);r&&r(a,e);var o=U(a,d=h()+1),u=y.createHref(a);try{c.pushState(o,"",u)}catch(e){if(m(e,DOMException)&&"DataCloneError"===e.name)throw e;i.location.assign(u)}s&&f&&f({action:l,location:y.location,delta:1})},replace:function(e,t){l=n.Replace;var a=F(y.location,e,t);r&&r(a,e);var o=U(a,d=h()),i=y.createHref(a);c.replaceState(o,"",i),s&&f&&f({action:l,location:y.location,delta:0})},go:function(e){return c.go(e)}};return y}!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(L||(L={}));var z=new Set(["lazy","caseSensitive","path","id","index","children"]);function H(e,t,r,n){return void 0===r&&(r=[]),void 0===n&&(n={}),e.map(function(e,a){var o=S(r).concat([String(a)]),i="string"==typeof e.id?e.id:o.join("-");if(O(!0!==e.index||!e.children,"Cannot specify children on an index route"),O(!n[i],'Found a route id collision on id "'+i+"\". Route id's must be globally unique within Data Router usages"),function(e){return!0===e.index}(e)){var u=D({},e,t(e),{id:i});return n[i]=u,u}var s=D({},e,t(e),{id:i,children:void 0});return n[i]=s,e.children&&(s.children=H(e.children,t,o,n)),s})}function W(e,t,r){return void 0===r&&(r="/"),K(e,t,r,!1)}function K(e,t,r,n){var a=ie(("string"==typeof t?N(t):t).pathname||"/",r);if(null==a)return null;var o=V(e);!function(e){e.sort(function(e,t){return e.score!==t.score?t.score-e.score:function(e,t){var r=e.length===t.length&&e.slice(0,-1).every(function(e,r){return e===t[r]});return r?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(function(e){return e.childrenIndex}),t.routesMeta.map(function(e){return e.childrenIndex}))})}(o);for(var i=null,u=0;null==i&&u<o.length;++u){var s=oe(a);i=re(o[u],s,n)}return i}function $(e,t){var r=e.route,n=e.pathname,a=e.params;return{id:r.id,pathname:n,params:a,data:t[r.id],handle:r.handle}}function V(e,t,r,n){void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===n&&(n="");var a=function(e,a,o){var i={relativePath:void 0===o?e.path||"":o,caseSensitive:!0===e.caseSensitive,childrenIndex:a,route:e};i.relativePath.startsWith("/")&&(O(i.relativePath.startsWith(n),'Absolute route path "'+i.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),i.relativePath=i.relativePath.slice(n.length));var u=pe([n,i.relativePath]),s=r.concat(i);e.children&&e.children.length>0&&(O(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+u+'".'),V(e.children,t,s,u)),(null!=e.path||e.index)&&t.push({path:u,score:te(u,e.index),routesMeta:s})};return e.forEach(function(e,t){var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?")){var n=!0,o=!1,i=void 0;try{for(var u,s=J(e.path)[Symbol.iterator]();!(n=(u=s.next()).done);n=!0){var c=u.value;a(e,t,c)}}catch(e){o=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw i}}}else a(e,t)}),t}function J(e){var t,r=e.split("/");if(0===r.length)return[];var n,a=s(n=r)||y(n)||R(n)||b(),o=a[0],i=a.slice(1),u=o.endsWith("?"),c=o.replace(/\?$/,"");if(0===i.length)return u?[c,""]:[c];var l,f=J(i.join("/")),d=[];return(t=d).push.apply(t,S(f.map(function(e){return""===e?c:[c,e].join("/")}))),u&&(l=d).push.apply(l,S(f)),d.map(function(t){return e.startsWith("/")&&""===t?"/":t})}var q=/^:[\w-]+$/,Y=3,X=2,G=1,Q=10,Z=-2,ee=function(e){return"*"===e};function te(e,t){var r=e.split("/"),n=r.length;return r.some(ee)&&(n+=Z),t&&(n+=X),r.filter(function(e){return!ee(e)}).reduce(function(e,t){return e+(q.test(t)?Y:""===t?G:Q)},n)}function re(e,t,r){void 0===r&&(r=!1);for(var n=e.routesMeta,a={},o="/",i=[],u=0;u<n.length;++u){var s=n[u],c=u===n.length-1,l="/"===o?t:t.slice(o.length)||"/",f=ae({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!f&&c&&r&&!n[n.length-1].route.index&&(f=ae({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!f)return null;Object.assign(a,f.params),i.push({params:a,pathname:pe([o,f.pathname]),pathnameBase:me(pe([o,f.pathnameBase])),route:d}),"/"!==f.pathnameBase&&(o=pe([o,f.pathnameBase]))}return i}function ne(e,t){void 0===t&&(t={});var r=e;r.endsWith("*")&&"*"!==r&&!r.endsWith("/*")&&(M(!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(/\*$/,"/*"));var n=r.startsWith("/")?"/":"",a=function(e){return null==e?"":"string"==typeof e?e:String(e)};return n+r.split(/\/+/).map(function(e,r,n){if(r===n.length-1&&"*"===e)return a(t["*"]);var o=e.match(/^:([\w-]+)(\??)$/);if(o){var i=w(o,3),u=i[1],s=i[2],c=t[u];return O("?"===s||null!=c,'Missing ":'+u+'" param'),a(c)}return e.replace(/\?$/g,"")}).filter(function(e){return!!e}).join("/")}function ae(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});var r=w(function(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!0),M("*"===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(/\*$/,"/*")+'".');var n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,function(e,t,r){return n.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)"});return e.endsWith("*")?(n.push({paramName:"*"}),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}(e.path,e.caseSensitive,e.end),2),n=r[0],a=r[1],o=t.match(n);if(!o)return null;var i=o[0],u=i.replace(/(.)\/+$/,"$1"),s=o.slice(1);return{params:a.reduce(function(e,t,r){var n=t.paramName,a=t.isOptional;if("*"===n){var o=s[r]||"";u=i.slice(0,i.length-o.length).replace(/(.)\/+$/,"$1")}var c=s[r];return e[n]=a&&!c?void 0:(c||"").replace(/%2F/g,"/"),e},{}),pathname:i,pathnameBase:u,pattern:e}}function oe(e){try{return e.split("/").map(function(e){return decodeURIComponent(e).replace(/\//g,"%2F")}).join("/")}catch(t){return M(!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 ie(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;var r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&"/"!==n?null:e.slice(r)||"/"}var ue=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,se=function(e){return ue.test(e)};function ce(e,t){void 0===t&&(t="/");var r,n="string"==typeof e?N(e):e,a=n.pathname,o=n.search,i=void 0===o?"":o,u=n.hash,s=void 0===u?"":u;return a?se(a)?r=a:(a.includes("//")&&M(!1,"Pathnames cannot have embedded double slashes - normalizing "+a+" -> "+(a=a.replace(/\/\/+/g,"/"))),r=a.startsWith("/")?le(a.substring(1),"/"):le(a,t)):r=t,{pathname:r,search:ye(i),hash:be(s)}}function le(e,t){var r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(function(e){".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)}),r.length>1?r.join("/"):"/"}function fe(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the `to."+r+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function de(e){return e.filter(function(e,t){return 0===t||e.route.path&&e.route.path.length>0})}function he(e,t){var r=de(e);return t?r.map(function(e,t){return t===r.length-1?e.pathname:e.pathnameBase}):r.map(function(e){return e.pathnameBase})}function ve(e,t,r,n){var a;void 0===n&&(n=!1),"string"==typeof e?a=N(e):(O(!(a=D({},e)).pathname||!a.pathname.includes("?"),fe("?","pathname","search",a)),O(!a.pathname||!a.pathname.includes("#"),fe("#","pathname","hash",a)),O(!a.search||!a.search.includes("#"),fe("#","search","hash",a)));var o,i=""===e||""===a.pathname,u=i?"/":a.pathname;if(null==u)o=r;else{var s=t.length-1;if(!n&&u.startsWith("..")){for(var c=u.split("/");".."===c[0];)c.shift(),s-=1;a.pathname=c.join("/")}o=s>=0?t[s]:"/"}var l=ce(a,o),f=u&&"/"!==u&&u.endsWith("/"),d=(i||"."===u)&&r.endsWith("/");return l.pathname.endsWith("/")||!f&&!d||(l.pathname+="/"),l}var pe=function(e){return e.join("/").replace(/\/\/+/g,"/")},me=function(e){return e.replace(/\/+$/,"").replace(/^\/*/,"/")},ye=function(e){return e&&"?"!==e?e.startsWith("?")?e:"?"+e:""},be=function(e){return e&&"#"!==e?e.startsWith("#")?e:"#"+e:""},ge=function(e,t){void 0===t&&(t={});var r="number"==typeof t?{status:t}:t,n=new Headers(r.headers);return n.has("Content-Type")||n.set("Content-Type","application/json; charset=utf-8"),new Response(JSON.stringify(e),D({},r,{headers:n}))},we=function(e){function t(){return f(this,t),e=this,n=arguments,r=p(r=t),a=e,!(o=k()?Reflect.construct(r,n||[],p(e).constructor):r.apply(e,n))||"object"!==E(o)&&"function"!=typeof o?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(a):o;var e,r,n,a,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t)}(t,e),t}(x(Error)),Se=function(){function e(t,r){var n,a=this;f(this,e),this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],O(t&&"object"===(void 0===t?"undefined":E(t))&&!Array.isArray(t),"defer() only accepts plain objects"),this.abortPromise=new Promise(function(e,t){return n=t}),this.controller=new AbortController;var o=function(){return n(new we("Deferred data aborted"))};this.unlistenAbortSignal=function(){return a.controller.signal.removeEventListener("abort",o)},this.controller.signal.addEventListener("abort",o),this.data=Object.entries(t).reduce(function(e,t){var r=w(t,2),n=r[0],o=r[1];return Object.assign(e,v({},n,a.trackPromise(n,o)))},{}),this.done&&this.unlistenAbortSignal(),this.init=r}var t,r;return t=e,(r=[{key:"trackPromise",value:function(e,t){var r=this;if(!m(t,Promise))return t;this.deferredKeys.push(e),this.pendingKeysSet.add(e);var n=Promise.race([t,this.abortPromise]).then(function(t){return r.onSettle(n,e,void 0,t)},function(t){return r.onSettle(n,e,t)});return n.catch(function(){}),Object.defineProperty(n,"_tracked",{get:function(){return!0}}),n}},{key:"onSettle",value:function(e,t,r,n){if(this.controller.signal.aborted&&m(r,we))return this.unlistenAbortSignal(),Object.defineProperty(e,"_error",{get:function(){return r}}),Promise.reject(r);if(this.pendingKeysSet.delete(t),this.done&&this.unlistenAbortSignal(),void 0===r&&void 0===n){var a=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:function(){return a}}),this.emit(!1,t),Promise.reject(a)}return void 0===n?(Object.defineProperty(e,"_error",{get:function(){return r}}),this.emit(!1,t),Promise.reject(r)):(Object.defineProperty(e,"_data",{get:function(){return n}}),this.emit(!1,t),n)}},{key:"emit",value:function(e,t){this.subscribers.forEach(function(r){return r(e,t)})}},{key:"subscribe",value:function(e){var t=this;return this.subscribers.add(e),function(){return t.subscribers.delete(e)}}},{key:"cancel",value:function(){var e=this;this.controller.abort(),this.pendingKeysSet.forEach(function(t,r){return e.pendingKeysSet.delete(r)}),this.emit(!0)}},{key:"resolveData",value:function(e){return l(function(){var t,r,n;return P(this,function(a){switch(a.label){case 0:return t=this,r=!1,this.done?[3,2]:(n=function(){return t.cancel()},e.addEventListener("abort",n),[4,new Promise(function(r){t.subscribe(function(a){e.removeEventListener("abort",n),(a||t.done)&&r(a)})})]);case 1:r=a.sent(),a.label=2;case 2:return[2,r]}})}).call(this)}},{key:"done",get:function(){return 0===this.pendingKeysSet.size}},{key:"unwrappedData",get:function(){return O(null!==this.data&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce(function(e,t){var r=w(t,2),n=r[0],a=r[1];return Object.assign(e,v({},n,function(e){if(!function(e){return m(e,Promise)&&!0===e._tracked}(e))return e;if(e._error)throw e._error;return e._data}(a)))},{})}},{key:"pendingKeys",get:function(){return Array.from(this.pendingKeysSet)}}])&&h(t.prototype,r),e}(),Ee=function(e,t){return void 0===t&&(t={}),new Se(e,"number"==typeof t?{status:t}:t)},Re=function(e,t){void 0===t&&(t=302);var r=t;"number"==typeof r?r={status:r}:void 0===r.status&&(r.status=302);var n=new Headers(r.headers);return n.set("Location",e),new Response(null,D({},r,{headers:n}))},xe=function(e,t){var r=Re(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r},ke=function(e,t){var r=Re(e,t);return r.headers.set("X-Remix-Replace","true"),r},Pe=function e(t,r,n,a){f(this,e),void 0===a&&(a=!1),this.status=t,this.statusText=r||"",this.internal=a,m(n,Error)?(this.data=n.toString(),this.error=n):this.data=n};function Ce(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}var De=["post","put","patch","delete"],Le=new Set(De),_e=["get"].concat(S(De)),Ae=new Set(_e),Te=new Set([301,302,303,307,308]),je=new Set([307,308]),Oe={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Me={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ue={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Fe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ie=function(e){return{hasErrorBoundary:Boolean(e.hasErrorBoundary)}},Ne="remix-router-transitions";function Be(e){var t,r=e.window?e.window:"undefined"!=typeof window?window:void 0,a=void 0!==r&&void 0!==r.document&&void 0!==r.document.createElement,o=!a;if(O(e.routes.length>0,"You must provide a non-empty routes array to createRouter"),e.mapRouteProperties)t=e.mapRouteProperties;else if(e.detectErrorBoundary){var i=e.detectErrorBoundary;t=function(e){return{hasErrorBoundary:i(e)}}}else t=Ie;var u,s,c,f={},d=H(e.routes,t,void 0,f),h=e.basename||"/",p=e.dataStrategy||Xe,y=e.patchRoutesOnNavigation,b=D({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),g=null,R=new Set,x=null,k=null,_=null,A=null!=e.hydrationData,T=W(d,e.history.location,h),j=!1,U=null;if(null==T&&!y){var I=ct(404,{pathname:e.history.location.pathname}),N=st(d);T=N.matches,U=v({},N.route.id,I)}if(T&&!e.hydrationData&&Lt(T,d,e.history.location.pathname).active&&(T=null),T)if(T.some(function(e){return e.route.lazy}))s=!1;else if(T.some(function(e){return e.route.loader}))if(b.v7_partialHydration){var B=e.hydrationData?e.hydrationData.loaderData:null,z=e.hydrationData?e.hydrationData.errors:null;if(z){var V=T.findIndex(function(e){return void 0!==z[e.route.id]});s=T.slice(0,V+1).every(function(e){return!$e(e.route,B,z)})}else s=T.every(function(e){return!$e(e.route,B,z)})}else s=null!=e.hydrationData;else s=!0;else if(s=!1,T=[],b.v7_partialHydration){var J=Lt(null,d,e.history.location.pathname);J.active&&J.matches&&(j=!0,T=J.matches)}var q,Y={historyAction:e.history.action,location:e.history.location,matches:T,initialized:s,navigation:Oe,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||U,fetchers:new Map,blockers:new Map},X=n.Pop,G=!1,Q=!1,Z=new Map,ee=null,te=!1,re=!1,ne=[],ae=new Set,oe=new Map,ue=0,se=-1,ce=new Map,le=new Set,fe=new Map,de=new Map,he=new Set,ve=new Map,pe=new Map,me=void 0;function ye(e,t){void 0===t&&(t={}),Y=D({},Y,e);var r=[],n=[];b.v7_fetcherPersist&&Y.fetchers.forEach(function(e,t){"idle"===e.state&&(he.has(t)?n.push(t):r.push(t))}),he.forEach(function(e){Y.fetchers.has(e)||oe.has(e)||n.push(e)}),S(R).forEach(function(e){return e(Y,{deletedFetchers:n,viewTransitionOpts:t.viewTransitionOpts,flushSync:!0===t.flushSync})}),b.v7_fetcherPersist?(r.forEach(function(e){return Y.fetchers.delete(e)}),n.forEach(function(e){return Be(e)})):n.forEach(function(e){return he.delete(e)})}function be(t,r,a){var o,i,s,c=(void 0===a?{}:a).flushSync,l=null!=Y.actionData&&null!=Y.navigation.formMethod&&yt(Y.navigation.formMethod)&&"loading"===Y.navigation.state&&!0!==(null==(o=t.state)?void 0:o._isRedirect);s=r.actionData?Object.keys(r.actionData).length>0?r.actionData:null:l?Y.actionData:null;var f=r.loaderData?ot(Y.loaderData,r.loaderData,r.matches||[],r.errors):Y.loaderData,h=Y.blockers;h.size>0&&(h=new Map(h)).forEach(function(e,t){return h.set(t,Ue)});var v,p=!0===G||null!=Y.navigation.formMethod&&yt(Y.navigation.formMethod)&&!0!==(null==(i=t.state)?void 0:i._isRedirect);if(u&&(d=u,u=void 0),te||X===n.Pop||(X===n.Push?e.history.push(t,t.state):X===n.Replace&&e.history.replace(t,t.state)),X===n.Pop){var m=Z.get(Y.location.pathname);m&&m.has(t.pathname)?v={currentLocation:Y.location,nextLocation:t}:Z.has(t.pathname)&&(v={currentLocation:t,nextLocation:Y.location})}else if(Q){var y=Z.get(Y.location.pathname);y?y.add(t.pathname):(y=new Set([t.pathname]),Z.set(Y.location.pathname,y)),v={currentLocation:Y.location,nextLocation:t}}ye(D({},r,{actionData:s,loaderData:f,historyAction:X,location:t,initialized:!0,navigation:Oe,revalidation:"idle",restoreScrollPosition:Dt(t,r.matches||Y.matches),preventScrollReset:p,blockers:h}),{viewTransitionOpts:v,flushSync:!0===c}),X=n.Pop,G=!1,Q=!1,te=!1,re=!1,ne=[]}function ge(t,r,n){return l(function(){var a,o,i,s,c,l,f,p,m,y,b,g,S,E,R,k,C,A,T,O;return P(this,function(P){switch(P.label){case 0:return q&&q.abort(),q=null,X=t,te=!0===(n&&n.startUninterruptedRevalidation),function(e,t){if(x&&_){var r=Ct(e,t);x[r]=_()}}(Y.location,Y.matches),G=!0===(n&&n.preventScrollReset),Q=!0===(n&&n.enableViewTransition),a=u||d,o=n&&n.overrideNavigation,i=null!=n&&n.initialHydration&&Y.matches&&Y.matches.length>0&&!j?Y.matches:W(a,r,h),s=!0===(n&&n.flushSync),!i||!Y.initialized||re||(M=Y.location,U=r,M.pathname!==U.pathname||M.search!==U.search||(""===M.hash||M.hash!==U.hash)&&""===U.hash)||n&&n.submission&&yt(n.submission.formMethod)?((c=Lt(i,a,r.pathname)).active&&c.matches&&(i=c.matches),i?(q=new AbortController,y=tt(e.history,r,q.signal,n&&n.submission),n&&n.pendingError?(b=[ut(i).route.id,{type:L.error,error:n.pendingError}],[3,3]):[3,1]):(l=ft(r.pathname),f=l.error,p=l.notFoundMatches,m=l.route,be(r,{matches:p,loaderData:{},errors:v({},m.id,f)},{flushSync:s}),[2])):(be(r,{matches:i},{flushSync:s}),[2]);case 1:return n&&n.submission&&yt(n.submission.formMethod)?[4,we(y,r,n.submission,i,c.active,{replace:n.replace,flushSync:s})]:[3,3];case 2:if((g=P.sent()).shortCircuited)return[2];if(g.pendingActionResult&&(S=w(g.pendingActionResult,2),E=S[0],ht(R=S[1])&&Ce(R.error)&&404===R.error.status))return q=null,be(r,{matches:g.matches,loaderData:{},errors:v({},E,R.error)}),[2];i=g.matches||i,b=g.pendingActionResult,o=xt(r,n.submission),s=!1,c.active=!1,y=tt(e.history,y.url,y.signal),P.label=3;case 3:return[4,Se(y,r,i,c.active,o,n&&n.submission,n&&n.fetcherSubmission,n&&n.replace,n&&!0===n.initialHydration,s,b)];case 4:return k=P.sent(),C=k.shortCircuited,A=k.matches,T=k.loaderData,O=k.errors,C||(q=null,be(r,D({matches:A||i},it(b),{loaderData:T,errors:O}))),[2]}var M,U})})()}function we(e,t,r,a,o,i){return l(function(){var u,s,c,l,f,d,v,p,m,y,b,g,w;return P(this,function(S){switch(S.label){case 0:return void 0===i&&(i={}),De(),u=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),ye({navigation:u},{flushSync:!0===i.flushSync}),o?[4,_t(a,t.pathname,e.signal)]:[3,2];case 1:if("aborted"===(s=S.sent()).type)return[2,{shortCircuited:!0}];if("error"===s.type)return c=ut(s.partialMatches).route.id,[2,{matches:s.partialMatches,pendingActionResult:[c,{type:L.error,error:s.error}]}];if(!s.matches)return l=ft(t.pathname),f=l.notFoundMatches,d=l.error,v=l.route,[2,{matches:f,pendingActionResult:[v.id,{type:L.error,error:d}]}];a=s.matches,S.label=2;case 2:return(m=Et(a,t)).route.action||m.route.lazy?[3,3]:(p={type:L.error,error:ct(405,{method:e.method,pathname:t.pathname,routeId:m.route.id})},[3,5]);case 3:return[4,xe("action",Y,e,[m],a,null)];case 4:if(y=S.sent(),p=y[m.route.id],e.signal.aborted)return[2,{shortCircuited:!0}];S.label=5;case 5:return vt(p)?(i&&null!=i.replace?b=i.replace:(g=et(p.response.headers.get("Location"),new URL(e.url),h),b=g===Y.location.pathname+Y.location.search),[4,Re(e,p,!0,{submission:r,replace:b})]):[3,7];case 6:return S.sent(),[2,{shortCircuited:!0}];case 7:if(dt(p))throw ct(400,{type:"defer-action"});return ht(p)?(w=ut(a,m.route.id),!0!==(i&&i.replace)&&(X=n.Push),[2,{matches:a,pendingActionResult:[w.route.id,p]}]):[2,{matches:a,pendingActionResult:[m.route.id,p]}]}})})()}function Se(t,r,n,a,o,i,s,c,f,p,m){return l(function(){var l,y,g,S,E,R,x,k,C,L,_,A,T,j,O,M,U,F,I,N,B,z,H,W,K,$,V,J;return P(this,function(P){switch(P.label){case 0:return l=o||xt(r,i),y=i||s||Rt(l),g=!(te||b.v7_partialHydration&&f),a?(g&&(S=Ee(m),ye(D({navigation:l},void 0!==S?{actionData:S}:{}),{flushSync:p})),[4,_t(n,r.pathname,t.signal)]):[3,2];case 1:if("aborted"===(E=P.sent()).type)return[2,{shortCircuited:!0}];if("error"===E.type)return R=ut(E.partialMatches).route.id,[2,{matches:E.partialMatches,loaderData:{},errors:v({},R,E.error)}];if(!E.matches)return x=ft(r.pathname),k=x.error,C=x.notFoundMatches,L=x.route,[2,{matches:C,loaderData:{},errors:v({},L.id,k)}];n=E.matches,P.label=2;case 2:return _=u||d,A=w(Ke(e.history,Y,n,y,r,b.v7_partialHydration&&!0===f,b.v7_skipActionErrorRevalidation,re,ne,ae,he,fe,le,_,h,m),2),T=A[0],j=A[1],St(function(e){return!(n&&n.some(function(t){return t.route.id===e}))||T&&T.some(function(t){return t.route.id===e})}),se=++ue,0===T.length&&0===j.length?(O=Je(),be(r,D({matches:n,loaderData:{},errors:m&&ht(m[1])?v({},m[0],m[1].error):null},it(m),O?{fetchers:new Map(Y.fetchers)}:{}),{flushSync:p}),[2,{shortCircuited:!0}]):(g&&(M={},a||(M.navigation=l,void 0!==(U=Ee(m))&&(M.actionData=U)),j.length>0&&(M.fetchers=function(e){return e.forEach(function(e){var t=Y.fetchers.get(e.key),r=kt(void 0,t?t.data:void 0);Y.fetchers.set(e.key,r)}),new Map(Y.fetchers)}(j)),ye(M,{flushSync:p})),j.forEach(function(e){We(e.key),e.controller&&oe.set(e.key,e.controller)}),F=function(){return j.forEach(function(e){return We(e.key)})},q&&q.signal.addEventListener("abort",F),[4,ke(Y,n,T,j,t)]);case 3:return I=P.sent(),N=I.loaderResults,B=I.fetcherResults,t.signal.aborted?[2,{shortCircuited:!0}]:(q&&q.signal.removeEventListener("abort",F),j.forEach(function(e){return oe.delete(e.key)}),(z=lt(N))?[4,Re(t,z.result,!0,{replace:c})]:[3,5]);case 4:return P.sent(),[2,{shortCircuited:!0}];case 5:return(z=lt(B))?(le.add(z.key),[4,Re(t,z.result,!0,{replace:c})]):[3,7];case 6:return P.sent(),[2,{shortCircuited:!0}];case 7:return H=at(Y,n,N,m,j,B,ve),W=H.loaderData,K=H.errors,ve.forEach(function(e,t){e.subscribe(function(r){(r||e.done)&&ve.delete(t)})}),b.v7_partialHydration&&f&&Y.errors&&(K=D({},Y.errors,K)),$=Je(),V=Ye(se),J=$||V||j.length>0,[2,D({matches:n,loaderData:W,errors:K},J?{fetchers:new Map(Y.fetchers)}:{})]}})})()}function Ee(e){return e&&!ht(e[1])?v({},e[0],e[1].data):Y.actionData?0===Object.keys(Y.actionData).length?null:Y.actionData:void 0}function Re(t,o,i,u){return l(function(){var s,c,l,f,d,v,p,m,y,b,g,w,S,E,R,x;return P(this,function(k){switch(k.label){case 0:return c=(s=void 0===u?{}:u).submission,l=s.fetcherSubmission,f=s.preventScrollReset,d=s.replace,o.response.headers.has("X-Remix-Revalidate")&&(re=!0),O(v=o.response.headers.get("Location"),"Expected a Location header on the redirect Response"),v=et(v,new URL(t.url),h),p=F(Y.location,v,{_isRedirect:!0}),a&&(m=!1,o.response.headers.has("X-Remix-Reload-Document")?m=!0:Fe.test(v)&&(y=e.history.createURL(v),m=y.origin!==r.location.origin||null==ie(y.pathname,h)),m)?(d?r.location.replace(v):r.location.assign(v),[2]):(q=null,b=!0===d||o.response.headers.has("X-Remix-Replace")?n.Replace:n.Push,g=Y.navigation,w=g.formMethod,S=g.formAction,E=g.formEncType,!c&&!l&&w&&S&&E&&(c=Rt(Y.navigation)),R=c||l,je.has(o.response.status)&&R&&yt(R.formMethod)?[4,ge(b,p,{submission:D({},R,{formAction:v}),preventScrollReset:f||G,enableViewTransition:i?Q:void 0})]:[3,2]);case 1:return k.sent(),[3,4];case 2:return x=xt(p,c),[4,ge(b,p,{overrideNavigation:x,fetcherSubmission:l,preventScrollReset:f||G,enableViewTransition:i?Q:void 0})];case 3:k.sent(),k.label=4;case 4:return[2]}})})()}function xe(e,r,n,a,o,i){return l(function(){var r,u,s,c,d,v,y,g,S,R,x,k,C;return P(this,function(D){switch(D.label){case 0:u={},D.label=1;case 1:return D.trys.push([1,3,,4]),[4,Ge(p,e,0,n,a,o,i,f,t)];case 2:return r=D.sent(),[3,4];case 3:return s=D.sent(),a.forEach(function(e){u[e.route.id]={type:L.error,error:s}}),[2,u];case 4:c=!0,d=!1,v=void 0,D.label=5;case 5:D.trys.push([5,11,12,13]),y=Object.entries(r)[Symbol.iterator](),D.label=6;case 6:return(c=(g=y.next()).done)?[3,10]:(S=w(g.value,2),R=S[0],function(e){return mt(e.result)&&Te.has(e.result.status)}(x=S[1])?(k=x.result,u[R]={type:L.redirect,response:Ze(k,n,R,o,h,b.v7_relativeSplatPath)},[3,9]):[3,7]);case 7:return[4,(_=x,l(function(){var e,t,r,n,a,o,i,u,s,c,l,f,d;return P(this,function(h){switch(h.label){case 0:if(e=_.result,t=_.type,!mt(e))return[3,10];h.label=1;case 1:return h.trys.push([1,8,,9]),(n=e.headers.get("Content-Type"))&&/\bapplication\/json\b/.test(n)?null!=e.body?[3,2]:(r=null,[3,4]):[3,5];case 2:return[4,e.json()];case 3:r=h.sent(),h.label=4;case 4:return[3,7];case 5:return[4,e.text()];case 6:r=h.sent(),h.label=7;case 7:return[3,9];case 8:return a=h.sent(),[2,{type:L.error,error:a}];case 9:return t===L.error?[2,{type:L.error,error:new Pe(e.status,e.statusText,r),statusCode:e.status,headers:e.headers}]:[2,{type:L.data,data:r,statusCode:e.status,headers:e.headers}];case 10:return t===L.error?pt(e)?m(e.data,Error)?[2,{type:L.error,error:e.data,statusCode:null==(u=e.init)?void 0:u.status,headers:null!=(s=e.init)&&s.headers?new Headers(e.init.headers):void 0}]:[2,{type:L.error,error:new Pe((null==(o=e.init)?void 0:o.status)||500,void 0,e.data),statusCode:Ce(e)?e.status:void 0,headers:null!=(i=e.init)&&i.headers?new Headers(e.init.headers):void 0}]:[2,{type:L.error,error:e,statusCode:Ce(e)?e.status:void 0}]:(v=e)&&"object"===(void 0===v?"undefined":E(v))&&"object"===E(v.data)&&"function"==typeof v.subscribe&&"function"==typeof v.cancel&&"function"==typeof v.resolveData?[2,{type:L.deferred,deferredData:e,statusCode:null==(c=e.init)?void 0:c.status,headers:(null==(l=e.init)?void 0:l.headers)&&new Headers(e.init.headers)}]:pt(e)?[2,{type:L.data,data:e.data,statusCode:null==(f=e.init)?void 0:f.status,headers:null!=(d=e.init)&&d.headers?new Headers(e.init.headers):void 0}]:[2,{type:L.data,data:e}]}var v})})())];case 8:u[R]=D.sent(),D.label=9;case 9:return c=!0,[3,6];case 10:return[3,13];case 11:return C=D.sent(),d=!0,v=C,[3,13];case 12:try{c||null==y.return||y.return()}finally{if(d)throw v}return[7];case 13:return[2,u]}var _})})()}function ke(t,r,n,a,o){return l(function(){var i,u,s,c,f;return P(this,function(d){switch(d.label){case 0:return i=t.matches,u=xe("loader",0,o,n,r,null),s=Promise.all(a.map(function(t){return l(function(){var r,n;return P(this,function(a){switch(a.label){case 0:return t.matches&&t.match&&t.controller?[4,xe("loader",0,tt(e.history,t.path,t.controller.signal),[t.match],t.matches,t.key)]:[3,2];case 1:return r=a.sent(),n=r[t.match.route.id],[2,v({},t.key,n)];case 2:return[2,Promise.resolve(v({},t.key,{type:L.error,error:ct(404,{pathname:t.path})}))];case 3:return[2]}})})()})),[4,u];case 1:return c=d.sent(),[4,s];case 2:return f=d.sent().reduce(function(e,t){return Object.assign(e,t)},{}),[4,Promise.all([bt(r,c,o.signal,i,t.loaderData),gt(r,f,a)])];case 3:return d.sent(),[2,{loaderResults:c,fetcherResults:f}]}})})()}function De(){var e;re=!0,(e=ne).push.apply(e,S(St())),fe.forEach(function(e,t){oe.has(t)&&ae.add(t),We(t)})}function Le(e,t,r){void 0===r&&(r={}),Y.fetchers.set(e,t),ye({fetchers:new Map(Y.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function _e(e,t,r,n){void 0===n&&(n={});var a=ut(Y.matches,t);Be(e),ye({errors:v({},a.route.id,r),fetchers:new Map(Y.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function Ae(e){return de.set(e,(de.get(e)||0)+1),he.has(e)&&he.delete(e),Y.fetchers.get(e)||Me}function Be(e){var t=Y.fetchers.get(e);!oe.has(e)||t&&"loading"===t.state&&ce.has(e)||We(e),fe.delete(e),ce.delete(e),le.delete(e),b.v7_fetcherPersist&&he.delete(e),ae.delete(e),Y.fetchers.delete(e)}function We(e){var t=oe.get(e);t&&(t.abort(),oe.delete(e))}function Ve(e){var t=!0,r=!1,n=void 0;try{for(var a,o=e[Symbol.iterator]();!(t=(a=o.next()).done);t=!0){var i=a.value,u=Pt(Ae(i).data);Y.fetchers.set(i,u)}}catch(e){r=!0,n=e}finally{try{t||null==o.return||o.return()}finally{if(r)throw n}}}function Je(){var e=[],t=!1,r=!0,n=!1,a=void 0;try{for(var o,i=le[Symbol.iterator]();!(r=(o=i.next()).done);r=!0){var u=o.value,s=Y.fetchers.get(u);O(s,"Expected fetcher: "+u),"loading"===s.state&&(le.delete(u),e.push(u),t=!0)}}catch(e){n=!0,a=e}finally{try{r||null==i.return||i.return()}finally{if(n)throw a}}return Ve(e),t}function Ye(e){var t=[],r=!0,n=!1,a=void 0;try{for(var o,i=ce[Symbol.iterator]();!(r=(o=i.next()).done);r=!0){var u=w(o.value,2),s=u[0];if(u[1]<e){var c=Y.fetchers.get(s);O(c,"Expected fetcher: "+s),"loading"===c.state&&(We(s),ce.delete(s),t.push(s))}}}catch(e){n=!0,a=e}finally{try{r||null==i.return||i.return()}finally{if(n)throw a}}return Ve(t),t.length>0}function Qe(e){Y.blockers.delete(e),pe.delete(e)}function rt(e,t){var r=Y.blockers.get(e)||Ue;O("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);var n=new Map(Y.blockers);n.set(e,t),ye({blockers:n})}function nt(e){var t=e.currentLocation,r=e.nextLocation,n=e.historyAction;if(0!==pe.size){pe.size>1&&M(!1,"A router only supports one blocker at a time");var a=Array.from(pe.entries()),o=w(a[a.length-1],2),i=o[0],u=o[1],s=Y.blockers.get(i);if(!s||"proceeding"!==s.state)return u({currentLocation:t,nextLocation:r,historyAction:n})?i:void 0}}function ft(e){var t=ct(404,{pathname:e}),r=st(u||d),n=r.matches,a=r.route;return St(),{notFoundMatches:n,route:a,error:t}}function St(e){var t=[];return ve.forEach(function(r,n){e&&!e(n)||(r.cancel(),t.push(n),ve.delete(n))}),t}function Ct(e,t){return k&&k(e,t.map(function(e){return $(e,Y.loaderData)}))||e.key}function Dt(e,t){if(x){var r=Ct(e,t),n=x[r];if("number"==typeof n)return n}return null}function Lt(e,t,r){if(y){if(!e)return{active:!0,matches:K(t,r,h,!0)||[]};if(Object.keys(e[0].params).length>0)return{active:!0,matches:K(t,r,h,!0)}}return{active:!1,matches:null}}function _t(e,r,n,a){return l(function(){var o,i,s;return P(this,function(c){switch(c.label){case 0:if(o=function(){var e,o,s,c,l;return P(this,function(v){switch(v.label){case 0:e=null==u,o=u||d,s=f,v.label=1;case 1:return v.trys.push([1,3,4,5]),[4,y({signal:n,path:r,matches:i,fetcherKey:a,patch:function(e,r){n.aborted||qe(e,r,o,s,t)}})];case 2:return v.sent(),[3,5];case 3:return[2,{v:{type:"error",error:v.sent(),partialMatches:i}}];case 4:return e&&!n.aborted&&(d=S(d)),[7];case 5:return n.aborted?[2,{v:{type:"aborted"}}]:(c=W(o,r,h))?[2,{v:{type:"success",matches:c}}]:!(l=K(o,r,h,!0))||i.length===l.length&&i.every(function(e,t){return e.route.id===l[t].route.id})?[2,{v:{type:"success",matches:null}}]:(i=l,[2])}})},!y)return[2,{type:"success",matches:e}];i=e,c.label=1;case 1:return[5,C(o())];case 2:return"object"===E(s=c.sent())?[2,s.v]:[3,1];case 3:return[2]}})})()}return c={get basename(){return h},get future(){return b},get state(){return Y},get routes(){return d},get window(){return r},initialize:function(){if(g=e.history.listen(function(t){var r=t.action,n=t.location,a=t.delta;if(me)return me(),void(me=void 0);M(0===pe.size||null!=a,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");var o=nt({currentLocation:Y.location,nextLocation:n,historyAction:r});if(o&&null!=a){var i=new Promise(function(e){me=e});return e.history.go(-1*a),void rt(o,{state:"blocked",location:n,proceed:function(){rt(o,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),i.then(function(){return e.history.go(a)})},reset:function(){var e=new Map(Y.blockers);e.set(o,Ue),ye({blockers:e})}})}return ge(r,n)}),a){!function(e,t){try{var r=e.sessionStorage.getItem(Ne);if(r){var n=JSON.parse(r),a=!0,o=!1,i=void 0;try{for(var u,s=Object.entries(n||{})[Symbol.iterator]();!(a=(u=s.next()).done);a=!0){var c=w(u.value,2),l=c[0],f=c[1];f&&Array.isArray(f)&&t.set(l,new Set(f||[]))}}catch(e){o=!0,i=e}finally{try{a||null==s.return||s.return()}finally{if(o)throw i}}}}catch(e){}}(r,Z);var t=function(){return function(e,t){if(t.size>0){var r={},n=!0,a=!1,o=void 0;try{for(var i,u=t[Symbol.iterator]();!(n=(i=u.next()).done);n=!0){var s=w(i.value,2),c=s[0],l=s[1];r[c]=S(l)}}catch(e){a=!0,o=e}finally{try{n||null==u.return||u.return()}finally{if(a)throw o}}try{e.sessionStorage.setItem(Ne,JSON.stringify(r))}catch(e){M(!1,"Failed to save applied view transitions in sessionStorage ("+e+").")}}}(r,Z)};r.addEventListener("pagehide",t),ee=function(){return r.removeEventListener("pagehide",t)}}return Y.initialized||ge(n.Pop,Y.location,{initialHydration:!0}),c},subscribe:function(e){return R.add(e),function(){return R.delete(e)}},enableScrollRestoration:function(e,t,r){if(x=e,_=t,k=r||null,!A&&Y.navigation===Oe){A=!0;var n=Dt(Y.location,Y.matches);null!=n&&ye({restoreScrollPosition:n})}return function(){x=null,_=null,k=null}},navigate:function t(r,a){return l(function(){var o,i,u,s,c,l,f,d,v,p,m,y;return P(this,function(g){switch(g.label){case 0:return"number"==typeof r?(e.history.go(r),[2]):(o=ze(Y.location,Y.matches,h,b.v7_prependBasename,r,b.v7_relativeSplatPath,null==a?void 0:a.fromRouteId,null==a?void 0:a.relative),i=He(b.v7_normalizeFormMethod,!1,o,a),u=i.path,s=i.submission,c=i.error,l=Y.location,f=D({},f=F(Y.location,u,a&&a.state),e.history.encodeLocation(f)),d=a&&null!=a.replace?a.replace:void 0,v=n.Push,!0===d?v=n.Replace:!1===d||null!=s&&yt(s.formMethod)&&s.formAction===Y.location.pathname+Y.location.search&&(v=n.Replace),p=a&&"preventScrollReset"in a?!0===a.preventScrollReset:void 0,m=!0===(a&&a.flushSync),(y=nt({currentLocation:l,nextLocation:f,historyAction:v}))?(rt(y,{state:"blocked",location:f,proceed:function(){rt(y,{state:"proceeding",proceed:void 0,reset:void 0,location:f}),t(r,a)},reset:function(){var e=new Map(Y.blockers);e.set(y,Ue),ye({blockers:e})}}),[2]):[4,ge(v,f,{submission:s,pendingError:c,preventScrollReset:p,replace:a&&a.replace,enableViewTransition:a&&a.viewTransition,flushSync:m})]);case 1:return[2,g.sent()]}})})()},fetch:function(t,r,n,a){if(o)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.");We(t);var i=!0===(a&&a.flushSync),s=u||d,c=ze(Y.location,Y.matches,h,b.v7_prependBasename,n,b.v7_relativeSplatPath,r,null==a?void 0:a.relative),f=W(s,c,h),v=Lt(f,s,c);if(v.active&&v.matches&&(f=v.matches),f){var p=He(b.v7_normalizeFormMethod,!0,c,a),m=p.path,y=p.submission,g=p.error;if(g)_e(t,r,g,{flushSync:i});else{var S=Et(f,m),E=!0===(a&&a.preventScrollReset);y&&yt(y.formMethod)?function(t,r,n,a,o,i,s,c,f){l(function(){var l,v,p,m,y,g,S,E,R,x,k,C,D,L,_,A,T,j,M,U,F,I,N,B,z;function H(e){if(!e.route.action&&!e.route.lazy){var a=ct(405,{method:f.formMethod,pathname:n,routeId:r});return _e(t,r,a,{flushSync:s}),!0}return!1}return P(this,function(P){switch(P.label){case 0:return De(),fe.delete(t),!i&&H(a)?[2]:(l=Y.fetchers.get(t),Le(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}}(f,l),{flushSync:s}),v=new AbortController,p=tt(e.history,n,v.signal,f),i?[4,_t(o,new URL(p.url).pathname,p.signal,t)]:[3,2]);case 1:if("aborted"===(m=P.sent()).type)return[2];if("error"===m.type)return _e(t,r,m.error,{flushSync:s}),[2];if(!m.matches)return _e(t,r,ct(404,{pathname:n}),{flushSync:s}),[2];if(o=m.matches,H(a=Et(o,n)))return[2];P.label=2;case 2:return oe.set(t,v),y=ue,[4,xe("action",0,p,[a],o,t)];case 3:if(g=P.sent(),S=g[a.route.id],p.signal.aborted)return oe.get(t)===v&&oe.delete(t),[2];if(b.v7_fetcherPersist&&he.has(t)){if(vt(S)||ht(S))return Le(t,Pt(void 0)),[2]}else{if(vt(S))return oe.delete(t),se>y?(Le(t,Pt(void 0)),[2]):(le.add(t),Le(t,kt(f)),[2,Re(p,S,!1,{fetcherSubmission:f,preventScrollReset:c})]);if(ht(S))return _e(t,r,S.error),[2]}if(dt(S))throw ct(400,{type:"defer-action"});return E=Y.navigation.location||Y.location,R=tt(e.history,E,v.signal),x=u||d,O(k="idle"!==Y.navigation.state?W(x,Y.navigation.location,h):Y.matches,"Didn't find any matches after fetcher action"),C=++ue,ce.set(t,C),D=kt(f,S.data),Y.fetchers.set(t,D),L=w(Ke(e.history,Y,k,f,E,!1,b.v7_skipActionErrorRevalidation,re,ne,ae,he,fe,le,x,h,[a.route.id,S]),2),_=L[0],(A=L[1]).filter(function(e){return e.key!==t}).forEach(function(e){var t=e.key,r=Y.fetchers.get(t),n=kt(void 0,r?r.data:void 0);Y.fetchers.set(t,n),We(t),e.controller&&oe.set(t,e.controller)}),ye({fetchers:new Map(Y.fetchers)}),T=function(){return A.forEach(function(e){return We(e.key)})},v.signal.addEventListener("abort",T),[4,ke(Y,k,_,A,R)];case 4:return j=P.sent(),M=j.loaderResults,U=j.fetcherResults,v.signal.aborted?[2]:(v.signal.removeEventListener("abort",T),ce.delete(t),oe.delete(t),A.forEach(function(e){return oe.delete(e.key)}),(F=lt(M))?[2,Re(R,F.result,!1,{preventScrollReset:c})]:(F=lt(U))?(le.add(F.key),[2,Re(R,F.result,!1,{preventScrollReset:c})]):(I=at(Y,k,M,void 0,A,U,ve),N=I.loaderData,B=I.errors,Y.fetchers.has(t)&&(z=Pt(S.data),Y.fetchers.set(t,z)),Ye(C),"loading"===Y.navigation.state&&C>se?(O(X,"Expected pending action"),q&&q.abort(),be(Y.navigation.location,{matches:k,loaderData:N,errors:B,fetchers:new Map(Y.fetchers)})):(ye({errors:B,loaderData:ot(Y.loaderData,N,k,B),fetchers:new Map(Y.fetchers)}),re=!1),[2]))}})})()}(t,r,m,S,f,v.active,i,E,y):(fe.set(t,{routeId:r,path:m}),function(t,r,n,a,o,i,u,s,c){l(function(){var l,f,d,h,v,p,m;return P(this,