@ugandaemr/esm-patient-queues-app
Version:
Patient queues microfrontend for UgandaEMR
2 lines • 88 kB
JavaScript
/*! For license information please see 73.js.LICENSE.txt */
"use strict";(globalThis.webpackChunk_ugandaemr_esm_patient_queues_app=globalThis.webpackChunk_ugandaemr_esm_patient_queues_app||[]).push([[73],{5073:(e,t,r)=>{r.r(t),r.d(t,{AbortedDeferredError:()=>fe,Await:()=>gr,BrowserRouter:()=>Vr,Form:()=>on,HashRouter:()=>Xr,Link:()=>rn,MemoryRouter:()=>hr,NavLink:()=>nn,Navigate:()=>pr,NavigationType:()=>n,Outlet:()=>vr,Route:()=>mr,Router:()=>yr,RouterProvider:()=>fr,Routes:()=>br,ScrollRestoration:()=>un,UNSAFE_DataRouterContext:()=>Et,UNSAFE_DataRouterStateContext:()=>Rt,UNSAFE_LocationContext:()=>Dt,UNSAFE_NavigationContext:()=>xt,UNSAFE_RouteContext:()=>Ct,UNSAFE_useRouteId:()=>Qt,UNSAFE_useScrollRestoration:()=>En,createBrowserRouter:()=>Hr,createHashRouter:()=>Kr,createMemoryRouter:()=>kr,createPath:()=>_,createRoutesFromChildren:()=>xr,createRoutesFromElements:()=>xr,createSearchParams:()=>Tr,defer:()=>he,generatePath:()=>Q,isRouteErrorResponse:()=>ye,json:()=>le,matchPath:()=>Z,matchRoutes:()=>N,parsePath:()=>T,redirect:()=>pe,redirectDocument:()=>ve,renderMatches:()=>Dr,resolvePath:()=>re,unstable_HistoryRouter:()=>Gr,unstable_useBlocker:()=>sr,unstable_usePrompt:()=>Sn,useActionData:()=>or,useAsyncError:()=>ur,useAsyncValue:()=>ir,useBeforeUnload:()=>Rn,useFetcher:()=>yn,useFetchers:()=>bn,useFormAction:()=>vn,useHref:()=>At,useInRouterContext:()=>Pt,useLinkClickHandler:()=>ln,useLoaderData:()=>rr,useLocation:()=>jt,useMatch:()=>Ot,useMatches:()=>tr,useNavigate:()=>Mt,useNavigation:()=>Zt,useNavigationType:()=>Lt,useOutlet:()=>It,useOutletContext:()=>Tt,useParams:()=>Bt,useResolvedPath:()=>Ft,useRevalidator:()=>er,useRouteError:()=>ar,useRouteLoaderData:()=>nr,useRoutes:()=>Nt,useSearchParams:()=>fn,useSubmit:()=>hn});var n,o=r(268);function a(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 i(e){if(Array.isArray(e))return e}function u(e,t,r,n,o,a,i){try{var u=e[a](i),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).then(n,o)}function c(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){u(a,n,o,i,c,"next",e)}function c(e){u(a,n,o,i,c,"throw",e)}i(void 0)}))}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t,r){return l=R()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&y(o,r.prototype),o},l.apply(null,arguments)}function f(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 d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function p(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function v(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function m(){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 y(e,t){return y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},y(e,t)}function b(e,t){return i(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],i=!0,u=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){u=!0,o=e}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}}(e,t)||w(e,t)||m()}function g(e){return function(e){if(Array.isArray(e))return a(e)}(e)||v(e)||w(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 w(e,t){if(e){if("string"==typeof e)return a(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)?a(e,t):void 0}}function E(e){var t="function"==typeof Map?new Map:void 0;return E=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 l(e,arguments,h(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),y(n,e)},E(e)}function R(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function S(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}function x(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 C,k="popstate";function A(e){var t=function(e){return Math.min(Math.max(e,0),i.length-1)},r=function(){return i[d]},o=function(e,t,n){void 0===t&&(t=null);var o=M(i?r().pathname:"/",e,t,n);return O("/"===o.pathname.charAt(0),"relative pathnames are not supported in memory history: "+JSON.stringify(e)),o},a=function(e){return"string"==typeof e?e:_(e)};void 0===e&&(e={});var i,u=e.initialEntries,c=void 0===u?["/"]:u,s=e.initialIndex,l=e.v5Compat,f=void 0!==l&&l;i=c.map((function(e,t){return o(e,"string"==typeof e?null:e.state,0===t?"default":void 0)}));var d=t(null==s?i.length-1:s),h=n.Pop,p=null;return{get index(){return d},get action(){return h},get location(){return r()},createHref:a,createURL:function(e){return new URL(a(e),"http://localhost")},encodeLocation:function(e){var t="string"==typeof e?T(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push:function(e,t){h=n.Push;var r=o(e,t);d+=1,i.splice(d,i.length,r),f&&p&&p({action:h,location:r,delta:1})},replace:function(e,t){h=n.Replace;var r=o(e,t);i[d]=r,f&&p&&p({action:h,location:r,delta:0})},go:function(e){h=n.Pop;var r=t(d+e),o=i[r];d=r,p&&p({action:h,location:o,delta:e})},listen:function(e){return p=e,function(){p=null}}}}function P(e){return void 0===e&&(e={}),I((function(e,t){var r=e.location;return M("",{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:_(t)}),null,e)}function j(e){return void 0===e&&(e={}),I((function(e,t){var r=T(e.location.hash.substr(1)),n=r.pathname,o=void 0===n?"/":n,a=r.search,i=void 0===a?"":a,u=r.hash,c=void 0===u?"":u;return o.startsWith("/")||o.startsWith(".")||(o="/"+o),M("",{pathname:o,search:i,hash:c},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 o=e.location.href,a=o.indexOf("#");n=-1===a?o:o.slice(0,a)}return n+"#"+("string"==typeof t?t:_(t))}),(function(e,t){O("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),e)}function L(e,t){if(!1===e||null==e)throw new Error(t)}function O(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 M(e,t,r,n){return void 0===r&&(r=null),D({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?T(t):t,{state:r,key:t&&t.key||n||Math.random().toString(36).substr(2,8)})}function _(e){var t=e.pathname,r=void 0===t?"/":t,n=e.search,o=void 0===n?"":n,a=e.hash,i=void 0===a?"":a;return o&&"?"!==o&&(r+="?"===o.charAt(0)?o:"?"+o),i&&"#"!==i&&(r+="#"===i.charAt(0)?i:"#"+i),r}function T(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 I(e,t,r,o){var a=function(){return(d.state||{idx:null}).idx},i=function(){h=n.Pop;var e=a(),t=null==e?null:e-m;m=e,v&&v({action:h,location:y.location,delta:t})},u=function(e){var t="null"!==s.location.origin?s.location.origin:s.location.href,r="string"==typeof e?e:_(e);return L(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)};void 0===o&&(o={});var c=o.window,s=void 0===c?document.defaultView:c,l=o.v5Compat,f=void 0!==l&&l,d=s.history,h=n.Pop,v=null,m=a();null==m&&(m=0,d.replaceState(D({},d.state,{idx:m}),""));var y={get action(){return h},get location(){return e(s,d)},listen:function(e){if(v)throw new Error("A history only accepts one active listener");return s.addEventListener(k,i),v=e,function(){s.removeEventListener(k,i),v=null}},createHref:function(e){return t(s,e)},createURL:u,encodeLocation:function(e){var t=u(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){h=n.Push;var o=M(y.location,e,t);r&&r(o,e);var i=U(o,m=a()+1),u=y.createHref(o);try{d.pushState(i,"",u)}catch(e){if(p(e,DOMException)&&"DataCloneError"===e.name)throw e;s.location.assign(u)}f&&v&&v({action:h,location:y.location,delta:1})},replace:function(e,t){h=n.Replace;var o=M(y.location,e,t);r&&r(o,e);var i=U(o,m=a()),u=y.createHref(o);d.replaceState(i,"",u),f&&v&&v({action:h,location:y.location,delta:0})},go:function(e){return d.go(e)}};return y}!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(C||(C={}));var B=new Set(["lazy","caseSensitive","path","id","index","children"]);function F(e,t,r,n){return void 0===r&&(r=[]),void 0===n&&(n={}),e.map((function(e,o){var a=g(r).concat([o]),i="string"==typeof e.id?e.id:a.join("-");if(L(!0!==e.index||!e.children,"Cannot specify children on an index route"),L(!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 c=D({},e,t(e),{id:i,children:void 0});return n[i]=c,e.children&&(c.children=F(e.children,t,a,n)),c}))}function N(e,t,r){void 0===r&&(r="/");var n=te(("string"==typeof t?T(t):t).pathname||"/",r);if(null==n)return null;var o=z(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 a=null,i=0;null==a&&i<o.length;++i)a=G(o[i],ee(n));return a}function z(e,t,r,n){void 0===t&&(t=[]),void 0===r&&(r=[]),void 0===n&&(n="");var o=function(e,o,a){var i={relativePath:void 0===a?e.path||"":a,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};i.relativePath.startsWith("/")&&(L(i.relativePath.startsWith(n),'Absolute route path "'+i.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),i.relativePath=i.relativePath.slice(n.length));var u=ie([n,i.relativePath]),c=r.concat(i);e.children&&e.children.length>0&&(L(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+u+'".'),z(e.children,t,c,u)),(null!=e.path||e.index)&&t.push({path:u,score:X(u,e.index),routesMeta:c})};return e.forEach((function(e,t){var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?")){var n=!0,a=!1,i=void 0;try{for(var u,c=W(e.path)[Symbol.iterator]();!(n=(u=c.next()).done);n=!0){var s=u.value;o(e,t,s)}}catch(e){a=!0,i=e}finally{try{n||null==c.return||c.return()}finally{if(a)throw i}}}else o(e,t)})),t}function W(e){var t,r=e.split("/");if(0===r.length)return[];var n,o=i(n=r)||v(n)||w(n)||m(),a=o[0],u=o.slice(1),c=a.endsWith("?"),s=a.replace(/\?$/,"");if(0===u.length)return c?[s,""]:[s];var l,f=W(u.join("/")),d=[];return(t=d).push.apply(t,g(f.map((function(e){return""===e?s:[s,e].join("/")})))),c&&(l=d).push.apply(l,g(f)),d.map((function(t){return e.startsWith("/")&&""===t?"/":t}))}var $=/^:\w+$/,H=3,K=2,q=1,J=10,Y=-2,V=function(e){return"*"===e};function X(e,t){var r=e.split("/"),n=r.length;return r.some(V)&&(n+=Y),t&&(n+=K),r.filter((function(e){return!V(e)})).reduce((function(e,t){return e+($.test(t)?H:""===t?q:J)}),n)}function G(e,t){for(var r=e.routesMeta,n={},o="/",a=[],i=0;i<r.length;++i){var u=r[i],c=i===r.length-1,s="/"===o?t:t.slice(o.length)||"/",l=Z({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},s);if(!l)return null;Object.assign(n,l.params);var f=u.route;a.push({params:n,pathname:ie([o,l.pathname]),pathnameBase:ue(ie([o,l.pathnameBase])),route:f}),"/"!==l.pathnameBase&&(o=ie([o,l.pathnameBase]))}return a}function Q(e,t){void 0===t&&(t={});var r=e;r.endsWith("*")&&"*"!==r&&!r.endsWith("/*")&&(O(!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("/")?"/":"",o=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 o(t["*"]);var a=e.match(/^:(\w+)(\??)$/);if(a){var i=b(a,3),u=i[1],c=i[2],s=t[u];return L("?"===c||null!=s,'Missing ":'+u+'" param'),o(s)}return e.replace(/\?$/g,"")})).filter((function(e){return!!e})).join("/")}function Z(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});var r=b(function(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!0),O("*"===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=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(function(e,t){return n.push(t),"/([^\\/]+)"}));return e.endsWith("*")?(n.push("*"),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),n]}(e.path,e.caseSensitive,e.end),2),n=r[0],o=r[1],a=t.match(n);if(!a)return null;var i=a[0],u=i.replace(/(.)\/+$/,"$1"),c=a.slice(1);return{params:o.reduce((function(e,t,r){if("*"===t){var n=c[r]||"";u=i.slice(0,i.length-n.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e,t){try{return decodeURIComponent(e)}catch(r){return O(!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[r]||"",t),e}),{}),pathname:i,pathnameBase:u,pattern:e}}function ee(e){try{return decodeURI(e)}catch(t){return O(!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 te(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 re(e,t){void 0===t&&(t="/");var r="string"==typeof e?T(e):e,n=r.pathname,o=r.search,a=void 0===o?"":o,i=r.hash,u=void 0===i?"":i,c=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:c,search:ce(a),hash:se(u)}}function ne(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 oe(e){return e.filter((function(e,t){return 0===t||e.route.path&&e.route.path.length>0}))}function ae(e,t,r,n){var o;void 0===n&&(n=!1),"string"==typeof e?o=T(e):(L(!(o=D({},e)).pathname||!o.pathname.includes("?"),ne("?","pathname","search",o)),L(!o.pathname||!o.pathname.includes("#"),ne("#","pathname","hash",o)),L(!o.search||!o.search.includes("#"),ne("#","search","hash",o)));var a,i=""===e||""===o.pathname,u=i?"/":o.pathname;if(n||null==u)a=r;else{var c=t.length-1;if(u.startsWith("..")){for(var s=u.split("/");".."===s[0];)s.shift(),c-=1;o.pathname=s.join("/")}a=c>=0?t[c]:"/"}var l=re(o,a),f=u&&"/"!==u&&u.endsWith("/"),d=(i||"."===u)&&r.endsWith("/");return l.pathname.endsWith("/")||!f&&!d||(l.pathname+="/"),l}var ie=function(e){return e.join("/").replace(/\/\/+/g,"/")},ue=function(e){return e.replace(/\/+$/,"").replace(/^\/*/,"/")},ce=function(e){return e&&"?"!==e?e.startsWith("?")?e:"?"+e:""},se=function(e){return e&&"#"!==e?e.startsWith("#")?e:"#"+e:""},le=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}))},fe=function(e){!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&&y(e,t)}(o,e);var t,r,n=(t=o,r=R(),function(){var e,n,o,a,i=h(t);if(r){var u=h(this).constructor;e=Reflect.construct(i,arguments,u)}else e=i.apply(this,arguments);return n=this,!(o=e)||"object"!=((a=o)&&"undefined"!=typeof Symbol&&a.constructor===Symbol?"symbol":typeof a)&&"function"!=typeof o?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n):o});function o(){return s(this,o),n.apply(this,arguments)}return o}(E(Error)),de=function(){function e(t,r){var n,o=this;s(this,e),this.pendingKeysSet=new Set,this.subscribers=new Set,this.deferredKeys=[],L(t&&"object"==typeof t&&!Array.isArray(t),"defer() only accepts plain objects"),this.abortPromise=new Promise((function(e,t){return n=t})),this.controller=new AbortController;var a=function(){return n(new fe("Deferred data aborted"))};this.unlistenAbortSignal=function(){return o.controller.signal.removeEventListener("abort",a)},this.controller.signal.addEventListener("abort",a),this.data=Object.entries(t).reduce((function(e,t){var r=b(t,2),n=r[0],a=r[1];return Object.assign(e,d({},n,o.trackPromise(n,a)))}),{}),this.done&&this.unlistenAbortSignal(),this.init=r}var t,r;return t=e,(r=[{key:"trackPromise",value:function(e,t){var r=this;if(!p(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&&p(r,fe))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 o=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 o}}),this.emit(!1,t),Promise.reject(o)}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){var t=this;return c((function(){var r,n;return S(this,(function(o){switch(o.label){case 0:return r=!1,t.done?[3,2]:(n=function(){return t.cancel()},e.addEventListener("abort",n),[4,new Promise((function(r){t.subscribe((function(o){e.removeEventListener("abort",n),(o||t.done)&&r(o)}))}))]);case 1:r=o.sent(),o.label=2;case 2:return[2,r]}}))}))()}},{key:"done",get:function(){return 0===this.pendingKeysSet.size}},{key:"unwrappedData",get:function(){return L(null!==this.data&&this.done,"Can only unwrap data on initialized and settled deferreds"),Object.entries(this.data).reduce((function(e,t){var r=b(t,2),n=r[0],o=r[1];return Object.assign(e,d({},n,function(e){if(!function(e){return p(e,Promise)&&!0===e._tracked}(e))return e;if(e._error)throw e._error;return e._data}(o)))}),{})}},{key:"pendingKeys",get:function(){return Array.from(this.pendingKeysSet)}}])&&f(t.prototype,r),e}(),he=function(e,t){return void 0===t&&(t={}),new de(e,"number"==typeof t?{status:t}:t)},pe=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}))},ve=function(e,t){var r=pe(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r},me=function e(t,r,n,o){s(this,e),void 0===o&&(o=!1),this.status=t,this.statusText=r||"",this.internal=o,p(n,Error)?(this.data=n.toString(),this.error=n):this.data=n};function ye(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}var be=["post","put","patch","delete"],ge=new Set(be),we=["get"].concat(g(be)),Ee=new Set(we),Re=new Set([301,302,303,307,308]),Se=new Set([307,308]),xe={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},De={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ce={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ke=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ae=function(e){return{hasErrorBoundary:Boolean(e.hasErrorBoundary)}};function Pe(e){var t,r=function(e){ee=D({},ee,e),W.forEach((function(e){return e(ee)}))},o=function(t,o){var a,i,u,c=null!=ee.actionData&&null!=ee.navigation.formMethod&&Qe(ee.navigation.formMethod)&&"loading"===ee.navigation.state&&!0!==(null==(a=t.state)?void 0:a._isRedirect);u=o.actionData?Object.keys(o.actionData).length>0?o.actionData:null:c?ee.actionData:null;var s=o.loaderData?$e(ee.loaderData,o.loaderData,o.matches||[],o.errors):ee.loaderData,l=ee.blockers;l.size>0&&(l=new Map(l)).forEach((function(e,t){return l.set(t,Ce)}));var f=!0===ne||null!=ee.navigation.formMethod&&Qe(ee.navigation.formMethod)&&!0!==(null==(i=t.state)?void 0:i._isRedirect);U&&(T=U,U=void 0),oe||re===n.Pop||(re===n.Push?e.history.push(t,t.state):re===n.Replace&&e.history.replace(t,t.state)),r(D({},o,{actionData:u,loaderData:s,historyAction:re,location:t,initialized:!0,navigation:xe,revalidation:"idle",restoreScrollPosition:x(t,o.matches||ee.matches),preventScrollReset:f,blockers:l})),re=n.Pop,ne=!1,oe=!1,ae=!1,ie=[],ue=[]},a=function(e){return ee.fetchers.get(e)||De},i=function(){var e;ae=!0,(e=ie).push.apply(e,g(w())),he.forEach((function(e,t){ce.has(t)&&(ue.push(t),l(t))}))},u=function(e,t,n){var o=He(ee.matches,t);s(e),r({errors:d({},o.route.id,n),fetchers:new Map(ee.fetchers)})},s=function(e){var t=ee.fetchers.get(e);!ce.has(e)||t&&"loading"===t.state&&fe.has(e)||l(e),he.delete(e),fe.delete(e),de.delete(e),ee.fetchers.delete(e)},l=function(e){var t=ce.get(e);L(t,"Expected fetch controller: "+e),t.abort(),ce.delete(e)},f=function(e){var t=!0,r=!1,n=void 0;try{for(var o,i=e[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var u=o.value,c=ct(a(u).data);ee.fetchers.set(u,c)}}catch(e){r=!0,n=e}finally{try{t||null==i.return||i.return()}finally{if(r)throw n}}},h=function(){var e=[],t=!1,r=!0,n=!1,o=void 0;try{for(var a,i=de[Symbol.iterator]();!(r=(a=i.next()).done);r=!0){var u=a.value,c=ee.fetchers.get(u);L(c,"Expected fetcher: "+u),"loading"===c.state&&(de.delete(u),e.push(u),t=!0)}}catch(e){n=!0,o=e}finally{try{r||null==i.return||i.return()}finally{if(n)throw o}}return f(e),t},p=function(e){var t=[],r=!0,n=!1,o=void 0;try{for(var a,i=fe[Symbol.iterator]();!(r=(a=i.next()).done);r=!0){var u=b(a.value,2),c=u[0];if(u[1]<e){var s=ee.fetchers.get(c);L(s,"Expected fetcher: "+c),"loading"===s.state&&(l(c),fe.delete(c),t.push(c))}}}catch(e){n=!0,o=e}finally{try{r||null==i.return||i.return()}finally{if(n)throw o}}return f(t),t.length>0},v=function(e){ee.blockers.delete(e),ve.delete(e)},m=function(e,t){var n=ee.blockers.get(e)||Ce;L("unblocked"===n.state&&"blocked"===t.state||"blocked"===n.state&&"blocked"===t.state||"blocked"===n.state&&"proceeding"===t.state||"blocked"===n.state&&"unblocked"===t.state||"proceeding"===n.state&&"unblocked"===t.state,"Invalid blocker state transition: "+n.state+" -> "+t.state);var o=new Map(ee.blockers);o.set(e,t),r({blockers:o})},y=function(e){var t=e.currentLocation,r=e.nextLocation,n=e.historyAction;if(0!==ve.size){ve.size>1&&O(!1,"A router only supports one blocker at a time");var o=Array.from(ve.entries()),a=b(o[o.length-1],2),i=a[0],u=a[1],c=ee.blockers.get(i);if(!c||"proceeding"!==c.state)return u({currentLocation:t,nextLocation:r,historyAction:n})?i:void 0}},w=function(e){var t=[];return pe.forEach((function(r,n){e&&!e(n)||(r.cancel(),t.push(n),pe.delete(n))})),t},E=function(e,t){return H&&H(e,t.map((function(e){return t=e,r=ee.loaderData,n=t.route,o=t.pathname,a=t.params,{id:n.id,pathname:o,params:a,data:r[n.id],handle:n.handle};var t,r,n,o,a})))||e.key},R=function(e,t){if($&&K){var r=E(e,t);$[r]=K()}},x=function(e,t){if($){var r=E(e,t),n=$[r];if("number"==typeof n)return n}return null},k=e.window?e.window:"undefined"!=typeof window?window:void 0,A=void 0!==k&&void 0!==k.document&&void 0!==k.document.createElement,P=!A;if(L(e.routes.length>0,"You must provide a non-empty routes array to createRouter"),e.mapRouteProperties)t=e.mapRouteProperties;else if(e.detectErrorBoundary){var j=e.detectErrorBoundary;t=function(e){return{hasErrorBoundary:j(e)}}}else t=Ae;var U,_={},T=F(e.routes,t,void 0,_),I=e.basename||"/",B=D({v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),z=null,W=new Set,$=null,H=null,K=null,q=null!=e.hydrationData,J=N(T,e.history.location,I),Y=null;if(null==J){var V=qe(404,{pathname:e.history.location.pathname}),X=Ke(T);J=X.matches,Y=d({},X.route.id,V)}var G,Q,Z=!(J.some((function(e){return e.route.lazy}))||J.some((function(e){return e.route.loader}))&&null==e.hydrationData),ee={historyAction:e.history.action,location:e.history.location,matches:J,initialized:Z,navigation:xe,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||Y,fetchers:new Map,blockers:new Map},re=n.Pop,ne=!1,oe=!1,ae=!1,ie=[],ue=[],ce=new Map,se=0,le=-1,fe=new Map,de=new Set,he=new Map,pe=new Map,ve=new Map,me=!1;function ye(e,t){return be.apply(this,arguments)}function be(){return be=c((function(t,o){var a,i,u,c,s,l,f,d,h,p,v;return S(this,(function(b){switch(b.label){case 0:return"number"==typeof t?(e.history.go(t),[2]):(a=je(ee.location,ee.matches,I,B.v7_prependBasename,t,null==o?void 0:o.fromRouteId,null==o?void 0:o.relative),i=Le(B.v7_normalizeFormMethod,!1,a,o),u=i.path,c=i.submission,s=i.error,l=ee.location,f=D({},f=M(ee.location,u,o&&o.state),e.history.encodeLocation(f)),d=o&&null!=o.replace?o.replace:void 0,h=n.Push,!0===d?h=n.Replace:!1===d||null!=c&&Qe(c.formMethod)&&c.formAction===ee.location.pathname+ee.location.search&&(h=n.Replace),p=o&&"preventScrollReset"in o?!0===o.preventScrollReset:void 0,(v=y({currentLocation:l,nextLocation:f,historyAction:h}))?(m(v,{state:"blocked",location:f,proceed:function(){m(v,{state:"proceeding",proceed:void 0,reset:void 0,location:f}),ye(t,o)},reset:function(){var e=new Map(ee.blockers);e.set(v,Ce),r({blockers:e})}}),[2]):[4,ge(h,f,{submission:c,pendingError:s,preventScrollReset:p,replace:o&&o.replace})]);case 1:return[2,b.sent()]}}))})),be.apply(this,arguments)}function ge(e,t,r){return we.apply(this,arguments)}function we(){return we=c((function(t,r,n){var a,i,u,c,s,l,f,h,p,v,m,y,b,g,E;return S(this,(function(S){switch(S.label){case 0:return Q&&Q.abort(),Q=null,re=t,oe=!0===(n&&n.startUninterruptedRevalidation),R(ee.location,ee.matches),ne=!0===(n&&n.preventScrollReset),a=U||T,i=n&&n.overrideNavigation,(u=N(a,r,I))?!ee.initialized||ae||(x=ee.location,C=r,x.pathname!==C.pathname||x.search!==C.search||(""===x.hash||x.hash!==C.hash)&&""===C.hash)||n&&n.submission&&Qe(n.submission.formMethod)?(Q=new AbortController,h=Fe(e.history,r,Q.signal,n&&n.submission),n&&n.pendingError?(v=d({},He(u).route.id,n.pendingError),[3,3]):[3,1]):(o(r,{matches:u}),[2]):(c=qe(404,{pathname:r.pathname}),s=Ke(a),l=s.matches,f=s.route,w(),o(r,{matches:l,loaderData:{},errors:d({},f.id,c)}),[2]);case 1:return n&&n.submission&&Qe(n.submission.formMethod)?[4,Ee(h,r,n.submission,u,{replace:n.replace})]:[3,3];case 2:if((m=S.sent()).shortCircuited)return[2];p=m.pendingActionData,v=m.pendingActionError,i=it(r,n.submission),h=new Request(h.url,{signal:h.signal}),S.label=3;case 3:return[4,Pe(h,r,u,i,n&&n.submission,n&&n.fetcherSubmission,n&&n.replace,p,v)];case 4:return y=S.sent(),b=y.shortCircuited,g=y.loaderData,E=y.errors,b||(Q=null,o(r,D({matches:u},p?{actionData:p}:{},{loaderData:g,errors:E}))),[2]}var x,C}))})),we.apply(this,arguments)}function Ee(e,t,r,n,o){return Re.apply(this,arguments)}function Re(){return(Re=c((function(e,o,a,u,c){var s,l,f,h,p;return S(this,(function(v){switch(v.label){case 0:return void 0===c&&(c={}),i(),s=function(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}(o,a),r({navigation:s}),(f=ot(u,o)).route.action||f.route.lazy?[3,1]:(l={type:C.error,error:qe(405,{method:e.method,pathname:o.pathname,routeId:f.route.id})},[3,3]);case 1:return[4,Ie("action",e,f,u,_,t,I)];case 2:if(l=v.sent(),e.signal.aborted)return[2,{shortCircuited:!0}];v.label=3;case 3:return Ge(l)?(h=c&&null!=c.replace?c.replace:l.location===ee.location.pathname+ee.location.search,[4,Te(ee,l,{submission:a,replace:h})]):[3,5];case 4:return v.sent(),[2,{shortCircuited:!0}];case 5:if(Xe(l))return p=He(u,f.route.id),!0!==(c&&c.replace)&&(re=n.Push),[2,{pendingActionData:{},pendingActionError:d({},p.route.id,l.error)}];if(Ve(l))throw qe(400,{type:"defer-action"});return[2,{pendingActionData:d({},f.route.id,l.data)}]}}))}))).apply(this,arguments)}function Pe(e,t,r,n,o,a,i,u,c){return Ue.apply(this,arguments)}function Ue(){return Ue=c((function(t,n,a,i,u,c,s,f,d){var v,m,y,g,E,R,x,C,k,A,P,j,L,O,M,_,B,F,N,z,W;return S(this,(function(S){switch(S.label){case 0:return v=i||it(n,u),m=u||c||at(v),y=U||T,g=b(Oe(e.history,ee,a,m,n,ae,ie,ue,he,de,y,I,f,d),2),E=g[0],R=g[1],w((function(e){return!(a&&a.some((function(t){return t.route.id===e})))||E&&E.some((function(t){return t.route.id===e}))})),le=++se,0===E.length&&0===R.length?(x=h(),o(n,D({matches:a,loaderData:{},errors:d||null},f?{actionData:f}:{},x?{fetchers:new Map(ee.fetchers)}:{})),[2,{shortCircuited:!0}]):(oe||(R.forEach((function(e){var t=ee.fetchers.get(e.key),r=ut(void 0,t?t.data:void 0);ee.fetchers.set(e.key,r)})),C=f||ee.actionData,r(D({navigation:v},C?0===Object.keys(C).length?{actionData:null}:{actionData:C}:{},R.length>0?{fetchers:new Map(ee.fetchers)}:{}))),R.forEach((function(e){ce.has(e.key)&&l(e.key),e.controller&&ce.set(e.key,e.controller)})),k=function(){return R.forEach((function(e){return l(e.key)}))},Q&&Q.signal.addEventListener("abort",k),[4,Ne(ee.matches,a,E,R,t)]);case 1:return A=S.sent(),P=A.results,j=A.loaderResults,L=A.fetcherResults,t.signal.aborted?[2,{shortCircuited:!0}]:(Q&&Q.signal.removeEventListener("abort",k),R.forEach((function(e){return ce.delete(e.key)})),(O=Je(P))?(O.idx>=E.length&&(M=R[O.idx-E.length].key,de.add(M)),[4,Te(ee,O.result,{replace:s})]):[3,3]);case 2:return S.sent(),[2,{shortCircuited:!0}];case 3:return _=We(ee,a,E,j,d,R,L,pe),B=_.loaderData,F=_.errors,pe.forEach((function(e,t){e.subscribe((function(r){(r||e.done)&&pe.delete(t)}))})),N=h(),z=p(le),W=N||z||R.length>0,[2,D({loaderData:B,errors:F},W?{fetchers:new Map(ee.fetchers)}:{})]}}))})),Ue.apply(this,arguments)}function Me(){return Me=c((function(n,a,c,s,f,h){var v,m,y,g,w,E,R,x,C,k,A,P,j,O,M,B,F,z,W,$,H,K,q,J,Y,V,X,G,Z,te;return S(this,(function(S){switch(S.label){case 0:return i(),he.delete(n),s.route.action||s.route.lazy?(m=ee.fetchers.get(n),y=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," _hasFetcherDoneAnything ":!0}}(h,m),ee.fetchers.set(n,y),r({fetchers:new Map(ee.fetchers)}),g=new AbortController,w=Fe(e.history,c,g.signal,h),ce.set(n,g),E=se,[4,Ie("action",w,s,f,_,t,I)]):(v=qe(405,{method:h.formMethod,pathname:c,routeId:a}),u(n,a,v),[2]);case 1:if(R=S.sent(),w.signal.aborted)return ce.get(n)===g&&ce.delete(n),[2];if(Ge(R))return ce.delete(n),le>E?(x=ct(void 0),ee.fetchers.set(n,x),r({fetchers:new Map(ee.fetchers)}),[2]):(de.add(n),C=ut(h),ee.fetchers.set(n,C),r({fetchers:new Map(ee.fetchers)}),[2,Te(ee,R,{submission:h,isFetchActionRedirect:!0})]);if(Xe(R))return u(n,a,R.error),[2];if(Ve(R))throw qe(400,{type:"defer-action"});return k=ee.navigation.location||ee.location,A=Fe(e.history,k,g.signal),P=U||T,L(j="idle"!==ee.navigation.state?N(P,ee.navigation.location,I):ee.matches,"Didn't find any matches after fetcher action"),O=++se,fe.set(n,O),M=ut(h,R.data),ee.fetchers.set(n,M),B=b(Oe(e.history,ee,j,h,k,ae,ie,ue,he,de,P,I,d({},s.route.id,R.data),void 0),2),F=B[0],(z=B[1]).filter((function(e){return e.key!==n})).forEach((function(e){var t=e.key,r=ee.fetchers.get(t),n=ut(void 0,r?r.data:void 0);ee.fetchers.set(t,n),ce.has(t)&&l(t),e.controller&&ce.set(t,e.controller)})),r({fetchers:new Map(ee.fetchers)}),W=function(){return z.forEach((function(e){return l(e.key)}))},g.signal.addEventListener("abort",W),[4,Ne(ee.matches,j,F,z,A)];case 2:return $=S.sent(),H=$.results,K=$.loaderResults,q=$.fetcherResults,g.signal.aborted?[2]:(g.signal.removeEventListener("abort",W),fe.delete(n),ce.delete(n),z.forEach((function(e){return ce.delete(e.key)})),(J=Je(H))?(J.idx>=F.length&&(Y=z[J.idx-F.length].key,de.add(Y)),[2,Te(ee,J.result)]):(V=We(ee,ee.matches,F,K,void 0,z,q,pe),X=V.loaderData,G=V.errors,ee.fetchers.has(n)&&(Z=ct(R.data),ee.fetchers.set(n,Z)),te=p(O),"loading"===ee.navigation.state&&O>le?(L(re,"Expected pending action"),Q&&Q.abort(),o(ee.navigation.location,{matches:j,loaderData:X,errors:G,fetchers:new Map(ee.fetchers)})):(r(D({errors:G,loaderData:$e(ee.loaderData,X,j,G)},te||z.length>0?{fetchers:new Map(ee.fetchers)}:{})),ae=!1),[2]))}}))})),Me.apply(this,arguments)}function _e(){return(_e=c((function(n,o,a,i,u,c){var s,l,f,h,p,v,m,y,b;return S(this,(function(g){switch(g.label){case 0:return s=ee.fetchers.get(n),l=ut(c,s?s.data:void 0),ee.fetchers.set(n,l),r({fetchers:new Map(ee.fetchers)}),f=new AbortController,h=Fe(e.history,a,f.signal),ce.set(n,f),p=se,[4,Ie("loader",h,i,u,_,t,I)];case 1:return Ve(v=g.sent())?[4,tt(v,h.signal,!0)]:[3,3];case 2:v=g.sent()||v,g.label=3;case 3:return ce.get(n)===f&&ce.delete(n),h.signal.aborted?[2]:Ge(v)?le>p?(m=ct(void 0),ee.fetchers.set(n,m),r({fetchers:new Map(ee.fetchers)}),[2]):[3,4]:[3,6];case 4:return de.add(n),[4,Te(ee,v)];case 5:return g.sent(),[2];case 6:return Xe(v)?(y=He(ee.matches,o),ee.fetchers.delete(n),r({fetchers:new Map(ee.fetchers),errors:d({},y.route.id,v.error)}),[2]):(L(!Ve(v),"Unhandled fetcher deferred data"),b=ct(v.data),ee.fetchers.set(n,b),r({fetchers:new Map(ee.fetchers)}),[2])}}))}))).apply(this,arguments)}function Te(e,t,r){return Be.apply(this,arguments)}function Be(){return Be=c((function(t,r,o){var a,i,u,c,s,l,f,d,h,p;return S(this,(function(v){switch(v.label){case 0:return i=(a=void 0===o?{}:o).submission,u=a.replace,c=a.isFetchActionRedirect,r.revalidate&&(ae=!0),L(s=M(t.location,r.location,D({_isRedirect:!0},c?{_isFetchActionRedirect:!0}:{})),"Expected a location on the redirect navigation"),A&&(l=!1,r.reloadDocument?l=!0:ke.test(r.location)&&(f=e.history.createURL(r.location),l=f.origin!==k.location.origin||null==te(f.pathname,I)),l)?(u?k.location.replace(r.location):k.location.assign(r.location),[2]):(Q=null,d=!0===u?n.Replace:n.Push,h=i||at(t.navigation),Se.has(r.status)&&h&&Qe(h.formMethod)?[4,ge(d,s,{submission:D({},h,{formAction:r.location}),preventScrollReset:ne})]:[3,2]);case 1:return v.sent(),[3,6];case 2:return c?[4,ge(d,s,{overrideNavigation:it(s),fetcherSubmission:h,preventScrollReset:ne})]:[3,4];case 3:return v.sent(),[3,6];case 4:return p=it(s,h),[4,ge(d,s,{overrideNavigation:p,preventScrollReset:ne})];case 5:v.sent(),v.label=6;case 6:return[2]}}))})),Be.apply(this,arguments)}function Ne(e,t,r,n,o){return ze.apply(this,arguments)}function ze(){return(ze=c((function(r,n,o,a,i){var u,c,s;return S(this,(function(l){switch(l.label){case 0:return[4,Promise.all(g(o.map((function(e){return Ie("loader",i,e,n,_,t,I)}))).concat(g(a.map((function(r){return r.matches&&r.match&&r.controller?Ie("loader",Fe(e.history,r.path,r.controller.signal),r.match,r.matches,_,t,I):{type:C.error,error:qe(404,{pathname:r.path})}})))))];case 1:return u=l.sent(),c=u.slice(0,o.length),s=u.slice(o.length),[4,Promise.all([Ze(r,o,c,c.map((function(){return i.signal})),!1,ee.loaderData),Ze(r,a.map((function(e){return e.match})),s,a.map((function(e){return e.controller?e.controller.signal:null})),!0)])];case 2:return l.sent(),[2,{results:u,loaderResults:c,fetcherResults:s}]}}))}))).apply(this,arguments)}return G={get basename(){return I},get state(){return ee},get routes(){return T},initialize:function(){return z=e.history.listen((function(t){var n=t.action,o=t.location,a=t.delta;if(!me){O(0===ve.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 i=y({currentLocation:ee.location,nextLocation:o,historyAction:n});return i&&null!=a?(me=!0,e.history.go(-1*a),void m(i,{state:"blocked",location:o,proceed:function(){m(i,{state:"proceeding",proceed:void 0,reset:void 0,location:o}),e.history.go(a)},reset:function(){var e=new Map(ee.blockers);e.set(i,Ce),r({blockers:e})}})):ge(n,o)}me=!1})),ee.initialized||ge(n.Pop,ee.location),G},subscribe:function(e){return W.add(e),function(){return W.delete(e)}},enableScrollRestoration:function(e,t,n){if($=e,K=t,H=n||null,!q&&ee.navigation===xe){q=!0;var o=x(ee.location,ee.matches);null!=o&&r({restoreScrollPosition:o})}return function(){$=null,K=null,H=null}},navigate:ye,fetch:function(e,t,r,n){if(P)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.");ce.has(e)&&l(e);var o=U||T,a=je(ee.location,ee.matches,I,B.v7_prependBasename,r,t,null==n?void 0:n.relative),i=N(o,a,I);if(i){var c=Le(B.v7_normalizeFormMethod,!0,a,n),s=c.path,f=c.submission,d=c.error;if(d)u(e,t,d);else{var h=ot(i,s);ne=!0===(n&&n.preventScrollReset),f&&Qe(f.formMethod)?function(e,t,r,n,o,a){Me.apply(this,arguments)}(e,t,s,h,i,f):(he.set(e,{routeId:t,path:s}),function(e,t,r,n,o,a){_e.apply(this,arguments)}(e,t,s,h,i,f))}}else u(e,t,qe(404,{pathname:a}))},revalidate:function(){i(),r({revalidation:"loading"}),"submitting"!==ee.navigation.state&&("idle"!==ee.navigation.state?ge(re||ee.historyAction,ee.navigation.location,{overrideNavigation:ee.navigation}):ge(ee.historyAction,ee.location,{startUninterruptedRevalidation:!0}))},createHref:function(t){return e.history.createHref(t)},encodeLocation:function(t){return e.history.encodeLocation(t)},getFetcher:a,deleteFetcher:s,dispose:function(){z&&z(),W.clear(),Q&&Q.abort(),ee.fetchers.forEach((function(e,t){return s(t)})),ee.blockers.forEach((function(e,t){return v(t)}))},getBlocker:function(e,t){var r=ee.blockers.get(e)||Ce;return ve.get(e)!==t&&ve.set(e,t),r},deleteBlocker:v,_internalFetchControllers:ce,_internalActiveDeferreds:pe,_internalSetRoutes:function(e){U=F(e,t,void 0,_={})}},G}function je(e,t,r,n,o,a,i){var u,c;if(null!=a&&"path"!==i){u=[];var s=!0,l=!1,f=void 0;try{for(var d,h=t[Symbol.iterator]();!(s=(d=h.next()).done);s=!0){var p=d.value;if(u.push(p),p.route.id===a){c=p;break}}}catch(e){l=!0,f=e}finally{try{s||null==h.return||h.return()}finally{if(l)throw f}}}else u=t,c=t[t.length-1];var v=ae(o||".",oe(u).map((function(e){return e.pathnameBase})),te(e.pathname,r)||e.pathname,"path"===i);return null==o&&(v.search=e.search,v.hash=e.hash),null!=o&&""!==o&&"."!==o||!c||!c.route.index||nt(v.search)||(v.search=v.search?v.search.replace(/^\?/,"?index&"):"?index"),n&&"/"!==r&&(v.pathname="/"===v.pathname?r:ie([r,v.pathname])),_(v)}function Le(e,t,r,n){if(!n||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(n))return{path:r};if(n.formMethod&&(o=n.formMethod,!Ee.has(o.toLowerCase())))return{path:r,error:qe(405,{method:n.formMethod})};var o,a,i,u=function(){return{path:r,error:qe(400,{type:"invalid-body"})}},c=n.formMethod||"get",s=e?c.toUpperCase():c.toLowerCase(),l=Ye(r);if(void 0!==n.body){if("text/plain"===n.formEncType){if(!Qe(s))return u();var f="string"==typeof n.body?n.body:p(n.body,FormData)||p(n.body,URLSearchParams)?Array.from(n.body.entries()).reduce((function(e,t){var r=b(t,2);return""+e+r[0]+"="+r[1]+"\n"}),""):String(n.body);return{path:r,submission:{formMethod:s,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:f}}}if("application/json"===n.formEncType){if(!Qe(s))return u();try{var d="string"==typeof n.body?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:s,formAction:l,formEncType:n.formEncType,formData:void 0,json:d,text:void 0}}}catch(e){return u()}}}if(L("function"==typeof FormData,"FormData is not available in this environment"),n.formData)a=Ne(n.formData),i=n.formData;else if(p(n.body,FormData))a=Ne(n.body),i=n.body;else if(p(n.body,URLSearchParams))i=ze(a=n.body);else if(null==n.body)a=new URLSearchParams,i=new FormData;else try{i=ze(a=new URLSearchParams(n.body))}catch(e){return u()}var h={formMethod:s,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(Qe(h.formMethod))return{path:r,submission:h};var v=T(r);return t&&v.search&&nt(v.search)&&a.append("index",""),v.search="?"+a,{path:_(v),submission:h}}function Oe(e,t,r,n,o,a,i,u,c,s,l,f,d,h){var p=h?Object.values(h)[0]:d?Object.values(d)[0]:void 0,v=e.createURL(t.location),m=e.createURL(o),y=h?Object.keys(h)[0]:void 0,b=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,y).filter((function(e,r){if(e.route.lazy)return!0;if(null==e.route.loader)return!1;if(function(e,t,r){var n=!t||r.route.id!==t.route.id,o=void 0===e[r.route.id];return n||o}(t.loaderData,t.matches[r],e)||i.some((function(t){return t===e.route.id})))return!0;var o=t.matches[r],u=e;return Me(e,D({currentUrl:v,currentParams:o.params,nextUrl:m,nextParams:u.params},n,{actionResult:p,defaultShouldRevalidate:a||v.pathname+v.search===m.pathname+m.search||v.search!==m.search||Ue(o,u)}))})),g=[];return c.forEach((function(e,o){if(r.some((function(t){return t.route.id===e.routeId}))){var i=N(l,e.path,f);if(i){var c=t.fetchers.get(o),d=ot(i,e.path);!s.has(o)&&(u.includes(o)||(c&&"idle"!==c.state&&void 0===c.data?a:Me(d,D({currentUrl:v,currentParams:t.matches[t.matches.length-1].params,nextUrl:m,nextParams:r[r.length-1].params},n,{actionResult:p,defaultShouldRevalidate:a}))))&&g.push({key:o,routeId:e.routeId,path:e.path,matches:i,match:d,controller:new AbortController})}else g.push({key:o,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null})}})),[b,g]}function Ue(e,t){var r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function Me(e,t){if(e.route.shouldRevalidate){var r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}function _e(e,t,r){return Te.apply(this,arguments)}function Te(){return Te=c((function(e,t,r){var n,o,a,i,u;return S(this,(function(c){switch(c.label){case 0:return e.lazy?[4,e.lazy()]:[2];case 1:if(n=c.sent(),!e.lazy)return[2];for(var s in L(o=r[e.id],"No route found in manifest"),a={},n)i=o[s],O(!(u=void 0!==i&&"hasErrorBoundary"!==s),'Route "'+o.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. The lazy route property "'+s+'" will be ignored.'),u||B.has(s)||(a[s]=n[s]);return Object.assign(o,a),Object.assign(o,D({},t(o),{lazy:void 0})),[2]}}))})),Te.apply(this,arguments)}function Ie(e,t,r,n,o,a,i,u){return Be.apply(this,arguments)}function Be(){return Be=c((function(e,t,r,n,o,a,i,u){var c,s,l,f,d,h,p,v,m,y,b,g,w,E,R,x,D,k,A;return S(this,(function(S){switch(S.label){case 0:void 0===u&&(u={}),f=function(e){var n,o=new Promise((function(e,t){return n=t}));return l=function(){return n()},t.signal.addEventListener("abort",l),Promise.race([e({request:t,params:r.params,context:u.requestContext}),o])},S.label=1;case 1:return S.trys.push([1,12,13,14]),d=r.route[e],r.route.lazy?d?[4,Promise.all([f(d),_e(r.route,a,o)])]:[3,3]:[3,8];case 2:return h=S.sent(),s=h[0],[3,7];case 3:return[4,_e(r.route,a,o)];case 4:return S.sent(),(d=r.route[e])?[4,f(d)]:[3,6];case 5:return s=S.sent(),[3,7];case 6:if("action"===e)throw p=new URL(t.url),v=p.pathname+p.search,qe(405,{method:t.method,pathname:v,routeId:r.route.id});return[2,{type:C.data,data:void 0}];case 7:return[3,11];case 8:if(d)return[3,9];throw qe(404,{pathname:(m=new URL(t.url)).pathname+m.search});case 9:return[4,f(d)];case 10:s=S.sent(),S.label=11;case 11:return L(void 0!==s,"You defined "+("action"===e?"an action":"a loader")+' for route "'+r.route.id+"\" but didn't return anything from your `"+e+"` function. Please return a value or `null`."),[3,14];case 12:return y=S.sent(),c=C.error,s=y,[3,14];case 13:return l&&t.signal.removeEventListener("abort",l),[7];case 14:if(null==(P=s)||"number"!=typeof P.status||"string"!=typeof P.statusText||"object"!=typeof P.headers||void 0===P.body)return[3,19];if(b=s.status,Re.has(b)){if(L(g=s.headers.get("Location"),"Redirects returned/thrown from loaders/actions must have a Location header"),ke.test(g)?u.isStaticRequest||(w=new URL(t.url),E=g.startsWith("//")?new URL(w.protocol+g):new URL(g),R=null!=te(E.pathname,i),E.origin===w.origin&&R&&(g=E.pathname+E.search+E.hash)):g=je(new URL(t.url),n.slice(0,n.indexOf(r)+1),i,!0,g),u.isStaticRequest)throw s.headers.set("Location",g),s;return[2,{type:C.redirect,status:b,location:g,revalidate:null!==s.headers.get("X-Remix-Revalidate"),reloadDocument:null!==s.headers.get("X-Remix-Reload-Document")}]}if(u.isRouteRequest)throw{type:c===C.error?C.error:C.data,response:s};return(D=s.headers.get("Content-Type"))&&/\bapplication\/json\b/.test(D)?[4,s.json()]:[3,16];case 15:return x=S.sent(),[3,18];case 16:return[4,s.text()];case 17:x=S.sent(),S.label=18;case 18:return c===C.error?[2,{type:c,error:new me(b,s.statusText,x),headers:s.headers}]:[2,{type:C.data,data:x,statusCode:s.status,headers:s.headers}];case 19:return c===C.error?[2,{type:c,error:s}]:(j=s)&&"object"==typeof j&&"object"==typeof j.data&&"function"==typeof j.subscribe&&"function"==typeof j.cancel&&"function"==typeof j.resolveData?[2,{type:C.deferred,deferredData:s,statusCode:null==(k=s.init)?void 0:k.status,headers:(null==(A=s.init)?void 0:A.headers)&&new Headers(s.init.headers)}]:[2,{type:C.data,data:s}]}var P,j}))})),Be.apply(this,arguments)}function Fe(e,t,r,n){var o=e.createURL(Ye(t)).toString(),a={signal:r};if(n&