@openmrs/esm-laboratory-app
Version:
An O3 frontend module for managing laboratory requests and queues
2 lines • 95.7 kB
JavaScript
/*! For license information please see 1026.js.LICENSE.txt */
"use strict";(globalThis.webpackChunk_openmrs_esm_laboratory_app=globalThis.webpackChunk_openmrs_esm_laboratory_app||[]).push([[1026],{91026:(e,t,r)=>{r.r(t),r.d(t,{AbortedDeferredError:()=>me,Await:()=>Sr,BrowserRouter:()=>an,Form:()=>vn,HashRouter:()=>on,Link:()=>dn,MemoryRouter:()=>pr,NavLink:()=>hn,Navigate:()=>mr,NavigationType:()=>n,Outlet:()=>yr,Route:()=>br,Router:()=>gr,RouterProvider:()=>rn,Routes:()=>wr,ScrollRestoration:()=>pn,UNSAFE_DataRouterContext:()=>Rt,UNSAFE_DataRouterStateContext:()=>Dt,UNSAFE_FetchersContext:()=>Xr,UNSAFE_LocationContext:()=>Ct,UNSAFE_NavigationContext:()=>Pt,UNSAFE_RouteContext:()=>_t,UNSAFE_ViewTransitionContext:()=>Yr,UNSAFE_useRouteId:()=>tr,UNSAFE_useScrollRestoration:()=>Cn,createBrowserRouter:()=>$r,createHashRouter:()=>Jr,createMemoryRouter:()=>_r,createPath:()=>I,createRoutesFromChildren:()=>kr,createRoutesFromElements:()=>kr,createSearchParams:()=>Ir,defer:()=>be,generatePath:()=>re,isRouteErrorResponse:()=>Ee,json:()=>pe,matchPath:()=>ne,matchRoutes:()=>W,parsePath:()=>B,redirect:()=>ge,redirectDocument:()=>we,renderMatches:()=>Pr,resolvePath:()=>ie,unstable_HistoryRouter:()=>un,unstable_usePrompt:()=>Ln,unstable_useViewTransitionState:()=>Tn,useActionData:()=>ur,useAsyncError:()=>lr,useAsyncValue:()=>cr,useBeforeUnload:()=>_n,useBlocker:()=>dr,useFetcher:()=>Rn,useFetchers:()=>Dn,useFormAction:()=>xn,useHref:()=>Tt,useInRouterContext:()=>At,useLinkClickHandler:()=>bn,useLoaderData:()=>or,useLocation:()=>jt,useMatch:()=>Ut,useMatches:()=>ar,useNavigate:()=>Ft,useNavigation:()=>rr,useNavigationType:()=>Ot,useOutlet:()=>Nt,useOutletContext:()=>Bt,useParams:()=>zt,useResolvedPath:()=>Ht,useRevalidator:()=>nr,useRouteError:()=>sr,useRouteLoaderData:()=>ir,useRoutes:()=>Wt,useSearchParams:()=>gn,useSubmit:()=>En});var n,a=r(16072),o=r(32934),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=D()?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)||x(e,t)||b()}function S(e){return function(e){if(Array.isArray(e))return u(e)}(e)||y(e)||x(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 x(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 R(e){var t="function"==typeof Map?new Map:void 0;return R=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)},R(e)}function D(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(D=function(){return!!e})()}function k(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 P(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 C(){return C=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},C.apply(this,arguments)}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(n||(n={}));var _,L="popstate";function T(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 U("/"===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?B(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 A(e){return void 0===e&&(e={}),N((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={}),N((function(e,t){var r=B(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){U("/"===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 U(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function M(e,t){return{usr:e.state,key:e.key,idx:t}}function F(e,t,r,n){return void 0===r&&(r=null),C({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?B(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 B(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 N(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),new URL(r,t)}null==d&&(d=0,c.replaceState(C({},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(L,v),f=e,function(){i.removeEventListener(L,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=M(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=M(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"}(_||(_={}));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([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=C({},e,t(e),{id:i});return n[i]=u,u}var s=C({},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){void 0===r&&(r="/");var n=oe(("string"==typeof t?B(t):t).pathname||"/",r);if(null==n)return null;var a=$(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})))}))}(a);for(var o=null,i=0;null==o&&i<a.length;++i)o=te(a[i],ae(n));return o}function K(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 $(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=fe([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+'".'),$(e.children,t,s,u)),(null!=e.path||e.index)&&t.push({path:u,score:ee(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)||x(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-]+$/,V=3,Y=2,X=1,G=10,Q=-2,Z=function(e){return"*"===e};function ee(e,t){var r=e.split("/"),n=r.length;return r.some(Z)&&(n+=Q),t&&(n+=Y),r.filter((function(e){return!Z(e)})).reduce((function(e,t){return e+(q.test(t)?V:""===t?X:G)}),n)}function te(e,t){for(var r=e.routesMeta,n={},a="/",o=[],i=0;i<r.length;++i){var u=r[i],s=i===r.length-1,c="/"===a?t:t.slice(a.length)||"/",l=ne({path:u.relativePath,caseSensitive:u.caseSensitive,end:s},c);if(!l)return null;Object.assign(n,l.params);var f=u.route;o.push({params:n,pathname:fe([a,l.pathname]),pathnameBase:de(fe([a,l.pathnameBase])),route:f}),"/"!==l.pathnameBase&&(a=fe([a,l.pathnameBase]))}return o}function re(e,t){void 0===t&&(t={});var r=e;r.endsWith("*")&&"*"!==r&&!r.endsWith("/*")&&(U(!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 ne(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),U("*"===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:function(e,t){try{return decodeURIComponent(e)}catch(r){return U(!1,'The value for the URL param "'+t+'" will not be decoded because the string "'+e+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+r+")."),e}}(c||"",n),e}),{}),pathname:i,pathnameBase:u,pattern:e}}function ae(e){try{return decodeURI(e)}catch(t){return U(!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 oe(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)||"/"}function ie(e,t){void 0===t&&(t="/");var r="string"==typeof e?B(e):e,n=r.pathname,a=r.search,o=void 0===a?"":a,i=r.hash,u=void 0===i?"":i,s=n?n.startsWith("/")?n:function(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("/"):"/"}(n,t):t;return{pathname:s,search:he(o),hash:ve(u)}}function ue(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 se(e){return e.filter((function(e,t){return 0===t||e.route.path&&e.route.path.length>0}))}function ce(e,t){var r=se(e);return t?r.map((function(t,r){return r===e.length-1?t.pathname:t.pathnameBase})):r.map((function(e){return e.pathnameBase}))}function le(e,t,r,n){var a;void 0===n&&(n=!1),"string"==typeof e?a=B(e):(O(!(a=C({},e)).pathname||!a.pathname.includes("?"),ue("?","pathname","search",a)),O(!a.pathname||!a.pathname.includes("#"),ue("#","pathname","hash",a)),O(!a.search||!a.search.includes("#"),ue("#","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=ie(a,o),f=u&&"/"!==u&&u.endsWith("/"),d=(i||"."===u)&&r.endsWith("/");return l.pathname.endsWith("/")||!f&&!d||(l.pathname+="/"),l}var fe=function(e){return e.join("/").replace(/\/\/+/g,"/")},de=function(e){return e.replace(/\/+$/,"").replace(/^\/*/,"/")},he=function(e){return e&&"?"!==e?e.startsWith("?")?e:"?"+e:""},ve=function(e){return e&&"#"!==e?e.startsWith("#")?e:"#"+e:""},pe=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),C({},r,{headers:n}))},me=function(e){function t(){return f(this,t),e=this,n=arguments,r=p(r=t),a=e,!(o=D()?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}(R(Error)),ye=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 me("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,me))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 k(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}(),be=function(e,t){return void 0===t&&(t={}),new ye(e,"number"==typeof t?{status:t}:t)},ge=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,C({},r,{headers:n}))},we=function(e,t){var r=ge(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r},Se=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 Ee(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}var xe=["post","put","patch","delete"],Re=new Set(xe),De=["get"].concat(S(xe)),ke=new Set(De),Pe=new Set([301,302,303,307,308]),Ce=new Set([307,308]),_e={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Le={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Te={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Ae=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,je=function(e){return{hasErrorBoundary:Boolean(e.hasErrorBoundary)}},Oe="remix-router-transitions";function Ue(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=je;var u,s,c={},f=H(e.routes,t,void 0,c),d=e.basename||"/",h=C({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1},e.future),p=null,m=new Set,y=null,b=null,g=null,E=null!=e.hydrationData,x=W(f,e.history.location,d),R=null;if(null==x){var D=Xe(404,{pathname:e.history.location.pathname}),P=Ye(f);x=P.matches,R=v({},P.route.id,D)}var L,T=x.some((function(e){return e.route.lazy})),A=x.some((function(e){return e.route.loader}));if(T)s=!1;else if(A)if(h.v7_partialHydration){var j=e.hydrationData?e.hydrationData.loaderData:null,M=e.hydrationData?e.hydrationData.errors:null;s=x.every((function(e){return e.route.loader&&!0!==e.route.loader.hydrate&&(j&&void 0!==j[e.route.id]||M&&void 0!==M[e.route.id])}))}else s=null!=e.hydrationData;else s=!0;var I,B={historyAction:e.history.action,location:e.history.location,matches:x,initialized:s,navigation:_e,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||R,fetchers:new Map,blockers:new Map},N=n.Pop,z=!1,$=!1,J=new Map,q=null,V=!1,Y=!1,X=[],G=[],Q=new Map,Z=0,ee=-1,te=new Map,re=new Set,ne=new Map,ae=new Map,ie=new Set,ue=new Map,se=new Map,ce=!1;function le(e,t){void 0===t&&(t={}),B=C({},B,e);var r=[],n=[];h.v7_fetcherPersist&&B.fetchers.forEach((function(e,t){"idle"===e.state&&(ie.has(t)?n.push(t):r.push(t))})),S(m).forEach((function(e){return e(B,{deletedFetchers:n,unstable_viewTransitionOpts:t.viewTransitionOpts,unstable_flushSync:!0===t.flushSync})})),h.v7_fetcherPersist&&(r.forEach((function(e){return B.fetchers.delete(e)})),n.forEach((function(e){return Se(e)})))}function fe(t,r,a){var o,i,s,c=(void 0===a?{}:a).flushSync,l=null!=B.actionData&&null!=B.navigation.formMethod&&rt(B.navigation.formMethod)&&"loading"===B.navigation.state&&!0!==(null==(o=t.state)?void 0:o._isRedirect);s=r.actionData?Object.keys(r.actionData).length>0?r.actionData:null:l?B.actionData:null;var d=r.loaderData?qe(B.loaderData,r.loaderData,r.matches||[],r.errors):B.loaderData,h=B.blockers;h.size>0&&(h=new Map(h)).forEach((function(e,t){return h.set(t,Te)}));var v,p=!0===z||null!=B.navigation.formMethod&&rt(B.navigation.formMethod)&&!0!==(null==(i=t.state)?void 0:i._isRedirect);if(u&&(f=u,u=void 0),V||N===n.Pop||(N===n.Push?e.history.push(t,t.state):N===n.Replace&&e.history.replace(t,t.state)),N===n.Pop){var m=J.get(B.location.pathname);m&&m.has(t.pathname)?v={currentLocation:B.location,nextLocation:t}:J.has(t.pathname)&&(v={currentLocation:t,nextLocation:B.location})}else if($){var y=J.get(B.location.pathname);y?y.add(t.pathname):(y=new Set([t.pathname]),J.set(B.location.pathname,y)),v={currentLocation:B.location,nextLocation:t}}le(C({},r,{actionData:s,loaderData:d,historyAction:N,location:t,initialized:!0,navigation:_e,revalidation:"idle",restoreScrollPosition:ze(t,r.matches||B.matches),preventScrollReset:p,blockers:h}),{viewTransitionOpts:v,flushSync:!0===c}),N=n.Pop,z=!1,$=!1,V=!1,Y=!1,X=[],G=[]}function de(t,r,n){return l((function(){var a,o,i,s,c,l,h,p,m,b,w,S,E,x,R,D;return k(this,(function(k){switch(k.label){case 0:return I&&I.abort(),I=null,N=t,V=!0===(n&&n.startUninterruptedRevalidation),function(e,t){if(y&&g){var r=Ne(e,t);y[r]=g()}}(B.location,B.matches),z=!0===(n&&n.preventScrollReset),$=!0===(n&&n.enableViewTransition),a=u||f,o=n&&n.overrideNavigation,i=W(a,r,d),s=!0===(n&&n.flushSync),i?!B.initialized||Y||(P=B.location,_=r,P.pathname!==_.pathname||P.search!==_.search||(""===P.hash||P.hash!==_.hash)&&""===_.hash)||n&&n.submission&&rt(n.submission.formMethod)?(I=new AbortController,m=We(e.history,r,I.signal,n&&n.submission),n&&n.pendingError?(w=v({},Ve(i).route.id,n.pendingError),[3,3]):[3,1]):(fe(r,{matches:i},{flushSync:s}),[2]):(c=Xe(404,{pathname:r.pathname}),l=Ye(a),h=l.matches,p=l.route,Be(),fe(r,{matches:h,loaderData:{},errors:v({},p.id,c)},{flushSync:s}),[2]);case 1:return n&&n.submission&&rt(n.submission.formMethod)?[4,he(m,r,n.submission,i,{replace:n.replace,flushSync:s})]:[3,3];case 2:if((S=k.sent()).shortCircuited)return[2];b=S.pendingActionData,w=S.pendingActionError,o=st(r,n.submission),s=!1,m=new Request(m.url,{signal:m.signal}),k.label=3;case 3:return[4,ve(m,r,i,o,n&&n.submission,n&&n.fetcherSubmission,n&&n.replace,n&&!0===n.initialHydration,s,b,w)];case 4:return E=k.sent(),x=E.shortCircuited,R=E.loaderData,D=E.errors,x||(I=null,fe(r,C({matches:i},b?{actionData:b}:{},{loaderData:R,errors:D}))),[2]}var P,_}))}))()}function he(e,r,a,o,i){return l((function(){var u,s,l,f,p;return k(this,(function(m){switch(m.label){case 0:return void 0===i&&(i={}),ye(),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}}(r,a),le({navigation:u},{flushSync:!0===i.flushSync}),(l=it(o,r)).route.action||l.route.lazy?[3,1]:(s={type:_.error,error:Xe(405,{method:e.method,pathname:r.pathname,routeId:l.route.id})},[3,3]);case 1:return[4,He("action",e,l,o,c,t,d,h.v7_relativeSplatPath)];case 2:if(s=m.sent(),e.signal.aborted)return[2,{shortCircuited:!0}];m.label=3;case 3:return tt(s)?(f=i&&null!=i.replace?i.replace:s.location===B.location.pathname+B.location.search,[4,pe(B,s,{submission:a,replace:f})]):[3,5];case 4:return m.sent(),[2,{shortCircuited:!0}];case 5:if(et(s))return p=Ve(o,l.route.id),!0!==(i&&i.replace)&&(N=n.Push),[2,{pendingActionData:{},pendingActionError:v({},p.route.id,s.error)}];if(Ze(s))throw Xe(400,{type:"defer-action"});return[2,{pendingActionData:v({},l.route.id,s.data)}]}}))}))()}function ve(t,r,n,a,o,i,s,c,v,p,m){return l((function(){var l,y,b,g,S,E,x,R,D,P,_,L,T,A,j,O,U,M,F,N,z;return k(this,(function(k){switch(k.label){case 0:return l=a||st(r,o),y=o||i||ut(l),b=u||f,g=w(Ie(e.history,B,n,y,r,h.v7_partialHydration&&!0===c,Y,X,G,ie,ne,re,b,d,p,m),2),S=g[0],E=g[1],Be((function(e){return!(n&&n.some((function(t){return t.route.id===e})))||S&&S.some((function(t){return t.route.id===e}))})),ee=++Z,0===S.length&&0===E.length?(x=Re(),fe(r,C({matches:n,loaderData:{},errors:m||null},p?{actionData:p}:{},x?{fetchers:new Map(B.fetchers)}:{}),{flushSync:v}),[2,{shortCircuited:!0}]):(V||h.v7_partialHydration&&c||(E.forEach((function(e){var t=B.fetchers.get(e.key),r=ct(void 0,t?t.data:void 0);B.fetchers.set(e.key,r)})),R=p||B.actionData,le(C({navigation:l},R?0===Object.keys(R).length?{actionData:null}:{actionData:R}:{},E.length>0?{fetchers:new Map(B.fetchers)}:{}),{flushSync:v})),E.forEach((function(e){Q.has(e.key)&&Ee(e.key),e.controller&&Q.set(e.key,e.controller)})),D=function(){return E.forEach((function(e){return Ee(e.key)}))},I&&I.signal.addEventListener("abort",D),[4,me(B.matches,n,S,E,t)]);case 1:return P=k.sent(),_=P.results,L=P.loaderResults,T=P.fetcherResults,t.signal.aborted?[2,{shortCircuited:!0}]:(I&&I.signal.removeEventListener("abort",D),E.forEach((function(e){return Q.delete(e.key)})),(A=Ge(_))?(A.idx>=S.length&&(j=E[A.idx-S.length].key,re.add(j)),[4,pe(B,A.result,{replace:s})]):[3,3]);case 2:return k.sent(),[2,{shortCircuited:!0}];case 3:return O=Je(B,n,S,L,m,E,T,ue),U=O.loaderData,M=O.errors,ue.forEach((function(e,t){e.subscribe((function(r){(r||e.done)&&ue.delete(t)}))})),F=Re(),N=De(ee),z=F||N||E.length>0,[2,C({loaderData:U,errors:M},z?{fetchers:new Map(B.fetchers)}:{})]}}))}))()}function pe(t,o,i){return l((function(){var u,s,c,l,f,h,v,p,m,y,b,g,w,S;return k(this,(function(E){switch(E.label){case 0:return s=(u=void 0===i?{}:i).submission,c=u.fetcherSubmission,l=u.replace,o.revalidate&&(Y=!0),O(f=F(t.location,o.location,{_isRedirect:!0}),"Expected a location on the redirect navigation"),a&&(h=!1,o.reloadDocument?h=!0:Ae.test(o.location)&&(v=e.history.createURL(o.location),h=v.origin!==r.location.origin||null==oe(v.pathname,d)),h)?(l?r.location.replace(o.location):r.location.assign(o.location),[2]):(I=null,p=!0===l?n.Replace:n.Push,m=t.navigation,y=m.formMethod,b=m.formAction,g=m.formEncType,!s&&!c&&y&&b&&g&&(s=ut(t.navigation)),w=s||c,Ce.has(o.status)&&w&&rt(w.formMethod)?[4,de(p,f,{submission:C({},w,{formAction:o.location}),preventScrollReset:z})]:[3,2]);case 1:return E.sent(),[3,4];case 2:return S=st(f,s),[4,de(p,f,{overrideNavigation:S,fetcherSubmission:c,preventScrollReset:z})];case 3:E.sent(),E.label=4;case 4:return[2]}}))}))()}function me(r,n,a,o,i){return l((function(){var u,s,l;return k(this,(function(f){switch(f.label){case 0:return[4,Promise.all(S(a.map((function(e){return He("loader",i,e,n,c,t,d,h.v7_relativeSplatPath)}))).concat(S(o.map((function(r){return r.matches&&r.match&&r.controller?He("loader",We(e.history,r.path,r.controller.signal),r.match,r.matches,c,t,d,h.v7_relativeSplatPath):{type:_.error,error:Xe(404,{pathname:r.path})}})))))];case 1:return u=f.sent(),s=u.slice(0,a.length),l=u.slice(a.length),[4,Promise.all([nt(r,a,s,s.map((function(){return i.signal})),!1,B.loaderData),nt(r,o.map((function(e){return e.match})),l,o.map((function(e){return e.controller?e.controller.signal:null})),!0)])];case 2:return f.sent(),[2,{results:u,loaderResults:s,fetcherResults:l}]}}))}))()}function ye(){var e;Y=!0,(e=X).push.apply(e,S(Be())),ne.forEach((function(e,t){Q.has(t)&&(G.push(t),Ee(t))}))}function be(e,t,r){void 0===r&&(r={}),B.fetchers.set(e,t),le({fetchers:new Map(B.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function ge(e,t,r,n){void 0===n&&(n={});var a=Ve(B.matches,t);Se(e),le({errors:v({},a.route.id,r),fetchers:new Map(B.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function we(e){return h.v7_fetcherPersist&&(ae.set(e,(ae.get(e)||0)+1),ie.has(e)&&ie.delete(e)),B.fetchers.get(e)||Le}function Se(e){var t=B.fetchers.get(e);!Q.has(e)||t&&"loading"===t.state&&te.has(e)||Ee(e),ne.delete(e),te.delete(e),re.delete(e),ie.delete(e),B.fetchers.delete(e)}function Ee(e){var t=Q.get(e);O(t,"Expected fetch controller: "+e),t.abort(),Q.delete(e)}function xe(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=lt(we(i).data);B.fetchers.set(i,u)}}catch(e){r=!0,n=e}finally{try{t||null==o.return||o.return()}finally{if(r)throw n}}}function Re(){var e=[],t=!1,r=!0,n=!1,a=void 0;try{for(var o,i=re[Symbol.iterator]();!(r=(o=i.next()).done);r=!0){var u=o.value,s=B.fetchers.get(u);O(s,"Expected fetcher: "+u),"loading"===s.state&&(re.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 xe(e),t}function De(e){var t=[],r=!0,n=!1,a=void 0;try{for(var o,i=te[Symbol.iterator]();!(r=(o=i.next()).done);r=!0){var u=w(o.value,2),s=u[0];if(u[1]<e){var c=B.fetchers.get(s);O(c,"Expected fetcher: "+s),"loading"===c.state&&(Ee(s),te.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 xe(t),t.length>0}function ke(e){B.blockers.delete(e),se.delete(e)}function Pe(e,t){var r=B.blockers.get(e)||Te;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(B.blockers);n.set(e,t),le({blockers:n})}function Ue(e){var t=e.currentLocation,r=e.nextLocation,n=e.historyAction;if(0!==se.size){se.size>1&&U(!1,"A router only supports one blocker at a time");var a=Array.from(se.entries()),o=w(a[a.length-1],2),i=o[0],u=o[1],s=B.blockers.get(i);if(!s||"proceeding"!==s.state)return u({currentLocation:t,nextLocation:r,historyAction:n})?i:void 0}}function Be(e){var t=[];return ue.forEach((function(r,n){e&&!e(n)||(r.cancel(),t.push(n),ue.delete(n))})),t}function Ne(e,t){return b&&b(e,t.map((function(e){return K(e,B.loaderData)})))||e.key}function ze(e,t){if(y){var r=Ne(e,t),n=y[r];if("number"==typeof n)return n}return null}return L={get basename(){return d},get future(){return h},get state(){return B},get routes(){return f},get window(){return r},initialize:function(){if(p=e.history.listen((function(t){var r=t.action,n=t.location,a=t.delta;if(!ce){U(0===se.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=Ue({currentLocation:B.location,nextLocation:n,historyAction:r});return o&&null!=a?(ce=!0,e.history.go(-1*a),void Pe(o,{state:"blocked",location:n,proceed:function(){Pe(o,{state:"proceeding",proceed:void 0,reset:void 0,location:n}),e.history.go(a)},reset:function(){var e=new Map(B.blockers);e.set(o,Te),le({blockers:e})}})):de(r,n)}ce=!1})),a){!function(e,t){try{var r=e.sessionStorage.getItem(Oe);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,J);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(Oe,JSON.stringify(r))}catch(e){U(!1,"Failed to save applied view transitions in sessionStorage ("+e+").")}}}(r,J)};r.addEventListener("pagehide",t),q=function(){return r.removeEventListener("pagehide",t)}}return B.initialized||de(n.Pop,B.location,{initialHydration:!0}),L},subscribe:function(e){return m.add(e),function(){return m.delete(e)}},enableScrollRestoration:function(e,t,r){if(y=e,g=t,b=r||null,!E&&B.navigation===_e){E=!0;var n=ze(B.location,B.matches);null!=n&&le({restoreScrollPosition:n})}return function(){y=null,g=null,b=null}},navigate:function t(r,a){return l((function(){var o,i,u,s,c,l,f,v,p,m,y,b;return k(this,(function(g){switch(g.label){case 0:return"number"==typeof r?(e.history.go(r),[2]):(o=Me(B.location,B.matches,d,h.v7_prependBasename,r,h.v7_relativeSplatPath,null==a?void 0:a.fromRouteId,null==a?void 0:a.relative),i=Fe(h.v7_normalizeFormMethod,!1,o,a),u=i.path,s=i.submission,c=i.error,l=B.location,f=C({},f=F(B.location,u,a&&a.state),e.history.encodeLocation(f)),v=a&&null!=a.replace?a.replace:void 0,p=n.Push,!0===v?p=n.Replace:!1===v||null!=s&&rt(s.formMethod)&&s.formAction===B.location.pathname+B.location.search&&(p=n.Replace),m=a&&"preventScrollReset"in a?!0===a.preventScrollReset:void 0,y=!0===(a&&a.unstable_flushSync),(b=Ue({currentLocation:l,nextLocation:f,historyAction:p}))?(Pe(b,{state:"blocked",location:f,proceed:function(){Pe(b,{state:"proceeding",proceed:void 0,reset:void 0,location:f}),t(r,a)},reset:function(){var e=new Map(B.blockers);e.set(b,Te),le({blockers:e})}}),[2]):[4,de(p,f,{submission:s,pendingError:c,preventScrollReset:m,replace:a&&a.replace,enableViewTransition:a&&a.unstable_viewTransition,flushSync:y})]);case 1:return[2,g.sent()]}}))}))()},fetch:function(r,n,a,i){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.");Q.has(r)&&Ee(r);var s=!0===(i&&i.unstable_flushSync),p=u||f,m=Me(B.location,B.matches,d,h.v7_prependBasename,a,h.v7_relativeSplatPath,n,null==i?void 0:i.relative),y=W(p,m,d);if(y){var b=Fe(h.v7_normalizeFormMethod,!0,m,i),g=b.path,S=b.submission,E=b.error;if(E)ge(r,n,E,{flushSync:s});else{var x=it(y,g);z=!0===(i&&i.preventScrollReset),S&&rt(S.formMethod)?function(r,n,a,o,i,s,p){l((function(){var l,m,y,b,g,S,E,x,R,D,P,C,_,L,T,A,j,U,M,F,z,H,K,$,J,q;return k(this,(function(k){switch(k.label){case 0:return ye(),ne.delete(r),o.route.action||o.route.lazy?(m=B.fetchers.get(r),be(r,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}}(p,m),{flushSync:s}),y=new AbortController,b=We(e.history,a,y.signal,p),Q.set(r,y),g=Z,[4,He("action",b,o,i,c,t,d,h.v7_relativeSplatPath)]):(l=Xe(405,{method:p.formMethod,pathname:a,routeId:n}),ge(r,n,l,{flushSync:s}),[2]);case 1:if(S=k.sent(),b.signal.aborted)return Q.get(r)===y&&Q.delete(r),[2];if(h.v7_fetcherPersist&&ie.has(r)){if(tt(S)||et(S))return be(r,lt(void 0)),[2]}else{if(tt(S))return Q.delete(r),ee>g?(be(r,lt(void 0)),[2]):(re.add(r),be(r,ct(p)),[2,pe(B,S,{fetcherSubmission:p})]);if(et(S))return ge(r,n,S.error),[2]}if(Ze(S))throw Xe(400,{type:"defer-action"});return E=B.navigation.location||B.location,x=We(e.history,E,y.signal),R=u||f,O(D="idle"!==B.navigation.state?W(R,B.navigation.location,d):B.matches,"Didn't find any matches after fetcher action"),P=++Z,te.set(r,P),C=ct(p,S.data),B.fetchers.set(r,C),_=w(Ie(e.history,B,D,p,E,!1,Y,X,G,ie,ne,re,R,d,v({},o.route.id,S.data),void 0),2),L=_[0],(T=_[1]).filter((function(e){return e.key!==r})).forEach((function(e){var t=e.key,r=B.fetchers.get(t),n=ct(void 0,r?r.data:void 0);B.fetchers.set(t,n),Q.has(t)&&Ee(t),e.controller&&Q.set(t,e.controller)})),le({fetchers:new Map(B.fetchers)}),A=function(){return T.forEach((function(e){return Ee(e.key)}))},y.signal.addEventListener("abort",A),[4,me(B.matches,D,L,T,x)];case 2:return j=k.sent(),U=j.results,M=j.loaderResults,F=j.fetcherResults,y.signal.aborted?[2]:(y.signal.removeEventListener("abort",A),te.delete(r),Q.delete(r),T.forEach((function(e){return Q.delete(e.key)})),(z=Ge(U))?(z.idx>=L.length&&(H=T[z.idx-L.length].key,re.add(H)),[2,pe(B,z.result)]):(K=Je(B,B.matches,L,M,void 0,T,F,ue),$=K.loaderData,J=K.errors,B.fetchers.has(r)&&(q=lt(S.data),B.fetchers.set(r,q)),De(P),"loading"===B.navigation.state&&P>ee?(O(N,"Expected pending action"),I&&I.abort(),fe(B.navigation.location,{matches:D,loaderData:$,errors:J,fetchers:new Map(B.fetchers)})):(le({errors:J,loaderData:qe(B.loaderData,$,D,J),fetchers:new Map(B.fetchers)}),Y=!1),[2]))}}))}))()}(r,n,g,x,y,s,S):(ne.set(r,{routeId:n,path:g}),function(r,n,a,o,i,u,s){l((function(){var l,f,v,p,m;return k(this,(function(y){switch(y.label){case 0:return l=B.fetchers.get(r),be(r,ct(s,l?l.data:void 0),{flushSync:u}),f=new AbortController,v=We(e.history,a,f.signal),Q.set(r,f),p=Z,[4,He("loader",v,o,i,c,t,d,h.v7_relativeSplatPath)];case 1:return Ze(m=y.sent())?[4,at(m,v.signal,!0)]:[3,3];case 2:m=y.sent()||m,y.label=3;case 3:return Q.get(r)===f&&Q.delete(r),v.signal.aborted?[2]:ie.has(r)?(be(r,lt(void 0)),[2]):tt(m)?ee>p?(be(r,lt(void 0)),[2]):[3,4]:[3,6];case 4:return re.add(r),[4,pe(B,m)];case 5:return y.sent(),[2];case 6:return et(m)?(ge(r,n,m.error),[2]):(O(!Ze(m),"Unhandled fetcher deferred data"),be(r,lt(m.data)),[2])}}))}))()}(r,n,g,x,y,s,S))}}else ge(r,n,Xe(404,{pathname:m}),{flushSync:s})},revalidate:function(){ye(),le({revalidation:"loading"}),"submitting"!==B.navigation.state&&("idle"!==B.navigation.state?de(N||B.historyAction,B.navigation.location,{overrideNavigation:B.navigation}):de(B.historyAction,B.location,{startUninterruptedRevalidation:!0}))},createHref:function(t){return e.history.createHref(t)},encodeLocation:function(t){return e.history.encodeLocation(t)},getFetcher:we,deleteFetcher:function(e){if(h.v7_fetcherPersist){var t=(ae.get(e)||0)-1;t<=0?(ae.delete(e),ie.add(e)):ae.set(e,t)}else Se(e);le({fetchers:new Map(B.fetchers)})},dispose:function(){p&&p(),q&&q(),m.clear(),I&&I.abort(),B.fetchers.forEach((function(e,t){return Se(t)})),B.blockers.forEach((function(e,t){return ke(t)}))},getBlocker:function(e,t){var r=B.blockers.get(e)||Te;return se.get(e)!==t&&se.set(e,t),r},deleteBlocker:ke,_internalFetchControllers:Q,_internalActiveDeferreds:ue,_internalSetRoutes:function(e){u=H(e,t,void 0,c={})}},L}function Me(e,t,r,n,a,o,i,u){var s,c;if(i){s=[];var l=!0,f=!1,d=void 0;try{for(var h,v=t[Symbol.iterator]();!(l=(h=v.next()).done);l=!0){var p=h.value;if(s.push(p),p.route.id===i){c=p;break}}}catch(e){f=!0,d=e}finally{try{l||null==v.return||v.return()}finally{if(f)throw d}}}else s=t,c=t[t.length-1];var m=le(a||".",ce(s,o),oe(e.pathname,r)||e.pathname,"path"===u);return null==a&&(m.search=e.search,m.hash=e.hash),null!=a&&""!==a&&"."!==a||!c||!c.route.index||ot(m.search)||(m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index"),n&&"/"!==r&&(m.pathname="/"===m.pathname?r:fe([r,m.pathname])),I(m)}function Fe(e,t,r,n){if(!n||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(n))return{path:r};if(n.formMethod&&(a=n.formMethod,!ke.has(a.toLowerCase())))return{path:r,error:Xe(405,{method:n.formMethod})};var a,o,i,u=function(){return{path:r,error:Xe(400,{type:"invalid-body"})}},s=n.formMethod||"get",c=e?s.toUpperCase():s.toLowerCase(),l=Qe(r);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!rt(c))return u();var f="string"==typeof n.body?n.body:m(n.body,FormData)||m(n.body,URLSearchParams)?Array.from(n.body.entries()).reduce((function(e,t){var r=w(t,2);return""+e+r[0]+"="+r[1]+"\n"}),""):String(n.body);return{path:r,submission:{formMethod:c,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:f}}}if("application/json"===n.formEncType){if(!rt(c))return u();try{var d="string"==typeof n.body?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:c,formAction:l,formEncType:n.formEncType,formData:void 0,json:d,text:void 0}}}catch(e){return u()}}}if(O("function"==typeof FormData,"FormData is not available in this environment"),n.formData)o=Ke(n.formData),i=n.formData;else if(m(n.body,FormData))o=Ke(n.body),i=n.body;else if(m(n.body,URLSearchParams))i=$e(o=n.body);else if(null==n.body)o=new URLSearchParams,i=new FormData;else try{i=$e(o=new URLSearchParams(n.body))}catch(e){return u()}var h={formMethod:c,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(rt(h.formMethod))return{path:r,submission:h};var v=B(r);return t&&v.search&&ot(v.search)&&o.append("index",""),v.search="?"+o,{path:I(v),submission:h}}function Ie(e,t,r,n,a,o,i,u,s,c,l,f,d,h,v,p){var m=p?Object.values(p)[0]:v?Object.values(v)[0]:void 0,y=e.createURL(t.location),b=e.createURL(a),g=p?Object.keys(p)[0]:void 0,w=function(e,t){var r=e;if(t){var n=e.findIndex((function(e){return e.route.id===t}));n>=0&&(r=e.slice(0,n))}return r}(r,g).filter((function(e,r){var a=e.route;if(a.lazy)return!0;if(null==a.loader)return!1;if(o)return!!a.loader.hydrate||void 0===t.loaderData[a.id]&&(!t.errors||void 0===t.errors[a.id]);if(function(e,t,r){var n=!t||r.route.id!==t.route.id,a=void 0===e[r.route.id];return n||a}(t.loaderData,t.matches[r],e)||u.some((function(t){return t===e.route.id})))return!0;var s=t.matches[r],c=e;return Ne(e,C({currentUrl:y,currentParams:s.params,nextUrl:b,nextParams:c.params},n,{actionResult:m,defaultShouldRevalidate:i||y.pathname+y.search===b.pathname+b.search||y.search!==b.search||Be(s,c)}))})),S=[];return l.forEach((function(e,a){if(!o&&r.some((function(t){return t.route.id===e.routeId}))&&!c.has(a)){var u=W(d,e.path,h);if(u){var l=t.fetchers.get(a),v=it(u,e.path);!f.has(a)&&(s.includes(a)||(l&&"idle"!==l.state&&void 0===l.data?i:Ne(v,C({currentUrl:y,currentParams:t.matches[t.matches.length-1].params,nextUrl:b,nextParams:r[r.length-1].params},n,{actionResult:m,defaultShouldRevalidate:i}))))&&S.push({key:a,routeId:e.routeId,path:e.path,matches:u,match:v,controller:new AbortController})}else S.push({key:a,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null})}})),[w,S]}function Be(e,t){var r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function Ne(e,t){if(e.route.shouldRevalidate){var r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}function ze(e,t,r){return l((function(){var n,a,o,i,u;return k(this,(function(s){switch(s.label){case 0:return e.lazy?[4,e.lazy()]:[2];case 1:if(n=s.sent(),!e.lazy)return[2];for(var c in O(a=r[e.id],"No route found in manifest"),o={},n)i=a[c],U(!(u=void 0!==i&&"hasErrorBoundary"!==c),'Route "'+a.id+'" has a static property "'+c+'" defined but its lazy function is also returning a value for this property. The lazy route property "'+c+'" will be ignored.'),u||z.has(c)||(o[c]=n[c]);return Object.assign(a,o),Object.assign(a,C({},t(a),{lazy:void 0})),[2]}}))}))()}function He(e,t,r,n,a,o,i,u,s){return l((function(){var c,l,f,d,h,v,p,m,y,b,g,w,S,x,R,D,P,C,L,T,A;return k(this,(function(k){switch(k.label){case 0:void 0===s&&(s={}),d=function(e){var n,a=new Promise((function(e,t){return n=t}));return f=function(){return n()},t.signal.addEventListener("abort",f),Promise.race([e({request:t,params:r.params,context:s.requestContext}),a])},k.label=1;case 1:return k.trys.push([1,12,13,14]),h=r.route[e],r.route.lazy?h?[4,Promise.all([d(h).catch((function(e){v=e})),ze(r.route,o,a)])]:[3,3]:[3,8];case 2:if(p=k.sent(),v)throw v;return l=p[0],[3,7];case 3:return[4,ze(r.