@ampath/esm-patient-registration-app 6.0.1-pre.235 → 6.0.1-pre.239

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/831.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see 831.js.LICENSE.txt */
2
- (globalThis.webpackChunk_ampath_esm_patient_registration_app=globalThis.webpackChunk_ampath_esm_patient_registration_app||[]).push([[831],{6747:(t,e,n)=>{function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}function a(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}System.register(["@openmrs/esm-config","@openmrs/esm-navigation","@openmrs/esm-error-handling","@openmrs/esm-offline"],(function(t,e){var u={},s={},c={},l={};return{setters:[function(t){u.Type=t.Type,u.defineConfigSchema=t.defineConfigSchema,u.getConfig=t.getConfig,u.validators=t.validators},function(t){s.navigate=t.navigate},function(t){c.reportError=t.reportError},function(t){l.getSynchronizationItems=t.getSynchronizationItems}],execute:function(){t(function(){var t={385:function(){System.register([],(function(t,e){return{execute:function(){t(function(){"use strict";var t=function(t,e){var n=c[t];if(n)return n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value.setState(e,!0),n.active=!0,n.value;var r=s()((function(){return e}));return c[t]={value:r,active:!0},r},e=function(t,e){var n=c[t];return n?(n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value=e,n.active=!0,n.value):(c[t]={value:e,active:!0},e)},n=function(t,e){var n=c[t];if(!n){var r=s()((function(){return null!=e?e:{}}));return c[t]={value:r,active:!1},r}return n.value},r=function(t,e,n){var r=e(t.getState());return t.subscribe((function(t){var o=e(t);o!==r&&(r=o,n(o))}))},o={d:function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},i={};o.r(i),o.d(i,{createGlobalStore:function(){return t},getGlobalStore:function(){return n},registerGlobalStore:function(){return e},subscribeTo:function(){return r}});var u=function(t){var e,n=new Set,r=function(t,r){var o="function"==typeof t?t(e):t;if(!Object.is(o,e)){var i=e;e=(null!=r?r:"object"!=(void 0===o?"undefined":a(o)))?o:Object.assign({},e,o),n.forEach((function(t){return t(e,i)}))}},o=function(){return e},i={setState:r,getState:o,subscribe:function(t){return n.add(t),function(){return n.delete(t)}},destroy:function(){console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return e=t(r,o,i),i},s=function(t){return t?u(t):u},c={};return setTimeout((function(){"development"===window.spaEnv&&(window.stores=c)}),1e3),i}())}}}))},824:function(t){"use strict";t.exports=u},254:function(t){"use strict";t.exports=c},513:function(t){"use strict";t.exports=s},738:function(t){"use strict";t.exports=l}},e={};function f(n){var r=e[n];if(void 0!==r)return r.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,f),o.exports}f.d=function(t,e){for(var n in e)f.o(e,n)&&!f.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},f.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},f.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var h={};return function(){"use strict";var t=function(t,e){function n(){this.constructor=t}se(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=function(t){return"function"==typeof t},u=function(t){setTimeout((function(){throw t}),0)},s=function(t){return null!==t&&"object"==(void 0===t?"undefined":a(t))},c=function(t){return t.reduce((function(t,e){return t.concat(i(e,de)?e.errors:e)}),[])},l=function(t){return t},p=function(t){if(t||(t=le.Promise||Promise),!t)throw new Error("no Promise impl found");return t},d=function(t,e,n){var r=g(t,e,n);Ge.length?Ge.forEach((function(t){return t(r)})):setTimeout((function(){throw r}))},v=function(t){if("function"!=typeof t)throw Error(m(28,!1));Ge.push(t)},y=function(t){if("function"!=typeof t)throw Error(m(29,!1));var e=!1;return Ge=Ge.filter((function(n){var r=n===t;return e=e||r,!r})),e},m=function(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return"single-spa minified message #".concat(t,": ").concat(e?e+" ":"","See https://single-spa.js.org/error/?code=").concat(t).concat(r.length?"&arg=".concat(r.join("&arg=")):"")},g=function(t,e,n){var r,o="".concat(E(e)," '").concat(S(e),"' died in status ").concat(e.status,": ");if(i(t,Error)){try{t.message=o+t.message}catch(t){}r=t}else{console.warn(m(30,!1,e.status,S(e)));try{r=Error(o+JSON.stringify(t))}catch(e){r=t}}return r.appOrParcelName=S(e),e.status=n,r},b=function(t){return t.status===Qe},w=function(t){try{return t.activeWhen(window.location)}catch(e){return d(e,t,nn),!1}},S=function(t){return t.name},O=function(t){return Boolean(t.unmountThisParcel)},E=function(t){return O(t)?"parcel":"application"},x=function(){for(var t=arguments.length-1;t>0;t--)for(var e in arguments[t])"__proto__"!==e&&(arguments[t-1][e]=arguments[t][e]);return arguments[0]},j=function(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return t[n];return null},P=function(t){return t&&("function"==typeof t||(e=t,Array.isArray(e)&&!j(e,(function(t){return"function"!=typeof t}))));var e},_=function(t,e){var n=t[e]||[];0===(n=Array.isArray(n)?n:[n]).length&&(n=[function(){return Promise.resolve()}]);var r=E(t),o=S(t);return function(t){return n.reduce((function(n,i,a){return n.then((function(){var n=i(t);return A(n)?n:Promise.reject(m(15,!1,r,o,e,a))}))}),Promise.resolve())}},A=function(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch},k=function(t,e){return Promise.resolve().then((function(){return t.status!==$e?t:(t.status=qe,t.bootstrap?F(t,"bootstrap").then(n).catch((function(n){if(e)throw g(n,t,nn);return d(n,t,nn),t})):Promise.resolve().then(n))}));function n(){return t.status=Je,t}},T=function(t,e){return Promise.resolve().then((function(){var n=function(){return F(t,"unmount").then((function(){t.status=Je}),(function(n){if(e)throw g(n,t,nn);d(n,t,nn)}))};if(t.status!==Qe)return t;t.status=Ze;var r=Object.keys(t.parcels).map((function(e){return t.parcels[e].unmountThisParcel()}));return Promise.all(r).then(n,(function(r){return n().then((function(){var n=Error(r.message);if(e)throw g(n,t,nn);d(n,t,nn)}))})).then((function(){return t}))}))},C=function(t,e){return Promise.resolve().then((function(){return t.status!==Je?t:(on||(window.dispatchEvent(new He("single-spa:before-first-mount")),on=!0),t.status=Ye,F(t,"mount").then((function(){return t.status=Qe,an||(window.dispatchEvent(new He("single-spa:first-mount")),an=!0),t})).catch((function(n){var r=function(){if(e)throw g(n,t,nn);return d(n,t,nn),t};return t.status=Qe,T(t,!0).then(r,r)})))}))},I=function(){return M.apply(sn,arguments)},M=function(t,e){var n=this;if(!t||"object"!=(void 0===t?"undefined":a(t))&&"function"!=typeof t)throw Error(m(2,!1));if(t.name&&"string"!=typeof t.name)throw Error(m(3,!1,a(t.name)));var r=un++,o=t.name||"parcel-".concat(r);if("object"!=(void 0===e?"undefined":a(e)))throw Error(m(4,!1,o,void 0===e?"undefined":a(e)));if(!e.domElement)throw Error(m(5,!1,o));var i,u="function"==typeof t,s=u?t:function(){return Promise.resolve(t)},c={id:r,parcels:{},status:u?Ke:$e,customProps:e,parentName:S(n),unmountThisParcel:function(){return d.then((function(){if(c.status!==Qe)throw Error(m(6,!1,o,c.status));return T(c,!0)})).then((function(t){return c.parentName&&delete n.parcels[c.id],t})).then((function(t){return f(t),t})).catch((function(t){throw c.status=nn,h(t),t}))}};n.parcels[r]=c;var l=s();if(!l||"function"!=typeof l.then)throw Error(m(7,!1));l=l.then((function(t){if(!t)throw Error(m(8,!1));if(o=t.name||"parcel-".concat(r),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!P(t.bootstrap))throw Error(m(9,!1,o));if(!P(t.mount))throw Error(m(10,!1,o));if(!P(t.unmount))throw Error(m(11,!1,o));if(t.update&&!P(t.update))throw Error(m(12,!1,o));var e=_(t,"bootstrap"),n=_(t,"mount"),a=_(t,"unmount");c.status=$e,c.name=o,c.bootstrap=e,c.mount=n,c.unmount=a,c.timeouts=z(t.timeouts),t.update&&(c.update=_(t,"update"),i.update=function(t){return c.customProps=t,D((e=c,Promise.resolve().then((function(){if(e.status!==Qe)throw Error(m(32,!1,S(e)));return e.status=Xe,F(e,"update").then((function(){return e.status=Qe,e})).catch((function(t){throw g(t,e,nn)}))}))));var e})}));var f,h,p=l.then((function(){return k(c,!0)})),d=p.then((function(){return C(c,!0)})),v=new Promise((function(t,e){f=t,h=e}));return i={mount:function(){return D(Promise.resolve().then((function(){if(c.status!==Je)throw Error(m(13,!1,o,c.status));return n.parcels[r]=c,C(c)})))},unmount:function(){return D(c.unmountThisParcel())},getStatus:function(){return c.status},loadPromise:D(l),bootstrapPromise:D(p),mountPromise:D(d),unmountPromise:D(v)}},D=function(t){return t.then((function(){return null}))},R=function(t){var e=S(t),n="function"==typeof t.customProps?t.customProps(e,window.location):t.customProps;("object"!=(void 0===n?"undefined":a(n))||null===n||Array.isArray(n))&&(n={},console.warn(m(40,!1),e,n));var r=x({},n,{name:e,mountParcel:M.bind(t),singleSpa:ze});return O(t)&&(r.unmountSelf=t.unmountThisParcel),r},N=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(m(16,!1));cn.bootstrap={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},L=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(m(17,!1));cn.mount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},U=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(m(18,!1));cn.unmount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},B=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(m(19,!1));cn.unload={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},F=function(t,e){var n=t.timeouts[e],r=n.warningMillis,o=E(t);return new Promise((function(i,a){var u=!1,s=!1;t[e](R(t)).then((function(t){u=!0,i(t)})).catch((function(t){u=!0,a(t)})),setTimeout((function(){return l(1)}),r),setTimeout((function(){return l(!0)}),n.millis);var c=m(31,!1,e,o,S(t),n.millis);function l(t){if(!u)if(!0===t)s=!0,n.dieOnTimeout?a(Error(c)):console.error(c);else if(!s){var e=t,o=e*r;console.warn(c),o+r<n.millis&&setTimeout((function(){return l(e+1)}),r)}}}))},z=function(t){var e={};for(var n in cn)e[n]=x({},cn[n],t&&t[n]||{});return e},V=function(t){return Promise.resolve().then((function(){return t.loadPromise?t.loadPromise:t.status!==We&&t.status!==en?t:(t.status=Ke,t.loadPromise=Promise.resolve().then((function(){var r=t.loadApp(R(t));if(!A(r))throw n=!0,Error(m(33,!1,S(t)));return r.then((function(n){var r;t.loadErrorTime=null,"object"!=(void 0===(e=n)?"undefined":a(e))&&(r=34),Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!P(e.bootstrap)&&(r=35),P(e.mount)||(r=36),P(e.unmount)||(r=37);var o=E(e);if(r){var i;try{i=JSON.stringify(e)}catch(t){}return console.error(m(r,!1,o,S(t),i),e),d(void 0,t,nn),t}return e.devtools&&e.devtools.overlays&&(t.devtools.overlays=x({},t.devtools.overlays,e.devtools.overlays)),t.status=$e,t.bootstrap=_(e,"bootstrap"),t.mount=_(e,"mount"),t.unmount=_(e,"unmount"),t.unload=_(e,"unload"),t.timeouts=z(e.timeouts),delete t.loadPromise,t}))})).catch((function(e){var r;return delete t.loadPromise,n?r=nn:(r=en,t.loadErrorTime=(new Date).getTime()),d(e,t,r),t})));var e,n}))},H=function(t){var e;if("string"==typeof t)e=t;else if(this&&this.href)e=this.href;else{if(!(t&&t.currentTarget&&t.currentTarget.href&&t.preventDefault))throw Error(m(14,!1));e=t.currentTarget.href,t.preventDefault()}var n=q(window.location.href),r=q(e);0===e.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=e:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,e)},G=function(t){var e=this;if(t){var n=t[0].type;hn.indexOf(n)>=0&&fn[n].forEach((function(n){try{n.apply(e,t)}catch(t){setTimeout((function(){throw t}))}}))}},W=function(){On([],arguments)},K=function(t,e){return function(){var n=window.location.href,r=t.apply(this,arguments),o=window.location.href;return Fe&&n===o||window.dispatchEvent(function(t,e){var n;try{n=new PopStateEvent("popstate",{state:t})}catch(e){(n=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,t)}return n.singleSpa=!0,n.singleSpaTrigger=e,n}(window.history.state,e)),r}},$=function(t){if(dn)throw Error(m(43,!1));Fe=!t||!t.hasOwnProperty("urlRerouteOnly")||t.urlRerouteOnly,dn=!0,pn=window.history.replaceState,window.addEventListener("hashchange",W),window.addEventListener("popstate",W);var e=window.addEventListener,n=window.removeEventListener;window.addEventListener=function(t,n){if(!("function"==typeof n&&hn.indexOf(t)>=0)||j(fn[t],(function(t){return t===n})))return e.apply(this,arguments);fn[t].push(n)},window.removeEventListener=function(t,e){if(!("function"==typeof e&&hn.indexOf(t)>=0))return n.apply(this,arguments);fn[t]=fn[t].filter((function(t){return t!==e}))},window.history.pushState=K(window.history.pushState,"pushState"),window.history.replaceState=K(pn,"replaceState")},q=function(t){var e=document.createElement("a");return e.href=t,e},J=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!vn){var e=t.fn.on,n=t.fn.off;t.fn.on=function(t,n){return Y.call(this,e,window.addEventListener,t,n,arguments)},t.fn.off=function(t,e){return Y.call(this,n,window.removeEventListener,t,e,arguments)},vn=!0}},Y=function(t,e,n,r,o){return"string"!=typeof n?t.apply(this,o):(n.split(/\s+/).forEach((function(t){hn.indexOf(t)>=0&&(e(t,r),n=n.replace(t,""))})),""===n.trim()?this:t.apply(this,o))},Q=function(t){return Promise.resolve().then((function(){var e=yn[S(t)];if(!e)return t;if(t.status===We)return X(t,e),t;if(t.status===tn)return e.promise.then((function(){return t}));if(t.status!==Je&&t.status!==en)return t;var n=t.status===en?Promise.resolve():F(t,"unload");return t.status=tn,n.then((function(){return X(t,e),t})).catch((function(n){return function(t,e,n){delete yn[S(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,d(n,t,nn),e.reject(n)}(t,e,n),t}))}))},X=function(t,e){delete yn[S(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=We,e.resolve()},Z=function(t,e,n,r){yn[S(t)]={app:t,resolve:n,reject:r},Object.defineProperty(yn[S(t)],"promise",{get:e})},tt=function(t){return yn[t]},et=function(){return mn.filter(b).map(S)},nt=function(){return mn.map(S)},rt=function(t){var e=j(mn,(function(e){return S(e)===t}));return e?e.status:null},ot=function(t,e,n,r){var o=function(t,e,n,r){var o,i={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"==(void 0===t?"undefined":a(t))?(function(t){if(Array.isArray(t)||null===t)throw Error(m(39,!1));var e=["name","app","activeWhen","customProps"],n=Object.keys(t).reduce((function(t,n){return e.indexOf(n)>=0?t:t.concat(n)}),[]);if(0!==n.length)throw Error(m(38,!1,e.join(", "),n.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(m(20,!1));if("object"!=a(t.app)&&"function"!=typeof t.app)throw Error(m(20,!1));var r=function(t){return"string"==typeof t||"function"==typeof t};if(!(r(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(r)))throw Error(m(24,!1));if(!ct(t.customProps))throw Error(m(22,!1))}(t),i.name=t.name,i.loadApp=t.app,i.activeWhen=t.activeWhen,i.customProps=t.customProps):(function(t,e,n,r){if("string"!=typeof t||0===t.length)throw Error(m(20,!1));if(!e)throw Error(m(23,!1));if("function"!=typeof n)throw Error(m(24,!1));if(!ct(r))throw Error(m(22,!1))}(t,e,n,r),i.name=t,i.loadApp=e,i.activeWhen=n,i.customProps=r),i.loadApp="function"!=typeof(o=i.loadApp)?function(){return Promise.resolve(o)}:o,i.customProps=function(t){return t||{}}(i.customProps),i.activeWhen=function(t){var e=Array.isArray(t)?t:[t];return e=e.map((function(t){return"function"==typeof t?t:lt(t)})),function(t){return e.some((function(e){return e(t)}))}}(i.activeWhen),i}(t,e,n,r);if(dt()||gn||(gn=!0,setTimeout((function(){dt()||console.warn(m(1,!1))}),5e3)),-1!==nt().indexOf(o.name))throw Error(m(21,!1,o.name));mn.push(x({loadErrorTime:null,status:We,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},o)),ln&&(J(),On())},it=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return mn.filter((function(e){return e.activeWhen(t)})).map(S)},at=function(t){if(0===mn.filter((function(e){return S(e)===t})).length)throw Error(m(25,!1,t));return(ln?ut(t,{waitForUnmount:!1}):Promise.resolve()).then((function(){var e=mn.map(S).indexOf(t);mn.splice(e,1)}))},ut=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof t)throw Error(m(26,!1));var n=j(mn,(function(e){return S(e)===t}));if(!n)throw Error(m(27,!1,t));var r,o=tt(S(n));if(e&&e.waitForUnmount){if(o)return o.promise;var i=new Promise((function(t,e){Z(n,(function(){return i}),t,e)}));return i}return o?(r=o.promise,st(n,o.resolve,o.reject)):r=new Promise((function(t,e){Z(n,(function(){return r}),t,e),st(n,t,e)})),r},st=function(t,e,n){Promise.resolve().then((function(){if(j(it(),(function(e){return e===S(t)})))return ft()})).then((function(){return T(t).then(Q).then((function(){e(),setTimeout((function(){On()}))}))})).catch(n)},ct=function(t){return!t||"function"==typeof t||"object"==(void 0===t?"undefined":a(t))&&null!==t&&!Array.isArray(t)},lt=function(t,e){var n=function(t,e){var n=0,r=!1,o="^";"/"!==t[0]&&(t="/"+t);for(var i=0;i<t.length;i++){var a=t[i];(!r&&":"===a||r&&"/"===a)&&u(i)}return u(t.length),new RegExp(o,"i");function u(i){var a=t.slice(n,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":a,i===t.length)if(r)e&&(o+="$");else{var u=e?"":".*";o="/"===o.charAt(o.length-1)?"".concat(o).concat(u,"$"):"".concat(o,"(/").concat(u,")?(#.*)?$")}r=!r,n=i}}(t,e);return function(t){var e=t.origin;e||(e="".concat(t.protocol,"//").concat(t.host));var r=t.href.replace(e,"").replace(t.search,"").split("?")[0];return n.test(r)}},ft=function(){return On()},ht=function(t,e){return w(t)?k(t).then((function(t){return e.then((function(){return w(t)?C(t):t}))})):e.then((function(){return t}))},pt=function(t){En=!0,ln&&($(t),On())},dt=function(){return En},vt=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},yt=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},mt=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},gt=function(){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(t){return!1}},bt=function(t){return t&&t.startsWith("http")?t:("/"!==t[0]&&(t="/"+t),window.openmrsBase+t)},wt=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof t)throw Error("The first argument to @openmrs/api's openmrsFetch function must be a url string");if("object"!=(void 0===e?"undefined":a(e)))throw Error("The second argument to @openmrs/api's openmrsFetch function must be a plain object.");if(!window.openmrsBase)throw Error("@openmrs/api is running in a browser that doesn't have window.openmrsBase, which is provided by openmrs-module-spa's HTML file.");var n=bt(t);if(e.headers||(e.headers={}),Ne(e.body)&&(e.body=JSON.stringify(e.body)),void 0===e.headers.Accept&&(e.headers.Accept="application/json"),null===e.headers.Accept&&delete e.headers.Accept,t.startsWith(Tn)&&void 0===e.headers["Disable-WWW-Authenticate"]&&(e.headers["Disable-WWW-Authenticate"]="true"),t.startsWith(Cn)){var r=new URL(n,window.location.toString());r.searchParams.has("_summary")||(r.searchParams.set("_summary","data"),n=r.toString())}var o,i,u=Error();return window.fetch(n,e).then((o=function(t){var e,r;return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(o){switch(o.label){case 0:return(e=t).ok?204===e.status?(e.data=null,[2,e]):[2,e.clone().text().then((function(t){try{t&&(e.data=JSON.parse(t))}catch(t){}return e}))]:[3,1];case 1:return[4,(0,Le.getConfig)("@openmrs/esm-api")];case 2:return r=o.sent().redirectAuthFailure,n===bt(In)&&403===e.status||r.enabled&&r.errors.includes(e.status)?(sessionStorage.removeItem(jn),(0,Ue.navigate)({to:r.url}),[2,r.resolvePromise?Promise.resolve():new Promise((function(){}))]):[2,e.clone().text().then((function(t){var r=t;try{r=JSON.parse(t)}catch(t){}throw new Mn(n,e,r,u)}),(function(t){throw new Mn(n,e,null,u)}))];case 3:return[2]}}))},i=function(){var t=this,e=arguments;return new Promise((function(n,r){var i=o.apply(t,e);function a(t){yt(i,n,r,a,u,"next",t)}function u(t){yt(i,n,r,a,u,"throw",t)}a(void 0)}))},function(t){return i.apply(this,arguments)}))},St=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"!=(void 0===e?"undefined":a(e)))throw Error("The second argument to openmrsObservableFetch must be either omitted or an object");var n=new AbortController;return e.signal=n.signal,new we((function(r){var o=!1;return wt(t,e).then((function(t){o=!0,r.next(t),r.complete()}),(function(t){o=!0,r.error(t)})),function(){o||n.abort()}}))},Ot=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},Et=function(t,e){return wt("".concat(Dn,"/").concat(t),{signal:e.signal})},xt=function(t,e,n){return wt("".concat(Dn,"?patient=").concat(t,"&includeEncounterless=").concat(e),{signal:n.signal})},jt=function(t,e){return Rn.apply(this,arguments)},Pt=function(t,e){return wt("".concat(Dn,"/").concat(t),{method:"DELETE",signal:e.signal})},_t=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},At=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){_t(i,r,o,a,u,"next",t)}function u(t){_t(i,r,o,a,u,"throw",t)}a(void 0)}))}},kt=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},Tt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{includeAuthStatus:!0};return(Bn<Date.now()-6e4||!Un.getState().loaded)&&Mt(),new we((function(e){var n=function(n){var r;n.loaded&&(t.includeAuthStatus?e.next(n.session):e.next(null===(r=n.session)||void 0===r?void 0:r.user))};return n(Un.getState()),Un.subscribe(n)}))},Ct=function(){return(Bn<Date.now()-6e4||!Un.getState().loaded)&&Mt(),Un},It=function(t){var e,n,r,o=null!==(r=null==t||null===(e=t.user)||void 0===e||null===(n=e.userProperties)||void 0===n?void 0:n.defaultLocale)&&void 0!==r?r:t.locale,i=document.documentElement.getAttribute("lang");(function(t){if(void 0===t||"string"!=typeof t)return!1;try{new Intl.Locale(t)}catch(t){return!1}return!0})(o)&&o!==i&&document.documentElement.setAttribute("lang",o)},Mt=function(t,e){Bn=Date.now();var n={};return t&&e&&(n.Authorization="Basic ".concat(window.btoa("".concat(t,":").concat(e)))),Ft(wt(In,{headers:n}))},Dt=function(){Un.setState({loaded:!0,session:{authenticated:!1,sessionId:""}})},Rt=function(t,e){return void 0===e?Boolean(t):!Boolean(t)||function(t,e){return"string"==typeof t?!Ln(e.privileges.find((function(e){return t===e.display}))):Array.isArray(t)?t.every((function(t){return!Ln(e.privileges.find((function(e){return t===e.display})))})):(Ln(t)||console.error('Could not understand privileges "'.concat(t,'"')),!0)}(t,e)||function(t){return!Ln(t.roles.find((function(t){return"System Developer"===t.display})))}(e)},Nt=function(){var t,e;return new Promise((function(n){var r=function(r){r.loaded&&r.session.user&&(t=r.session.user,n(r.session.user),e&&e())};r(Un.getState()),t||(e=Un.subscribe(r))}))},Lt=function(){return new Promise((function(t,e){Tt().subscribe((function(e){t(e.sessionLocation)}),e).unsubscribe()}))},Ut=function(t,e){return Fn.apply(this,arguments)},Bt=function(t,e,n){return zn.apply(this,arguments)},Ft=function(t){return new Promise((function(e,n){t.then((function(t){var r;"object"==a(null==t?void 0:t.data)?(r={loaded:!0,session:t.data},Un.setState(r),e(r)):(r={loaded:!1,session:null},Un.setState(r),n(r))})).catch((function(t){(0,Nn.reportError)("Failed to fetch new session information: ".concat(t));var e={loaded:!1,session:null};Un.setState(e),n(e)}))}))},zt=function(){(0,Le.defineConfigSchema)("@openmrs/esm-api",{redirectAuthFailure:{enabled:{_type:Le.Type.Boolean,_default:!0,_description:"Whether to redirect logged-out users to `redirectAuthFailure.url`"},url:{_type:Le.Type.String,_default:"${openmrsSpaBase}/login",_validators:[Le.validators.isUrl]},errors:{_type:Le.Type.Array,_default:[401],_elements:{_type:Le.Type.Number,_validators:[Le.validators.inRange(100,600)]},_description:"The HTTP error codes for which users will be redirected"},resolvePromise:{_type:Le.Type.Boolean,_default:!1,_description:"Changes how requests that fail authentication are handled. Try messing with this if redirects to the login page aren't working correctly."}}}),Mt()},Vt=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},Ht=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},Gt=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Ht(i,r,o,a,u,"next",t)}function u(t){Ht(i,r,o,a,u,"throw",t)}a(void 0)}))}},Wt=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Vt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Vt(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},Kt=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},$t=function(t,e){return Hn.apply(this,arguments)},qt=function(t){return Gn.apply(this,arguments)},Jt=function(t){return function(e){return 0===t?Xn:e.lift(new Zn(t))}},Yt=function(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new er(t,e))}},Qt=function(){return(0,Be.getGlobalStore)("visit",or)},Xt=function(t,e){Qt().setState({patientUuid:t,manuallySetVisitUuid:e})},Zt=function(t,e,n){var r=null!=n?n:rr;return St("".concat(Tn,"/visit?patient=").concat(t,"&v=").concat(r),{signal:e.signal,method:"GET",headers:{"Content-type":"application/json"}}).pipe(Jt(1)).pipe(Yt((function(t){return t})))},te=function(t,e){return St("".concat(Tn,"/visit"),{signal:e.signal,method:"POST",headers:{"Content-type":"application/json"},body:t})},ee=function(t,e,n){return St("".concat(Tn,"/visit/").concat(t),{signal:n.signal,method:"POST",headers:{"Content-type":"application/json"},body:e})},ne=function(t){return{uuid:t.uuid,display:t.display,name:t.name}},re=function(){return St("".concat(Tn,"/visittype")).pipe(Yt((function(t){return t.data.results.map(ne)}))).pipe(Jt(1))},oe=function(t){return{uuid:t.uuid,display:t.display}},ie=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return St("".concat(Tn,"/location")+(t?"?tag="+t:"")).pipe(Yt((function(t){return t.data.results.map(oe)}))).pipe(Jt(1))};f.r(h),f.d(h,{OpenmrsFetchError:function(){return Mn},VisitMode:function(){return ir},VisitStatus:function(){return ar},attachmentUrl:function(){return Dn},backendDependencies:function(){return sr},clearCurrentUser:function(){return Dt},createAttachment:function(){return jt},defaultVisitCustomRepresentation:function(){return rr},deleteAttachmentPermanently:function(){return Pt},fetchCurrentPatient:function(){return $t},fhirBaseUrl:function(){return Cn},getAttachmentByUuid:function(){return Et},getAttachments:function(){return xt},getCurrentUser:function(){return Tt},getLocations:function(){return ie},getLoggedInUser:function(){return Nt},getSessionLocation:function(){return Lt},getSessionStore:function(){return Ct},getStartedVisit:function(){return ur},getVisitStore:function(){return Qt},getVisitTypes:function(){return re},getVisitsForPatient:function(){return Zt},makeUrl:function(){return bt},openmrsFetch:function(){return wt},openmrsObservableFetch:function(){return St},refetchCurrentUser:function(){return Mt},restBaseUrl:function(){return Tn},saveVisit:function(){return te},sessionEndpoint:function(){return In},setCurrentVisit:function(){return Xt},setSessionLocation:function(){return Ut},setUserLanguage:function(){return It},setUserProperties:function(){return Bt},setupApiModule:function(){return zt},toLocationObject:function(){return oe},toVisitTypeObject:function(){return ne},updateVisit:function(){return ee},userHasAccess:function(){return Rt}});var ae,ue,se=function(t,e){return se=Object.setPrototypeOf||i({__proto__:[]},Array)&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},se(t,e)},ce=!1,le={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack,ce=t},get useDeprecatedSynchronousErrorHandling(){return ce}},fe={closed:!0,next:function(t){},error:function(t){if(le.useDeprecatedSynchronousErrorHandling)throw t;u(t)},complete:function(){}},he=Array.isArray||function(t){return t&&"number"==typeof t.length},pe=function(){function t(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t}(),de=pe,ve=function(){function t(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}return t.prototype.unsubscribe=function(){var n;if(!this.closed){var r=this,o=r._parentOrParents,a=r._ctorUnsubscribe,u=r._unsubscribe,l=r._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,i(o,t))o.remove(this);else if(null!==o)for(var f=0;f<o.length;++f)o[f].remove(this);if(e(u)){a&&(this._unsubscribe=void 0);try{u.call(this)}catch(t){n=i(t,de)?c(t.errors):[t]}}if(he(l)){f=-1;for(var h=l.length;++f<h;){var p=l[f];if(s(p))try{p.unsubscribe()}catch(t){n=n||[],i(t,de)?n=n.concat(c(t.errors)):n.push(t)}}}if(n)throw new de(n)}},t.prototype.add=function(e){var n=e;if(!e)return t.EMPTY;switch(void 0===e?"undefined":a(e)){case"function":n=new t(e);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!i(n,t)){var r=n;(n=new t)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var o=n._parentOrParents;if(null===o)n._parentOrParents=this;else if(i(o,t)){if(o===this)return n;n._parentOrParents=[o,this]}else{if(-1!==o.indexOf(this))return n;o.push(this)}var u=this._subscriptions;return null===u?this._subscriptions=[n]:u.push(n),n},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}},t.EMPTY=function(t){return t.closed=!0,t}(new t),t}(),ye="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random(),me=function(e){function n(t,r,o){var u=e.call(this)||this;switch(u.syncErrorValue=null,u.syncErrorThrown=!1,u.syncErrorThrowable=!1,u.isStopped=!1,arguments.length){case 0:u.destination=fe;break;case 1:if(!t){u.destination=fe;break}if("object"==(void 0===t?"undefined":a(t))){i(t,n)?(u.syncErrorThrowable=t.syncErrorThrowable,u.destination=t,t.add(u)):(u.syncErrorThrowable=!0,u.destination=new ge(u,t));break}default:u.syncErrorThrowable=!0,u.destination=new ge(u,t,r,o)}return u}return t(n,e),n.prototype[ye]=function(){return this},n.create=function(t,e,r){var o=new n(t,e,r);return o.syncErrorThrowable=!1,o},n.prototype.next=function(t){this.isStopped||this._next(t)},n.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},n.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},n.prototype._next=function(t){this.destination.next(t)},n.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},n.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},n.prototype._unsubscribeAndRecycle=function(){var t=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this},n}(ve),ge=function(n){function r(t,r,o,i){var a,u=n.call(this)||this;u._parentSubscriber=t;var s=u;return e(r)?a=r:r&&(a=r.next,o=r.error,i=r.complete,r!==fe&&(e((s=Object.create(r)).unsubscribe)&&u.add(s.unsubscribe.bind(s)),s.unsubscribe=u.unsubscribe.bind(u))),u._context=s,u._next=a,u._error=o,u._complete=i,u}return t(r,n),r.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;le.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},r.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,n=le.useDeprecatedSynchronousErrorHandling;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):u(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;u(t)}}},r.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var n=function(){return t._complete.call(t._context)};le.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},r.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),le.useDeprecatedSynchronousErrorHandling)throw t;u(t)}},r.prototype.__tryOrSetError=function(t,e,n){if(!le.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(e){return le.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):(u(e),!0)}return!1},r.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},r}(me),be="function"==typeof Symbol&&Symbol.observable||"@@observable",we=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r=this.operator,o=function(t,e,n){if(t){if(i(t,me))return t;if(t[ye])return t[ye]()}return t||e||n?new me(t,e,n):new me(fe)}(t,e,n);if(r?o.add(r.call(o,this.source)):o.add(this.source||le.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),le.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){le.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),function(t){for(;t;){var e=t,n=e.closed,r=e.destination,o=e.isStopped;if(n||o)return!1;t=r&&i(r,me)?r:null}return!0}(t)?t.error(e):console.warn(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=p(e))((function(e,r){var o;o=n.subscribe((function(e){try{t(e)}catch(t){r(t),o&&o.unsubscribe()}}),r,e)}))},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[be]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:(0===(n=t).length?l:1===n.length?n[0]:function(t){return n.reduce((function(t,e){return e(t)}),t)})(this);var n},t.prototype.toPromise=function(t){var e=this;return new(t=p(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}(),Se="object"==(void 0===n.g?"undefined":a(n.g))&&n.g&&n.g.Object===Object&&n.g,Oe="object"==("undefined"==typeof self?"undefined":a(self))&&self&&self.Object===Object&&self,Ee=(Se||Oe||Function("return this")()).Symbol,xe=Object.prototype,je=xe.hasOwnProperty,Pe=xe.toString,_e=Ee?Ee.toStringTag:void 0,Ae=Object.prototype.toString,ke=Ee?Ee.toStringTag:void 0,Te=(ae=Object.getPrototypeOf,ue=Object,function(t){return ae(ue(t))}),Ce=Function.prototype,Ie=Object.prototype,Me=Ce.toString,De=Ie.hasOwnProperty,Re=Me.call(Object),Ne=function(t){if(!function(t){return null!=t&&"object"==(void 0===t?"undefined":a(t))}(t)||"[object Object]"!=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":ke&&ke in Object(t)?function(t){var e=je.call(t,_e),n=t[_e];try{t[_e]=void 0;var r=!0}catch(t){}var o=Pe.call(t);return r&&(e?t[_e]=n:delete t[_e]),o}(t):function(t){return Ae.call(t)}(t)}(t))return!1;var e=Te(t);if(null===e)return!0;var n=De.call(e,"constructor")&&e.constructor;return"function"==typeof n&&i(n,n)&&Me.call(n)==Re},Le=f(824),Ue=f(513),Be=f(385);(0,Be.createGlobalStore)("breadcrumbs",[]);var Fe,ze=Object.freeze({__proto__:null,get start(){return pt},get ensureJQuerySupport(){return J},get setBootstrapMaxTime(){return N},get setMountMaxTime(){return L},get setUnmountMaxTime(){return U},get setUnloadMaxTime(){return B},get registerApplication(){return ot},get unregisterApplication(){return at},get getMountedApps(){return et},get getAppStatus(){return rt},get unloadApplication(){return ut},get checkActivityFunctions(){return it},get getAppNames(){return nt},get pathToActiveWhen(){return lt},get navigateToUrl(){return H},get patchHistoryApi(){return $},get triggerAppChange(){return ft},get addErrorHandler(){return v},get removeErrorHandler(){return y},get mountRootParcel(){return I},get NOT_LOADED(){return We},get LOADING_SOURCE_CODE(){return Ke},get NOT_BOOTSTRAPPED(){return $e},get BOOTSTRAPPING(){return qe},get NOT_MOUNTED(){return Je},get MOUNTING(){return Ye},get UPDATING(){return Xe},get LOAD_ERROR(){return en},get MOUNTED(){return Qe},get UNLOADING(){return tn},get UNMOUNTING(){return Ze},get SKIP_BECAUSE_BROKEN(){return nn}}),Ve=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).CustomEvent,He=function(){try{var t=new Ve("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?Ve:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(t,e){var n=document.createEvent("CustomEvent");return e?n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail):n.initCustomEvent(t,!1,!1,void 0),n}:function(t,e){var n=document.createEventObject();return n.type=t,e?(n.bubbles=Boolean(e.bubbles),n.cancelable=Boolean(e.cancelable),n.detail=e.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n},Ge=[],We="NOT_LOADED",Ke="LOADING_SOURCE_CODE",$e="NOT_BOOTSTRAPPED",qe="BOOTSTRAPPING",Je="NOT_MOUNTED",Ye="MOUNTING",Qe="MOUNTED",Xe="UPDATING",Ze="UNMOUNTING",tn="UNLOADING",en="LOAD_ERROR",nn="SKIP_BECAUSE_BROKEN",rn=[],on=!1,an=!1,un=0,sn={parcels:{}},cn={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}},ln="undefined"!=typeof window,fn={hashchange:[],popstate:[]},hn=["hashchange","popstate"],pn=null,dn=!1;ln&&(window.singleSpaNavigate?console.warn(m(41,!1)):window.singleSpaNavigate=H);var vn=!1,yn={},mn=[],gn=!1,bn=!1,wn=[],Sn=ln&&window.location.href;function On(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(bn)return new Promise((function(t,n){wn.push({resolve:t,reject:n,eventArguments:e})}));var r,i=function(){var t=[],e=[],n=[],r=[],o=(new Date).getTime();return mn.forEach((function(i){var a=i.status!==nn&&w(i);switch(i.status){case en:a&&o-i.loadErrorTime>=200&&n.push(i);break;case We:case Ke:a&&n.push(i);break;case $e:case Je:!a&&tt(S(i))?t.push(i):a&&r.push(i);break;case Qe:a||e.push(i)}})),{appsToUnload:t,appsToUnmount:e,appsToLoad:n,appsToMount:r}}(),a=i.appsToUnload,u=i.appsToUnmount,s=i.appsToLoad,c=i.appsToMount,l=[],f=Sn,h=Sn=window.location.href;return dt()?(bn=!0,r=a.concat(s,u,c),Promise.resolve().then((function(){return g(0===r.length?"before-no-app-change":"before-app-change",y(!0)),g("before-routing-event",y(!0,{cancelNavigation:p})),Promise.all(l).then((function(n){if(n.some((function(t){return t})))return pn.call(window.history,history.state,"",f.substring(location.origin.length)),Sn=location.href,bn=!1,On(t,e,!0);var r=a.map(Q),o=u.map(T).map((function(t){return t.then(Q)})).concat(r),i=Promise.all(o);i.then((function(){g("before-mount-routing-event",y(!0))}),(function(t){throw t}));var l=s.map((function(t){return V(t).then((function(t){return ht(t,i)}))})),h=c.filter((function(t){return s.indexOf(t)<0})).map((function(t){return ht(t,i)}));return i.catch((function(t){throw v(),t})).then((function(){return v(),Promise.all(l.concat(h)).catch((function(e){throw t.forEach((function(t){return t.reject(e)})),e})).then(d).then((function(){}),(function(t){throw t}))}))}))}))):(r=s,Promise.resolve().then((function(){var t=s.map(V);return Promise.all(t).then(v).then((function(){return[]})).catch((function(t){throw v(),t})).finally((function(){}))})));function p(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e="function"==typeof(null==t?void 0:t.then)?t:Promise.resolve(t);l.push(e.catch((function(t){return console.warn(Error(m(42,!1))),console.warn(t),!1})))}function d(){var e=et();t.forEach((function(t){return t.resolve(e)}));try{g(0===r.length?"no-app-change":"app-change",y()),g("routing-event",y())}catch(t){setTimeout((function(){throw t}))}if(bn=!1,wn.length>0){var n=wn;wn=[],On(n)}return e}function v(){n||(t.forEach((function(t){G(t.eventArguments)})),G(e))}function y(){var t,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1?arguments[1]:void 0,l={},p=(o(t={},Qe,[]),o(t,Je,[]),o(t,We,[]),o(t,nn,[]),t);n?(s.concat(c).forEach((function(t,e){v(t,Qe)})),a.forEach((function(t){v(t,We)})),u.forEach((function(t){v(t,Je)}))):r.forEach((function(t){v(t)}));var d={detail:{newAppStatuses:l,appsByNewStatus:p,totalAppChanges:r.length,originalEvent:null==e?void 0:e[0],oldUrl:f,newUrl:h}};return i&&x(d.detail,i),d;function v(t,e){var n=S(t);e=e||rt(n),l[n]=e,(p[e]=p[e]||[]).push(n)}}function g(t,e){n||window.dispatchEvent(new He("single-spa:".concat(t),e))}}var En=!1,xn={getRawAppData:function(){return function(t){if(Array.isArray(t))return r(t)}(t=mn)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(t)||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.")}();var t},reroute:On,NOT_LOADED:We,toLoadPromise:V,toBootstrapPromise:k,unregisterApplication:at,getProfilerData:function(){return rn}};ln&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=xn);var jn="openmrs:history";function Pn(t,e,n){return Pn=gt()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&An(o,n.prototype),o},Pn.apply(null,arguments)}function _n(t){return _n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},_n(t)}function An(t,e){return An=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},An(t,e)}function kn(t){var e="function"==typeof Map?new Map:void 0;return kn=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return Pn(t,arguments,_n(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),An(r,t)},kn(t)}var Tn="/ws/rest/v1",Cn="/ws/fhir2/R4",In="".concat(Tn,"/session"),Mn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&An(t,e)}(o,t);var e,n,r=(e=o,n=gt(),function(){var t,r=_n(e);if(n){var o=_n(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return function(t,e){return!e||"object"!=((n=e)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":void 0===n?"undefined":a(n))&&"function"!=typeof e?vt(t):e;var n}(this,t)});function o(t,e,n,a){var u;return function(t,e){if(!i(t,e))throw new TypeError("Cannot call a class as a function")}(this,o),mt(vt(u=r.call(this)),"response",void 0),mt(vt(u),"responseBody",void 0),u.message="Server responded with ".concat(e.status," (").concat(e.statusText,") for url ").concat(t,". Check err.responseBody or network tab in dev tools for more info"),a.message=u.message,u.responseBody=n,u.response=e,u.stack="Stacktrace for outgoing request:\n".concat(a.stack,"\nStacktrace for incoming response:\n").concat(u.stack),u}return o}(kn(Error)),Dn="".concat(Tn,"/attachment");function Rn(){var t;return t=function(t,e){var n;return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(r){return(n=new FormData).append("fileCaption",e.fileDescription),n.append("patient",t),e.file?n.append("file",e.file):(n.append("file",new File([""],e.fileName),e.fileName),n.append("base64Content",e.base64Content)),[2,wt("".concat(Dn),{method:"POST",body:n})]}))},Rn=function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Ot(i,r,o,a,u,"next",t)}function u(t){Ot(i,r,o,a,u,"throw",t)}a(void 0)}))},Rn.apply(this,arguments)}var Nn=f(254),Ln=function(t){return void 0===t},Un=(0,Be.createGlobalStore)("session",{loaded:!1,session:null}),Bn=0;function Fn(){return(Fn=At((function(t,e){return kt(this,(function(n){return[2,Ft(wt(In,{method:"POST",body:{sessionLocation:t},headers:{"Content-Type":"application/json"},signal:e.signal}))]}))}))).apply(this,arguments)}function zn(){return(zn=At((function(t,e,n){return kt(this,(function(r){switch(r.label){case 0:return n||(n=new AbortController),[4,wt("".concat(Tn,"/user/").concat(t),{method:"POST",body:{userProperties:e},headers:{"Content-Type":"application/json"},signal:n.signal})];case 1:return r.sent(),[2,Mt()]}}))}))).apply(this,arguments)}Un.subscribe((function(t){return t.session&&It(t.session)}));var Vn=f(738);function Hn(){return Hn=Gt((function(t,e){var n,r,o,i,a,u=arguments;return Kt(this,(function(s){switch(s.label){case 0:return n=!(u.length>2&&void 0!==u[2])||u[2],t?(r=null,[4,Promise.all([wt("".concat(Cn,"/Patient/").concat(t),e).catch((function(t){return r=t})),n?qt(t):Promise.resolve(null)])]):[3,2];case 1:if(o=Wt.apply(void 0,[s.sent(),2]),i=o[0],a=o[1],i.ok)return[2,i.data];if(a)return[2,a];if(r)throw r;s.label=2;case 2:return[2,null]}}))})),Hn.apply(this,arguments)}function Gn(){return(Gn=Gt((function(t){var e,n,r;return Kt(this,(function(o){switch(o.label){case 0:return[4,(0,Vn.getSynchronizationItems)("patient-registration")];case 1:return e=o.sent(),n=e.find((function(e){return e.fhirPatient.id===t})),[2,null!==(r=null==n?void 0:n.fhirPatient)&&void 0!==r?r:null]}}))}))).apply(this,arguments)}var Wn=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}(),Kn=function(e){function n(t,n){var r=e.call(this)||this;return r.subject=t,r.subscriber=n,r.closed=!1,r}return t(n,e),n.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}},n}(ve),$n=function(e){function n(t){var n=e.call(this,t)||this;return n.destination=t,n}return t(n,e),n}(me),qn=function(e){function n(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return t(n,e),n.prototype[ye]=function(){return new $n(this)},n.prototype.lift=function(t){var e=new Jn(this,this);return e.operator=t,e},n.prototype.next=function(t){if(this.closed)throw new Wn;if(!this.isStopped)for(var e=this.observers,n=e.length,r=e.slice(),o=0;o<n;o++)r[o].next(t)},n.prototype.error=function(t){if(this.closed)throw new Wn;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,n=e.length,r=e.slice(),o=0;o<n;o++)r[o].error(t);this.observers.length=0},n.prototype.complete=function(){if(this.closed)throw new Wn;this.isStopped=!0;for(var t=this.observers,e=t.length,n=t.slice(),r=0;r<e;r++)n[r].complete();this.observers.length=0},n.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},n.prototype._trySubscribe=function(t){if(this.closed)throw new Wn;return e.prototype._trySubscribe.call(this,t)},n.prototype._subscribe=function(t){if(this.closed)throw new Wn;return this.hasError?(t.error(this.thrownError),ve.EMPTY):this.isStopped?(t.complete(),ve.EMPTY):(this.observers.push(t),new Kn(this,t))},n.prototype.asObservable=function(){var t=new we;return t.source=this,t},n.create=function(t,e){return new Jn(t,e)},n}(we),Jn=function(e){function n(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return t(n,e),n.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},n.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},n.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},n.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):ve.EMPTY},n}(qn),Yn=function(e){function n(t){var n=e.call(this)||this;return n._value=t,n}return t(n,e),Object.defineProperty(n.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),n.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return n&&!n.closed&&t.next(this._value),n},n.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new Wn;return this._value},n.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},n}(qn),Qn=function(){function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t}(),Xn=new we((function(t){return t.complete()})),Zn=function(){function t(t){if(this.total=t,this.total<0)throw new Qn}return t.prototype.call=function(t,e){return e.subscribe(new tr(t,this.total))},t}(),tr=function(e){function n(t,n){var r=e.call(this,t)||this;return r.total=n,r.count=0,r}return t(n,e),n.prototype._next=function(t){var e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))},n}(me),er=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new nr(t,this.project,this.thisArg))},t}(),nr=function(e){function n(t,n,r){var o=e.call(this,t)||this;return o.project=n,o.count=0,o.thisArg=r||o,o}return t(n,e),n.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},n}(me),rr="custom:(uuid,display,voided,indication,startDatetime,stopDatetime,encounters:(uuid,display,encounterDatetime,form:(uuid,name),location:ref,encounterType:ref,encounterProviders:(uuid,display,provider:(uuid,display))),patient:(uuid,display),visitType:(uuid,name,display),attributes:(uuid,display,attributeType:(name,datatypeClassname,uuid),value),location:(uuid,name,display))",or=function(){try{return JSON.parse(localStorage.getItem("openmrs:visitStoreState")||"null")}catch(t){return null}}()||{patientUuid:null,manuallySetVisitUuid:null};Qt().subscribe((function(t){var e;e=t,localStorage.setItem("openmrs:visitStoreState",JSON.stringify(e))}));var ir,ar,ur=new Yn(null);!function(t){t.NEWVISIT="startVisit",t.EDITVISIT="editVisit",t.LOADING="loadingVisit"}(ir||(ir={})),function(t){t.NOTSTARTED="notStarted",t.ONGOING="ongoing"}(ar||(ar={}));var sr={"webservices.rest":"2.24.0",fhir2:"1.0.0-SNAPSHOT"}}(),h}())}}}))},7274:()=>{function t(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}System.register(["@openmrs/esm-state"],(function(e,n){var r={};return{setters:[function(t){r.createGlobalStore=t.createGlobalStore,r.getGlobalStore=t.getGlobalStore}],execute:function(){e(function(){"use strict";var e={685:function(t){t.exports=r}},n={};function o(t){var r=n[t];if(void 0!==r)return r.exports;var i=n[t]={exports:{}};return e[t](i,i.exports,o),i.exports}o.d=function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};return function(){var e=function(e){return null!=e&&"object"==(void 0===e?"undefined":t(e))&&!0===e["@@functional/placeholder"]},n=function(t){return function n(r){return 0===arguments.length||e(r)?n:t.apply(this,arguments)}},r=function(t){return function r(o,i){switch(arguments.length){case 0:return r;case 1:return e(o)?r:n((function(e){return t(o,e)}));default:return e(o)&&e(i)?r:e(o)?n((function(e){return t(e,i)})):e(i)?n((function(e){return t(o,e)})):t(o,i)}}},a=function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n},u=function(t,e,n){for(var r=0,o=n.length;r<o;){if(t(e,n[r]))return!0;r+=1}return!1},s=function(t,e){return Object.prototype.hasOwnProperty.call(e,t)},c=function(t,e,n,r){var o=a(t);function i(t,e){return ft(t,e,n.slice(),r.slice())}return!u((function(t,e){return!u(i,e,t)}),a(e),o)},l=function(t){return function o(i,a,u){switch(arguments.length){case 0:return o;case 1:return e(i)?o:r((function(e,n){return t(i,e,n)}));case 2:return e(i)&&e(a)?o:e(i)?r((function(e,n){return t(e,a,n)})):e(a)?r((function(e,n){return t(i,e,n)})):n((function(e){return t(i,a,e)}));default:return e(i)&&e(a)&&e(u)?o:e(i)&&e(a)?r((function(e,n){return t(e,n,u)})):e(i)&&e(u)?r((function(e,n){return t(e,a,n)})):e(a)&&e(u)?r((function(e,n){return t(i,e,n)})):e(i)?n((function(e){return t(e,a,u)})):e(a)?n((function(e){return t(i,e,u)})):e(u)?n((function(e){return t(i,a,e)})):t(i,a,u)}}},f=function(t){return"[object Object]"===Object.prototype.toString.call(t)},h=function(t,e,n){for(var r=n.next();!r.done;){if((e=t["@@transducer/step"](e,r.value))&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}r=n.next()}return t["@@transducer/result"](e)},p=function(t,e,n,r){return t["@@transducer/result"](n[r](xt(t["@@transducer/step"],t),e))},d=function(t,e){return function(n){if(!t(n))return"function"==typeof e?e(n):e}},v=function(t){return(0,Mt.getGlobalStore)("config-module-".concat(t),{config:null,loaded:!1,translationOverridesLoaded:!1})},y=function(){return(0,Mt.getGlobalStore)("config-extension-slots",{slots:{}})},m=function(t){return g(y().getState(),t)},g=function(t,e){var n=t.slots[e];return null!=n?n:{loaded:!1,config:{}}},b=function(){return(0,Mt.getGlobalStore)("config-extensions",{configs:{}})},w=function(t,e){var n=Object.assign({},S(b().getState(),t,e));return n.config=yt(["Display conditions","Translation overrides"],n.config),n},S=function(t,e,n){var r,o=null===(r=t.configs[e])||void 0===r?void 0:r[n];return null!=o?o:{loaded:!1,config:null}},O=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},E=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},x=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){E(t,e,n[e])}))}return t},j=function(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n.push.apply(n,r)}return n}(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},P=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t,e)||A(t,e)||function(){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(t){return function(t){if(Array.isArray(t))return O(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||A(t)||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.")}()},A=function(t,e){if(t){if("string"==typeof t)return O(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?O(t,e):void 0}},k=function(t,e){var n=!0,r=!1,o=void 0;try{for(var i,a=Object.keys(t.schemas)[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var u=i.value,s=v(u);if(t.moduleLoaded[u]){var c=G(u,t,e);s.setState({translationOverridesLoaded:!0,loaded:!0,config:c})}else{var l=W(u,t,e);s.setState({translationOverridesLoaded:!0,loaded:!1,config:l})}}}catch(t){r=!0,o=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}},T=function(t,e){var n,r,o=(n=$(H(t,e)),function(t){var e=!0,n=!1,r=void 0;try{for(var o,i=Object.entries(t)[Symbol.iterator]();!(e=(o=i.next()).done);e=!0){var a=P(o.value,2),u=a[0],s=a[1],c=!0,l=!1,f=void 0;try{for(var h,p=Object.entries(s)[Symbol.iterator]();!(c=(h=p.next()).done);c=!0){var d=P(h.value,2),v=d[0];V(d[1],u,v)}}catch(t){l=!0,f=t}finally{try{c||null==p.return||p.return()}finally{if(l)throw f}}}}catch(t){n=!0,r=t}finally{try{e||null==i.return||i.return()}finally{if(n)throw r}}}(r=Object.keys(n).reduce((function(t,e){var r,o;return(null===(r=n[e])||void 0===r?void 0:r.extensionSlots)&&(t[e]=null===(o=n[e])||void 0===o?void 0:o.extensionSlots),t}),{})),Object.keys(r).reduce((function(t,e){return x({},t,r[e])}),{})),i=Object.fromEntries(Object.entries(o).map((function(t){var e=P(t,2);return[e[0],{loaded:!0,config:e[1]}]}))),a=y(),u=a.getState(),s={slots:x({},u.slots,i)};ht(u,s)||a.setState(s)},C=function(t,e){var n=function(t,e){var n=Ut(bt(t.schemas)),r=_(t.providedConfigs.map((function(t){return[t.config,t.source]}))).concat([[e.config,"temporary config"]]),o=!0,i=!1,a=void 0;try{for(var u,s=r[Symbol.iterator]();!(o=(u=s.next()).done);o=!0){var c=P(u.value,2);n=$([n,Bt(c[0],c[1])])}}catch(t){i=!0,a=t}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}return n}(t,e);Lt.setState({config:n})},I=function(t,e,n){var r={},o=!0,i=!1,a=void 0;try{for(var u,s=e.mountedExtensions[Symbol.iterator]();!(o=(u=s.next()).done);o=!0){var c=u.value,l=z(c.slotModuleName,c.extensionModuleName,c.slotName,c.extensionId,t,n);r[c.slotName]=j(x({},r[c.slotName]),E({},c.extensionId,{config:l,loaded:!0}))}}catch(t){i=!0,a=t}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}b().setState({configs:r})},M=function(t,e){Ft(t,e);var n=vt(e,Kt);Dt.setState((function(e){return j(x({},e),{schemas:j(x({},e.schemas),E({},t,n)),moduleLoaded:j(x({},e.moduleLoaded),E({},t,!0))})}))},D=function(t){var e=Dt.getState();Dt.setState({schemas:j(x({},e.schemas),E({},t,Kt))})},R=function(t){var e=Dt.getState();Dt.setState({schemas:j(x({},e.schemas),E({},t,Wt))})},N=function(t,e){Ft(t,e);var n=vt(e,Kt),r=Dt.getState();r.schemas[t]&&console.error("Config schema for extension ".concat(t," already exists. If there are multiple extensions with this same name, one will probably crash.")),Dt.setState({schemas:j(x({},r.schemas),E({},t,n))})},L=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"provided";Dt.setState((function(n){return j(x({},n),{providedConfigs:_(n.providedConfigs).concat([{source:e,config:t}])})}))},U=function(t){return new Promise((function(e){var n=function(t){if(t.loaded&&t.config){var n=yt(["Display conditions","Translation overrides"],t.config);e(n),o&&o()}},r=v(t);n(r.getState());var o=r.subscribe(n)}))},B=function(t){return new Promise((function(e){var n=function(t){if(t.translationOverridesLoaded&&t.config){var n,r=null!==(n=t.config["Translation overrides"])&&void 0!==n?n:{};e(r),o&&o()}},r=v(t);n(r.getState());var o=r.subscribe(n)}))},F=function(t,e,n){q(t,e,n);var r=Ht(t,e);return Vt(t,r,n),r},z=function(t,e,n,r,o,i){var a,u,s,c,l=function(t){return P(t.split("#"),1)[0]}(r),f=o.schemas[l],h=f?l:e,p=H(o,i),d=K(t,p),v=null!==(c=null==d||null===(a=d.extensionSlots)||void 0===a||null===(u=a[n])||void 0===u||null===(s=u.configure)||void 0===s?void 0:s[r])&&void 0!==c?c:{},y=$([K(h,p),v]),m=null!=f?f:o.schemas[e];q(m,y,h);var g=Ht(m,y);return Vt(m,g,h),delete g.extensionSlots,g},V=function(t,e,n){var r="".concat(e,".extensionSlots.").concat(n),o="Extension slot config '".concat(r,"'"),i=Object.keys(t).filter((function(t){return!["add","remove","order","configure"].includes(t)}));i.length&&Z(r,o+"' contains invalid keys '".concat(i.join("', '"),"'")),t.add&&(Array.isArray(t.add)&&t.add.every((function(t){return"string"==typeof t}))||Z(r,o+".add' is invalid. Must be an array of strings (extension IDs)")),t.remove&&(Array.isArray(t.remove)&&t.remove.every((function(t){return"string"==typeof t}))||Z(r,o+".remove' is invalid. Must be an array of strings (extension IDs)")),t.order&&(Array.isArray(t.order)&&t.order.every((function(t){return"string"==typeof t}))||Z(r,o+".order' is invalid. Must be an array of strings (extension IDs)")),t.configure&&(X(t.configure)||Z(r,o+".configure' is invalid. Must be an object with extension IDs for keys"))},H=function(t,e){return _(t.providedConfigs.map((function(t){return t.config}))).concat([e.config])},G=function(t,e,n){var r=e.schemas[t],o=K(t,H(e,n));q(r,o,t);var i=Ht(r,o);return Vt(r,i,t),delete i.extensionSlots,i},W=function(t,e,n){var r=K(t,H(e,n)),o=Ht(Kt,r);return Vt(Kt,o,t),delete o.extensionSlots,o},K=function(t,e){return $(e.map((function(e){return e[t]})).filter((function(t){return!!t})))},$=function(t){return Pt(vt)({},t)},q=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=!0,o=!1,i=void 0;try{for(var a,u=Object.keys(e)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=a.value,c=e[s],l=n+"."+s,f=t[s];t.hasOwnProperty(s)?zt(f,c,l):"extensionSlots"===s&&""!==n||Z(l,"Unknown config key '".concat(l,"' provided. Ignoring."))}}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}},J=function(t,e,n){e&&Y(t,[{Array:_t,Boolean:At,ConceptUuid:It,Number:kt,Object:Ct,String:Tt,UUID:It,PersonAttributeTypeUuid:It,PatientIdentifierTypeUuid:It}[e]],n)},Y=function(e,n,r){if(n)try{var o=!0,i=!1,a=void 0;try{for(var u,s=n[Symbol.iterator]();!(o=(u=s.next()).done);o=!0){var c=(0,u.value)(r);"string"==typeof c&&Z(e,"object"==(void 0===r?"undefined":t(r))?"Invalid configuration for ".concat(e,": ").concat(c):"Invalid configuration value ".concat(r," for ").concat(e,": ").concat(c))}}catch(e){i=!0,a=e}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}}catch(n){console.error('Skipping invalid validator at "'.concat(e,'". Encountered error\n\t').concat(n))}},Q=function(t){return!!t&&Object.keys(t).filter((function(t){return!["_default","_validators"].includes(t)})).length>0},X=function(e){return"object"==(void 0===e?"undefined":t(e))&&!Array.isArray(e)&&null!==e},Z=function(t,e){var n="".concat(t,":::").concat(e);Gt.has(n)||(console.error(e),Gt.add(n))},tt=function(t){t?Gt.forEach((function(e){e.startsWith(t)&&Gt.delete(e)})):Gt.clear()};o.r(i),o.d(i,{Type:function(){return gt},clearConfigErrors:function(){return tt},configExtensionStore:function(){return Nt},configInternalStore:function(){return Dt},defineConfigSchema:function(){return M},defineExtensionConfigSchema:function(){return N},getConfig:function(){return U},getConfigStore:function(){return v},getExtensionConfig:function(){return w},getExtensionConfigFromStore:function(){return S},getExtensionSlotConfig:function(){return m},getExtensionSlotConfigFromStore:function(){return g},getExtensionSlotsConfigStore:function(){return y},getExtensionsConfigStore:function(){return b},getTranslationOverrides:function(){return B},implementerToolsConfigStore:function(){return Lt},inRange:function(){return $t},isUrl:function(){return Jt},isUrlWithTemplateParameters:function(){return qt},oneOf:function(){return Yt},processConfig:function(){return F},provide:function(){return L},registerModuleWithConfigSystem:function(){return D},registerTranslationNamespace:function(){return R},temporaryConfigStore:function(){return Rt},validator:function(){return d},validators:function(){return Qt}});var et="function"==typeof Object.is?Object.is:function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e},nt=Object.prototype.toString,rt=function(){return"[object Arguments]"===nt.call(arguments)?function(t){return"[object Arguments]"===nt.call(t)}:function(t){return s("callee",t)}}(),ot=rt,it=!{toString:null}.propertyIsEnumerable("toString"),at=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],ut=function(){return arguments.propertyIsEnumerable("length")}(),st=function(t,e){for(var n=0;n<t.length;){if(t[n]===e)return!0;n+=1}return!1},ct="function"!=typeof Object.keys||ut?n((function(t){if(Object(t)!==t)return[];var e,n,r=[],o=ut&&ot(t);for(e in t)!s(e,t)||o&&"length"===e||(r[r.length]=e);if(it)for(n=at.length-1;n>=0;)s(e=at[n],t)&&!st(r,e)&&(r[r.length]=e),n-=1;return r})):n((function(t){return Object(t)!==t?[]:Object.keys(t)})),lt=n((function(t){return null===t?"Null":void 0===t?"Undefined":Object.prototype.toString.call(t).slice(8,-1)}));function ft(e,n,r,o){if(et(e,n))return!0;var i,a,u=lt(e);if(u!==lt(n))return!1;if(null==e||null==n)return!1;if("function"==typeof e["fantasy-land/equals"]||"function"==typeof n["fantasy-land/equals"])return"function"==typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](n)&&"function"==typeof n["fantasy-land/equals"]&&n["fantasy-land/equals"](e);if("function"==typeof e.equals||"function"==typeof n.equals)return"function"==typeof e.equals&&e.equals(n)&&"function"==typeof n.equals&&n.equals(e);switch(u){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===(i=e.constructor,null==(a=String(i).match(/^function (\w*)/))?"":a[1]))return e===n;break;case"Boolean":case"Number":case"String":if((void 0===e?"undefined":t(e))!=(void 0===n?"undefined":t(n))||!et(e.valueOf(),n.valueOf()))return!1;break;case"Date":if(!et(e.valueOf(),n.valueOf()))return!1;break;case"Error":return e.name===n.name&&e.message===n.message;case"RegExp":if(e.source!==n.source||e.global!==n.global||e.ignoreCase!==n.ignoreCase||e.multiline!==n.multiline||e.sticky!==n.sticky||e.unicode!==n.unicode)return!1}for(var l=r.length-1;l>=0;){if(r[l]===e)return o[l]===n;l-=1}switch(u){case"Map":return e.size===n.size&&c(e.entries(),n.entries(),r.concat([e]),o.concat([n]));case"Set":return e.size===n.size&&c(e.values(),n.values(),r.concat([e]),o.concat([n]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var f=ct(e);if(f.length!==ct(n).length)return!1;var h=r.concat([e]),p=o.concat([n]);for(l=f.length-1;l>=0;){var d=f[l];if(!s(d,n)||!ft(n[d],e[d],h,p))return!1;l-=1}return!0}var ht=r((function(t,e){return ft(t,e,[],[])})),pt=l((function(t,e,n){var r,o={};for(r in e)s(r,e)&&(o[r]=s(r,n)?t(r,e[r],n[r]):e[r]);for(r in n)s(r,n)&&!s(r,o)&&(o[r]=n[r]);return o})),dt=l((function t(e,n,r){return pt((function(n,r,o){return f(r)&&f(o)?t(e,r,o):e(n,r,o)}),n,r)})),vt=r((function(t,e){return dt((function(t,e,n){return n}),t,e)})),yt=r((function(t,e){for(var n={},r={},o=0,i=t.length;o<i;)r[t[o]]=1,o+=1;for(var a in e)r.hasOwnProperty(a)||(n[a]=e[a]);return n}));function mt(t,e,n,r){var o,i=function(o){for(var i=e.length,a=0;a<i;){if(t===e[a])return n[a];a+=1}for(var u in e[a+1]=t,n[a+1]=o,t)o[u]=r?mt(t[u],e,n,!0):t[u];return o};switch(lt(t)){case"Object":return i({});case"Array":return i([]);case"Date":return new Date(t.valueOf());case"RegExp":return o=t,new RegExp(o.source,(o.global?"g":"")+(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.sticky?"y":"")+(o.unicode?"u":""));default:return t}}var gt,bt=n((function(t){return null!=t&&"function"==typeof t.clone?t.clone():mt(t,[],[],!0)})),wt=Array.isArray||function(t){return null!=t&&t.length>=0&&"[object Array]"===Object.prototype.toString.call(t)},St=n((function(e){return!!wt(e)||!!e&&"object"==(void 0===e?"undefined":t(e))&&!function(t){return"[object String]"===Object.prototype.toString.call(t)}(e)&&(1===e.nodeType?!!e.length:0===e.length||e.length>0&&e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1))})),Ot=function(){function t(t){this.f=t}return t.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},t.prototype["@@transducer/result"]=function(t){return t},t.prototype["@@transducer/step"]=function(t,e){return this.f(t,e)},t}(),Et=r((function(t,e){return function(t,e){switch(t){case 0:return function(){return e.apply(this,arguments)};case 1:return function(t){return e.apply(this,arguments)};case 2:return function(t,n){return e.apply(this,arguments)};case 3:return function(t,n,r){return e.apply(this,arguments)};case 4:return function(t,n,r,o){return e.apply(this,arguments)};case 5:return function(t,n,r,o,i){return e.apply(this,arguments)};case 6:return function(t,n,r,o,i,a){return e.apply(this,arguments)};case 7:return function(t,n,r,o,i,a,u){return e.apply(this,arguments)};case 8:return function(t,n,r,o,i,a,u,s){return e.apply(this,arguments)};case 9:return function(t,n,r,o,i,a,u,s,c){return e.apply(this,arguments)};case 10:return function(t,n,r,o,i,a,u,s,c,l){return e.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}(t.length,(function(){return t.apply(e,arguments)}))})),xt=Et,jt="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",Pt=l((function(t,e,n){if("function"==typeof t&&(t=function(t){return new Ot(t)}(t)),St(n))return function(t,e,n){for(var r=0,o=n.length;r<o;){if((e=t["@@transducer/step"](e,n[r]))&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}r+=1}return t["@@transducer/result"](e)}(t,e,n);if("function"==typeof n["fantasy-land/reduce"])return p(t,e,n,"fantasy-land/reduce");if(null!=n[jt])return h(t,e,n[jt]());if("function"==typeof n.next)return h(t,e,n);if("function"==typeof n.reduce)return p(t,e,n,"reduce");throw new TypeError("reduce: list must be array or iterable")}));!function(t){t.Array="Array",t.Boolean="Boolean",t.ConceptUuid="ConceptUuid",t.Number="Number",t.Object="Object",t.String="String",t.UUID="UUID",t.PersonAttributeTypeUuid="PersonAttributeTypeUuid",t.PatientIdentifierTypeUuid="PatientIdentifierTypeUuid"}(gt||(gt={}));var _t=d((function(t){return Array.isArray(t)}),"must be an array"),At=d((function(t){return"boolean"==typeof t}),"must be a boolean"),kt=d((function(t){return"number"==typeof t}),"must be a number"),Tt=d((function(t){return"string"==typeof t}),"must be a string"),Ct=d((function(e){return"object"==(void 0===e?"undefined":t(e))&&!Array.isArray(e)&&null!==e}),"must be an object (not an array or null)"),It=d((function(t){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t)||/^[0-9a-f]{36}$/i.test(t)}),"must be a valid UUID or a 36-character hexadecimal string"),Mt=o(685),Dt=(0,Mt.createGlobalStore)("config-internal",{providedConfigs:[],schemas:{},moduleLoaded:{}}),Rt=(0,Mt.createGlobalStore)("temporary-config",{config:function(){try{return JSON.parse(localStorage.getItem("openmrs:temporaryConfig")||"{}")}catch(t){return{}}}()});Rt.subscribe((function(t){var e;e=t.config,localStorage.setItem("openmrs:temporaryConfig",JSON.stringify(e))}));var Nt=(0,Mt.createGlobalStore)("config-store-of-extension-state",{mountedExtensions:[]}),Lt=(0,Mt.createGlobalStore)("config-implementer-tools",{config:{}});function Ut(t){return t.hasOwnProperty("_default")?j(x({},t),{_value:t._default,_source:"default"}):X(t)?Object.keys(t).reduce((function(e,n){return e[n]=Ut(t[n]),e}),{}):{}}function Bt(t,e){return X(t)?Object.keys(t).reduce((function(n,r){return n[r]=Bt(t[r],e),n}),{}):{_value:t,_source:e}}function Ft(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r="Please verify that you are running the latest version and, if so, alert the maintainer.",o=!0,i=!1,a=void 0;try{for(var u,s=function(){var o=u.value,i=n+(n&&".")+o,a=e[o];if("Display conditions"===i&&console.error("".concat(t,' declares a configuration option called "Display conditions"; the "Display conditions" option is a reserved name. ').concat(r)),"Translation overrides"===i&&console.error("".concat(t,' declares a configuration option called "Translation overrides"; the "Translation overrides" option is a reserved name. ').concat(r)),!X(a))return console.error("".concat(t," has bad config schema definition for key '").concat(i,"'. ").concat(r)),"continue";a.hasOwnProperty("_default")||Ft(t,a,i);var s=a._elements;if(Q(s)&&Ft(t,s,i+"._elements"),a._validators){var c=!0,l=!1,f=void 0;try{for(var h,p=a._validators[Symbol.iterator]();!(c=(h=p.next()).done);c=!0){var d=h.value;"function"!=typeof d&&console.error("".concat(t," has invalid validator for key '").concat(i,"' ").concat(r,".")+"\n\nIf you're the maintainer: validators must be functions that return either "+"undefined or an error string. Received ".concat(d,"."))}}catch(t){l=!0,f=t}finally{try{c||null==p.return||p.return()}finally{if(l)throw f}}}var v=a._type;v&&!Object.values(gt).includes(v)&&console.error("".concat(t," has invalid type for key '").concat(i,"' ").concat(r,".")+"\n\nIf you're the maintainer: the allowed types are ".concat(Object.values(gt).join(", "),". ")+"Received '".concat(v,"'")),Object.keys(a).every((function(t){return["_description","_validators","_elements","_type"].includes(t)}))&&!n.includes("._elements")&&console.error("".concat(t," has bad config schema definition for key '").concat(i,"'. ").concat(r,".")+"\n\nIf you're the maintainer: all config elements must have a default. "+"Received ".concat(JSON.stringify(a))),s&&v&&![gt.Array,gt.Object].includes(v)&&console.error("".concat(t," has bad config schema definition for key '").concat(i,"'. ").concat(r,".")+"\n\nIf you're the maintainer: the 'elements' key only works with '_type' equal to 'Array' or 'Object'. "+"Received ".concat(JSON.stringify(v)))},c=Object.keys(e).filter((function(t){return!t.startsWith("_")}))[Symbol.iterator]();!(o=(u=c.next()).done);o=!0)s()}catch(t){i=!0,a=t}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}}function zt(t,e,n){J(n,t._type,e),X(e)?t._type===gt.Object?function(t,e,n){if(t._elements){var r=!0,o=!1,i=void 0;try{for(var a,u=Object.keys(e)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=a.value,c=e[s];q(t._elements,c,"".concat(n,".").concat(s))}}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}}(t,e,n):t.hasOwnProperty("_default")||t.hasOwnProperty("_type")||q(t,e,n):t._type===gt.Array&&function(t,e,n){if(Q(t._elements))for(var r=0;r<e.length;r++)zt(t._elements,e[r],"".concat(n,"[").concat(r,"]"));for(var o=0;o<e.length;o++){var i;J("".concat(n,"[").concat(o,"]"),null===(i=t._elements)||void 0===i?void 0:i._type,e[o])}}(t,e,n)}function Vt(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(t)if(e!==t._default&&Y(n,t._validators,e),X(e)){var r=!0,o=!1,i=void 0;try{for(var a,u=Object.keys(e)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=a.value,c=e[s],l=n+"."+s,f=t[s];t._type===gt.Object&&t._elements?Vt(t._elements,c,l):Vt(f,c,l)}}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}else if(Array.isArray(e)&&t._elements)for(var h=0;h<e.length;h++)Vt(t._elements,e[h],"".concat(n,"[").concat(h,"]"))}k(Dt.getState(),Rt.getState()),Dt.subscribe((function(t){return k(t,Rt.getState())})),Rt.subscribe((function(t){return k(Dt.getState(),t)})),C(Dt.getState(),Rt.getState()),Dt.subscribe((function(t){return C(t,Rt.getState())})),Rt.subscribe((function(t){return C(Dt.getState(),t)})),T(Dt.getState(),Rt.getState()),Dt.subscribe((function(t){return T(t,Rt.getState())})),Rt.subscribe((function(t){return T(Dt.getState(),t)})),I(Dt.getState(),Nt.getState(),Rt.getState()),Dt.subscribe((function(t){I(t,Nt.getState(),Rt.getState())})),Nt.subscribe((function(t){I(Dt.getState(),t,Rt.getState())})),Rt.subscribe((function(t){I(Dt.getState(),Nt.getState(),t)}));var Ht=function(t,e){var n=bt(e);if(!t)return n;var r=!0,o=!1,i=void 0;try{for(var a,u=function(){var e=a.value,r=n[e],o=t[e];if(o&&(o.hasOwnProperty("_type")||o.hasOwnProperty("_default"))){n.hasOwnProperty(e)||(n[e]=o._default);var i=o._elements;if(r&&Q(i))if(o._type===gt.Array&&Array.isArray(r)){var u=r.map((function(t){return Ht(i,t)}));n[e]=u}else if(o._type===gt.Object){var s=!0,c=!1,l=void 0;try{for(var f,h=Object.keys(r)[Symbol.iterator]();!(s=(f=h.next()).done);s=!0){var p=f.value;r[p]=Ht(i,r[p])}}catch(t){c=!0,l=t}finally{try{s||null==h.return||h.return()}finally{if(c)throw l}}}}else if(X(o)){var d=null!=r?r:{};X(d)&&(n[e]=Ht(o,d))}},s=Object.keys(t)[Symbol.iterator]();!(r=(a=s.next()).done);r=!0)u()}catch(t){o=!0,i=t}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n},Gt=new Set,Wt={"Translation overrides":{_description:"Per-language overrides for frontend translations should be keyed by language code and each language dictionary contains the translation key and the display value",_type:gt.Object,_default:{},_validators:[d((function(t){return Object.keys(t).every((function(t){return/^[a-z]{2,3}(-[A-Z]{2,3})?$/.test(t)}))}),(function(t){var e=Object.keys(t).filter((function(t){return!/^[a-z]{2,3}(-[A-Z]{2,3})?$/.test(t)}));return"The 'Translation overrides' object should have language codes for keys. Language codes must be in the form of a two-to-three letter language code optionally followed by a hyphen and a two-to-three letter country code. The following keys do not conform: ".concat(e.join(", "),".")}))]}},Kt=x({"Display conditions":{privileges:{_description:"The privilege(s) the user must have to use this extension",_type:gt.Array,_default:[]}}},Wt),$t=function(t,e){return d((function(n){return t<=n&&n<=e}),"must be between ".concat(t," and ").concat(e))},qt=function(t){var e=t.concat(["openmrsBase","openmrsSpaBase"]);return d((function(t){if(!t||"string"!=typeof t)return!1;for(var n=/\${(.*?)}/g,r=n.exec(t);r;){if(!e.includes(r[1]))return!1;r=n.exec(t)}return!0}),"Should be a URL or path. The allowed template parameters are "+e.map((function(t){return"${"+t+"}"})).join(", "))},Jt=qt([]),Yt=function(t){return d((function(e){return t.includes(e)}),"Must be one of the following: '".concat(t.join("', '"),"'."))},Qt={inRange:$t,isUrl:Jt,isUrlWithTemplateParameters:qt,oneOf:Yt}}(),i}())}}}))},5863:()=>{function t(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}System.register(["@openmrs/esm-globals","@openmrs/esm-translations"],(function(e,n){var r={},o={};return{setters:[function(t){r.dispatchToastShown=t.dispatchToastShown},function(t){o.getCoreTranslation=t.getCoreTranslation}],execute:function(){e(function(){"use strict";var e={728:function(t){t.exports=r},901:function(t){t.exports=o}},n={};function i(t){var r=n[t];if(void 0!==r)return r.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,i),o.exports}i.d=function(t,e){for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},function(){i.S={};var t={},e={};i.I=function(n,r){r||(r=[]);var o=e[n];if(o||(o=e[n]={}),!(r.indexOf(o)>=0)){if(r.push(o),t[n])return t[n];i.o(i.S,n)||(i.S[n]={}),i.S[n];var a=[];return t[n]=a.length?Promise.all(a).then((function(){return t[n]=1})):1}}}();var a={};return function(){var e=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},n=function(t){return function(){var n=this,r=arguments;return new Promise((function(o,i){var a=t.apply(n,r);function u(t){e(a,o,i,u,s,"next",t)}function s(t){e(a,o,i,u,s,"throw",t)}u(void 0)}))}},r=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},o=function(t){return t.replace(/[\/\-@]/g,"_")},u=function(t){return h.apply(this,arguments)},s=function(t,e){return p.apply(this,arguments)},c=function(){return d.apply(this,arguments)};i.r(a),i.d(a,{getCurrentImportMap:function(){return c},importDynamic:function(){return u},preloadImport:function(){return s},slugify:function(){return o}});var l=i(728),f=i(901);function h(){return h=n((function(e){var n,a,u,c,l,f,h,p,d,v,y=arguments;return r(this,(function(r){switch(r.label){case 0:return n=y.length>1&&void 0!==y[1]?y[1]:"./start",u=!(null==(a=y.length>2?y[2]:void 0)?void 0:a.maxLoadingTime)||a.maxLoadingTime<=0?6e5:a.maxLoadingTime,c=void 0,[4,Promise.race([s(e,null==a?void 0:a.importMap),new Promise((function(t,n){c=setTimeout((function(){var t;n(new Error("Could not resolve requested script, ".concat(e,", within ").concat((t=u)<1e3?"".concat(t," milliseconds"):t<6e4?"".concat(Math.floor(t/1e3)," seconds"):t<36e5?"".concat(Math.floor(t/6e4)," minutes"):t<864e5?"".concat(Math.floor(t/36e5)," hours"):"".concat(Math.floor(t/864e5)," days"),".")))}),u)}))])];case 1:if(r.sent(),c&&clearTimeout(c),l=o(e),"object"!=t(m=f=window[l])||null===m||!("init"in m)||"function"!=typeof m.init||!("get"in m)||"function"!=typeof m.get)throw h="The global variable ".concat(l," does not refer to a federated module"),console.error(h),new Error(h);return f.init(i.S.default),[4,f.get(n)];case 2:if(p=r.sent(),"object"!=t(d=p())||null===d)throw v="Container for ".concat(e," did not return an ESM module as expected"),console.error(v),new Error(v);return[2,d]}var m}))})),h.apply(this,arguments)}function p(){return(p=n((function(t,e){var n,i,a,u,s,h,p,d;return r(this,(function(r){switch(r.label){case 0:if("string"!=typeof t||0===t.trim().length)throw n="Attempted to call importDynamic() without supplying a package to load",console.error(n),new Error(n);return i=o(t),window[i]?[3,7]:null==e?[3,1]:(u=e,[3,3]);case 1:return[4,c()];case 2:u=r.sent(),r.label=3;case 3:if(!(a=u).imports.hasOwnProperty(t))throw s="Could not find the package ".concat(t," defined in the current importmap"),console.error(s),new Error(s);(h=a.imports[t]).startsWith("./")&&(h=window.spaBase+h.substring(1)),p=!!window.localStorage.getItem("import-map-override:".concat(t)),r.label=4;case 4:return r.trys.push([4,6,,7]),[4,new Promise((function(t,e){!function(t,e,n){var r=document.head.querySelector('script[src="'.concat(t,'"]')),o=window[v];if(o||(o=window[v]=new Set([])),r){var i,a,u;o.has(t)?(u=function(){i&&r.removeEventListener("load",i),a&&r.removeEventListener("error",a)},i=function(){u(),e(null)},a=function(t){u(),n(t.message)},r.addEventListener("load",i),r.addEventListener("error",a)):(console.warn("Script at ".concat(t," already loaded. Not loading it again.")),e(null))}else{o.add(t);var s=document.createElement("script");s.src=t,s.type="text/javascript",s.async=!0;var c,l,f,h=setTimeout((function(){console.error("The script at ".concat(t," did not load within 5 seconds. This may indicate an issue with the imports in the script's entry-point file or with the script's bundler configuration."))}),5e3);f=function(){clearTimeout(h),o.delete(t),c&&s.removeEventListener("load",c),l&&s.removeEventListener("error",l)},c=function(){f(),e(null)},l=function(e){f();var r,o="Failed to load script from ".concat(t);console.error(o,e),n(null!==(r=e.message)&&void 0!==r?r:o)},s.addEventListener("load",c),s.addEventListener("error",l),document.head.appendChild(s)}}(h,t,e)}))];case 5:return[2,r.sent()];case 6:return d=r.sent(),p&&(0,l.dispatchToastShown)({kind:"error",title:(0,f.getCoreTranslation)("scriptLoadingFailed","Error: Script failed to load"),description:(0,f.getCoreTranslation)("scriptLoadingError","Failed to load overridden script from {{- url}}. Please check that the bundled script is available at the expected URL. Click the button below to reset all import map overrides.",{url:h}),actionButtonLabel:(0,f.getCoreTranslation)("resetOverrides","Reset overrides"),onActionButtonClick:function(){window.importMapOverrides.resetOverrides(),window.location.reload()}}),[2,Promise.reject(d)];case 7:return[2,Promise.resolve()]}}))}))).apply(this,arguments)}function d(){return(d=n((function(){return r(this,(function(t){return[2,window.importMapOverrides.getCurrentPageMap()]}))}))).apply(this,arguments)}var v=Symbol("__openmrs_script_loading")}(),a}())}}}))},9425:()=>{System.register(["@openmrs/esm-globals"],(function(t,e){var n={};return{setters:[function(t){n.dispatchToastShown=t.dispatchToastShown}],execute:function(){t(function(){"use strict";var t={728:function(t){t.exports=n}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return function(){var t=function(t){var e=n(t);setTimeout((function(){throw e}))},e=function(){var e=Error();return function(r){n(r).stack+="\nAsync stacktrace:\n".concat(e.stack),t(r)}},n=function(t){var e,n,r,o,i,a;if(n=t,null!=(r=Error)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):(o=n,null!=(i=r)&&"undefined"!=typeof Symbol&&i[Symbol.hasInstance]?i[Symbol.hasInstance](o):o instanceof i))return t;if(null===t)return Error("'null' was thrown as an error");if("object"==(void 0===t?"undefined":(a=t)&&"undefined"!=typeof Symbol&&a.constructor===Symbol?"symbol":typeof a)){try{e="Object thrown as error: ".concat(JSON.stringify(t))}catch(n){e="Object thrown as error with the following properties: ".concat(Object.keys(t))}return Error(e)}return void 0===t?Error("'undefined' was thrown as an error"):Error(t.toString())};r.r(o),r.d(o,{createErrorHandler:function(){return e},reportError:function(){return t}});var i=r(728);window.onerror=function(t){return console.error("Unexpected error: ",t),(0,i.dispatchToastShown)({description:null!=t?t:"Oops! An unexpected error occurred.",kind:"error",title:"Error"}),!1},window.onunhandledrejection=function(t){var e;console.error("Unhandled rejection: ",t.reason),(0,i.dispatchToastShown)({description:null!==(e=t.reason)&&void 0!==e?e:"Oops! An unhandled promise rejection occurred.",kind:"error",title:"Error"})}}(),o}())}}}))},6133:(t,e,n)=>{function r(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}function o(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}t=n.nmd(t),System.register(["@openmrs/esm-config","@openmrs/esm-state","@openmrs/esm-api","@openmrs/esm-feature-flags","@openmrs/esm-utils","single-spa"],(function(i,a){var u={},s={},c={},l={},f={},h={};return{setters:[function(t){u.configExtensionStore=t.configExtensionStore,u.getExtensionConfigFromStore=t.getExtensionConfigFromStore,u.getExtensionSlotConfig=t.getExtensionSlotConfig,u.getExtensionSlotConfigFromStore=t.getExtensionSlotConfigFromStore,u.getExtensionSlotsConfigStore=t.getExtensionSlotsConfigStore,u.getExtensionsConfigStore=t.getExtensionsConfigStore},function(t){s.createGlobalStore=t.createGlobalStore,s.getGlobalStore=t.getGlobalStore},function(t){c.getSessionStore=t.getSessionStore,c.userHasAccess=t.userHasAccess},function(t){l.featureFlagsStore=t.featureFlagsStore},function(t){f.isOnline=t.isOnline},function(t){h.mountRootParcel=t.mountRootParcel}],execute:function(){i(function(){"use strict";var i={766:function(t){t.exports=c},824:function(t){t.exports=u},708:function(t){t.exports=l},685:function(t){t.exports=s},618:function(t){t.exports=f},645:function(t){t.exports=h}},a={};function p(t){var e=a[t];if(void 0!==e)return e.exports;var n=a[t]={exports:{}};return i[t](n,n.exports,p),n.exports}p.d=function(t,e){for(var n in e)p.o(e,n)&&!p.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},p.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},p.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var d={};return function(){var i=function(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}},a=function(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}},u=function(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}},s=function(t){var e=this.__data__=new W(t);this.size=e.size},c=function(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Ot;++e<n;)this.add(t[e])},l=function(t){var e=Re.getState(),n=t(e);n!==e&&Re.setState(n)},f=function(t){var e=[],n=!0,r=!1,o=void 0;try{for(var i,a=Object.values(t.extensions)[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var u=i.value,s=!0,c=!1,l=void 0;try{for(var f,h=u.instances[Symbol.iterator]();!(s=(f=h.next()).done);s=!0){var p=f.value;e.push({slotModuleName:p.slotModuleName,extensionModuleName:u.moduleName,slotName:p.slotName,extensionId:p.id})}}catch(t){c=!0,l=t}finally{try{s||null==h.return||h.return()}finally{if(c)throw l}}}}catch(t){r=!0,o=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}Ie(Me.configExtensionStore.getState().mountedExtensions,e)||Me.configExtensionStore.setState({mountedExtensions:e})},h=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},v=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},y=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){v(t,e,n[e])}))}return t},m=function(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n.push.apply(n,r)}return n}(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},g=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t,e)||w(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},b=function(t){return function(t){if(Array.isArray(t))return h(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||w(t)||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.")}()},w=function(t,e){if(t){if("string"==typeof t)return h(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(t,e):void 0}},S=function(t,e,n){var r={},o=!0,i=!1,a=void 0;try{for(var u,s=Object.entries(t.slots)[Symbol.iterator]();!(o=(u=s.next()).done);o=!0){var c=g(u.value,2),l=c[0],f=c[1],h=C(l,t,(0,Me.getExtensionSlotConfigFromStore)(e,f.name).config,n);r[l]={moduleName:f.moduleName,assignedExtensions:h}}}catch(t){i=!0,a=t}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}Ie(He.getState().slots,r)||He.setState({slots:r})},O=function(t,e){return{moduleName:e,name:t,attachedIds:[],config:null}},E=function(t){return g(t.split("#"),1)[0]},x=function(t,e){var n=E(e);return t.extensions[n]},j=function(t){return x(Ve.getState(),t)},P=function(t,e){l((function(n){var r=n.slots[t];return m(y({},n),r?{slots:m(y({},n.slots),v({},t,m(y({},r),{attachedIds:b(r.attachedIds).concat([e])})))}:{slots:m(y({},n.slots),v({},t,m(y({},O(t)),{attachedIds:[e]})))})}))},_=function(t,e){l((function(n){var r=n.slots[t];return r&&r.attachedIds.includes(e)?m(y({},n),{slots:m(y({},n.slots),v({},t,m(y({},r),{attachedIds:r.attachedIds.filter((function(t){return t!==e}))})))}):n}))},A=function(t){l((function(e){var n=e.slots[t];return n?m(y({},e),{slots:m(y({},e.slots),v({},t,m(y({},n),{attachedIds:[]})))}):e}))},k=function(t,e,n,r){var o=e.indexOf(t);if(-1!==o)return o;if(void 0!==n)return 1e3+n;var i=r.indexOf(t);return-1!==i?2e3+i:-1},T=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=(0,Fe.isOnline)(null!=e?e:void 0),o=null!=n?n:Object.entries(Be.featureFlagsStore.getState().flags).filter((function(t){return g(t,2)[1].enabled})).map((function(t){return g(t,1)[0]}));return t.filter((function(t){return!window.offlineEnabled||D(r,t.online,t.offline)})).filter((function(t){return void 0===t.featureFlag||(null==o?void 0:o.includes(t.featureFlag))}))},C=function(t,e,n,r){var o=function(t,e){var n=t.add||[],r=t.remove||[],o=t.order||[],i=Ve.getState().extensions;return b(e).concat(b(n)).filter((function(t){return!r.includes(t)})).sort((function(t,n){var r,a,u=k(t,o,null===(r=i[E(t)])||void 0===r?void 0:r.order,e),s=k(n,o,null===(a=i[E(n)])||void 0===a?void 0:a.order,e);return-1===s?-1:-1===u?1:u-s}))}(n,e.slots[t].attachedIds),i=[],a=void 0,u=!0,s=!1,c=void 0;try{for(var l,f=o[Symbol.iterator]();!(u=(l=f.next()).done);u=!0){var h=l.value,p=(0,Me.getExtensionConfigFromStore)(r,t,h).config,d=E(h),v=e.extensions[d];if(v){var y,m,g,w,S,O,x,j,P,_=null!==(S=null!==(w=null==p||null===(y=p["Display conditions"])||void 0===y?void 0:y.privileges)&&void 0!==w?w:v.privileges)&&void 0!==S?S:[];if(_&&("string"==typeof _||Array.isArray(_)&&_.length>0)){var A;if(ze(a)&&(a=null===(A=(0,Ue.getSessionStore)().getState().session)||void 0===A?void 0:A.user),!a)continue;if(!(0,Ue.userHasAccess)(_,a))continue}i.push({id:h,name:d,moduleName:v.moduleName,config:p,featureFlag:v.featureFlag,meta:v.meta,online:null===(x=null!==(O=null==p||null===(m=p["Display conditions"])||void 0===m?void 0:m.online)&&void 0!==O?O:v.online)||void 0===x||x,offline:null!==(P=null!==(j=null==p||null===(g=p["Display conditions"])||void 0===g?void 0:g.offline)&&void 0!==j?j:v.offline)&&void 0!==P&&P})}}}catch(t){s=!0,c=t}finally{try{u||null==f.return||f.return()}finally{if(s)throw c}}return i},I=function(t){return C(t,Ve.getState(),(0,Me.getExtensionSlotConfig)(t).config,We.getState())},M=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return D((0,Fe.isOnline)(),t,e)},D=function(t){return Boolean(t?!(arguments.length>1&&void 0!==arguments[1])||arguments[1]:arguments.length>2&&void 0!==arguments[2]&&arguments[2])},R=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},N=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},L=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},U=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){L(t,e,n[e])}))}return t},B=function(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n.push.apply(n,r)}return n}(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},F=function(t,e,n,r){return Qe.apply(this,arguments)};p.r(d),p.d(d,{attach:function(){return P},checkStatus:function(){return M},checkStatusFor:function(){return D},detach:function(){return _},detachAll:function(){return A},extensionStore:function(){return Xe},getAssignedExtensions:function(){return I},getConnectedExtensions:function(){return T},getExtensionInternalStore:function(){return Ne},getExtensionNameFromId:function(){return E},getExtensionRegistration:function(){return j},getExtensionRegistrationFrom:function(){return x},getExtensionStore:function(){return Le},registerExtension:function(){return Ke},registerExtensionSlot:function(){return $e},renderExtension:function(){return F},reset:function(){return qe},updateInternalExtensionStore:function(){return l}});var z=function(t,e){return t===e||t!=t&&e!=e},V=function(t,e){for(var n=t.length;n--;)if(z(t[n][0],e))return n;return-1},H=Array.prototype.splice;i.prototype.clear=function(){this.__data__=[],this.size=0},i.prototype.delete=function(t){var e=this.__data__,n=V(e,t);return!(n<0||(n==e.length-1?e.pop():H.call(e,n,1),--this.size,0))},i.prototype.get=function(t){var e=this.__data__,n=V(e,t);return n<0?void 0:e[n][1]},i.prototype.has=function(t){return V(this.__data__,t)>-1},i.prototype.set=function(t,e){var n=this.__data__,r=V(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var G,W=i,K="object"==(void 0===n.g?"undefined":o(n.g))&&n.g&&n.g.Object===Object&&n.g,$="object"==("undefined"==typeof self?"undefined":o(self))&&self&&self.Object===Object&&self,q=K||$||Function("return this")(),J=q.Symbol,Y=Object.prototype,Q=Y.hasOwnProperty,X=Y.toString,Z=J?J.toStringTag:void 0,tt=Object.prototype.toString,et=J?J.toStringTag:void 0,nt=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":et&&et in Object(t)?function(t){var e=Q.call(t,Z),n=t[Z];try{t[Z]=void 0;var r=!0}catch(t){}var o=X.call(t);return r&&(e?t[Z]=n:delete t[Z]),o}(t):function(t){return tt.call(t)}(t)},rt=function(t){var e=void 0===t?"undefined":o(t);return null!=t&&("object"==e||"function"==e)},ot=function(t){if(!rt(t))return!1;var e=nt(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},it=q["__core-js_shared__"],at=(G=/[^.]+$/.exec(it&&it.keys&&it.keys.IE_PROTO||""))?"Symbol(src)_1."+G:"",ut=Function.prototype.toString,st=function(t){if(null!=t){try{return ut.call(t)}catch(t){}try{return t+""}catch(t){}}return""},ct=/^\[object .+?Constructor\]$/,lt=Function.prototype,ft=Object.prototype,ht=lt.toString,pt=ft.hasOwnProperty,dt=RegExp("^"+ht.call(pt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),vt=function(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!rt(t)||(e=t,at&&at in e))&&(ot(t)?dt:ct).test(st(t));var e}(n)?n:void 0},yt=vt(q,"Map"),mt=vt(Object,"create"),gt=Object.prototype.hasOwnProperty,bt=Object.prototype.hasOwnProperty;a.prototype.clear=function(){this.__data__=mt?mt(null):{},this.size=0},a.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},a.prototype.get=function(t){var e=this.__data__;if(mt){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return gt.call(e,t)?e[t]:void 0},a.prototype.has=function(t){var e=this.__data__;return mt?void 0!==e[t]:bt.call(e,t)},a.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=mt&&void 0===e?"__lodash_hash_undefined__":e,this};var wt=a,St=function(t,e){var n,r,i=t.__data__;return("string"==(r=o(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map};u.prototype.clear=function(){this.size=0,this.__data__={hash:new wt,map:new(yt||W),string:new wt}},u.prototype.delete=function(t){var e=St(this,t).delete(t);return this.size-=e?1:0,e},u.prototype.get=function(t){return St(this,t).get(t)},u.prototype.has=function(t){return St(this,t).has(t)},u.prototype.set=function(t,e){var n=St(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};var Ot=u;s.prototype.clear=function(){this.__data__=new W,this.size=0},s.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},s.prototype.get=function(t){return this.__data__.get(t)},s.prototype.has=function(t){return this.__data__.has(t)},s.prototype.set=function(t,e){var n=this.__data__;if(r(n,W)){var o=n.__data__;if(!yt||o.length<199)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new Ot(o)}return n.set(t,e),this.size=n.size,this};var Et=s;c.prototype.add=c.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},c.prototype.has=function(t){return this.__data__.has(t)};var xt=c,jt=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1},Pt=function(t,e,n,r,o,i){var a=1&n,u=t.length,s=e.length;if(u!=s&&!(a&&s>u))return!1;var c=i.get(t),l=i.get(e);if(c&&l)return c==e&&l==t;var f=-1,h=!0,p=2&n?new xt:void 0;for(i.set(t,e),i.set(e,t);++f<u;){var d=t[f],v=e[f];if(r)var y=a?r(v,d,f,e,t,i):r(d,v,f,t,e,i);if(void 0!==y){if(y)continue;h=!1;break}if(p){if(!jt(e,(function(t,e){if(a=e,!p.has(a)&&(d===t||o(d,t,n,r,i)))return p.push(e);var a}))){h=!1;break}}else if(d!==v&&!o(d,v,n,r,i)){h=!1;break}}return i.delete(t),i.delete(e),h},_t=q.Uint8Array,At=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n},kt=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n},Tt=J?J.prototype:void 0,Ct=Tt?Tt.valueOf:void 0,It=Array.isArray,Mt=Object.prototype.propertyIsEnumerable,Dt=Object.getOwnPropertySymbols,Rt=Dt?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var a=t[n];e(a)&&(i[o++]=a)}return i}(Dt(t),(function(e){return Mt.call(t,e)})))}:function(){return[]},Nt=function(t){return null!=t&&"object"==(void 0===t?"undefined":o(t))},Lt=function(t){return Nt(t)&&"[object Arguments]"==nt(t)},Ut=Object.prototype,Bt=Ut.hasOwnProperty,Ft=Ut.propertyIsEnumerable,zt=Lt(function(){return arguments}())?Lt:function(t){return Nt(t)&&Bt.call(t,"callee")&&!Ft.call(t,"callee")},Vt=zt,Ht="object"==o(e)&&e&&!e.nodeType&&e,Gt=Ht&&"object"==o(t)&&t&&!t.nodeType&&t,Wt=Gt&&Gt.exports===Ht?q.Buffer:void 0,Kt=(Wt?Wt.isBuffer:void 0)||function(){return!1},$t=/^(?:0|[1-9]\d*)$/,qt=function(t,e){var n=void 0===t?"undefined":o(t);return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&$t.test(t))&&t>-1&&t%1==0&&t<e},Jt=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},Yt={};Yt["[object Float32Array]"]=Yt["[object Float64Array]"]=Yt["[object Int8Array]"]=Yt["[object Int16Array]"]=Yt["[object Int32Array]"]=Yt["[object Uint8Array]"]=Yt["[object Uint8ClampedArray]"]=Yt["[object Uint16Array]"]=Yt["[object Uint32Array]"]=!0,Yt["[object Arguments]"]=Yt["[object Array]"]=Yt["[object ArrayBuffer]"]=Yt["[object Boolean]"]=Yt["[object DataView]"]=Yt["[object Date]"]=Yt["[object Error]"]=Yt["[object Function]"]=Yt["[object Map]"]=Yt["[object Number]"]=Yt["[object Object]"]=Yt["[object RegExp]"]=Yt["[object Set]"]=Yt["[object String]"]=Yt["[object WeakMap]"]=!1;var Qt,Xt="object"==o(e)&&e&&!e.nodeType&&e,Zt=Xt&&"object"==o(t)&&t&&!t.nodeType&&t,te=Zt&&Zt.exports===Xt&&K.process,ee=function(){try{return Zt&&Zt.require&&Zt.require("util").types||te&&te.binding&&te.binding("util")}catch(t){}}(),ne=ee&&ee.isTypedArray,re=ne?(Qt=ne,function(t){return Qt(t)}):function(t){return Nt(t)&&Jt(t.length)&&!!Yt[nt(t)]},oe=Object.prototype.hasOwnProperty,ie=Object.prototype,ae=function(t,e){return function(n){return t(e(n))}}(Object.keys,Object),ue=Object.prototype.hasOwnProperty,se=function(t){return null!=(e=t)&&Jt(e.length)&&!ot(e)?function(t,e){var n=It(t),r=!n&&Vt(t),o=!n&&!r&&Kt(t),i=!n&&!r&&!o&&re(t),a=n||r||o||i,u=a?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],s=u.length;for(var c in t)!oe.call(t,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||qt(c,s))||u.push(c);return u}(t):function(t){if(n=(e=t)&&e.constructor,e!==("function"==typeof n&&n.prototype||ie))return ae(t);var e,n,r=[];for(var o in Object(t))ue.call(t,o)&&"constructor"!=o&&r.push(o);return r}(t);var e},ce=function(t){return function(t,e,n){var r=e(t);return It(t)?r:function(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}(r,n(t))}(t,se,Rt)},le=Object.prototype.hasOwnProperty,fe=vt(q,"DataView"),he=vt(q,"Promise"),pe=vt(q,"Set"),de=vt(q,"WeakMap"),ve="[object Map]",ye="[object Promise]",me="[object Set]",ge="[object WeakMap]",be="[object DataView]",we=st(fe),Se=st(yt),Oe=st(he),Ee=st(pe),xe=st(de),je=nt;(fe&&je(new fe(new ArrayBuffer(1)))!=be||yt&&je(new yt)!=ve||he&&je(he.resolve())!=ye||pe&&je(new pe)!=me||de&&je(new de)!=ge)&&(je=function(t){var e=nt(t),n="[object Object]"==e?t.constructor:void 0,r=n?st(n):"";if(r)switch(r){case we:return be;case Se:return ve;case Oe:return ye;case Ee:return me;case xe:return ge}return e});var Pe=je,_e="[object Arguments]",Ae="[object Array]",ke="[object Object]",Te=Object.prototype.hasOwnProperty,Ce=function t(e,n,o,i,a){return e===n||(null==e||null==n||!Nt(e)&&!Nt(n)?e!=e&&n!=n:function(t,e,n,o,i,a){var u=It(t),s=It(e),c=u?Ae:Pe(t),l=s?Ae:Pe(e),f=(c=c==_e?ke:c)==ke,h=(l=l==_e?ke:l)==ke,p=c==l;if(p&&Kt(t)){if(!Kt(e))return!1;u=!0,f=!1}if(p&&!f)return a||(a=new Et),u||re(t)?Pt(t,e,n,o,i,a):function(t,e,n,r,o,i,a){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!i(new _t(t),new _t(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return z(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var u=At;case"[object Set]":var s=1&r;if(u||(u=kt),t.size!=e.size&&!s)return!1;var c=a.get(t);if(c)return c==e;r|=2,a.set(t,e);var l=Pt(u(t),u(e),r,o,i,a);return a.delete(t),l;case"[object Symbol]":if(Ct)return Ct.call(t)==Ct.call(e)}return!1}(t,e,c,n,o,i,a);if(!(1&n)){var d=f&&Te.call(t,"__wrapped__"),v=h&&Te.call(e,"__wrapped__");if(d||v){var y=d?t.value():t,m=v?e.value():e;return a||(a=new Et),i(y,m,n,o,a)}}return!!p&&(a||(a=new Et),function(t,e,n,o,i,a){var u=1&n,s=ce(t),c=s.length;if(c!=ce(e).length&&!u)return!1;for(var l=c;l--;){var f=s[l];if(!(u?f in e:le.call(e,f)))return!1}var h=a.get(t),p=a.get(e);if(h&&p)return h==e&&p==t;var d=!0;a.set(t,e),a.set(e,t);for(var v=u;++l<c;){var y=t[f=s[l]],m=e[f];if(o)var g=u?o(m,y,f,e,t,a):o(y,m,f,t,e,a);if(!(void 0===g?y===m||i(y,m,n,o,a):g)){d=!1;break}v||(v="constructor"==f)}if(d&&!v){var b=t.constructor,w=e.constructor;b==w||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&r(b,b)&&"function"==typeof w&&r(w,w)||(d=!1)}return a.delete(t),a.delete(e),d}(t,e,n,o,i,a))}(e,n,o,i,t,a))},Ie=function(t,e){return Ce(t,e)},Me=p(824),De=p(685),Re=(0,De.createGlobalStore)("extensionsInternal",{slots:{},extensions:{}}),Ne=function(){return(0,De.getGlobalStore)("extensionsInternal",{slots:{},extensions:{}})},Le=function(){return(0,De.getGlobalStore)("extensions",{slots:{}})};f(Re.getState()),Re.subscribe(f);var Ue=p(766),Be=p(708),Fe=p(618),ze=function(t){return void 0===t},Ve=Ne(),He=Le(),Ge=(0,Me.getExtensionSlotsConfigStore)(),We=(0,Me.getExtensionsConfigStore)();Ve.subscribe((function(t){S(t,Ge.getState(),We.getState())})),Ge.subscribe((function(t){S(Ve.getState(),t,We.getState())})),We.subscribe((function(t){S(Ve.getState(),Ge.getState(),t)}));var Ke=function(t){return Ve.setState((function(e){return e.extensions[t.name]=m(y({},t),{instances:[]}),e}))},$e=function(t,e){return Ve.setState((function(n){var r,o=null===(r=n.slots[e])||void 0===r?void 0:r.moduleName;if(o&&o!=t)return console.warn("An extension slot with the name '".concat(e,'\' already exists. Refusing to register the same slot name twice (in "registerExtensionSlot"). The existing one is from module ').concat(o,".")),n;if(o&&o==t)return n;if(n.slots[e])return m(y({},n),{slots:m(y({},n.slots),v({},e,m(y({},n.slots[e]),{moduleName:t})))});var i=O(e,t);return m(y({},n),{slots:m(y({},n.slots),v({},e,i))})}))},qe=function(){return He.setState((function(){return{slots:{},extensions:{}}}))},Je=p(645),Ye=0;function Qe(){var t;return t=function(t,e,n,r){var o,i,a,u,s,c,f,h,p,d,v,y,m,g,b=arguments;return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(w){switch(w.label){case 0:if(o=b.length>4&&void 0!==b[4]?b[4]:function(t){return t},i=b.length>5&&void 0!==b[5]?b[5]:{},a=E(r),u=j(r),s=null,!t)return[3,3];if(!u)throw Error("Couldn't find extension '".concat(a,"' to attach to '").concat(e,"'"));return c=u.load,f=u.meta,h=u.moduleName,p=u.online,d=u.offline,M(p,d)?(l((function(o){var i,u={domElement:t,id:r,slotName:e,slotModuleName:n};return B(U({},o),{extensions:B(U({},o.extensions),L({},a,B(U({},o.extensions[a]),{instances:(i=o.extensions[a].instances,function(t){if(Array.isArray(t))return R(t)}(i)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(i)||function(t,e){if(t){if("string"==typeof t)return R(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?R(t,e):void 0}}(i)||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.")}()).concat([u])})))})})),[4,c()]):[3,2];case 1:v=w.sent(),y=v.default,m=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(v,["default"]),g=Ye++,s=(0,Je.mountRootParcel)(o(B(U({},null!=y?y:m),{name:"".concat(e,"/").concat(a,"-").concat(g)})),B(U({},i),{_meta:f,_extensionContext:{extensionId:r,extensionSlotName:e,extensionSlotModuleName:n,extensionModuleName:h},domElement:t})),w.label=2;case 2:return[3,4];case 3:console.warn("Tried to render ".concat(r," into ").concat(e," but no DOM element was available.")),w.label=4;case 4:return[2,s]}}))},Qe=function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){N(i,r,o,a,u,"next",t)}function u(t){N(i,r,o,a,u,"throw",t)}a(void 0)}))},Qe.apply(this,arguments)}var Xe=Ne()}(),d}())}}}))},2223:()=>{System.register(["@openmrs/esm-state"],(function(t,e){var n={};return{setters:[function(t){n.getGlobalStore=t.getGlobalStore}],execute:function(){t(function(){"use strict";var t={685:function(t){t.exports=n}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return function(){var t=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},e=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},n=function(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),o.forEach((function(n){e(t,n,r[n])}))}return t},i=function(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n.push.apply(n,r)}return n}(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},a=function(t,r,o){var a;h.setState((function(u){var s;return{flags:i(n({},u.flags),e({},t,{enabled:null!==(a=null===(s=u.flags[t])||void 0===s?void 0:s.enabled)&&void 0!==a&&a,label:r,description:o}))}}))},u=function(t){return h.getState().flags[t].enabled},s=function(t,e){h.subscribe((function(n){e(n.flags[t].enabled)}))},c=function(t,r){h.setState((function(o){return{flags:i(n({},o.flags),e({},t,i(n({},o.flags[t]),{enabled:r})))}}))};r.r(o),r.d(o,{featureFlagsStore:function(){return h},getFeatureFlag:function(){return u},registerFeatureFlag:function(){return a},setFeatureFlag:function(){return c},subscribeToFeatureFlag:function(){return s}});var l=r(685),f={flags:function(){var t={},e=!0,r=!1,o=void 0;try{for(var i,a=Object.keys(localStorage)[Symbol.iterator]();!(e=(i=a.next()).done);e=!0){var u=i.value;if(u.startsWith("openmrs:feature-flag:")){var s=u.replace("openmrs:feature-flag:",""),c=JSON.parse(localStorage.getItem("openmrs:feature-flag-meta:".concat(s))||"{}");t[s]=n({enabled:"true"===localStorage.getItem(u)},c)}}}catch(t){r=!0,o=t}finally{try{e||null==a.return||a.return()}finally{if(r)throw o}}return t}()},h=(0,l.getGlobalStore)("feature-flags",f);h.subscribe((function(e){var n,r=!0,o=!1,i=void 0;try{for(var a,u=Object.entries(e.flags)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=function(t){if(Array.isArray(t))return t}(n=a.value)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(n)||function(e,n){if(e){if("string"==typeof e)return t(e,2);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)?t(e,2):void 0}}(n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),c=s[0],l=s[1];localStorage.setItem("openmrs:feature-flag:".concat(c),l.enabled.toString()),localStorage.setItem("openmrs:feature-flag-meta:".concat(c),JSON.stringify({label:l.label,description:l.description}))}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}))}(),o}())}}}))},831:(t,e,n)=>{"use strict";n.r(e),n.d(e,{addRoutesOverride:()=>d.Ay,getCoreTranslation:()=>m.V,isOpenmrsAppRoutes:()=>d.Uz,isOpenmrsRoutes:()=>d.nX,localStorageRoutesPrefix:()=>d.ll,removeRoutesOverride:()=>d.p9,resetAllRoutesOverrides:()=>d.gM,translateFrom:()=>m.t});var r=n(6747),o={};for(const t in r)"default"!==t&&(o[t]=()=>r[t]);n.d(e,o);var i=n(7274);o={};for(const t in i)"default"!==t&&(o[t]=()=>i[t]);n.d(e,o);var a=n(5863);o={};for(const t in a)"default"!==t&&(o[t]=()=>a[t]);n.d(e,o);var u=n(9425);o={};for(const t in u)"default"!==t&&(o[t]=()=>u[t]);n.d(e,o);var s=n(6133);o={};for(const t in s)"default"!==t&&(o[t]=()=>s[t]);n.d(e,o);var c=n(2223);o={};for(const t in c)"default"!==t&&(o[t]=()=>c[t]);n.d(e,o);var l=n(2207);o={};for(const t in l)"default"!==t&&(o[t]=()=>l[t]);n.d(e,o);var f=n(4757);o={};for(const t in f)"default"!==t&&(o[t]=()=>f[t]);n.d(e,o);var h=n(6641);o={};for(const t in h)"default"!==t&&(o[t]=()=>h[t]);n.d(e,o);var p=n(973);o={};for(const t in p)"default"!==t&&(o[t]=()=>p[t]);n.d(e,o);var d=n(4999),v=n(5297);o={};for(const t in v)["default","addRoutesOverride","isOpenmrsAppRoutes","isOpenmrsRoutes","localStorageRoutesPrefix","removeRoutesOverride","resetAllRoutesOverrides"].indexOf(t)<0&&(o[t]=()=>v[t]);n.d(e,o);var y=n(5961);o={};for(const t in y)["default","addRoutesOverride","isOpenmrsAppRoutes","isOpenmrsRoutes","localStorageRoutesPrefix","removeRoutesOverride","resetAllRoutesOverrides"].indexOf(t)<0&&(o[t]=()=>y[t]);n.d(e,o);var m=n(8834),g=n(2238);o={};for(const t in g)["default","addRoutesOverride","isOpenmrsAppRoutes","isOpenmrsRoutes","localStorageRoutesPrefix","removeRoutesOverride","resetAllRoutesOverrides","getCoreTranslation","translateFrom"].indexOf(t)<0&&(o[t]=()=>g[t]);n.d(e,o)},2207:()=>{System.register([],(function(t,e){return{execute:function(){t(function(){"use strict";var t=function(t){window.dispatchEvent(new CustomEvent(v,{detail:{online:t}}))},e=function(t){if(!window.offlineEnabled)return function(){};var e=function(e){return t(e.detail)};return window.addEventListener(v,e),function(){return window.removeEventListener(v,e)}},n=function(t){return t({online:!window.offlineEnabled||navigator.onLine}),e(t)},r=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};window.dispatchEvent(new CustomEvent(y,{detail:t}))},o=function(t){var e=function(e){return t(e.detail)};return window.addEventListener(y,e),function(){return window.removeEventListener(y,e)}},i=function(t){window.dispatchEvent(new CustomEvent(m,{detail:t}))},a=function(t){window.dispatchEvent(new CustomEvent(g,{detail:t}))},u=function(t){window.dispatchEvent(new CustomEvent(w,{detail:t}))},s=function(t){window.dispatchEvent(new CustomEvent(b,{detail:t}))},c=function(t){var e=function(e){return t(e.detail)};return window.addEventListener(m,e),function(){return window.removeEventListener(m,e)}},l=function(t){var e=function(e){return t(e.detail)};return window.addEventListener(g,e),function(){return window.removeEventListener(g,e)}},f=function(t){var e=function(e){return t(e.detail)};return window.addEventListener(b,e),function(){return window.removeEventListener(b,e)}},h=function(t){var e=function(e){return t(e.detail)};return window.addEventListener(w,e),function(){return window.removeEventListener(w,e)}},p={d:function(t,e){for(var n in e)p.o(e,n)&&!p.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},d={};p.r(d),p.d(d,{dispatchActionableNotificationShown:function(){return a},dispatchConnectivityChanged:function(){return t},dispatchNotificationShown:function(){return i},dispatchPrecacheStaticDependencies:function(){return r},dispatchSnackbarShown:function(){return u},dispatchToastShown:function(){return s},subscribeActionableNotificationShown:function(){return l},subscribeConnectivity:function(){return n},subscribeConnectivityChanged:function(){return e},subscribeNotificationShown:function(){return c},subscribePrecacheStaticDependencies:function(){return o},subscribeSnackbarShown:function(){return h},subscribeToastShown:function(){return f}});var v="openmrs:connectivity-changed",y="openmrs:precache-static-dependencies",m="openmrs:notification-shown",g="openmrs:actionable-notification-shown",b="openmrs:toast-shown",w="openmrs:snack-bar-shown";return d}())}}}))},4757:(t,e,n)=>{function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}function a(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}System.register(["@openmrs/esm-state"],(function(t,e){var u={};return{setters:[function(t){u.createGlobalStore=t.createGlobalStore}],execute:function(){t(function(){"use strict";var t={685:function(t){t.exports=u}},e={};function s(n){var r=e[n];if(void 0!==r)return r.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,s),o.exports}s.d=function(t,e){for(var n in e)s.o(e,n)&&!s.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var c={};return function(){var t=function(t){return t.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")},e=function(t){return t&&t.sensitive?"":"i"},u=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},l=function(t){return function(t){if(Array.isArray(t))return u(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return u(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(t,e):void 0}}(t)||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.")}()},f=function(t){return e=t.matcher,(null!=(n=RegExp)&&"undefined"!=typeof Symbol&&n[Symbol.hasInstance]?n[Symbol.hasInstance](e):i(e,n))?t.matcher:"string"==typeof t.matcher?At(t.matcher):At(t.path);var e,n},h=function(t){return p([t])},p=function(t){var e=d(),n=t.map((function(t){return{matcher:f(t),settings:t}})),r=l(e).concat(l(n));kt.setState(r,!0)},d=function(){return kt.getState()},v=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},y=function(t,e){if(t.length>0){var n=Tt(t,e);if(n){for(var r=[n],o=Tt(t,n.settings.parent);void 0!==o;)r.push(o),o=Tt(t,o.settings.parent);return r.reverse()}}return[]},m=function(t){return y(d(),t)},g=function(t,e,n){var r=O(t,e,n);Rt.length?Rt.forEach((function(t){return t(r)})):setTimeout((function(){throw r}))},b=function(t){if("function"!=typeof t)throw Error(S(28,!1));Rt.push(t)},w=function(t){if("function"!=typeof t)throw Error(S(29,!1));var e=!1;return Rt=Rt.filter((function(n){var r=n===t;return e=e||r,!r})),e},S=function(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return"single-spa minified message #".concat(t,": ").concat(e?e+" ":"","See https://single-spa.js.org/error/?code=").concat(t).concat(r.length?"&arg=".concat(r.join("&arg=")):"")},O=function(t,e,n){var r,o="".concat(_(e)," '").concat(j(e),"' died in status ").concat(e.status,": ");if(i(t,Error)){try{t.message=o+t.message}catch(t){}r=t}else{console.warn(S(30,!1,e.status,j(e)));try{r=Error(o+JSON.stringify(t))}catch(e){r=t}}return r.appOrParcelName=j(e),e.status=n,r},E=function(t){return t.status===Vt},x=function(t){try{return t.activeWhen(window.location)}catch(e){return g(e,t,$t),!1}},j=function(t){return t.name},P=function(t){return Boolean(t.unmountThisParcel)},_=function(t){return P(t)?"parcel":"application"},A=function(){for(var t=arguments.length-1;t>0;t--)for(var e in arguments[t])"__proto__"!==e&&(arguments[t-1][e]=arguments[t][e]);return arguments[0]},k=function(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return t[n];return null},T=function(t){return t&&("function"==typeof t||(e=t,Array.isArray(e)&&!k(e,(function(t){return"function"!=typeof t}))));var e},C=function(t,e){var n=t[e]||[];0===(n=Array.isArray(n)?n:[n]).length&&(n=[function(){return Promise.resolve()}]);var r=_(t),o=j(t);return function(t){return n.reduce((function(n,i,a){return n.then((function(){var n=i(t);return I(n)?n:Promise.reject(S(15,!1,r,o,e,a))}))}),Promise.resolve())}},I=function(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch},M=function(t,e){return Promise.resolve().then((function(){return t.status!==Ut?t:(t.status=Bt,t.bootstrap?G(t,"bootstrap").then(n).catch((function(n){if(e)throw O(n,t,$t);return g(n,t,$t),t})):Promise.resolve().then(n))}));function n(){return t.status=Ft,t}},D=function(t,e){return Promise.resolve().then((function(){var n=function(){return G(t,"unmount").then((function(){t.status=Ft}),(function(n){if(e)throw O(n,t,$t);g(n,t,$t)}))};if(t.status!==Vt)return t;t.status=Gt;var r=Object.keys(t.parcels).map((function(e){return t.parcels[e].unmountThisParcel()}));return Promise.all(r).then(n,(function(r){return n().then((function(){var n=Error(r.message);if(e)throw O(n,t,$t);g(n,t,$t)}))})).then((function(){return t}))}))},R=function(t,e){return Promise.resolve().then((function(){return t.status!==Ft?t:(Jt||(window.dispatchEvent(new Dt("single-spa:before-first-mount")),Jt=!0),t.status=zt,G(t,"mount").then((function(){return t.status=Vt,Yt||(window.dispatchEvent(new Dt("single-spa:first-mount")),Yt=!0),t})).catch((function(n){var r=function(){if(e)throw O(n,t,$t);return g(n,t,$t),t};return t.status=Vt,D(t,!0).then(r,r)})))}))},N=function(){return L.apply(Xt,arguments)},L=function(t,e){var n=this;if(!t||"object"!=(void 0===t?"undefined":a(t))&&"function"!=typeof t)throw Error(S(2,!1));if(t.name&&"string"!=typeof t.name)throw Error(S(3,!1,a(t.name)));var r=Qt++,o=t.name||"parcel-".concat(r);if("object"!=(void 0===e?"undefined":a(e)))throw Error(S(4,!1,o,void 0===e?"undefined":a(e)));if(!e.domElement)throw Error(S(5,!1,o));var i,u="function"==typeof t,s=u?t:function(){return Promise.resolve(t)},c={id:r,parcels:{},status:u?Lt:Ut,customProps:e,parentName:j(n),unmountThisParcel:function(){return d.then((function(){if(c.status!==Vt)throw Error(S(6,!1,o,c.status));return D(c,!0)})).then((function(t){return c.parentName&&delete n.parcels[c.id],t})).then((function(t){return f(t),t})).catch((function(t){throw c.status=$t,h(t),t}))}};n.parcels[r]=c;var l=s();if(!l||"function"!=typeof l.then)throw Error(S(7,!1));l=l.then((function(t){if(!t)throw Error(S(8,!1));if(o=t.name||"parcel-".concat(r),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!T(t.bootstrap))throw Error(S(9,!1,o));if(!T(t.mount))throw Error(S(10,!1,o));if(!T(t.unmount))throw Error(S(11,!1,o));if(t.update&&!T(t.update))throw Error(S(12,!1,o));var e=C(t,"bootstrap"),n=C(t,"mount"),a=C(t,"unmount");c.status=Ut,c.name=o,c.bootstrap=e,c.mount=n,c.unmount=a,c.timeouts=W(t.timeouts),t.update&&(c.update=C(t,"update"),i.update=function(t){return c.customProps=t,U((e=c,Promise.resolve().then((function(){if(e.status!==Vt)throw Error(S(32,!1,j(e)));return e.status=Ht,G(e,"update").then((function(){return e.status=Vt,e})).catch((function(t){throw O(t,e,$t)}))}))));var e})}));var f,h,p=l.then((function(){return M(c,!0)})),d=p.then((function(){return R(c,!0)})),v=new Promise((function(t,e){f=t,h=e}));return i={mount:function(){return U(Promise.resolve().then((function(){if(c.status!==Ft)throw Error(S(13,!1,o,c.status));return n.parcels[r]=c,R(c)})))},unmount:function(){return U(c.unmountThisParcel())},getStatus:function(){return c.status},loadPromise:U(l),bootstrapPromise:U(p),mountPromise:U(d),unmountPromise:U(v)}},U=function(t){return t.then((function(){return null}))},B=function(t){var e=j(t),n="function"==typeof t.customProps?t.customProps(e,window.location):t.customProps;("object"!=(void 0===n?"undefined":a(n))||null===n||Array.isArray(n))&&(n={},console.warn(S(40,!1),e,n));var r=A({},n,{name:e,mountParcel:L.bind(t),singleSpa:It});return P(t)&&(r.unmountSelf=t.unmountThisParcel),r},F=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(S(16,!1));Zt.bootstrap={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},z=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(S(17,!1));Zt.mount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},V=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(S(18,!1));Zt.unmount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},H=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(S(19,!1));Zt.unload={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},G=function(t,e){var n=t.timeouts[e],r=n.warningMillis,o=_(t);return new Promise((function(i,a){var u=!1,s=!1;t[e](B(t)).then((function(t){u=!0,i(t)})).catch((function(t){u=!0,a(t)})),setTimeout((function(){return l(1)}),r),setTimeout((function(){return l(!0)}),n.millis);var c=S(31,!1,e,o,j(t),n.millis);function l(t){if(!u)if(!0===t)s=!0,n.dieOnTimeout?a(Error(c)):console.error(c);else if(!s){var e=t,o=e*r;console.warn(c),o+r<n.millis&&setTimeout((function(){return l(e+1)}),r)}}}))},W=function(t){var e={};for(var n in Zt)e[n]=A({},Zt[n],t&&t[n]||{});return e},K=function(t){return Promise.resolve().then((function(){return t.loadPromise?t.loadPromise:t.status!==Nt&&t.status!==Kt?t:(t.status=Lt,t.loadPromise=Promise.resolve().then((function(){var r=t.loadApp(B(t));if(!I(r))throw n=!0,Error(S(33,!1,j(t)));return r.then((function(n){var r;t.loadErrorTime=null,"object"!=(void 0===(e=n)?"undefined":a(e))&&(r=34),Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!T(e.bootstrap)&&(r=35),T(e.mount)||(r=36),T(e.unmount)||(r=37);var o=_(e);if(r){var i;try{i=JSON.stringify(e)}catch(t){}return console.error(S(r,!1,o,j(t),i),e),g(void 0,t,$t),t}return e.devtools&&e.devtools.overlays&&(t.devtools.overlays=A({},t.devtools.overlays,e.devtools.overlays)),t.status=Ut,t.bootstrap=C(e,"bootstrap"),t.mount=C(e,"mount"),t.unmount=C(e,"unmount"),t.unload=C(e,"unload"),t.timeouts=W(e.timeouts),delete t.loadPromise,t}))})).catch((function(e){var r;return delete t.loadPromise,n?r=$t:(r=Kt,t.loadErrorTime=(new Date).getTime()),g(e,t,r),t})));var e,n}))},$=function(t){var e;if("string"==typeof t)e=t;else if(this&&this.href)e=this.href;else{if(!(t&&t.currentTarget&&t.currentTarget.href&&t.preventDefault))throw Error(S(14,!1));e=t.currentTarget.href,t.preventDefault()}var n=X(window.location.href),r=X(e);0===e.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=e:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,e)},q=function(t){var e=this;if(t){var n=t[0].type;ne.indexOf(n)>=0&&ee[n].forEach((function(n){try{n.apply(e,t)}catch(t){setTimeout((function(){throw t}))}}))}},J=function(){he([],arguments)},Y=function(t,e){return function(){var n=window.location.href,r=t.apply(this,arguments),o=window.location.href;return Ct&&n===o||window.dispatchEvent(function(t,e){var n;try{n=new PopStateEvent("popstate",{state:t})}catch(e){(n=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,t)}return n.singleSpa=!0,n.singleSpaTrigger=e,n}(window.history.state,e)),r}},Q=function(t){if(oe)throw Error(S(43,!1));Ct=!t||!t.hasOwnProperty("urlRerouteOnly")||t.urlRerouteOnly,oe=!0,re=window.history.replaceState,window.addEventListener("hashchange",J),window.addEventListener("popstate",J);var e=window.addEventListener,n=window.removeEventListener;window.addEventListener=function(t,n){if(!("function"==typeof n&&ne.indexOf(t)>=0)||k(ee[t],(function(t){return t===n})))return e.apply(this,arguments);ee[t].push(n)},window.removeEventListener=function(t,e){if(!("function"==typeof e&&ne.indexOf(t)>=0))return n.apply(this,arguments);ee[t]=ee[t].filter((function(t){return t!==e}))},window.history.pushState=Y(window.history.pushState,"pushState"),window.history.replaceState=Y(re,"replaceState")},X=function(t){var e=document.createElement("a");return e.href=t,e},Z=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!ie){var e=t.fn.on,n=t.fn.off;t.fn.on=function(t,n){return tt.call(this,e,window.addEventListener,t,n,arguments)},t.fn.off=function(t,e){return tt.call(this,n,window.removeEventListener,t,e,arguments)},ie=!0}},tt=function(t,e,n,r,o){return"string"!=typeof n?t.apply(this,o):(n.split(/\s+/).forEach((function(t){ne.indexOf(t)>=0&&(e(t,r),n=n.replace(t,""))})),""===n.trim()?this:t.apply(this,o))},et=function(t){return Promise.resolve().then((function(){var e=ae[j(t)];if(!e)return t;if(t.status===Nt)return nt(t,e),t;if(t.status===Wt)return e.promise.then((function(){return t}));if(t.status!==Ft&&t.status!==Kt)return t;var n=t.status===Kt?Promise.resolve():G(t,"unload");return t.status=Wt,n.then((function(){return nt(t,e),t})).catch((function(n){return function(t,e,n){delete ae[j(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,g(n,t,$t),e.reject(n)}(t,e,n),t}))}))},nt=function(t,e){delete ae[j(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=Nt,e.resolve()},rt=function(t,e,n,r){ae[j(t)]={app:t,resolve:n,reject:r},Object.defineProperty(ae[j(t)],"promise",{get:e})},ot=function(t){return ae[t]},it=function(){return ue.filter(E).map(j)},at=function(){return ue.map(j)},ut=function(t){var e=k(ue,(function(e){return j(e)===t}));return e?e.status:null},st=function(t,e,n,r){var o=function(t,e,n,r){var o,i={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"==(void 0===t?"undefined":a(t))?(function(t){if(Array.isArray(t)||null===t)throw Error(S(39,!1));var e=["name","app","activeWhen","customProps"],n=Object.keys(t).reduce((function(t,n){return e.indexOf(n)>=0?t:t.concat(n)}),[]);if(0!==n.length)throw Error(S(38,!1,e.join(", "),n.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(S(20,!1));if("object"!=a(t.app)&&"function"!=typeof t.app)throw Error(S(20,!1));var r=function(t){return"string"==typeof t||"function"==typeof t};if(!(r(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(r)))throw Error(S(24,!1));if(!pt(t.customProps))throw Error(S(22,!1))}(t),i.name=t.name,i.loadApp=t.app,i.activeWhen=t.activeWhen,i.customProps=t.customProps):(function(t,e,n,r){if("string"!=typeof t||0===t.length)throw Error(S(20,!1));if(!e)throw Error(S(23,!1));if("function"!=typeof n)throw Error(S(24,!1));if(!pt(r))throw Error(S(22,!1))}(t,e,n,r),i.name=t,i.loadApp=e,i.activeWhen=n,i.customProps=r),i.loadApp="function"!=typeof(o=i.loadApp)?function(){return Promise.resolve(o)}:o,i.customProps=function(t){return t||{}}(i.customProps),i.activeWhen=function(t){var e=Array.isArray(t)?t:[t];return e=e.map((function(t){return"function"==typeof t?t:dt(t)})),function(t){return e.some((function(e){return e(t)}))}}(i.activeWhen),i}(t,e,n,r);if(gt()||se||(se=!0,setTimeout((function(){gt()||console.warn(S(1,!1))}),5e3)),-1!==at().indexOf(o.name))throw Error(S(21,!1,o.name));ue.push(A({loadErrorTime:null,status:Nt,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},o)),te&&(Z(),he())},ct=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return ue.filter((function(e){return e.activeWhen(t)})).map(j)},lt=function(t){if(0===ue.filter((function(e){return j(e)===t})).length)throw Error(S(25,!1,t));return(te?ft(t,{waitForUnmount:!1}):Promise.resolve()).then((function(){var e=ue.map(j).indexOf(t);ue.splice(e,1)}))},ft=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof t)throw Error(S(26,!1));var n=k(ue,(function(e){return j(e)===t}));if(!n)throw Error(S(27,!1,t));var r,o=ot(j(n));if(e&&e.waitForUnmount){if(o)return o.promise;var i=new Promise((function(t,e){rt(n,(function(){return i}),t,e)}));return i}return o?(r=o.promise,ht(n,o.resolve,o.reject)):r=new Promise((function(t,e){rt(n,(function(){return r}),t,e),ht(n,t,e)})),r},ht=function(t,e,n){Promise.resolve().then((function(){if(k(ct(),(function(e){return e===j(t)})))return vt()})).then((function(){return D(t).then(et).then((function(){e(),setTimeout((function(){he()}))}))})).catch(n)},pt=function(t){return!t||"function"==typeof t||"object"==(void 0===t?"undefined":a(t))&&null!==t&&!Array.isArray(t)},dt=function(t,e){var n=function(t,e){var n=0,r=!1,o="^";"/"!==t[0]&&(t="/"+t);for(var i=0;i<t.length;i++){var a=t[i];(!r&&":"===a||r&&"/"===a)&&u(i)}return u(t.length),new RegExp(o,"i");function u(i){var a=t.slice(n,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":a,i===t.length)if(r)e&&(o+="$");else{var u=e?"":".*";o="/"===o.charAt(o.length-1)?"".concat(o).concat(u,"$"):"".concat(o,"(/").concat(u,")?(#.*)?$")}r=!r,n=i}}(t,e);return function(t){var e=t.origin;e||(e="".concat(t.protocol,"//").concat(t.host));var r=t.href.replace(e,"").replace(t.search,"").split("?")[0];return n.test(r)}},vt=function(){return he()},yt=function(t,e){return x(t)?M(t).then((function(t){return e.then((function(){return x(t)?R(t):t}))})):e.then((function(){return t}))},mt=function(t){pe=!0,te&&(Q(t),he())},gt=function(){return pe},bt=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},wt=function(t,e){var n=window.getOpenmrsSpaBase().replace(/\/$/,"");return St(t,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){bt(t,e,n[e])}))}return t}({openmrsBase:window.openmrsBase,openmrsSpaBase:n},e)).replace(/^\/\//,"/")},St=function(t,e){return Object.keys(e).reduce((function(t,n){return t.split("${"+n+"}").join(e[n])}),t)},Ot=function(t){var e=t.to,n=t.templateParams,r=window.getOpenmrsSpaBase().replace(/\/$/,""),o=wt(e,n).replace(window.location.origin,"");o.startsWith(r)?$(o):window.location.assign(o)},Et=function(t){var e,n=JSON.parse(null!==(e=sessionStorage.getItem(ve))&&void 0!==e?e:"[]")||[];n.push(t),n.length>50&&(n=n.slice(-50)),sessionStorage.setItem(ve,JSON.stringify(n))},xt=function(){var t;0===JSON.parse(null!==(t=sessionStorage.getItem(ve))&&void 0!==t?t:"[]").length&&document.referrer&&Et(document.referrer),window.addEventListener("single-spa:routing-event",(function(t){var e,n,r=jt();"replaceState"==(null===(e=t.detail.originalEvent)||void 0===e?void 0:e.singleSpaTrigger)?(r[r.length-1]=window.location.href,sessionStorage.setItem(ve,JSON.stringify(r))):!(null===(n=t.detail.originalEvent)||void 0===n?void 0:n.singleSpa)&&r.includes(window.location.href)?Pt({toUrl:window.location.href}):r[r.length-1]!==window.location.href&&Et(window.location.href)}))},jt=function(){var t;return JSON.parse(null!==(t=sessionStorage.getItem(ve))&&void 0!==t?t:"[]")},Pt=function(t){var e=t.toUrl,n=jt(),r=n.lastIndexOf(e);if(-1==r)throw new Error("URL ".concat(e," not found in history; cannot go back to it."));var o=n.slice(0,r+1);Ot({to:n[r]}),sessionStorage.setItem(ve,JSON.stringify(o))},_t=function(){sessionStorage.removeItem(ve)};function At(n,r,o){return i(n,RegExp)?function(t,e){if(!e)return t;var n=t.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)e.push({name:r,prefix:"",suffix:"",modifier:"",pattern:""});return t}(n,r):Array.isArray(n)?function(t,n,r){var o=t.map((function(t){return At(t,n,r).source}));return new RegExp("(?:"+o.join("|")+")",e(r))}(n,r,o):function(n,r,o){return function(n,r,o){void 0===o&&(o={});for(var i=o.strict,a=void 0!==i&&i,u=o.start,s=void 0===u||u,c=o.end,l=void 0===c||c,f=o.encode,h=void 0===f?function(t){return t}:f,p="["+t(o.endsWith||"")+"]|$",d="["+t(o.delimiter||"/#?")+"]",v=s?"^":"",y=0,m=n;y<m.length;y++){var g=m[y];if("string"==typeof g)v+=t(h(g));else{var b=t(h(g.prefix)),w=t(h(g.suffix));if(g.pattern)if(r&&r.push(g),b||w)if("+"===g.modifier||"*"===g.modifier){var S="*"===g.modifier?"?":"";v+="(?:"+b+"((?:"+g.pattern+")(?:"+w+b+"(?:"+g.pattern+"))*)"+w+")"+S}else v+="(?:"+b+"("+g.pattern+")"+w+")"+g.modifier;else v+="("+g.pattern+")"+g.modifier;else v+="(?:"+b+w+")"+g.modifier}}if(l)a||(v+=d+"?"),v+=o.endsWith?"(?="+p+")":"$";else{var O=n[n.length-1],E="string"==typeof O?d.indexOf(O[O.length-1])>-1:void 0===O;a||(v+="(?:"+d+"(?="+p+"))?"),E||(v+="(?="+d+"|"+p+")")}return new RegExp(v,e(o))}(function(e,n){void 0===n&&(n={});for(var r=function(t){for(var e=[],n=0;n<t.length;){var r=t[n];if("*"!==r&&"+"!==r&&"?"!==r)if("\\"!==r)if("{"!==r)if("}"!==r)if(":"!==r)if("("!==r)e.push({type:"CHAR",index:n,value:t[n++]});else{var o=1,i="";if("?"===t[u=n+1])throw new TypeError('Pattern cannot start with "?" at '+u);for(;u<t.length;)if("\\"!==t[u]){if(")"===t[u]){if(0==--o){u++;break}}else if("("===t[u]&&(o++,"?"!==t[u+1]))throw new TypeError("Capturing groups are not allowed at "+u);i+=t[u++]}else i+=t[u++]+t[u++];if(o)throw new TypeError("Unbalanced pattern at "+n);if(!i)throw new TypeError("Missing pattern at "+n);e.push({type:"PATTERN",index:n,value:i}),n=u}else{for(var a="",u=n+1;u<t.length;){var s=t.charCodeAt(u);if(!(s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122||95===s))break;a+=t[u++]}if(!a)throw new TypeError("Missing parameter name at "+n);e.push({type:"NAME",index:n,value:a}),n=u}else e.push({type:"CLOSE",index:n,value:t[n++]});else e.push({type:"OPEN",index:n,value:t[n++]});else e.push({type:"ESCAPED_CHAR",index:n++,value:t[n++]});else e.push({type:"MODIFIER",index:n,value:t[n++]})}return e.push({type:"END",index:n,value:""}),e}(e),o=n.prefixes,i=void 0===o?"./":o,a="[^"+t(n.delimiter||"/#?")+"]+?",u=[],s=0,c=0,l="",f=function(t){if(c<r.length&&r[c].type===t)return r[c++].value},h=function(t){var e=f(t);if(void 0!==e)return e;var n=r[c],o=n.type,i=n.index;throw new TypeError("Unexpected "+o+" at "+i+", expected "+t)},p=function(){for(var t,e="";t=f("CHAR")||f("ESCAPED_CHAR");)e+=t;return e};c<r.length;){var d=f("CHAR"),v=f("NAME"),y=f("PATTERN");if(v||y){var m=d||"";-1===i.indexOf(m)&&(l+=m,m=""),l&&(u.push(l),l=""),u.push({name:v||s++,prefix:m,suffix:"",pattern:y||a,modifier:f("MODIFIER")||""})}else{var g=d||f("ESCAPED_CHAR");if(g)l+=g;else if(l&&(u.push(l),l=""),f("OPEN")){m=p();var b=f("NAME")||"",w=f("PATTERN")||"",S=p();h("CLOSE"),u.push({name:b||(w?s++:""),pattern:b&&!w?a:w,prefix:m,suffix:S,modifier:f("MODIFIER")||""})}else h("END")}}return u}(n,o),r,o)}(n,r,o)}s.r(c),s.d(c,{clearHistory:function(){return _t},filterBreadcrumbs:function(){return y},getBreadcrumbs:function(){return d},getBreadcrumbsFor:function(){return m},getHistory:function(){return jt},goBackInHistory:function(){return Pt},interpolateString:function(){return St},interpolateUrl:function(){return wt},navigate:function(){return Ot},registerBreadcrumb:function(){return h},registerBreadcrumbs:function(){return p},setupHistory:function(){return xt}});var kt=(0,s(685).createGlobalStore)("breadcrumbs",[]);function Tt(t,e){if(e)return function(t,e){var n=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),1!==i.length);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t)||function(t,e){if(t){if("string"==typeof t)return v(t,1);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(t,1):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t.filter((function(t){return t.matcher.test(e)})));return n[0]}(t,e)||function(t,e){for(var n=e.split("/");n.length>1;){n.pop();var r=Tt(t,n.join("/"));if(r)return r}}(t,e)}var Ct,It=Object.freeze({__proto__:null,get start(){return mt},get ensureJQuerySupport(){return Z},get setBootstrapMaxTime(){return F},get setMountMaxTime(){return z},get setUnmountMaxTime(){return V},get setUnloadMaxTime(){return H},get registerApplication(){return st},get unregisterApplication(){return lt},get getMountedApps(){return it},get getAppStatus(){return ut},get unloadApplication(){return ft},get checkActivityFunctions(){return ct},get getAppNames(){return at},get pathToActiveWhen(){return dt},get navigateToUrl(){return $},get patchHistoryApi(){return Q},get triggerAppChange(){return vt},get addErrorHandler(){return b},get removeErrorHandler(){return w},get mountRootParcel(){return N},get NOT_LOADED(){return Nt},get LOADING_SOURCE_CODE(){return Lt},get NOT_BOOTSTRAPPED(){return Ut},get BOOTSTRAPPING(){return Bt},get NOT_MOUNTED(){return Ft},get MOUNTING(){return zt},get UPDATING(){return Ht},get LOAD_ERROR(){return Kt},get MOUNTED(){return Vt},get UNLOADING(){return Wt},get UNMOUNTING(){return Gt},get SKIP_BECAUSE_BROKEN(){return $t}}),Mt=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).CustomEvent,Dt=function(){try{var t=new Mt("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?Mt:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(t,e){var n=document.createEvent("CustomEvent");return e?n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail):n.initCustomEvent(t,!1,!1,void 0),n}:function(t,e){var n=document.createEventObject();return n.type=t,e?(n.bubbles=Boolean(e.bubbles),n.cancelable=Boolean(e.cancelable),n.detail=e.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n},Rt=[],Nt="NOT_LOADED",Lt="LOADING_SOURCE_CODE",Ut="NOT_BOOTSTRAPPED",Bt="BOOTSTRAPPING",Ft="NOT_MOUNTED",zt="MOUNTING",Vt="MOUNTED",Ht="UPDATING",Gt="UNMOUNTING",Wt="UNLOADING",Kt="LOAD_ERROR",$t="SKIP_BECAUSE_BROKEN",qt=[],Jt=!1,Yt=!1,Qt=0,Xt={parcels:{}},Zt={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}},te="undefined"!=typeof window,ee={hashchange:[],popstate:[]},ne=["hashchange","popstate"],re=null,oe=!1;te&&(window.singleSpaNavigate?console.warn(S(41,!1)):window.singleSpaNavigate=$);var ie=!1,ae={},ue=[],se=!1,ce=!1,le=[],fe=te&&window.location.href;function he(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(ce)return new Promise((function(t,n){le.push({resolve:t,reject:n,eventArguments:e})}));var r,i=function(){var t=[],e=[],n=[],r=[],o=(new Date).getTime();return ue.forEach((function(i){var a=i.status!==$t&&x(i);switch(i.status){case Kt:a&&o-i.loadErrorTime>=200&&n.push(i);break;case Nt:case Lt:a&&n.push(i);break;case Ut:case Ft:!a&&ot(j(i))?t.push(i):a&&r.push(i);break;case Vt:a||e.push(i)}})),{appsToUnload:t,appsToUnmount:e,appsToLoad:n,appsToMount:r}}(),a=i.appsToUnload,u=i.appsToUnmount,s=i.appsToLoad,c=i.appsToMount,l=[],f=fe,h=fe=window.location.href;return gt()?(ce=!0,r=a.concat(s,u,c),Promise.resolve().then((function(){return m(0===r.length?"before-no-app-change":"before-app-change",y(!0)),m("before-routing-event",y(!0,{cancelNavigation:p})),Promise.all(l).then((function(n){if(n.some((function(t){return t})))return re.call(window.history,history.state,"",f.substring(location.origin.length)),fe=location.href,ce=!1,he(t,e,!0);var r=a.map(et),o=u.map(D).map((function(t){return t.then(et)})).concat(r),i=Promise.all(o);i.then((function(){m("before-mount-routing-event",y(!0))}),(function(t){throw t}));var l=s.map((function(t){return K(t).then((function(t){return yt(t,i)}))})),h=c.filter((function(t){return s.indexOf(t)<0})).map((function(t){return yt(t,i)}));return i.catch((function(t){throw v(),t})).then((function(){return v(),Promise.all(l.concat(h)).catch((function(e){throw t.forEach((function(t){return t.reject(e)})),e})).then(d).then((function(){}),(function(t){throw t}))}))}))}))):(r=s,Promise.resolve().then((function(){var t=s.map(K);return Promise.all(t).then(v).then((function(){return[]})).catch((function(t){throw v(),t})).finally((function(){}))})));function p(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e="function"==typeof(null==t?void 0:t.then)?t:Promise.resolve(t);l.push(e.catch((function(t){return console.warn(Error(S(42,!1))),console.warn(t),!1})))}function d(){var e=it();t.forEach((function(t){return t.resolve(e)}));try{m(0===r.length?"no-app-change":"app-change",y()),m("routing-event",y())}catch(t){setTimeout((function(){throw t}))}if(ce=!1,le.length>0){var n=le;le=[],he(n)}return e}function v(){n||(t.forEach((function(t){q(t.eventArguments)})),q(e))}function y(){var t,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1?arguments[1]:void 0,l={},p=(o(t={},Vt,[]),o(t,Ft,[]),o(t,Nt,[]),o(t,$t,[]),t);n?(s.concat(c).forEach((function(t,e){v(t,Vt)})),a.forEach((function(t){v(t,Nt)})),u.forEach((function(t){v(t,Ft)}))):r.forEach((function(t){v(t)}));var d={detail:{newAppStatuses:l,appsByNewStatus:p,totalAppChanges:r.length,originalEvent:null==e?void 0:e[0],oldUrl:f,newUrl:h}};return i&&A(d.detail,i),d;function v(t,e){var n=j(t);e=e||ut(n),l[n]=e,(p[e]=p[e]||[]).push(n)}}function m(t,e){n||window.dispatchEvent(new Dt("single-spa:".concat(t),e))}}var pe=!1,de={getRawAppData:function(){return function(t){if(Array.isArray(t))return r(t)}(t=ue)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(t)||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.")}();var t},reroute:he,NOT_LOADED:Nt,toLoadPromise:K,toBootstrapPromise:M,unregisterApplication:lt,getProfilerData:function(){return qt}};te&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=de);var ve="openmrs:history"}(),c}())}}}))},6641:(t,e,n)=>{function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function u(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}function c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){u(t,e,n[e])}))}return t}function l(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n.push.apply(n,r)}return n}(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t}function f(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t,e)||d(t,e)||function(){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 h(t){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||d(t)||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 p(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}function d(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}System.register(["@openmrs/esm-api","@openmrs/esm-state"],(function(t,e){var r={},i={};return{setters:[function(t){r.getLoggedInUser=t.getLoggedInUser},function(t){i.createGlobalStore=t.createGlobalStore}],execute:function(){t(function(){"use strict";var t={766:function(t){t.exports=r},685:function(t){t.exports=i}},e={};function d(n){var r=e[n];if(void 0!==r)return r.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,d),o.exports}d.d=function(t,e){for(var n in e)d.o(e,n)&&!d.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},d.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},d.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var v={};return function(){var t=function(t,e){return new Promise((function(n){var r=new MessageChannel;r.port1.onmessage=function(t){n(t.data)},t.postMessage(e,[r.port2])}))},e=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},r=function(t,n){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,n){if(t){if("string"==typeof t)return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){r&&(t=r);var o=0;return function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=t[Symbol.iterator]()).next.bind(r)},i=function(t,e){var n=location.href;return new URL(t,n).href===new URL(e,n).href},y=function(t,e,n){return n?e?e(t):t:(t&&t.then||(t=Promise.resolve(t)),e?t.then(e):t)},m=function(){},g=function(t,e){if(!e)return t&&t.then?t.then(m):Promise.resolve()},b=function(t,e){if(void 0!==Mn)return console.warn("The application's Service Worker has already been registered. The new service worker at ".concat(t," will not be registered.")),Mn;if(!("serviceWorker"in navigator))throw new Error("Registering the Service Worker is not possible due to missing browser capabilities.");var n=new In(t,e);return Mn=n.register().then((function(){return n.controlling.then((function(){return n}))}))},w=function(){return null!=Mn?Mn:Promise.resolve(void 0)},S=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},O=function(t){return Ln.apply(this,arguments)},E=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},x=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){E(i,r,o,a,u,"next",t)}function u(t){E(i,r,o,a,u,"throw",t)}a(void 0)}))}},j=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},P=function(){return Un.apply(this,arguments)},A=function(){return Bn.apply(this,arguments)},k=function(){return Fn.apply(this,arguments)},T=function(){return zn.apply(this,arguments)},C=function(){return{current:Hn,notAvailable:"unavailable"===Hn,active:"on"===Hn}},I=function(t){"unavailable"!==Hn&&"unavailable"!==t&&(localStorage.setItem(Vn,"on"===t?"active":"disabled"),Hn=t)},M=function(){return Gn.apply(this,arguments)},D=function(t,e){return"object"!=(void 0===e?"undefined":p(e))||Kn(e).forEach((function(n){t[n]=e[n]})),t},R=function(t,e){return Jn.call(t,e)},N=function(t,e){"function"==typeof e&&(e=e(qn(t))),("undefined"==typeof Reflect?Kn:Reflect.ownKeys)(e).forEach((function(n){L(t,n,e[n])}))},L=function(t,e,n,r){Yn(t,e,D(n&&R(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))},U=function(t){return{from:function(e){return t.prototype=Object.create(e.prototype),L(t.prototype,"constructor",t),{extend:N.bind(null,t.prototype)}}}},B=function(t,e,n){return Zn.call(t,e,n)},F=function(t,e){return e(t)},z=function(t){if(!t)throw new Error("Assertion Failed")},V=function(t){Wn.setImmediate?setImmediate(t):setTimeout(t,0)},H=function(t,e){return t.reduce((function(t,n,r){var o=e(n,r);return o&&(t[o[0]]=o[1]),t}),{})},G=function(t){var e={};for(var n in t)R(t,n)&&(e[n]=t[n]);return e},W=function(t){return nr.apply([],t)},K=function(t){ir="undefined"!=typeof WeakMap&&new WeakMap;var e=ar(t);return ir=null,e},$=function(t){return ur.call(t).slice(8,-1)},q=function(t){var e,n,r,o;if(1===arguments.length){if($n(t))return t.slice();if(this===lr&&"string"==typeof t)return[t];if(o=cr(t)){for(n=[];!(r=o.next()).done;)n.push(r.value);return n}if(null==t)return[t];if("number"==typeof(e=t.length)){for(n=new Array(e);e--;)n[e]=t[e];return n}return[t]}for(e=arguments.length,n=new Array(e);e--;)n[e]=arguments[e];return n},J=function(t,e){hr=t,pr=e},Y=function(t,e){var n=t.stack;return n?(e=e||0,0===n.indexOf(t.name)&&(e+=(t.name+t.message).split("\n").length),n.split("\n").slice(e).filter(pr).map((function(t){return"\n"+t})).join("")):""},Q=function(t,e){this._e=vr(),this.name=t,this.message=e},X=function(t,e){return t+". Errors: "+Object.keys(e).map((function(t){return e[t].toString()})).filter((function(t,e,n){return n.indexOf(t)===e})).join("\n")},Z=function(t,e,n,r){this._e=vr(),this.failures=e,this.failedKeys=r,this.successCount=n,this.message=X(t,e)},tt=function(t,e){this._e=vr(),this.name="BulkError",this.failures=Object.keys(e).map((function(t){return e[t]})),this.failuresByPos=e,this.message=X(t,e)},et=function(){},nt=function(t){return t},rt=function(t,e){return null==t||t===nt?e:function(n){return e(t(n))}},ot=function(t,e){return function(){t.apply(this,arguments),e.apply(this,arguments)}},it=function(t,e){return t===et?e:function(){var n=t.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var i=e.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?ot(r,this.onsuccess):r),o&&(this.onerror=this.onerror?ot(o,this.onerror):o),void 0!==i?i:n}},at=function(t,e){return t===et?e:function(){t.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,e.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?ot(n,this.onsuccess):n),r&&(this.onerror=this.onerror?ot(r,this.onerror):r)}},ut=function(t,e){return t===et?e:function(n){var r=t.apply(this,arguments);D(n,r);var o=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var a=e.apply(this,arguments);return o&&(this.onsuccess=this.onsuccess?ot(o,this.onsuccess):o),i&&(this.onerror=this.onerror?ot(i,this.onerror):i),void 0===r?void 0===a?void 0:a:D(r,a)}},st=function(t,e){return t===et?e:function(){return!1!==e.apply(this,arguments)&&t.apply(this,arguments)}},ct=function(t,e){return t===et?e:function(){var n=t.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,o=arguments.length,i=new Array(o);o--;)i[o]=arguments[o];return n.then((function(){return e.apply(r,i)}))}return e.apply(this,arguments)}},lt=function(t){if("object"!=p(this))throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=et,this._lib=!1;var e=this._PSD=Vr;if(hr&&(this._stackHolder=vr(),this._prev=null,this._numPrev=0),"function"!=typeof t){if(t!==xr)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&ht(this,this._value))}this._state=null,this._value=null,++e.ref,$r(this,t)},ft=function(t,e,n,r,o){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r,this.psd=o},ht=function(t,e){if(Ur.push(e),null===t._state){var n=t._lib&&gt();e=Fr(e),t._state=!1,t._value=e,hr&&null!==e&&"object"==(void 0===e?"undefined":p(e))&&!e._promise&&function(t,e,n){try{t.apply(null,void 0)}catch(t){}}((function(){var n=Xn(e,"stack");e._promise=t,L(e,"stack",{get:function(){return Ir?n&&(n.get?n.get.apply(e):n.value):t.stack}})})),function(t){Lr.some((function(e){return e._value===t._value}))||Lr.push(t)}(t),pt(t),n&&bt()}},pt=function(t){var e=t._listeners;t._listeners=[];for(var n=0,r=e.length;n<r;++n)dt(t,e[n]);var o=t._PSD;--o.ref||o.finalize(),0===Gr&&(++Gr,Dr((function(){0==--Gr&&wt()}),[]))},dt=function(t,e){if(null!==t._state){var n=t._state?e.onFulfilled:e.onRejected;if(null===n)return(t._state?e.resolve:e.reject)(t._value);++e.psd.ref,++Gr,Dr(vt,[n,t,e])}else t._listeners.push(e)},vt=function(t,e,n){try{Br=e;var r,o=e._value;e._state?r=t(o):(Ur.length&&(Ur=[]),r=t(o),-1===Ur.indexOf(o)&&function(t){for(var e=Lr.length;e;)if(Lr[--e]._value===t._value)return void Lr.splice(e,1)}(e)),n.resolve(r)}catch(t){n.reject(t)}finally{Br=null,0==--Gr&&wt(),--n.psd.ref||n.psd.finalize()}},yt=function(t,e){var n=e?e._numPrev+1:0;n<100&&(t._prev=e,t._numPrev=n)},mt=function(){gt()&&bt()},gt=function(){var t=Rr;return Rr=!1,Nr=!1,t},bt=function(){var t,e,n;do{for(;Hr.length>0;)for(t=Hr,Hr=[],n=t.length,e=0;e<n;++e){var r=t[e];r[0].apply(null,r[1])}}while(Hr.length>0);Rr=!0,Nr=!0},wt=function(){var t=Lr;Lr=[],t.forEach((function(t){t._PSD.onunhandled.call(null,t._value,t)}));for(var e=Wr.slice(0),n=e.length;n;)e[--n]()},St=function(t){return new lt(xr,!1,t)},Ot=function(t,e){var n=Vr;return function(){var r=gt(),o=Vr;try{return kt(n,!0),t.apply(this,arguments)}catch(t){e&&e(t)}finally{kt(o,!1),r&&bt()}}},Et=function(t,e,n,r){var o=Vr,i=Object.create(o);i.parent=o,i.ref=0,i.global=!1,i.id=++to;var a=zr.env;i.env=Cr?{Promise:lt,PromiseProp:{value:lt,configurable:!0,writable:!0},all:lt.all,race:lt.race,allSettled:lt.allSettled,any:lt.any,resolve:lt.resolve,reject:lt.reject,nthen:Dt(a.nthen,i),gthen:Dt(a.gthen,i)}:{},e&&D(i,e),++o.ref,i.finalize=function(){--this.parent.ref||this.parent.finalize()};var u=Ct(i,t,n,r);return 0===i.ref&&i.finalize(),u},xt=function(){return Jr.id||(Jr.id=++Yr),++Jr.awaits,Jr.echoes+=100,Jr.id},jt=function(){return!!Jr.awaits&&(0==--Jr.awaits&&(Jr.id=0),Jr.echoes=100*Jr.awaits,!0)},Pt=function(t){return Jr.echoes&&t&&t.constructor===Tr?(xt(),t.then((function(t){return jt(),t}),(function(t){return jt(),eo(t)}))):t},_t=function(t){++Zr,Jr.echoes&&0!=--Jr.echoes||(Jr.echoes=Jr.id=0),Qr.push(Vr),kt(t,!0)},At=function(){var t=Qr[Qr.length-1];Qr.pop(),kt(t,!1)},kt=function(t,e){var n=Vr;if((e?!Jr.echoes||Xr++&&t===Vr:!Xr||--Xr&&t===Vr)||It(e?_t.bind(null,t):At),t!==Vr&&(Vr=t,n===zr&&(zr.env=Tt()),Cr)){var r=zr.env.Promise,o=t.env;_r.then=o.nthen,r.prototype.then=o.gthen,(n.global||t.global)&&(Object.defineProperty(Wn,"Promise",o.PromiseProp),r.all=o.all,r.race=o.race,r.resolve=o.resolve,r.reject=o.reject,o.allSettled&&(r.allSettled=o.allSettled),o.any&&(r.any=o.any))}},Tt=function(){var t=Wn.Promise;return Cr?{Promise:t,PromiseProp:Object.getOwnPropertyDescriptor(Wn,"Promise"),all:t.all,race:t.race,allSettled:t.allSettled,any:t.any,resolve:t.resolve,reject:t.reject,nthen:_r.then,gthen:t.prototype.then}:{}},Ct=function(t,e,n,r,o){var i=Vr;try{return kt(t,!0),e(n,r,o)}finally{kt(i,!1)}},It=function(t){kr.call(Pr,t)},Mt=function(t,e,n,r){return"function"!=typeof t?t:function(){var o=Vr;n&&xt(),kt(e,!0);try{return t.apply(this,arguments)}finally{kt(o,!1),r&&It(jt)}}},Dt=function(t,e){return function(n,r){return t.call(this,Mt(n,e),Mt(r,e))}},Rt=function(t,e){var n;try{n=e.onuncatched(t)}catch(t){}if(!1!==n)try{var r,o={promise:e,reason:t};if(Wn.document&&document.createEvent?((r=document.createEvent("Event")).initEvent("unhandledrejection",!0,!0),D(r,o)):Wn.CustomEvent&&D(r=new CustomEvent("unhandledrejection",{detail:o}),o),r&&Wn.dispatchEvent&&(dispatchEvent(r),!Wn.PromiseRejectionEvent&&Wn.onunhandledrejection))try{Wn.onunhandledrejection(r)}catch(t){}hr&&r&&!r.defaultPrevented&&console.warn("Unhandled rejection: ".concat(t.stack||t))}catch(t){}},Nt=function(t,e){return t?e?function(){return t.apply(this,arguments)&&e.apply(this,arguments)}:t:e},Lt=function(t){return"string"!=typeof t||/\./.test(t)?function(t){return t}:function(e){return void 0===e[t]&&t in e&&delete(e=K(e))[t],e}},Ut=function(t){var e={},n=function(n,r){if(r){for(var o=arguments.length,i=new Array(o-1);--o;)i[o-1]=arguments[o];return e[n].subscribe.apply(null,i),t}if("string"==typeof n)return e[n]};n.addEventType=i;for(var r=1,o=arguments.length;r<o;++r)i(arguments[r]);return n;function i(t,r,o){if("object"==(void 0===t?"undefined":p(t)))return function(t){Kn(t).forEach((function(e){var n=t[e];if($n(n))i(e,t[e][0],t[e][1]);else{if("asap"!==n)throw new Sr.InvalidArgument("Invalid event config");var r=i(e,nt,(function(){for(var t=arguments.length,e=new Array(t);t--;)e[t]=arguments[t];r.subscribers.forEach((function(t){V((function(){t.apply(null,e)}))}))}))}}))}(t);r||(r=st),o||(o=et);var a={subscribers:[],fire:o,subscribe:function(t){-1===a.subscribers.indexOf(t)&&(a.subscribers.push(t),a.fire=r(a.fire,t))},unsubscribe:function(t){a.subscribers=a.subscribers.filter((function(e){return e!==t})),a.fire=a.subscribers.reduce(r,o)}};return e[t]=n[t]=a,a}},Bt=function(t,e){return U(e).from({prototype:t}),e},Ft=function(t,e){return!(t.filter||t.algorithm||t.or)&&(e?t.justLimit:!t.replayFilter)},zt=function(t,e){t.filter=Nt(t.filter,e)},Vt=function(t,e,n){var r=t.replayFilter;t.replayFilter=r?function(){return Nt(r(),e())}:e,t.justLimit=n&&!r},Ht=function(t,e){if(t.isPrimKey)return e.primaryKey;var n=e.getIndexByKeyPath(t.index);if(!n)throw new Sr.Schema("KeyPath "+t.index+" on object store "+e.name+" is not indexed");return n},Gt=function(t,e,n){var r=Ht(t,e.schema);return e.openCursor({trans:n,values:!t.keysOnly,reverse:"prev"===t.dir,unique:!!t.unique,query:{index:r,range:t.range}})},Wt=function(t,e,n,r){var o=t.replayFilter?Nt(t.filter,t.replayFilter()):t.filter;if(t.or){var i={},a=function(t,n,r){if(!o||o(n,r,(function(t){return n.stop(t)}),(function(t){return n.fail(t)}))){var a=n.primaryKey,u=""+a;"[object ArrayBuffer]"===u&&(u=""+new Uint8Array(a)),R(i,u)||(i[u]=!0,e(t,n,r))}};return Promise.all([t.or._iterate(a,n),Kt(Gt(t,r,n),t.algorithm,a,!t.keysOnly&&t.valueMapper)])}return Kt(Gt(t,r,n),Nt(t.algorithm,o),e,!t.keysOnly&&t.valueMapper)},Kt=function(t,e,n,r){var o=Ot(r?function(t,e,o){return n(r(t),e,o)}:n);return t.then((function(t){if(t)return t.start((function(){var n=function(){return t.continue()};e&&!e(t,(function(t){return n=t}),(function(e){t.stop(e),n=et}),(function(e){t.fail(e),n=et}))||o(t.value,t,(function(t){return n=t})),n()}))}))},$t=function(t){var e=void 0===t?"undefined":p(t);if("object"!==e)return e;if(ArrayBuffer.isView(t))return"binary";var n=$(t);return"ArrayBuffer"===n?"binary":n},qt=function(t){return s(t,Uint8Array)?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(t)},Jt=function(t,e){return t<e?-1:t===e?0:1},Yt=function(t,e){return t>e?-1:t===e?0:1},Qt=function(t,e,n){var r=s(t,yo)?new t.Collection(t):t;return r._ctx.error=n?new n(e):new TypeError(e),r},Xt=function(t){return new t.Collection(t,(function(){return ne("")})).limit(0)},Zt=function(t,e,n,r,o,i){for(var a=Math.min(t.length,r.length),u=-1,s=0;s<a;++s){var c=e[s];if(c!==r[s])return o(t[s],n[s])<0?t.substr(0,s)+n[s]+n.substr(s+1):o(t[s],r[s])<0?t.substr(0,s)+r[s]+n.substr(s+1):u>=0?t.substr(0,u)+e[u]+n.substr(u+1):null;o(t[s],c)<0&&(u=s)}return a<r.length&&"next"===i?t+n.substr(t.length):a<t.length&&"prev"===i?t.substr(0,n.length):u<0?null:t.substr(0,u)+r[u]+n.substr(u+1)},te=function(t,e,n,r){var o,i,a,u,s,c,l,f=n.length;if(!n.every((function(t){return"string"==typeof t})))return Qt(t,"String expected.");function h(t){o=function(t){return"next"===t?function(t){return t.toUpperCase()}:function(t){return t.toLowerCase()}}(t),i=function(t){return"next"===t?function(t){return t.toLowerCase()}:function(t){return t.toUpperCase()}}(t),a="next"===t?Jt:Yt;var e=n.map((function(t){return{lower:i(t),upper:o(t)}})).sort((function(t,e){return a(t.lower,e.lower)}));u=e.map((function(t){return t.upper})),s=e.map((function(t){return t.lower})),c=t,l="next"===t?"":r}h("next");var p=new t.Collection(t,(function(){return ee(u[0],s[f-1]+r)}));p._ondirectionchange=function(t){h(t)};var d=0;return p._addAlgorithm((function(t,n,r){var o=t.key;if("string"!=typeof o)return!1;var h=i(o);if(e(h,s,d))return!0;for(var p=null,v=d;v<f;++v){var y=Zt(o,h,u[v],s[v],a,c);null===y&&null===p?d=v+1:(null===p||a(p,y)>0)&&(p=y)}return n(null!==p?function(){t.continue(p+l)}:r),!1})),p},ee=function(t,e,n,r){return{type:2,lower:t,upper:e,lowerOpen:n,upperOpen:r}},ne=function(t){return{type:1,lower:t,upper:t}},re=function(t){return Ot((function(e){return oe(e),t(e.target.error),!1}))},oe=function(t){t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault()},ie=function(t,e,n,r,o,i,a){return{name:t,keyPath:e,unique:n,multi:r,auto:o,compound:i,src:(n&&!a?"&":"")+(r?"*":"")+(o?"++":"")+ae(e)}},ae=function(t){return"string"==typeof t?t:t?"["+[].join.call(t,"+")+"]":""},ue=function(t,e,n){return{name:t,primKey:e,indexes:n,mappedClass:null,idxByName:H(n,(function(t){return[t.name,t]}))}},se=function(t){return null==t?function(){}:"string"==typeof t?function(t){return 1===t.split(".").length?function(e){return e[t]}:function(e){return tr(e,t)}}(t):function(e){return tr(e,t)}},ce=function(t){return[].slice.call(t)},le=function(t){return null==t?":id":"string"==typeof t?t:"[".concat(t.join("+"),"]")},fe=function(t,e){var n=t._novip,r=e.db,o=function(t,e,n,r){var o=n.IDBKeyRange,i=(n.indexedDB,function(t,e){return e.reduce((function(t,e){return c({},t,(0,e.create)(t))}),t)}(function(t,e,n){function r(t){if(3===t.type)return null;if(4===t.type)throw new Error("Cannot convert never type to IDBKeyRange");var n=t.lower,r=t.upper,o=t.lowerOpen,i=t.upperOpen;return void 0===n?void 0===r?null:e.upperBound(r,!!i):void 0===r?e.lowerBound(n,!!o):e.bound(n,r,!!o,!!i)}var o=function(t,e){var n=ce(t.objectStoreNames);return{schema:{name:t.name,tables:n.map((function(t){return e.objectStore(t)})).map((function(t){var e=t.keyPath,n=t.autoIncrement,r=$n(e),o=null==e,i={},a={name:t.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:o,compound:r,keyPath:e,autoIncrement:n,unique:!0,extractKey:se(e)},indexes:ce(t.indexNames).map((function(e){return t.index(e)})).map((function(t){var e=t.name,n=t.unique,r=t.multiEntry,o=t.keyPath,a={name:e,compound:$n(o),keyPath:o,unique:n,multiEntry:r,extractKey:se(o)};return i[le(o)]=a,a})),getIndexByKeyPath:function(t){return i[le(t)]}};return i[":id"]=a.primaryKey,null!=e&&(i[le(e)]=a.primaryKey),a}))},hasGetAll:n.length>0&&"getAll"in e.objectStore(n[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}(t,n),i=o.schema,a=o.hasGetAll,u=i.tables.map((function(t){return function(t){var e=t.name;return{name:e,schema:t,mutate:function(t){var n=t.trans,o=t.type,i=t.keys,a=t.values,u=t.range;return new Promise((function(t,s){t=Ot(t);var c=n.objectStore(e),l=null==c.keyPath,h="put"===o||"add"===o;if(!h&&"delete"!==o&&"deleteRange"!==o)throw new Error("Invalid operation type: "+o);var p,d=(i||a||{length:1}).length;if(i&&a&&i.length!==a.length)throw new Error("Given keys array must have same length as given values array.");if(0===d)return t({numFailures:0,failures:{},results:[],lastResult:void 0});var v=[],y=[],m=0,g=function(t){++m,oe(t)};if("deleteRange"===o){if(4===u.type)return t({numFailures:m,failures:y,results:[],lastResult:void 0});3===u.type?v.push(p=c.clear()):v.push(p=c.delete(r(u)))}else{var b=f(h?l?[a,i]:[a,null]:[i,null],2),w=b[0],S=b[1];if(h)for(var O=0;O<d;++O)v.push(p=S&&void 0!==S[O]?c[o](w[O],S[O]):c[o](w[O])),p.onerror=g;else for(var E=0;E<d;++E)v.push(p=c[o](w[E])),p.onerror=g}var x=function(e){var n=e.target.result;v.forEach((function(t,e){return null!=t.error&&(y[e]=t.error)})),t({numFailures:m,failures:y,results:"delete"===o?i:v.map((function(t){return t.result})),lastResult:n})};p.onerror=function(t){g(t),x(t)},p.onsuccess=x}))},getMany:function(t){var n=t.trans,r=t.keys;return new Promise((function(t,o){t=Ot(t);for(var i,a=n.objectStore(e),u=r.length,s=new Array(u),c=0,l=0,f=function(e){var n=e.target;s[n._pos]=n.result,++l===c&&t(s)},h=re(o),p=0;p<u;++p)null!=r[p]&&((i=a.get(r[p]))._pos=p,i.onsuccess=f,i.onerror=h,++c);0===c&&t(s)}))},get:function(t){var n=t.trans,r=t.key;return new Promise((function(t,o){t=Ot(t);var i=n.objectStore(e).get(r);i.onsuccess=function(e){return t(e.target.result)},i.onerror=re(o)}))},query:function(t){return function(n){return new Promise((function(o,i){o=Ot(o);var a=n.trans,u=n.values,s=n.limit,c=n.query,l=s===1/0?void 0:s,f=c.index,h=c.range,p=a.objectStore(e),d=f.isPrimaryKey?p:p.index(f.name),v=r(h);if(0===s)return o({result:[]});if(t){var y=u?d.getAll(v,l):d.getAllKeys(v,l);y.onsuccess=function(t){return o({result:t.target.result})},y.onerror=re(i)}else{var m=0,g=u||!("openKeyCursor"in d)?d.openCursor(v):d.openKeyCursor(v),b=[];g.onsuccess=function(t){var e=g.result;return e?(b.push(u?e.value:e.primaryKey),++m===s?o({result:b}):void e.continue()):o({result:b})},g.onerror=re(i)}}))}}(a),openCursor:function(t){var n=t.trans,o=t.values,i=t.query,a=t.reverse,u=t.unique;return new Promise((function(t,s){t=Ot(t);var c=i.index,l=i.range,f=n.objectStore(e),h=c.isPrimaryKey?f:f.index(c.name),p=a?u?"prevunique":"prev":u?"nextunique":"next",d=o||!("openKeyCursor"in h)?h.openCursor(r(l),p):h.openKeyCursor(r(l),p);d.onerror=re(s),d.onsuccess=Ot((function(e){var r=d.result;if(r){r.___id=++wo,r.done=!1;var o=r.continue.bind(r),i=r.continuePrimaryKey;i&&(i=i.bind(r));var a=r.advance.bind(r),u=function(){throw new Error("Cursor not stopped")};r.trans=n,r.stop=r.continue=r.continuePrimaryKey=r.advance=function(){throw new Error("Cursor not started")},r.fail=Ot(s),r.next=function(){var t=this,e=1;return this.start((function(){return e--?t.continue():t.stop()})).then((function(){return t}))},r.start=function(t){var e=new Promise((function(t,e){t=Ot(t),d.onerror=re(e),r.fail=e,r.stop=function(e){r.stop=r.continue=r.continuePrimaryKey=r.advance=u,t(e)}})),n=function(){if(d.result)try{t()}catch(t){r.fail(t)}else r.done=!0,r.start=function(){throw new Error("Cursor behind last entry")},r.stop()};return d.onsuccess=Ot((function(t){d.onsuccess=n,n()})),r.continue=o,r.continuePrimaryKey=i,r.advance=a,n(),e},t(r)}else t(null)}),s)}))},count:function(t){var n=t.query,o=t.trans,i=n.index,a=n.range;return new Promise((function(t,n){var u=o.objectStore(e),s=i.isPrimaryKey?u:u.index(i.name),c=r(a),l=c?s.count(c):s.count();l.onsuccess=Ot((function(e){return t(e.target.result)})),l.onerror=re(n)}))}}}(t)})),s={};return u.forEach((function(t){return s[t.name]=t})),{stack:"dbcore",transaction:t.transaction.bind(t),table:function(t){if(!s[t])throw new Error("Table '".concat(t,"' not found"));return s[t]},MIN_KEY:-1/0,MAX_KEY:bo(e),schema:i}}(e,o,r),t.dbcore));return{dbcore:i}}(n._middlewares,r,n._deps,e);n.core=o.dbcore,n.tables.forEach((function(t){var e=t.name;n.core.schema.tables.some((function(t){return t.name===e}))&&(t.core=n.core.table(e),s(n[e],n.Table)&&(n[e].core=t.core))}))},he=function(t,e,n,r){var o=t._novip;n.forEach((function(t){var n=r[t];e.forEach((function(e){var r=Xn(e,t);(!r||"value"in r&&void 0===r.value)&&(e===o.Transaction.prototype||s(e,o.Transaction)?L(e,t,{get:function(){return this.table(t)},set:function(e){Yn(this,t,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):e[t]=new o.Table(t,n))}))}))},pe=function(t,e){var n=t._novip;e.forEach((function(t){for(var e in t)s(t[e],n.Table)&&delete t[e]}))},de=function(t,e){return t._cfg.version-e._cfg.version},ve=function(t,e){var n,r={del:[],add:[],change:[]};for(n in t)e[n]||r.del.push(n);for(n in e){var o=t[n],i=e[n];if(o){var a={name:n,def:i,recreate:!1,del:[],add:[],change:[]};if(""+(o.primKey.keyPath||"")!=""+(i.primKey.keyPath||"")||o.primKey.auto!==i.primKey.auto&&!ao)a.recreate=!0,r.change.push(a);else{var u=o.idxByName,s=i.idxByName,c=void 0;for(c in u)s[c]||a.del.push(c);for(c in s){var l=u[c],f=s[c];l?l.src!==f.src&&a.change.push(f):a.add.push(f)}(a.del.length>0||a.add.length>0||a.change.length>0)&&r.change.push(a)}}else r.add.push([n,i])}return r},ye=function(t,e,n,r){var o=t.db.createObjectStore(e,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach((function(t){return me(o,t)})),o},me=function(t,e){t.createIndex(e.name,e.keyPath,{unique:e.unique,multiEntry:e.multi})},ge=function(t,e,n){var r={};return B(e.objectStoreNames,0).forEach((function(t){for(var e=n.objectStore(t),o=e.keyPath,i=ie(ae(o),o||"",!1,!1,!!e.autoIncrement,o&&"string"!=typeof o,!0),a=[],u=0;u<e.indexNames.length;++u){var s=e.index(e.indexNames[u]);o=s.keyPath;var c=ie(s.name,o,!!s.unique,!!s.multiEntry,!1,o&&"string"!=typeof o,!1);a.push(c)}r[t]=ue(t,i,a)})),r},be=function(t,e,n){for(var r=t._novip,o=n.db.objectStoreNames,i=0;i<o.length;++i){var a=o[i],u=n.objectStore(a);r._hasGetAll="getAll"in u;for(var c=0;c<u.indexNames.length;++c){var l=u.indexNames[c],f=u.index(l).keyPath,h="string"==typeof f?f:"["+B(f).join("+")+"]";if(e[a]){var p=e[a].idxByName[h];p&&(p.name=l,delete e[a].idxByName[h],e[a].idxByName[l]=p)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&Wn.WorkerGlobalScope&&s(Wn,Wn.WorkerGlobalScope)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(r._hasGetAll=!1)},we=function(t,e){var n=t._dbNamesDB;return n||(n=t._dbNamesDB=new Co("__dbnames",{addons:[],indexedDB:t,IDBKeyRange:e})).version(1).stores({dbnames:"name"}),n.table("dbnames")},Se=function(t){return t&&"function"==typeof t.databases},Oe=function(t){return Et((function(){return Vr.letThrough=!0,t()}))},Ee=function(){var t;return!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(e){var n=function(){return indexedDB.databases().finally(e)};t=setInterval(n,100),n()})).finally((function(){return clearInterval(t)})):Promise.resolve()},xe=function(t){var e=function(e){return t.next(e)},n=o(e),r=o((function(e){return t.throw(e)}));function o(t){return function(e){var o=t(e),i=o.value;return o.done?i:i&&"function"==typeof i.then?i.then(n,r):$n(i)?Promise.all(i).then(n,r):n(i)}}return o(e)()},je=function(t,e,n){var r=arguments.length;if(r<2)throw new Sr.InvalidArgument("Too few arguments");for(var o=new Array(r-1);--r;)o[r-1]=arguments[r];return n=o.pop(),[t,W(o),n]},Pe=function(t,e,n){for(var r=$n(t)?t.slice():[t],o=0;o<n;++o)r.push(e);return r},_e=function(t,e,n){try{if(!e)return null;if(e.keys.length<t.length)return null;for(var r=[],o=0,i=0;o<e.keys.length&&i<t.length;++o)0===ho(e.keys[o],t[i])&&(r.push(n?K(e.values[o]):e.values[o]),++i);return r.length===t.length?r:null}catch(t){return null}},Ae=function(t){return!("from"in t)},ke=function(t,e){Ae(e)||function t(e,n){var r=n.from,o=n.to,i=n.l,a=n.r;Ao(e,r,o),i&&t(e,i),a&&t(e,a)}(t,e)},Te=function(t){var e=Ae(t)?null:{s:0,n:t};return{next:function(t){for(var n=arguments.length>0;e;)switch(e.s){case 0:if(e.s=1,n)for(;e.n.l&&ho(t,e.n.from)<0;)e={up:e,n:e.n.l,s:1};else for(;e.n.l;)e={up:e,n:e.n.l,s:1};case 1:if(e.s=2,!n||ho(t,e.n.to)<=0)return{value:e.n,done:!1};case 2:if(e.n.r){e.s=3,e={up:e,n:e.n.r,s:0};continue}case 3:e=e.up}return{done:!0}}}},Ce=function(t){var e,n,r=((null===(e=t.r)||void 0===e?void 0:e.d)||0)-((null===(n=t.l)||void 0===n?void 0:n.d)||0),o=r>1?"r":r<-1?"l":"";if(o){var i="r"===o?"l":"r",a=c({},t),u=t[o];t.from=u.from,t.to=u.to,t[o]=u[o],a[o]=u[i],t[i]=a,a.d=Ie(a)}t.d=Ie(t)},Ie=function(t){var e=t.r,n=t.l;return(e?n?Math.max(e.d,n.d):e.d:n?n.d:0)+1},Me=function(t,e){return Kn(e).forEach((function(n){ke(t[n]||(t[n]=new _o),e[n])})),t},De=function(t){var e=Ro;try{Ro=!0,mo.storagemutated.fire(t)}finally{Ro=e}},Re=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},Ne=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},Le=function(){return new Vo},Ue=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},Be=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},Fe=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Be(i,r,o,a,u,"next",t)}function u(t){Be(i,r,o,a,u,"throw",t)}a(void 0)}))}},ze=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},Ve=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){ze(t,e,n[e])}))}return t},He=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Ue(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ue(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},Ge=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},We=function(){return Wo},Ke=function(){return Ko.apply(this,arguments)},$e=function(){return qo.apply(this,arguments)},qe=function(t,e,n,r){return Jo.apply(this,arguments)},Je=function(t,e,n){return Yo.apply(this,arguments)},Ye=function(t,e){return Qo.apply(this,arguments)},Qe=function(t,e){return Xo.apply(this,arguments)},Xe=function(t){return Zo.apply(this,arguments)},Ze=function(t){return ti.apply(this,arguments)},tn=function(t){return ei.apply(this,arguments)},en=function(t){var e;return!!(null===(e=Go[t])||void 0===e?void 0:e.options.onBeginEditSyncItem)},nn=function(t){return ni.apply(this,arguments)},rn=function(t){return ri.apply(this,arguments)},on=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};Go[t]={type:t,dependsOn:e,process:n,options:r}},an=function(){if(!oi&&!(oi="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return oi(ai)},un=function(){return li+ci()},sn=function(t){return t.startsWith(li)},cn=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},ln=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},fn=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){ln(i,r,o,a,u,"next",t)}function u(t){ln(i,r,o,a,u,"throw",t)}a(void 0)}))}},hn=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},pn=function(){return Object.values(fi)},dn=function(t){fi[t.id]&&console.warn('[setupDynamicOfflineDataHandler] Another second handler with the ID "'.concat(t.id,'" was registered. This handler will override the previous one. This could be unintended as the previous handler might run different flows than the newly registered one. If this is the case, ensure that you are setting up the handlers with different IDs.')),fi[t.id]=t},vn=function(t){return hi.apply(this,arguments)},yn=function(t,e){return pi.apply(this,arguments)},mn=function(t,e){return di.apply(this,arguments)},gn=function(t,e,n){return vi.apply(this,arguments)},bn=function(t,e){return yi.apply(this,arguments)},wn=function(t,e,n){return mi.apply(this,arguments)},Sn=function(t,e){return gi.apply(this,arguments)},On=function(t,e,n){return bi.apply(this,arguments)},En=function(){return wi.apply(this,arguments)},xn=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},jn=function(){return An(),Si},Pn=function(t,e){An(),dn({type:"patient",displayName:e.displayName,id:t,isSynced:function(){return Promise.resolve(!0)},sync:function(t,n){return e.onOfflinePatientAdded({patientUuid:t,signal:null!=n?n:(new AbortController).signal})}})},_n=function(t){return Oi.apply(this,arguments)},An=function(){console.warn("The offline patient API has been deprecated and will be removed in a future release. To prevent future crashes, the functions remain available for the moment, but any invocations should be migrated ASAP.")};d.r(v),d.d(v,{activateOfflineCapability:function(){return M},beginEditSynchronizationItem:function(){return nn},canBeginEditSynchronizationItemsOfType:function(){return en},deleteSynchronizationItem:function(){return rn},generateOfflineUuid:function(){return un},getCurrentOfflineMode:function(){return C},getDynamicOfflineDataEntries:function(){return vn},getDynamicOfflineDataEntriesFor:function(){return yn},getDynamicOfflineDataHandlers:function(){return pn},getFullSynchronizationItems:function(){return Ze},getFullSynchronizationItemsFor:function(){return Qe},getOfflineDb:function(){return Le},getOfflinePatientDataStore:function(){return jn},getOfflineSynchronizationStore:function(){return We},getOmrsServiceWorker:function(){return w},getSynchronizationItem:function(){return tn},getSynchronizationItems:function(){return Xe},getSynchronizationItemsFor:function(){return Ye},isOfflineUuid:function(){return sn},messageOmrsServiceWorker:function(){return O},offlineUuidPrefix:function(){return li},omrsOfflineCachingStrategyHttpHeaderName:function(){return Nn},omrsOfflineResponseBodyHttpHeaderName:function(){return Dn},omrsOfflineResponseStatusHttpHeaderName:function(){return Rn},putDynamicOfflineData:function(){return mn},putDynamicOfflineDataFor:function(){return gn},queueSynchronizationItem:function(){return Je},queueSynchronizationItemFor:function(){return qe},registerOfflinePatientHandler:function(){return Pn},registerOmrsServiceWorker:function(){return b},removeDynamicOfflineData:function(){return bn},removeDynamicOfflineDataFor:function(){return wn},runSynchronization:function(){return Ke},setCurrentOfflineMode:function(){return I},setupDynamicOfflineDataHandler:function(){return dn},setupOfflineSync:function(){return on},syncAllDynamicOfflineData:function(){return Sn},syncDynamicOfflineData:function(){return On},syncOfflinePatientData:function(){return _n}});try{self["workbox:window:6.5.4"]&&_()}catch(t){}try{self["workbox:core:6.5.4"]&&_()}catch(t){}var kn=function(){var t=this;this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))},Tn=function(t,e){this.type=t,Object.assign(this,e)},Cn={type:"SKIP_WAITING"},In=function(e){var n,r;function o(t,n){var r,o;return void 0===n&&(n={}),(r=e.call(this)||this).nn={},r.tn=0,r.rn=new kn,r.en=new kn,r.on=new kn,r.un=0,r.an=new Set,r.cn=function(){var t=r.fn,e=t.installing;r.tn>0||!i(e.scriptURL,r.sn.toString())||performance.now()>r.un+6e4?(r.vn=e,t.removeEventListener("updatefound",r.cn)):(r.hn=e,r.an.add(e),r.rn.resolve(e)),++r.tn,e.addEventListener("statechange",r.ln)},r.ln=function(t){var e=r.fn,n=t.target,o=n.state,i=n===r.vn,a={sw:n,isExternal:i,originalEvent:t};!i&&r.mn&&(a.isUpdate=!0),r.dispatchEvent(new Tn(o,a)),"installed"===o?r.wn=self.setTimeout((function(){"installed"===o&&e.waiting===n&&r.dispatchEvent(new Tn("waiting",a))}),200):"activating"===o&&(clearTimeout(r.wn),i||r.en.resolve(n))},r.dn=function(t){var e=r.hn,n=e!==navigator.serviceWorker.controller;r.dispatchEvent(new Tn("controlling",{isExternal:n,originalEvent:t,sw:e,isUpdate:r.mn})),n||r.on.resolve(e)},r.gn=(o=function(t){var e=t.data,n=t.ports,o=t.source;return y(r.getSW(),(function(){r.an.has(o)&&r.dispatchEvent(new Tn("message",{data:e,originalEvent:t,ports:n,sw:o}))}))},function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];try{return Promise.resolve(o.apply(this,t))}catch(t){return Promise.reject(t)}}),r.sn=t,r.nn=n,navigator.serviceWorker.addEventListener("message",r.gn),r}r=e,(n=o).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r;var a,u=o.prototype;return u.register=function(t){var e=(void 0===t?{}:t).immediate,n=void 0!==e&&e;try{var r=this;return function(t,e){var n=t();return n&&n.then?n.then(e):e()}((function(){if(!n&&"complete"!==document.readyState)return g(new Promise((function(t){return window.addEventListener("load",t)})))}),(function(){return r.mn=Boolean(navigator.serviceWorker.controller),r.yn=r.pn(),y(r.bn(),(function(t){r.fn=t,r.yn&&(r.hn=r.yn,r.en.resolve(r.yn),r.on.resolve(r.yn),r.yn.addEventListener("statechange",r.ln,{once:!0}));var e=r.fn.waiting;return e&&i(e.scriptURL,r.sn.toString())&&(r.hn=e,Promise.resolve().then((function(){r.dispatchEvent(new Tn("waiting",{sw:e,wasWaitingBeforeRegister:!0}))})).then((function(){}))),r.hn&&(r.rn.resolve(r.hn),r.an.add(r.hn)),r.fn.addEventListener("updatefound",r.cn),navigator.serviceWorker.addEventListener("controllerchange",r.dn),r.fn}))}))}catch(t){return Promise.reject(t)}},u.update=function(){try{return this.fn?g(this.fn.update()):void 0}catch(t){return Promise.reject(t)}},u.getSW=function(){return void 0!==this.hn?Promise.resolve(this.hn):this.rn.promise},u.messageSW=function(e){try{return y(this.getSW(),(function(n){return t(n,e)}))}catch(t){return Promise.reject(t)}},u.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&t(this.fn.waiting,Cn)},u.pn=function(){var t=navigator.serviceWorker.controller;return t&&i(t.scriptURL,this.sn.toString())?t:void 0},u.bn=function(){try{var t=this;return function(e,n){try{var r=y(navigator.serviceWorker.register(t.sn,t.nn),(function(e){return t.un=performance.now(),e}))}catch(e){return n(e)}return r&&r.then?r.then(void 0,n):r}((function(){return y(navigator.serviceWorker.register(t.sn,t.nn),(function(e){return t.un=performance.now(),e}))}),(function(t){throw t}))}catch(t){return Promise.reject(t)}},(a=[{key:"active",get:function(){return this.en.promise}},{key:"controlling",get:function(){return this.on.promise}}])&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(o.prototype,a),o}(function(){function t(){this.Pn=new Map}var e=t.prototype;return e.addEventListener=function(t,e){this.Sn(t).add(e)},e.removeEventListener=function(t,e){this.Sn(t).delete(e)},e.dispatchEvent=function(t){t.target=this;for(var e,n=r(this.Sn(t.type));!(e=n()).done;)(0,e.value)(t)},e.Sn=function(t){return this.Pn.has(t)||this.Pn.set(t,new Set),this.Pn.get(t)},t}()),Mn=void 0,Dn="x-omrs-offline-response-body",Rn="x-omrs-offline-response-status",Nn="x-omrs-offline-caching-strategy";function Ln(){return Ln=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){S(i,r,o,a,u,"next",t)}function u(t){S(i,r,o,a,u,"throw",t)}a(void 0)}))}}((function(t){var e,n;return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(r){switch(r.label){case 0:return[4,w()];case 1:return(e=r.sent())?[4,e.messageSW(t)]:[3,3];case 2:return n=r.sent(),[3,4];case 3:n={success:!1,result:void 0,error:"No service worker has been registered. This is typically the case when the application has been built without offline-related features."},r.label=4;case 4:return[2,n]}}))})),Ln.apply(this,arguments)}function Un(){return Un=x((function(){var t;return j(this,(function(e){t=window.sessionStorage;try{t.setItem("someKeyHere","test"),t.removeItem("someKeyHere")}catch(e){if(e.code===DOMException.QUOTA_EXCEEDED_ERR&&0===t.length)return[2,!0]}return[2,!1]}))})),Un.apply(this,arguments)}function Bn(){return(Bn=x((function(){return j(this,(function(t){return[2,!window.indexedDB]}))}))).apply(this,arguments)}function Fn(){return Fn=x((function(){return j(this,(function(t){return[2,new Promise((function(t){var e=indexedDB.open("test");e.onerror=function(){return t(!0)},e.onsuccess=function(){return t(!1)}}))]}))})),Fn.apply(this,arguments)}function zn(){return(zn=x((function(){var t,e;return j(this,(function(n){switch(n.label){case 0:return[4,k()];case 1:return(e=n.sent())?[3,3]:[4,A()];case 2:e=n.sent(),n.label=3;case 3:return(t=e)?[3,5]:[4,P()];case 4:t=n.sent(),n.label=5;case 5:return[2,t]}}))}))).apply(this,arguments)}var Vn="openmrs3:offline-mode",Hn="unavailable";function Gn(){return(Gn=x((function(){return j(this,(function(t){switch(t.label){case 0:return[4,T()];case 1:return t.sent()||(Hn="active"===localStorage.getItem(Vn)?"on":"off"),navigator.onLine,[2]}}))}))).apply(this,arguments)}var Wn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,Kn=Object.keys,$n=Array.isArray;"undefined"==typeof Promise||Wn.Promise||(Wn.Promise=Promise);var qn=Object.getPrototypeOf,Jn={}.hasOwnProperty,Yn=Object.defineProperty,Qn=Object.getOwnPropertyDescriptor;function Xn(t,e){var n;return Qn(t,e)||(n=qn(t))&&Xn(n,e)}var Zn=[].slice;function tr(t,e){if(R(t,e))return t[e];if(!e)return t;if("string"!=typeof e){for(var n=[],r=0,o=e.length;r<o;++r){var i=tr(t,e[r]);n.push(i)}return n}var a=e.indexOf(".");if(-1!==a){var u=t[e.substr(0,a)];return void 0===u?void 0:tr(u,e.substr(a+1))}}function er(t,e,n){if(t&&void 0!==e&&(!("isFrozen"in Object)||!Object.isFrozen(t)))if("string"!=typeof e&&"length"in e){z("string"!=typeof n&&"length"in n);for(var r=0,o=e.length;r<o;++r)er(t,e[r],n[r])}else{var i=e.indexOf(".");if(-1!==i){var a=e.substr(0,i),u=e.substr(i+1);if(""===u)void 0===n?$n(t)&&!isNaN(parseInt(a))?t.splice(a,1):delete t[a]:t[a]=n;else{var s=t[a];s&&R(t,a)||(s=t[a]={}),er(s,u,n)}}else void 0===n?$n(t)&&!isNaN(parseInt(e))?t.splice(e,1):delete t[e]:t[e]=n}}var nr=[].concat,rr="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(W([8,16,32,64].map((function(t){return["Int","Uint","Float"].map((function(e){return e+t+"Array"}))})))).filter((function(t){return Wn[t]})),or=rr.map((function(t){return Wn[t]}));H(rr,(function(t){return[t,!0]}));var ir=null;function ar(t){if(!t||"object"!=(void 0===t?"undefined":p(t)))return t;var e=ir&&ir.get(t);if(e)return e;if($n(t)){e=[],ir&&ir.set(t,e);for(var n=0,r=t.length;n<r;++n)e.push(ar(t[n]))}else if(or.indexOf(t.constructor)>=0)e=t;else{var o=qn(t);for(var i in e=o===Object.prototype?{}:Object.create(o),ir&&ir.set(t,e),t)R(t,i)&&(e[i]=ar(t[i]))}return e}var ur={}.toString,sr="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",cr="symbol"==(void 0===sr?"undefined":p(sr))?function(t){var e;return null!=t&&(e=t[sr])&&e.apply(t)}:function(){return null},lr={},fr="undefined"!=typeof Symbol?function(t){return"AsyncFunction"===t[Symbol.toStringTag]}:function(){return!1},hr="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href),pr=function(){return!0},dr=!new Error("").stack;function vr(){if(dr)try{throw vr.arguments,new Error}catch(t){return t}return new Error}var yr=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],mr=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(yr),gr={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};U(Q).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+Y(this._e,2))}},toString:function(){return this.name+": "+this.message}}),U(Z).from(Q),U(tt).from(Q);var br=mr.reduce((function(t,e){return t[e]=e+"Error",t}),{}),wr=Q,Sr=mr.reduce((function(t,e){var n=function(t,n){this._e=vr(),this.name=r,t?"string"==typeof t?(this.message="".concat(t).concat(n?"\n "+n:""),this.inner=n||null):"object"==(void 0===t?"undefined":p(t))&&(this.message="".concat(t.name," ").concat(t.message),this.inner=t):(this.message=gr[e]||r,this.inner=null)},r=e+"Error";return U(n).from(wr),t[e]=n,t}),{});Sr.Syntax=SyntaxError,Sr.Type=TypeError,Sr.Range=RangeError;var Or=yr.reduce((function(t,e){return t[e+"Error"]=Sr[e],t}),{}),Er=mr.reduce((function(t,e){return-1===["Syntax","Type","Range"].indexOf(e)&&(t[e+"Error"]=Sr[e]),t}),{});Er.ModifyError=Z,Er.DexieError=Q,Er.BulkError=tt;var xr={},jr=f("undefined"==typeof Promise?[]:function(){var t=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[t,qn(t),t];var e=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[e,qn(e),t]}(),3),Pr=jr[0],_r=jr[1],Ar=jr[2],kr=_r&&_r.then,Tr=Pr&&Pr.constructor,Cr=!!Ar,Ir=!1,Mr=Ar?function(){Ar.then(mt)}:Wn.setImmediate?setImmediate.bind(null,mt):Wn.MutationObserver?function(){var t=document.createElement("div");new MutationObserver((function(){mt(),t=null})).observe(t,{attributes:!0}),t.setAttribute("i","1")}:function(){setTimeout(mt,0)},Dr=function(t,e){Hr.push([t,e]),Nr&&(Mr(),Nr=!1)},Rr=!0,Nr=!0,Lr=[],Ur=[],Br=null,Fr=nt,zr={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Rt,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((function(t){try{Rt(t[0],t[1])}catch(t){}}))}},Vr=zr,Hr=[],Gr=0,Wr=[],Kr={get:function(){var t=Vr,e=Zr;function n(n,r){var o=this,i=!t.global&&(t!==Vr||e!==Zr),a=i&&!jt(),u=new lt((function(e,u){dt(o,new ft(Mt(n,t,i,a),Mt(r,t,i,a),e,u,t))}));return hr&&yt(u,this),u}return n.prototype=xr,n},set:function(t){L(this,"then",t&&t.prototype===xr?Kr:{get:function(){return t},set:Kr.set})}};function $r(t,e){try{e((function(e){if(null===t._state){if(e===t)throw new TypeError("A promise cannot be resolved with itself.");var n=t._lib&&gt();e&&"function"==typeof e.then?$r(t,(function(t,n){s(e,lt)?e._then(t,n):e.then(t,n)})):(t._state=!0,t._value=e,pt(t)),n&&bt()}}),ht.bind(null,t))}catch(e){ht(t,e)}}function qr(t,e,n){if(e.length===n)return e;var r="";if(!1===t._state){var o,i,a=t._value;null!=a?(o=a.name||"Error",i=a.message||a,r=Y(a,0)):(o=a,i=""),e.push(o+(i?": "+i:"")+r)}return hr&&((r=Y(t._stackHolder,2))&&-1===e.indexOf(r)&&e.push(r),t._prev&&qr(t._prev,e,n)),e}N(lt.prototype,{then:Kr,_then:function(t,e){dt(this,new ft(null,null,t,e,Vr))},catch:function(t){if(1===arguments.length)return this.then(null,t);var e=arguments[0],n=arguments[1];return"function"==typeof e?this.then(null,(function(t){return s(t,e)?n(t):St(t)})):this.then(null,(function(t){return t&&t.name===e?n(t):St(t)}))},finally:function(t){return this.then((function(e){return t(),e}),(function(e){return t(),St(e)}))},stack:{get:function(){if(this._stack)return this._stack;try{Ir=!0;var t=qr(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=t),t}finally{Ir=!1}}},timeout:function(t,e){var n=this;return t<1/0?new lt((function(r,o){var i=setTimeout((function(){return o(new Sr.Timeout(e))}),t);n.then(r,o).finally(clearTimeout.bind(null,i))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&L(lt.prototype,Symbol.toStringTag,"Dexie.Promise"),zr.env=Tt(),N(lt,{all:function(){var t=q.apply(null,arguments).map(Pt);return new lt((function(e,n){0===t.length&&e([]);var r=t.length;t.forEach((function(o,i){return lt.resolve(o).then((function(n){t[i]=n,--r||e(t)}),n)}))}))},resolve:function(t){if(s(t,lt))return t;if(t&&"function"==typeof t.then)return new lt((function(e,n){t.then(e,n)}));var e=new lt(xr,!0,t);return yt(e,Br),e},reject:St,race:function(){var t=q.apply(null,arguments).map(Pt);return new lt((function(e,n){t.map((function(t){return lt.resolve(t).then(e,n)}))}))},PSD:{get:function(){return Vr},set:function(t){return Vr=t}},totalEchoes:{get:function(){return Zr}},newPSD:Et,usePSD:Ct,scheduler:{get:function(){return Dr},set:function(t){Dr=t}},rejectionMapper:{get:function(){return Fr},set:function(t){Fr=t}},follow:function(t,e){return new lt((function(n,r){return Et((function(e,n){var r=Vr;r.unhandleds=[],r.onunhandled=n,r.finalize=ot((function(){var t=this;!function(t){Wr.push((function e(){t(),Wr.splice(Wr.indexOf(e),1)})),++Gr,Dr((function(){0==--Gr&&wt()}),[])}((function(){0===t.unhandleds.length?e():n(t.unhandleds[0])}))}),r.finalize),t()}),e,n,r)}))}}),Tr&&(Tr.allSettled&&L(lt,"allSettled",(function(){var t=q.apply(null,arguments).map(Pt);return new lt((function(e){0===t.length&&e([]);var n=t.length,r=new Array(n);t.forEach((function(t,o){return lt.resolve(t).then((function(t){return r[o]={status:"fulfilled",value:t}}),(function(t){return r[o]={status:"rejected",reason:t}})).then((function(){return--n||e(r)}))}))}))})),Tr.any&&"undefined"!=typeof AggregateError&&L(lt,"any",(function(){var t=q.apply(null,arguments).map(Pt);return new lt((function(e,n){0===t.length&&n(new AggregateError([]));var r=t.length,o=new Array(r);t.forEach((function(t,i){return lt.resolve(t).then((function(t){return e(t)}),(function(t){o[i]=t,--r||n(new AggregateError(o))}))}))}))})));var Jr={awaits:0,echoes:0,id:0},Yr=0,Qr=[],Xr=0,Zr=0,to=0;-1===(""+kr).indexOf("[native code]")&&(xt=jt=et);var eo=lt.reject;function no(t,e,n,r){if(t.idbdb&&(t._state.openComplete||Vr.letThrough||t._vip)){var o=t._createTransaction(e,n,t._dbSchema);try{o.create(),t._state.PR1398_maxLoop=3}catch(o){return o.name===br.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then((function(){return no(t,e,n,r)}))):eo(o)}return o._promise(e,(function(t,e){return Et((function(){return Vr.trans=o,r(t,e,o)}))})).then((function(t){return o._completion.then((function(){return t}))}))}if(t._state.openComplete)return eo(new Sr.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._options.autoOpen)return eo(new Sr.DatabaseClosed);t.open().catch(et)}return t._state.dbReadyPromise.then((function(){return no(t,e,n,r)}))}var ro=String.fromCharCode(65535),oo="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",io=[],ao="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),uo=ao,so=ao,co=function(t){return!/(dexie\.js|dexie\.min\.js)/.test(t)},lo={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1},fo=function(){function t(){o(this,t)}return a(t,[{key:"_trans",value:function(t,e,n){var r=this._tx||Vr.trans,o=this.name;function i(t,n,r){if(!r.schema[o])throw new Sr.NotFound("Table "+o+" not part of transaction");return e(r.idbtrans,r)}var a=gt();try{return r&&r.db===this.db?r===Vr.trans?r._promise(t,i,n):Et((function(){return r._promise(t,i,n)}),{trans:r,transless:Vr.transless||Vr}):no(this.db,t,[this.name],i)}finally{a&&bt()}}},{key:"get",value:function(t,e){var n=this;return t&&t.constructor===Object?this.where(t).first(e):this._trans("readonly",(function(e){return n.core.get({trans:e,key:t}).then((function(t){return n.hook.reading.fire(t)}))})).then(e)}},{key:"where",value:function(t){if("string"==typeof t)return new this.db.WhereClause(this,t);if($n(t))return new this.db.WhereClause(this,"[".concat(t.join("+"),"]"));var e=Kn(t);if(1===e.length)return this.where(e[0]).equals(t[e[0]]);var n=this.schema.indexes.concat(this.schema.primKey).filter((function(t){return t.compound&&e.every((function(e){return t.keyPath.indexOf(e)>=0}))&&t.keyPath.every((function(t){return e.indexOf(t)>=0}))}))[0];if(n&&this.db._maxKey!==ro)return this.where(n.name).equals(n.keyPath.map((function(e){return t[e]})));!n&&hr&&console.warn("The query ".concat(JSON.stringify(t)," on ").concat(this.name," would benefit of a compound index [").concat(e.join("+"),"]"));var r=this.schema.idxByName,o=this.db._deps.indexedDB;function i(t,e){try{return 0===o.cmp(t,e)}catch(t){return!1}}var a=f(e.reduce((function(e,n){var o=f(e,2),a=o[0],u=o[1],s=r[n],c=t[n];return[a||s,a||!s?Nt(u,s&&s.multi?function(t){var e=tr(t,n);return $n(e)&&e.some((function(t){return i(c,t)}))}:function(t){return i(c,tr(t,n))}):u]}),[null,null]),2),u=a[0],s=a[1];return u?this.where(u.name).equals(t[u.keyPath]).filter(s):n?this.filter(s):this.where(e).equals("")}},{key:"filter",value:function(t){return this.toCollection().and(t)}},{key:"count",value:function(t){return this.toCollection().count(t)}},{key:"offset",value:function(t){return this.toCollection().offset(t)}},{key:"limit",value:function(t){return this.toCollection().limit(t)}},{key:"each",value:function(t){return this.toCollection().each(t)}},{key:"toArray",value:function(t){return this.toCollection().toArray(t)}},{key:"toCollection",value:function(){return new this.db.Collection(new this.db.WhereClause(this))}},{key:"orderBy",value:function(t){return new this.db.Collection(new this.db.WhereClause(this,$n(t)?"[".concat(t.join("+"),"]"):t))}},{key:"reverse",value:function(){return this.toCollection().reverse()}},{key:"mapToClass",value:function(t){this.schema.mappedClass=t;var e=function(e){if(!e)return e;var n=Object.create(t.prototype);for(var r in e)if(R(e,r))try{n[r]=e[r]}catch(t){}return n};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=e,this.hook("reading",e),t}},{key:"defineClass",value:function(){return this.mapToClass((function(t){D(this,t)}))}},{key:"add",value:function(t,e){var n=this,r=this.schema.primKey,o=r.auto,i=r.keyPath,a=t;return i&&o&&(a=Lt(i)(t)),this._trans("readwrite",(function(t){return n.core.mutate({trans:t,type:"add",keys:null!=e?[e]:null,values:[a]})})).then((function(t){return t.numFailures?lt.reject(t.failures[0]):t.lastResult})).then((function(e){if(i)try{er(t,i,e)}catch(t){}return e}))}},{key:"update",value:function(t,e){if("object"!=(void 0===t?"undefined":p(t))||$n(t))return this.where(":id").equals(t).modify(e);var n=tr(t,this.schema.primKey.keyPath);if(void 0===n)return eo(new Sr.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof e?Kn(e).forEach((function(n){er(t,n,e[n])})):e(t,{value:t,primKey:n})}catch(t){}return this.where(":id").equals(n).modify(e)}},{key:"put",value:function(t,e){var n=this,r=this.schema.primKey,o=r.auto,i=r.keyPath,a=t;return i&&o&&(a=Lt(i)(t)),this._trans("readwrite",(function(t){return n.core.mutate({trans:t,type:"put",values:[a],keys:null!=e?[e]:null})})).then((function(t){return t.numFailures?lt.reject(t.failures[0]):t.lastResult})).then((function(e){if(i)try{er(t,i,e)}catch(t){}return e}))}},{key:"delete",value:function(t){var e=this;return this._trans("readwrite",(function(n){return e.core.mutate({trans:n,type:"delete",keys:[t]})})).then((function(t){return t.numFailures?lt.reject(t.failures[0]):void 0}))}},{key:"clear",value:function(){var t=this;return this._trans("readwrite",(function(e){return t.core.mutate({trans:e,type:"deleteRange",range:lo})})).then((function(t){return t.numFailures?lt.reject(t.failures[0]):void 0}))}},{key:"bulkGet",value:function(t){var e=this;return this._trans("readonly",(function(n){return e.core.getMany({keys:t,trans:n}).then((function(t){return t.map((function(t){return e.hook.reading.fire(t)}))}))}))}},{key:"bulkAdd",value:function(t,e,n){var r=this,o=Array.isArray(e)?e:void 0,i=(n=n||(o?void 0:e))?n.allKeys:void 0;return this._trans("readwrite",(function(e){var n=r.schema.primKey,a=n.auto,u=n.keyPath;if(u&&o)throw new Sr.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(o&&o.length!==t.length)throw new Sr.InvalidArgument("Arguments objects and keys must have the same length");var s=t.length,c=u&&a?t.map(Lt(u)):t;return r.core.mutate({trans:e,type:"add",keys:o,values:c,wantResults:i}).then((function(t){var e=t.numFailures,n=t.results,o=t.lastResult,a=t.failures;if(0===e)return i?n:o;throw new tt("".concat(r.name,".bulkAdd(): ").concat(e," of ").concat(s," operations failed"),a)}))}))}},{key:"bulkPut",value:function(t,e,n){var r=this,o=Array.isArray(e)?e:void 0,i=(n=n||(o?void 0:e))?n.allKeys:void 0;return this._trans("readwrite",(function(e){var n=r.schema.primKey,a=n.auto,u=n.keyPath;if(u&&o)throw new Sr.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(o&&o.length!==t.length)throw new Sr.InvalidArgument("Arguments objects and keys must have the same length");var s=t.length,c=u&&a?t.map(Lt(u)):t;return r.core.mutate({trans:e,type:"put",keys:o,values:c,wantResults:i}).then((function(t){var e=t.numFailures,n=t.results,o=t.lastResult,a=t.failures;if(0===e)return i?n:o;throw new tt("".concat(r.name,".bulkPut(): ").concat(e," of ").concat(s," operations failed"),a)}))}))}},{key:"bulkDelete",value:function(t){var e=this,n=t.length;return this._trans("readwrite",(function(n){return e.core.mutate({trans:n,type:"delete",keys:t})})).then((function(t){var r=t.numFailures,o=t.lastResult,i=t.failures;if(0===r)return o;throw new tt("".concat(e.name,".bulkDelete(): ").concat(r," of ").concat(n," operations failed"),i)}))}}]),t}();function ho(t,e){try{var n=$t(t),r=$t(e);if(n!==r)return"Array"===n?1:"Array"===r?-1:"binary"===n?1:"binary"===r?-1:"string"===n?1:"string"===r?-1:"Date"===n?1:"Date"!==r?NaN:-1;switch(n){case"number":case"Date":case"string":return t>e?1:t<e?-1:0;case"binary":return function(t,e){for(var n=t.length,r=e.length,o=n<r?n:r,i=0;i<o;++i)if(t[i]!==e[i])return t[i]<e[i]?-1:1;return n===r?0:n<r?-1:1}(qt(t),qt(e));case"Array":return function(t,e){for(var n=t.length,r=e.length,o=n<r?n:r,i=0;i<o;++i){var a=ho(t[i],e[i]);if(0!==a)return a}return n===r?0:n<r?-1:1}(t,e)}}catch(t){}return NaN}var po=function(){function t(){o(this,t)}return a(t,[{key:"_read",value:function(t,e){var n=this._ctx;return n.error?n.table._trans(null,eo.bind(null,n.error)):n.table._trans("readonly",t).then(e)}},{key:"_write",value:function(t){var e=this._ctx;return e.error?e.table._trans(null,eo.bind(null,e.error)):e.table._trans("readwrite",t,"locked")}},{key:"_addAlgorithm",value:function(t){var e=this._ctx;e.algorithm=Nt(e.algorithm,t)}},{key:"_iterate",value:function(t,e){return Wt(this._ctx,t,e,this._ctx.table.core)}},{key:"clone",value:function(t){var e=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return t&&D(n,t),e._ctx=n,e}},{key:"raw",value:function(){return this._ctx.valueMapper=null,this}},{key:"each",value:function(t){var e=this._ctx;return this._read((function(n){return Wt(e,t,n,e.table.core)}))}},{key:"count",value:function(t){var e=this;return this._read((function(t){var n=e._ctx,r=n.table.core;if(Ft(n,!0))return r.count({trans:t,query:{index:Ht(n,r.schema),range:n.range}}).then((function(t){return Math.min(t,n.limit)}));var o=0;return Wt(n,(function(){return++o,!1}),t,r).then((function(){return o}))})).then(t)}},{key:"sortBy",value:function(t,e){var n=t.split(".").reverse(),r=n[0],o=n.length-1;function i(t,e){return e?i(t[n[e]],e-1):t[r]}var a="next"===this._ctx.dir?1:-1;function u(t,e){var n=i(t,o),r=i(e,o);return n<r?-a:n>r?a:0}return this.toArray((function(t){return t.sort(u)})).then(e)}},{key:"toArray",value:function(t){var e=this;return this._read((function(t){var n=e._ctx;if("next"===n.dir&&Ft(n,!0)&&n.limit>0){var r=n.valueMapper,o=Ht(n,n.table.core.schema);return n.table.core.query({trans:t,limit:n.limit,values:!0,query:{index:o,range:n.range}}).then((function(t){var e=t.result;return r?e.map(r):e}))}var i=[];return Wt(n,(function(t){return i.push(t)}),t,n.table.core).then((function(){return i}))}),t)}},{key:"offset",value:function(t){var e=this._ctx;return t<=0||(e.offset+=t,Ft(e)?Vt(e,(function(){var e=t;return function(t,n){return 0===e||(1===e?(--e,!1):(n((function(){t.advance(e),e=0})),!1))}})):Vt(e,(function(){var e=t;return function(){return--e<0}}))),this}},{key:"limit",value:function(t){return this._ctx.limit=Math.min(this._ctx.limit,t),Vt(this._ctx,(function(){var e=t;return function(t,n,r){return--e<=0&&n(r),e>=0}}),!0),this}},{key:"until",value:function(t,e){return zt(this._ctx,(function(n,r,o){return!t(n.value)||(r(o),e)})),this}},{key:"first",value:function(t){return this.limit(1).toArray((function(t){return t[0]})).then(t)}},{key:"last",value:function(t){return this.reverse().first(t)}},{key:"filter",value:function(t){var e,n;return zt(this._ctx,(function(e){return t(e.value)})),e=this._ctx,n=t,e.isMatch=Nt(e.isMatch,n),this}},{key:"and",value:function(t){return this.filter(t)}},{key:"or",value:function(t){return new this.db.WhereClause(this._ctx.table,t,this)}},{key:"reverse",value:function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this}},{key:"desc",value:function(){return this.reverse()}},{key:"eachKey",value:function(t){var e=this._ctx;return e.keysOnly=!e.isMatch,this.each((function(e,n){t(n.key,n)}))}},{key:"eachUniqueKey",value:function(t){return this._ctx.unique="unique",this.eachKey(t)}},{key:"eachPrimaryKey",value:function(t){var e=this._ctx;return e.keysOnly=!e.isMatch,this.each((function(e,n){t(n.primaryKey,n)}))}},{key:"keys",value:function(t){var e=this._ctx;e.keysOnly=!e.isMatch;var n=[];return this.each((function(t,e){n.push(e.key)})).then((function(){return n})).then(t)}},{key:"primaryKeys",value:function(t){var e=this._ctx;if("next"===e.dir&&Ft(e,!0)&&e.limit>0)return this._read((function(t){var n=Ht(e,e.table.core.schema);return e.table.core.query({trans:t,values:!1,limit:e.limit,query:{index:n,range:e.range}})})).then((function(t){return t.result})).then(t);e.keysOnly=!e.isMatch;var n=[];return this.each((function(t,e){n.push(e.primaryKey)})).then((function(){return n})).then(t)}},{key:"uniqueKeys",value:function(t){return this._ctx.unique="unique",this.keys(t)}},{key:"firstKey",value:function(t){return this.limit(1).keys((function(t){return t[0]})).then(t)}},{key:"lastKey",value:function(t){return this.reverse().firstKey(t)}},{key:"distinct",value:function(){var t=this._ctx,e=t.index&&t.table.schema.idxByName[t.index];if(!e||!e.multi)return this;var n={};return zt(this._ctx,(function(t){var e=t.primaryKey.toString(),r=R(n,e);return n[e]=!0,!r})),this}},{key:"modify",value:function(t){var e=this,n=this._ctx;return this._write((function(r){var o;if("function"==typeof t)o=t;else{var i=Kn(t),a=i.length;o=function(e){for(var n=!1,r=0;r<a;++r){var o=i[r],u=t[o];tr(e,o)!==u&&(er(e,o,u),n=!0)}return n}}var u=n.table.core,s=u.schema.primaryKey,c=s.outbound,l=s.extractKey,f=e.db._options.modifyChunkSize||200,h=[],d=0,v=[],y=function(t,e){var n=e.failures,r=e.numFailures;d+=t-r;var o=!0,i=!1,a=void 0;try{for(var u,s=Kn(n)[Symbol.iterator]();!(o=(u=s.next()).done);o=!0){var c=u.value;h.push(n[c])}}catch(t){i=!0,a=t}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}};return e.clone().primaryKeys().then((function(e){var i=function(a){var s=Math.min(f,e.length-a);return u.getMany({trans:r,keys:e.slice(a,a+s),cache:"immutable"}).then((function(h){for(var d=[],v=[],m=c?[]:null,g=[],b=0;b<s;++b){var w=h[b],S={value:K(w),primKey:e[a+b]};!1!==o.call(S,S.value,S)&&(null==S.value?g.push(e[a+b]):c||0===ho(l(w),l(S.value))?(v.push(S.value),c&&m.push(e[a+b])):(g.push(e[a+b]),d.push(S.value)))}var O=Ft(n)&&n.limit===1/0&&("function"!=typeof t||t===vo)&&{index:n.index,range:n.range};return Promise.resolve(d.length>0&&u.mutate({trans:r,type:"add",values:d}).then((function(t){for(var e in t.failures)g.splice(parseInt(e),1);y(d.length,t)}))).then((function(){return(v.length>0||O&&"object"==(void 0===t?"undefined":p(t)))&&u.mutate({trans:r,type:"put",keys:m,values:v,criteria:O,changeSpec:"function"!=typeof t&&t}).then((function(t){return y(v.length,t)}))})).then((function(){return(g.length>0||O&&t===vo)&&u.mutate({trans:r,type:"delete",keys:g,criteria:O}).then((function(t){return y(g.length,t)}))})).then((function(){return e.length>a+s&&i(a+f)}))}))};return i(0).then((function(){if(h.length>0)throw new Z("Error modifying one or more objects",h,d,v);return e.length}))}))}))}},{key:"delete",value:function(){var t=this._ctx,e=t.range;return Ft(t)&&(t.isPrimKey&&!so||3===e.type)?this._write((function(n){var r=t.table.core.schema.primaryKey,o=e;return t.table.core.count({trans:n,query:{index:r,range:o}}).then((function(e){return t.table.core.mutate({trans:n,type:"deleteRange",range:o}).then((function(t){var n=t.failures,r=(t.lastResult,t.results,t.numFailures);if(r)throw new Z("Could not delete some values",Object.keys(n).map((function(t){return n[t]})),e-r);return e-r}))}))})):this.modify(vo)}}]),t}(),vo=function(t,e){return e.value=null},yo=function(){function t(){o(this,t)}return a(t,[{key:"Collection",get:function(){return this._ctx.table.db.Collection}},{key:"between",value:function(t,e,n,r){n=!1!==n,r=!0===r;try{return this._cmp(t,e)>0||0===this._cmp(t,e)&&(n||r)&&(!n||!r)?Xt(this):new this.Collection(this,(function(){return ee(t,e,!n,!r)}))}catch(t){return Qt(this,oo)}}},{key:"equals",value:function(t){return null==t?Qt(this,oo):new this.Collection(this,(function(){return ne(t)}))}},{key:"above",value:function(t){return null==t?Qt(this,oo):new this.Collection(this,(function(){return ee(t,void 0,!0)}))}},{key:"aboveOrEqual",value:function(t){return null==t?Qt(this,oo):new this.Collection(this,(function(){return ee(t,void 0,!1)}))}},{key:"below",value:function(t){return null==t?Qt(this,oo):new this.Collection(this,(function(){return ee(void 0,t,!1,!0)}))}},{key:"belowOrEqual",value:function(t){return null==t?Qt(this,oo):new this.Collection(this,(function(){return ee(void 0,t)}))}},{key:"startsWith",value:function(t){return"string"!=typeof t?Qt(this,"String expected."):this.between(t,t+ro,!0,!0)}},{key:"startsWithIgnoreCase",value:function(t){return""===t?this.startsWith(t):te(this,(function(t,e){return 0===t.indexOf(e[0])}),[t],ro)}},{key:"equalsIgnoreCase",value:function(t){return te(this,(function(t,e){return t===e[0]}),[t],"")}},{key:"anyOfIgnoreCase",value:function(){var t=q.apply(lr,arguments);return 0===t.length?Xt(this):te(this,(function(t,e){return-1!==e.indexOf(t)}),t,"")}},{key:"startsWithAnyOfIgnoreCase",value:function(){var t=q.apply(lr,arguments);return 0===t.length?Xt(this):te(this,(function(t,e){return e.some((function(e){return 0===t.indexOf(e)}))}),t,ro)}},{key:"anyOf",value:function(){var t=this,e=q.apply(lr,arguments),n=this._cmp;try{e.sort(n)}catch(t){return Qt(this,oo)}if(0===e.length)return Xt(this);var r=new this.Collection(this,(function(){return ee(e[0],e[e.length-1])}));r._ondirectionchange=function(r){n="next"===r?t._ascending:t._descending,e.sort(n)};var o=0;return r._addAlgorithm((function(t,r,i){for(var a=t.key;n(a,e[o])>0;)if(++o===e.length)return r(i),!1;return 0===n(a,e[o])||(r((function(){t.continue(e[o])})),!1)})),r}},{key:"notEqual",value:function(t){return this.inAnyRange([[-1/0,t],[t,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}},{key:"noneOf",value:function(){var t=q.apply(lr,arguments);if(0===t.length)return new this.Collection(this);try{t.sort(this._ascending)}catch(t){return Qt(this,oo)}var e=t.reduce((function(t,e){return t?t.concat([[t[t.length-1][1],e]]):[[-1/0,e]]}),null);return e.push([t[t.length-1],this.db._maxKey]),this.inAnyRange(e,{includeLowers:!1,includeUppers:!1})}},{key:"inAnyRange",value:function(t,e){var n=this,r=this._cmp,o=this._ascending,i=this._descending,a=this._min,u=this._max;if(0===t.length)return Xt(this);if(!t.every((function(t){return void 0!==t[0]&&void 0!==t[1]&&o(t[0],t[1])<=0})))return Qt(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Sr.InvalidArgument);var s,c=!e||!1!==e.includeLowers,l=e&&!0===e.includeUppers,f=o;function h(t,e){return f(t[0],e[0])}try{s=t.reduce((function(t,e){for(var n=0,o=t.length;n<o;++n){var i=t[n];if(r(e[0],i[1])<0&&r(e[1],i[0])>0){i[0]=a(i[0],e[0]),i[1]=u(i[1],e[1]);break}}return n===o&&t.push(e),t}),[]),s.sort(h)}catch(t){return Qt(this,oo)}var p=0,d=l?function(t){return o(t,s[p][1])>0}:function(t){return o(t,s[p][1])>=0},v=c?function(t){return i(t,s[p][0])>0}:function(t){return i(t,s[p][0])>=0},y=d,m=new this.Collection(this,(function(){return ee(s[0][0],s[s.length-1][1],!c,!l)}));return m._ondirectionchange=function(t){"next"===t?(y=d,f=o):(y=v,f=i),s.sort(h)},m._addAlgorithm((function(t,e,r){for(var i=t.key;y(i);)if(++p===s.length)return e(r),!1;return!!function(t){return!d(t)&&!v(t)}(i)||(0===n._cmp(i,s[p][1])||0===n._cmp(i,s[p][0])||e((function(){f===o?t.continue(s[p][0]):t.continue(s[p][1])})),!1)})),m}},{key:"startsWithAnyOf",value:function(){var t=q.apply(lr,arguments);return t.every((function(t){return"string"==typeof t}))?0===t.length?Xt(this):this.inAnyRange(t.map((function(t){return[t,t+ro]}))):Qt(this,"startsWithAnyOf() only works with strings")}}]),t}(),mo=Ut(null,"storagemutated"),go=function(){function t(){o(this,t)}return a(t,[{key:"_lock",value:function(){return z(!Vr.global),++this._reculock,1!==this._reculock||Vr.global||(Vr.lockOwnerFor=this),this}},{key:"_unlock",value:function(){if(z(!Vr.global),0==--this._reculock)for(Vr.global||(Vr.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var t=this._blockedFuncs.shift();try{Ct(t[1],t[0])}catch(t){}}return this}},{key:"_locked",value:function(){return this._reculock&&Vr.lockOwnerFor!==this}},{key:"create",value:function(t){var e=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(z(!this.idbtrans),!t&&!n)switch(r&&r.name){case"DatabaseClosedError":throw new Sr.DatabaseClosed(r);case"MissingAPIError":throw new Sr.MissingAPI(r.message,r);default:throw new Sr.OpenFailed(r)}if(!this.active)throw new Sr.TransactionInactive;return z(null===this._completion._state),(t=this.idbtrans=t||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):n.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=Ot((function(n){oe(n),e._reject(t.error)})),t.onabort=Ot((function(n){oe(n),e.active&&e._reject(new Sr.Abort(t.error)),e.active=!1,e.on("abort").fire(n)})),t.oncomplete=Ot((function(){e.active=!1,e._resolve(),"mutatedParts"in t&&mo.storagemutated.fire(t.mutatedParts)})),this}},{key:"_promise",value:function(t,e,n){var r=this;if("readwrite"===t&&"readwrite"!==this.mode)return eo(new Sr.ReadOnly("Transaction is readonly"));if(!this.active)return eo(new Sr.TransactionInactive);if(this._locked())return new lt((function(o,i){r._blockedFuncs.push([function(){r._promise(t,e,n).then(o,i)},Vr])}));if(n)return Et((function(){var t=new lt((function(t,n){r._lock();var o=e(t,n,r);o&&o.then&&o.then(t,n)}));return t.finally((function(){return r._unlock()})),t._lib=!0,t}));var o=new lt((function(t,n){var o=e(t,n,r);o&&o.then&&o.then(t,n)}));return o._lib=!0,o}},{key:"_root",value:function(){return this.parent?this.parent._root():this}},{key:"waitFor",value:function(t){var e=this._root(),n=lt.resolve(t);if(e._waitingFor)e._waitingFor=e._waitingFor.then((function(){return n}));else{e._waitingFor=n,e._waitingQueue=[];var r=e.idbtrans.objectStore(e.storeNames[0]);!function t(){for(++e._spinCount;e._waitingQueue.length;)e._waitingQueue.shift()();e._waitingFor&&(r.get(-1/0).onsuccess=t)}()}var o=e._waitingFor;return new lt((function(t,r){n.then((function(n){return e._waitingQueue.push(Ot(t.bind(null,n)))}),(function(t){return e._waitingQueue.push(Ot(r.bind(null,t)))})).finally((function(){e._waitingFor===o&&(e._waitingFor=null)}))}))}},{key:"abort",value:function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Sr.Abort))}},{key:"table",value:function(t){var e=this._memoizedTables||(this._memoizedTables={});if(R(e,t))return e[t];var n=this.schema[t];if(!n)throw new Sr.NotFound("Table "+t+" not part of transaction");var r=new this.db.Table(t,n,this);return r.core=this.db.core.table(t),e[t]=r,r}}]),t}(),bo=function(t){try{return t.only([[]]),bo=function(){return[[]]},[[]]}catch(t){return bo=function(){return ro},ro}},wo=0,So=function(){function t(){o(this,t)}return a(t,[{key:"_parseStoresSpec",value:function(t,e){Kn(t).forEach((function(n){if(null!==t[n]){var r=t[n].split(",").map((function(t,e){var n=(t=t.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return ie(n,r||null,/\&/.test(t),/\*/.test(t),/\+\+/.test(t),$n(r),0===e)})),o=r.shift();if(o.multi)throw new Sr.Schema("Primary key cannot be multi-valued");r.forEach((function(t){if(t.auto)throw new Sr.Schema("Only primary key can be marked as autoIncrement (++)");if(!t.keyPath)throw new Sr.Schema("Index must have a name and cannot be an empty string")})),e[n]=ue(n,o,r)}}))}},{key:"stores",value:function(t){var e=this.db;this._cfg.storesSource=this._cfg.storesSource?D(this._cfg.storesSource,t):t;var n=e._versions,r={},o={};return n.forEach((function(t){D(r,t._cfg.storesSource),o=t._cfg.dbschema={},t._parseStoresSpec(r,o)})),e._dbSchema=o,pe(e,[e._allTables,e,e.Transaction.prototype]),he(e,[e._allTables,e,e.Transaction.prototype,this._cfg.tables],Kn(o),o),e._storeNames=Kn(o),this}},{key:"upgrade",value:function(t){return this._cfg.contentUpgrade=ct(this._cfg.contentUpgrade||et,t),this}}]),t}();function Oo(t,e,n,r,o){return lt.resolve().then((function(){var i=Vr.transless||Vr,a=t._createTransaction(e,n,t._dbSchema,r),u={trans:a,transless:i};if(r)a.idbtrans=r.idbtrans;else try{a.create(),t._state.PR1398_maxLoop=3}catch(r){return r.name===br.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then((function(){return Oo(t,e,n,null,o)}))):eo(r)}var s,c=fr(o);c&&xt();var l=lt.follow((function(){if(s=o.call(a,a))if(c){var t=jt.bind(null,null);s.then(t,t)}else"function"==typeof s.next&&"function"==typeof s.throw&&(s=xe(s))}),u);return(s&&"function"==typeof s.then?lt.resolve(s).then((function(t){return a.active?t:eo(new Sr.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))})):l.then((function(){return s}))).then((function(t){return r&&a._resolve(),a._completion.then((function(){return t}))})).catch((function(t){return a._reject(t),eo(t)}))}))}var Eo={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(t){return l(c({},t),{table:function(e){var n=t.table(e),r=n.schema,o={},i=[];function a(t,e,n){var r=le(t),u=o[r]=o[r]||[],s=null==t?0:"string"==typeof t?1:t.length,f=e>0,h=l(c({},n),{isVirtual:f,keyTail:e,keyLength:s,extractKey:se(t),unique:!f&&n.unique});return u.push(h),h.isPrimaryKey||i.push(h),s>1&&a(2===s?t[0]:t.slice(0,s-1),e+1,n),u.sort((function(t,e){return t.keyTail-e.keyTail})),h}var u=a(r.primaryKey.keyPath,0,r.primaryKey);o[":id"]=[u];var s=!0,f=!1,h=void 0;try{for(var p,d=r.indexes[Symbol.iterator]();!(s=(p=d.next()).done);s=!0){var v=p.value;a(v.keyPath,0,v)}}catch(t){f=!0,h=t}finally{try{s||null==d.return||d.return()}finally{if(f)throw h}}function y(e){var n,r,o=e.query.index;return o.isVirtual?l(c({},e),{query:{index:o,range:(n=e.query.range,r=o.keyTail,{type:1===n.type?2:n.type,lower:Pe(n.lower,n.lowerOpen?t.MAX_KEY:t.MIN_KEY,r),lowerOpen:!0,upper:Pe(n.upper,n.upperOpen?t.MIN_KEY:t.MAX_KEY,r),upperOpen:!0})}}):e}var m=l(c({},n),{schema:l(c({},r),{primaryKey:u,indexes:i,getIndexByKeyPath:function(t){var e=o[le(t)];return e&&e[0]}}),count:function(t){return n.count(y(t))},query:function(t){return n.query(y(t))},openCursor:function(e){var r=e.query.index,o=r.keyTail,i=r.isVirtual,a=r.keyLength;return i?n.openCursor(y(e)).then((function(n){return n&&function(n){var r=Object.create(n,{continue:{value:function(r){null!=r?n.continue(Pe(r,e.reverse?t.MAX_KEY:t.MIN_KEY,o)):e.unique?n.continue(n.key.slice(0,a).concat(e.reverse?t.MIN_KEY:t.MAX_KEY,o)):n.continue()}},continuePrimaryKey:{value:function(e,r){n.continuePrimaryKey(Pe(e,t.MAX_KEY,o),r)}},primaryKey:{get:function(){return n.primaryKey}},key:{get:function(){var t=n.key;return 1===a?t[0]:t.slice(0,a)}},value:{get:function(){return n.value}}});return r}(n)})):n.openCursor(e)}});return m}})}};function xo(t,e,n,r){return n=n||{},r=r||"",Kn(t).forEach((function(o){if(R(e,o)){var i=t[o],a=e[o];if("object"==(void 0===i?"undefined":p(i))&&"object"==(void 0===a?"undefined":p(a))&&i&&a){var u=$(i);u!==$(a)?n[r+o]=e[o]:"Object"===u?xo(i,a,n,r+o+"."):i!==a&&(n[r+o]=e[o])}else i!==a&&(n[r+o]=e[o])}else n[r+o]=void 0})),Kn(e).forEach((function(o){R(t,o)||(n[r+o]=e[o])})),n}var jo={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(t){return l(c({},t),{table:function(e){var n=t.table(e),r=n.schema.primaryKey,o=l(c({},n),{mutate:function(t){var o=Vr.trans,i=o.table(e).hook,a=i.deleting,u=i.creating,s=i.updating;switch(t.type){case"add":if(u.fire===et)break;return o._promise("readwrite",(function(){return f(t)}),!0);case"put":if(u.fire===et&&s.fire===et)break;return o._promise("readwrite",(function(){return f(t)}),!0);case"delete":if(a.fire===et)break;return o._promise("readwrite",(function(){return f(t)}),!0);case"deleteRange":if(a.fire===et)break;return o._promise("readwrite",(function(){return function(t){return p(t.trans,t.range,1e4)}(t)}),!0)}return n.mutate(t);function f(t){var e=Vr.trans,o=t.keys||function(t,e){return"delete"===e.type?e.keys:e.keys||e.values.map(t.extractKey)}(r,t);if(!o)throw new Error("Keys missing");return"delete"!==(t="add"===t.type||"put"===t.type?l(c({},t),{keys:o}):c({},t)).type&&(t.values=h(t.values)),t.keys&&(t.keys=h(t.keys)),function(t,e,n){return"add"===e.type?Promise.resolve([]):t.getMany({trans:e.trans,keys:n,cache:"immutable"})}(n,t,o).then((function(i){var c=o.map((function(n,o){var c=i[o],l={onerror:null,onsuccess:null};if("delete"===t.type)a.fire.call(l,n,c,e);else if("add"===t.type||void 0===c){var f=u.fire.call(l,n,t.values[o],e);null==n&&null!=f&&(n=f,t.keys[o]=n,r.outbound||er(t.values[o],r.keyPath,n))}else{var h=xo(c,t.values[o]),p=s.fire.call(l,h,n,c,e);if(p){var d=t.values[o];Object.keys(p).forEach((function(t){R(d,t)?d[t]=p[t]:er(d,t,p[t])}))}}return l}));return n.mutate(t).then((function(e){for(var n=e.failures,r=e.results,a=e.numFailures,u=e.lastResult,s=0;s<o.length;++s){var l=r?r[s]:o[s],f=c[s];null==l?f.onerror&&f.onerror(n[s]):f.onsuccess&&f.onsuccess("put"===t.type&&i[s]?t.values[s]:l)}return{failures:n,results:r,numFailures:a,lastResult:u}})).catch((function(t){return c.forEach((function(e){return e.onerror&&e.onerror(t)})),Promise.reject(t)}))}))}function p(t,e,o){return n.query({trans:t,values:!1,query:{index:r,range:e},limit:o}).then((function(n){var r=n.result;return f({type:"delete",keys:r,trans:t}).then((function(n){return n.numFailures>0?Promise.reject(n.failures[0]):r.length<o?{failures:[],numFailures:0,lastResult:void 0}:p(t,l(c({},e),{lower:r[r.length-1],lowerOpen:!0}),o)}))}))}}});return o}})}},Po={stack:"dbcore",level:-1,create:function(t){return{table:function(e){var n=t.table(e);return l(c({},n),{getMany:function(t){if(!t.cache)return n.getMany(t);var e=_e(t.keys,t.trans._cache,"clone"===t.cache);return e?lt.resolve(e):n.getMany(t).then((function(e){return t.trans._cache={keys:t.keys,values:"clone"===t.cache?K(e):e},e}))},mutate:function(t){return"add"!==t.type&&(t.trans._cache=null),n.mutate(t)}})}}}},_o=function(t,e){if(!this){var n=new _o;return t&&"d"in t&&D(n,t),n}D(this,arguments.length?{d:1,from:t,to:arguments.length>1?e:t}:{d:0})};function Ao(t,e,n){var r=ho(e,n);if(!isNaN(r)){if(r>0)throw RangeError();if(Ae(t))return D(t,{from:e,to:n,d:1});var o=t.l,i=t.r;if(ho(n,t.from)<0)return o?Ao(o,e,n):t.l={from:e,to:n,d:1,l:null,r:null},Ce(t);if(ho(e,t.to)>0)return i?Ao(i,e,n):t.r={from:e,to:n,d:1,l:null,r:null},Ce(t);ho(e,t.from)<0&&(t.from=e,t.l=null,t.d=i?i.d+1:1),ho(n,t.to)>0&&(t.to=n,t.r=null,t.d=t.l?t.l.d+1:1);var a=!t.r;o&&!t.l&&ke(t,o),i&&a&&ke(t,i)}}N(_o.prototype,u({add:function(t){return ke(this,t),this},addKey:function(t){return Ao(this,t,t),this},addKeys:function(t){var e=this;return t.forEach((function(t){return Ao(e,t,t)})),this}},sr,(function(){return Te(this)})));var ko,To={stack:"dbcore",level:0,create:function(t){var e=t.schema.name,n=new _o(t.MIN_KEY,t.MAX_KEY);return l(c({},t),{table:function(r){var o=t.table(r),i=o.schema,a=i.primaryKey,u=a.extractKey,s=a.outbound,h=l(c({},o),{mutate:function(t){var a=t.trans,u=a.mutatedParts||(a.mutatedParts={}),s=function(t){var n="idb://".concat(e,"/").concat(r,"/").concat(t);return u[n]||(u[n]=new _o)},c=s(""),l=s(":dels"),h=t.type,p=f("deleteRange"===t.type?[t.range]:"delete"===t.type?[t.keys]:t.values.length<50?[[],t.values]:[],2),d=p[0],v=p[1],y=t.trans._cache;return o.mutate(t).then((function(t){if($n(d)){"delete"!==h&&(d=t.results),c.addKeys(d);var e=_e(d,y);e||"add"===h||l.addKeys(d),(e||v)&&function(t,e,n,r){e.indexes.forEach((function(e){var o=t(e.name||"");function i(t){return null!=t?e.extractKey(t):null}var a=function(t){return e.multiEntry&&$n(t)?t.forEach((function(t){return o.addKey(t)})):o.addKey(t)};(n||r).forEach((function(t,e){var o=n&&i(n[e]),u=r&&i(r[e]);0!==ho(o,u)&&(null!=o&&a(o),null!=u&&a(u))}))}))}(s,i,e,v)}else if(d){var r={from:d.lower,to:d.upper};l.add(r),c.add(r)}else c.add(n),l.add(n),i.indexes.forEach((function(t){return s(t.name).add(n)}));return t}))}}),p=function(e){var n,r,o=e.query,i=o.index,a=o.range;return[i,new _o(null!==(n=a.lower)&&void 0!==n?n:t.MIN_KEY,null!==(r=a.upper)&&void 0!==r?r:t.MAX_KEY)]},d={get:function(t){return[a,new _o(t.key)]},getMany:function(t){return[a,(new _o).addKeys(t.keys)]},count:p,query:p,openCursor:p};return Kn(d).forEach((function(t){h[t]=function(i){var a=Vr.subscr;if(a){var h=function(t){var n="idb://".concat(e,"/").concat(r,"/").concat(t);return a[n]||(a[n]=new _o)},p=h(""),v=h(":dels"),y=f(d[t](i),2),m=y[0],g=y[1];if(h(m.name||"").add(g),!m.isPrimaryKey){if("count"!==t){var b="query"===t&&s&&i.values&&o.query(l(c({},i),{values:!1}));return o[t].apply(this,arguments).then((function(e){if("query"===t){if(s&&i.values)return b.then((function(t){var n=t.result;return p.addKeys(n),e}));var n=i.values?e.result.map(u):e.result;i.values?p.addKeys(n):v.addKeys(n)}else if("openCursor"===t){var r=e,o=i.values;return r&&Object.create(r,{key:{get:function(){return v.addKey(r.primaryKey),r.key}},primaryKey:{get:function(){var t=r.primaryKey;return v.addKey(t),t}},value:{get:function(){return o&&p.addKey(r.primaryKey),r.value}}})}return e}))}v.add(n)}}return o[t].apply(this,arguments)}})),h}})}},Co=function(){function t(e,n){var r=this;o(this,t),this._middlewares={},this.verno=0;var i=t.dependencies;this._options=n=c({addons:t.addons,autoOpen:!0,indexedDB:i.indexedDB,IDBKeyRange:i.IDBKeyRange},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange};var a=n.addons;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var u,s={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:et,dbReadyPromise:null,cancelOpen:et,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};s.dbReadyPromise=new lt((function(t){s.dbReadyResolve=t})),s.openCanceller=new lt((function(t,e){s.cancelOpen=e})),this._state=s,this.name=e,this.on=Ut(this,"populate","blocked","versionchange","close",{ready:[ct,et]}),this.on.ready.subscribe=F(this.on.ready.subscribe,(function(e){return function(n,o){t.vip((function(){var t=r._state;if(t.openComplete)t.dbOpenError||lt.resolve().then(n),o&&e(n);else if(t.onReadyBeingFired)t.onReadyBeingFired.push(n),o&&e(n);else{e(n);var i=r;o||e((function t(){i.on.ready.unsubscribe(n),i.on.ready.unsubscribe(t)}))}}))}})),this.Collection=(u=this,Bt(po.prototype,(function(t,e){this.db=u;var n=lo,r=null;if(e)try{n=e()}catch(t){r=t}var o=t._ctx,i=o.table,a=i.hook.reading.fire;this._ctx={table:i,index:o.index,isPrimKey:!o.index||i.schema.primKey.keyPath&&o.index===i.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:r,or:o.or,valueMapper:a!==nt?a:null}}))),this.Table=function(t){return Bt(fo.prototype,(function(e,n,r){this.db=t,this._tx=r,this.name=e,this.schema=n,this.hook=t._allTables[e]?t._allTables[e].hook:Ut(null,{creating:[it,et],reading:[rt,nt],updating:[ut,et],deleting:[at,et]})}))}(this),this.Transaction=function(t){return Bt(go.prototype,(function(e,n,r,o,i){var a=this;this.db=t,this.mode=e,this.storeNames=n,this.schema=r,this.chromeTransactionDurability=o,this.idbtrans=null,this.on=Ut(this,"complete","error","abort"),this.parent=i||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new lt((function(t,e){a._resolve=t,a._reject=e})),this._completion.then((function(){a.active=!1,a.on.complete.fire()}),(function(t){var e=a.active;return a.active=!1,a.on.error.fire(t),a.parent?a.parent._reject(t):e&&a.idbtrans&&a.idbtrans.abort(),eo(t)}))}))}(this),this.Version=function(t){return Bt(So.prototype,(function(e){this.db=t,this._cfg={version:e,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(t){return Bt(yo.prototype,(function(e,n,r){this.db=t,this._ctx={table:e,index:":id"===n?null:n,or:r};var o=t._deps.indexedDB;if(!o)throw new Sr.MissingAPI;this._cmp=this._ascending=o.cmp.bind(o),this._descending=function(t,e){return o.cmp(e,t)},this._max=function(t,e){return o.cmp(t,e)>0?t:e},this._min=function(t,e){return o.cmp(t,e)<0?t:e},this._IDBKeyRange=t._deps.IDBKeyRange}))}(this),this.on("versionchange",(function(t){t.newVersion>0?console.warn("Another connection wants to upgrade database '".concat(r.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(r.name,"'. Closing db now to resume the delete request.")),r.close()})),this.on("blocked",(function(t){!t.newVersion||t.newVersion<t.oldVersion?console.warn("Dexie.delete('".concat(r.name,"') was blocked")):console.warn("Upgrade '".concat(r.name,"' blocked by other connection holding version ").concat(t.oldVersion/10))})),this._maxKey=bo(n.IDBKeyRange),this._createTransaction=function(t,e,n,o){return new r.Transaction(t,e,n,r._options.chromeTransactionDurability,o)},this._fireOnBlocked=function(t){r.on("blocked").fire(t),io.filter((function(t){return t.name===r.name&&t!==r&&!t._state.vcFired})).map((function(e){return e.on("versionchange").fire(t)}))},this.use(Eo),this.use(jo),this.use(To),this.use(Po),this.vip=Object.create(this,{_vip:{value:!0}}),a.forEach((function(t){return t(r)}))}return a(t,[{key:"version",value:function(t){if(isNaN(t)||t<.1)throw new Sr.Type("Given version is not a positive number");if(t=Math.round(10*t)/10,this.idbdb||this._state.isBeingOpened)throw new Sr.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,t);var e=this._versions,n=e.filter((function(e){return e._cfg.version===t}))[0];return n||(n=new this.Version(t),e.push(n),e.sort(de),n.stores({}),this._state.autoSchema=!1,n)}},{key:"_whenReady",value:function(t){var e=this;return this.idbdb&&(this._state.openComplete||Vr.letThrough||this._vip)?t():new lt((function(t,n){if(e._state.openComplete)return n(new Sr.DatabaseClosed(e._state.dbOpenError));if(!e._state.isBeingOpened){if(!e._options.autoOpen)return void n(new Sr.DatabaseClosed);e.open().catch(et)}e._state.dbReadyPromise.then(t,n)})).then(t)}},{key:"use",value:function(t){var e=t.stack,n=t.create,r=t.level,o=t.name;o&&this.unuse({stack:e,name:o});var i=this._middlewares[e]||(this._middlewares[e]=[]);return i.push({stack:e,create:n,level:null==r?10:r,name:o}),i.sort((function(t,e){return t.level-e.level})),this}},{key:"unuse",value:function(t){var e=t.stack,n=t.name,r=t.create;return e&&this._middlewares[e]&&(this._middlewares[e]=this._middlewares[e].filter((function(t){return r?t.create!==r:!!n&&t.name!==n}))),this}},{key:"open",value:function(){return function(t){var e=t._state,n=t._deps.indexedDB;if(e.isBeingOpened||t.idbdb)return e.dbReadyPromise.then((function(){return e.dbOpenError?eo(e.dbOpenError):t}));hr&&(e.openCanceller._stackHolder=vr()),e.isBeingOpened=!0,e.dbOpenError=null,e.openComplete=!1;var r=e.openCanceller;function o(){if(e.openCanceller!==r)throw new Sr.DatabaseClosed("db.open() was cancelled")}var i=e.dbReadyResolve,a=null,u=!1;return lt.race([r,("undefined"==typeof navigator?lt.resolve():Ee()).then((function(){return new lt((function(r,i){if(o(),!n)throw new Sr.MissingAPI;var s=t.name,c=e.autoSchema?n.open(s):n.open(s,Math.round(10*t.verno));if(!c)throw new Sr.MissingAPI;c.onerror=re(i),c.onblocked=Ot(t._fireOnBlocked),c.onupgradeneeded=Ot((function(r){if(a=c.transaction,e.autoSchema&&!t._options.allowEmptyDB){c.onerror=oe,a.abort(),c.result.close();var o=n.deleteDatabase(s);o.onsuccess=o.onerror=Ot((function(){i(new Sr.NoSuchDatabase("Database ".concat(s," doesnt exist")))}))}else{a.onerror=re(i);var l=r.oldVersion>Math.pow(2,62)?0:r.oldVersion;u=l<1,t._novip.idbdb=c.result,function(t,e,n,r){var o=t._dbSchema,i=t._createTransaction("readwrite",t._storeNames,o);i.create(n),i._completion.catch(r);var a=i._reject.bind(i),u=Vr.transless||Vr;Et((function(){Vr.trans=i,Vr.transless=u,0===e?(Kn(o).forEach((function(t){ye(n,t,o[t].primKey,o[t].indexes)})),fe(t,n),lt.follow((function(){return t.on.populate.fire(i)})).catch(a)):function(t,e,n,r){var o=t._novip,i=[],a=o._versions,u=o._dbSchema=ge(0,o.idbdb,r),s=!1;return a.filter((function(t){return t._cfg.version>=e})).forEach((function(t){i.push((function(){var i=u,a=t._cfg.dbschema;be(o,i,r),be(o,a,r),u=o._dbSchema=a;var c=ve(i,a);c.add.forEach((function(t){ye(r,t[0],t[1].primKey,t[1].indexes)})),c.change.forEach((function(t){if(t.recreate)throw new Sr.Upgrade("Not yet support for changing primary key");var e=r.objectStore(t.name);t.add.forEach((function(t){return me(e,t)})),t.change.forEach((function(t){e.deleteIndex(t.name),me(e,t)})),t.del.forEach((function(t){return e.deleteIndex(t)}))}));var l=t._cfg.contentUpgrade;if(l&&t._cfg.version>e){fe(o,r),n._memoizedTables={},s=!0;var f=G(a);c.del.forEach((function(t){f[t]=i[t]})),pe(o,[o.Transaction.prototype]),he(o,[o.Transaction.prototype],Kn(f),f),n.schema=f;var h,p=fr(l);p&&xt();var d=lt.follow((function(){if((h=l(n))&&p){var t=jt.bind(null,null);h.then(t,t)}}));return h&&"function"==typeof h.then?lt.resolve(h):d.then((function(){return h}))}})),i.push((function(e){s&&uo||function(t,e){[].slice.call(e.db.objectStoreNames).forEach((function(n){return null==t[n]&&e.db.deleteObjectStore(n)}))}(t._cfg.dbschema,e),pe(o,[o.Transaction.prototype]),he(o,[o.Transaction.prototype],o._storeNames,o._dbSchema),n.schema=o._dbSchema}))})),function t(){return i.length?lt.resolve(i.shift()(n.idbtrans)).then(t):lt.resolve()}().then((function(){var t,e;e=r,Kn(t=u).forEach((function(n){e.db.objectStoreNames.contains(n)||ye(e,n,t[n].primKey,t[n].indexes)}))}))}(t,e,i,n).catch(a)}))}(t,l/10,a,i)}}),i),c.onsuccess=Ot((function(){a=null;var n,o=t._novip.idbdb=c.result,i=B(o.objectStoreNames);if(i.length>0)try{var l=o.transaction(1===(n=i).length?n[0]:n,"readonly");e.autoSchema?function(t,e,n){var r=t._novip;r.verno=e.version/10;var o=r._dbSchema=ge(0,e,n);r._storeNames=B(e.objectStoreNames,0),he(r,[r._allTables],Kn(o),o)}(t,o,l):(be(t,t._dbSchema,l),function(t,e){var n=ve(ge(0,t.idbdb,e),t._dbSchema);return!(n.add.length||n.change.some((function(t){return t.add.length||t.change.length})))}(t,l)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),fe(t,l)}catch(t){}io.push(t),o.onversionchange=Ot((function(n){e.vcFired=!0,t.on("versionchange").fire(n)})),o.onclose=Ot((function(e){t.on("close").fire(e)})),u&&function(t,e){var n=t.indexedDB,r=t.IDBKeyRange;!Se(n)&&"__dbnames"!==e&&we(n,r).put({name:e}).catch(et)}(t._deps,s),r()}),i)}))}))]).then((function(){return o(),e.onReadyBeingFired=[],lt.resolve(Oe((function(){return t.on.ready.fire(t.vip)}))).then((function n(){if(e.onReadyBeingFired.length>0){var r=e.onReadyBeingFired.reduce(ct,et);return e.onReadyBeingFired=[],lt.resolve(Oe((function(){return r(t.vip)}))).then(n)}}))})).finally((function(){e.onReadyBeingFired=null,e.isBeingOpened=!1})).then((function(){return t})).catch((function(n){e.dbOpenError=n;try{a&&a.abort()}catch(t){}return r===e.openCanceller&&t._close(),eo(n)})).finally((function(){e.openComplete=!0,i()}))}(this)}},{key:"_close",value:function(){var t=this._state,e=io.indexOf(this);if(e>=0&&io.splice(e,1),this.idbdb){try{this.idbdb.close()}catch(t){}this._novip.idbdb=null}t.dbReadyPromise=new lt((function(e){t.dbReadyResolve=e})),t.openCanceller=new lt((function(e,n){t.cancelOpen=n}))}},{key:"close",value:function(){this._close();var t=this._state;this._options.autoOpen=!1,t.dbOpenError=new Sr.DatabaseClosed,t.isBeingOpened&&t.cancelOpen(t.dbOpenError)}},{key:"delete",value:function(){var t=this,e=arguments.length>0,n=this._state;return new lt((function(r,o){var i=function(){t.close();var e=t._deps.indexedDB.deleteDatabase(t.name);e.onsuccess=Ot((function(){!function(t,e){var n=t.indexedDB,r=t.IDBKeyRange;!Se(n)&&"__dbnames"!==e&&we(n,r).delete(e).catch(et)}(t._deps,t.name),r()})),e.onerror=re(o),e.onblocked=t._fireOnBlocked};if(e)throw new Sr.InvalidArgument("Arguments not allowed in db.delete()");n.isBeingOpened?n.dbReadyPromise.then(i):i()}))}},{key:"backendDB",value:function(){return this.idbdb}},{key:"isOpen",value:function(){return null!==this.idbdb}},{key:"hasBeenClosed",value:function(){var t=this._state.dbOpenError;return t&&"DatabaseClosed"===t.name}},{key:"hasFailed",value:function(){return null!==this._state.dbOpenError}},{key:"dynamicallyOpened",value:function(){return this._state.autoSchema}},{key:"tables",get:function(){var t=this;return Kn(this._allTables).map((function(e){return t._allTables[e]}))}},{key:"transaction",value:function(){var t=je.apply(this,arguments);return this._transaction.apply(this,t)}},{key:"_transaction",value:function(t,e,n){var r=this,o=Vr.trans;o&&o.db===this&&-1===t.indexOf("!")||(o=null);var i,a,u=-1!==t.indexOf("?");t=t.replace("!","").replace("?","");try{if(a=e.map((function(t){var e=s(t,r.Table)?t.name:t;if("string"!=typeof e)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return e})),"r"==t||"readonly"===t)i="readonly";else{if("rw"!=t&&"readwrite"!=t)throw new Sr.InvalidArgument("Invalid transaction mode: "+t);i="readwrite"}if(o){if("readonly"===o.mode&&"readwrite"===i){if(!u)throw new Sr.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");o=null}o&&a.forEach((function(t){if(o&&-1===o.storeNames.indexOf(t)){if(!u)throw new Sr.SubTransaction("Table "+t+" not included in parent transaction.");o=null}})),u&&o&&!o.active&&(o=null)}}catch(t){return o?o._promise(null,(function(e,n){n(t)})):eo(t)}var c=Oo.bind(null,this,i,a,o,n);return o?o._promise(i,c,"lock"):Vr.trans?Ct(Vr.transless,(function(){return r._whenReady(c)})):this._whenReady(c)}},{key:"table",value:function(t){if(!R(this._allTables,t))throw new Sr.InvalidTable("Table ".concat(t," does not exist"));return this._allTables[t]}}]),t}(),Io="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable",Mo=function(){function t(e){o(this,t),this._subscribe=e}return a(t,[{key:"subscribe",value:function(t,e,n){return this._subscribe(t&&"function"!=typeof t?t:{next:t,error:e,complete:n})}},{key:Io,value:function(){return this}}]),t}();try{ko={indexedDB:Wn.indexedDB||Wn.mozIndexedDB||Wn.webkitIndexedDB||Wn.msIndexedDB,IDBKeyRange:Wn.IDBKeyRange||Wn.webkitIDBKeyRange}}catch(r){ko={indexedDB:null,IDBKeyRange:null}}var Do=Co;N(Do,l(c({},Er),{delete:function(t){return new Do(t,{addons:[]}).delete()},exists:function(t){return new Do(t,{addons:[]}).open().then((function(t){return t.close(),!0})).catch("NoSuchDatabaseError",(function(){return!1}))},getDatabaseNames:function(t){try{return function(t){var e=t.indexedDB,n=t.IDBKeyRange;return Se(e)?Promise.resolve(e.databases()).then((function(t){return t.map((function(t){return t.name})).filter((function(t){return"__dbnames"!==t}))})):we(e,n).toCollection().primaryKeys()}(Do.dependencies).then(t)}catch(t){return eo(new Sr.MissingAPI)}},defineClass:function(){return function(t){D(this,t)}},ignoreTransaction:function(t){return Vr.trans?Ct(Vr.transless,t):t()},vip:Oe,async:function(t){return function(){try{var e=xe(t.apply(this,arguments));return e&&"function"==typeof e.then?e:lt.resolve(e)}catch(t){return eo(t)}}},spawn:function(t,e,n){try{var r=xe(t.apply(n,e||[]));return r&&"function"==typeof r.then?r:lt.resolve(r)}catch(t){return eo(t)}},currentTransaction:{get:function(){return Vr.trans||null}},waitFor:function(t,e){var n=lt.resolve("function"==typeof t?Do.ignoreTransaction(t):t).timeout(e||6e4);return Vr.trans?Vr.trans.waitFor(n):n},Promise:lt,debug:{get:function(){return hr},set:function(t){J(t,"dexie"===t?function(){return!0}:co)}},derive:U,extend:D,props:N,override:F,Events:Ut,on:mo,liveQuery:function(t){return new Mo((function(e){var n=function(){return Kn(a).some((function(t){return i[t]&&function(t,e){var n=Te(e),r=n.next();if(r.done)return!1;for(var o=r.value,i=Te(t),a=i.next(o.from),u=a.value;!r.done&&!a.done;){if(ho(u.from,o.to)<=0&&ho(u.to,o.from)>=0)return!0;ho(o.from,u.from)<0?o=(r=n.next(u.from)).value:u=(a=i.next(o.from)).value}return!1}(i[t],a[t])}))},r=fr(t),o=!1,i={},a={},u={get closed(){return o},unsubscribe:function(){o=!0,mo.storagemutated.unsubscribe(l)}};e.start&&e.start(u);var s=!1,c=!1,l=function(t){Me(i,t),n()&&f()},f=function(){if(!s&&!o){i={};var h={},p=function(e){r&&xt();var n=function(){return Et(t,{subscr:e,trans:null})},o=Vr.trans?Ct(Vr.transless,n):n();return r&&o.then(jt,jt),o}(h);c||(mo("storagemutated",l),c=!0),s=!0,Promise.resolve(p).then((function(t){s=!1,o||(n()?f():(i={},a=h,e.next&&e.next(t)))}),(function(t){s=!1,e.error&&e.error(t),u.unsubscribe()}))}};return f(),u}))},extendObservabilitySet:Me,getByKeyPath:tr,setByKeyPath:er,delByKeyPath:function(t,e){"string"==typeof e?er(t,e,void 0):"length"in e&&[].map.call(e,(function(e){er(t,e,void 0)}))},shallowClone:G,deepClone:K,getObjectDiff:xo,cmp:ho,asap:V,minKey:-1/0,addons:[],connections:io,errnames:br,dependencies:ko,semVer:"3.2.3",version:"3.2.3".split(".").map((function(t){return parseInt(t)})).reduce((function(t,e,n){return t+e/Math.pow(10,2*n)}))})),Do.maxKey=bo(Do.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(mo("storagemutated",(function(t){var e;Ro||(ao?(e=document.createEvent("CustomEvent")).initCustomEvent("x-storagemutated-1",!0,!0,t):e=new CustomEvent("x-storagemutated-1",{detail:t}),Ro=!0,dispatchEvent(e),Ro=!1)})),addEventListener("x-storagemutated-1",(function(t){var e=t.detail;Ro||De(e)})));var Ro=!1;if("undefined"!=typeof BroadcastChannel){var No=new BroadcastChannel("x-storagemutated-1");"function"==typeof No.unref&&No.unref(),mo("storagemutated",(function(t){Ro||No.postMessage(t)})),No.onmessage=function(t){t.data&&De(t.data)}}else if("undefined"!=typeof self&&"undefined"!=typeof navigator){mo("storagemutated",(function(t){try{Ro||("undefined"!=typeof localStorage&&localStorage.setItem("x-storagemutated-1",JSON.stringify({trig:Math.random(),changedParts:t})),"object"==p(self.clients)&&h(self.clients.matchAll({includeUncontrolled:!0})).forEach((function(e){return e.postMessage({type:"x-storagemutated-1",changedParts:t})})))}catch(t){}})),"undefined"!=typeof addEventListener&&addEventListener("storage",(function(t){if("x-storagemutated-1"===t.key){var e=JSON.parse(t.newValue);e&&De(e.changedParts)}}));var Lo=self.document&&navigator.serviceWorker;Lo&&Lo.addEventListener("message",(function(t){var e=t.data;e&&"x-storagemutated-1"===e.type&&De(e.changedParts)}))}lt.rejectionMapper=function(t,e){if(!t||s(t,Q)||s(t,TypeError)||s(t,SyntaxError)||!t.name||!Or[t.name])return t;var n=new Or[t.name](e||t.message,t);return"stack"in t&&L(n,"stack",{get:function(){return this.inner.stack}}),n},J(hr,co);var Uo=d(766),Bo=d(685);function Fo(t){return Fo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Fo(t)}function zo(t,e){return zo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},zo(t,e)}var Vo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&zo(t,e)}(n,t);var e=function(t){var e=function(){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(t){return!1}}();return function(){var n,r=Fo(t);if(e){var o=Fo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(t,e){return!e||"object"!=((n=e)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":void 0===n?"undefined":p(n))&&"function"!=typeof e?Re(t):e;var n}(this,n)}}(n);function n(){var t;return function(t,e){if(!s(t,e))throw new TypeError("Cannot call a class as a function")}(this,n),Ne(Re(t=e.call(this,"EsmOffline")),"syncQueue",void 0),Ne(Re(t),"dynamicOfflineData",void 0),t.version(4).stores({syncQueue:"++id,userId,type,[userId+type]",dynamicOfflineData:"++id,type,identifier,*users,&[type+identifier]"}),t.syncQueue=t.table("syncQueue"),t.dynamicOfflineData=t.table("dynamicOfflineData"),t}return n}(Co),Ho=new Vo,Go={},Wo=(0,Bo.createGlobalStore)("offline-synchronization",{});function Ko(){return Ko=Fe((function(){var t,e,n,r,o,i,a,u,s,c,l,f,h;return Ge(this,(function(p){switch(p.label){case 0:return Wo.getState().synchronization?[2]:[4,Ho.syncQueue.count()];case 1:t=p.sent(),e={},n=Object.entries(Go),r=n.length,o={},i=new AbortController,a=function(){var t,e,n=Wo.getState().synchronization;Wo.setState({synchronization:(t=Ve({},n),e={pendingCount:n.pendingCount-1},e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n.push.apply(n,r)}return n}(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t)})},p.label=2;case 2:p.trys.push([2,,10,11]),Wo.setState({synchronization:{totalCount:t,pendingCount:t,abortController:i}}),u=0,p.label=3;case 3:if(!(u<r&&n.length>0))return[3,8];s=n.length,p.label=4;case 4:return s--?(c=He(n[s],2),l=c[0],f=c[1],(h=f.dependsOn.map((function(t){return e[t]}))).every(Boolean)?(o[l]={},[4,Promise.all(h)]):[3,6]):[3,7];case 5:p.sent(),e[l]=function(t,e,n,r){return $o.apply(this,arguments)}(f,o,i,a),n.splice(s,1),p.label=6;case 6:return[3,4];case 7:return u++,[3,3];case 8:return[4,Promise.allSettled(Object.values(e))];case 9:return p.sent(),[3,11];case 10:return Wo.setState({synchronization:void 0}),[7];case 11:return[2]}}))})),Ko.apply(this,arguments)}function $o(){return $o=Fe((function(t,e,n,r){var o,i,a,u,s,c,l,f,h,p,d,v,y,m,g,b,w;return Ge(this,(function(S){switch(S.label){case 0:return o=t.type,i=t.dependsOn,a=t.process,u=[],s=[],[4,$e()];case 1:return c=S.sent(),[4,Ho.syncQueue.where({type:o,userId:c}).each((function(t,e){u.push([e.primaryKey,t.content,t.descriptor]),s.push(t.content)}))];case 2:S.sent(),l=0,S.label=3;case 3:if(!(l<u.length))return[3,11];f=He(u[l],3),h=f[0],p=f[1],d=f[2],v=d.id,y=d.dependencies,m=void 0===y?[]:y,S.label=4;case 4:return S.trys.push([4,7,9,10]),[4,a(p,{abort:n,index:l,items:s,userId:c,dependencies:m.map((function(t){var n=t.id,r=t.type;return i.includes(r)?e[r][n]:void 0}))})];case 5:return g=S.sent(),void 0!==v&&(e[o][v]=g),[4,Ho.syncQueue.delete(h)];case 6:return S.sent(),[3,10];case 7:return b=S.sent(),[4,Ho.syncQueue.update(h,{lastError:{name:null==b?void 0:b.name,message:null!==(w=null==b?void 0:b.message)&&void 0!==w?w:null==b?void 0:b.toString()}})];case 8:return S.sent(),[3,10];case 9:return r(),[7];case 10:return l++,[3,3];case 11:return[2]}}))})),$o.apply(this,arguments)}function qo(){return(qo=Fe((function(){var t;return Ge(this,(function(e){switch(e.label){case 0:return[4,(0,Uo.getLoggedInUser)()];case 1:return[2,(null==(t=e.sent())?void 0:t.uuid)||"*"]}}))}))).apply(this,arguments)}function Jo(){return(Jo=Fe((function(t,e,n,r){var o;return Ge(this,(function(i){switch(i.label){case 0:return void 0===(o=r&&r.id)?[3,2]:[4,Ho.syncQueue.where({type:e,userId:t}).filter((function(t){return(null==t?void 0:t.descriptor.id)===o})).delete().catch(Co.errnames.DatabaseClosed)];case 1:i.sent(),i.label=2;case 2:return[4,Ho.syncQueue.add({type:e,content:n,userId:t,descriptor:r||{},createdOn:new Date}).catch(Co.errnames.DatabaseClosed,(function(){return-1}))];case 3:return[2,i.sent()]}}))}))).apply(this,arguments)}function Yo(){return(Yo=Fe((function(t,e,n){return Ge(this,(function(r){switch(r.label){case 0:return[4,$e()];case 1:return[4,qe(r.sent(),t,e,n)];case 2:return[2,r.sent()]}}))}))).apply(this,arguments)}function Qo(){return(Qo=Fe((function(t,e){return Ge(this,(function(n){switch(n.label){case 0:return[4,Qe(t,e)];case 1:return[2,n.sent().map((function(t){return t.content}))]}}))}))).apply(this,arguments)}function Xo(){return(Xo=Fe((function(t,e){var n;return Ge(this,(function(r){switch(r.label){case 0:return n=e?{type:e,userId:t}:{userId:t},[4,Ho.syncQueue.where(n).toArray().catch(Co.errnames.DatabaseClosed,(function(){return[]}))];case 1:return[2,r.sent()]}}))}))).apply(this,arguments)}function Zo(){return(Zo=Fe((function(t){return Ge(this,(function(e){switch(e.label){case 0:return[4,$e()];case 1:return[4,Ye(e.sent(),t)];case 2:return[2,e.sent()]}}))}))).apply(this,arguments)}function ti(){return(ti=Fe((function(t){return Ge(this,(function(e){switch(e.label){case 0:return[4,$e()];case 1:return[4,Qe(e.sent(),t)];case 2:return[2,e.sent()]}}))}))).apply(this,arguments)}function ei(){return(ei=Fe((function(t){return Ge(this,(function(e){switch(e.label){case 0:return[4,Ho.syncQueue.get(t).catch(Co.errnames.DatabaseClosed,(function(){}))];case 1:return[2,e.sent()]}}))}))).apply(this,arguments)}function ni(){return(ni=Fe((function(t){var e,n,r;return Ge(this,(function(o){switch(o.label){case 0:return[4,tn(t)];case 1:if(!(n=o.sent()))throw new Error("No sync item with the ID ".concat(t," exists."));if(!(r=null===(e=Go[n.type])||void 0===e?void 0:e.options.onBeginEditSyncItem))throw new Error("A sync item with the ID ".concat(t,' exists, but the associated handler (if one exists) doesn\'t support editing the item. You can avoid this error by either verifying that sync items of this type can be edited via the "canEditSynchronizationItemsOfType(type: string)" function or alternatively ensure that the synchronizaton handler for sync items of type "').concat(n.type,'" supports editing items.'));return r(n),[2]}}))}))).apply(this,arguments)}function ri(){return(ri=Fe((function(t){return Ge(this,(function(e){switch(e.label){case 0:return[4,Ho.syncQueue.delete(t).catch(Co.errnames.DatabaseClosed)];case 1:return e.sent(),[2]}}))}))).apply(this,arguments)}for(var oi,ii={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},ai=new Uint8Array(16),ui=[],si=0;si<256;++si)ui.push((si+256).toString(16).slice(1));var ci=function(t,e,n){if(ii.randomUUID&&!e&&!t)return ii.randomUUID();var r=(t=t||{}).random||(t.rng||an)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(var o=0;o<16;++o)e[n+o]=r[o];return e}return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(ui[t[e+0]]+ui[t[e+1]]+ui[t[e+2]]+ui[t[e+3]]+"-"+ui[t[e+4]]+ui[t[e+5]]+"-"+ui[t[e+6]]+ui[t[e+7]]+"-"+ui[t[e+8]]+ui[t[e+9]]+"-"+ui[t[e+10]]+ui[t[e+11]]+ui[t[e+12]]+ui[t[e+13]]+ui[t[e+14]]+ui[t[e+15]]).toLowerCase()}(r)},li="OFFLINE+",fi={};function hi(){return(hi=fn((function(t){return hn(this,(function(e){switch(e.label){case 0:return[4,En()];case 1:return[4,yn(e.sent(),t)];case 2:return[2,e.sent()]}}))}))).apply(this,arguments)}function pi(){return(pi=fn((function(t,e){var n;return hn(this,(function(r){switch(r.label){case 0:return n=e?{type:e,users:t}:{users:t},[4,(new Vo).dynamicOfflineData.where(n).toArray().catch(Co.errnames.DatabaseClosed,(function(){return[]}))];case 1:return[2,r.sent()]}}))}))).apply(this,arguments)}function di(){return(di=fn((function(t,e){return hn(this,(function(n){switch(n.label){case 0:return[4,En()];case 1:return[4,gn(n.sent(),t,e)];case 2:return[2,n.sent()]}}))}))).apply(this,arguments)}function vi(){return vi=fn((function(t,e,n){var r,o;return hn(this,(function(i){switch(i.label){case 0:return[4,(r=new Vo).dynamicOfflineData.get({type:e,identifier:n}).catch(Co.errnames.DatabaseClosed,(function(){}))];case 1:return(o=i.sent())?[3,3]:[4,r.dynamicOfflineData.add({users:[t],type:e,identifier:n}).catch(Co.errnames.DatabaseClosed)];case 2:return i.sent(),[3,5];case 3:return o.users.includes(t)?[3,5]:[4,r.dynamicOfflineData.update(o.id,{users:(a=o.users,function(t){if(Array.isArray(t))return cn(t)}(a)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(a)||function(t,e){if(t){if("string"==typeof t)return cn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cn(t,e):void 0}}(a)||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.")}()).concat([t])}).catch(Co.errnames.DatabaseClosed)];case 4:i.sent(),i.label=5;case 5:return[2]}var a}))})),vi.apply(this,arguments)}function yi(){return(yi=fn((function(t,e){return hn(this,(function(n){switch(n.label){case 0:return[4,En()];case 1:return[4,wn(n.sent(),t,e)];case 2:return[2,n.sent()]}}))}))).apply(this,arguments)}function mi(){return mi=fn((function(t,e,n){var r,o;return hn(this,(function(i){switch(i.label){case 0:return[4,(r=new Vo).dynamicOfflineData.get({type:e,identifier:n,users:t}).catch(Co.errnames.DatabaseClosed,(function(){}))];case 1:return(o=i.sent())?o.users.length>1?[4,r.dynamicOfflineData.update(o.id,{users:o.users.filter((function(e){return e!==t}))}).catch(Co.errnames.DatabaseClosed)]:[3,3]:[3,5];case 2:return i.sent(),[3,5];case 3:return[4,r.dynamicOfflineData.delete(o.id).catch(Co.errnames.DatabaseClosed)];case 4:i.sent(),i.label=5;case 5:return[2]}}))})),mi.apply(this,arguments)}function gi(){return gi=fn((function(t,e){var n;return hn(this,(function(r){switch(r.label){case 0:return[4,vn(t)];case 1:return n=r.sent(),[4,Promise.all(n.map((o=fn((function(t){return hn(this,(function(n){return[2,On(t.type,t.identifier,e)]}))})),function(t){return o.apply(this,arguments)})))];case 2:return r.sent(),[2]}var o}))})),gi.apply(this,arguments)}function bi(){return bi=fn((function(t,e,n){var r,o,i,a,u,s,c,l,f;return hn(this,(function(h){switch(h.label){case 0:return[4,mn(t,e)];case 1:return h.sent(),r=new Vo,[4,En()];case 2:return o=h.sent(),[4,r.dynamicOfflineData.get({type:t,identifier:e}).catch(Co.errnames.DatabaseClosed,(function(){}))];case 3:return i=h.sent(),a=pn().filter((function(e){return e.type===t})),i?[4,Promise.all(a.map((p=fn((function(t){var r,o,i;return hn(this,(function(a){try{return t.sync(e,n),[2,{id:t.id,error:void 0}]}catch(e){return i=null!==(o=null===(r=e.message)||void 0===r?void 0:r.toString())&&void 0!==o?o:e.toString(),[2,{id:t.id,error:i}]}return[2]}))})),function(t){return p.apply(this,arguments)})))]:[2];case 4:return u=h.sent(),s=u.filter((function(t){return!t.error})).map((function(t){return t.id})),c=u.filter((function(t){return t.error})).map((function(t){return t.id})),l=u.filter((function(t){return t.error})).map((function(t){return{handlerId:t.id,message:t.error}})),f={syncedOn:new Date,syncedBy:o,succeededHandlers:s,erroredHandlers:c,errors:l},i.id?[4,r.dynamicOfflineData.update(i.id,{syncState:f}).catch(Co.errnames.DatabaseClosed)]:[3,6];case 5:h.sent(),h.label=6;case 6:return[2]}var p}))})),bi.apply(this,arguments)}function wi(){return(wi=fn((function(){var t;return hn(this,(function(e){switch(e.label){case 0:return[4,(0,Uo.getLoggedInUser)()];case 1:if(!(t=e.sent().uuid))throw new Error("Using the dynamic offline data API requires a logged in user.");return[2,t]}}))}))).apply(this,arguments)}var Si=(0,Bo.createGlobalStore)("offline-patients",{offlinePatientDataSyncState:{},handlers:{}});function Oi(){return Oi=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){xn(i,r,o,a,u,"next",t)}function u(t){xn(i,r,o,a,u,"throw",t)}a(void 0)}))}}((function(t){return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(e){switch(e.label){case 0:return An(),[4,On("patient",t)];case 1:return e.sent(),[2]}}))})),Oi.apply(this,arguments)}}(),v}())}}}))},973:(t,e,n)=>{function r(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}function o(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}t=n.nmd(t),System.register(["react","@openmrs/esm-navigation","@openmrs/esm-extensions","@openmrs/esm-globals","@openmrs/esm-utils","@openmrs/esm-feature-flags","@openmrs/esm-api","react-dom","react-i18next","swr","@openmrs/esm-context","@openmrs/esm-config","dayjs"],(function(i,a){var u={},s={},c={},l={},f={},h={},p={},d={},v={},y={},m={},g={},b={};return Object.defineProperty(d,"__esModule",{value:!0}),{setters:[function(t){u.Suspense=t.Suspense,u.default=t.default,u.useCallback=t.useCallback,u.useContext=t.useContext,u.useEffect=t.useEffect,u.useMemo=t.useMemo,u.useReducer=t.useReducer,u.useRef=t.useRef,u.useState=t.useState},function(t){s.interpolateUrl=t.interpolateUrl,s.navigate=t.navigate},function(t){c.getConnectedExtensions=t.getConnectedExtensions,c.getExtensionInternalStore=t.getExtensionInternalStore,c.getExtensionStore=t.getExtensionStore,c.registerExtensionSlot=t.registerExtensionSlot,c.renderExtension=t.renderExtension},function(t){l.subscribeConnectivityChanged=t.subscribeConnectivityChanged},function(t){f.isOnline=t.isOnline,f.shallowEqual=t.shallowEqual},function(t){h.featureFlagsStore=t.featureFlagsStore},function(t){p.attachmentUrl=t.attachmentUrl,p.defaultVisitCustomRepresentation=t.defaultVisitCustomRepresentation,p.fetchCurrentPatient=t.fetchCurrentPatient,p.getCurrentUser=t.getCurrentUser,p.getLocations=t.getLocations,p.getSessionStore=t.getSessionStore,p.getVisitStore=t.getVisitStore,p.getVisitTypes=t.getVisitTypes,p.openmrsFetch=t.openmrsFetch,p.restBaseUrl=t.restBaseUrl,p.userHasAccess=t.userHasAccess},function(t){Object.keys(t).forEach((function(e){d[e]=t[e]}))},function(t){v.I18nextProvider=t.I18nextProvider},function(t){y.SWRConfig=t.SWRConfig,y.default=t.default},function(t){m.registerContext=t.registerContext,m.subscribeToContext=t.subscribeToContext,m.unregisterContext=t.unregisterContext,m.updateContext=t.updateContext},function(t){g.getConfigStore=t.getConfigStore,g.getExtensionConfigFromStore=t.getExtensionConfigFromStore,g.getExtensionsConfigStore=t.getExtensionsConfigStore},function(t){b.default=t.default}],execute:function(){i(function(){var i={332:function(t){t.exports=function(){"use strict";return function(t,e,n){e.prototype.isToday=function(){var t="YYYY-MM-DD",e=n();return this.format(t)===e.format(t)}}}()},645:function(t,e,n){"use strict";var r=n(493);e.createRoot=r.createRoot,e.hydrateRoot=r.hydrateRoot},385:function(){System.register([],(function(t,e){return{execute:function(){t(function(){"use strict";var t=function(t,e){var n=c[t];if(n)return n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value.setState(e,!0),n.active=!0,n.value;var r=s()((function(){return e}));return c[t]={value:r,active:!0},r},e=function(t,e){var n=c[t];return n?(n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value=e,n.active=!0,n.value):(c[t]={value:e,active:!0},e)},n=function(t,e){var n=c[t];if(!n){var r=s()((function(){return null!=e?e:{}}));return c[t]={value:r,active:!1},r}return n.value},r=function(t,e,n){var r=e(t.getState());return t.subscribe((function(t){var o=e(t);o!==r&&(r=o,n(o))}))},i={d:function(t,e){for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},a={};i.r(a),i.d(a,{createGlobalStore:function(){return t},getGlobalStore:function(){return n},registerGlobalStore:function(){return e},subscribeTo:function(){return r}});var u=function(t){var e,n=new Set,r=function(t,r){var i="function"==typeof t?t(e):t;if(!Object.is(i,e)){var a=e;e=(null!=r?r:"object"!=(void 0===i?"undefined":o(i)))?i:Object.assign({},e,i),n.forEach((function(t){return t(e,a)}))}},i=function(){return e},a={setState:r,getState:i,subscribe:function(t){return n.add(t),function(){return n.delete(t)}},destroy:function(){console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return e=t(r,i,a),a},s=function(t){return t?u(t):u},c={};return setTimeout((function(){"development"===window.spaEnv&&(window.stores=c)}),1e3),a}())}}}))},766:function(t){"use strict";t.exports=p},824:function(t){"use strict";t.exports=g},743:function(t){"use strict";t.exports=m},45:function(t){"use strict";t.exports=c},708:function(t){"use strict";t.exports=h},728:function(t){"use strict";t.exports=l},513:function(t){"use strict";t.exports=s},618:function(t){"use strict";t.exports=f},688:function(t){"use strict";t.exports=b},954:function(t){"use strict";t.exports=u},493:function(t){"use strict";t.exports=d},281:function(t){"use strict";t.exports=v},725:function(t){"use strict";t.exports=y}},a={};function w(t){var e=a[t];if(void 0!==e)return e.exports;var n=a[t]={exports:{}};return i[t].call(n.exports,n,n.exports,w),n.exports}w.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return w.d(e,{a:e}),e},w.d=function(t,e){for(var n in e)w.o(e,n)&&!w.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},w.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},w.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var S={};return function(){"use strict";var i=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},a=function(t){var e=t.to,n=t.templateParams,r=t.onBeforeNavigate,o=t.children,a=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,["to","templateParams","onBeforeNavigate","children"]);return(0,Gt.useEffect)((function(){a.href&&console.warn("ConfigurableLink does not support the href prop. Use the 'to' prop instead. The provided href value is '".concat(a.href,"'")),a.onClick&&console.warn("ConfigurableLink does not support the onClick prop. Use the 'onBeforeNavigate' prop instead. The 'to' prop of the offending link is ".concat(e))}),[]),Gt.default.createElement("a",function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){i(t,e,n[e])}))}return t}({onClick:function(t){return function(t,e,n,r){0!==t.button||t.ctrlKey||t.shiftKey||t.altKey||t.metaKey||(t.preventDefault(),null==r||r(t),(0,Kt.navigate)({to:e,templateParams:n})),0===t.button&&(t.ctrlKey||t.metaKey)&&(null==r||r(t)),0===t.button&&t.shiftKey&&(null==r||r(t)),1===t.button&&(null==r||r(t))}(t,e,n,r)},href:(0,Kt.interpolateUrl)(e,n)},a),o)},u=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},s=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},c=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){s(t,e,n[e])}))}return t},l=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},f=function(){var t,e=function(t){if(Array.isArray(t))return t}(t=(0,Gt.useState)((0,Yt.isOnline)()))||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t)||function(t,e){if(t){if("string"==typeof t)return l(t,2);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(t,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=e[0],r=e[1];return(0,Gt.useEffect)((function(){return(0,Jt.subscribeConnectivityChanged)((function(t){var e=t.online;return r(e)}))}),[]),n},h=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},p=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},d=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){p(t,e,n[e])}))}return t},v=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t,e)||m(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},y=function(t){return function(t){if(Array.isArray(t))return h(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||m(t)||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.")}()},m=function(t,e){if(t){if("string"==typeof t)return h(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(t,e):void 0}},g=function(t,e){var n=function(n){r[n]=function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];t.setState((function(t){var r,i=[t].concat(y(o));return(r=e)[n].apply(r,y(i))}))}};"function"==typeof e&&(e=e(t));var r={};for(var o in e)n(o);return r},b=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xt,n=arguments.length>2?arguments[2]:void 0,r=v((0,Gt.useState)((function(){return e(t.getState())})),2),o=r[0],i=r[1];return(0,Gt.useEffect)((function(){return(0,Qt.subscribeTo)(t,e,i)}),[t,e]),d({},o,(0,Gt.useMemo)((function(){return n?g(t,n):{}}),[t,n]))},O=function(t,e){return b(t,Xt,e)},E=function(t){return function(e){var n=v((0,Gt.useState)(t.getState()),2),r=n[0],o=n[1];return(0,Gt.useEffect)((function(){return t.subscribe((function(t){return o(t)}))}),[]),d({},r,(0,Gt.useMemo)((function(){return e?g(t,e):{}}),[e]))}},x=function(t){var e=Zt().slots;return(0,Gt.useMemo)((function(){var n,r;return null!==(r=null===(n=e[t])||void 0===n?void 0:n.assignedExtensions)&&void 0!==r?r:[]}),[e,t])},j=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},P=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return j(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?j(t,e):void 0}}(t,e)||function(){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(t){var e=f(),n=x(t),r=b(te.featureFlagsStore),o=(0,Gt.useMemo)((function(){return Object.entries(r.flags).filter((function(t){return P(t,2)[1].enabled})).map((function(t){return P(t,1)[0]}))}),[r.flags]);return(0,Gt.useMemo)((function(){return(0,$t.getConnectedExtensions)(n,e,o)}),[n,e,o])},A=function(t){var e=(0,Gt.useContext)(Wt).moduleName;if(!e)throw Error("ComponentContext has not been provided. This should come from @openmrs/esm-react-utils.");return(0,Gt.useEffect)((function(){(0,$t.registerExtensionSlot)(e,t)}),[]),{extensions:_(t),extensionSlotName:t,extensionSlotModuleName:e}},k=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},T=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){k(t,e,n[e])}))}return t},C=function(t){return t},I=function(t){var e=t.name,n=t.extensionSlotName,r=t.select,o=void 0===r?C:r,i=t.children,a=t.state,u=t.style,s=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,["name","extensionSlotName","select","children","state","style"]);if(i&&a)throw new Error("Both children and state have been provided. If children are provided, the state must be passed as a prop to the `Extension` component.");var c,l,f,h,p=null!=e?e:n,d=(0,Gt.useRef)(null),v=A(p),y=v.extensions,m=v.extensionSlotModuleName,g=(0,Gt.useMemo)((function(){return o(y)}),[o,y]),b=(0,Gt.useMemo)((function(){if("function"==typeof i&&!Gt.default.isValidElement(i))return g.map((function(t){return i(t)}))}),[i,g]);return Gt.default.createElement("div",T({ref:d,"data-extension-slot-name":p,"data-extension-slot-module-name":m,style:(f=T({},u),h={position:"relative"},h=null!=h?h:{},Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(h)):function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n.push.apply(n,r)}return n}(Object(h)).forEach((function(t){Object.defineProperty(f,t,Object.getOwnPropertyDescriptor(h,t))})),f)},s),p&&g.map((function(t,e){return Gt.default.createElement(Wt.Provider,{key:t.id,value:{moduleName:m,featureName:"",extension:{extensionId:t.id,extensionSlotName:p,extensionSlotModuleName:m}}},null!==(l=null!==(c=null==b?void 0:b[e])&&void 0!==c?c:"function"!=typeof i?i:null)&&void 0!==l?l:Gt.default.createElement(qt,{state:a}))})))},M=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},D=function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n},R=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?D(Object(n),!0).forEach((function(e){N(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t},N=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},L=function(t,e){var n;if("function"!=typeof(n=e.domElement?function(){return e.domElement}:e.domElementGetter?e.domElementGetter:t.domElementGetter?t.domElementGetter:function(t){var e=t.appName||t.name;if(!e)throw Error("single-spa's dom-element-getter-helpers was not given an application name as a prop, so it can't make a unique dom element container for the react application");var n="single-spa-application:".concat(e);return function(){var t=document.getElementById(n);return t||((t=document.createElement("div")).id=n,document.body.appendChild(t)),t}}(e)))throw Error("single-spa's dom-element-getter-helpers was given an invalid domElementGetter for application or parcel '".concat(e.name,"'. Expected a function, received ").concat(ie(n)));return function(){var t=n(e);if(!r(t,HTMLElement))throw Error("single-spa's dom-element-getter-helpers: domElementGetter returned an invalid dom element for application or parcel '".concat(e.name,"'. Expected HTMLElement, received ").concat(ie(t)));return t}},U=function(t,e){return t.rootComponent?Promise.resolve():t.loadRootComponent(e).then((function(e){t.rootComponent=e}))},B=function(t,e){return new Promise((function(n,r){t.suppressComponentDidCatchWarning||!function(t){if(!(t&&"string"==typeof t.version&&t.version.indexOf(".")>=0))return!1;var e=t.version.slice(0,t.version.indexOf("."));try{return Number(e)>=16}catch(t){return!1}}(t.React)||t.errorBoundary||t.errorBoundaryClass||(t.rootComponent.prototype?t.rootComponent.prototype.componentDidCatch||console.warn("single-spa-react: ".concat(e.name||e.appName||e.childAppName,"'s rootComponent should implement componentDidCatch to avoid accidentally unmounting the entire single-spa application.")):console.warn("single-spa-react: ".concat(e.name||e.appName||e.childAppName,"'s rootComponent does not implement an error boundary. If using a functional component, consider providing an opts.errorBoundary to singleSpaReact(opts).")));var o=G(t,e,(function(){n(this)})),i=L(t,e)(),a=function(t){var e=t.renderType,n=t.elementToRender,r=t.domElement,o=t.reactDom[e];if("function"!=typeof o)throw new Error('renderType "'.concat(e,'" did not return a function.'));switch(e){case"createRoot":case"unstable_createRoot":case"createBlockingRoot":case"unstable_createBlockingRoot":var i=o(r);return i.render(n),i;case"hydrateRoot":return o(r,n);default:return o(n,r),null}}({elementToRender:o,domElement:i,reactDom:V(t),renderType:H(t)});t.domElements[e.name]=i,t.renderResults[e.name]=a}))},F=function(t,e){return new Promise((function(n){t.unmountResolves[e.name]=n;var r=t.renderResults[e.name];r&&r.unmount?r.unmount():V(t).unmountComponentAtNode(t.domElements[e.name]),delete t.domElements[e.name],delete t.renderResults[e.name]}))},z=function(t,e){return new Promise((function(n){t.updateResolves[e.name]||(t.updateResolves[e.name]=[]),t.updateResolves[e.name].push(n);var r=G(t,e,null),o=t.renderResults[e.name];if(o&&o.render)o.render(r);else{var i=L(t,e)();V(t).render(r,i)}}))},V=function(t){return t.ReactDOMClient||t.ReactDOM},H=function(t){return"function"==typeof t.renderType?t.renderType():t.renderType},G=function(t,e,n){var r=t.React.createElement(t.rootComponent,e),o=ae?t.React.createElement(ae.Provider,{value:e},r):r;return(t.errorBoundary||e.errorBoundary||t.errorBoundaryClass||e.errorBoundaryClass)&&(t.errorBoundaryClass=t.errorBoundaryClass||e.errorBoundaryClass||function(t,e){function n(e){t.React.Component.apply(this,arguments),this.state={caughtError:null,caughtErrorInfo:null},n.displayName="SingleSpaReactErrorBoundary(".concat(e.name,")")}return n.prototype=Object.create(t.React.Component.prototype),n.prototype.render=function(){return this.state.caughtError?(t.errorBoundary||e.errorBoundary)(this.state.caughtError,this.state.caughtErrorInfo,this.props):this.props.children},n.prototype.componentDidCatch=function(t,e){this.setState({caughtError:t,caughtErrorInfo:e})},n}(t,e),o=t.React.createElement(t.errorBoundaryClass,e,o)),t.React.createElement(t.SingleSpaRoot,R(R({},e),{},{mountFinished:n,updateFinished:function(){t.updateResolves[e.name]&&(t.updateResolves[e.name].forEach((function(t){return t()})),delete t.updateResolves[e.name])},unmountFinished:function(){t.unmountResolves[e.name]&&(t.unmountResolves[e.name](),delete t.unmountResolves[e.name])}}),o)},W=function(t){if("object"!=(void 0===t?"undefined":o(t))||"string"!=typeof t.featureName||"string"!=typeof t.moduleName)throw new Error("Invalid options");var e=Object.assign({},he,t);return function(t){var n,i,a,u;return i=n=function(n){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&fe(t,e)}(u,n);var i,a=function(t){var e=function(){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(t){return!1}}();return function(){var n,r=le(t);if(e){var i=le(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(t,e){return!e||"object"!=((n=e)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":void 0===n?"undefined":o(n))&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e;var n}(this,n)}}(u);function u(t){var n;return function(t,e){if(!r(t,e))throw new TypeError("Cannot call a class as a function")}(this,u),(n=a.call(this,t)).state={caughtError:null,caughtErrorInfo:null,config:{moduleName:e.moduleName,featureName:e.featureName,extension:t._extensionContext}},n}return(i=[{key:"componentDidCatch",value:function(t,n){n&&n.componentStack&&(t.extra=Object.assign(t.extra||{},{componentStack:n.componentStack})),e.throwErrorsToConsole&&setTimeout((function(){throw t})),this.setState({caughtError:t,caughtErrorInfo:n})}},{key:"render",value:function(){if(this.state.caughtError)return Gt.default.createElement("div",null,"An error has occurred. Please try reloading the page.");var n=Gt.default.createElement(Gt.Suspense,{fallback:null},Gt.default.createElement(ce.SWRConfig,{value:pe},Gt.default.createElement(Wt.Provider,{value:this.state.config},e.disableTranslations?Gt.default.createElement(t,this.props):Gt.default.createElement(se.I18nextProvider,{i18n:window.i18next,defaultNS:e.moduleName},Gt.default.createElement(t,this.props)))));return e.strictMode||!Gt.default.StrictMode?n:Gt.default.createElement(Gt.default.StrictMode,null,n)}}])&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(u.prototype,i),u}(Gt.default.Component),a="displayName",u="OpenmrsReactComponent(".concat(e.featureName,")"),a in i?Object.defineProperty(i,a,{value:u,enumerable:!0,configurable:!0,writable:!0}):i[a]=u,n}},K=function(t,e){return function(t){if("object"!==oe(t))throw new Error("single-spa-react requires a configuration object");var e,n=R(R({},ue),t);if(!n.React)throw new Error("single-spa-react must be passed opts.React");if(!n.ReactDOM&&!n.ReactDOMClient)throw new Error("single-spa-react must be passed opts.ReactDOM or opts.ReactDOMClient");if(n.renderType||(null!==(e=n.ReactDOMClient)&&void 0!==e&&e.createRoot?n.renderType="createRoot":n.renderType="render"),!n.rootComponent&&!n.loadRootComponent)throw new Error("single-spa-react must be passed opts.rootComponent or opts.loadRootComponent");if(n.errorBoundary&&"function"!=typeof n.errorBoundary)throw Error("The errorBoundary opt for single-spa-react must either be omitted or be a function that returns React elements");!ae&&n.React.createContext&&(ae=n.React.createContext()),n.SingleSpaRoot=function(t){function e(t){e.displayName="SingleSpaRoot(".concat(t.name,")")}return e.prototype=Object.create(t.React.Component.prototype),e.prototype.componentDidMount=function(){setTimeout(this.props.mountFinished)},e.prototype.componentWillUnmount=function(){setTimeout(this.props.unmountFinished)},e.prototype.render=function(){return setTimeout(this.props.updateFinished),this.props.children},e}(n);var r={bootstrap:U.bind(null,n),mount:B.bind(null,n),unmount:F.bind(null,n)};return n.parcelCanUpdate&&(r.update=z.bind(null,n)),r}({React:Gt.default,ReactDOMClient:re,rootComponent:W(e)(t)})},$=function(t,e){return function(){return t().then((function(t){return K(t.default,e)}))}},q=function(t,e){return function(){return Promise.resolve(K(t,e))}},J=function(t,e){var n=(0,Gt.useRef)(null!=e?e:{}),r=(0,Gt.useRef)((function(e){return(0,ve.updateContext)(t,e)}));return(0,Gt.useEffect)((function(){return(0,ve.registerContext)(t,null!=e?e:{}),function(){(0,ve.unregisterContext)(t)}}),[t]),(0,Gt.useEffect)((function(){var r=null!=e?e:{};(0,Yt.shallowEqual)(n.current,r)||((0,ve.updateContext)(t,(function(){return r})),n.current=r)}),[e]),r.current},Y=function(t){return J(t.namespace,t.value),null},Q=function(){var t=(0,Gt.useRef)();return t.current&&!t.current.signal.aborted||(t.current=new AbortController),(0,Gt.useEffect)((function(){var e=t.current;return function(){return null==e?void 0:e.abort()}}),[]),t.current},X=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},Z=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(t){return null!=t?t:{}},r=function(t){if(Array.isArray(t))return t}(e=(0,Gt.useState)())||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e)||function(t,e){if(t){if("string"==typeof t)return X(t,2);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?X(t,2):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=r[0],i=r[1];return(0,Gt.useEffect)((function(){if(null==t||""===t.replace(" ",""))throw new Error('The namespace supplied to useAppContext must be a non-empty string, but was "'.concat(t,'".'))}),[t]),(0,Gt.useEffect)((function(){return(0,ve.subscribeToContext)(t,(function(t){if(void 0!==t){var e=n?n(t):null!=t?t:{};(0,Yt.shallowEqual)(o,e)||i(e)}}))}),[]),o},tt=function(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}},et=function(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}},nt=function(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}},rt=function(t){var e=this.__data__=new Se(t);this.size=e.size},ot=function(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Xe;++e<n;)this.add(t[e])},it=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},at=function(t){var e,n=function(t){if(Array.isArray(t))return t}(e=(0,Gt.useState)([]))||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e)||function(t,e){if(t){if("string"==typeof t)return it(t,2);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?it(t,2):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=n[0],o=n[1];return(0,Gt.useEffect)((function(){return(0,$t.getExtensionStore)().subscribe((function(e){var n,i,a=null!==(i=null===(n=e.slots[t])||void 0===n?void 0:n.assignedExtensions.map((function(t){return t.id})))&&void 0!==i?i:[];lr(a,r)||o(a)}))}),[]),r},ut=function(t,e){var n,r=(0,ce.default)("".concat(ee.attachmentUrl,"?patient=").concat(t,"&includeEncounterless=").concat(e),ee.openmrsFetch),o=r.data,i=r.error,a=r.mutate,u=r.isLoading,s=r.isValidating;return(0,Gt.useMemo)((function(){return{isLoading:u,data:null!==(n=null==o?void 0:o.data.results)&&void 0!==n?n:[],error:i,mutate:a,isValidating:s}}),[o,i,u,s,a])},st=function(t){(0,Gt.useEffect)((function(){if(t){var e=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",function(){document.body.style.overflow=e}}}),[t])},ct=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},lt=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},ft=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){lt(t,e,n[e])}))}return t},ht=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return ct(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ct(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},pt=function(t){var e,n=(0,Gt.useContext)(Wt),r=n.moduleName,o=n.extension,i=null!==(e=null==t?void 0:t.externalModuleName)&&void 0!==e?e:r;if(!i&&!o)throw Error(pr);var a=function(t){var e=(0,Gt.useMemo)((function(){return(0,fr.getConfigStore)(t)}),[t]),n=t,r=function(t){var e=ht((0,Gt.useState)(function(t){return function(){var e=t.getState();return e.loaded&&e.config?e.config:null}}(t)),2),n=e[0],r=e[1];return(0,Gt.useEffect)((function(){return null==t?void 0:t.subscribe((function(t){t.loaded&&t.config&&r(t.config)}))}),[t]),n}(e);if(!r)throw hr[n]||(hr[n]=function(t){return new Promise((function(e){var n=t.subscribe((function(t){t.loaded&&t.config&&(e(t.config),n())}))}))}(e)),hr[n];return r}(i),u=function(t){var e=(0,Gt.useMemo)(fr.getExtensionsConfigStore,[]),n=function(t,e){var n=ht((0,Gt.useState)(function(t,e){return e?function(){var n=t.getState(),r=(0,fr.getExtensionConfigFromStore)(n,e.extensionSlotName,e.extensionId);if(r.loaded&&r.config)return r.config}:null}(t,e)),2),r=n[0],o=n[1];return(0,Gt.useEffect)((function(){if(e)return t.subscribe((function(t){var n=(0,fr.getExtensionConfigFromStore)(t,e.extensionSlotName,e.extensionId);n.loaded&&n.config&&!lr(n.config,r)&&o(n.config)}))}),[t,e,r]),r}(e,t);if(!n&&t){var r="".concat(t.extensionSlotName,"-").concat(t.extensionId);throw!hr[r]&&e&&(hr[r]=function(t,e){return new Promise((function(n){var r=t.subscribe((function(t){var o=(0,fr.getExtensionConfigFromStore)(t,e.extensionSlotName,e.extensionId);o.loaded&&o.config&&(n(o.config),r())}))}))}(e,t)),hr[r]}return n||{}}(o);return(0,Gt.useMemo)((function(){return(null==t?void 0:t.externalModuleName)&&i===t.externalModuleName?ft({},a):ft({},a,u)}),[i,null==t?void 0:t.externalModuleName,a,u])},dt=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},vt=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300,r=function(t){if(Array.isArray(t))return t}(e=(0,Gt.useState)(t))||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e)||function(t,e){if(t){if("string"==typeof t)return dt(t,2);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dt(t,2):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=r[0],i=r[1];return(0,Gt.useEffect)((function(){var e=setTimeout((function(){i(t)}),n);return function(){clearTimeout(e)}}),[t,n]),o},yt=function(t){var e=_(t);return(0,Gt.useMemo)((function(){return Object.fromEntries(e.map((function(t){return[t.name,t.meta]})))}),[e])},mt=function(t){var e,n=b(te.featureFlagsStore).flags;return(0,Gt.useEffect)((function(){n[t]||console.error('useFeatureFlag: Attempted to get value of non-existent flag "'.concat(t,'". Did you forget to call registerFeatureFlag?'))}),[n[t]]),null===(e=n[t])||void 0===e?void 0:e.enabled},gt=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},bt=function(){var t,e=(t=(0,Gt.useState)(0),function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t)||function(t,e){if(t){if("string"==typeof t)return gt(t,2);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gt(t,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[1];return(0,Gt.useCallback)((function(){e((function(t){return t+1}))}),[])},wt=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},St=function(){var t="tablet";return document.body.classList.forEach((function(e){switch(e){case"omrs-breakpoint-lt-tablet":t="phone";break;case"omrs-breakpoint-gt-small-desktop":t="large-desktop";break;case"omrs-breakpoint-gt-tablet":t="small-desktop"}})),t},Ot=function(){var t,e=function(t){if(Array.isArray(t))return t}(t=(0,Gt.useState)(St))||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t)||function(t,e){if(t){if("string"==typeof t)return wt(t,2);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wt(t,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=e[0],r=e[1];return(0,Gt.useEffect)((function(){var t=function(){r(St())};return window.addEventListener("resize",t),function(){return window.removeEventListener("resize",t)}}),[]),n},Et=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},xt=function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=function(t){if(Array.isArray(t))return t}(t=(0,Gt.useState)([]))||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t)||function(t,e){if(t){if("string"==typeof t)return Et(t,2);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Et(t,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=n[0],o=n[1];return(0,Gt.useEffect)((function(){var t=(0,ee.getLocations)(e).subscribe((function(t){o(t)}),(function(t){console.error(t)}));return function(){return t.unsubscribe()}}),[]),r},jt=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=(0,Gt.useRef)(null);return(0,Gt.useEffect)((function(){var r=function(r){e&&n.current&&!n.current.contains(r.target)&&t(r)};return window.addEventListener("mousedown",r),window.addEventListener("touchstart",r),function(){window.removeEventListener("mousedown",r),window.removeEventListener("touchstart",r)}}),[t,e]),n},Pt=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},_t=function(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.abortController,i=r.fetchInit,a=r.url,u=r.swrConfig,s=ye(),c=(0,Gt.useMemo)((function(){return null!==(n=null!==(e=null==i?void 0:i.signal)&&void 0!==e?e:null==o?void 0:o.signal)&&void 0!==n?n:s.signal}),[null==o?void 0:o.signal,null==i?void 0:i.signal,s.signal]),l=(0,Gt.useCallback)((function(t){var e,n,r=function(t,e){if(e)return"function"==typeof e?e(t):e;if("string"==typeof t)return t;throw new Error("When using useOpenmrsSWR with a key that is not a string, you must provide a url() function that converts the key to a valid url. The key for this hook is ".concat(t,"."))}(t,a);return(0,ee.openmrsFetch)(r,(e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){Pt(t,e,n[e])}))}return t}({},i),n=null!=(n={signal:c})?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n.push.apply(n,r)}return n}(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})),e))}),[c,i,a]);return(0,ce.default)(t,l,u)},At=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},kt=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},Tt=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){kt(t,e,n[e])}))}return t},Ct=function(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n.push.apply(n,r)}return n}(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},It=function(){var t=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return t&&t[1]},Mt=function(t,e){switch(e.type){case rr.loadPatient:return Ct(Tt({},t),{patientUuid:e.patientUuid,patient:null,isPendingUuid:!1,isLoadingPatient:!0,err:null});case rr.newPatient:return Ct(Tt({},t),{patient:e.patient,isPendingUuid:!1,isLoadingPatient:!1,err:null});case rr.loadError:return Ct(Tt({},t),{patient:null,isPendingUuid:!1,isLoadingPatient:!1,err:e.err});default:return t}},Dt=function(t){var e,n=function(t){if(Array.isArray(t))return t}(e=(0,Gt.useReducer)(Mt,Ct(Tt({},mr),{patientUuid:null!=t?t:null,isPendingUuid:!t,isLoadingPatient:!!t})))||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e)||function(t,e){if(t){if("string"==typeof t)return At(t,2);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?At(t,2):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=n[0],o=n[1];return(0,Gt.useEffect)((function(){if(r.isPendingUuid){var t=It();o(t?{type:rr.loadPatient,patientUuid:t}:{type:rr.newPatient,patient:null})}var e=!0;return r.isLoadingPatient&&r.patientUuid&&(0,ee.fetchCurrentPatient)(r.patientUuid).then((function(t){return e&&o({patient:t,type:rr.newPatient})}),(function(t){return e&&o({err:t,type:rr.loadError})})),function(){e=!1}}),[r.isPendingUuid,r.isLoadingPatient,r.patientUuid]),(0,Gt.useEffect)((function(){var t=function(t){var e=It();e!=r.patientUuid&&o({type:rr.loadPatient,patientUuid:e})};return window.addEventListener("single-spa:routing-event",t),function(){return window.removeEventListener("single-spa:routing-event",t)}}),[r.patientUuid]),{isLoading:r.isPendingUuid||r.isLoadingPatient,patient:r.patient,patientUuid:null!=t?t:r.patientUuid,error:r.err}},Rt=function(t){var e=A(t),n=e.extensions,r=e.extensionSlotModuleName;return t?n.map((function(e){return function(n){var o=n.state;return Gt.default.createElement(Wt.Provider,{value:{moduleName:r,featureName:"",extension:{extensionId:e.id,extensionSlotName:t,extensionSlotModuleName:r}}},Gt.default.createElement(qt,{state:o}))}})):[]},Nt=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},Lt=function(){var t,e=(0,Gt.useRef)(),n=function(t){if(Array.isArray(t))return t}(t=(0,Gt.useState)(null))||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t)||function(t,e){if(t){if("string"==typeof t)return Nt(t,2);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nt(t,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=n[0],o=n[1],i=null;if(!r){if(yr){var a=(0,ee.getSessionStore)().getState();a.loaded&&(i=a.session)}else yr=new Promise((function(t){var n=function(n){var r=n.loaded,o=n.session;r&&(t(o),i=o,e.current&&e.current(),e.current=void 0)};n((0,ee.getSessionStore)().getState()),i||(e.current=(0,ee.getSessionStore)().subscribe(n))}));if(!i)throw yr;o(i)}(0,Gt.useEffect)((function(){return e.current||(e.current=(0,ee.getSessionStore)().subscribe((function(t){var e=t.loaded,n=t.session;e&&(i=n,o(n))}))),function(){e.current&&e.current(),e.current=void 0}}),[]);var u=r||i;if(!u)throw yr?(console.warn("useSession is in an unexpected state. Attempting to recover."),yr):Error("useSession is in an invalid state.");return u},Ut=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ee.defaultVisitCustomRepresentation,r=b((0,ee.getVisitStore)()),o=r.patientUuid,i=r.manuallySetVisitUuid,a=t&&o==t?i:null,u="?patient=".concat(t,"&v=").concat(n,"&includeInactive=false"),s="/".concat(a,"?v=").concat(n),c=(0,ce.default)(t?"".concat(ee.restBaseUrl,"/visit").concat(u):null,ee.openmrsFetch),l=c.data,f=c.error,h=c.mutate,p=c.isValidating,d=(0,ce.default)(t&&a?"".concat(ee.restBaseUrl,"/visit").concat(s):null,ee.openmrsFetch),v=d.data,y=d.error,m=d.mutate,g=d.isValidating,w=(0,Gt.useMemo)((function(){return null!==(e=null==l?void 0:l.data.results.find((function(t){return null===t.stopDatetime})))&&void 0!==e?e:null}),[l]),S=(0,Gt.useMemo)((function(){return a?null==v?void 0:v.data:null!=w?w:null}),[v,w,a]);return{error:f||y,mutate:function(){h(),m()},isValidating:p||g,activeVisit:w,currentVisit:S,currentVisitIsRetrospective:Boolean(a),isLoading:Boolean((!l||a&&!v)&&(!f||!y))}},Bt=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},Ft=function(){var t,e=function(t){if(Array.isArray(t))return t}(t=(0,Gt.useState)([]))||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t)||function(t,e){if(t){if("string"==typeof t)return Bt(t,2);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Bt(t,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=e[0],r=e[1];return(0,Gt.useEffect)((function(){var t=(0,ee.getVisitTypes)().subscribe((function(t){r(t)}),(function(t){return console.error(t)}));return function(){return t.unsubscribe()}}),[]),n},zt=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},Vt=function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Sr,r=function(t){if(Array.isArray(t))return t}(t=(0,Gt.useState)(1))||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t)||function(t,e){if(t){if("string"==typeof t)return zt(t,2);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zt(t,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=r[0],i=r[1],a=(0,Gt.useMemo)((function(){return"number"==typeof n&&n>0?Math.max(1,Math.ceil(e.length/n)):1}),[e.length,n]),u=(0,Gt.useMemo)((function(){var t=(o-1)*n,r=(o+0)*n;return e.slice(t,r)}),[e,o,n]),s=(0,Gt.useCallback)((function(t){i(Math.max(1,Math.min(a,t)))}),[i,a]),c=(0,Gt.useCallback)((function(){o<a&&i(o+1)}),[o,a,i]),l=(0,Gt.useCallback)((function(){o>1&&i(o-1)}),[o,i]);return(0,Gt.useMemo)((function(){return{results:u,totalPages:a,currentPage:o,paginated:e.length>n,showNextButton:o<a,showPreviousButton:o>1,goTo:s,goToNext:c,goToPrevious:l}}),[u,a,e.length,n,o,s,c,l])},Ht=function(){var t="".concat(ee.restBaseUrl,"/metadatamapping/termmapping?v=custom:(metadataUuid)&code=emr.primaryIdentifierType"),e=(0,ce.default)(t,ee.openmrsFetch),n=e.data,r=e.error,o=e.isLoading;return(0,Gt.useMemo)((function(){var t,e;return{primaryIdentifierCode:null===(t=null==n||null===(e=n.data)||void 0===e?void 0:e.results[0])||void 0===t?void 0:t.metadataUuid,isLoading:o,error:r}}),[n,r,o])};w.r(S),w.d(S,{ComponentContext:function(){return Wt},ConfigurableLink:function(){return a},Extension:function(){return qt},ExtensionSlot:function(){return I},OpenmrsAppContext:function(){return Y},UserHasAccess:function(){return ne},createUseStore:function(){return E},getAsyncExtensionLifecycle:function(){return de},getAsyncLifecycle:function(){return $},getLifecycle:function(){return K},getSyncLifecycle:function(){return q},isDesktop:function(){return vr},openmrsComponentDecorator:function(){return W},useAbortController:function(){return Q},useAppContext:function(){return Z},useAssignedExtensionIds:function(){return at},useAssignedExtensions:function(){return x},useAttachments:function(){return ut},useBodyScrollLock:function(){return st},useConfig:function(){return pt},useConnectedExtensions:function(){return _},useConnectivity:function(){return f},useDebounce:function(){return vt},useDefineAppContext:function(){return J},useExtensionInternalStore:function(){return dr},useExtensionSlot:function(){return A},useExtensionSlotMeta:function(){return yt},useExtensionStore:function(){return Zt},useFeatureFlag:function(){return mt},useForceUpdate:function(){return bt},useLayoutType:function(){return Ot},useLocations:function(){return xt},useOnClickOutside:function(){return jt},useOpenmrsSWR:function(){return _t},usePagination:function(){return Vt},usePatient:function(){return Dt},usePrimaryIdentifierCode:function(){return Ht},useRenderableExtensions:function(){return Rt},useSession:function(){return Lt},useStore:function(){return b},useStoreWithActions:function(){return O},useVisit:function(){return Ut},useVisitTypes:function(){return Ft}});var Gt=w(954),Wt=Gt.default.createContext({moduleName:"",featureName:""}),Kt=w(513),$t=w(45),qt=function(t){var e,n=t.state,o=t.children,i=t.wrap,a=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,["state","children","wrap"]),s=function(t){if(Array.isArray(t))return t}(e=(0,Gt.useState)())||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e)||function(t,e){if(t){if("string"==typeof t)return u(t,2);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(t,2):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),l=s[0],f=s[1],h=(0,Gt.useContext)(Wt).extension,p=(0,Gt.useRef)(null),d=(0,Gt.useRef)(Promise.resolve()),v=(0,Gt.useRef)(!1);(0,Gt.useEffect)((function(){i&&console.warn("'wrap' prop of Extension is being used ".concat((null==h?void 0:h.extensionId)?"by ".concat(h.extensionId," in ").concat(h.extensionSlotName):"",". This will be removed in a future release."))}),[]);var y=(0,Gt.useCallback)((function(t){f(t)}),[f]);(0,Gt.useEffect)((function(){if(null!=l&&(null==h?void 0:h.extensionSlotName)&&h.extensionSlotModuleName&&h.extensionSlotModuleName&&!p.current&&!v.current)return v.current=!0,(0,$t.renderExtension)(l,h.extensionSlotName,h.extensionSlotModuleName,h.extensionId,void 0,n).then((function(t){p.current=t,v.current=!1})),function(){if(p&&p.current)switch(p.current.getStatus()){case"MOUNTING":p.current.mountPromise.then((function(){var t;"MOUNTED"===(null===(t=p.current)||void 0===t?void 0:t.getStatus())&&p.current.unmount()}));break;case"MOUNTED":p.current.unmount();break;case"UPDATING":d.current&&d.current.then((function(){var t;"MOUNTED"===(null===(t=p.current)||void 0===t?void 0:t.getStatus())&&p.current.unmount()}))}}}),[null==h?void 0:h.extensionSlotName,null==h?void 0:h.extensionId,null==h?void 0:h.extensionSlotModuleName,l]),(0,Gt.useEffect)((function(){p.current&&p.current.update&&"UNMOUNTING"!==p.current.getStatus()&&Promise.all([p.current.mountPromise,d.current]).then((function(){var t;"MOUNTED"===(null==p||null===(t=p.current)||void 0===t?void 0:t.getStatus())&&p.current.update&&(d.current=p.current.update(c({},n)).catch((function(t){var e,n,o;if(n=t,!(null!=(o=Error)&&"undefined"!=typeof Symbol&&o[Symbol.hasInstance]?o[Symbol.hasInstance](n):r(n,o))||!t.message.includes("minified message #32")||"MOUNTED"===(null===(e=p.current)||void 0===e?void 0:e.getStatus()))throw t})))}))}),[n]);var m=Gt.default.createElement("div",c({ref:y,"data-extension-id":null==h?void 0:h.extensionId,style:{position:"relative"}},a));return"function"!=typeof o||Gt.default.isValidElement(o)?h&&i?i(m,h):m:Gt.default.createElement(Gt.default.Fragment,null,o(m,h))},Jt=w(728),Yt=w(618),Qt=w(385),Xt=function(t){return t},Zt=E((0,$t.getExtensionStore)()),te=w(708),ee=w(766),ne=function(t){var e,n=t.privilege,r=t.fallback,o=t.children,i=function(t){if(Array.isArray(t))return t}(e=(0,Gt.useState)(null))||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e)||function(t,e){if(t){if("string"==typeof t)return M(t,2);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?M(t,2):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=i[0],u=i[1];return(0,Gt.useEffect)((function(){var t=(0,ee.getCurrentUser)({includeAuthStatus:!1}).subscribe(u);return function(){return t.unsubscribe()}}),[]),a&&(0,ee.userHasAccess)(n,a)?Gt.default.createElement(Gt.default.Fragment,null,o):r?Gt.default.createElement(Gt.default.Fragment,null,r):null},re=w(645);function oe(t){return(oe="function"==typeof Symbol&&"symbol"==o(Symbol.iterator)?function(t){return void 0===t?"undefined":o(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":o(t)})(t)}function ie(t){return(ie="function"==typeof Symbol&&"symbol"==o(Symbol.iterator)?function(t){return void 0===t?"undefined":o(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":o(t)})(t)}var ae=null;try{ae=n(1343).createContext()}catch(D){}var ue={React:null,ReactDOM:null,ReactDOMClient:null,rootComponent:null,loadRootComponent:null,errorBoundary:null,errorBoundaryClass:null,domElementGetter:null,parcelCanUpdate:!0,suppressComponentDidCatchWarning:!1,domElements:{},renderResults:{},updateResolves:{},unmountResolves:{}},se=w(281),ce=w(725);function le(t){return le=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},le(t)}function fe(t,e){return fe=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},fe(t,e)}var he={strictMode:!0,throwErrorsToConsole:!0,disableTranslations:!1},pe={errorRetryCount:3,fetcher:ee.openmrsFetch,focusThrottleInterval:3e4},de=$,ve=w(743),ye=Q,me=function(t,e){return t===e||t!=t&&e!=e},ge=function(t,e){for(var n=t.length;n--;)if(me(t[n][0],e))return n;return-1},be=Array.prototype.splice;tt.prototype.clear=function(){this.__data__=[],this.size=0},tt.prototype.delete=function(t){var e=this.__data__,n=ge(e,t);return!(n<0||(n==e.length-1?e.pop():be.call(e,n,1),--this.size,0))},tt.prototype.get=function(t){var e=this.__data__,n=ge(e,t);return n<0?void 0:e[n][1]},tt.prototype.has=function(t){return ge(this.__data__,t)>-1},tt.prototype.set=function(t,e){var n=this.__data__,r=ge(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var we,Se=tt,Oe="object"==(void 0===n.g?"undefined":o(n.g))&&n.g&&n.g.Object===Object&&n.g,Ee="object"==("undefined"==typeof self?"undefined":o(self))&&self&&self.Object===Object&&self,xe=Oe||Ee||Function("return this")(),je=xe.Symbol,Pe=Object.prototype,_e=Pe.hasOwnProperty,Ae=Pe.toString,ke=je?je.toStringTag:void 0,Te=Object.prototype.toString,Ce=je?je.toStringTag:void 0,Ie=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Ce&&Ce in Object(t)?function(t){var e=_e.call(t,ke),n=t[ke];try{t[ke]=void 0;var r=!0}catch(t){}var o=Ae.call(t);return r&&(e?t[ke]=n:delete t[ke]),o}(t):function(t){return Te.call(t)}(t)},Me=function(t){var e=void 0===t?"undefined":o(t);return null!=t&&("object"==e||"function"==e)},De=function(t){if(!Me(t))return!1;var e=Ie(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},Re=xe["__core-js_shared__"],Ne=(we=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||""))?"Symbol(src)_1."+we:"",Le=Function.prototype.toString,Ue=function(t){if(null!=t){try{return Le.call(t)}catch(t){}try{return t+""}catch(t){}}return""},Be=/^\[object .+?Constructor\]$/,Fe=Function.prototype,ze=Object.prototype,Ve=Fe.toString,He=ze.hasOwnProperty,Ge=RegExp("^"+Ve.call(He).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),We=function(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!Me(t)||(e=t,Ne&&Ne in e))&&(De(t)?Ge:Be).test(Ue(t));var e}(n)?n:void 0},Ke=We(xe,"Map"),$e=We(Object,"create"),qe=Object.prototype.hasOwnProperty,Je=Object.prototype.hasOwnProperty;et.prototype.clear=function(){this.__data__=$e?$e(null):{},this.size=0},et.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},et.prototype.get=function(t){var e=this.__data__;if($e){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return qe.call(e,t)?e[t]:void 0},et.prototype.has=function(t){var e=this.__data__;return $e?void 0!==e[t]:Je.call(e,t)},et.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=$e&&void 0===e?"__lodash_hash_undefined__":e,this};var Ye=et,Qe=function(t,e){var n,r,i=t.__data__;return("string"==(r=o(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map};nt.prototype.clear=function(){this.size=0,this.__data__={hash:new Ye,map:new(Ke||Se),string:new Ye}},nt.prototype.delete=function(t){var e=Qe(this,t).delete(t);return this.size-=e?1:0,e},nt.prototype.get=function(t){return Qe(this,t).get(t)},nt.prototype.has=function(t){return Qe(this,t).has(t)},nt.prototype.set=function(t,e){var n=Qe(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};var Xe=nt;rt.prototype.clear=function(){this.__data__=new Se,this.size=0},rt.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},rt.prototype.get=function(t){return this.__data__.get(t)},rt.prototype.has=function(t){return this.__data__.has(t)},rt.prototype.set=function(t,e){var n=this.__data__;if(r(n,Se)){var o=n.__data__;if(!Ke||o.length<199)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new Xe(o)}return n.set(t,e),this.size=n.size,this};var Ze=rt;ot.prototype.add=ot.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},ot.prototype.has=function(t){return this.__data__.has(t)};var tn=ot,en=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1},nn=function(t,e,n,r,o,i){var a=1&n,u=t.length,s=e.length;if(u!=s&&!(a&&s>u))return!1;var c=i.get(t),l=i.get(e);if(c&&l)return c==e&&l==t;var f=-1,h=!0,p=2&n?new tn:void 0;for(i.set(t,e),i.set(e,t);++f<u;){var d=t[f],v=e[f];if(r)var y=a?r(v,d,f,e,t,i):r(d,v,f,t,e,i);if(void 0!==y){if(y)continue;h=!1;break}if(p){if(!en(e,(function(t,e){if(a=e,!p.has(a)&&(d===t||o(d,t,n,r,i)))return p.push(e);var a}))){h=!1;break}}else if(d!==v&&!o(d,v,n,r,i)){h=!1;break}}return i.delete(t),i.delete(e),h},rn=xe.Uint8Array,on=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n},an=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n},un=je?je.prototype:void 0,sn=un?un.valueOf:void 0,cn=Array.isArray,ln=Object.prototype.propertyIsEnumerable,fn=Object.getOwnPropertySymbols,hn=fn?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var a=t[n];e(a)&&(i[o++]=a)}return i}(fn(t),(function(e){return ln.call(t,e)})))}:function(){return[]},pn=function(t){return null!=t&&"object"==(void 0===t?"undefined":o(t))},dn=function(t){return pn(t)&&"[object Arguments]"==Ie(t)},vn=Object.prototype,yn=vn.hasOwnProperty,mn=vn.propertyIsEnumerable,gn=dn(function(){return arguments}())?dn:function(t){return pn(t)&&yn.call(t,"callee")&&!mn.call(t,"callee")},bn=gn,wn="object"==o(e)&&e&&!e.nodeType&&e,Sn=wn&&"object"==o(t)&&t&&!t.nodeType&&t,On=Sn&&Sn.exports===wn?xe.Buffer:void 0,En=(On?On.isBuffer:void 0)||function(){return!1},xn=/^(?:0|[1-9]\d*)$/,jn=function(t,e){var n=void 0===t?"undefined":o(t);return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&xn.test(t))&&t>-1&&t%1==0&&t<e},Pn=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},_n={};_n["[object Float32Array]"]=_n["[object Float64Array]"]=_n["[object Int8Array]"]=_n["[object Int16Array]"]=_n["[object Int32Array]"]=_n["[object Uint8Array]"]=_n["[object Uint8ClampedArray]"]=_n["[object Uint16Array]"]=_n["[object Uint32Array]"]=!0,_n["[object Arguments]"]=_n["[object Array]"]=_n["[object ArrayBuffer]"]=_n["[object Boolean]"]=_n["[object DataView]"]=_n["[object Date]"]=_n["[object Error]"]=_n["[object Function]"]=_n["[object Map]"]=_n["[object Number]"]=_n["[object Object]"]=_n["[object RegExp]"]=_n["[object Set]"]=_n["[object String]"]=_n["[object WeakMap]"]=!1;var An,kn="object"==o(e)&&e&&!e.nodeType&&e,Tn=kn&&"object"==o(t)&&t&&!t.nodeType&&t,Cn=Tn&&Tn.exports===kn&&Oe.process,In=function(){try{return Tn&&Tn.require&&Tn.require("util").types||Cn&&Cn.binding&&Cn.binding("util")}catch(t){}}(),Mn=In&&In.isTypedArray,Dn=Mn?(An=Mn,function(t){return An(t)}):function(t){return pn(t)&&Pn(t.length)&&!!_n[Ie(t)]},Rn=Object.prototype.hasOwnProperty,Nn=Object.prototype,Ln=function(t,e){return function(n){return t(e(n))}}(Object.keys,Object),Un=Object.prototype.hasOwnProperty,Bn=function(t){return null!=(e=t)&&Pn(e.length)&&!De(e)?function(t,e){var n=cn(t),r=!n&&bn(t),o=!n&&!r&&En(t),i=!n&&!r&&!o&&Dn(t),a=n||r||o||i,u=a?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],s=u.length;for(var c in t)!Rn.call(t,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||jn(c,s))||u.push(c);return u}(t):function(t){if(n=(e=t)&&e.constructor,e!==("function"==typeof n&&n.prototype||Nn))return Ln(t);var e,n,r=[];for(var o in Object(t))Un.call(t,o)&&"constructor"!=o&&r.push(o);return r}(t);var e},Fn=function(t){return function(t,e,n){var r=e(t);return cn(t)?r:function(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}(r,n(t))}(t,Bn,hn)},zn=Object.prototype.hasOwnProperty,Vn=We(xe,"DataView"),Hn=We(xe,"Promise"),Gn=We(xe,"Set"),Wn=We(xe,"WeakMap"),Kn="[object Map]",$n="[object Promise]",qn="[object Set]",Jn="[object WeakMap]",Yn="[object DataView]",Qn=Ue(Vn),Xn=Ue(Ke),Zn=Ue(Hn),tr=Ue(Gn),er=Ue(Wn),nr=Ie;(Vn&&nr(new Vn(new ArrayBuffer(1)))!=Yn||Ke&&nr(new Ke)!=Kn||Hn&&nr(Hn.resolve())!=$n||Gn&&nr(new Gn)!=qn||Wn&&nr(new Wn)!=Jn)&&(nr=function(t){var e=Ie(t),n="[object Object]"==e?t.constructor:void 0,r=n?Ue(n):"";if(r)switch(r){case Qn:return Yn;case Xn:return Kn;case Zn:return $n;case tr:return qn;case er:return Jn}return e});var rr,or=nr,ir="[object Arguments]",ar="[object Array]",ur="[object Object]",sr=Object.prototype.hasOwnProperty,cr=function t(e,n,o,i,a){return e===n||(null==e||null==n||!pn(e)&&!pn(n)?e!=e&&n!=n:function(t,e,n,o,i,a){var u=cn(t),s=cn(e),c=u?ar:or(t),l=s?ar:or(e),f=(c=c==ir?ur:c)==ur,h=(l=l==ir?ur:l)==ur,p=c==l;if(p&&En(t)){if(!En(e))return!1;u=!0,f=!1}if(p&&!f)return a||(a=new Ze),u||Dn(t)?nn(t,e,n,o,i,a):function(t,e,n,r,o,i,a){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!i(new rn(t),new rn(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return me(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var u=on;case"[object Set]":var s=1&r;if(u||(u=an),t.size!=e.size&&!s)return!1;var c=a.get(t);if(c)return c==e;r|=2,a.set(t,e);var l=nn(u(t),u(e),r,o,i,a);return a.delete(t),l;case"[object Symbol]":if(sn)return sn.call(t)==sn.call(e)}return!1}(t,e,c,n,o,i,a);if(!(1&n)){var d=f&&sr.call(t,"__wrapped__"),v=h&&sr.call(e,"__wrapped__");if(d||v){var y=d?t.value():t,m=v?e.value():e;return a||(a=new Ze),i(y,m,n,o,a)}}return!!p&&(a||(a=new Ze),function(t,e,n,o,i,a){var u=1&n,s=Fn(t),c=s.length;if(c!=Fn(e).length&&!u)return!1;for(var l=c;l--;){var f=s[l];if(!(u?f in e:zn.call(e,f)))return!1}var h=a.get(t),p=a.get(e);if(h&&p)return h==e&&p==t;var d=!0;a.set(t,e),a.set(e,t);for(var v=u;++l<c;){var y=t[f=s[l]],m=e[f];if(o)var g=u?o(m,y,f,e,t,a):o(y,m,f,t,e,a);if(!(void 0===g?y===m||i(y,m,n,o,a):g)){d=!1;break}v||(v="constructor"==f)}if(d&&!v){var b=t.constructor,w=e.constructor;b==w||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&r(b,b)&&"function"==typeof w&&r(w,w)||(d=!1)}return a.delete(t),a.delete(e),d}(t,e,n,o,i,a))}(e,n,o,i,t,a))},lr=function(t,e){return cr(t,e)},fr=w(824),hr={},pr='No ComponentContext has been provided. This should come from "openmrsComponentDecorator".\nUsually this is already applied when using "getAsyncLifecycle" or "getSyncLifecycle".',dr=E((0,$t.getExtensionInternalStore)()),vr=function(t){return"small-desktop"===t||"large-desktop"===t};!function(t){t.loadPatient="loadPatient",t.newPatient="newPatient",t.loadError="patientLoadError"}(rr||(rr={}));var yr,mr={patientUuid:null,patient:null,isPendingUuid:!0,isLoadingPatient:!1,err:null},gr=w(688),br=w(332),wr=w.n(br);gr.default.extend(wr());var Sr=10}(),S}())}}}))},4999:(t,e,n)=>{"use strict";n.d(e,{Ay:()=>u,Uz:()=>f,nX:()=>h,ll:()=>r,p9:()=>s,gM:()=>c});var r="openmrs-routes:";function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function i(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}var a=(0,n(2238).canAccessStorage)();function u(t,e){if(a){if("string"==typeof e){if(e.startsWith("http"))return l(t,e);try{var n=JSON.parse(e);if(f(n))return l(t,n);console.error("The supplied routes for ".concat(t," is not a valid OpenmrsAppRoutes object"),e)}catch(e){console.error("Could not add routes override for ".concat(t,": "),e)}}else{if(r=e,null!=(o=URL)&&"undefined"!=typeof Symbol&&o[Symbol.hasInstance]?o[Symbol.hasInstance](r):r instanceof o)return l(t,e.toString());if(f(e))return l(t,e)}var r,o;console.error("Override for ".concat(t," is not in a valid format. Expected either a Javascript Object, a JSON string of a Javascript object, or a URL"),e)}}function s(t){if(a){var e=r+t;localStorage.removeItem(e)}}function c(){if(a)for(var t=window.localStorage,e=0;e<t.length;e++){var n=t.key(e);(null==n?void 0:n.startsWith(r))&&t.removeItem(n)}}function l(t,e){var n=r+t;localStorage.setItem(n,JSON.stringify(e))}function f(t){if(t&&"object"===(void 0===t?"undefined":i(t))){var e=Object.prototype.hasOwnProperty,n=t;return!!((!e.call(t,"pages")||Boolean(n.pages)&&Array.isArray(n.pages))&&(!e.call(t,"extensions")||Boolean(n.extensions)&&Array.isArray(n.extensions))&&(!e.call(t,"workspaces")||Boolean(n.workspaces)&&Array.isArray(n.workspaces))&&(!e.call(t,"modals")||Boolean(n.modals)&&Array.isArray(n.modals)))}return!1}function h(t){if(t&&"object"===(void 0===t?"undefined":i(t))){var e=t;return Object.entries(e).every((function(t){var e,n,r=(n=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,n)||function(t,e){if(t){if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=r[0],a=r[1];return"string"==typeof i&&f(a)}))}return!1}},5297:()=>{System.register([],(function(t,e){return{execute:function(){t(function(){"use strict";var t=function(t,e){var n=s[t];if(n)return n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value.setState(e,!0),n.active=!0,n.value;var r=u()((function(){return e}));return s[t]={value:r,active:!0},r},e=function(t,e){var n=s[t];return n?(n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value=e,n.active=!0,n.value):(s[t]={value:e,active:!0},e)},n=function(t,e){var n=s[t];if(!n){var r=u()((function(){return null!=e?e:{}}));return s[t]={value:r,active:!1},r}return n.value},r=function(t,e,n){var r=e(t.getState());return t.subscribe((function(t){var o=e(t);o!==r&&(r=o,n(o))}))},o={d:function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},i={};o.r(i),o.d(i,{createGlobalStore:function(){return t},getGlobalStore:function(){return n},registerGlobalStore:function(){return e},subscribeTo:function(){return r}});var a=function(t){var e,n=new Set,r=function(t,r){var o,i="function"==typeof t?t(e):t;if(!Object.is(i,e)){var a=e;e=(null!=r?r:"object"!=(void 0===i?"undefined":(o=i)&&"undefined"!=typeof Symbol&&o.constructor===Symbol?"symbol":typeof o))?i:Object.assign({},e,i),n.forEach((function(t){return t(e,a)}))}},o=function(){return e},i={setState:r,getState:o,subscribe:function(t){return n.add(t),function(){return n.delete(t)}},destroy:function(){console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return e=t(r,o,i),i},u=function(t){return t?a(t):a},s={};return setTimeout((function(){"development"===window.spaEnv&&(window.stores=s)}),1e3),i}())}}}))},5961:(t,e,n)=>{function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function o(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)}function i(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var a=t.apply(e,n);function u(t){o(a,r,i,u,s,"next",t)}function s(t){o(a,r,i,u,s,"throw",t)}u(void 0)}))}}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function u(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}function s(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t,e)||f(t,e)||function(){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 c(t){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||f(t)||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 l(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}function f(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}function h(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}System.register(["@openmrs/esm-error-handling","@openmrs/esm-extensions","@openmrs/esm-navigation","@openmrs/esm-react-utils","@openmrs/esm-state","@openmrs/esm-translations","dayjs","react","react-dom","rxjs"],(function(t,e){var r={},o={},f={},p={},d={},v={},y={},m={},g={},b={};return Object.defineProperty(m,"__esModule",{value:!0}),Object.defineProperty(g,"__esModule",{value:!0}),{setters:[function(){},function(){},function(){},function(){},function(t){d.createGlobalStore=t.createGlobalStore},function(){},function(){},function(t){Object.keys(t).forEach((function(e){m[e]=t[e]}))},function(t){Object.keys(t).forEach((function(e){g[e]=t[e]}))},function(t){b.Subject=t.Subject}],execute:function(){t(function(){var t={976:function(t,e){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var t,e=[],n=0;n<arguments.length;n++){var i=arguments[n];if(i){var a=void 0===i?"undefined":(t=i)&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":void 0===t?"undefined":l(t);if("string"===a||"number"===a)e.push(i);else if(Array.isArray(i)){if(i.length){var u=o.apply(null,i);u&&e.push(u)}}else if("object"===a){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]")){e.push(i.toString());continue}for(var s in i)r.call(i,s)&&i[s]&&e.push(s)}}}return e.join(" ")}t.exports?(o.default=o,t.exports=o):void 0===(n=function(){return o}.apply(e,[]))||(t.exports=n)}()},353:function(t,e,n){!function(e){"use strict";var r=function(t){return function(e,n){return"object"==(void 0===e?"undefined":l(e))&&(n=e,e=null),null==e&&(e=(new Date).toString()),n||(n={}),t.call(this,e,n)}},o=n(42),i=t.exports={generate:r((function(t,e){return new o(t,e)}))};e&&(e.fn.geopattern=r((function(t,n){return this.each((function(){var r=e(this).attr("data-title-sha");r&&(n=e.extend({hash:r},n));var o=i.generate(t,n);e(this).css("background-image",o.toDataUrl())}))})))}("undefined"!=typeof jQuery?jQuery:null)},851:function(t){"use strict";t.exports={hex2rgb:function(t){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r}));var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null},rgb2hex:function(t){return"#"+["r","g","b"].map((function(e){return("0"+t[e].toString(16)).slice(-2)})).join("")},rgb2hsl:function(t){var e=t.r,n=t.g,r=t.b;e/=255,n/=255,r/=255;var o,i,a=Math.max(e,n,r),u=Math.min(e,n,r),s=(a+u)/2;if(a===u)o=i=0;else{var c=a-u;switch(i=s>.5?c/(2-a-u):c/(a+u),a){case e:o=(n-r)/c+(n<r?6:0);break;case n:o=(r-e)/c+2;break;case r:o=(e-n)/c+4}o/=6}return{h:o,s:i,l:s}},hsl2rgb:function(t){var e,n,r,o=function(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t},i=t.h,a=t.s,u=t.l;if(0===a)e=n=r=u;else{var s=u<.5?u*(1+a):u+a-u*a,c=2*u-s;e=o(c,s,i+1/3),n=o(c,s,i),r=o(c,s,i-1/3)}return{r:Math.round(255*e),g:Math.round(255*n),b:Math.round(255*r)}},rgb2rgbString:function(t){return"rgb("+[t.r,t.g,t.b].join(",")+")"}}},42:function(t,e,n){"use strict";var r=function(t,e,n){return parseInt(t.substr(e,n||1),16)},o=function(t,e,n,r,o){return(parseFloat(t)-e)*(o-r)/(n-e)+r},i=function(t){return t%2==0?g:m},a=function(t){return o(t,0,15,S,O)},u=function(t){return[[t,0,t,3*t],[0,t,3*t,t]]},s=function(t){return[0,0,t,t,0,t,0,0].join(",")},c=function(t,e,n,r,o){var u=s(r),c=a(o[0]),l=i(o[0]),f={stroke:b,"stroke-opacity":w,"fill-opacity":c,fill:l};t.polyline(u,f).transform({translate:[e+r,n],scale:[-1,1]}),t.polyline(u,f).transform({translate:[e+r,n+2*r],scale:[1,-1]}),c=a(o[1]),l=i(o[1]),f={stroke:b,"stroke-opacity":w,"fill-opacity":c,fill:l},t.polyline(u,f).transform({translate:[e+r,n+2*r],scale:[-1,-1]}),t.polyline(u,f).transform({translate:[e+r,n],scale:[1,1]})},l=function(t,e,n,r,o){var u=a(o),c=i(o),l=s(r),f={stroke:b,"stroke-opacity":w,"fill-opacity":u,fill:c};t.polyline(l,f).transform({translate:[e,n+r],scale:[1,-1]}),t.polyline(l,f).transform({translate:[e+2*r,n+r],scale:[-1,-1]}),t.polyline(l,f).transform({translate:[e,n+r],scale:[1,1]}),t.polyline(l,f).transform({translate:[e+2*r,n+r],scale:[-1,1]})},f=n(495),h=n(851),p=n(451),d=n(138),v={baseColor:"#933c3c"},y=["octogons","overlappingCircles","plusSigns","xes","sineWaves","hexagons","overlappingRings","plaid","triangles","squares","concentricCircles","diamonds","tessellation","nestedSquares","mosaicSquares","chevrons"],m="#222",g="#ddd",b="#000",w=.02,S=.02,O=.15,E=t.exports=function(t,e){return this.opts=f({},v,e),this.hash=e.hash||p(t),this.svg=new d,this.generateBackground(),this.generatePattern(),this};E.prototype.toSvg=function(){return this.svg.toString()},E.prototype.toString=function(){return this.toSvg()},E.prototype.toBase64=function(){var t=this.toSvg();return"undefined"!=typeof window&&"function"==typeof window.btoa?window.btoa(t):new Buffer(t).toString("base64")},E.prototype.toDataUri=function(){return"data:image/svg+xml;base64,"+this.toBase64()},E.prototype.toDataUrl=function(){return'url("'+this.toDataUri()+'")'},E.prototype.generateBackground=function(){var t,e,n,i;this.opts.color?n=h.hex2rgb(this.opts.color):(e=o(r(this.hash,14,3),0,4095,0,359),i=r(this.hash,17),(t=h.rgb2hsl(h.hex2rgb(this.opts.baseColor))).h=(360*t.h-e+360)%360/360,t.s=i%2==0?Math.min(1,(100*t.s+i)/100):Math.max(0,(100*t.s-i)/100),n=h.hsl2rgb(t)),this.color=h.rgb2hex(n),this.svg.rect(0,0,"100%","100%",{fill:h.rgb2rgbString(n)})},E.prototype.generatePattern=function(){var t=this.opts.generator;if(t){if(y.indexOf(t)<0)throw new Error("The generator "+t+" does not exist.")}else t=y[r(this.hash,20)];return this["geo"+t.slice(0,1).toUpperCase()+t.slice(1)]()},E.prototype.geoHexagons=function(){var t,e,n,u,s,c,l,f=o(r(this.hash,0),0,15,8,60),h=f*Math.sqrt(3),p=2*f,d=function(t){var e=t,n=e/2,r=Math.sin(60*Math.PI/180)*e;return[0,r,n,0,n+e,0,2*e,r,n+e,2*r,n,2*r,0,r].join(",")}(f);for(this.svg.setWidth(3*p+3*f),this.svg.setHeight(6*h),e=0,l=0;l<6;l++)for(c=0;c<6;c++)t=c%2==0?l*h:l*h+h/2,n=a(s=r(this.hash,e)),u={fill:i(s),"fill-opacity":n,stroke:b,"stroke-opacity":w},this.svg.polyline(d,u).transform({translate:[c*f*1.5-p/2,t-h/2]}),0===c&&this.svg.polyline(d,u).transform({translate:[6*f*1.5-p/2,t-h/2]}),0===l&&(t=c%2==0?6*h:6*h+h/2,this.svg.polyline(d,u).transform({translate:[c*f*1.5-p/2,t-h/2]})),0===c&&0===l&&this.svg.polyline(d,u).transform({translate:[6*f*1.5-p/2,5*h+h/2]}),e++},E.prototype.geoSineWaves=function(){var t,e,n,u,s,c,l=Math.floor(o(r(this.hash,0),0,15,100,400)),f=Math.floor(o(r(this.hash,1),0,15,30,100)),h=Math.floor(o(r(this.hash,2),0,15,3,30));for(this.svg.setWidth(l),this.svg.setHeight(36*h),t=0;t<36;t++)e=a(s=r(this.hash,t)),u={fill:"none",stroke:i(s),opacity:e,"stroke-width":h+"px"},n="M0 "+f+" C "+(c=l/4*.7)+" 0, "+(l/2-c)+" 0, "+l/2+" "+f+" S "+(l-c)+" "+2*f+", "+l+" "+f+" S "+(1.5*l-c)+" 0, "+1.5*l+", "+f,this.svg.path(n,u).transform({translate:[-l/4,h*t-1.5*f]}),this.svg.path(n,u).transform({translate:[-l/4,h*t-1.5*f+36*h]})},E.prototype.geoChevrons=function(){var t,e,n,u,s,c,l,f,h,p,d=o(r(this.hash,0),0,15,30,80),v=o(r(this.hash,0),0,15,30,80),y=[[0,0,(t=d)/2,(e=v)-(n=.66*e),t/2,e,0,n,0,0],[t/2,e-n,t,0,t,n,t/2,e,t/2,e-n]].map((function(t){return t.join(",")}));for(this.svg.setWidth(6*d),this.svg.setHeight(6*v*.66),s=0,p=0;p<6;p++)for(h=0;h<6;h++)c=a(f=r(this.hash,s)),u=i(f),l={stroke:b,"stroke-opacity":w,fill:u,"fill-opacity":c,"stroke-width":1},this.svg.group(l).transform({translate:[h*d,p*v*.66-v/2]}).polyline(y).end(),0===p&&this.svg.group(l).transform({translate:[h*d,6*v*.66-v/2]}).polyline(y).end(),s+=1},E.prototype.geoPlusSigns=function(){var t,e,n,s,c,l,f,h=o(r(this.hash,0),0,15,10,25),p=3*h,d=u(h);for(this.svg.setWidth(12*h),this.svg.setHeight(12*h),e=0,f=0;f<6;f++)for(l=0;l<6;l++)n=a(c=r(this.hash,e)),t=f%2==0?0:1,s={fill:i(c),stroke:b,"stroke-opacity":w,"fill-opacity":n},this.svg.group(s).transform({translate:[l*p-l*h+t*h-h,f*p-f*h-p/2]}).rect(d).end(),0===l&&this.svg.group(s).transform({translate:[4*p-l*h+t*h-h,f*p-f*h-p/2]}).rect(d).end(),0===f&&this.svg.group(s).transform({translate:[l*p-l*h+t*h-h,4*p-f*h-p/2]}).rect(d).end(),0===l&&0===f&&this.svg.group(s).transform({translate:[4*p-l*h+t*h-h,4*p-f*h-p/2]}).rect(d).end(),e++},E.prototype.geoXes=function(){var t,e,n,s,c,l,f,h=o(r(this.hash,0),0,15,10,25),p=u(h),d=3*h*.943;for(this.svg.setWidth(3*d),this.svg.setHeight(3*d),e=0,f=0;f<6;f++)for(l=0;l<6;l++)n=a(c=r(this.hash,e)),t=l%2==0?f*d-.5*d:f*d-.5*d+d/4,s={fill:i(c),opacity:n},this.svg.group(s).transform({translate:[l*d/2-d/2,t-f*d/2],rotate:[45,d/2,d/2]}).rect(p).end(),0===l&&this.svg.group(s).transform({translate:[6*d/2-d/2,t-f*d/2],rotate:[45,d/2,d/2]}).rect(p).end(),0===f&&(t=l%2==0?6*d-d/2:6*d-d/2+d/4,this.svg.group(s).transform({translate:[l*d/2-d/2,t-6*d/2],rotate:[45,d/2,d/2]}).rect(p).end()),5===f&&this.svg.group(s).transform({translate:[l*d/2-d/2,t-11*d/2],rotate:[45,d/2,d/2]}).rect(p).end(),0===l&&0===f&&this.svg.group(s).transform({translate:[6*d/2-d/2,t-6*d/2],rotate:[45,d/2,d/2]}).rect(p).end(),e++},E.prototype.geoOverlappingCircles=function(){var t,e,n,u,s,c,l=o(r(this.hash,0),0,15,25,200)/2;for(this.svg.setWidth(6*l),this.svg.setHeight(6*l),t=0,c=0;c<6;c++)for(s=0;s<6;s++)e=a(u=r(this.hash,t)),n={fill:i(u),opacity:e},this.svg.circle(s*l,c*l,l,n),0===s&&this.svg.circle(6*l,c*l,l,n),0===c&&this.svg.circle(s*l,6*l,l,n),0===s&&0===c&&this.svg.circle(6*l,6*l,l,n),t++},E.prototype.geoOctogons=function(){var t,e,n,u,s,c,l=o(r(this.hash,0),0,15,10,60),f=function(t){var e=.33*t;return[e,0,t-e,0,t,e,t,t-e,t-e,t,e,t,0,t-e,0,e,e,0].join(",")}(l);for(this.svg.setWidth(6*l),this.svg.setHeight(6*l),e=0,c=0;c<6;c++)for(s=0;s<6;s++)n=a(u=r(this.hash,e)),t=i(u),this.svg.polyline(f,{fill:t,"fill-opacity":n,stroke:b,"stroke-opacity":w}).transform({translate:[s*l,c*l]}),e+=1},E.prototype.geoSquares=function(){var t,e,n,u,s,c,l=o(r(this.hash,0),0,15,10,60);for(this.svg.setWidth(6*l),this.svg.setHeight(6*l),e=0,c=0;c<6;c++)for(s=0;s<6;s++)n=a(u=r(this.hash,e)),t=i(u),this.svg.rect(s*l,c*l,l,l,{fill:t,"fill-opacity":n,stroke:b,"stroke-opacity":w}),e+=1},E.prototype.geoConcentricCircles=function(){var t,e,n,u,s,c,l=o(r(this.hash,0),0,15,10,60),f=l/5;for(this.svg.setWidth(6*(l+f)),this.svg.setHeight(6*(l+f)),e=0,c=0;c<6;c++)for(s=0;s<6;s++)n=a(u=r(this.hash,e)),t=i(u),this.svg.circle(s*l+s*f+(l+f)/2,c*l+c*f+(l+f)/2,l/2,{fill:"none",stroke:t,opacity:n,"stroke-width":f+"px"}),n=a(u=r(this.hash,39-e)),t=i(u),this.svg.circle(s*l+s*f+(l+f)/2,c*l+c*f+(l+f)/2,l/4,{fill:t,"fill-opacity":n}),e+=1},E.prototype.geoOverlappingRings=function(){var t,e,n,u,s,c,l=o(r(this.hash,0),0,15,10,60),f=l/4;for(this.svg.setWidth(6*l),this.svg.setHeight(6*l),t=0,c=0;c<6;c++)for(s=0;s<6;s++)e=a(u=r(this.hash,t)),n={fill:"none",stroke:i(u),opacity:e,"stroke-width":f+"px"},this.svg.circle(s*l,c*l,l-f/2,n),0===s&&this.svg.circle(6*l,c*l,l-f/2,n),0===c&&this.svg.circle(s*l,6*l,l-f/2,n),0===s&&0===c&&this.svg.circle(6*l,6*l,l-f/2,n),t+=1},E.prototype.geoTriangles=function(){var t,e,n,u,s,c,l,f=o(r(this.hash,0),0,15,15,80),h=f/2*Math.sqrt(3),p=function(t,e){var n=t/2;return[n,0,t,e,0,e,n,0].join(",")}(f,h);for(this.svg.setWidth(3*f),this.svg.setHeight(6*h),t=0,l=0;l<6;l++)for(c=0;c<6;c++)e=a(s=r(this.hash,t)),u={fill:i(s),"fill-opacity":e,stroke:b,"stroke-opacity":w},n=l%2==0?c%2==0?180:0:c%2!=0?180:0,this.svg.polyline(p,u).transform({translate:[c*f*.5-f/2,h*l],rotate:[n,f/2,h/2]}),0===c&&this.svg.polyline(p,u).transform({translate:[6*f*.5-f/2,h*l],rotate:[n,f/2,h/2]}),t+=1},E.prototype.geoDiamonds=function(){var t,e,n,u,s,c,l,f,h,p=o(r(this.hash,0),0,15,10,50),d=o(r(this.hash,1),0,15,10,50),v=[(t=p)/2,0,t,(e=d)/2,t/2,e,0,e/2].join(",");for(this.svg.setWidth(6*p),this.svg.setHeight(3*d),u=0,h=0;h<6;h++)for(f=0;f<6;f++)s=a(l=r(this.hash,u)),c={fill:i(l),"fill-opacity":s,stroke:b,"stroke-opacity":w},n=h%2==0?0:p/2,this.svg.polyline(v,c).transform({translate:[f*p-p/2+n,d/2*h-d/2]}),0===f&&this.svg.polyline(v,c).transform({translate:[6*p-p/2+n,d/2*h-d/2]}),0===h&&this.svg.polyline(v,c).transform({translate:[f*p-p/2+n,d/2*6-d/2]}),0===f&&0===h&&this.svg.polyline(v,c).transform({translate:[6*p-p/2+n,d/2*6-d/2]}),u+=1},E.prototype.geoNestedSquares=function(){var t,e,n,u,s,c,l=o(r(this.hash,0),0,15,4,12),f=7*l;for(this.svg.setWidth(6*(f+l)+6*l),this.svg.setHeight(6*(f+l)+6*l),t=0,c=0;c<6;c++)for(s=0;s<6;s++)e=a(u=r(this.hash,t)),n={fill:"none",stroke:i(u),opacity:e,"stroke-width":l+"px"},this.svg.rect(s*f+s*l*2+l/2,c*f+c*l*2+l/2,f,f,n),e=a(u=r(this.hash,39-t)),n={fill:"none",stroke:i(u),opacity:e,"stroke-width":l+"px"},this.svg.rect(s*f+s*l*2+l/2+2*l,c*f+c*l*2+l/2+2*l,3*l,3*l,n),t+=1},E.prototype.geoMosaicSquares=function(){var t,e,n,i=o(r(this.hash,0),0,15,15,50);for(this.svg.setWidth(8*i),this.svg.setHeight(8*i),t=0,n=0;n<4;n++)for(e=0;e<4;e++)e%2==0?n%2==0?l(this.svg,e*i*2,n*i*2,i,r(this.hash,t)):c(this.svg,e*i*2,n*i*2,i,[r(this.hash,t),r(this.hash,t+1)]):n%2==0?c(this.svg,e*i*2,n*i*2,i,[r(this.hash,t),r(this.hash,t+1)]):l(this.svg,e*i*2,n*i*2,i,r(this.hash,t)),t+=1},E.prototype.geoPlaid=function(){var t,e,n,o,u,s,c=0,l=0;for(e=0;e<36;)c+=r(this.hash,e)+5,n=a(s=r(this.hash,e+1)),t=i(s),o=s+5,this.svg.rect(0,c,"100%",o,{opacity:n,fill:t}),c+=o,e+=2;for(e=0;e<36;)l+=r(this.hash,e)+5,n=a(s=r(this.hash,e+1)),t=i(s),u=s+5,this.svg.rect(l,0,u,"100%",{opacity:n,fill:t}),l+=u,e+=2;this.svg.setWidth(l),this.svg.setHeight(c)},E.prototype.geoTessellation=function(){var t,e,n,u,s,c=o(r(this.hash,0),0,15,5,40),l=c*Math.sqrt(3),f=2*c,h=c/2*Math.sqrt(3),p=function(t,e){return[0,0,e,t/2,0,t,0,0].join(",")}(c,h),d=3*c+2*h,v=2*l+2*c;for(this.svg.setWidth(d),this.svg.setHeight(v),e=0;e<20;e++)switch(n=a(s=r(this.hash,e)),t=i(s),u={stroke:b,"stroke-opacity":w,fill:t,"fill-opacity":n,"stroke-width":1},e){case 0:this.svg.rect(-c/2,-c/2,c,c,u),this.svg.rect(d-c/2,-c/2,c,c,u),this.svg.rect(-c/2,v-c/2,c,c,u),this.svg.rect(d-c/2,v-c/2,c,c,u);break;case 1:this.svg.rect(f/2+h,l/2,c,c,u);break;case 2:this.svg.rect(-c/2,v/2-c/2,c,c,u),this.svg.rect(d-c/2,v/2-c/2,c,c,u);break;case 3:this.svg.rect(f/2+h,1.5*l+c,c,c,u);break;case 4:this.svg.polyline(p,u).transform({translate:[c/2,-c/2],rotate:[0,c/2,h/2]}),this.svg.polyline(p,u).transform({translate:[c/2,v- -c/2],rotate:[0,c/2,h/2],scale:[1,-1]});break;case 5:this.svg.polyline(p,u).transform({translate:[d-c/2,-c/2],rotate:[0,c/2,h/2],scale:[-1,1]}),this.svg.polyline(p,u).transform({translate:[d-c/2,v+c/2],rotate:[0,c/2,h/2],scale:[-1,-1]});break;case 6:this.svg.polyline(p,u).transform({translate:[d/2+c/2,l/2]});break;case 7:this.svg.polyline(p,u).transform({translate:[d-d/2-c/2,l/2],scale:[-1,1]});break;case 8:this.svg.polyline(p,u).transform({translate:[d/2+c/2,v-l/2],scale:[1,-1]});break;case 9:this.svg.polyline(p,u).transform({translate:[d-d/2-c/2,v-l/2],scale:[-1,-1]});break;case 10:this.svg.polyline(p,u).transform({translate:[c/2,v/2-c/2]});break;case 11:this.svg.polyline(p,u).transform({translate:[d-c/2,v/2-c/2],scale:[-1,1]});break;case 12:this.svg.rect(0,0,c,c,u).transform({translate:[c/2,c/2],rotate:[-30,0,0]});break;case 13:this.svg.rect(0,0,c,c,u).transform({scale:[-1,1],translate:[c/2-d,c/2],rotate:[-30,0,0]});break;case 14:this.svg.rect(0,0,c,c,u).transform({translate:[c/2,v/2-c/2-c],rotate:[30,0,c]});break;case 15:this.svg.rect(0,0,c,c,u).transform({scale:[-1,1],translate:[c/2-d,v/2-c/2-c],rotate:[30,0,c]});break;case 16:this.svg.rect(0,0,c,c,u).transform({scale:[1,-1],translate:[c/2,v/2-v-c/2-c],rotate:[30,0,c]});break;case 17:this.svg.rect(0,0,c,c,u).transform({scale:[-1,-1],translate:[c/2-d,v/2-v-c/2-c],rotate:[30,0,c]});break;case 18:this.svg.rect(0,0,c,c,u).transform({scale:[1,-1],translate:[c/2,c/2-v],rotate:[-30,0,0]});break;case 19:this.svg.rect(0,0,c,c,u).transform({scale:[-1,-1],translate:[c/2-d,c/2-v],rotate:[-30,0,0]})}}},451:function(t){"use strict";var e=function(){var t=function(){for(var t=16;t<80;t++){var e=s[t-3]^s[t-8]^s[t-14]^s[t-16];s[t]=e<<1|e>>>31}var n,l,f=r,h=o,p=i,d=a,v=u;for(t=0;t<80;t++){t<20?(n=d^h&(p^d),l=1518500249):t<40?(n=h^p^d,l=1859775393):t<60?(n=h&p|d&(h|p),l=2400959708):(n=h^p^d,l=3395469782);var y=(f<<5|f>>>27)+n+v+l+(0|s[t]);v=d,d=p,p=h<<30|h>>>2,h=f,f=y}for(r=r+f|0,o=o+h|0,i=i+p|0,a=a+d|0,u=u+v|0,c=0,t=0;t<16;t++)s[t]=0},e=function(e){s[c]|=(255&e)<<l,l?l-=8:(c++,l=24),16===c&&t()},n=function(t){for(var e="",n=28;n>=0;n-=4)e+=(t>>n&15).toString(16);return e},r=1732584193,o=4023233417,i=2562383102,a=271733878,u=3285377520,s=new Uint32Array(80),c=0,l=24,f=0;return{update:function(t){if("string"==typeof t)return function(t){var n=t.length;f+=8*n;for(var r=0;r<n;r++)e(t.charCodeAt(r))}(t);var n=t.length;f+=8*n;for(var r=0;r<n;r++)e(t[r])},digest:function(){e(128),(c>14||14===c&&l<24)&&t(),c=14,l=24,e(0),e(0),e(f>0xffffffffff?f/1099511627776:0),e(f>4294967295?f/4294967296:0);for(var s=24;s>=0;s-=8)e(f>>s);return n(r)+n(o)+n(i)+n(a)+n(u)}}};t.exports=function(t){if(void 0===t)return e();var n=e();return n.update(t),n.digest()}},138:function(t,e,n){"use strict";var r=function(){return this.width=100,this.height=100,this.svg=i("svg"),this.context=[],this.setAttributes(this.svg,{xmlns:"http://www.w3.org/2000/svg",width:this.width,height:this.height}),this},o=n(495),i=n(97);t.exports=r,r.prototype.currentContext=function(){return this.context[this.context.length-1]||this.svg},r.prototype.end=function(){return this.context.pop(),this},r.prototype.currentNode=function(){var t=this.currentContext();return t.lastChild||t},r.prototype.transform=function(t){return this.currentNode().setAttribute("transform",Object.keys(t).map((function(e){return e+"("+t[e].join(",")+")"})).join(" ")),this},r.prototype.setAttributes=function(t,e){Object.keys(e).forEach((function(n){t.setAttribute(n,e[n])}))},r.prototype.setWidth=function(t){this.svg.setAttribute("width",Math.floor(t))},r.prototype.setHeight=function(t){this.svg.setAttribute("height",Math.floor(t))},r.prototype.toString=function(){return this.svg.toString()},r.prototype.rect=function(t,e,n,r,a){var u=this;if(Array.isArray(t))return t.forEach((function(t){u.rect.apply(u,t.concat(a))})),this;var s=i("rect");return this.currentContext().appendChild(s),this.setAttributes(s,o({x:t,y:e,width:n,height:r},a)),this},r.prototype.circle=function(t,e,n,r){var a=i("circle");return this.currentContext().appendChild(a),this.setAttributes(a,o({cx:t,cy:e,r:n},r)),this},r.prototype.path=function(t,e){var n=i("path");return this.currentContext().appendChild(n),this.setAttributes(n,o({d:t},e)),this},r.prototype.polyline=function(t,e){var n=this;if(Array.isArray(t))return t.forEach((function(t){n.polyline(t,e)})),this;var r=i("polyline");return this.currentContext().appendChild(r),this.setAttributes(r,o({points:t},e)),this},r.prototype.group=function(t){var e=i("g");return this.currentContext().appendChild(e),this.context.push(e),this.setAttributes(e,o({},t)),this}},97:function(t){"use strict";var e=t.exports=function(t){return(null!=(n=e)&&"undefined"!=typeof Symbol&&n[Symbol.hasInstance]?n[Symbol.hasInstance](this):u(this,n))?(this.tagName=t,this.attributes=Object.create(null),this.children=[],this.lastChild=null,this):new e(t);var n};e.prototype.appendChild=function(t){return this.children.push(t),this.lastChild=t,this},e.prototype.setAttribute=function(t,e){return this.attributes[t]=e,this},e.prototype.toString=function(){var t=this;return["<",t.tagName,Object.keys(t.attributes).map((function(e){return[" ",e,'="',t.attributes[e],'"'].join("")})).join(""),">",t.children.map((function(t){return t.toString()})).join(""),"</",t.tagName,">"].join("")}},495:function(t){var e=function(t){if(!t||"[object Object]"!==r.call(t)||t.nodeType||t.setInterval)return!1;var e,o=n.call(t,"constructor"),i=n.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!o&&!i)return!1;for(e in t);return void 0===e||n.call(t,e)},n=Object.prototype.hasOwnProperty,r=Object.prototype.toString;t.exports=function t(){var n,r,o,i,a,u,s=arguments[0]||{},c=1,f=arguments.length,h=!1;for("boolean"==typeof s&&(h=s,s=arguments[1]||{},c=2),"object"!=(void 0===s?"undefined":l(s))&&"function"!=typeof s&&(s={});c<f;c++)if(null!=(n=arguments[c]))for(r in n)o=s[r],s!==(i=n[r])&&(h&&i&&(e(i)||(a=Array.isArray(i)))?(a?(a=!1,u=o&&Array.isArray(o)?o:[]):u=o&&e(o)?o:{},s[r]=t(h,u,i)):void 0!==i&&(s[r]=i));return s}},279:function(t,e,n){"use strict";var r=n(493);r.createRoot,r.hydrateRoot},978:function(t,e,n){"use strict";var r=function(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!i(t,n)}catch(t){return!0}},o=n(954),i="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},a=o.useState,u=o.useEffect,s=o.useLayoutEffect,c=o.useDebugValue,l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var n=e(),o=a({inst:{value:n,getSnapshot:e}}),i=o[0].inst,l=o[1];return s((function(){i.value=n,i.getSnapshot=e,r(i)&&l({inst:i})}),[t,n,e]),u((function(){return r(i)&&l({inst:i}),t((function(){r(i)&&l({inst:i})}))}),[t]),c(n),n};e.useSyncExternalStore=void 0!==o.useSyncExternalStore?o.useSyncExternalStore:l},921:function(t,e,n){"use strict";t.exports=n(978)},641:function(t,e,n){var r=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},o=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},i=function(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):u(t,e)},a=function(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":void 0===t?"undefined":l(t)};System.register(["@openmrs/esm-config","@openmrs/esm-navigation","@openmrs/esm-error-handling","@openmrs/esm-offline"],(function(t,e){var u={},s={},c={},f={};return{setters:[function(t){u.Type=t.Type,u.defineConfigSchema=t.defineConfigSchema,u.getConfig=t.getConfig,u.validators=t.validators},function(t){s.navigate=t.navigate},function(t){c.reportError=t.reportError},function(t){f.getSynchronizationItems=t.getSynchronizationItems}],execute:function(){t(function(){var t={385:function(){System.register([],(function(t,e){return{execute:function(){t(function(){"use strict";var t=function(t,e){var n=s[t];if(n)return n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value.setState(e,!0),n.active=!0,n.value;var r=u()((function(){return e}));return s[t]={value:r,active:!0},r},e=function(t,e){var n=s[t];return n?(n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value=e,n.active=!0,n.value):(s[t]={value:e,active:!0},e)},n=function(t,e){var n=s[t];if(!n){var r=u()((function(){return null!=e?e:{}}));return s[t]={value:r,active:!1},r}return n.value},r=function(t,e,n){var r=e(t.getState());return t.subscribe((function(t){var o=e(t);o!==r&&(r=o,n(o))}))},o={d:function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},i={};o.r(i),o.d(i,{createGlobalStore:function(){return t},getGlobalStore:function(){return n},registerGlobalStore:function(){return e},subscribeTo:function(){return r}});var a=function(t){var e,n=new Set,r=function(t,r){var o="function"==typeof t?t(e):t;if(!Object.is(o,e)){var i=e;e=(null!=r?r:"object"!=(void 0===o?"undefined":l(o)))?o:Object.assign({},e,o),n.forEach((function(t){return t(e,i)}))}},o=function(){return e},i={setState:r,getState:o,subscribe:function(t){return n.add(t),function(){return n.delete(t)}},destroy:function(){console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return e=t(r,o,i),i},u=function(t){return t?a(t):a},s={};return setTimeout((function(){"development"===window.spaEnv&&(window.stores=s)}),1e3),i}())}}}))},824:function(t){"use strict";t.exports=u},254:function(t){"use strict";t.exports=c},513:function(t){"use strict";t.exports=s},738:function(t){"use strict";t.exports=f}},e={};function h(n){var r=e[n];if(void 0!==r)return r.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,h),o.exports}h.d=function(t,e){for(var n in e)h.o(e,n)&&!h.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},h.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},h.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var p={};return function(){"use strict";var t=function(t,e){function n(){this.constructor=t}ce(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=function(t){return"function"==typeof t},u=function(t){setTimeout((function(){throw t}),0)},s=function(t){return null!==t&&"object"==(void 0===t?"undefined":l(t))},c=function(t){return t.reduce((function(t,e){return t.concat(i(e,ve)?e.errors:e)}),[])},f=function(t){return t},d=function(t){if(t||(t=fe.Promise||Promise),!t)throw new Error("no Promise impl found");return t},v=function(t,e,n){var r=b(t,e,n);We.length?We.forEach((function(t){return t(r)})):setTimeout((function(){throw r}))},y=function(t){if("function"!=typeof t)throw Error(g(28,!1));We.push(t)},m=function(t){if("function"!=typeof t)throw Error(g(29,!1));var e=!1;return We=We.filter((function(n){var r=n===t;return e=e||r,!r})),e},g=function(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return"single-spa minified message #".concat(t,": ").concat(e?e+" ":"","See https://single-spa.js.org/error/?code=").concat(t).concat(r.length?"&arg=".concat(r.join("&arg=")):"")},b=function(t,e,n){var r,o="".concat(x(e)," '").concat(O(e),"' died in status ").concat(e.status,": ");if(i(t,Error)){try{t.message=o+t.message}catch(t){}r=t}else{console.warn(g(30,!1,e.status,O(e)));try{r=Error(o+JSON.stringify(t))}catch(e){r=t}}return r.appOrParcelName=O(e),e.status=n,r},w=function(t){return t.status===Xe},S=function(t){try{return t.activeWhen(window.location)}catch(e){return v(e,t,rn),!1}},O=function(t){return t.name},E=function(t){return Boolean(t.unmountThisParcel)},x=function(t){return E(t)?"parcel":"application"},j=function(){for(var t=arguments.length-1;t>0;t--)for(var e in arguments[t])"__proto__"!==e&&(arguments[t-1][e]=arguments[t][e]);return arguments[0]},P=function(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return t[n];return null},_=function(t){return t&&("function"==typeof t||(e=t,Array.isArray(e)&&!P(e,(function(t){return"function"!=typeof t}))));var e},A=function(t,e){var n=t[e]||[];0===(n=Array.isArray(n)?n:[n]).length&&(n=[function(){return Promise.resolve()}]);var r=x(t),o=O(t);return function(t){return n.reduce((function(n,i,a){return n.then((function(){var n=i(t);return k(n)?n:Promise.reject(g(15,!1,r,o,e,a))}))}),Promise.resolve())}},k=function(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch},T=function(t,e){return Promise.resolve().then((function(){return t.status!==qe?t:(t.status=Je,t.bootstrap?z(t,"bootstrap").then(n).catch((function(n){if(e)throw b(n,t,rn);return v(n,t,rn),t})):Promise.resolve().then(n))}));function n(){return t.status=Ye,t}},C=function(t,e){return Promise.resolve().then((function(){if(t.status!==Xe)return t;t.status=tn;var n=Object.keys(t.parcels).map((function(e){return t.parcels[e].unmountThisParcel()}));return Promise.all(n).then(r,(function(n){return r().then((function(){var r=Error(n.message);if(e)throw b(r,t,rn);v(r,t,rn)}))})).then((function(){return t}));function r(){return z(t,"unmount").then((function(){t.status=Ye}),(function(n){if(e)throw b(n,t,rn);v(n,t,rn)}))}}))},I=function(t,e){return Promise.resolve().then((function(){return t.status!==Ye?t:(an||(window.dispatchEvent(new Ge("single-spa:before-first-mount")),an=!0),t.status=Qe,z(t,"mount").then((function(){return t.status=Xe,un||(window.dispatchEvent(new Ge("single-spa:first-mount")),un=!0),t})).catch((function(n){return t.status=Xe,C(t,!0).then(r,r);function r(){if(e)throw b(n,t,rn);return v(n,t,rn),t}})))}))},M=function(){return D.apply(cn,arguments)},D=function(t,e){var n=this;if(!t||"object"!=(void 0===t?"undefined":l(t))&&"function"!=typeof t)throw Error(g(2,!1));if(t.name&&"string"!=typeof t.name)throw Error(g(3,!1,a(t.name)));var r=sn++,o=t.name||"parcel-".concat(r);if("object"!=(void 0===e?"undefined":l(e)))throw Error(g(4,!1,o,void 0===e?"undefined":a(e)));if(!e.domElement)throw Error(g(5,!1,o));var i,u="function"==typeof t,s=u?t:function(){return Promise.resolve(t)},c={id:r,parcels:{},status:u?$e:qe,customProps:e,parentName:O(n),unmountThisParcel:function(){return v.then((function(){if(c.status!==Xe)throw Error(g(6,!1,o,c.status));return C(c,!0)})).then((function(t){return c.parentName&&delete n.parcels[c.id],t})).then((function(t){return h(t),t})).catch((function(t){throw c.status=rn,p(t),t}))}};n.parcels[r]=c;var f=s();if(!f||"function"!=typeof f.then)throw Error(g(7,!1));f=f.then((function(t){if(!t)throw Error(g(8,!1));if(o=t.name||"parcel-".concat(r),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!_(t.bootstrap))throw Error(g(9,!1,o));if(!_(t.mount))throw Error(g(10,!1,o));if(!_(t.unmount))throw Error(g(11,!1,o));if(t.update&&!_(t.update))throw Error(g(12,!1,o));var e=A(t,"bootstrap"),n=A(t,"mount"),a=A(t,"unmount");c.status=qe,c.name=o,c.bootstrap=e,c.mount=n,c.unmount=a,c.timeouts=V(t.timeouts),t.update&&(c.update=A(t,"update"),i.update=function(t){return c.customProps=t,R((e=c,Promise.resolve().then((function(){if(e.status!==Xe)throw Error(g(32,!1,O(e)));return e.status=Ze,z(e,"update").then((function(){return e.status=Xe,e})).catch((function(t){throw b(t,e,rn)}))}))));var e})}));var h,p,d=f.then((function(){return T(c,!0)})),v=d.then((function(){return I(c,!0)})),y=new Promise((function(t,e){h=t,p=e}));return i={mount:function(){return R(Promise.resolve().then((function(){if(c.status!==Ye)throw Error(g(13,!1,o,c.status));return n.parcels[r]=c,I(c)})))},unmount:function(){return R(c.unmountThisParcel())},getStatus:function(){return c.status},loadPromise:R(f),bootstrapPromise:R(d),mountPromise:R(v),unmountPromise:R(y)}},R=function(t){return t.then((function(){return null}))},N=function(t){var e=O(t),n="function"==typeof t.customProps?t.customProps(e,window.location):t.customProps;("object"!=(void 0===n?"undefined":l(n))||null===n||Array.isArray(n))&&(n={},console.warn(g(40,!1),e,n));var r=j({},n,{name:e,mountParcel:D.bind(t),singleSpa:Ve});return E(t)&&(r.unmountSelf=t.unmountThisParcel),r},L=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(g(16,!1));ln.bootstrap={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},U=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(g(17,!1));ln.mount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},B=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(g(18,!1));ln.unmount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},F=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(g(19,!1));ln.unload={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},z=function(t,e){var n=t.timeouts[e],r=n.warningMillis,o=x(t);return new Promise((function(i,a){var u=!1,s=!1;t[e](N(t)).then((function(t){u=!0,i(t)})).catch((function(t){u=!0,a(t)})),setTimeout((function(){return l(1)}),r),setTimeout((function(){return l(!0)}),n.millis);var c=g(31,!1,e,o,O(t),n.millis);function l(t){if(!u)if(!0===t)s=!0,n.dieOnTimeout?a(Error(c)):console.error(c);else if(!s){var e=t,o=e*r;console.warn(c),o+r<n.millis&&setTimeout((function(){return l(e+1)}),r)}}}))},V=function(t){var e={};for(var n in ln)e[n]=j({},ln[n],t&&t[n]||{});return e},H=function(t){return Promise.resolve().then((function(){return t.loadPromise?t.loadPromise:t.status!==Ke&&t.status!==nn?t:(t.status=$e,t.loadPromise=Promise.resolve().then((function(){var r=t.loadApp(N(t));if(!k(r))throw n=!0,Error(g(33,!1,O(t)));return r.then((function(n){var r;t.loadErrorTime=null,"object"!=l(e=n)&&(r=34),Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!_(e.bootstrap)&&(r=35),_(e.mount)||(r=36),_(e.unmount)||(r=37);var o=x(e);if(r){var i;try{i=JSON.stringify(e)}catch(t){}return console.error(g(r,!1,o,O(t),i),e),v(void 0,t,rn),t}return e.devtools&&e.devtools.overlays&&(t.devtools.overlays=j({},t.devtools.overlays,e.devtools.overlays)),t.status=qe,t.bootstrap=A(e,"bootstrap"),t.mount=A(e,"mount"),t.unmount=A(e,"unmount"),t.unload=A(e,"unload"),t.timeouts=V(e.timeouts),delete t.loadPromise,t}))})).catch((function(e){var r;return delete t.loadPromise,n?r=rn:(r=nn,t.loadErrorTime=(new Date).getTime()),v(e,t,r),t})));var e,n}))},G=function(t){var e;if("string"==typeof t)e=t;else if(this&&this.href)e=this.href;else{if(!(t&&t.currentTarget&&t.currentTarget.href&&t.preventDefault))throw Error(g(14,!1));e=t.currentTarget.href,t.preventDefault()}var n=J(window.location.href),r=J(e);0===e.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=e:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,e)},W=function(t){var e=this;if(t){var n=t[0].type;pn.indexOf(n)>=0&&hn[n].forEach((function(n){try{n.apply(e,t)}catch(t){setTimeout((function(){throw t}))}}))}},K=function(){En([],arguments)},$=function(t,e){return function(){var n=window.location.href,r=t.apply(this,arguments),o=window.location.href;return ze&&n===o||window.dispatchEvent(function(t,e){var n;try{n=new PopStateEvent("popstate",{state:t})}catch(e){(n=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,t)}return n.singleSpa=!0,n.singleSpaTrigger=e,n}(window.history.state,e)),r}},q=function(t){if(vn)throw Error(g(43,!1));ze=!t||!t.hasOwnProperty("urlRerouteOnly")||t.urlRerouteOnly,vn=!0,dn=window.history.replaceState,window.addEventListener("hashchange",K),window.addEventListener("popstate",K);var e=window.addEventListener,n=window.removeEventListener;window.addEventListener=function(t,n){if(!("function"==typeof n&&pn.indexOf(t)>=0)||P(hn[t],(function(t){return t===n})))return e.apply(this,arguments);hn[t].push(n)},window.removeEventListener=function(t,e){if(!("function"==typeof e&&pn.indexOf(t)>=0))return n.apply(this,arguments);hn[t]=hn[t].filter((function(t){return t!==e}))},window.history.pushState=$(window.history.pushState,"pushState"),window.history.replaceState=$(dn,"replaceState")},J=function(t){var e=document.createElement("a");return e.href=t,e},Y=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!yn){var e=t.fn.on,n=t.fn.off;t.fn.on=function(t,n){return Q.call(this,e,window.addEventListener,t,n,arguments)},t.fn.off=function(t,e){return Q.call(this,n,window.removeEventListener,t,e,arguments)},yn=!0}},Q=function(t,e,n,r,o){return"string"!=typeof n?t.apply(this,o):(n.split(/\s+/).forEach((function(t){pn.indexOf(t)>=0&&(e(t,r),n=n.replace(t,""))})),""===n.trim()?this:t.apply(this,o))},X=function(t){return Promise.resolve().then((function(){var e=mn[O(t)];if(!e)return t;if(t.status===Ke)return Z(t,e),t;if(t.status===en)return e.promise.then((function(){return t}));if(t.status!==Ye&&t.status!==nn)return t;var n=t.status===nn?Promise.resolve():z(t,"unload");return t.status=en,n.then((function(){return Z(t,e),t})).catch((function(n){return function(t,e,n){delete mn[O(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,v(n,t,rn),e.reject(n)}(t,e,n),t}))}))},Z=function(t,e){delete mn[O(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=Ke,e.resolve()},tt=function(t,e,n,r){mn[O(t)]={app:t,resolve:n,reject:r},Object.defineProperty(mn[O(t)],"promise",{get:e})},et=function(t){return mn[t]},nt=function(){return gn.filter(w).map(O)},rt=function(){return gn.map(O)},ot=function(t){var e=P(gn,(function(e){return O(e)===t}));return e?e.status:null},it=function(t,e,n,r){var o=function(t,e,n,r){var o,i={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"==(void 0===t?"undefined":l(t))?(function(t){if(Array.isArray(t)||null===t)throw Error(g(39,!1));var e=["name","app","activeWhen","customProps"],n=Object.keys(t).reduce((function(t,n){return e.indexOf(n)>=0?t:t.concat(n)}),[]);if(0!==n.length)throw Error(g(38,!1,e.join(", "),n.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(g(20,!1));if("object"!=l(t.app)&&"function"!=typeof t.app)throw Error(g(20,!1));var r=function(t){return"string"==typeof t||"function"==typeof t};if(!(r(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(r)))throw Error(g(24,!1));if(!lt(t.customProps))throw Error(g(22,!1))}(t),i.name=t.name,i.loadApp=t.app,i.activeWhen=t.activeWhen,i.customProps=t.customProps):(function(t,e,n,r){if("string"!=typeof t||0===t.length)throw Error(g(20,!1));if(!e)throw Error(g(23,!1));if("function"!=typeof n)throw Error(g(24,!1));if(!lt(r))throw Error(g(22,!1))}(t,e,n,r),i.name=t,i.loadApp=e,i.activeWhen=n,i.customProps=r),i.loadApp="function"!=typeof(o=i.loadApp)?function(){return Promise.resolve(o)}:o,i.customProps=function(t){return t||{}}(i.customProps),i.activeWhen=function(t){var e=Array.isArray(t)?t:[t];return e=e.map((function(t){return"function"==typeof t?t:ft(t)})),function(t){return e.some((function(e){return e(t)}))}}(i.activeWhen),i}(t,e,n,r);if(vt()||bn||(bn=!0,setTimeout((function(){vt()||console.warn(g(1,!1))}),5e3)),-1!==rt().indexOf(o.name))throw Error(g(21,!1,o.name));gn.push(j({loadErrorTime:null,status:Ke,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},o)),fn&&(Y(),En())},at=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return gn.filter((function(e){return e.activeWhen(t)})).map(O)},ut=function(t){if(0===gn.filter((function(e){return O(e)===t})).length)throw Error(g(25,!1,t));return(fn?st(t,{waitForUnmount:!1}):Promise.resolve()).then((function(){var e=gn.map(O).indexOf(t);gn.splice(e,1)}))},st=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof t)throw Error(g(26,!1));var n=P(gn,(function(e){return O(e)===t}));if(!n)throw Error(g(27,!1,t));var r,o=et(O(n));if(e&&e.waitForUnmount){if(o)return o.promise;var i=new Promise((function(t,e){tt(n,(function(){return i}),t,e)}));return i}return o?(r=o.promise,ct(n,o.resolve,o.reject)):r=new Promise((function(t,e){tt(n,(function(){return r}),t,e),ct(n,t,e)})),r},ct=function(t,e,n){Promise.resolve().then((function(){if(P(at(),(function(e){return e===O(t)})))return ht()})).then((function(){return C(t).then(X).then((function(){e(),setTimeout((function(){En()}))}))})).catch(n)},lt=function(t){return!t||"function"==typeof t||"object"==(void 0===t?"undefined":l(t))&&null!==t&&!Array.isArray(t)},ft=function(t,e){var n=function(t,e){var n=0,r=!1,o="^";"/"!==t[0]&&(t="/"+t);for(var i=0;i<t.length;i++){var a=t[i];(!r&&":"===a||r&&"/"===a)&&u(i)}return u(t.length),new RegExp(o,"i");function u(i){var a=t.slice(n,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":a,i===t.length)if(r)e&&(o+="$");else{var u=e?"":".*";o="/"===o.charAt(o.length-1)?"".concat(o).concat(u,"$"):"".concat(o,"(/").concat(u,")?(#.*)?$")}r=!r,n=i}}(t,e);return function(t){var e=t.origin;e||(e="".concat(t.protocol,"//").concat(t.host));var r=t.href.replace(e,"").replace(t.search,"").split("?")[0];return n.test(r)}},ht=function(){return En()},pt=function(t,e){return S(t)?T(t).then((function(t){return e.then((function(){return S(t)?I(t):t}))})):e.then((function(){return t}))},dt=function(t){xn=!0,fn&&(q(t),En())},vt=function(){return xn},yt=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},mt=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},gt=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},bt=function(){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(t){return!1}},wt=function(t){return t&&t.startsWith("http")?t:("/"!==t[0]&&(t="/"+t),window.openmrsBase+t)},St=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof t)throw Error("The first argument to @openmrs/api's openmrsFetch function must be a url string");if("object"!=(void 0===e?"undefined":l(e)))throw Error("The second argument to @openmrs/api's openmrsFetch function must be a plain object.");if(!window.openmrsBase)throw Error("@openmrs/api is running in a browser that doesn't have window.openmrsBase, which is provided by openmrs-module-spa's HTML file.");var n=wt(t);if(e.headers||(e.headers={}),Le(e.body)&&(e.body=JSON.stringify(e.body)),void 0===e.headers.Accept&&(e.headers.Accept="application/json"),null===e.headers.Accept&&delete e.headers.Accept,t.startsWith(Cn)&&void 0===e.headers["Disable-WWW-Authenticate"]&&(e.headers["Disable-WWW-Authenticate"]="true"),t.startsWith(In)){var r=new URL(n,window.location.toString());r.searchParams.has("_summary")||(r.searchParams.set("_summary","data"),n=r.toString())}var o,i,a=Error();return window.fetch(n,e).then((o=function(t){var e,r;return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(o){switch(o.label){case 0:return(e=t).ok?204===e.status?(e.data=null,[2,e]):[2,e.clone().text().then((function(t){try{t&&(e.data=JSON.parse(t))}catch(t){}return e}))]:[3,1];case 1:return[4,(0,Ue.getConfig)("@openmrs/esm-api")];case 2:return r=o.sent().redirectAuthFailure,n===wt(Mn)&&403===e.status||r.enabled&&r.errors.includes(e.status)?(sessionStorage.removeItem(Pn),(0,Be.navigate)({to:r.url}),[2,r.resolvePromise?Promise.resolve():new Promise((function(){}))]):[2,e.clone().text().then((function(t){var r=t;try{r=JSON.parse(t)}catch(t){}throw new Dn(n,e,r,a)}),(function(t){throw new Dn(n,e,null,a)}))];case 3:return[2]}}))},i=function(){var t=this,e=arguments;return new Promise((function(n,r){var i=o.apply(t,e);function a(t){mt(i,n,r,a,u,"next",t)}function u(t){mt(i,n,r,a,u,"throw",t)}a(void 0)}))},function(t){return i.apply(this,arguments)}))},Ot=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"!=(void 0===e?"undefined":l(e)))throw Error("The second argument to openmrsObservableFetch must be either omitted or an object");var n=new AbortController;return e.signal=n.signal,new Se((function(r){var o=!1;return St(t,e).then((function(t){o=!0,r.next(t),r.complete()}),(function(t){o=!0,r.error(t)})),function(){o||n.abort()}}))},Et=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},xt=function(t,e){return St("".concat(Rn,"/").concat(t),{signal:e.signal})},jt=function(t,e,n){return St("".concat(Rn,"?patient=").concat(t,"&includeEncounterless=").concat(e),{signal:n.signal})},Pt=function(t,e){return Nn.apply(this,arguments)},_t=function(t,e){return St("".concat(Rn,"/").concat(t),{method:"DELETE",signal:e.signal})},At=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},kt=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){At(i,r,o,a,u,"next",t)}function u(t){At(i,r,o,a,u,"throw",t)}a(void 0)}))}},Tt=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},Ct=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{includeAuthStatus:!0};return(Fn<Date.now()-6e4||!Bn.getState().loaded)&&Dt(),new Se((function(e){var n=function(n){var r;n.loaded&&(t.includeAuthStatus?e.next(n.session):e.next(null===(r=n.session)||void 0===r?void 0:r.user))};return n(Bn.getState()),Bn.subscribe(n)}))},It=function(){return(Fn<Date.now()-6e4||!Bn.getState().loaded)&&Dt(),Bn},Mt=function(t){var e,n,r,o=null!==(r=null==t||null===(e=t.user)||void 0===e||null===(n=e.userProperties)||void 0===n?void 0:n.defaultLocale)&&void 0!==r?r:t.locale,i=document.documentElement.getAttribute("lang");(function(t){if(void 0===t||"string"!=typeof t)return!1;try{new Intl.Locale(t)}catch(t){return!1}return!0})(o)&&o!==i&&document.documentElement.setAttribute("lang",o)},Dt=function(t,e){Fn=Date.now();var n={};return t&&e&&(n.Authorization="Basic ".concat(window.btoa("".concat(t,":").concat(e)))),zt(St(Mn,{headers:n}))},Rt=function(){Bn.setState({loaded:!0,session:{authenticated:!1,sessionId:""}})},Nt=function(t,e){return void 0===e?Boolean(t):!Boolean(t)||function(t,e){return"string"==typeof t?!Un(e.privileges.find((function(e){return t===e.display}))):Array.isArray(t)?t.every((function(t){return!Un(e.privileges.find((function(e){return t===e.display})))})):(Un(t)||console.error('Could not understand privileges "'.concat(t,'"')),!0)}(t,e)||function(t){return!Un(t.roles.find((function(t){return"System Developer"===t.display})))}(e)},Lt=function(){var t,e;return new Promise((function(n){var r=function(r){r.loaded&&r.session.user&&(t=r.session.user,n(r.session.user),e&&e())};r(Bn.getState()),t||(e=Bn.subscribe(r))}))},Ut=function(){return new Promise((function(t,e){Ct().subscribe((function(e){t(e.sessionLocation)}),e).unsubscribe()}))},Bt=function(t,e){return zn.apply(this,arguments)},Ft=function(t,e,n){return Vn.apply(this,arguments)},zt=function(t){return new Promise((function(e,n){t.then((function(t){var r;"object"==l(null==t?void 0:t.data)?(r={loaded:!0,session:t.data},Bn.setState(r),e(r)):(r={loaded:!1,session:null},Bn.setState(r),n(r))})).catch((function(t){(0,Ln.reportError)("Failed to fetch new session information: ".concat(t));var e={loaded:!1,session:null};Bn.setState(e),n(e)}))}))},Vt=function(){(0,Ue.defineConfigSchema)("@openmrs/esm-api",{redirectAuthFailure:{enabled:{_type:Ue.Type.Boolean,_default:!0,_description:"Whether to redirect logged-out users to `redirectAuthFailure.url`"},url:{_type:Ue.Type.String,_default:"${openmrsSpaBase}/login",_validators:[Ue.validators.isUrl]},errors:{_type:Ue.Type.Array,_default:[401],_elements:{_type:Ue.Type.Number,_validators:[Ue.validators.inRange(100,600)]},_description:"The HTTP error codes for which users will be redirected"},resolvePromise:{_type:Ue.Type.Boolean,_default:!1,_description:"Changes how requests that fail authentication are handled. Try messing with this if redirects to the login page aren't working correctly."}}}),Dt()},Ht=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},Gt=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},Wt=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Gt(i,r,o,a,u,"next",t)}function u(t){Gt(i,r,o,a,u,"throw",t)}a(void 0)}))}},Kt=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Ht(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ht(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},$t=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},qt=function(t,e){return Gn.apply(this,arguments)},Jt=function(t){return Wn.apply(this,arguments)},Yt=function(t){return function(e){return 0===t?Zn:e.lift(new tr(t))}},Qt=function(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new nr(t,e))}},Xt=function(){return(0,Fe.getGlobalStore)("visit",ir)},Zt=function(t,e){Xt().setState({patientUuid:t,manuallySetVisitUuid:e})},te=function(t,e,n){var r=null!=n?n:or;return Ot("".concat(Cn,"/visit?patient=").concat(t,"&v=").concat(r),{signal:e.signal,method:"GET",headers:{"Content-type":"application/json"}}).pipe(Yt(1)).pipe(Qt((function(t){return t})))},ee=function(t,e){return Ot("".concat(Cn,"/visit"),{signal:e.signal,method:"POST",headers:{"Content-type":"application/json"},body:t})},ne=function(t,e,n){return Ot("".concat(Cn,"/visit/").concat(t),{signal:n.signal,method:"POST",headers:{"Content-type":"application/json"},body:e})},re=function(t){return{uuid:t.uuid,display:t.display,name:t.name}},oe=function(){return Ot("".concat(Cn,"/visittype")).pipe(Qt((function(t){return t.data.results.map(re)}))).pipe(Yt(1))},ie=function(t){return{uuid:t.uuid,display:t.display}},ae=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return Ot("".concat(Cn,"/location")+(t?"?tag="+t:"")).pipe(Qt((function(t){return t.data.results.map(ie)}))).pipe(Yt(1))};h.r(p),h.d(p,{OpenmrsFetchError:function(){return Dn},VisitMode:function(){return ar},VisitStatus:function(){return ur},attachmentUrl:function(){return Rn},backendDependencies:function(){return cr},clearCurrentUser:function(){return Rt},createAttachment:function(){return Pt},defaultVisitCustomRepresentation:function(){return or},deleteAttachmentPermanently:function(){return _t},fetchCurrentPatient:function(){return qt},fhirBaseUrl:function(){return In},getAttachmentByUuid:function(){return xt},getAttachments:function(){return jt},getCurrentUser:function(){return Ct},getLocations:function(){return ae},getLoggedInUser:function(){return Lt},getSessionLocation:function(){return Ut},getSessionStore:function(){return It},getStartedVisit:function(){return sr},getVisitStore:function(){return Xt},getVisitTypes:function(){return oe},getVisitsForPatient:function(){return te},makeUrl:function(){return wt},openmrsFetch:function(){return St},openmrsObservableFetch:function(){return Ot},refetchCurrentUser:function(){return Dt},restBaseUrl:function(){return Cn},saveVisit:function(){return ee},sessionEndpoint:function(){return Mn},setCurrentVisit:function(){return Zt},setSessionLocation:function(){return Bt},setUserLanguage:function(){return Mt},setUserProperties:function(){return Ft},setupApiModule:function(){return Vt},toLocationObject:function(){return ie},toVisitTypeObject:function(){return re},updateVisit:function(){return ne},userHasAccess:function(){return Nt}});var ue,se,ce=function(t,e){return ce=Object.setPrototypeOf||i({__proto__:[]},Array)&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},ce(t,e)},le=!1,fe={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack,le=t},get useDeprecatedSynchronousErrorHandling(){return le}},he={closed:!0,next:function(t){},error:function(t){if(fe.useDeprecatedSynchronousErrorHandling)throw t;u(t)},complete:function(){}},pe=Array.isArray||function(t){return t&&"number"==typeof t.length},de=function(){var t=function(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this};return t.prototype=Object.create(Error.prototype),t}(),ve=de,ye=function(){var t=function(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)};return t.prototype.unsubscribe=function(){var n;if(!this.closed){var r=this,o=r._parentOrParents,a=r._ctorUnsubscribe,u=r._unsubscribe,l=r._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,i(o,t))o.remove(this);else if(null!==o)for(var f=0;f<o.length;++f)o[f].remove(this);if(e(u)){a&&(this._unsubscribe=void 0);try{u.call(this)}catch(t){n=i(t,ve)?c(t.errors):[t]}}if(pe(l)){f=-1;for(var h=l.length;++f<h;){var p=l[f];if(s(p))try{p.unsubscribe()}catch(t){n=n||[],i(t,ve)?n=n.concat(c(t.errors)):n.push(t)}}}if(n)throw new ve(n)}},t.prototype.add=function(e){var n=e;if(!e)return t.EMPTY;switch(void 0===e?"undefined":a(e)){case"function":n=new t(e);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!i(n,t)){var r=n;(n=new t)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var o=n._parentOrParents;if(null===o)n._parentOrParents=this;else if(i(o,t)){if(o===this)return n;n._parentOrParents=[o,this]}else{if(-1!==o.indexOf(this))return n;o.push(this)}var u=this._subscriptions;return null===u?this._subscriptions=[n]:u.push(n),n},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}},t.EMPTY=function(t){return t.closed=!0,t}(new t),t}(),me="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random(),ge=function(e){function n(t,r,o){var a=e.call(this)||this;switch(a.syncErrorValue=null,a.syncErrorThrown=!1,a.syncErrorThrowable=!1,a.isStopped=!1,arguments.length){case 0:a.destination=he;break;case 1:if(!t){a.destination=he;break}if("object"==(void 0===t?"undefined":l(t))){i(t,n)?(a.syncErrorThrowable=t.syncErrorThrowable,a.destination=t,t.add(a)):(a.syncErrorThrowable=!0,a.destination=new be(a,t));break}default:a.syncErrorThrowable=!0,a.destination=new be(a,t,r,o)}return a}return t(n,e),n.prototype[me]=function(){return this},n.create=function(t,e,r){var o=new n(t,e,r);return o.syncErrorThrowable=!1,o},n.prototype.next=function(t){this.isStopped||this._next(t)},n.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},n.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},n.prototype._next=function(t){this.destination.next(t)},n.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},n.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},n.prototype._unsubscribeAndRecycle=function(){var t=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this},n}(ye),be=function(n){var r=function(t,r,o,i){var a,u=n.call(this)||this;u._parentSubscriber=t;var s=u;return e(r)?a=r:r&&(a=r.next,o=r.error,i=r.complete,r!==he&&(e((s=Object.create(r)).unsubscribe)&&u.add(s.unsubscribe.bind(s)),s.unsubscribe=u.unsubscribe.bind(u))),u._context=s,u._next=a,u._error=o,u._complete=i,u};return t(r,n),r.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;fe.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},r.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,n=fe.useDeprecatedSynchronousErrorHandling;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):u(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;u(t)}}},r.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var n=function(){return t._complete.call(t._context)};fe.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},r.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),fe.useDeprecatedSynchronousErrorHandling)throw t;u(t)}},r.prototype.__tryOrSetError=function(t,e,n){if(!fe.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(e){return fe.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):(u(e),!0)}return!1},r.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},r}(ge),we="function"==typeof Symbol&&Symbol.observable||"@@observable",Se=function(){var t=function(t){this._isScalar=!1,t&&(this._subscribe=t)};return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r=this.operator,o=function(t,e,n){if(t){if(i(t,ge))return t;if(t[me])return t[me]()}return t||e||n?new ge(t,e,n):new ge(he)}(t,e,n);if(r?o.add(r.call(o,this.source)):o.add(this.source||fe.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),fe.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){fe.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),function(t){for(;t;){var e=t,n=e.closed,r=e.destination,o=e.isStopped;if(n||o)return!1;t=r&&i(r,ge)?r:null}return!0}(t)?t.error(e):console.warn(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=d(e))((function(e,r){var o;o=n.subscribe((function(e){try{t(e)}catch(t){r(t),o&&o.unsubscribe()}}),r,e)}))},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[we]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:(0===(n=t).length?f:1===n.length?n[0]:function(t){return n.reduce((function(t,e){return e(t)}),t)})(this);var n},t.prototype.toPromise=function(t){var e=this;return new(t=d(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}(),Oe="object"==l(n.g)&&n.g&&n.g.Object===Object&&n.g,Ee="object"==("undefined"==typeof self?"undefined":l(self))&&self&&self.Object===Object&&self,xe=(Oe||Ee||Function("return this")()).Symbol,je=Object.prototype,Pe=je.hasOwnProperty,_e=je.toString,Ae=xe?xe.toStringTag:void 0,ke=Object.prototype.toString,Te=xe?xe.toStringTag:void 0,Ce=(ue=Object.getPrototypeOf,se=Object,function(t){return ue(se(t))}),Ie=Function.prototype,Me=Object.prototype,De=Ie.toString,Re=Me.hasOwnProperty,Ne=De.call(Object),Le=function(t){if(!function(t){return null!=t&&"object"==(void 0===t?"undefined":l(t))}(t)||"[object Object]"!=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Te&&Te in Object(t)?function(t){var e=Pe.call(t,Ae),n=t[Ae];try{t[Ae]=void 0;var r=!0}catch(t){}var o=_e.call(t);return r&&(e?t[Ae]=n:delete t[Ae]),o}(t):function(t){return ke.call(t)}(t)}(t))return!1;var e=Ce(t);if(null===e)return!0;var n=Re.call(e,"constructor")&&e.constructor;return"function"==typeof n&&i(n,n)&&De.call(n)==Ne},Ue=h(824),Be=h(513),Fe=h(385);(0,Fe.createGlobalStore)("breadcrumbs",[]);var ze,Ve=Object.freeze({__proto__:null,get start(){return dt},get ensureJQuerySupport(){return Y},get setBootstrapMaxTime(){return L},get setMountMaxTime(){return U},get setUnmountMaxTime(){return B},get setUnloadMaxTime(){return F},get registerApplication(){return it},get unregisterApplication(){return ut},get getMountedApps(){return nt},get getAppStatus(){return ot},get unloadApplication(){return st},get checkActivityFunctions(){return at},get getAppNames(){return rt},get pathToActiveWhen(){return ft},get navigateToUrl(){return G},get patchHistoryApi(){return q},get triggerAppChange(){return ht},get addErrorHandler(){return y},get removeErrorHandler(){return m},get mountRootParcel(){return M},get NOT_LOADED(){return Ke},get LOADING_SOURCE_CODE(){return $e},get NOT_BOOTSTRAPPED(){return qe},get BOOTSTRAPPING(){return Je},get NOT_MOUNTED(){return Ye},get MOUNTING(){return Qe},get UPDATING(){return Ze},get LOAD_ERROR(){return nn},get MOUNTED(){return Xe},get UNLOADING(){return en},get UNMOUNTING(){return tn},get SKIP_BECAUSE_BROKEN(){return rn}}),He=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).CustomEvent,Ge=function(){try{var t=new He("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?He:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(t,e){var n=document.createEvent("CustomEvent");return e?n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail):n.initCustomEvent(t,!1,!1,void 0),n}:function(t,e){var n=document.createEventObject();return n.type=t,e?(n.bubbles=Boolean(e.bubbles),n.cancelable=Boolean(e.cancelable),n.detail=e.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n},We=[],Ke="NOT_LOADED",$e="LOADING_SOURCE_CODE",qe="NOT_BOOTSTRAPPED",Je="BOOTSTRAPPING",Ye="NOT_MOUNTED",Qe="MOUNTING",Xe="MOUNTED",Ze="UPDATING",tn="UNMOUNTING",en="UNLOADING",nn="LOAD_ERROR",rn="SKIP_BECAUSE_BROKEN",on=[],an=!1,un=!1,sn=0,cn={parcels:{}},ln={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}},fn="undefined"!=typeof window,hn={hashchange:[],popstate:[]},pn=["hashchange","popstate"],dn=null,vn=!1;fn&&(window.singleSpaNavigate?console.warn(g(41,!1)):window.singleSpaNavigate=G);var yn=!1,mn={},gn=[],bn=!1,wn=!1,Sn=[],On=fn&&window.location.href;function En(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(wn)return new Promise((function(t,n){Sn.push({resolve:t,reject:n,eventArguments:e})}));var r,i=function(){var t=[],e=[],n=[],r=[],o=(new Date).getTime();return gn.forEach((function(i){var a=i.status!==rn&&S(i);switch(i.status){case nn:a&&o-i.loadErrorTime>=200&&n.push(i);break;case Ke:case $e:a&&n.push(i);break;case qe:case Ye:!a&&et(O(i))?t.push(i):a&&r.push(i);break;case Xe:a||e.push(i)}})),{appsToUnload:t,appsToUnmount:e,appsToLoad:n,appsToMount:r}}(),a=i.appsToUnload,u=i.appsToUnmount,s=i.appsToLoad,c=i.appsToMount,l=[],f=On,h=On=window.location.href;return vt()?(wn=!0,r=a.concat(s,u,c),Promise.resolve().then((function(){return m(0===r.length?"before-no-app-change":"before-app-change",y(!0)),m("before-routing-event",y(!0,{cancelNavigation:p})),Promise.all(l).then((function(n){if(n.some((function(t){return t})))return dn.call(window.history,history.state,"",f.substring(location.origin.length)),On=location.href,wn=!1,En(t,e,!0);var r=a.map(X),o=u.map(C).map((function(t){return t.then(X)})).concat(r),i=Promise.all(o);i.then((function(){m("before-mount-routing-event",y(!0))}),(function(t){throw t}));var l=s.map((function(t){return H(t).then((function(t){return pt(t,i)}))})),h=c.filter((function(t){return s.indexOf(t)<0})).map((function(t){return pt(t,i)}));return i.catch((function(t){throw v(),t})).then((function(){return v(),Promise.all(l.concat(h)).catch((function(e){throw t.forEach((function(t){return t.reject(e)})),e})).then(d).then((function(){}),(function(t){throw t}))}))}))}))):(r=s,Promise.resolve().then((function(){var t=s.map(H);return Promise.all(t).then(v).then((function(){return[]})).catch((function(t){throw v(),t})).finally((function(){}))})));function p(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e="function"==typeof(null==t?void 0:t.then)?t:Promise.resolve(t);l.push(e.catch((function(t){return console.warn(Error(g(42,!1))),console.warn(t),!1})))}function d(){var e=nt();t.forEach((function(t){return t.resolve(e)}));try{m(0===r.length?"no-app-change":"app-change",y()),m("routing-event",y())}catch(t){setTimeout((function(){throw t}))}if(wn=!1,Sn.length>0){var n=Sn;Sn=[],En(n)}return e}function v(){n||(t.forEach((function(t){W(t.eventArguments)})),W(e))}function y(){var t,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1?arguments[1]:void 0,l={},p=(o(t={},Xe,[]),o(t,Ye,[]),o(t,Ke,[]),o(t,rn,[]),t);n?(s.concat(c).forEach((function(t,e){v(t,Xe)})),a.forEach((function(t){v(t,Ke)})),u.forEach((function(t){v(t,Ye)}))):r.forEach((function(t){v(t)}));var d={detail:{newAppStatuses:l,appsByNewStatus:p,totalAppChanges:r.length,originalEvent:null==e?void 0:e[0],oldUrl:f,newUrl:h}};return i&&j(d.detail,i),d;function v(t,e){var n=O(t);e=e||ot(n),l[n]=e,(p[e]=p[e]||[]).push(n)}}function m(t,e){n||window.dispatchEvent(new Ge("single-spa:".concat(t),e))}}var xn=!1,jn={getRawAppData:function(){return function(t){if(Array.isArray(t))return r(t)}(t=gn)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(t)||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.")}();var t},reroute:En,NOT_LOADED:Ke,toLoadPromise:H,toBootstrapPromise:T,unregisterApplication:ut,getProfilerData:function(){return on}};fn&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=jn);var Pn="openmrs:history";function _n(t,e,n){return _n=bt()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&kn(o,n.prototype),o},_n.apply(null,arguments)}function An(t){return An=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},An(t)}function kn(t,e){return kn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},kn(t,e)}function Tn(t){var e="function"==typeof Map?new Map:void 0;return Tn=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return _n(t,arguments,An(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),kn(r,t)},Tn(t)}var Cn="/ws/rest/v1",In="/ws/fhir2/R4",Mn="".concat(Cn,"/session"),Dn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&kn(t,e)}(o,t);var e,n,r=(e=o,n=bt(),function(){var t,r=An(e);if(n){var o=An(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return function(t,e){return!e||"object"!=((n=e)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":void 0===n?"undefined":a(n))&&"function"!=typeof e?yt(t):e;var n}(this,t)});function o(t,e,n,a){var u;return function(t,e){if(!i(t,e))throw new TypeError("Cannot call a class as a function")}(this,o),gt(yt(u=r.call(this)),"response",void 0),gt(yt(u),"responseBody",void 0),u.message="Server responded with ".concat(e.status," (").concat(e.statusText,") for url ").concat(t,". Check err.responseBody or network tab in dev tools for more info"),a.message=u.message,u.responseBody=n,u.response=e,u.stack="Stacktrace for outgoing request:\n".concat(a.stack,"\nStacktrace for incoming response:\n").concat(u.stack),u}return o}(Tn(Error)),Rn="".concat(Cn,"/attachment");function Nn(){var t;return t=function(t,e){var n;return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(r){return(n=new FormData).append("fileCaption",e.fileDescription),n.append("patient",t),e.file?n.append("file",e.file):(n.append("file",new File([""],e.fileName),e.fileName),n.append("base64Content",e.base64Content)),[2,St("".concat(Rn),{method:"POST",body:n})]}))},Nn=function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Et(i,r,o,a,u,"next",t)}function u(t){Et(i,r,o,a,u,"throw",t)}a(void 0)}))},Nn.apply(this,arguments)}var Ln=h(254),Un=function(t){return void 0===t},Bn=(0,Fe.createGlobalStore)("session",{loaded:!1,session:null}),Fn=0;function zn(){return(zn=kt((function(t,e){return Tt(this,(function(n){return[2,zt(St(Mn,{method:"POST",body:{sessionLocation:t},headers:{"Content-Type":"application/json"},signal:e.signal}))]}))}))).apply(this,arguments)}function Vn(){return(Vn=kt((function(t,e,n){return Tt(this,(function(r){switch(r.label){case 0:return n||(n=new AbortController),[4,St("".concat(Cn,"/user/").concat(t),{method:"POST",body:{userProperties:e},headers:{"Content-Type":"application/json"},signal:n.signal})];case 1:return r.sent(),[2,Dt()]}}))}))).apply(this,arguments)}Bn.subscribe((function(t){return t.session&&Mt(t.session)}));var Hn=h(738);function Gn(){return Gn=Wt((function(t,e){var n,r,o,i,a,u=arguments;return $t(this,(function(s){switch(s.label){case 0:return n=!(u.length>2&&void 0!==u[2])||u[2],t?(r=null,[4,Promise.all([St("".concat(In,"/Patient/").concat(t),e).catch((function(t){return r=t})),n?Jt(t):Promise.resolve(null)])]):[3,2];case 1:if(o=Kt.apply(void 0,[s.sent(),2]),i=o[0],a=o[1],i.ok)return[2,i.data];if(a)return[2,a];if(r)throw r;s.label=2;case 2:return[2,null]}}))})),Gn.apply(this,arguments)}function Wn(){return(Wn=Wt((function(t){var e,n,r;return $t(this,(function(o){switch(o.label){case 0:return[4,(0,Hn.getSynchronizationItems)("patient-registration")];case 1:return e=o.sent(),n=e.find((function(e){return e.fhirPatient.id===t})),[2,null!==(r=null==n?void 0:n.fhirPatient)&&void 0!==r?r:null]}}))}))).apply(this,arguments)}var Kn=function(){var t=function(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this};return t.prototype=Object.create(Error.prototype),t}(),$n=function(e){var n=function(t,n){var r=e.call(this)||this;return r.subject=t,r.subscriber=n,r.closed=!1,r};return t(n,e),n.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}},n}(ye),qn=function(e){var n=function(t){var n=e.call(this,t)||this;return n.destination=t,n};return t(n,e),n}(ge),Jn=function(e){var n=function(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t};return t(n,e),n.prototype[me]=function(){return new qn(this)},n.prototype.lift=function(t){var e=new Yn(this,this);return e.operator=t,e},n.prototype.next=function(t){if(this.closed)throw new Kn;if(!this.isStopped)for(var e=this.observers,n=e.length,r=e.slice(),o=0;o<n;o++)r[o].next(t)},n.prototype.error=function(t){if(this.closed)throw new Kn;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,n=e.length,r=e.slice(),o=0;o<n;o++)r[o].error(t);this.observers.length=0},n.prototype.complete=function(){if(this.closed)throw new Kn;this.isStopped=!0;for(var t=this.observers,e=t.length,n=t.slice(),r=0;r<e;r++)n[r].complete();this.observers.length=0},n.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},n.prototype._trySubscribe=function(t){if(this.closed)throw new Kn;return e.prototype._trySubscribe.call(this,t)},n.prototype._subscribe=function(t){if(this.closed)throw new Kn;return this.hasError?(t.error(this.thrownError),ye.EMPTY):this.isStopped?(t.complete(),ye.EMPTY):(this.observers.push(t),new $n(this,t))},n.prototype.asObservable=function(){var t=new Se;return t.source=this,t},n.create=function(t,e){return new Yn(t,e)},n}(Se),Yn=function(e){var n=function(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r};return t(n,e),n.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},n.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},n.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},n.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):ye.EMPTY},n}(Jn),Qn=function(e){var n=function(t){var n=e.call(this)||this;return n._value=t,n};return t(n,e),Object.defineProperty(n.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),n.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return n&&!n.closed&&t.next(this._value),n},n.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new Kn;return this._value},n.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},n}(Jn),Xn=function(){var t=function(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this};return t.prototype=Object.create(Error.prototype),t}(),Zn=new Se((function(t){return t.complete()})),tr=function(){var t=function(t){if(this.total=t,this.total<0)throw new Xn};return t.prototype.call=function(t,e){return e.subscribe(new er(t,this.total))},t}(),er=function(e){var n=function(t,n){var r=e.call(this,t)||this;return r.total=n,r.count=0,r};return t(n,e),n.prototype._next=function(t){var e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))},n}(ge),nr=function(){var t=function(t,e){this.project=t,this.thisArg=e};return t.prototype.call=function(t,e){return e.subscribe(new rr(t,this.project,this.thisArg))},t}(),rr=function(e){var n=function(t,n,r){var o=e.call(this,t)||this;return o.project=n,o.count=0,o.thisArg=r||o,o};return t(n,e),n.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},n}(ge),or="custom:(uuid,display,voided,indication,startDatetime,stopDatetime,encounters:(uuid,display,encounterDatetime,form:(uuid,name),location:ref,encounterType:ref,encounterProviders:(uuid,display,provider:(uuid,display))),patient:(uuid,display),visitType:(uuid,name,display),attributes:(uuid,display,attributeType:(name,datatypeClassname,uuid),value),location:(uuid,name,display))",ir=function(){try{return JSON.parse(localStorage.getItem("openmrs:visitStoreState")||"null")}catch(t){return null}}()||{patientUuid:null,manuallySetVisitUuid:null};Xt().subscribe((function(t){var e;e=t,localStorage.setItem("openmrs:visitStoreState",JSON.stringify(e))}));var ar,ur,sr=new Qn(null);!function(t){t.NEWVISIT="startVisit",t.EDITVISIT="editVisit",t.LOADING="loadingVisit"}(ar||(ar={})),function(t){t.NOTSTARTED="notStarted",t.ONGOING="ongoing"}(ur||(ur={}));var cr={"webservices.rest":"2.24.0",fhir2:"1.0.0-SNAPSHOT"}}(),p}())}}}))},714:function(){var t=function(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":void 0===t?"undefined":l(t)};System.register(["@openmrs/esm-state"],(function(e,n){var r={};return{setters:[function(t){r.createGlobalStore=t.createGlobalStore,r.getGlobalStore=t.getGlobalStore}],execute:function(){e(function(){"use strict";var e={685:function(t){t.exports=r}},n={};function o(t){var r=n[t];if(void 0!==r)return r.exports;var i=n[t]={exports:{}};return e[t](i,i.exports,o),i.exports}o.d=function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};return function(){var e=function(t){return null!=t&&"object"==(void 0===t?"undefined":l(t))&&!0===t["@@functional/placeholder"]},n=function(t){return function n(r){return 0===arguments.length||e(r)?n:t.apply(this,arguments)}},r=function(t){return function r(o,i){switch(arguments.length){case 0:return r;case 1:return e(o)?r:n((function(e){return t(o,e)}));default:return e(o)&&e(i)?r:e(o)?n((function(e){return t(e,i)})):e(i)?n((function(e){return t(o,e)})):t(o,i)}}},a=function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n},u=function(t,e,n){for(var r=0,o=n.length;r<o;){if(t(e,n[r]))return!0;r+=1}return!1},s=function(t,e){return Object.prototype.hasOwnProperty.call(e,t)},c=function(t,e,n,r){var o=a(t);function i(t,e){return ht(t,e,n.slice(),r.slice())}return!u((function(t,e){return!u(i,e,t)}),a(e),o)},f=function(t){return function o(i,a,u){switch(arguments.length){case 0:return o;case 1:return e(i)?o:r((function(e,n){return t(i,e,n)}));case 2:return e(i)&&e(a)?o:e(i)?r((function(e,n){return t(e,a,n)})):e(a)?r((function(e,n){return t(i,e,n)})):n((function(e){return t(i,a,e)}));default:return e(i)&&e(a)&&e(u)?o:e(i)&&e(a)?r((function(e,n){return t(e,n,u)})):e(i)&&e(u)?r((function(e,n){return t(e,a,n)})):e(a)&&e(u)?r((function(e,n){return t(i,e,n)})):e(i)?n((function(e){return t(e,a,u)})):e(a)?n((function(e){return t(i,e,u)})):e(u)?n((function(e){return t(i,a,e)})):t(i,a,u)}}},h=function(t){return"[object Object]"===Object.prototype.toString.call(t)},p=function(t,e,n){for(var r=n.next();!r.done;){if((e=t["@@transducer/step"](e,r.value))&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}r=n.next()}return t["@@transducer/result"](e)},d=function(t,e,n,r){return t["@@transducer/result"](n[r](jt(t["@@transducer/step"],t),e))},v=function(t,e){return function(n){if(!t(n))return"function"==typeof e?e(n):e}},y=function(t){return(0,Dt.getGlobalStore)("config-module-".concat(t),{config:null,loaded:!1,translationOverridesLoaded:!1})},m=function(){return(0,Dt.getGlobalStore)("config-extension-slots",{slots:{}})},g=function(t){return b(m().getState(),t)},b=function(t,e){var n=t.slots[e];return null!=n?n:{loaded:!1,config:{}}},w=function(){return(0,Dt.getGlobalStore)("config-extensions",{configs:{}})},S=function(t,e){var n=Object.assign({},O(w().getState(),t,e));return n.config=mt(["Display conditions","Translation overrides"],n.config),n},O=function(t,e,n){var r,o=null===(r=t.configs[e])||void 0===r?void 0:r[n];return null!=o?o:{loaded:!1,config:null}},E=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},x=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},j=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){x(t,e,n[e])}))}return t},P=function(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n.push.apply(n,r)}return n}(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},_=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t,e)||k(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},A=function(t){return function(t){if(Array.isArray(t))return E(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||k(t)||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.")}()},k=function(t,e){if(t){if("string"==typeof t)return E(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?E(t,e):void 0}},T=function(t,e){var n=!0,r=!1,o=void 0;try{for(var i,a=Object.keys(t.schemas)[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var u=i.value,s=y(u);if(t.moduleLoaded[u]){var c=W(u,t,e);s.setState({translationOverridesLoaded:!0,loaded:!0,config:c})}else{var l=K(u,t,e);s.setState({translationOverridesLoaded:!0,loaded:!1,config:l})}}}catch(t){r=!0,o=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}},C=function(t,e){var n,r,o=(n=q(G(t,e)),function(t){var e=!0,n=!1,r=void 0;try{for(var o,i=Object.entries(t)[Symbol.iterator]();!(e=(o=i.next()).done);e=!0){var a=_(o.value,2),u=a[0],s=a[1],c=!0,l=!1,f=void 0;try{for(var h,p=Object.entries(s)[Symbol.iterator]();!(c=(h=p.next()).done);c=!0){var d=_(h.value,2),v=d[0];H(d[1],u,v)}}catch(t){l=!0,f=t}finally{try{c||null==p.return||p.return()}finally{if(l)throw f}}}}catch(t){n=!0,r=t}finally{try{e||null==i.return||i.return()}finally{if(n)throw r}}}(r=Object.keys(n).reduce((function(t,e){var r,o;return(null===(r=n[e])||void 0===r?void 0:r.extensionSlots)&&(t[e]=null===(o=n[e])||void 0===o?void 0:o.extensionSlots),t}),{})),Object.keys(r).reduce((function(t,e){return j({},t,r[e])}),{})),i=Object.fromEntries(Object.entries(o).map((function(t){var e=_(t,2);return[e[0],{loaded:!0,config:e[1]}]}))),a=m(),u=a.getState(),s={slots:j({},u.slots,i)};pt(u,s)||a.setState(s)},I=function(t,e){var n=function(t,e){var n=Bt(wt(t.schemas)),r=A(t.providedConfigs.map((function(t){return[t.config,t.source]}))).concat([[e.config,"temporary config"]]),o=!0,i=!1,a=void 0;try{for(var u,s=r[Symbol.iterator]();!(o=(u=s.next()).done);o=!0){var c=_(u.value,2);n=q([n,Ft(c[0],c[1])])}}catch(t){i=!0,a=t}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}return n}(t,e);Ut.setState({config:n})},M=function(t,e,n){var r={},o=!0,i=!1,a=void 0;try{for(var u,s=e.mountedExtensions[Symbol.iterator]();!(o=(u=s.next()).done);o=!0){var c=u.value,l=V(c.slotModuleName,c.extensionModuleName,c.slotName,c.extensionId,t,n);r[c.slotName]=P(j({},r[c.slotName]),x({},c.extensionId,{config:l,loaded:!0}))}}catch(t){i=!0,a=t}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}w().setState({configs:r})},D=function(t,e){zt(t,e);var n=yt(e,$t);Rt.setState((function(e){return P(j({},e),{schemas:P(j({},e.schemas),x({},t,n)),moduleLoaded:P(j({},e.moduleLoaded),x({},t,!0))})}))},R=function(t){var e=Rt.getState();Rt.setState({schemas:P(j({},e.schemas),x({},t,$t))})},N=function(t){var e=Rt.getState();Rt.setState({schemas:P(j({},e.schemas),x({},t,Kt))})},L=function(t,e){zt(t,e);var n=yt(e,$t),r=Rt.getState();r.schemas[t]&&console.error("Config schema for extension ".concat(t," already exists. If there are multiple extensions with this same name, one will probably crash.")),Rt.setState({schemas:P(j({},r.schemas),x({},t,n))})},U=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"provided";Rt.setState((function(n){return P(j({},n),{providedConfigs:A(n.providedConfigs).concat([{source:e,config:t}])})}))},B=function(t){return new Promise((function(e){var n=function(t){if(t.loaded&&t.config){var n=mt(["Display conditions","Translation overrides"],t.config);e(n),o&&o()}},r=y(t);n(r.getState());var o=r.subscribe(n)}))},F=function(t){return new Promise((function(e){var n=function(t){if(t.translationOverridesLoaded&&t.config){var n,r=null!==(n=t.config["Translation overrides"])&&void 0!==n?n:{};e(r),o&&o()}},r=y(t);n(r.getState());var o=r.subscribe(n)}))},z=function(t,e,n){J(t,e,n);var r=Gt(t,e);return Ht(t,r,n),r},V=function(t,e,n,r,o,i){var a,u,s,c,l=function(t){return _(t.split("#"),1)[0]}(r),f=o.schemas[l],h=f?l:e,p=G(o,i),d=$(t,p),v=null!==(c=null==d||null===(a=d.extensionSlots)||void 0===a||null===(u=a[n])||void 0===u||null===(s=u.configure)||void 0===s?void 0:s[r])&&void 0!==c?c:{},y=q([$(h,p),v]),m=null!=f?f:o.schemas[e];J(m,y,h);var g=Gt(m,y);return Ht(m,g,h),delete g.extensionSlots,g},H=function(t,e,n){var r="".concat(e,".extensionSlots.").concat(n),o="Extension slot config '".concat(r,"'"),i=Object.keys(t).filter((function(t){return!["add","remove","order","configure"].includes(t)}));i.length&&tt(r,o+"' contains invalid keys '".concat(i.join("', '"),"'")),t.add&&(Array.isArray(t.add)&&t.add.every((function(t){return"string"==typeof t}))||tt(r,o+".add' is invalid. Must be an array of strings (extension IDs)")),t.remove&&(Array.isArray(t.remove)&&t.remove.every((function(t){return"string"==typeof t}))||tt(r,o+".remove' is invalid. Must be an array of strings (extension IDs)")),t.order&&(Array.isArray(t.order)&&t.order.every((function(t){return"string"==typeof t}))||tt(r,o+".order' is invalid. Must be an array of strings (extension IDs)")),t.configure&&(Z(t.configure)||tt(r,o+".configure' is invalid. Must be an object with extension IDs for keys"))},G=function(t,e){return A(t.providedConfigs.map((function(t){return t.config}))).concat([e.config])},W=function(t,e,n){var r=e.schemas[t],o=$(t,G(e,n));J(r,o,t);var i=Gt(r,o);return Ht(r,i,t),delete i.extensionSlots,i},K=function(t,e,n){var r=$(t,G(e,n)),o=Gt($t,r);return Ht($t,o,t),delete o.extensionSlots,o},$=function(t,e){return q(e.map((function(e){return e[t]})).filter((function(t){return!!t})))},q=function(t){return _t(yt)({},t)},J=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=!0,o=!1,i=void 0;try{for(var a,u=Object.keys(e)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=a.value,c=e[s],l=n+"."+s,f=t[s];t.hasOwnProperty(s)?Vt(f,c,l):"extensionSlots"===s&&""!==n||tt(l,"Unknown config key '".concat(l,"' provided. Ignoring."))}}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}},Y=function(t,e,n){e&&Q(t,[{Array:At,Boolean:kt,ConceptUuid:Mt,Number:Tt,Object:It,String:Ct,UUID:Mt,PersonAttributeTypeUuid:Mt,PatientIdentifierTypeUuid:Mt}[e]],n)},Q=function(t,e,n){if(e)try{var r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=(0,a.value)(n);"string"==typeof s&&tt(t,"object"==(void 0===n?"undefined":l(n))?"Invalid configuration for ".concat(t,": ").concat(s):"Invalid configuration value ".concat(n," for ").concat(t,": ").concat(s))}}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}catch(e){console.error('Skipping invalid validator at "'.concat(t,'". Encountered error\n\t').concat(e))}},X=function(t){return!!t&&Object.keys(t).filter((function(t){return!["_default","_validators"].includes(t)})).length>0},Z=function(t){return"object"==(void 0===t?"undefined":l(t))&&!Array.isArray(t)&&null!==t},tt=function(t,e){var n="".concat(t,":::").concat(e);Wt.has(n)||(console.error(e),Wt.add(n))},et=function(t){t?Wt.forEach((function(e){e.startsWith(t)&&Wt.delete(e)})):Wt.clear()};o.r(i),o.d(i,{Type:function(){return bt},clearConfigErrors:function(){return et},configExtensionStore:function(){return Lt},configInternalStore:function(){return Rt},defineConfigSchema:function(){return D},defineExtensionConfigSchema:function(){return L},getConfig:function(){return B},getConfigStore:function(){return y},getExtensionConfig:function(){return S},getExtensionConfigFromStore:function(){return O},getExtensionSlotConfig:function(){return g},getExtensionSlotConfigFromStore:function(){return b},getExtensionSlotsConfigStore:function(){return m},getExtensionsConfigStore:function(){return w},getTranslationOverrides:function(){return F},implementerToolsConfigStore:function(){return Ut},inRange:function(){return qt},isUrl:function(){return Yt},isUrlWithTemplateParameters:function(){return Jt},oneOf:function(){return Qt},processConfig:function(){return z},provide:function(){return U},registerModuleWithConfigSystem:function(){return R},registerTranslationNamespace:function(){return N},temporaryConfigStore:function(){return Nt},validator:function(){return v},validators:function(){return Xt}});var nt="function"==typeof Object.is?Object.is:function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e},rt=Object.prototype.toString,ot=function(){return"[object Arguments]"===rt.call(arguments)?function(t){return"[object Arguments]"===rt.call(t)}:function(t){return s("callee",t)}}(),it=ot,at=!{toString:null}.propertyIsEnumerable("toString"),ut=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],st=function(){return arguments.propertyIsEnumerable("length")}(),ct=function(t,e){for(var n=0;n<t.length;){if(t[n]===e)return!0;n+=1}return!1},lt="function"!=typeof Object.keys||st?n((function(t){if(Object(t)!==t)return[];var e,n,r=[],o=st&&it(t);for(e in t)!s(e,t)||o&&"length"===e||(r[r.length]=e);if(at)for(n=ut.length-1;n>=0;)s(e=ut[n],t)&&!ct(r,e)&&(r[r.length]=e),n-=1;return r})):n((function(t){return Object(t)!==t?[]:Object.keys(t)})),ft=n((function(t){return null===t?"Null":void 0===t?"Undefined":Object.prototype.toString.call(t).slice(8,-1)}));function ht(e,n,r,o){if(nt(e,n))return!0;var i,a,u=ft(e);if(u!==ft(n))return!1;if(null==e||null==n)return!1;if("function"==typeof e["fantasy-land/equals"]||"function"==typeof n["fantasy-land/equals"])return"function"==typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](n)&&"function"==typeof n["fantasy-land/equals"]&&n["fantasy-land/equals"](e);if("function"==typeof e.equals||"function"==typeof n.equals)return"function"==typeof e.equals&&e.equals(n)&&"function"==typeof n.equals&&n.equals(e);switch(u){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===(i=e.constructor,null==(a=String(i).match(/^function (\w*)/))?"":a[1]))return e===n;break;case"Boolean":case"Number":case"String":if((void 0===e?"undefined":t(e))!=(void 0===n?"undefined":t(n))||!nt(e.valueOf(),n.valueOf()))return!1;break;case"Date":if(!nt(e.valueOf(),n.valueOf()))return!1;break;case"Error":return e.name===n.name&&e.message===n.message;case"RegExp":if(e.source!==n.source||e.global!==n.global||e.ignoreCase!==n.ignoreCase||e.multiline!==n.multiline||e.sticky!==n.sticky||e.unicode!==n.unicode)return!1}for(var l=r.length-1;l>=0;){if(r[l]===e)return o[l]===n;l-=1}switch(u){case"Map":return e.size===n.size&&c(e.entries(),n.entries(),r.concat([e]),o.concat([n]));case"Set":return e.size===n.size&&c(e.values(),n.values(),r.concat([e]),o.concat([n]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var f=lt(e);if(f.length!==lt(n).length)return!1;var h=r.concat([e]),p=o.concat([n]);for(l=f.length-1;l>=0;){var d=f[l];if(!s(d,n)||!ht(n[d],e[d],h,p))return!1;l-=1}return!0}var pt=r((function(t,e){return ht(t,e,[],[])})),dt=f((function(t,e,n){var r,o={};for(r in e)s(r,e)&&(o[r]=s(r,n)?t(r,e[r],n[r]):e[r]);for(r in n)s(r,n)&&!s(r,o)&&(o[r]=n[r]);return o})),vt=f((function t(e,n,r){return dt((function(n,r,o){return h(r)&&h(o)?t(e,r,o):e(n,r,o)}),n,r)})),yt=r((function(t,e){return vt((function(t,e,n){return n}),t,e)})),mt=r((function(t,e){for(var n={},r={},o=0,i=t.length;o<i;)r[t[o]]=1,o+=1;for(var a in e)r.hasOwnProperty(a)||(n[a]=e[a]);return n}));function gt(t,e,n,r){var o,i=function(o){for(var i=e.length,a=0;a<i;){if(t===e[a])return n[a];a+=1}for(var u in e[a+1]=t,n[a+1]=o,t)o[u]=r?gt(t[u],e,n,!0):t[u];return o};switch(ft(t)){case"Object":return i({});case"Array":return i([]);case"Date":return new Date(t.valueOf());case"RegExp":return o=t,new RegExp(o.source,(o.global?"g":"")+(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.sticky?"y":"")+(o.unicode?"u":""));default:return t}}var bt,wt=n((function(t){return null!=t&&"function"==typeof t.clone?t.clone():gt(t,[],[],!0)})),St=Array.isArray||function(t){return null!=t&&t.length>=0&&"[object Array]"===Object.prototype.toString.call(t)},Ot=n((function(t){return!!St(t)||!!t&&"object"==(void 0===t?"undefined":l(t))&&!function(t){return"[object String]"===Object.prototype.toString.call(t)}(t)&&(1===t.nodeType?!!t.length:0===t.length||t.length>0&&t.hasOwnProperty(0)&&t.hasOwnProperty(t.length-1))})),Et=function(){var t=function(t){this.f=t};return t.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},t.prototype["@@transducer/result"]=function(t){return t},t.prototype["@@transducer/step"]=function(t,e){return this.f(t,e)},t}(),xt=r((function(t,e){return function(t,e){switch(t){case 0:return function(){return e.apply(this,arguments)};case 1:return function(t){return e.apply(this,arguments)};case 2:return function(t,n){return e.apply(this,arguments)};case 3:return function(t,n,r){return e.apply(this,arguments)};case 4:return function(t,n,r,o){return e.apply(this,arguments)};case 5:return function(t,n,r,o,i){return e.apply(this,arguments)};case 6:return function(t,n,r,o,i,a){return e.apply(this,arguments)};case 7:return function(t,n,r,o,i,a,u){return e.apply(this,arguments)};case 8:return function(t,n,r,o,i,a,u,s){return e.apply(this,arguments)};case 9:return function(t,n,r,o,i,a,u,s,c){return e.apply(this,arguments)};case 10:return function(t,n,r,o,i,a,u,s,c,l){return e.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}(t.length,(function(){return t.apply(e,arguments)}))})),jt=xt,Pt="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",_t=f((function(t,e,n){if("function"==typeof t&&(t=function(t){return new Et(t)}(t)),Ot(n))return function(t,e,n){for(var r=0,o=n.length;r<o;){if((e=t["@@transducer/step"](e,n[r]))&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}r+=1}return t["@@transducer/result"](e)}(t,e,n);if("function"==typeof n["fantasy-land/reduce"])return d(t,e,n,"fantasy-land/reduce");if(null!=n[Pt])return p(t,e,n[Pt]());if("function"==typeof n.next)return p(t,e,n);if("function"==typeof n.reduce)return d(t,e,n,"reduce");throw new TypeError("reduce: list must be array or iterable")}));!function(t){t.Array="Array",t.Boolean="Boolean",t.ConceptUuid="ConceptUuid",t.Number="Number",t.Object="Object",t.String="String",t.UUID="UUID",t.PersonAttributeTypeUuid="PersonAttributeTypeUuid",t.PatientIdentifierTypeUuid="PatientIdentifierTypeUuid"}(bt||(bt={}));var At=v((function(t){return Array.isArray(t)}),"must be an array"),kt=v((function(t){return"boolean"==typeof t}),"must be a boolean"),Tt=v((function(t){return"number"==typeof t}),"must be a number"),Ct=v((function(t){return"string"==typeof t}),"must be a string"),It=v((function(t){return"object"==(void 0===t?"undefined":l(t))&&!Array.isArray(t)&&null!==t}),"must be an object (not an array or null)"),Mt=v((function(t){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t)||/^[0-9a-f]{36}$/i.test(t)}),"must be a valid UUID or a 36-character hexadecimal string"),Dt=o(685),Rt=(0,Dt.createGlobalStore)("config-internal",{providedConfigs:[],schemas:{},moduleLoaded:{}}),Nt=(0,Dt.createGlobalStore)("temporary-config",{config:function(){try{return JSON.parse(localStorage.getItem("openmrs:temporaryConfig")||"{}")}catch(t){return{}}}()});Nt.subscribe((function(t){var e;e=t.config,localStorage.setItem("openmrs:temporaryConfig",JSON.stringify(e))}));var Lt=(0,Dt.createGlobalStore)("config-store-of-extension-state",{mountedExtensions:[]}),Ut=(0,Dt.createGlobalStore)("config-implementer-tools",{config:{}});function Bt(t){return t.hasOwnProperty("_default")?P(j({},t),{_value:t._default,_source:"default"}):Z(t)?Object.keys(t).reduce((function(e,n){return e[n]=Bt(t[n]),e}),{}):{}}function Ft(t,e){return Z(t)?Object.keys(t).reduce((function(n,r){return n[r]=Ft(t[r],e),n}),{}):{_value:t,_source:e}}function zt(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r="Please verify that you are running the latest version and, if so, alert the maintainer.",o=!0,i=!1,a=void 0;try{for(var u,s=function(){var o=u.value,i=n+(n&&".")+o,a=e[o];if("Display conditions"===i&&console.error("".concat(t,' declares a configuration option called "Display conditions"; the "Display conditions" option is a reserved name. ').concat(r)),"Translation overrides"===i&&console.error("".concat(t,' declares a configuration option called "Translation overrides"; the "Translation overrides" option is a reserved name. ').concat(r)),!Z(a))return console.error("".concat(t," has bad config schema definition for key '").concat(i,"'. ").concat(r)),"continue";a.hasOwnProperty("_default")||zt(t,a,i);var s=a._elements;if(X(s)&&zt(t,s,i+"._elements"),a._validators){var c=!0,l=!1,f=void 0;try{for(var h,p=a._validators[Symbol.iterator]();!(c=(h=p.next()).done);c=!0){var d=h.value;"function"!=typeof d&&console.error("".concat(t," has invalid validator for key '").concat(i,"' ").concat(r,".")+"\n\nIf you're the maintainer: validators must be functions that return either "+"undefined or an error string. Received ".concat(d,"."))}}catch(t){l=!0,f=t}finally{try{c||null==p.return||p.return()}finally{if(l)throw f}}}var v=a._type;v&&!Object.values(bt).includes(v)&&console.error("".concat(t," has invalid type for key '").concat(i,"' ").concat(r,".")+"\n\nIf you're the maintainer: the allowed types are ".concat(Object.values(bt).join(", "),". ")+"Received '".concat(v,"'")),Object.keys(a).every((function(t){return["_description","_validators","_elements","_type"].includes(t)}))&&!n.includes("._elements")&&console.error("".concat(t," has bad config schema definition for key '").concat(i,"'. ").concat(r,".")+"\n\nIf you're the maintainer: all config elements must have a default. "+"Received ".concat(JSON.stringify(a))),s&&v&&![bt.Array,bt.Object].includes(v)&&console.error("".concat(t," has bad config schema definition for key '").concat(i,"'. ").concat(r,".")+"\n\nIf you're the maintainer: the 'elements' key only works with '_type' equal to 'Array' or 'Object'. "+"Received ".concat(JSON.stringify(v)))},c=Object.keys(e).filter((function(t){return!t.startsWith("_")}))[Symbol.iterator]();!(o=(u=c.next()).done);o=!0)s()}catch(t){i=!0,a=t}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}}function Vt(t,e,n){Y(n,t._type,e),Z(e)?t._type===bt.Object?function(t,e,n){if(t._elements){var r=!0,o=!1,i=void 0;try{for(var a,u=Object.keys(e)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=a.value,c=e[s];J(t._elements,c,"".concat(n,".").concat(s))}}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}}(t,e,n):t.hasOwnProperty("_default")||t.hasOwnProperty("_type")||J(t,e,n):t._type===bt.Array&&function(t,e,n){if(X(t._elements))for(var r=0;r<e.length;r++)Vt(t._elements,e[r],"".concat(n,"[").concat(r,"]"));for(var o=0;o<e.length;o++){var i;Y("".concat(n,"[").concat(o,"]"),null===(i=t._elements)||void 0===i?void 0:i._type,e[o])}}(t,e,n)}function Ht(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(t)if(e!==t._default&&Q(n,t._validators,e),Z(e)){var r=!0,o=!1,i=void 0;try{for(var a,u=Object.keys(e)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=a.value,c=e[s],l=n+"."+s,f=t[s];t._type===bt.Object&&t._elements?Ht(t._elements,c,l):Ht(f,c,l)}}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}else if(Array.isArray(e)&&t._elements)for(var h=0;h<e.length;h++)Ht(t._elements,e[h],"".concat(n,"[").concat(h,"]"))}T(Rt.getState(),Nt.getState()),Rt.subscribe((function(t){return T(t,Nt.getState())})),Nt.subscribe((function(t){return T(Rt.getState(),t)})),I(Rt.getState(),Nt.getState()),Rt.subscribe((function(t){return I(t,Nt.getState())})),Nt.subscribe((function(t){return I(Rt.getState(),t)})),C(Rt.getState(),Nt.getState()),Rt.subscribe((function(t){return C(t,Nt.getState())})),Nt.subscribe((function(t){return C(Rt.getState(),t)})),M(Rt.getState(),Lt.getState(),Nt.getState()),Rt.subscribe((function(t){M(t,Lt.getState(),Nt.getState())})),Lt.subscribe((function(t){M(Rt.getState(),t,Nt.getState())})),Nt.subscribe((function(t){M(Rt.getState(),Lt.getState(),t)}));var Gt=function(t,e){var n=wt(e);if(!t)return n;var r=!0,o=!1,i=void 0;try{for(var a,u=function(){var e=a.value,r=n[e],o=t[e];if(o&&(o.hasOwnProperty("_type")||o.hasOwnProperty("_default"))){n.hasOwnProperty(e)||(n[e]=o._default);var i=o._elements;if(r&&X(i))if(o._type===bt.Array&&Array.isArray(r)){var u=r.map((function(t){return Gt(i,t)}));n[e]=u}else if(o._type===bt.Object){var s=!0,c=!1,l=void 0;try{for(var f,h=Object.keys(r)[Symbol.iterator]();!(s=(f=h.next()).done);s=!0){var p=f.value;r[p]=Gt(i,r[p])}}catch(t){c=!0,l=t}finally{try{s||null==h.return||h.return()}finally{if(c)throw l}}}}else if(Z(o)){var d=null!=r?r:{};Z(d)&&(n[e]=Gt(o,d))}},s=Object.keys(t)[Symbol.iterator]();!(r=(a=s.next()).done);r=!0)u()}catch(t){o=!0,i=t}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n},Wt=new Set,Kt={"Translation overrides":{_description:"Per-language overrides for frontend translations should be keyed by language code and each language dictionary contains the translation key and the display value",_type:bt.Object,_default:{},_validators:[v((function(t){return Object.keys(t).every((function(t){return/^[a-z]{2,3}(-[A-Z]{2,3})?$/.test(t)}))}),(function(t){var e=Object.keys(t).filter((function(t){return!/^[a-z]{2,3}(-[A-Z]{2,3})?$/.test(t)}));return"The 'Translation overrides' object should have language codes for keys. Language codes must be in the form of a two-to-three letter language code optionally followed by a hyphen and a two-to-three letter country code. The following keys do not conform: ".concat(e.join(", "),".")}))]}},$t=j({"Display conditions":{privileges:{_description:"The privilege(s) the user must have to use this extension",_type:bt.Array,_default:[]}}},Kt),qt=function(t,e){return v((function(n){return t<=n&&n<=e}),"must be between ".concat(t," and ").concat(e))},Jt=function(t){var e=t.concat(["openmrsBase","openmrsSpaBase"]);return v((function(t){if(!t||"string"!=typeof t)return!1;for(var n=/\${(.*?)}/g,r=n.exec(t);r;){if(!e.includes(r[1]))return!1;r=n.exec(t)}return!0}),"Should be a URL or path. The allowed template parameters are "+e.map((function(t){return"${"+t+"}"})).join(", "))},Yt=Jt([]),Qt=function(t){return v((function(e){return t.includes(e)}),"Must be one of the following: '".concat(t.join("', '"),"'."))},Xt={inRange:qt,isUrl:Yt,isUrlWithTemplateParameters:Jt,oneOf:Qt}}(),i}())}}}))},254:function(t){"use strict";t.exports=r},45:function(t){"use strict";t.exports=o},513:function(t){"use strict";t.exports=f},740:function(t){"use strict";t.exports=p},685:function(t){"use strict";t.exports=d},901:function(t){"use strict";t.exports=v},688:function(t){"use strict";t.exports=y},954:function(t){"use strict";t.exports=m},493:function(t){"use strict";t.exports=g},792:function(t){"use strict";t.exports=b}},e={};function w(n){var r=e[n];if(void 0!==r)return r.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,w),o.exports}w.g=function(){if("object"==("undefined"==typeof globalThis?"undefined":l(globalThis)))return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==("undefined"==typeof window?"undefined":l(window)))return window}}(),w.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var S={};return function(){"use strict";var t=function(t,e){var n=(new DOMParser).parseFromString(e,"image/svg+xml").querySelector("svg");n&&(n.id=t,Pt.appendChild(n))},e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],s=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);s=!0);}catch(t){c=!0,o=t}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,e)||r(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},r=function(t,e){if(t){if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}},o=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},f=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},p=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},d=function(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":void 0===t?"undefined":l(t)},v=function(t,e,n){var r=b(t,e,n);Vt.length?Vt.forEach((function(t){return t(r)})):setTimeout((function(){throw r}))},y=function(t){if("function"!=typeof t)throw Error(g(28,!1));Vt.push(t)},m=function(t){if("function"!=typeof t)throw Error(g(29,!1));var e=!1;return Vt=Vt.filter((function(n){var r=n===t;return e=e||r,!r})),e},g=function(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return"single-spa minified message #".concat(t,": ").concat(e?e+" ":"","See https://single-spa.js.org/error/?code=").concat(t).concat(r.length?"&arg=".concat(r.join("&arg=")):"")},b=function(t,e,n){var r,o,i,a="".concat(j(e)," '").concat(E(e),"' died in status ").concat(e.status,": ");if(o=t,null!=(i=Error)&&"undefined"!=typeof Symbol&&i[Symbol.hasInstance]?i[Symbol.hasInstance](o):u(o,i)){try{t.message=a+t.message}catch(t){}r=t}else{console.warn(g(30,!1,e.status,E(e)));try{r=Error(a+JSON.stringify(t))}catch(e){r=t}}return r.appOrParcelName=E(e),e.status=n,r},S=function(t){return t.status===Jt},O=function(t){try{return t.activeWhen(window.location)}catch(e){return v(e,t,te),!1}},E=function(t){return t.name},x=function(t){return Boolean(t.unmountThisParcel)},j=function(t){return x(t)?"parcel":"application"},P=function(){for(var t=arguments.length-1;t>0;t--)for(var e in arguments[t])"__proto__"!==e&&(arguments[t-1][e]=arguments[t][e]);return arguments[0]},_=function(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return t[n];return null},A=function(t){return t&&("function"==typeof t||(e=t,Array.isArray(e)&&!_(e,(function(t){return"function"!=typeof t}))));var e},k=function(t,e){var n=t[e]||[];0===(n=Array.isArray(n)?n:[n]).length&&(n=[function(){return Promise.resolve()}]);var r=j(t),o=E(t);return function(t){return n.reduce((function(n,i,a){return n.then((function(){var n=i(t);return T(n)?n:Promise.reject(g(15,!1,r,o,e,a))}))}),Promise.resolve())}},T=function(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch},C=function(t,e){var n=function(){return t.status=$t,t};return Promise.resolve().then((function(){return t.status!==Wt?t:(t.status=Kt,t.bootstrap?V(t,"bootstrap").then(n).catch((function(n){if(e)throw b(n,t,te);return v(n,t,te),t})):Promise.resolve().then(n))}))},I=function(t,e){return Promise.resolve().then((function(){var n=function(){return V(t,"unmount").then((function(){t.status=$t}),(function(n){if(e)throw b(n,t,te);v(n,t,te)}))};if(t.status!==Jt)return t;t.status=Qt;var r=Object.keys(t.parcels).map((function(e){return t.parcels[e].unmountThisParcel()}));return Promise.all(r).then(n,(function(r){return n().then((function(){var n=Error(r.message);if(e)throw b(n,t,te);v(n,t,te)}))})).then((function(){return t}))}))},M=function(t,e){return Promise.resolve().then((function(){return t.status!==$t?t:(ne||(window.dispatchEvent(new zt("single-spa:before-first-mount")),ne=!0),t.status=qt,V(t,"mount").then((function(){return t.status=Jt,re||(window.dispatchEvent(new zt("single-spa:first-mount")),re=!0),t})).catch((function(n){var r=function(){if(e)throw b(n,t,te);return v(n,t,te),t};return t.status=Jt,I(t,!0).then(r,r)})))}))},D=function(){return R.apply(ie,arguments)},R=function(t,e){var n=this;if(!t||"object"!=(void 0===t?"undefined":l(t))&&"function"!=typeof t)throw Error(g(2,!1));if(t.name&&"string"!=typeof t.name)throw Error(g(3,!1,d(t.name)));var r=oe++,o=t.name||"parcel-".concat(r);if("object"!=(void 0===e?"undefined":l(e)))throw Error(g(4,!1,o,void 0===e?"undefined":d(e)));if(!e.domElement)throw Error(g(5,!1,o));var i,a="function"==typeof t,u=a?t:function(){return Promise.resolve(t)},s={id:r,parcels:{},status:a?Gt:Wt,customProps:e,parentName:E(n),unmountThisParcel:function(){return v.then((function(){if(s.status!==Jt)throw Error(g(6,!1,o,s.status));return I(s,!0)})).then((function(t){return s.parentName&&delete n.parcels[s.id],t})).then((function(t){return f(t),t})).catch((function(t){throw s.status=te,h(t),t}))}};n.parcels[r]=s;var c=u();if(!c||"function"!=typeof c.then)throw Error(g(7,!1));c=c.then((function(t){if(!t)throw Error(g(8,!1));if(o=t.name||"parcel-".concat(r),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!A(t.bootstrap))throw Error(g(9,!1,o));if(!A(t.mount))throw Error(g(10,!1,o));if(!A(t.unmount))throw Error(g(11,!1,o));if(t.update&&!A(t.update))throw Error(g(12,!1,o));var e=k(t,"bootstrap"),n=k(t,"mount"),a=k(t,"unmount");s.status=Wt,s.name=o,s.bootstrap=e,s.mount=n,s.unmount=a,s.timeouts=H(t.timeouts),t.update&&(s.update=k(t,"update"),i.update=function(t){return s.customProps=t,N((e=s,Promise.resolve().then((function(){if(e.status!==Jt)throw Error(g(32,!1,E(e)));return e.status=Yt,V(e,"update").then((function(){return e.status=Jt,e})).catch((function(t){throw b(t,e,te)}))}))));var e})}));var f,h,p=c.then((function(){return C(s,!0)})),v=p.then((function(){return M(s,!0)})),y=new Promise((function(t,e){f=t,h=e}));return i={mount:function(){return N(Promise.resolve().then((function(){if(s.status!==$t)throw Error(g(13,!1,o,s.status));return n.parcels[r]=s,M(s)})))},unmount:function(){return N(s.unmountThisParcel())},getStatus:function(){return s.status},loadPromise:N(c),bootstrapPromise:N(p),mountPromise:N(v),unmountPromise:N(y)}},N=function(t){return t.then((function(){return null}))},L=function(t){var e=E(t),n="function"==typeof t.customProps?t.customProps(e,window.location):t.customProps;("object"!=(void 0===n?"undefined":l(n))||null===n||Array.isArray(n))&&(n={},console.warn(g(40,!1),e,n));var r=P({},n,{name:e,mountParcel:R.bind(t),singleSpa:Bt});return x(t)&&(r.unmountSelf=t.unmountThisParcel),r},U=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(g(16,!1));ae.bootstrap={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},B=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(g(17,!1));ae.mount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},F=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(g(18,!1));ae.unmount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},z=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(g(19,!1));ae.unload={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},V=function(t,e){var n=t.timeouts[e],r=n.warningMillis,o=j(t);return new Promise((function(i,a){var u=!1,s=!1;t[e](L(t)).then((function(t){u=!0,i(t)})).catch((function(t){u=!0,a(t)})),setTimeout((function(){return l(1)}),r),setTimeout((function(){return l(!0)}),n.millis);var c=g(31,!1,e,o,E(t),n.millis);function l(t){if(!u)if(!0===t)s=!0,n.dieOnTimeout?a(Error(c)):console.error(c);else if(!s){var e=t,o=e*r;console.warn(c),o+r<n.millis&&setTimeout((function(){return l(e+1)}),r)}}}))},H=function(t){var e={};for(var n in ae)e[n]=P({},ae[n],t&&t[n]||{});return e},G=function(t){return Promise.resolve().then((function(){return t.loadPromise?t.loadPromise:t.status!==Ht&&t.status!==Zt?t:(t.status=Gt,t.loadPromise=Promise.resolve().then((function(){var r=t.loadApp(L(t));if(!T(r))throw n=!0,Error(g(33,!1,E(t)));return r.then((function(n){var r;t.loadErrorTime=null,"object"!=l(e=n)&&(r=34),Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!A(e.bootstrap)&&(r=35),A(e.mount)||(r=36),A(e.unmount)||(r=37);var o=j(e);if(r){var i;try{i=JSON.stringify(e)}catch(t){}return console.error(g(r,!1,o,E(t),i),e),v(void 0,t,te),t}return e.devtools&&e.devtools.overlays&&(t.devtools.overlays=P({},t.devtools.overlays,e.devtools.overlays)),t.status=Wt,t.bootstrap=k(e,"bootstrap"),t.mount=k(e,"mount"),t.unmount=k(e,"unmount"),t.unload=k(e,"unload"),t.timeouts=H(e.timeouts),delete t.loadPromise,t}))})).catch((function(e){var r;return delete t.loadPromise,n?r=te:(r=Zt,t.loadErrorTime=(new Date).getTime()),v(e,t,r),t})));var e,n}))},W=function(t){var e;if("string"==typeof t)e=t;else if(this&&this.href)e=this.href;else{if(!(t&&t.currentTarget&&t.currentTarget.href&&t.preventDefault))throw Error(g(14,!1));e=t.currentTarget.href,t.preventDefault()}var n=Y(window.location.href),r=Y(e);0===e.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=e:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,e)},K=function(t){var e=this;if(t){var n=t[0].type;ce.indexOf(n)>=0&&se[n].forEach((function(n){try{n.apply(e,t)}catch(t){setTimeout((function(){throw t}))}}))}},$=function(){be([],arguments)},q=function(t,e){return function(){var n=window.location.href,r=t.apply(this,arguments),o=window.location.href;return Ut&&n===o||window.dispatchEvent(function(t,e){var n;try{n=new PopStateEvent("popstate",{state:t})}catch(e){(n=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,t)}return n.singleSpa=!0,n.singleSpaTrigger=e,n}(window.history.state,e)),r}},J=function(t){if(fe)throw Error(g(43,!1));Ut=!t||!t.hasOwnProperty("urlRerouteOnly")||t.urlRerouteOnly,fe=!0,le=window.history.replaceState,window.addEventListener("hashchange",$),window.addEventListener("popstate",$);var e=window.addEventListener,n=window.removeEventListener;window.addEventListener=function(t,n){if(!("function"==typeof n&&ce.indexOf(t)>=0)||_(se[t],(function(t){return t===n})))return e.apply(this,arguments);se[t].push(n)},window.removeEventListener=function(t,e){if(!("function"==typeof e&&ce.indexOf(t)>=0))return n.apply(this,arguments);se[t]=se[t].filter((function(t){return t!==e}))},window.history.pushState=q(window.history.pushState,"pushState"),window.history.replaceState=q(le,"replaceState")},Y=function(t){var e=document.createElement("a");return e.href=t,e},Q=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!he){var e=t.fn.on,n=t.fn.off;t.fn.on=function(t,n){return X.call(this,e,window.addEventListener,t,n,arguments)},t.fn.off=function(t,e){return X.call(this,n,window.removeEventListener,t,e,arguments)},he=!0}},X=function(t,e,n,r,o){return"string"!=typeof n?t.apply(this,o):(n.split(/\s+/).forEach((function(t){ce.indexOf(t)>=0&&(e(t,r),n=n.replace(t,""))})),""===n.trim()?this:t.apply(this,o))},Z=function(t){return Promise.resolve().then((function(){var e=pe[E(t)];if(!e)return t;if(t.status===Ht)return tt(t,e),t;if(t.status===Xt)return e.promise.then((function(){return t}));if(t.status!==$t&&t.status!==Zt)return t;var n=t.status===Zt?Promise.resolve():V(t,"unload");return t.status=Xt,n.then((function(){return tt(t,e),t})).catch((function(n){return function(t,e,n){delete pe[E(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,v(n,t,te),e.reject(n)}(t,e,n),t}))}))},tt=function(t,e){delete pe[E(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=Ht,e.resolve()},et=function(t,e,n,r){pe[E(t)]={app:t,resolve:n,reject:r},Object.defineProperty(pe[E(t)],"promise",{get:e})},nt=function(t){return pe[t]},rt=function(){return de.filter(S).map(E)},ot=function(){return de.map(E)},it=function(t){var e=_(de,(function(e){return E(e)===t}));return e?e.status:null},at=function(t,e,n,r){var o=function(t,e,n,r){var o,i={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"==(void 0===t?"undefined":l(t))?(function(t){if(Array.isArray(t)||null===t)throw Error(g(39,!1));var e=["name","app","activeWhen","customProps"],n=Object.keys(t).reduce((function(t,n){return e.indexOf(n)>=0?t:t.concat(n)}),[]);if(0!==n.length)throw Error(g(38,!1,e.join(", "),n.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(g(20,!1));if("object"!=l(t.app)&&"function"!=typeof t.app)throw Error(g(20,!1));var r=function(t){return"string"==typeof t||"function"==typeof t};if(!(r(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(r)))throw Error(g(24,!1));if(!ft(t.customProps))throw Error(g(22,!1))}(t),i.name=t.name,i.loadApp=t.app,i.activeWhen=t.activeWhen,i.customProps=t.customProps):(function(t,e,n,r){if("string"!=typeof t||0===t.length)throw Error(g(20,!1));if(!e)throw Error(g(23,!1));if("function"!=typeof n)throw Error(g(24,!1));if(!ft(r))throw Error(g(22,!1))}(t,e,n,r),i.name=t,i.loadApp=e,i.activeWhen=n,i.customProps=r),i.loadApp="function"!=typeof(o=i.loadApp)?function(){return Promise.resolve(o)}:o,i.customProps=function(t){return t||{}}(i.customProps),i.activeWhen=function(t){var e=Array.isArray(t)?t:[t];return e=e.map((function(t){return"function"==typeof t?t:ht(t)})),function(t){return e.some((function(e){return e(t)}))}}(i.activeWhen),i}(t,e,n,r);if(yt()||ve||(ve=!0,setTimeout((function(){yt()||console.warn(g(1,!1))}),5e3)),-1!==ot().indexOf(o.name))throw Error(g(21,!1,o.name));de.push(P({loadErrorTime:null,status:Ht,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},o)),ue&&(Q(),be())},ut=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return de.filter((function(e){return e.activeWhen(t)})).map(E)},st=function(t){if(0===de.filter((function(e){return E(e)===t})).length)throw Error(g(25,!1,t));return(ue?ct(t,{waitForUnmount:!1}):Promise.resolve()).then((function(){var e=de.map(E).indexOf(t);de.splice(e,1)}))},ct=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof t)throw Error(g(26,!1));var n=_(de,(function(e){return E(e)===t}));if(!n)throw Error(g(27,!1,t));var r,o=nt(E(n));if(e&&e.waitForUnmount){if(o)return o.promise;var i=new Promise((function(t,e){et(n,(function(){return i}),t,e)}));return i}return o?(r=o.promise,lt(n,o.resolve,o.reject)):r=new Promise((function(t,e){et(n,(function(){return r}),t,e),lt(n,t,e)})),r},lt=function(t,e,n){Promise.resolve().then((function(){if(_(ut(),(function(e){return e===E(t)})))return pt()})).then((function(){return I(t).then(Z).then((function(){e(),setTimeout((function(){be()}))}))})).catch(n)},ft=function(t){return!t||"function"==typeof t||"object"==(void 0===t?"undefined":l(t))&&null!==t&&!Array.isArray(t)},ht=function(t,e){var n=function(t,e){var n=function(n){var a=t.slice(r,n).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(i+=o?"[^/]+/?":a,n===t.length)if(o)e&&(i+="$");else{var u=e?"":".*";i="/"===i.charAt(i.length-1)?"".concat(i).concat(u,"$"):"".concat(i,"(/").concat(u,")?(#.*)?$")}o=!o,r=n},r=0,o=!1,i="^";"/"!==t[0]&&(t="/"+t);for(var a=0;a<t.length;a++){var u=t[a];(!o&&":"===u||o&&"/"===u)&&n(a)}return n(t.length),new RegExp(i,"i")}(t,e);return function(t){var e=t.origin;e||(e="".concat(t.protocol,"//").concat(t.host));var r=t.href.replace(e,"").replace(t.search,"").split("?")[0];return n.test(r)}},pt=function(){return be()},dt=function(t,e){return O(t)?C(t).then((function(t){return e.then((function(){return O(t)?M(t):t}))})):e.then((function(){return t}))},vt=function(t){we=!0,ue&&(J(t),be())},yt=function(){return we},mt=function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n},gt=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?mt(Object(n),!0).forEach((function(e){bt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):mt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t},bt=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},wt=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},St=function(){return nn.apply(this,arguments)},Ot=w(714),Et='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 380 119"><path fill="var(--logo-red)" fill-rule="evenodd" d="M40.29 40.328a27.76 27.76 0 0 1 19.688-8.154c7.669 0 14.613 3.102 19.646 8.116l.021-18.54A42.84 42.84 0 0 0 59.978 17c-7.089 0-13.813 1.93-19.709 4.968z" clip-rule="evenodd"/><path fill="var(--logo-orange)" fill-rule="evenodd" d="M79.645 79.671a27.74 27.74 0 0 1-19.684 8.154c-7.67 0-14.614-3.101-19.651-8.116l-.02 18.54A42.86 42.86 0 0 0 59.96 103a42.8 42.8 0 0 0 19.672-4.751z" clip-rule="evenodd"/><path fill="var(--logo-purple)" fill-rule="evenodd" d="M40.328 79.696c-5.038-5.037-8.154-11.995-8.154-19.685 0-7.669 3.102-14.612 8.116-19.65l-18.54-.02A42.85 42.85 0 0 0 17 60.012a42.8 42.8 0 0 0 4.752 19.672z" clip-rule="evenodd"/><path fill="var(--logo-green)" fill-rule="evenodd" d="M79.634 40.289a27.75 27.75 0 0 1 8.154 19.688 27.74 27.74 0 0 1-8.117 19.646l18.542.02a42.84 42.84 0 0 0 4.749-19.666c0-7.09-1.714-13.779-4.751-19.675z" clip-rule="evenodd"/><path fill="var(--logo-black)" fill-rule="evenodd" d="M156.184 60.003c0-8.749-6.118-15.777-15.025-15.777-8.909 0-15.025 7.028-15.025 15.776s6.116 15.78 15.025 15.78c8.907 0 15.025-7.031 15.025-15.78m-34.881 0c0-11.483 8.318-19.96 19.856-19.96 11.536 0 19.855 8.478 19.855 19.96 0 11.484-8.319 19.964-19.855 19.964-11.538 0-19.856-8.48-19.856-19.964M179.514 75.54c5.507 0 9.05-4.14 9.05-9.482s-3.543-9.483-9.05-9.483c-5.505 0-9.046 4.142-9.046 9.483s3.541 9.482 9.046 9.482M166.22 53.306h4.248v3.704h.11c2.344-2.725 5.449-4.36 9.154-4.36 8.014 0 13.408 5.67 13.408 13.408 0 7.63-5.613 13.406-12.752 13.406-4.58 0-8.231-2.29-9.81-5.178h-.11V90.87h-4.248zM217.773 63.768c-.163-4.305-3-7.193-7.686-7.193-4.685 0-7.79 2.888-8.335 7.193zm3.653 10.412c-3.001 3.868-6.596 5.284-11.339 5.284-8.01 0-12.914-5.993-12.914-13.406 0-7.901 5.559-13.407 13.08-13.407 7.196 0 12.096 4.906 12.096 13.354v1.362h-20.597c.325 4.413 3.704 8.173 8.335 8.173 3.65 0 6.105-1.307 8.12-3.868zM227.854 59.357c0-2.347-.216-4.361-.216-6.05h4.031c0 1.362.11 2.776.11 4.194h.11c1.144-2.505 4.306-4.85 8.5-4.85 6.705 0 9.699 4.252 9.699 10.41v15.748h-4.248v-15.31c0-4.253-1.856-6.924-5.833-6.924-5.503 0-7.903 3.979-7.903 9.811V78.81h-4.25zM259.211 41.009h6.708L278.8 70.79h.107l12.982-29.782h6.549v37.99h-4.506V47.124h-.106L280.192 79h-2.738l-13.629-31.875h-.107V79h-4.507zM312.392 57.752h4.023c4.992 0 11.487 0 11.487-6.282 0-5.47-4.776-6.276-9.177-6.276h-6.333zm-4.506-16.744h9.711c7.352 0 15.132 1.072 15.132 10.462 0 5.527-3.594 9.125-9.495 10.037l10.784 17.492h-5.525l-10.304-17.063h-5.797V79h-4.506zM358.123 47.713c-1.506-2.414-4.187-3.487-6.926-3.487-3.973 0-8.1 1.88-8.1 6.385 0 3.49 1.931 5.047 7.994 6.98 5.903 1.878 11.377 3.809 11.377 11.267 0 7.567-6.495 11.11-13.36 11.11-4.402 0-9.125-1.45-11.7-5.262l3.862-3.165c1.61 2.794 4.83 4.24 8.105 4.24 3.862 0 8.263-2.253 8.263-6.601 0-4.669-3.165-5.474-9.928-7.728-5.366-1.771-9.442-4.134-9.442-10.463 0-7.298 6.277-10.945 12.929-10.945 4.241 0 7.836 1.178 10.625 4.45zM185.885 90.998h1.424l2.734 6.326h.023l2.758-6.326h1.391v8.07h-.957v-6.77h-.024l-2.894 6.77h-.582l-2.894-6.77h-.022v6.77h-.957zM198.386 90.998h5.071v.889h-4.114v2.53h3.841v.89h-3.841v2.871h4.32v.89h-5.277zM207.891 98.178h1.822c1.848 0 3.25-.935 3.25-3.146s-1.402-3.145-3.25-3.145h-1.822zm-.957-7.18h3.1c1.583 0 3.953 1.06 3.953 4.034 0 2.976-2.37 4.036-3.953 4.036h-3.1zM217.007 99.068h.958v-8.07h-.958zM227.105 92.663c-.478-.651-1.242-.981-2.017-.981-1.8 0-3.077 1.584-3.077 3.35 0 1.87 1.266 3.352 3.077 3.352.98 0 1.767-.4 2.337-1.129l.718.603c-.718.97-1.766 1.414-3.055 1.414-2.314 0-4.102-1.79-4.102-4.24 0-2.37 1.709-4.239 4.102-4.239 1.095 0 2.166.377 2.849 1.266zM233.557 92.23h-.024l-1.675 3.965h3.294zm-.434-1.232h.9l3.43 8.07h-1.117l-.82-1.984h-4.034l-.832 1.984h-1.082zM240.006 90.998h.958v7.18h3.692v.89h-4.65zM252.793 94.554h.855c1.06 0 2.439 0 2.439-1.334 0-1.161-1.014-1.333-1.948-1.333h-1.346zm-.957-3.556h2.063c1.561 0 3.214.228 3.214 2.222 0 1.174-.764 1.938-2.018 2.132l2.291 3.716h-1.173l-2.19-3.625h-1.23v3.625h-.957zM260.51 90.998h5.07v.889h-4.112v2.53h3.84v.89h-3.84v2.871h4.318v.89h-5.276zM274.402 92.663c-.479-.651-1.242-.981-2.018-.981-1.8 0-3.077 1.584-3.077 3.35 0 1.87 1.266 3.352 3.077 3.352.98 0 1.767-.4 2.336-1.129l.718.603c-.718.97-1.766 1.414-3.054 1.414-2.313 0-4.102-1.79-4.102-4.24 0-2.37 1.709-4.239 4.102-4.239 1.094 0 2.166.377 2.85 1.266zM284.739 95.032c0-1.857-1.3-3.35-3.191-3.35-1.892 0-3.191 1.493-3.191 3.35 0 1.858 1.299 3.352 3.191 3.352s3.191-1.494 3.191-3.352m-7.409 0c0-2.439 1.767-4.239 4.218-4.239s4.217 1.8 4.217 4.239-1.767 4.24-4.217 4.24c-2.451 0-4.218-1.8-4.218-4.24M289.514 94.554h.855c1.059 0 2.438 0 2.438-1.334 0-1.161-1.014-1.333-1.948-1.333h-1.345zm-.958-3.556h2.062c1.563 0 3.215.228 3.215 2.222 0 1.174-.763 1.938-2.016 2.132l2.289 3.716h-1.173l-2.189-3.625h-1.23v3.625h-.958zM297.81 98.178h1.825c1.845 0 3.246-.935 3.246-3.146s-1.401-3.145-3.246-3.145h-1.825zm-.957-7.18h3.1c1.585 0 3.956 1.06 3.956 4.034 0 2.976-2.371 4.036-3.956 4.036h-3.1zM315.407 92.422c-.318-.513-.89-.74-1.47-.74-.844 0-1.721.4-1.721 1.356 0 .74.41 1.072 1.698 1.482 1.254.399 2.417.81 2.417 2.393 0 1.607-1.38 2.36-2.838 2.36-.935 0-1.938-.309-2.486-1.118l.821-.672c.342.593 1.026.9 1.721.9.821 0 1.754-.478 1.754-1.402 0-.991-.67-1.163-2.107-1.64-1.139-.377-2.006-.878-2.006-2.222 0-1.551 1.333-2.326 2.747-2.326.9 0 1.664.25 2.256.946zM320.844 95.591l-3.009-4.593h1.219l2.269 3.647 2.335-3.647h1.152l-3.01 4.593v3.477h-.956zM330.565 92.422c-.32-.513-.89-.74-1.471-.74-.843 0-1.72.4-1.72 1.356 0 .74.41 1.072 1.698 1.482 1.254.399 2.415.81 2.415 2.393 0 1.607-1.378 2.36-2.837 2.36-.934 0-1.937-.309-2.485-1.118l.821-.672c.342.593 1.026.9 1.721.9.821 0 1.754-.478 1.754-1.402 0-.991-.671-1.163-2.107-1.64-1.139-.377-2.006-.878-2.006-2.222 0-1.551 1.333-2.326 2.746-2.326.901 0 1.665.25 2.257.946zM339.283 91.887h-2.666v7.18h-.958v-7.18h-2.667v-.889h6.291zM341.665 90.998h5.071v.889h-4.113v2.53h3.84v.89h-3.84v2.871h4.319v.89h-5.277zM349.905 90.998h1.424l2.735 6.326h.023l2.758-6.326h1.391v8.07h-.958v-6.77h-.023l-2.894 6.77h-.582l-2.895-6.77h-.021v6.77h-.958z" clip-rule="evenodd"/></svg>',xt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 380 119"><path fill="var(--logo-red)" fill-rule="evenodd" d="M40.29 40.328a27.76 27.76 0 0 1 19.688-8.154c7.669 0 14.613 3.102 19.647 8.116l.02-18.54A42.84 42.84 0 0 0 59.978 17c-7.089 0-13.813 1.93-19.709 4.968z" clip-rule="evenodd"/><path fill="var(--logo-orange)" fill-rule="evenodd" d="M79.645 79.671a27.74 27.74 0 0 1-19.684 8.154c-7.67 0-14.614-3.101-19.651-8.116l-.02 18.54A42.86 42.86 0 0 0 59.96 103a42.8 42.8 0 0 0 19.672-4.751z" clip-rule="evenodd"/><path fill="var(--logo-purple)" fill-rule="evenodd" d="M40.328 79.696c-5.038-5.037-8.154-11.995-8.154-19.685 0-7.669 3.102-14.612 8.116-19.65l-18.54-.02A42.85 42.85 0 0 0 17 60.012a42.8 42.8 0 0 0 4.752 19.672z" clip-rule="evenodd"/><path fill="var(--logo-green)" fill-rule="evenodd" d="M79.634 40.289a27.75 27.75 0 0 1 8.154 19.688 27.74 27.74 0 0 1-8.117 19.646l18.542.02a42.84 42.84 0 0 0 4.749-19.666c0-7.09-1.714-13.779-4.751-19.675z" clip-rule="evenodd"/><path fill="var(--logo-black)" fill-rule="evenodd" d="M156.184 60.003c0-8.749-6.118-15.777-15.025-15.777-8.909 0-15.025 7.028-15.025 15.776s6.116 15.78 15.025 15.78c8.907 0 15.025-7.031 15.025-15.78m-34.881 0c0-11.483 8.318-19.96 19.856-19.96 11.536 0 19.855 8.478 19.855 19.96 0 11.484-8.319 19.964-19.855 19.964-11.538 0-19.856-8.48-19.856-19.964M179.514 75.54c5.507 0 9.05-4.14 9.05-9.482s-3.543-9.483-9.05-9.483c-5.505 0-9.046 4.142-9.046 9.483s3.541 9.482 9.046 9.482M166.22 53.306h4.248v3.704h.11c2.344-2.725 5.449-4.36 9.154-4.36 8.014 0 13.408 5.67 13.408 13.408 0 7.63-5.613 13.406-12.752 13.406-4.58 0-8.231-2.29-9.81-5.178h-.11V90.87h-4.248zM217.773 63.768c-.163-4.305-3-7.193-7.686-7.193-4.685 0-7.79 2.888-8.335 7.193zm3.653 10.412c-3.001 3.868-6.596 5.284-11.339 5.284-8.01 0-12.914-5.993-12.914-13.406 0-7.901 5.559-13.407 13.08-13.407 7.196 0 12.096 4.906 12.096 13.354v1.362h-20.597c.325 4.413 3.704 8.173 8.335 8.173 3.65 0 6.105-1.307 8.12-3.868zM227.854 59.357c0-2.347-.216-4.361-.216-6.05h4.031c0 1.362.11 2.776.11 4.194h.11c1.144-2.505 4.306-4.85 8.5-4.85 6.705 0 9.699 4.252 9.699 10.41v15.748h-4.248v-15.31c0-4.253-1.856-6.924-5.833-6.924-5.503 0-7.903 3.979-7.903 9.811V78.81h-4.25zM259.211 41.009h6.708L278.8 70.79h.107l12.982-29.782h6.549v37.99h-4.506V47.124h-.106L280.192 79h-2.738l-13.629-31.875h-.107V79h-4.507zM312.392 57.752h4.023c4.992 0 11.487 0 11.487-6.282 0-5.47-4.776-6.276-9.177-6.276h-6.333zm-4.506-16.744h9.711c7.352 0 15.132 1.072 15.132 10.462 0 5.527-3.594 9.125-9.495 10.037L334.018 79h-5.525l-10.304-17.063h-5.797V79h-4.506zM358.123 47.713c-1.506-2.414-4.187-3.487-6.926-3.487-3.973 0-8.1 1.88-8.1 6.385 0 3.49 1.931 5.047 7.994 6.98 5.903 1.878 11.377 3.809 11.377 11.267 0 7.567-6.495 11.11-13.36 11.11-4.402 0-9.125-1.45-11.7-5.262l3.862-3.165c1.61 2.794 4.83 4.24 8.105 4.24 3.862 0 8.263-2.253 8.263-6.601 0-4.669-3.165-5.474-9.928-7.728-5.366-1.771-9.442-4.134-9.442-10.463 0-7.298 6.277-10.945 12.929-10.945 4.241 0 7.836 1.178 10.625 4.45z" clip-rule="evenodd"/></svg>',jt='<svg xmlns="http://www.w3.org/2000/svg" width="121" height="118"><path fill="var(--logo-red)" fill-rule="evenodd" d="M40.436 39.474a27.93 27.93 0 0 1 19.811-8.205c7.717 0 14.705 3.122 19.77 8.167l.021-18.656A43.1 43.1 0 0 0 60.247 16c-7.133 0-13.899 1.943-19.832 4.999z" clip-rule="evenodd"/><path fill="var(--logo-orange)" fill-rule="evenodd" d="M80.038 79.064a27.92 27.92 0 0 1-19.808 8.205c-7.717 0-14.705-3.121-19.774-8.167l-.02 18.657a43.1 43.1 0 0 0 19.794 4.78 43.1 43.1 0 0 0 19.794-4.781z" clip-rule="evenodd"/><path fill="var(--logo-purple)" fill-rule="evenodd" d="M40.474 79.089c-5.069-5.069-8.205-12.07-8.205-19.808 0-7.717 3.121-14.704 8.167-19.773l-18.657-.02A43.1 43.1 0 0 0 17 59.281a43.1 43.1 0 0 0 4.782 19.795z" clip-rule="evenodd"/><path fill="var(--logo-green)" fill-rule="evenodd" d="M80.027 39.435a27.93 27.93 0 0 1 8.205 19.811 27.92 27.92 0 0 1-8.168 19.769l18.658.021a43.1 43.1 0 0 0 4.779-19.79 43.1 43.1 0 0 0-4.781-19.798z" clip-rule="evenodd"/></svg>',Pt=document.createElement("div"),_t=function(){document.body.appendChild(Pt)};Pt.id="omrs-svgs-container",Pt.style.display="none","complete"===document.readyState?_t():window.addEventListener("load",_t);var At='<svg xmlns="http://www.w3.org/2000/svg"><path d="M9 2H7v2h2zM4 2H2v2h2zM14 2h-2v2h2zM9 7H7v2h2zM4 7H2v2h2zM14 7h-2v2h2zM9 12H7v2h2zM4 12H2v2h2zM14 12h-2v2h2z"/></svg>',kt={"Brand color #1":{_default:"#005d5d",_type:Ot.Type.String},"Brand color #2":{_default:"#004144",_type:Ot.Type.String},"Brand color #3":{_default:"#007d79",_type:Ot.Type.String},patientPhotoConceptUuid:{_type:Ot.Type.ConceptUuid,_default:"736e8771-e501-4615-bfa7-570c03f4bef5",_description:"Used to look up the patient photo, which is stored as an attachment obs. Set to `null` in order to disable the feature and use only generated avatars. To remove the avatars entirely, use extension configuration's `remove` feature."},preferredCalendar:{_type:Ot.Type.Object,_description:"Keys should be locale codes, and values should be the preferred calendar for that locale. For example, {'am': 'ethiopic'}.",_default:{am:"ethiopic"},_elements:{_validators:[Ot.validators.oneOf(["buddhist","chinese","coptic","dangi","ethioaa","ethiopic","gregory","hebrew","indian","islamic","islamic-umalqura","islamic-tbla","islamic-civil","islamic-rgsa","iso8601","japanese","persian","roc","islamicc"])]}}};Number.MAX_SAFE_INTEGER;var Tt=w(954),Ct=w(792),It={};try{process.env.CARBON_ENABLE_CSS_CUSTOM_PROPERTIES&&"true"===process.env.CARBON_ENABLE_CSS_CUSTOM_PROPERTIES?It.enableCssCustomProperties=!0:It.enableCssCustomProperties=!1,process.env.CARBON_ENABLE_USE_CONTROLLED_STATE_WITH_VALUE&&"true"===process.env.CARBON_ENABLE_USE_CONTROLLED_STATE_WITH_VALUE?It.enableUseControlledStateWithValue=!0:It.enableUseControlledStateWithValue=!1,process.env.CARBON_ENABLE_CSS_GRID&&"true"===process.env.CARBON_ENABLE_CSS_GRID?It.enableCssGrid=!0:It.enableCssGrid=!1,process.env.CARBON_ENABLE_V11_RELEASE?"true"===process.env.CARBON_ENABLE_V11_RELEASE?It.enableV11Release=!0:It.enableV11Release=!1:It.enableV11Release=!0,process.env.CARBON_ENABLE_EXPERIMENTAL_TILE_CONTRAST&&"true"===process.env.CARBON_ENABLE_EXPERIMENTAL_TILE_CONTRAST?It.enableExperimentalTileContrast=!0:It.enableExperimentalTileContrast=!1,process.env.CARBON_ENABLE_V12_TILE_DEFAULT_ICONS&&"true"===process.env.CARBON_ENABLE_V12_TILE_DEFAULT_ICONS?It.enableV12TileDefaultIcons=!0:It.enableV12TileDefaultIcons=!1,process.env.CARBON_ENABLE_V12_OVERFLOWMENU&&"true"===process.env.CARBON_ENABLE_V12_OVERFLOWMENU?It.enableV12Overflowmenu=!0:It.enableV12Overflowmenu=!1}catch(t){It.enableCssCustomProperties=!1,It.enableUseControlledStateWithValue=!1,It.enableCssGrid=!1,It.enableV11Release=!0,It.enableExperimentalTileContrast=!1,It.enableV12TileDefaultIcons=!1,It.enableV12Overflowmenu=!1}for(var Mt=[{name:"enable-css-custom-properties",description:"Describe what the flag does",enabled:It.enableCssCustomProperties},{name:"enable-use-controlled-state-with-value",description:"Enable components to be created in either a controlled or uncontrolled mode\n",enabled:It.enableUseControlledStateWithValue},{name:"enable-css-grid",description:"Enable CSS Grid Layout in the Grid and Column React components\n",enabled:It.enableCssGrid},{name:"enable-v11-release",description:"Enable the features and functionality for the v11 Release\n",enabled:It.enableV11Release},{name:"enable-experimental-tile-contrast",description:"Enable the experimental tile improved contrast styles\n",enabled:It.enableExperimentalTileContrast},{name:"enable-v12-tile-default-icons",description:"Enable rendering of default icons in the tile components\n",enabled:It.enableV12TileDefaultIcons},{name:"enable-v12-overflowmenu",description:"Enable the use of the v12 OverflowMenu leveraging the Menu subcomponents\n",enabled:It.enableV12Overflowmenu}],Dt=function(){function t(e){var n=this;(function(t,e){if(n=t,!(null!=(r=e)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):u(n,r)))throw new TypeError("Cannot call a class as a function");var n,r})(this,t),this.flags=new Map,e&&Object.keys(e).forEach((function(t){n.flags.set(t,e[t])}))}var n,o;return n=t,o=[{key:"checkForFlag",value:function(t){if(!this.flags.has(t))throw new Error("Unable to find a feature flag with the name: `".concat(t,"`"))}},{key:"add",value:function(t,e){if(this.flags.has(t))throw new Error("The feature flag: ".concat(t," already exists"));this.flags.set(t,e)}},{key:"enable",value:function(t){this.checkForFlag(t),this.flags.set(t,!0)}},{key:"disable",value:function(t){this.checkForFlag(t),this.flags.set(t,!1)}},{key:"merge",value:function(t){var e=this;Object.keys(t).forEach((function(n){e.flags.set(n,t[n])}))}},{key:"mergeWithScope",value:function(t){var n,o=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=r(t))){n&&(t=n);var o=0,i=function(){};return{s:i,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return u=t.done,t},e:function(t){s=!0,a=t},f:function(){try{u||null==n.return||n.return()}finally{if(s)throw a}}}}(t.flags);try{for(o.s();!(n=o.n()).done;){var i=e(n.value,2),a=i[0],u=i[1];this.flags.has(a)||this.flags.set(a,u)}}catch(t){o.e(t)}finally{o.f()}}},{key:"enabled",value:function(t){return this.checkForFlag(t),this.flags.get(t)}}],o&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,"symbol"==(void 0===(i=function(t,e){if("object"!=(void 0===t?"undefined":l(t))||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,"string");if("object"!=(void 0===r?"undefined":l(r)))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key))?"undefined":(o=i)&&"undefined"!=typeof Symbol&&o.constructor===Symbol?"symbol":void 0===o?"undefined":l(o))?i:String(i),r)}var o,i}(n.prototype,o),Object.defineProperty(n,"prototype",{writable:!1}),t}(),Rt=new Dt(void 0),Nt=0;Nt<Mt.length;Nt++){var Lt=Mt[Nt];Rt.add(Lt.name,Lt.enabled)}!function(){Rt.merge.apply(Rt,arguments)}({"enable-css-custom-properties":!0,"enable-css-grid":!0,"enable-v11-release":!0,"enable-experimental-tile-contrast":!1}),w(279),new Ct.Subject,new Ct.Subject,new Ct.Subject,w(976),new Ct.Subject;var Ut,Bt=Object.freeze({__proto__:null,get start(){return vt},get ensureJQuerySupport(){return Q},get setBootstrapMaxTime(){return U},get setMountMaxTime(){return B},get setUnmountMaxTime(){return F},get setUnloadMaxTime(){return z},get registerApplication(){return at},get unregisterApplication(){return st},get getMountedApps(){return rt},get getAppStatus(){return it},get unloadApplication(){return ct},get checkActivityFunctions(){return ut},get getAppNames(){return ot},get pathToActiveWhen(){return ht},get navigateToUrl(){return W},get patchHistoryApi(){return J},get triggerAppChange(){return pt},get addErrorHandler(){return y},get removeErrorHandler(){return m},get mountRootParcel(){return D},get NOT_LOADED(){return Ht},get LOADING_SOURCE_CODE(){return Gt},get NOT_BOOTSTRAPPED(){return Wt},get BOOTSTRAPPING(){return Kt},get NOT_MOUNTED(){return $t},get MOUNTING(){return qt},get UPDATING(){return Yt},get LOAD_ERROR(){return Zt},get MOUNTED(){return Jt},get UNLOADING(){return Xt},get UNMOUNTING(){return Qt},get SKIP_BECAUSE_BROKEN(){return te}}),Ft=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).CustomEvent,zt=function(){try{var t=new Ft("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?Ft:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(t,e){var n=document.createEvent("CustomEvent");return e?n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail):n.initCustomEvent(t,!1,!1,void 0),n}:function(t,e){var n=document.createEventObject();return n.type=t,e?(n.bubbles=Boolean(e.bubbles),n.cancelable=Boolean(e.cancelable),n.detail=e.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n},Vt=[],Ht="NOT_LOADED",Gt="LOADING_SOURCE_CODE",Wt="NOT_BOOTSTRAPPED",Kt="BOOTSTRAPPING",$t="NOT_MOUNTED",qt="MOUNTING",Jt="MOUNTED",Yt="UPDATING",Qt="UNMOUNTING",Xt="UNLOADING",Zt="LOAD_ERROR",te="SKIP_BECAUSE_BROKEN",ee=[],ne=!1,re=!1,oe=0,ie={parcels:{}},ae={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}},ue="undefined"!=typeof window,se={hashchange:[],popstate:[]},ce=["hashchange","popstate"],le=null,fe=!1;ue&&(window.singleSpaNavigate?console.warn(g(41,!1)):window.singleSpaNavigate=W);var he=!1,pe={},de=[],ve=!1,ye=!1,me=[],ge=ue&&window.location.href;function be(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e="function"==typeof(null==t?void 0:t.then)?t:Promise.resolve(t);v.push(e.catch((function(t){return console.warn(Error(g(42,!1))),console.warn(t),!1})))},o=function(){var e=rt();t.forEach((function(t){return t.resolve(e)}));try{u(0===s.length?"no-app-change":"app-change",a()),u("routing-event",a())}catch(t){setTimeout((function(){throw t}))}if(ye=!1,me.length>0){var n=me;me=[],be(n)}return e},i=function(){n||(t.forEach((function(t){K(t.eventArguments)})),K(e))},a=function(){var t,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1?arguments[1]:void 0,o={},i=(p(t={},Jt,[]),p(t,$t,[]),p(t,Ht,[]),p(t,te,[]),t);n?(h.concat(d).forEach((function(t,e){u(t,Jt)})),l.forEach((function(t){u(t,Ht)})),f.forEach((function(t){u(t,$t)}))):s.forEach((function(t){u(t)}));var a={detail:{newAppStatuses:o,appsByNewStatus:i,totalAppChanges:s.length,originalEvent:null==e?void 0:e[0],oldUrl:y,newUrl:m}};return r&&P(a.detail,r),a;function u(t,e){var n=E(t);e=e||it(n),o[n]=e,(i[e]=i[e]||[]).push(n)}},u=function(t,e){n||window.dispatchEvent(new zt("single-spa:".concat(t),e))};if(ye)return new Promise((function(t,n){me.push({resolve:t,reject:n,eventArguments:e})}));var s,c=function(){var t=[],e=[],n=[],r=[],o=(new Date).getTime();return de.forEach((function(i){var a=i.status!==te&&O(i);switch(i.status){case Zt:a&&o-i.loadErrorTime>=200&&n.push(i);break;case Ht:case Gt:a&&n.push(i);break;case Wt:case $t:!a&&nt(E(i))?t.push(i):a&&r.push(i);break;case Jt:a||e.push(i)}})),{appsToUnload:t,appsToUnmount:e,appsToLoad:n,appsToMount:r}}(),l=c.appsToUnload,f=c.appsToUnmount,h=c.appsToLoad,d=c.appsToMount,v=[],y=ge,m=ge=window.location.href;return yt()?(ye=!0,s=l.concat(h,f,d),Promise.resolve().then((function(){return u(0===s.length?"before-no-app-change":"before-app-change",a(!0)),u("before-routing-event",a(!0,{cancelNavigation:r})),Promise.all(v).then((function(n){if(n.some((function(t){return t})))return le.call(window.history,history.state,"",y.substring(location.origin.length)),ge=location.href,ye=!1,be(t,e,!0);var r=l.map(Z),s=f.map(I).map((function(t){return t.then(Z)})).concat(r),c=Promise.all(s);c.then((function(){u("before-mount-routing-event",a(!0))}),(function(t){throw t}));var p=h.map((function(t){return G(t).then((function(t){return dt(t,c)}))})),v=d.filter((function(t){return h.indexOf(t)<0})).map((function(t){return dt(t,c)}));return c.catch((function(t){throw i(),t})).then((function(){return i(),Promise.all(p.concat(v)).catch((function(e){throw t.forEach((function(t){return t.reject(e)})),e})).then(o).then((function(){}),(function(t){throw t}))}))}))}))):(s=h,Promise.resolve().then((function(){var t=h.map(G);return Promise.all(t).then(i).then((function(){return[]})).catch((function(t){throw i(),t})).finally((function(){}))})))}var we=!1,Se={getRawAppData:function(){return function(t){if(Array.isArray(t))return f(t)}(t=de)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return f(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(t,e):void 0}}(t)||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.")}();var t},reroute:be,NOT_LOADED:Ht,toLoadPromise:G,toBootstrapPromise:C,unregisterApplication:st,getProfilerData:function(){return ee}};ue&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Se);var Oe=w(685);w(45),(0,Oe.createGlobalStore)("modalRegistry",{modals:{}}),w(254),(0,Oe.createGlobalStore)("modalState",{modalContainer:null,modalStack:[]}),window.getComputedStyle(document.body).overflow,w(740),w(513),w(901),(0,Oe.createGlobalStore)("workspaceRegistrations",{workspaces:{}}),new Set,(0,Oe.createGlobalStore)("workspace",{context:"",openWorkspaces:[],prompt:null,workspaceWindowState:"normal"});var Ee=null;try{Ee=n(1343).createContext()}catch(Ft){}function xe(t){return(xe=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function je(t,e){return(je=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var Pe=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&je(t,e)}(r,Tt.Component);var e,n=function(t){var e=function(){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(t){return!1}}();return function(){var n,r=xe(t);if(e){var o=xe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(t,e){if(e&&("object"==(void 0===e?"undefined":l(e))||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return wt(t)}(this,n)}}(r);function r(t){var e;if(function(t,e){if(n=t,!(null!=(r=e)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):u(n,r)))throw new TypeError("Cannot call a class as a function");var n,r}(this,r),bt(wt(e=n.call(this,t)),"handleRef",(function(t){e.el=t})),bt(wt(e),"addThingToDo",(function(t,n){e.state.hasError&&"unmount"!==t||(e.nextThingToDo=(e.nextThingToDo||Promise.resolve()).then((function(){if(!e.unmounted||"unmount"===t)return n.apply(void 0,arguments)})).catch((function(n){throw e.nextThingToDo=Promise.resolve(),e.setState({hasError:!0}),n&&n.message&&(n.message="During '".concat(t,"', parcel threw an error: ").concat(n.message)),e.props.handleError?e.props.handleError(n):setTimeout((function(){throw n})),n})))})),bt(wt(e),"getParcelProps",(function(){var t=gt(gt({},e.props),{},{domElement:e.el});return delete t.mountParcel,delete t.config,delete t.wrapWith,delete t.wrapStyle,delete t.appendTo,delete t.handleError,delete t.parcelDidMount,t})),e.state={hasError:!1},!t.config)throw new Error("single-spa-react's Parcel component requires the 'config' prop to either be a parcel config or a loading function that returns a promise. See https://github.com/single-spa/single-spa-react");return e}return(e=[{key:"componentDidMount",value:function(){var t=this;this.addThingToDo("mount",(function(){var e,n=t.props.mountParcel||t.mountParcel;if(!n)throw new Error("\n\t\t\t\t <Parcel /> was not passed a mountParcel prop, nor is it rendered where mountParcel is within the React context.\n\t\t\t\t If you are using <Parcel /> within a module that is not a single-spa application, you will need to import mountRootParcel from single-spa and pass it into <Parcel /> as a mountParcel prop\t\n\t\t\t\t");return t.el?e=t.el:(t.createdDomElement=e=document.createElement(t.props.wrapWith),Object.keys(t.props.wrapStyle).forEach((function(n){e.style[n]=t.props.wrapStyle[n]})),t.props.appendTo.appendChild(e)),t.parcel=n(t.props.config,gt({domElement:e},t.getParcelProps())),t.parcel.mountPromise.then(t.props.parcelDidMount),t.parcel.mountPromise}))}},{key:"componentDidUpdate",value:function(){var t=this;this.addThingToDo("update",(function(){if(t.parcel&&t.parcel.update)return t.parcel.update(t.getParcelProps())}))}},{key:"componentWillUnmount",value:function(){var t=this;this.addThingToDo("unmount",(function(){if(t.parcel&&"MOUNTED"===t.parcel.getStatus())return t.parcel.unmount()})),this.createdDomElement&&this.createdDomElement.parentNode.removeChild(this.createdDomElement),this.unmounted=!0}},{key:"render",value:function(){var t=this;if(this.props.appendTo)return Ee&&Ee.Consumer?Tt.createElement(Ee.Consumer,null,(function(e){return t.mountParcel=e?e.mountParcel:null,null})):null;var e=Ee&&Ee.Consumer?Tt.createElement(Ee.Consumer,null,(function(e){return t.mountParcel=e?e.mountParcel:null,null})):void 0;return Tt.createElement(this.props.wrapWith,{ref:this.handleRef,style:this.props.wrapStyle,className:this.props.wrapClassName},e)}}])&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(r.prototype,e),r}();bt(Pe,"defaultProps",{wrapWith:"div",wrapStyle:{},parcelDidMount:function(){}}),(0,Oe.createGlobalStore)("left-nav",{slotName:null,basePath:window.spaBase}),w(688),w(353);w(921);var _e=function(){},Ae=void 0,ke=Object,Te=function(t){return t===Ae},Ce=function(t){return"function"==typeof t},Ie=function(t,e){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){a(t,e,n[e])}))}return t}({},t,e)},Me=new WeakMap,De=0,Re=function(t){var e,n,r=void 0===t?"undefined":l(t),o=t&&t.constructor,i=o==Date;if(ke(t)!==t||i||o==RegExp)e=i?t.toJSON():"symbol"==r?t.toString():"string"==r?JSON.stringify(t):""+t;else{if(e=Me.get(t))return e;if(e=++De+"~",Me.set(t,e),o==Array){for(e="@",n=0;n<t.length;n++)e+=Re(t[n])+",";Me.set(t,e)}if(o==ke){e="#";for(var a=ke.keys(t).sort();!Te(n=a.pop());)Te(t[n])||(e+=n+":"+Re(t[n])+",");Me.set(t,e)}}return e},Ne=new WeakMap,Le={},Ue={},Be="undefined",Fe=("undefined"==typeof window?"undefined":l(window))!=Be,ze=("undefined"==typeof document?"undefined":l(document))!=Be,Ve=function(t,e){var n=Ne.get(t);return[function(){return!Te(e)&&t.get(e)||Le},function(r){if(!Te(e)){var o=t.get(e);e in Ue||(Ue[e]=o),n[5](e,Ie(o,r),o||Le)}},n[6],function(){return!Te(e)&&e in Ue?Ue[e]:!Te(e)&&t.get(e)||Le}]},He=!0,Ge=s(Fe&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[_e,_e],2),We=Ge[0],Ke=Ge[1],$e={isOnline:function(){return He},isVisible:function(){var t=ze&&document.visibilityState;return Te(t)||"hidden"!==t}},qe={initFocus:function(t){return ze&&document.addEventListener("visibilitychange",t),We("focus",t),function(){ze&&document.removeEventListener("visibilitychange",t),Ke("focus",t)}},initReconnect:function(t){var e=function(){He=!0,t()},n=function(){He=!1};return We("online",e),We("offline",n),function(){Ke("online",e),Ke("offline",n)}}},Je=(Tt.default.useId,!Fe||"Deno"in window),Ye=Je?Tt.useEffect:Tt.useLayoutEffect,Qe="undefined"!=typeof navigator&&navigator.connection,Xe=!Je&&Qe&&(["slow-2g","2g"].includes(Qe.effectiveType)||Qe.saveData),Ze=function(t){if(Ce(t))try{t=t()}catch(e){t=""}var e=t;return[t="string"==typeof t?t:(Array.isArray(t)?t.length:t)?Re(t):"",e]},tn=0,en=function(){return++tn};function nn(){return nn=i((function(){var t,e,n,r,o,a,u,c,l,f,p,d,v,y,m,g,b,w,S,O,E,x,j,P=arguments;function _(t){return A.apply(this,arguments)}function A(){return A=i((function(t){var n,r,i,a,c,l,m,g,b,w,S,O,E,x,j,P,_,A,k,T;return h(this,(function(h){switch(h.label){case 0:if(n=s(Ze(t),1),!(r=n[0]))return[2];if(i=s(Ve(o,r),2),a=i[0],c=i[1],l=s(Ne.get(o),4),m=l[0],g=l[1],b=l[2],w=l[3],S=function(){var t=m[r];return v&&(delete b[r],delete w[r],t&&t[0])?t[0](2).then((function(){return a().data})):a().data},e.length<3)return[2,S()];if(E=u,x=en(),g[r]=[x,0],j=!Te(d),P=a(),_=P.data,A=P._c,k=Te(A)?_:A,j&&(d=Ce(d)?d(k,_):d,c({data:d,_c:k})),Ce(E))try{E=E(k)}catch(t){O=t}return E&&function(t){return Ce(t.then)}(E)?[4,E.catch((function(t){O=t}))]:[3,2];case 1:if(E=h.sent(),x!==g[r][0]){if(O)throw O;return[2,E]}O&&j&&function(t){return"function"==typeof p?p(t):!1!==p}(O)&&(f=!0,c({data:k,_c:Ae})),h.label=2;case 2:if(f&&!O&&(Ce(f)?(T=f(E,k),c({data:T,error:Ae,_c:Ae})):c({data:E,error:Ae,_c:Ae})),g[r][1]=en(),Promise.resolve(S()).then((function(){c({_c:Ae})})),!O)return[2,E];if(y)throw O;return[2]}}))})),A.apply(this,arguments)}return h(this,(function(i){for(t=P.length,e=new Array(t),n=0;n<t;n++)e[n]=P[n];if(r=s(e,4),o=r[0],a=r[1],u=r[2],c=r[3],l=Ie({populateCache:!0,throwOnError:!0},"boolean"==typeof c?{revalidate:c}:c||{}),f=l.populateCache,p=l.rollbackOnError,d=l.optimisticData,v=!1!==l.revalidate,y=l.throwOnError,Ce(a)){m=a,g=[],b=o.keys(),w=!0,S=!1,O=void 0;try{for(E=b[Symbol.iterator]();!(w=(x=E.next()).done);w=!0)j=x.value,!/^\$(inf|sub)\$/.test(j)&&m(o.get(j)._k)&&g.push(j)}catch(t){S=!0,O=t}finally{try{w||null==E.return||E.return()}finally{if(S)throw O}}return[2,Promise.all(g.map(_))]}return[2,_(a)]}))})),nn.apply(this,arguments)}var rn=function(t,e){for(var n in t)t[n][0]&&t[n][0](e)},on=function(t,e){if(!Ne.has(t)){var n=Ie(qe,e),r={},o=St.bind(Ae,t),i=_e,a={},u=function(t,e){var n=a[t]||[];return a[t]=n,n.push(e),function(){return n.splice(n.indexOf(e),1)}},s=function(e,n,r){t.set(e,n);var o=a[e],i=!0,u=!1,s=void 0;if(o)try{for(var c,l=o[Symbol.iterator]();!(i=(c=l.next()).done);i=!0)(0,c.value)(n,r)}catch(t){u=!0,s=t}finally{try{i||null==l.return||l.return()}finally{if(u)throw s}}},c=function(){if(!Ne.has(t)&&(Ne.set(t,[r,{},{},{},o,s,u]),!Je)){var e=n.initFocus(setTimeout.bind(Ae,rn.bind(Ae,r,0))),a=n.initReconnect(setTimeout.bind(Ae,rn.bind(Ae,r,1)));i=function(){e&&e(),a&&a(),Ne.delete(t)}}};return c(),[t,o,c,i]}return[t,Ne.get(t)[4]]},an=s(on(new Map),2),un=an[0],sn=an[1],cn=Ie({onLoadingSlow:_e,onSuccess:_e,onError:_e,onErrorRetry:function(t,e,n,r,o){var i=n.errorRetryCount,a=o.retryCount,u=~~((Math.random()+.5)*(1<<(a<8?a:8)))*n.errorRetryInterval;!Te(i)&&a>i||setTimeout(r,u,o)},onDiscarded:_e,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Xe?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:Xe?5e3:3e3,compare:function(t,e){return Re(t)==Re(e)},isPaused:function(){return!1},cache:un,mutate:sn,fallback:{}},$e),ln=(0,Tt.createContext)({}),fn=Fe&&window.__SWR_DEVTOOLS_USE__;(fn?window.__SWR_DEVTOOLS_USE__:[]).concat((function(t){return function(e,n,r){return t(e,n&&function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=s(Ze(e),1)[0],a=s(Ne.get(un),4)[3];if(i.startsWith("$inf$"))return n.apply(void 0,c(r));var u=a[i];return Te(u)?n.apply(void 0,c(r)):(delete a[i],u)},r)}})),fn&&(window.__SWR_DEVTOOLS_REACT__=Tt.default);var hn;Tt.default.use;ke.defineProperty((function(t){var e=t.value,n=(0,Tt.useContext)(ln),r=Ce(e),o=(0,Tt.useMemo)((function(){return r?e(n):e}),[r,n,e]),i=(0,Tt.useMemo)((function(){return r?o:function(t,e){var n=Ie(t,e);if(e){var r=t.use,o=t.fallback,i=e.use,a=e.fallback;r&&i&&(n.use=r.concat(i)),o&&a&&(n.fallback=Ie(o,a))}return n}(n,o)}),[r,n,o]),a=o&&o.provider,u=(0,Tt.useRef)(Ae);a&&!u.current&&(u.current=on(a(i.cache||un),o));var s=u.current;return s&&(i.cache=s[0],i.mutate=s[1]),Ye((function(){if(s)return s[2]&&s[2](),s[3]}),[]),(0,Tt.createElement)(ln.Provider,Ie(t,{value:i}))}),"defaultValue",{value:cn}),w(641),(0,Ot.defineConfigSchema)("@openmrs/esm-styleguide",kt),hn=function(t,e){document.documentElement.style.setProperty(t,e)},(0,Ot.getConfigStore)("@openmrs/esm-styleguide").subscribe((function(t){t.loaded&&t.config&&(hn("--brand-01",t.config["Brand color #1"]),hn("--brand-02",t.config["Brand color #2"]),hn("--brand-03",t.config["Brand color #3"]))})),t("omrs-logo-full-color",Et),t("omrs-logo-full-mono",Et),t("omrs-logo-full-grey",Et),t("omrs-logo-partial-color",xt),t("omrs-logo-partial-mono",xt),t("omrs-logo-partial-grey",xt),t("omrs-logo-icon-color",jt),t("omrs-logo-icon-mono",jt),t("omrs-logo-icon-grey",jt),t("omrs-logo-white",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 380 119"><path fill="var(--logo-white)" fill-rule="evenodd" d="M40.29 40.328a27.76 27.76 0 0 1 19.688-8.154c7.669 0 14.613 3.102 19.647 8.116l.02-18.54A42.84 42.84 0 0 0 59.978 17c-7.089 0-13.813 1.93-19.709 4.968zM79.645 79.671a27.74 27.74 0 0 1-19.684 8.154c-7.67 0-14.614-3.101-19.651-8.116l-.02 18.54A42.86 42.86 0 0 0 59.96 103a42.8 42.8 0 0 0 19.672-4.751z" clip-rule="evenodd"/><path fill="var(--logo-grey)" fill-rule="evenodd" d="M40.328 79.696c-5.038-5.037-8.154-11.995-8.154-19.685 0-7.669 3.102-14.612 8.116-19.65l-18.54-.02A42.85 42.85 0 0 0 17 60.012a42.8 42.8 0 0 0 4.752 19.672zM79.634 40.289a27.75 27.75 0 0 1 8.154 19.688 27.74 27.74 0 0 1-8.117 19.646l18.542.02a42.84 42.84 0 0 0 4.749-19.666c0-7.09-1.714-13.779-4.751-19.675z" clip-rule="evenodd"/><path fill="var(--logo-white)" fill-rule="evenodd" d="M156.184 60.003c0-8.749-6.118-15.777-15.025-15.777-8.909 0-15.025 7.028-15.025 15.776s6.116 15.78 15.025 15.78c8.907 0 15.025-7.031 15.025-15.78m-34.881 0c0-11.483 8.318-19.96 19.856-19.96 11.536 0 19.855 8.478 19.855 19.96 0 11.484-8.319 19.964-19.855 19.964-11.538 0-19.856-8.48-19.856-19.964M179.514 75.54c5.507 0 9.05-4.14 9.05-9.482s-3.543-9.483-9.05-9.483c-5.505 0-9.046 4.142-9.046 9.483s3.541 9.482 9.046 9.482M166.22 53.306h4.248v3.704h.11c2.344-2.725 5.449-4.36 9.154-4.36 8.014 0 13.408 5.67 13.408 13.408 0 7.63-5.613 13.406-12.752 13.406-4.58 0-8.231-2.29-9.81-5.178h-.11V90.87h-4.248zM217.773 63.768c-.163-4.305-3-7.193-7.686-7.193-4.685 0-7.79 2.888-8.335 7.193zm3.653 10.412c-3.001 3.868-6.596 5.284-11.339 5.284-8.01 0-12.914-5.993-12.914-13.406 0-7.901 5.559-13.407 13.08-13.407 7.196 0 12.096 4.906 12.096 13.354v1.362h-20.597c.325 4.413 3.704 8.173 8.335 8.173 3.65 0 6.105-1.307 8.12-3.868zM227.854 59.357c0-2.347-.216-4.361-.216-6.05h4.031c0 1.362.11 2.776.11 4.194h.11c1.144-2.505 4.306-4.85 8.5-4.85 6.705 0 9.699 4.252 9.699 10.41v15.748h-4.248v-15.31c0-4.253-1.856-6.924-5.833-6.924-5.503 0-7.903 3.979-7.903 9.811V78.81h-4.25zM259.211 41.009h6.708L278.8 70.79h.107l12.982-29.782h6.549v37.99h-4.506V47.124h-.106L280.192 79h-2.738l-13.629-31.875h-.107V79h-4.507zM312.392 57.752h4.023c4.992 0 11.487 0 11.487-6.282 0-5.47-4.776-6.276-9.177-6.276h-6.333zm-4.506-16.744h9.711c7.352 0 15.132 1.072 15.132 10.462 0 5.527-3.594 9.125-9.495 10.037L334.018 79h-5.525l-10.304-17.063h-5.797V79h-4.506zM358.123 47.713c-1.506-2.414-4.187-3.487-6.926-3.487-3.973 0-8.1 1.88-8.1 6.385 0 3.49 1.931 5.047 7.994 6.98 5.903 1.878 11.377 3.809 11.377 11.267 0 7.567-6.495 11.11-13.36 11.11-4.402 0-9.125-1.45-11.7-5.262l3.862-3.165c1.61 2.794 4.83 4.24 8.105 4.24 3.862 0 8.263-2.253 8.263-6.601 0-4.669-3.165-5.474-9.928-7.728-5.366-1.771-9.442-4.134-9.442-10.463 0-7.298 6.277-10.945 12.929-10.945 4.241 0 7.836 1.178 10.625 4.45z" clip-rule="evenodd"/></svg>'),t("omrs-icon-activity",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M6 14.5a.5.5 0 0 1-.46-.31L3.165 8.5H1v-1h2.5a.5.5 0 0 1 .46.31L6 12.64l4.03-10.815a.5.5 0 0 1 .47-.325.5.5 0 0 1 .465.34L12.86 7.5H15v1h-2.5a.5.5 0 0 1-.475-.34L10.5 3.5 6.47 14.175A.5.5 0 0 1 6 14.5"/></svg>'),t("omrs-icon-add",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8.5 7.5V4h-1v3.5H4v1h3.5V12h1V8.5H12v-1z"/></svg>'),t("omrs-icon-arrow-down",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M12.295 8.295 8.5 12.085V2h-1v10.085l-3.795-3.79L3 9l5 5 5-5z"/></svg>'),t("omrs-icon-arrow-left",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m7 13 .705-.705L3.915 8.5H14v-1H3.915l3.79-3.795L7 3 2 8z"/></svg>'),t("omrs-icon-arrow-right",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m9 3-.715.696 3.79 3.804H2v1h10.075l-3.79 3.787L9 13l5-5z"/></svg>'),t("omrs-icon-arrow-up",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8 2 3 7l.705.705L7.5 3.915V14h1V3.915l3.795 3.79L13 7z"/></svg>'),t("omrs-icon-calendar-heat-map",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M13 2h-2V1h-1v1H6V1H5v1H3a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1M3 3h2v1h1V3h4v1h1V3h2v2H3zm0 3h2.5v3H3zm6.5 7h-3v-3h3zm0-4h-3V6h3zm1 4v-3H13v3z"/></svg>'),t("omrs-icon-calendar",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M13 2h-2V1h-1v1H6V1H5v1H3c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h10c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1m0 11H3V6h10zm0-8H3V3h2v1h1V3h4v1h1V3h2z"/></svg>'),t("omrs-icon-caret-down",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m12 6-4 5-4-5z"/></svg>'),t("omrs-icon-caret-left",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M10 12 5 8l5-4z"/></svg>'),t("omrs-icon-caret-right",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m6 4 5 4-5 4z"/></svg>'),t("omrs-icon-caret-up",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m4 10 4-5 4 5z"/></svg>'),t("omrs-icon-chart-average",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M11.5 12c-1.8 0-2.515-2.088-3.206-4.107C7.638 5.979 6.96 4 5.5 4a1.72 1.72 0 0 0-1.527 1.16l-.947-.318C3.05 4.767 3.66 3 5.5 3c2.175 0 3.006 2.427 3.74 4.569C9.844 9.333 10.415 11 11.5 11a1.72 1.72 0 0 0 1.527-1.16l.947.318C13.95 10.233 13.34 12 11.5 12"/><path d="M2 14V8.5h1v-1H2V1H1v13a1 1 0 0 0 1 1h13v-1z"/><path d="M5 7.5H4v1h1zM7 7.5H6v1h1zM11 7.5h-1v1h1zM13 7.5h-1v1h1zM15 7.5h-1v1h1z"/></svg>'),t("omrs-icon-chemistry",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M13.616 11.81 10 6.836V2h1V1H5v1h1v4.837L2.384 11.81A2.009 2.009 0 0 0 4.01 15h7.982a2.01 2.01 0 0 0 1.625-3.19M7 7.162V2h2v5.163L10.336 9H5.664zM11.99 14H4.01a1.01 1.01 0 0 1-.817-1.603L4.936 10h6.128l1.743 2.397A1.011 1.011 0 0 1 11.991 14"/></svg>'),t("omrs-icon-chevron-down",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8 11 3 6l.7-.7L8 9.6l4.3-4.3.7.7z"/></svg>'),t("omrs-icon-chevron-left",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m5 8 5-5 .7.7L6.4 8l4.3 4.3-.7.7z"/></svg>'),t("omrs-icon-chevron-right",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m11 8-5 5-.7-.7L9.6 8 5.3 3.7 6 3z"/></svg>'),t("omrs-icon-chevron-up",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m8 5 5 5-.7.7L8 6.4l-4.3 4.3L3 10z"/></svg>'),t("omrs-icon-close",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m12 4.7-.7-.7L8 7.3 4.7 4l-.7.7L7.3 8 4 11.3l.7.7L8 8.7l3.3 3.3.7-.7L8.7 8z"/></svg>'),t("omrs-icon-close-filled",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8 1C4.1 1 1 4.1 1 8s3.1 7 7 7 7-3.1 7-7-3.1-7-7-7m2.7 10.5L8 8.8l-2.7 2.7-.8-.8L7.2 8 4.5 5.3l.8-.8L8 7.2l2.7-2.7.8.8L8.8 8l2.7 2.7z"/></svg>'),t("omrs-icon-close-outline",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8 1C4.1 1 1 4.1 1 8s3.1 7 7 7 7-3.1 7-7-3.1-7-7-7m0 13c-3.3 0-6-2.7-6-6s2.7-6 6-6 6 2.7 6 6-2.7 6-6 6"/><path d="M10.7 11.5 8 8.8l-2.7 2.7-.8-.8L7.2 8 4.5 5.3l.8-.8L8 7.2l2.7-2.7.8.8L8.8 8l2.7 2.7z"/></svg>'),t("omrs-icon-document",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m12.85 4.65-3.5-3.5C9.25 1.05 9.15 1 9 1H4c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h8c.55 0 1-.45 1-1V5c0-.15-.05-.25-.15-.35M9 2.2 11.8 5H9zM12 14H4V2h4v3c0 .55.45 1 1 1h3z"/><path d="M11 11H5v1h6zM11 8H5v1h6z"/></svg>'),t("omrs-icon-document-attachment",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M13 15H5.5a1 1 0 0 1-1-1v-3h1v3H13V3H8.5V2H13a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1"/><path d="M12 5H8.5v1H12zM12 7.5H8v1h4zM12 10H7.5v1H12zM4.5 9.5A2.503 2.503 0 0 1 2 7V1.5h1V7a1.5 1.5 0 0 0 3 0V2.5a.5.5 0 1 0-1 0v5H4v-5a1.5 1.5 0 0 1 3 0V7a2.503 2.503 0 0 1-2.5 2.5"/></svg>'),t("omrs-icon-download",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M13 12v2H3v-2H2v2a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1v-2zM13 7l-.705-.705-3.795 3.79V1h-1v9.085l-3.795-3.79L3 7l5 5z"/></svg>'),t("omrs-icon-edit",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M15 13H1v1h14zM12.7 4.5c.4-.4.4-1 0-1.4l-1.8-1.8c-.4-.4-1-.4-1.4 0L2 8.8V12h3.2zM10.2 2 12 3.8l-1.5 1.5-1.8-1.8zM3 11V9.2l5-5L9.8 6l-5 5z"/></svg>'),t("omrs-icon-event-schedule",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M10.5 15a4 4 0 1 1 0-8 4 4 0 0 1 0 8m0-7a3 3 0 1 0 0 6 3 3 0 0 0 0-6"/><path d="M11.295 12.5 10 11.205V9h1v1.795l1 1z"/><path d="M14 3a1 1 0 0 0-1-1h-2V1h-1v1H6V1H5v1H3a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h2v-1H3V3h2v1h1V3h4v1h1V3h2v3h1z"/></svg>'),t("omrs-icon-events",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M13 7h-1v1h1a1.5 1.5 0 0 1 1.5 1.5v2h1v-2A2.503 2.503 0 0 0 13 7M12 2a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m0-1a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M11.5 15h-1v-1A1.5 1.5 0 0 0 9 12.5H7A1.5 1.5 0 0 0 5.5 14v1h-1v-1A2.503 2.503 0 0 1 7 11.5h2a2.503 2.503 0 0 1 2.5 2.5zM8 6.5a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m0-1a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M4 7H3A2.503 2.503 0 0 0 .5 9.5v2h1v-2A1.5 1.5 0 0 1 3 8h1zM4 2a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m0-1a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5"/></svg>'),t("omrs-icon-group",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M15.5 15h-1v-1.5A1.5 1.5 0 0 0 13 12h-2a1.5 1.5 0 0 0-1.5 1.5V15h-1v-1.5A2.5 2.5 0 0 1 11 11h2a2.5 2.5 0 0 1 2.5 2.5zM12 6a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m0-1a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M7.5 11h-1V9.5A1.5 1.5 0 0 0 5 8H3a1.5 1.5 0 0 0-1.5 1.5V11h-1V9.5A2.5 2.5 0 0 1 3 7h2a2.5 2.5 0 0 1 2.5 2.5zM4 2a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m0-1a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5"/></svg>'),t("omrs-icon-group-access",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M4 9.5H3v-1A1.5 1.5 0 0 1 4.5 7H7v1H4.5a.5.5 0 0 0-.5.5zM6 6.5a2 2 0 1 1 0-4 2 2 0 0 1 0 4m0-3a1 1 0 1 0 0 2 1 1 0 0 0 0-2M10 10a2 2 0 1 1 0-4 2 2 0 0 1 0 4m0-3a1 1 0 1 0 0 2 1 1 0 0 0 0-2M13 13h-1v-1a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5v1H7v-1a1.5 1.5 0 0 1 1.5-1.5h3A1.5 1.5 0 0 1 13 12z"/><path d="M4 15H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h2v1H2v12h2zM14 15h-2v-1h2V2h-2V1h2a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1"/></svg>'),t("omrs-icon-hospital-bed",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M12.5 8h-4a1 1 0 0 0-1 1v3H2V7H1v8h1v-2h12v2h1v-4.5A2.503 2.503 0 0 0 12.5 8m1.5 4H8.5V9h4a1.5 1.5 0 0 1 1.5 1.5z"/><path d="M4.75 8.5a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5m0-1a1.75 1.75 0 1 0 0 3.5 1.75 1.75 0 0 0 0-3.5M10.5 3h-2V1h-1v2h-2v1h2v2h1V4h2z"/></svg>'),t("omrs-icon-image-medical",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M13 3v10H3V3zm0-1H3a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1"/><path d="M11 8V7H8.5V6H10V5H8.5V4h-1v1H6v1h1.5v1H5v1h2.5v1H5v1h2.5v1H6v1h4v-1H8.5v-1H11V9H8.5V8z"/></svg>'),t("omrs-icon-inventory-management",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M11.5 12h-2v2h2zM15 12h-2v2h2zM11.5 8.5h-2v2h2zM15 8.5h-2v2h2z"/><path d="M8.5 12H2V5h12v2.5h1V5a1 1 0 0 0-1-1h-3V2a1 1 0 0 0-1-1H6a1 1 0 0 0-1 1v2H2a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h6.5zM6 2h4v2H6z"/></svg>'),t("omrs-icon-list-checked",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M15 4H8v1h7zM3 5.295 1.705 4 1 4.705l2 2 4-4L6.295 2zM15 11H8v1h7zM3 12.295 1.705 11 1 11.705l2 2 4-4L6.295 9z"/></svg>'),t("omrs-icon-location",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8 9a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5m0-4a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3"/><path d="m8 15-4.218-4.974-.174-.226A5.44 5.44 0 0 1 2.5 6.5a5.5 5.5 0 1 1 11 0 5.44 5.44 0 0 1-1.107 3.299h-.001s-.15.198-.172.225zM4.406 9.198s.117.154.144.187L8 13.454l3.455-4.075.14-.183A4.45 4.45 0 0 0 12.5 6.5a4.5 4.5 0 1 0-9 0 4.45 4.45 0 0 0 .906 2.698"/></svg>'),t("omrs-icon-maximize",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M10 1v1h3.293L9 6.291 9.707 7 14 2.707V6h1V1zM7 9.708 6.296 9 2 13.293V10H1v5h5v-1H2.707z"/></svg>'),t("omrs-icon-medication",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M12 1H4a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1v9a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V5a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1M5 7h1.5v5H5zm6 7H5v-1h2.5V6H5V5h6zM4 4V2h8v2z"/></svg>'),t("omrs-icon-message-queue",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M14 14H2a1 1 0 0 1-1-1v-2.5h1V13h12v-2.5h1V13a1 1 0 0 1-1 1"/><path d="M12.5 10.5h-9v1h9zM12.5 8h-9v1h9zM12.5 5.5h-9v1h9zM12.5 3h-9v1h9z"/></svg>'),t("omrs-icon-microscope",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M12.697 12a3.94 3.94 0 0 0-.835-4.284 1.96 1.96 0 0 0-.542-2.207l1.388-1.388a1 1 0 0 0 0-1.415l-1.415-1.414a1 1 0 0 0-1.414 0L3.293 7.88a1 1 0 0 0 0 1.414l1.414 1.414a1 1 0 0 0 1.414 0L8.51 8.319a1.966 1.966 0 0 0 2.757.217A2.97 2.97 0 0 1 11.589 12H8v2H2v1h12v-3zm-7.283-2L4 8.586l.94-.94L6.353 9.06zM8 7q0 .19.038.376l-.977.977L5.646 6.94 10.586 2l1.415 1.414-1.625 1.625A1.99 1.99 0 0 0 8 7m2 1a1 1 0 1 1 0-2 1 1 0 0 1 0 2m3 6H9v-1h4z"/></svg>'),t("omrs-icon-money",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M15 11H1v1h14zM15 13H1v1h14zM12 5a1 1 0 1 0 0 2 1 1 0 0 0 0-2M8 8a2 2 0 1 1 0-4 2 2 0 0 1 0 4m0-3a1 1 0 1 0 0 2 1 1 0 0 0 0-2M4 5a1 1 0 1 0 0 2 1 1 0 0 0 0-2"/><path d="M14 10H2a1.003 1.003 0 0 1-1-1V3a1.003 1.003 0 0 1 1-1h12a1.003 1.003 0 0 1 1 1v6a1 1 0 0 1-1 1m0-7H2v6h12z"/></svg>'),t("omrs-icon-movement",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m12 10-.705.705 1.79 1.795H5a2 2 0 1 1 0-4h6a3 3 0 0 0 0-6H2.915L4.705.705 4 0 1 3l3 3 .705-.705L2.915 3.5H11a2 2 0 0 1 0 4H5a3 3 0 1 0 0 6h8.085l-1.79 1.795L12 16l3-3z"/></svg>'),t("omrs-icon-overflow-menu--horizontal",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M4 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2M8 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2M12 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2"/></svg>'),t("omrs-icon-overflow-menu--vertical",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8 5a1 1 0 1 0 0-2 1 1 0 0 0 0 2M8 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2M8 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2"/></svg>'),t("omrs-icon-pedestrian-family",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M10 15H8.5a1 1 0 0 1-1-1v-2.5h1V14H10v-2.5h1v-2a.5.5 0 0 0-.5-.5H6.14l-1-3H2a.5.5 0 0 0-.5.5v3h1V14h2v-3.5h1V14a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-3.5a1 1 0 0 1-1-1v-3A1.5 1.5 0 0 1 2 5h3.14a1 1 0 0 1 .948.684L6.86 8h3.64A1.5 1.5 0 0 1 12 9.5v2a1 1 0 0 1-1 1V14a1 1 0 0 1-1 1M14 15h-1V9.5h1.5v-3A.5.5 0 0 0 14 6h-2V5h2a1.5 1.5 0 0 1 1.5 1.5v3a1 1 0 0 1-1 1H14zM3.5 4.5a2 2 0 1 1 0-4 2 2 0 0 1 0 4m0-3a1 1 0 1 0 0 2 1 1 0 0 0 0-2M12.5 4.5a2 2 0 1 1 0-4 2 2 0 0 1 0 4m0-3a1 1 0 1 0 0 2 1 1 0 0 0 0-2"/><path d="M9.25 7.5a1.75 1.75 0 1 1 0-3.5 1.75 1.75 0 0 1 0 3.5m0-2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5"/></svg>'),t("omrs-icon-pen",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M13.654 3.053 15 1.707 14.293 1l-1.346 1.346L12.4 1.8a.967.967 0 0 0-1.4 0l-9 9V14h3.2l9-9a.967.967 0 0 0 0-1.4zM4.8 13H3v-1.8l8.7-8.7 1.8 1.8zM8.293 2 4.5 5.793l.707.707L9 2.707z"/></svg>'),t("omrs-icon-printer",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M14 4.5h-1.5v-3h-9v3H2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h1.5v3h9v-3H14a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1m-9.5-2h7v2h-7zm7 11h-7v-5h7zm2.5-3h-1.5v-3h-9v3H2v-5h12z"/></svg>'),t("omrs-icon-renew",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M6 5H3.39A5.5 5.5 0 0 1 13.5 8h1A6.5 6.5 0 0 0 3 3.84V2H2v4h4zM10 11h2.61A5.5 5.5 0 0 1 2.5 8h-1A6.5 6.5 0 0 0 13 12.16V14h1v-4h-4z"/></svg>'),t("omrs-icon-password",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M10.5 1a4.5 4.5 0 0 0-4.306 5.806L1 12v3h3l5.194-5.194A4.5 4.5 0 1 0 10.5 1m0 8c-.344 0-.687-.051-1.016-.151l-.573-.174-2.015 2.014L6.207 10l-.707.707.69.69-.794.792-.689-.689-.707.707.69.69L3.585 14H2v-1.586L7.325 7.09l-.174-.573A3.5 3.5 0 1 1 10.5 9"/><path d="M11 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2"/></svg>'),t("omrs-icon-reset",'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none"><path fill="#161616" d="M9 14a6 6 0 1 0-6-6v3.1L1.2 9.3l-.7.7 3 3 3-3-.7-.7L4 11.1V8a5 5 0 1 1 5 5z"/></svg>'),t("omrs-icon-search",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m14.5 13.793-3.776-3.776a5.508 5.508 0 1 0-.707.707l3.776 3.776zM2 6.5a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0"/></svg>'),t("omrs-icon-save",'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none"><path fill="#161616" d="m13.855 4.645-2.5-2.5A.5.5 0 0 0 11 2H3a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V5a.5.5 0 0 0-.145-.355M6 3h4v2H6zm4 10H6V9h4zm1 0V9a1 1 0 0 0-1-1H6a1 1 0 0 0-1 1v4H3V3h2v2a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1V3.205l2 2V13z"/></svg>'),t("omrs-icon-shopping-cart",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M5 15a1 1 0 1 0 0-2 1 1 0 0 0 0 2M12 15a1 1 0 1 0 0-2 1 1 0 0 0 0 2M14 3.5H2.91L2.5 1.4A.5.5 0 0 0 2 1H0v1h1.59l1.91 9.6a.5.5 0 0 0 .5.4h9v-1H4.41L4 9h9a.5.5 0 0 0 .5-.39l1-4.5a.5.5 0 0 0-.5-.61M12.6 8H3.81l-.7-3.5h10.265z"/></svg>'),t("omrs-icon-shopping-cart--arrow-down",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M5 15a1 1 0 1 0 0-2 1 1 0 0 0 0 2M12 15a1 1 0 1 0 0-2 1 1 0 0 0 0 2M2.49 1.402A.5.5 0 0 0 2 1H0v1h1.59l1.92 9.598A.5.5 0 0 0 4 12h9v-1H4.41l-.4-2H13a.5.5 0 0 0 .488-.392L14.622 3.5h-1.024L12.6 8H3.81z"/><path d="M10.793 3.293 9 5.086V1H8v4.086L6.207 3.293 5.5 4l3 3 3-3z"/></svg>'),t("omrs-icon-sticky-note-add",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M14.375 1.25h-1.25v2.5h-2.5V5h2.5v2.5h1.25V5h2.5V3.75h-2.5z"/><path d="M9.375 2.5h-5a1.254 1.254 0 0 0-1.25 1.25v12.5a1.254 1.254 0 0 0 1.25 1.25h7.5a.57.57 0 0 0 .438-.188l4.374-4.375a.57.57 0 0 0 .188-.437V8.75h-1.25v2.5h-3.75a1.254 1.254 0 0 0-1.25 1.25v3.75h-6.25V3.75h5zm6 10-3.5 3.5v-3.5z"/></svg>'),t("omrs-icon-switcher",At),t("omrs-icon-switcher",At),t("omrs-icon-table-of-contents",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M11 3H2v1h9zM11 6H2v1h9zM11 9H2v1h9zM11 12H2v1h9zM14 3h-1v1h1zM14 6h-1v1h1zM14 9h-1v1h1zM14 12h-1v1h1z"/></svg>'),t("omrs-icon-table",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M14.5 2.5a1 1 0 0 0-1-1h-11a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1zm-1 0v2h-11v-2zm0 11h-11v-2h11zm0-3h-11v-2h11zm0-3h-11v-2h11z"/></svg>'),t("omrs-icon-time",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14M8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2"/><path d="M10.295 11 7.5 8.205V3.5h1v4.29l2.5 2.505z"/></svg>'),t("omrs-icon-tools",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M6.05 1a4.9 4.9 0 0 0-2.7.8L6.55 5a1.05 1.05 0 0 1 .1 1.5 1.05 1.05 0 0 1-1.5-.1l-3.3-3.2A4.9 4.9 0 0 0 1 6.05a5.07 5.07 0 0 0 5.05 5.05c.438.002.874-.048 1.3-.15l3.35 3.35a2.51 2.51 0 1 0 3.55-3.55L10.9 7.4q.153-.641.15-1.3a5 5 0 0 0-5-5.1m4 5.05c0 .355-.051.709-.15 1.05l-.15.55.4.4 3.35 3.35a1.44 1.44 0 0 1 .45 1.05 1.36 1.36 0 0 1-.45 1.05 1.45 1.45 0 0 1-2.1 0l-3.35-3.35-.4-.4-.55.15c-.341.099-.695.15-1.05.15A4.14 4.14 0 0 1 3.2 8.9 3.82 3.82 0 0 1 2 6.05c0-.372.051-.742.15-1.1l2.2 2.2a2.07 2.07 0 0 0 2.95.1 2.07 2.07 0 0 0-.1-2.95L5 2.1c.323-.102.66-.153 1-.15A4.14 4.14 0 0 1 8.85 3.1a4.25 4.25 0 0 1 1.2 2.95"/></svg>'),t("omrs-icon-translate",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M13.925 14.5H15L12 7h-1.175l-3 7.5H8.9l.8-2h3.425zm-3.825-3 1.31-3.28 1.315 3.28zM9 3.5v-1H5.5V1h-1v1.5H1v1h5.37a7.36 7.36 0 0 1-1.595 3.09A6.8 6.8 0 0 1 3.63 4.5H2.58a8.2 8.2 0 0 0 1.5 2.79A8.4 8.4 0 0 1 1.5 9l.375.93A9.2 9.2 0 0 0 4.765 8a8.5 8.5 0 0 0 2.88 1.92L8 9a7.2 7.2 0 0 1-2.56-1.685A8.8 8.8 0 0 0 7.4 3.5z"/></svg>'),t("omrs-icon-trash-can",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M7 6H6v6h1zM10 6H9v6h1z"/><path d="M2 3v1h1v10a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4h1V3zm2 11V4h8v10zM10 1H6v1h4z"/></svg>'),t("omrs-icon-tree-view--alt",'<svg xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#a)"><path d="M11.5 4.502h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1h-3a1 1 0 0 0-1 1v.5h-5v-.5a1 1 0 0 0-1-1h-3a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-.5h2v10a1 1 0 0 0 1 1h2v.5a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1h-3a1 1 0 0 0-1 1v.5h-2v-4.5h2v.5a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1h-3a1 1 0 0 0-1 1v.5h-2v-4.5h2v.5a1 1 0 0 0 1 1m0-3h3v2h-3zm-7 2h-3v-2h3zm7 9h3v2h-3zm0-5.5h3v2h-3z"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg>'),t("omrs-icon-user-avatar",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8 4a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5m0 4a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"/><path d="M8 1a7 7 0 1 0 7 7 7.01 7.01 0 0 0-7-7M5 13.188V12.5A1.5 1.5 0 0 1 6.5 11h3a1.5 1.5 0 0 1 1.5 1.5v.688a5.95 5.95 0 0 1-6 0m6.996-.725A2.5 2.5 0 0 0 9.5 10h-3a2.5 2.5 0 0 0-2.496 2.463 6 6 0 1 1 7.992 0"/></svg>'),t("omrs-icon-user-follow",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M16 7h-2V5h-1v2h-2v1h2v2h1V8h2zM6 2a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5m0-1a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7M11 15h-1v-2.5A2.5 2.5 0 0 0 7.5 10h-3A2.5 2.5 0 0 0 2 12.5V15H1v-2.5A3.5 3.5 0 0 1 4.5 9h3a3.5 3.5 0 0 1 3.5 3.5z"/></svg>'),t("omrs-icon-user-xray",'<svg xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#a)"><path d="M15.5 1.5h-7A.5.5 0 0 0 8 2v6.5a.5.5 0 0 0 .5.5h7a.5.5 0 0 0 .5-.5V2a.5.5 0 0 0-.5-.5m-1.5 3h-1.5V6H14v1h-1.5v1h-1V7H10V6h1.5V4.5H10v-1h1.5v-1h1v1H14zM7.5 15h-1v-2A1.473 1.473 0 0 0 5 11.5H3A1.474 1.474 0 0 0 1.5 13v2h-1v-2A2.475 2.475 0 0 1 3 10.5h2A2.476 2.476 0 0 1 7.5 13zM4 5.5a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m0-1a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg>'),t("omrs-icon-user",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8 2a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5m0-1a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7M13 15h-1v-2.5A2.5 2.5 0 0 0 9.5 10h-3A2.5 2.5 0 0 0 4 12.5V15H3v-2.5A3.5 3.5 0 0 1 6.5 9h3a3.5 3.5 0 0 1 3.5 3.5z"/></svg>'),t("omrs-icon-view-off",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m2.62 11.255.715-.71A7 7 0 0 1 1.535 8C2.55 5.465 5.35 3.5 8 3.5a6.2 6.2 0 0 1 2 .36l.775-.78A7.4 7.4 0 0 0 8 2.5 8.35 8.35 0 0 0 .53 7.83a.5.5 0 0 0 0 .34 8 8 0 0 0 2.09 3.085"/><path d="M6 7.865a2 2 0 0 1 1.85-1.85l.905-.91A3 3 0 0 0 5.09 8.77zM15.47 7.83a8.2 8.2 0 0 0-2.87-3.72L15 1.705 14.295 1 1 14.295l.705.705 2.55-2.55A7.65 7.65 0 0 0 8 13.5a8.35 8.35 0 0 0 7.47-5.33.5.5 0 0 0 0-.34M10 8a2 2 0 0 1-3 1.72L9.72 7A2 2 0 0 1 10 8m-2 4.5a6.5 6.5 0 0 1-3-.79l1.27-1.27a3 3 0 0 0 4.175-4.175L11.88 4.83A7.27 7.27 0 0 1 14.465 8C13.45 10.535 10.65 12.5 8 12.5"/></svg>'),t("omrs-icon-view",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M15.47 7.83A8.34 8.34 0 0 0 8 2.5 8.35 8.35 0 0 0 .53 7.83a.5.5 0 0 0 0 .34A8.35 8.35 0 0 0 8 13.5a8.35 8.35 0 0 0 7.47-5.33.5.5 0 0 0 0-.34M8 12.5c-2.65 0-5.45-1.965-6.465-4.5C2.55 5.465 5.35 3.5 8 3.5s5.45 1.965 6.465 4.5C13.45 10.535 10.65 12.5 8 12.5"/><path d="M8 5a3 3 0 1 0 0 6 3 3 0 0 0 0-6m0 5a2 2 0 1 1 0-4 2 2 0 0 1 0 4"/></svg>'),t("omrs-icon-warning",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1m0 13A6 6 0 1 1 8 2a6 6 0 0 1 0 12"/><path d="M8.5 4h-1v5.5h1zM8 11a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5"/></svg>')}(),function(){"use strict";w.r(S)}(),S}())}}}))},8834:(t,e,n)=>{"use strict";function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,{V:()=>gt,t:()=>mt});var o,i,a=(o=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),o.forEach((function(e){r(t,e,n[e])}))}return t}({},{address1:"Address line 1",address2:"Address line 2",address3:"Address line 3",address4:"Address line 4",address5:"Address line 5",address6:"Address line 6",city:"City",cityVillage:"City",country:"Country",countyDistrict:"District",postalCode:"Postal code",state:"State",stateProvince:"State"},{closeAllOpenedWorkspaces:"Discard changes in {{count}} workspaces",closingAllWorkspacesPromptBody:"There are unsaved changes in the following workspaces. Do you want to discard changes in the following workspaces? {{workspaceNames}}",closingAllWorkspacesPromptTitle:"You have unsaved changes",discard:"Discard",hide:"Hide",maximize:"Maximize",minimize:"Minimize",openAnyway:"Open anyway",unsavedChangesInOpenedWorkspace:"You have unsaved changes in the opened workspace. Do you want to discard these changes?",unsavedChangesInWorkspace:"There are unsaved changes in {{workspaceName}}. Please save them before opening another workspace.",unsavedChangesTitleText:"Unsaved changes",workspaceHeader:"Workspace header"}),i=null!=(i={actions:"Actions",address:"Address",age:"Age",cancel:"Cancel",change:"Change",close:"Close",confirm:"Confirm",contactAdministratorIfIssuePersists:"Contact your system administrator if the problem persists.",contactDetails:"Contact details",error:"Error",errorCopy:"Sorry, there was a problem displaying this information. You can try to reload this page, or contact the site administrator and quote the error code above.",female:"Female",hideDetails:"Hide details",loading:"Loading",male:"Male",other:"Other",patientIdentifierSticker:"Patient identifier sticker",patientLists:"Patient lists",print:"Print",printError:"Print error",printErrorExplainer:"An error occurred in {{errorLocation}}",printIdentifierSticker:"Print identifier sticker",printing:"Printing",relationships:"Relationships",resetOverrides:"Reset overrides",scriptLoadingFailed:"Error: Script failed to load",scriptLoadingError:"Failed to load overridden script from {{url}}. Please check that the bundled script is available at the expected URL. Click the button below to reset all import map overrides.",seeMoreLists:"See {{count}} more lists",sex:"Sex",showDetails:"Show details",unknown:"Unknown"})?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n.push.apply(n,r)}return n}(Object(i)).forEach((function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(i,t))})),o),u=n(7545),s=n(5152),c=n(414),l=n(2474),f=n(1087);function h(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&(0,f.A)(t,e)}function p(t,e){if(e&&("object"==(0,u.A)(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return(0,l.A)(t)}function d(t){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},d(t)}var v=n(4586),y=n(6488),m=n(2296),g=n(5405);function b(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function w(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?b(Object(n),!0).forEach((function(e){(0,v.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var S={type:"logger",log:function(t){this.output("log",t)},warn:function(t){this.output("warn",t)},error:function(t){this.output("error",t)},output:function(t,e){console&&console[t]&&console[t].apply(console,e)}},O=new(function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,s.A)(this,t),this.init(e,n)}return(0,c.A)(t,[{key:"init",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=e.prefix||"i18next:",this.logger=t||S,this.options=e,this.debug=e.debug}},{key:"setDebug",value:function(t){this.debug=t}},{key:"log",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.forward(e,"log","",!0)}},{key:"warn",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.forward(e,"warn","",!0)}},{key:"error",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.forward(e,"error","")}},{key:"deprecate",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(t,e,n,r){return r&&!this.debug?null:("string"==typeof t[0]&&(t[0]="".concat(n).concat(this.prefix," ").concat(t[0])),this.logger[e](t))}},{key:"create",value:function(e){return new t(this.logger,w(w({},{prefix:"".concat(this.prefix,":").concat(e,":")}),this.options))}},{key:"clone",value:function(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new t(this.logger,e)}}]),t}()),E=function(){function t(){(0,s.A)(this,t),this.observers={}}return(0,c.A)(t,[{key:"on",value:function(t,e){var n=this;return t.split(" ").forEach((function(t){n.observers[t]=n.observers[t]||[],n.observers[t].push(e)})),this}},{key:"off",value:function(t,e){this.observers[t]&&(e?this.observers[t]=this.observers[t].filter((function(t){return t!==e})):delete this.observers[t])}},{key:"emit",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.observers[t]&&[].concat(this.observers[t]).forEach((function(t){t.apply(void 0,n)})),this.observers["*"]&&[].concat(this.observers["*"]).forEach((function(e){e.apply(e,[t].concat(n))}))}}]),t}();function x(){var t,e,n=new Promise((function(n,r){t=n,e=r}));return n.resolve=t,n.reject=e,n}function j(t){return null==t?"":""+t}function P(t,e,n){function r(t){return t&&t.indexOf("###")>-1?t.replace(/###/g,"."):t}function o(){return!t||"string"==typeof t}for(var i="string"!=typeof e?[].concat(e):e.split(".");i.length>1;){if(o())return{};var a=r(i.shift());!t[a]&&n&&(t[a]=new n),t=Object.prototype.hasOwnProperty.call(t,a)?t[a]:{}}return o()?{}:{obj:t,k:r(i.shift())}}function _(t,e,n){var r=P(t,e,Object);r.obj[r.k]=n}function A(t,e){var n=P(t,e),r=n.obj,o=n.k;if(r)return r[o]}function k(t,e,n){var r=A(t,n);return void 0!==r?r:A(e,n)}function T(t,e,n){for(var r in e)"__proto__"!==r&&"constructor"!==r&&(r in t?"string"==typeof t[r]||t[r]instanceof String||"string"==typeof e[r]||e[r]instanceof String?n&&(t[r]=e[r]):T(t[r],e[r],n):t[r]=e[r]);return t}function C(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var I={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function M(t){return"string"==typeof t?t.replace(/[&<>"'\/]/g,(function(t){return I[t]})):t}var D="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,R=[" ",",","?","!",";"];function N(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function L(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?N(Object(n),!0).forEach((function(e){(0,v.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function U(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(t){if(t[e])return t[e];for(var r=e.split(n),o=t,i=0;i<r.length;++i){if(!o)return;if("string"==typeof o[r[i]]&&i+1<r.length)return;if(void 0===o[r[i]]){for(var a=2,u=r.slice(i,i+a).join(n),s=o[u];void 0===s&&r.length>i+a;)a++,s=o[u=r.slice(i,i+a).join(n)];if(void 0===s)return;if(null===s)return null;if(e.endsWith(u)){if("string"==typeof s)return s;if(u&&"string"==typeof s[u])return s[u]}var c=r.slice(i+a).join(n);return c?U(s,c,n):void 0}o=o[r[i]]}return o}}var B=function(t){h(o,t);var e,n,r=(e=o,n=function(){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(t){return!1}}(),function(){var t,r=d(e);if(n){var o=d(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return p(this,t)});function o(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return(0,s.A)(this,o),e=r.call(this),D&&E.call((0,l.A)(e)),e.data=t||{},e.options=n,void 0===e.options.keySeparator&&(e.options.keySeparator="."),void 0===e.options.ignoreJSONStructure&&(e.options.ignoreJSONStructure=!0),e}return(0,c.A)(o,[{key:"addNamespaces",value:function(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}},{key:"removeNamespaces",value:function(t){var e=this.options.ns.indexOf(t);e>-1&&this.options.ns.splice(e,1)}},{key:"getResource",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,a=[t,e];n&&"string"!=typeof n&&(a=a.concat(n)),n&&"string"==typeof n&&(a=a.concat(o?n.split(o):n)),t.indexOf(".")>-1&&(a=t.split("."));var u=A(this.data,a);return u||!i||"string"!=typeof n?u:U(this.data&&this.data[t]&&this.data[t][e],n,o)}},{key:"addResource",value:function(t,e,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=this.options.keySeparator;void 0===i&&(i=".");var a=[t,e];n&&(a=a.concat(i?n.split(i):n)),t.indexOf(".")>-1&&(r=e,e=(a=t.split("."))[1]),this.addNamespaces(e),_(this.data,a,r),o.silent||this.emit("added",t,e,n,r)}},{key:"addResources",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var o in n)"string"!=typeof n[o]&&"[object Array]"!==Object.prototype.toString.apply(n[o])||this.addResource(t,e,o,n[o],{silent:!0});r.silent||this.emit("added",t,e,n)}},{key:"addResourceBundle",value:function(t,e,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[t,e];t.indexOf(".")>-1&&(r=n,n=e,e=(a=t.split("."))[1]),this.addNamespaces(e);var u=A(this.data,a)||{};r?T(u,n,o):u=L(L({},u),n),_(this.data,a,u),i.silent||this.emit("added",t,e,n)}},{key:"removeResourceBundle",value:function(t,e){this.hasResourceBundle(t,e)&&delete this.data[t][e],this.removeNamespaces(e),this.emit("removed",t,e)}},{key:"hasResourceBundle",value:function(t,e){return void 0!==this.getResource(t,e)}},{key:"getResourceBundle",value:function(t,e){return e||(e=this.options.defaultNS),"v1"===this.options.compatibilityAPI?L(L({},{}),this.getResource(t,e)):this.getResource(t,e)}},{key:"getDataByLanguage",value:function(t){return this.data[t]}},{key:"hasLanguageSomeTranslations",value:function(t){var e=this.getDataByLanguage(t);return!!(e&&Object.keys(e)||[]).find((function(t){return e[t]&&Object.keys(e[t]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),o}(E),F={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,e,n,r,o){var i=this;return t.forEach((function(t){i.processors[t]&&(e=i.processors[t].process(e,n,r,o))})),e}};function z(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function V(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?z(Object(n),!0).forEach((function(e){(0,v.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var H={},G=function(t){h(o,t);var e,n,r=(e=o,n=function(){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(t){return!1}}(),function(){var t,r=d(e);if(n){var o=d(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return p(this,t)});function o(t){var e,n,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,s.A)(this,o),e=r.call(this),D&&E.call((0,l.A)(e)),n=t,i=(0,l.A)(e),["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach((function(t){n[t]&&(i[t]=n[t])})),e.options=a,void 0===e.options.keySeparator&&(e.options.keySeparator="."),e.logger=O.create("translator"),e}return(0,c.A)(o,[{key:"changeLanguage",value:function(t){t&&(this.language=t)}},{key:"exists",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==t)return!1;var n=this.resolve(t,e);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(t,e){var n=void 0!==e.nsSeparator?e.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator,o=e.ns||this.options.defaultNS||[],i=n&&t.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||e.keySeparator||this.options.userDefinedNsSeparator||e.nsSeparator||function(t,e,n){e=e||"",n=n||"";var r=R.filter((function(t){return e.indexOf(t)<0&&n.indexOf(t)<0}));if(0===r.length)return!0;var o=new RegExp("(".concat(r.map((function(t){return"?"===t?"\\?":t})).join("|"),")")),i=!o.test(t);if(!i){var a=t.indexOf(n);a>0&&!o.test(t.substring(0,a))&&(i=!0)}return i}(t,n,r));if(i&&!a){var u=t.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:t,namespaces:o};var s=t.split(n);(n!==r||n===r&&this.options.ns.indexOf(s[0])>-1)&&(o=s.shift()),t=s.join(r)}return"string"==typeof o&&(o=[o]),{key:t,namespaces:o}}},{key:"translate",value:function(t,e,n){var r=this;if("object"!==(0,u.A)(e)&&this.options.overloadTranslationOptionHandler&&(e=this.options.overloadTranslationOptionHandler(arguments)),e||(e={}),null==t)return"";Array.isArray(t)||(t=[String(t)]);var i=void 0!==e.returnDetails?e.returnDetails:this.options.returnDetails,a=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator,s=this.extractFromKey(t[t.length-1],e),c=s.key,l=s.namespaces,f=l[l.length-1],h=e.lng||this.language,p=e.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(h&&"cimode"===h.toLowerCase()){if(p){var d=e.nsSeparator||this.options.nsSeparator;return i?(v.res="".concat(f).concat(d).concat(c),v):"".concat(f).concat(d).concat(c)}return i?(v.res=c,v):c}var v=this.resolve(t,e),y=v&&v.res,m=v&&v.usedKey||c,g=v&&v.exactUsedKey||c,b=Object.prototype.toString.apply(y),w=void 0!==e.joinArrays?e.joinArrays:this.options.joinArrays,S=!this.i18nFormat||this.i18nFormat.handleAsObject;if(S&&y&&"string"!=typeof y&&"boolean"!=typeof y&&"number"!=typeof y&&["[object Number]","[object Function]","[object RegExp]"].indexOf(b)<0&&("string"!=typeof w||"[object Array]"!==b)){if(!e.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var O=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,y,V(V({},e),{},{ns:l})):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");return i?(v.res=O,v):O}if(a){var E="[object Array]"===b,x=E?[]:{},j=E?g:m;for(var P in y)if(Object.prototype.hasOwnProperty.call(y,P)){var _="".concat(j).concat(a).concat(P);x[P]=this.translate(_,V(V({},e),{joinArrays:!1,ns:l})),x[P]===_&&(x[P]=y[P])}y=x}}else if(S&&"string"==typeof w&&"[object Array]"===b)(y=y.join(w))&&(y=this.extendTranslation(y,t,e,n));else{var A=!1,k=!1,T=void 0!==e.count&&"string"!=typeof e.count,C=o.hasDefaultValue(e),I=T?this.pluralResolver.getSuffix(h,e.count,e):"",M=e["defaultValue".concat(I)]||e.defaultValue;!this.isValidLookup(y)&&C&&(A=!0,y=M),this.isValidLookup(y)||(k=!0,y=c);var D=(e.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&k?void 0:y,R=C&&M!==y&&this.options.updateMissing;if(k||A||R){if(this.logger.log(R?"updateKey":"missingKey",h,f,c,R?M:y),a){var N=this.resolve(c,V(V({},e),{},{keySeparator:!1}));N&&N.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var L=[],U=this.languageUtils.getFallbackCodes(this.options.fallbackLng,e.lng||this.language);if("fallback"===this.options.saveMissingTo&&U&&U[0])for(var B=0;B<U.length;B++)L.push(U[B]);else"all"===this.options.saveMissingTo?L=this.languageUtils.toResolveHierarchy(e.lng||this.language):L.push(e.lng||this.language);var F=function(t,n,o){var i=C&&o!==y?o:D;r.options.missingKeyHandler?r.options.missingKeyHandler(t,f,n,i,R,e):r.backendConnector&&r.backendConnector.saveMissing&&r.backendConnector.saveMissing(t,f,n,i,R,e),r.emit("missingKey",t,f,n,y)};this.options.saveMissing&&(this.options.saveMissingPlurals&&T?L.forEach((function(t){r.pluralResolver.getSuffixes(t,e).forEach((function(n){F([t],c+n,e["defaultValue".concat(n)]||M)}))})):F(L,c,M))}y=this.extendTranslation(y,t,e,v,n),k&&y===c&&this.options.appendNamespaceToMissingKey&&(y="".concat(f,":").concat(c)),(k||A)&&this.options.parseMissingKeyHandler&&(y="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(f,":").concat(c):c,A?y:void 0):this.options.parseMissingKeyHandler(y))}return i?(v.res=y,v):y}},{key:"extendTranslation",value:function(t,e,n,r,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,V(V({},this.options.interpolation.defaultVariables),n),r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(V(V({},n),{interpolation:V(V({},this.options.interpolation),n.interpolation)}));var a,u="string"==typeof t&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(u){var s=t.match(this.interpolator.nestingRegexp);a=s&&s.length}var c=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(c=V(V({},this.options.interpolation.defaultVariables),c)),t=this.interpolator.interpolate(t,c,n.lng||this.language,n),u){var l=t.match(this.interpolator.nestingRegexp);a<(l&&l.length)&&(n.nest=!1)}!1!==n.nest&&(t=this.interpolator.nest(t,(function(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return o&&o[0]===r[0]&&!n.context?(i.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(e[0])),null):i.translate.apply(i,r.concat([e]))}),n)),n.interpolation&&this.interpolator.reset()}var f=n.postProcess||this.options.postProcess,h="string"==typeof f?[f]:f;return null!=t&&h&&h.length&&!1!==n.applyPostProcessor&&(t=F.handle(h,t,e,this.options&&this.options.postProcessPassResolved?V({i18nResolved:r},n):n,this)),t}},{key:"resolve",value:function(t){var e,n,r,o,i,a=this,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof t&&(t=[t]),t.forEach((function(t){if(!a.isValidLookup(e)){var s=a.extractFromKey(t,u),c=s.key;n=c;var l=s.namespaces;a.options.fallbackNS&&(l=l.concat(a.options.fallbackNS));var f=void 0!==u.count&&"string"!=typeof u.count,h=f&&!u.ordinal&&0===u.count&&a.pluralResolver.shouldUseIntlApi(),p=void 0!==u.context&&("string"==typeof u.context||"number"==typeof u.context)&&""!==u.context,d=u.lngs?u.lngs:a.languageUtils.toResolveHierarchy(u.lng||a.language,u.fallbackLng);l.forEach((function(t){a.isValidLookup(e)||(i=t,!H["".concat(d[0],"-").concat(t)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(i)&&(H["".concat(d[0],"-").concat(t)]=!0,a.logger.warn('key "'.concat(n,'" for languages "').concat(d.join(", "),'" won\'t get resolved as namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),d.forEach((function(n){if(!a.isValidLookup(e)){o=n;var i,s=[c];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(s,c,n,t,u);else{var l;f&&(l=a.pluralResolver.getSuffix(n,u.count,u));var d="".concat(a.options.pluralSeparator,"zero");if(f&&(s.push(c+l),h&&s.push(c+d)),p){var v="".concat(c).concat(a.options.contextSeparator).concat(u.context);s.push(v),f&&(s.push(v+l),h&&s.push(v+d))}}for(;i=s.pop();)a.isValidLookup(e)||(r=i,e=a.getResource(n,t,i,u))}})))}))}})),{res:e,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:i}}},{key:"isValidLookup",value:function(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)}},{key:"getResource",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,e,n,r):this.resourceStore.getResource(t,e,n,r)}}],[{key:"hasDefaultValue",value:function(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&"defaultValue"===e.substring(0,12)&&void 0!==t[e])return!0;return!1}}]),o}(E);function W(t){return t.charAt(0).toUpperCase()+t.slice(1)}var K=function(){function t(e){(0,s.A)(this,t),this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=O.create("languageUtils")}return(0,c.A)(t,[{key:"getScriptPartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return null;var e=t.split("-");return 2===e.length?null:(e.pop(),"x"===e[e.length-1].toLowerCase()?null:this.formatLanguageCode(e.join("-")))}},{key:"getLanguagePartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return t;var e=t.split("-");return this.formatLanguageCode(e[0])}},{key:"formatLanguageCode",value:function(t){if("string"==typeof t&&t.indexOf("-")>-1){var e=["hans","hant","latn","cyrl","cans","mong","arab"],n=t.split("-");return this.options.lowerCaseLng?n=n.map((function(t){return t.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),e.indexOf(n[1].toLowerCase())>-1&&(n[1]=W(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),e.indexOf(n[1].toLowerCase())>-1&&(n[1]=W(n[1].toLowerCase())),e.indexOf(n[2].toLowerCase())>-1&&(n[2]=W(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}},{key:"isSupportedCode",value:function(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}},{key:"getBestMatchFromCodes",value:function(t){var e,n=this;return t?(t.forEach((function(t){if(!e){var r=n.formatLanguageCode(t);n.options.supportedLngs&&!n.isSupportedCode(r)||(e=r)}})),!e&&this.options.supportedLngs&&t.forEach((function(t){if(!e){var r=n.getLanguagePartFromCode(t);if(n.isSupportedCode(r))return e=r;e=n.options.supportedLngs.find((function(t){if(0===t.indexOf(r))return t}))}})),e||(e=this.getFallbackCodes(this.options.fallbackLng)[0]),e):null}},{key:"getFallbackCodes",value:function(t,e){if(!t)return[];if("function"==typeof t&&(t=t(e)),"string"==typeof t&&(t=[t]),"[object Array]"===Object.prototype.toString.apply(t))return t;if(!e)return t.default||[];var n=t[e];return n||(n=t[this.getScriptPartFromCode(e)]),n||(n=t[this.formatLanguageCode(e)]),n||(n=t[this.getLanguagePartFromCode(e)]),n||(n=t.default),n||[]}},{key:"toResolveHierarchy",value:function(t,e){var n=this,r=this.getFallbackCodes(e||this.options.fallbackLng||[],t),o=[],i=function(t){t&&(n.isSupportedCode(t)?o.push(t):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(t)))};return"string"==typeof t&&t.indexOf("-")>-1?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(t))):"string"==typeof t&&i(this.formatLanguageCode(t)),r.forEach((function(t){o.indexOf(t)<0&&i(n.formatLanguageCode(t))})),o}}]),t}(),$=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],q={1:function(t){return Number(t>1)},2:function(t){return Number(1!=t)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(0==t?0:1==t?1:2==t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(1==t?0:t>=2&&t<=4?1:2)},7:function(t){return Number(1==t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(1==t?0:2==t?1:8!=t&&11!=t?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(1==t?0:2==t?1:t<7?2:t<11?3:4)},11:function(t){return Number(1==t||11==t?0:2==t||12==t?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(0!==t)},14:function(t){return Number(1==t?0:2==t?1:3==t?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:0!==t?1:2)},17:function(t){return Number(1==t||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(0==t?0:1==t?1:2)},19:function(t){return Number(1==t?0:0==t||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(1==t?0:0==t||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(1==t?0:2==t?1:(t<0||t>10)&&t%10==0?2:3)}},J=["v1","v2","v3"],Y={zero:0,one:1,two:2,few:3,many:4,other:5},Q=function(){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,s.A)(this,t),this.languageUtils=e,this.options=r,this.logger=O.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=(n={},$.forEach((function(t){t.lngs.forEach((function(e){n[e]={numbers:t.nr,plurals:q[t.fc]}}))})),n)}return(0,c.A)(t,[{key:"addRule",value:function(t,e){this.rules[t]=e}},{key:"getRule",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(t,{type:e.ordinal?"ordinal":"cardinal"})}catch(t){return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}},{key:"needsPlural",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(t,e);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(t,n).map((function(t){return"".concat(e).concat(t)}))}},{key:"getSuffixes",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((function(t,e){return Y[t]-Y[e]})).map((function(t){return"".concat(e.options.prepend).concat(t)})):r.numbers.map((function(r){return e.getSuffix(t,r,n)})):[]}},{key:"getSuffix",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(t,n);return r?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(r.select(e)):this.getSuffixRetroCompatible(r,e):(this.logger.warn("no plural rule found for: ".concat(t)),"")}},{key:"getSuffixRetroCompatible",value:function(t,e){var n=this,r=t.noAbs?t.plurals(e):t.plurals(Math.abs(e)),o=t.numbers[r];this.options.simplifyPluralSuffix&&2===t.numbers.length&&1===t.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var i=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):i():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===t.numbers.length&&1===t.numbers[0]?i():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}},{key:"shouldUseIntlApi",value:function(){return!J.includes(this.options.compatibilityJSON)}}]),t}();function X(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Z(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?X(Object(n),!0).forEach((function(e){(0,v.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var tt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,s.A)(this,t),this.logger=O.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||function(t){return t},this.init(e)}return(0,c.A)(t,[{key:"init",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});var e=t.interpolation;this.escape=void 0!==e.escape?e.escape:M,this.escapeValue=void 0===e.escapeValue||e.escapeValue,this.useRawValueToEscape=void 0!==e.useRawValueToEscape&&e.useRawValueToEscape,this.prefix=e.prefix?C(e.prefix):e.prefixEscaped||"{{",this.suffix=e.suffix?C(e.suffix):e.suffixEscaped||"}}",this.formatSeparator=e.formatSeparator?e.formatSeparator:e.formatSeparator||",",this.unescapePrefix=e.unescapeSuffix?"":e.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":e.unescapeSuffix||"",this.nestingPrefix=e.nestingPrefix?C(e.nestingPrefix):e.nestingPrefixEscaped||C("$t("),this.nestingSuffix=e.nestingSuffix?C(e.nestingSuffix):e.nestingSuffixEscaped||C(")"),this.nestingOptionsSeparator=e.nestingOptionsSeparator?e.nestingOptionsSeparator:e.nestingOptionsSeparator||",",this.maxReplaces=e.maxReplaces?e.maxReplaces:1e3,this.alwaysFormat=void 0!==e.alwaysFormat&&e.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var t="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(t,"g");var e="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(e,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(t,e,n,r){var o,i,a,u=this,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(t){return t.replace(/\$/g,"$$$$")}var l=function(t){if(t.indexOf(u.formatSeparator)<0){var o=k(e,s,t);return u.alwaysFormat?u.format(o,void 0,n,Z(Z(Z({},r),e),{},{interpolationkey:t})):o}var i=t.split(u.formatSeparator),a=i.shift().trim(),c=i.join(u.formatSeparator).trim();return u.format(k(e,s,a),c,n,Z(Z(Z({},r),e),{},{interpolationkey:a}))};this.resetRegExp();var f=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,h=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(t){return c(t)}},{regex:this.regexp,safeValue:function(t){return u.escapeValue?c(u.escape(t)):c(t)}}].forEach((function(e){for(a=0;o=e.regex.exec(t);){var n=o[1].trim();if(void 0===(i=l(n)))if("function"==typeof f){var s=f(t,o,r);i="string"==typeof s?s:""}else if(r&&r.hasOwnProperty(n))i="";else{if(h){i=o[0];continue}u.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(t)),i=""}else"string"==typeof i||u.useRawValueToEscape||(i=j(i));var c=e.safeValue(i);if(t=t.replace(o[0],c),h?(e.regex.lastIndex+=i.length,e.regex.lastIndex-=o[0].length):e.regex.lastIndex=0,++a>=u.maxReplaces)break}})),t}},{key:"nest",value:function(t,e){var n,r,o=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=Z({},i);function u(t,e){var n=this.nestingOptionsSeparator;if(t.indexOf(n)<0)return t;var r=t.split(new RegExp("".concat(n,"[ ]*{"))),o="{".concat(r[1]);t=r[0];var i=(o=this.interpolate(o,a)).match(/'/g),u=o.match(/"/g);(i&&i.length%2==0&&!u||u.length%2!=0)&&(o=o.replace(/'/g,'"'));try{a=JSON.parse(o),e&&(a=Z(Z({},e),a))}catch(e){return this.logger.warn("failed parsing options string in nesting for key ".concat(t),e),"".concat(t).concat(n).concat(o)}return delete a.defaultValue,t}for(a.applyPostProcessor=!1,delete a.defaultValue;n=this.nestingRegexp.exec(t);){var s=[],c=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var l=n[1].split(this.formatSeparator).map((function(t){return t.trim()}));n[1]=l.shift(),s=l,c=!0}if((r=e(u.call(this,n[1].trim(),a),a))&&n[0]===t&&"string"!=typeof r)return r;"string"!=typeof r&&(r=j(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(t)),r=""),c&&(r=s.reduce((function(t,e){return o.format(t,e,i.lng,Z(Z({},i),{},{interpolationkey:n[1].trim()}))}),r.trim())),t=t.replace(n[0],r),this.regexp.lastIndex=0}return t}}]),t}();function et(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function nt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?et(Object(n),!0).forEach((function(e){(0,v.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):et(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function rt(t){var e={};return function(n,r,o){var i=r+JSON.stringify(o),a=e[i];return a||(a=t(r,o),e[i]=a),a(n)}}var ot=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,s.A)(this,t),this.logger=O.create("formatter"),this.options=e,this.formats={number:rt((function(t,e){var n=new Intl.NumberFormat(t,e);return function(t){return n.format(t)}})),currency:rt((function(t,e){var n=new Intl.NumberFormat(t,nt(nt({},e),{},{style:"currency"}));return function(t){return n.format(t)}})),datetime:rt((function(t,e){var n=new Intl.DateTimeFormat(t,nt({},e));return function(t){return n.format(t)}})),relativetime:rt((function(t,e){var n=new Intl.RelativeTimeFormat(t,nt({},e));return function(t){return n.format(t,e.range||"day")}})),list:rt((function(t,e){var n=new Intl.ListFormat(t,nt({},e));return function(t){return n.format(t)}}))},this.init(e)}return(0,c.A)(t,[{key:"init",value:function(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=e.formatSeparator?e.formatSeparator:e.formatSeparator||","}},{key:"add",value:function(t,e){this.formats[t.toLowerCase().trim()]=e}},{key:"addCached",value:function(t,e){this.formats[t.toLowerCase().trim()]=rt(e)}},{key:"format",value:function(t,e,n,r){var o=this;return e.split(this.formatSeparator).reduce((function(t,e){var i=function(t){var e=t.toLowerCase().trim(),n={};if(t.indexOf("(")>-1){var r=t.split("(");e=r[0].toLowerCase().trim();var o=r[1].substring(0,r[1].length-1);"currency"===e&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===e&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach((function(t){if(t){var e=(i=t.split(":"),(0,y.A)(i)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(i)||(0,m.A)(i)||(0,g.A)()),r=e[0],o=e.slice(1).join(":").trim().replace(/^'+|'+$/g,"");n[r.trim()]||(n[r.trim()]=o),"false"===o&&(n[r.trim()]=!1),"true"===o&&(n[r.trim()]=!0),isNaN(o)||(n[r.trim()]=parseInt(o,10))}var i}))}return{formatName:e,formatOptions:n}}(e),a=i.formatName,u=i.formatOptions;if(o.formats[a]){var s=t;try{var c=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},l=c.locale||c.lng||r.locale||r.lng||n;s=o.formats[a](t,l,nt(nt(nt({},u),r),c))}catch(t){o.logger.warn(t)}return s}return o.logger.warn("there was no format function for ".concat(a)),t}),t)}}]),t}();function it(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function at(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?it(Object(n),!0).forEach((function(e){(0,v.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):it(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ut=function(t){h(o,t);var e,n,r=(e=o,n=function(){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(t){return!1}}(),function(){var t,r=d(e);if(n){var o=d(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return p(this,t)});function o(t,e,n){var i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return(0,s.A)(this,o),i=r.call(this),D&&E.call((0,l.A)(i)),i.backend=t,i.store=e,i.services=n,i.languageUtils=n.languageUtils,i.options=a,i.logger=O.create("backendConnector"),i.waitingReads=[],i.maxParallelReads=a.maxParallelReads||10,i.readingCalls=0,i.maxRetries=a.maxRetries>=0?a.maxRetries:5,i.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(n,a.backend,a),i}return(0,c.A)(o,[{key:"queueLoad",value:function(t,e,n,r){var o=this,i={},a={},u={},s={};return t.forEach((function(t){var r=!0;e.forEach((function(e){var u="".concat(t,"|").concat(e);!n.reload&&o.store.hasResourceBundle(t,e)?o.state[u]=2:o.state[u]<0||(1===o.state[u]?void 0===a[u]&&(a[u]=!0):(o.state[u]=1,r=!1,void 0===a[u]&&(a[u]=!0),void 0===i[u]&&(i[u]=!0),void 0===s[e]&&(s[e]=!0)))})),r||(u[t]=!0)})),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(u),toLoadNamespaces:Object.keys(s)}}},{key:"loaded",value:function(t,e,n){var r=t.split("|"),o=r[0],i=r[1];e&&this.emit("failedLoading",o,i,e),n&&this.store.addResourceBundle(o,i,n),this.state[t]=e?-1:2;var a={};this.queue.forEach((function(n){var r,u,s,c,l;r=n.loaded,u=i,(c=(s=P(r,[o],Object)).obj)[l=s.k]=c[l]||[],c[l].push(u),function(t,e){void 0!==t.pending[e]&&(delete t.pending[e],t.pendingCount--)}(n,t),e&&n.errors.push(e),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((function(t){a[t]||(a[t]={});var e=n.loaded[t];e.length&&e.forEach((function(e){void 0===a[t][e]&&(a[t][e]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(t){return!t.done}))}},{key:"read",value:function(t,e,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;return t.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:t,ns:e,fcName:n,tried:o,wait:i,callback:a}):(this.readingCalls++,this.backend[n](t,e,(function(u,s){if(r.readingCalls--,r.waitingReads.length>0){var c=r.waitingReads.shift();r.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}u&&s&&o<r.maxRetries?setTimeout((function(){r.read.call(r,t,e,n,o+1,2*i,a)}),i):a(u,s)}))):a(null,{})}},{key:"prepareLoading",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();"string"==typeof t&&(t=this.languageUtils.toResolveHierarchy(t)),"string"==typeof e&&(e=[e]);var i=this.queueLoad(t,e,r,o);if(!i.toLoad.length)return i.pending.length||o(),null;i.toLoad.forEach((function(t){n.loadOne(t)}))}},{key:"load",value:function(t,e,n){this.prepareLoading(t,e,{},n)}},{key:"reload",value:function(t,e,n){this.prepareLoading(t,e,{reload:!0},n)}},{key:"loadOne",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=t.split("|"),o=r[0],i=r[1];this.read(o,i,"read",void 0,void 0,(function(r,a){r&&e.logger.warn("".concat(n,"loading namespace ").concat(i," for language ").concat(o," failed"),r),!r&&a&&e.logger.log("".concat(n,"loaded namespace ").concat(i," for language ").concat(o),a),e.loaded(t,r,a)}))}},{key:"saveMissing",value:function(t,e,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(e)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(e,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(t,e,n,r,null,at(at({},i),{},{isUpdate:o})),t&&t[0]&&this.store.addResource(t[0],e,n,r))}}]),o}(E);function st(t){return"string"==typeof t.ns&&(t.ns=[t.ns]),"string"==typeof t.fallbackLng&&(t.fallbackLng=[t.fallbackLng]),"string"==typeof t.fallbackNS&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function ct(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function lt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ct(Object(n),!0).forEach((function(e){(0,v.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ct(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ft(){}var ht=function(t){h(o,t);var e,n,r=(e=o,n=function(){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(t){return!1}}(),function(){var t,r=d(e);if(n){var o=d(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return p(this,t)});function o(){var t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if((0,s.A)(this,o),t=r.call(this),D&&E.call((0,l.A)(t)),t.options=st(n),t.services={},t.logger=O,t.modules={external:[]},e=(0,l.A)(t),Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))})),i&&!t.isInitialized&&!n.isClone){if(!t.options.initImmediate)return t.init(n,i),p(t,(0,l.A)(t));setTimeout((function(){t.init(n,i)}),0)}return t}return(0,c.A)(o,[{key:"init",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof e&&(n=e,e={}),!e.defaultNS&&!1!==e.defaultNS&&e.ns&&("string"==typeof e.ns?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));var r={debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var e={};if("object"===(0,u.A)(t[1])&&(e=t[1]),"string"==typeof t[1]&&(e.defaultValue=t[1]),"string"==typeof t[2]&&(e.tDescription=t[2]),"object"===(0,u.A)(t[2])||"object"===(0,u.A)(t[3])){var n=t[3]||t[2];Object.keys(n).forEach((function(t){e[t]=n[t]}))}return e},interpolation:{escapeValue:!0,format:function(t,e,n,r){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}};function o(t){return t?"function"==typeof t?new t:t:null}if(this.options=lt(lt(lt({},r),this.options),st(e)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=lt(lt({},r.interpolation),this.options.interpolation)),void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator),!this.options.isClone){var i;this.modules.logger?O.init(o(this.modules.logger),this.options):O.init(null,this.options),this.modules.formatter?i=this.modules.formatter:"undefined"!=typeof Intl&&(i=ot);var a=new K(this.options);this.store=new B(this.options.resources,this.options);var s=this.services;s.logger=O,s.resourceStore=this.store,s.languageUtils=a,s.pluralResolver=new Q(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!i||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(s.formatter=o(i),s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new tt(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new ut(o(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];t.emit.apply(t,[e].concat(r))})),this.modules.languageDetector&&(s.languageDetector=o(this.modules.languageDetector),s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=o(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new G(this.services,this.options),this.translator.on("*",(function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];t.emit.apply(t,[e].concat(r))})),this.modules.external.forEach((function(e){e.init&&e.init(t)}))}if(this.format=this.options.interpolation.format,n||(n=ft),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&"dev"!==c[0]&&(this.options.lng=c[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((function(e){t[e]=function(){var n;return(n=t.store)[e].apply(n,arguments)}})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((function(e){t[e]=function(){var n;return(n=t.store)[e].apply(n,arguments),t}}));var l=x(),f=function(){var e=function(e,r){t.isInitialized&&!t.initializedStoreOnce&&t.logger.warn("init: i18next is already initialized. You should call init just once!"),t.isInitialized=!0,t.options.isClone||t.logger.log("initialized",t.options),t.emit("initialized",t.options),l.resolve(r),n(e,r)};if(t.languages&&"v1"!==t.options.compatibilityAPI&&!t.isInitialized)return e(null,t.t.bind(t));t.changeLanguage(t.options.lng,e)};return this.options.resources||!this.options.initImmediate?f():setTimeout(f,0),l}},{key:"loadResources",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ft,r="string"==typeof t?t:this.language;if("function"==typeof t&&(n=t),!this.options.resources||this.options.partialBundledLanguages){if(r&&"cimode"===r.toLowerCase())return n();var o=[],i=function(t){t&&e.services.languageUtils.toResolveHierarchy(t).forEach((function(t){o.indexOf(t)<0&&o.push(t)}))};r?i(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((function(t){return i(t)})),this.options.preload&&this.options.preload.forEach((function(t){return i(t)})),this.services.backendConnector.load(o,this.options.ns,(function(t){t||e.resolvedLanguage||!e.language||e.setResolvedLanguage(e.language),n(t)}))}else n(null)}},{key:"reloadResources",value:function(t,e,n){var r=x();return t||(t=this.languages),e||(e=this.options.ns),n||(n=ft),this.services.backendConnector.reload(t,e,(function(t){r.resolve(),n(t)})),r}},{key:"use",value:function(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&F.addPostProcessor(t),"formatter"===t.type&&(this.modules.formatter=t),"3rdParty"===t.type&&this.modules.external.push(t),this}},{key:"setResolvedLanguage",value:function(t){if(t&&this.languages&&!(["cimode","dev"].indexOf(t)>-1))for(var e=0;e<this.languages.length;e++){var n=this.languages[e];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}},{key:"changeLanguage",value:function(t,e){var n=this;this.isLanguageChangingTo=t;var r=x();this.emit("languageChanging",t);var o=function(t){n.language=t,n.languages=n.services.languageUtils.toResolveHierarchy(t),n.resolvedLanguage=void 0,n.setResolvedLanguage(t)},i=function(i){t||i||!n.services.languageDetector||(i=[]);var a="string"==typeof i?i:n.services.languageUtils.getBestMatchFromCodes(i);a&&(n.language||o(a),n.translator.language||n.translator.changeLanguage(a),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(a)),n.loadResources(a,(function(t){!function(t,i){i?(o(i),n.translator.changeLanguage(i),n.isLanguageChangingTo=void 0,n.emit("languageChanged",i),n.logger.log("languageChanged",i)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),e&&e(t,(function(){return n.t.apply(n,arguments)}))}(t,a)}))};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(i):i(t):i(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(t,e,n){var r=this,o=function t(e,o){var i;if("object"!==(0,u.A)(o)){for(var a=arguments.length,s=new Array(a>2?a-2:0),c=2;c<a;c++)s[c-2]=arguments[c];i=r.options.overloadTranslationOptionHandler([e,o].concat(s))}else i=lt({},o);i.lng=i.lng||t.lng,i.lngs=i.lngs||t.lngs,i.ns=i.ns||t.ns,i.keyPrefix=i.keyPrefix||n||t.keyPrefix;var l=r.options.keySeparator||".",f=i.keyPrefix?"".concat(i.keyPrefix).concat(l).concat(e):e;return r.t(f,i)};return"string"==typeof t?o.lng=t:o.lngs=t,o.ns=e,o.keyPrefix=n,o}},{key:"t",value:function(){var t;return this.translator&&(t=this.translator).translate.apply(t,arguments)}},{key:"exists",value:function(){var t;return this.translator&&(t=this.translator).exists.apply(t,arguments)}},{key:"setDefaultNamespace",value:function(t){this.options.defaultNS=t}},{key:"hasLoadedNamespace",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.resolvedLanguage||this.languages[0],o=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(t,n){var r=e.services.backendConnector.state["".concat(t,"|").concat(n)];return-1===r||2===r};if(n.precheck){var u=n.precheck(this,a);if(void 0!==u)return u}return!(!this.hasResourceBundle(r,t)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!a(r,t)||o&&!a(i,t)))}},{key:"loadNamespaces",value:function(t,e){var n=this,r=x();return this.options.ns?("string"==typeof t&&(t=[t]),t.forEach((function(t){n.options.ns.indexOf(t)<0&&n.options.ns.push(t)})),this.loadResources((function(t){r.resolve(),e&&e(t)})),r):(e&&e(),Promise.resolve())}},{key:"loadLanguages",value:function(t,e){var n=x();"string"==typeof t&&(t=[t]);var r=this.options.preload||[],o=t.filter((function(t){return r.indexOf(t)<0}));return o.length?(this.options.preload=r.concat(o),this.loadResources((function(t){n.resolve(),e&&e(t)})),n):(e&&e(),Promise.resolve())}},{key:"dir",value:function(t){return t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),t?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(this.services.languageUtils.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr":"rtl"}},{key:"cloneInstance",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ft,r=lt(lt(lt({},this.options),e),{isClone:!0}),i=new o(r);return void 0===e.debug&&void 0===e.prefix||(i.logger=i.logger.clone(e)),["store","services","language"].forEach((function(e){i[e]=t[e]})),i.services=lt({},this.services),i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i.translator=new G(i.services,i.options),i.translator.on("*",(function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];i.emit.apply(i,[t].concat(n))})),i.init(r,n),i.translator.options=i.options,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),o}(E);(0,v.A)(ht,"createInstance",(function(){return new ht(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}));var pt=ht.createInstance();pt.createInstance=ht.createInstance,pt.createInstance,pt.init,pt.loadResources,pt.reloadResources,pt.use,pt.changeLanguage,pt.getFixedT,pt.t,pt.exists,pt.setDefaultNamespace,pt.hasLoadedNamespace,pt.loadNamespaces,pt.loadLanguages;const dt=pt;function vt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var yt=dt.default||dt;function mt(t,e,n,r){return yt.t(e,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){vt(t,e,n[e])}))}return t}({ns:t,defaultValue:n},r))}function gt(t,e,n){return a[t]?mt("core",t,null!=e?e:a[t],n):(console.error("O3 Core Translations does not provide key '".concat(t,"'. The key itself is being rendered as text.")),t)}yt.on("initialized",(function(){window.i18next.loadNamespaces(["core"])}))},2238:()=>{function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function r(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}function o(t,e,n){return o="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=i(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n||t):o.value}},o(t,e,n||t)}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&c(t,e)}function u(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}function s(t,e){return!e||"object"!==h(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function c(t,e){return c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},c(t,e)}function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t,e)||p(t,e)||function(){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 f(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||p(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 h(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}function p(e,n){if(e){if("string"==typeof e)return t(e,n);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)?t(e,n):void 0}}function d(t){var e=function(){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(t){return!1}}();return function(){var n,r=i(t);if(e){var o=i(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return s(this,n)}}System.register(["dayjs"],(function(t,n){var c={};return{setters:[function(t){c.default=t.default}],execute:function(){t(function(){var t={332:function(t){t.exports=function(){"use strict";return function(t,e,n){e.prototype.isToday=function(){var t="YYYY-MM-DD",e=n();return this.format(t)===e.format(t)}}}()},14:function(t){t.exports=function(){"use strict";var t="minute",e=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,o,i){var a=o.prototype;i.utc=function(t){return new o({date:t,utc:!0,args:arguments})},a.utc=function(e){var n=i(this.toDate(),{locale:this.$L,utc:!0});return e?n.add(this.utcOffset(),t):n},a.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var u=a.parse;a.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),u.call(this,t)};var s=a.init;a.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else s.call(this)};var c=a.utcOffset;a.utcOffset=function(r,o){var i=this.$utils().u;if(i(r))return this.$u?0:i(this.$offset)?c.call(this):this.$offset;if("string"==typeof r&&(r=function(t){void 0===t&&(t="");var r=t.match(e);if(!r)return null;var o=(""+r[0]).match(n)||["-",0,0],i=o[0],a=60*+o[1]+ +o[2];return 0===a?0:"+"===i?a:-a}(r),null===r))return this;var a=Math.abs(r)<=16?60*r:r,u=this;if(o)return u.$offset=a,u.$u=0===r,u;if(0!==r){var s=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(u=this.local().add(a+s,t)).$offset=a,u.$x.$localOffset=s}else u=this.utc();return u};var l=a.format;a.format=function(t){var e=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return l.call(this,e)},a.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var f=a.toDate;a.toDate=function(t){return"s"===t&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():f.call(this)};var h=a.diff;a.diff=function(t,e,n){if(t&&this.$u===t.$u)return h.call(this,t,e,n);var r=this.local(),o=i(t).local();return h.call(r,o,e,n)}}}()},257:function(t,n,o){var i=Symbol("SemVer ANY"),a=function(){"use strict";function t(n,r){if(e(this,t),r&&"object"==(void 0===r?"undefined":h(r))||(r={loose:!!r,includePrerelease:!1}),u(n,t)){if(n.loose===!!r.loose)return n;n=n.value}p("comparator",n,r),this.options=r,this.loose=!!r.loose,this.parse(n),this.semver===i?this.value="":this.value=this.operator+this.semver.version,p("comp",this)}return r(t,[{key:"parse",value:function(t){var e=this.options.loose?c[l.COMPARATORLOOSE]:c[l.COMPARATOR],n=t.match(e);if(!n)throw new TypeError("Invalid comparator: ".concat(t));this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new d(n[2],this.options.loose):this.semver=i}},{key:"toString",value:function(){return this.value}},{key:"test",value:function(t){if(p("Comparator.test",t,this.options.loose),this.semver===i||t===i)return!0;if("string"==typeof t)try{t=new d(t,this.options)}catch(t){return!1}return f(t,this.operator,this.semver,this.options)}},{key:"intersects",value:function(e,n){if(!u(e,t))throw new TypeError("a Comparator is required");if(n&&"object"==(void 0===n?"undefined":h(n))||(n={loose:!!n,includePrerelease:!1}),""===this.operator)return""===this.value||new v(e.value,n).test(this.value);if(""===e.operator)return""===e.value||new v(this.value,n).test(e.semver);var r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),s=f(this.semver,"<",e.semver,n)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=f(this.semver,">",e.semver,n)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||o||i&&a||s||c}}],[{key:"ANY",get:function(){return i}}]),t}();t.exports=a;var s=o(765),c=s.re,l=s.t,f=o(539),p=o(225),d=o(376),v=o(902)},902:function(t,n,o){var i=function(){"use strict";function t(n,r){var o=this;if(e(this,t),r&&"object"==(void 0===r?"undefined":h(r))||(r={loose:!!r,includePrerelease:!1}),u(n,t))return n.loose===!!r.loose&&n.includePrerelease===!!r.includePrerelease?n:new t(n.raw,r);if(u(n,a))return this.raw=n.value,this.set=[[n]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=n,this.set=n.split(/\s*\|\|\s*/).map((function(t){return o.parseRange(t.trim())})).filter((function(t){return t.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(n));this.format()}return r(t,[{key:"format",value:function(){return this.range=this.set.map((function(t){return t.join(" ").trim()})).join("||").trim(),this.range}},{key:"toString",value:function(){return this.range}},{key:"parseRange",value:function(t){var e=this,n=this.options.loose;t=t.trim();var r=n?f[p.HYPHENRANGELOOSE]:f[p.HYPHENRANGE];t=t.replace(r,A(this.options.includePrerelease)),s("hyphen replace",t),t=t.replace(f[p.COMPARATORTRIM],d),s("comparator trim",t,f[p.COMPARATORTRIM]),t=(t=(t=t.replace(f[p.TILDETRIM],v)).replace(f[p.CARETTRIM],y)).split(/\s+/).join(" ");var o=n?f[p.COMPARATORLOOSE]:f[p.COMPARATOR];return t.split(" ").map((function(t){return g(t,e.options)})).join(" ").split(/\s+/).map((function(t){return _(t,e.options)})).filter(this.options.loose?function(t){return!!t.match(o)}:function(){return!0}).map((function(t){return new a(t,e.options)}))}},{key:"intersects",value:function(e,n){if(!u(e,t))throw new TypeError("a Range is required");return this.set.some((function(t){return m(t,n)&&e.set.some((function(e){return m(e,n)&&t.every((function(t){return e.every((function(e){return t.intersects(e,n)}))}))}))}))}},{key:"test",value:function(t){if(!t)return!1;if("string"==typeof t)try{t=new c(t,this.options)}catch(t){return!1}for(var e=0;e<this.set.length;e++)if(k(this.set[e],t,this.options))return!0;return!1}}]),t}();t.exports=i;var a=o(257),s=o(225),c=o(376),l=o(765),f=l.re,p=l.t,d=l.comparatorTrimReplace,v=l.tildeTrimReplace,y=l.caretTrimReplace,m=function(t,e){for(var n=!0,r=t.slice(),o=r.pop();n&&r.length;)n=r.every((function(t){return o.intersects(t,e)})),o=r.pop();return n},g=function(t,e){return s("comp",t,e),t=O(t,e),s("caret",t),t=w(t,e),s("tildes",t),t=x(t,e),s("xrange",t),t=P(t,e),s("stars",t),t},b=function(t){return!t||"x"===t.toLowerCase()||"*"===t},w=function(t,e){return t.trim().split(/\s+/).map((function(t){return S(t,e)})).join(" ")},S=function(t,e){var n=e.loose?f[p.TILDELOOSE]:f[p.TILDE];return t.replace(n,(function(e,n,r,o,i){var a;return s("tilde",t,e,n,r,o,i),b(n)?a="":b(r)?a=">=".concat(n,".0.0 <").concat(+n+1,".0.0-0"):b(o)?a=">=".concat(n,".").concat(r,".0 <").concat(n,".").concat(+r+1,".0-0"):i?(s("replaceTilde pr",i),a=">=".concat(n,".").concat(r,".").concat(o,"-").concat(i," <").concat(n,".").concat(+r+1,".0-0")):a=">=".concat(n,".").concat(r,".").concat(o," <").concat(n,".").concat(+r+1,".0-0"),s("tilde return",a),a}))},O=function(t,e){return t.trim().split(/\s+/).map((function(t){return E(t,e)})).join(" ")},E=function(t,e){s("caret",t,e);var n=e.loose?f[p.CARETLOOSE]:f[p.CARET],r=e.includePrerelease?"-0":"";return t.replace(n,(function(e,n,o,i,a){var u;return s("caret",t,e,n,o,i,a),b(n)?u="":b(o)?u=">=".concat(n,".0.0").concat(r," <").concat(+n+1,".0.0-0"):b(i)?u="0"===n?">=".concat(n,".").concat(o,".0").concat(r," <").concat(n,".").concat(+o+1,".0-0"):">=".concat(n,".").concat(o,".0").concat(r," <").concat(+n+1,".0.0-0"):a?(s("replaceCaret pr",a),u="0"===n?"0"===o?">=".concat(n,".").concat(o,".").concat(i,"-").concat(a," <").concat(n,".").concat(o,".").concat(+i+1,"-0"):">=".concat(n,".").concat(o,".").concat(i,"-").concat(a," <").concat(n,".").concat(+o+1,".0-0"):">=".concat(n,".").concat(o,".").concat(i,"-").concat(a," <").concat(+n+1,".0.0-0")):(s("no pr"),u="0"===n?"0"===o?">=".concat(n,".").concat(o,".").concat(i).concat(r," <").concat(n,".").concat(o,".").concat(+i+1,"-0"):">=".concat(n,".").concat(o,".").concat(i).concat(r," <").concat(n,".").concat(+o+1,".0-0"):">=".concat(n,".").concat(o,".").concat(i," <").concat(+n+1,".0.0-0")),s("caret return",u),u}))},x=function(t,e){return s("replaceXRanges",t,e),t.split(/\s+/).map((function(t){return j(t,e)})).join(" ")},j=function(t,e){t=t.trim();var n=e.loose?f[p.XRANGELOOSE]:f[p.XRANGE];return t.replace(n,(function(n,r,o,i,a,u){s("xRange",t,n,r,o,i,a,u);var c=b(o),l=c||b(i),f=l||b(a),h=f;return"="===r&&h&&(r=""),u=e.includePrerelease?"-0":"",c?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&h?(l&&(i=0),a=0,">"===r?(r=">=",l?(o=+o+1,i=0,a=0):(i=+i+1,a=0)):"<="===r&&(r="<",l?o=+o+1:i=+i+1),"<"===r&&(u="-0"),n="".concat(r+o,".").concat(i,".").concat(a).concat(u)):l?n=">=".concat(o,".0.0").concat(u," <").concat(+o+1,".0.0-0"):f&&(n=">=".concat(o,".").concat(i,".0").concat(u," <").concat(o,".").concat(+i+1,".0-0")),s("xRange return",n),n}))},P=function(t,e){return s("replaceStars",t,e),t.trim().replace(f[p.STAR],"")},_=function(t,e){return s("replaceGTE0",t,e),t.trim().replace(f[e.includePrerelease?p.GTE0PRE:p.GTE0],"")},A=function(t){return function(e,n,r,o,i,a,u,s,c,l,f,h,p){return"".concat(n=b(r)?"":b(o)?">=".concat(r,".0.0").concat(t?"-0":""):b(i)?">=".concat(r,".").concat(o,".0").concat(t?"-0":""):a?">=".concat(n):">=".concat(n).concat(t?"-0":"")," ").concat(s=b(c)?"":b(l)?"<".concat(+c+1,".0.0-0"):b(f)?"<".concat(c,".").concat(+l+1,".0-0"):h?"<=".concat(c,".").concat(l,".").concat(f,"-").concat(h):t?"<".concat(c,".").concat(l,".").concat(+f+1,"-0"):"<=".concat(s)).trim()}},k=function(t,e,n){for(var r=0;r<t.length;r++)if(!t[r].test(e))return!1;if(e.prerelease.length&&!n.includePrerelease){for(var o=0;o<t.length;o++)if(s(t[o].semver),t[o].semver!==a.ANY&&t[o].semver.prerelease.length>0){var i=t[o].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}},376:function(t,n,o){var i=o(225),a=o(295),s=a.MAX_LENGTH,c=a.MAX_SAFE_INTEGER,l=o(765),f=l.re,p=l.t,d=o(742).compareIdentifiers,v=function(){"use strict";function t(n,r){if(e(this,t),r&&"object"==(void 0===r?"undefined":h(r))||(r={loose:!!r,includePrerelease:!1}),u(n,t)){if(n.loose===!!r.loose&&n.includePrerelease===!!r.includePrerelease)return n;n=n.version}else if("string"!=typeof n)throw new TypeError("Invalid Version: ".concat(n));if(n.length>s)throw new TypeError("version is longer than ".concat(s," characters"));i("SemVer",n,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;var o=n.trim().match(r.loose?f[p.LOOSE]:f[p.FULL]);if(!o)throw new TypeError("Invalid Version: ".concat(n));if(this.raw=n,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>c||this.major<0)throw new TypeError("Invalid major version");if(this.minor>c||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>c||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map((function(t){if(/^[0-9]+$/.test(t)){var e=+t;if(e>=0&&e<c)return e}return t})):this.prerelease=[],this.build=o[5]?o[5].split("."):[],this.format()}return r(t,[{key:"format",value:function(){return this.version="".concat(this.major,".").concat(this.minor,".").concat(this.patch),this.prerelease.length&&(this.version+="-".concat(this.prerelease.join("."))),this.version}},{key:"toString",value:function(){return this.version}},{key:"compare",value:function(e){if(i("SemVer.compare",this.version,this.options,e),!u(e,t)){if("string"==typeof e&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}},{key:"compareMain",value:function(e){return u(e,t)||(e=new t(e,this.options)),d(this.major,e.major)||d(this.minor,e.minor)||d(this.patch,e.patch)}},{key:"comparePre",value:function(e){if(u(e,t)||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;var n=0;do{var r=this.prerelease[n],o=e.prerelease[n];if(i("prerelease compare",n,r,o),void 0===r&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===r)return-1;if(r!==o)return d(r,o)}while(++n)}},{key:"compareBuild",value:function(e){u(e,t)||(e=new t(e,this.options));var n=0;do{var r=this.build[n],o=e.build[n];if(i("prerelease compare",n,r,o),void 0===r&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===r)return-1;if(r!==o)return d(r,o)}while(++n)}},{key:"inc",value:function(t,e){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",e);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",e);break;case"prepatch":this.prerelease.length=0,this.inc("patch",e),this.inc("pre",e);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",e),this.inc("pre",e);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var n=this.prerelease.length;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error("invalid increment argument: ".concat(t))}return this.format(),this.raw=this.version,this}}]),t}();t.exports=v},507:function(t,e,n){var r=n(959);t.exports=function(t,e){var n=r(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null}},539:function(t,e,n){var r=n(718),o=n(194),i=n(312),a=n(903),u=n(544),s=n(56);t.exports=function(t,e,n,c){switch(e){case"===":return"object"==(void 0===t?"undefined":h(t))&&(t=t.version),"object"==(void 0===n?"undefined":h(n))&&(n=n.version),t===n;case"!==":return"object"==(void 0===t?"undefined":h(t))&&(t=t.version),"object"==(void 0===n?"undefined":h(n))&&(n=n.version),t!==n;case"":case"=":case"==":return r(t,n,c);case"!=":return o(t,n,c);case">":return i(t,n,c);case">=":return a(t,n,c);case"<":return u(t,n,c);case"<=":return s(t,n,c);default:throw new TypeError("Invalid operator: ".concat(e))}}},38:function(t,e,n){var r=n(376),o=n(959),i=n(765),a=i.re,s=i.t;t.exports=function(t,e){if(u(t,r))return t;if("number"==typeof t&&(t=String(t)),"string"!=typeof t)return null;var n=null;if((e=e||{}).rtl){for(var i;(i=a[s.COERCERTL].exec(t))&&(!n||n.index+n[0].length!==t.length);)n&&i.index+i[0].length===n.index+n[0].length||(n=i),a[s.COERCERTL].lastIndex=i.index+i[1].length+i[2].length;a[s.COERCERTL].lastIndex=-1}else n=t.match(a[s.COERCE]);return null===n?null:o("".concat(n[2],".").concat(n[3]||"0",".").concat(n[4]||"0"),e)}},773:function(t,e,n){var r=n(376);t.exports=function(t,e,n){var o=new r(t,n),i=new r(e,n);return o.compare(i)||o.compareBuild(i)}},880:function(t,e,n){var r=n(269);t.exports=function(t,e){return r(t,e,!0)}},269:function(t,e,n){var r=n(376);t.exports=function(t,e,n){return new r(t,n).compare(new r(e,n))}},378:function(t,e,n){var r=n(959),o=n(718);t.exports=function(t,e){if(o(t,e))return null;var n=r(t),i=r(e),a=n.prerelease.length||i.prerelease.length,u=a?"pre":"",s=a?"prerelease":"";for(var c in n)if(("major"===c||"minor"===c||"patch"===c)&&n[c]!==i[c])return u+c;return s}},718:function(t,e,n){var r=n(269);t.exports=function(t,e,n){return 0===r(t,e,n)}},312:function(t,e,n){var r=n(269);t.exports=function(t,e,n){return r(t,e,n)>0}},903:function(t,e,n){var r=n(269);t.exports=function(t,e,n){return r(t,e,n)>=0}},253:function(t,e,n){var r=n(376);t.exports=function(t,e,n,o){"string"==typeof n&&(o=n,n=void 0);try{return new r(t,n).inc(e,o).version}catch(t){return null}}},544:function(t,e,n){var r=n(269);t.exports=function(t,e,n){return r(t,e,n)<0}},56:function(t,e,n){var r=n(269);t.exports=function(t,e,n){return r(t,e,n)<=0}},679:function(t,e,n){var r=n(376);t.exports=function(t,e){return new r(t,e).major}},789:function(t,e,n){var r=n(376);t.exports=function(t,e){return new r(t,e).minor}},194:function(t,e,n){var r=n(269);t.exports=function(t,e,n){return 0!==r(t,e,n)}},959:function(t,e,n){var r=n(295).MAX_LENGTH,o=n(765),i=o.re,a=o.t,s=n(376);t.exports=function(t,e){if(e&&"object"==(void 0===e?"undefined":h(e))||(e={loose:!!e,includePrerelease:!1}),u(t,s))return t;if("string"!=typeof t)return null;if(t.length>r)return null;if(!(e.loose?i[a.LOOSE]:i[a.FULL]).test(t))return null;try{return new s(t,e)}catch(t){return null}}},358:function(t,e,n){var r=n(376);t.exports=function(t,e){return new r(t,e).patch}},559:function(t,e,n){var r=n(959);t.exports=function(t,e){var n=r(t,e);return n&&n.prerelease.length?n.prerelease:null}},795:function(t,e,n){var r=n(269);t.exports=function(t,e,n){return r(e,t,n)}},657:function(t,e,n){var r=n(773);t.exports=function(t,e){return t.sort((function(t,n){return r(n,t,e)}))}},712:function(t,e,n){var r=n(902);t.exports=function(t,e,n){try{e=new r(e,n)}catch(t){return!1}return e.test(t)}},100:function(t,e,n){var r=n(773);t.exports=function(t,e){return t.sort((function(t,n){return r(t,n,e)}))}},397:function(t,e,n){var r=n(959);t.exports=function(t,e){var n=r(t,e);return n?n.version:null}},249:function(t,e,n){var r=n(765);t.exports={re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:n(295).SEMVER_SPEC_VERSION,SemVer:n(376),compareIdentifiers:n(742).compareIdentifiers,rcompareIdentifiers:n(742).rcompareIdentifiers,parse:n(959),valid:n(397),clean:n(507),inc:n(253),diff:n(378),major:n(679),minor:n(789),patch:n(358),prerelease:n(559),compare:n(269),rcompare:n(795),compareLoose:n(880),compareBuild:n(773),sort:n(100),rsort:n(657),gt:n(312),lt:n(544),eq:n(718),neq:n(194),gte:n(903),lte:n(56),cmp:n(539),coerce:n(38),Comparator:n(257),Range:n(902),satisfies:n(712),toComparators:n(42),maxSatisfying:n(775),minSatisfying:n(649),minVersion:n(316),validRange:n(230),outside:n(826),gtr:n(606),ltr:n(32),intersects:n(937),simplifyRange:n(908),subset:n(799)}},295:function(t){var e=Number.MAX_SAFE_INTEGER||9007199254740991;t.exports={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:e,MAX_SAFE_COMPONENT_LENGTH:16}},225:function(t){var e,n="object"==("undefined"==typeof process?"undefined":h(process))&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=console).error.apply(e,["SEMVER"].concat(f(n)))}:function(){};t.exports=n},742:function(t){var e=/^[0-9]+$/,n=function(t,n){var r=e.test(t),o=e.test(n);return r&&o&&(t=+t,n=+n),t===n?0:r&&!o?-1:o&&!r?1:t<n?-1:1};t.exports={compareIdentifiers:n,rcompareIdentifiers:function(t,e){return n(e,t)}}},765:function(t,e,n){var r=n(295).MAX_SAFE_COMPONENT_LENGTH,o=n(225),i=(e=t.exports={}).re=[],a=e.src=[],u=e.t={},s=0,c=function(t,e,n){var r=s++;o(r,e),u[t]=r,a[r]=e,i[r]=new RegExp(e,n?"g":void 0)};c("NUMERICIDENTIFIER","0|[1-9]\\d*"),c("NUMERICIDENTIFIERLOOSE","[0-9]+"),c("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),c("MAINVERSION","(".concat(a[u.NUMERICIDENTIFIER],")\\.(").concat(a[u.NUMERICIDENTIFIER],")\\.(").concat(a[u.NUMERICIDENTIFIER],")")),c("MAINVERSIONLOOSE","(".concat(a[u.NUMERICIDENTIFIERLOOSE],")\\.(").concat(a[u.NUMERICIDENTIFIERLOOSE],")\\.(").concat(a[u.NUMERICIDENTIFIERLOOSE],")")),c("PRERELEASEIDENTIFIER","(?:".concat(a[u.NUMERICIDENTIFIER],"|").concat(a[u.NONNUMERICIDENTIFIER],")")),c("PRERELEASEIDENTIFIERLOOSE","(?:".concat(a[u.NUMERICIDENTIFIERLOOSE],"|").concat(a[u.NONNUMERICIDENTIFIER],")")),c("PRERELEASE","(?:-(".concat(a[u.PRERELEASEIDENTIFIER],"(?:\\.").concat(a[u.PRERELEASEIDENTIFIER],")*))")),c("PRERELEASELOOSE","(?:-?(".concat(a[u.PRERELEASEIDENTIFIERLOOSE],"(?:\\.").concat(a[u.PRERELEASEIDENTIFIERLOOSE],")*))")),c("BUILDIDENTIFIER","[0-9A-Za-z-]+"),c("BUILD","(?:\\+(".concat(a[u.BUILDIDENTIFIER],"(?:\\.").concat(a[u.BUILDIDENTIFIER],")*))")),c("FULLPLAIN","v?".concat(a[u.MAINVERSION]).concat(a[u.PRERELEASE],"?").concat(a[u.BUILD],"?")),c("FULL","^".concat(a[u.FULLPLAIN],"$")),c("LOOSEPLAIN","[v=\\s]*".concat(a[u.MAINVERSIONLOOSE]).concat(a[u.PRERELEASELOOSE],"?").concat(a[u.BUILD],"?")),c("LOOSE","^".concat(a[u.LOOSEPLAIN],"$")),c("GTLT","((?:<|>)?=?)"),c("XRANGEIDENTIFIERLOOSE","".concat(a[u.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),c("XRANGEIDENTIFIER","".concat(a[u.NUMERICIDENTIFIER],"|x|X|\\*")),c("XRANGEPLAIN","[v=\\s]*(".concat(a[u.XRANGEIDENTIFIER],")(?:\\.(").concat(a[u.XRANGEIDENTIFIER],")(?:\\.(").concat(a[u.XRANGEIDENTIFIER],")(?:").concat(a[u.PRERELEASE],")?").concat(a[u.BUILD],"?)?)?")),c("XRANGEPLAINLOOSE","[v=\\s]*(".concat(a[u.XRANGEIDENTIFIERLOOSE],")(?:\\.(").concat(a[u.XRANGEIDENTIFIERLOOSE],")(?:\\.(").concat(a[u.XRANGEIDENTIFIERLOOSE],")(?:").concat(a[u.PRERELEASELOOSE],")?").concat(a[u.BUILD],"?)?)?")),c("XRANGE","^".concat(a[u.GTLT],"\\s*").concat(a[u.XRANGEPLAIN],"$")),c("XRANGELOOSE","^".concat(a[u.GTLT],"\\s*").concat(a[u.XRANGEPLAINLOOSE],"$")),c("COERCE","(^|[^\\d])(\\d{1,".concat(r,"})(?:\\.(\\d{1,").concat(r,"}))?(?:\\.(\\d{1,").concat(r,"}))?(?:$|[^\\d])")),c("COERCERTL",a[u.COERCE],!0),c("LONETILDE","(?:~>?)"),c("TILDETRIM","(\\s*)".concat(a[u.LONETILDE],"\\s+"),!0),e.tildeTrimReplace="$1~",c("TILDE","^".concat(a[u.LONETILDE]).concat(a[u.XRANGEPLAIN],"$")),c("TILDELOOSE","^".concat(a[u.LONETILDE]).concat(a[u.XRANGEPLAINLOOSE],"$")),c("LONECARET","(?:\\^)"),c("CARETTRIM","(\\s*)".concat(a[u.LONECARET],"\\s+"),!0),e.caretTrimReplace="$1^",c("CARET","^".concat(a[u.LONECARET]).concat(a[u.XRANGEPLAIN],"$")),c("CARETLOOSE","^".concat(a[u.LONECARET]).concat(a[u.XRANGEPLAINLOOSE],"$")),c("COMPARATORLOOSE","^".concat(a[u.GTLT],"\\s*(").concat(a[u.LOOSEPLAIN],")$|^$")),c("COMPARATOR","^".concat(a[u.GTLT],"\\s*(").concat(a[u.FULLPLAIN],")$|^$")),c("COMPARATORTRIM","(\\s*)".concat(a[u.GTLT],"\\s*(").concat(a[u.LOOSEPLAIN],"|").concat(a[u.XRANGEPLAIN],")"),!0),e.comparatorTrimReplace="$1$2$3",c("HYPHENRANGE","^\\s*(".concat(a[u.XRANGEPLAIN],")\\s+-\\s+(").concat(a[u.XRANGEPLAIN],")\\s*$")),c("HYPHENRANGELOOSE","^\\s*(".concat(a[u.XRANGEPLAINLOOSE],")\\s+-\\s+(").concat(a[u.XRANGEPLAINLOOSE],")\\s*$")),c("STAR","(<|>)?=?\\s*\\*"),c("GTE0","^\\s*>=\\s*0.0.0\\s*$"),c("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")},606:function(t,e,n){var r=n(826);t.exports=function(t,e,n){return r(t,e,">",n)}},937:function(t,e,n){var r=n(902);t.exports=function(t,e,n){return t=new r(t,n),e=new r(e,n),t.intersects(e)}},32:function(t,e,n){var r=n(826);t.exports=function(t,e,n){return r(t,e,"<",n)}},775:function(t,e,n){var r=n(376),o=n(902);t.exports=function(t,e,n){var i=null,a=null,u=null;try{u=new o(e,n)}catch(t){return null}return t.forEach((function(t){u.test(t)&&(i&&-1!==a.compare(t)||(a=new r(i=t,n)))})),i}},649:function(t,e,n){var r=n(376),o=n(902);t.exports=function(t,e,n){var i=null,a=null,u=null;try{u=new o(e,n)}catch(t){return null}return t.forEach((function(t){u.test(t)&&(i&&1!==a.compare(t)||(a=new r(i=t,n)))})),i}},316:function(t,e,n){var r=n(376),o=n(902),i=n(312);t.exports=function(t,e){t=new o(t,e);var n=new r("0.0.0");if(t.test(n))return n;if(n=new r("0.0.0-0"),t.test(n))return n;n=null;for(var a=0;a<t.set.length;++a)t.set[a].forEach((function(t){var e=new r(t.semver.version);switch(t.operator){case">":0===e.prerelease.length?e.patch++:e.prerelease.push(0),e.raw=e.format();case"":case">=":n&&!i(n,e)||(n=e);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: ".concat(t.operator))}}));return n&&t.test(n)?n:null}},826:function(t,e,n){var r=n(376),o=n(257),i=o.ANY,a=n(902),u=n(712),s=n(312),c=n(544),l=n(56),f=n(903);t.exports=function(t,e,n,p){var d,v,y,m,g,b=function(n){var r=e.set[n],a=null,u=null;return r.forEach((function(t){t.semver===i&&(t=new o(">=0.0.0")),a=a||t,u=u||t,d(t.semver,a.semver,p)?a=t:y(t.semver,u.semver,p)&&(u=t)})),a.operator===m||a.operator===g?{v:!1}:u.operator&&u.operator!==m||!v(t,u.semver)?u.operator===g&&y(t,u.semver)?{v:!1}:void 0:{v:!1}};switch(t=new r(t,p),e=new a(e,p),n){case">":d=s,v=l,y=c,m=">",g=">=";break;case"<":d=c,v=f,y=s,m="<",g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(u(t,e,p))return!1;for(var w=0;w<e.set.length;++w){var S=b(w);if("object"===h(S))return S.v}return!0}},908:function(t,e,n){var r=n(712),o=n(269);t.exports=function(t,e,n){var i=[],a=null,u=null,s=t.sort((function(t,e){return o(t,e,n)})),c=!0,f=!1,h=void 0;try{for(var p,d=s[Symbol.iterator]();!(c=(p=d.next()).done);c=!0){var v=p.value;r(v,e,n)?(u=v,a||(a=v)):(u&&i.push([a,u]),u=null,a=null)}}catch(t){f=!0,h=t}finally{try{c||null==d.return||d.return()}finally{if(f)throw h}}a&&i.push([a,null]);var y=[],m=!0,g=!1,b=void 0;try{for(var w,S=i[Symbol.iterator]();!(m=(w=S.next()).done);m=!0){var O=l(w.value,2),E=O[0],x=O[1];E===x?y.push(E):x||E!==s[0]?x?E===s[0]?y.push("<=".concat(x)):y.push("".concat(E," - ").concat(x)):y.push(">=".concat(E)):y.push("*")}}catch(t){g=!0,b=t}finally{try{m||null==S.return||S.return()}finally{if(g)throw b}}var j=y.join(" || "),P="string"==typeof e.raw?e.raw:String(e);return j.length<P.length?j:e}},799:function(t,e,n){var r=n(902),o=n(257).ANY,i=n(712),a=n(269),u=function(t,e,n){if(1===t.length&&t[0].semver===o)return 1===e.length&&e[0].semver===o;var r,u,l,f,h,p=new Set,d=!0,v=!1,y=void 0;try{for(var m,g=t[Symbol.iterator]();!(d=(m=g.next()).done);d=!0){var b=m.value;">"===b.operator||">="===b.operator?r=s(r,b,n):"<"===b.operator||"<="===b.operator?u=c(u,b,n):p.add(b.semver)}}catch(t){v=!0,y=t}finally{try{d||null==g.return||g.return()}finally{if(v)throw y}}if(p.size>1)return null;if(r&&u){if((l=a(r.semver,u.semver,n))>0)return null;if(0===l&&(">="!==r.operator||"<="!==u.operator))return null}var w=!0,S=!1,O=void 0;try{for(var E,x=p[Symbol.iterator]();!(w=(E=x.next()).done);w=!0){var j=E.value;if(r&&!i(j,String(r),n))return null;if(u&&!i(j,String(u),n))return null;var P=!0,_=!1,A=void 0;try{for(var k,T=e[Symbol.iterator]();!(P=(k=T.next()).done);P=!0){var C=k.value;if(!i(j,String(C),n))return!1}}catch(t){_=!0,A=t}finally{try{P||null==T.return||T.return()}finally{if(_)throw A}}return!0}}catch(t){S=!0,O=t}finally{try{w||null==x.return||x.return()}finally{if(S)throw O}}var I=!0,M=!1,D=void 0;try{for(var R,N=e[Symbol.iterator]();!(I=(R=N.next()).done);I=!0){var L=R.value;if(h=h||">"===L.operator||">="===L.operator,f=f||"<"===L.operator||"<="===L.operator,r)if(">"===L.operator||">="===L.operator){if(s(r,L,n)===L)return!1}else if(">="===r.operator&&!i(r.semver,String(L),n))return!1;if(u)if("<"===L.operator||"<="===L.operator){if(c(u,L,n)===L)return!1}else if("<="===u.operator&&!i(u.semver,String(L),n))return!1;if(!L.operator&&(u||r)&&0!==l)return!1}}catch(t){M=!0,D=t}finally{try{I||null==N.return||N.return()}finally{if(M)throw D}}return!(r&&f&&!u&&0!==l||u&&h&&!r&&0!==l)},s=function(t,e,n){if(!t)return e;var r=a(t.semver,e.semver,n);return r>0?t:r<0||">"===e.operator&&">="===t.operator?e:t},c=function(t,e,n){if(!t)return e;var r=a(t.semver,e.semver,n);return r<0?t:r>0||"<"===e.operator&&"<="===t.operator?e:t};t.exports=function(t,e,n){t=new r(t,n),e=new r(e,n);var o=!1,i=!0,a=!1,s=void 0;try{t:for(var c,l=t.set[Symbol.iterator]();!(i=(c=l.next()).done);i=!0){var f=c.value,h=!0,p=!1,d=void 0;try{for(var v,y=e.set[Symbol.iterator]();!(h=(v=y.next()).done);h=!0){var m=v.value,g=u(f,m,n);if(o=o||null!==g,g)continue t}}catch(t){p=!0,d=t}finally{try{h||null==y.return||y.return()}finally{if(p)throw d}}if(o)return!1}}catch(t){a=!0,s=t}finally{try{i||null==l.return||l.return()}finally{if(a)throw s}}return!0}},42:function(t,e,n){var r=n(902);t.exports=function(t,e){return new r(t,e).set.map((function(t){return t.map((function(t){return t.value})).join(" ").trim().split(" ")}))}},230:function(t,e,n){var r=n(902);t.exports=function(t,e){try{return new r(t,e).range||"*"}catch(t){return null}}},688:function(t){"use strict";t.exports=c}},n={};function p(e){var r=n[e];if(void 0!==r)return r.exports;var o=n[e]={exports:{}};return t[e].call(o.exports,o,o.exports,p),o.exports}p.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return p.d(e,{a:e}),e},p.d=function(t,e){for(var n in e)p.o(e,n)&&!p.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},p.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},p.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var v={};return function(){"use strict";var t=function(t,e){var r=t.copy(),o="hour"in r?function(t,e){return t.hour+=e.hours||0,t.minute+=e.minutes||0,t.second+=e.seconds||0,t.millisecond+=e.milliseconds||0,function(t){t.second+=Math.floor(t.millisecond/1e3),t.millisecond=w(t.millisecond,1e3),t.minute+=Math.floor(t.second/60),t.second=w(t.second,60),t.hour+=Math.floor(t.minute/60),t.minute=w(t.minute,60);var e=Math.floor(t.hour/24);return t.hour=w(t.hour,24),e}(t)}(r,e):0;n(r,e.years||0),r.calendar.balanceYearMonth&&r.calendar.balanceYearMonth(r,t),r.month+=e.months||0,c(r),y(r),r.day+=7*(e.weeks||0),r.day+=e.days||0,r.day+=o,function(t){for(;t.day<1;)t.month--,c(t),t.day+=t.calendar.getDaysInMonth(t);for(;t.day>t.calendar.getDaysInMonth(t);)t.day-=t.calendar.getDaysInMonth(t),t.month++,c(t)}(r),r.calendar.balanceDate&&r.calendar.balanceDate(r),r.year<1&&(r.year=1,r.month=1,r.day=1);var i=r.calendar.getYearsInEra(r);if(r.year>i){var a,u,s=null===(a=(u=r.calendar).isInverseEra)||void 0===a?void 0:a.call(u,r);r.year=i,r.month=s?1:r.calendar.getMonthsInYear(r),r.day=s?1:r.calendar.getDaysInMonth(r)}r.month<1&&(r.month=1,r.day=1);var l=r.calendar.getMonthsInYear(r);return r.month>l&&(r.month=l,r.day=r.calendar.getDaysInMonth(r)),r.day=Math.max(1,Math.min(r.calendar.getDaysInMonth(r),r.day)),r},n=function(t,e){var n,r;(null===(n=(r=t.calendar).isInverseEra)||void 0===n?void 0:n.call(r,t))&&(e=-e),t.year+=e},c=function(t){for(;t.month<1;)n(t,-1),t.month+=t.calendar.getMonthsInYear(t);for(var e=0;t.month>(e=t.calendar.getMonthsInYear(t));)t.month-=e,n(t,1)},y=function(t){t.month=Math.max(1,Math.min(t.calendar.getMonthsInYear(t),t.month)),t.day=Math.max(1,Math.min(t.calendar.getDaysInMonth(t),t.day))},m=function(t){t.calendar.constrainDate&&t.calendar.constrainDate(t),t.year=Math.max(1,Math.min(t.calendar.getYearsInEra(t),t.year)),y(t)},g=function(e,n){return t(e,function(t){var e={};for(var n in t)"number"==typeof t[n]&&(e[n]=-t[n]);return e}(n))},b=function(t,e){var n=t.copy();return null!=e.era&&(n.era=e.era),null!=e.year&&(n.year=e.year),null!=e.month&&(n.month=e.month),null!=e.day&&(n.day=e.day),m(n),n},w=function(t,e){var n=t%e;return n<0&&(n+=e),n},S=function(t,e,n,r){var o=t.copy();switch(e){case"era":var i=t.calendar.getEras(),a=i.indexOf(t.era);if(a<0)throw new Error("Invalid era: "+t.era);a=O(a,n,0,i.length-1,null==r?void 0:r.round),o.era=i[a],m(o);break;case"year":var u,s;(null===(u=(s=o.calendar).isInverseEra)||void 0===u?void 0:u.call(s,o))&&(n=-n),o.year=O(t.year,n,-1/0,9999,null==r?void 0:r.round),o.year===-1/0&&(o.year=1),o.calendar.balanceYearMonth&&o.calendar.balanceYearMonth(o,t);break;case"month":o.month=O(t.month,n,1,t.calendar.getMonthsInYear(t),null==r?void 0:r.round);break;case"day":o.day=O(t.day,n,1,t.calendar.getDaysInMonth(t),null==r?void 0:r.round);break;default:throw new Error("Unsupported field "+e)}return t.calendar.balanceDate&&t.calendar.balanceDate(o),m(o),o},O=function(t,e,n,r){if(arguments.length>4&&void 0!==arguments[4]&&arguments[4]){(t+=Math.sign(e))<n&&(t=r);var o=Math.abs(e);(t=e>0?Math.ceil(t/o)*o:Math.floor(t/o)*o)>r&&(t=n)}else(t+=e)<n?t=r-(n-t-1):t>r&&(t=n+(t-r-1));return t},E=function(t,e){return t.calendar.toJulianDay(t)-e.calendar.toJulianDay(e)},x=function(t){return 36e5*t.hour+6e4*t.minute+1e3*t.second+t.millisecond},j=function(){return null==Jt&&(Jt=(new Intl.DateTimeFormat).resolvedOptions().timeZone),Jt},P=function(t,e){return t-e*Math.floor(t/e)},_=function(t,e,n,r){var o=(e=k(t,e))-1,i=-2;return n<=2?i=0:A(e)&&(i=-1),1721425+365*o+Math.floor(o/4)-Math.floor(o/100)+Math.floor(o/400)+Math.floor((367*n-362)/12+i+r)},A=function(t){return t%4==0&&(t%100!=0||t%400==0)},k=function(t,e){return"BC"===t?1-e:e},T=function(t){var e="AD";return t<=0&&(e="BC",t=1-t),[e,t]},C=function(t){var e=F(t,new Zt);return"".concat(String(e.year).padStart(4,"0"),"-").concat(String(e.month).padStart(2,"0"),"-").concat(String(e.day).padStart(2,"0"))},I=function(t,e,n){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,n)},M=function(t){var e,n="object"==h(t[0])?t.shift():new Zt;if("string"==typeof t[0])e=t.shift();else{var r=n.getEras();e=r[r.length-1]}return[n,e,t.shift(),t.shift(),t.shift()]},D=function(t){return R(k((t=F(t,new Zt)).era,t.year),t.month,t.day,t.hour,t.minute,t.second,t.millisecond)},R=function(t,e,n,r,o,i,a){var u=new Date;return u.setUTCHours(r,o,i,a),u.setUTCFullYear(t,e-1,n),u.getTime()},N=function(t,e){if("UTC"===e)return 0;if(t>0&&e===j())return-6e4*new Date(t).getTimezoneOffset();var n=L(t,e),r=n.year,o=n.month,i=n.day,a=n.hour,u=n.minute,s=n.second;return R(r,o,i,a,u,s,0)-1e3*Math.floor(t/1e3)},L=function(t,e){var n=oe.get(e);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:e,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),oe.set(e,n));var r=n.formatToParts(new Date(t)),o={},i=!0,a=!1,u=void 0;try{for(var s,c=r[Symbol.iterator]();!(i=(s=c.next()).done);i=!0){var l=s.value;"literal"!==l.type&&(o[l.type]=l.value)}}catch(t){a=!0,u=t}finally{try{i||null==c.return||c.return()}finally{if(a)throw u}}return{year:"BC"===o.era||"B"===o.era?1-o.year:+o.year,month:+o.month,day:+o.day,hour:"24"===o.hour?0:+o.hour,minute:+o.minute,second:+o.second}},U=function(t,e){return new Date(function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"compatible",r=B(t);if("UTC"===e)return D(r);if(e===j()&&"compatible"===n){r=F(r,new Zt);var o=new Date,i=k(r.era,r.year);return o.setFullYear(i,r.month-1,r.day),o.setHours(r.hour,r.minute,r.second,r.millisecond),o.getTime()}var a=D(r),u=N(a-ie,e),s=N(a+ie,e),c=function(t,e,n,r){return(n===r?[n]:[n,r]).filter((function(n){return function(t,e,n){var r=L(n,e);return t.year===r.year&&t.month===r.month&&t.day===r.day&&t.hour===r.hour&&t.minute===r.minute&&t.second===r.second}(t,e,n)}))}(r,e,a-u,a-s);if(1===c.length)return c[0];if(c.length>1)switch(n){case"compatible":case"earlier":return c[0];case"later":return c[c.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(a-u,a-s);case"compatible":case"later":return Math.max(a-u,a-s);case"reject":throw new RangeError("No such absolute time found")}}(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"compatible"))},B=function(t,e){var n,r,o=0,i=0,a=0,u=0;if("timeZone"in t)o=(n=t).hour,i=n.minute,a=n.second,u=n.millisecond;else if("hour"in t&&!e)return t;return e&&(o=(r=e).hour,i=r.minute,a=r.second,u=r.millisecond),new re(t.calendar,t.era,t.year,t.month,t.day,o,i,a,u)},F=function(t,e){if(t.calendar.identifier===e.identifier)return t;var n=e.fromJulianDay(t.calendar.toJulianDay(t)),r=t.copy();return r.calendar=e,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,m(r),r},z=function(t){var e=l(T(t.year+-543),2),n=e[0],r=e[1];return new ee(n,r,t.month,t.day)},V=function(t,e,n,r){return t+365*e+Math.floor(e/4)+30*(n-1)+r-1},H=function(t,e){var n=Math.floor(4*(e-t)/1461),r=1+Math.floor((e-V(t,n,1,1))/30);return[n,r,e+1-V(t,n,r,1)]},G=function(t){return Math.floor(t%4/3)},W=function(t,e){return e%13!=0?30:G(t)+5},K=function(t){return P(7*t+1,19)<7},$=function(t){var e=Math.floor((235*t-234)/19),n=12084+13753*e,r=29*e+Math.floor(n/25920);return P(3*(r+1),7)<3&&(r+=1),r},q=function(t){return $(t)+function(t){var e=$(t-1),n=$(t);return $(t+1)-n==356?2:n-e==382?1:0}(t)},J=function(t){return q(t+1)-q(t)},Y=function(t,e){if(e>=6&&!K(t)&&e++,4===e||7===e||9===e||11===e||13===e)return 29;var n=function(t){var e=J(t);switch(e>380&&(e-=30),e){case 353:return 0;case 354:return 1;case 355:return 2}}(t);return 2===e?2===n?30:29:3===e?0===n?29:30:6===e?K(t)?30:0:30},Q=function(t,e,n,r){return r+Math.ceil(29.5*(n-1))+354*(e-1)+Math.floor((3+11*e)/30)+t-1},X=function(t,e,n){var r=Math.floor((30*(n-e)+10646)/10631),o=Math.min(12,Math.ceil((n-(29+Q(e,r,1,1)))/29.5)+1),i=n-Q(e,r,o,1)+1;return new ee(t,r,o,i)},Z=function(t){return(14+11*t)%30<11},tt=function(t){return we+Qt[t-ge]},et=function(t,e){var n=1<<11-(e-1);return Yt[t-ge]&n?30:29},nt=function(t,e){for(var n=tt(t),r=1;r<e;r++)n+=et(t,r);return n},rt=function(t){return Qt[t+1-ge]-Qt[t-ge]},ot=function(t){var e=xe.findIndex((function(e){var n=l(e,3),r=n[0],o=n[1],i=n[2];return t.year<r||t.year===r&&t.month<o||t.year===r&&t.month===o&&t.day<i}));return-1===e?xe.length-1:0===e?0:e-1},it=function(t){var e=Pe[_e.indexOf(t.era)];if(!e)throw new Error("Unknown era: "+t.era);return new ee(t.year+e,t.month,t.day)},at=function(t){if(1===t.year){var e=_e.indexOf(t.era);return xe[e]}},ut=function(t){return"minguo"===t.era?t.year+Ce:1-t.year+Ce},st=function(t){var e=t-Ce;return e>0?["minguo",e]:["before_minguo",1-e]},ct=function(t){var e=l(T(ut(t)),2),n=e[0],r=e[1];return new ee(n,r,t.month,t.day)},lt=function(t,e){var n=function(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}(t,e);return function(t,e){return e.get?e.get.call(t):e.value}(t,n)},ft=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},ht=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){ft(t,e,n[e])}))}return t},pt=function(t){return null!=t&&28===t.trim().length&&"T"===(t=t.trim())[10]&&":"===t[13]&&":"===t[16]&&"."===t[19]&&("+"===t[23]||"-"===t[23])&&(0,Me.default)(t,Ue).isValid()},dt=function(t){return(0,Me.default)(t).isToday()},vt=function(t){return pt(t)?(0,Me.default)(t,Ue).toDate():null},yt=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=(0,Me.default)(t);return e&&(n=n.utc()),n.format(Ue)},mt=function(t){return(0,Me.default)(t).format("HH:mm")},gt=function(t){return Me.default.utc(t).format("HH:mm A")},bt=function(t){return St(t,"DD - MMM - YYYY")},wt=function(t){return St(t,"DD-MMM")},St=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"YYYY-MMM-DD";return(0,Me.default)(t).format(e)},Ot=function(t){return(0,Me.default)(t).toDate()},Et=function(t,e){ze.register(t,e)},xt=function(t){var e,n,r=null!=t?t:At();return ze.getCalendar((e=r,(null!=(n=Intl.Locale)&&"undefined"!=typeof Symbol&&n[Symbol.hasInstance]?n[Symbol.hasInstance](e):u(e,n))?r:new Intl.Locale(r)))},jt=function(t,e){var n,r,o=null!==(n=null==e?void 0:e.locale)&&void 0!==n?n:At(),i=new Intl.Locale(o),a=ht({},Be,{noToday:"am"===i.language},e),u=a.calendar,s=a.mode,c=a.time,l=a.day,f=a.month,h=a.year,p=a.noToday,d=a.numberingSystem,v={calendar:null!=u?u:xt(i),year:h?"numeric":void 0,month:f?"short":void 0,day:l?"2-digit":void 0,numberingSystem:d},y=(0,Me.default)(t).isToday();if(y&&!p)r=(r=new Intl.RelativeTimeFormat(o,{numeric:"auto"}).format(0,"day"))[0].toLocaleUpperCase(o)+r.slice(1);else{"en"===i.language&&(o="en-GB");var m=new Intl.DateTimeFormat(o,v).formatToParts(t);("en"===i.language||"am"===i.language)&&"standard"==s&&h&&l&&(m=m.map(Ve("-"))),"wide"==s&&(m=m.map(Ve(" — "))),"ethiopic"===v.calendar&&(m=m.filter((function(t,e,n){return!("era"===t.type||"literal"===t.type&&e<n.length-1&&"era"===n[e+1].type)}))),r=m.map((function(t){return t.value})).join("")}return(!0===c||y&&"for today"===c)&&(r+=", ".concat(Pt(t))),r},Pt=function(t){return t.toLocaleTimeString(At(),{hour:"2-digit",minute:"2-digit"})},_t=function(t,e){return jt(t,(n=ht({},e),r=null!=(r={time:!0})?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n.push.apply(n,r)}return n}(Object(r)).forEach((function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(r,t))})),n));var n,r},At=function(){var t=window.i18next.language;return"ht"===(t=t.replace("_","-"))&&(t="fr-HT"),t},kt=function(t,e){var n=xt("string"==typeof e?new Intl.Locale(e):e);return n?F(t,function(t){switch(t){case"buddhist":return new ae;case"ethiopic":return new le;case"ethioaa":return new fe;case"coptic":return new he;case"hebrew":return new de;case"indian":return new ve;case"islamic-civil":return new Se;case"islamic-tbla":return new Oe;case"islamic-umalqura":return new Ee;case"japanese":return new Ae;case"persian":return new Te;case"roc":return new Ie;default:return new Zt}}(n)):t},Tt=function(t){return(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())-Date.UTC(t.getUTCFullYear(),0,0))/24/60/60/1e3},Ct=function(t,e){var n=t.toISOString(),r=e.toISOString();return n.slice(0,n.indexOf("T"))===r.slice(0,r.indexOf("T"))},It=function(t){var e=new Date,n=new Date(t),r=e.getUTCMonth()-n.getUTCMonth(),o=e.getUTCDate()-n.getUTCDate(),i=e.getUTCFullYear()-n.getUTCFullYear();(r<0||0===r&&o<0)&&i--;var a=r>=0?r:r+12;o<0&&a--;var u=Tt(e)-Tt(n);u<0&&(u+=365);var s=Math.floor(u/7),c=At();return 0===i?Ct(e,n)?new Intl.RelativeTimeFormat(c,{numeric:"auto"}).format(0,"day"):u<31?new Intl.NumberFormat(c,{style:"unit",unit:"day",unitDisplay:"short"}).format(u):new Intl.NumberFormat(c,{style:"unit",unit:"week",unitDisplay:"short"}).format(s):i<2?new Intl.NumberFormat(c,{style:"unit",unit:"month",unitDisplay:"short"}).format(a+12):new Intl.NumberFormat(c,{style:"unit",unit:"year",unitDisplay:"short"}).format(i)},Mt=function(t){return!window.offlineEnabled||(null!=t?t:navigator.onLine)},Dt=function(t){return Nt(Ut(t,"usual","official"))},Rt=function(t){return Dt(t)},Nt=function(t){var e;return t?null!==(e=t.text)&&void 0!==e?e:function(t){var e,n=null!==(e=t.given)&&void 0!==e?e:[];return(t.family?n.concat(t.family):n).join(" ")}(t):""},Lt=function(t){return Nt(t)},Ut=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];0==n.length&&(n=["usual"]);var o,i=!0,a=!1,u=void 0;try{for(var s,c=function(){var e,n=s.value,r=null===(e=t.name)||void 0===e?void 0:e.find((function(t){return function(t,e){return t.use?t.use===e:"usual"===e}(t,n)}));if(r)return{v:r}},l=n[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var f=c();if("object"==((o=f)&&"undefined"!=typeof Symbol&&o.constructor===Symbol?"symbol":void 0===o?"undefined":h(o)))return f.v}}catch(t){a=!0,u=t}finally{try{i||null==l.return||l.return()}finally{if(a)throw u}}},Bt=function(t,e){if(t===e||Object.is(t,e))return!0;if(Array.isArray(t)){if(!Array.isArray(e))return!1;if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}if(Array.isArray(e))return!1;if("object"!=(void 0===t?"undefined":h(t))||null===t||"object"!=(void 0===e?"undefined":h(e))||null===e)return!1;var r=Object.getOwnPropertyNames(t),o=Object.getOwnPropertyNames(e);return r.length===o.length&&r.every((function(n){return t[n]===e[n]}))},Ft=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.localStorage;try{return t.getItem("test"),!0}catch(t){return!1}},zt=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},Vt=function(t){var e,n=function(t){if(Array.isArray(t))return t}(e=t.split("."))||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),3!==i.length);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e)||function(t,e){if(t){if("string"==typeof t)return zt(t,3);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zt(t,3):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=n[0],o=n[1],i=n[2];return"".concat(r,".").concat(o,".").concat(i)},Ht=function(t,e){var n=function(t){var e=t.indexOf("-");if(e>=0){var n=Vt(t.slice(0,e)),r=t.slice(e+1);return"".concat(n,"-").concat(r)}return Vt(t)}(e);return Ge.satisfies(n,t,{includePrerelease:!0})},Gt=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},Wt=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Gt(i,r,o,a,u,"next",t)}function u(t){Gt(i,r,o,a,u,"throw",t)}a(void 0)}))}},Kt=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},$t=function(t){return We.apply(this,arguments)},qt=function(t){return Ke.apply(this,arguments)};p.r(v),p.d(v,{age:function(){return It},canAccessStorage:function(){return Ft},convertToLocaleCalendar:function(){return kt},daysIntoYear:function(){return Tt},displayName:function(){return Rt},formatDate:function(){return jt},formatDatetime:function(){return _t},formatPatientName:function(){return Nt},formatTime:function(){return Pt},formattedName:function(){return Lt},getDefaultCalendar:function(){return xt},getDefaultsFromConfigSchema:function(){return He},getLocale:function(){return At},getPatientName:function(){return Dt},isOmrsDateStrict:function(){return pt},isOmrsDateToday:function(){return dt},isOnline:function(){return Mt},isSameDay:function(){return Ct},isVersionSatisfied:function(){return Ht},parseDate:function(){return Ot},registerDefaultCalendar:function(){return Et},retry:function(){return $t},selectPreferredName:function(){return Ut},shallowEqual:function(){return Bt},toDateObjectStrict:function(){return vt},toOmrsDateFormat:function(){return St},toOmrsDayDateFormat:function(){return bt},toOmrsIsoString:function(){return yt},toOmrsTimeString:function(){return gt},toOmrsTimeString24:function(){return mt},toOmrsYearlessDateFormat:function(){return wt}});var Jt=null;new Map;var Yt,Qt,Xt={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]},Zt=function(){function t(){e(this,t),this.identifier="gregory"}return r(t,[{key:"fromJulianDay",value:function(t){var e=t,n=e-1721426,r=Math.floor(n/146097),o=P(n,146097),i=Math.floor(o/36524),a=P(o,36524),u=Math.floor(a/1461),s=P(a,1461),c=Math.floor(s/365),f=l(T(400*r+100*i+4*u+c+(4!==i&&4!==c?1:0)),2),h=f[0],p=f[1],d=e-_(h,p,1,1),v=2;e<_(h,p,3,1)?v=0:A(p)&&(v=1);var y=Math.floor((12*(d+v)+373)/367),m=e-_(h,p,y,1)+1;return new ee(h,p,y,m)}},{key:"toJulianDay",value:function(t){return _(t.era,t.year,t.month,t.day)}},{key:"getDaysInMonth",value:function(t){return Xt[A(t.year)?"leapyear":"standard"][t.month-1]}},{key:"getMonthsInYear",value:function(t){return 12}},{key:"getDaysInYear",value:function(t){return A(t.year)?366:365}},{key:"getYearsInEra",value:function(t){return 9999}},{key:"getEras",value:function(){return["BC","AD"]}},{key:"isInverseEra",value:function(t){return"BC"===t.era}},{key:"balanceDate",value:function(t){t.year<=0&&(t.era="BC"===t.era?"AD":"BC",t.year=1-t.year)}}]),t}(),te=new WeakMap,ee=function(){function n(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];e(this,n),I(this,te,{writable:!0,value:void 0});var i=l(M(r),5),a=i[0],u=i[1],s=i[2],c=i[3],f=i[4];this.calendar=a,this.era=u,this.year=s,this.month=c,this.day=f,m(this)}return r(n,[{key:"copy",value:function(){return this.era?new n(this.calendar,this.era,this.year,this.month,this.day):new n(this.calendar,this.year,this.month,this.day)}},{key:"add",value:function(e){return t(this,e)}},{key:"subtract",value:function(t){return g(this,t)}},{key:"set",value:function(t){return b(this,t)}},{key:"cycle",value:function(t,e,n){return S(this,t,e,n)}},{key:"toDate",value:function(t){return U(this,t)}},{key:"toString",value:function(){return C(this)}},{key:"compare",value:function(t){return E(this,t)}}]),n}(),ne=new WeakMap,re=function(){function n(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];e(this,n),I(this,ne,{writable:!0,value:void 0});var i=l(M(r),5),a=i[0],u=i[1],s=i[2],c=i[3],f=i[4];this.calendar=a,this.era=u,this.year=s,this.month=c,this.day=f,this.hour=r.shift()||0,this.minute=r.shift()||0,this.second=r.shift()||0,this.millisecond=r.shift()||0,m(this)}return r(n,[{key:"copy",value:function(){return this.era?new n(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new n(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}},{key:"add",value:function(e){return t(this,e)}},{key:"subtract",value:function(t){return g(this,t)}},{key:"set",value:function(t){return b(function(t,e){var n,r=t.copy();return null!=e.hour&&(r.hour=e.hour),null!=e.minute&&(r.minute=e.minute),null!=e.second&&(r.second=e.second),null!=e.millisecond&&(r.millisecond=e.millisecond),(n=r).millisecond=Math.max(0,Math.min(n.millisecond,1e3)),n.second=Math.max(0,Math.min(n.second,59)),n.minute=Math.max(0,Math.min(n.minute,59)),n.hour=Math.max(0,Math.min(n.hour,23)),r}(this,t),t)}},{key:"cycle",value:function(t,e,n){switch(t){case"era":case"year":case"month":case"day":return S(this,t,e,n);default:return function(t,e,n,r){var o=t.copy();switch(e){case"hour":var i=t.hour,a=0,u=23;if(12===(null==r?void 0:r.hourCycle)){var s=i>=12;a=s?12:0,u=s?23:11}o.hour=O(i,n,a,u,null==r?void 0:r.round);break;case"minute":o.minute=O(t.minute,n,0,59,null==r?void 0:r.round);break;case"second":o.second=O(t.second,n,0,59,null==r?void 0:r.round);break;case"millisecond":o.millisecond=O(t.millisecond,n,0,999,null==r?void 0:r.round);break;default:throw new Error("Unsupported field "+e)}return o}(this,t,e,n)}}},{key:"toDate",value:function(t,e){return U(this,t,e)}},{key:"toString",value:function(){return"".concat(C(this),"T").concat((t=this,"".concat(String(t.hour).padStart(2,"0"),":").concat(String(t.minute).padStart(2,"0"),":").concat(String(t.second).padStart(2,"0")).concat(t.millisecond?String(t.millisecond/1e3).slice(1):"")));var t}},{key:"compare",value:function(t){var e=E(this,t);return 0===e?function(t,e){return x(t)-x(e)}(this,B(t)):e}}]),n}(),oe=new Map,ie=864e5,ae=function(t){a(u,t);var n=d(u);function u(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var i;return e(this,u),(i=n.call.apply(n,[this].concat(f(r)))).identifier="buddhist",s(i)}return r(u,[{key:"fromJulianDay",value:function(t){var e=o(i(u.prototype),"fromJulianDay",this).call(this,t),n=k(e.era,e.year);return new ee(this,n- -543,e.month,e.day)}},{key:"toJulianDay",value:function(t){return o(i(u.prototype),"toJulianDay",this).call(this,z(t))}},{key:"getEras",value:function(){return["BE"]}},{key:"getDaysInMonth",value:function(t){return o(i(u.prototype),"getDaysInMonth",this).call(this,z(t))}},{key:"balanceDate",value:function(){}}]),u}(Zt),ue=1723856,se=1824665,ce=5500,le=function(){function t(){e(this,t),this.identifier="ethiopic"}return r(t,[{key:"fromJulianDay",value:function(t){var e=l(H(ue,t),3),n=e[0],r=e[1],o=e[2],i="AM";return n<=0&&(i="AA",n+=ce),new ee(this,i,n,r,o)}},{key:"toJulianDay",value:function(t){var e=t.year;return"AA"===t.era&&(e-=ce),V(ue,e,t.month,t.day)}},{key:"getDaysInMonth",value:function(t){return W(t.year,t.month)}},{key:"getMonthsInYear",value:function(){return 13}},{key:"getDaysInYear",value:function(t){return 365+G(t.year)}},{key:"getYearsInEra",value:function(t){return"AA"===t.era?9999:9991}},{key:"getEras",value:function(){return["AA","AM"]}}]),t}(),fe=function(t){a(o,t);var n=d(o);function o(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];var a;return e(this,o),(a=n.call.apply(n,[this].concat(f(r)))).identifier="ethioaa",s(a)}return r(o,[{key:"fromJulianDay",value:function(t){var e=l(H(ue,t),3),n=e[0],r=e[1],o=e[2];return new ee(this,"AA",n+=ce,r,o)}},{key:"getEras",value:function(){return["AA"]}},{key:"getYearsInEra",value:function(){return 9999}}]),o}(le),he=function(t){a(o,t);var n=d(o);function o(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];var a;return e(this,o),(a=n.call.apply(n,[this].concat(f(r)))).identifier="coptic",s(a)}return r(o,[{key:"fromJulianDay",value:function(t){var e=l(H(se,t),3),n=e[0],r=e[1],o=e[2],i="CE";return n<=0&&(i="BCE",n=1-n),new ee(this,i,n,r,o)}},{key:"toJulianDay",value:function(t){var e=t.year;return"BCE"===t.era&&(e=1-e),V(se,e,t.month,t.day)}},{key:"getDaysInMonth",value:function(t){var e=t.year;return"BCE"===t.era&&(e=1-e),W(e,t.month)}},{key:"isInverseEra",value:function(t){return"BCE"===t.era}},{key:"balanceDate",value:function(t){t.year<=0&&(t.era="BCE"===t.era?"CE":"BCE",t.year=1-t.year)}},{key:"getEras",value:function(){return["BCE","CE"]}},{key:"getYearsInEra",value:function(t){return"BCE"===t.era?9999:9715}}]),o}(le),pe=347997,de=function(){function t(){e(this,t),this.identifier="hebrew"}return r(t,[{key:"fromJulianDay",value:function(t){for(var e=t-pe,n=25920*e/765433,r=Math.floor((19*n+234)/235)+1,o=q(r),i=Math.floor(e-o);i<1;)r--,o=q(r),i=Math.floor(e-o);for(var a=1,u=0;u<i;)u+=Y(r,a),a++;return a--,u-=Y(r,a),new ee(this,r,a,i-u)}},{key:"toJulianDay",value:function(t){for(var e=q(t.year),n=1;n<t.month;n++)e+=Y(t.year,n);return e+t.day+pe}},{key:"getDaysInMonth",value:function(t){return Y(t.year,t.month)}},{key:"getMonthsInYear",value:function(t){return K(t.year)?13:12}},{key:"getDaysInYear",value:function(t){return J(t.year)}},{key:"getYearsInEra",value:function(){return 9999}},{key:"getEras",value:function(){return["AM"]}},{key:"balanceYearMonth",value:function(t,e){e.year!==t.year&&(K(e.year)&&!K(t.year)&&e.month>6?t.month--:!K(e.year)&&K(t.year)&&e.month>6&&t.month++)}}]),t}(),ve=function(t){a(u,t);var n=d(u);function u(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var i;return e(this,u),(i=n.call.apply(n,[this].concat(f(r)))).identifier="indian",s(i)}return r(u,[{key:"fromJulianDay",value:function(t){var e,n,r,a=o(i(u.prototype),"fromJulianDay",this).call(this,t),s=a.year-78,c=t-_(a.era,a.year,1,1);if(c<80?(s--,c+=155+(e=A(a.year-1)?31:30)+90+10):(e=A(a.year)?31:30,c-=80),c<e)n=1,r=c+1;else{var l=c-e;l<155?(n=Math.floor(l/31)+2,r=l%31+1):(l-=155,n=Math.floor(l/30)+7,r=l%30+1)}return new ee(this,s,n,r)}},{key:"toJulianDay",value:function(t){var e,n,r=t.year+78,o=l(T(r),2),i=o[0],a=o[1];return A(a)?(e=31,n=_(i,a,3,21)):(e=30,n=_(i,a,3,22)),1===t.month?n+t.day-1:(n+=e+31*Math.min(t.month-2,5),t.month>=8&&(n+=30*(t.month-7)),n+=t.day-1)}},{key:"getDaysInMonth",value:function(t){return 1===t.month&&A(t.year+78)||t.month>=2&&t.month<=6?31:30}},{key:"getYearsInEra",value:function(){return 9919}},{key:"getEras",value:function(){return["saka"]}},{key:"balanceDate",value:function(){}}]),u}(Zt),ye=1948440,me=1948439,ge=1300,be=1600,we=460322,Se=function(){function t(){e(this,t),this.identifier="islamic-civil"}return r(t,[{key:"fromJulianDay",value:function(t){return X(this,ye,t)}},{key:"toJulianDay",value:function(t){return Q(ye,t.year,t.month,t.day)}},{key:"getDaysInMonth",value:function(t){var e=29+t.month%2;return 12===t.month&&Z(t.year)&&e++,e}},{key:"getMonthsInYear",value:function(){return 12}},{key:"getDaysInYear",value:function(t){return Z(t.year)?355:354}},{key:"getYearsInEra",value:function(){return 9665}},{key:"getEras",value:function(){return["AH"]}}]),t}(),Oe=function(t){a(o,t);var n=d(o);function o(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];var a;return e(this,o),(a=n.call.apply(n,[this].concat(f(r)))).identifier="islamic-tbla",s(a)}return r(o,[{key:"fromJulianDay",value:function(t){return X(this,me,t)}},{key:"toJulianDay",value:function(t){return Q(me,t.year,t.month,t.day)}}]),o}(Se),Ee=function(t){a(u,t);var n=d(u);function u(){var t;if(e(this,u),(t=n.call(this)).identifier="islamic-umalqura",Yt||(Yt=new Uint16Array(Uint8Array.from(atob("qgpUDckO1AbqBmwDrQpVBakGkgepC9QF2gpcBS0NlQZKB1QLagutBa4ETwoXBYsGpQbVCtYCWwmdBE0KJg2VDawFtgm6AlsKKwWVCsoG6Qr0AnYJtgJWCcoKpAvSC9kF3AJtCU0FpQpSC6ULtAW2CVcFlwJLBaMGUgdlC2oFqworBZUMSg2lDcoF1gpXCasESwmlClILagt1BXYCtwhbBFUFqQW0BdoJ3QRuAjYJqgpUDbIN1QXaAlsJqwRVCkkLZAtxC7QFtQpVCiUNkg7JDtQG6QprCasEkwpJDaQNsg25CroEWworBZUKKgtVC1wFvQQ9Ah0JlQpKC1oLbQW2AjsJmwRVBqkGVAdqC2wFrQpVBSkLkgupC9QF2gpaBasKlQVJB2QHqgu1BbYCVgpNDiULUgtqC60FrgIvCZcESwalBqwG1gpdBZ0ETQoWDZUNqgW1BdoCWwmtBJUFygbkBuoK9QS2AlYJqgpUC9IL2QXqAm0JrQSVCkoLpQuyBbUJ1gSXCkcFkwZJB1ULagVrCisFiwpGDaMNygXWCtsEawJLCaUKUgtpC3UFdgG3CFsCKwVlBbQF2gntBG0BtgimClINqQ3UBdoKWwmrBFMGKQdiB6kLsgW1ClUFJQuSDckO0gbpCmsFqwRVCikNVA2qDbUJugQ7CpsETQqqCtUK2gJdCV4ELgqaDFUNsga5BroEXQotBZUKUguoC7QLuQXaAloJSgukDdEO6AZqC20FNQWVBkoNqA3UDdoGWwWdAisGFQtKC5ULqgWuCi4JjwwnBZUGqgbWCl0FnQI="),(function(t){return t.charCodeAt(0)})).buffer)),!Qt){Qt=new Uint32Array(be-ge+1);for(var r=0,o=ge;o<=be;o++){Qt[o-ge]=r;for(var i=1;i<=12;i++)r+=et(o,i)}}return s(t)}return r(u,[{key:"fromJulianDay",value:function(t){var e=t-ye,n=tt(ge),r=tt(be);if(e<n||e>r)return o(i(u.prototype),"fromJulianDay",this).call(this,t);for(var a=ge-1,s=1,c=1;c>0;){a++,c=e-tt(a)+1;var l=rt(a);if(c===l){s=12;break}if(c<l){var f=et(a,s);for(s=1;c>f;)c-=f,s++,f=et(a,s);break}}return new ee(this,a,s,e-nt(a,s)+1)}},{key:"toJulianDay",value:function(t){return t.year<ge||t.year>be?o(i(u.prototype),"toJulianDay",this).call(this,t):ye+nt(t.year,t.month)+(t.day-1)}},{key:"getDaysInMonth",value:function(t){return t.year<ge||t.year>be?o(i(u.prototype),"getDaysInMonth",this).call(this,t):et(t.year,t.month)}},{key:"getDaysInYear",value:function(t){return t.year<ge||t.year>be?o(i(u.prototype),"getDaysInYear",this).call(this,t):rt(t.year)}}]),u}(Se),xe=[[1868,9,8],[1912,7,30],[1926,12,25],[1989,1,8],[2019,5,1]],je=[[1912,7,29],[1926,12,24],[1989,1,7],[2019,4,30]],Pe=[1867,1911,1925,1988,2018],_e=["meiji","taisho","showa","heisei","reiwa"],Ae=function(t){a(u,t);var n=d(u);function u(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var i;return e(this,u),(i=n.call.apply(n,[this].concat(f(r)))).identifier="japanese",s(i)}return r(u,[{key:"fromJulianDay",value:function(t){var e=o(i(u.prototype),"fromJulianDay",this).call(this,t),n=ot(e);return new ee(this,_e[n],e.year-Pe[n],e.month,e.day)}},{key:"toJulianDay",value:function(t){return o(i(u.prototype),"toJulianDay",this).call(this,it(t))}},{key:"balanceDate",value:function(t){var e=it(t),n=ot(e);_e[n]!==t.era&&(t.era=_e[n],t.year=e.year-Pe[n]),this.constrainDate(t)}},{key:"constrainDate",value:function(t){var e=_e.indexOf(t.era),n=je[e];if(null!=n){var r=l(n,3),o=r[0],i=r[1],a=r[2],u=o-Pe[e];t.year=Math.max(1,Math.min(u,t.year)),t.year===u&&(t.month=Math.min(i,t.month),t.month===i&&(t.day=Math.min(a,t.day)))}if(1===t.year&&e>=0){var s=l(xe[e],3),c=s[1],f=s[2];t.month=Math.max(c,t.month),t.month===c&&(t.day=Math.max(f,t.day))}}},{key:"getEras",value:function(){return _e}},{key:"getYearsInEra",value:function(t){var e=_e.indexOf(t.era),n=xe[e],r=xe[e+1];if(null==r)return 9999-n[0]+1;var o=r[0]-n[0];return(t.month<r[1]||t.month===r[1]&&t.day<r[2])&&o++,o}},{key:"getDaysInMonth",value:function(t){return o(i(u.prototype),"getDaysInMonth",this).call(this,it(t))}},{key:"getMinimumMonthInYear",value:function(t){var e=at(t);return e?e[1]:1}},{key:"getMinimumDayInMonth",value:function(t){var e=at(t);return e&&t.month===e[1]?e[2]:1}}]),u}(Zt),ke=[0,31,62,93,124,155,186,216,246,276,306,336],Te=function(){function t(){e(this,t),this.identifier="persian"}return r(t,[{key:"fromJulianDay",value:function(t){var e=t-1948320,n=1+Math.floor((33*e+3)/12053),r=e-(365*(n-1)+Math.floor((8*n+21)/33)),o=r<216?Math.floor(r/31):Math.floor((r-6)/30);return new ee(this,n,o+1,r-ke[o]+1)}},{key:"toJulianDay",value:function(t){var e=1948319+365*(t.year-1)+Math.floor((8*t.year+21)/33);return(e+=ke[t.month-1])+t.day}},{key:"getMonthsInYear",value:function(){return 12}},{key:"getDaysInMonth",value:function(t){return t.month<=6?31:t.month<=11||P(25*t.year+11,33)<8?30:29}},{key:"getEras",value:function(){return["AP"]}},{key:"getYearsInEra",value:function(){return 9377}}]),t}(),Ce=1911,Ie=function(t){a(u,t);var n=d(u);function u(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var i;return e(this,u),(i=n.call.apply(n,[this].concat(f(r)))).identifier="roc",s(i)}return r(u,[{key:"fromJulianDay",value:function(t){var e=o(i(u.prototype),"fromJulianDay",this).call(this,t),n=k(e.era,e.year),r=l(st(n),2),a=r[0],s=r[1];return new ee(this,a,s,e.month,e.day)}},{key:"toJulianDay",value:function(t){return o(i(u.prototype),"toJulianDay",this).call(this,ct(t))}},{key:"getEras",value:function(){return["before_minguo","minguo"]}},{key:"balanceDate",value:function(t){var e=l(st(ut(t)),2),n=e[0],r=e[1];t.era=n,t.year=r}},{key:"isInverseEra",value:function(t){return"before_minguo"===t.era}},{key:"getDaysInMonth",value:function(t){return o(i(u.prototype),"getDaysInMonth",this).call(this,ct(t))}},{key:"getYearsInEra",value:function(t){return"before_minguo"===t.era?9999:9999-Ce}}]),u}(Zt),Me=p(688),De=p(14),Re=p.n(De),Ne=p(332),Le=p.n(Ne);Me.default.extend(Re()),Me.default.extend(Le());var Ue="YYYY-MM-DDTHH:mm:ss.SSSZZ",Be={mode:"standard",time:"for today",day:!0,month:!0,year:!0,noToday:!1},Fe=new WeakMap,ze=new(function(){function t(){var e,n;!function(t,e){if(!u(t,e))throw new TypeError("Cannot call a class as a function")}(this,t),e=Fe,n={writable:!0,value:new Map},function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(this,e),e.set(this,n),lt(this,Fe).set("am","ethiopic")}var e;return(e=[{key:"register",value:function(t,e){lt(this,Fe).set(t,e)}},{key:"getCalendar",value:function(t){if(Boolean(t)){if(t.calendar)return t.calendar;if(t.region){var e="".concat(t.language,"-").concat(t.region);if(lt(this,Fe).has(e))return lt(this,Fe).get(e)}if(t.language&&lt(this,Fe).has(t.language))return lt(this,Fe).get(t.language);var n=new Intl.DateTimeFormat(t.toString()).resolvedOptions().calendar;return lt(this,Fe).set("".concat(t.language).concat(t.region?"-".concat(t.region):""),n),n}}}])&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(t.prototype,e),t}()),Ve=function(t){return function(e,n,r){return"literal"!==e.type||" "!==e.value||n<r.length-1&&"era"===r[n+1].type?e:{type:"literal",value:t}}};function He(t){var e,n={},r=!0,o=!1,i=void 0;try{for(var a,u=Object.keys(t)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=a.value;if(t[s].hasOwnProperty("_default"))n[s]=t[s]._default;else{if(s.startsWith("_"))continue;(e=t[s])&&e.constructor===Object?n[s]=He(t[s]):n[s]=t[s]}}}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}var Ge=p(249);function We(){return We=Wt((function(t){var e,n,r,o,i,a,u,s=arguments;return Kt(this,(function(c){switch(c.label){case 0:n=(e=s.length>1&&void 0!==s[1]?s[1]:{}).shouldRetry,r=e.getDelay,o=e.onError,n=null!=n?n:function(t){return function(t,e){return t<=5}(t)},r=null!=r?r:function(t){return function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2]?t+1:t;return e*Math.pow(2,n)}(t,1e3)},i=0,a=void 0,c.label=1;case 1:return c.trys.push([1,4,,5]),[4,qt(r(i))];case 2:return c.sent(),[4,t()];case 3:return[2,c.sent()];case 4:return u=c.sent(),null==o||o(u,i),a=u,[3,5];case 5:if(n(i++))return[3,1];c.label=6;case 6:throw a}}))})),We.apply(this,arguments)}function Ke(){return(Ke=Wt((function(t){return Kt(this,(function(e){return t<=0?[2]:[2,new Promise((function(e){return setTimeout(e,t)}))]}))}))).apply(this,arguments)}}(),v}())}}}))},6488:(t,e,n)=>{"use strict";function r(t){if(Array.isArray(t))return t}n.d(e,{A:()=>r})},5152:(t,e,n)=>{"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.d(e,{A:()=>r})},4586:(t,e,n)=>{"use strict";n.d(e,{A:()=>o});var r=n(8515);function o(t,e,n){return(e=(0,r.A)(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},5405:(t,e,n)=>{"use strict";function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}n.d(e,{A:()=>r})},2296:(t,e,n)=>{"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function o(t,e){if(t){if("string"==typeof t)return r(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}n.d(e,{A:()=>o})}}]);
2
+ (globalThis.webpackChunk_ampath_esm_patient_registration_app=globalThis.webpackChunk_ampath_esm_patient_registration_app||[]).push([[831],{6747:(t,e,n)=>{function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}function a(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}System.register(["@openmrs/esm-config","@openmrs/esm-navigation","@openmrs/esm-error-handling","@openmrs/esm-offline"],(function(t,e){var u={},s={},c={},l={};return{setters:[function(t){u.Type=t.Type,u.defineConfigSchema=t.defineConfigSchema,u.getConfig=t.getConfig,u.validators=t.validators},function(t){s.navigate=t.navigate},function(t){c.reportError=t.reportError},function(t){l.getSynchronizationItems=t.getSynchronizationItems}],execute:function(){t(function(){var t={385:function(){System.register([],(function(t,e){return{execute:function(){t(function(){"use strict";var t=function(t,e){var n=c[t];if(n)return n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value.setState(e,!0),n.active=!0,n.value;var r=s()((function(){return e}));return c[t]={value:r,active:!0},r},e=function(t,e){var n=c[t];return n?(n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value=e,n.active=!0,n.value):(c[t]={value:e,active:!0},e)},n=function(t,e){var n=c[t];if(!n){var r=s()((function(){return null!=e?e:{}}));return c[t]={value:r,active:!1},r}return n.value},r=function(t,e,n){var r=e(t.getState());return t.subscribe((function(t){var o=e(t);o!==r&&(r=o,n(o))}))},o={d:function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},i={};o.r(i),o.d(i,{createGlobalStore:function(){return t},getGlobalStore:function(){return n},registerGlobalStore:function(){return e},subscribeTo:function(){return r}});var u=function(t){var e,n=new Set,r=function(t,r){var o="function"==typeof t?t(e):t;if(!Object.is(o,e)){var i=e;e=(null!=r?r:"object"!=(void 0===o?"undefined":a(o)))?o:Object.assign({},e,o),n.forEach((function(t){return t(e,i)}))}},o=function(){return e},i={setState:r,getState:o,subscribe:function(t){return n.add(t),function(){return n.delete(t)}},destroy:function(){console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return e=t(r,o,i),i},s=function(t){return t?u(t):u},c={};return setTimeout((function(){"development"===window.spaEnv&&(window.stores=c)}),1e3),i}())}}}))},824:function(t){"use strict";t.exports=u},254:function(t){"use strict";t.exports=c},513:function(t){"use strict";t.exports=s},738:function(t){"use strict";t.exports=l}},e={};function f(n){var r=e[n];if(void 0!==r)return r.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,f),o.exports}f.d=function(t,e){for(var n in e)f.o(e,n)&&!f.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},f.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},f.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var p={};return function(){"use strict";var t=function(t,e){function n(){this.constructor=t}se(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=function(t){return"function"==typeof t},u=function(t){setTimeout((function(){throw t}),0)},s=function(t){return null!==t&&"object"==(void 0===t?"undefined":a(t))},c=function(t){return t.reduce((function(t,e){return t.concat(i(e,de)?e.errors:e)}),[])},l=function(t){return t},h=function(t){if(t||(t=le.Promise||Promise),!t)throw new Error("no Promise impl found");return t},d=function(t,e,n){var r=m(t,e,n);We.length?We.forEach((function(t){return t(r)})):setTimeout((function(){throw r}))},v=function(t){if("function"!=typeof t)throw Error(g(28,!1));We.push(t)},y=function(t){if("function"!=typeof t)throw Error(g(29,!1));var e=!1;return We=We.filter((function(n){var r=n===t;return e=e||r,!r})),e},g=function(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return"single-spa minified message #".concat(t,": ").concat(e?e+" ":"","See https://single-spa.js.org/error/?code=").concat(t).concat(r.length?"&arg=".concat(r.join("&arg=")):"")},m=function(t,e,n){var r,o="".concat(E(e)," '").concat(O(e),"' died in status ").concat(e.status,": ");if(i(t,Error)){try{t.message=o+t.message}catch(t){}r=t}else{console.warn(g(30,!1,e.status,O(e)));try{r=Error(o+JSON.stringify(t))}catch(e){r=t}}return r.appOrParcelName=O(e),e.status=n,r},b=function(t){return t.status===Qe},w=function(t){try{return t.activeWhen(window.location)}catch(e){return d(e,t,nn),!1}},O=function(t){return t.name},S=function(t){return Boolean(t.unmountThisParcel)},E=function(t){return S(t)?"parcel":"application"},x=function(){for(var t=arguments.length-1;t>0;t--)for(var e in arguments[t])"__proto__"!==e&&(arguments[t-1][e]=arguments[t][e]);return arguments[0]},P=function(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return t[n];return null},j=function(t){return t&&("function"==typeof t||(e=t,Array.isArray(e)&&!P(e,(function(t){return"function"!=typeof t}))));var e},k=function(t,e){var n=t[e]||[];0===(n=Array.isArray(n)?n:[n]).length&&(n=[function(){return Promise.resolve()}]);var r=E(t),o=O(t);return function(t){return n.reduce((function(n,i,a){return n.then((function(){var n=i(t);return A(n)?n:Promise.reject(g(15,!1,r,o,e,a))}))}),Promise.resolve())}},A=function(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch},_=function(t,e){return Promise.resolve().then((function(){return t.status!==$e?t:(t.status=qe,t.bootstrap?F(t,"bootstrap").then(n).catch((function(n){if(e)throw m(n,t,nn);return d(n,t,nn),t})):Promise.resolve().then(n))}));function n(){return t.status=Je,t}},T=function(t,e){return Promise.resolve().then((function(){var n=function(){return F(t,"unmount").then((function(){t.status=Je}),(function(n){if(e)throw m(n,t,nn);d(n,t,nn)}))};if(t.status!==Qe)return t;t.status=Ze;var r=Object.keys(t.parcels).map((function(e){return t.parcels[e].unmountThisParcel()}));return Promise.all(r).then(n,(function(r){return n().then((function(){var n=Error(r.message);if(e)throw m(n,t,nn);d(n,t,nn)}))})).then((function(){return t}))}))},C=function(t,e){return Promise.resolve().then((function(){return t.status!==Je?t:(on||(window.dispatchEvent(new He("single-spa:before-first-mount")),on=!0),t.status=Ye,F(t,"mount").then((function(){return t.status=Qe,an||(window.dispatchEvent(new He("single-spa:first-mount")),an=!0),t})).catch((function(n){var r=function(){if(e)throw m(n,t,nn);return d(n,t,nn),t};return t.status=Qe,T(t,!0).then(r,r)})))}))},I=function(){return M.apply(sn,arguments)},M=function(t,e){var n=this;if(!t||"object"!=(void 0===t?"undefined":a(t))&&"function"!=typeof t)throw Error(g(2,!1));if(t.name&&"string"!=typeof t.name)throw Error(g(3,!1,a(t.name)));var r=un++,o=t.name||"parcel-".concat(r);if("object"!=(void 0===e?"undefined":a(e)))throw Error(g(4,!1,o,void 0===e?"undefined":a(e)));if(!e.domElement)throw Error(g(5,!1,o));var i,u="function"==typeof t,s=u?t:function(){return Promise.resolve(t)},c={id:r,parcels:{},status:u?Ke:$e,customProps:e,parentName:O(n),unmountThisParcel:function(){return d.then((function(){if(c.status!==Qe)throw Error(g(6,!1,o,c.status));return T(c,!0)})).then((function(t){return c.parentName&&delete n.parcels[c.id],t})).then((function(t){return f(t),t})).catch((function(t){throw c.status=nn,p(t),t}))}};n.parcels[r]=c;var l=s();if(!l||"function"!=typeof l.then)throw Error(g(7,!1));l=l.then((function(t){if(!t)throw Error(g(8,!1));if(o=t.name||"parcel-".concat(r),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!j(t.bootstrap))throw Error(g(9,!1,o));if(!j(t.mount))throw Error(g(10,!1,o));if(!j(t.unmount))throw Error(g(11,!1,o));if(t.update&&!j(t.update))throw Error(g(12,!1,o));var e=k(t,"bootstrap"),n=k(t,"mount"),a=k(t,"unmount");c.status=$e,c.name=o,c.bootstrap=e,c.mount=n,c.unmount=a,c.timeouts=V(t.timeouts),t.update&&(c.update=k(t,"update"),i.update=function(t){return c.customProps=t,D((e=c,Promise.resolve().then((function(){if(e.status!==Qe)throw Error(g(32,!1,O(e)));return e.status=Xe,F(e,"update").then((function(){return e.status=Qe,e})).catch((function(t){throw m(t,e,nn)}))}))));var e})}));var f,p,h=l.then((function(){return _(c,!0)})),d=h.then((function(){return C(c,!0)})),v=new Promise((function(t,e){f=t,p=e}));return i={mount:function(){return D(Promise.resolve().then((function(){if(c.status!==Je)throw Error(g(13,!1,o,c.status));return n.parcels[r]=c,C(c)})))},unmount:function(){return D(c.unmountThisParcel())},getStatus:function(){return c.status},loadPromise:D(l),bootstrapPromise:D(h),mountPromise:D(d),unmountPromise:D(v)}},D=function(t){return t.then((function(){return null}))},N=function(t){var e=O(t),n="function"==typeof t.customProps?t.customProps(e,window.location):t.customProps;("object"!=(void 0===n?"undefined":a(n))||null===n||Array.isArray(n))&&(n={},console.warn(g(40,!1),e,n));var r=x({},n,{name:e,mountParcel:M.bind(t),singleSpa:Ve});return S(t)&&(r.unmountSelf=t.unmountThisParcel),r},R=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(g(16,!1));cn.bootstrap={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},L=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(g(17,!1));cn.mount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},U=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(g(18,!1));cn.unmount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},B=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(g(19,!1));cn.unload={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},F=function(t,e){var n=t.timeouts[e],r=n.warningMillis,o=E(t);return new Promise((function(i,a){var u=!1,s=!1;t[e](N(t)).then((function(t){u=!0,i(t)})).catch((function(t){u=!0,a(t)})),setTimeout((function(){return l(1)}),r),setTimeout((function(){return l(!0)}),n.millis);var c=g(31,!1,e,o,O(t),n.millis);function l(t){if(!u)if(!0===t)s=!0,n.dieOnTimeout?a(Error(c)):console.error(c);else if(!s){var e=t,o=e*r;console.warn(c),o+r<n.millis&&setTimeout((function(){return l(e+1)}),r)}}}))},V=function(t){var e={};for(var n in cn)e[n]=x({},cn[n],t&&t[n]||{});return e},z=function(t){return Promise.resolve().then((function(){return t.loadPromise?t.loadPromise:t.status!==Ge&&t.status!==en?t:(t.status=Ke,t.loadPromise=Promise.resolve().then((function(){var r=t.loadApp(N(t));if(!A(r))throw n=!0,Error(g(33,!1,O(t)));return r.then((function(n){var r;t.loadErrorTime=null,"object"!=(void 0===(e=n)?"undefined":a(e))&&(r=34),Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!j(e.bootstrap)&&(r=35),j(e.mount)||(r=36),j(e.unmount)||(r=37);var o=E(e);if(r){var i;try{i=JSON.stringify(e)}catch(t){}return console.error(g(r,!1,o,O(t),i),e),d(void 0,t,nn),t}return e.devtools&&e.devtools.overlays&&(t.devtools.overlays=x({},t.devtools.overlays,e.devtools.overlays)),t.status=$e,t.bootstrap=k(e,"bootstrap"),t.mount=k(e,"mount"),t.unmount=k(e,"unmount"),t.unload=k(e,"unload"),t.timeouts=V(e.timeouts),delete t.loadPromise,t}))})).catch((function(e){var r;return delete t.loadPromise,n?r=nn:(r=en,t.loadErrorTime=(new Date).getTime()),d(e,t,r),t})));var e,n}))},H=function(t){var e;if("string"==typeof t)e=t;else if(this&&this.href)e=this.href;else{if(!(t&&t.currentTarget&&t.currentTarget.href&&t.preventDefault))throw Error(g(14,!1));e=t.currentTarget.href,t.preventDefault()}var n=q(window.location.href),r=q(e);0===e.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=e:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,e)},W=function(t){var e=this;if(t){var n=t[0].type;pn.indexOf(n)>=0&&fn[n].forEach((function(n){try{n.apply(e,t)}catch(t){setTimeout((function(){throw t}))}}))}},G=function(){Sn([],arguments)},K=function(t,e){return function(){var n=window.location.href,r=t.apply(this,arguments),o=window.location.href;return Fe&&n===o||window.dispatchEvent(function(t,e){var n;try{n=new PopStateEvent("popstate",{state:t})}catch(e){(n=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,t)}return n.singleSpa=!0,n.singleSpaTrigger=e,n}(window.history.state,e)),r}},$=function(t){if(dn)throw Error(g(43,!1));Fe=!t||!t.hasOwnProperty("urlRerouteOnly")||t.urlRerouteOnly,dn=!0,hn=window.history.replaceState,window.addEventListener("hashchange",G),window.addEventListener("popstate",G);var e=window.addEventListener,n=window.removeEventListener;window.addEventListener=function(t,n){if(!("function"==typeof n&&pn.indexOf(t)>=0)||P(fn[t],(function(t){return t===n})))return e.apply(this,arguments);fn[t].push(n)},window.removeEventListener=function(t,e){if(!("function"==typeof e&&pn.indexOf(t)>=0))return n.apply(this,arguments);fn[t]=fn[t].filter((function(t){return t!==e}))},window.history.pushState=K(window.history.pushState,"pushState"),window.history.replaceState=K(hn,"replaceState")},q=function(t){var e=document.createElement("a");return e.href=t,e},J=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!vn){var e=t.fn.on,n=t.fn.off;t.fn.on=function(t,n){return Y.call(this,e,window.addEventListener,t,n,arguments)},t.fn.off=function(t,e){return Y.call(this,n,window.removeEventListener,t,e,arguments)},vn=!0}},Y=function(t,e,n,r,o){return"string"!=typeof n?t.apply(this,o):(n.split(/\s+/).forEach((function(t){pn.indexOf(t)>=0&&(e(t,r),n=n.replace(t,""))})),""===n.trim()?this:t.apply(this,o))},Q=function(t){return Promise.resolve().then((function(){var e=yn[O(t)];if(!e)return t;if(t.status===Ge)return X(t,e),t;if(t.status===tn)return e.promise.then((function(){return t}));if(t.status!==Je&&t.status!==en)return t;var n=t.status===en?Promise.resolve():F(t,"unload");return t.status=tn,n.then((function(){return X(t,e),t})).catch((function(n){return function(t,e,n){delete yn[O(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,d(n,t,nn),e.reject(n)}(t,e,n),t}))}))},X=function(t,e){delete yn[O(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=Ge,e.resolve()},Z=function(t,e,n,r){yn[O(t)]={app:t,resolve:n,reject:r},Object.defineProperty(yn[O(t)],"promise",{get:e})},tt=function(t){return yn[t]},et=function(){return gn.filter(b).map(O)},nt=function(){return gn.map(O)},rt=function(t){var e=P(gn,(function(e){return O(e)===t}));return e?e.status:null},ot=function(t,e,n,r){var o=function(t,e,n,r){var o,i={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"==(void 0===t?"undefined":a(t))?(function(t){if(Array.isArray(t)||null===t)throw Error(g(39,!1));var e=["name","app","activeWhen","customProps"],n=Object.keys(t).reduce((function(t,n){return e.indexOf(n)>=0?t:t.concat(n)}),[]);if(0!==n.length)throw Error(g(38,!1,e.join(", "),n.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(g(20,!1));if("object"!=a(t.app)&&"function"!=typeof t.app)throw Error(g(20,!1));var r=function(t){return"string"==typeof t||"function"==typeof t};if(!(r(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(r)))throw Error(g(24,!1));if(!ct(t.customProps))throw Error(g(22,!1))}(t),i.name=t.name,i.loadApp=t.app,i.activeWhen=t.activeWhen,i.customProps=t.customProps):(function(t,e,n,r){if("string"!=typeof t||0===t.length)throw Error(g(20,!1));if(!e)throw Error(g(23,!1));if("function"!=typeof n)throw Error(g(24,!1));if(!ct(r))throw Error(g(22,!1))}(t,e,n,r),i.name=t,i.loadApp=e,i.activeWhen=n,i.customProps=r),i.loadApp="function"!=typeof(o=i.loadApp)?function(){return Promise.resolve(o)}:o,i.customProps=function(t){return t||{}}(i.customProps),i.activeWhen=function(t){var e=Array.isArray(t)?t:[t];return e=e.map((function(t){return"function"==typeof t?t:lt(t)})),function(t){return e.some((function(e){return e(t)}))}}(i.activeWhen),i}(t,e,n,r);if(dt()||mn||(mn=!0,setTimeout((function(){dt()||console.warn(g(1,!1))}),5e3)),-1!==nt().indexOf(o.name))throw Error(g(21,!1,o.name));gn.push(x({loadErrorTime:null,status:Ge,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},o)),ln&&(J(),Sn())},it=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return gn.filter((function(e){return e.activeWhen(t)})).map(O)},at=function(t){if(0===gn.filter((function(e){return O(e)===t})).length)throw Error(g(25,!1,t));return(ln?ut(t,{waitForUnmount:!1}):Promise.resolve()).then((function(){var e=gn.map(O).indexOf(t);gn.splice(e,1)}))},ut=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof t)throw Error(g(26,!1));var n=P(gn,(function(e){return O(e)===t}));if(!n)throw Error(g(27,!1,t));var r,o=tt(O(n));if(e&&e.waitForUnmount){if(o)return o.promise;var i=new Promise((function(t,e){Z(n,(function(){return i}),t,e)}));return i}return o?(r=o.promise,st(n,o.resolve,o.reject)):r=new Promise((function(t,e){Z(n,(function(){return r}),t,e),st(n,t,e)})),r},st=function(t,e,n){Promise.resolve().then((function(){if(P(it(),(function(e){return e===O(t)})))return ft()})).then((function(){return T(t).then(Q).then((function(){e(),setTimeout((function(){Sn()}))}))})).catch(n)},ct=function(t){return!t||"function"==typeof t||"object"==(void 0===t?"undefined":a(t))&&null!==t&&!Array.isArray(t)},lt=function(t,e){var n=function(t,e){var n=0,r=!1,o="^";"/"!==t[0]&&(t="/"+t);for(var i=0;i<t.length;i++){var a=t[i];(!r&&":"===a||r&&"/"===a)&&u(i)}return u(t.length),new RegExp(o,"i");function u(i){var a=t.slice(n,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":a,i===t.length)if(r)e&&(o+="$");else{var u=e?"":".*";o="/"===o.charAt(o.length-1)?"".concat(o).concat(u,"$"):"".concat(o,"(/").concat(u,")?(#.*)?$")}r=!r,n=i}}(t,e);return function(t){var e=t.origin;e||(e="".concat(t.protocol,"//").concat(t.host));var r=t.href.replace(e,"").replace(t.search,"").split("?")[0];return n.test(r)}},ft=function(){return Sn()},pt=function(t,e){return w(t)?_(t).then((function(t){return e.then((function(){return w(t)?C(t):t}))})):e.then((function(){return t}))},ht=function(t){En=!0,ln&&($(t),Sn())},dt=function(){return En},vt=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},yt=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},gt=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},mt=function(){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(t){return!1}},bt=function(t){return t&&t.startsWith("http")?t:("/"!==t[0]&&(t="/"+t),window.openmrsBase+t)},wt=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof t)throw Error("The first argument to @openmrs/api's openmrsFetch function must be a url string");if("object"!=(void 0===e?"undefined":a(e)))throw Error("The second argument to @openmrs/api's openmrsFetch function must be a plain object.");if(!window.openmrsBase)throw Error("@openmrs/api is running in a browser that doesn't have window.openmrsBase, which is provided by openmrs-module-spa's HTML file.");var n=bt(t);if(e.headers||(e.headers={}),Re(e.body)&&(e.body=JSON.stringify(e.body)),void 0===e.headers.Accept&&(e.headers.Accept="application/json"),null===e.headers.Accept&&delete e.headers.Accept,t.startsWith(Tn)&&void 0===e.headers["Disable-WWW-Authenticate"]&&(e.headers["Disable-WWW-Authenticate"]="true"),t.startsWith(Cn)){var r=new URL(n,window.location.toString());r.searchParams.has("_summary")||(r.searchParams.set("_summary","data"),n=r.toString())}var o,i,u=Error();return window.fetch(n,e).then((o=function(t){var e,r;return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(o){switch(o.label){case 0:return(e=t).ok?204===e.status?(e.data=null,[2,e]):[2,e.clone().text().then((function(t){try{t&&(e.data=JSON.parse(t))}catch(t){}return e}))]:[3,1];case 1:return[4,(0,Le.getConfig)("@openmrs/esm-api")];case 2:return r=o.sent().redirectAuthFailure,n===bt(In)&&403===e.status||r.enabled&&r.errors.includes(e.status)?(sessionStorage.removeItem(Pn),(0,Ue.navigate)({to:r.url}),[2,r.resolvePromise?Promise.resolve():new Promise((function(){}))]):[2,e.clone().text().then((function(t){var r=t;try{r=JSON.parse(t)}catch(t){}throw new Mn(n,e,r,u)}),(function(t){throw new Mn(n,e,null,u)}))];case 3:return[2]}}))},i=function(){var t=this,e=arguments;return new Promise((function(n,r){var i=o.apply(t,e);function a(t){yt(i,n,r,a,u,"next",t)}function u(t){yt(i,n,r,a,u,"throw",t)}a(void 0)}))},function(t){return i.apply(this,arguments)}))},Ot=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"!=(void 0===e?"undefined":a(e)))throw Error("The second argument to openmrsObservableFetch must be either omitted or an object");var n=new AbortController;return e.signal=n.signal,new we((function(r){var o=!1;return wt(t,e).then((function(t){o=!0,r.next(t),r.complete()}),(function(t){o=!0,r.error(t)})),function(){o||n.abort()}}))},St=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},Et=function(t,e){return wt("".concat(Dn,"/").concat(t),{signal:e.signal})},xt=function(t,e,n){return wt("".concat(Dn,"?patient=").concat(t,"&includeEncounterless=").concat(e),{signal:n.signal})},Pt=function(t,e){return Nn.apply(this,arguments)},jt=function(t,e){return wt("".concat(Dn,"/").concat(t),{method:"DELETE",signal:e.signal})},kt=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},At=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){kt(i,r,o,a,u,"next",t)}function u(t){kt(i,r,o,a,u,"throw",t)}a(void 0)}))}},_t=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},Tt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{includeAuthStatus:!0};return(Bn<Date.now()-6e4||!Un.getState().loaded)&&Mt(),new we((function(e){var n=function(n){var r;n.loaded&&(t.includeAuthStatus?e.next(n.session):e.next(null===(r=n.session)||void 0===r?void 0:r.user))};return n(Un.getState()),Un.subscribe(n)}))},Ct=function(){return(Bn<Date.now()-6e4||!Un.getState().loaded)&&Mt(),Un},It=function(t){var e,n,r,o=null!==(r=null==t||null===(e=t.user)||void 0===e||null===(n=e.userProperties)||void 0===n?void 0:n.defaultLocale)&&void 0!==r?r:t.locale,i=document.documentElement.getAttribute("lang");(function(t){if(void 0===t||"string"!=typeof t)return!1;try{new Intl.Locale(t)}catch(t){return!1}return!0})(o)&&o!==i&&document.documentElement.setAttribute("lang",o)},Mt=function(t,e){Bn=Date.now();var n={};return t&&e&&(n.Authorization="Basic ".concat(window.btoa("".concat(t,":").concat(e)))),Ft(wt(In,{headers:n}))},Dt=function(){Un.setState({loaded:!0,session:{authenticated:!1,sessionId:""}})},Nt=function(t,e){return void 0===e?Boolean(t):!Boolean(t)||function(t,e){return"string"==typeof t?!Ln(e.privileges.find((function(e){return t===e.display}))):Array.isArray(t)?t.every((function(t){return!Ln(e.privileges.find((function(e){return t===e.display})))})):(Ln(t)||console.error('Could not understand privileges "'.concat(t,'"')),!0)}(t,e)||function(t){return!Ln(t.roles.find((function(t){return"System Developer"===t.display})))}(e)},Rt=function(){var t,e;return new Promise((function(n){var r=function(r){r.loaded&&r.session.user&&(t=r.session.user,n(r.session.user),e&&e())};r(Un.getState()),t||(e=Un.subscribe(r))}))},Lt=function(){return new Promise((function(t,e){Tt().subscribe((function(e){t(e.sessionLocation)}),e).unsubscribe()}))},Ut=function(t,e){return Fn.apply(this,arguments)},Bt=function(t,e,n){return Vn.apply(this,arguments)},Ft=function(t){return new Promise((function(e,n){t.then((function(t){var r;"object"==a(null==t?void 0:t.data)?(r={loaded:!0,session:t.data},Un.setState(r),e(r)):(r={loaded:!1,session:null},Un.setState(r),n(r))})).catch((function(t){(0,Rn.reportError)("Failed to fetch new session information: ".concat(t));var e={loaded:!1,session:null};Un.setState(e),n(e)}))}))},Vt=function(){(0,Le.defineConfigSchema)("@openmrs/esm-api",{redirectAuthFailure:{enabled:{_type:Le.Type.Boolean,_default:!0,_description:"Whether to redirect logged-out users to `redirectAuthFailure.url`"},url:{_type:Le.Type.String,_default:"${openmrsSpaBase}/login",_validators:[Le.validators.isUrl]},errors:{_type:Le.Type.Array,_default:[401],_elements:{_type:Le.Type.Number,_validators:[Le.validators.inRange(100,600)]},_description:"The HTTP error codes for which users will be redirected"},resolvePromise:{_type:Le.Type.Boolean,_default:!1,_description:"Changes how requests that fail authentication are handled. Try messing with this if redirects to the login page aren't working correctly."}}}),Mt()},zt=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},Ht=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},Wt=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Ht(i,r,o,a,u,"next",t)}function u(t){Ht(i,r,o,a,u,"throw",t)}a(void 0)}))}},Gt=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return zt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zt(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},Kt=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},$t=function(t,e){return Hn.apply(this,arguments)},qt=function(t){return Wn.apply(this,arguments)},Jt=function(t){return function(e){return 0===t?Xn:e.lift(new Zn(t))}},Yt=function(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new er(t,e))}},Qt=function(){return(0,Be.getGlobalStore)("visit",or)},Xt=function(t,e){Qt().setState({patientUuid:t,manuallySetVisitUuid:e})},Zt=function(t,e,n){var r=null!=n?n:rr;return Ot("".concat(Tn,"/visit?patient=").concat(t,"&v=").concat(r),{signal:e.signal,method:"GET",headers:{"Content-type":"application/json"}}).pipe(Jt(1)).pipe(Yt((function(t){return t})))},te=function(t,e){return Ot("".concat(Tn,"/visit"),{signal:e.signal,method:"POST",headers:{"Content-type":"application/json"},body:t})},ee=function(t,e,n){return Ot("".concat(Tn,"/visit/").concat(t),{signal:n.signal,method:"POST",headers:{"Content-type":"application/json"},body:e})},ne=function(t){return{uuid:t.uuid,display:t.display,name:t.name}},re=function(){return Ot("".concat(Tn,"/visittype")).pipe(Yt((function(t){return t.data.results.map(ne)}))).pipe(Jt(1))},oe=function(t){return{uuid:t.uuid,display:t.display}},ie=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return Ot("".concat(Tn,"/location")+(t?"?tag="+t:"")).pipe(Yt((function(t){return t.data.results.map(oe)}))).pipe(Jt(1))};f.r(p),f.d(p,{OpenmrsFetchError:function(){return Mn},VisitMode:function(){return ir},VisitStatus:function(){return ar},attachmentUrl:function(){return Dn},backendDependencies:function(){return sr},clearCurrentUser:function(){return Dt},createAttachment:function(){return Pt},defaultVisitCustomRepresentation:function(){return rr},deleteAttachmentPermanently:function(){return jt},fetchCurrentPatient:function(){return $t},fhirBaseUrl:function(){return Cn},getAttachmentByUuid:function(){return Et},getAttachments:function(){return xt},getCurrentUser:function(){return Tt},getLocations:function(){return ie},getLoggedInUser:function(){return Rt},getSessionLocation:function(){return Lt},getSessionStore:function(){return Ct},getStartedVisit:function(){return ur},getVisitStore:function(){return Qt},getVisitTypes:function(){return re},getVisitsForPatient:function(){return Zt},makeUrl:function(){return bt},openmrsFetch:function(){return wt},openmrsObservableFetch:function(){return Ot},refetchCurrentUser:function(){return Mt},restBaseUrl:function(){return Tn},saveVisit:function(){return te},sessionEndpoint:function(){return In},setCurrentVisit:function(){return Xt},setSessionLocation:function(){return Ut},setUserLanguage:function(){return It},setUserProperties:function(){return Bt},setupApiModule:function(){return Vt},toLocationObject:function(){return oe},toVisitTypeObject:function(){return ne},updateVisit:function(){return ee},userHasAccess:function(){return Nt}});var ae,ue,se=function(t,e){return se=Object.setPrototypeOf||i({__proto__:[]},Array)&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},se(t,e)},ce=!1,le={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack,ce=t},get useDeprecatedSynchronousErrorHandling(){return ce}},fe={closed:!0,next:function(t){},error:function(t){if(le.useDeprecatedSynchronousErrorHandling)throw t;u(t)},complete:function(){}},pe=Array.isArray||function(t){return t&&"number"==typeof t.length},he=function(){function t(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t}(),de=he,ve=function(){function t(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}return t.prototype.unsubscribe=function(){var n;if(!this.closed){var r=this,o=r._parentOrParents,a=r._ctorUnsubscribe,u=r._unsubscribe,l=r._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,i(o,t))o.remove(this);else if(null!==o)for(var f=0;f<o.length;++f)o[f].remove(this);if(e(u)){a&&(this._unsubscribe=void 0);try{u.call(this)}catch(t){n=i(t,de)?c(t.errors):[t]}}if(pe(l)){f=-1;for(var p=l.length;++f<p;){var h=l[f];if(s(h))try{h.unsubscribe()}catch(t){n=n||[],i(t,de)?n=n.concat(c(t.errors)):n.push(t)}}}if(n)throw new de(n)}},t.prototype.add=function(e){var n=e;if(!e)return t.EMPTY;switch(void 0===e?"undefined":a(e)){case"function":n=new t(e);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!i(n,t)){var r=n;(n=new t)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var o=n._parentOrParents;if(null===o)n._parentOrParents=this;else if(i(o,t)){if(o===this)return n;n._parentOrParents=[o,this]}else{if(-1!==o.indexOf(this))return n;o.push(this)}var u=this._subscriptions;return null===u?this._subscriptions=[n]:u.push(n),n},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}},t.EMPTY=function(t){return t.closed=!0,t}(new t),t}(),ye="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random(),ge=function(e){function n(t,r,o){var u=e.call(this)||this;switch(u.syncErrorValue=null,u.syncErrorThrown=!1,u.syncErrorThrowable=!1,u.isStopped=!1,arguments.length){case 0:u.destination=fe;break;case 1:if(!t){u.destination=fe;break}if("object"==(void 0===t?"undefined":a(t))){i(t,n)?(u.syncErrorThrowable=t.syncErrorThrowable,u.destination=t,t.add(u)):(u.syncErrorThrowable=!0,u.destination=new me(u,t));break}default:u.syncErrorThrowable=!0,u.destination=new me(u,t,r,o)}return u}return t(n,e),n.prototype[ye]=function(){return this},n.create=function(t,e,r){var o=new n(t,e,r);return o.syncErrorThrowable=!1,o},n.prototype.next=function(t){this.isStopped||this._next(t)},n.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},n.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},n.prototype._next=function(t){this.destination.next(t)},n.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},n.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},n.prototype._unsubscribeAndRecycle=function(){var t=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this},n}(ve),me=function(n){function r(t,r,o,i){var a,u=n.call(this)||this;u._parentSubscriber=t;var s=u;return e(r)?a=r:r&&(a=r.next,o=r.error,i=r.complete,r!==fe&&(e((s=Object.create(r)).unsubscribe)&&u.add(s.unsubscribe.bind(s)),s.unsubscribe=u.unsubscribe.bind(u))),u._context=s,u._next=a,u._error=o,u._complete=i,u}return t(r,n),r.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;le.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},r.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,n=le.useDeprecatedSynchronousErrorHandling;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):u(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;u(t)}}},r.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var n=function(){return t._complete.call(t._context)};le.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},r.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),le.useDeprecatedSynchronousErrorHandling)throw t;u(t)}},r.prototype.__tryOrSetError=function(t,e,n){if(!le.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(e){return le.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):(u(e),!0)}return!1},r.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},r}(ge),be="function"==typeof Symbol&&Symbol.observable||"@@observable",we=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r=this.operator,o=function(t,e,n){if(t){if(i(t,ge))return t;if(t[ye])return t[ye]()}return t||e||n?new ge(t,e,n):new ge(fe)}(t,e,n);if(r?o.add(r.call(o,this.source)):o.add(this.source||le.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),le.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){le.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),function(t){for(;t;){var e=t,n=e.closed,r=e.destination,o=e.isStopped;if(n||o)return!1;t=r&&i(r,ge)?r:null}return!0}(t)?t.error(e):console.warn(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=h(e))((function(e,r){var o;o=n.subscribe((function(e){try{t(e)}catch(t){r(t),o&&o.unsubscribe()}}),r,e)}))},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[be]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:(0===(n=t).length?l:1===n.length?n[0]:function(t){return n.reduce((function(t,e){return e(t)}),t)})(this);var n},t.prototype.toPromise=function(t){var e=this;return new(t=h(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}(),Oe="object"==(void 0===n.g?"undefined":a(n.g))&&n.g&&n.g.Object===Object&&n.g,Se="object"==("undefined"==typeof self?"undefined":a(self))&&self&&self.Object===Object&&self,Ee=(Oe||Se||Function("return this")()).Symbol,xe=Object.prototype,Pe=xe.hasOwnProperty,je=xe.toString,ke=Ee?Ee.toStringTag:void 0,Ae=Object.prototype.toString,_e=Ee?Ee.toStringTag:void 0,Te=(ae=Object.getPrototypeOf,ue=Object,function(t){return ae(ue(t))}),Ce=Function.prototype,Ie=Object.prototype,Me=Ce.toString,De=Ie.hasOwnProperty,Ne=Me.call(Object),Re=function(t){if(!function(t){return null!=t&&"object"==(void 0===t?"undefined":a(t))}(t)||"[object Object]"!=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":_e&&_e in Object(t)?function(t){var e=Pe.call(t,ke),n=t[ke];try{t[ke]=void 0;var r=!0}catch(t){}var o=je.call(t);return r&&(e?t[ke]=n:delete t[ke]),o}(t):function(t){return Ae.call(t)}(t)}(t))return!1;var e=Te(t);if(null===e)return!0;var n=De.call(e,"constructor")&&e.constructor;return"function"==typeof n&&i(n,n)&&Me.call(n)==Ne},Le=f(824),Ue=f(513),Be=f(385);(0,Be.createGlobalStore)("breadcrumbs",[]);var Fe,Ve=Object.freeze({__proto__:null,get start(){return ht},get ensureJQuerySupport(){return J},get setBootstrapMaxTime(){return R},get setMountMaxTime(){return L},get setUnmountMaxTime(){return U},get setUnloadMaxTime(){return B},get registerApplication(){return ot},get unregisterApplication(){return at},get getMountedApps(){return et},get getAppStatus(){return rt},get unloadApplication(){return ut},get checkActivityFunctions(){return it},get getAppNames(){return nt},get pathToActiveWhen(){return lt},get navigateToUrl(){return H},get patchHistoryApi(){return $},get triggerAppChange(){return ft},get addErrorHandler(){return v},get removeErrorHandler(){return y},get mountRootParcel(){return I},get NOT_LOADED(){return Ge},get LOADING_SOURCE_CODE(){return Ke},get NOT_BOOTSTRAPPED(){return $e},get BOOTSTRAPPING(){return qe},get NOT_MOUNTED(){return Je},get MOUNTING(){return Ye},get UPDATING(){return Xe},get LOAD_ERROR(){return en},get MOUNTED(){return Qe},get UNLOADING(){return tn},get UNMOUNTING(){return Ze},get SKIP_BECAUSE_BROKEN(){return nn}}),ze=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).CustomEvent,He=function(){try{var t=new ze("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?ze:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(t,e){var n=document.createEvent("CustomEvent");return e?n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail):n.initCustomEvent(t,!1,!1,void 0),n}:function(t,e){var n=document.createEventObject();return n.type=t,e?(n.bubbles=Boolean(e.bubbles),n.cancelable=Boolean(e.cancelable),n.detail=e.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n},We=[],Ge="NOT_LOADED",Ke="LOADING_SOURCE_CODE",$e="NOT_BOOTSTRAPPED",qe="BOOTSTRAPPING",Je="NOT_MOUNTED",Ye="MOUNTING",Qe="MOUNTED",Xe="UPDATING",Ze="UNMOUNTING",tn="UNLOADING",en="LOAD_ERROR",nn="SKIP_BECAUSE_BROKEN",rn=[],on=!1,an=!1,un=0,sn={parcels:{}},cn={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}},ln="undefined"!=typeof window,fn={hashchange:[],popstate:[]},pn=["hashchange","popstate"],hn=null,dn=!1;ln&&(window.singleSpaNavigate?console.warn(g(41,!1)):window.singleSpaNavigate=H);var vn=!1,yn={},gn=[],mn=!1,bn=!1,wn=[],On=ln&&window.location.href;function Sn(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(bn)return new Promise((function(t,n){wn.push({resolve:t,reject:n,eventArguments:e})}));var r,i=function(){var t=[],e=[],n=[],r=[],o=(new Date).getTime();return gn.forEach((function(i){var a=i.status!==nn&&w(i);switch(i.status){case en:a&&o-i.loadErrorTime>=200&&n.push(i);break;case Ge:case Ke:a&&n.push(i);break;case $e:case Je:!a&&tt(O(i))?t.push(i):a&&r.push(i);break;case Qe:a||e.push(i)}})),{appsToUnload:t,appsToUnmount:e,appsToLoad:n,appsToMount:r}}(),a=i.appsToUnload,u=i.appsToUnmount,s=i.appsToLoad,c=i.appsToMount,l=[],f=On,p=On=window.location.href;return dt()?(bn=!0,r=a.concat(s,u,c),Promise.resolve().then((function(){return m(0===r.length?"before-no-app-change":"before-app-change",y(!0)),m("before-routing-event",y(!0,{cancelNavigation:h})),Promise.all(l).then((function(n){if(n.some((function(t){return t})))return hn.call(window.history,history.state,"",f.substring(location.origin.length)),On=location.href,bn=!1,Sn(t,e,!0);var r=a.map(Q),o=u.map(T).map((function(t){return t.then(Q)})).concat(r),i=Promise.all(o);i.then((function(){m("before-mount-routing-event",y(!0))}),(function(t){throw t}));var l=s.map((function(t){return z(t).then((function(t){return pt(t,i)}))})),p=c.filter((function(t){return s.indexOf(t)<0})).map((function(t){return pt(t,i)}));return i.catch((function(t){throw v(),t})).then((function(){return v(),Promise.all(l.concat(p)).catch((function(e){throw t.forEach((function(t){return t.reject(e)})),e})).then(d).then((function(){}),(function(t){throw t}))}))}))}))):(r=s,Promise.resolve().then((function(){var t=s.map(z);return Promise.all(t).then(v).then((function(){return[]})).catch((function(t){throw v(),t})).finally((function(){}))})));function h(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e="function"==typeof(null==t?void 0:t.then)?t:Promise.resolve(t);l.push(e.catch((function(t){return console.warn(Error(g(42,!1))),console.warn(t),!1})))}function d(){var e=et();t.forEach((function(t){return t.resolve(e)}));try{m(0===r.length?"no-app-change":"app-change",y()),m("routing-event",y())}catch(t){setTimeout((function(){throw t}))}if(bn=!1,wn.length>0){var n=wn;wn=[],Sn(n)}return e}function v(){n||(t.forEach((function(t){W(t.eventArguments)})),W(e))}function y(){var t,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1?arguments[1]:void 0,l={},h=(o(t={},Qe,[]),o(t,Je,[]),o(t,Ge,[]),o(t,nn,[]),t);n?(s.concat(c).forEach((function(t,e){v(t,Qe)})),a.forEach((function(t){v(t,Ge)})),u.forEach((function(t){v(t,Je)}))):r.forEach((function(t){v(t)}));var d={detail:{newAppStatuses:l,appsByNewStatus:h,totalAppChanges:r.length,originalEvent:null==e?void 0:e[0],oldUrl:f,newUrl:p}};return i&&x(d.detail,i),d;function v(t,e){var n=O(t);e=e||rt(n),l[n]=e,(h[e]=h[e]||[]).push(n)}}function m(t,e){n||window.dispatchEvent(new He("single-spa:".concat(t),e))}}var En=!1,xn={getRawAppData:function(){return function(t){if(Array.isArray(t))return r(t)}(t=gn)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(t)||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.")}();var t},reroute:Sn,NOT_LOADED:Ge,toLoadPromise:z,toBootstrapPromise:_,unregisterApplication:at,getProfilerData:function(){return rn}};ln&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=xn);var Pn="openmrs:history";function jn(t,e,n){return jn=mt()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&An(o,n.prototype),o},jn.apply(null,arguments)}function kn(t){return kn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},kn(t)}function An(t,e){return An=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},An(t,e)}function _n(t){var e="function"==typeof Map?new Map:void 0;return _n=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return jn(t,arguments,kn(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),An(r,t)},_n(t)}var Tn="/ws/rest/v1",Cn="/ws/fhir2/R4",In="".concat(Tn,"/session"),Mn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&An(t,e)}(o,t);var e,n,r=(e=o,n=mt(),function(){var t,r=kn(e);if(n){var o=kn(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return function(t,e){return!e||"object"!=((n=e)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":void 0===n?"undefined":a(n))&&"function"!=typeof e?vt(t):e;var n}(this,t)});function o(t,e,n,a){var u;return function(t,e){if(!i(t,e))throw new TypeError("Cannot call a class as a function")}(this,o),gt(vt(u=r.call(this)),"response",void 0),gt(vt(u),"responseBody",void 0),u.message="Server responded with ".concat(e.status," (").concat(e.statusText,") for url ").concat(t,". Check err.responseBody or network tab in dev tools for more info"),a.message=u.message,u.responseBody=n,u.response=e,u.stack="Stacktrace for outgoing request:\n".concat(a.stack,"\nStacktrace for incoming response:\n").concat(u.stack),u}return o}(_n(Error)),Dn="".concat(Tn,"/attachment");function Nn(){var t;return t=function(t,e){var n;return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(r){return(n=new FormData).append("fileCaption",e.fileDescription),n.append("patient",t),e.file?n.append("file",e.file):(n.append("file",new File([""],e.fileName),e.fileName),n.append("base64Content",e.base64Content)),[2,wt("".concat(Dn),{method:"POST",body:n})]}))},Nn=function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){St(i,r,o,a,u,"next",t)}function u(t){St(i,r,o,a,u,"throw",t)}a(void 0)}))},Nn.apply(this,arguments)}var Rn=f(254),Ln=function(t){return void 0===t},Un=(0,Be.createGlobalStore)("session",{loaded:!1,session:null}),Bn=0;function Fn(){return(Fn=At((function(t,e){return _t(this,(function(n){return[2,Ft(wt(In,{method:"POST",body:{sessionLocation:t},headers:{"Content-Type":"application/json"},signal:e.signal}))]}))}))).apply(this,arguments)}function Vn(){return(Vn=At((function(t,e,n){return _t(this,(function(r){switch(r.label){case 0:return n||(n=new AbortController),[4,wt("".concat(Tn,"/user/").concat(t),{method:"POST",body:{userProperties:e},headers:{"Content-Type":"application/json"},signal:n.signal})];case 1:return r.sent(),[2,Mt()]}}))}))).apply(this,arguments)}Un.subscribe((function(t){return t.session&&It(t.session)}));var zn=f(738);function Hn(){return Hn=Wt((function(t,e){var n,r,o,i,a,u=arguments;return Kt(this,(function(s){switch(s.label){case 0:return n=!(u.length>2&&void 0!==u[2])||u[2],t?(r=null,[4,Promise.all([wt("".concat(Cn,"/Patient/").concat(t),e).catch((function(t){return r=t})),n?qt(t):Promise.resolve(null)])]):[3,2];case 1:if(o=Gt.apply(void 0,[s.sent(),2]),i=o[0],a=o[1],i.ok)return[2,i.data];if(a)return[2,a];if(r)throw r;s.label=2;case 2:return[2,null]}}))})),Hn.apply(this,arguments)}function Wn(){return(Wn=Wt((function(t){var e,n,r;return Kt(this,(function(o){switch(o.label){case 0:return[4,(0,zn.getSynchronizationItems)("patient-registration")];case 1:return e=o.sent(),n=e.find((function(e){return e.fhirPatient.id===t})),[2,null!==(r=null==n?void 0:n.fhirPatient)&&void 0!==r?r:null]}}))}))).apply(this,arguments)}var Gn=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}(),Kn=function(e){function n(t,n){var r=e.call(this)||this;return r.subject=t,r.subscriber=n,r.closed=!1,r}return t(n,e),n.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}},n}(ve),$n=function(e){function n(t){var n=e.call(this,t)||this;return n.destination=t,n}return t(n,e),n}(ge),qn=function(e){function n(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return t(n,e),n.prototype[ye]=function(){return new $n(this)},n.prototype.lift=function(t){var e=new Jn(this,this);return e.operator=t,e},n.prototype.next=function(t){if(this.closed)throw new Gn;if(!this.isStopped)for(var e=this.observers,n=e.length,r=e.slice(),o=0;o<n;o++)r[o].next(t)},n.prototype.error=function(t){if(this.closed)throw new Gn;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,n=e.length,r=e.slice(),o=0;o<n;o++)r[o].error(t);this.observers.length=0},n.prototype.complete=function(){if(this.closed)throw new Gn;this.isStopped=!0;for(var t=this.observers,e=t.length,n=t.slice(),r=0;r<e;r++)n[r].complete();this.observers.length=0},n.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},n.prototype._trySubscribe=function(t){if(this.closed)throw new Gn;return e.prototype._trySubscribe.call(this,t)},n.prototype._subscribe=function(t){if(this.closed)throw new Gn;return this.hasError?(t.error(this.thrownError),ve.EMPTY):this.isStopped?(t.complete(),ve.EMPTY):(this.observers.push(t),new Kn(this,t))},n.prototype.asObservable=function(){var t=new we;return t.source=this,t},n.create=function(t,e){return new Jn(t,e)},n}(we),Jn=function(e){function n(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return t(n,e),n.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},n.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},n.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},n.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):ve.EMPTY},n}(qn),Yn=function(e){function n(t){var n=e.call(this)||this;return n._value=t,n}return t(n,e),Object.defineProperty(n.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),n.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return n&&!n.closed&&t.next(this._value),n},n.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new Gn;return this._value},n.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},n}(qn),Qn=function(){function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t}(),Xn=new we((function(t){return t.complete()})),Zn=function(){function t(t){if(this.total=t,this.total<0)throw new Qn}return t.prototype.call=function(t,e){return e.subscribe(new tr(t,this.total))},t}(),tr=function(e){function n(t,n){var r=e.call(this,t)||this;return r.total=n,r.count=0,r}return t(n,e),n.prototype._next=function(t){var e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))},n}(ge),er=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new nr(t,this.project,this.thisArg))},t}(),nr=function(e){function n(t,n,r){var o=e.call(this,t)||this;return o.project=n,o.count=0,o.thisArg=r||o,o}return t(n,e),n.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},n}(ge),rr="custom:(uuid,display,voided,indication,startDatetime,stopDatetime,encounters:(uuid,display,encounterDatetime,form:(uuid,name),location:ref,encounterType:ref,encounterProviders:(uuid,display,provider:(uuid,display))),patient:(uuid,display),visitType:(uuid,name,display),attributes:(uuid,display,attributeType:(name,datatypeClassname,uuid),value),location:(uuid,name,display))",or=function(){try{return JSON.parse(localStorage.getItem("openmrs:visitStoreState")||"null")}catch(t){return null}}()||{patientUuid:null,manuallySetVisitUuid:null};Qt().subscribe((function(t){var e;e=t,localStorage.setItem("openmrs:visitStoreState",JSON.stringify(e))}));var ir,ar,ur=new Yn(null);!function(t){t.NEWVISIT="startVisit",t.EDITVISIT="editVisit",t.LOADING="loadingVisit"}(ir||(ir={})),function(t){t.NOTSTARTED="notStarted",t.ONGOING="ongoing"}(ar||(ar={}));var sr={"webservices.rest":"2.24.0",fhir2:"1.0.0-SNAPSHOT"}}(),p}())}}}))},7274:()=>{function t(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}System.register(["@openmrs/esm-state"],(function(e,n){var r={};return{setters:[function(t){r.createGlobalStore=t.createGlobalStore,r.getGlobalStore=t.getGlobalStore}],execute:function(){e(function(){"use strict";var e={685:function(t){t.exports=r}},n={};function o(t){var r=n[t];if(void 0!==r)return r.exports;var i=n[t]={exports:{}};return e[t](i,i.exports,o),i.exports}o.d=function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};return function(){var e=function(e){return null!=e&&"object"==(void 0===e?"undefined":t(e))&&!0===e["@@functional/placeholder"]},n=function(t){return function n(r){return 0===arguments.length||e(r)?n:t.apply(this,arguments)}},r=function(t){return function r(o,i){switch(arguments.length){case 0:return r;case 1:return e(o)?r:n((function(e){return t(o,e)}));default:return e(o)&&e(i)?r:e(o)?n((function(e){return t(e,i)})):e(i)?n((function(e){return t(o,e)})):t(o,i)}}},a=function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n},u=function(t,e,n){for(var r=0,o=n.length;r<o;){if(t(e,n[r]))return!0;r+=1}return!1},s=function(t,e){return Object.prototype.hasOwnProperty.call(e,t)},c=function(t,e,n,r){var o=a(t);function i(t,e){return ft(t,e,n.slice(),r.slice())}return!u((function(t,e){return!u(i,e,t)}),a(e),o)},l=function(t){return function o(i,a,u){switch(arguments.length){case 0:return o;case 1:return e(i)?o:r((function(e,n){return t(i,e,n)}));case 2:return e(i)&&e(a)?o:e(i)?r((function(e,n){return t(e,a,n)})):e(a)?r((function(e,n){return t(i,e,n)})):n((function(e){return t(i,a,e)}));default:return e(i)&&e(a)&&e(u)?o:e(i)&&e(a)?r((function(e,n){return t(e,n,u)})):e(i)&&e(u)?r((function(e,n){return t(e,a,n)})):e(a)&&e(u)?r((function(e,n){return t(i,e,n)})):e(i)?n((function(e){return t(e,a,u)})):e(a)?n((function(e){return t(i,e,u)})):e(u)?n((function(e){return t(i,a,e)})):t(i,a,u)}}},f=function(t){return"[object Object]"===Object.prototype.toString.call(t)},p=function(t,e,n){for(var r=n.next();!r.done;){if((e=t["@@transducer/step"](e,r.value))&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}r=n.next()}return t["@@transducer/result"](e)},h=function(t,e,n,r){return t["@@transducer/result"](n[r](xt(t["@@transducer/step"],t),e))},d=function(t,e){return function(n){if(!t(n))return"function"==typeof e?e(n):e}},v=function(t){return(0,Mt.getGlobalStore)("config-module-".concat(t),{config:null,loaded:!1,translationOverridesLoaded:!1})},y=function(){return(0,Mt.getGlobalStore)("config-extension-slots",{slots:{}})},g=function(t){return m(y().getState(),t)},m=function(t,e){var n=t.slots[e];return null!=n?n:{loaded:!1,config:{}}},b=function(){return(0,Mt.getGlobalStore)("config-extensions",{configs:{}})},w=function(t,e){var n=Object.assign({},O(b().getState(),t,e));return n.config=yt(["Display conditions","Translation overrides"],n.config),n},O=function(t,e,n){var r,o=null===(r=t.configs[e])||void 0===r?void 0:r[n];return null!=o?o:{loaded:!1,config:null}},S=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},E=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},x=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){E(t,e,n[e])}))}return t},P=function(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e.push.apply(e,n)}return e}(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},j=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t,e)||A(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},k=function(t){return function(t){if(Array.isArray(t))return S(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||A(t)||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.")}()},A=function(t,e){if(t){if("string"==typeof t)return S(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(t,e):void 0}},_=function(t,e){var n=!0,r=!1,o=void 0;try{for(var i,a=Object.keys(t.schemas)[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var u=i.value,s=v(u);if(t.moduleLoaded[u]){var c=W(u,t,e);s.setState({translationOverridesLoaded:!0,loaded:!0,config:c})}else{var l=G(u,t,e);s.setState({translationOverridesLoaded:!0,loaded:!1,config:l})}}}catch(t){r=!0,o=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}},T=function(t,e){var n,r,o=(n=$(H(t,e)),function(t){var e=!0,n=!1,r=void 0;try{for(var o,i=Object.entries(t)[Symbol.iterator]();!(e=(o=i.next()).done);e=!0){var a=j(o.value,2),u=a[0],s=a[1],c=!0,l=!1,f=void 0;try{for(var p,h=Object.entries(s)[Symbol.iterator]();!(c=(p=h.next()).done);c=!0){var d=j(p.value,2),v=d[0];z(d[1],u,v)}}catch(t){l=!0,f=t}finally{try{c||null==h.return||h.return()}finally{if(l)throw f}}}}catch(t){n=!0,r=t}finally{try{e||null==i.return||i.return()}finally{if(n)throw r}}}(r=Object.keys(n).reduce((function(t,e){var r,o;return(null===(r=n[e])||void 0===r?void 0:r.extensionSlots)&&(t[e]=null===(o=n[e])||void 0===o?void 0:o.extensionSlots),t}),{})),Object.keys(r).reduce((function(t,e){return x({},t,r[e])}),{})),i=Object.fromEntries(Object.entries(o).map((function(t){var e=j(t,2);return[e[0],{loaded:!0,config:e[1]}]}))),a=y(),u=a.getState(),s={slots:x({},u.slots,i)};pt(u,s)||a.setState(s)},C=function(t,e){var n=function(t,e){var n=Ut(bt(t.schemas)),r=k(t.providedConfigs.map((function(t){return[t.config,t.source]}))).concat([[e.config,"temporary config"]]),o=!0,i=!1,a=void 0;try{for(var u,s=r[Symbol.iterator]();!(o=(u=s.next()).done);o=!0){var c=j(u.value,2);n=$([n,Bt(c[0],c[1])])}}catch(t){i=!0,a=t}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}return n}(t,e);Lt.setState({config:n})},I=function(t,e,n){var r={},o=!0,i=!1,a=void 0;try{for(var u,s=e.mountedExtensions[Symbol.iterator]();!(o=(u=s.next()).done);o=!0){var c=u.value,l=V(c.slotModuleName,c.extensionModuleName,c.slotName,c.extensionId,t,n);r[c.slotName]=P(x({},r[c.slotName]),E({},c.extensionId,{config:l,loaded:!0}))}}catch(t){i=!0,a=t}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}b().setState({configs:r})},M=function(t,e){Ft(t,e);var n=vt(e,Kt);Dt.setState((function(e){return P(x({},e),{schemas:P(x({},e.schemas),E({},t,n)),moduleLoaded:P(x({},e.moduleLoaded),E({},t,!0))})}))},D=function(t){var e=Dt.getState();Dt.setState({schemas:P(x({},e.schemas),E({},t,Kt))})},N=function(t){var e=Dt.getState();Dt.setState({schemas:P(x({},e.schemas),E({},t,Gt))})},R=function(t,e){Ft(t,e);var n=vt(e,Kt),r=Dt.getState();r.schemas[t]&&console.error("Config schema for extension ".concat(t," already exists. If there are multiple extensions with this same name, one will probably crash.")),Dt.setState({schemas:P(x({},r.schemas),E({},t,n))})},L=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"provided";Dt.setState((function(n){return P(x({},n),{providedConfigs:k(n.providedConfigs).concat([{source:e,config:t}])})}))},U=function(t){return new Promise((function(e){var n=function(t){if(t.loaded&&t.config){var n=yt(["Display conditions","Translation overrides"],t.config);e(n),o&&o()}},r=v(t);n(r.getState());var o=r.subscribe(n)}))},B=function(t){return new Promise((function(e){var n=function(t){if(t.translationOverridesLoaded&&t.config){var n,r=null!==(n=t.config["Translation overrides"])&&void 0!==n?n:{};e(r),o&&o()}},r=v(t);n(r.getState());var o=r.subscribe(n)}))},F=function(t,e,n){q(t,e,n);var r=Ht(t,e);return zt(t,r,n),r},V=function(t,e,n,r,o,i){var a,u,s,c,l=function(t){return j(t.split("#"),1)[0]}(r),f=o.schemas[l],p=f?l:e,h=H(o,i),d=K(t,h),v=null!==(c=null==d||null===(a=d.extensionSlots)||void 0===a||null===(u=a[n])||void 0===u||null===(s=u.configure)||void 0===s?void 0:s[r])&&void 0!==c?c:{},y=$([K(p,h),v]),g=null!=f?f:o.schemas[e];q(g,y,p);var m=Ht(g,y);return zt(g,m,p),delete m.extensionSlots,m},z=function(t,e,n){var r="".concat(e,".extensionSlots.").concat(n),o="Extension slot config '".concat(r,"'"),i=Object.keys(t).filter((function(t){return!["add","remove","order","configure"].includes(t)}));i.length&&Z(r,o+"' contains invalid keys '".concat(i.join("', '"),"'")),t.add&&(Array.isArray(t.add)&&t.add.every((function(t){return"string"==typeof t}))||Z(r,o+".add' is invalid. Must be an array of strings (extension IDs)")),t.remove&&(Array.isArray(t.remove)&&t.remove.every((function(t){return"string"==typeof t}))||Z(r,o+".remove' is invalid. Must be an array of strings (extension IDs)")),t.order&&(Array.isArray(t.order)&&t.order.every((function(t){return"string"==typeof t}))||Z(r,o+".order' is invalid. Must be an array of strings (extension IDs)")),t.configure&&(X(t.configure)||Z(r,o+".configure' is invalid. Must be an object with extension IDs for keys"))},H=function(t,e){return k(t.providedConfigs.map((function(t){return t.config}))).concat([e.config])},W=function(t,e,n){var r=e.schemas[t],o=K(t,H(e,n));q(r,o,t);var i=Ht(r,o);return zt(r,i,t),delete i.extensionSlots,i},G=function(t,e,n){var r=K(t,H(e,n)),o=Ht(Kt,r);return zt(Kt,o,t),delete o.extensionSlots,o},K=function(t,e){return $(e.map((function(e){return e[t]})).filter((function(t){return!!t})))},$=function(t){return jt(vt)({},t)},q=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=!0,o=!1,i=void 0;try{for(var a,u=Object.keys(e)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=a.value,c=e[s],l=n+"."+s,f=t[s];t.hasOwnProperty(s)?Vt(f,c,l):"extensionSlots"===s&&""!==n||Z(l,"Unknown config key '".concat(l,"' provided. Ignoring."))}}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}},J=function(t,e,n){e&&Y(t,[{Array:kt,Boolean:At,ConceptUuid:It,Number:_t,Object:Ct,String:Tt,UUID:It,PersonAttributeTypeUuid:It,PatientIdentifierTypeUuid:It}[e]],n)},Y=function(e,n,r){if(n)try{var o=!0,i=!1,a=void 0;try{for(var u,s=n[Symbol.iterator]();!(o=(u=s.next()).done);o=!0){var c=(0,u.value)(r);"string"==typeof c&&Z(e,"object"==(void 0===r?"undefined":t(r))?"Invalid configuration for ".concat(e,": ").concat(c):"Invalid configuration value ".concat(r," for ").concat(e,": ").concat(c))}}catch(e){i=!0,a=e}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}}catch(n){console.error('Skipping invalid validator at "'.concat(e,'". Encountered error\n\t').concat(n))}},Q=function(t){return!!t&&Object.keys(t).filter((function(t){return!["_default","_validators"].includes(t)})).length>0},X=function(e){return"object"==(void 0===e?"undefined":t(e))&&!Array.isArray(e)&&null!==e},Z=function(t,e){var n="".concat(t,":::").concat(e);Wt.has(n)||(console.error(e),Wt.add(n))},tt=function(t){t?Wt.forEach((function(e){e.startsWith(t)&&Wt.delete(e)})):Wt.clear()};o.r(i),o.d(i,{Type:function(){return mt},clearConfigErrors:function(){return tt},configExtensionStore:function(){return Rt},configInternalStore:function(){return Dt},defineConfigSchema:function(){return M},defineExtensionConfigSchema:function(){return R},getConfig:function(){return U},getConfigStore:function(){return v},getExtensionConfig:function(){return w},getExtensionConfigFromStore:function(){return O},getExtensionSlotConfig:function(){return g},getExtensionSlotConfigFromStore:function(){return m},getExtensionSlotsConfigStore:function(){return y},getExtensionsConfigStore:function(){return b},getTranslationOverrides:function(){return B},implementerToolsConfigStore:function(){return Lt},inRange:function(){return $t},isUrl:function(){return Jt},isUrlWithTemplateParameters:function(){return qt},oneOf:function(){return Yt},processConfig:function(){return F},provide:function(){return L},registerModuleWithConfigSystem:function(){return D},registerTranslationNamespace:function(){return N},temporaryConfigStore:function(){return Nt},validator:function(){return d},validators:function(){return Qt}});var et="function"==typeof Object.is?Object.is:function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e},nt=Object.prototype.toString,rt=function(){return"[object Arguments]"===nt.call(arguments)?function(t){return"[object Arguments]"===nt.call(t)}:function(t){return s("callee",t)}}(),ot=rt,it=!{toString:null}.propertyIsEnumerable("toString"),at=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],ut=function(){return arguments.propertyIsEnumerable("length")}(),st=function(t,e){for(var n=0;n<t.length;){if(t[n]===e)return!0;n+=1}return!1},ct="function"!=typeof Object.keys||ut?n((function(t){if(Object(t)!==t)return[];var e,n,r=[],o=ut&&ot(t);for(e in t)!s(e,t)||o&&"length"===e||(r[r.length]=e);if(it)for(n=at.length-1;n>=0;)s(e=at[n],t)&&!st(r,e)&&(r[r.length]=e),n-=1;return r})):n((function(t){return Object(t)!==t?[]:Object.keys(t)})),lt=n((function(t){return null===t?"Null":void 0===t?"Undefined":Object.prototype.toString.call(t).slice(8,-1)}));function ft(e,n,r,o){if(et(e,n))return!0;var i,a,u=lt(e);if(u!==lt(n))return!1;if(null==e||null==n)return!1;if("function"==typeof e["fantasy-land/equals"]||"function"==typeof n["fantasy-land/equals"])return"function"==typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](n)&&"function"==typeof n["fantasy-land/equals"]&&n["fantasy-land/equals"](e);if("function"==typeof e.equals||"function"==typeof n.equals)return"function"==typeof e.equals&&e.equals(n)&&"function"==typeof n.equals&&n.equals(e);switch(u){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===(i=e.constructor,null==(a=String(i).match(/^function (\w*)/))?"":a[1]))return e===n;break;case"Boolean":case"Number":case"String":if((void 0===e?"undefined":t(e))!=(void 0===n?"undefined":t(n))||!et(e.valueOf(),n.valueOf()))return!1;break;case"Date":if(!et(e.valueOf(),n.valueOf()))return!1;break;case"Error":return e.name===n.name&&e.message===n.message;case"RegExp":if(e.source!==n.source||e.global!==n.global||e.ignoreCase!==n.ignoreCase||e.multiline!==n.multiline||e.sticky!==n.sticky||e.unicode!==n.unicode)return!1}for(var l=r.length-1;l>=0;){if(r[l]===e)return o[l]===n;l-=1}switch(u){case"Map":return e.size===n.size&&c(e.entries(),n.entries(),r.concat([e]),o.concat([n]));case"Set":return e.size===n.size&&c(e.values(),n.values(),r.concat([e]),o.concat([n]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var f=ct(e);if(f.length!==ct(n).length)return!1;var p=r.concat([e]),h=o.concat([n]);for(l=f.length-1;l>=0;){var d=f[l];if(!s(d,n)||!ft(n[d],e[d],p,h))return!1;l-=1}return!0}var pt=r((function(t,e){return ft(t,e,[],[])})),ht=l((function(t,e,n){var r,o={};for(r in e)s(r,e)&&(o[r]=s(r,n)?t(r,e[r],n[r]):e[r]);for(r in n)s(r,n)&&!s(r,o)&&(o[r]=n[r]);return o})),dt=l((function t(e,n,r){return ht((function(n,r,o){return f(r)&&f(o)?t(e,r,o):e(n,r,o)}),n,r)})),vt=r((function(t,e){return dt((function(t,e,n){return n}),t,e)})),yt=r((function(t,e){for(var n={},r={},o=0,i=t.length;o<i;)r[t[o]]=1,o+=1;for(var a in e)r.hasOwnProperty(a)||(n[a]=e[a]);return n}));function gt(t,e,n,r){var o,i=function(o){for(var i=e.length,a=0;a<i;){if(t===e[a])return n[a];a+=1}for(var u in e[a+1]=t,n[a+1]=o,t)o[u]=r?gt(t[u],e,n,!0):t[u];return o};switch(lt(t)){case"Object":return i({});case"Array":return i([]);case"Date":return new Date(t.valueOf());case"RegExp":return o=t,new RegExp(o.source,(o.global?"g":"")+(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.sticky?"y":"")+(o.unicode?"u":""));default:return t}}var mt,bt=n((function(t){return null!=t&&"function"==typeof t.clone?t.clone():gt(t,[],[],!0)})),wt=Array.isArray||function(t){return null!=t&&t.length>=0&&"[object Array]"===Object.prototype.toString.call(t)},Ot=n((function(e){return!!wt(e)||!!e&&"object"==(void 0===e?"undefined":t(e))&&!function(t){return"[object String]"===Object.prototype.toString.call(t)}(e)&&(1===e.nodeType?!!e.length:0===e.length||e.length>0&&e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1))})),St=function(){function t(t){this.f=t}return t.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},t.prototype["@@transducer/result"]=function(t){return t},t.prototype["@@transducer/step"]=function(t,e){return this.f(t,e)},t}(),Et=r((function(t,e){return function(t,e){switch(t){case 0:return function(){return e.apply(this,arguments)};case 1:return function(t){return e.apply(this,arguments)};case 2:return function(t,n){return e.apply(this,arguments)};case 3:return function(t,n,r){return e.apply(this,arguments)};case 4:return function(t,n,r,o){return e.apply(this,arguments)};case 5:return function(t,n,r,o,i){return e.apply(this,arguments)};case 6:return function(t,n,r,o,i,a){return e.apply(this,arguments)};case 7:return function(t,n,r,o,i,a,u){return e.apply(this,arguments)};case 8:return function(t,n,r,o,i,a,u,s){return e.apply(this,arguments)};case 9:return function(t,n,r,o,i,a,u,s,c){return e.apply(this,arguments)};case 10:return function(t,n,r,o,i,a,u,s,c,l){return e.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}(t.length,(function(){return t.apply(e,arguments)}))})),xt=Et,Pt="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",jt=l((function(t,e,n){if("function"==typeof t&&(t=function(t){return new St(t)}(t)),Ot(n))return function(t,e,n){for(var r=0,o=n.length;r<o;){if((e=t["@@transducer/step"](e,n[r]))&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}r+=1}return t["@@transducer/result"](e)}(t,e,n);if("function"==typeof n["fantasy-land/reduce"])return h(t,e,n,"fantasy-land/reduce");if(null!=n[Pt])return p(t,e,n[Pt]());if("function"==typeof n.next)return p(t,e,n);if("function"==typeof n.reduce)return h(t,e,n,"reduce");throw new TypeError("reduce: list must be array or iterable")}));!function(t){t.Array="Array",t.Boolean="Boolean",t.ConceptUuid="ConceptUuid",t.Number="Number",t.Object="Object",t.String="String",t.UUID="UUID",t.PersonAttributeTypeUuid="PersonAttributeTypeUuid",t.PatientIdentifierTypeUuid="PatientIdentifierTypeUuid"}(mt||(mt={}));var kt=d((function(t){return Array.isArray(t)}),"must be an array"),At=d((function(t){return"boolean"==typeof t}),"must be a boolean"),_t=d((function(t){return"number"==typeof t}),"must be a number"),Tt=d((function(t){return"string"==typeof t}),"must be a string"),Ct=d((function(e){return"object"==(void 0===e?"undefined":t(e))&&!Array.isArray(e)&&null!==e}),"must be an object (not an array or null)"),It=d((function(t){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t)||/^[0-9a-f]{36}$/i.test(t)}),"must be a valid UUID or a 36-character hexadecimal string"),Mt=o(685),Dt=(0,Mt.createGlobalStore)("config-internal",{providedConfigs:[],schemas:{},moduleLoaded:{}}),Nt=(0,Mt.createGlobalStore)("temporary-config",{config:function(){try{return JSON.parse(localStorage.getItem("openmrs:temporaryConfig")||"{}")}catch(t){return{}}}()});Nt.subscribe((function(t){var e;e=t.config,localStorage.setItem("openmrs:temporaryConfig",JSON.stringify(e))}));var Rt=(0,Mt.createGlobalStore)("config-store-of-extension-state",{mountedExtensions:[]}),Lt=(0,Mt.createGlobalStore)("config-implementer-tools",{config:{}});function Ut(t){return t.hasOwnProperty("_default")?P(x({},t),{_value:t._default,_source:"default"}):X(t)?Object.keys(t).reduce((function(e,n){return e[n]=Ut(t[n]),e}),{}):{}}function Bt(t,e){return X(t)?Object.keys(t).reduce((function(n,r){return n[r]=Bt(t[r],e),n}),{}):{_value:t,_source:e}}function Ft(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r="Please verify that you are running the latest version and, if so, alert the maintainer.",o=!0,i=!1,a=void 0;try{for(var u,s=function(){var o=u.value,i=n+(n&&".")+o,a=e[o];if("Display conditions"===i&&console.error("".concat(t,' declares a configuration option called "Display conditions"; the "Display conditions" option is a reserved name. ').concat(r)),"Translation overrides"===i&&console.error("".concat(t,' declares a configuration option called "Translation overrides"; the "Translation overrides" option is a reserved name. ').concat(r)),!X(a))return console.error("".concat(t," has bad config schema definition for key '").concat(i,"'. ").concat(r)),"continue";a.hasOwnProperty("_default")||Ft(t,a,i);var s=a._elements;if(Q(s)&&Ft(t,s,i+"._elements"),a._validators){var c=!0,l=!1,f=void 0;try{for(var p,h=a._validators[Symbol.iterator]();!(c=(p=h.next()).done);c=!0){var d=p.value;"function"!=typeof d&&console.error("".concat(t," has invalid validator for key '").concat(i,"' ").concat(r,".")+"\n\nIf you're the maintainer: validators must be functions that return either "+"undefined or an error string. Received ".concat(d,"."))}}catch(t){l=!0,f=t}finally{try{c||null==h.return||h.return()}finally{if(l)throw f}}}var v=a._type;v&&!Object.values(mt).includes(v)&&console.error("".concat(t," has invalid type for key '").concat(i,"' ").concat(r,".")+"\n\nIf you're the maintainer: the allowed types are ".concat(Object.values(mt).join(", "),". ")+"Received '".concat(v,"'")),Object.keys(a).every((function(t){return["_description","_validators","_elements","_type"].includes(t)}))&&!n.includes("._elements")&&console.error("".concat(t," has bad config schema definition for key '").concat(i,"'. ").concat(r,".")+"\n\nIf you're the maintainer: all config elements must have a default. "+"Received ".concat(JSON.stringify(a))),s&&v&&![mt.Array,mt.Object].includes(v)&&console.error("".concat(t," has bad config schema definition for key '").concat(i,"'. ").concat(r,".")+"\n\nIf you're the maintainer: the 'elements' key only works with '_type' equal to 'Array' or 'Object'. "+"Received ".concat(JSON.stringify(v)))},c=Object.keys(e).filter((function(t){return!t.startsWith("_")}))[Symbol.iterator]();!(o=(u=c.next()).done);o=!0)s()}catch(t){i=!0,a=t}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}}function Vt(t,e,n){J(n,t._type,e),X(e)?t._type===mt.Object?function(t,e,n){if(t._elements){var r=!0,o=!1,i=void 0;try{for(var a,u=Object.keys(e)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=a.value,c=e[s];q(t._elements,c,"".concat(n,".").concat(s))}}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}}(t,e,n):t.hasOwnProperty("_default")||t.hasOwnProperty("_type")||q(t,e,n):t._type===mt.Array&&function(t,e,n){if(Q(t._elements))for(var r=0;r<e.length;r++)Vt(t._elements,e[r],"".concat(n,"[").concat(r,"]"));for(var o=0;o<e.length;o++){var i;J("".concat(n,"[").concat(o,"]"),null===(i=t._elements)||void 0===i?void 0:i._type,e[o])}}(t,e,n)}function zt(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(t)if(e!==t._default&&Y(n,t._validators,e),X(e)){var r=!0,o=!1,i=void 0;try{for(var a,u=Object.keys(e)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=a.value,c=e[s],l=n+"."+s,f=t[s];t._type===mt.Object&&t._elements?zt(t._elements,c,l):zt(f,c,l)}}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}else if(Array.isArray(e)&&t._elements)for(var p=0;p<e.length;p++)zt(t._elements,e[p],"".concat(n,"[").concat(p,"]"))}_(Dt.getState(),Nt.getState()),Dt.subscribe((function(t){return _(t,Nt.getState())})),Nt.subscribe((function(t){return _(Dt.getState(),t)})),C(Dt.getState(),Nt.getState()),Dt.subscribe((function(t){return C(t,Nt.getState())})),Nt.subscribe((function(t){return C(Dt.getState(),t)})),T(Dt.getState(),Nt.getState()),Dt.subscribe((function(t){return T(t,Nt.getState())})),Nt.subscribe((function(t){return T(Dt.getState(),t)})),I(Dt.getState(),Rt.getState(),Nt.getState()),Dt.subscribe((function(t){I(t,Rt.getState(),Nt.getState())})),Rt.subscribe((function(t){I(Dt.getState(),t,Nt.getState())})),Nt.subscribe((function(t){I(Dt.getState(),Rt.getState(),t)}));var Ht=function(t,e){var n=bt(e);if(!t)return n;var r=!0,o=!1,i=void 0;try{for(var a,u=function(){var e=a.value,r=n[e],o=t[e];if(o&&(o.hasOwnProperty("_type")||o.hasOwnProperty("_default"))){n.hasOwnProperty(e)||(n[e]=o._default);var i=o._elements;if(r&&Q(i))if(o._type===mt.Array&&Array.isArray(r)){var u=r.map((function(t){return Ht(i,t)}));n[e]=u}else if(o._type===mt.Object){var s=!0,c=!1,l=void 0;try{for(var f,p=Object.keys(r)[Symbol.iterator]();!(s=(f=p.next()).done);s=!0){var h=f.value;r[h]=Ht(i,r[h])}}catch(t){c=!0,l=t}finally{try{s||null==p.return||p.return()}finally{if(c)throw l}}}}else if(X(o)){var d=null!=r?r:{};X(d)&&(n[e]=Ht(o,d))}},s=Object.keys(t)[Symbol.iterator]();!(r=(a=s.next()).done);r=!0)u()}catch(t){o=!0,i=t}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n},Wt=new Set,Gt={"Translation overrides":{_description:"Per-language overrides for frontend translations should be keyed by language code and each language dictionary contains the translation key and the display value",_type:mt.Object,_default:{},_validators:[d((function(t){return Object.keys(t).every((function(t){return/^[a-z]{2,3}(-[A-Z]{2,3})?$/.test(t)}))}),(function(t){var e=Object.keys(t).filter((function(t){return!/^[a-z]{2,3}(-[A-Z]{2,3})?$/.test(t)}));return"The 'Translation overrides' object should have language codes for keys. Language codes must be in the form of a two-to-three letter language code optionally followed by a hyphen and a two-to-three letter country code. The following keys do not conform: ".concat(e.join(", "),".")}))]}},Kt=x({"Display conditions":{privileges:{_description:"The privilege(s) the user must have to use this extension",_type:mt.Array,_default:[]}}},Gt),$t=function(t,e){return d((function(n){return t<=n&&n<=e}),"must be between ".concat(t," and ").concat(e))},qt=function(t){var e=t.concat(["openmrsBase","openmrsSpaBase"]);return d((function(t){if(!t||"string"!=typeof t)return!1;for(var n=/\${(.*?)}/g,r=n.exec(t);r;){if(!e.includes(r[1]))return!1;r=n.exec(t)}return!0}),"Should be a URL or path. The allowed template parameters are "+e.map((function(t){return"${"+t+"}"})).join(", "))},Jt=qt([]),Yt=function(t){return d((function(e){return t.includes(e)}),"Must be one of the following: '".concat(t.join("', '"),"'."))},Qt={inRange:$t,isUrl:Jt,isUrlWithTemplateParameters:qt,oneOf:Yt}}(),i}())}}}))},5863:()=>{function t(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}System.register(["@openmrs/esm-globals","@openmrs/esm-translations"],(function(e,n){var r={},o={};return{setters:[function(t){r.dispatchToastShown=t.dispatchToastShown},function(t){o.getCoreTranslation=t.getCoreTranslation}],execute:function(){e(function(){"use strict";var e={728:function(t){t.exports=r},901:function(t){t.exports=o}},n={};function i(t){var r=n[t];if(void 0!==r)return r.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,i),o.exports}i.d=function(t,e){for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},function(){i.S={};var t={},e={};i.I=function(n,r){r||(r=[]);var o=e[n];if(o||(o=e[n]={}),!(r.indexOf(o)>=0)){if(r.push(o),t[n])return t[n];i.o(i.S,n)||(i.S[n]={}),i.S[n];var a=[];return t[n]=a.length?Promise.all(a).then((function(){return t[n]=1})):1}}}();var a={};return function(){var e=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},n=function(t){return function(){var n=this,r=arguments;return new Promise((function(o,i){var a=t.apply(n,r);function u(t){e(a,o,i,u,s,"next",t)}function s(t){e(a,o,i,u,s,"throw",t)}u(void 0)}))}},r=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},o=function(t){return t.replace(/[\/\-@]/g,"_")},u=function(t){return p.apply(this,arguments)},s=function(t,e){return h.apply(this,arguments)},c=function(){return d.apply(this,arguments)};i.r(a),i.d(a,{getCurrentImportMap:function(){return c},importDynamic:function(){return u},preloadImport:function(){return s},slugify:function(){return o}});var l=i(728),f=i(901);function p(){return p=n((function(e){var n,a,u,c,l,f,p,h,d,v,y=arguments;return r(this,(function(r){switch(r.label){case 0:return n=y.length>1&&void 0!==y[1]?y[1]:"./start",u=!(null==(a=y.length>2?y[2]:void 0)?void 0:a.maxLoadingTime)||a.maxLoadingTime<=0?6e5:a.maxLoadingTime,c=void 0,[4,Promise.race([s(e,null==a?void 0:a.importMap),new Promise((function(t,n){c=setTimeout((function(){var t;n(new Error("Could not resolve requested script, ".concat(e,", within ").concat((t=u)<1e3?"".concat(t," milliseconds"):t<6e4?"".concat(Math.floor(t/1e3)," seconds"):t<36e5?"".concat(Math.floor(t/6e4)," minutes"):t<864e5?"".concat(Math.floor(t/36e5)," hours"):"".concat(Math.floor(t/864e5)," days"),".")))}),u)}))])];case 1:if(r.sent(),c&&clearTimeout(c),l=o(e),"object"!=t(g=f=window[l])||null===g||!("init"in g)||"function"!=typeof g.init||!("get"in g)||"function"!=typeof g.get)throw p="The global variable ".concat(l," does not refer to a federated module"),console.error(p),new Error(p);return f.init(i.S.default),[4,f.get(n)];case 2:if(h=r.sent(),"object"!=t(d=h())||null===d)throw v="Container for ".concat(e," did not return an ESM module as expected"),console.error(v),new Error(v);return[2,d]}var g}))})),p.apply(this,arguments)}function h(){return(h=n((function(t,e){var n,i,a,u,s,p,h,d;return r(this,(function(r){switch(r.label){case 0:if("string"!=typeof t||0===t.trim().length)throw n="Attempted to call importDynamic() without supplying a package to load",console.error(n),new Error(n);return i=o(t),window[i]?[3,7]:null==e?[3,1]:(u=e,[3,3]);case 1:return[4,c()];case 2:u=r.sent(),r.label=3;case 3:if(!(a=u).imports.hasOwnProperty(t))throw s="Could not find the package ".concat(t," defined in the current importmap"),console.error(s),new Error(s);(p=a.imports[t]).startsWith("./")&&(p=window.spaBase+p.substring(1)),h=!!window.localStorage.getItem("import-map-override:".concat(t)),r.label=4;case 4:return r.trys.push([4,6,,7]),[4,new Promise((function(t,e){!function(t,e,n){var r=document.head.querySelector('script[src="'.concat(t,'"]')),o=window[v];if(o||(o=window[v]=new Set([])),r){var i,a,u;o.has(t)?(u=function(){i&&r.removeEventListener("load",i),a&&r.removeEventListener("error",a)},i=function(){u(),e(null)},a=function(t){u(),n(t.message)},r.addEventListener("load",i),r.addEventListener("error",a)):(console.warn("Script at ".concat(t," already loaded. Not loading it again.")),e(null))}else{o.add(t);var s=document.createElement("script");s.src=t,s.type="text/javascript",s.async=!0;var c,l,f,p=setTimeout((function(){console.error("The script at ".concat(t," did not load within 5 seconds. This may indicate an issue with the imports in the script's entry-point file or with the script's bundler configuration."))}),5e3);f=function(){clearTimeout(p),o.delete(t),c&&s.removeEventListener("load",c),l&&s.removeEventListener("error",l)},c=function(){f(),e(null)},l=function(e){f();var r,o="Failed to load script from ".concat(t);console.error(o,e),n(null!==(r=e.message)&&void 0!==r?r:o)},s.addEventListener("load",c),s.addEventListener("error",l),document.head.appendChild(s)}}(p,t,e)}))];case 5:return[2,r.sent()];case 6:return d=r.sent(),h&&(0,l.dispatchToastShown)({kind:"error",title:(0,f.getCoreTranslation)("scriptLoadingFailed","Error: Script failed to load"),description:(0,f.getCoreTranslation)("scriptLoadingError","Failed to load overridden script from {{- url}}. Please check that the bundled script is available at the expected URL. Click the button below to reset all import map overrides.",{url:p}),actionButtonLabel:(0,f.getCoreTranslation)("resetOverrides","Reset overrides"),onActionButtonClick:function(){window.importMapOverrides.resetOverrides(),window.location.reload()}}),[2,Promise.reject(d)];case 7:return[2,Promise.resolve()]}}))}))).apply(this,arguments)}function d(){return(d=n((function(){return r(this,(function(t){return[2,window.importMapOverrides.getCurrentPageMap()]}))}))).apply(this,arguments)}var v=Symbol("__openmrs_script_loading")}(),a}())}}}))},9425:()=>{System.register(["@openmrs/esm-globals"],(function(t,e){var n={};return{setters:[function(t){n.dispatchToastShown=t.dispatchToastShown}],execute:function(){t(function(){"use strict";var t={728:function(t){t.exports=n}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return function(){var t=function(t){var e=n(t);setTimeout((function(){throw e}))},e=function(){var e=Error();return function(r){n(r).stack+="\nAsync stacktrace:\n".concat(e.stack),t(r)}},n=function(t){var e,n,r,o,i,a;if(n=t,null!=(r=Error)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):(o=n,null!=(i=r)&&"undefined"!=typeof Symbol&&i[Symbol.hasInstance]?i[Symbol.hasInstance](o):o instanceof i))return t;if(null===t)return Error("'null' was thrown as an error");if("object"==(void 0===t?"undefined":(a=t)&&"undefined"!=typeof Symbol&&a.constructor===Symbol?"symbol":typeof a)){try{e="Object thrown as error: ".concat(JSON.stringify(t))}catch(n){e="Object thrown as error with the following properties: ".concat(Object.keys(t))}return Error(e)}return void 0===t?Error("'undefined' was thrown as an error"):Error(t.toString())};r.r(o),r.d(o,{createErrorHandler:function(){return e},reportError:function(){return t}});var i=r(728);window.onerror=function(t){return console.error("Unexpected error: ",t),(0,i.dispatchToastShown)({description:null!=t?t:"Oops! An unexpected error occurred.",kind:"error",title:"Error"}),!1},window.onunhandledrejection=function(t){var e;console.error("Unhandled rejection: ",t.reason),(0,i.dispatchToastShown)({description:null!==(e=t.reason)&&void 0!==e?e:"Oops! An unhandled promise rejection occurred.",kind:"error",title:"Error"})}}(),o}())}}}))},6133:(t,e,n)=>{function r(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}function o(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}t=n.nmd(t),System.register(["@openmrs/esm-config","@openmrs/esm-state","@openmrs/esm-api","@openmrs/esm-feature-flags","@openmrs/esm-utils","single-spa"],(function(i,a){var u={},s={},c={},l={},f={},p={};return{setters:[function(t){u.configExtensionStore=t.configExtensionStore,u.getExtensionConfigFromStore=t.getExtensionConfigFromStore,u.getExtensionSlotConfig=t.getExtensionSlotConfig,u.getExtensionSlotConfigFromStore=t.getExtensionSlotConfigFromStore,u.getExtensionSlotsConfigStore=t.getExtensionSlotsConfigStore,u.getExtensionsConfigStore=t.getExtensionsConfigStore},function(t){s.createGlobalStore=t.createGlobalStore,s.getGlobalStore=t.getGlobalStore},function(t){c.getSessionStore=t.getSessionStore,c.userHasAccess=t.userHasAccess},function(t){l.featureFlagsStore=t.featureFlagsStore},function(t){f.isOnline=t.isOnline},function(t){p.mountRootParcel=t.mountRootParcel}],execute:function(){i(function(){"use strict";var i={766:function(t){t.exports=c},824:function(t){t.exports=u},708:function(t){t.exports=l},685:function(t){t.exports=s},618:function(t){t.exports=f},645:function(t){t.exports=p}},a={};function h(t){var e=a[t];if(void 0!==e)return e.exports;var n=a[t]={exports:{}};return i[t](n,n.exports,h),n.exports}h.d=function(t,e){for(var n in e)h.o(e,n)&&!h.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},h.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},h.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var d={};return function(){var i=function(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}},a=function(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}},u=function(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}},s=function(t){var e=this.__data__=new Nt(t);this.size=e.size},c=function(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new pe;++e<n;)this.add(t[e])},l=function(t){var e=jn.getState(),n=t(e);n!==e&&jn.setState(n)},f=function(t){var e=[],n=!0,r=!1,o=void 0;try{for(var i,a=Object.values(t.extensions)[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var u=i.value,s=!0,c=!1,l=void 0;try{for(var f,p=u.instances[Symbol.iterator]();!(s=(f=p.next()).done);s=!0){var h=f.value;e.push({slotModuleName:h.slotModuleName,extensionModuleName:u.moduleName,slotName:h.slotName,extensionId:h.id})}}catch(t){c=!0,l=t}finally{try{s||null==p.return||p.return()}finally{if(c)throw l}}}}catch(t){r=!0,o=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}En(xn.configExtensionStore.getState().mountedExtensions,e)||xn.configExtensionStore.setState({mountedExtensions:e})},p=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},v=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},y=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){v(t,e,n[e])}))}return t},g=function(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e.push.apply(e,n)}return e}(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},m=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t,e)||w(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},b=function(t){return function(t){if(Array.isArray(t))return p(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||w(t)||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.")}()},w=function(t,e){if(t){if("string"==typeof t)return p(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(t,e):void 0}},O=function(t,e,n){var r={},o=!0,i=!1,a=void 0;try{for(var u,s=Object.entries(t.slots)[Symbol.iterator]();!(o=(u=s.next()).done);o=!0){var c=m(u.value,2),l=c[0],f=c[1],p=C(l,t,(0,xn.getExtensionSlotConfigFromStore)(e,f.name).config,n);r[l]={moduleName:f.moduleName,assignedExtensions:p}}}catch(t){i=!0,a=t}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}En(Dn.getState().slots,r)||Dn.setState({slots:r})},S=function(t,e){return{moduleName:e,name:t,attachedIds:[],config:null}},E=function(t){return m(t.split("#"),1)[0]},x=function(t,e){var n=E(e);return t.extensions[n]},P=function(t){return x(Mn.getState(),t)},j=function(t,e){l((function(n){var r=n.slots[t];return g(y({},n),r?{slots:g(y({},n.slots),v({},t,g(y({},r),{attachedIds:b(r.attachedIds).concat([e])})))}:{slots:g(y({},n.slots),v({},t,g(y({},S(t)),{attachedIds:[e]})))})}))},k=function(t,e){l((function(n){var r=n.slots[t];return r&&r.attachedIds.includes(e)?g(y({},n),{slots:g(y({},n.slots),v({},t,g(y({},r),{attachedIds:r.attachedIds.filter((function(t){return t!==e}))})))}):n}))},A=function(t){l((function(e){var n=e.slots[t];return n?g(y({},e),{slots:g(y({},e.slots),v({},t,g(y({},n),{attachedIds:[]})))}):e}))},_=function(t,e,n,r){var o=e.indexOf(t);if(-1!==o)return o;if(void 0!==n)return 1e3+n;var i=r.indexOf(t);return-1!==i?2e3+i:-1},T=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=(0,Cn.isOnline)(null!=e?e:void 0),o=null!=n?n:Object.entries(Tn.featureFlagsStore.getState().flags).filter((function(t){return m(t,2)[1].enabled})).map((function(t){return m(t,1)[0]}));return t.filter((function(t){return!window.offlineEnabled||xt(r,t.online,t.offline)})).filter((function(t){return void 0===t.featureFlag||(null==o?void 0:o.includes(t.featureFlag))}))},C=function(t,e,n,r){var o=function(t,e){var n=t.add||[],r=t.remove||[],o=t.order||[],i=Mn.getState().extensions;return b(e).concat(b(n)).filter((function(t){return!r.includes(t)})).sort((function(t,n){var r,a,u=_(t,o,null===(r=i[E(t)])||void 0===r?void 0:r.order,e),s=_(n,o,null===(a=i[E(n)])||void 0===a?void 0:a.order,e);return-1===s?-1:-1===u?1:u-s}))}(n,e.slots[t].attachedIds),i=[],a=void 0,u=!0,s=!1,c=void 0;try{for(var l,f=o[Symbol.iterator]();!(u=(l=f.next()).done);u=!0){var p=l.value,h=(0,xn.getExtensionConfigFromStore)(r,t,p).config,d=E(p),v=e.extensions[d];if(v){var y,g,m,w,O,S,x,P,j,k=null!==(O=null!==(w=null==h||null===(y=h["Display conditions"])||void 0===y?void 0:y.privileges)&&void 0!==w?w:v.privileges)&&void 0!==O?O:[];if(k&&("string"==typeof k||Array.isArray(k)&&k.length>0)){var A;if(In(a)&&(a=null===(A=(0,_n.getSessionStore)().getState().session)||void 0===A?void 0:A.user),!a)continue;if(!(0,_n.userHasAccess)(k,a))continue}i.push({id:p,name:d,moduleName:v.moduleName,config:h,featureFlag:v.featureFlag,meta:v.meta,online:null===(x=null!==(S=null==h||null===(g=h["Display conditions"])||void 0===g?void 0:g.online)&&void 0!==S?S:v.online)||void 0===x||x,offline:null!==(j=null!==(P=null==h||null===(m=h["Display conditions"])||void 0===m?void 0:m.offline)&&void 0!==P?P:v.offline)&&void 0!==j&&j})}}}catch(t){s=!0,c=t}finally{try{u||null==f.return||f.return()}finally{if(s)throw c}}return i},I=function(t){return C(t,Mn.getState(),(0,xn.getExtensionSlotConfig)(t).config,Rn.getState())},M=function(t){zn.setState((function(e){return e.modals[t.name]=t,e}))},D=function(t){var e=zn.getState().modals[t];if(!e){var n=P(t);n&&(e={name:t,load:n.load,moduleName:n.moduleName},console.warn("Modal ".concat(t,' was registered as an extension. This is deprecated and will be removed in the future. Please register it in the "modals" section of routes.json instead of the "extensions" section.')),M(e))}return e},N=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},R=function(t,e){if(!r(t,e))throw new TypeError("Cannot call a class as a function")},L=function(t){var e=function(t){if("object"!==Hn(t)||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!==Hn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===Hn(e)?e:String(e)},U=function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,L(r.key),r)}},B=function(t,e,n){return e&&U(t.prototype,e),n&&U(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t},F=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},V=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Wn(t,e)},z=function(t,e){if(e&&("object"===Hn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return F(t)},H=function(t,e,n){return(e=L(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},W=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},G=function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n},K=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?G(Object(n),!0).forEach((function(e){H(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):G(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t},$=function(){var t,e,n=new Promise((function(n,r){t=n,e=r}));return n.resolve=t,n.reject=e,n},q=function(t){return null==t?"":""+t},J=function(t,e,n){function r(t){return t&&t.indexOf("###")>-1?t.replace(/###/g,"."):t}function o(){return!t||"string"==typeof t}for(var i="string"!=typeof e?[].concat(e):e.split(".");i.length>1;){if(o())return{};var a=r(i.shift());!t[a]&&n&&(t[a]=new n),t=Object.prototype.hasOwnProperty.call(t,a)?t[a]:{}}return o()?{}:{obj:t,k:r(i.shift())}},Y=function(t,e,n){var r=J(t,e,Object);r.obj[r.k]=n},Q=function(t,e){var n=J(t,e),r=n.obj,o=n.k;if(r)return r[o]},X=function(t,e,n){var r=Q(t,n);return void 0!==r?r:Q(e,n)},Z=function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},tt=function(t){return"string"==typeof t?t.replace(/[&<>"'\/]/g,(function(t){return Qn[t]})):t},et=function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n},nt=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?et(Object(n),!0).forEach((function(e){H(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):et(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t},rt=function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n},ot=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?rt(Object(n),!0).forEach((function(e){H(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):rt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t},it=function(t){return t.charAt(0).toUpperCase()+t.slice(1)},at=function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n},ut=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?at(Object(n),!0).forEach((function(e){H(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):at(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t},st=function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n},ct=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?st(Object(n),!0).forEach((function(e){H(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):st(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t},lt=function(t){var e={};return function(n,r,o){var i=r+JSON.stringify(o),a=e[i];return a||(a=t(r,o),e[i]=a),a(n)}},ft=function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n},pt=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ft(Object(n),!0).forEach((function(e){H(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ft(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t},ht=function(t){return"string"==typeof t.ns&&(t.ns=[t.ns]),"string"==typeof t.fallbackLng&&(t.fallbackLng=[t.fallbackLng]),"string"==typeof t.fallbackNS&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t},dt=function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n},vt=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?dt(Object(n),!0).forEach((function(e){H(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):dt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t},yt=function(){},gt=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},mt=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},bt=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){mt(t,e,n[e])}))}return t},wt=function(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e.push.apply(e,n)}return e}(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},Ot=function(t){var e,n,r,o,i,a,u;mr.setState((function(s){return{workspaces:wt(bt({},s.workspaces),mt({},t.name,wt(bt({},t),{preferredWindowSize:null!==(e=t.preferredWindowSize)&&void 0!==e?e:"normal",type:null!==(n=t.type)&&void 0!==n?n:"form",canHide:null!==(r=t.canHide)&&void 0!==r&&r,canMaximize:null!==(o=t.canMaximize)&&void 0!==o&&o,width:null!==(i=t.width)&&void 0!==i?i:"narrow",hasOwnSidebar:null!==(a=t.hasOwnSidebar)&&void 0!==a&&a,sidebarFamily:null!==(u=t.sidebarFamily)&&void 0!==u?u:"default"})))}}))},St=function(t){var e=mr.getState().workspaces;if(e[t])return e[t];var n,r,i,a,u,s,c,l,f,p,h,d,v,y,g,m,b=P(t);if(b)return br.has(t)||(console.warn("The workspace '".concat(t,'\' is registered as an extension. This is deprecated. Please register it in the "workspaces" section of the routes.json file.')),br.add(t)),{name:b.name,title:(y=b,m=null==y||null===(g=y.meta)||void 0===g?void 0:g.title,"string"==typeof m?m:m&&"object"==(void 0===m?"undefined":o(m))?(h=y.moduleName,d=m.key,v=m.default,gr.t(d,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){gt(t,e,n[e])}))}return t}({ns:h,defaultValue:v},void 0))):y.name),moduleName:b.moduleName,preferredWindowSize:null!==(s=null===(n=b.meta)||void 0===n?void 0:n.screenSize)&&void 0!==s?s:"normal",load:b.load,type:null!==(c=null===(r=b.meta)||void 0===r?void 0:r.type)&&void 0!==c?c:"form",canHide:null!==(l=null===(i=b.meta)||void 0===i?void 0:i.canHide)&&void 0!==l&&l,canMaximize:null!==(f=null===(a=b.meta)||void 0===a?void 0:a.canMaximize)&&void 0!==f&&f,width:null!==(p=null===(u=b.meta)||void 0===u?void 0:u.width)&&void 0!==p?p:"narrow",sidebarFamily:"default",hasOwnSidebar:!1};throw new Error("No workspace named '".concat(t,"' has been registered."))},Et=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return xt((0,Cn.isOnline)(),t,e)},xt=function(t){return Boolean(t?!(arguments.length>1&&void 0!==arguments[1])||arguments[1]:arguments.length>2&&void 0!==arguments[2]&&arguments[2])},Pt=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},jt=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},kt=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},At=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){kt(t,e,n[e])}))}return t},_t=function(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e.push.apply(e,n)}return e}(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},Tt=function(t,e,n,r){return Sr.apply(this,arguments)};h.r(d),h.d(d,{attach:function(){return j},checkStatus:function(){return Et},checkStatusFor:function(){return xt},detach:function(){return k},detachAll:function(){return A},extensionStore:function(){return Er},getAssignedExtensions:function(){return I},getConnectedExtensions:function(){return T},getExtensionInternalStore:function(){return kn},getExtensionNameFromId:function(){return E},getExtensionRegistration:function(){return P},getExtensionRegistrationFrom:function(){return x},getExtensionStore:function(){return An},getModalRegistration:function(){return D},getWorkspaceRegistration:function(){return St},registerExtension:function(){return Bn},registerExtensionSlot:function(){return Fn},registerModal:function(){return M},registerWorkspace:function(){return Ot},renderExtension:function(){return Tt},reset:function(){return Vn},updateInternalExtensionStore:function(){return l}});var Ct=function(t,e){return t===e||t!=t&&e!=e},It=function(t,e){for(var n=t.length;n--;)if(Ct(t[n][0],e))return n;return-1},Mt=Array.prototype.splice;i.prototype.clear=function(){this.__data__=[],this.size=0},i.prototype.delete=function(t){var e=this.__data__,n=It(e,t);return!(n<0||(n==e.length-1?e.pop():Mt.call(e,n,1),--this.size,0))},i.prototype.get=function(t){var e=this.__data__,n=It(e,t);return n<0?void 0:e[n][1]},i.prototype.has=function(t){return It(this.__data__,t)>-1},i.prototype.set=function(t,e){var n=this.__data__,r=It(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var Dt,Nt=i,Rt="object"==(void 0===n.g?"undefined":o(n.g))&&n.g&&n.g.Object===Object&&n.g,Lt="object"==("undefined"==typeof self?"undefined":o(self))&&self&&self.Object===Object&&self,Ut=Rt||Lt||Function("return this")(),Bt=Ut.Symbol,Ft=Object.prototype,Vt=Ft.hasOwnProperty,zt=Ft.toString,Ht=Bt?Bt.toStringTag:void 0,Wt=Object.prototype.toString,Gt=Bt?Bt.toStringTag:void 0,Kt=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Gt&&Gt in Object(t)?function(t){var e=Vt.call(t,Ht),n=t[Ht];try{t[Ht]=void 0;var r=!0}catch(t){}var o=zt.call(t);return r&&(e?t[Ht]=n:delete t[Ht]),o}(t):function(t){return Wt.call(t)}(t)},$t=function(t){var e=void 0===t?"undefined":o(t);return null!=t&&("object"==e||"function"==e)},qt=function(t){if(!$t(t))return!1;var e=Kt(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},Jt=Ut["__core-js_shared__"],Yt=(Dt=/[^.]+$/.exec(Jt&&Jt.keys&&Jt.keys.IE_PROTO||""))?"Symbol(src)_1."+Dt:"",Qt=Function.prototype.toString,Xt=function(t){if(null!=t){try{return Qt.call(t)}catch(t){}try{return t+""}catch(t){}}return""},Zt=/^\[object .+?Constructor\]$/,te=Function.prototype,ee=Object.prototype,ne=te.toString,re=ee.hasOwnProperty,oe=RegExp("^"+ne.call(re).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ie=function(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!$t(t)||(e=t,Yt&&Yt in e))&&(qt(t)?oe:Zt).test(Xt(t));var e}(n)?n:void 0},ae=ie(Ut,"Map"),ue=ie(Object,"create"),se=Object.prototype.hasOwnProperty,ce=Object.prototype.hasOwnProperty;a.prototype.clear=function(){this.__data__=ue?ue(null):{},this.size=0},a.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},a.prototype.get=function(t){var e=this.__data__;if(ue){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return se.call(e,t)?e[t]:void 0},a.prototype.has=function(t){var e=this.__data__;return ue?void 0!==e[t]:ce.call(e,t)},a.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=ue&&void 0===e?"__lodash_hash_undefined__":e,this};var le=a,fe=function(t,e){var n,r,i=t.__data__;return("string"==(r=o(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map};u.prototype.clear=function(){this.size=0,this.__data__={hash:new le,map:new(ae||Nt),string:new le}},u.prototype.delete=function(t){var e=fe(this,t).delete(t);return this.size-=e?1:0,e},u.prototype.get=function(t){return fe(this,t).get(t)},u.prototype.has=function(t){return fe(this,t).has(t)},u.prototype.set=function(t,e){var n=fe(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};var pe=u;s.prototype.clear=function(){this.__data__=new Nt,this.size=0},s.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},s.prototype.get=function(t){return this.__data__.get(t)},s.prototype.has=function(t){return this.__data__.has(t)},s.prototype.set=function(t,e){var n=this.__data__;if(r(n,Nt)){var o=n.__data__;if(!ae||o.length<199)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new pe(o)}return n.set(t,e),this.size=n.size,this};var he=s;c.prototype.add=c.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},c.prototype.has=function(t){return this.__data__.has(t)};var de=c,ve=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1},ye=function(t,e,n,r,o,i){var a=1&n,u=t.length,s=e.length;if(u!=s&&!(a&&s>u))return!1;var c=i.get(t),l=i.get(e);if(c&&l)return c==e&&l==t;var f=-1,p=!0,h=2&n?new de:void 0;for(i.set(t,e),i.set(e,t);++f<u;){var d=t[f],v=e[f];if(r)var y=a?r(v,d,f,e,t,i):r(d,v,f,t,e,i);if(void 0!==y){if(y)continue;p=!1;break}if(h){if(!ve(e,(function(t,e){if(a=e,!h.has(a)&&(d===t||o(d,t,n,r,i)))return h.push(e);var a}))){p=!1;break}}else if(d!==v&&!o(d,v,n,r,i)){p=!1;break}}return i.delete(t),i.delete(e),p},ge=Ut.Uint8Array,me=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n},be=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n},we=Bt?Bt.prototype:void 0,Oe=we?we.valueOf:void 0,Se=Array.isArray,Ee=Object.prototype.propertyIsEnumerable,xe=Object.getOwnPropertySymbols,Pe=xe?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var a=t[n];e(a)&&(i[o++]=a)}return i}(xe(t),(function(e){return Ee.call(t,e)})))}:function(){return[]},je=function(t){return null!=t&&"object"==(void 0===t?"undefined":o(t))},ke=function(t){return je(t)&&"[object Arguments]"==Kt(t)},Ae=Object.prototype,_e=Ae.hasOwnProperty,Te=Ae.propertyIsEnumerable,Ce=ke(function(){return arguments}())?ke:function(t){return je(t)&&_e.call(t,"callee")&&!Te.call(t,"callee")},Ie=Ce,Me="object"==o(e)&&e&&!e.nodeType&&e,De=Me&&"object"==o(t)&&t&&!t.nodeType&&t,Ne=De&&De.exports===Me?Ut.Buffer:void 0,Re=(Ne?Ne.isBuffer:void 0)||function(){return!1},Le=/^(?:0|[1-9]\d*)$/,Ue=function(t,e){var n=void 0===t?"undefined":o(t);return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&Le.test(t))&&t>-1&&t%1==0&&t<e},Be=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},Fe={};Fe["[object Float32Array]"]=Fe["[object Float64Array]"]=Fe["[object Int8Array]"]=Fe["[object Int16Array]"]=Fe["[object Int32Array]"]=Fe["[object Uint8Array]"]=Fe["[object Uint8ClampedArray]"]=Fe["[object Uint16Array]"]=Fe["[object Uint32Array]"]=!0,Fe["[object Arguments]"]=Fe["[object Array]"]=Fe["[object ArrayBuffer]"]=Fe["[object Boolean]"]=Fe["[object DataView]"]=Fe["[object Date]"]=Fe["[object Error]"]=Fe["[object Function]"]=Fe["[object Map]"]=Fe["[object Number]"]=Fe["[object Object]"]=Fe["[object RegExp]"]=Fe["[object Set]"]=Fe["[object String]"]=Fe["[object WeakMap]"]=!1;var Ve,ze="object"==o(e)&&e&&!e.nodeType&&e,He=ze&&"object"==o(t)&&t&&!t.nodeType&&t,We=He&&He.exports===ze&&Rt.process,Ge=function(){try{return He&&He.require&&He.require("util").types||We&&We.binding&&We.binding("util")}catch(t){}}(),Ke=Ge&&Ge.isTypedArray,$e=Ke?(Ve=Ke,function(t){return Ve(t)}):function(t){return je(t)&&Be(t.length)&&!!Fe[Kt(t)]},qe=Object.prototype.hasOwnProperty,Je=Object.prototype,Ye=function(t,e){return function(n){return t(e(n))}}(Object.keys,Object),Qe=Object.prototype.hasOwnProperty,Xe=function(t){return null!=(e=t)&&Be(e.length)&&!qt(e)?function(t){var e=Se(t),n=!e&&Ie(t),r=!e&&!n&&Re(t),o=!e&&!n&&!r&&$e(t),i=e||n||r||o,a=i?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],u=a.length;for(var s in t)!qe.call(t,s)||i&&("length"==s||r&&("offset"==s||"parent"==s)||o&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||Ue(s,u))||a.push(s);return a}(t):function(t){if(n=(e=t)&&e.constructor,e!==("function"==typeof n&&n.prototype||Je))return Ye(t);var e,n,r=[];for(var o in Object(t))Qe.call(t,o)&&"constructor"!=o&&r.push(o);return r}(t);var e},Ze=function(t){return function(t,e,n){var r=e(t);return Se(t)?r:function(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}(r,n(t))}(t,Xe,Pe)},tn=Object.prototype.hasOwnProperty,en=ie(Ut,"DataView"),nn=ie(Ut,"Promise"),rn=ie(Ut,"Set"),on=ie(Ut,"WeakMap"),an="[object Map]",un="[object Promise]",sn="[object Set]",cn="[object WeakMap]",ln="[object DataView]",fn=Xt(en),pn=Xt(ae),hn=Xt(nn),dn=Xt(rn),vn=Xt(on),yn=Kt;(en&&yn(new en(new ArrayBuffer(1)))!=ln||ae&&yn(new ae)!=an||nn&&yn(nn.resolve())!=un||rn&&yn(new rn)!=sn||on&&yn(new on)!=cn)&&(yn=function(t){var e=Kt(t),n="[object Object]"==e?t.constructor:void 0,r=n?Xt(n):"";if(r)switch(r){case fn:return ln;case pn:return an;case hn:return un;case dn:return sn;case vn:return cn}return e});var gn=yn,mn="[object Arguments]",bn="[object Array]",wn="[object Object]",On=Object.prototype.hasOwnProperty,Sn=function t(e,n,o,i,a){return e===n||(null==e||null==n||!je(e)&&!je(n)?e!=e&&n!=n:function(t,e,n,o,i,a){var u=Se(t),s=Se(e),c=u?bn:gn(t),l=s?bn:gn(e),f=(c=c==mn?wn:c)==wn,p=(l=l==mn?wn:l)==wn,h=c==l;if(h&&Re(t)){if(!Re(e))return!1;u=!0,f=!1}if(h&&!f)return a||(a=new he),u||$e(t)?ye(t,e,n,o,i,a):function(t,e,n,r,o,i,a){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!i(new ge(t),new ge(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Ct(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var u=me;case"[object Set]":var s=1&r;if(u||(u=be),t.size!=e.size&&!s)return!1;var c=a.get(t);if(c)return c==e;r|=2,a.set(t,e);var l=ye(u(t),u(e),r,o,i,a);return a.delete(t),l;case"[object Symbol]":if(Oe)return Oe.call(t)==Oe.call(e)}return!1}(t,e,c,n,o,i,a);if(!(1&n)){var d=f&&On.call(t,"__wrapped__"),v=p&&On.call(e,"__wrapped__");if(d||v){var y=d?t.value():t,g=v?e.value():e;return a||(a=new he),i(y,g,n,o,a)}}return!!h&&(a||(a=new he),function(t,e,n,o,i,a){var u=1&n,s=Ze(t),c=s.length;if(c!=Ze(e).length&&!u)return!1;for(var l=c;l--;){var f=s[l];if(!(u?f in e:tn.call(e,f)))return!1}var p=a.get(t),h=a.get(e);if(p&&h)return p==e&&h==t;var d=!0;a.set(t,e),a.set(e,t);for(var v=u;++l<c;){var y=t[f=s[l]],g=e[f];if(o)var m=u?o(g,y,f,e,t,a):o(y,g,f,t,e,a);if(!(void 0===m?y===g||i(y,g,n,o,a):m)){d=!1;break}v||(v="constructor"==f)}if(d&&!v){var b=t.constructor,w=e.constructor;b==w||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&r(b,b)&&"function"==typeof w&&r(w,w)||(d=!1)}return a.delete(t),a.delete(e),d}(t,e,n,o,i,a))}(e,n,o,i,t,a))},En=function(t,e){return Sn(t,e)},xn=h(824),Pn=h(685),jn=(0,Pn.createGlobalStore)("extensionsInternal",{slots:{},extensions:{}}),kn=function(){return(0,Pn.getGlobalStore)("extensionsInternal",{slots:{},extensions:{}})},An=function(){return(0,Pn.getGlobalStore)("extensions",{slots:{}})};f(jn.getState()),jn.subscribe(f);var _n=h(766),Tn=h(708),Cn=h(618),In=function(t){return void 0===t},Mn=kn(),Dn=An(),Nn=(0,xn.getExtensionSlotsConfigStore)(),Rn=(0,xn.getExtensionsConfigStore)();Mn.subscribe((function(t){O(t,Nn.getState(),Rn.getState())})),Nn.subscribe((function(t){O(Mn.getState(),t,Rn.getState())})),Rn.subscribe((function(t){O(Mn.getState(),Nn.getState(),t)}));var Ln,Un,Bn=function(t){return Mn.setState((function(e){return e.extensions[t.name]=g(y({},t),{instances:[]}),e}))},Fn=function(t,e){return Mn.setState((function(n){var r,o=null===(r=n.slots[e])||void 0===r?void 0:r.moduleName;if(o&&o!=t)return console.warn("An extension slot with the name '".concat(e,'\' already exists. Refusing to register the same slot name twice (in "registerExtensionSlot"). The existing one is from module ').concat(o,".")),n;if(o&&o==t)return n;if(n.slots[e])return g(y({},n),{slots:g(y({},n.slots),v({},e,g(y({},n.slots[e]),{moduleName:t})))});var i=S(e,t);return g(y({},n),{slots:g(y({},n.slots),v({},e,i))})}))},Vn=function(){return Dn.setState((function(){return{slots:{},extensions:{}}}))},zn=(0,Pn.createGlobalStore)("modalRegistry",{modals:{}});function Hn(t){return Hn="function"==typeof Symbol&&"symbol"==o(Symbol.iterator)?function(t){return void 0===t?"undefined":o(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":o(t)},Hn(t)}function Wn(t,e){return Wn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Wn(t,e)}function Gn(t){return Gn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Gn(t)}Ln=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){N(t,e,n[e])}))}return t}({},{address1:"Address line 1",address2:"Address line 2",address3:"Address line 3",address4:"Address line 4",address5:"Address line 5",address6:"Address line 6",city:"City",cityVillage:"City",country:"Country",countyDistrict:"District",postalCode:"Postal code",state:"State",stateProvince:"State"},{closeAllOpenedWorkspaces:"Discard changes in {{count}} workspaces",closingAllWorkspacesPromptBody:"There are unsaved changes in the following workspaces. Do you want to discard changes in the following workspaces? {{workspaceNames}}",closingAllWorkspacesPromptTitle:"You have unsaved changes",discard:"Discard",hide:"Hide",maximize:"Maximize",minimize:"Minimize",openAnyway:"Open anyway",unsavedChangesInOpenedWorkspace:"You have unsaved changes in the opened workspace. Do you want to discard these changes?",unsavedChangesInWorkspace:"There are unsaved changes in {{workspaceName}}. Please save them before opening another workspace.",unsavedChangesTitleText:"Unsaved changes",workspaceHeader:"Workspace header"}),Un=null!=(Un={actions:"Actions",address:"Address",age:"Age",cancel:"Cancel",change:"Change",close:"Close",confirm:"Confirm",contactAdministratorIfIssuePersists:"Contact your system administrator if the problem persists.",contactDetails:"Contact details",error:"Error",errorCopy:"Sorry, there was a problem displaying this information. You can try to reload this page, or contact the site administrator and quote the error code above.",female:"Female",hideDetails:"Hide details",loading:"Loading",male:"Male",other:"Other",patientIdentifierSticker:"Patient identifier sticker",patientLists:"Patient lists",print:"Print",printError:"Print error",printErrorExplainer:"An error occurred in {{errorLocation}}",printIdentifierSticker:"Print identifier sticker",printing:"Printing",relationships:"Relationships",resetOverrides:"Reset overrides",scriptLoadingFailed:"Error: Script failed to load",scriptLoadingError:"Failed to load overridden script from {{url}}. Please check that the bundled script is available at the expected URL. Click the button below to reset all import map overrides.",seeMoreLists:"See {{count}} more lists",sex:"Sex",showDetails:"Show details",unknown:"Unknown"})?Un:{},Object.getOwnPropertyDescriptors?Object.defineProperties(Ln,Object.getOwnPropertyDescriptors(Un)):function(t){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e.push.apply(e,n)}return e}(Object(Un)).forEach((function(t){Object.defineProperty(Ln,t,Object.getOwnPropertyDescriptor(Un,t))}));var Kn={type:"logger",log:function(t){this.output("log",t)},warn:function(t){this.output("warn",t)},error:function(t){this.output("error",t)},output:function(t,e){console&&console[t]&&console[t].apply(console,e)}},$n=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};R(this,t),this.init(e,n)}return B(t,[{key:"init",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=e.prefix||"i18next:",this.logger=t||Kn,this.options=e,this.debug=e.debug}},{key:"setDebug",value:function(t){this.debug=t}},{key:"log",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.forward(e,"log","",!0)}},{key:"warn",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.forward(e,"warn","",!0)}},{key:"error",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.forward(e,"error","")}},{key:"deprecate",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(t,e,n,r){return r&&!this.debug?null:("string"==typeof t[0]&&(t[0]="".concat(n).concat(this.prefix," ").concat(t[0])),this.logger[e](t))}},{key:"create",value:function(e){return new t(this.logger,K(K({},{prefix:"".concat(this.prefix,":").concat(e,":")}),this.options))}},{key:"clone",value:function(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new t(this.logger,e)}}]),t}(),qn=new $n,Jn=function(){function t(){R(this,t),this.observers={}}return B(t,[{key:"on",value:function(t,e){var n=this;return t.split(" ").forEach((function(t){n.observers[t]=n.observers[t]||[],n.observers[t].push(e)})),this}},{key:"off",value:function(t,e){this.observers[t]&&(e?this.observers[t]=this.observers[t].filter((function(t){return t!==e})):delete this.observers[t])}},{key:"emit",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.observers[t]&&[].concat(this.observers[t]).forEach((function(t){t.apply(void 0,n)})),this.observers["*"]&&[].concat(this.observers["*"]).forEach((function(e){e.apply(e,[t].concat(n))}))}}]),t}();function Yn(t,e,n){for(var o in e)"__proto__"!==o&&"constructor"!==o&&(o in t?"string"==typeof t[o]||r(t[o],String)||"string"==typeof e[o]||r(e[o],String)?n&&(t[o]=e[o]):Yn(t[o],e[o],n):t[o]=e[o]);return t}var Qn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},Xn="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Zn=[" ",",","?","!",";"];function tr(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(t){if(t[e])return t[e];for(var r=e.split(n),o=t,i=0;i<r.length;++i){if(!o)return;if("string"==typeof o[r[i]]&&i+1<r.length)return;if(void 0===o[r[i]]){for(var a=2,u=r.slice(i,i+a).join(n),s=o[u];void 0===s&&r.length>i+a;)a++,s=o[u=r.slice(i,i+a).join(n)];if(void 0===s)return;if(null===s)return null;if(e.endsWith(u)){if("string"==typeof s)return s;if(u&&"string"==typeof s[u])return s[u]}var c=r.slice(i+a).join(n);return c?tr(s,c,n):void 0}o=o[r[i]]}return o}}var er=function(t){V(o,t);var e,n,r=(e=o,n=function(){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(t){return!1}}(),function(){var t,r=Gn(e);if(n){var o=Gn(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return z(this,t)});function o(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return R(this,o),e=r.call(this),Xn&&Jn.call(F(e)),e.data=t||{},e.options=n,void 0===e.options.keySeparator&&(e.options.keySeparator="."),void 0===e.options.ignoreJSONStructure&&(e.options.ignoreJSONStructure=!0),e}return B(o,[{key:"addNamespaces",value:function(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}},{key:"removeNamespaces",value:function(t){var e=this.options.ns.indexOf(t);e>-1&&this.options.ns.splice(e,1)}},{key:"getResource",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,a=[t,e];n&&"string"!=typeof n&&(a=a.concat(n)),n&&"string"==typeof n&&(a=a.concat(o?n.split(o):n)),t.indexOf(".")>-1&&(a=t.split("."));var u=Q(this.data,a);return u||!i||"string"!=typeof n?u:tr(this.data&&this.data[t]&&this.data[t][e],n,o)}},{key:"addResource",value:function(t,e,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=this.options.keySeparator;void 0===i&&(i=".");var a=[t,e];n&&(a=a.concat(i?n.split(i):n)),t.indexOf(".")>-1&&(r=e,e=(a=t.split("."))[1]),this.addNamespaces(e),Y(this.data,a,r),o.silent||this.emit("added",t,e,n,r)}},{key:"addResources",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var o in n)"string"!=typeof n[o]&&"[object Array]"!==Object.prototype.toString.apply(n[o])||this.addResource(t,e,o,n[o],{silent:!0});r.silent||this.emit("added",t,e,n)}},{key:"addResourceBundle",value:function(t,e,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[t,e];t.indexOf(".")>-1&&(r=n,n=e,e=(a=t.split("."))[1]),this.addNamespaces(e);var u=Q(this.data,a)||{};r?Yn(u,n,o):u=nt(nt({},u),n),Y(this.data,a,u),i.silent||this.emit("added",t,e,n)}},{key:"removeResourceBundle",value:function(t,e){this.hasResourceBundle(t,e)&&delete this.data[t][e],this.removeNamespaces(e),this.emit("removed",t,e)}},{key:"hasResourceBundle",value:function(t,e){return void 0!==this.getResource(t,e)}},{key:"getResourceBundle",value:function(t,e){return e||(e=this.options.defaultNS),"v1"===this.options.compatibilityAPI?nt(nt({},{}),this.getResource(t,e)):this.getResource(t,e)}},{key:"getDataByLanguage",value:function(t){return this.data[t]}},{key:"hasLanguageSomeTranslations",value:function(t){var e=this.getDataByLanguage(t);return!!(e&&Object.keys(e)||[]).find((function(t){return e[t]&&Object.keys(e[t]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),o}(Jn),nr={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,e,n,r,o){var i=this;return t.forEach((function(t){i.processors[t]&&(e=i.processors[t].process(e,n,r,o))})),e}},rr={},or=function(t){V(o,t);var e,n,r=(e=o,n=function(){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(t){return!1}}(),function(){var t,r=Gn(e);if(n){var o=Gn(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return z(this,t)});function o(t){var e,n,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return R(this,o),e=r.call(this),Xn&&Jn.call(F(e)),n=t,i=F(e),["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach((function(t){n[t]&&(i[t]=n[t])})),e.options=a,void 0===e.options.keySeparator&&(e.options.keySeparator="."),e.logger=qn.create("translator"),e}return B(o,[{key:"changeLanguage",value:function(t){t&&(this.language=t)}},{key:"exists",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==t)return!1;var n=this.resolve(t,e);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(t,e){var n=void 0!==e.nsSeparator?e.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator,o=e.ns||this.options.defaultNS||[],i=n&&t.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||e.keySeparator||this.options.userDefinedNsSeparator||e.nsSeparator||function(t,e,n){e=e||"",n=n||"";var r=Zn.filter((function(t){return e.indexOf(t)<0&&n.indexOf(t)<0}));if(0===r.length)return!0;var o=new RegExp("(".concat(r.map((function(t){return"?"===t?"\\?":t})).join("|"),")")),i=!o.test(t);if(!i){var a=t.indexOf(n);a>0&&!o.test(t.substring(0,a))&&(i=!0)}return i}(t,n,r));if(i&&!a){var u=t.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:t,namespaces:o};var s=t.split(n);(n!==r||n===r&&this.options.ns.indexOf(s[0])>-1)&&(o=s.shift()),t=s.join(r)}return"string"==typeof o&&(o=[o]),{key:t,namespaces:o}}},{key:"translate",value:function(t,e,n){var r=this;if("object"!==Hn(e)&&this.options.overloadTranslationOptionHandler&&(e=this.options.overloadTranslationOptionHandler(arguments)),e||(e={}),null==t)return"";Array.isArray(t)||(t=[String(t)]);var i=void 0!==e.returnDetails?e.returnDetails:this.options.returnDetails,a=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator,u=this.extractFromKey(t[t.length-1],e),s=u.key,c=u.namespaces,l=c[c.length-1],f=e.lng||this.language,p=e.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f&&"cimode"===f.toLowerCase()){if(p){var h=e.nsSeparator||this.options.nsSeparator;return i?(d.res="".concat(l).concat(h).concat(s),d):"".concat(l).concat(h).concat(s)}return i?(d.res=s,d):s}var d=this.resolve(t,e),v=d&&d.res,y=d&&d.usedKey||s,g=d&&d.exactUsedKey||s,m=Object.prototype.toString.apply(v),b=void 0!==e.joinArrays?e.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject;if(w&&v&&"string"!=typeof v&&"boolean"!=typeof v&&"number"!=typeof v&&["[object Number]","[object Function]","[object RegExp]"].indexOf(m)<0&&("string"!=typeof b||"[object Array]"!==m)){if(!e.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var O=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,v,ot(ot({},e),{},{ns:c})):"key '".concat(s," (").concat(this.language,")' returned an object instead of string.");return i?(d.res=O,d):O}if(a){var S="[object Array]"===m,E=S?[]:{},x=S?g:y;for(var P in v)if(Object.prototype.hasOwnProperty.call(v,P)){var j="".concat(x).concat(a).concat(P);E[P]=this.translate(j,ot(ot({},e),{joinArrays:!1,ns:c})),E[P]===j&&(E[P]=v[P])}v=E}}else if(w&&"string"==typeof b&&"[object Array]"===m)(v=v.join(b))&&(v=this.extendTranslation(v,t,e,n));else{var k=!1,A=!1,_=void 0!==e.count&&"string"!=typeof e.count,T=o.hasDefaultValue(e),C=_?this.pluralResolver.getSuffix(f,e.count,e):"",I=e["defaultValue".concat(C)]||e.defaultValue;!this.isValidLookup(v)&&T&&(k=!0,v=I),this.isValidLookup(v)||(A=!0,v=s);var M=(e.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&A?void 0:v,D=T&&I!==v&&this.options.updateMissing;if(A||k||D){if(this.logger.log(D?"updateKey":"missingKey",f,l,s,D?I:v),a){var N=this.resolve(s,ot(ot({},e),{},{keySeparator:!1}));N&&N.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var R=[],L=this.languageUtils.getFallbackCodes(this.options.fallbackLng,e.lng||this.language);if("fallback"===this.options.saveMissingTo&&L&&L[0])for(var U=0;U<L.length;U++)R.push(L[U]);else"all"===this.options.saveMissingTo?R=this.languageUtils.toResolveHierarchy(e.lng||this.language):R.push(e.lng||this.language);var B=function(t,n,o){var i=T&&o!==v?o:M;r.options.missingKeyHandler?r.options.missingKeyHandler(t,l,n,i,D,e):r.backendConnector&&r.backendConnector.saveMissing&&r.backendConnector.saveMissing(t,l,n,i,D,e),r.emit("missingKey",t,l,n,v)};this.options.saveMissing&&(this.options.saveMissingPlurals&&_?R.forEach((function(t){r.pluralResolver.getSuffixes(t,e).forEach((function(n){B([t],s+n,e["defaultValue".concat(n)]||I)}))})):B(R,s,I))}v=this.extendTranslation(v,t,e,d,n),A&&v===s&&this.options.appendNamespaceToMissingKey&&(v="".concat(l,":").concat(s)),(A||k)&&this.options.parseMissingKeyHandler&&(v="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(l,":").concat(s):s,k?v:void 0):this.options.parseMissingKeyHandler(v))}return i?(d.res=v,d):v}},{key:"extendTranslation",value:function(t,e,n,r,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,ot(ot({},this.options.interpolation.defaultVariables),n),r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(ot(ot({},n),{interpolation:ot(ot({},this.options.interpolation),n.interpolation)}));var a,u="string"==typeof t&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(u){var s=t.match(this.interpolator.nestingRegexp);a=s&&s.length}var c=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(c=ot(ot({},this.options.interpolation.defaultVariables),c)),t=this.interpolator.interpolate(t,c,n.lng||this.language,n),u){var l=t.match(this.interpolator.nestingRegexp);a<(l&&l.length)&&(n.nest=!1)}!1!==n.nest&&(t=this.interpolator.nest(t,(function(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return o&&o[0]===r[0]&&!n.context?(i.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(e[0])),null):i.translate.apply(i,r.concat([e]))}),n)),n.interpolation&&this.interpolator.reset()}var f=n.postProcess||this.options.postProcess,p="string"==typeof f?[f]:f;return null!=t&&p&&p.length&&!1!==n.applyPostProcessor&&(t=nr.handle(p,t,e,this.options&&this.options.postProcessPassResolved?ot({i18nResolved:r},n):n,this)),t}},{key:"resolve",value:function(t){var e,n,r,o,i,a=this,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof t&&(t=[t]),t.forEach((function(t){if(!a.isValidLookup(e)){var s=a.extractFromKey(t,u),c=s.key;n=c;var l=s.namespaces;a.options.fallbackNS&&(l=l.concat(a.options.fallbackNS));var f=void 0!==u.count&&"string"!=typeof u.count,p=f&&!u.ordinal&&0===u.count&&a.pluralResolver.shouldUseIntlApi(),h=void 0!==u.context&&("string"==typeof u.context||"number"==typeof u.context)&&""!==u.context,d=u.lngs?u.lngs:a.languageUtils.toResolveHierarchy(u.lng||a.language,u.fallbackLng);l.forEach((function(t){a.isValidLookup(e)||(i=t,!rr["".concat(d[0],"-").concat(t)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(i)&&(rr["".concat(d[0],"-").concat(t)]=!0,a.logger.warn('key "'.concat(n,'" for languages "').concat(d.join(", "),'" won\'t get resolved as namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),d.forEach((function(n){if(!a.isValidLookup(e)){o=n;var i,s=[c];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(s,c,n,t,u);else{var l;f&&(l=a.pluralResolver.getSuffix(n,u.count,u));var d="".concat(a.options.pluralSeparator,"zero");if(f&&(s.push(c+l),p&&s.push(c+d)),h){var v="".concat(c).concat(a.options.contextSeparator).concat(u.context);s.push(v),f&&(s.push(v+l),p&&s.push(v+d))}}for(;i=s.pop();)a.isValidLookup(e)||(r=i,e=a.getResource(n,t,i,u))}})))}))}})),{res:e,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:i}}},{key:"isValidLookup",value:function(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)}},{key:"getResource",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,e,n,r):this.resourceStore.getResource(t,e,n,r)}}],[{key:"hasDefaultValue",value:function(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&"defaultValue"===e.substring(0,12)&&void 0!==t[e])return!0;return!1}}]),o}(Jn),ir=function(){function t(e){R(this,t),this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=qn.create("languageUtils")}return B(t,[{key:"getScriptPartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return null;var e=t.split("-");return 2===e.length?null:(e.pop(),"x"===e[e.length-1].toLowerCase()?null:this.formatLanguageCode(e.join("-")))}},{key:"getLanguagePartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return t;var e=t.split("-");return this.formatLanguageCode(e[0])}},{key:"formatLanguageCode",value:function(t){if("string"==typeof t&&t.indexOf("-")>-1){var e=["hans","hant","latn","cyrl","cans","mong","arab"],n=t.split("-");return this.options.lowerCaseLng?n=n.map((function(t){return t.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),e.indexOf(n[1].toLowerCase())>-1&&(n[1]=it(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),e.indexOf(n[1].toLowerCase())>-1&&(n[1]=it(n[1].toLowerCase())),e.indexOf(n[2].toLowerCase())>-1&&(n[2]=it(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}},{key:"isSupportedCode",value:function(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}},{key:"getBestMatchFromCodes",value:function(t){var e,n=this;return t?(t.forEach((function(t){if(!e){var r=n.formatLanguageCode(t);n.options.supportedLngs&&!n.isSupportedCode(r)||(e=r)}})),!e&&this.options.supportedLngs&&t.forEach((function(t){if(!e){var r=n.getLanguagePartFromCode(t);if(n.isSupportedCode(r))return e=r;e=n.options.supportedLngs.find((function(t){if(0===t.indexOf(r))return t}))}})),e||(e=this.getFallbackCodes(this.options.fallbackLng)[0]),e):null}},{key:"getFallbackCodes",value:function(t,e){if(!t)return[];if("function"==typeof t&&(t=t(e)),"string"==typeof t&&(t=[t]),"[object Array]"===Object.prototype.toString.apply(t))return t;if(!e)return t.default||[];var n=t[e];return n||(n=t[this.getScriptPartFromCode(e)]),n||(n=t[this.formatLanguageCode(e)]),n||(n=t[this.getLanguagePartFromCode(e)]),n||(n=t.default),n||[]}},{key:"toResolveHierarchy",value:function(t,e){var n=this,r=this.getFallbackCodes(e||this.options.fallbackLng||[],t),o=[],i=function(t){t&&(n.isSupportedCode(t)?o.push(t):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(t)))};return"string"==typeof t&&t.indexOf("-")>-1?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(t))):"string"==typeof t&&i(this.formatLanguageCode(t)),r.forEach((function(t){o.indexOf(t)<0&&i(n.formatLanguageCode(t))})),o}}]),t}(),ar=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],ur={1:function(t){return Number(t>1)},2:function(t){return Number(1!=t)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(0==t?0:1==t?1:2==t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(1==t?0:t>=2&&t<=4?1:2)},7:function(t){return Number(1==t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(1==t?0:2==t?1:8!=t&&11!=t?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(1==t?0:2==t?1:t<7?2:t<11?3:4)},11:function(t){return Number(1==t||11==t?0:2==t||12==t?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(0!==t)},14:function(t){return Number(1==t?0:2==t?1:3==t?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:0!==t?1:2)},17:function(t){return Number(1==t||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(0==t?0:1==t?1:2)},19:function(t){return Number(1==t?0:0==t||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(1==t?0:0==t||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(1==t?0:2==t?1:(t<0||t>10)&&t%10==0?2:3)}},sr=["v1","v2","v3"],cr={zero:0,one:1,two:2,few:3,many:4,other:5},lr=function(){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};R(this,t),this.languageUtils=e,this.options=r,this.logger=qn.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=(n={},ar.forEach((function(t){t.lngs.forEach((function(e){n[e]={numbers:t.nr,plurals:ur[t.fc]}}))})),n)}return B(t,[{key:"addRule",value:function(t,e){this.rules[t]=e}},{key:"getRule",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(t,{type:e.ordinal?"ordinal":"cardinal"})}catch(t){return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}},{key:"needsPlural",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(t,e);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(t,n).map((function(t){return"".concat(e).concat(t)}))}},{key:"getSuffixes",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((function(t,e){return cr[t]-cr[e]})).map((function(t){return"".concat(e.options.prepend).concat(t)})):r.numbers.map((function(r){return e.getSuffix(t,r,n)})):[]}},{key:"getSuffix",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(t,n);return r?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(r.select(e)):this.getSuffixRetroCompatible(r,e):(this.logger.warn("no plural rule found for: ".concat(t)),"")}},{key:"getSuffixRetroCompatible",value:function(t,e){var n=this,r=t.noAbs?t.plurals(e):t.plurals(Math.abs(e)),o=t.numbers[r];this.options.simplifyPluralSuffix&&2===t.numbers.length&&1===t.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var i=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):i():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===t.numbers.length&&1===t.numbers[0]?i():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}},{key:"shouldUseIntlApi",value:function(){return!sr.includes(this.options.compatibilityJSON)}}]),t}(),fr=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};R(this,t),this.logger=qn.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||function(t){return t},this.init(e)}return B(t,[{key:"init",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});var e=t.interpolation;this.escape=void 0!==e.escape?e.escape:tt,this.escapeValue=void 0===e.escapeValue||e.escapeValue,this.useRawValueToEscape=void 0!==e.useRawValueToEscape&&e.useRawValueToEscape,this.prefix=e.prefix?Z(e.prefix):e.prefixEscaped||"{{",this.suffix=e.suffix?Z(e.suffix):e.suffixEscaped||"}}",this.formatSeparator=e.formatSeparator?e.formatSeparator:e.formatSeparator||",",this.unescapePrefix=e.unescapeSuffix?"":e.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":e.unescapeSuffix||"",this.nestingPrefix=e.nestingPrefix?Z(e.nestingPrefix):e.nestingPrefixEscaped||Z("$t("),this.nestingSuffix=e.nestingSuffix?Z(e.nestingSuffix):e.nestingSuffixEscaped||Z(")"),this.nestingOptionsSeparator=e.nestingOptionsSeparator?e.nestingOptionsSeparator:e.nestingOptionsSeparator||",",this.maxReplaces=e.maxReplaces?e.maxReplaces:1e3,this.alwaysFormat=void 0!==e.alwaysFormat&&e.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var t="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(t,"g");var e="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(e,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(t,e,n,r){var o,i,a,u=this,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(t){return t.replace(/\$/g,"$$$$")}var l=function(t){if(t.indexOf(u.formatSeparator)<0){var o=X(e,s,t);return u.alwaysFormat?u.format(o,void 0,n,ut(ut(ut({},r),e),{},{interpolationkey:t})):o}var i=t.split(u.formatSeparator),a=i.shift().trim(),c=i.join(u.formatSeparator).trim();return u.format(X(e,s,a),c,n,ut(ut(ut({},r),e),{},{interpolationkey:a}))};this.resetRegExp();var f=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,p=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(t){return c(t)}},{regex:this.regexp,safeValue:function(t){return u.escapeValue?c(u.escape(t)):c(t)}}].forEach((function(e){for(a=0;o=e.regex.exec(t);){var n=o[1].trim();if(void 0===(i=l(n)))if("function"==typeof f){var s=f(t,o,r);i="string"==typeof s?s:""}else if(r&&r.hasOwnProperty(n))i="";else{if(p){i=o[0];continue}u.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(t)),i=""}else"string"==typeof i||u.useRawValueToEscape||(i=q(i));var c=e.safeValue(i);if(t=t.replace(o[0],c),p?(e.regex.lastIndex+=i.length,e.regex.lastIndex-=o[0].length):e.regex.lastIndex=0,++a>=u.maxReplaces)break}})),t}},{key:"nest",value:function(t,e){var n,r,o=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=ut({},i);function u(t,e){var n=this.nestingOptionsSeparator;if(t.indexOf(n)<0)return t;var r=t.split(new RegExp("".concat(n,"[ ]*{"))),o="{".concat(r[1]);t=r[0];var i=(o=this.interpolate(o,a)).match(/'/g),u=o.match(/"/g);(i&&i.length%2==0&&!u||u.length%2!=0)&&(o=o.replace(/'/g,'"'));try{a=JSON.parse(o),e&&(a=ut(ut({},e),a))}catch(e){return this.logger.warn("failed parsing options string in nesting for key ".concat(t),e),"".concat(t).concat(n).concat(o)}return delete a.defaultValue,t}for(a.applyPostProcessor=!1,delete a.defaultValue;n=this.nestingRegexp.exec(t);){var s=[],c=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var l=n[1].split(this.formatSeparator).map((function(t){return t.trim()}));n[1]=l.shift(),s=l,c=!0}if((r=e(u.call(this,n[1].trim(),a),a))&&n[0]===t&&"string"!=typeof r)return r;"string"!=typeof r&&(r=q(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(t)),r=""),c&&(r=s.reduce((function(t,e){return o.format(t,e,i.lng,ut(ut({},i),{},{interpolationkey:n[1].trim()}))}),r.trim())),t=t.replace(n[0],r),this.regexp.lastIndex=0}return t}}]),t}(),pr=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};R(this,t),this.logger=qn.create("formatter"),this.options=e,this.formats={number:lt((function(t,e){var n=new Intl.NumberFormat(t,e);return function(t){return n.format(t)}})),currency:lt((function(t,e){var n=new Intl.NumberFormat(t,ct(ct({},e),{},{style:"currency"}));return function(t){return n.format(t)}})),datetime:lt((function(t,e){var n=new Intl.DateTimeFormat(t,ct({},e));return function(t){return n.format(t)}})),relativetime:lt((function(t,e){var n=new Intl.RelativeTimeFormat(t,ct({},e));return function(t){return n.format(t,e.range||"day")}})),list:lt((function(t,e){var n=new Intl.ListFormat(t,ct({},e));return function(t){return n.format(t)}}))},this.init(e)}return B(t,[{key:"init",value:function(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=e.formatSeparator?e.formatSeparator:e.formatSeparator||","}},{key:"add",value:function(t,e){this.formats[t.toLowerCase().trim()]=e}},{key:"addCached",value:function(t,e){this.formats[t.toLowerCase().trim()]=lt(e)}},{key:"format",value:function(t,e,n,r){var o=this;return e.split(this.formatSeparator).reduce((function(t,e){var i=function(t){var e=t.toLowerCase().trim(),n={};if(t.indexOf("(")>-1){var r=t.split("(");e=r[0].toLowerCase().trim();var o=r[1].substring(0,r[1].length-1);"currency"===e&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===e&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach((function(t){if(t){var e=function(t){if(Array.isArray(t))return t}(i=t.split(":"))||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(i)||function(t,e){if(t){if("string"==typeof t)return W(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?W(t,e):void 0}}(i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=e[0],o=e.slice(1).join(":").trim().replace(/^'+|'+$/g,"");n[r.trim()]||(n[r.trim()]=o),"false"===o&&(n[r.trim()]=!1),"true"===o&&(n[r.trim()]=!0),isNaN(o)||(n[r.trim()]=parseInt(o,10))}var i}))}return{formatName:e,formatOptions:n}}(e),a=i.formatName,u=i.formatOptions;if(o.formats[a]){var s=t;try{var c=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},l=c.locale||c.lng||r.locale||r.lng||n;s=o.formats[a](t,l,ct(ct(ct({},u),r),c))}catch(t){o.logger.warn(t)}return s}return o.logger.warn("there was no format function for ".concat(a)),t}),t)}}]),t}(),hr=function(t){V(o,t);var e,n,r=(e=o,n=function(){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(t){return!1}}(),function(){var t,r=Gn(e);if(n){var o=Gn(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return z(this,t)});function o(t,e,n){var i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return R(this,o),i=r.call(this),Xn&&Jn.call(F(i)),i.backend=t,i.store=e,i.services=n,i.languageUtils=n.languageUtils,i.options=a,i.logger=qn.create("backendConnector"),i.waitingReads=[],i.maxParallelReads=a.maxParallelReads||10,i.readingCalls=0,i.maxRetries=a.maxRetries>=0?a.maxRetries:5,i.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(n,a.backend,a),i}return B(o,[{key:"queueLoad",value:function(t,e,n,r){var o=this,i={},a={},u={},s={};return t.forEach((function(t){var r=!0;e.forEach((function(e){var u="".concat(t,"|").concat(e);!n.reload&&o.store.hasResourceBundle(t,e)?o.state[u]=2:o.state[u]<0||(1===o.state[u]?void 0===a[u]&&(a[u]=!0):(o.state[u]=1,r=!1,void 0===a[u]&&(a[u]=!0),void 0===i[u]&&(i[u]=!0),void 0===s[e]&&(s[e]=!0)))})),r||(u[t]=!0)})),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(u),toLoadNamespaces:Object.keys(s)}}},{key:"loaded",value:function(t,e,n){var r=t.split("|"),o=r[0],i=r[1];e&&this.emit("failedLoading",o,i,e),n&&this.store.addResourceBundle(o,i,n),this.state[t]=e?-1:2;var a={};this.queue.forEach((function(n){var r,u,s,c,l;r=n.loaded,u=i,(c=(s=J(r,[o],Object)).obj)[l=s.k]=c[l]||[],c[l].push(u),function(t,e){void 0!==t.pending[e]&&(delete t.pending[e],t.pendingCount--)}(n,t),e&&n.errors.push(e),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((function(t){a[t]||(a[t]={});var e=n.loaded[t];e.length&&e.forEach((function(e){void 0===a[t][e]&&(a[t][e]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(t){return!t.done}))}},{key:"read",value:function(t,e,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;return t.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:t,ns:e,fcName:n,tried:o,wait:i,callback:a}):(this.readingCalls++,this.backend[n](t,e,(function(u,s){if(r.readingCalls--,r.waitingReads.length>0){var c=r.waitingReads.shift();r.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}u&&s&&o<r.maxRetries?setTimeout((function(){r.read.call(r,t,e,n,o+1,2*i,a)}),i):a(u,s)}))):a(null,{})}},{key:"prepareLoading",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();"string"==typeof t&&(t=this.languageUtils.toResolveHierarchy(t)),"string"==typeof e&&(e=[e]);var i=this.queueLoad(t,e,r,o);if(!i.toLoad.length)return i.pending.length||o(),null;i.toLoad.forEach((function(t){n.loadOne(t)}))}},{key:"load",value:function(t,e,n){this.prepareLoading(t,e,{},n)}},{key:"reload",value:function(t,e,n){this.prepareLoading(t,e,{reload:!0},n)}},{key:"loadOne",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=t.split("|"),o=r[0],i=r[1];this.read(o,i,"read",void 0,void 0,(function(r,a){r&&e.logger.warn("".concat(n,"loading namespace ").concat(i," for language ").concat(o," failed"),r),!r&&a&&e.logger.log("".concat(n,"loaded namespace ").concat(i," for language ").concat(o),a),e.loaded(t,r,a)}))}},{key:"saveMissing",value:function(t,e,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(e)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(e,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(t,e,n,r,null,pt(pt({},i),{},{isUpdate:o})),t&&t[0]&&this.store.addResource(t[0],e,n,r))}}]),o}(Jn),dr=function(t){V(o,t);var e,n,r=(e=o,n=function(){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(t){return!1}}(),function(){var t,r=Gn(e);if(n){var o=Gn(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return z(this,t)});function o(){var t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(R(this,o),t=r.call(this),Xn&&Jn.call(F(t)),t.options=ht(n),t.services={},t.logger=qn,t.modules={external:[]},e=F(t),Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))})),i&&!t.isInitialized&&!n.isClone){if(!t.options.initImmediate)return t.init(n,i),z(t,F(t));setTimeout((function(){t.init(n,i)}),0)}return t}return B(o,[{key:"init",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof e&&(n=e,e={}),!e.defaultNS&&!1!==e.defaultNS&&e.ns&&("string"==typeof e.ns?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));var r={debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var e={};if("object"===Hn(t[1])&&(e=t[1]),"string"==typeof t[1]&&(e.defaultValue=t[1]),"string"==typeof t[2]&&(e.tDescription=t[2]),"object"===Hn(t[2])||"object"===Hn(t[3])){var n=t[3]||t[2];Object.keys(n).forEach((function(t){e[t]=n[t]}))}return e},interpolation:{escapeValue:!0,format:function(t,e,n,r){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}};function o(t){return t?"function"==typeof t?new t:t:null}if(this.options=vt(vt(vt({},r),this.options),ht(e)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=vt(vt({},r.interpolation),this.options.interpolation)),void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator),!this.options.isClone){var i;this.modules.logger?qn.init(o(this.modules.logger),this.options):qn.init(null,this.options),this.modules.formatter?i=this.modules.formatter:"undefined"!=typeof Intl&&(i=pr);var a=new ir(this.options);this.store=new er(this.options.resources,this.options);var u=this.services;u.logger=qn,u.resourceStore=this.store,u.languageUtils=a,u.pluralResolver=new lr(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!i||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(u.formatter=o(i),u.formatter.init(u,this.options),this.options.interpolation.format=u.formatter.format.bind(u.formatter)),u.interpolator=new fr(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new hr(o(this.modules.backend),u.resourceStore,u,this.options),u.backendConnector.on("*",(function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];t.emit.apply(t,[e].concat(r))})),this.modules.languageDetector&&(u.languageDetector=o(this.modules.languageDetector),u.languageDetector.init(u,this.options.detection,this.options)),this.modules.i18nFormat&&(u.i18nFormat=o(this.modules.i18nFormat),u.i18nFormat.init&&u.i18nFormat.init(this)),this.translator=new or(this.services,this.options),this.translator.on("*",(function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];t.emit.apply(t,[e].concat(r))})),this.modules.external.forEach((function(e){e.init&&e.init(t)}))}if(this.format=this.options.interpolation.format,n||(n=yt),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var s=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);s.length>0&&"dev"!==s[0]&&(this.options.lng=s[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((function(e){t[e]=function(){var n;return(n=t.store)[e].apply(n,arguments)}})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((function(e){t[e]=function(){var n;return(n=t.store)[e].apply(n,arguments),t}}));var c=$(),l=function(){var e=function(e,r){t.isInitialized&&!t.initializedStoreOnce&&t.logger.warn("init: i18next is already initialized. You should call init just once!"),t.isInitialized=!0,t.options.isClone||t.logger.log("initialized",t.options),t.emit("initialized",t.options),c.resolve(r),n(e,r)};if(t.languages&&"v1"!==t.options.compatibilityAPI&&!t.isInitialized)return e(null,t.t.bind(t));t.changeLanguage(t.options.lng,e)};return this.options.resources||!this.options.initImmediate?l():setTimeout(l,0),c}},{key:"loadResources",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yt,r="string"==typeof t?t:this.language;if("function"==typeof t&&(n=t),!this.options.resources||this.options.partialBundledLanguages){if(r&&"cimode"===r.toLowerCase())return n();var o=[],i=function(t){t&&e.services.languageUtils.toResolveHierarchy(t).forEach((function(t){o.indexOf(t)<0&&o.push(t)}))};r?i(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((function(t){return i(t)})),this.options.preload&&this.options.preload.forEach((function(t){return i(t)})),this.services.backendConnector.load(o,this.options.ns,(function(t){t||e.resolvedLanguage||!e.language||e.setResolvedLanguage(e.language),n(t)}))}else n(null)}},{key:"reloadResources",value:function(t,e,n){var r=$();return t||(t=this.languages),e||(e=this.options.ns),n||(n=yt),this.services.backendConnector.reload(t,e,(function(t){r.resolve(),n(t)})),r}},{key:"use",value:function(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&nr.addPostProcessor(t),"formatter"===t.type&&(this.modules.formatter=t),"3rdParty"===t.type&&this.modules.external.push(t),this}},{key:"setResolvedLanguage",value:function(t){if(t&&this.languages&&!(["cimode","dev"].indexOf(t)>-1))for(var e=0;e<this.languages.length;e++){var n=this.languages[e];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}},{key:"changeLanguage",value:function(t,e){var n=this;this.isLanguageChangingTo=t;var r=$();this.emit("languageChanging",t);var o=function(t){n.language=t,n.languages=n.services.languageUtils.toResolveHierarchy(t),n.resolvedLanguage=void 0,n.setResolvedLanguage(t)},i=function(i){t||i||!n.services.languageDetector||(i=[]);var a="string"==typeof i?i:n.services.languageUtils.getBestMatchFromCodes(i);a&&(n.language||o(a),n.translator.language||n.translator.changeLanguage(a),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(a)),n.loadResources(a,(function(t){!function(t,i){i?(o(i),n.translator.changeLanguage(i),n.isLanguageChangingTo=void 0,n.emit("languageChanged",i),n.logger.log("languageChanged",i)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),e&&e(t,(function(){return n.t.apply(n,arguments)}))}(t,a)}))};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(i):i(t):i(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(t,e,n){var r=this,o=function t(e,o){var i;if("object"!==Hn(o)){for(var a=arguments.length,u=new Array(a>2?a-2:0),s=2;s<a;s++)u[s-2]=arguments[s];i=r.options.overloadTranslationOptionHandler([e,o].concat(u))}else i=vt({},o);i.lng=i.lng||t.lng,i.lngs=i.lngs||t.lngs,i.ns=i.ns||t.ns,i.keyPrefix=i.keyPrefix||n||t.keyPrefix;var c=r.options.keySeparator||".",l=i.keyPrefix?"".concat(i.keyPrefix).concat(c).concat(e):e;return r.t(l,i)};return"string"==typeof t?o.lng=t:o.lngs=t,o.ns=e,o.keyPrefix=n,o}},{key:"t",value:function(){var t;return this.translator&&(t=this.translator).translate.apply(t,arguments)}},{key:"exists",value:function(){var t;return this.translator&&(t=this.translator).exists.apply(t,arguments)}},{key:"setDefaultNamespace",value:function(t){this.options.defaultNS=t}},{key:"hasLoadedNamespace",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.resolvedLanguage||this.languages[0],o=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(t,n){var r=e.services.backendConnector.state["".concat(t,"|").concat(n)];return-1===r||2===r};if(n.precheck){var u=n.precheck(this,a);if(void 0!==u)return u}return!(!this.hasResourceBundle(r,t)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!a(r,t)||o&&!a(i,t)))}},{key:"loadNamespaces",value:function(t,e){var n=this,r=$();return this.options.ns?("string"==typeof t&&(t=[t]),t.forEach((function(t){n.options.ns.indexOf(t)<0&&n.options.ns.push(t)})),this.loadResources((function(t){r.resolve(),e&&e(t)})),r):(e&&e(),Promise.resolve())}},{key:"loadLanguages",value:function(t,e){var n=$();"string"==typeof t&&(t=[t]);var r=this.options.preload||[],o=t.filter((function(t){return r.indexOf(t)<0}));return o.length?(this.options.preload=r.concat(o),this.loadResources((function(t){n.resolve(),e&&e(t)})),n):(e&&e(),Promise.resolve())}},{key:"dir",value:function(t){return t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),t?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(this.services.languageUtils.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr":"rtl"}},{key:"cloneInstance",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yt,r=vt(vt(vt({},this.options),e),{isClone:!0}),i=new o(r);return void 0===e.debug&&void 0===e.prefix||(i.logger=i.logger.clone(e)),["store","services","language"].forEach((function(e){i[e]=t[e]})),i.services=vt({},this.services),i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i.translator=new or(i.services,i.options),i.translator.on("*",(function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];i.emit.apply(i,[t].concat(n))})),i.init(r,n),i.translator.options=i.options,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),o}(Jn);H(dr,"createInstance",(function(){return new dr(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}));var vr=dr.createInstance();vr.createInstance=dr.createInstance,vr.createInstance,vr.init,vr.loadResources,vr.reloadResources,vr.use,vr.changeLanguage,vr.getFixedT,vr.t,vr.exists,vr.setDefaultNamespace,vr.hasLoadedNamespace,vr.loadNamespaces,vr.loadLanguages;var yr=vr,gr=yr.default||yr;gr.on("initialized",(function(){window.i18next.loadNamespaces(["core"])}));var mr=(0,Pn.createGlobalStore)("workspaceRegistrations",{workspaces:{}}),br=new Set,wr=h(645),Or=0;function Sr(){var t;return t=function(t,e,n,r){var o,i,a,u,s,c,f,p,h,d,v,y,g,m,b=arguments;return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(w){switch(w.label){case 0:if(o=b.length>4&&void 0!==b[4]?b[4]:function(t){return t},i=b.length>5&&void 0!==b[5]?b[5]:{},a=E(r),u=P(r),s=null,!t)return[3,3];if(!u)throw Error("Couldn't find extension '".concat(a,"' to attach to '").concat(e,"'"));return c=u.load,f=u.meta,p=u.moduleName,h=u.online,d=u.offline,Et(h,d)?(l((function(o){var i,u={domElement:t,id:r,slotName:e,slotModuleName:n};return _t(At({},o),{extensions:_t(At({},o.extensions),kt({},a,_t(At({},o.extensions[a]),{instances:(i=o.extensions[a].instances,function(t){if(Array.isArray(t))return Pt(t)}(i)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(i)||function(t,e){if(t){if("string"==typeof t)return Pt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pt(t,e):void 0}}(i)||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.")}()).concat([u])})))})})),[4,c()]):[3,2];case 1:v=w.sent(),y=v.default,g=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(v,["default"]),m=Or++,s=(0,wr.mountRootParcel)(o(_t(At({},null!=y?y:g),{name:"".concat(e,"/").concat(a,"-").concat(m)})),_t(At({},i),{_meta:f,_extensionContext:{extensionId:r,extensionSlotName:e,extensionSlotModuleName:n,extensionModuleName:p},domElement:t})),w.label=2;case 2:return[3,4];case 3:console.warn("Tried to render ".concat(r," into ").concat(e," but no DOM element was available.")),w.label=4;case 4:return[2,s]}}))},Sr=function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){jt(i,r,o,a,u,"next",t)}function u(t){jt(i,r,o,a,u,"throw",t)}a(void 0)}))},Sr.apply(this,arguments)}var Er=kn()}(),d}())}}}))},2223:()=>{System.register(["@openmrs/esm-state"],(function(t,e){var n={};return{setters:[function(t){n.getGlobalStore=t.getGlobalStore}],execute:function(){t(function(){"use strict";var t={685:function(t){t.exports=n}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return function(){var t=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},e=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},n=function(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),o.forEach((function(n){e(t,n,r[n])}))}return t},i=function(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e.push.apply(e,n)}return e}(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},a=function(t,r,o){var a;p.setState((function(u){var s;return{flags:i(n({},u.flags),e({},t,{enabled:null!==(a=null===(s=u.flags[t])||void 0===s?void 0:s.enabled)&&void 0!==a&&a,label:r,description:o}))}}))},u=function(t){return p.getState().flags[t].enabled},s=function(t,e){p.subscribe((function(n){e(n.flags[t].enabled)}))},c=function(t,r){p.setState((function(o){return{flags:i(n({},o.flags),e({},t,i(n({},o.flags[t]),{enabled:r})))}}))};r.r(o),r.d(o,{featureFlagsStore:function(){return p},getFeatureFlag:function(){return u},registerFeatureFlag:function(){return a},setFeatureFlag:function(){return c},subscribeToFeatureFlag:function(){return s}});var l=r(685),f={flags:function(){var t={},e=!0,r=!1,o=void 0;try{for(var i,a=Object.keys(localStorage)[Symbol.iterator]();!(e=(i=a.next()).done);e=!0){var u=i.value;if(u.startsWith("openmrs:feature-flag:")){var s=u.replace("openmrs:feature-flag:",""),c=JSON.parse(localStorage.getItem("openmrs:feature-flag-meta:".concat(s))||"{}");t[s]=n({enabled:"true"===localStorage.getItem(u)},c)}}}catch(t){r=!0,o=t}finally{try{e||null==a.return||a.return()}finally{if(r)throw o}}return t}()},p=(0,l.getGlobalStore)("feature-flags",f);p.subscribe((function(e){var n,r=!0,o=!1,i=void 0;try{for(var a,u=Object.entries(e.flags)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=function(t){if(Array.isArray(t))return t}(n=a.value)||function(t){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,r,o=[],i=!0,a=!1;try{for(e=e.call(t);!(i=(n=e.next()).done)&&(o.push(n.value),2!==o.length);i=!0);}catch(t){a=!0,r=t}finally{try{i||null==e.return||e.return()}finally{if(a)throw r}}return o}}(n)||function(e){if(e){if("string"==typeof e)return t(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(e,2):void 0}}(n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),c=s[0],l=s[1];localStorage.setItem("openmrs:feature-flag:".concat(c),l.enabled.toString()),localStorage.setItem("openmrs:feature-flag-meta:".concat(c),JSON.stringify({label:l.label,description:l.description}))}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}))}(),o}())}}}))},831:(t,e,n)=>{"use strict";n.r(e),n.d(e,{addRoutesOverride:()=>d.Ay,finishRegisteringAllApps:()=>d.yw,getCoreTranslation:()=>g.V,initializeApp:()=>d.Wp,isOpenmrsAppRoutes:()=>d.Uz,isOpenmrsRoutes:()=>d.nX,localStorageRoutesPrefix:()=>d.ll,registerApp:()=>d.FZ,removeRoutesOverride:()=>d.p9,resetAllRoutesOverrides:()=>d.gM,translateFrom:()=>g.t,tryRegisterExtension:()=>d.Y1});var r=n(6747),o={};for(const t in r)"default"!==t&&(o[t]=()=>r[t]);n.d(e,o);var i=n(7274);o={};for(const t in i)"default"!==t&&(o[t]=()=>i[t]);n.d(e,o);var a=n(5863);o={};for(const t in a)"default"!==t&&(o[t]=()=>a[t]);n.d(e,o);var u=n(9425);o={};for(const t in u)"default"!==t&&(o[t]=()=>u[t]);n.d(e,o);var s=n(6133);o={};for(const t in s)"default"!==t&&(o[t]=()=>s[t]);n.d(e,o);var c=n(2223);o={};for(const t in c)"default"!==t&&(o[t]=()=>c[t]);n.d(e,o);var l=n(2207);o={};for(const t in l)"default"!==t&&(o[t]=()=>l[t]);n.d(e,o);var f=n(4757);o={};for(const t in f)"default"!==t&&(o[t]=()=>f[t]);n.d(e,o);var p=n(6641);o={};for(const t in p)"default"!==t&&(o[t]=()=>p[t]);n.d(e,o);var h=n(973);o={};for(const t in h)"default"!==t&&(o[t]=()=>h[t]);n.d(e,o);var d=n(9316),v=n(5297);o={};for(const t in v)["default","addRoutesOverride","finishRegisteringAllApps","initializeApp","isOpenmrsAppRoutes","isOpenmrsRoutes","localStorageRoutesPrefix","registerApp","removeRoutesOverride","resetAllRoutesOverrides","tryRegisterExtension"].indexOf(t)<0&&(o[t]=()=>v[t]);n.d(e,o);var y=n(5961);o={};for(const t in y)["default","addRoutesOverride","finishRegisteringAllApps","initializeApp","isOpenmrsAppRoutes","isOpenmrsRoutes","localStorageRoutesPrefix","registerApp","removeRoutesOverride","resetAllRoutesOverrides","tryRegisterExtension"].indexOf(t)<0&&(o[t]=()=>y[t]);n.d(e,o);var g=n(8834),m=n(2238);o={};for(const t in m)["default","addRoutesOverride","finishRegisteringAllApps","initializeApp","isOpenmrsAppRoutes","isOpenmrsRoutes","localStorageRoutesPrefix","registerApp","removeRoutesOverride","resetAllRoutesOverrides","tryRegisterExtension","getCoreTranslation","translateFrom"].indexOf(t)<0&&(o[t]=()=>m[t]);n.d(e,o)},2207:()=>{System.register([],(function(t,e){return{execute:function(){t(function(){"use strict";var t=function(t){window.dispatchEvent(new CustomEvent(v,{detail:{online:t}}))},e=function(t){if(!window.offlineEnabled)return function(){};var e=function(e){return t(e.detail)};return window.addEventListener(v,e),function(){return window.removeEventListener(v,e)}},n=function(t){return t({online:!window.offlineEnabled||navigator.onLine}),e(t)},r=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};window.dispatchEvent(new CustomEvent(y,{detail:t}))},o=function(t){var e=function(e){return t(e.detail)};return window.addEventListener(y,e),function(){return window.removeEventListener(y,e)}},i=function(t){window.dispatchEvent(new CustomEvent(g,{detail:t}))},a=function(t){window.dispatchEvent(new CustomEvent(m,{detail:t}))},u=function(t){window.dispatchEvent(new CustomEvent(w,{detail:t}))},s=function(t){window.dispatchEvent(new CustomEvent(b,{detail:t}))},c=function(t){var e=function(e){return t(e.detail)};return window.addEventListener(g,e),function(){return window.removeEventListener(g,e)}},l=function(t){var e=function(e){return t(e.detail)};return window.addEventListener(m,e),function(){return window.removeEventListener(m,e)}},f=function(t){var e=function(e){return t(e.detail)};return window.addEventListener(b,e),function(){return window.removeEventListener(b,e)}},p=function(t){var e=function(e){return t(e.detail)};return window.addEventListener(w,e),function(){return window.removeEventListener(w,e)}},h={d:function(t,e){for(var n in e)h.o(e,n)&&!h.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},d={};h.r(d),h.d(d,{dispatchActionableNotificationShown:function(){return a},dispatchConnectivityChanged:function(){return t},dispatchNotificationShown:function(){return i},dispatchPrecacheStaticDependencies:function(){return r},dispatchSnackbarShown:function(){return u},dispatchToastShown:function(){return s},subscribeActionableNotificationShown:function(){return l},subscribeConnectivity:function(){return n},subscribeConnectivityChanged:function(){return e},subscribeNotificationShown:function(){return c},subscribePrecacheStaticDependencies:function(){return o},subscribeSnackbarShown:function(){return p},subscribeToastShown:function(){return f}});var v="openmrs:connectivity-changed",y="openmrs:precache-static-dependencies",g="openmrs:notification-shown",m="openmrs:actionable-notification-shown",b="openmrs:toast-shown",w="openmrs:snack-bar-shown";return d}())}}}))},4757:(t,e,n)=>{function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}function a(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}System.register(["@openmrs/esm-state"],(function(t,e){var u={};return{setters:[function(t){u.createGlobalStore=t.createGlobalStore}],execute:function(){t(function(){"use strict";var t={685:function(t){t.exports=u}},e={};function s(n){var r=e[n];if(void 0!==r)return r.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,s),o.exports}s.d=function(t,e){for(var n in e)s.o(e,n)&&!s.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var c={};return function(){var t=function(t){return t.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")},e=function(t){return t&&t.sensitive?"":"i"},u=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},l=function(t){return function(t){if(Array.isArray(t))return u(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return u(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(t,e):void 0}}(t)||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.")}()},f=function(t){return e=t.matcher,(null!=(n=RegExp)&&"undefined"!=typeof Symbol&&n[Symbol.hasInstance]?n[Symbol.hasInstance](e):i(e,n))?t.matcher:"string"==typeof t.matcher?At(t.matcher):At(t.path);var e,n},p=function(t){return h([t])},h=function(t){var e=d(),n=t.map((function(t){return{matcher:f(t),settings:t}})),r=l(e).concat(l(n));_t.setState(r,!0)},d=function(){return _t.getState()},v=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},y=function(t,e){if(t.length>0){var n=Tt(t,e);if(n){for(var r=[n],o=Tt(t,n.settings.parent);void 0!==o;)r.push(o),o=Tt(t,o.settings.parent);return r.reverse()}}return[]},g=function(t){return y(d(),t)},m=function(t,e,n){var r=S(t,e,n);Nt.length?Nt.forEach((function(t){return t(r)})):setTimeout((function(){throw r}))},b=function(t){if("function"!=typeof t)throw Error(O(28,!1));Nt.push(t)},w=function(t){if("function"!=typeof t)throw Error(O(29,!1));var e=!1;return Nt=Nt.filter((function(n){var r=n===t;return e=e||r,!r})),e},O=function(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return"single-spa minified message #".concat(t,": ").concat(e?e+" ":"","See https://single-spa.js.org/error/?code=").concat(t).concat(r.length?"&arg=".concat(r.join("&arg=")):"")},S=function(t,e,n){var r,o="".concat(k(e)," '").concat(P(e),"' died in status ").concat(e.status,": ");if(i(t,Error)){try{t.message=o+t.message}catch(t){}r=t}else{console.warn(O(30,!1,e.status,P(e)));try{r=Error(o+JSON.stringify(t))}catch(e){r=t}}return r.appOrParcelName=P(e),e.status=n,r},E=function(t){return t.status===zt},x=function(t){try{return t.activeWhen(window.location)}catch(e){return m(e,t,$t),!1}},P=function(t){return t.name},j=function(t){return Boolean(t.unmountThisParcel)},k=function(t){return j(t)?"parcel":"application"},A=function(){for(var t=arguments.length-1;t>0;t--)for(var e in arguments[t])"__proto__"!==e&&(arguments[t-1][e]=arguments[t][e]);return arguments[0]},_=function(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return t[n];return null},T=function(t){return t&&("function"==typeof t||(e=t,Array.isArray(e)&&!_(e,(function(t){return"function"!=typeof t}))));var e},C=function(t,e){var n=t[e]||[];0===(n=Array.isArray(n)?n:[n]).length&&(n=[function(){return Promise.resolve()}]);var r=k(t),o=P(t);return function(t){return n.reduce((function(n,i,a){return n.then((function(){var n=i(t);return I(n)?n:Promise.reject(O(15,!1,r,o,e,a))}))}),Promise.resolve())}},I=function(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch},M=function(t,e){return Promise.resolve().then((function(){return t.status!==Ut?t:(t.status=Bt,t.bootstrap?W(t,"bootstrap").then(n).catch((function(n){if(e)throw S(n,t,$t);return m(n,t,$t),t})):Promise.resolve().then(n))}));function n(){return t.status=Ft,t}},D=function(t,e){return Promise.resolve().then((function(){var n=function(){return W(t,"unmount").then((function(){t.status=Ft}),(function(n){if(e)throw S(n,t,$t);m(n,t,$t)}))};if(t.status!==zt)return t;t.status=Wt;var r=Object.keys(t.parcels).map((function(e){return t.parcels[e].unmountThisParcel()}));return Promise.all(r).then(n,(function(r){return n().then((function(){var n=Error(r.message);if(e)throw S(n,t,$t);m(n,t,$t)}))})).then((function(){return t}))}))},N=function(t,e){return Promise.resolve().then((function(){return t.status!==Ft?t:(Jt||(window.dispatchEvent(new Dt("single-spa:before-first-mount")),Jt=!0),t.status=Vt,W(t,"mount").then((function(){return t.status=zt,Yt||(window.dispatchEvent(new Dt("single-spa:first-mount")),Yt=!0),t})).catch((function(n){var r=function(){if(e)throw S(n,t,$t);return m(n,t,$t),t};return t.status=zt,D(t,!0).then(r,r)})))}))},R=function(){return L.apply(Xt,arguments)},L=function(t,e){var n=this;if(!t||"object"!=(void 0===t?"undefined":a(t))&&"function"!=typeof t)throw Error(O(2,!1));if(t.name&&"string"!=typeof t.name)throw Error(O(3,!1,a(t.name)));var r=Qt++,o=t.name||"parcel-".concat(r);if("object"!=(void 0===e?"undefined":a(e)))throw Error(O(4,!1,o,void 0===e?"undefined":a(e)));if(!e.domElement)throw Error(O(5,!1,o));var i,u="function"==typeof t,s=u?t:function(){return Promise.resolve(t)},c={id:r,parcels:{},status:u?Lt:Ut,customProps:e,parentName:P(n),unmountThisParcel:function(){return d.then((function(){if(c.status!==zt)throw Error(O(6,!1,o,c.status));return D(c,!0)})).then((function(t){return c.parentName&&delete n.parcels[c.id],t})).then((function(t){return f(t),t})).catch((function(t){throw c.status=$t,p(t),t}))}};n.parcels[r]=c;var l=s();if(!l||"function"!=typeof l.then)throw Error(O(7,!1));l=l.then((function(t){if(!t)throw Error(O(8,!1));if(o=t.name||"parcel-".concat(r),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!T(t.bootstrap))throw Error(O(9,!1,o));if(!T(t.mount))throw Error(O(10,!1,o));if(!T(t.unmount))throw Error(O(11,!1,o));if(t.update&&!T(t.update))throw Error(O(12,!1,o));var e=C(t,"bootstrap"),n=C(t,"mount"),a=C(t,"unmount");c.status=Ut,c.name=o,c.bootstrap=e,c.mount=n,c.unmount=a,c.timeouts=G(t.timeouts),t.update&&(c.update=C(t,"update"),i.update=function(t){return c.customProps=t,U((e=c,Promise.resolve().then((function(){if(e.status!==zt)throw Error(O(32,!1,P(e)));return e.status=Ht,W(e,"update").then((function(){return e.status=zt,e})).catch((function(t){throw S(t,e,$t)}))}))));var e})}));var f,p,h=l.then((function(){return M(c,!0)})),d=h.then((function(){return N(c,!0)})),v=new Promise((function(t,e){f=t,p=e}));return i={mount:function(){return U(Promise.resolve().then((function(){if(c.status!==Ft)throw Error(O(13,!1,o,c.status));return n.parcels[r]=c,N(c)})))},unmount:function(){return U(c.unmountThisParcel())},getStatus:function(){return c.status},loadPromise:U(l),bootstrapPromise:U(h),mountPromise:U(d),unmountPromise:U(v)}},U=function(t){return t.then((function(){return null}))},B=function(t){var e=P(t),n="function"==typeof t.customProps?t.customProps(e,window.location):t.customProps;("object"!=(void 0===n?"undefined":a(n))||null===n||Array.isArray(n))&&(n={},console.warn(O(40,!1),e,n));var r=A({},n,{name:e,mountParcel:L.bind(t),singleSpa:It});return j(t)&&(r.unmountSelf=t.unmountThisParcel),r},F=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(O(16,!1));Zt.bootstrap={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},V=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(O(17,!1));Zt.mount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},z=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(O(18,!1));Zt.unmount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},H=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(O(19,!1));Zt.unload={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},W=function(t,e){var n=t.timeouts[e],r=n.warningMillis,o=k(t);return new Promise((function(i,a){var u=!1,s=!1;t[e](B(t)).then((function(t){u=!0,i(t)})).catch((function(t){u=!0,a(t)})),setTimeout((function(){return l(1)}),r),setTimeout((function(){return l(!0)}),n.millis);var c=O(31,!1,e,o,P(t),n.millis);function l(t){if(!u)if(!0===t)s=!0,n.dieOnTimeout?a(Error(c)):console.error(c);else if(!s){var e=t,o=e*r;console.warn(c),o+r<n.millis&&setTimeout((function(){return l(e+1)}),r)}}}))},G=function(t){var e={};for(var n in Zt)e[n]=A({},Zt[n],t&&t[n]||{});return e},K=function(t){return Promise.resolve().then((function(){return t.loadPromise?t.loadPromise:t.status!==Rt&&t.status!==Kt?t:(t.status=Lt,t.loadPromise=Promise.resolve().then((function(){var r=t.loadApp(B(t));if(!I(r))throw n=!0,Error(O(33,!1,P(t)));return r.then((function(n){var r;t.loadErrorTime=null,"object"!=(void 0===(e=n)?"undefined":a(e))&&(r=34),Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!T(e.bootstrap)&&(r=35),T(e.mount)||(r=36),T(e.unmount)||(r=37);var o=k(e);if(r){var i;try{i=JSON.stringify(e)}catch(t){}return console.error(O(r,!1,o,P(t),i),e),m(void 0,t,$t),t}return e.devtools&&e.devtools.overlays&&(t.devtools.overlays=A({},t.devtools.overlays,e.devtools.overlays)),t.status=Ut,t.bootstrap=C(e,"bootstrap"),t.mount=C(e,"mount"),t.unmount=C(e,"unmount"),t.unload=C(e,"unload"),t.timeouts=G(e.timeouts),delete t.loadPromise,t}))})).catch((function(e){var r;return delete t.loadPromise,n?r=$t:(r=Kt,t.loadErrorTime=(new Date).getTime()),m(e,t,r),t})));var e,n}))},$=function(t){var e;if("string"==typeof t)e=t;else if(this&&this.href)e=this.href;else{if(!(t&&t.currentTarget&&t.currentTarget.href&&t.preventDefault))throw Error(O(14,!1));e=t.currentTarget.href,t.preventDefault()}var n=X(window.location.href),r=X(e);0===e.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=e:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,e)},q=function(t){var e=this;if(t){var n=t[0].type;ne.indexOf(n)>=0&&ee[n].forEach((function(n){try{n.apply(e,t)}catch(t){setTimeout((function(){throw t}))}}))}},J=function(){pe([],arguments)},Y=function(t,e){return function(){var n=window.location.href,r=t.apply(this,arguments),o=window.location.href;return Ct&&n===o||window.dispatchEvent(function(t,e){var n;try{n=new PopStateEvent("popstate",{state:t})}catch(e){(n=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,t)}return n.singleSpa=!0,n.singleSpaTrigger=e,n}(window.history.state,e)),r}},Q=function(t){if(oe)throw Error(O(43,!1));Ct=!t||!t.hasOwnProperty("urlRerouteOnly")||t.urlRerouteOnly,oe=!0,re=window.history.replaceState,window.addEventListener("hashchange",J),window.addEventListener("popstate",J);var e=window.addEventListener,n=window.removeEventListener;window.addEventListener=function(t,n){if(!("function"==typeof n&&ne.indexOf(t)>=0)||_(ee[t],(function(t){return t===n})))return e.apply(this,arguments);ee[t].push(n)},window.removeEventListener=function(t,e){if(!("function"==typeof e&&ne.indexOf(t)>=0))return n.apply(this,arguments);ee[t]=ee[t].filter((function(t){return t!==e}))},window.history.pushState=Y(window.history.pushState,"pushState"),window.history.replaceState=Y(re,"replaceState")},X=function(t){var e=document.createElement("a");return e.href=t,e},Z=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!ie){var e=t.fn.on,n=t.fn.off;t.fn.on=function(t,n){return tt.call(this,e,window.addEventListener,t,n,arguments)},t.fn.off=function(t,e){return tt.call(this,n,window.removeEventListener,t,e,arguments)},ie=!0}},tt=function(t,e,n,r,o){return"string"!=typeof n?t.apply(this,o):(n.split(/\s+/).forEach((function(t){ne.indexOf(t)>=0&&(e(t,r),n=n.replace(t,""))})),""===n.trim()?this:t.apply(this,o))},et=function(t){return Promise.resolve().then((function(){var e=ae[P(t)];if(!e)return t;if(t.status===Rt)return nt(t,e),t;if(t.status===Gt)return e.promise.then((function(){return t}));if(t.status!==Ft&&t.status!==Kt)return t;var n=t.status===Kt?Promise.resolve():W(t,"unload");return t.status=Gt,n.then((function(){return nt(t,e),t})).catch((function(n){return function(t,e,n){delete ae[P(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,m(n,t,$t),e.reject(n)}(t,e,n),t}))}))},nt=function(t,e){delete ae[P(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=Rt,e.resolve()},rt=function(t,e,n,r){ae[P(t)]={app:t,resolve:n,reject:r},Object.defineProperty(ae[P(t)],"promise",{get:e})},ot=function(t){return ae[t]},it=function(){return ue.filter(E).map(P)},at=function(){return ue.map(P)},ut=function(t){var e=_(ue,(function(e){return P(e)===t}));return e?e.status:null},st=function(t,e,n,r){var o=function(t,e,n,r){var o,i={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"==(void 0===t?"undefined":a(t))?(function(t){if(Array.isArray(t)||null===t)throw Error(O(39,!1));var e=["name","app","activeWhen","customProps"],n=Object.keys(t).reduce((function(t,n){return e.indexOf(n)>=0?t:t.concat(n)}),[]);if(0!==n.length)throw Error(O(38,!1,e.join(", "),n.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(O(20,!1));if("object"!=a(t.app)&&"function"!=typeof t.app)throw Error(O(20,!1));var r=function(t){return"string"==typeof t||"function"==typeof t};if(!(r(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(r)))throw Error(O(24,!1));if(!ht(t.customProps))throw Error(O(22,!1))}(t),i.name=t.name,i.loadApp=t.app,i.activeWhen=t.activeWhen,i.customProps=t.customProps):(function(t,e,n,r){if("string"!=typeof t||0===t.length)throw Error(O(20,!1));if(!e)throw Error(O(23,!1));if("function"!=typeof n)throw Error(O(24,!1));if(!ht(r))throw Error(O(22,!1))}(t,e,n,r),i.name=t,i.loadApp=e,i.activeWhen=n,i.customProps=r),i.loadApp="function"!=typeof(o=i.loadApp)?function(){return Promise.resolve(o)}:o,i.customProps=function(t){return t||{}}(i.customProps),i.activeWhen=function(t){var e=Array.isArray(t)?t:[t];return e=e.map((function(t){return"function"==typeof t?t:dt(t)})),function(t){return e.some((function(e){return e(t)}))}}(i.activeWhen),i}(t,e,n,r);if(mt()||se||(se=!0,setTimeout((function(){mt()||console.warn(O(1,!1))}),5e3)),-1!==at().indexOf(o.name))throw Error(O(21,!1,o.name));ue.push(A({loadErrorTime:null,status:Rt,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},o)),te&&(Z(),pe())},ct=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return ue.filter((function(e){return e.activeWhen(t)})).map(P)},lt=function(t){if(0===ue.filter((function(e){return P(e)===t})).length)throw Error(O(25,!1,t));return(te?ft(t,{waitForUnmount:!1}):Promise.resolve()).then((function(){var e=ue.map(P).indexOf(t);ue.splice(e,1)}))},ft=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof t)throw Error(O(26,!1));var n=_(ue,(function(e){return P(e)===t}));if(!n)throw Error(O(27,!1,t));var r,o=ot(P(n));if(e&&e.waitForUnmount){if(o)return o.promise;var i=new Promise((function(t,e){rt(n,(function(){return i}),t,e)}));return i}return o?(r=o.promise,pt(n,o.resolve,o.reject)):r=new Promise((function(t,e){rt(n,(function(){return r}),t,e),pt(n,t,e)})),r},pt=function(t,e,n){Promise.resolve().then((function(){if(_(ct(),(function(e){return e===P(t)})))return vt()})).then((function(){return D(t).then(et).then((function(){e(),setTimeout((function(){pe()}))}))})).catch(n)},ht=function(t){return!t||"function"==typeof t||"object"==(void 0===t?"undefined":a(t))&&null!==t&&!Array.isArray(t)},dt=function(t,e){var n=function(t,e){var n=0,r=!1,o="^";"/"!==t[0]&&(t="/"+t);for(var i=0;i<t.length;i++){var a=t[i];(!r&&":"===a||r&&"/"===a)&&u(i)}return u(t.length),new RegExp(o,"i");function u(i){var a=t.slice(n,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":a,i===t.length)if(r)e&&(o+="$");else{var u=e?"":".*";o="/"===o.charAt(o.length-1)?"".concat(o).concat(u,"$"):"".concat(o,"(/").concat(u,")?(#.*)?$")}r=!r,n=i}}(t,e);return function(t){var e=t.origin;e||(e="".concat(t.protocol,"//").concat(t.host));var r=t.href.replace(e,"").replace(t.search,"").split("?")[0];return n.test(r)}},vt=function(){return pe()},yt=function(t,e){return x(t)?M(t).then((function(t){return e.then((function(){return x(t)?N(t):t}))})):e.then((function(){return t}))},gt=function(t){he=!0,te&&(Q(t),pe())},mt=function(){return he},bt=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},wt=function(t,e){var n=window.getOpenmrsSpaBase().replace(/\/$/,"");return Ot(t,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){bt(t,e,n[e])}))}return t}({openmrsBase:window.openmrsBase,openmrsSpaBase:n},e)).replace(/^\/\//,"/")},Ot=function(t,e){return Object.keys(e).reduce((function(t,n){return t.split("${"+n+"}").join(e[n])}),t)},St=function(t){var e=t.to,n=t.templateParams,r=window.getOpenmrsSpaBase().replace(/\/$/,""),o=wt(e,n).replace(window.location.origin,"");o.startsWith(r)?$(o):window.location.assign(o)},Et=function(t){var e,n=JSON.parse(null!==(e=sessionStorage.getItem(ve))&&void 0!==e?e:"[]")||[];n.push(t),n.length>50&&(n=n.slice(-50)),sessionStorage.setItem(ve,JSON.stringify(n))},xt=function(){var t;0===JSON.parse(null!==(t=sessionStorage.getItem(ve))&&void 0!==t?t:"[]").length&&document.referrer&&Et(document.referrer),window.addEventListener("single-spa:routing-event",(function(t){var e,n,r=Pt();"replaceState"==(null===(e=t.detail.originalEvent)||void 0===e?void 0:e.singleSpaTrigger)?(r[r.length-1]=window.location.href,sessionStorage.setItem(ve,JSON.stringify(r))):!(null===(n=t.detail.originalEvent)||void 0===n?void 0:n.singleSpa)&&r.includes(window.location.href)?jt({toUrl:window.location.href}):r[r.length-1]!==window.location.href&&Et(window.location.href)}))},Pt=function(){var t;return JSON.parse(null!==(t=sessionStorage.getItem(ve))&&void 0!==t?t:"[]")},jt=function(t){var e=t.toUrl,n=Pt(),r=n.lastIndexOf(e);if(-1==r)throw new Error("URL ".concat(e," not found in history; cannot go back to it."));var o=n.slice(0,r+1);St({to:n[r]}),sessionStorage.setItem(ve,JSON.stringify(o))},kt=function(){sessionStorage.removeItem(ve)};function At(n,r,o){return i(n,RegExp)?function(t,e){if(!e)return t;var n=t.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)e.push({name:r,prefix:"",suffix:"",modifier:"",pattern:""});return t}(n,r):Array.isArray(n)?function(t,n,r){var o=t.map((function(t){return At(t,n,r).source}));return new RegExp("(?:"+o.join("|")+")",e(r))}(n,r,o):function(n,r,o){return function(n,r,o){void 0===o&&(o={});for(var i=o.strict,a=void 0!==i&&i,u=o.start,s=void 0===u||u,c=o.end,l=void 0===c||c,f=o.encode,p=void 0===f?function(t){return t}:f,h="["+t(o.endsWith||"")+"]|$",d="["+t(o.delimiter||"/#?")+"]",v=s?"^":"",y=0,g=n;y<g.length;y++){var m=g[y];if("string"==typeof m)v+=t(p(m));else{var b=t(p(m.prefix)),w=t(p(m.suffix));if(m.pattern)if(r&&r.push(m),b||w)if("+"===m.modifier||"*"===m.modifier){var O="*"===m.modifier?"?":"";v+="(?:"+b+"((?:"+m.pattern+")(?:"+w+b+"(?:"+m.pattern+"))*)"+w+")"+O}else v+="(?:"+b+"("+m.pattern+")"+w+")"+m.modifier;else v+="("+m.pattern+")"+m.modifier;else v+="(?:"+b+w+")"+m.modifier}}if(l)a||(v+=d+"?"),v+=o.endsWith?"(?="+h+")":"$";else{var S=n[n.length-1],E="string"==typeof S?d.indexOf(S[S.length-1])>-1:void 0===S;a||(v+="(?:"+d+"(?="+h+"))?"),E||(v+="(?="+d+"|"+h+")")}return new RegExp(v,e(o))}(function(e,n){void 0===n&&(n={});for(var r=function(t){for(var e=[],n=0;n<t.length;){var r=t[n];if("*"!==r&&"+"!==r&&"?"!==r)if("\\"!==r)if("{"!==r)if("}"!==r)if(":"!==r)if("("!==r)e.push({type:"CHAR",index:n,value:t[n++]});else{var o=1,i="";if("?"===t[u=n+1])throw new TypeError('Pattern cannot start with "?" at '+u);for(;u<t.length;)if("\\"!==t[u]){if(")"===t[u]){if(0==--o){u++;break}}else if("("===t[u]&&(o++,"?"!==t[u+1]))throw new TypeError("Capturing groups are not allowed at "+u);i+=t[u++]}else i+=t[u++]+t[u++];if(o)throw new TypeError("Unbalanced pattern at "+n);if(!i)throw new TypeError("Missing pattern at "+n);e.push({type:"PATTERN",index:n,value:i}),n=u}else{for(var a="",u=n+1;u<t.length;){var s=t.charCodeAt(u);if(!(s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122||95===s))break;a+=t[u++]}if(!a)throw new TypeError("Missing parameter name at "+n);e.push({type:"NAME",index:n,value:a}),n=u}else e.push({type:"CLOSE",index:n,value:t[n++]});else e.push({type:"OPEN",index:n,value:t[n++]});else e.push({type:"ESCAPED_CHAR",index:n++,value:t[n++]});else e.push({type:"MODIFIER",index:n,value:t[n++]})}return e.push({type:"END",index:n,value:""}),e}(e),o=n.prefixes,i=void 0===o?"./":o,a="[^"+t(n.delimiter||"/#?")+"]+?",u=[],s=0,c=0,l="",f=function(t){if(c<r.length&&r[c].type===t)return r[c++].value},p=function(t){var e=f(t);if(void 0!==e)return e;var n=r[c],o=n.type,i=n.index;throw new TypeError("Unexpected "+o+" at "+i+", expected "+t)},h=function(){for(var t,e="";t=f("CHAR")||f("ESCAPED_CHAR");)e+=t;return e};c<r.length;){var d=f("CHAR"),v=f("NAME"),y=f("PATTERN");if(v||y){var g=d||"";-1===i.indexOf(g)&&(l+=g,g=""),l&&(u.push(l),l=""),u.push({name:v||s++,prefix:g,suffix:"",pattern:y||a,modifier:f("MODIFIER")||""})}else{var m=d||f("ESCAPED_CHAR");if(m)l+=m;else if(l&&(u.push(l),l=""),f("OPEN")){g=h();var b=f("NAME")||"",w=f("PATTERN")||"",O=h();p("CLOSE"),u.push({name:b||(w?s++:""),pattern:b&&!w?a:w,prefix:g,suffix:O,modifier:f("MODIFIER")||""})}else p("END")}}return u}(n,o),r,o)}(n,r,o)}s.r(c),s.d(c,{clearHistory:function(){return kt},filterBreadcrumbs:function(){return y},getBreadcrumbs:function(){return d},getBreadcrumbsFor:function(){return g},getHistory:function(){return Pt},goBackInHistory:function(){return jt},interpolateString:function(){return Ot},interpolateUrl:function(){return wt},navigate:function(){return St},registerBreadcrumb:function(){return p},registerBreadcrumbs:function(){return h},setupHistory:function(){return xt}});var _t=(0,s(685).createGlobalStore)("breadcrumbs",[]);function Tt(t,e){if(e)return function(t,e){var n=function(t){return function(t){if(Array.isArray(t))return t}(t)||function(t){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,r,o=[],i=!0,a=!1;try{for(e=e.call(t);!(i=(n=e.next()).done)&&(o.push(n.value),1!==o.length);i=!0);}catch(t){a=!0,r=t}finally{try{i||null==e.return||e.return()}finally{if(a)throw r}}return o}}(t)||function(t){if(t){if("string"==typeof t)return v(t,1);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(e):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?v(t,1):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t.filter((function(t){return t.matcher.test(e)})));return n[0]}(t,e)||function(t,e){for(var n=e.split("/");n.length>1;){n.pop();var r=Tt(t,n.join("/"));if(r)return r}}(t,e)}var Ct,It=Object.freeze({__proto__:null,get start(){return gt},get ensureJQuerySupport(){return Z},get setBootstrapMaxTime(){return F},get setMountMaxTime(){return V},get setUnmountMaxTime(){return z},get setUnloadMaxTime(){return H},get registerApplication(){return st},get unregisterApplication(){return lt},get getMountedApps(){return it},get getAppStatus(){return ut},get unloadApplication(){return ft},get checkActivityFunctions(){return ct},get getAppNames(){return at},get pathToActiveWhen(){return dt},get navigateToUrl(){return $},get patchHistoryApi(){return Q},get triggerAppChange(){return vt},get addErrorHandler(){return b},get removeErrorHandler(){return w},get mountRootParcel(){return R},get NOT_LOADED(){return Rt},get LOADING_SOURCE_CODE(){return Lt},get NOT_BOOTSTRAPPED(){return Ut},get BOOTSTRAPPING(){return Bt},get NOT_MOUNTED(){return Ft},get MOUNTING(){return Vt},get UPDATING(){return Ht},get LOAD_ERROR(){return Kt},get MOUNTED(){return zt},get UNLOADING(){return Gt},get UNMOUNTING(){return Wt},get SKIP_BECAUSE_BROKEN(){return $t}}),Mt=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).CustomEvent,Dt=function(){try{var t=new Mt("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?Mt:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(t,e){var n=document.createEvent("CustomEvent");return e?n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail):n.initCustomEvent(t,!1,!1,void 0),n}:function(t,e){var n=document.createEventObject();return n.type=t,e?(n.bubbles=Boolean(e.bubbles),n.cancelable=Boolean(e.cancelable),n.detail=e.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n},Nt=[],Rt="NOT_LOADED",Lt="LOADING_SOURCE_CODE",Ut="NOT_BOOTSTRAPPED",Bt="BOOTSTRAPPING",Ft="NOT_MOUNTED",Vt="MOUNTING",zt="MOUNTED",Ht="UPDATING",Wt="UNMOUNTING",Gt="UNLOADING",Kt="LOAD_ERROR",$t="SKIP_BECAUSE_BROKEN",qt=[],Jt=!1,Yt=!1,Qt=0,Xt={parcels:{}},Zt={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}},te="undefined"!=typeof window,ee={hashchange:[],popstate:[]},ne=["hashchange","popstate"],re=null,oe=!1;te&&(window.singleSpaNavigate?console.warn(O(41,!1)):window.singleSpaNavigate=$);var ie=!1,ae={},ue=[],se=!1,ce=!1,le=[],fe=te&&window.location.href;function pe(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(ce)return new Promise((function(t,n){le.push({resolve:t,reject:n,eventArguments:e})}));var r,i=function(){var t=[],e=[],n=[],r=[],o=(new Date).getTime();return ue.forEach((function(i){var a=i.status!==$t&&x(i);switch(i.status){case Kt:a&&o-i.loadErrorTime>=200&&n.push(i);break;case Rt:case Lt:a&&n.push(i);break;case Ut:case Ft:!a&&ot(P(i))?t.push(i):a&&r.push(i);break;case zt:a||e.push(i)}})),{appsToUnload:t,appsToUnmount:e,appsToLoad:n,appsToMount:r}}(),a=i.appsToUnload,u=i.appsToUnmount,s=i.appsToLoad,c=i.appsToMount,l=[],f=fe,p=fe=window.location.href;return mt()?(ce=!0,r=a.concat(s,u,c),Promise.resolve().then((function(){return g(0===r.length?"before-no-app-change":"before-app-change",y(!0)),g("before-routing-event",y(!0,{cancelNavigation:h})),Promise.all(l).then((function(n){if(n.some((function(t){return t})))return re.call(window.history,history.state,"",f.substring(location.origin.length)),fe=location.href,ce=!1,pe(t,e,!0);var r=a.map(et),o=u.map(D).map((function(t){return t.then(et)})).concat(r),i=Promise.all(o);i.then((function(){g("before-mount-routing-event",y(!0))}),(function(t){throw t}));var l=s.map((function(t){return K(t).then((function(t){return yt(t,i)}))})),p=c.filter((function(t){return s.indexOf(t)<0})).map((function(t){return yt(t,i)}));return i.catch((function(t){throw v(),t})).then((function(){return v(),Promise.all(l.concat(p)).catch((function(e){throw t.forEach((function(t){return t.reject(e)})),e})).then(d).then((function(){}),(function(t){throw t}))}))}))}))):(r=s,Promise.resolve().then((function(){var t=s.map(K);return Promise.all(t).then(v).then((function(){return[]})).catch((function(t){throw v(),t})).finally((function(){}))})));function h(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e="function"==typeof(null==t?void 0:t.then)?t:Promise.resolve(t);l.push(e.catch((function(t){return console.warn(Error(O(42,!1))),console.warn(t),!1})))}function d(){var e=it();t.forEach((function(t){return t.resolve(e)}));try{g(0===r.length?"no-app-change":"app-change",y()),g("routing-event",y())}catch(t){setTimeout((function(){throw t}))}if(ce=!1,le.length>0){var n=le;le=[],pe(n)}return e}function v(){n||(t.forEach((function(t){q(t.eventArguments)})),q(e))}function y(){var t,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1?arguments[1]:void 0,l={},h=(o(t={},zt,[]),o(t,Ft,[]),o(t,Rt,[]),o(t,$t,[]),t);n?(s.concat(c).forEach((function(t,e){v(t,zt)})),a.forEach((function(t){v(t,Rt)})),u.forEach((function(t){v(t,Ft)}))):r.forEach((function(t){v(t)}));var d={detail:{newAppStatuses:l,appsByNewStatus:h,totalAppChanges:r.length,originalEvent:null==e?void 0:e[0],oldUrl:f,newUrl:p}};return i&&A(d.detail,i),d;function v(t,e){var n=P(t);e=e||ut(n),l[n]=e,(h[e]=h[e]||[]).push(n)}}function g(t,e){n||window.dispatchEvent(new Dt("single-spa:".concat(t),e))}}var he=!1,de={getRawAppData:function(){return function(t){if(Array.isArray(t))return r(t)}(t=ue)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(t)||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.")}();var t},reroute:pe,NOT_LOADED:Rt,toLoadPromise:K,toBootstrapPromise:M,unregisterApplication:lt,getProfilerData:function(){return qt}};te&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=de);var ve="openmrs:history"}(),c}())}}}))},6641:(t,e,n)=>{function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function a(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function u(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}function c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){u(t,e,n[e])}))}return t}function l(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e.push.apply(e,n)}return e}(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t}function f(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t,e)||d(t,e)||function(){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 p(t){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||d(t)||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 h(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}function d(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}System.register(["@openmrs/esm-api","@openmrs/esm-state"],(function(t,e){var r={},i={};return{setters:[function(t){r.getLoggedInUser=t.getLoggedInUser},function(t){i.createGlobalStore=t.createGlobalStore}],execute:function(){t(function(){"use strict";var t={766:function(t){t.exports=r},685:function(t){t.exports=i}},e={};function d(n){var r=e[n];if(void 0!==r)return r.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,d),o.exports}d.d=function(t,e){for(var n in e)d.o(e,n)&&!d.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},d.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},d.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var v={};return function(){var t=function(t,e){return new Promise((function(n){var r=new MessageChannel;r.port1.onmessage=function(t){n(t.data)},t.postMessage(e,[r.port2])}))},e=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},r=function(t,n){var r;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(r=function(t,n){if(t){if("string"==typeof t)return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){r&&(t=r);var o=0;return function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=t[Symbol.iterator]()).next.bind(r)},i=function(t,e){var n=location.href;return new URL(t,n).href===new URL(e,n).href},y=function(t,e,n){return n?e?e(t):t:(t&&t.then||(t=Promise.resolve(t)),e?t.then(e):t)},g=function(){},m=function(t,e){if(!e)return t&&t.then?t.then(g):Promise.resolve()},b=function(t,e){if(void 0!==Mn)return console.warn("The application's Service Worker has already been registered. The new service worker at ".concat(t," will not be registered.")),Mn;if(!("serviceWorker"in navigator))throw new Error("Registering the Service Worker is not possible due to missing browser capabilities.");var n=new In(t,e);return Mn=n.register().then((function(){return n.controlling.then((function(){return n}))}))},w=function(){return null!=Mn?Mn:Promise.resolve(void 0)},O=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},S=function(t){return Ln.apply(this,arguments)},E=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},x=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){E(i,r,o,a,u,"next",t)}function u(t){E(i,r,o,a,u,"throw",t)}a(void 0)}))}},P=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},j=function(){return Un.apply(this,arguments)},k=function(){return Bn.apply(this,arguments)},A=function(){return Fn.apply(this,arguments)},T=function(){return Vn.apply(this,arguments)},C=function(){return{current:Hn,notAvailable:"unavailable"===Hn,active:"on"===Hn}},I=function(t){"unavailable"!==Hn&&"unavailable"!==t&&(localStorage.setItem(zn,"on"===t?"active":"disabled"),Hn=t)},M=function(){return Wn.apply(this,arguments)},D=function(t,e){return"object"!=(void 0===e?"undefined":h(e))||Kn(e).forEach((function(n){t[n]=e[n]})),t},N=function(t,e){return Jn.call(t,e)},R=function(t,e){"function"==typeof e&&(e=e(qn(t))),("undefined"==typeof Reflect?Kn:Reflect.ownKeys)(e).forEach((function(n){L(t,n,e[n])}))},L=function(t,e,n,r){Yn(t,e,D(n&&N(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))},U=function(t){return{from:function(e){return t.prototype=Object.create(e.prototype),L(t.prototype,"constructor",t),{extend:R.bind(null,t.prototype)}}}},B=function(t,e,n){return Zn.call(t,e,n)},F=function(t,e){return e(t)},V=function(t){if(!t)throw new Error("Assertion Failed")},z=function(t){Gn.setImmediate?setImmediate(t):setTimeout(t,0)},H=function(t,e){return t.reduce((function(t,n,r){var o=e(n,r);return o&&(t[o[0]]=o[1]),t}),{})},W=function(t){var e={};for(var n in t)N(t,n)&&(e[n]=t[n]);return e},G=function(t){return nr.apply([],t)},K=function(t){ir="undefined"!=typeof WeakMap&&new WeakMap;var e=ar(t);return ir=null,e},$=function(t){return ur.call(t).slice(8,-1)},q=function(t){var e,n,r,o;if(1===arguments.length){if($n(t))return t.slice();if(this===lr&&"string"==typeof t)return[t];if(o=cr(t)){for(n=[];!(r=o.next()).done;)n.push(r.value);return n}if(null==t)return[t];if("number"==typeof(e=t.length)){for(n=new Array(e);e--;)n[e]=t[e];return n}return[t]}for(e=arguments.length,n=new Array(e);e--;)n[e]=arguments[e];return n},J=function(t,e){pr=t,hr=e},Y=function(t,e){var n=t.stack;return n?(e=e||0,0===n.indexOf(t.name)&&(e+=(t.name+t.message).split("\n").length),n.split("\n").slice(e).filter(hr).map((function(t){return"\n"+t})).join("")):""},Q=function(t,e){this._e=vr(),this.name=t,this.message=e},X=function(t,e){return t+". Errors: "+Object.keys(e).map((function(t){return e[t].toString()})).filter((function(t,e,n){return n.indexOf(t)===e})).join("\n")},Z=function(t,e,n,r){this._e=vr(),this.failures=e,this.failedKeys=r,this.successCount=n,this.message=X(t,e)},tt=function(t,e){this._e=vr(),this.name="BulkError",this.failures=Object.keys(e).map((function(t){return e[t]})),this.failuresByPos=e,this.message=X(t,e)},et=function(){},nt=function(t){return t},rt=function(t,e){return null==t||t===nt?e:function(n){return e(t(n))}},ot=function(t,e){return function(){t.apply(this,arguments),e.apply(this,arguments)}},it=function(t,e){return t===et?e:function(){var n=t.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var i=e.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?ot(r,this.onsuccess):r),o&&(this.onerror=this.onerror?ot(o,this.onerror):o),void 0!==i?i:n}},at=function(t,e){return t===et?e:function(){t.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,e.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?ot(n,this.onsuccess):n),r&&(this.onerror=this.onerror?ot(r,this.onerror):r)}},ut=function(t,e){return t===et?e:function(n){var r=t.apply(this,arguments);D(n,r);var o=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var a=e.apply(this,arguments);return o&&(this.onsuccess=this.onsuccess?ot(o,this.onsuccess):o),i&&(this.onerror=this.onerror?ot(i,this.onerror):i),void 0===r?void 0===a?void 0:a:D(r,a)}},st=function(t,e){return t===et?e:function(){return!1!==e.apply(this,arguments)&&t.apply(this,arguments)}},ct=function(t,e){return t===et?e:function(){var n=t.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,o=arguments.length,i=new Array(o);o--;)i[o]=arguments[o];return n.then((function(){return e.apply(r,i)}))}return e.apply(this,arguments)}},lt=function(t){if("object"!=h(this))throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=et,this._lib=!1;var e=this._PSD=zr;if(pr&&(this._stackHolder=vr(),this._prev=null,this._numPrev=0),"function"!=typeof t){if(t!==xr)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&pt(this,this._value))}this._state=null,this._value=null,++e.ref,$r(this,t)},ft=function(t,e,n,r,o){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r,this.psd=o},pt=function(t,e){if(Ur.push(e),null===t._state){var n=t._lib&&mt();e=Fr(e),t._state=!1,t._value=e,pr&&null!==e&&"object"==(void 0===e?"undefined":h(e))&&!e._promise&&function(t){try{t.apply(null,void 0)}catch(t){}}((function(){var n=Xn(e,"stack");e._promise=t,L(e,"stack",{get:function(){return Ir?n&&(n.get?n.get.apply(e):n.value):t.stack}})})),function(t){Lr.some((function(e){return e._value===t._value}))||Lr.push(t)}(t),ht(t),n&&bt()}},ht=function(t){var e=t._listeners;t._listeners=[];for(var n=0,r=e.length;n<r;++n)dt(t,e[n]);var o=t._PSD;--o.ref||o.finalize(),0===Wr&&(++Wr,Dr((function(){0==--Wr&&wt()}),[]))},dt=function(t,e){if(null!==t._state){var n=t._state?e.onFulfilled:e.onRejected;if(null===n)return(t._state?e.resolve:e.reject)(t._value);++e.psd.ref,++Wr,Dr(vt,[n,t,e])}else t._listeners.push(e)},vt=function(t,e,n){try{Br=e;var r,o=e._value;e._state?r=t(o):(Ur.length&&(Ur=[]),r=t(o),-1===Ur.indexOf(o)&&function(t){for(var e=Lr.length;e;)if(Lr[--e]._value===t._value)return void Lr.splice(e,1)}(e)),n.resolve(r)}catch(t){n.reject(t)}finally{Br=null,0==--Wr&&wt(),--n.psd.ref||n.psd.finalize()}},yt=function(t,e){var n=e?e._numPrev+1:0;n<100&&(t._prev=e,t._numPrev=n)},gt=function(){mt()&&bt()},mt=function(){var t=Nr;return Nr=!1,Rr=!1,t},bt=function(){var t,e,n;do{for(;Hr.length>0;)for(t=Hr,Hr=[],n=t.length,e=0;e<n;++e){var r=t[e];r[0].apply(null,r[1])}}while(Hr.length>0);Nr=!0,Rr=!0},wt=function(){var t=Lr;Lr=[],t.forEach((function(t){t._PSD.onunhandled.call(null,t._value,t)}));for(var e=Gr.slice(0),n=e.length;n;)e[--n]()},Ot=function(t){return new lt(xr,!1,t)},St=function(t,e){var n=zr;return function(){var r=mt(),o=zr;try{return _t(n,!0),t.apply(this,arguments)}catch(t){e&&e(t)}finally{_t(o,!1),r&&bt()}}},Et=function(t,e,n,r){var o=zr,i=Object.create(o);i.parent=o,i.ref=0,i.global=!1,i.id=++to;var a=Vr.env;i.env=Cr?{Promise:lt,PromiseProp:{value:lt,configurable:!0,writable:!0},all:lt.all,race:lt.race,allSettled:lt.allSettled,any:lt.any,resolve:lt.resolve,reject:lt.reject,nthen:Dt(a.nthen,i),gthen:Dt(a.gthen,i)}:{},e&&D(i,e),++o.ref,i.finalize=function(){--this.parent.ref||this.parent.finalize()};var u=Ct(i,t,n,r);return 0===i.ref&&i.finalize(),u},xt=function(){return Jr.id||(Jr.id=++Yr),++Jr.awaits,Jr.echoes+=100,Jr.id},Pt=function(){return!!Jr.awaits&&(0==--Jr.awaits&&(Jr.id=0),Jr.echoes=100*Jr.awaits,!0)},jt=function(t){return Jr.echoes&&t&&t.constructor===Tr?(xt(),t.then((function(t){return Pt(),t}),(function(t){return Pt(),eo(t)}))):t},kt=function(t){++Zr,Jr.echoes&&0!=--Jr.echoes||(Jr.echoes=Jr.id=0),Qr.push(zr),_t(t,!0)},At=function(){var t=Qr[Qr.length-1];Qr.pop(),_t(t,!1)},_t=function(t,e){var n=zr;if((e?!Jr.echoes||Xr++&&t===zr:!Xr||--Xr&&t===zr)||It(e?kt.bind(null,t):At),t!==zr&&(zr=t,n===Vr&&(Vr.env=Tt()),Cr)){var r=Vr.env.Promise,o=t.env;kr.then=o.nthen,r.prototype.then=o.gthen,(n.global||t.global)&&(Object.defineProperty(Gn,"Promise",o.PromiseProp),r.all=o.all,r.race=o.race,r.resolve=o.resolve,r.reject=o.reject,o.allSettled&&(r.allSettled=o.allSettled),o.any&&(r.any=o.any))}},Tt=function(){var t=Gn.Promise;return Cr?{Promise:t,PromiseProp:Object.getOwnPropertyDescriptor(Gn,"Promise"),all:t.all,race:t.race,allSettled:t.allSettled,any:t.any,resolve:t.resolve,reject:t.reject,nthen:kr.then,gthen:t.prototype.then}:{}},Ct=function(t,e,n,r,o){var i=zr;try{return _t(t,!0),e(n,r,o)}finally{_t(i,!1)}},It=function(t){_r.call(jr,t)},Mt=function(t,e,n,r){return"function"!=typeof t?t:function(){var o=zr;n&&xt(),_t(e,!0);try{return t.apply(this,arguments)}finally{_t(o,!1),r&&It(Pt)}}},Dt=function(t,e){return function(n,r){return t.call(this,Mt(n,e),Mt(r,e))}},Nt=function(t,e){var n;try{n=e.onuncatched(t)}catch(t){}if(!1!==n)try{var r,o={promise:e,reason:t};if(Gn.document&&document.createEvent?((r=document.createEvent("Event")).initEvent("unhandledrejection",!0,!0),D(r,o)):Gn.CustomEvent&&D(r=new CustomEvent("unhandledrejection",{detail:o}),o),r&&Gn.dispatchEvent&&(dispatchEvent(r),!Gn.PromiseRejectionEvent&&Gn.onunhandledrejection))try{Gn.onunhandledrejection(r)}catch(t){}pr&&r&&!r.defaultPrevented&&console.warn("Unhandled rejection: ".concat(t.stack||t))}catch(t){}},Rt=function(t,e){return t?e?function(){return t.apply(this,arguments)&&e.apply(this,arguments)}:t:e},Lt=function(t){return"string"!=typeof t||/\./.test(t)?function(t){return t}:function(e){return void 0===e[t]&&t in e&&delete(e=K(e))[t],e}},Ut=function(t){var e={},n=function(n,r){if(r){for(var o=arguments.length,i=new Array(o-1);--o;)i[o-1]=arguments[o];return e[n].subscribe.apply(null,i),t}if("string"==typeof n)return e[n]};n.addEventType=i;for(var r=1,o=arguments.length;r<o;++r)i(arguments[r]);return n;function i(t,r,o){if("object"==(void 0===t?"undefined":h(t)))return function(t){Kn(t).forEach((function(e){var n=t[e];if($n(n))i(e,t[e][0],t[e][1]);else{if("asap"!==n)throw new Or.InvalidArgument("Invalid event config");var r=i(e,nt,(function(){for(var t=arguments.length,e=new Array(t);t--;)e[t]=arguments[t];r.subscribers.forEach((function(t){z((function(){t.apply(null,e)}))}))}))}}))}(t);r||(r=st),o||(o=et);var a={subscribers:[],fire:o,subscribe:function(t){-1===a.subscribers.indexOf(t)&&(a.subscribers.push(t),a.fire=r(a.fire,t))},unsubscribe:function(t){a.subscribers=a.subscribers.filter((function(e){return e!==t})),a.fire=a.subscribers.reduce(r,o)}};return e[t]=n[t]=a,a}},Bt=function(t,e){return U(e).from({prototype:t}),e},Ft=function(t,e){return!(t.filter||t.algorithm||t.or)&&(e?t.justLimit:!t.replayFilter)},Vt=function(t,e){t.filter=Rt(t.filter,e)},zt=function(t,e,n){var r=t.replayFilter;t.replayFilter=r?function(){return Rt(r(),e())}:e,t.justLimit=n&&!r},Ht=function(t,e){if(t.isPrimKey)return e.primaryKey;var n=e.getIndexByKeyPath(t.index);if(!n)throw new Or.Schema("KeyPath "+t.index+" on object store "+e.name+" is not indexed");return n},Wt=function(t,e,n){var r=Ht(t,e.schema);return e.openCursor({trans:n,values:!t.keysOnly,reverse:"prev"===t.dir,unique:!!t.unique,query:{index:r,range:t.range}})},Gt=function(t,e,n,r){var o=t.replayFilter?Rt(t.filter,t.replayFilter()):t.filter;if(t.or){var i={},a=function(t,n,r){if(!o||o(n,r,(function(t){return n.stop(t)}),(function(t){return n.fail(t)}))){var a=n.primaryKey,u=""+a;"[object ArrayBuffer]"===u&&(u=""+new Uint8Array(a)),N(i,u)||(i[u]=!0,e(t,n,r))}};return Promise.all([t.or._iterate(a,n),Kt(Wt(t,r,n),t.algorithm,a,!t.keysOnly&&t.valueMapper)])}return Kt(Wt(t,r,n),Rt(t.algorithm,o),e,!t.keysOnly&&t.valueMapper)},Kt=function(t,e,n,r){var o=St(r?function(t,e,o){return n(r(t),e,o)}:n);return t.then((function(t){if(t)return t.start((function(){var n=function(){return t.continue()};e&&!e(t,(function(t){return n=t}),(function(e){t.stop(e),n=et}),(function(e){t.fail(e),n=et}))||o(t.value,t,(function(t){return n=t})),n()}))}))},$t=function(t){var e=void 0===t?"undefined":h(t);if("object"!==e)return e;if(ArrayBuffer.isView(t))return"binary";var n=$(t);return"ArrayBuffer"===n?"binary":n},qt=function(t){return s(t,Uint8Array)?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(t)},Jt=function(t,e){return t<e?-1:t===e?0:1},Yt=function(t,e){return t>e?-1:t===e?0:1},Qt=function(t,e,n){var r=s(t,yo)?new t.Collection(t):t;return r._ctx.error=n?new n(e):new TypeError(e),r},Xt=function(t){return new t.Collection(t,(function(){return ne("")})).limit(0)},Zt=function(t,e,n,r,o,i){for(var a=Math.min(t.length,r.length),u=-1,s=0;s<a;++s){var c=e[s];if(c!==r[s])return o(t[s],n[s])<0?t.substr(0,s)+n[s]+n.substr(s+1):o(t[s],r[s])<0?t.substr(0,s)+r[s]+n.substr(s+1):u>=0?t.substr(0,u)+e[u]+n.substr(u+1):null;o(t[s],c)<0&&(u=s)}return a<r.length&&"next"===i?t+n.substr(t.length):a<t.length&&"prev"===i?t.substr(0,n.length):u<0?null:t.substr(0,u)+r[u]+n.substr(u+1)},te=function(t,e,n,r){var o,i,a,u,s,c,l,f=n.length;if(!n.every((function(t){return"string"==typeof t})))return Qt(t,"String expected.");function p(t){o=function(t){return"next"===t?function(t){return t.toUpperCase()}:function(t){return t.toLowerCase()}}(t),i=function(t){return"next"===t?function(t){return t.toLowerCase()}:function(t){return t.toUpperCase()}}(t),a="next"===t?Jt:Yt;var e=n.map((function(t){return{lower:i(t),upper:o(t)}})).sort((function(t,e){return a(t.lower,e.lower)}));u=e.map((function(t){return t.upper})),s=e.map((function(t){return t.lower})),c=t,l="next"===t?"":r}p("next");var h=new t.Collection(t,(function(){return ee(u[0],s[f-1]+r)}));h._ondirectionchange=function(t){p(t)};var d=0;return h._addAlgorithm((function(t,n,r){var o=t.key;if("string"!=typeof o)return!1;var p=i(o);if(e(p,s,d))return!0;for(var h=null,v=d;v<f;++v){var y=Zt(o,p,u[v],s[v],a,c);null===y&&null===h?d=v+1:(null===h||a(h,y)>0)&&(h=y)}return n(null!==h?function(){t.continue(h+l)}:r),!1})),h},ee=function(t,e,n,r){return{type:2,lower:t,upper:e,lowerOpen:n,upperOpen:r}},ne=function(t){return{type:1,lower:t,upper:t}},re=function(t){return St((function(e){return oe(e),t(e.target.error),!1}))},oe=function(t){t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault()},ie=function(t,e,n,r,o,i,a){return{name:t,keyPath:e,unique:n,multi:r,auto:o,compound:i,src:(n&&!a?"&":"")+(r?"*":"")+(o?"++":"")+ae(e)}},ae=function(t){return"string"==typeof t?t:t?"["+[].join.call(t,"+")+"]":""},ue=function(t,e,n){return{name:t,primKey:e,indexes:n,mappedClass:null,idxByName:H(n,(function(t){return[t.name,t]}))}},se=function(t){return null==t?function(){}:"string"==typeof t?function(t){return 1===t.split(".").length?function(e){return e[t]}:function(e){return tr(e,t)}}(t):function(e){return tr(e,t)}},ce=function(t){return[].slice.call(t)},le=function(t){return null==t?":id":"string"==typeof t?t:"[".concat(t.join("+"),"]")},fe=function(t,e){var n=t._novip,r=e.db,o=function(t,e,n,r){var o=n.IDBKeyRange,i=(n.indexedDB,function(t,e){return e.reduce((function(t,e){return c({},t,(0,e.create)(t))}),t)}(function(t,e,n){function r(t){if(3===t.type)return null;if(4===t.type)throw new Error("Cannot convert never type to IDBKeyRange");var n=t.lower,r=t.upper,o=t.lowerOpen,i=t.upperOpen;return void 0===n?void 0===r?null:e.upperBound(r,!!i):void 0===r?e.lowerBound(n,!!o):e.bound(n,r,!!o,!!i)}var o=function(t,e){var n=ce(t.objectStoreNames);return{schema:{name:t.name,tables:n.map((function(t){return e.objectStore(t)})).map((function(t){var e=t.keyPath,n=t.autoIncrement,r=$n(e),o=null==e,i={},a={name:t.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:o,compound:r,keyPath:e,autoIncrement:n,unique:!0,extractKey:se(e)},indexes:ce(t.indexNames).map((function(e){return t.index(e)})).map((function(t){var e=t.name,n=t.unique,r=t.multiEntry,o=t.keyPath,a={name:e,compound:$n(o),keyPath:o,unique:n,multiEntry:r,extractKey:se(o)};return i[le(o)]=a,a})),getIndexByKeyPath:function(t){return i[le(t)]}};return i[":id"]=a.primaryKey,null!=e&&(i[le(e)]=a.primaryKey),a}))},hasGetAll:n.length>0&&"getAll"in e.objectStore(n[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}(t,n),i=o.schema,a=o.hasGetAll,u=i.tables.map((function(t){return function(t){var e=t.name;return{name:e,schema:t,mutate:function(t){var n=t.trans,o=t.type,i=t.keys,a=t.values,u=t.range;return new Promise((function(t,s){t=St(t);var c=n.objectStore(e),l=null==c.keyPath,p="put"===o||"add"===o;if(!p&&"delete"!==o&&"deleteRange"!==o)throw new Error("Invalid operation type: "+o);var h,d=(i||a||{length:1}).length;if(i&&a&&i.length!==a.length)throw new Error("Given keys array must have same length as given values array.");if(0===d)return t({numFailures:0,failures:{},results:[],lastResult:void 0});var v=[],y=[],g=0,m=function(t){++g,oe(t)};if("deleteRange"===o){if(4===u.type)return t({numFailures:g,failures:y,results:[],lastResult:void 0});3===u.type?v.push(h=c.clear()):v.push(h=c.delete(r(u)))}else{var b=f(p?l?[a,i]:[a,null]:[i,null],2),w=b[0],O=b[1];if(p)for(var S=0;S<d;++S)v.push(h=O&&void 0!==O[S]?c[o](w[S],O[S]):c[o](w[S])),h.onerror=m;else for(var E=0;E<d;++E)v.push(h=c[o](w[E])),h.onerror=m}var x=function(e){var n=e.target.result;v.forEach((function(t,e){return null!=t.error&&(y[e]=t.error)})),t({numFailures:g,failures:y,results:"delete"===o?i:v.map((function(t){return t.result})),lastResult:n})};h.onerror=function(t){m(t),x(t)},h.onsuccess=x}))},getMany:function(t){var n=t.trans,r=t.keys;return new Promise((function(t,o){t=St(t);for(var i,a=n.objectStore(e),u=r.length,s=new Array(u),c=0,l=0,f=function(e){var n=e.target;s[n._pos]=n.result,++l===c&&t(s)},p=re(o),h=0;h<u;++h)null!=r[h]&&((i=a.get(r[h]))._pos=h,i.onsuccess=f,i.onerror=p,++c);0===c&&t(s)}))},get:function(t){var n=t.trans,r=t.key;return new Promise((function(t,o){t=St(t);var i=n.objectStore(e).get(r);i.onsuccess=function(e){return t(e.target.result)},i.onerror=re(o)}))},query:function(t){return function(n){return new Promise((function(o,i){o=St(o);var a=n.trans,u=n.values,s=n.limit,c=n.query,l=s===1/0?void 0:s,f=c.index,p=c.range,h=a.objectStore(e),d=f.isPrimaryKey?h:h.index(f.name),v=r(p);if(0===s)return o({result:[]});if(t){var y=u?d.getAll(v,l):d.getAllKeys(v,l);y.onsuccess=function(t){return o({result:t.target.result})},y.onerror=re(i)}else{var g=0,m=u||!("openKeyCursor"in d)?d.openCursor(v):d.openKeyCursor(v),b=[];m.onsuccess=function(t){var e=m.result;return e?(b.push(u?e.value:e.primaryKey),++g===s?o({result:b}):void e.continue()):o({result:b})},m.onerror=re(i)}}))}}(a),openCursor:function(t){var n=t.trans,o=t.values,i=t.query,a=t.reverse,u=t.unique;return new Promise((function(t,s){t=St(t);var c=i.index,l=i.range,f=n.objectStore(e),p=c.isPrimaryKey?f:f.index(c.name),h=a?u?"prevunique":"prev":u?"nextunique":"next",d=o||!("openKeyCursor"in p)?p.openCursor(r(l),h):p.openKeyCursor(r(l),h);d.onerror=re(s),d.onsuccess=St((function(e){var r=d.result;if(r){r.___id=++wo,r.done=!1;var o=r.continue.bind(r),i=r.continuePrimaryKey;i&&(i=i.bind(r));var a=r.advance.bind(r),u=function(){throw new Error("Cursor not stopped")};r.trans=n,r.stop=r.continue=r.continuePrimaryKey=r.advance=function(){throw new Error("Cursor not started")},r.fail=St(s),r.next=function(){var t=this,e=1;return this.start((function(){return e--?t.continue():t.stop()})).then((function(){return t}))},r.start=function(t){var e=new Promise((function(t,e){t=St(t),d.onerror=re(e),r.fail=e,r.stop=function(e){r.stop=r.continue=r.continuePrimaryKey=r.advance=u,t(e)}})),n=function(){if(d.result)try{t()}catch(t){r.fail(t)}else r.done=!0,r.start=function(){throw new Error("Cursor behind last entry")},r.stop()};return d.onsuccess=St((function(t){d.onsuccess=n,n()})),r.continue=o,r.continuePrimaryKey=i,r.advance=a,n(),e},t(r)}else t(null)}),s)}))},count:function(t){var n=t.query,o=t.trans,i=n.index,a=n.range;return new Promise((function(t,n){var u=o.objectStore(e),s=i.isPrimaryKey?u:u.index(i.name),c=r(a),l=c?s.count(c):s.count();l.onsuccess=St((function(e){return t(e.target.result)})),l.onerror=re(n)}))}}}(t)})),s={};return u.forEach((function(t){return s[t.name]=t})),{stack:"dbcore",transaction:t.transaction.bind(t),table:function(t){if(!s[t])throw new Error("Table '".concat(t,"' not found"));return s[t]},MIN_KEY:-1/0,MAX_KEY:bo(e),schema:i}}(e,o,r),t.dbcore));return{dbcore:i}}(n._middlewares,r,n._deps,e);n.core=o.dbcore,n.tables.forEach((function(t){var e=t.name;n.core.schema.tables.some((function(t){return t.name===e}))&&(t.core=n.core.table(e),s(n[e],n.Table)&&(n[e].core=t.core))}))},pe=function(t,e,n,r){var o=t._novip;n.forEach((function(t){var n=r[t];e.forEach((function(e){var r=Xn(e,t);(!r||"value"in r&&void 0===r.value)&&(e===o.Transaction.prototype||s(e,o.Transaction)?L(e,t,{get:function(){return this.table(t)},set:function(e){Yn(this,t,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):e[t]=new o.Table(t,n))}))}))},he=function(t,e){var n=t._novip;e.forEach((function(t){for(var e in t)s(t[e],n.Table)&&delete t[e]}))},de=function(t,e){return t._cfg.version-e._cfg.version},ve=function(t,e){var n,r=function(){var r=t[n],i=e[n];if(r){var a={name:n,def:i,recreate:!1,del:[],add:[],change:[]};if(""+(r.primKey.keyPath||"")!=""+(i.primKey.keyPath||"")||r.primKey.auto!==i.primKey.auto&&!ao)a.recreate=!0,o.change.push(a);else{var u=r.idxByName,s=i.idxByName,c=void 0;for(c in u)s[c]||a.del.push(c);for(c in s){var l=u[c],f=s[c];l?l.src!==f.src&&a.change.push(f):a.add.push(f)}(a.del.length>0||a.add.length>0||a.change.length>0)&&o.change.push(a)}}else o.add.push([n,i])},o={del:[],add:[],change:[]};for(n in t)e[n]||o.del.push(n);for(n in e)r();return o},ye=function(t,e,n,r){var o=t.db.createObjectStore(e,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach((function(t){return ge(o,t)})),o},ge=function(t,e){t.createIndex(e.name,e.keyPath,{unique:e.unique,multiEntry:e.multi})},me=function(t,e,n){var r={};return B(e.objectStoreNames,0).forEach((function(t){for(var e=n.objectStore(t),o=e.keyPath,i=ie(ae(o),o||"",!1,!1,!!e.autoIncrement,o&&"string"!=typeof o,!0),a=[],u=0;u<e.indexNames.length;++u){var s=e.index(e.indexNames[u]);o=s.keyPath;var c=ie(s.name,o,!!s.unique,!!s.multiEntry,!1,o&&"string"!=typeof o,!1);a.push(c)}r[t]=ue(t,i,a)})),r},be=function(t,e,n){for(var r=t._novip,o=n.db.objectStoreNames,i=0;i<o.length;++i){var a=o[i],u=n.objectStore(a);r._hasGetAll="getAll"in u;for(var c=0;c<u.indexNames.length;++c){var l=u.indexNames[c],f=u.index(l).keyPath,p="string"==typeof f?f:"["+B(f).join("+")+"]";if(e[a]){var h=e[a].idxByName[p];h&&(h.name=l,delete e[a].idxByName[p],e[a].idxByName[l]=h)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&Gn.WorkerGlobalScope&&s(Gn,Gn.WorkerGlobalScope)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(r._hasGetAll=!1)},we=function(t,e){var n=t._dbNamesDB;return n||(n=t._dbNamesDB=new Co("__dbnames",{addons:[],indexedDB:t,IDBKeyRange:e})).version(1).stores({dbnames:"name"}),n.table("dbnames")},Oe=function(t){return t&&"function"==typeof t.databases},Se=function(t){return Et((function(){return zr.letThrough=!0,t()}))},Ee=function(){var t;return!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(e){var n=function(){return indexedDB.databases().finally(e)};t=setInterval(n,100),n()})).finally((function(){return clearInterval(t)})):Promise.resolve()},xe=function(t){var e=function(e){return t.next(e)},n=o(e),r=o((function(e){return t.throw(e)}));function o(t){return function(e){var o=t(e),i=o.value;return o.done?i:i&&"function"==typeof i.then?i.then(n,r):$n(i)?Promise.all(i).then(n,r):n(i)}}return o(e)()},Pe=function(t,e,n){var r=arguments.length;if(r<2)throw new Or.InvalidArgument("Too few arguments");for(var o=new Array(r-1);--r;)o[r-1]=arguments[r];return n=o.pop(),[t,G(o),n]},je=function(t,e,n){for(var r=$n(t)?t.slice():[t],o=0;o<n;++o)r.push(e);return r},ke=function(t,e,n){try{if(!e)return null;if(e.keys.length<t.length)return null;for(var r=[],o=0,i=0;o<e.keys.length&&i<t.length;++o)0===po(e.keys[o],t[i])&&(r.push(n?K(e.values[o]):e.values[o]),++i);return r.length===t.length?r:null}catch(t){return null}},Ae=function(t){return!("from"in t)},_e=function(t,e){Ae(e)||function t(e,n){var r=n.from,o=n.to,i=n.l,a=n.r;Ao(e,r,o),i&&t(e,i),a&&t(e,a)}(t,e)},Te=function(t){var e=Ae(t)?null:{s:0,n:t};return{next:function(t){for(var n=arguments.length>0;e;)switch(e.s){case 0:if(e.s=1,n)for(;e.n.l&&po(t,e.n.from)<0;)e={up:e,n:e.n.l,s:1};else for(;e.n.l;)e={up:e,n:e.n.l,s:1};case 1:if(e.s=2,!n||po(t,e.n.to)<=0)return{value:e.n,done:!1};case 2:if(e.n.r){e.s=3,e={up:e,n:e.n.r,s:0};continue}case 3:e=e.up}return{done:!0}}}},Ce=function(t){var e,n,r=((null===(e=t.r)||void 0===e?void 0:e.d)||0)-((null===(n=t.l)||void 0===n?void 0:n.d)||0),o=r>1?"r":r<-1?"l":"";if(o){var i="r"===o?"l":"r",a=c({},t),u=t[o];t.from=u.from,t.to=u.to,t[o]=u[o],a[o]=u[i],t[i]=a,a.d=Ie(a)}t.d=Ie(t)},Ie=function(t){var e=t.r,n=t.l;return(e?n?Math.max(e.d,n.d):e.d:n?n.d:0)+1},Me=function(t,e){return Kn(e).forEach((function(n){_e(t[n]||(t[n]=new ko),e[n])})),t},De=function(t){var e=No;try{No=!0,go.storagemutated.fire(t)}finally{No=e}},Ne=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},Re=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},Le=function(){return new zo},Ue=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},Be=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},Fe=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Be(i,r,o,a,u,"next",t)}function u(t){Be(i,r,o,a,u,"throw",t)}a(void 0)}))}},Ve=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},ze=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){Ve(t,e,n[e])}))}return t},He=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Ue(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ue(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},We=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},Ge=function(){return Go},Ke=function(){return Ko.apply(this,arguments)},$e=function(){return qo.apply(this,arguments)},qe=function(t,e,n,r){return Jo.apply(this,arguments)},Je=function(t,e,n){return Yo.apply(this,arguments)},Ye=function(t,e){return Qo.apply(this,arguments)},Qe=function(t,e){return Xo.apply(this,arguments)},Xe=function(t){return Zo.apply(this,arguments)},Ze=function(t){return ti.apply(this,arguments)},tn=function(t){return ei.apply(this,arguments)},en=function(t){var e;return!!(null===(e=Wo[t])||void 0===e?void 0:e.options.onBeginEditSyncItem)},nn=function(t){return ni.apply(this,arguments)},rn=function(t){return ri.apply(this,arguments)},on=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};Wo[t]={type:t,dependsOn:e,process:n,options:r}},an=function(){if(!oi&&!(oi="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return oi(ai)},un=function(){return li+ci()},sn=function(t){return t.startsWith(li)},cn=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},ln=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},fn=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){ln(i,r,o,a,u,"next",t)}function u(t){ln(i,r,o,a,u,"throw",t)}a(void 0)}))}},pn=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},hn=function(){return Object.values(fi)},dn=function(t){fi[t.id]&&console.warn('[setupDynamicOfflineDataHandler] Another second handler with the ID "'.concat(t.id,'" was registered. This handler will override the previous one. This could be unintended as the previous handler might run different flows than the newly registered one. If this is the case, ensure that you are setting up the handlers with different IDs.')),fi[t.id]=t},vn=function(t){return pi.apply(this,arguments)},yn=function(t,e){return hi.apply(this,arguments)},gn=function(t,e){return di.apply(this,arguments)},mn=function(t,e,n){return vi.apply(this,arguments)},bn=function(t,e){return yi.apply(this,arguments)},wn=function(t,e,n){return gi.apply(this,arguments)},On=function(t,e){return mi.apply(this,arguments)},Sn=function(t,e,n){return bi.apply(this,arguments)},En=function(){return wi.apply(this,arguments)},xn=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},Pn=function(){return An(),Oi},jn=function(t,e){An(),dn({type:"patient",displayName:e.displayName,id:t,isSynced:function(){return Promise.resolve(!0)},sync:function(t,n){return e.onOfflinePatientAdded({patientUuid:t,signal:null!=n?n:(new AbortController).signal})}})},kn=function(t){return Si.apply(this,arguments)},An=function(){console.warn("The offline patient API has been deprecated and will be removed in a future release. To prevent future crashes, the functions remain available for the moment, but any invocations should be migrated ASAP.")};d.r(v),d.d(v,{activateOfflineCapability:function(){return M},beginEditSynchronizationItem:function(){return nn},canBeginEditSynchronizationItemsOfType:function(){return en},deleteSynchronizationItem:function(){return rn},generateOfflineUuid:function(){return un},getCurrentOfflineMode:function(){return C},getDynamicOfflineDataEntries:function(){return vn},getDynamicOfflineDataEntriesFor:function(){return yn},getDynamicOfflineDataHandlers:function(){return hn},getFullSynchronizationItems:function(){return Ze},getFullSynchronizationItemsFor:function(){return Qe},getOfflineDb:function(){return Le},getOfflinePatientDataStore:function(){return Pn},getOfflineSynchronizationStore:function(){return Ge},getOmrsServiceWorker:function(){return w},getSynchronizationItem:function(){return tn},getSynchronizationItems:function(){return Xe},getSynchronizationItemsFor:function(){return Ye},isOfflineUuid:function(){return sn},messageOmrsServiceWorker:function(){return S},offlineUuidPrefix:function(){return li},omrsOfflineCachingStrategyHttpHeaderName:function(){return Rn},omrsOfflineResponseBodyHttpHeaderName:function(){return Dn},omrsOfflineResponseStatusHttpHeaderName:function(){return Nn},putDynamicOfflineData:function(){return gn},putDynamicOfflineDataFor:function(){return mn},queueSynchronizationItem:function(){return Je},queueSynchronizationItemFor:function(){return qe},registerOfflinePatientHandler:function(){return jn},registerOmrsServiceWorker:function(){return b},removeDynamicOfflineData:function(){return bn},removeDynamicOfflineDataFor:function(){return wn},runSynchronization:function(){return Ke},setCurrentOfflineMode:function(){return I},setupDynamicOfflineDataHandler:function(){return dn},setupOfflineSync:function(){return on},syncAllDynamicOfflineData:function(){return On},syncDynamicOfflineData:function(){return Sn},syncOfflinePatientData:function(){return kn}});try{self["workbox:window:6.5.4"]&&_()}catch(t){}try{self["workbox:core:6.5.4"]&&_()}catch(t){}var _n=function(){var t=this;this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))},Tn=function(t,e){this.type=t,Object.assign(this,e)},Cn={type:"SKIP_WAITING"},In=function(e){var n,r;function o(t,n){var r,o;return void 0===n&&(n={}),(r=e.call(this)||this).nn={},r.tn=0,r.rn=new _n,r.en=new _n,r.on=new _n,r.un=0,r.an=new Set,r.cn=function(){var t=r.fn,e=t.installing;r.tn>0||!i(e.scriptURL,r.sn.toString())||performance.now()>r.un+6e4?(r.vn=e,t.removeEventListener("updatefound",r.cn)):(r.hn=e,r.an.add(e),r.rn.resolve(e)),++r.tn,e.addEventListener("statechange",r.ln)},r.ln=function(t){var e=r.fn,n=t.target,o=n.state,i=n===r.vn,a={sw:n,isExternal:i,originalEvent:t};!i&&r.mn&&(a.isUpdate=!0),r.dispatchEvent(new Tn(o,a)),"installed"===o?r.wn=self.setTimeout((function(){"installed"===o&&e.waiting===n&&r.dispatchEvent(new Tn("waiting",a))}),200):"activating"===o&&(clearTimeout(r.wn),i||r.en.resolve(n))},r.dn=function(t){var e=r.hn,n=e!==navigator.serviceWorker.controller;r.dispatchEvent(new Tn("controlling",{isExternal:n,originalEvent:t,sw:e,isUpdate:r.mn})),n||r.on.resolve(e)},r.gn=(o=function(t){var e=t.data,n=t.ports,o=t.source;return y(r.getSW(),(function(){r.an.has(o)&&r.dispatchEvent(new Tn("message",{data:e,originalEvent:t,ports:n,sw:o}))}))},function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];try{return Promise.resolve(o.apply(this,t))}catch(t){return Promise.reject(t)}}),r.sn=t,r.nn=n,navigator.serviceWorker.addEventListener("message",r.gn),r}r=e,(n=o).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r;var a,u=o.prototype;return u.register=function(t){var e=(void 0===t?{}:t).immediate,n=void 0!==e&&e;try{var r=this;return function(t,e){var n=t();return n&&n.then?n.then(e):e()}((function(){if(!n&&"complete"!==document.readyState)return m(new Promise((function(t){return window.addEventListener("load",t)})))}),(function(){return r.mn=Boolean(navigator.serviceWorker.controller),r.yn=r.pn(),y(r.bn(),(function(t){r.fn=t,r.yn&&(r.hn=r.yn,r.en.resolve(r.yn),r.on.resolve(r.yn),r.yn.addEventListener("statechange",r.ln,{once:!0}));var e=r.fn.waiting;return e&&i(e.scriptURL,r.sn.toString())&&(r.hn=e,Promise.resolve().then((function(){r.dispatchEvent(new Tn("waiting",{sw:e,wasWaitingBeforeRegister:!0}))})).then((function(){}))),r.hn&&(r.rn.resolve(r.hn),r.an.add(r.hn)),r.fn.addEventListener("updatefound",r.cn),navigator.serviceWorker.addEventListener("controllerchange",r.dn),r.fn}))}))}catch(t){return Promise.reject(t)}},u.update=function(){try{return this.fn?m(this.fn.update()):void 0}catch(t){return Promise.reject(t)}},u.getSW=function(){return void 0!==this.hn?Promise.resolve(this.hn):this.rn.promise},u.messageSW=function(e){try{return y(this.getSW(),(function(n){return t(n,e)}))}catch(t){return Promise.reject(t)}},u.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&t(this.fn.waiting,Cn)},u.pn=function(){var t=navigator.serviceWorker.controller;return t&&i(t.scriptURL,this.sn.toString())?t:void 0},u.bn=function(){try{var t=this;return function(e,n){try{var r=y(navigator.serviceWorker.register(t.sn,t.nn),(function(e){return t.un=performance.now(),e}))}catch(e){return n(e)}return r&&r.then?r.then(void 0,n):r}((function(){return y(navigator.serviceWorker.register(t.sn,t.nn),(function(e){return t.un=performance.now(),e}))}),(function(t){throw t}))}catch(t){return Promise.reject(t)}},(a=[{key:"active",get:function(){return this.en.promise}},{key:"controlling",get:function(){return this.on.promise}}])&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(o.prototype,a),o}(function(){function t(){this.Pn=new Map}var e=t.prototype;return e.addEventListener=function(t,e){this.Sn(t).add(e)},e.removeEventListener=function(t,e){this.Sn(t).delete(e)},e.dispatchEvent=function(t){t.target=this;for(var e,n=r(this.Sn(t.type));!(e=n()).done;)(0,e.value)(t)},e.Sn=function(t){return this.Pn.has(t)||this.Pn.set(t,new Set),this.Pn.get(t)},t}()),Mn=void 0,Dn="x-omrs-offline-response-body",Nn="x-omrs-offline-response-status",Rn="x-omrs-offline-caching-strategy";function Ln(){return Ln=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){O(i,r,o,a,u,"next",t)}function u(t){O(i,r,o,a,u,"throw",t)}a(void 0)}))}}((function(t){var e,n;return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(r){switch(r.label){case 0:return[4,w()];case 1:return(e=r.sent())?[4,e.messageSW(t)]:[3,3];case 2:return n=r.sent(),[3,4];case 3:n={success:!1,result:void 0,error:"No service worker has been registered. This is typically the case when the application has been built without offline-related features."},r.label=4;case 4:return[2,n]}}))})),Ln.apply(this,arguments)}function Un(){return Un=x((function(){var t;return P(this,(function(e){t=window.sessionStorage;try{t.setItem("someKeyHere","test"),t.removeItem("someKeyHere")}catch(e){if(e.code===DOMException.QUOTA_EXCEEDED_ERR&&0===t.length)return[2,!0]}return[2,!1]}))})),Un.apply(this,arguments)}function Bn(){return(Bn=x((function(){return P(this,(function(t){return[2,!window.indexedDB]}))}))).apply(this,arguments)}function Fn(){return Fn=x((function(){return P(this,(function(t){return[2,new Promise((function(t){var e=indexedDB.open("test");e.onerror=function(){return t(!0)},e.onsuccess=function(){return t(!1)}}))]}))})),Fn.apply(this,arguments)}function Vn(){return(Vn=x((function(){var t,e;return P(this,(function(n){switch(n.label){case 0:return[4,A()];case 1:return(e=n.sent())?[3,3]:[4,k()];case 2:e=n.sent(),n.label=3;case 3:return(t=e)?[3,5]:[4,j()];case 4:t=n.sent(),n.label=5;case 5:return[2,t]}}))}))).apply(this,arguments)}var zn="openmrs3:offline-mode",Hn="unavailable";function Wn(){return(Wn=x((function(){return P(this,(function(t){switch(t.label){case 0:return[4,T()];case 1:return t.sent()||(Hn="active"===localStorage.getItem(zn)?"on":"off"),navigator.onLine,[2]}}))}))).apply(this,arguments)}var Gn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,Kn=Object.keys,$n=Array.isArray;"undefined"==typeof Promise||Gn.Promise||(Gn.Promise=Promise);var qn=Object.getPrototypeOf,Jn={}.hasOwnProperty,Yn=Object.defineProperty,Qn=Object.getOwnPropertyDescriptor;function Xn(t,e){var n;return Qn(t,e)||(n=qn(t))&&Xn(n,e)}var Zn=[].slice;function tr(t,e){if(N(t,e))return t[e];if(!e)return t;if("string"!=typeof e){for(var n=[],r=0,o=e.length;r<o;++r){var i=tr(t,e[r]);n.push(i)}return n}var a=e.indexOf(".");if(-1!==a){var u=t[e.substr(0,a)];return void 0===u?void 0:tr(u,e.substr(a+1))}}function er(t,e,n){if(t&&void 0!==e&&(!("isFrozen"in Object)||!Object.isFrozen(t)))if("string"!=typeof e&&"length"in e){V("string"!=typeof n&&"length"in n);for(var r=0,o=e.length;r<o;++r)er(t,e[r],n[r])}else{var i=e.indexOf(".");if(-1!==i){var a=e.substr(0,i),u=e.substr(i+1);if(""===u)void 0===n?$n(t)&&!isNaN(parseInt(a))?t.splice(a,1):delete t[a]:t[a]=n;else{var s=t[a];s&&N(t,a)||(s=t[a]={}),er(s,u,n)}}else void 0===n?$n(t)&&!isNaN(parseInt(e))?t.splice(e,1):delete t[e]:t[e]=n}}var nr=[].concat,rr="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(G([8,16,32,64].map((function(t){return["Int","Uint","Float"].map((function(e){return e+t+"Array"}))})))).filter((function(t){return Gn[t]})),or=rr.map((function(t){return Gn[t]}));H(rr,(function(t){return[t,!0]}));var ir=null;function ar(t){if(!t||"object"!=(void 0===t?"undefined":h(t)))return t;var e=ir&&ir.get(t);if(e)return e;if($n(t)){e=[],ir&&ir.set(t,e);for(var n=0,r=t.length;n<r;++n)e.push(ar(t[n]))}else if(or.indexOf(t.constructor)>=0)e=t;else{var o=qn(t);for(var i in e=o===Object.prototype?{}:Object.create(o),ir&&ir.set(t,e),t)N(t,i)&&(e[i]=ar(t[i]))}return e}var ur={}.toString,sr="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",cr="symbol"==(void 0===sr?"undefined":h(sr))?function(t){var e;return null!=t&&(e=t[sr])&&e.apply(t)}:function(){return null},lr={},fr="undefined"!=typeof Symbol?function(t){return"AsyncFunction"===t[Symbol.toStringTag]}:function(){return!1},pr="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href),hr=function(){return!0},dr=!new Error("").stack;function vr(){if(dr)try{throw vr.arguments,new Error}catch(t){return t}return new Error}var yr=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],gr=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(yr),mr={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};U(Q).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+Y(this._e,2))}},toString:function(){return this.name+": "+this.message}}),U(Z).from(Q),U(tt).from(Q);var br=gr.reduce((function(t,e){return t[e]=e+"Error",t}),{}),wr=Q,Or=gr.reduce((function(t,e){var n=function(t,n){this._e=vr(),this.name=r,t?"string"==typeof t?(this.message="".concat(t).concat(n?"\n "+n:""),this.inner=n||null):"object"==(void 0===t?"undefined":h(t))&&(this.message="".concat(t.name," ").concat(t.message),this.inner=t):(this.message=mr[e]||r,this.inner=null)},r=e+"Error";return U(n).from(wr),t[e]=n,t}),{});Or.Syntax=SyntaxError,Or.Type=TypeError,Or.Range=RangeError;var Sr=yr.reduce((function(t,e){return t[e+"Error"]=Or[e],t}),{}),Er=gr.reduce((function(t,e){return-1===["Syntax","Type","Range"].indexOf(e)&&(t[e+"Error"]=Or[e]),t}),{});Er.ModifyError=Z,Er.DexieError=Q,Er.BulkError=tt;var xr={},Pr=f("undefined"==typeof Promise?[]:function(){var t=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[t,qn(t),t];var e=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[e,qn(e),t]}(),3),jr=Pr[0],kr=Pr[1],Ar=Pr[2],_r=kr&&kr.then,Tr=jr&&jr.constructor,Cr=!!Ar,Ir=!1,Mr=Ar?function(){Ar.then(gt)}:Gn.setImmediate?setImmediate.bind(null,gt):Gn.MutationObserver?function(){var t=document.createElement("div");new MutationObserver((function(){gt(),t=null})).observe(t,{attributes:!0}),t.setAttribute("i","1")}:function(){setTimeout(gt,0)},Dr=function(t,e){Hr.push([t,e]),Rr&&(Mr(),Rr=!1)},Nr=!0,Rr=!0,Lr=[],Ur=[],Br=null,Fr=nt,Vr={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Nt,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((function(t){try{Nt(t[0],t[1])}catch(t){}}))}},zr=Vr,Hr=[],Wr=0,Gr=[],Kr={get:function(){var t=zr,e=Zr;function n(n,r){var o=this,i=!t.global&&(t!==zr||e!==Zr),a=i&&!Pt(),u=new lt((function(e,u){dt(o,new ft(Mt(n,t,i,a),Mt(r,t,i,a),e,u,t))}));return pr&&yt(u,this),u}return n.prototype=xr,n},set:function(t){L(this,"then",t&&t.prototype===xr?Kr:{get:function(){return t},set:Kr.set})}};function $r(t,e){try{e((function(e){if(null===t._state){if(e===t)throw new TypeError("A promise cannot be resolved with itself.");var n=t._lib&&mt();e&&"function"==typeof e.then?$r(t,(function(t,n){s(e,lt)?e._then(t,n):e.then(t,n)})):(t._state=!0,t._value=e,ht(t)),n&&bt()}}),pt.bind(null,t))}catch(e){pt(t,e)}}function qr(t,e,n){if(e.length===n)return e;var r="";if(!1===t._state){var o,i,a=t._value;null!=a?(o=a.name||"Error",i=a.message||a,r=Y(a,0)):(o=a,i=""),e.push(o+(i?": "+i:"")+r)}return pr&&((r=Y(t._stackHolder,2))&&-1===e.indexOf(r)&&e.push(r),t._prev&&qr(t._prev,e,n)),e}R(lt.prototype,{then:Kr,_then:function(t,e){dt(this,new ft(null,null,t,e,zr))},catch:function(t){if(1===arguments.length)return this.then(null,t);var e=arguments[0],n=arguments[1];return"function"==typeof e?this.then(null,(function(t){return s(t,e)?n(t):Ot(t)})):this.then(null,(function(t){return t&&t.name===e?n(t):Ot(t)}))},finally:function(t){return this.then((function(e){return t(),e}),(function(e){return t(),Ot(e)}))},stack:{get:function(){if(this._stack)return this._stack;try{Ir=!0;var t=qr(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=t),t}finally{Ir=!1}}},timeout:function(t,e){var n=this;return t<1/0?new lt((function(r,o){var i=setTimeout((function(){return o(new Or.Timeout(e))}),t);n.then(r,o).finally(clearTimeout.bind(null,i))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&L(lt.prototype,Symbol.toStringTag,"Dexie.Promise"),Vr.env=Tt(),R(lt,{all:function(){var t=q.apply(null,arguments).map(jt);return new lt((function(e,n){0===t.length&&e([]);var r=t.length;t.forEach((function(o,i){return lt.resolve(o).then((function(n){t[i]=n,--r||e(t)}),n)}))}))},resolve:function(t){if(s(t,lt))return t;if(t&&"function"==typeof t.then)return new lt((function(e,n){t.then(e,n)}));var e=new lt(xr,!0,t);return yt(e,Br),e},reject:Ot,race:function(){var t=q.apply(null,arguments).map(jt);return new lt((function(e,n){t.map((function(t){return lt.resolve(t).then(e,n)}))}))},PSD:{get:function(){return zr},set:function(t){return zr=t}},totalEchoes:{get:function(){return Zr}},newPSD:Et,usePSD:Ct,scheduler:{get:function(){return Dr},set:function(t){Dr=t}},rejectionMapper:{get:function(){return Fr},set:function(t){Fr=t}},follow:function(t,e){return new lt((function(n,r){return Et((function(e,n){var r=zr;r.unhandleds=[],r.onunhandled=n,r.finalize=ot((function(){var t=this;!function(t){Gr.push((function e(){t(),Gr.splice(Gr.indexOf(e),1)})),++Wr,Dr((function(){0==--Wr&&wt()}),[])}((function(){0===t.unhandleds.length?e():n(t.unhandleds[0])}))}),r.finalize),t()}),e,n,r)}))}}),Tr&&(Tr.allSettled&&L(lt,"allSettled",(function(){var t=q.apply(null,arguments).map(jt);return new lt((function(e){0===t.length&&e([]);var n=t.length,r=new Array(n);t.forEach((function(t,o){return lt.resolve(t).then((function(t){return r[o]={status:"fulfilled",value:t}}),(function(t){return r[o]={status:"rejected",reason:t}})).then((function(){return--n||e(r)}))}))}))})),Tr.any&&"undefined"!=typeof AggregateError&&L(lt,"any",(function(){var t=q.apply(null,arguments).map(jt);return new lt((function(e,n){0===t.length&&n(new AggregateError([]));var r=t.length,o=new Array(r);t.forEach((function(t,i){return lt.resolve(t).then((function(t){return e(t)}),(function(t){o[i]=t,--r||n(new AggregateError(o))}))}))}))})));var Jr={awaits:0,echoes:0,id:0},Yr=0,Qr=[],Xr=0,Zr=0,to=0;-1===(""+_r).indexOf("[native code]")&&(xt=Pt=et);var eo=lt.reject;function no(t,e,n,r){if(t.idbdb&&(t._state.openComplete||zr.letThrough||t._vip)){var o=t._createTransaction(e,n,t._dbSchema);try{o.create(),t._state.PR1398_maxLoop=3}catch(o){return o.name===br.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then((function(){return no(t,e,n,r)}))):eo(o)}return o._promise(e,(function(t,e){return Et((function(){return zr.trans=o,r(t,e,o)}))})).then((function(t){return o._completion.then((function(){return t}))}))}if(t._state.openComplete)return eo(new Or.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._options.autoOpen)return eo(new Or.DatabaseClosed);t.open().catch(et)}return t._state.dbReadyPromise.then((function(){return no(t,e,n,r)}))}var ro=String.fromCharCode(65535),oo="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",io=[],ao="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),uo=ao,so=ao,co=function(t){return!/(dexie\.js|dexie\.min\.js)/.test(t)},lo={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1},fo=function(){function t(){o(this,t)}return a(t,[{key:"_trans",value:function(t,e,n){var r=this._tx||zr.trans,o=this.name;function i(t,n,r){if(!r.schema[o])throw new Or.NotFound("Table "+o+" not part of transaction");return e(r.idbtrans,r)}var a=mt();try{return r&&r.db===this.db?r===zr.trans?r._promise(t,i,n):Et((function(){return r._promise(t,i,n)}),{trans:r,transless:zr.transless||zr}):no(this.db,t,[this.name],i)}finally{a&&bt()}}},{key:"get",value:function(t,e){var n=this;return t&&t.constructor===Object?this.where(t).first(e):this._trans("readonly",(function(e){return n.core.get({trans:e,key:t}).then((function(t){return n.hook.reading.fire(t)}))})).then(e)}},{key:"where",value:function(t){if("string"==typeof t)return new this.db.WhereClause(this,t);if($n(t))return new this.db.WhereClause(this,"[".concat(t.join("+"),"]"));var e=Kn(t);if(1===e.length)return this.where(e[0]).equals(t[e[0]]);var n=this.schema.indexes.concat(this.schema.primKey).filter((function(t){return t.compound&&e.every((function(e){return t.keyPath.indexOf(e)>=0}))&&t.keyPath.every((function(t){return e.indexOf(t)>=0}))}))[0];if(n&&this.db._maxKey!==ro)return this.where(n.name).equals(n.keyPath.map((function(e){return t[e]})));!n&&pr&&console.warn("The query ".concat(JSON.stringify(t)," on ").concat(this.name," would benefit of a compound index [").concat(e.join("+"),"]"));var r=this.schema.idxByName,o=this.db._deps.indexedDB;function i(t,e){try{return 0===o.cmp(t,e)}catch(t){return!1}}var a=f(e.reduce((function(e,n){var o=f(e,2),a=o[0],u=o[1],s=r[n],c=t[n];return[a||s,a||!s?Rt(u,s&&s.multi?function(t){var e=tr(t,n);return $n(e)&&e.some((function(t){return i(c,t)}))}:function(t){return i(c,tr(t,n))}):u]}),[null,null]),2),u=a[0],s=a[1];return u?this.where(u.name).equals(t[u.keyPath]).filter(s):n?this.filter(s):this.where(e).equals("")}},{key:"filter",value:function(t){return this.toCollection().and(t)}},{key:"count",value:function(t){return this.toCollection().count(t)}},{key:"offset",value:function(t){return this.toCollection().offset(t)}},{key:"limit",value:function(t){return this.toCollection().limit(t)}},{key:"each",value:function(t){return this.toCollection().each(t)}},{key:"toArray",value:function(t){return this.toCollection().toArray(t)}},{key:"toCollection",value:function(){return new this.db.Collection(new this.db.WhereClause(this))}},{key:"orderBy",value:function(t){return new this.db.Collection(new this.db.WhereClause(this,$n(t)?"[".concat(t.join("+"),"]"):t))}},{key:"reverse",value:function(){return this.toCollection().reverse()}},{key:"mapToClass",value:function(t){this.schema.mappedClass=t;var e=function(e){if(!e)return e;var n=Object.create(t.prototype);for(var r in e)if(N(e,r))try{n[r]=e[r]}catch(t){}return n};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=e,this.hook("reading",e),t}},{key:"defineClass",value:function(){return this.mapToClass((function(t){D(this,t)}))}},{key:"add",value:function(t,e){var n=this,r=this.schema.primKey,o=r.auto,i=r.keyPath,a=t;return i&&o&&(a=Lt(i)(t)),this._trans("readwrite",(function(t){return n.core.mutate({trans:t,type:"add",keys:null!=e?[e]:null,values:[a]})})).then((function(t){return t.numFailures?lt.reject(t.failures[0]):t.lastResult})).then((function(e){if(i)try{er(t,i,e)}catch(t){}return e}))}},{key:"update",value:function(t,e){if("object"!=(void 0===t?"undefined":h(t))||$n(t))return this.where(":id").equals(t).modify(e);var n=tr(t,this.schema.primKey.keyPath);if(void 0===n)return eo(new Or.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof e?Kn(e).forEach((function(n){er(t,n,e[n])})):e(t,{value:t,primKey:n})}catch(t){}return this.where(":id").equals(n).modify(e)}},{key:"put",value:function(t,e){var n=this,r=this.schema.primKey,o=r.auto,i=r.keyPath,a=t;return i&&o&&(a=Lt(i)(t)),this._trans("readwrite",(function(t){return n.core.mutate({trans:t,type:"put",values:[a],keys:null!=e?[e]:null})})).then((function(t){return t.numFailures?lt.reject(t.failures[0]):t.lastResult})).then((function(e){if(i)try{er(t,i,e)}catch(t){}return e}))}},{key:"delete",value:function(t){var e=this;return this._trans("readwrite",(function(n){return e.core.mutate({trans:n,type:"delete",keys:[t]})})).then((function(t){return t.numFailures?lt.reject(t.failures[0]):void 0}))}},{key:"clear",value:function(){var t=this;return this._trans("readwrite",(function(e){return t.core.mutate({trans:e,type:"deleteRange",range:lo})})).then((function(t){return t.numFailures?lt.reject(t.failures[0]):void 0}))}},{key:"bulkGet",value:function(t){var e=this;return this._trans("readonly",(function(n){return e.core.getMany({keys:t,trans:n}).then((function(t){return t.map((function(t){return e.hook.reading.fire(t)}))}))}))}},{key:"bulkAdd",value:function(t,e,n){var r=this,o=Array.isArray(e)?e:void 0,i=(n=n||(o?void 0:e))?n.allKeys:void 0;return this._trans("readwrite",(function(e){var n=r.schema.primKey,a=n.auto,u=n.keyPath;if(u&&o)throw new Or.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(o&&o.length!==t.length)throw new Or.InvalidArgument("Arguments objects and keys must have the same length");var s=t.length,c=u&&a?t.map(Lt(u)):t;return r.core.mutate({trans:e,type:"add",keys:o,values:c,wantResults:i}).then((function(t){var e=t.numFailures,n=t.results,o=t.lastResult,a=t.failures;if(0===e)return i?n:o;throw new tt("".concat(r.name,".bulkAdd(): ").concat(e," of ").concat(s," operations failed"),a)}))}))}},{key:"bulkPut",value:function(t,e,n){var r=this,o=Array.isArray(e)?e:void 0,i=(n=n||(o?void 0:e))?n.allKeys:void 0;return this._trans("readwrite",(function(e){var n=r.schema.primKey,a=n.auto,u=n.keyPath;if(u&&o)throw new Or.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(o&&o.length!==t.length)throw new Or.InvalidArgument("Arguments objects and keys must have the same length");var s=t.length,c=u&&a?t.map(Lt(u)):t;return r.core.mutate({trans:e,type:"put",keys:o,values:c,wantResults:i}).then((function(t){var e=t.numFailures,n=t.results,o=t.lastResult,a=t.failures;if(0===e)return i?n:o;throw new tt("".concat(r.name,".bulkPut(): ").concat(e," of ").concat(s," operations failed"),a)}))}))}},{key:"bulkDelete",value:function(t){var e=this,n=t.length;return this._trans("readwrite",(function(n){return e.core.mutate({trans:n,type:"delete",keys:t})})).then((function(t){var r=t.numFailures,o=t.lastResult,i=t.failures;if(0===r)return o;throw new tt("".concat(e.name,".bulkDelete(): ").concat(r," of ").concat(n," operations failed"),i)}))}}]),t}();function po(t,e){try{var n=$t(t),r=$t(e);if(n!==r)return"Array"===n?1:"Array"===r?-1:"binary"===n?1:"binary"===r?-1:"string"===n?1:"string"===r?-1:"Date"===n?1:"Date"!==r?NaN:-1;switch(n){case"number":case"Date":case"string":return t>e?1:t<e?-1:0;case"binary":return function(t,e){for(var n=t.length,r=e.length,o=n<r?n:r,i=0;i<o;++i)if(t[i]!==e[i])return t[i]<e[i]?-1:1;return n===r?0:n<r?-1:1}(qt(t),qt(e));case"Array":return function(t,e){for(var n=t.length,r=e.length,o=n<r?n:r,i=0;i<o;++i){var a=po(t[i],e[i]);if(0!==a)return a}return n===r?0:n<r?-1:1}(t,e)}}catch(t){}return NaN}var ho=function(){function t(){o(this,t)}return a(t,[{key:"_read",value:function(t,e){var n=this._ctx;return n.error?n.table._trans(null,eo.bind(null,n.error)):n.table._trans("readonly",t).then(e)}},{key:"_write",value:function(t){var e=this._ctx;return e.error?e.table._trans(null,eo.bind(null,e.error)):e.table._trans("readwrite",t,"locked")}},{key:"_addAlgorithm",value:function(t){var e=this._ctx;e.algorithm=Rt(e.algorithm,t)}},{key:"_iterate",value:function(t,e){return Gt(this._ctx,t,e,this._ctx.table.core)}},{key:"clone",value:function(t){var e=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return t&&D(n,t),e._ctx=n,e}},{key:"raw",value:function(){return this._ctx.valueMapper=null,this}},{key:"each",value:function(t){var e=this._ctx;return this._read((function(n){return Gt(e,t,n,e.table.core)}))}},{key:"count",value:function(t){var e=this;return this._read((function(t){var n=e._ctx,r=n.table.core;if(Ft(n,!0))return r.count({trans:t,query:{index:Ht(n,r.schema),range:n.range}}).then((function(t){return Math.min(t,n.limit)}));var o=0;return Gt(n,(function(){return++o,!1}),t,r).then((function(){return o}))})).then(t)}},{key:"sortBy",value:function(t,e){var n=t.split(".").reverse(),r=n[0],o=n.length-1;function i(t,e){return e?i(t[n[e]],e-1):t[r]}var a="next"===this._ctx.dir?1:-1;function u(t,e){var n=i(t,o),r=i(e,o);return n<r?-a:n>r?a:0}return this.toArray((function(t){return t.sort(u)})).then(e)}},{key:"toArray",value:function(t){var e=this;return this._read((function(t){var n=e._ctx;if("next"===n.dir&&Ft(n,!0)&&n.limit>0){var r=n.valueMapper,o=Ht(n,n.table.core.schema);return n.table.core.query({trans:t,limit:n.limit,values:!0,query:{index:o,range:n.range}}).then((function(t){var e=t.result;return r?e.map(r):e}))}var i=[];return Gt(n,(function(t){return i.push(t)}),t,n.table.core).then((function(){return i}))}),t)}},{key:"offset",value:function(t){var e=this._ctx;return t<=0||(e.offset+=t,Ft(e)?zt(e,(function(){var e=t;return function(t,n){return 0===e||(1===e?(--e,!1):(n((function(){t.advance(e),e=0})),!1))}})):zt(e,(function(){var e=t;return function(){return--e<0}}))),this}},{key:"limit",value:function(t){return this._ctx.limit=Math.min(this._ctx.limit,t),zt(this._ctx,(function(){var e=t;return function(t,n,r){return--e<=0&&n(r),e>=0}}),!0),this}},{key:"until",value:function(t,e){return Vt(this._ctx,(function(n,r,o){return!t(n.value)||(r(o),e)})),this}},{key:"first",value:function(t){return this.limit(1).toArray((function(t){return t[0]})).then(t)}},{key:"last",value:function(t){return this.reverse().first(t)}},{key:"filter",value:function(t){var e,n;return Vt(this._ctx,(function(e){return t(e.value)})),e=this._ctx,n=t,e.isMatch=Rt(e.isMatch,n),this}},{key:"and",value:function(t){return this.filter(t)}},{key:"or",value:function(t){return new this.db.WhereClause(this._ctx.table,t,this)}},{key:"reverse",value:function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this}},{key:"desc",value:function(){return this.reverse()}},{key:"eachKey",value:function(t){var e=this._ctx;return e.keysOnly=!e.isMatch,this.each((function(e,n){t(n.key,n)}))}},{key:"eachUniqueKey",value:function(t){return this._ctx.unique="unique",this.eachKey(t)}},{key:"eachPrimaryKey",value:function(t){var e=this._ctx;return e.keysOnly=!e.isMatch,this.each((function(e,n){t(n.primaryKey,n)}))}},{key:"keys",value:function(t){var e=this._ctx;e.keysOnly=!e.isMatch;var n=[];return this.each((function(t,e){n.push(e.key)})).then((function(){return n})).then(t)}},{key:"primaryKeys",value:function(t){var e=this._ctx;if("next"===e.dir&&Ft(e,!0)&&e.limit>0)return this._read((function(t){var n=Ht(e,e.table.core.schema);return e.table.core.query({trans:t,values:!1,limit:e.limit,query:{index:n,range:e.range}})})).then((function(t){return t.result})).then(t);e.keysOnly=!e.isMatch;var n=[];return this.each((function(t,e){n.push(e.primaryKey)})).then((function(){return n})).then(t)}},{key:"uniqueKeys",value:function(t){return this._ctx.unique="unique",this.keys(t)}},{key:"firstKey",value:function(t){return this.limit(1).keys((function(t){return t[0]})).then(t)}},{key:"lastKey",value:function(t){return this.reverse().firstKey(t)}},{key:"distinct",value:function(){var t=this._ctx,e=t.index&&t.table.schema.idxByName[t.index];if(!e||!e.multi)return this;var n={};return Vt(this._ctx,(function(t){var e=t.primaryKey.toString(),r=N(n,e);return n[e]=!0,!r})),this}},{key:"modify",value:function(t){var e=this,n=this._ctx;return this._write((function(r){var o;if("function"==typeof t)o=t;else{var i=Kn(t),a=i.length;o=function(e){for(var n=!1,r=0;r<a;++r){var o=i[r],u=t[o];tr(e,o)!==u&&(er(e,o,u),n=!0)}return n}}var u=n.table.core,s=u.schema.primaryKey,c=s.outbound,l=s.extractKey,f=e.db._options.modifyChunkSize||200,p=[],d=0,v=[],y=function(t,e){var n=e.failures,r=e.numFailures;d+=t-r;var o=!0,i=!1,a=void 0;try{for(var u,s=Kn(n)[Symbol.iterator]();!(o=(u=s.next()).done);o=!0){var c=u.value;p.push(n[c])}}catch(t){i=!0,a=t}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}};return e.clone().primaryKeys().then((function(e){var i=function(a){var s=Math.min(f,e.length-a);return u.getMany({trans:r,keys:e.slice(a,a+s),cache:"immutable"}).then((function(p){for(var d=[],v=[],g=c?[]:null,m=[],b=0;b<s;++b){var w=p[b],O={value:K(w),primKey:e[a+b]};!1!==o.call(O,O.value,O)&&(null==O.value?m.push(e[a+b]):c||0===po(l(w),l(O.value))?(v.push(O.value),c&&g.push(e[a+b])):(m.push(e[a+b]),d.push(O.value)))}var S=Ft(n)&&n.limit===1/0&&("function"!=typeof t||t===vo)&&{index:n.index,range:n.range};return Promise.resolve(d.length>0&&u.mutate({trans:r,type:"add",values:d}).then((function(t){for(var e in t.failures)m.splice(parseInt(e),1);y(d.length,t)}))).then((function(){return(v.length>0||S&&"object"==(void 0===t?"undefined":h(t)))&&u.mutate({trans:r,type:"put",keys:g,values:v,criteria:S,changeSpec:"function"!=typeof t&&t}).then((function(t){return y(v.length,t)}))})).then((function(){return(m.length>0||S&&t===vo)&&u.mutate({trans:r,type:"delete",keys:m,criteria:S}).then((function(t){return y(m.length,t)}))})).then((function(){return e.length>a+s&&i(a+f)}))}))};return i(0).then((function(){if(p.length>0)throw new Z("Error modifying one or more objects",p,d,v);return e.length}))}))}))}},{key:"delete",value:function(){var t=this._ctx,e=t.range;return Ft(t)&&(t.isPrimKey&&!so||3===e.type)?this._write((function(n){var r=t.table.core.schema.primaryKey,o=e;return t.table.core.count({trans:n,query:{index:r,range:o}}).then((function(e){return t.table.core.mutate({trans:n,type:"deleteRange",range:o}).then((function(t){var n=t.failures,r=(t.lastResult,t.results,t.numFailures);if(r)throw new Z("Could not delete some values",Object.keys(n).map((function(t){return n[t]})),e-r);return e-r}))}))})):this.modify(vo)}}]),t}(),vo=function(t,e){return e.value=null},yo=function(){function t(){o(this,t)}return a(t,[{key:"Collection",get:function(){return this._ctx.table.db.Collection}},{key:"between",value:function(t,e,n,r){n=!1!==n,r=!0===r;try{return this._cmp(t,e)>0||0===this._cmp(t,e)&&(n||r)&&(!n||!r)?Xt(this):new this.Collection(this,(function(){return ee(t,e,!n,!r)}))}catch(t){return Qt(this,oo)}}},{key:"equals",value:function(t){return null==t?Qt(this,oo):new this.Collection(this,(function(){return ne(t)}))}},{key:"above",value:function(t){return null==t?Qt(this,oo):new this.Collection(this,(function(){return ee(t,void 0,!0)}))}},{key:"aboveOrEqual",value:function(t){return null==t?Qt(this,oo):new this.Collection(this,(function(){return ee(t,void 0,!1)}))}},{key:"below",value:function(t){return null==t?Qt(this,oo):new this.Collection(this,(function(){return ee(void 0,t,!1,!0)}))}},{key:"belowOrEqual",value:function(t){return null==t?Qt(this,oo):new this.Collection(this,(function(){return ee(void 0,t)}))}},{key:"startsWith",value:function(t){return"string"!=typeof t?Qt(this,"String expected."):this.between(t,t+ro,!0,!0)}},{key:"startsWithIgnoreCase",value:function(t){return""===t?this.startsWith(t):te(this,(function(t,e){return 0===t.indexOf(e[0])}),[t],ro)}},{key:"equalsIgnoreCase",value:function(t){return te(this,(function(t,e){return t===e[0]}),[t],"")}},{key:"anyOfIgnoreCase",value:function(){var t=q.apply(lr,arguments);return 0===t.length?Xt(this):te(this,(function(t,e){return-1!==e.indexOf(t)}),t,"")}},{key:"startsWithAnyOfIgnoreCase",value:function(){var t=q.apply(lr,arguments);return 0===t.length?Xt(this):te(this,(function(t,e){return e.some((function(e){return 0===t.indexOf(e)}))}),t,ro)}},{key:"anyOf",value:function(){var t=this,e=q.apply(lr,arguments),n=this._cmp;try{e.sort(n)}catch(t){return Qt(this,oo)}if(0===e.length)return Xt(this);var r=new this.Collection(this,(function(){return ee(e[0],e[e.length-1])}));r._ondirectionchange=function(r){n="next"===r?t._ascending:t._descending,e.sort(n)};var o=0;return r._addAlgorithm((function(t,r,i){for(var a=t.key;n(a,e[o])>0;)if(++o===e.length)return r(i),!1;return 0===n(a,e[o])||(r((function(){t.continue(e[o])})),!1)})),r}},{key:"notEqual",value:function(t){return this.inAnyRange([[-1/0,t],[t,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}},{key:"noneOf",value:function(){var t=q.apply(lr,arguments);if(0===t.length)return new this.Collection(this);try{t.sort(this._ascending)}catch(t){return Qt(this,oo)}var e=t.reduce((function(t,e){return t?t.concat([[t[t.length-1][1],e]]):[[-1/0,e]]}),null);return e.push([t[t.length-1],this.db._maxKey]),this.inAnyRange(e,{includeLowers:!1,includeUppers:!1})}},{key:"inAnyRange",value:function(t,e){var n=this,r=this._cmp,o=this._ascending,i=this._descending,a=this._min,u=this._max;if(0===t.length)return Xt(this);if(!t.every((function(t){return void 0!==t[0]&&void 0!==t[1]&&o(t[0],t[1])<=0})))return Qt(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Or.InvalidArgument);var s,c=!e||!1!==e.includeLowers,l=e&&!0===e.includeUppers,f=o;function p(t,e){return f(t[0],e[0])}try{s=t.reduce((function(t,e){for(var n=0,o=t.length;n<o;++n){var i=t[n];if(r(e[0],i[1])<0&&r(e[1],i[0])>0){i[0]=a(i[0],e[0]),i[1]=u(i[1],e[1]);break}}return n===o&&t.push(e),t}),[]),s.sort(p)}catch(t){return Qt(this,oo)}var h=0,d=l?function(t){return o(t,s[h][1])>0}:function(t){return o(t,s[h][1])>=0},v=c?function(t){return i(t,s[h][0])>0}:function(t){return i(t,s[h][0])>=0},y=d,g=new this.Collection(this,(function(){return ee(s[0][0],s[s.length-1][1],!c,!l)}));return g._ondirectionchange=function(t){"next"===t?(y=d,f=o):(y=v,f=i),s.sort(p)},g._addAlgorithm((function(t,e,r){for(var i=t.key;y(i);)if(++h===s.length)return e(r),!1;return!!function(t){return!d(t)&&!v(t)}(i)||(0===n._cmp(i,s[h][1])||0===n._cmp(i,s[h][0])||e((function(){f===o?t.continue(s[h][0]):t.continue(s[h][1])})),!1)})),g}},{key:"startsWithAnyOf",value:function(){var t=q.apply(lr,arguments);return t.every((function(t){return"string"==typeof t}))?0===t.length?Xt(this):this.inAnyRange(t.map((function(t){return[t,t+ro]}))):Qt(this,"startsWithAnyOf() only works with strings")}}]),t}(),go=Ut(null,"storagemutated"),mo=function(){function t(){o(this,t)}return a(t,[{key:"_lock",value:function(){return V(!zr.global),++this._reculock,1!==this._reculock||zr.global||(zr.lockOwnerFor=this),this}},{key:"_unlock",value:function(){if(V(!zr.global),0==--this._reculock)for(zr.global||(zr.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var t=this._blockedFuncs.shift();try{Ct(t[1],t[0])}catch(t){}}return this}},{key:"_locked",value:function(){return this._reculock&&zr.lockOwnerFor!==this}},{key:"create",value:function(t){var e=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(V(!this.idbtrans),!t&&!n)switch(r&&r.name){case"DatabaseClosedError":throw new Or.DatabaseClosed(r);case"MissingAPIError":throw new Or.MissingAPI(r.message,r);default:throw new Or.OpenFailed(r)}if(!this.active)throw new Or.TransactionInactive;return V(null===this._completion._state),(t=this.idbtrans=t||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):n.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=St((function(n){oe(n),e._reject(t.error)})),t.onabort=St((function(n){oe(n),e.active&&e._reject(new Or.Abort(t.error)),e.active=!1,e.on("abort").fire(n)})),t.oncomplete=St((function(){e.active=!1,e._resolve(),"mutatedParts"in t&&go.storagemutated.fire(t.mutatedParts)})),this}},{key:"_promise",value:function(t,e,n){var r=this;if("readwrite"===t&&"readwrite"!==this.mode)return eo(new Or.ReadOnly("Transaction is readonly"));if(!this.active)return eo(new Or.TransactionInactive);if(this._locked())return new lt((function(o,i){r._blockedFuncs.push([function(){r._promise(t,e,n).then(o,i)},zr])}));if(n)return Et((function(){var t=new lt((function(t,n){r._lock();var o=e(t,n,r);o&&o.then&&o.then(t,n)}));return t.finally((function(){return r._unlock()})),t._lib=!0,t}));var o=new lt((function(t,n){var o=e(t,n,r);o&&o.then&&o.then(t,n)}));return o._lib=!0,o}},{key:"_root",value:function(){return this.parent?this.parent._root():this}},{key:"waitFor",value:function(t){var e=this._root(),n=lt.resolve(t);if(e._waitingFor)e._waitingFor=e._waitingFor.then((function(){return n}));else{e._waitingFor=n,e._waitingQueue=[];var r=e.idbtrans.objectStore(e.storeNames[0]);!function t(){for(++e._spinCount;e._waitingQueue.length;)e._waitingQueue.shift()();e._waitingFor&&(r.get(-1/0).onsuccess=t)}()}var o=e._waitingFor;return new lt((function(t,r){n.then((function(n){return e._waitingQueue.push(St(t.bind(null,n)))}),(function(t){return e._waitingQueue.push(St(r.bind(null,t)))})).finally((function(){e._waitingFor===o&&(e._waitingFor=null)}))}))}},{key:"abort",value:function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Or.Abort))}},{key:"table",value:function(t){var e=this._memoizedTables||(this._memoizedTables={});if(N(e,t))return e[t];var n=this.schema[t];if(!n)throw new Or.NotFound("Table "+t+" not part of transaction");var r=new this.db.Table(t,n,this);return r.core=this.db.core.table(t),e[t]=r,r}}]),t}(),bo=function(t){try{return t.only([[]]),bo=function(){return[[]]},[[]]}catch(t){return bo=function(){return ro},ro}},wo=0,Oo=function(){function t(){o(this,t)}return a(t,[{key:"_parseStoresSpec",value:function(t,e){Kn(t).forEach((function(n){if(null!==t[n]){var r=t[n].split(",").map((function(t,e){var n=(t=t.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return ie(n,r||null,/\&/.test(t),/\*/.test(t),/\+\+/.test(t),$n(r),0===e)})),o=r.shift();if(o.multi)throw new Or.Schema("Primary key cannot be multi-valued");r.forEach((function(t){if(t.auto)throw new Or.Schema("Only primary key can be marked as autoIncrement (++)");if(!t.keyPath)throw new Or.Schema("Index must have a name and cannot be an empty string")})),e[n]=ue(n,o,r)}}))}},{key:"stores",value:function(t){var e=this.db;this._cfg.storesSource=this._cfg.storesSource?D(this._cfg.storesSource,t):t;var n=e._versions,r={},o={};return n.forEach((function(t){D(r,t._cfg.storesSource),o=t._cfg.dbschema={},t._parseStoresSpec(r,o)})),e._dbSchema=o,he(e,[e._allTables,e,e.Transaction.prototype]),pe(e,[e._allTables,e,e.Transaction.prototype,this._cfg.tables],Kn(o),o),e._storeNames=Kn(o),this}},{key:"upgrade",value:function(t){return this._cfg.contentUpgrade=ct(this._cfg.contentUpgrade||et,t),this}}]),t}();function So(t,e,n,r,o){return lt.resolve().then((function(){var i=zr.transless||zr,a=t._createTransaction(e,n,t._dbSchema,r),u={trans:a,transless:i};if(r)a.idbtrans=r.idbtrans;else try{a.create(),t._state.PR1398_maxLoop=3}catch(r){return r.name===br.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then((function(){return So(t,e,n,null,o)}))):eo(r)}var s,c=fr(o);c&&xt();var l=lt.follow((function(){if(s=o.call(a,a))if(c){var t=Pt.bind(null,null);s.then(t,t)}else"function"==typeof s.next&&"function"==typeof s.throw&&(s=xe(s))}),u);return(s&&"function"==typeof s.then?lt.resolve(s).then((function(t){return a.active?t:eo(new Or.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))})):l.then((function(){return s}))).then((function(t){return r&&a._resolve(),a._completion.then((function(){return t}))})).catch((function(t){return a._reject(t),eo(t)}))}))}var Eo={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(t){return l(c({},t),{table:function(e){var n=t.table(e),r=n.schema,o={},i=[];function a(t,e,n){var r=le(t),u=o[r]=o[r]||[],s=null==t?0:"string"==typeof t?1:t.length,f=e>0,p=l(c({},n),{isVirtual:f,keyTail:e,keyLength:s,extractKey:se(t),unique:!f&&n.unique});return u.push(p),p.isPrimaryKey||i.push(p),s>1&&a(2===s?t[0]:t.slice(0,s-1),e+1,n),u.sort((function(t,e){return t.keyTail-e.keyTail})),p}var u=a(r.primaryKey.keyPath,0,r.primaryKey);o[":id"]=[u];var s=!0,f=!1,p=void 0;try{for(var h,d=r.indexes[Symbol.iterator]();!(s=(h=d.next()).done);s=!0){var v=h.value;a(v.keyPath,0,v)}}catch(t){f=!0,p=t}finally{try{s||null==d.return||d.return()}finally{if(f)throw p}}function y(e){var n,r,o=e.query.index;return o.isVirtual?l(c({},e),{query:{index:o,range:(n=e.query.range,r=o.keyTail,{type:1===n.type?2:n.type,lower:je(n.lower,n.lowerOpen?t.MAX_KEY:t.MIN_KEY,r),lowerOpen:!0,upper:je(n.upper,n.upperOpen?t.MIN_KEY:t.MAX_KEY,r),upperOpen:!0})}}):e}var g=l(c({},n),{schema:l(c({},r),{primaryKey:u,indexes:i,getIndexByKeyPath:function(t){var e=o[le(t)];return e&&e[0]}}),count:function(t){return n.count(y(t))},query:function(t){return n.query(y(t))},openCursor:function(e){var r=e.query.index,o=r.keyTail,i=r.isVirtual,a=r.keyLength;return i?n.openCursor(y(e)).then((function(n){return n&&function(n){var r=Object.create(n,{continue:{value:function(r){null!=r?n.continue(je(r,e.reverse?t.MAX_KEY:t.MIN_KEY,o)):e.unique?n.continue(n.key.slice(0,a).concat(e.reverse?t.MIN_KEY:t.MAX_KEY,o)):n.continue()}},continuePrimaryKey:{value:function(e,r){n.continuePrimaryKey(je(e,t.MAX_KEY,o),r)}},primaryKey:{get:function(){return n.primaryKey}},key:{get:function(){var t=n.key;return 1===a?t[0]:t.slice(0,a)}},value:{get:function(){return n.value}}});return r}(n)})):n.openCursor(e)}});return g}})}};function xo(t,e,n,r){return n=n||{},r=r||"",Kn(t).forEach((function(o){if(N(e,o)){var i=t[o],a=e[o];if("object"==(void 0===i?"undefined":h(i))&&"object"==(void 0===a?"undefined":h(a))&&i&&a){var u=$(i);u!==$(a)?n[r+o]=e[o]:"Object"===u?xo(i,a,n,r+o+"."):i!==a&&(n[r+o]=e[o])}else i!==a&&(n[r+o]=e[o])}else n[r+o]=void 0})),Kn(e).forEach((function(o){N(t,o)||(n[r+o]=e[o])})),n}var Po={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(t){return l(c({},t),{table:function(e){var n=t.table(e),r=n.schema.primaryKey,o=l(c({},n),{mutate:function(t){var o=zr.trans,i=o.table(e).hook,a=i.deleting,u=i.creating,s=i.updating;switch(t.type){case"add":if(u.fire===et)break;return o._promise("readwrite",(function(){return f(t)}),!0);case"put":if(u.fire===et&&s.fire===et)break;return o._promise("readwrite",(function(){return f(t)}),!0);case"delete":if(a.fire===et)break;return o._promise("readwrite",(function(){return f(t)}),!0);case"deleteRange":if(a.fire===et)break;return o._promise("readwrite",(function(){return function(t){return h(t.trans,t.range,1e4)}(t)}),!0)}return n.mutate(t);function f(t){var e=zr.trans,o=t.keys||function(t,e){return"delete"===e.type?e.keys:e.keys||e.values.map(t.extractKey)}(r,t);if(!o)throw new Error("Keys missing");return"delete"!==(t="add"===t.type||"put"===t.type?l(c({},t),{keys:o}):c({},t)).type&&(t.values=p(t.values)),t.keys&&(t.keys=p(t.keys)),function(t,e,n){return"add"===e.type?Promise.resolve([]):t.getMany({trans:e.trans,keys:n,cache:"immutable"})}(n,t,o).then((function(i){var c=o.map((function(n,o){var c=i[o],l={onerror:null,onsuccess:null};if("delete"===t.type)a.fire.call(l,n,c,e);else if("add"===t.type||void 0===c){var f=u.fire.call(l,n,t.values[o],e);null==n&&null!=f&&(n=f,t.keys[o]=n,r.outbound||er(t.values[o],r.keyPath,n))}else{var p=xo(c,t.values[o]),h=s.fire.call(l,p,n,c,e);if(h){var d=t.values[o];Object.keys(h).forEach((function(t){N(d,t)?d[t]=h[t]:er(d,t,h[t])}))}}return l}));return n.mutate(t).then((function(e){for(var n=e.failures,r=e.results,a=e.numFailures,u=e.lastResult,s=0;s<o.length;++s){var l=r?r[s]:o[s],f=c[s];null==l?f.onerror&&f.onerror(n[s]):f.onsuccess&&f.onsuccess("put"===t.type&&i[s]?t.values[s]:l)}return{failures:n,results:r,numFailures:a,lastResult:u}})).catch((function(t){return c.forEach((function(e){return e.onerror&&e.onerror(t)})),Promise.reject(t)}))}))}function h(t,e,o){return n.query({trans:t,values:!1,query:{index:r,range:e},limit:o}).then((function(n){var r=n.result;return f({type:"delete",keys:r,trans:t}).then((function(n){return n.numFailures>0?Promise.reject(n.failures[0]):r.length<o?{failures:[],numFailures:0,lastResult:void 0}:h(t,l(c({},e),{lower:r[r.length-1],lowerOpen:!0}),o)}))}))}}});return o}})}},jo={stack:"dbcore",level:-1,create:function(t){return{table:function(e){var n=t.table(e);return l(c({},n),{getMany:function(t){if(!t.cache)return n.getMany(t);var e=ke(t.keys,t.trans._cache,"clone"===t.cache);return e?lt.resolve(e):n.getMany(t).then((function(e){return t.trans._cache={keys:t.keys,values:"clone"===t.cache?K(e):e},e}))},mutate:function(t){return"add"!==t.type&&(t.trans._cache=null),n.mutate(t)}})}}}},ko=function(t,e){if(!this){var n=new ko;return t&&"d"in t&&D(n,t),n}D(this,arguments.length?{d:1,from:t,to:arguments.length>1?e:t}:{d:0})};function Ao(t,e,n){var r=po(e,n);if(!isNaN(r)){if(r>0)throw RangeError();if(Ae(t))return D(t,{from:e,to:n,d:1});var o=t.l,i=t.r;if(po(n,t.from)<0)return o?Ao(o,e,n):t.l={from:e,to:n,d:1,l:null,r:null},Ce(t);if(po(e,t.to)>0)return i?Ao(i,e,n):t.r={from:e,to:n,d:1,l:null,r:null},Ce(t);po(e,t.from)<0&&(t.from=e,t.l=null,t.d=i?i.d+1:1),po(n,t.to)>0&&(t.to=n,t.r=null,t.d=t.l?t.l.d+1:1);var a=!t.r;o&&!t.l&&_e(t,o),i&&a&&_e(t,i)}}R(ko.prototype,u({add:function(t){return _e(this,t),this},addKey:function(t){return Ao(this,t,t),this},addKeys:function(t){var e=this;return t.forEach((function(t){return Ao(e,t,t)})),this}},sr,(function(){return Te(this)})));var _o,To={stack:"dbcore",level:0,create:function(t){var e=t.schema.name,n=new ko(t.MIN_KEY,t.MAX_KEY);return l(c({},t),{table:function(r){var o=t.table(r),i=o.schema,a=i.primaryKey,u=a.extractKey,s=a.outbound,p=l(c({},o),{mutate:function(t){var a=t.trans,u=a.mutatedParts||(a.mutatedParts={}),s=function(t){var n="idb://".concat(e,"/").concat(r,"/").concat(t);return u[n]||(u[n]=new ko)},c=s(""),l=s(":dels"),p=t.type,h=f("deleteRange"===t.type?[t.range]:"delete"===t.type?[t.keys]:t.values.length<50?[[],t.values]:[],2),d=h[0],v=h[1],y=t.trans._cache;return o.mutate(t).then((function(t){if($n(d)){"delete"!==p&&(d=t.results),c.addKeys(d);var e=ke(d,y);e||"add"===p||l.addKeys(d),(e||v)&&function(t,e,n,r){e.indexes.forEach((function(e){var o=t(e.name||"");function i(t){return null!=t?e.extractKey(t):null}var a=function(t){return e.multiEntry&&$n(t)?t.forEach((function(t){return o.addKey(t)})):o.addKey(t)};(n||r).forEach((function(t,e){var o=n&&i(n[e]),u=r&&i(r[e]);0!==po(o,u)&&(null!=o&&a(o),null!=u&&a(u))}))}))}(s,i,e,v)}else if(d){var r={from:d.lower,to:d.upper};l.add(r),c.add(r)}else c.add(n),l.add(n),i.indexes.forEach((function(t){return s(t.name).add(n)}));return t}))}}),h=function(e){var n,r,o=e.query,i=o.index,a=o.range;return[i,new ko(null!==(n=a.lower)&&void 0!==n?n:t.MIN_KEY,null!==(r=a.upper)&&void 0!==r?r:t.MAX_KEY)]},d={get:function(t){return[a,new ko(t.key)]},getMany:function(t){return[a,(new ko).addKeys(t.keys)]},count:h,query:h,openCursor:h};return Kn(d).forEach((function(t){p[t]=function(i){var a=zr.subscr;if(a){var p=function(t){var n="idb://".concat(e,"/").concat(r,"/").concat(t);return a[n]||(a[n]=new ko)},h=p(""),v=p(":dels"),y=f(d[t](i),2),g=y[0],m=y[1];if(p(g.name||"").add(m),!g.isPrimaryKey){if("count"!==t){var b="query"===t&&s&&i.values&&o.query(l(c({},i),{values:!1}));return o[t].apply(this,arguments).then((function(e){if("query"===t){if(s&&i.values)return b.then((function(t){var n=t.result;return h.addKeys(n),e}));var n=i.values?e.result.map(u):e.result;i.values?h.addKeys(n):v.addKeys(n)}else if("openCursor"===t){var r=e,o=i.values;return r&&Object.create(r,{key:{get:function(){return v.addKey(r.primaryKey),r.key}},primaryKey:{get:function(){var t=r.primaryKey;return v.addKey(t),t}},value:{get:function(){return o&&h.addKey(r.primaryKey),r.value}}})}return e}))}v.add(n)}}return o[t].apply(this,arguments)}})),p}})}},Co=function(){function t(e,n){var r=this;o(this,t),this._middlewares={},this.verno=0;var i=t.dependencies;this._options=n=c({addons:t.addons,autoOpen:!0,indexedDB:i.indexedDB,IDBKeyRange:i.IDBKeyRange},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange};var a=n.addons;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var u,s={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:et,dbReadyPromise:null,cancelOpen:et,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};s.dbReadyPromise=new lt((function(t){s.dbReadyResolve=t})),s.openCanceller=new lt((function(t,e){s.cancelOpen=e})),this._state=s,this.name=e,this.on=Ut(this,"populate","blocked","versionchange","close",{ready:[ct,et]}),this.on.ready.subscribe=F(this.on.ready.subscribe,(function(e){return function(n,o){t.vip((function(){var t=r._state;if(t.openComplete)t.dbOpenError||lt.resolve().then(n),o&&e(n);else if(t.onReadyBeingFired)t.onReadyBeingFired.push(n),o&&e(n);else{e(n);var i=r;o||e((function t(){i.on.ready.unsubscribe(n),i.on.ready.unsubscribe(t)}))}}))}})),this.Collection=(u=this,Bt(ho.prototype,(function(t,e){this.db=u;var n=lo,r=null;if(e)try{n=e()}catch(t){r=t}var o=t._ctx,i=o.table,a=i.hook.reading.fire;this._ctx={table:i,index:o.index,isPrimKey:!o.index||i.schema.primKey.keyPath&&o.index===i.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:r,or:o.or,valueMapper:a!==nt?a:null}}))),this.Table=function(t){return Bt(fo.prototype,(function(e,n,r){this.db=t,this._tx=r,this.name=e,this.schema=n,this.hook=t._allTables[e]?t._allTables[e].hook:Ut(null,{creating:[it,et],reading:[rt,nt],updating:[ut,et],deleting:[at,et]})}))}(this),this.Transaction=function(t){return Bt(mo.prototype,(function(e,n,r,o,i){var a=this;this.db=t,this.mode=e,this.storeNames=n,this.schema=r,this.chromeTransactionDurability=o,this.idbtrans=null,this.on=Ut(this,"complete","error","abort"),this.parent=i||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new lt((function(t,e){a._resolve=t,a._reject=e})),this._completion.then((function(){a.active=!1,a.on.complete.fire()}),(function(t){var e=a.active;return a.active=!1,a.on.error.fire(t),a.parent?a.parent._reject(t):e&&a.idbtrans&&a.idbtrans.abort(),eo(t)}))}))}(this),this.Version=function(t){return Bt(Oo.prototype,(function(e){this.db=t,this._cfg={version:e,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(t){return Bt(yo.prototype,(function(e,n,r){this.db=t,this._ctx={table:e,index:":id"===n?null:n,or:r};var o=t._deps.indexedDB;if(!o)throw new Or.MissingAPI;this._cmp=this._ascending=o.cmp.bind(o),this._descending=function(t,e){return o.cmp(e,t)},this._max=function(t,e){return o.cmp(t,e)>0?t:e},this._min=function(t,e){return o.cmp(t,e)<0?t:e},this._IDBKeyRange=t._deps.IDBKeyRange}))}(this),this.on("versionchange",(function(t){t.newVersion>0?console.warn("Another connection wants to upgrade database '".concat(r.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(r.name,"'. Closing db now to resume the delete request.")),r.close()})),this.on("blocked",(function(t){!t.newVersion||t.newVersion<t.oldVersion?console.warn("Dexie.delete('".concat(r.name,"') was blocked")):console.warn("Upgrade '".concat(r.name,"' blocked by other connection holding version ").concat(t.oldVersion/10))})),this._maxKey=bo(n.IDBKeyRange),this._createTransaction=function(t,e,n,o){return new r.Transaction(t,e,n,r._options.chromeTransactionDurability,o)},this._fireOnBlocked=function(t){r.on("blocked").fire(t),io.filter((function(t){return t.name===r.name&&t!==r&&!t._state.vcFired})).map((function(e){return e.on("versionchange").fire(t)}))},this.use(Eo),this.use(Po),this.use(To),this.use(jo),this.vip=Object.create(this,{_vip:{value:!0}}),a.forEach((function(t){return t(r)}))}return a(t,[{key:"version",value:function(t){if(isNaN(t)||t<.1)throw new Or.Type("Given version is not a positive number");if(t=Math.round(10*t)/10,this.idbdb||this._state.isBeingOpened)throw new Or.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,t);var e=this._versions,n=e.filter((function(e){return e._cfg.version===t}))[0];return n||(n=new this.Version(t),e.push(n),e.sort(de),n.stores({}),this._state.autoSchema=!1,n)}},{key:"_whenReady",value:function(t){var e=this;return this.idbdb&&(this._state.openComplete||zr.letThrough||this._vip)?t():new lt((function(t,n){if(e._state.openComplete)return n(new Or.DatabaseClosed(e._state.dbOpenError));if(!e._state.isBeingOpened){if(!e._options.autoOpen)return void n(new Or.DatabaseClosed);e.open().catch(et)}e._state.dbReadyPromise.then(t,n)})).then(t)}},{key:"use",value:function(t){var e=t.stack,n=t.create,r=t.level,o=t.name;o&&this.unuse({stack:e,name:o});var i=this._middlewares[e]||(this._middlewares[e]=[]);return i.push({stack:e,create:n,level:null==r?10:r,name:o}),i.sort((function(t,e){return t.level-e.level})),this}},{key:"unuse",value:function(t){var e=t.stack,n=t.name,r=t.create;return e&&this._middlewares[e]&&(this._middlewares[e]=this._middlewares[e].filter((function(t){return r?t.create!==r:!!n&&t.name!==n}))),this}},{key:"open",value:function(){return function(t){var e=t._state,n=t._deps.indexedDB;if(e.isBeingOpened||t.idbdb)return e.dbReadyPromise.then((function(){return e.dbOpenError?eo(e.dbOpenError):t}));pr&&(e.openCanceller._stackHolder=vr()),e.isBeingOpened=!0,e.dbOpenError=null,e.openComplete=!1;var r=e.openCanceller;function o(){if(e.openCanceller!==r)throw new Or.DatabaseClosed("db.open() was cancelled")}var i=e.dbReadyResolve,a=null,u=!1;return lt.race([r,("undefined"==typeof navigator?lt.resolve():Ee()).then((function(){return new lt((function(r,i){if(o(),!n)throw new Or.MissingAPI;var s=t.name,c=e.autoSchema?n.open(s):n.open(s,Math.round(10*t.verno));if(!c)throw new Or.MissingAPI;c.onerror=re(i),c.onblocked=St(t._fireOnBlocked),c.onupgradeneeded=St((function(r){if(a=c.transaction,e.autoSchema&&!t._options.allowEmptyDB){c.onerror=oe,a.abort(),c.result.close();var o=n.deleteDatabase(s);o.onsuccess=o.onerror=St((function(){i(new Or.NoSuchDatabase("Database ".concat(s," doesnt exist")))}))}else{a.onerror=re(i);var l=r.oldVersion>Math.pow(2,62)?0:r.oldVersion;u=l<1,t._novip.idbdb=c.result,function(t,e,n,r){var o=t._dbSchema,i=t._createTransaction("readwrite",t._storeNames,o);i.create(n),i._completion.catch(r);var a=i._reject.bind(i),u=zr.transless||zr;Et((function(){zr.trans=i,zr.transless=u,0===e?(Kn(o).forEach((function(t){ye(n,t,o[t].primKey,o[t].indexes)})),fe(t,n),lt.follow((function(){return t.on.populate.fire(i)})).catch(a)):function(t,e,n,r){var o=t._novip,i=[],a=o._versions,u=o._dbSchema=me(0,o.idbdb,r),s=!1;return a.filter((function(t){return t._cfg.version>=e})).forEach((function(t){i.push((function(){var i=u,a=t._cfg.dbschema;be(o,i,r),be(o,a,r),u=o._dbSchema=a;var c=ve(i,a);c.add.forEach((function(t){ye(r,t[0],t[1].primKey,t[1].indexes)})),c.change.forEach((function(t){if(t.recreate)throw new Or.Upgrade("Not yet support for changing primary key");var e=r.objectStore(t.name);t.add.forEach((function(t){return ge(e,t)})),t.change.forEach((function(t){e.deleteIndex(t.name),ge(e,t)})),t.del.forEach((function(t){return e.deleteIndex(t)}))}));var l=t._cfg.contentUpgrade;if(l&&t._cfg.version>e){fe(o,r),n._memoizedTables={},s=!0;var f=W(a);c.del.forEach((function(t){f[t]=i[t]})),he(o,[o.Transaction.prototype]),pe(o,[o.Transaction.prototype],Kn(f),f),n.schema=f;var p,h=fr(l);h&&xt();var d=lt.follow((function(){if((p=l(n))&&h){var t=Pt.bind(null,null);p.then(t,t)}}));return p&&"function"==typeof p.then?lt.resolve(p):d.then((function(){return p}))}})),i.push((function(e){s&&uo||function(t,e){[].slice.call(e.db.objectStoreNames).forEach((function(n){return null==t[n]&&e.db.deleteObjectStore(n)}))}(t._cfg.dbschema,e),he(o,[o.Transaction.prototype]),pe(o,[o.Transaction.prototype],o._storeNames,o._dbSchema),n.schema=o._dbSchema}))})),function t(){return i.length?lt.resolve(i.shift()(n.idbtrans)).then(t):lt.resolve()}().then((function(){var t,e;e=r,Kn(t=u).forEach((function(n){e.db.objectStoreNames.contains(n)||ye(e,n,t[n].primKey,t[n].indexes)}))}))}(t,e,i,n).catch(a)}))}(t,l/10,a,i)}}),i),c.onsuccess=St((function(){a=null;var n,o=t._novip.idbdb=c.result,i=B(o.objectStoreNames);if(i.length>0)try{var l=o.transaction(1===(n=i).length?n[0]:n,"readonly");e.autoSchema?function(t,e,n){var r=t._novip;r.verno=e.version/10;var o=r._dbSchema=me(0,e,n);r._storeNames=B(e.objectStoreNames,0),pe(r,[r._allTables],Kn(o),o)}(t,o,l):(be(t,t._dbSchema,l),function(t,e){var n=ve(me(0,t.idbdb,e),t._dbSchema);return!(n.add.length||n.change.some((function(t){return t.add.length||t.change.length})))}(t,l)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),fe(t,l)}catch(t){}io.push(t),o.onversionchange=St((function(n){e.vcFired=!0,t.on("versionchange").fire(n)})),o.onclose=St((function(e){t.on("close").fire(e)})),u&&function(t,e){var n=t.indexedDB,r=t.IDBKeyRange;!Oe(n)&&"__dbnames"!==e&&we(n,r).put({name:e}).catch(et)}(t._deps,s),r()}),i)}))}))]).then((function(){return o(),e.onReadyBeingFired=[],lt.resolve(Se((function(){return t.on.ready.fire(t.vip)}))).then((function n(){if(e.onReadyBeingFired.length>0){var r=e.onReadyBeingFired.reduce(ct,et);return e.onReadyBeingFired=[],lt.resolve(Se((function(){return r(t.vip)}))).then(n)}}))})).finally((function(){e.onReadyBeingFired=null,e.isBeingOpened=!1})).then((function(){return t})).catch((function(n){e.dbOpenError=n;try{a&&a.abort()}catch(t){}return r===e.openCanceller&&t._close(),eo(n)})).finally((function(){e.openComplete=!0,i()}))}(this)}},{key:"_close",value:function(){var t=this._state,e=io.indexOf(this);if(e>=0&&io.splice(e,1),this.idbdb){try{this.idbdb.close()}catch(t){}this._novip.idbdb=null}t.dbReadyPromise=new lt((function(e){t.dbReadyResolve=e})),t.openCanceller=new lt((function(e,n){t.cancelOpen=n}))}},{key:"close",value:function(){this._close();var t=this._state;this._options.autoOpen=!1,t.dbOpenError=new Or.DatabaseClosed,t.isBeingOpened&&t.cancelOpen(t.dbOpenError)}},{key:"delete",value:function(){var t=this,e=arguments.length>0,n=this._state;return new lt((function(r,o){var i=function(){t.close();var e=t._deps.indexedDB.deleteDatabase(t.name);e.onsuccess=St((function(){!function(t,e){var n=t.indexedDB,r=t.IDBKeyRange;!Oe(n)&&"__dbnames"!==e&&we(n,r).delete(e).catch(et)}(t._deps,t.name),r()})),e.onerror=re(o),e.onblocked=t._fireOnBlocked};if(e)throw new Or.InvalidArgument("Arguments not allowed in db.delete()");n.isBeingOpened?n.dbReadyPromise.then(i):i()}))}},{key:"backendDB",value:function(){return this.idbdb}},{key:"isOpen",value:function(){return null!==this.idbdb}},{key:"hasBeenClosed",value:function(){var t=this._state.dbOpenError;return t&&"DatabaseClosed"===t.name}},{key:"hasFailed",value:function(){return null!==this._state.dbOpenError}},{key:"dynamicallyOpened",value:function(){return this._state.autoSchema}},{key:"tables",get:function(){var t=this;return Kn(this._allTables).map((function(e){return t._allTables[e]}))}},{key:"transaction",value:function(){var t=Pe.apply(this,arguments);return this._transaction.apply(this,t)}},{key:"_transaction",value:function(t,e,n){var r=this,o=zr.trans;o&&o.db===this&&-1===t.indexOf("!")||(o=null);var i,a,u=-1!==t.indexOf("?");t=t.replace("!","").replace("?","");try{if(a=e.map((function(t){var e=s(t,r.Table)?t.name:t;if("string"!=typeof e)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return e})),"r"==t||"readonly"===t)i="readonly";else{if("rw"!=t&&"readwrite"!=t)throw new Or.InvalidArgument("Invalid transaction mode: "+t);i="readwrite"}if(o){if("readonly"===o.mode&&"readwrite"===i){if(!u)throw new Or.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");o=null}o&&a.forEach((function(t){if(o&&-1===o.storeNames.indexOf(t)){if(!u)throw new Or.SubTransaction("Table "+t+" not included in parent transaction.");o=null}})),u&&o&&!o.active&&(o=null)}}catch(t){return o?o._promise(null,(function(e,n){n(t)})):eo(t)}var c=So.bind(null,this,i,a,o,n);return o?o._promise(i,c,"lock"):zr.trans?Ct(zr.transless,(function(){return r._whenReady(c)})):this._whenReady(c)}},{key:"table",value:function(t){if(!N(this._allTables,t))throw new Or.InvalidTable("Table ".concat(t," does not exist"));return this._allTables[t]}}]),t}(),Io="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable",Mo=function(){function t(e){o(this,t),this._subscribe=e}return a(t,[{key:"subscribe",value:function(t,e,n){return this._subscribe(t&&"function"!=typeof t?t:{next:t,error:e,complete:n})}},{key:Io,value:function(){return this}}]),t}();try{_o={indexedDB:Gn.indexedDB||Gn.mozIndexedDB||Gn.webkitIndexedDB||Gn.msIndexedDB,IDBKeyRange:Gn.IDBKeyRange||Gn.webkitIDBKeyRange}}catch(r){_o={indexedDB:null,IDBKeyRange:null}}var Do=Co;R(Do,l(c({},Er),{delete:function(t){return new Do(t,{addons:[]}).delete()},exists:function(t){return new Do(t,{addons:[]}).open().then((function(t){return t.close(),!0})).catch("NoSuchDatabaseError",(function(){return!1}))},getDatabaseNames:function(t){try{return function(t){var e=t.indexedDB,n=t.IDBKeyRange;return Oe(e)?Promise.resolve(e.databases()).then((function(t){return t.map((function(t){return t.name})).filter((function(t){return"__dbnames"!==t}))})):we(e,n).toCollection().primaryKeys()}(Do.dependencies).then(t)}catch(t){return eo(new Or.MissingAPI)}},defineClass:function(){return function(t){D(this,t)}},ignoreTransaction:function(t){return zr.trans?Ct(zr.transless,t):t()},vip:Se,async:function(t){return function(){try{var e=xe(t.apply(this,arguments));return e&&"function"==typeof e.then?e:lt.resolve(e)}catch(t){return eo(t)}}},spawn:function(t,e,n){try{var r=xe(t.apply(n,e||[]));return r&&"function"==typeof r.then?r:lt.resolve(r)}catch(t){return eo(t)}},currentTransaction:{get:function(){return zr.trans||null}},waitFor:function(t,e){var n=lt.resolve("function"==typeof t?Do.ignoreTransaction(t):t).timeout(e||6e4);return zr.trans?zr.trans.waitFor(n):n},Promise:lt,debug:{get:function(){return pr},set:function(t){J(t,"dexie"===t?function(){return!0}:co)}},derive:U,extend:D,props:R,override:F,Events:Ut,on:go,liveQuery:function(t){return new Mo((function(e){var n=function(){return Kn(a).some((function(t){return i[t]&&function(t,e){var n=Te(e),r=n.next();if(r.done)return!1;for(var o=r.value,i=Te(t),a=i.next(o.from),u=a.value;!r.done&&!a.done;){if(po(u.from,o.to)<=0&&po(u.to,o.from)>=0)return!0;po(o.from,u.from)<0?o=(r=n.next(u.from)).value:u=(a=i.next(o.from)).value}return!1}(i[t],a[t])}))},r=fr(t),o=!1,i={},a={},u={get closed(){return o},unsubscribe:function(){o=!0,go.storagemutated.unsubscribe(l)}};e.start&&e.start(u);var s=!1,c=!1,l=function(t){Me(i,t),n()&&f()},f=function(){if(!s&&!o){i={};var p={},h=function(e){r&&xt();var n=function(){return Et(t,{subscr:e,trans:null})},o=zr.trans?Ct(zr.transless,n):n();return r&&o.then(Pt,Pt),o}(p);c||(go("storagemutated",l),c=!0),s=!0,Promise.resolve(h).then((function(t){s=!1,o||(n()?f():(i={},a=p,e.next&&e.next(t)))}),(function(t){s=!1,e.error&&e.error(t),u.unsubscribe()}))}};return f(),u}))},extendObservabilitySet:Me,getByKeyPath:tr,setByKeyPath:er,delByKeyPath:function(t,e){"string"==typeof e?er(t,e,void 0):"length"in e&&[].map.call(e,(function(e){er(t,e,void 0)}))},shallowClone:W,deepClone:K,getObjectDiff:xo,cmp:po,asap:z,minKey:-1/0,addons:[],connections:io,errnames:br,dependencies:_o,semVer:"3.2.3",version:"3.2.3".split(".").map((function(t){return parseInt(t)})).reduce((function(t,e,n){return t+e/Math.pow(10,2*n)}))})),Do.maxKey=bo(Do.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(go("storagemutated",(function(t){var e;No||(ao?(e=document.createEvent("CustomEvent")).initCustomEvent("x-storagemutated-1",!0,!0,t):e=new CustomEvent("x-storagemutated-1",{detail:t}),No=!0,dispatchEvent(e),No=!1)})),addEventListener("x-storagemutated-1",(function(t){var e=t.detail;No||De(e)})));var No=!1;if("undefined"!=typeof BroadcastChannel){var Ro=new BroadcastChannel("x-storagemutated-1");"function"==typeof Ro.unref&&Ro.unref(),go("storagemutated",(function(t){No||Ro.postMessage(t)})),Ro.onmessage=function(t){t.data&&De(t.data)}}else if("undefined"!=typeof self&&"undefined"!=typeof navigator){go("storagemutated",(function(t){try{No||("undefined"!=typeof localStorage&&localStorage.setItem("x-storagemutated-1",JSON.stringify({trig:Math.random(),changedParts:t})),"object"==h(self.clients)&&p(self.clients.matchAll({includeUncontrolled:!0})).forEach((function(e){return e.postMessage({type:"x-storagemutated-1",changedParts:t})})))}catch(t){}})),"undefined"!=typeof addEventListener&&addEventListener("storage",(function(t){if("x-storagemutated-1"===t.key){var e=JSON.parse(t.newValue);e&&De(e.changedParts)}}));var Lo=self.document&&navigator.serviceWorker;Lo&&Lo.addEventListener("message",(function(t){var e=t.data;e&&"x-storagemutated-1"===e.type&&De(e.changedParts)}))}lt.rejectionMapper=function(t,e){if(!t||s(t,Q)||s(t,TypeError)||s(t,SyntaxError)||!t.name||!Sr[t.name])return t;var n=new Sr[t.name](e||t.message,t);return"stack"in t&&L(n,"stack",{get:function(){return this.inner.stack}}),n},J(pr,co);var Uo=d(766),Bo=d(685);function Fo(t){return Fo=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Fo(t)}function Vo(t,e){return Vo=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Vo(t,e)}var zo=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Vo(t,e)}(n,t);var e=function(t){var e=function(){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(t){return!1}}();return function(){var n,r=Fo(t);if(e){var o=Fo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(t,e){return!e||"object"!=((n=e)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":void 0===n?"undefined":h(n))&&"function"!=typeof e?Ne(t):e;var n}(this,n)}}(n);function n(){var t;return function(t,e){if(!s(t,e))throw new TypeError("Cannot call a class as a function")}(this,n),Re(Ne(t=e.call(this,"EsmOffline")),"syncQueue",void 0),Re(Ne(t),"dynamicOfflineData",void 0),t.version(4).stores({syncQueue:"++id,userId,type,[userId+type]",dynamicOfflineData:"++id,type,identifier,*users,&[type+identifier]"}),t.syncQueue=t.table("syncQueue"),t.dynamicOfflineData=t.table("dynamicOfflineData"),t}return n}(Co),Ho=new zo,Wo={},Go=(0,Bo.createGlobalStore)("offline-synchronization",{});function Ko(){return Ko=Fe((function(){var t,e,n,r,o,i,a,u,s,c,l,f,p;return We(this,(function(h){switch(h.label){case 0:return Go.getState().synchronization?[2]:[4,Ho.syncQueue.count()];case 1:t=h.sent(),e={},n=Object.entries(Wo),r=n.length,o={},i=new AbortController,a=function(){var t,e,n=Go.getState().synchronization;Go.setState({synchronization:(t=ze({},n),e={pendingCount:n.pendingCount-1},e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e.push.apply(e,n)}return e}(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t)})},h.label=2;case 2:h.trys.push([2,,10,11]),Go.setState({synchronization:{totalCount:t,pendingCount:t,abortController:i}}),u=0,h.label=3;case 3:if(!(u<r&&n.length>0))return[3,8];s=n.length,h.label=4;case 4:return s--?(c=He(n[s],2),l=c[0],f=c[1],(p=f.dependsOn.map((function(t){return e[t]}))).every(Boolean)?(o[l]={},[4,Promise.all(p)]):[3,6]):[3,7];case 5:h.sent(),e[l]=function(t,e,n,r){return $o.apply(this,arguments)}(f,o,i,a),n.splice(s,1),h.label=6;case 6:return[3,4];case 7:return u++,[3,3];case 8:return[4,Promise.allSettled(Object.values(e))];case 9:return h.sent(),[3,11];case 10:return Go.setState({synchronization:void 0}),[7];case 11:return[2]}}))})),Ko.apply(this,arguments)}function $o(){return $o=Fe((function(t,e,n,r){var o,i,a,u,s,c,l,f,p,h,d,v,y,g,m,b,w;return We(this,(function(O){switch(O.label){case 0:return o=t.type,i=t.dependsOn,a=t.process,u=[],s=[],[4,$e()];case 1:return c=O.sent(),[4,Ho.syncQueue.where({type:o,userId:c}).each((function(t,e){u.push([e.primaryKey,t.content,t.descriptor]),s.push(t.content)}))];case 2:O.sent(),l=0,O.label=3;case 3:if(!(l<u.length))return[3,11];f=He(u[l],3),p=f[0],h=f[1],d=f[2],v=d.id,y=d.dependencies,g=void 0===y?[]:y,O.label=4;case 4:return O.trys.push([4,7,9,10]),[4,a(h,{abort:n,index:l,items:s,userId:c,dependencies:g.map((function(t){var n=t.id,r=t.type;return i.includes(r)?e[r][n]:void 0}))})];case 5:return m=O.sent(),void 0!==v&&(e[o][v]=m),[4,Ho.syncQueue.delete(p)];case 6:return O.sent(),[3,10];case 7:return b=O.sent(),[4,Ho.syncQueue.update(p,{lastError:{name:null==b?void 0:b.name,message:null!==(w=null==b?void 0:b.message)&&void 0!==w?w:null==b?void 0:b.toString()}})];case 8:return O.sent(),[3,10];case 9:return r(),[7];case 10:return l++,[3,3];case 11:return[2]}}))})),$o.apply(this,arguments)}function qo(){return(qo=Fe((function(){var t;return We(this,(function(e){switch(e.label){case 0:return[4,(0,Uo.getLoggedInUser)()];case 1:return[2,(null==(t=e.sent())?void 0:t.uuid)||"*"]}}))}))).apply(this,arguments)}function Jo(){return(Jo=Fe((function(t,e,n,r){var o;return We(this,(function(i){switch(i.label){case 0:return void 0===(o=r&&r.id)?[3,2]:[4,Ho.syncQueue.where({type:e,userId:t}).filter((function(t){return(null==t?void 0:t.descriptor.id)===o})).delete().catch(Co.errnames.DatabaseClosed)];case 1:i.sent(),i.label=2;case 2:return[4,Ho.syncQueue.add({type:e,content:n,userId:t,descriptor:r||{},createdOn:new Date}).catch(Co.errnames.DatabaseClosed,(function(){return-1}))];case 3:return[2,i.sent()]}}))}))).apply(this,arguments)}function Yo(){return(Yo=Fe((function(t,e,n){return We(this,(function(r){switch(r.label){case 0:return[4,$e()];case 1:return[4,qe(r.sent(),t,e,n)];case 2:return[2,r.sent()]}}))}))).apply(this,arguments)}function Qo(){return(Qo=Fe((function(t,e){return We(this,(function(n){switch(n.label){case 0:return[4,Qe(t,e)];case 1:return[2,n.sent().map((function(t){return t.content}))]}}))}))).apply(this,arguments)}function Xo(){return(Xo=Fe((function(t,e){var n;return We(this,(function(r){switch(r.label){case 0:return n=e?{type:e,userId:t}:{userId:t},[4,Ho.syncQueue.where(n).toArray().catch(Co.errnames.DatabaseClosed,(function(){return[]}))];case 1:return[2,r.sent()]}}))}))).apply(this,arguments)}function Zo(){return(Zo=Fe((function(t){return We(this,(function(e){switch(e.label){case 0:return[4,$e()];case 1:return[4,Ye(e.sent(),t)];case 2:return[2,e.sent()]}}))}))).apply(this,arguments)}function ti(){return(ti=Fe((function(t){return We(this,(function(e){switch(e.label){case 0:return[4,$e()];case 1:return[4,Qe(e.sent(),t)];case 2:return[2,e.sent()]}}))}))).apply(this,arguments)}function ei(){return(ei=Fe((function(t){return We(this,(function(e){switch(e.label){case 0:return[4,Ho.syncQueue.get(t).catch(Co.errnames.DatabaseClosed,(function(){}))];case 1:return[2,e.sent()]}}))}))).apply(this,arguments)}function ni(){return(ni=Fe((function(t){var e,n,r;return We(this,(function(o){switch(o.label){case 0:return[4,tn(t)];case 1:if(!(n=o.sent()))throw new Error("No sync item with the ID ".concat(t," exists."));if(!(r=null===(e=Wo[n.type])||void 0===e?void 0:e.options.onBeginEditSyncItem))throw new Error("A sync item with the ID ".concat(t,' exists, but the associated handler (if one exists) doesn\'t support editing the item. You can avoid this error by either verifying that sync items of this type can be edited via the "canEditSynchronizationItemsOfType(type: string)" function or alternatively ensure that the synchronizaton handler for sync items of type "').concat(n.type,'" supports editing items.'));return r(n),[2]}}))}))).apply(this,arguments)}function ri(){return(ri=Fe((function(t){return We(this,(function(e){switch(e.label){case 0:return[4,Ho.syncQueue.delete(t).catch(Co.errnames.DatabaseClosed)];case 1:return e.sent(),[2]}}))}))).apply(this,arguments)}for(var oi,ii={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},ai=new Uint8Array(16),ui=[],si=0;si<256;++si)ui.push((si+256).toString(16).slice(1));var ci=function(t,e,n){if(ii.randomUUID&&!e&&!t)return ii.randomUUID();var r=(t=t||{}).random||(t.rng||an)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(var o=0;o<16;++o)e[n+o]=r[o];return e}return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(ui[t[e+0]]+ui[t[e+1]]+ui[t[e+2]]+ui[t[e+3]]+"-"+ui[t[e+4]]+ui[t[e+5]]+"-"+ui[t[e+6]]+ui[t[e+7]]+"-"+ui[t[e+8]]+ui[t[e+9]]+"-"+ui[t[e+10]]+ui[t[e+11]]+ui[t[e+12]]+ui[t[e+13]]+ui[t[e+14]]+ui[t[e+15]]).toLowerCase()}(r)},li="OFFLINE+",fi={};function pi(){return(pi=fn((function(t){return pn(this,(function(e){switch(e.label){case 0:return[4,En()];case 1:return[4,yn(e.sent(),t)];case 2:return[2,e.sent()]}}))}))).apply(this,arguments)}function hi(){return(hi=fn((function(t,e){var n;return pn(this,(function(r){switch(r.label){case 0:return n=e?{type:e,users:t}:{users:t},[4,(new zo).dynamicOfflineData.where(n).toArray().catch(Co.errnames.DatabaseClosed,(function(){return[]}))];case 1:return[2,r.sent()]}}))}))).apply(this,arguments)}function di(){return(di=fn((function(t,e){return pn(this,(function(n){switch(n.label){case 0:return[4,En()];case 1:return[4,mn(n.sent(),t,e)];case 2:return[2,n.sent()]}}))}))).apply(this,arguments)}function vi(){return vi=fn((function(t,e,n){var r,o;return pn(this,(function(i){switch(i.label){case 0:return[4,(r=new zo).dynamicOfflineData.get({type:e,identifier:n}).catch(Co.errnames.DatabaseClosed,(function(){}))];case 1:return(o=i.sent())?[3,3]:[4,r.dynamicOfflineData.add({users:[t],type:e,identifier:n}).catch(Co.errnames.DatabaseClosed)];case 2:return i.sent(),[3,5];case 3:return o.users.includes(t)?[3,5]:[4,r.dynamicOfflineData.update(o.id,{users:(a=o.users,function(t){if(Array.isArray(t))return cn(t)}(a)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(a)||function(t,e){if(t){if("string"==typeof t)return cn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cn(t,e):void 0}}(a)||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.")}()).concat([t])}).catch(Co.errnames.DatabaseClosed)];case 4:i.sent(),i.label=5;case 5:return[2]}var a}))})),vi.apply(this,arguments)}function yi(){return(yi=fn((function(t,e){return pn(this,(function(n){switch(n.label){case 0:return[4,En()];case 1:return[4,wn(n.sent(),t,e)];case 2:return[2,n.sent()]}}))}))).apply(this,arguments)}function gi(){return gi=fn((function(t,e,n){var r,o;return pn(this,(function(i){switch(i.label){case 0:return[4,(r=new zo).dynamicOfflineData.get({type:e,identifier:n,users:t}).catch(Co.errnames.DatabaseClosed,(function(){}))];case 1:return(o=i.sent())?o.users.length>1?[4,r.dynamicOfflineData.update(o.id,{users:o.users.filter((function(e){return e!==t}))}).catch(Co.errnames.DatabaseClosed)]:[3,3]:[3,5];case 2:return i.sent(),[3,5];case 3:return[4,r.dynamicOfflineData.delete(o.id).catch(Co.errnames.DatabaseClosed)];case 4:i.sent(),i.label=5;case 5:return[2]}}))})),gi.apply(this,arguments)}function mi(){return mi=fn((function(t,e){var n;return pn(this,(function(r){switch(r.label){case 0:return[4,vn(t)];case 1:return n=r.sent(),[4,Promise.all(n.map((o=fn((function(t){return pn(this,(function(n){return[2,Sn(t.type,t.identifier,e)]}))})),function(t){return o.apply(this,arguments)})))];case 2:return r.sent(),[2]}var o}))})),mi.apply(this,arguments)}function bi(){return bi=fn((function(t,e,n){var r,o,i,a,u,s,c,l,f;return pn(this,(function(p){switch(p.label){case 0:return[4,gn(t,e)];case 1:return p.sent(),r=new zo,[4,En()];case 2:return o=p.sent(),[4,r.dynamicOfflineData.get({type:t,identifier:e}).catch(Co.errnames.DatabaseClosed,(function(){}))];case 3:return i=p.sent(),a=hn().filter((function(e){return e.type===t})),i?[4,Promise.all(a.map((h=fn((function(t){var r,o,i;return pn(this,(function(a){try{return t.sync(e,n),[2,{id:t.id,error:void 0}]}catch(e){return i=null!==(o=null===(r=e.message)||void 0===r?void 0:r.toString())&&void 0!==o?o:e.toString(),[2,{id:t.id,error:i}]}return[2]}))})),function(t){return h.apply(this,arguments)})))]:[2];case 4:return u=p.sent(),s=u.filter((function(t){return!t.error})).map((function(t){return t.id})),c=u.filter((function(t){return t.error})).map((function(t){return t.id})),l=u.filter((function(t){return t.error})).map((function(t){return{handlerId:t.id,message:t.error}})),f={syncedOn:new Date,syncedBy:o,succeededHandlers:s,erroredHandlers:c,errors:l},i.id?[4,r.dynamicOfflineData.update(i.id,{syncState:f}).catch(Co.errnames.DatabaseClosed)]:[3,6];case 5:p.sent(),p.label=6;case 6:return[2]}var h}))})),bi.apply(this,arguments)}function wi(){return(wi=fn((function(){var t;return pn(this,(function(e){switch(e.label){case 0:return[4,(0,Uo.getLoggedInUser)()];case 1:if(!(t=e.sent().uuid))throw new Error("Using the dynamic offline data API requires a logged in user.");return[2,t]}}))}))).apply(this,arguments)}var Oi=(0,Bo.createGlobalStore)("offline-patients",{offlinePatientDataSyncState:{},handlers:{}});function Si(){return Si=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){xn(i,r,o,a,u,"next",t)}function u(t){xn(i,r,o,a,u,"throw",t)}a(void 0)}))}}((function(t){return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(e){switch(e.label){case 0:return An(),[4,Sn("patient",t)];case 1:return e.sent(),[2]}}))})),Si.apply(this,arguments)}}(),v}())}}}))},973:(t,e,n)=>{function r(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}function o(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}t=n.nmd(t),System.register(["react","@openmrs/esm-navigation","@openmrs/esm-extensions","@openmrs/esm-globals","@openmrs/esm-utils","@openmrs/esm-feature-flags","@openmrs/esm-api","react-dom","react-i18next","swr","@openmrs/esm-context","@openmrs/esm-config","dayjs"],(function(i,a){var u={},s={},c={},l={},f={},p={},h={},d={},v={},y={},g={},m={},b={};return Object.defineProperty(d,"__esModule",{value:!0}),{setters:[function(t){u.Suspense=t.Suspense,u.default=t.default,u.useCallback=t.useCallback,u.useContext=t.useContext,u.useEffect=t.useEffect,u.useMemo=t.useMemo,u.useReducer=t.useReducer,u.useRef=t.useRef,u.useState=t.useState},function(t){s.interpolateUrl=t.interpolateUrl,s.navigate=t.navigate},function(t){c.getConnectedExtensions=t.getConnectedExtensions,c.getExtensionInternalStore=t.getExtensionInternalStore,c.getExtensionStore=t.getExtensionStore,c.registerExtensionSlot=t.registerExtensionSlot,c.renderExtension=t.renderExtension},function(t){l.subscribeConnectivityChanged=t.subscribeConnectivityChanged},function(t){f.isOnline=t.isOnline,f.shallowEqual=t.shallowEqual},function(t){p.featureFlagsStore=t.featureFlagsStore},function(t){h.attachmentUrl=t.attachmentUrl,h.defaultVisitCustomRepresentation=t.defaultVisitCustomRepresentation,h.fetchCurrentPatient=t.fetchCurrentPatient,h.getCurrentUser=t.getCurrentUser,h.getLocations=t.getLocations,h.getSessionStore=t.getSessionStore,h.getVisitStore=t.getVisitStore,h.getVisitTypes=t.getVisitTypes,h.openmrsFetch=t.openmrsFetch,h.restBaseUrl=t.restBaseUrl,h.userHasAccess=t.userHasAccess},function(t){Object.keys(t).forEach((function(e){d[e]=t[e]}))},function(t){v.I18nextProvider=t.I18nextProvider},function(t){y.SWRConfig=t.SWRConfig,y.default=t.default},function(t){g.registerContext=t.registerContext,g.subscribeToContext=t.subscribeToContext,g.unregisterContext=t.unregisterContext,g.updateContext=t.updateContext},function(t){m.getConfigStore=t.getConfigStore,m.getExtensionConfigFromStore=t.getExtensionConfigFromStore,m.getExtensionsConfigStore=t.getExtensionsConfigStore},function(t){b.default=t.default}],execute:function(){i(function(){var i={332:function(t){t.exports=function(){"use strict";return function(t,e,n){e.prototype.isToday=function(){var t="YYYY-MM-DD",e=n();return this.format(t)===e.format(t)}}}()},645:function(t,e,n){"use strict";var r=n(493);e.createRoot=r.createRoot,e.hydrateRoot=r.hydrateRoot},385:function(){System.register([],(function(t,e){return{execute:function(){t(function(){"use strict";var t=function(t,e){var n=c[t];if(n)return n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value.setState(e,!0),n.active=!0,n.value;var r=s()((function(){return e}));return c[t]={value:r,active:!0},r},e=function(t,e){var n=c[t];return n?(n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value=e,n.active=!0,n.value):(c[t]={value:e,active:!0},e)},n=function(t,e){var n=c[t];if(!n){var r=s()((function(){return null!=e?e:{}}));return c[t]={value:r,active:!1},r}return n.value},r=function(t,e,n){var r=e(t.getState());return t.subscribe((function(t){var o=e(t);o!==r&&(r=o,n(o))}))},i={d:function(t,e){for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},a={};i.r(a),i.d(a,{createGlobalStore:function(){return t},getGlobalStore:function(){return n},registerGlobalStore:function(){return e},subscribeTo:function(){return r}});var u=function(t){var e,n=new Set,r=function(t,r){var i="function"==typeof t?t(e):t;if(!Object.is(i,e)){var a=e;e=(null!=r?r:"object"!=(void 0===i?"undefined":o(i)))?i:Object.assign({},e,i),n.forEach((function(t){return t(e,a)}))}},i=function(){return e},a={setState:r,getState:i,subscribe:function(t){return n.add(t),function(){return n.delete(t)}},destroy:function(){console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return e=t(r,i,a),a},s=function(t){return t?u(t):u},c={};return setTimeout((function(){"development"===window.spaEnv&&(window.stores=c)}),1e3),a}())}}}))},766:function(t){"use strict";t.exports=h},824:function(t){"use strict";t.exports=m},743:function(t){"use strict";t.exports=g},45:function(t){"use strict";t.exports=c},708:function(t){"use strict";t.exports=p},728:function(t){"use strict";t.exports=l},513:function(t){"use strict";t.exports=s},618:function(t){"use strict";t.exports=f},688:function(t){"use strict";t.exports=b},954:function(t){"use strict";t.exports=u},493:function(t){"use strict";t.exports=d},281:function(t){"use strict";t.exports=v},725:function(t){"use strict";t.exports=y}},a={};function w(t){var e=a[t];if(void 0!==e)return e.exports;var n=a[t]={exports:{}};return i[t].call(n.exports,n,n.exports,w),n.exports}w.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return w.d(e,{a:e}),e},w.d=function(t,e){for(var n in e)w.o(e,n)&&!w.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},w.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},w.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var O={};return function(){"use strict";var i=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},a=function(t){var e=t.to,n=t.templateParams,r=t.onBeforeNavigate,o=t.children,a=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,["to","templateParams","onBeforeNavigate","children"]);return(0,Wt.useEffect)((function(){a.href&&console.warn("ConfigurableLink does not support the href prop. Use the 'to' prop instead. The provided href value is '".concat(a.href,"'")),a.onClick&&console.warn("ConfigurableLink does not support the onClick prop. Use the 'onBeforeNavigate' prop instead. The 'to' prop of the offending link is ".concat(e))}),[]),Wt.default.createElement("a",function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){i(t,e,n[e])}))}return t}({onClick:function(t){return function(t,e,n,r){0!==t.button||t.ctrlKey||t.shiftKey||t.altKey||t.metaKey||(t.preventDefault(),null==r||r(t),(0,Kt.navigate)({to:e,templateParams:n})),0===t.button&&(t.ctrlKey||t.metaKey)&&(null==r||r(t)),0===t.button&&t.shiftKey&&(null==r||r(t)),1===t.button&&(null==r||r(t))}(t,e,n,r)},href:(0,Kt.interpolateUrl)(e,n)},a),o)},u=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},s=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},c=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){s(t,e,n[e])}))}return t},l=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},f=function(){var t,e=function(t){if(Array.isArray(t))return t}(t=(0,Wt.useState)((0,Yt.isOnline)()))||function(t){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,r,o=[],i=!0,a=!1;try{for(e=e.call(t);!(i=(n=e.next()).done)&&(o.push(n.value),2!==o.length);i=!0);}catch(t){a=!0,r=t}finally{try{i||null==e.return||e.return()}finally{if(a)throw r}}return o}}(t)||function(t){if(t){if("string"==typeof t)return l(t,2);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(e):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?l(t,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=e[0],r=e[1];return(0,Wt.useEffect)((function(){return(0,Jt.subscribeConnectivityChanged)((function(t){var e=t.online;return r(e)}))}),[]),n},p=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},h=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},d=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){h(t,e,n[e])}))}return t},v=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t,e)||g(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},y=function(t){return function(t){if(Array.isArray(t))return p(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||g(t)||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.")}()},g=function(t,e){if(t){if("string"==typeof t)return p(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(t,e):void 0}},m=function(t,e){var n=function(n){r[n]=function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];t.setState((function(t){var r,i=[t].concat(y(o));return(r=e)[n].apply(r,y(i))}))}};"function"==typeof e&&(e=e(t));var r={};for(var o in e)n(o);return r},b=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Xt,n=arguments.length>2?arguments[2]:void 0,r=v((0,Wt.useState)((function(){return e(t.getState())})),2),o=r[0],i=r[1];return(0,Wt.useEffect)((function(){return(0,Qt.subscribeTo)(t,e,i)}),[t,e]),d({},o,(0,Wt.useMemo)((function(){return n?m(t,n):{}}),[t,n]))},S=function(t,e){return b(t,Xt,e)},E=function(t){return function(e){var n=v((0,Wt.useState)(t.getState()),2),r=n[0],o=n[1];return(0,Wt.useEffect)((function(){return t.subscribe((function(t){return o(t)}))}),[]),d({},r,(0,Wt.useMemo)((function(){return e?m(t,e):{}}),[e]))}},x=function(t){var e=Zt().slots;return(0,Wt.useMemo)((function(){var n,r;return null!==(r=null===(n=e[t])||void 0===n?void 0:n.assignedExtensions)&&void 0!==r?r:[]}),[e,t])},P=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},j=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return P(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?P(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},k=function(t){var e=f(),n=x(t),r=b(te.featureFlagsStore),o=(0,Wt.useMemo)((function(){return Object.entries(r.flags).filter((function(t){return j(t,2)[1].enabled})).map((function(t){return j(t,1)[0]}))}),[r.flags]);return(0,Wt.useMemo)((function(){return(0,$t.getConnectedExtensions)(n,e,o)}),[n,e,o])},A=function(t){var e=(0,Wt.useContext)(Gt).moduleName;if(!e)throw Error("ComponentContext has not been provided. This should come from @openmrs/esm-react-utils.");return(0,Wt.useEffect)((function(){(0,$t.registerExtensionSlot)(e,t)}),[]),{extensions:k(t),extensionSlotName:t,extensionSlotModuleName:e}},_=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},T=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){_(t,e,n[e])}))}return t},C=function(t){return t},I=function(t){var e=t.name,n=t.extensionSlotName,r=t.select,o=void 0===r?C:r,i=t.children,a=t.state,u=t.style,s=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,["name","extensionSlotName","select","children","state","style"]);if(i&&a)throw new Error("Both children and state have been provided. If children are provided, the state must be passed as a prop to the `Extension` component.");var c,l,f,p,h=null!=e?e:n,d=(0,Wt.useRef)(null),v=A(h),y=v.extensions,g=v.extensionSlotModuleName,m=(0,Wt.useMemo)((function(){return o(y)}),[o,y]),b=(0,Wt.useMemo)((function(){if("function"==typeof i&&!Wt.default.isValidElement(i))return m.map((function(t){return i(t)}))}),[i,m]);return Wt.default.createElement("div",T({ref:d,"data-extension-slot-name":h,"data-extension-slot-module-name":g,style:(f=T({},u),p={position:"relative"},p=null!=p?p:{},Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(p)):function(t){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e.push.apply(e,n)}return e}(Object(p)).forEach((function(t){Object.defineProperty(f,t,Object.getOwnPropertyDescriptor(p,t))})),f)},s),h&&m.map((function(t,e){return Wt.default.createElement(Gt.Provider,{key:t.id,value:{moduleName:g,featureName:"",extension:{extensionId:t.id,extensionSlotName:h,extensionSlotModuleName:g}}},null!==(l=null!==(c=null==b?void 0:b[e])&&void 0!==c?c:"function"!=typeof i?i:null)&&void 0!==l?l:Wt.default.createElement(qt,{state:a}))})))},M=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},D=function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n},N=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?D(Object(n),!0).forEach((function(e){R(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t},R=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},L=function(t,e){var n;if("function"!=typeof(n=e.domElement?function(){return e.domElement}:e.domElementGetter?e.domElementGetter:t.domElementGetter?t.domElementGetter:function(t){var e=t.appName||t.name;if(!e)throw Error("single-spa's dom-element-getter-helpers was not given an application name as a prop, so it can't make a unique dom element container for the react application");var n="single-spa-application:".concat(e);return function(){var t=document.getElementById(n);return t||((t=document.createElement("div")).id=n,document.body.appendChild(t)),t}}(e)))throw Error("single-spa's dom-element-getter-helpers was given an invalid domElementGetter for application or parcel '".concat(e.name,"'. Expected a function, received ").concat(ie(n)));return function(){var t=n(e);if(!r(t,HTMLElement))throw Error("single-spa's dom-element-getter-helpers: domElementGetter returned an invalid dom element for application or parcel '".concat(e.name,"'. Expected HTMLElement, received ").concat(ie(t)));return t}},U=function(t,e){return t.rootComponent?Promise.resolve():t.loadRootComponent(e).then((function(e){t.rootComponent=e}))},B=function(t,e){return new Promise((function(n,r){t.suppressComponentDidCatchWarning||!function(t){if(!(t&&"string"==typeof t.version&&t.version.indexOf(".")>=0))return!1;var e=t.version.slice(0,t.version.indexOf("."));try{return Number(e)>=16}catch(t){return!1}}(t.React)||t.errorBoundary||t.errorBoundaryClass||(t.rootComponent.prototype?t.rootComponent.prototype.componentDidCatch||console.warn("single-spa-react: ".concat(e.name||e.appName||e.childAppName,"'s rootComponent should implement componentDidCatch to avoid accidentally unmounting the entire single-spa application.")):console.warn("single-spa-react: ".concat(e.name||e.appName||e.childAppName,"'s rootComponent does not implement an error boundary. If using a functional component, consider providing an opts.errorBoundary to singleSpaReact(opts).")));var o=W(t,e,(function(){n(this)})),i=L(t,e)(),a=function(t){var e=t.renderType,n=t.elementToRender,r=t.domElement,o=t.reactDom[e];if("function"!=typeof o)throw new Error('renderType "'.concat(e,'" did not return a function.'));switch(e){case"createRoot":case"unstable_createRoot":case"createBlockingRoot":case"unstable_createBlockingRoot":var i=o(r);return i.render(n),i;case"hydrateRoot":return o(r,n);default:return o(n,r),null}}({elementToRender:o,domElement:i,reactDom:z(t),renderType:H(t)});t.domElements[e.name]=i,t.renderResults[e.name]=a}))},F=function(t,e){return new Promise((function(n){t.unmountResolves[e.name]=n;var r=t.renderResults[e.name];r&&r.unmount?r.unmount():z(t).unmountComponentAtNode(t.domElements[e.name]),delete t.domElements[e.name],delete t.renderResults[e.name]}))},V=function(t,e){return new Promise((function(n){t.updateResolves[e.name]||(t.updateResolves[e.name]=[]),t.updateResolves[e.name].push(n);var r=W(t,e,null),o=t.renderResults[e.name];if(o&&o.render)o.render(r);else{var i=L(t,e)();z(t).render(r,i)}}))},z=function(t){return t.ReactDOMClient||t.ReactDOM},H=function(t){return"function"==typeof t.renderType?t.renderType():t.renderType},W=function(t,e,n){var r=t.React.createElement(t.rootComponent,e),o=ae?t.React.createElement(ae.Provider,{value:e},r):r;return(t.errorBoundary||e.errorBoundary||t.errorBoundaryClass||e.errorBoundaryClass)&&(t.errorBoundaryClass=t.errorBoundaryClass||e.errorBoundaryClass||function(t,e){function n(e){t.React.Component.apply(this,arguments),this.state={caughtError:null,caughtErrorInfo:null},n.displayName="SingleSpaReactErrorBoundary(".concat(e.name,")")}return n.prototype=Object.create(t.React.Component.prototype),n.prototype.render=function(){return this.state.caughtError?(t.errorBoundary||e.errorBoundary)(this.state.caughtError,this.state.caughtErrorInfo,this.props):this.props.children},n.prototype.componentDidCatch=function(t,e){this.setState({caughtError:t,caughtErrorInfo:e})},n}(t,e),o=t.React.createElement(t.errorBoundaryClass,e,o)),t.React.createElement(t.SingleSpaRoot,N(N({},e),{},{mountFinished:n,updateFinished:function(){t.updateResolves[e.name]&&(t.updateResolves[e.name].forEach((function(t){return t()})),delete t.updateResolves[e.name])},unmountFinished:function(){t.unmountResolves[e.name]&&(t.unmountResolves[e.name](),delete t.unmountResolves[e.name])}}),o)},G=function(t){if("object"!=(void 0===t?"undefined":o(t))||"string"!=typeof t.featureName||"string"!=typeof t.moduleName)throw new Error("Invalid options");var e=Object.assign({},pe,t);return function(t){var n,i,a,u;return i=n=function(n){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&fe(t,e)}(u,n);var i,a=function(t){var e=function(){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(t){return!1}}();return function(){var n,r=le(t);if(e){var i=le(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(t,e){return!e||"object"!=((n=e)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":void 0===n?"undefined":o(n))&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e;var n}(this,n)}}(u);function u(t){var n;return function(t,e){if(!r(t,e))throw new TypeError("Cannot call a class as a function")}(this,u),(n=a.call(this,t)).state={caughtError:null,caughtErrorInfo:null,config:{moduleName:e.moduleName,featureName:e.featureName,extension:t._extensionContext}},n}return(i=[{key:"componentDidCatch",value:function(t,n){n&&n.componentStack&&(t.extra=Object.assign(t.extra||{},{componentStack:n.componentStack})),e.throwErrorsToConsole&&setTimeout((function(){throw t})),this.setState({caughtError:t,caughtErrorInfo:n})}},{key:"render",value:function(){if(this.state.caughtError)return Wt.default.createElement("div",null,"An error has occurred. Please try reloading the page.");var n=Wt.default.createElement(Wt.Suspense,{fallback:null},Wt.default.createElement(ce.SWRConfig,{value:he},Wt.default.createElement(Gt.Provider,{value:this.state.config},e.disableTranslations?Wt.default.createElement(t,this.props):Wt.default.createElement(se.I18nextProvider,{i18n:window.i18next,defaultNS:e.moduleName},Wt.default.createElement(t,this.props)))));return e.strictMode||!Wt.default.StrictMode?n:Wt.default.createElement(Wt.default.StrictMode,null,n)}}])&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(u.prototype,i),u}(Wt.default.Component),a="displayName",u="OpenmrsReactComponent(".concat(e.featureName,")"),a in i?Object.defineProperty(i,a,{value:u,enumerable:!0,configurable:!0,writable:!0}):i[a]=u,n}},K=function(t,e){return function(t){if("object"!==oe(t))throw new Error("single-spa-react requires a configuration object");var e,n=N(N({},ue),t);if(!n.React)throw new Error("single-spa-react must be passed opts.React");if(!n.ReactDOM&&!n.ReactDOMClient)throw new Error("single-spa-react must be passed opts.ReactDOM or opts.ReactDOMClient");if(n.renderType||(null!==(e=n.ReactDOMClient)&&void 0!==e&&e.createRoot?n.renderType="createRoot":n.renderType="render"),!n.rootComponent&&!n.loadRootComponent)throw new Error("single-spa-react must be passed opts.rootComponent or opts.loadRootComponent");if(n.errorBoundary&&"function"!=typeof n.errorBoundary)throw Error("The errorBoundary opt for single-spa-react must either be omitted or be a function that returns React elements");!ae&&n.React.createContext&&(ae=n.React.createContext()),n.SingleSpaRoot=function(t){function e(t){e.displayName="SingleSpaRoot(".concat(t.name,")")}return e.prototype=Object.create(t.React.Component.prototype),e.prototype.componentDidMount=function(){setTimeout(this.props.mountFinished)},e.prototype.componentWillUnmount=function(){setTimeout(this.props.unmountFinished)},e.prototype.render=function(){return setTimeout(this.props.updateFinished),this.props.children},e}(n);var r={bootstrap:U.bind(null,n),mount:B.bind(null,n),unmount:F.bind(null,n)};return n.parcelCanUpdate&&(r.update=V.bind(null,n)),r}({React:Wt.default,ReactDOMClient:re,rootComponent:G(e)(t)})},$=function(t,e){return function(){return t().then((function(t){return K(t.default,e)}))}},q=function(t,e){return function(){return Promise.resolve(K(t,e))}},J=function(t,e){var n=(0,Wt.useRef)(null!=e?e:{}),r=(0,Wt.useRef)((function(e){return(0,ve.updateContext)(t,e)}));return(0,Wt.useEffect)((function(){return(0,ve.registerContext)(t,null!=e?e:{}),function(){(0,ve.unregisterContext)(t)}}),[t]),(0,Wt.useEffect)((function(){var r=null!=e?e:{};(0,Yt.shallowEqual)(n.current,r)||((0,ve.updateContext)(t,(function(){return r})),n.current=r)}),[e]),r.current},Y=function(t){return J(t.namespace,t.value),null},Q=function(){var t=(0,Wt.useRef)();return t.current&&!t.current.signal.aborted||(t.current=new AbortController),(0,Wt.useEffect)((function(){var e=t.current;return function(){return null==e?void 0:e.abort()}}),[]),t.current},X=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},Z=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(t){return null!=t?t:{}},r=function(t){if(Array.isArray(t))return t}(e=(0,Wt.useState)())||function(t){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,r,o=[],i=!0,a=!1;try{for(e=e.call(t);!(i=(n=e.next()).done)&&(o.push(n.value),2!==o.length);i=!0);}catch(t){a=!0,r=t}finally{try{i||null==e.return||e.return()}finally{if(a)throw r}}return o}}(e)||function(t){if(t){if("string"==typeof t)return X(t,2);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(e):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?X(t,2):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=r[0],i=r[1];return(0,Wt.useEffect)((function(){if(null==t||""===t.replace(" ",""))throw new Error('The namespace supplied to useAppContext must be a non-empty string, but was "'.concat(t,'".'))}),[t]),(0,Wt.useEffect)((function(){return(0,ve.subscribeToContext)(t,(function(t){if(void 0!==t){var e=n?n(t):null!=t?t:{};(0,Yt.shallowEqual)(o,e)||i(e)}}))}),[]),o},tt=function(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}},et=function(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}},nt=function(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}},rt=function(t){var e=this.__data__=new Oe(t);this.size=e.size},ot=function(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Xe;++e<n;)this.add(t[e])},it=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},at=function(t){var e,n=function(t){if(Array.isArray(t))return t}(e=(0,Wt.useState)([]))||function(t){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,r,o=[],i=!0,a=!1;try{for(e=e.call(t);!(i=(n=e.next()).done)&&(o.push(n.value),2!==o.length);i=!0);}catch(t){a=!0,r=t}finally{try{i||null==e.return||e.return()}finally{if(a)throw r}}return o}}(e)||function(t){if(t){if("string"==typeof t)return it(t,2);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(e):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?it(t,2):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=n[0],o=n[1];return(0,Wt.useEffect)((function(){return(0,$t.getExtensionStore)().subscribe((function(e){var n,i,a=null!==(i=null===(n=e.slots[t])||void 0===n?void 0:n.assignedExtensions.map((function(t){return t.id})))&&void 0!==i?i:[];lr(a,r)||o(a)}))}),[]),r},ut=function(t,e){var n,r=(0,ce.default)("".concat(ee.attachmentUrl,"?patient=").concat(t,"&includeEncounterless=").concat(e),ee.openmrsFetch),o=r.data,i=r.error,a=r.mutate,u=r.isLoading,s=r.isValidating;return(0,Wt.useMemo)((function(){return{isLoading:u,data:null!==(n=null==o?void 0:o.data.results)&&void 0!==n?n:[],error:i,mutate:a,isValidating:s}}),[o,i,u,s,a])},st=function(t){(0,Wt.useEffect)((function(){if(t){var e=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",function(){document.body.style.overflow=e}}}),[t])},ct=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},lt=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},ft=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){lt(t,e,n[e])}))}return t},pt=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return ct(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ct(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},ht=function(t){var e,n=(0,Wt.useContext)(Gt),r=n.moduleName,o=n.extension,i=null!==(e=null==t?void 0:t.externalModuleName)&&void 0!==e?e:r;if(!i&&!o)throw Error(hr);var a=function(t){var e=(0,Wt.useMemo)((function(){return(0,fr.getConfigStore)(t)}),[t]),n=t,r=function(t){var e=pt((0,Wt.useState)(function(t){return function(){var e=t.getState();return e.loaded&&e.config?e.config:null}}(t)),2),n=e[0],r=e[1];return(0,Wt.useEffect)((function(){return null==t?void 0:t.subscribe((function(t){t.loaded&&t.config&&r(t.config)}))}),[t]),n}(e);if(!r)throw pr[n]||(pr[n]=function(t){return new Promise((function(e){var n=t.subscribe((function(t){t.loaded&&t.config&&(e(t.config),n())}))}))}(e)),pr[n];return r}(i),u=function(t){var e=(0,Wt.useMemo)(fr.getExtensionsConfigStore,[]),n=function(t,e){var n=pt((0,Wt.useState)(function(t,e){return e?function(){var n=t.getState(),r=(0,fr.getExtensionConfigFromStore)(n,e.extensionSlotName,e.extensionId);if(r.loaded&&r.config)return r.config}:null}(t,e)),2),r=n[0],o=n[1];return(0,Wt.useEffect)((function(){if(e)return t.subscribe((function(t){var n=(0,fr.getExtensionConfigFromStore)(t,e.extensionSlotName,e.extensionId);n.loaded&&n.config&&!lr(n.config,r)&&o(n.config)}))}),[t,e,r]),r}(e,t);if(!n&&t){var r="".concat(t.extensionSlotName,"-").concat(t.extensionId);throw!pr[r]&&e&&(pr[r]=function(t,e){return new Promise((function(n){var r=t.subscribe((function(t){var o=(0,fr.getExtensionConfigFromStore)(t,e.extensionSlotName,e.extensionId);o.loaded&&o.config&&(n(o.config),r())}))}))}(e,t)),pr[r]}return n||{}}(o);return(0,Wt.useMemo)((function(){return(null==t?void 0:t.externalModuleName)&&i===t.externalModuleName?ft({},a):ft({},a,u)}),[i,null==t?void 0:t.externalModuleName,a,u])},dt=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},vt=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300,r=function(t){if(Array.isArray(t))return t}(e=(0,Wt.useState)(t))||function(t){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,r,o=[],i=!0,a=!1;try{for(e=e.call(t);!(i=(n=e.next()).done)&&(o.push(n.value),2!==o.length);i=!0);}catch(t){a=!0,r=t}finally{try{i||null==e.return||e.return()}finally{if(a)throw r}}return o}}(e)||function(t){if(t){if("string"==typeof t)return dt(t,2);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(e):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?dt(t,2):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=r[0],i=r[1];return(0,Wt.useEffect)((function(){var e=setTimeout((function(){i(t)}),n);return function(){clearTimeout(e)}}),[t,n]),o},yt=function(t){var e=k(t);return(0,Wt.useMemo)((function(){return Object.fromEntries(e.map((function(t){return[t.name,t.meta]})))}),[e])},gt=function(t){var e,n=b(te.featureFlagsStore).flags;return(0,Wt.useEffect)((function(){n[t]||console.error('useFeatureFlag: Attempted to get value of non-existent flag "'.concat(t,'". Did you forget to call registerFeatureFlag?'))}),[n[t]]),null===(e=n[t])||void 0===e?void 0:e.enabled},mt=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},bt=function(){var t,e=(t=(0,Wt.useState)(0),function(t){if(Array.isArray(t))return t}(t)||function(t){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,r,o=[],i=!0,a=!1;try{for(e=e.call(t);!(i=(n=e.next()).done)&&(o.push(n.value),2!==o.length);i=!0);}catch(t){a=!0,r=t}finally{try{i||null==e.return||e.return()}finally{if(a)throw r}}return o}}(t)||function(t){if(t){if("string"==typeof t)return mt(t,2);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(e):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?mt(t,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[1];return(0,Wt.useCallback)((function(){e((function(t){return t+1}))}),[])},wt=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},Ot=function(){var t="tablet";return document.body.classList.forEach((function(e){switch(e){case"omrs-breakpoint-lt-tablet":t="phone";break;case"omrs-breakpoint-gt-small-desktop":t="large-desktop";break;case"omrs-breakpoint-gt-tablet":t="small-desktop"}})),t},St=function(){var t,e=function(t){if(Array.isArray(t))return t}(t=(0,Wt.useState)(Ot))||function(t){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,r,o=[],i=!0,a=!1;try{for(e=e.call(t);!(i=(n=e.next()).done)&&(o.push(n.value),2!==o.length);i=!0);}catch(t){a=!0,r=t}finally{try{i||null==e.return||e.return()}finally{if(a)throw r}}return o}}(t)||function(t){if(t){if("string"==typeof t)return wt(t,2);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(e):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?wt(t,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=e[0],r=e[1];return(0,Wt.useEffect)((function(){var t=function(){r(Ot())};return window.addEventListener("resize",t),function(){return window.removeEventListener("resize",t)}}),[]),n},Et=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},xt=function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=function(t){if(Array.isArray(t))return t}(t=(0,Wt.useState)([]))||function(t){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,r,o=[],i=!0,a=!1;try{for(e=e.call(t);!(i=(n=e.next()).done)&&(o.push(n.value),2!==o.length);i=!0);}catch(t){a=!0,r=t}finally{try{i||null==e.return||e.return()}finally{if(a)throw r}}return o}}(t)||function(t){if(t){if("string"==typeof t)return Et(t,2);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(e):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Et(t,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=n[0],o=n[1];return(0,Wt.useEffect)((function(){var t=(0,ee.getLocations)(e).subscribe((function(t){o(t)}),(function(t){console.error(t)}));return function(){return t.unsubscribe()}}),[]),r},Pt=function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=(0,Wt.useRef)(null);return(0,Wt.useEffect)((function(){var r=function(r){e&&n.current&&!n.current.contains(r.target)&&t(r)};return window.addEventListener("mousedown",r),window.addEventListener("touchstart",r),function(){window.removeEventListener("mousedown",r),window.removeEventListener("touchstart",r)}}),[t,e]),n},jt=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},kt=function(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.abortController,i=r.fetchInit,a=r.url,u=r.swrConfig,s=ye(),c=(0,Wt.useMemo)((function(){return null!==(n=null!==(e=null==i?void 0:i.signal)&&void 0!==e?e:null==o?void 0:o.signal)&&void 0!==n?n:s.signal}),[null==o?void 0:o.signal,null==i?void 0:i.signal,s.signal]),l=(0,Wt.useCallback)((function(t){var e,n,r=function(t,e){if(e)return"function"==typeof e?e(t):e;if("string"==typeof t)return t;throw new Error("When using useOpenmrsSWR with a key that is not a string, you must provide a url() function that converts the key to a valid url. The key for this hook is ".concat(t,"."))}(t,a);return(0,ee.openmrsFetch)(r,(e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){jt(t,e,n[e])}))}return t}({},i),n=null!=(n={signal:c})?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):function(t){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e.push.apply(e,n)}return e}(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})),e))}),[c,i,a]);return(0,ce.default)(t,l,u)},At=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},_t=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},Tt=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){_t(t,e,n[e])}))}return t},Ct=function(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e.push.apply(e,n)}return e}(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},It=function(){var t=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return t&&t[1]},Mt=function(t,e){switch(e.type){case rr.loadPatient:return Ct(Tt({},t),{patientUuid:e.patientUuid,patient:null,isPendingUuid:!1,isLoadingPatient:!0,err:null});case rr.newPatient:return Ct(Tt({},t),{patient:e.patient,isPendingUuid:!1,isLoadingPatient:!1,err:null});case rr.loadError:return Ct(Tt({},t),{patient:null,isPendingUuid:!1,isLoadingPatient:!1,err:e.err});default:return t}},Dt=function(t){var e,n=function(t){if(Array.isArray(t))return t}(e=(0,Wt.useReducer)(Mt,Ct(Tt({},gr),{patientUuid:null!=t?t:null,isPendingUuid:!t,isLoadingPatient:!!t})))||function(t){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,r,o=[],i=!0,a=!1;try{for(e=e.call(t);!(i=(n=e.next()).done)&&(o.push(n.value),2!==o.length);i=!0);}catch(t){a=!0,r=t}finally{try{i||null==e.return||e.return()}finally{if(a)throw r}}return o}}(e)||function(t){if(t){if("string"==typeof t)return At(t,2);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(e):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?At(t,2):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=n[0],o=n[1];return(0,Wt.useEffect)((function(){if(r.isPendingUuid){var t=It();o(t?{type:rr.loadPatient,patientUuid:t}:{type:rr.newPatient,patient:null})}var e=!0;return r.isLoadingPatient&&r.patientUuid&&(0,ee.fetchCurrentPatient)(r.patientUuid).then((function(t){return e&&o({patient:t,type:rr.newPatient})}),(function(t){return e&&o({err:t,type:rr.loadError})})),function(){e=!1}}),[r.isPendingUuid,r.isLoadingPatient,r.patientUuid]),(0,Wt.useEffect)((function(){var t=function(t){var e=It();e!=r.patientUuid&&o({type:rr.loadPatient,patientUuid:e})};return window.addEventListener("single-spa:routing-event",t),function(){return window.removeEventListener("single-spa:routing-event",t)}}),[r.patientUuid]),{isLoading:r.isPendingUuid||r.isLoadingPatient,patient:r.patient,patientUuid:null!=t?t:r.patientUuid,error:r.err}},Nt=function(t){var e=A(t),n=e.extensions,r=e.extensionSlotModuleName;return t?n.map((function(e){return function(n){var o=n.state;return Wt.default.createElement(Gt.Provider,{value:{moduleName:r,featureName:"",extension:{extensionId:e.id,extensionSlotName:t,extensionSlotModuleName:r}}},Wt.default.createElement(qt,{state:o}))}})):[]},Rt=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},Lt=function(){var t,e=(0,Wt.useRef)(),n=function(t){if(Array.isArray(t))return t}(t=(0,Wt.useState)(null))||function(t){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,r,o=[],i=!0,a=!1;try{for(e=e.call(t);!(i=(n=e.next()).done)&&(o.push(n.value),2!==o.length);i=!0);}catch(t){a=!0,r=t}finally{try{i||null==e.return||e.return()}finally{if(a)throw r}}return o}}(t)||function(t){if(t){if("string"==typeof t)return Rt(t,2);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(e):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Rt(t,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=n[0],o=n[1],i=null;if(!r){if(yr){var a=(0,ee.getSessionStore)().getState();a.loaded&&(i=a.session)}else yr=new Promise((function(t){var n=function(n){var r=n.loaded,o=n.session;r&&(t(o),i=o,e.current&&e.current(),e.current=void 0)};n((0,ee.getSessionStore)().getState()),i||(e.current=(0,ee.getSessionStore)().subscribe(n))}));if(!i)throw yr;o(i)}(0,Wt.useEffect)((function(){return e.current||(e.current=(0,ee.getSessionStore)().subscribe((function(t){var e=t.loaded,n=t.session;e&&(i=n,o(n))}))),function(){e.current&&e.current(),e.current=void 0}}),[]);var u=r||i;if(!u)throw yr?(console.warn("useSession is in an unexpected state. Attempting to recover."),yr):Error("useSession is in an invalid state.");return u},Ut=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ee.defaultVisitCustomRepresentation,r=b((0,ee.getVisitStore)()),o=r.patientUuid,i=r.manuallySetVisitUuid,a=t&&o==t?i:null,u="?patient=".concat(t,"&v=").concat(n,"&includeInactive=false"),s="/".concat(a,"?v=").concat(n),c=(0,ce.default)(t?"".concat(ee.restBaseUrl,"/visit").concat(u):null,ee.openmrsFetch),l=c.data,f=c.error,p=c.mutate,h=c.isValidating,d=(0,ce.default)(t&&a?"".concat(ee.restBaseUrl,"/visit").concat(s):null,ee.openmrsFetch),v=d.data,y=d.error,g=d.mutate,m=d.isValidating,w=(0,Wt.useMemo)((function(){return null!==(e=null==l?void 0:l.data.results.find((function(t){return null===t.stopDatetime})))&&void 0!==e?e:null}),[l]),O=(0,Wt.useMemo)((function(){return a?null==v?void 0:v.data:null!=w?w:null}),[v,w,a]);return{error:f||y,mutate:function(){p(),g()},isValidating:h||m,activeVisit:w,currentVisit:O,currentVisitIsRetrospective:Boolean(a),isLoading:Boolean((!l||a&&!v)&&(!f||!y))}},Bt=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},Ft=function(){var t,e=function(t){if(Array.isArray(t))return t}(t=(0,Wt.useState)([]))||function(t){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,r,o=[],i=!0,a=!1;try{for(e=e.call(t);!(i=(n=e.next()).done)&&(o.push(n.value),2!==o.length);i=!0);}catch(t){a=!0,r=t}finally{try{i||null==e.return||e.return()}finally{if(a)throw r}}return o}}(t)||function(t){if(t){if("string"==typeof t)return Bt(t,2);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(e):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Bt(t,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=e[0],r=e[1];return(0,Wt.useEffect)((function(){var t=(0,ee.getVisitTypes)().subscribe((function(t){r(t)}),(function(t){return console.error(t)}));return function(){return t.unsubscribe()}}),[]),n},Vt=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},zt=function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Or,r=function(t){if(Array.isArray(t))return t}(t=(0,Wt.useState)(1))||function(t){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,r,o=[],i=!0,a=!1;try{for(e=e.call(t);!(i=(n=e.next()).done)&&(o.push(n.value),2!==o.length);i=!0);}catch(t){a=!0,r=t}finally{try{i||null==e.return||e.return()}finally{if(a)throw r}}return o}}(t)||function(t){if(t){if("string"==typeof t)return Vt(t,2);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(e):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Vt(t,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=r[0],i=r[1],a=(0,Wt.useMemo)((function(){return"number"==typeof n&&n>0?Math.max(1,Math.ceil(e.length/n)):1}),[e.length,n]),u=(0,Wt.useMemo)((function(){var t=(o-1)*n,r=(o+0)*n;return e.slice(t,r)}),[e,o,n]),s=(0,Wt.useCallback)((function(t){i(Math.max(1,Math.min(a,t)))}),[i,a]),c=(0,Wt.useCallback)((function(){o<a&&i(o+1)}),[o,a,i]),l=(0,Wt.useCallback)((function(){o>1&&i(o-1)}),[o,i]);return(0,Wt.useMemo)((function(){return{results:u,totalPages:a,currentPage:o,paginated:e.length>n,showNextButton:o<a,showPreviousButton:o>1,goTo:s,goToNext:c,goToPrevious:l}}),[u,a,e.length,n,o,s,c,l])},Ht=function(){var t="".concat(ee.restBaseUrl,"/metadatamapping/termmapping?v=custom:(metadataUuid)&code=emr.primaryIdentifierType"),e=(0,ce.default)(t,ee.openmrsFetch),n=e.data,r=e.error,o=e.isLoading;return(0,Wt.useMemo)((function(){var t,e;return{primaryIdentifierCode:null===(t=null==n||null===(e=n.data)||void 0===e?void 0:e.results[0])||void 0===t?void 0:t.metadataUuid,isLoading:o,error:r}}),[n,r,o])};w.r(O),w.d(O,{ComponentContext:function(){return Gt},ConfigurableLink:function(){return a},Extension:function(){return qt},ExtensionSlot:function(){return I},OpenmrsAppContext:function(){return Y},UserHasAccess:function(){return ne},createUseStore:function(){return E},getAsyncExtensionLifecycle:function(){return de},getAsyncLifecycle:function(){return $},getLifecycle:function(){return K},getSyncLifecycle:function(){return q},isDesktop:function(){return vr},openmrsComponentDecorator:function(){return G},useAbortController:function(){return Q},useAppContext:function(){return Z},useAssignedExtensionIds:function(){return at},useAssignedExtensions:function(){return x},useAttachments:function(){return ut},useBodyScrollLock:function(){return st},useConfig:function(){return ht},useConnectedExtensions:function(){return k},useConnectivity:function(){return f},useDebounce:function(){return vt},useDefineAppContext:function(){return J},useExtensionInternalStore:function(){return dr},useExtensionSlot:function(){return A},useExtensionSlotMeta:function(){return yt},useExtensionStore:function(){return Zt},useFeatureFlag:function(){return gt},useForceUpdate:function(){return bt},useLayoutType:function(){return St},useLocations:function(){return xt},useOnClickOutside:function(){return Pt},useOpenmrsSWR:function(){return kt},usePagination:function(){return zt},usePatient:function(){return Dt},usePrimaryIdentifierCode:function(){return Ht},useRenderableExtensions:function(){return Nt},useSession:function(){return Lt},useStore:function(){return b},useStoreWithActions:function(){return S},useVisit:function(){return Ut},useVisitTypes:function(){return Ft}});var Wt=w(954),Gt=Wt.default.createContext({moduleName:"",featureName:""}),Kt=w(513),$t=w(45),qt=function(t){var e,n=t.state,o=t.children,i=t.wrap,a=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,["state","children","wrap"]),s=function(t){if(Array.isArray(t))return t}(e=(0,Wt.useState)())||function(t){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,r,o=[],i=!0,a=!1;try{for(e=e.call(t);!(i=(n=e.next()).done)&&(o.push(n.value),2!==o.length);i=!0);}catch(t){a=!0,r=t}finally{try{i||null==e.return||e.return()}finally{if(a)throw r}}return o}}(e)||function(t){if(t){if("string"==typeof t)return u(t,2);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(e):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?u(t,2):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),l=s[0],f=s[1],p=(0,Wt.useContext)(Gt).extension,h=(0,Wt.useRef)(null),d=(0,Wt.useRef)(Promise.resolve()),v=(0,Wt.useRef)(!1);(0,Wt.useEffect)((function(){i&&console.warn("'wrap' prop of Extension is being used ".concat((null==p?void 0:p.extensionId)?"by ".concat(p.extensionId," in ").concat(p.extensionSlotName):"",". This will be removed in a future release."))}),[]);var y=(0,Wt.useCallback)((function(t){f(t)}),[f]);(0,Wt.useEffect)((function(){if(null!=l&&(null==p?void 0:p.extensionSlotName)&&p.extensionSlotModuleName&&p.extensionSlotModuleName&&!h.current&&!v.current)return v.current=!0,(0,$t.renderExtension)(l,p.extensionSlotName,p.extensionSlotModuleName,p.extensionId,void 0,n).then((function(t){h.current=t,v.current=!1})),function(){if(h&&h.current)switch(h.current.getStatus()){case"MOUNTING":h.current.mountPromise.then((function(){var t;"MOUNTED"===(null===(t=h.current)||void 0===t?void 0:t.getStatus())&&h.current.unmount()}));break;case"MOUNTED":h.current.unmount();break;case"UPDATING":d.current&&d.current.then((function(){var t;"MOUNTED"===(null===(t=h.current)||void 0===t?void 0:t.getStatus())&&h.current.unmount()}))}}}),[null==p?void 0:p.extensionSlotName,null==p?void 0:p.extensionId,null==p?void 0:p.extensionSlotModuleName,l]),(0,Wt.useEffect)((function(){h.current&&h.current.update&&"UNMOUNTING"!==h.current.getStatus()&&Promise.all([h.current.mountPromise,d.current]).then((function(){var t;"MOUNTED"===(null==h||null===(t=h.current)||void 0===t?void 0:t.getStatus())&&h.current.update&&(d.current=h.current.update(c({},n)).catch((function(t){var e,n,o;if(n=t,!(null!=(o=Error)&&"undefined"!=typeof Symbol&&o[Symbol.hasInstance]?o[Symbol.hasInstance](n):r(n,o))||!t.message.includes("minified message #32")||"MOUNTED"===(null===(e=h.current)||void 0===e?void 0:e.getStatus()))throw t})))}))}),[n]);var g=Wt.default.createElement("div",c({ref:y,"data-extension-id":null==p?void 0:p.extensionId,style:{position:"relative"}},a));return"function"!=typeof o||Wt.default.isValidElement(o)?p&&i?i(g,p):g:Wt.default.createElement(Wt.default.Fragment,null,o(g,p))},Jt=w(728),Yt=w(618),Qt=w(385),Xt=function(t){return t},Zt=E((0,$t.getExtensionStore)()),te=w(708),ee=w(766),ne=function(t){var e,n=t.privilege,r=t.fallback,o=t.children,i=function(t){if(Array.isArray(t))return t}(e=(0,Wt.useState)(null))||function(t){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,r,o=[],i=!0,a=!1;try{for(e=e.call(t);!(i=(n=e.next()).done)&&(o.push(n.value),2!==o.length);i=!0);}catch(t){a=!0,r=t}finally{try{i||null==e.return||e.return()}finally{if(a)throw r}}return o}}(e)||function(t){if(t){if("string"==typeof t)return M(t,2);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(e):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?M(t,2):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=i[0],u=i[1];return(0,Wt.useEffect)((function(){var t=(0,ee.getCurrentUser)({includeAuthStatus:!1}).subscribe(u);return function(){return t.unsubscribe()}}),[]),a&&(0,ee.userHasAccess)(n,a)?Wt.default.createElement(Wt.default.Fragment,null,o):r?Wt.default.createElement(Wt.default.Fragment,null,r):null},re=w(645);function oe(t){return(oe="function"==typeof Symbol&&"symbol"==o(Symbol.iterator)?function(t){return void 0===t?"undefined":o(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":o(t)})(t)}function ie(t){return(ie="function"==typeof Symbol&&"symbol"==o(Symbol.iterator)?function(t){return void 0===t?"undefined":o(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":o(t)})(t)}var ae=null;try{ae=n(1343).createContext()}catch(D){}var ue={React:null,ReactDOM:null,ReactDOMClient:null,rootComponent:null,loadRootComponent:null,errorBoundary:null,errorBoundaryClass:null,domElementGetter:null,parcelCanUpdate:!0,suppressComponentDidCatchWarning:!1,domElements:{},renderResults:{},updateResolves:{},unmountResolves:{}},se=w(281),ce=w(725);function le(t){return le=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},le(t)}function fe(t,e){return fe=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},fe(t,e)}var pe={strictMode:!0,throwErrorsToConsole:!0,disableTranslations:!1},he={errorRetryCount:3,fetcher:ee.openmrsFetch,focusThrottleInterval:3e4},de=$,ve=w(743),ye=Q,ge=function(t,e){return t===e||t!=t&&e!=e},me=function(t,e){for(var n=t.length;n--;)if(ge(t[n][0],e))return n;return-1},be=Array.prototype.splice;tt.prototype.clear=function(){this.__data__=[],this.size=0},tt.prototype.delete=function(t){var e=this.__data__,n=me(e,t);return!(n<0||(n==e.length-1?e.pop():be.call(e,n,1),--this.size,0))},tt.prototype.get=function(t){var e=this.__data__,n=me(e,t);return n<0?void 0:e[n][1]},tt.prototype.has=function(t){return me(this.__data__,t)>-1},tt.prototype.set=function(t,e){var n=this.__data__,r=me(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var we,Oe=tt,Se="object"==(void 0===n.g?"undefined":o(n.g))&&n.g&&n.g.Object===Object&&n.g,Ee="object"==("undefined"==typeof self?"undefined":o(self))&&self&&self.Object===Object&&self,xe=Se||Ee||Function("return this")(),Pe=xe.Symbol,je=Object.prototype,ke=je.hasOwnProperty,Ae=je.toString,_e=Pe?Pe.toStringTag:void 0,Te=Object.prototype.toString,Ce=Pe?Pe.toStringTag:void 0,Ie=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Ce&&Ce in Object(t)?function(t){var e=ke.call(t,_e),n=t[_e];try{t[_e]=void 0;var r=!0}catch(t){}var o=Ae.call(t);return r&&(e?t[_e]=n:delete t[_e]),o}(t):function(t){return Te.call(t)}(t)},Me=function(t){var e=void 0===t?"undefined":o(t);return null!=t&&("object"==e||"function"==e)},De=function(t){if(!Me(t))return!1;var e=Ie(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},Ne=xe["__core-js_shared__"],Re=(we=/[^.]+$/.exec(Ne&&Ne.keys&&Ne.keys.IE_PROTO||""))?"Symbol(src)_1."+we:"",Le=Function.prototype.toString,Ue=function(t){if(null!=t){try{return Le.call(t)}catch(t){}try{return t+""}catch(t){}}return""},Be=/^\[object .+?Constructor\]$/,Fe=Function.prototype,Ve=Object.prototype,ze=Fe.toString,He=Ve.hasOwnProperty,We=RegExp("^"+ze.call(He).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ge=function(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!Me(t)||(e=t,Re&&Re in e))&&(De(t)?We:Be).test(Ue(t));var e}(n)?n:void 0},Ke=Ge(xe,"Map"),$e=Ge(Object,"create"),qe=Object.prototype.hasOwnProperty,Je=Object.prototype.hasOwnProperty;et.prototype.clear=function(){this.__data__=$e?$e(null):{},this.size=0},et.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},et.prototype.get=function(t){var e=this.__data__;if($e){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return qe.call(e,t)?e[t]:void 0},et.prototype.has=function(t){var e=this.__data__;return $e?void 0!==e[t]:Je.call(e,t)},et.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=$e&&void 0===e?"__lodash_hash_undefined__":e,this};var Ye=et,Qe=function(t,e){var n,r,i=t.__data__;return("string"==(r=o(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map};nt.prototype.clear=function(){this.size=0,this.__data__={hash:new Ye,map:new(Ke||Oe),string:new Ye}},nt.prototype.delete=function(t){var e=Qe(this,t).delete(t);return this.size-=e?1:0,e},nt.prototype.get=function(t){return Qe(this,t).get(t)},nt.prototype.has=function(t){return Qe(this,t).has(t)},nt.prototype.set=function(t,e){var n=Qe(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};var Xe=nt;rt.prototype.clear=function(){this.__data__=new Oe,this.size=0},rt.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},rt.prototype.get=function(t){return this.__data__.get(t)},rt.prototype.has=function(t){return this.__data__.has(t)},rt.prototype.set=function(t,e){var n=this.__data__;if(r(n,Oe)){var o=n.__data__;if(!Ke||o.length<199)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new Xe(o)}return n.set(t,e),this.size=n.size,this};var Ze=rt;ot.prototype.add=ot.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},ot.prototype.has=function(t){return this.__data__.has(t)};var tn=ot,en=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1},nn=function(t,e,n,r,o,i){var a=1&n,u=t.length,s=e.length;if(u!=s&&!(a&&s>u))return!1;var c=i.get(t),l=i.get(e);if(c&&l)return c==e&&l==t;var f=-1,p=!0,h=2&n?new tn:void 0;for(i.set(t,e),i.set(e,t);++f<u;){var d=t[f],v=e[f];if(r)var y=a?r(v,d,f,e,t,i):r(d,v,f,t,e,i);if(void 0!==y){if(y)continue;p=!1;break}if(h){if(!en(e,(function(t,e){if(a=e,!h.has(a)&&(d===t||o(d,t,n,r,i)))return h.push(e);var a}))){p=!1;break}}else if(d!==v&&!o(d,v,n,r,i)){p=!1;break}}return i.delete(t),i.delete(e),p},rn=xe.Uint8Array,on=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n},an=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n},un=Pe?Pe.prototype:void 0,sn=un?un.valueOf:void 0,cn=Array.isArray,ln=Object.prototype.propertyIsEnumerable,fn=Object.getOwnPropertySymbols,pn=fn?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var a=t[n];e(a)&&(i[o++]=a)}return i}(fn(t),(function(e){return ln.call(t,e)})))}:function(){return[]},hn=function(t){return null!=t&&"object"==(void 0===t?"undefined":o(t))},dn=function(t){return hn(t)&&"[object Arguments]"==Ie(t)},vn=Object.prototype,yn=vn.hasOwnProperty,gn=vn.propertyIsEnumerable,mn=dn(function(){return arguments}())?dn:function(t){return hn(t)&&yn.call(t,"callee")&&!gn.call(t,"callee")},bn=mn,wn="object"==o(e)&&e&&!e.nodeType&&e,On=wn&&"object"==o(t)&&t&&!t.nodeType&&t,Sn=On&&On.exports===wn?xe.Buffer:void 0,En=(Sn?Sn.isBuffer:void 0)||function(){return!1},xn=/^(?:0|[1-9]\d*)$/,Pn=function(t,e){var n=void 0===t?"undefined":o(t);return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&xn.test(t))&&t>-1&&t%1==0&&t<e},jn=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},kn={};kn["[object Float32Array]"]=kn["[object Float64Array]"]=kn["[object Int8Array]"]=kn["[object Int16Array]"]=kn["[object Int32Array]"]=kn["[object Uint8Array]"]=kn["[object Uint8ClampedArray]"]=kn["[object Uint16Array]"]=kn["[object Uint32Array]"]=!0,kn["[object Arguments]"]=kn["[object Array]"]=kn["[object ArrayBuffer]"]=kn["[object Boolean]"]=kn["[object DataView]"]=kn["[object Date]"]=kn["[object Error]"]=kn["[object Function]"]=kn["[object Map]"]=kn["[object Number]"]=kn["[object Object]"]=kn["[object RegExp]"]=kn["[object Set]"]=kn["[object String]"]=kn["[object WeakMap]"]=!1;var An,_n="object"==o(e)&&e&&!e.nodeType&&e,Tn=_n&&"object"==o(t)&&t&&!t.nodeType&&t,Cn=Tn&&Tn.exports===_n&&Se.process,In=function(){try{return Tn&&Tn.require&&Tn.require("util").types||Cn&&Cn.binding&&Cn.binding("util")}catch(t){}}(),Mn=In&&In.isTypedArray,Dn=Mn?(An=Mn,function(t){return An(t)}):function(t){return hn(t)&&jn(t.length)&&!!kn[Ie(t)]},Nn=Object.prototype.hasOwnProperty,Rn=Object.prototype,Ln=function(t,e){return function(n){return t(e(n))}}(Object.keys,Object),Un=Object.prototype.hasOwnProperty,Bn=function(t){return null!=(e=t)&&jn(e.length)&&!De(e)?function(t){var e=cn(t),n=!e&&bn(t),r=!e&&!n&&En(t),o=!e&&!n&&!r&&Dn(t),i=e||n||r||o,a=i?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],u=a.length;for(var s in t)!Nn.call(t,s)||i&&("length"==s||r&&("offset"==s||"parent"==s)||o&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||Pn(s,u))||a.push(s);return a}(t):function(t){if(n=(e=t)&&e.constructor,e!==("function"==typeof n&&n.prototype||Rn))return Ln(t);var e,n,r=[];for(var o in Object(t))Un.call(t,o)&&"constructor"!=o&&r.push(o);return r}(t);var e},Fn=function(t){return function(t,e,n){var r=e(t);return cn(t)?r:function(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}(r,n(t))}(t,Bn,pn)},Vn=Object.prototype.hasOwnProperty,zn=Ge(xe,"DataView"),Hn=Ge(xe,"Promise"),Wn=Ge(xe,"Set"),Gn=Ge(xe,"WeakMap"),Kn="[object Map]",$n="[object Promise]",qn="[object Set]",Jn="[object WeakMap]",Yn="[object DataView]",Qn=Ue(zn),Xn=Ue(Ke),Zn=Ue(Hn),tr=Ue(Wn),er=Ue(Gn),nr=Ie;(zn&&nr(new zn(new ArrayBuffer(1)))!=Yn||Ke&&nr(new Ke)!=Kn||Hn&&nr(Hn.resolve())!=$n||Wn&&nr(new Wn)!=qn||Gn&&nr(new Gn)!=Jn)&&(nr=function(t){var e=Ie(t),n="[object Object]"==e?t.constructor:void 0,r=n?Ue(n):"";if(r)switch(r){case Qn:return Yn;case Xn:return Kn;case Zn:return $n;case tr:return qn;case er:return Jn}return e});var rr,or=nr,ir="[object Arguments]",ar="[object Array]",ur="[object Object]",sr=Object.prototype.hasOwnProperty,cr=function t(e,n,o,i,a){return e===n||(null==e||null==n||!hn(e)&&!hn(n)?e!=e&&n!=n:function(t,e,n,o,i,a){var u=cn(t),s=cn(e),c=u?ar:or(t),l=s?ar:or(e),f=(c=c==ir?ur:c)==ur,p=(l=l==ir?ur:l)==ur,h=c==l;if(h&&En(t)){if(!En(e))return!1;u=!0,f=!1}if(h&&!f)return a||(a=new Ze),u||Dn(t)?nn(t,e,n,o,i,a):function(t,e,n,r,o,i,a){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!i(new rn(t),new rn(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return ge(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var u=on;case"[object Set]":var s=1&r;if(u||(u=an),t.size!=e.size&&!s)return!1;var c=a.get(t);if(c)return c==e;r|=2,a.set(t,e);var l=nn(u(t),u(e),r,o,i,a);return a.delete(t),l;case"[object Symbol]":if(sn)return sn.call(t)==sn.call(e)}return!1}(t,e,c,n,o,i,a);if(!(1&n)){var d=f&&sr.call(t,"__wrapped__"),v=p&&sr.call(e,"__wrapped__");if(d||v){var y=d?t.value():t,g=v?e.value():e;return a||(a=new Ze),i(y,g,n,o,a)}}return!!h&&(a||(a=new Ze),function(t,e,n,o,i,a){var u=1&n,s=Fn(t),c=s.length;if(c!=Fn(e).length&&!u)return!1;for(var l=c;l--;){var f=s[l];if(!(u?f in e:Vn.call(e,f)))return!1}var p=a.get(t),h=a.get(e);if(p&&h)return p==e&&h==t;var d=!0;a.set(t,e),a.set(e,t);for(var v=u;++l<c;){var y=t[f=s[l]],g=e[f];if(o)var m=u?o(g,y,f,e,t,a):o(y,g,f,t,e,a);if(!(void 0===m?y===g||i(y,g,n,o,a):m)){d=!1;break}v||(v="constructor"==f)}if(d&&!v){var b=t.constructor,w=e.constructor;b==w||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&r(b,b)&&"function"==typeof w&&r(w,w)||(d=!1)}return a.delete(t),a.delete(e),d}(t,e,n,o,i,a))}(e,n,o,i,t,a))},lr=function(t,e){return cr(t,e)},fr=w(824),pr={},hr='No ComponentContext has been provided. This should come from "openmrsComponentDecorator".\nUsually this is already applied when using "getAsyncLifecycle" or "getSyncLifecycle".',dr=E((0,$t.getExtensionInternalStore)()),vr=function(t){return"small-desktop"===t||"large-desktop"===t};!function(t){t.loadPatient="loadPatient",t.newPatient="newPatient",t.loadError="patientLoadError"}(rr||(rr={}));var yr,gr={patientUuid:null,patient:null,isPendingUuid:!0,isLoadingPatient:!1,err:null},mr=w(688),br=w(332),wr=w.n(br);mr.default.extend(wr());var Or=10}(),O}())}}}))},9316:(t,e,n)=>{"use strict";n.d(e,{Ay:()=>pe,yw:()=>ue,Wp:()=>f,Uz:()=>ye,nX:()=>ge,ll:()=>r,FZ:()=>ae,p9:()=>he,gM:()=>de,Y1:()=>ee});var r="openmrs-routes:",o=n(5863),i={bootstrap:function(){return Promise.resolve()},mount:function(){return Promise.resolve()},unmount:function(){return Promise.resolve()}};function a(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)}function u(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function u(t){a(i,r,o,u,s,"next",t)}function s(t){a(i,r,o,u,s,"throw",t)}u(void 0)}))}}function s(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}var c=new Map;function l(t,e){return u((function(){var n;return s(this,(function(r){switch(r.label){case 0:return[4,(0,o.importDynamic)(t)];case 1:return(n=r.sent())&&Object.hasOwn(n,e)&&"function"==typeof n[e]?[2,f(t,n).then((function(){return n[e]()}))]:(n&&Object.hasOwn(n,e)?console.warn("The export ".concat(e," of the app ").concat(t," is not a function")):console.warn("The app ".concat(t," does not define a component called ").concat(e,", this cannot be loaded")),[2,i])}}))}))}function f(t,e){return p.apply(this,arguments)}function p(){return(p=u((function(t,e){var n,r;return s(this,(function(i){switch(i.label){case 0:return t in c?[3,5]:null==e?[3,1]:(r=e,[3,3]);case 1:return[4,(0,o.importDynamic)(t)];case 2:r=i.sent(),i.label=3;case 3:return n=r,[4,c[t]=new Promise((function(t,e){if(Object.hasOwn(n,"startupApp")){var r=n.startupApp;if("function"==typeof r)return Promise.resolve(r()).then(t).catch(e)}t(null)}))];case 4:return i.sent(),[3,7];case 5:return[4,c[t]];case 6:i.sent(),i.label=7;case 7:return[2]}}))}))).apply(this,arguments)}var h=Object.freeze({__proto__:null,get start(){return Jt},get ensureJQuerySupport(){return Et},get setBootstrapMaxTime(){return rt},get setMountMaxTime(){return ot},get setUnmountMaxTime(){return it},get setUnloadMaxTime(){return at},get registerApplication(){return Nt},get unregisterApplication(){return Lt},get getMountedApps(){return Ct},get getAppStatus(){return Mt},get unloadApplication(){return Ut},get checkActivityFunctions(){return Rt},get getAppNames(){return It},get pathToActiveWhen(){return Vt},get navigateToUrl(){return ht},get patchHistoryApi(){return wt},get triggerAppChange(){return Gt},get addErrorHandler(){return m},get removeErrorHandler(){return b},get mountRootParcel(){return X},get NOT_LOADED(){return S},get LOADING_SOURCE_CODE(){return E},get NOT_BOOTSTRAPPED(){return x},get BOOTSTRAPPING(){return P},get NOT_MOUNTED(){return j},get MOUNTING(){return k},get UPDATING(){return _},get LOAD_ERROR(){return I},get MOUNTED(){return A},get UNLOADING(){return C},get UNMOUNTING(){return T},get SKIP_BECAUSE_BROKEN(){return M}}),d=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).CustomEvent,v=function(){try{var t=new d("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?d:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(t,e){var n=document.createEvent("CustomEvent");return e?n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail):n.initCustomEvent(t,!1,!1,void 0),n}:function(t,e){var n=document.createEventObject();return n.type=t,e?(n.bubbles=Boolean(e.bubbles),n.cancelable=Boolean(e.cancelable),n.detail=e.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n};let y=[];function g(t,e,n){const r=O(t,e,n);y.length?y.forEach((t=>t(r))):setTimeout((()=>{throw r}))}function m(t){if("function"!=typeof t)throw Error(w(28,!1));y.push(t)}function b(t){if("function"!=typeof t)throw Error(w(29,!1));let e=!1;return y=y.filter((n=>{const r=n===t;return e=e||r,!r})),e}function w(t,e,...n){return`single-spa minified message #${t}: ${e?e+" ":""}See https://single-spa.js.org/error/?code=${t}${n.length?`&arg=${n.join("&arg=")}`:""}`}function O(t,e,n){const r=`${U(e)} '${R(e)}' died in status ${e.status}: `;let o;if(t instanceof Error){try{t.message=r+t.message}catch(t){}o=t}else{console.warn(w(30,!1,e.status,R(e)));try{o=Error(r+JSON.stringify(t))}catch(e){o=t}}return o.appOrParcelName=R(e),e.status=n,o}const S="NOT_LOADED",E="LOADING_SOURCE_CODE",x="NOT_BOOTSTRAPPED",P="BOOTSTRAPPING",j="NOT_MOUNTED",k="MOUNTING",A="MOUNTED",_="UPDATING",T="UNMOUNTING",C="UNLOADING",I="LOAD_ERROR",M="SKIP_BECAUSE_BROKEN";function D(t){return t.status===A}function N(t){try{return t.activeWhen(window.location)}catch(e){return g(e,t,M),!1}}function R(t){return t.name}function L(t){return Boolean(t.unmountThisParcel)}function U(t){return L(t)?"parcel":"application"}function B(){for(let t=arguments.length-1;t>0;t--)for(let e in arguments[t])"__proto__"!==e&&(arguments[t-1][e]=arguments[t][e]);return arguments[0]}function F(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return t[n];return null}function V(t){return t&&("function"==typeof t||(e=t,Array.isArray(e)&&!F(e,(t=>"function"!=typeof t))));var e}function z(t,e){let n=t[e]||[];n=Array.isArray(n)?n:[n],0===n.length&&(n=[()=>Promise.resolve()]);const r=U(t),o=R(t);return function(t){return n.reduce(((n,i,a)=>n.then((()=>{const n=i(t);return H(n)?n:Promise.reject(w(15,!1,r,o,e,a))}))),Promise.resolve())}}function H(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch}let W=[];function G(t,e){return Promise.resolve().then((()=>t.status!==x?t:(t.status=P,t.bootstrap?ut(t,"bootstrap").then(n).catch((n=>{if(e)throw O(n,t,M);return g(n,t,M),t})):Promise.resolve().then(n))));function n(){return t.status=j,t}}function K(t,e){return Promise.resolve().then((()=>{if(t.status!==A)return t;t.status=T;const n=Object.keys(t.parcels).map((e=>t.parcels[e].unmountThisParcel()));return Promise.all(n).then(r,(n=>r().then((()=>{const r=Error(n.message);if(e)throw O(r,t,M);g(r,t,M)})))).then((()=>t));function r(){return ut(t,"unmount").then((()=>{t.status=j}),(n=>{if(e)throw O(n,t,M);g(n,t,M)}))}}))}let $=!1,q=!1;function J(t,e){return Promise.resolve().then((()=>t.status!==j?t:($||(window.dispatchEvent(new v("single-spa:before-first-mount")),$=!0),t.status=k,ut(t,"mount").then((()=>(t.status=A,q||(window.dispatchEvent(new v("single-spa:first-mount")),q=!0),t))).catch((n=>{return t.status=A,K(t,!0).then(r,r);function r(){if(e)throw O(n,t,M);return g(n,t,M),t}})))))}let Y=0;const Q={parcels:{}};function X(){return Z.apply(Q,arguments)}function Z(t,e){const n=this;if(!t||"object"!=typeof t&&"function"!=typeof t)throw Error(w(2,!1));if(t.name&&"string"!=typeof t.name)throw Error(w(3,!1,typeof t.name));const r=Y++;let o=t.name||`parcel-${r}`;if("object"!=typeof e)throw Error(w(4,!1,o,typeof e));if(!e.domElement)throw Error(w(5,!1,o));const i="function"==typeof t,a=i?t:()=>Promise.resolve(t),u={id:r,parcels:{},status:i?E:x,customProps:e,parentName:R(n),unmountThisParcel:()=>f.then((()=>{if(u.status!==A)throw Error(w(6,!1,o,u.status));return K(u,!0)})).then((t=>(u.parentName&&delete n.parcels[u.id],t))).then((t=>(p(t),t))).catch((t=>{throw u.status=M,h(t),t}))};let s;n.parcels[r]=u;let c=a();if(!c||"function"!=typeof c.then)throw Error(w(7,!1));c=c.then((t=>{if(!t)throw Error(w(8,!1));if(o=t.name||`parcel-${r}`,Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!V(t.bootstrap))throw Error(w(9,!1,o));if(!V(t.mount))throw Error(w(10,!1,o));if(!V(t.unmount))throw Error(w(11,!1,o));if(t.update&&!V(t.update))throw Error(w(12,!1,o));const e=z(t,"bootstrap"),n=z(t,"mount"),i=z(t,"unmount");u.status=x,u.name=o,u.bootstrap=e,u.mount=n,u.unmount=i,u.timeouts=st(t.timeouts),t.update&&(u.update=z(t,"update"),s.update=function(t){return u.customProps=t,tt((e=u,Promise.resolve().then((()=>{if(e.status!==A)throw Error(w(32,!1,R(e)));return e.status=_,ut(e,"update").then((()=>(e.status=A,e))).catch((t=>{throw O(t,e,M)}))}))));var e})}));const l=c.then((()=>G(u,!0))),f=l.then((()=>J(u,!0)));let p,h;const d=new Promise(((t,e)=>{p=t,h=e}));return s={mount:()=>tt(Promise.resolve().then((()=>{if(u.status!==j)throw Error(w(13,!1,o,u.status));return n.parcels[r]=u,J(u)}))),unmount:()=>tt(u.unmountThisParcel()),getStatus:()=>u.status,loadPromise:tt(c),bootstrapPromise:tt(l),mountPromise:tt(f),unmountPromise:tt(d)},s}function tt(t){return t.then((()=>null))}function et(t){const e=R(t);let n="function"==typeof t.customProps?t.customProps(e,window.location):t.customProps;("object"!=typeof n||null===n||Array.isArray(n))&&(n={},console.warn(w(40,!1),e,n));const r=B({},n,{name:e,mountParcel:Z.bind(t),singleSpa:h});return L(t)&&(r.unmountSelf=t.unmountThisParcel),r}const nt={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}};function rt(t,e,n){if("number"!=typeof t||t<=0)throw Error(w(16,!1));nt.bootstrap={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function ot(t,e,n){if("number"!=typeof t||t<=0)throw Error(w(17,!1));nt.mount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function it(t,e,n){if("number"!=typeof t||t<=0)throw Error(w(18,!1));nt.unmount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function at(t,e,n){if("number"!=typeof t||t<=0)throw Error(w(19,!1));nt.unload={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function ut(t,e){const n=t.timeouts[e],r=n.warningMillis,o=U(t);return new Promise(((i,a)=>{let u=!1,s=!1;t[e](et(t)).then((t=>{u=!0,i(t)})).catch((t=>{u=!0,a(t)})),setTimeout((()=>l(1)),r),setTimeout((()=>l(!0)),n.millis);const c=w(31,!1,e,o,R(t),n.millis);function l(t){if(!u)if(!0===t)s=!0,n.dieOnTimeout?a(Error(c)):console.error(c);else if(!s){const e=t,o=e*r;console.warn(c),o+r<n.millis&&setTimeout((()=>l(e+1)),r)}}}))}function st(t){const e={};for(let n in nt)e[n]=B({},nt[n],t&&t[n]||{});return e}function ct(t){return Promise.resolve().then((()=>{if(t.loadPromise)return t.loadPromise;if(t.status!==S&&t.status!==I)return t;let e,n;return t.status=E,t.loadPromise=Promise.resolve().then((()=>{const r=t.loadApp(et(t));if(!H(r))throw n=!0,Error(w(33,!1,R(t)));return r.then((n=>{let r;t.loadErrorTime=null,e=n,"object"!=typeof e&&(r=34),Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!V(e.bootstrap)&&(r=35),V(e.mount)||(r=36),V(e.unmount)||(r=37);const o=U(e);if(r){let n;try{n=JSON.stringify(e)}catch(t){}return console.error(w(r,!1,o,R(t),n),e),g(void 0,t,M),t}return e.devtools&&e.devtools.overlays&&(t.devtools.overlays=B({},t.devtools.overlays,e.devtools.overlays)),t.status=x,t.bootstrap=z(e,"bootstrap"),t.mount=z(e,"mount"),t.unmount=z(e,"unmount"),t.unload=z(e,"unload"),t.timeouts=st(e.timeouts),delete t.loadPromise,t}))})).catch((e=>{let r;return delete t.loadPromise,n?r=M:(r=I,t.loadErrorTime=(new Date).getTime()),g(e,t,r),t}))}))}const lt="undefined"!=typeof window,ft={hashchange:[],popstate:[]},pt=["hashchange","popstate"];function ht(t){let e;if("string"==typeof t)e=t;else if(this&&this.href)e=this.href;else{if(!(t&&t.currentTarget&&t.currentTarget.href&&t.preventDefault))throw Error(w(14,!1));e=t.currentTarget.href,t.preventDefault()}const n=Ot(window.location.href),r=Ot(e);0===e.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=e:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,e)}function dt(t){if(t){const e=t[0].type;pt.indexOf(e)>=0&&ft[e].forEach((e=>{try{e.apply(this,t)}catch(t){setTimeout((()=>{throw t}))}}))}}let vt;function yt(){Kt([],arguments)}function gt(t,e){return function(){const n=window.location.href,r=t.apply(this,arguments),o=window.location.href;return vt&&n===o||window.dispatchEvent(function(t,e){let n;try{n=new PopStateEvent("popstate",{state:t})}catch(e){n=document.createEvent("PopStateEvent"),n.initPopStateEvent("popstate",!1,!1,t)}return n.singleSpa=!0,n.singleSpaTrigger=e,n}(window.history.state,e)),r}}let mt=null,bt=!1;function wt(t){if(bt)throw Error(w(43,!1));vt=!t||!t.hasOwnProperty("urlRerouteOnly")||t.urlRerouteOnly,bt=!0,mt=window.history.replaceState,window.addEventListener("hashchange",yt),window.addEventListener("popstate",yt);const e=window.addEventListener,n=window.removeEventListener;window.addEventListener=function(t,n){if(!("function"==typeof n&&pt.indexOf(t)>=0)||F(ft[t],(t=>t===n)))return e.apply(this,arguments);ft[t].push(n)},window.removeEventListener=function(t,e){if(!("function"==typeof e&&pt.indexOf(t)>=0))return n.apply(this,arguments);ft[t]=ft[t].filter((t=>t!==e))},window.history.pushState=gt(window.history.pushState,"pushState"),window.history.replaceState=gt(mt,"replaceState")}function Ot(t){const e=document.createElement("a");return e.href=t,e}lt&&(window.singleSpaNavigate?console.warn(w(41,!1)):window.singleSpaNavigate=ht);let St=!1;function Et(t=window.jQuery){if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!St){const e=t.fn.on,n=t.fn.off;t.fn.on=function(t,n){return xt.call(this,e,window.addEventListener,t,n,arguments)},t.fn.off=function(t,e){return xt.call(this,n,window.removeEventListener,t,e,arguments)},St=!0}}function xt(t,e,n,r,o){return"string"!=typeof n?t.apply(this,o):(n.split(/\s+/).forEach((t=>{pt.indexOf(t)>=0&&(e(t,r),n=n.replace(t,""))})),""===n.trim()?this:t.apply(this,o))}const Pt={};function jt(t){return Promise.resolve().then((()=>{const e=Pt[R(t)];if(!e)return t;if(t.status===S)return kt(t,e),t;if(t.status===C)return e.promise.then((()=>t));if(t.status!==j&&t.status!==I)return t;const n=t.status===I?Promise.resolve():ut(t,"unload");return t.status=C,n.then((()=>(kt(t,e),t))).catch((n=>(function(t,e,n){delete Pt[R(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,g(n,t,M),e.reject(n)}(t,e,n),t)))}))}function kt(t,e){delete Pt[R(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=S,e.resolve()}function At(t,e,n,r){Pt[R(t)]={app:t,resolve:n,reject:r},Object.defineProperty(Pt[R(t)],"promise",{get:e})}function _t(t){return Pt[t]}const Tt=[];function Ct(){return Tt.filter(D).map(R)}function It(){return Tt.map(R)}function Mt(t){const e=F(Tt,(e=>R(e)===t));return e?e.status:null}let Dt=!1;function Nt(t,e,n,r){const o=function(t,e,n,r){const o={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"==typeof t?(function(t){if(Array.isArray(t)||null===t)throw Error(w(39,!1));const e=["name","app","activeWhen","customProps"],n=Object.keys(t).reduce(((t,n)=>e.indexOf(n)>=0?t:t.concat(n)),[]);if(0!==n.length)throw Error(w(38,!1,e.join(", "),n.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(w(20,!1));if("object"!=typeof t.app&&"function"!=typeof t.app)throw Error(w(20,!1));const r=t=>"string"==typeof t||"function"==typeof t;if(!(r(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(r)))throw Error(w(24,!1));if(!Ft(t.customProps))throw Error(w(22,!1))}(t),o.name=t.name,o.loadApp=t.app,o.activeWhen=t.activeWhen,o.customProps=t.customProps):(function(t,e,n,r){if("string"!=typeof t||0===t.length)throw Error(w(20,!1));if(!e)throw Error(w(23,!1));if("function"!=typeof n)throw Error(w(24,!1));if(!Ft(r))throw Error(w(22,!1))}(t,e,n,r),o.name=t,o.loadApp=e,o.activeWhen=n,o.customProps=r),o.loadApp="function"!=typeof(i=o.loadApp)?()=>Promise.resolve(i):i,o.customProps=function(t){return t||{}}(o.customProps),o.activeWhen=function(t){let e=Array.isArray(t)?t:[t];return e=e.map((t=>"function"==typeof t?t:Vt(t))),t=>e.some((e=>e(t)))}(o.activeWhen),o;var i}(t,e,n,r);if(Yt()||Dt||(Dt=!0,setTimeout((()=>{Yt()||console.warn(w(1,!1))}),5e3)),-1!==It().indexOf(o.name))throw Error(w(21,!1,o.name));Tt.push(B({loadErrorTime:null,status:S,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},o)),lt&&(Et(),Kt())}function Rt(t=window.location){return Tt.filter((e=>e.activeWhen(t))).map(R)}function Lt(t){if(0===Tt.filter((e=>R(e)===t)).length)throw Error(w(25,!1,t));return(lt?Ut(t,{waitForUnmount:!1}):Promise.resolve()).then((()=>{const e=Tt.map(R).indexOf(t);Tt.splice(e,1)}))}function Ut(t,e={waitForUnmount:!1}){if("string"!=typeof t)throw Error(w(26,!1));const n=F(Tt,(e=>R(e)===t));if(!n)throw Error(w(27,!1,t));const r=_t(R(n));if(e&&e.waitForUnmount){if(r)return r.promise;{const t=new Promise(((e,r)=>{At(n,(()=>t),e,r)}));return t}}{let t;return r?(t=r.promise,Bt(n,r.resolve,r.reject)):t=new Promise(((e,r)=>{At(n,(()=>t),e,r),Bt(n,e,r)})),t}}function Bt(t,e,n){Promise.resolve().then((()=>{if(F(Rt(),(e=>e===R(t))))return Gt()})).then((()=>K(t).then(jt).then((()=>{e(),setTimeout((()=>{Kt()}))})))).catch(n)}function Ft(t){return!t||"function"==typeof t||"object"==typeof t&&null!==t&&!Array.isArray(t)}function Vt(t,e){const n=function(t,e){let n=0,r=!1,o="^";"/"!==t[0]&&(t="/"+t);for(let e=0;e<t.length;e++){const n=t[e];(!r&&":"===n||r&&"/"===n)&&i(e)}return i(t.length),new RegExp(o,"i");function i(i){const a=t.slice(n,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":a,i===t.length)if(r)e&&(o+="$");else{const t=e?"":".*";o="/"===o.charAt(o.length-1)?`${o}${t}$`:`${o}(/${t})?(#.*)?$`}r=!r,n=i}}(t,e);return t=>{let e=t.origin;e||(e=`${t.protocol}//${t.host}`);const r=t.href.replace(e,"").replace(t.search,"").split("?")[0];return n.test(r)}}let zt=!1,Ht=[],Wt=lt&&window.location.href;function Gt(){return Kt()}function Kt(t=[],e,n=!1){if(zt)return new Promise(((t,n)=>{Ht.push({resolve:t,reject:n,eventArguments:e})}));const{appsToUnload:r,appsToUnmount:o,appsToLoad:i,appsToMount:a}=function(){const t=[],e=[],n=[],r=[],o=(new Date).getTime();return Tt.forEach((i=>{const a=i.status!==M&&N(i);switch(i.status){case I:a&&o-i.loadErrorTime>=200&&n.push(i);break;case S:case E:a&&n.push(i);break;case x:case j:!a&&_t(R(i))?t.push(i):a&&r.push(i);break;case A:a||e.push(i)}})),{appsToUnload:t,appsToUnmount:e,appsToLoad:n,appsToMount:r}}();let u,s=[],c=Wt,l=Wt=window.location.href;return Yt()?(zt=!0,u=r.concat(i,o,a),Promise.resolve().then((()=>(y(0===u.length?"before-no-app-change":"before-app-change",d(!0)),y("before-routing-event",d(!0,{cancelNavigation:f})),Promise.all(s).then((n=>{if(n.some((t=>t)))return mt.call(window.history,history.state,"",c.substring(location.origin.length)),Wt=location.href,zt=!1,Kt(t,e,!0);const u=r.map(jt),s=o.map(K).map((t=>t.then(jt))).concat(u),l=Promise.all(s);l.then((()=>{y("before-mount-routing-event",d(!0))}),(t=>{throw t}));const f=i.map((t=>ct(t).then((t=>$t(t,l))))),v=a.filter((t=>i.indexOf(t)<0)).map((t=>$t(t,l)));return l.catch((t=>{throw h(),t})).then((()=>(h(),Promise.all(f.concat(v)).catch((e=>{throw t.forEach((t=>t.reject(e))),e})).then(p).then((()=>{}),(t=>{throw t})))))})))))):(u=i,Promise.resolve().then((()=>{const t=i.map(ct);return Promise.all(t).then(h).then((()=>[])).catch((t=>{throw h(),t})).finally((()=>{}))})));function f(t=!0){const e="function"==typeof(null==t?void 0:t.then)?t:Promise.resolve(t);s.push(e.catch((t=>(console.warn(Error(w(42,!1))),console.warn(t),!1))))}function p(){const e=Ct();t.forEach((t=>t.resolve(e)));try{y(0===u.length?"no-app-change":"app-change",d()),y("routing-event",d())}catch(t){setTimeout((()=>{throw t}))}if(zt=!1,Ht.length>0){const t=Ht;Ht=[],Kt(t)}return e}function h(){n||(t.forEach((t=>{dt(t.eventArguments)})),dt(e))}function d(t=!1,n){const s={},f={[A]:[],[j]:[],[S]:[],[M]:[]};t?(i.concat(a).forEach(((t,e)=>{h(t,A)})),r.forEach((t=>{h(t,S)})),o.forEach((t=>{h(t,j)}))):u.forEach((t=>{h(t)}));const p={detail:{newAppStatuses:s,appsByNewStatus:f,totalAppChanges:u.length,originalEvent:null==e?void 0:e[0],oldUrl:c,newUrl:l}};return n&&B(p.detail,n),p;function h(t,e){const n=R(t);e=e||Mt(n),s[n]=e,(f[e]=f[e]||[]).push(n)}}function y(t,e){n||window.dispatchEvent(new v(`single-spa:${t}`,e))}}function $t(t,e){return N(t)?G(t).then((t=>e.then((()=>N(t)?J(t):t)))):e.then((()=>t))}let qt=!1;function Jt(t){qt=!0,lt&&(wt(t),Kt())}function Yt(){return qt}var Qt={getRawAppData:function(){return[...Tt]},reroute:Kt,NOT_LOADED:S,toLoadPromise:ct,toBootstrapPromise:G,unregisterApplication:Lt,getProfilerData:function(){return W}};lt&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Qt);var Xt=n(7274),Zt=n(2223),te=n(6133);function ee(t,e){var n=e.name;if(n){e.slots&&e.slot&&console.warn("The extension ".concat(n," from ").concat(t," declares both a 'slots' property and\na 'slot' property. Only the 'slots' property will be honored."));var r=e.slots?e.slots:e.slot?[e.slot]:[];if(e.component||e.load){var o,i,a=void 0;if(e.component)a=l(t,e.component);else if(e.load){if("function"!=typeof e.load)return void console.error("The extension ".concat(n," from ").concat(t," declares a 'load' property that is not a function. This is not\nsupported, so the extension will not be loaded."));a=e.load}a&&(0,te.registerExtension)({name:n,load:a,meta:e.meta||{},order:e.order,moduleName:t,privileges:e.privileges,online:null===(o=e.online)||void 0===o||o,offline:null!==(i=e.offline)&&void 0!==i&&i,featureFlag:e.featureFlag});var u=!0,s=!1,c=void 0;try{for(var f,p=r[Symbol.iterator]();!(u=(f=p.next()).done);u=!0){var h=f.value;(0,te.attach)(h,n)}}catch(t){s=!0,c=t}finally{try{u||null==p.return||p.return()}finally{if(s)throw c}}}else console.error("The extension ".concat(n," from ").concat(t," is missing a 'component' entry and thus cannot be registered.\nTo fix this, ensure that you define a 'component' field inside the extension definition."),e)}else console.error("An extension definition in ".concat(t,' is missing an name and thus cannot be\nregistered. To fix this, ensure that you define the "name" field inside the\nextension definition.'),e)}function ne(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function re(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}var oe=[];function ie(t){if(Array.isArray(t)){var e=t.map(ie);return function(t){return e.some((function(e){return e(t)}))}}return"string"==typeof t?Vt(window.getOpenmrsSpaBase()+t):(n=t,(null!=(r=RegExp)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r)?function(e){return function(t,e){return t.test(e.pathname.replace(window.getOpenmrsSpaBase(),""))}(t,e)}:function(){return t});var n,r}function ae(t,e){if(t&&e&&"object"===(void 0===e?"undefined":re(e))){var n,r;(0,Xt.registerModuleWithConfigSystem)(t);var o,i,a,u=null!==(r=e.extensions)&&void 0!==r?r:[],s=null!==(o=e.modals)&&void 0!==o?o:[],c=null!==(i=e.workspaces)&&void 0!==i?i:[],f=null!==(a=e.featureFlags)&&void 0!==a?a:[];null===(n=e.pages)||void 0===n||n.forEach((function(e){var n,r,o;e&&"object"===(void 0===e?"undefined":re(e))&&Object.hasOwn(e,"component")&&(Object.hasOwn(e,"route")||Object.hasOwn(e,"routeRegex")||Object.hasOwn(e,"routes"))?oe.push((r=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){ne(t,e,n[e])}))}return t}({},e),o=null!=(o={order:null!==(n=e.order)&&void 0!==n?n:Number.MAX_SAFE_INTEGER,appName:t})?o:{},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):function(t){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e.push.apply(e,n)}return e}(Object(o)).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(o,t))})),r)):console.warn("A page for ".concat(t," could not be registered as it does not appear to have the required properties"),e)})),u.forEach((function(e){e&&"object"===(void 0===e?"undefined":re(e))&&Object.hasOwn(e,"name")&&Object.hasOwn(e,"component")?ee(t,e):console.warn("An extension for ".concat(t," could not be registered as it does not appear to have the required properties"),e)})),s.forEach((function(e){e&&"object"===(void 0===e?"undefined":re(e))&&Object.hasOwn(e,"name")&&Object.hasOwn(e,"component")?function(t,e){var n=e.name;if(n)if(e.component||e.load){var r=void 0;if(e.component)r=l(t,e.component);else if(e.load){if("function"!=typeof e.load)return void console.error("The modal ".concat(n," from ").concat(t," declares a 'load' property that is not a function. This is not\nsupported, so the modal will not be loaded."));r=e.load}r&&(0,te.registerModal)({name:n,load:r,moduleName:t})}else console.error("The modal ".concat(n," from ").concat(t," is missing a 'component' entry and thus cannot be registered.\nTo fix this, ensure that you define a 'component' field inside the modal definition."),e);else console.error("A modal definition in ".concat(t,' is missing an name and thus cannot be\nregistered. To fix this, ensure that you define the "name" field inside the\nmodal definition.'),e)}(t,e):console.warn("A modal for ".concat(t," could not be registered as it does not appear to have the required properties"),e)})),c.forEach((function(e){e&&"object"===(void 0===e?"undefined":re(e))&&Object.hasOwn(e,"name")&&Object.hasOwn(e,"component")?function(t,e){var n=e.name;if(n){var r=e.title;if(r)if(e.component||e.load){var o=void 0;if(e.component)o=l(t,e.component);else if(e.load){if("function"!=typeof e.load)return void console.error("The workspace ".concat(n," from ").concat(t," declares a 'load' property that is not a function. This is not\nsupported, so the workspace will not be loaded."));o=e.load}o&&(0,te.registerWorkspace)({name:n,title:r,load:o,moduleName:t,type:e.type,canHide:e.canHide,canMaximize:e.canMaximize,width:e.width,hasOwnSidebar:e.hasOwnSidebar,sidebarFamily:e.sidebarFamily,preferredWindowSize:e.preferredWindowSize})}else console.error("The workspace ".concat(n," from ").concat(t," is missing a 'component' entry and thus cannot be registered.\nTo fix this, ensure that you define a 'component' field inside the workspace definition."),e);else console.error("A workspace definition in ".concat(t,' is missing a title and thus cannot be registered.\nTo fix this, ensure that you define the "title" field inside the workspace definition.'),e)}else console.error("A workspace definition in ".concat(t,' is missing a name and thus cannot be registered.\nTo fix this, ensure that you define the "name" field inside the workspace definition.'),e)}(t,e):console.warn("A workspace for ".concat(t," could not be registered as it does not appear to have the required properties"),e)})),f.forEach((function(e){e&&"object"===(void 0===e?"undefined":re(e))&&Object.hasOwn(e,"featureFlag")?function(t,e){e.flagName?e.label?e.description?(0,Zt.registerFeatureFlag)(e.flagName,e.label,e.description):console.error("A feature flag definition in ".concat(t,' is missing a description and thus cannot be registered.\nTo fix this, ensure that you define the "description" field inside the feature flag definition.'),e):console.error("A feature flag definition in ".concat(t,' is missing a description and thus cannot be registered.\nTo fix this, ensure that you define the "label" field inside the feature flag definition.'),e):console.error("A feature flag definition in ".concat(t,' is missing a name and thus cannot be registered.\nTo fix this, ensure that you define the "name" field inside the feature flag definition.'),e)}(t,e):console.warn("A feature flag for ".concat(t," could not be registered as it does not appear to have the required properties"),e)}))}}function ue(){oe.sort((function(t,e){var n=t.order-e.order;return 0!=n?n:t.appName.localeCompare(e.appName,"en")}));var t=new Map,e=!0,n=!1,r=void 0;try{for(var o,i=oe[Symbol.iterator]();!(e=(o=i.next()).done);e=!0){var a=o.value;t.has(a.appName)?t.set(a.appName,t.get(a.appName)+1):t.set(a.appName,0);var u=t.get(a.appName),s="".concat(a.appName,"-page-").concat(u),c=document.createElement("div");c.id="single-spa-application:".concat(s),document.body.appendChild(c),se(s,a)}}catch(t){n=!0,r=t}finally{try{e||null==i.return||i.return()}finally{if(n)throw r}}}function se(t,e){var n=void 0!==e.route?e.route:void 0!==e.routeRegex&&new RegExp(e.routeRegex);if(!1!==n)if(e.component){var r=function(t,e){var n=e.online,r=e.offline,o=e.featureFlag;return window.offlineEnabled?function(e){return!!(navigator.onLine&&(null==n||n)||!navigator.onLine&&null!=r&&r)&&!(o&&!(0,Zt.getFeatureFlag)(o))&&t(e)}:t}(ie(n),e);Nt(t,l(e.appName,e.component),r)}else console.warn('A registered page definition is missing a component and thus cannot be registered.\nTo fix this, ensure that you define the "component" field inside the page definition.',t);else console.warn('A registered page definition is missing a route and thus cannot be registered.\nTo fix this, ensure that you define the "route" (or alternatively the "routeRegex") field inside the extension definition.',t)}function ce(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function le(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}var fe=(0,n(2238).canAccessStorage)();function pe(t,e){if(fe){if("string"==typeof e){if(e.startsWith("http"))return ve(t,e);try{var n=JSON.parse(e);if(ye(n))return ve(t,n);console.error("The supplied routes for ".concat(t," is not a valid OpenmrsAppRoutes object"),e)}catch(e){console.error("Could not add routes override for ".concat(t,": "),e)}}else{if(r=e,null!=(o=URL)&&"undefined"!=typeof Symbol&&o[Symbol.hasInstance]?o[Symbol.hasInstance](r):r instanceof o)return ve(t,e.toString());if(ye(e))return ve(t,e)}var r,o;console.error("Override for ".concat(t," is not in a valid format. Expected either a Javascript Object, a JSON string of a Javascript object, or a URL"),e)}}function he(t){if(fe){var e=r+t;localStorage.removeItem(e)}}function de(){if(fe)for(var t=window.localStorage,e=0;e<t.length;e++){var n=t.key(e);(null==n?void 0:n.startsWith(r))&&t.removeItem(n)}}function ve(t,e){var n=r+t;localStorage.setItem(n,JSON.stringify(e))}function ye(t){if(t&&"object"===(void 0===t?"undefined":le(t))){var e=Object.prototype.hasOwnProperty,n=t;return!!((!e.call(t,"pages")||Boolean(n.pages)&&Array.isArray(n.pages))&&(!e.call(t,"extensions")||Boolean(n.extensions)&&Array.isArray(n.extensions))&&(!e.call(t,"workspaces")||Boolean(n.workspaces)&&Array.isArray(n.workspaces))&&(!e.call(t,"modals")||Boolean(n.modals)&&Array.isArray(n.modals)))}return!1}function ge(t){if(t&&"object"===(void 0===t?"undefined":le(t))){var e=t;return Object.entries(e).every((function(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return ce(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ce(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t,2),n=e[0],r=e[1];return"string"==typeof n&&ye(r)}))}return!1}},5297:()=>{System.register([],(function(t,e){return{execute:function(){t(function(){"use strict";var t=function(t,e){var n=s[t];if(n)return n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value.setState(e,!0),n.active=!0,n.value;var r=u()((function(){return e}));return s[t]={value:r,active:!0},r},e=function(t,e){var n=s[t];return n?(n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value=e,n.active=!0,n.value):(s[t]={value:e,active:!0},e)},n=function(t,e){var n=s[t];if(!n){var r=u()((function(){return null!=e?e:{}}));return s[t]={value:r,active:!1},r}return n.value},r=function(t,e,n){var r=e(t.getState());return t.subscribe((function(t){var o=e(t);o!==r&&(r=o,n(o))}))},o={d:function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},i={};o.r(i),o.d(i,{createGlobalStore:function(){return t},getGlobalStore:function(){return n},registerGlobalStore:function(){return e},subscribeTo:function(){return r}});var a=function(t){var e,n=new Set,r=function(t,r){var o,i="function"==typeof t?t(e):t;if(!Object.is(i,e)){var a=e;e=(null!=r?r:"object"!=(void 0===i?"undefined":(o=i)&&"undefined"!=typeof Symbol&&o.constructor===Symbol?"symbol":typeof o))?i:Object.assign({},e,i),n.forEach((function(t){return t(e,a)}))}},o=function(){return e},i={setState:r,getState:o,subscribe:function(t){return n.add(t),function(){return n.delete(t)}},destroy:function(){console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return e=t(r,o,i),i},u=function(t){return t?a(t):a},s={};return setTimeout((function(){"development"===window.spaEnv&&(window.stores=s)}),1e3),i}())}}}))},5961:(t,e,n)=>{function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function o(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)}function i(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var a=t.apply(e,n);function u(t){o(a,r,i,u,s,"next",t)}function s(t){o(a,r,i,u,s,"throw",t)}u(void 0)}))}}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function u(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}function s(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t,e)||f(t,e)||function(){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 c(t){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||f(t)||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 l(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}function f(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}function p(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}System.register(["@openmrs/esm-error-handling","@openmrs/esm-extensions","@openmrs/esm-navigation","@openmrs/esm-react-utils","@openmrs/esm-state","@openmrs/esm-translations","dayjs","react","react-dom","rxjs"],(function(t,e){var r={},o={},f={},h={},d={},v={},y={},g={},m={},b={};return Object.defineProperty(g,"__esModule",{value:!0}),Object.defineProperty(m,"__esModule",{value:!0}),{setters:[function(){},function(){},function(){},function(){},function(t){d.createGlobalStore=t.createGlobalStore},function(){},function(){},function(t){Object.keys(t).forEach((function(e){g[e]=t[e]}))},function(t){Object.keys(t).forEach((function(e){m[e]=t[e]}))},function(t){b.Subject=t.Subject}],execute:function(){t(function(){var t={976:function(t,e){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var t,e=[],n=0;n<arguments.length;n++){var i=arguments[n];if(i){var a=void 0===i?"undefined":(t=i)&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":void 0===t?"undefined":l(t);if("string"===a||"number"===a)e.push(i);else if(Array.isArray(i)){if(i.length){var u=o.apply(null,i);u&&e.push(u)}}else if("object"===a){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]")){e.push(i.toString());continue}for(var s in i)r.call(i,s)&&i[s]&&e.push(s)}}}return e.join(" ")}t.exports?(o.default=o,t.exports=o):void 0===(n=function(){return o}.apply(e,[]))||(t.exports=n)}()},353:function(t,e,n){!function(e){"use strict";var r=function(t){return function(e,n){return"object"==(void 0===e?"undefined":l(e))&&(n=e,e=null),null==e&&(e=(new Date).toString()),n||(n={}),t.call(this,e,n)}},o=n(42),i=t.exports={generate:r((function(t,e){return new o(t,e)}))};e&&(e.fn.geopattern=r((function(t,n){return this.each((function(){var r=e(this).attr("data-title-sha");r&&(n=e.extend({hash:r},n));var o=i.generate(t,n);e(this).css("background-image",o.toDataUrl())}))})))}("undefined"!=typeof jQuery?jQuery:null)},851:function(t){"use strict";t.exports={hex2rgb:function(t){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r}));var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null},rgb2hex:function(t){return"#"+["r","g","b"].map((function(e){return("0"+t[e].toString(16)).slice(-2)})).join("")},rgb2hsl:function(t){var e=t.r,n=t.g,r=t.b;e/=255,n/=255,r/=255;var o,i,a=Math.max(e,n,r),u=Math.min(e,n,r),s=(a+u)/2;if(a===u)o=i=0;else{var c=a-u;switch(i=s>.5?c/(2-a-u):c/(a+u),a){case e:o=(n-r)/c+(n<r?6:0);break;case n:o=(r-e)/c+2;break;case r:o=(e-n)/c+4}o/=6}return{h:o,s:i,l:s}},hsl2rgb:function(t){var e,n,r,o=function(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t},i=t.h,a=t.s,u=t.l;if(0===a)e=n=r=u;else{var s=u<.5?u*(1+a):u+a-u*a,c=2*u-s;e=o(c,s,i+1/3),n=o(c,s,i),r=o(c,s,i-1/3)}return{r:Math.round(255*e),g:Math.round(255*n),b:Math.round(255*r)}},rgb2rgbString:function(t){return"rgb("+[t.r,t.g,t.b].join(",")+")"}}},42:function(t,e,n){"use strict";var r=function(t,e,n){return parseInt(t.substr(e,n||1),16)},o=function(t,e,n,r,o){return(parseFloat(t)-e)*(o-r)/(n-e)+r},i=function(t){return t%2==0?m:g},a=function(t){return o(t,0,15,O,S)},u=function(t){return[[t,0,t,3*t],[0,t,3*t,t]]},s=function(t){return[0,0,t,t,0,t,0,0].join(",")},c=function(t,e,n,r,o){var u=s(r),c=a(o[0]),l=i(o[0]),f={stroke:b,"stroke-opacity":w,"fill-opacity":c,fill:l};t.polyline(u,f).transform({translate:[e+r,n],scale:[-1,1]}),t.polyline(u,f).transform({translate:[e+r,n+2*r],scale:[1,-1]}),c=a(o[1]),l=i(o[1]),f={stroke:b,"stroke-opacity":w,"fill-opacity":c,fill:l},t.polyline(u,f).transform({translate:[e+r,n+2*r],scale:[-1,-1]}),t.polyline(u,f).transform({translate:[e+r,n],scale:[1,1]})},l=function(t,e,n,r,o){var u=a(o),c=i(o),l=s(r),f={stroke:b,"stroke-opacity":w,"fill-opacity":u,fill:c};t.polyline(l,f).transform({translate:[e,n+r],scale:[1,-1]}),t.polyline(l,f).transform({translate:[e+2*r,n+r],scale:[-1,-1]}),t.polyline(l,f).transform({translate:[e,n+r],scale:[1,1]}),t.polyline(l,f).transform({translate:[e+2*r,n+r],scale:[-1,1]})},f=n(495),p=n(851),h=n(451),d=n(138),v={baseColor:"#933c3c"},y=["octogons","overlappingCircles","plusSigns","xes","sineWaves","hexagons","overlappingRings","plaid","triangles","squares","concentricCircles","diamonds","tessellation","nestedSquares","mosaicSquares","chevrons"],g="#222",m="#ddd",b="#000",w=.02,O=.02,S=.15,E=t.exports=function(t,e){return this.opts=f({},v,e),this.hash=e.hash||h(t),this.svg=new d,this.generateBackground(),this.generatePattern(),this};E.prototype.toSvg=function(){return this.svg.toString()},E.prototype.toString=function(){return this.toSvg()},E.prototype.toBase64=function(){var t=this.toSvg();return"undefined"!=typeof window&&"function"==typeof window.btoa?window.btoa(t):new Buffer(t).toString("base64")},E.prototype.toDataUri=function(){return"data:image/svg+xml;base64,"+this.toBase64()},E.prototype.toDataUrl=function(){return'url("'+this.toDataUri()+'")'},E.prototype.generateBackground=function(){var t,e,n,i;this.opts.color?n=p.hex2rgb(this.opts.color):(e=o(r(this.hash,14,3),0,4095,0,359),i=r(this.hash,17),(t=p.rgb2hsl(p.hex2rgb(this.opts.baseColor))).h=(360*t.h-e+360)%360/360,t.s=i%2==0?Math.min(1,(100*t.s+i)/100):Math.max(0,(100*t.s-i)/100),n=p.hsl2rgb(t)),this.color=p.rgb2hex(n),this.svg.rect(0,0,"100%","100%",{fill:p.rgb2rgbString(n)})},E.prototype.generatePattern=function(){var t=this.opts.generator;if(t){if(y.indexOf(t)<0)throw new Error("The generator "+t+" does not exist.")}else t=y[r(this.hash,20)];return this["geo"+t.slice(0,1).toUpperCase()+t.slice(1)]()},E.prototype.geoHexagons=function(){var t,e,n,u,s,c,l,f=o(r(this.hash,0),0,15,8,60),p=f*Math.sqrt(3),h=2*f,d=function(t){var e=t,n=e/2,r=Math.sin(60*Math.PI/180)*e;return[0,r,n,0,n+e,0,2*e,r,n+e,2*r,n,2*r,0,r].join(",")}(f);for(this.svg.setWidth(3*h+3*f),this.svg.setHeight(6*p),e=0,l=0;l<6;l++)for(c=0;c<6;c++)t=c%2==0?l*p:l*p+p/2,n=a(s=r(this.hash,e)),u={fill:i(s),"fill-opacity":n,stroke:b,"stroke-opacity":w},this.svg.polyline(d,u).transform({translate:[c*f*1.5-h/2,t-p/2]}),0===c&&this.svg.polyline(d,u).transform({translate:[6*f*1.5-h/2,t-p/2]}),0===l&&(t=c%2==0?6*p:6*p+p/2,this.svg.polyline(d,u).transform({translate:[c*f*1.5-h/2,t-p/2]})),0===c&&0===l&&this.svg.polyline(d,u).transform({translate:[6*f*1.5-h/2,5*p+p/2]}),e++},E.prototype.geoSineWaves=function(){var t,e,n,u,s,c,l=Math.floor(o(r(this.hash,0),0,15,100,400)),f=Math.floor(o(r(this.hash,1),0,15,30,100)),p=Math.floor(o(r(this.hash,2),0,15,3,30));for(this.svg.setWidth(l),this.svg.setHeight(36*p),t=0;t<36;t++)e=a(s=r(this.hash,t)),u={fill:"none",stroke:i(s),opacity:e,"stroke-width":p+"px"},n="M0 "+f+" C "+(c=l/4*.7)+" 0, "+(l/2-c)+" 0, "+l/2+" "+f+" S "+(l-c)+" "+2*f+", "+l+" "+f+" S "+(1.5*l-c)+" 0, "+1.5*l+", "+f,this.svg.path(n,u).transform({translate:[-l/4,p*t-1.5*f]}),this.svg.path(n,u).transform({translate:[-l/4,p*t-1.5*f+36*p]})},E.prototype.geoChevrons=function(){var t,e,n,u,s,c,l,f,p,h,d=o(r(this.hash,0),0,15,30,80),v=o(r(this.hash,0),0,15,30,80),y=[[0,0,(t=d)/2,(e=v)-(n=.66*e),t/2,e,0,n,0,0],[t/2,e-n,t,0,t,n,t/2,e,t/2,e-n]].map((function(t){return t.join(",")}));for(this.svg.setWidth(6*d),this.svg.setHeight(6*v*.66),s=0,h=0;h<6;h++)for(p=0;p<6;p++)c=a(f=r(this.hash,s)),u=i(f),l={stroke:b,"stroke-opacity":w,fill:u,"fill-opacity":c,"stroke-width":1},this.svg.group(l).transform({translate:[p*d,h*v*.66-v/2]}).polyline(y).end(),0===h&&this.svg.group(l).transform({translate:[p*d,6*v*.66-v/2]}).polyline(y).end(),s+=1},E.prototype.geoPlusSigns=function(){var t,e,n,s,c,l,f,p=o(r(this.hash,0),0,15,10,25),h=3*p,d=u(p);for(this.svg.setWidth(12*p),this.svg.setHeight(12*p),e=0,f=0;f<6;f++)for(l=0;l<6;l++)n=a(c=r(this.hash,e)),t=f%2==0?0:1,s={fill:i(c),stroke:b,"stroke-opacity":w,"fill-opacity":n},this.svg.group(s).transform({translate:[l*h-l*p+t*p-p,f*h-f*p-h/2]}).rect(d).end(),0===l&&this.svg.group(s).transform({translate:[4*h-l*p+t*p-p,f*h-f*p-h/2]}).rect(d).end(),0===f&&this.svg.group(s).transform({translate:[l*h-l*p+t*p-p,4*h-f*p-h/2]}).rect(d).end(),0===l&&0===f&&this.svg.group(s).transform({translate:[4*h-l*p+t*p-p,4*h-f*p-h/2]}).rect(d).end(),e++},E.prototype.geoXes=function(){var t,e,n,s,c,l,f,p=o(r(this.hash,0),0,15,10,25),h=u(p),d=3*p*.943;for(this.svg.setWidth(3*d),this.svg.setHeight(3*d),e=0,f=0;f<6;f++)for(l=0;l<6;l++)n=a(c=r(this.hash,e)),t=l%2==0?f*d-.5*d:f*d-.5*d+d/4,s={fill:i(c),opacity:n},this.svg.group(s).transform({translate:[l*d/2-d/2,t-f*d/2],rotate:[45,d/2,d/2]}).rect(h).end(),0===l&&this.svg.group(s).transform({translate:[6*d/2-d/2,t-f*d/2],rotate:[45,d/2,d/2]}).rect(h).end(),0===f&&(t=l%2==0?6*d-d/2:6*d-d/2+d/4,this.svg.group(s).transform({translate:[l*d/2-d/2,t-6*d/2],rotate:[45,d/2,d/2]}).rect(h).end()),5===f&&this.svg.group(s).transform({translate:[l*d/2-d/2,t-11*d/2],rotate:[45,d/2,d/2]}).rect(h).end(),0===l&&0===f&&this.svg.group(s).transform({translate:[6*d/2-d/2,t-6*d/2],rotate:[45,d/2,d/2]}).rect(h).end(),e++},E.prototype.geoOverlappingCircles=function(){var t,e,n,u,s,c,l=o(r(this.hash,0),0,15,25,200)/2;for(this.svg.setWidth(6*l),this.svg.setHeight(6*l),t=0,c=0;c<6;c++)for(s=0;s<6;s++)e=a(u=r(this.hash,t)),n={fill:i(u),opacity:e},this.svg.circle(s*l,c*l,l,n),0===s&&this.svg.circle(6*l,c*l,l,n),0===c&&this.svg.circle(s*l,6*l,l,n),0===s&&0===c&&this.svg.circle(6*l,6*l,l,n),t++},E.prototype.geoOctogons=function(){var t,e,n,u,s,c,l=o(r(this.hash,0),0,15,10,60),f=function(t){var e=.33*t;return[e,0,t-e,0,t,e,t,t-e,t-e,t,e,t,0,t-e,0,e,e,0].join(",")}(l);for(this.svg.setWidth(6*l),this.svg.setHeight(6*l),e=0,c=0;c<6;c++)for(s=0;s<6;s++)n=a(u=r(this.hash,e)),t=i(u),this.svg.polyline(f,{fill:t,"fill-opacity":n,stroke:b,"stroke-opacity":w}).transform({translate:[s*l,c*l]}),e+=1},E.prototype.geoSquares=function(){var t,e,n,u,s,c,l=o(r(this.hash,0),0,15,10,60);for(this.svg.setWidth(6*l),this.svg.setHeight(6*l),e=0,c=0;c<6;c++)for(s=0;s<6;s++)n=a(u=r(this.hash,e)),t=i(u),this.svg.rect(s*l,c*l,l,l,{fill:t,"fill-opacity":n,stroke:b,"stroke-opacity":w}),e+=1},E.prototype.geoConcentricCircles=function(){var t,e,n,u,s,c,l=o(r(this.hash,0),0,15,10,60),f=l/5;for(this.svg.setWidth(6*(l+f)),this.svg.setHeight(6*(l+f)),e=0,c=0;c<6;c++)for(s=0;s<6;s++)n=a(u=r(this.hash,e)),t=i(u),this.svg.circle(s*l+s*f+(l+f)/2,c*l+c*f+(l+f)/2,l/2,{fill:"none",stroke:t,opacity:n,"stroke-width":f+"px"}),n=a(u=r(this.hash,39-e)),t=i(u),this.svg.circle(s*l+s*f+(l+f)/2,c*l+c*f+(l+f)/2,l/4,{fill:t,"fill-opacity":n}),e+=1},E.prototype.geoOverlappingRings=function(){var t,e,n,u,s,c,l=o(r(this.hash,0),0,15,10,60),f=l/4;for(this.svg.setWidth(6*l),this.svg.setHeight(6*l),t=0,c=0;c<6;c++)for(s=0;s<6;s++)e=a(u=r(this.hash,t)),n={fill:"none",stroke:i(u),opacity:e,"stroke-width":f+"px"},this.svg.circle(s*l,c*l,l-f/2,n),0===s&&this.svg.circle(6*l,c*l,l-f/2,n),0===c&&this.svg.circle(s*l,6*l,l-f/2,n),0===s&&0===c&&this.svg.circle(6*l,6*l,l-f/2,n),t+=1},E.prototype.geoTriangles=function(){var t,e,n,u,s,c,l,f=o(r(this.hash,0),0,15,15,80),p=f/2*Math.sqrt(3),h=function(t,e){var n=t/2;return[n,0,t,e,0,e,n,0].join(",")}(f,p);for(this.svg.setWidth(3*f),this.svg.setHeight(6*p),t=0,l=0;l<6;l++)for(c=0;c<6;c++)e=a(s=r(this.hash,t)),u={fill:i(s),"fill-opacity":e,stroke:b,"stroke-opacity":w},n=l%2==0?c%2==0?180:0:c%2!=0?180:0,this.svg.polyline(h,u).transform({translate:[c*f*.5-f/2,p*l],rotate:[n,f/2,p/2]}),0===c&&this.svg.polyline(h,u).transform({translate:[6*f*.5-f/2,p*l],rotate:[n,f/2,p/2]}),t+=1},E.prototype.geoDiamonds=function(){var t,e,n,u,s,c,l,f,p,h=o(r(this.hash,0),0,15,10,50),d=o(r(this.hash,1),0,15,10,50),v=[(t=h)/2,0,t,(e=d)/2,t/2,e,0,e/2].join(",");for(this.svg.setWidth(6*h),this.svg.setHeight(3*d),u=0,p=0;p<6;p++)for(f=0;f<6;f++)s=a(l=r(this.hash,u)),c={fill:i(l),"fill-opacity":s,stroke:b,"stroke-opacity":w},n=p%2==0?0:h/2,this.svg.polyline(v,c).transform({translate:[f*h-h/2+n,d/2*p-d/2]}),0===f&&this.svg.polyline(v,c).transform({translate:[6*h-h/2+n,d/2*p-d/2]}),0===p&&this.svg.polyline(v,c).transform({translate:[f*h-h/2+n,d/2*6-d/2]}),0===f&&0===p&&this.svg.polyline(v,c).transform({translate:[6*h-h/2+n,d/2*6-d/2]}),u+=1},E.prototype.geoNestedSquares=function(){var t,e,n,u,s,c,l=o(r(this.hash,0),0,15,4,12),f=7*l;for(this.svg.setWidth(6*(f+l)+6*l),this.svg.setHeight(6*(f+l)+6*l),t=0,c=0;c<6;c++)for(s=0;s<6;s++)e=a(u=r(this.hash,t)),n={fill:"none",stroke:i(u),opacity:e,"stroke-width":l+"px"},this.svg.rect(s*f+s*l*2+l/2,c*f+c*l*2+l/2,f,f,n),e=a(u=r(this.hash,39-t)),n={fill:"none",stroke:i(u),opacity:e,"stroke-width":l+"px"},this.svg.rect(s*f+s*l*2+l/2+2*l,c*f+c*l*2+l/2+2*l,3*l,3*l,n),t+=1},E.prototype.geoMosaicSquares=function(){var t,e,n,i=o(r(this.hash,0),0,15,15,50);for(this.svg.setWidth(8*i),this.svg.setHeight(8*i),t=0,n=0;n<4;n++)for(e=0;e<4;e++)e%2==0?n%2==0?l(this.svg,e*i*2,n*i*2,i,r(this.hash,t)):c(this.svg,e*i*2,n*i*2,i,[r(this.hash,t),r(this.hash,t+1)]):n%2==0?c(this.svg,e*i*2,n*i*2,i,[r(this.hash,t),r(this.hash,t+1)]):l(this.svg,e*i*2,n*i*2,i,r(this.hash,t)),t+=1},E.prototype.geoPlaid=function(){var t,e,n,o,u,s,c=0,l=0;for(e=0;e<36;)c+=r(this.hash,e)+5,n=a(s=r(this.hash,e+1)),t=i(s),o=s+5,this.svg.rect(0,c,"100%",o,{opacity:n,fill:t}),c+=o,e+=2;for(e=0;e<36;)l+=r(this.hash,e)+5,n=a(s=r(this.hash,e+1)),t=i(s),u=s+5,this.svg.rect(l,0,u,"100%",{opacity:n,fill:t}),l+=u,e+=2;this.svg.setWidth(l),this.svg.setHeight(c)},E.prototype.geoTessellation=function(){var t,e,n,u,s,c=o(r(this.hash,0),0,15,5,40),l=c*Math.sqrt(3),f=2*c,p=c/2*Math.sqrt(3),h=function(t,e){return[0,0,e,t/2,0,t,0,0].join(",")}(c,p),d=3*c+2*p,v=2*l+2*c;for(this.svg.setWidth(d),this.svg.setHeight(v),e=0;e<20;e++)switch(n=a(s=r(this.hash,e)),t=i(s),u={stroke:b,"stroke-opacity":w,fill:t,"fill-opacity":n,"stroke-width":1},e){case 0:this.svg.rect(-c/2,-c/2,c,c,u),this.svg.rect(d-c/2,-c/2,c,c,u),this.svg.rect(-c/2,v-c/2,c,c,u),this.svg.rect(d-c/2,v-c/2,c,c,u);break;case 1:this.svg.rect(f/2+p,l/2,c,c,u);break;case 2:this.svg.rect(-c/2,v/2-c/2,c,c,u),this.svg.rect(d-c/2,v/2-c/2,c,c,u);break;case 3:this.svg.rect(f/2+p,1.5*l+c,c,c,u);break;case 4:this.svg.polyline(h,u).transform({translate:[c/2,-c/2],rotate:[0,c/2,p/2]}),this.svg.polyline(h,u).transform({translate:[c/2,v- -c/2],rotate:[0,c/2,p/2],scale:[1,-1]});break;case 5:this.svg.polyline(h,u).transform({translate:[d-c/2,-c/2],rotate:[0,c/2,p/2],scale:[-1,1]}),this.svg.polyline(h,u).transform({translate:[d-c/2,v+c/2],rotate:[0,c/2,p/2],scale:[-1,-1]});break;case 6:this.svg.polyline(h,u).transform({translate:[d/2+c/2,l/2]});break;case 7:this.svg.polyline(h,u).transform({translate:[d-d/2-c/2,l/2],scale:[-1,1]});break;case 8:this.svg.polyline(h,u).transform({translate:[d/2+c/2,v-l/2],scale:[1,-1]});break;case 9:this.svg.polyline(h,u).transform({translate:[d-d/2-c/2,v-l/2],scale:[-1,-1]});break;case 10:this.svg.polyline(h,u).transform({translate:[c/2,v/2-c/2]});break;case 11:this.svg.polyline(h,u).transform({translate:[d-c/2,v/2-c/2],scale:[-1,1]});break;case 12:this.svg.rect(0,0,c,c,u).transform({translate:[c/2,c/2],rotate:[-30,0,0]});break;case 13:this.svg.rect(0,0,c,c,u).transform({scale:[-1,1],translate:[c/2-d,c/2],rotate:[-30,0,0]});break;case 14:this.svg.rect(0,0,c,c,u).transform({translate:[c/2,v/2-c/2-c],rotate:[30,0,c]});break;case 15:this.svg.rect(0,0,c,c,u).transform({scale:[-1,1],translate:[c/2-d,v/2-c/2-c],rotate:[30,0,c]});break;case 16:this.svg.rect(0,0,c,c,u).transform({scale:[1,-1],translate:[c/2,v/2-v-c/2-c],rotate:[30,0,c]});break;case 17:this.svg.rect(0,0,c,c,u).transform({scale:[-1,-1],translate:[c/2-d,v/2-v-c/2-c],rotate:[30,0,c]});break;case 18:this.svg.rect(0,0,c,c,u).transform({scale:[1,-1],translate:[c/2,c/2-v],rotate:[-30,0,0]});break;case 19:this.svg.rect(0,0,c,c,u).transform({scale:[-1,-1],translate:[c/2-d,c/2-v],rotate:[-30,0,0]})}}},451:function(t){"use strict";var e=function(){var t=function(){for(var t=16;t<80;t++){var e=s[t-3]^s[t-8]^s[t-14]^s[t-16];s[t]=e<<1|e>>>31}var n,l,f=r,p=o,h=i,d=a,v=u;for(t=0;t<80;t++){t<20?(n=d^p&(h^d),l=1518500249):t<40?(n=p^h^d,l=1859775393):t<60?(n=p&h|d&(p|h),l=2400959708):(n=p^h^d,l=3395469782);var y=(f<<5|f>>>27)+n+v+l+(0|s[t]);v=d,d=h,h=p<<30|p>>>2,p=f,f=y}for(r=r+f|0,o=o+p|0,i=i+h|0,a=a+d|0,u=u+v|0,c=0,t=0;t<16;t++)s[t]=0},e=function(e){s[c]|=(255&e)<<l,l?l-=8:(c++,l=24),16===c&&t()},n=function(t){for(var e="",n=28;n>=0;n-=4)e+=(t>>n&15).toString(16);return e},r=1732584193,o=4023233417,i=2562383102,a=271733878,u=3285377520,s=new Uint32Array(80),c=0,l=24,f=0;return{update:function(t){if("string"==typeof t)return function(t){var n=t.length;f+=8*n;for(var r=0;r<n;r++)e(t.charCodeAt(r))}(t);var n=t.length;f+=8*n;for(var r=0;r<n;r++)e(t[r])},digest:function(){e(128),(c>14||14===c&&l<24)&&t(),c=14,l=24,e(0),e(0),e(f>0xffffffffff?f/1099511627776:0),e(f>4294967295?f/4294967296:0);for(var s=24;s>=0;s-=8)e(f>>s);return n(r)+n(o)+n(i)+n(a)+n(u)}}};t.exports=function(t){if(void 0===t)return e();var n=e();return n.update(t),n.digest()}},138:function(t,e,n){"use strict";var r=function(){return this.width=100,this.height=100,this.svg=i("svg"),this.context=[],this.setAttributes(this.svg,{xmlns:"http://www.w3.org/2000/svg",width:this.width,height:this.height}),this},o=n(495),i=n(97);t.exports=r,r.prototype.currentContext=function(){return this.context[this.context.length-1]||this.svg},r.prototype.end=function(){return this.context.pop(),this},r.prototype.currentNode=function(){var t=this.currentContext();return t.lastChild||t},r.prototype.transform=function(t){return this.currentNode().setAttribute("transform",Object.keys(t).map((function(e){return e+"("+t[e].join(",")+")"})).join(" ")),this},r.prototype.setAttributes=function(t,e){Object.keys(e).forEach((function(n){t.setAttribute(n,e[n])}))},r.prototype.setWidth=function(t){this.svg.setAttribute("width",Math.floor(t))},r.prototype.setHeight=function(t){this.svg.setAttribute("height",Math.floor(t))},r.prototype.toString=function(){return this.svg.toString()},r.prototype.rect=function(t,e,n,r,a){var u=this;if(Array.isArray(t))return t.forEach((function(t){u.rect.apply(u,t.concat(a))})),this;var s=i("rect");return this.currentContext().appendChild(s),this.setAttributes(s,o({x:t,y:e,width:n,height:r},a)),this},r.prototype.circle=function(t,e,n,r){var a=i("circle");return this.currentContext().appendChild(a),this.setAttributes(a,o({cx:t,cy:e,r:n},r)),this},r.prototype.path=function(t,e){var n=i("path");return this.currentContext().appendChild(n),this.setAttributes(n,o({d:t},e)),this},r.prototype.polyline=function(t,e){var n=this;if(Array.isArray(t))return t.forEach((function(t){n.polyline(t,e)})),this;var r=i("polyline");return this.currentContext().appendChild(r),this.setAttributes(r,o({points:t},e)),this},r.prototype.group=function(t){var e=i("g");return this.currentContext().appendChild(e),this.context.push(e),this.setAttributes(e,o({},t)),this}},97:function(t){"use strict";var e=t.exports=function(t){return(null!=(n=e)&&"undefined"!=typeof Symbol&&n[Symbol.hasInstance]?n[Symbol.hasInstance](this):u(this,n))?(this.tagName=t,this.attributes=Object.create(null),this.children=[],this.lastChild=null,this):new e(t);var n};e.prototype.appendChild=function(t){return this.children.push(t),this.lastChild=t,this},e.prototype.setAttribute=function(t,e){return this.attributes[t]=e,this},e.prototype.toString=function(){var t=this;return["<",t.tagName,Object.keys(t.attributes).map((function(e){return[" ",e,'="',t.attributes[e],'"'].join("")})).join(""),">",t.children.map((function(t){return t.toString()})).join(""),"</",t.tagName,">"].join("")}},495:function(t){var e=function(t){if(!t||"[object Object]"!==r.call(t)||t.nodeType||t.setInterval)return!1;var e,o=n.call(t,"constructor"),i=n.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!o&&!i)return!1;for(e in t);return void 0===e||n.call(t,e)},n=Object.prototype.hasOwnProperty,r=Object.prototype.toString;t.exports=function t(){var n,r,o,i,a,u,s=arguments[0]||{},c=1,f=arguments.length,p=!1;for("boolean"==typeof s&&(p=s,s=arguments[1]||{},c=2),"object"!=(void 0===s?"undefined":l(s))&&"function"!=typeof s&&(s={});c<f;c++)if(null!=(n=arguments[c]))for(r in n)o=s[r],s!==(i=n[r])&&(p&&i&&(e(i)||(a=Array.isArray(i)))?(a?(a=!1,u=o&&Array.isArray(o)?o:[]):u=o&&e(o)?o:{},s[r]=t(p,u,i)):void 0!==i&&(s[r]=i));return s}},279:function(t,e,n){"use strict";var r=n(493);r.createRoot,r.hydrateRoot},978:function(t,e,n){"use strict";var r=function(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!i(t,n)}catch(t){return!0}},o=n(954),i="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},a=o.useState,u=o.useEffect,s=o.useLayoutEffect,c=o.useDebugValue,l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var n=e(),o=a({inst:{value:n,getSnapshot:e}}),i=o[0].inst,l=o[1];return s((function(){i.value=n,i.getSnapshot=e,r(i)&&l({inst:i})}),[t,n,e]),u((function(){return r(i)&&l({inst:i}),t((function(){r(i)&&l({inst:i})}))}),[t]),c(n),n};e.useSyncExternalStore=void 0!==o.useSyncExternalStore?o.useSyncExternalStore:l},921:function(t,e,n){"use strict";t.exports=n(978)},641:function(t,e,n){var r=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},o=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},i=function(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):u(t,e)},a=function(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":void 0===t?"undefined":l(t)};System.register(["@openmrs/esm-config","@openmrs/esm-navigation","@openmrs/esm-error-handling","@openmrs/esm-offline"],(function(t,e){var u={},s={},c={},f={};return{setters:[function(t){u.Type=t.Type,u.defineConfigSchema=t.defineConfigSchema,u.getConfig=t.getConfig,u.validators=t.validators},function(t){s.navigate=t.navigate},function(t){c.reportError=t.reportError},function(t){f.getSynchronizationItems=t.getSynchronizationItems}],execute:function(){t(function(){var t={385:function(){System.register([],(function(t,e){return{execute:function(){t(function(){"use strict";var t=function(t,e){var n=s[t];if(n)return n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value.setState(e,!0),n.active=!0,n.value;var r=u()((function(){return e}));return s[t]={value:r,active:!0},r},e=function(t,e){var n=s[t];return n?(n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value=e,n.active=!0,n.value):(s[t]={value:e,active:!0},e)},n=function(t,e){var n=s[t];if(!n){var r=u()((function(){return null!=e?e:{}}));return s[t]={value:r,active:!1},r}return n.value},r=function(t,e,n){var r=e(t.getState());return t.subscribe((function(t){var o=e(t);o!==r&&(r=o,n(o))}))},o={d:function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},i={};o.r(i),o.d(i,{createGlobalStore:function(){return t},getGlobalStore:function(){return n},registerGlobalStore:function(){return e},subscribeTo:function(){return r}});var a=function(t){var e,n=new Set,r=function(t,r){var o="function"==typeof t?t(e):t;if(!Object.is(o,e)){var i=e;e=(null!=r?r:"object"!=(void 0===o?"undefined":l(o)))?o:Object.assign({},e,o),n.forEach((function(t){return t(e,i)}))}},o=function(){return e},i={setState:r,getState:o,subscribe:function(t){return n.add(t),function(){return n.delete(t)}},destroy:function(){console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return e=t(r,o,i),i},u=function(t){return t?a(t):a},s={};return setTimeout((function(){"development"===window.spaEnv&&(window.stores=s)}),1e3),i}())}}}))},824:function(t){"use strict";t.exports=u},254:function(t){"use strict";t.exports=c},513:function(t){"use strict";t.exports=s},738:function(t){"use strict";t.exports=f}},e={};function p(n){var r=e[n];if(void 0!==r)return r.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,p),o.exports}p.d=function(t,e){for(var n in e)p.o(e,n)&&!p.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},p.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},p.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var h={};return function(){"use strict";var t=function(t,e){function n(){this.constructor=t}ce(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=function(t){return"function"==typeof t},u=function(t){setTimeout((function(){throw t}),0)},s=function(t){return null!==t&&"object"==(void 0===t?"undefined":l(t))},c=function(t){return t.reduce((function(t,e){return t.concat(i(e,ve)?e.errors:e)}),[])},f=function(t){return t},d=function(t){if(t||(t=fe.Promise||Promise),!t)throw new Error("no Promise impl found");return t},v=function(t,e,n){var r=b(t,e,n);Ge.length?Ge.forEach((function(t){return t(r)})):setTimeout((function(){throw r}))},y=function(t){if("function"!=typeof t)throw Error(m(28,!1));Ge.push(t)},g=function(t){if("function"!=typeof t)throw Error(m(29,!1));var e=!1;return Ge=Ge.filter((function(n){var r=n===t;return e=e||r,!r})),e},m=function(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return"single-spa minified message #".concat(t,": ").concat(e?e+" ":"","See https://single-spa.js.org/error/?code=").concat(t).concat(r.length?"&arg=".concat(r.join("&arg=")):"")},b=function(t,e,n){var r,o="".concat(x(e)," '").concat(S(e),"' died in status ").concat(e.status,": ");if(i(t,Error)){try{t.message=o+t.message}catch(t){}r=t}else{console.warn(m(30,!1,e.status,S(e)));try{r=Error(o+JSON.stringify(t))}catch(e){r=t}}return r.appOrParcelName=S(e),e.status=n,r},w=function(t){return t.status===Xe},O=function(t){try{return t.activeWhen(window.location)}catch(e){return v(e,t,rn),!1}},S=function(t){return t.name},E=function(t){return Boolean(t.unmountThisParcel)},x=function(t){return E(t)?"parcel":"application"},P=function(){for(var t=arguments.length-1;t>0;t--)for(var e in arguments[t])"__proto__"!==e&&(arguments[t-1][e]=arguments[t][e]);return arguments[0]},j=function(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return t[n];return null},k=function(t){return t&&("function"==typeof t||(e=t,Array.isArray(e)&&!j(e,(function(t){return"function"!=typeof t}))));var e},A=function(t,e){var n=t[e]||[];0===(n=Array.isArray(n)?n:[n]).length&&(n=[function(){return Promise.resolve()}]);var r=x(t),o=S(t);return function(t){return n.reduce((function(n,i,a){return n.then((function(){var n=i(t);return _(n)?n:Promise.reject(m(15,!1,r,o,e,a))}))}),Promise.resolve())}},_=function(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch},T=function(t,e){return Promise.resolve().then((function(){return t.status!==qe?t:(t.status=Je,t.bootstrap?V(t,"bootstrap").then(n).catch((function(n){if(e)throw b(n,t,rn);return v(n,t,rn),t})):Promise.resolve().then(n))}));function n(){return t.status=Ye,t}},C=function(t,e){return Promise.resolve().then((function(){if(t.status!==Xe)return t;t.status=tn;var n=Object.keys(t.parcels).map((function(e){return t.parcels[e].unmountThisParcel()}));return Promise.all(n).then(r,(function(n){return r().then((function(){var r=Error(n.message);if(e)throw b(r,t,rn);v(r,t,rn)}))})).then((function(){return t}));function r(){return V(t,"unmount").then((function(){t.status=Ye}),(function(n){if(e)throw b(n,t,rn);v(n,t,rn)}))}}))},I=function(t,e){return Promise.resolve().then((function(){return t.status!==Ye?t:(an||(window.dispatchEvent(new We("single-spa:before-first-mount")),an=!0),t.status=Qe,V(t,"mount").then((function(){return t.status=Xe,un||(window.dispatchEvent(new We("single-spa:first-mount")),un=!0),t})).catch((function(n){return t.status=Xe,C(t,!0).then(r,r);function r(){if(e)throw b(n,t,rn);return v(n,t,rn),t}})))}))},M=function(){return D.apply(cn,arguments)},D=function(t,e){var n=this;if(!t||"object"!=(void 0===t?"undefined":l(t))&&"function"!=typeof t)throw Error(m(2,!1));if(t.name&&"string"!=typeof t.name)throw Error(m(3,!1,a(t.name)));var r=sn++,o=t.name||"parcel-".concat(r);if("object"!=(void 0===e?"undefined":l(e)))throw Error(m(4,!1,o,void 0===e?"undefined":a(e)));if(!e.domElement)throw Error(m(5,!1,o));var i,u="function"==typeof t,s=u?t:function(){return Promise.resolve(t)},c={id:r,parcels:{},status:u?$e:qe,customProps:e,parentName:S(n),unmountThisParcel:function(){return v.then((function(){if(c.status!==Xe)throw Error(m(6,!1,o,c.status));return C(c,!0)})).then((function(t){return c.parentName&&delete n.parcels[c.id],t})).then((function(t){return p(t),t})).catch((function(t){throw c.status=rn,h(t),t}))}};n.parcels[r]=c;var f=s();if(!f||"function"!=typeof f.then)throw Error(m(7,!1));f=f.then((function(t){if(!t)throw Error(m(8,!1));if(o=t.name||"parcel-".concat(r),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!k(t.bootstrap))throw Error(m(9,!1,o));if(!k(t.mount))throw Error(m(10,!1,o));if(!k(t.unmount))throw Error(m(11,!1,o));if(t.update&&!k(t.update))throw Error(m(12,!1,o));var e=A(t,"bootstrap"),n=A(t,"mount"),a=A(t,"unmount");c.status=qe,c.name=o,c.bootstrap=e,c.mount=n,c.unmount=a,c.timeouts=z(t.timeouts),t.update&&(c.update=A(t,"update"),i.update=function(t){return c.customProps=t,N((e=c,Promise.resolve().then((function(){if(e.status!==Xe)throw Error(m(32,!1,S(e)));return e.status=Ze,V(e,"update").then((function(){return e.status=Xe,e})).catch((function(t){throw b(t,e,rn)}))}))));var e})}));var p,h,d=f.then((function(){return T(c,!0)})),v=d.then((function(){return I(c,!0)})),y=new Promise((function(t,e){p=t,h=e}));return i={mount:function(){return N(Promise.resolve().then((function(){if(c.status!==Ye)throw Error(m(13,!1,o,c.status));return n.parcels[r]=c,I(c)})))},unmount:function(){return N(c.unmountThisParcel())},getStatus:function(){return c.status},loadPromise:N(f),bootstrapPromise:N(d),mountPromise:N(v),unmountPromise:N(y)}},N=function(t){return t.then((function(){return null}))},R=function(t){var e=S(t),n="function"==typeof t.customProps?t.customProps(e,window.location):t.customProps;("object"!=(void 0===n?"undefined":l(n))||null===n||Array.isArray(n))&&(n={},console.warn(m(40,!1),e,n));var r=P({},n,{name:e,mountParcel:D.bind(t),singleSpa:ze});return E(t)&&(r.unmountSelf=t.unmountThisParcel),r},L=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(m(16,!1));ln.bootstrap={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},U=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(m(17,!1));ln.mount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},B=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(m(18,!1));ln.unmount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},F=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(m(19,!1));ln.unload={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},V=function(t,e){var n=t.timeouts[e],r=n.warningMillis,o=x(t);return new Promise((function(i,a){var u=!1,s=!1;t[e](R(t)).then((function(t){u=!0,i(t)})).catch((function(t){u=!0,a(t)})),setTimeout((function(){return l(1)}),r),setTimeout((function(){return l(!0)}),n.millis);var c=m(31,!1,e,o,S(t),n.millis);function l(t){if(!u)if(!0===t)s=!0,n.dieOnTimeout?a(Error(c)):console.error(c);else if(!s){var e=t,o=e*r;console.warn(c),o+r<n.millis&&setTimeout((function(){return l(e+1)}),r)}}}))},z=function(t){var e={};for(var n in ln)e[n]=P({},ln[n],t&&t[n]||{});return e},H=function(t){return Promise.resolve().then((function(){return t.loadPromise?t.loadPromise:t.status!==Ke&&t.status!==nn?t:(t.status=$e,t.loadPromise=Promise.resolve().then((function(){var r=t.loadApp(R(t));if(!_(r))throw n=!0,Error(m(33,!1,S(t)));return r.then((function(n){var r;t.loadErrorTime=null,"object"!=l(e=n)&&(r=34),Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!k(e.bootstrap)&&(r=35),k(e.mount)||(r=36),k(e.unmount)||(r=37);var o=x(e);if(r){var i;try{i=JSON.stringify(e)}catch(t){}return console.error(m(r,!1,o,S(t),i),e),v(void 0,t,rn),t}return e.devtools&&e.devtools.overlays&&(t.devtools.overlays=P({},t.devtools.overlays,e.devtools.overlays)),t.status=qe,t.bootstrap=A(e,"bootstrap"),t.mount=A(e,"mount"),t.unmount=A(e,"unmount"),t.unload=A(e,"unload"),t.timeouts=z(e.timeouts),delete t.loadPromise,t}))})).catch((function(e){var r;return delete t.loadPromise,n?r=rn:(r=nn,t.loadErrorTime=(new Date).getTime()),v(e,t,r),t})));var e,n}))},W=function(t){var e;if("string"==typeof t)e=t;else if(this&&this.href)e=this.href;else{if(!(t&&t.currentTarget&&t.currentTarget.href&&t.preventDefault))throw Error(m(14,!1));e=t.currentTarget.href,t.preventDefault()}var n=J(window.location.href),r=J(e);0===e.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=e:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,e)},G=function(t){var e=this;if(t){var n=t[0].type;hn.indexOf(n)>=0&&pn[n].forEach((function(n){try{n.apply(e,t)}catch(t){setTimeout((function(){throw t}))}}))}},K=function(){En([],arguments)},$=function(t,e){return function(){var n=window.location.href,r=t.apply(this,arguments),o=window.location.href;return Ve&&n===o||window.dispatchEvent(function(t,e){var n;try{n=new PopStateEvent("popstate",{state:t})}catch(e){(n=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,t)}return n.singleSpa=!0,n.singleSpaTrigger=e,n}(window.history.state,e)),r}},q=function(t){if(vn)throw Error(m(43,!1));Ve=!t||!t.hasOwnProperty("urlRerouteOnly")||t.urlRerouteOnly,vn=!0,dn=window.history.replaceState,window.addEventListener("hashchange",K),window.addEventListener("popstate",K);var e=window.addEventListener,n=window.removeEventListener;window.addEventListener=function(t,n){if(!("function"==typeof n&&hn.indexOf(t)>=0)||j(pn[t],(function(t){return t===n})))return e.apply(this,arguments);pn[t].push(n)},window.removeEventListener=function(t,e){if(!("function"==typeof e&&hn.indexOf(t)>=0))return n.apply(this,arguments);pn[t]=pn[t].filter((function(t){return t!==e}))},window.history.pushState=$(window.history.pushState,"pushState"),window.history.replaceState=$(dn,"replaceState")},J=function(t){var e=document.createElement("a");return e.href=t,e},Y=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!yn){var e=t.fn.on,n=t.fn.off;t.fn.on=function(t,n){return Q.call(this,e,window.addEventListener,t,n,arguments)},t.fn.off=function(t,e){return Q.call(this,n,window.removeEventListener,t,e,arguments)},yn=!0}},Q=function(t,e,n,r,o){return"string"!=typeof n?t.apply(this,o):(n.split(/\s+/).forEach((function(t){hn.indexOf(t)>=0&&(e(t,r),n=n.replace(t,""))})),""===n.trim()?this:t.apply(this,o))},X=function(t){return Promise.resolve().then((function(){var e=gn[S(t)];if(!e)return t;if(t.status===Ke)return Z(t,e),t;if(t.status===en)return e.promise.then((function(){return t}));if(t.status!==Ye&&t.status!==nn)return t;var n=t.status===nn?Promise.resolve():V(t,"unload");return t.status=en,n.then((function(){return Z(t,e),t})).catch((function(n){return function(t,e,n){delete gn[S(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,v(n,t,rn),e.reject(n)}(t,e,n),t}))}))},Z=function(t,e){delete gn[S(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=Ke,e.resolve()},tt=function(t,e,n,r){gn[S(t)]={app:t,resolve:n,reject:r},Object.defineProperty(gn[S(t)],"promise",{get:e})},et=function(t){return gn[t]},nt=function(){return mn.filter(w).map(S)},rt=function(){return mn.map(S)},ot=function(t){var e=j(mn,(function(e){return S(e)===t}));return e?e.status:null},it=function(t,e,n,r){var o=function(t,e,n,r){var o,i={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"==(void 0===t?"undefined":l(t))?(function(t){if(Array.isArray(t)||null===t)throw Error(m(39,!1));var e=["name","app","activeWhen","customProps"],n=Object.keys(t).reduce((function(t,n){return e.indexOf(n)>=0?t:t.concat(n)}),[]);if(0!==n.length)throw Error(m(38,!1,e.join(", "),n.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(m(20,!1));if("object"!=l(t.app)&&"function"!=typeof t.app)throw Error(m(20,!1));var r=function(t){return"string"==typeof t||"function"==typeof t};if(!(r(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(r)))throw Error(m(24,!1));if(!lt(t.customProps))throw Error(m(22,!1))}(t),i.name=t.name,i.loadApp=t.app,i.activeWhen=t.activeWhen,i.customProps=t.customProps):(function(t,e,n,r){if("string"!=typeof t||0===t.length)throw Error(m(20,!1));if(!e)throw Error(m(23,!1));if("function"!=typeof n)throw Error(m(24,!1));if(!lt(r))throw Error(m(22,!1))}(t,e,n,r),i.name=t,i.loadApp=e,i.activeWhen=n,i.customProps=r),i.loadApp="function"!=typeof(o=i.loadApp)?function(){return Promise.resolve(o)}:o,i.customProps=function(t){return t||{}}(i.customProps),i.activeWhen=function(t){var e=Array.isArray(t)?t:[t];return e=e.map((function(t){return"function"==typeof t?t:ft(t)})),function(t){return e.some((function(e){return e(t)}))}}(i.activeWhen),i}(t,e,n,r);if(vt()||bn||(bn=!0,setTimeout((function(){vt()||console.warn(m(1,!1))}),5e3)),-1!==rt().indexOf(o.name))throw Error(m(21,!1,o.name));mn.push(P({loadErrorTime:null,status:Ke,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},o)),fn&&(Y(),En())},at=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return mn.filter((function(e){return e.activeWhen(t)})).map(S)},ut=function(t){if(0===mn.filter((function(e){return S(e)===t})).length)throw Error(m(25,!1,t));return(fn?st(t,{waitForUnmount:!1}):Promise.resolve()).then((function(){var e=mn.map(S).indexOf(t);mn.splice(e,1)}))},st=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof t)throw Error(m(26,!1));var n=j(mn,(function(e){return S(e)===t}));if(!n)throw Error(m(27,!1,t));var r,o=et(S(n));if(e&&e.waitForUnmount){if(o)return o.promise;var i=new Promise((function(t,e){tt(n,(function(){return i}),t,e)}));return i}return o?(r=o.promise,ct(n,o.resolve,o.reject)):r=new Promise((function(t,e){tt(n,(function(){return r}),t,e),ct(n,t,e)})),r},ct=function(t,e,n){Promise.resolve().then((function(){if(j(at(),(function(e){return e===S(t)})))return pt()})).then((function(){return C(t).then(X).then((function(){e(),setTimeout((function(){En()}))}))})).catch(n)},lt=function(t){return!t||"function"==typeof t||"object"==(void 0===t?"undefined":l(t))&&null!==t&&!Array.isArray(t)},ft=function(t,e){var n=function(t,e){var n=0,r=!1,o="^";"/"!==t[0]&&(t="/"+t);for(var i=0;i<t.length;i++){var a=t[i];(!r&&":"===a||r&&"/"===a)&&u(i)}return u(t.length),new RegExp(o,"i");function u(i){var a=t.slice(n,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":a,i===t.length)if(r)e&&(o+="$");else{var u=e?"":".*";o="/"===o.charAt(o.length-1)?"".concat(o).concat(u,"$"):"".concat(o,"(/").concat(u,")?(#.*)?$")}r=!r,n=i}}(t,e);return function(t){var e=t.origin;e||(e="".concat(t.protocol,"//").concat(t.host));var r=t.href.replace(e,"").replace(t.search,"").split("?")[0];return n.test(r)}},pt=function(){return En()},ht=function(t,e){return O(t)?T(t).then((function(t){return e.then((function(){return O(t)?I(t):t}))})):e.then((function(){return t}))},dt=function(t){xn=!0,fn&&(q(t),En())},vt=function(){return xn},yt=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},gt=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},mt=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},bt=function(){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(t){return!1}},wt=function(t){return t&&t.startsWith("http")?t:("/"!==t[0]&&(t="/"+t),window.openmrsBase+t)},Ot=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof t)throw Error("The first argument to @openmrs/api's openmrsFetch function must be a url string");if("object"!=(void 0===e?"undefined":l(e)))throw Error("The second argument to @openmrs/api's openmrsFetch function must be a plain object.");if(!window.openmrsBase)throw Error("@openmrs/api is running in a browser that doesn't have window.openmrsBase, which is provided by openmrs-module-spa's HTML file.");var n=wt(t);if(e.headers||(e.headers={}),Le(e.body)&&(e.body=JSON.stringify(e.body)),void 0===e.headers.Accept&&(e.headers.Accept="application/json"),null===e.headers.Accept&&delete e.headers.Accept,t.startsWith(Cn)&&void 0===e.headers["Disable-WWW-Authenticate"]&&(e.headers["Disable-WWW-Authenticate"]="true"),t.startsWith(In)){var r=new URL(n,window.location.toString());r.searchParams.has("_summary")||(r.searchParams.set("_summary","data"),n=r.toString())}var o,i,a=Error();return window.fetch(n,e).then((o=function(t){var e,r;return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(o){switch(o.label){case 0:return(e=t).ok?204===e.status?(e.data=null,[2,e]):[2,e.clone().text().then((function(t){try{t&&(e.data=JSON.parse(t))}catch(t){}return e}))]:[3,1];case 1:return[4,(0,Ue.getConfig)("@openmrs/esm-api")];case 2:return r=o.sent().redirectAuthFailure,n===wt(Mn)&&403===e.status||r.enabled&&r.errors.includes(e.status)?(sessionStorage.removeItem(jn),(0,Be.navigate)({to:r.url}),[2,r.resolvePromise?Promise.resolve():new Promise((function(){}))]):[2,e.clone().text().then((function(t){var r=t;try{r=JSON.parse(t)}catch(t){}throw new Dn(n,e,r,a)}),(function(t){throw new Dn(n,e,null,a)}))];case 3:return[2]}}))},i=function(){var t=this,e=arguments;return new Promise((function(n,r){var i=o.apply(t,e);function a(t){gt(i,n,r,a,u,"next",t)}function u(t){gt(i,n,r,a,u,"throw",t)}a(void 0)}))},function(t){return i.apply(this,arguments)}))},St=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"!=(void 0===e?"undefined":l(e)))throw Error("The second argument to openmrsObservableFetch must be either omitted or an object");var n=new AbortController;return e.signal=n.signal,new Oe((function(r){var o=!1;return Ot(t,e).then((function(t){o=!0,r.next(t),r.complete()}),(function(t){o=!0,r.error(t)})),function(){o||n.abort()}}))},Et=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},xt=function(t,e){return Ot("".concat(Nn,"/").concat(t),{signal:e.signal})},Pt=function(t,e,n){return Ot("".concat(Nn,"?patient=").concat(t,"&includeEncounterless=").concat(e),{signal:n.signal})},jt=function(t,e){return Rn.apply(this,arguments)},kt=function(t,e){return Ot("".concat(Nn,"/").concat(t),{method:"DELETE",signal:e.signal})},At=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},_t=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){At(i,r,o,a,u,"next",t)}function u(t){At(i,r,o,a,u,"throw",t)}a(void 0)}))}},Tt=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},Ct=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{includeAuthStatus:!0};return(Fn<Date.now()-6e4||!Bn.getState().loaded)&&Dt(),new Oe((function(e){var n=function(n){var r;n.loaded&&(t.includeAuthStatus?e.next(n.session):e.next(null===(r=n.session)||void 0===r?void 0:r.user))};return n(Bn.getState()),Bn.subscribe(n)}))},It=function(){return(Fn<Date.now()-6e4||!Bn.getState().loaded)&&Dt(),Bn},Mt=function(t){var e,n,r,o=null!==(r=null==t||null===(e=t.user)||void 0===e||null===(n=e.userProperties)||void 0===n?void 0:n.defaultLocale)&&void 0!==r?r:t.locale,i=document.documentElement.getAttribute("lang");(function(t){if(void 0===t||"string"!=typeof t)return!1;try{new Intl.Locale(t)}catch(t){return!1}return!0})(o)&&o!==i&&document.documentElement.setAttribute("lang",o)},Dt=function(t,e){Fn=Date.now();var n={};return t&&e&&(n.Authorization="Basic ".concat(window.btoa("".concat(t,":").concat(e)))),Vt(Ot(Mn,{headers:n}))},Nt=function(){Bn.setState({loaded:!0,session:{authenticated:!1,sessionId:""}})},Rt=function(t,e){return void 0===e?Boolean(t):!Boolean(t)||function(t,e){return"string"==typeof t?!Un(e.privileges.find((function(e){return t===e.display}))):Array.isArray(t)?t.every((function(t){return!Un(e.privileges.find((function(e){return t===e.display})))})):(Un(t)||console.error('Could not understand privileges "'.concat(t,'"')),!0)}(t,e)||function(t){return!Un(t.roles.find((function(t){return"System Developer"===t.display})))}(e)},Lt=function(){var t,e;return new Promise((function(n){var r=function(r){r.loaded&&r.session.user&&(t=r.session.user,n(r.session.user),e&&e())};r(Bn.getState()),t||(e=Bn.subscribe(r))}))},Ut=function(){return new Promise((function(t,e){Ct().subscribe((function(e){t(e.sessionLocation)}),e).unsubscribe()}))},Bt=function(t,e){return Vn.apply(this,arguments)},Ft=function(t,e,n){return zn.apply(this,arguments)},Vt=function(t){return new Promise((function(e,n){t.then((function(t){var r;"object"==l(null==t?void 0:t.data)?(r={loaded:!0,session:t.data},Bn.setState(r),e(r)):(r={loaded:!1,session:null},Bn.setState(r),n(r))})).catch((function(t){(0,Ln.reportError)("Failed to fetch new session information: ".concat(t));var e={loaded:!1,session:null};Bn.setState(e),n(e)}))}))},zt=function(){(0,Ue.defineConfigSchema)("@openmrs/esm-api",{redirectAuthFailure:{enabled:{_type:Ue.Type.Boolean,_default:!0,_description:"Whether to redirect logged-out users to `redirectAuthFailure.url`"},url:{_type:Ue.Type.String,_default:"${openmrsSpaBase}/login",_validators:[Ue.validators.isUrl]},errors:{_type:Ue.Type.Array,_default:[401],_elements:{_type:Ue.Type.Number,_validators:[Ue.validators.inRange(100,600)]},_description:"The HTTP error codes for which users will be redirected"},resolvePromise:{_type:Ue.Type.Boolean,_default:!1,_description:"Changes how requests that fail authentication are handled. Try messing with this if redirects to the login page aren't working correctly."}}}),Dt()},Ht=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},Wt=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},Gt=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Wt(i,r,o,a,u,"next",t)}function u(t){Wt(i,r,o,a,u,"throw",t)}a(void 0)}))}},Kt=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Ht(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ht(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},$t=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},qt=function(t,e){return Wn.apply(this,arguments)},Jt=function(t){return Gn.apply(this,arguments)},Yt=function(t){return function(e){return 0===t?Zn:e.lift(new tr(t))}},Qt=function(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new nr(t,e))}},Xt=function(){return(0,Fe.getGlobalStore)("visit",ir)},Zt=function(t,e){Xt().setState({patientUuid:t,manuallySetVisitUuid:e})},te=function(t,e,n){var r=null!=n?n:or;return St("".concat(Cn,"/visit?patient=").concat(t,"&v=").concat(r),{signal:e.signal,method:"GET",headers:{"Content-type":"application/json"}}).pipe(Yt(1)).pipe(Qt((function(t){return t})))},ee=function(t,e){return St("".concat(Cn,"/visit"),{signal:e.signal,method:"POST",headers:{"Content-type":"application/json"},body:t})},ne=function(t,e,n){return St("".concat(Cn,"/visit/").concat(t),{signal:n.signal,method:"POST",headers:{"Content-type":"application/json"},body:e})},re=function(t){return{uuid:t.uuid,display:t.display,name:t.name}},oe=function(){return St("".concat(Cn,"/visittype")).pipe(Qt((function(t){return t.data.results.map(re)}))).pipe(Yt(1))},ie=function(t){return{uuid:t.uuid,display:t.display}},ae=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return St("".concat(Cn,"/location")+(t?"?tag="+t:"")).pipe(Qt((function(t){return t.data.results.map(ie)}))).pipe(Yt(1))};p.r(h),p.d(h,{OpenmrsFetchError:function(){return Dn},VisitMode:function(){return ar},VisitStatus:function(){return ur},attachmentUrl:function(){return Nn},backendDependencies:function(){return cr},clearCurrentUser:function(){return Nt},createAttachment:function(){return jt},defaultVisitCustomRepresentation:function(){return or},deleteAttachmentPermanently:function(){return kt},fetchCurrentPatient:function(){return qt},fhirBaseUrl:function(){return In},getAttachmentByUuid:function(){return xt},getAttachments:function(){return Pt},getCurrentUser:function(){return Ct},getLocations:function(){return ae},getLoggedInUser:function(){return Lt},getSessionLocation:function(){return Ut},getSessionStore:function(){return It},getStartedVisit:function(){return sr},getVisitStore:function(){return Xt},getVisitTypes:function(){return oe},getVisitsForPatient:function(){return te},makeUrl:function(){return wt},openmrsFetch:function(){return Ot},openmrsObservableFetch:function(){return St},refetchCurrentUser:function(){return Dt},restBaseUrl:function(){return Cn},saveVisit:function(){return ee},sessionEndpoint:function(){return Mn},setCurrentVisit:function(){return Zt},setSessionLocation:function(){return Bt},setUserLanguage:function(){return Mt},setUserProperties:function(){return Ft},setupApiModule:function(){return zt},toLocationObject:function(){return ie},toVisitTypeObject:function(){return re},updateVisit:function(){return ne},userHasAccess:function(){return Rt}});var ue,se,ce=function(t,e){return ce=Object.setPrototypeOf||i({__proto__:[]},Array)&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},ce(t,e)},le=!1,fe={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack,le=t},get useDeprecatedSynchronousErrorHandling(){return le}},pe={closed:!0,next:function(t){},error:function(t){if(fe.useDeprecatedSynchronousErrorHandling)throw t;u(t)},complete:function(){}},he=Array.isArray||function(t){return t&&"number"==typeof t.length},de=function(){var t=function(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this};return t.prototype=Object.create(Error.prototype),t}(),ve=de,ye=function(){var t=function(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)};return t.prototype.unsubscribe=function(){var n;if(!this.closed){var r=this,o=r._parentOrParents,a=r._ctorUnsubscribe,u=r._unsubscribe,l=r._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,i(o,t))o.remove(this);else if(null!==o)for(var f=0;f<o.length;++f)o[f].remove(this);if(e(u)){a&&(this._unsubscribe=void 0);try{u.call(this)}catch(t){n=i(t,ve)?c(t.errors):[t]}}if(he(l)){f=-1;for(var p=l.length;++f<p;){var h=l[f];if(s(h))try{h.unsubscribe()}catch(t){n=n||[],i(t,ve)?n=n.concat(c(t.errors)):n.push(t)}}}if(n)throw new ve(n)}},t.prototype.add=function(e){var n=e;if(!e)return t.EMPTY;switch(void 0===e?"undefined":a(e)){case"function":n=new t(e);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!i(n,t)){var r=n;(n=new t)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var o=n._parentOrParents;if(null===o)n._parentOrParents=this;else if(i(o,t)){if(o===this)return n;n._parentOrParents=[o,this]}else{if(-1!==o.indexOf(this))return n;o.push(this)}var u=this._subscriptions;return null===u?this._subscriptions=[n]:u.push(n),n},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}},t.EMPTY=function(t){return t.closed=!0,t}(new t),t}(),ge="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random(),me=function(e){function n(t,r,o){var a=e.call(this)||this;switch(a.syncErrorValue=null,a.syncErrorThrown=!1,a.syncErrorThrowable=!1,a.isStopped=!1,arguments.length){case 0:a.destination=pe;break;case 1:if(!t){a.destination=pe;break}if("object"==(void 0===t?"undefined":l(t))){i(t,n)?(a.syncErrorThrowable=t.syncErrorThrowable,a.destination=t,t.add(a)):(a.syncErrorThrowable=!0,a.destination=new be(a,t));break}default:a.syncErrorThrowable=!0,a.destination=new be(a,t,r,o)}return a}return t(n,e),n.prototype[ge]=function(){return this},n.create=function(t,e,r){var o=new n(t,e,r);return o.syncErrorThrowable=!1,o},n.prototype.next=function(t){this.isStopped||this._next(t)},n.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},n.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},n.prototype._next=function(t){this.destination.next(t)},n.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},n.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},n.prototype._unsubscribeAndRecycle=function(){var t=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this},n}(ye),be=function(n){var r=function(t,r,o,i){var a,u=n.call(this)||this;u._parentSubscriber=t;var s=u;return e(r)?a=r:r&&(a=r.next,o=r.error,i=r.complete,r!==pe&&(e((s=Object.create(r)).unsubscribe)&&u.add(s.unsubscribe.bind(s)),s.unsubscribe=u.unsubscribe.bind(u))),u._context=s,u._next=a,u._error=o,u._complete=i,u};return t(r,n),r.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;fe.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},r.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,n=fe.useDeprecatedSynchronousErrorHandling;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):u(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;u(t)}}},r.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var n=function(){return t._complete.call(t._context)};fe.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},r.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),fe.useDeprecatedSynchronousErrorHandling)throw t;u(t)}},r.prototype.__tryOrSetError=function(t,e,n){if(!fe.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(e){return fe.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):(u(e),!0)}return!1},r.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},r}(me),we="function"==typeof Symbol&&Symbol.observable||"@@observable",Oe=function(){var t=function(t){this._isScalar=!1,t&&(this._subscribe=t)};return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r=this.operator,o=function(t,e,n){if(t){if(i(t,me))return t;if(t[ge])return t[ge]()}return t||e||n?new me(t,e,n):new me(pe)}(t,e,n);if(r?o.add(r.call(o,this.source)):o.add(this.source||fe.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),fe.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){fe.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),function(t){for(;t;){var e=t,n=e.closed,r=e.destination,o=e.isStopped;if(n||o)return!1;t=r&&i(r,me)?r:null}return!0}(t)?t.error(e):console.warn(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=d(e))((function(e,r){var o;o=n.subscribe((function(e){try{t(e)}catch(t){r(t),o&&o.unsubscribe()}}),r,e)}))},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[we]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:(0===(n=t).length?f:1===n.length?n[0]:function(t){return n.reduce((function(t,e){return e(t)}),t)})(this);var n},t.prototype.toPromise=function(t){var e=this;return new(t=d(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}(),Se="object"==l(n.g)&&n.g&&n.g.Object===Object&&n.g,Ee="object"==("undefined"==typeof self?"undefined":l(self))&&self&&self.Object===Object&&self,xe=(Se||Ee||Function("return this")()).Symbol,Pe=Object.prototype,je=Pe.hasOwnProperty,ke=Pe.toString,Ae=xe?xe.toStringTag:void 0,_e=Object.prototype.toString,Te=xe?xe.toStringTag:void 0,Ce=(ue=Object.getPrototypeOf,se=Object,function(t){return ue(se(t))}),Ie=Function.prototype,Me=Object.prototype,De=Ie.toString,Ne=Me.hasOwnProperty,Re=De.call(Object),Le=function(t){if(!function(t){return null!=t&&"object"==(void 0===t?"undefined":l(t))}(t)||"[object Object]"!=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Te&&Te in Object(t)?function(t){var e=je.call(t,Ae),n=t[Ae];try{t[Ae]=void 0;var r=!0}catch(t){}var o=ke.call(t);return r&&(e?t[Ae]=n:delete t[Ae]),o}(t):function(t){return _e.call(t)}(t)}(t))return!1;var e=Ce(t);if(null===e)return!0;var n=Ne.call(e,"constructor")&&e.constructor;return"function"==typeof n&&i(n,n)&&De.call(n)==Re},Ue=p(824),Be=p(513),Fe=p(385);(0,Fe.createGlobalStore)("breadcrumbs",[]);var Ve,ze=Object.freeze({__proto__:null,get start(){return dt},get ensureJQuerySupport(){return Y},get setBootstrapMaxTime(){return L},get setMountMaxTime(){return U},get setUnmountMaxTime(){return B},get setUnloadMaxTime(){return F},get registerApplication(){return it},get unregisterApplication(){return ut},get getMountedApps(){return nt},get getAppStatus(){return ot},get unloadApplication(){return st},get checkActivityFunctions(){return at},get getAppNames(){return rt},get pathToActiveWhen(){return ft},get navigateToUrl(){return W},get patchHistoryApi(){return q},get triggerAppChange(){return pt},get addErrorHandler(){return y},get removeErrorHandler(){return g},get mountRootParcel(){return M},get NOT_LOADED(){return Ke},get LOADING_SOURCE_CODE(){return $e},get NOT_BOOTSTRAPPED(){return qe},get BOOTSTRAPPING(){return Je},get NOT_MOUNTED(){return Ye},get MOUNTING(){return Qe},get UPDATING(){return Ze},get LOAD_ERROR(){return nn},get MOUNTED(){return Xe},get UNLOADING(){return en},get UNMOUNTING(){return tn},get SKIP_BECAUSE_BROKEN(){return rn}}),He=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).CustomEvent,We=function(){try{var t=new He("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?He:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(t,e){var n=document.createEvent("CustomEvent");return e?n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail):n.initCustomEvent(t,!1,!1,void 0),n}:function(t,e){var n=document.createEventObject();return n.type=t,e?(n.bubbles=Boolean(e.bubbles),n.cancelable=Boolean(e.cancelable),n.detail=e.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n},Ge=[],Ke="NOT_LOADED",$e="LOADING_SOURCE_CODE",qe="NOT_BOOTSTRAPPED",Je="BOOTSTRAPPING",Ye="NOT_MOUNTED",Qe="MOUNTING",Xe="MOUNTED",Ze="UPDATING",tn="UNMOUNTING",en="UNLOADING",nn="LOAD_ERROR",rn="SKIP_BECAUSE_BROKEN",on=[],an=!1,un=!1,sn=0,cn={parcels:{}},ln={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}},fn="undefined"!=typeof window,pn={hashchange:[],popstate:[]},hn=["hashchange","popstate"],dn=null,vn=!1;fn&&(window.singleSpaNavigate?console.warn(m(41,!1)):window.singleSpaNavigate=W);var yn=!1,gn={},mn=[],bn=!1,wn=!1,On=[],Sn=fn&&window.location.href;function En(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(wn)return new Promise((function(t,n){On.push({resolve:t,reject:n,eventArguments:e})}));var r,i=function(){var t=[],e=[],n=[],r=[],o=(new Date).getTime();return mn.forEach((function(i){var a=i.status!==rn&&O(i);switch(i.status){case nn:a&&o-i.loadErrorTime>=200&&n.push(i);break;case Ke:case $e:a&&n.push(i);break;case qe:case Ye:!a&&et(S(i))?t.push(i):a&&r.push(i);break;case Xe:a||e.push(i)}})),{appsToUnload:t,appsToUnmount:e,appsToLoad:n,appsToMount:r}}(),a=i.appsToUnload,u=i.appsToUnmount,s=i.appsToLoad,c=i.appsToMount,l=[],f=Sn,p=Sn=window.location.href;return vt()?(wn=!0,r=a.concat(s,u,c),Promise.resolve().then((function(){return g(0===r.length?"before-no-app-change":"before-app-change",y(!0)),g("before-routing-event",y(!0,{cancelNavigation:h})),Promise.all(l).then((function(n){if(n.some((function(t){return t})))return dn.call(window.history,history.state,"",f.substring(location.origin.length)),Sn=location.href,wn=!1,En(t,e,!0);var r=a.map(X),o=u.map(C).map((function(t){return t.then(X)})).concat(r),i=Promise.all(o);i.then((function(){g("before-mount-routing-event",y(!0))}),(function(t){throw t}));var l=s.map((function(t){return H(t).then((function(t){return ht(t,i)}))})),p=c.filter((function(t){return s.indexOf(t)<0})).map((function(t){return ht(t,i)}));return i.catch((function(t){throw v(),t})).then((function(){return v(),Promise.all(l.concat(p)).catch((function(e){throw t.forEach((function(t){return t.reject(e)})),e})).then(d).then((function(){}),(function(t){throw t}))}))}))}))):(r=s,Promise.resolve().then((function(){var t=s.map(H);return Promise.all(t).then(v).then((function(){return[]})).catch((function(t){throw v(),t})).finally((function(){}))})));function h(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e="function"==typeof(null==t?void 0:t.then)?t:Promise.resolve(t);l.push(e.catch((function(t){return console.warn(Error(m(42,!1))),console.warn(t),!1})))}function d(){var e=nt();t.forEach((function(t){return t.resolve(e)}));try{g(0===r.length?"no-app-change":"app-change",y()),g("routing-event",y())}catch(t){setTimeout((function(){throw t}))}if(wn=!1,On.length>0){var n=On;On=[],En(n)}return e}function v(){n||(t.forEach((function(t){G(t.eventArguments)})),G(e))}function y(){var t,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1?arguments[1]:void 0,l={},h=(o(t={},Xe,[]),o(t,Ye,[]),o(t,Ke,[]),o(t,rn,[]),t);n?(s.concat(c).forEach((function(t,e){v(t,Xe)})),a.forEach((function(t){v(t,Ke)})),u.forEach((function(t){v(t,Ye)}))):r.forEach((function(t){v(t)}));var d={detail:{newAppStatuses:l,appsByNewStatus:h,totalAppChanges:r.length,originalEvent:null==e?void 0:e[0],oldUrl:f,newUrl:p}};return i&&P(d.detail,i),d;function v(t,e){var n=S(t);e=e||ot(n),l[n]=e,(h[e]=h[e]||[]).push(n)}}function g(t,e){n||window.dispatchEvent(new We("single-spa:".concat(t),e))}}var xn=!1,Pn={getRawAppData:function(){return function(t){if(Array.isArray(t))return r(t)}(t=mn)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(t)||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.")}();var t},reroute:En,NOT_LOADED:Ke,toLoadPromise:H,toBootstrapPromise:T,unregisterApplication:ut,getProfilerData:function(){return on}};fn&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Pn);var jn="openmrs:history";function kn(t,e,n){return kn=bt()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&_n(o,n.prototype),o},kn.apply(null,arguments)}function An(t){return An=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},An(t)}function _n(t,e){return _n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},_n(t,e)}function Tn(t){var e="function"==typeof Map?new Map:void 0;return Tn=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return kn(t,arguments,An(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),_n(r,t)},Tn(t)}var Cn="/ws/rest/v1",In="/ws/fhir2/R4",Mn="".concat(Cn,"/session"),Dn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&_n(t,e)}(o,t);var e,n,r=(e=o,n=bt(),function(){var t,r=An(e);if(n){var o=An(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return function(t,e){return!e||"object"!=((n=e)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":void 0===n?"undefined":a(n))&&"function"!=typeof e?yt(t):e;var n}(this,t)});function o(t,e,n,a){var u;return function(t,e){if(!i(t,e))throw new TypeError("Cannot call a class as a function")}(this,o),mt(yt(u=r.call(this)),"response",void 0),mt(yt(u),"responseBody",void 0),u.message="Server responded with ".concat(e.status," (").concat(e.statusText,") for url ").concat(t,". Check err.responseBody or network tab in dev tools for more info"),a.message=u.message,u.responseBody=n,u.response=e,u.stack="Stacktrace for outgoing request:\n".concat(a.stack,"\nStacktrace for incoming response:\n").concat(u.stack),u}return o}(Tn(Error)),Nn="".concat(Cn,"/attachment");function Rn(){var t;return t=function(t,e){var n;return function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(r){return(n=new FormData).append("fileCaption",e.fileDescription),n.append("patient",t),e.file?n.append("file",e.file):(n.append("file",new File([""],e.fileName),e.fileName),n.append("base64Content",e.base64Content)),[2,Ot("".concat(Nn),{method:"POST",body:n})]}))},Rn=function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Et(i,r,o,a,u,"next",t)}function u(t){Et(i,r,o,a,u,"throw",t)}a(void 0)}))},Rn.apply(this,arguments)}var Ln=p(254),Un=function(t){return void 0===t},Bn=(0,Fe.createGlobalStore)("session",{loaded:!1,session:null}),Fn=0;function Vn(){return(Vn=_t((function(t,e){return Tt(this,(function(n){return[2,Vt(Ot(Mn,{method:"POST",body:{sessionLocation:t},headers:{"Content-Type":"application/json"},signal:e.signal}))]}))}))).apply(this,arguments)}function zn(){return(zn=_t((function(t,e,n){return Tt(this,(function(r){switch(r.label){case 0:return n||(n=new AbortController),[4,Ot("".concat(Cn,"/user/").concat(t),{method:"POST",body:{userProperties:e},headers:{"Content-Type":"application/json"},signal:n.signal})];case 1:return r.sent(),[2,Dt()]}}))}))).apply(this,arguments)}Bn.subscribe((function(t){return t.session&&Mt(t.session)}));var Hn=p(738);function Wn(){return Wn=Gt((function(t,e){var n,r,o,i,a,u=arguments;return $t(this,(function(s){switch(s.label){case 0:return n=!(u.length>2&&void 0!==u[2])||u[2],t?(r=null,[4,Promise.all([Ot("".concat(In,"/Patient/").concat(t),e).catch((function(t){return r=t})),n?Jt(t):Promise.resolve(null)])]):[3,2];case 1:if(o=Kt.apply(void 0,[s.sent(),2]),i=o[0],a=o[1],i.ok)return[2,i.data];if(a)return[2,a];if(r)throw r;s.label=2;case 2:return[2,null]}}))})),Wn.apply(this,arguments)}function Gn(){return(Gn=Gt((function(t){var e,n,r;return $t(this,(function(o){switch(o.label){case 0:return[4,(0,Hn.getSynchronizationItems)("patient-registration")];case 1:return e=o.sent(),n=e.find((function(e){return e.fhirPatient.id===t})),[2,null!==(r=null==n?void 0:n.fhirPatient)&&void 0!==r?r:null]}}))}))).apply(this,arguments)}var Kn=function(){var t=function(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this};return t.prototype=Object.create(Error.prototype),t}(),$n=function(e){var n=function(t,n){var r=e.call(this)||this;return r.subject=t,r.subscriber=n,r.closed=!1,r};return t(n,e),n.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}},n}(ye),qn=function(e){var n=function(t){var n=e.call(this,t)||this;return n.destination=t,n};return t(n,e),n}(me),Jn=function(e){var n=function(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t};return t(n,e),n.prototype[ge]=function(){return new qn(this)},n.prototype.lift=function(t){var e=new Yn(this,this);return e.operator=t,e},n.prototype.next=function(t){if(this.closed)throw new Kn;if(!this.isStopped)for(var e=this.observers,n=e.length,r=e.slice(),o=0;o<n;o++)r[o].next(t)},n.prototype.error=function(t){if(this.closed)throw new Kn;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,n=e.length,r=e.slice(),o=0;o<n;o++)r[o].error(t);this.observers.length=0},n.prototype.complete=function(){if(this.closed)throw new Kn;this.isStopped=!0;for(var t=this.observers,e=t.length,n=t.slice(),r=0;r<e;r++)n[r].complete();this.observers.length=0},n.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},n.prototype._trySubscribe=function(t){if(this.closed)throw new Kn;return e.prototype._trySubscribe.call(this,t)},n.prototype._subscribe=function(t){if(this.closed)throw new Kn;return this.hasError?(t.error(this.thrownError),ye.EMPTY):this.isStopped?(t.complete(),ye.EMPTY):(this.observers.push(t),new $n(this,t))},n.prototype.asObservable=function(){var t=new Oe;return t.source=this,t},n.create=function(t,e){return new Yn(t,e)},n}(Oe),Yn=function(e){var n=function(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r};return t(n,e),n.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},n.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},n.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},n.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):ye.EMPTY},n}(Jn),Qn=function(e){var n=function(t){var n=e.call(this)||this;return n._value=t,n};return t(n,e),Object.defineProperty(n.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),n.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return n&&!n.closed&&t.next(this._value),n},n.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new Kn;return this._value},n.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},n}(Jn),Xn=function(){var t=function(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this};return t.prototype=Object.create(Error.prototype),t}(),Zn=new Oe((function(t){return t.complete()})),tr=function(){var t=function(t){if(this.total=t,this.total<0)throw new Xn};return t.prototype.call=function(t,e){return e.subscribe(new er(t,this.total))},t}(),er=function(e){var n=function(t,n){var r=e.call(this,t)||this;return r.total=n,r.count=0,r};return t(n,e),n.prototype._next=function(t){var e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))},n}(me),nr=function(){var t=function(t,e){this.project=t,this.thisArg=e};return t.prototype.call=function(t,e){return e.subscribe(new rr(t,this.project,this.thisArg))},t}(),rr=function(e){var n=function(t,n,r){var o=e.call(this,t)||this;return o.project=n,o.count=0,o.thisArg=r||o,o};return t(n,e),n.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},n}(me),or="custom:(uuid,display,voided,indication,startDatetime,stopDatetime,encounters:(uuid,display,encounterDatetime,form:(uuid,name),location:ref,encounterType:ref,encounterProviders:(uuid,display,provider:(uuid,display))),patient:(uuid,display),visitType:(uuid,name,display),attributes:(uuid,display,attributeType:(name,datatypeClassname,uuid),value),location:(uuid,name,display))",ir=function(){try{return JSON.parse(localStorage.getItem("openmrs:visitStoreState")||"null")}catch(t){return null}}()||{patientUuid:null,manuallySetVisitUuid:null};Xt().subscribe((function(t){var e;e=t,localStorage.setItem("openmrs:visitStoreState",JSON.stringify(e))}));var ar,ur,sr=new Qn(null);!function(t){t.NEWVISIT="startVisit",t.EDITVISIT="editVisit",t.LOADING="loadingVisit"}(ar||(ar={})),function(t){t.NOTSTARTED="notStarted",t.ONGOING="ongoing"}(ur||(ur={}));var cr={"webservices.rest":"2.24.0",fhir2:"1.0.0-SNAPSHOT"}}(),h}())}}}))},714:function(){var t=function(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":void 0===t?"undefined":l(t)};System.register(["@openmrs/esm-state"],(function(e,n){var r={};return{setters:[function(t){r.createGlobalStore=t.createGlobalStore,r.getGlobalStore=t.getGlobalStore}],execute:function(){e(function(){"use strict";var e={685:function(t){t.exports=r}},n={};function o(t){var r=n[t];if(void 0!==r)return r.exports;var i=n[t]={exports:{}};return e[t](i,i.exports,o),i.exports}o.d=function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};return function(){var e=function(t){return null!=t&&"object"==(void 0===t?"undefined":l(t))&&!0===t["@@functional/placeholder"]},n=function(t){return function n(r){return 0===arguments.length||e(r)?n:t.apply(this,arguments)}},r=function(t){return function r(o,i){switch(arguments.length){case 0:return r;case 1:return e(o)?r:n((function(e){return t(o,e)}));default:return e(o)&&e(i)?r:e(o)?n((function(e){return t(e,i)})):e(i)?n((function(e){return t(o,e)})):t(o,i)}}},a=function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n},u=function(t,e,n){for(var r=0,o=n.length;r<o;){if(t(e,n[r]))return!0;r+=1}return!1},s=function(t,e){return Object.prototype.hasOwnProperty.call(e,t)},c=function(t,e,n,r){var o=a(t);function i(t,e){return pt(t,e,n.slice(),r.slice())}return!u((function(t,e){return!u(i,e,t)}),a(e),o)},f=function(t){return function o(i,a,u){switch(arguments.length){case 0:return o;case 1:return e(i)?o:r((function(e,n){return t(i,e,n)}));case 2:return e(i)&&e(a)?o:e(i)?r((function(e,n){return t(e,a,n)})):e(a)?r((function(e,n){return t(i,e,n)})):n((function(e){return t(i,a,e)}));default:return e(i)&&e(a)&&e(u)?o:e(i)&&e(a)?r((function(e,n){return t(e,n,u)})):e(i)&&e(u)?r((function(e,n){return t(e,a,n)})):e(a)&&e(u)?r((function(e,n){return t(i,e,n)})):e(i)?n((function(e){return t(e,a,u)})):e(a)?n((function(e){return t(i,e,u)})):e(u)?n((function(e){return t(i,a,e)})):t(i,a,u)}}},p=function(t){return"[object Object]"===Object.prototype.toString.call(t)},h=function(t,e,n){for(var r=n.next();!r.done;){if((e=t["@@transducer/step"](e,r.value))&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}r=n.next()}return t["@@transducer/result"](e)},d=function(t,e,n,r){return t["@@transducer/result"](n[r](Pt(t["@@transducer/step"],t),e))},v=function(t,e){return function(n){if(!t(n))return"function"==typeof e?e(n):e}},y=function(t){return(0,Dt.getGlobalStore)("config-module-".concat(t),{config:null,loaded:!1,translationOverridesLoaded:!1})},g=function(){return(0,Dt.getGlobalStore)("config-extension-slots",{slots:{}})},m=function(t){return b(g().getState(),t)},b=function(t,e){var n=t.slots[e];return null!=n?n:{loaded:!1,config:{}}},w=function(){return(0,Dt.getGlobalStore)("config-extensions",{configs:{}})},O=function(t,e){var n=Object.assign({},S(w().getState(),t,e));return n.config=gt(["Display conditions","Translation overrides"],n.config),n},S=function(t,e,n){var r,o=null===(r=t.configs[e])||void 0===r?void 0:r[n];return null!=o?o:{loaded:!1,config:null}},E=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},x=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},P=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){x(t,e,n[e])}))}return t},j=function(t,e){return e=null!=e?e:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):function(t){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e.push.apply(e,n)}return e}(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},k=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t,e)||_(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},A=function(t){return function(t){if(Array.isArray(t))return E(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_(t)||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(t,e){if(t){if("string"==typeof t)return E(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?E(t,e):void 0}},T=function(t,e){var n=!0,r=!1,o=void 0;try{for(var i,a=Object.keys(t.schemas)[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var u=i.value,s=y(u);if(t.moduleLoaded[u]){var c=G(u,t,e);s.setState({translationOverridesLoaded:!0,loaded:!0,config:c})}else{var l=K(u,t,e);s.setState({translationOverridesLoaded:!0,loaded:!1,config:l})}}}catch(t){r=!0,o=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}},C=function(t,e){var n,r,o=(n=q(W(t,e)),function(t){var e=!0,n=!1,r=void 0;try{for(var o,i=Object.entries(t)[Symbol.iterator]();!(e=(o=i.next()).done);e=!0){var a=k(o.value,2),u=a[0],s=a[1],c=!0,l=!1,f=void 0;try{for(var p,h=Object.entries(s)[Symbol.iterator]();!(c=(p=h.next()).done);c=!0){var d=k(p.value,2),v=d[0];H(d[1],u,v)}}catch(t){l=!0,f=t}finally{try{c||null==h.return||h.return()}finally{if(l)throw f}}}}catch(t){n=!0,r=t}finally{try{e||null==i.return||i.return()}finally{if(n)throw r}}}(r=Object.keys(n).reduce((function(t,e){var r,o;return(null===(r=n[e])||void 0===r?void 0:r.extensionSlots)&&(t[e]=null===(o=n[e])||void 0===o?void 0:o.extensionSlots),t}),{})),Object.keys(r).reduce((function(t,e){return P({},t,r[e])}),{})),i=Object.fromEntries(Object.entries(o).map((function(t){var e=k(t,2);return[e[0],{loaded:!0,config:e[1]}]}))),a=g(),u=a.getState(),s={slots:P({},u.slots,i)};ht(u,s)||a.setState(s)},I=function(t,e){var n=function(t,e){var n=Bt(wt(t.schemas)),r=A(t.providedConfigs.map((function(t){return[t.config,t.source]}))).concat([[e.config,"temporary config"]]),o=!0,i=!1,a=void 0;try{for(var u,s=r[Symbol.iterator]();!(o=(u=s.next()).done);o=!0){var c=k(u.value,2);n=q([n,Ft(c[0],c[1])])}}catch(t){i=!0,a=t}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}return n}(t,e);Ut.setState({config:n})},M=function(t,e,n){var r={},o=!0,i=!1,a=void 0;try{for(var u,s=e.mountedExtensions[Symbol.iterator]();!(o=(u=s.next()).done);o=!0){var c=u.value,l=z(c.slotModuleName,c.extensionModuleName,c.slotName,c.extensionId,t,n);r[c.slotName]=j(P({},r[c.slotName]),x({},c.extensionId,{config:l,loaded:!0}))}}catch(t){i=!0,a=t}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}w().setState({configs:r})},D=function(t,e){Vt(t,e);var n=yt(e,$t);Nt.setState((function(e){return j(P({},e),{schemas:j(P({},e.schemas),x({},t,n)),moduleLoaded:j(P({},e.moduleLoaded),x({},t,!0))})}))},N=function(t){var e=Nt.getState();Nt.setState({schemas:j(P({},e.schemas),x({},t,$t))})},R=function(t){var e=Nt.getState();Nt.setState({schemas:j(P({},e.schemas),x({},t,Kt))})},L=function(t,e){Vt(t,e);var n=yt(e,$t),r=Nt.getState();r.schemas[t]&&console.error("Config schema for extension ".concat(t," already exists. If there are multiple extensions with this same name, one will probably crash.")),Nt.setState({schemas:j(P({},r.schemas),x({},t,n))})},U=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"provided";Nt.setState((function(n){return j(P({},n),{providedConfigs:A(n.providedConfigs).concat([{source:e,config:t}])})}))},B=function(t){return new Promise((function(e){var n=function(t){if(t.loaded&&t.config){var n=gt(["Display conditions","Translation overrides"],t.config);e(n),o&&o()}},r=y(t);n(r.getState());var o=r.subscribe(n)}))},F=function(t){return new Promise((function(e){var n=function(t){if(t.translationOverridesLoaded&&t.config){var n,r=null!==(n=t.config["Translation overrides"])&&void 0!==n?n:{};e(r),o&&o()}},r=y(t);n(r.getState());var o=r.subscribe(n)}))},V=function(t,e,n){J(t,e,n);var r=Wt(t,e);return Ht(t,r,n),r},z=function(t,e,n,r,o,i){var a,u,s,c,l=function(t){return k(t.split("#"),1)[0]}(r),f=o.schemas[l],p=f?l:e,h=W(o,i),d=$(t,h),v=null!==(c=null==d||null===(a=d.extensionSlots)||void 0===a||null===(u=a[n])||void 0===u||null===(s=u.configure)||void 0===s?void 0:s[r])&&void 0!==c?c:{},y=q([$(p,h),v]),g=null!=f?f:o.schemas[e];J(g,y,p);var m=Wt(g,y);return Ht(g,m,p),delete m.extensionSlots,m},H=function(t,e,n){var r="".concat(e,".extensionSlots.").concat(n),o="Extension slot config '".concat(r,"'"),i=Object.keys(t).filter((function(t){return!["add","remove","order","configure"].includes(t)}));i.length&&tt(r,o+"' contains invalid keys '".concat(i.join("', '"),"'")),t.add&&(Array.isArray(t.add)&&t.add.every((function(t){return"string"==typeof t}))||tt(r,o+".add' is invalid. Must be an array of strings (extension IDs)")),t.remove&&(Array.isArray(t.remove)&&t.remove.every((function(t){return"string"==typeof t}))||tt(r,o+".remove' is invalid. Must be an array of strings (extension IDs)")),t.order&&(Array.isArray(t.order)&&t.order.every((function(t){return"string"==typeof t}))||tt(r,o+".order' is invalid. Must be an array of strings (extension IDs)")),t.configure&&(Z(t.configure)||tt(r,o+".configure' is invalid. Must be an object with extension IDs for keys"))},W=function(t,e){return A(t.providedConfigs.map((function(t){return t.config}))).concat([e.config])},G=function(t,e,n){var r=e.schemas[t],o=$(t,W(e,n));J(r,o,t);var i=Wt(r,o);return Ht(r,i,t),delete i.extensionSlots,i},K=function(t,e,n){var r=$(t,W(e,n)),o=Wt($t,r);return Ht($t,o,t),delete o.extensionSlots,o},$=function(t,e){return q(e.map((function(e){return e[t]})).filter((function(t){return!!t})))},q=function(t){return kt(yt)({},t)},J=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=!0,o=!1,i=void 0;try{for(var a,u=Object.keys(e)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=a.value,c=e[s],l=n+"."+s,f=t[s];t.hasOwnProperty(s)?zt(f,c,l):"extensionSlots"===s&&""!==n||tt(l,"Unknown config key '".concat(l,"' provided. Ignoring."))}}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}},Y=function(t,e,n){e&&Q(t,[{Array:At,Boolean:_t,ConceptUuid:Mt,Number:Tt,Object:It,String:Ct,UUID:Mt,PersonAttributeTypeUuid:Mt,PatientIdentifierTypeUuid:Mt}[e]],n)},Q=function(t,e,n){if(e)try{var r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=(0,a.value)(n);"string"==typeof s&&tt(t,"object"==(void 0===n?"undefined":l(n))?"Invalid configuration for ".concat(t,": ").concat(s):"Invalid configuration value ".concat(n," for ").concat(t,": ").concat(s))}}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}catch(e){console.error('Skipping invalid validator at "'.concat(t,'". Encountered error\n\t').concat(e))}},X=function(t){return!!t&&Object.keys(t).filter((function(t){return!["_default","_validators"].includes(t)})).length>0},Z=function(t){return"object"==(void 0===t?"undefined":l(t))&&!Array.isArray(t)&&null!==t},tt=function(t,e){var n="".concat(t,":::").concat(e);Gt.has(n)||(console.error(e),Gt.add(n))},et=function(t){t?Gt.forEach((function(e){e.startsWith(t)&&Gt.delete(e)})):Gt.clear()};o.r(i),o.d(i,{Type:function(){return bt},clearConfigErrors:function(){return et},configExtensionStore:function(){return Lt},configInternalStore:function(){return Nt},defineConfigSchema:function(){return D},defineExtensionConfigSchema:function(){return L},getConfig:function(){return B},getConfigStore:function(){return y},getExtensionConfig:function(){return O},getExtensionConfigFromStore:function(){return S},getExtensionSlotConfig:function(){return m},getExtensionSlotConfigFromStore:function(){return b},getExtensionSlotsConfigStore:function(){return g},getExtensionsConfigStore:function(){return w},getTranslationOverrides:function(){return F},implementerToolsConfigStore:function(){return Ut},inRange:function(){return qt},isUrl:function(){return Yt},isUrlWithTemplateParameters:function(){return Jt},oneOf:function(){return Qt},processConfig:function(){return V},provide:function(){return U},registerModuleWithConfigSystem:function(){return N},registerTranslationNamespace:function(){return R},temporaryConfigStore:function(){return Rt},validator:function(){return v},validators:function(){return Xt}});var nt="function"==typeof Object.is?Object.is:function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e},rt=Object.prototype.toString,ot=function(){return"[object Arguments]"===rt.call(arguments)?function(t){return"[object Arguments]"===rt.call(t)}:function(t){return s("callee",t)}}(),it=ot,at=!{toString:null}.propertyIsEnumerable("toString"),ut=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],st=function(){return arguments.propertyIsEnumerable("length")}(),ct=function(t,e){for(var n=0;n<t.length;){if(t[n]===e)return!0;n+=1}return!1},lt="function"!=typeof Object.keys||st?n((function(t){if(Object(t)!==t)return[];var e,n,r=[],o=st&&it(t);for(e in t)!s(e,t)||o&&"length"===e||(r[r.length]=e);if(at)for(n=ut.length-1;n>=0;)s(e=ut[n],t)&&!ct(r,e)&&(r[r.length]=e),n-=1;return r})):n((function(t){return Object(t)!==t?[]:Object.keys(t)})),ft=n((function(t){return null===t?"Null":void 0===t?"Undefined":Object.prototype.toString.call(t).slice(8,-1)}));function pt(e,n,r,o){if(nt(e,n))return!0;var i,a,u=ft(e);if(u!==ft(n))return!1;if(null==e||null==n)return!1;if("function"==typeof e["fantasy-land/equals"]||"function"==typeof n["fantasy-land/equals"])return"function"==typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](n)&&"function"==typeof n["fantasy-land/equals"]&&n["fantasy-land/equals"](e);if("function"==typeof e.equals||"function"==typeof n.equals)return"function"==typeof e.equals&&e.equals(n)&&"function"==typeof n.equals&&n.equals(e);switch(u){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===(i=e.constructor,null==(a=String(i).match(/^function (\w*)/))?"":a[1]))return e===n;break;case"Boolean":case"Number":case"String":if((void 0===e?"undefined":t(e))!=(void 0===n?"undefined":t(n))||!nt(e.valueOf(),n.valueOf()))return!1;break;case"Date":if(!nt(e.valueOf(),n.valueOf()))return!1;break;case"Error":return e.name===n.name&&e.message===n.message;case"RegExp":if(e.source!==n.source||e.global!==n.global||e.ignoreCase!==n.ignoreCase||e.multiline!==n.multiline||e.sticky!==n.sticky||e.unicode!==n.unicode)return!1}for(var l=r.length-1;l>=0;){if(r[l]===e)return o[l]===n;l-=1}switch(u){case"Map":return e.size===n.size&&c(e.entries(),n.entries(),r.concat([e]),o.concat([n]));case"Set":return e.size===n.size&&c(e.values(),n.values(),r.concat([e]),o.concat([n]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var f=lt(e);if(f.length!==lt(n).length)return!1;var p=r.concat([e]),h=o.concat([n]);for(l=f.length-1;l>=0;){var d=f[l];if(!s(d,n)||!pt(n[d],e[d],p,h))return!1;l-=1}return!0}var ht=r((function(t,e){return pt(t,e,[],[])})),dt=f((function(t,e,n){var r,o={};for(r in e)s(r,e)&&(o[r]=s(r,n)?t(r,e[r],n[r]):e[r]);for(r in n)s(r,n)&&!s(r,o)&&(o[r]=n[r]);return o})),vt=f((function t(e,n,r){return dt((function(n,r,o){return p(r)&&p(o)?t(e,r,o):e(n,r,o)}),n,r)})),yt=r((function(t,e){return vt((function(t,e,n){return n}),t,e)})),gt=r((function(t,e){for(var n={},r={},o=0,i=t.length;o<i;)r[t[o]]=1,o+=1;for(var a in e)r.hasOwnProperty(a)||(n[a]=e[a]);return n}));function mt(t,e,n,r){var o,i=function(o){for(var i=e.length,a=0;a<i;){if(t===e[a])return n[a];a+=1}for(var u in e[a+1]=t,n[a+1]=o,t)o[u]=r?mt(t[u],e,n,!0):t[u];return o};switch(ft(t)){case"Object":return i({});case"Array":return i([]);case"Date":return new Date(t.valueOf());case"RegExp":return o=t,new RegExp(o.source,(o.global?"g":"")+(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.sticky?"y":"")+(o.unicode?"u":""));default:return t}}var bt,wt=n((function(t){return null!=t&&"function"==typeof t.clone?t.clone():mt(t,[],[],!0)})),Ot=Array.isArray||function(t){return null!=t&&t.length>=0&&"[object Array]"===Object.prototype.toString.call(t)},St=n((function(t){return!!Ot(t)||!!t&&"object"==(void 0===t?"undefined":l(t))&&!function(t){return"[object String]"===Object.prototype.toString.call(t)}(t)&&(1===t.nodeType?!!t.length:0===t.length||t.length>0&&t.hasOwnProperty(0)&&t.hasOwnProperty(t.length-1))})),Et=function(){var t=function(t){this.f=t};return t.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},t.prototype["@@transducer/result"]=function(t){return t},t.prototype["@@transducer/step"]=function(t,e){return this.f(t,e)},t}(),xt=r((function(t,e){return function(t,e){switch(t){case 0:return function(){return e.apply(this,arguments)};case 1:return function(t){return e.apply(this,arguments)};case 2:return function(t,n){return e.apply(this,arguments)};case 3:return function(t,n,r){return e.apply(this,arguments)};case 4:return function(t,n,r,o){return e.apply(this,arguments)};case 5:return function(t,n,r,o,i){return e.apply(this,arguments)};case 6:return function(t,n,r,o,i,a){return e.apply(this,arguments)};case 7:return function(t,n,r,o,i,a,u){return e.apply(this,arguments)};case 8:return function(t,n,r,o,i,a,u,s){return e.apply(this,arguments)};case 9:return function(t,n,r,o,i,a,u,s,c){return e.apply(this,arguments)};case 10:return function(t,n,r,o,i,a,u,s,c,l){return e.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}(t.length,(function(){return t.apply(e,arguments)}))})),Pt=xt,jt="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",kt=f((function(t,e,n){if("function"==typeof t&&(t=function(t){return new Et(t)}(t)),St(n))return function(t,e,n){for(var r=0,o=n.length;r<o;){if((e=t["@@transducer/step"](e,n[r]))&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}r+=1}return t["@@transducer/result"](e)}(t,e,n);if("function"==typeof n["fantasy-land/reduce"])return d(t,e,n,"fantasy-land/reduce");if(null!=n[jt])return h(t,e,n[jt]());if("function"==typeof n.next)return h(t,e,n);if("function"==typeof n.reduce)return d(t,e,n,"reduce");throw new TypeError("reduce: list must be array or iterable")}));!function(t){t.Array="Array",t.Boolean="Boolean",t.ConceptUuid="ConceptUuid",t.Number="Number",t.Object="Object",t.String="String",t.UUID="UUID",t.PersonAttributeTypeUuid="PersonAttributeTypeUuid",t.PatientIdentifierTypeUuid="PatientIdentifierTypeUuid"}(bt||(bt={}));var At=v((function(t){return Array.isArray(t)}),"must be an array"),_t=v((function(t){return"boolean"==typeof t}),"must be a boolean"),Tt=v((function(t){return"number"==typeof t}),"must be a number"),Ct=v((function(t){return"string"==typeof t}),"must be a string"),It=v((function(t){return"object"==(void 0===t?"undefined":l(t))&&!Array.isArray(t)&&null!==t}),"must be an object (not an array or null)"),Mt=v((function(t){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t)||/^[0-9a-f]{36}$/i.test(t)}),"must be a valid UUID or a 36-character hexadecimal string"),Dt=o(685),Nt=(0,Dt.createGlobalStore)("config-internal",{providedConfigs:[],schemas:{},moduleLoaded:{}}),Rt=(0,Dt.createGlobalStore)("temporary-config",{config:function(){try{return JSON.parse(localStorage.getItem("openmrs:temporaryConfig")||"{}")}catch(t){return{}}}()});Rt.subscribe((function(t){var e;e=t.config,localStorage.setItem("openmrs:temporaryConfig",JSON.stringify(e))}));var Lt=(0,Dt.createGlobalStore)("config-store-of-extension-state",{mountedExtensions:[]}),Ut=(0,Dt.createGlobalStore)("config-implementer-tools",{config:{}});function Bt(t){return t.hasOwnProperty("_default")?j(P({},t),{_value:t._default,_source:"default"}):Z(t)?Object.keys(t).reduce((function(e,n){return e[n]=Bt(t[n]),e}),{}):{}}function Ft(t,e){return Z(t)?Object.keys(t).reduce((function(n,r){return n[r]=Ft(t[r],e),n}),{}):{_value:t,_source:e}}function Vt(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r="Please verify that you are running the latest version and, if so, alert the maintainer.",o=!0,i=!1,a=void 0;try{for(var u,s=function(){var o=u.value,i=n+(n&&".")+o,a=e[o];if("Display conditions"===i&&console.error("".concat(t,' declares a configuration option called "Display conditions"; the "Display conditions" option is a reserved name. ').concat(r)),"Translation overrides"===i&&console.error("".concat(t,' declares a configuration option called "Translation overrides"; the "Translation overrides" option is a reserved name. ').concat(r)),!Z(a))return console.error("".concat(t," has bad config schema definition for key '").concat(i,"'. ").concat(r)),"continue";a.hasOwnProperty("_default")||Vt(t,a,i);var s=a._elements;if(X(s)&&Vt(t,s,i+"._elements"),a._validators){var c=!0,l=!1,f=void 0;try{for(var p,h=a._validators[Symbol.iterator]();!(c=(p=h.next()).done);c=!0){var d=p.value;"function"!=typeof d&&console.error("".concat(t," has invalid validator for key '").concat(i,"' ").concat(r,".")+"\n\nIf you're the maintainer: validators must be functions that return either "+"undefined or an error string. Received ".concat(d,"."))}}catch(t){l=!0,f=t}finally{try{c||null==h.return||h.return()}finally{if(l)throw f}}}var v=a._type;v&&!Object.values(bt).includes(v)&&console.error("".concat(t," has invalid type for key '").concat(i,"' ").concat(r,".")+"\n\nIf you're the maintainer: the allowed types are ".concat(Object.values(bt).join(", "),". ")+"Received '".concat(v,"'")),Object.keys(a).every((function(t){return["_description","_validators","_elements","_type"].includes(t)}))&&!n.includes("._elements")&&console.error("".concat(t," has bad config schema definition for key '").concat(i,"'. ").concat(r,".")+"\n\nIf you're the maintainer: all config elements must have a default. "+"Received ".concat(JSON.stringify(a))),s&&v&&![bt.Array,bt.Object].includes(v)&&console.error("".concat(t," has bad config schema definition for key '").concat(i,"'. ").concat(r,".")+"\n\nIf you're the maintainer: the 'elements' key only works with '_type' equal to 'Array' or 'Object'. "+"Received ".concat(JSON.stringify(v)))},c=Object.keys(e).filter((function(t){return!t.startsWith("_")}))[Symbol.iterator]();!(o=(u=c.next()).done);o=!0)s()}catch(t){i=!0,a=t}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}}function zt(t,e,n){Y(n,t._type,e),Z(e)?t._type===bt.Object?function(t,e,n){if(t._elements){var r=!0,o=!1,i=void 0;try{for(var a,u=Object.keys(e)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=a.value,c=e[s];J(t._elements,c,"".concat(n,".").concat(s))}}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}}(t,e,n):t.hasOwnProperty("_default")||t.hasOwnProperty("_type")||J(t,e,n):t._type===bt.Array&&function(t,e,n){if(X(t._elements))for(var r=0;r<e.length;r++)zt(t._elements,e[r],"".concat(n,"[").concat(r,"]"));for(var o=0;o<e.length;o++){var i;Y("".concat(n,"[").concat(o,"]"),null===(i=t._elements)||void 0===i?void 0:i._type,e[o])}}(t,e,n)}function Ht(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(t)if(e!==t._default&&Q(n,t._validators,e),Z(e)){var r=!0,o=!1,i=void 0;try{for(var a,u=Object.keys(e)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=a.value,c=e[s],l=n+"."+s,f=t[s];t._type===bt.Object&&t._elements?Ht(t._elements,c,l):Ht(f,c,l)}}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}else if(Array.isArray(e)&&t._elements)for(var p=0;p<e.length;p++)Ht(t._elements,e[p],"".concat(n,"[").concat(p,"]"))}T(Nt.getState(),Rt.getState()),Nt.subscribe((function(t){return T(t,Rt.getState())})),Rt.subscribe((function(t){return T(Nt.getState(),t)})),I(Nt.getState(),Rt.getState()),Nt.subscribe((function(t){return I(t,Rt.getState())})),Rt.subscribe((function(t){return I(Nt.getState(),t)})),C(Nt.getState(),Rt.getState()),Nt.subscribe((function(t){return C(t,Rt.getState())})),Rt.subscribe((function(t){return C(Nt.getState(),t)})),M(Nt.getState(),Lt.getState(),Rt.getState()),Nt.subscribe((function(t){M(t,Lt.getState(),Rt.getState())})),Lt.subscribe((function(t){M(Nt.getState(),t,Rt.getState())})),Rt.subscribe((function(t){M(Nt.getState(),Lt.getState(),t)}));var Wt=function(t,e){var n=wt(e);if(!t)return n;var r=!0,o=!1,i=void 0;try{for(var a,u=function(){var e=a.value,r=n[e],o=t[e];if(o&&(o.hasOwnProperty("_type")||o.hasOwnProperty("_default"))){n.hasOwnProperty(e)||(n[e]=o._default);var i=o._elements;if(r&&X(i))if(o._type===bt.Array&&Array.isArray(r)){var u=r.map((function(t){return Wt(i,t)}));n[e]=u}else if(o._type===bt.Object){var s=!0,c=!1,l=void 0;try{for(var f,p=Object.keys(r)[Symbol.iterator]();!(s=(f=p.next()).done);s=!0){var h=f.value;r[h]=Wt(i,r[h])}}catch(t){c=!0,l=t}finally{try{s||null==p.return||p.return()}finally{if(c)throw l}}}}else if(Z(o)){var d=null!=r?r:{};Z(d)&&(n[e]=Wt(o,d))}},s=Object.keys(t)[Symbol.iterator]();!(r=(a=s.next()).done);r=!0)u()}catch(t){o=!0,i=t}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n},Gt=new Set,Kt={"Translation overrides":{_description:"Per-language overrides for frontend translations should be keyed by language code and each language dictionary contains the translation key and the display value",_type:bt.Object,_default:{},_validators:[v((function(t){return Object.keys(t).every((function(t){return/^[a-z]{2,3}(-[A-Z]{2,3})?$/.test(t)}))}),(function(t){var e=Object.keys(t).filter((function(t){return!/^[a-z]{2,3}(-[A-Z]{2,3})?$/.test(t)}));return"The 'Translation overrides' object should have language codes for keys. Language codes must be in the form of a two-to-three letter language code optionally followed by a hyphen and a two-to-three letter country code. The following keys do not conform: ".concat(e.join(", "),".")}))]}},$t=P({"Display conditions":{privileges:{_description:"The privilege(s) the user must have to use this extension",_type:bt.Array,_default:[]}}},Kt),qt=function(t,e){return v((function(n){return t<=n&&n<=e}),"must be between ".concat(t," and ").concat(e))},Jt=function(t){var e=t.concat(["openmrsBase","openmrsSpaBase"]);return v((function(t){if(!t||"string"!=typeof t)return!1;for(var n=/\${(.*?)}/g,r=n.exec(t);r;){if(!e.includes(r[1]))return!1;r=n.exec(t)}return!0}),"Should be a URL or path. The allowed template parameters are "+e.map((function(t){return"${"+t+"}"})).join(", "))},Yt=Jt([]),Qt=function(t){return v((function(e){return t.includes(e)}),"Must be one of the following: '".concat(t.join("', '"),"'."))},Xt={inRange:qt,isUrl:Yt,isUrlWithTemplateParameters:Jt,oneOf:Qt}}(),i}())}}}))},254:function(t){"use strict";t.exports=r},45:function(t){"use strict";t.exports=o},513:function(t){"use strict";t.exports=f},740:function(t){"use strict";t.exports=h},685:function(t){"use strict";t.exports=d},901:function(t){"use strict";t.exports=v},688:function(t){"use strict";t.exports=y},954:function(t){"use strict";t.exports=g},493:function(t){"use strict";t.exports=m},792:function(t){"use strict";t.exports=b}},e={};function w(n){var r=e[n];if(void 0!==r)return r.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,w),o.exports}w.g=function(){if("object"==("undefined"==typeof globalThis?"undefined":l(globalThis)))return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==("undefined"==typeof window?"undefined":l(window)))return window}}(),w.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var O={};return function(){"use strict";var t=function(t,e){var n=(new DOMParser).parseFromString(e,"image/svg+xml").querySelector("svg");n&&(n.id=t,jt.appendChild(n))},e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],s=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);s=!0);}catch(t){c=!0,o=t}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,e)||r(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},r=function(t,e){if(t){if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}},o=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},f=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},h=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},d=function(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":void 0===t?"undefined":l(t)},v=function(t,e,n){var r=b(t,e,n);zt.length?zt.forEach((function(t){return t(r)})):setTimeout((function(){throw r}))},y=function(t){if("function"!=typeof t)throw Error(m(28,!1));zt.push(t)},g=function(t){if("function"!=typeof t)throw Error(m(29,!1));var e=!1;return zt=zt.filter((function(n){var r=n===t;return e=e||r,!r})),e},m=function(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return"single-spa minified message #".concat(t,": ").concat(e?e+" ":"","See https://single-spa.js.org/error/?code=").concat(t).concat(r.length?"&arg=".concat(r.join("&arg=")):"")},b=function(t,e,n){var r,o,i,a="".concat(P(e)," '").concat(E(e),"' died in status ").concat(e.status,": ");if(o=t,null!=(i=Error)&&"undefined"!=typeof Symbol&&i[Symbol.hasInstance]?i[Symbol.hasInstance](o):u(o,i)){try{t.message=a+t.message}catch(t){}r=t}else{console.warn(m(30,!1,e.status,E(e)));try{r=Error(a+JSON.stringify(t))}catch(e){r=t}}return r.appOrParcelName=E(e),e.status=n,r},O=function(t){return t.status===Jt},S=function(t){try{return t.activeWhen(window.location)}catch(e){return v(e,t,te),!1}},E=function(t){return t.name},x=function(t){return Boolean(t.unmountThisParcel)},P=function(t){return x(t)?"parcel":"application"},j=function(){for(var t=arguments.length-1;t>0;t--)for(var e in arguments[t])"__proto__"!==e&&(arguments[t-1][e]=arguments[t][e]);return arguments[0]},k=function(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return t[n];return null},A=function(t){return t&&("function"==typeof t||(e=t,Array.isArray(e)&&!k(e,(function(t){return"function"!=typeof t}))));var e},_=function(t,e){var n=t[e]||[];0===(n=Array.isArray(n)?n:[n]).length&&(n=[function(){return Promise.resolve()}]);var r=P(t),o=E(t);return function(t){return n.reduce((function(n,i,a){return n.then((function(){var n=i(t);return T(n)?n:Promise.reject(m(15,!1,r,o,e,a))}))}),Promise.resolve())}},T=function(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch},C=function(t,e){var n=function(){return t.status=$t,t};return Promise.resolve().then((function(){return t.status!==Gt?t:(t.status=Kt,t.bootstrap?z(t,"bootstrap").then(n).catch((function(n){if(e)throw b(n,t,te);return v(n,t,te),t})):Promise.resolve().then(n))}))},I=function(t,e){return Promise.resolve().then((function(){var n=function(){return z(t,"unmount").then((function(){t.status=$t}),(function(n){if(e)throw b(n,t,te);v(n,t,te)}))};if(t.status!==Jt)return t;t.status=Qt;var r=Object.keys(t.parcels).map((function(e){return t.parcels[e].unmountThisParcel()}));return Promise.all(r).then(n,(function(r){return n().then((function(){var n=Error(r.message);if(e)throw b(n,t,te);v(n,t,te)}))})).then((function(){return t}))}))},M=function(t,e){return Promise.resolve().then((function(){return t.status!==$t?t:(ne||(window.dispatchEvent(new Vt("single-spa:before-first-mount")),ne=!0),t.status=qt,z(t,"mount").then((function(){return t.status=Jt,re||(window.dispatchEvent(new Vt("single-spa:first-mount")),re=!0),t})).catch((function(n){var r=function(){if(e)throw b(n,t,te);return v(n,t,te),t};return t.status=Jt,I(t,!0).then(r,r)})))}))},D=function(){return N.apply(ie,arguments)},N=function(t,e){var n=this;if(!t||"object"!=(void 0===t?"undefined":l(t))&&"function"!=typeof t)throw Error(m(2,!1));if(t.name&&"string"!=typeof t.name)throw Error(m(3,!1,d(t.name)));var r=oe++,o=t.name||"parcel-".concat(r);if("object"!=(void 0===e?"undefined":l(e)))throw Error(m(4,!1,o,void 0===e?"undefined":d(e)));if(!e.domElement)throw Error(m(5,!1,o));var i,a="function"==typeof t,u=a?t:function(){return Promise.resolve(t)},s={id:r,parcels:{},status:a?Wt:Gt,customProps:e,parentName:E(n),unmountThisParcel:function(){return v.then((function(){if(s.status!==Jt)throw Error(m(6,!1,o,s.status));return I(s,!0)})).then((function(t){return s.parentName&&delete n.parcels[s.id],t})).then((function(t){return f(t),t})).catch((function(t){throw s.status=te,p(t),t}))}};n.parcels[r]=s;var c=u();if(!c||"function"!=typeof c.then)throw Error(m(7,!1));c=c.then((function(t){if(!t)throw Error(m(8,!1));if(o=t.name||"parcel-".concat(r),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!A(t.bootstrap))throw Error(m(9,!1,o));if(!A(t.mount))throw Error(m(10,!1,o));if(!A(t.unmount))throw Error(m(11,!1,o));if(t.update&&!A(t.update))throw Error(m(12,!1,o));var e=_(t,"bootstrap"),n=_(t,"mount"),a=_(t,"unmount");s.status=Gt,s.name=o,s.bootstrap=e,s.mount=n,s.unmount=a,s.timeouts=H(t.timeouts),t.update&&(s.update=_(t,"update"),i.update=function(t){return s.customProps=t,R((e=s,Promise.resolve().then((function(){if(e.status!==Jt)throw Error(m(32,!1,E(e)));return e.status=Yt,z(e,"update").then((function(){return e.status=Jt,e})).catch((function(t){throw b(t,e,te)}))}))));var e})}));var f,p,h=c.then((function(){return C(s,!0)})),v=h.then((function(){return M(s,!0)})),y=new Promise((function(t,e){f=t,p=e}));return i={mount:function(){return R(Promise.resolve().then((function(){if(s.status!==$t)throw Error(m(13,!1,o,s.status));return n.parcels[r]=s,M(s)})))},unmount:function(){return R(s.unmountThisParcel())},getStatus:function(){return s.status},loadPromise:R(c),bootstrapPromise:R(h),mountPromise:R(v),unmountPromise:R(y)}},R=function(t){return t.then((function(){return null}))},L=function(t){var e=E(t),n="function"==typeof t.customProps?t.customProps(e,window.location):t.customProps;("object"!=(void 0===n?"undefined":l(n))||null===n||Array.isArray(n))&&(n={},console.warn(m(40,!1),e,n));var r=j({},n,{name:e,mountParcel:N.bind(t),singleSpa:Bt});return x(t)&&(r.unmountSelf=t.unmountThisParcel),r},U=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(m(16,!1));ae.bootstrap={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},B=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(m(17,!1));ae.mount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},F=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(m(18,!1));ae.unmount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},V=function(t,e,n){if("number"!=typeof t||t<=0)throw Error(m(19,!1));ae.unload={millis:t,dieOnTimeout:e,warningMillis:n||1e3}},z=function(t,e){var n=t.timeouts[e],r=n.warningMillis,o=P(t);return new Promise((function(i,a){var u=!1,s=!1;t[e](L(t)).then((function(t){u=!0,i(t)})).catch((function(t){u=!0,a(t)})),setTimeout((function(){return l(1)}),r),setTimeout((function(){return l(!0)}),n.millis);var c=m(31,!1,e,o,E(t),n.millis);function l(t){if(!u)if(!0===t)s=!0,n.dieOnTimeout?a(Error(c)):console.error(c);else if(!s){var e=t,o=e*r;console.warn(c),o+r<n.millis&&setTimeout((function(){return l(e+1)}),r)}}}))},H=function(t){var e={};for(var n in ae)e[n]=j({},ae[n],t&&t[n]||{});return e},W=function(t){return Promise.resolve().then((function(){return t.loadPromise?t.loadPromise:t.status!==Ht&&t.status!==Zt?t:(t.status=Wt,t.loadPromise=Promise.resolve().then((function(){var r=t.loadApp(L(t));if(!T(r))throw n=!0,Error(m(33,!1,E(t)));return r.then((function(n){var r;t.loadErrorTime=null,"object"!=l(e=n)&&(r=34),Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!A(e.bootstrap)&&(r=35),A(e.mount)||(r=36),A(e.unmount)||(r=37);var o=P(e);if(r){var i;try{i=JSON.stringify(e)}catch(t){}return console.error(m(r,!1,o,E(t),i),e),v(void 0,t,te),t}return e.devtools&&e.devtools.overlays&&(t.devtools.overlays=j({},t.devtools.overlays,e.devtools.overlays)),t.status=Gt,t.bootstrap=_(e,"bootstrap"),t.mount=_(e,"mount"),t.unmount=_(e,"unmount"),t.unload=_(e,"unload"),t.timeouts=H(e.timeouts),delete t.loadPromise,t}))})).catch((function(e){var r;return delete t.loadPromise,n?r=te:(r=Zt,t.loadErrorTime=(new Date).getTime()),v(e,t,r),t})));var e,n}))},G=function(t){var e;if("string"==typeof t)e=t;else if(this&&this.href)e=this.href;else{if(!(t&&t.currentTarget&&t.currentTarget.href&&t.preventDefault))throw Error(m(14,!1));e=t.currentTarget.href,t.preventDefault()}var n=Y(window.location.href),r=Y(e);0===e.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=e:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,e)},K=function(t){var e=this;if(t){var n=t[0].type;ce.indexOf(n)>=0&&se[n].forEach((function(n){try{n.apply(e,t)}catch(t){setTimeout((function(){throw t}))}}))}},$=function(){be([],arguments)},q=function(t,e){return function(){var n=window.location.href,r=t.apply(this,arguments),o=window.location.href;return Ut&&n===o||window.dispatchEvent(function(t,e){var n;try{n=new PopStateEvent("popstate",{state:t})}catch(e){(n=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,t)}return n.singleSpa=!0,n.singleSpaTrigger=e,n}(window.history.state,e)),r}},J=function(t){if(fe)throw Error(m(43,!1));Ut=!t||!t.hasOwnProperty("urlRerouteOnly")||t.urlRerouteOnly,fe=!0,le=window.history.replaceState,window.addEventListener("hashchange",$),window.addEventListener("popstate",$);var e=window.addEventListener,n=window.removeEventListener;window.addEventListener=function(t,n){if(!("function"==typeof n&&ce.indexOf(t)>=0)||k(se[t],(function(t){return t===n})))return e.apply(this,arguments);se[t].push(n)},window.removeEventListener=function(t,e){if(!("function"==typeof e&&ce.indexOf(t)>=0))return n.apply(this,arguments);se[t]=se[t].filter((function(t){return t!==e}))},window.history.pushState=q(window.history.pushState,"pushState"),window.history.replaceState=q(le,"replaceState")},Y=function(t){var e=document.createElement("a");return e.href=t,e},Q=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!pe){var e=t.fn.on,n=t.fn.off;t.fn.on=function(t,n){return X.call(this,e,window.addEventListener,t,n,arguments)},t.fn.off=function(t,e){return X.call(this,n,window.removeEventListener,t,e,arguments)},pe=!0}},X=function(t,e,n,r,o){return"string"!=typeof n?t.apply(this,o):(n.split(/\s+/).forEach((function(t){ce.indexOf(t)>=0&&(e(t,r),n=n.replace(t,""))})),""===n.trim()?this:t.apply(this,o))},Z=function(t){return Promise.resolve().then((function(){var e=he[E(t)];if(!e)return t;if(t.status===Ht)return tt(t,e),t;if(t.status===Xt)return e.promise.then((function(){return t}));if(t.status!==$t&&t.status!==Zt)return t;var n=t.status===Zt?Promise.resolve():z(t,"unload");return t.status=Xt,n.then((function(){return tt(t,e),t})).catch((function(n){return function(t,e,n){delete he[E(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,v(n,t,te),e.reject(n)}(t,e,n),t}))}))},tt=function(t,e){delete he[E(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=Ht,e.resolve()},et=function(t,e,n,r){he[E(t)]={app:t,resolve:n,reject:r},Object.defineProperty(he[E(t)],"promise",{get:e})},nt=function(t){return he[t]},rt=function(){return de.filter(O).map(E)},ot=function(){return de.map(E)},it=function(t){var e=k(de,(function(e){return E(e)===t}));return e?e.status:null},at=function(t,e,n,r){var o=function(t,e,n,r){var o,i={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"==(void 0===t?"undefined":l(t))?(function(t){if(Array.isArray(t)||null===t)throw Error(m(39,!1));var e=["name","app","activeWhen","customProps"],n=Object.keys(t).reduce((function(t,n){return e.indexOf(n)>=0?t:t.concat(n)}),[]);if(0!==n.length)throw Error(m(38,!1,e.join(", "),n.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(m(20,!1));if("object"!=l(t.app)&&"function"!=typeof t.app)throw Error(m(20,!1));var r=function(t){return"string"==typeof t||"function"==typeof t};if(!(r(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(r)))throw Error(m(24,!1));if(!ft(t.customProps))throw Error(m(22,!1))}(t),i.name=t.name,i.loadApp=t.app,i.activeWhen=t.activeWhen,i.customProps=t.customProps):(function(t,e,n,r){if("string"!=typeof t||0===t.length)throw Error(m(20,!1));if(!e)throw Error(m(23,!1));if("function"!=typeof n)throw Error(m(24,!1));if(!ft(r))throw Error(m(22,!1))}(t,e,n,r),i.name=t,i.loadApp=e,i.activeWhen=n,i.customProps=r),i.loadApp="function"!=typeof(o=i.loadApp)?function(){return Promise.resolve(o)}:o,i.customProps=function(t){return t||{}}(i.customProps),i.activeWhen=function(t){var e=Array.isArray(t)?t:[t];return e=e.map((function(t){return"function"==typeof t?t:pt(t)})),function(t){return e.some((function(e){return e(t)}))}}(i.activeWhen),i}(t,e,n,r);if(yt()||ve||(ve=!0,setTimeout((function(){yt()||console.warn(m(1,!1))}),5e3)),-1!==ot().indexOf(o.name))throw Error(m(21,!1,o.name));de.push(j({loadErrorTime:null,status:Ht,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},o)),ue&&(Q(),be())},ut=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return de.filter((function(e){return e.activeWhen(t)})).map(E)},st=function(t){if(0===de.filter((function(e){return E(e)===t})).length)throw Error(m(25,!1,t));return(ue?ct(t,{waitForUnmount:!1}):Promise.resolve()).then((function(){var e=de.map(E).indexOf(t);de.splice(e,1)}))},ct=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof t)throw Error(m(26,!1));var n=k(de,(function(e){return E(e)===t}));if(!n)throw Error(m(27,!1,t));var r,o=nt(E(n));if(e&&e.waitForUnmount){if(o)return o.promise;var i=new Promise((function(t,e){et(n,(function(){return i}),t,e)}));return i}return o?(r=o.promise,lt(n,o.resolve,o.reject)):r=new Promise((function(t,e){et(n,(function(){return r}),t,e),lt(n,t,e)})),r},lt=function(t,e,n){Promise.resolve().then((function(){if(k(ut(),(function(e){return e===E(t)})))return ht()})).then((function(){return I(t).then(Z).then((function(){e(),setTimeout((function(){be()}))}))})).catch(n)},ft=function(t){return!t||"function"==typeof t||"object"==(void 0===t?"undefined":l(t))&&null!==t&&!Array.isArray(t)},pt=function(t,e){var n=function(t,e){var n=function(n){var a=t.slice(r,n).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(i+=o?"[^/]+/?":a,n===t.length)if(o)e&&(i+="$");else{var u=e?"":".*";i="/"===i.charAt(i.length-1)?"".concat(i).concat(u,"$"):"".concat(i,"(/").concat(u,")?(#.*)?$")}o=!o,r=n},r=0,o=!1,i="^";"/"!==t[0]&&(t="/"+t);for(var a=0;a<t.length;a++){var u=t[a];(!o&&":"===u||o&&"/"===u)&&n(a)}return n(t.length),new RegExp(i,"i")}(t,e);return function(t){var e=t.origin;e||(e="".concat(t.protocol,"//").concat(t.host));var r=t.href.replace(e,"").replace(t.search,"").split("?")[0];return n.test(r)}},ht=function(){return be()},dt=function(t,e){return S(t)?C(t).then((function(t){return e.then((function(){return S(t)?M(t):t}))})):e.then((function(){return t}))},vt=function(t){we=!0,ue&&(J(t),be())},yt=function(){return we},gt=function(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n},mt=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?gt(Object(n),!0).forEach((function(e){bt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):gt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t},bt=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},wt=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},Ot=function(){return nn.apply(this,arguments)},St=w(714),Et='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 380 119"><path fill="var(--logo-red)" fill-rule="evenodd" d="M40.29 40.328a27.76 27.76 0 0 1 19.688-8.154c7.669 0 14.613 3.102 19.646 8.116l.021-18.54A42.84 42.84 0 0 0 59.978 17c-7.089 0-13.813 1.93-19.709 4.968z" clip-rule="evenodd"/><path fill="var(--logo-orange)" fill-rule="evenodd" d="M79.645 79.671a27.74 27.74 0 0 1-19.684 8.154c-7.67 0-14.614-3.101-19.651-8.116l-.02 18.54A42.86 42.86 0 0 0 59.96 103a42.8 42.8 0 0 0 19.672-4.751z" clip-rule="evenodd"/><path fill="var(--logo-purple)" fill-rule="evenodd" d="M40.328 79.696c-5.038-5.037-8.154-11.995-8.154-19.685 0-7.669 3.102-14.612 8.116-19.65l-18.54-.02A42.85 42.85 0 0 0 17 60.012a42.8 42.8 0 0 0 4.752 19.672z" clip-rule="evenodd"/><path fill="var(--logo-green)" fill-rule="evenodd" d="M79.634 40.289a27.75 27.75 0 0 1 8.154 19.688 27.74 27.74 0 0 1-8.117 19.646l18.542.02a42.84 42.84 0 0 0 4.749-19.666c0-7.09-1.714-13.779-4.751-19.675z" clip-rule="evenodd"/><path fill="var(--logo-black)" fill-rule="evenodd" d="M156.184 60.003c0-8.749-6.118-15.777-15.025-15.777-8.909 0-15.025 7.028-15.025 15.776s6.116 15.78 15.025 15.78c8.907 0 15.025-7.031 15.025-15.78m-34.881 0c0-11.483 8.318-19.96 19.856-19.96 11.536 0 19.855 8.478 19.855 19.96 0 11.484-8.319 19.964-19.855 19.964-11.538 0-19.856-8.48-19.856-19.964M179.514 75.54c5.507 0 9.05-4.14 9.05-9.482s-3.543-9.483-9.05-9.483c-5.505 0-9.046 4.142-9.046 9.483s3.541 9.482 9.046 9.482M166.22 53.306h4.248v3.704h.11c2.344-2.725 5.449-4.36 9.154-4.36 8.014 0 13.408 5.67 13.408 13.408 0 7.63-5.613 13.406-12.752 13.406-4.58 0-8.231-2.29-9.81-5.178h-.11V90.87h-4.248zM217.773 63.768c-.163-4.305-3-7.193-7.686-7.193-4.685 0-7.79 2.888-8.335 7.193zm3.653 10.412c-3.001 3.868-6.596 5.284-11.339 5.284-8.01 0-12.914-5.993-12.914-13.406 0-7.901 5.559-13.407 13.08-13.407 7.196 0 12.096 4.906 12.096 13.354v1.362h-20.597c.325 4.413 3.704 8.173 8.335 8.173 3.65 0 6.105-1.307 8.12-3.868zM227.854 59.357c0-2.347-.216-4.361-.216-6.05h4.031c0 1.362.11 2.776.11 4.194h.11c1.144-2.505 4.306-4.85 8.5-4.85 6.705 0 9.699 4.252 9.699 10.41v15.748h-4.248v-15.31c0-4.253-1.856-6.924-5.833-6.924-5.503 0-7.903 3.979-7.903 9.811V78.81h-4.25zM259.211 41.009h6.708L278.8 70.79h.107l12.982-29.782h6.549v37.99h-4.506V47.124h-.106L280.192 79h-2.738l-13.629-31.875h-.107V79h-4.507zM312.392 57.752h4.023c4.992 0 11.487 0 11.487-6.282 0-5.47-4.776-6.276-9.177-6.276h-6.333zm-4.506-16.744h9.711c7.352 0 15.132 1.072 15.132 10.462 0 5.527-3.594 9.125-9.495 10.037l10.784 17.492h-5.525l-10.304-17.063h-5.797V79h-4.506zM358.123 47.713c-1.506-2.414-4.187-3.487-6.926-3.487-3.973 0-8.1 1.88-8.1 6.385 0 3.49 1.931 5.047 7.994 6.98 5.903 1.878 11.377 3.809 11.377 11.267 0 7.567-6.495 11.11-13.36 11.11-4.402 0-9.125-1.45-11.7-5.262l3.862-3.165c1.61 2.794 4.83 4.24 8.105 4.24 3.862 0 8.263-2.253 8.263-6.601 0-4.669-3.165-5.474-9.928-7.728-5.366-1.771-9.442-4.134-9.442-10.463 0-7.298 6.277-10.945 12.929-10.945 4.241 0 7.836 1.178 10.625 4.45zM185.885 90.998h1.424l2.734 6.326h.023l2.758-6.326h1.391v8.07h-.957v-6.77h-.024l-2.894 6.77h-.582l-2.894-6.77h-.022v6.77h-.957zM198.386 90.998h5.071v.889h-4.114v2.53h3.841v.89h-3.841v2.871h4.32v.89h-5.277zM207.891 98.178h1.822c1.848 0 3.25-.935 3.25-3.146s-1.402-3.145-3.25-3.145h-1.822zm-.957-7.18h3.1c1.583 0 3.953 1.06 3.953 4.034 0 2.976-2.37 4.036-3.953 4.036h-3.1zM217.007 99.068h.958v-8.07h-.958zM227.105 92.663c-.478-.651-1.242-.981-2.017-.981-1.8 0-3.077 1.584-3.077 3.35 0 1.87 1.266 3.352 3.077 3.352.98 0 1.767-.4 2.337-1.129l.718.603c-.718.97-1.766 1.414-3.055 1.414-2.314 0-4.102-1.79-4.102-4.24 0-2.37 1.709-4.239 4.102-4.239 1.095 0 2.166.377 2.849 1.266zM233.557 92.23h-.024l-1.675 3.965h3.294zm-.434-1.232h.9l3.43 8.07h-1.117l-.82-1.984h-4.034l-.832 1.984h-1.082zM240.006 90.998h.958v7.18h3.692v.89h-4.65zM252.793 94.554h.855c1.06 0 2.439 0 2.439-1.334 0-1.161-1.014-1.333-1.948-1.333h-1.346zm-.957-3.556h2.063c1.561 0 3.214.228 3.214 2.222 0 1.174-.764 1.938-2.018 2.132l2.291 3.716h-1.173l-2.19-3.625h-1.23v3.625h-.957zM260.51 90.998h5.07v.889h-4.112v2.53h3.84v.89h-3.84v2.871h4.318v.89h-5.276zM274.402 92.663c-.479-.651-1.242-.981-2.018-.981-1.8 0-3.077 1.584-3.077 3.35 0 1.87 1.266 3.352 3.077 3.352.98 0 1.767-.4 2.336-1.129l.718.603c-.718.97-1.766 1.414-3.054 1.414-2.313 0-4.102-1.79-4.102-4.24 0-2.37 1.709-4.239 4.102-4.239 1.094 0 2.166.377 2.85 1.266zM284.739 95.032c0-1.857-1.3-3.35-3.191-3.35-1.892 0-3.191 1.493-3.191 3.35 0 1.858 1.299 3.352 3.191 3.352s3.191-1.494 3.191-3.352m-7.409 0c0-2.439 1.767-4.239 4.218-4.239s4.217 1.8 4.217 4.239-1.767 4.24-4.217 4.24c-2.451 0-4.218-1.8-4.218-4.24M289.514 94.554h.855c1.059 0 2.438 0 2.438-1.334 0-1.161-1.014-1.333-1.948-1.333h-1.345zm-.958-3.556h2.062c1.563 0 3.215.228 3.215 2.222 0 1.174-.763 1.938-2.016 2.132l2.289 3.716h-1.173l-2.189-3.625h-1.23v3.625h-.958zM297.81 98.178h1.825c1.845 0 3.246-.935 3.246-3.146s-1.401-3.145-3.246-3.145h-1.825zm-.957-7.18h3.1c1.585 0 3.956 1.06 3.956 4.034 0 2.976-2.371 4.036-3.956 4.036h-3.1zM315.407 92.422c-.318-.513-.89-.74-1.47-.74-.844 0-1.721.4-1.721 1.356 0 .74.41 1.072 1.698 1.482 1.254.399 2.417.81 2.417 2.393 0 1.607-1.38 2.36-2.838 2.36-.935 0-1.938-.309-2.486-1.118l.821-.672c.342.593 1.026.9 1.721.9.821 0 1.754-.478 1.754-1.402 0-.991-.67-1.163-2.107-1.64-1.139-.377-2.006-.878-2.006-2.222 0-1.551 1.333-2.326 2.747-2.326.9 0 1.664.25 2.256.946zM320.844 95.591l-3.009-4.593h1.219l2.269 3.647 2.335-3.647h1.152l-3.01 4.593v3.477h-.956zM330.565 92.422c-.32-.513-.89-.74-1.471-.74-.843 0-1.72.4-1.72 1.356 0 .74.41 1.072 1.698 1.482 1.254.399 2.415.81 2.415 2.393 0 1.607-1.378 2.36-2.837 2.36-.934 0-1.937-.309-2.485-1.118l.821-.672c.342.593 1.026.9 1.721.9.821 0 1.754-.478 1.754-1.402 0-.991-.671-1.163-2.107-1.64-1.139-.377-2.006-.878-2.006-2.222 0-1.551 1.333-2.326 2.746-2.326.901 0 1.665.25 2.257.946zM339.283 91.887h-2.666v7.18h-.958v-7.18h-2.667v-.889h6.291zM341.665 90.998h5.071v.889h-4.113v2.53h3.84v.89h-3.84v2.871h4.319v.89h-5.277zM349.905 90.998h1.424l2.735 6.326h.023l2.758-6.326h1.391v8.07h-.958v-6.77h-.023l-2.894 6.77h-.582l-2.895-6.77h-.021v6.77h-.958z" clip-rule="evenodd"/></svg>',xt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 380 119"><path fill="var(--logo-red)" fill-rule="evenodd" d="M40.29 40.328a27.76 27.76 0 0 1 19.688-8.154c7.669 0 14.613 3.102 19.647 8.116l.02-18.54A42.84 42.84 0 0 0 59.978 17c-7.089 0-13.813 1.93-19.709 4.968z" clip-rule="evenodd"/><path fill="var(--logo-orange)" fill-rule="evenodd" d="M79.645 79.671a27.74 27.74 0 0 1-19.684 8.154c-7.67 0-14.614-3.101-19.651-8.116l-.02 18.54A42.86 42.86 0 0 0 59.96 103a42.8 42.8 0 0 0 19.672-4.751z" clip-rule="evenodd"/><path fill="var(--logo-purple)" fill-rule="evenodd" d="M40.328 79.696c-5.038-5.037-8.154-11.995-8.154-19.685 0-7.669 3.102-14.612 8.116-19.65l-18.54-.02A42.85 42.85 0 0 0 17 60.012a42.8 42.8 0 0 0 4.752 19.672z" clip-rule="evenodd"/><path fill="var(--logo-green)" fill-rule="evenodd" d="M79.634 40.289a27.75 27.75 0 0 1 8.154 19.688 27.74 27.74 0 0 1-8.117 19.646l18.542.02a42.84 42.84 0 0 0 4.749-19.666c0-7.09-1.714-13.779-4.751-19.675z" clip-rule="evenodd"/><path fill="var(--logo-black)" fill-rule="evenodd" d="M156.184 60.003c0-8.749-6.118-15.777-15.025-15.777-8.909 0-15.025 7.028-15.025 15.776s6.116 15.78 15.025 15.78c8.907 0 15.025-7.031 15.025-15.78m-34.881 0c0-11.483 8.318-19.96 19.856-19.96 11.536 0 19.855 8.478 19.855 19.96 0 11.484-8.319 19.964-19.855 19.964-11.538 0-19.856-8.48-19.856-19.964M179.514 75.54c5.507 0 9.05-4.14 9.05-9.482s-3.543-9.483-9.05-9.483c-5.505 0-9.046 4.142-9.046 9.483s3.541 9.482 9.046 9.482M166.22 53.306h4.248v3.704h.11c2.344-2.725 5.449-4.36 9.154-4.36 8.014 0 13.408 5.67 13.408 13.408 0 7.63-5.613 13.406-12.752 13.406-4.58 0-8.231-2.29-9.81-5.178h-.11V90.87h-4.248zM217.773 63.768c-.163-4.305-3-7.193-7.686-7.193-4.685 0-7.79 2.888-8.335 7.193zm3.653 10.412c-3.001 3.868-6.596 5.284-11.339 5.284-8.01 0-12.914-5.993-12.914-13.406 0-7.901 5.559-13.407 13.08-13.407 7.196 0 12.096 4.906 12.096 13.354v1.362h-20.597c.325 4.413 3.704 8.173 8.335 8.173 3.65 0 6.105-1.307 8.12-3.868zM227.854 59.357c0-2.347-.216-4.361-.216-6.05h4.031c0 1.362.11 2.776.11 4.194h.11c1.144-2.505 4.306-4.85 8.5-4.85 6.705 0 9.699 4.252 9.699 10.41v15.748h-4.248v-15.31c0-4.253-1.856-6.924-5.833-6.924-5.503 0-7.903 3.979-7.903 9.811V78.81h-4.25zM259.211 41.009h6.708L278.8 70.79h.107l12.982-29.782h6.549v37.99h-4.506V47.124h-.106L280.192 79h-2.738l-13.629-31.875h-.107V79h-4.507zM312.392 57.752h4.023c4.992 0 11.487 0 11.487-6.282 0-5.47-4.776-6.276-9.177-6.276h-6.333zm-4.506-16.744h9.711c7.352 0 15.132 1.072 15.132 10.462 0 5.527-3.594 9.125-9.495 10.037L334.018 79h-5.525l-10.304-17.063h-5.797V79h-4.506zM358.123 47.713c-1.506-2.414-4.187-3.487-6.926-3.487-3.973 0-8.1 1.88-8.1 6.385 0 3.49 1.931 5.047 7.994 6.98 5.903 1.878 11.377 3.809 11.377 11.267 0 7.567-6.495 11.11-13.36 11.11-4.402 0-9.125-1.45-11.7-5.262l3.862-3.165c1.61 2.794 4.83 4.24 8.105 4.24 3.862 0 8.263-2.253 8.263-6.601 0-4.669-3.165-5.474-9.928-7.728-5.366-1.771-9.442-4.134-9.442-10.463 0-7.298 6.277-10.945 12.929-10.945 4.241 0 7.836 1.178 10.625 4.45z" clip-rule="evenodd"/></svg>',Pt='<svg xmlns="http://www.w3.org/2000/svg" width="121" height="118"><path fill="var(--logo-red)" fill-rule="evenodd" d="M40.436 39.474a27.93 27.93 0 0 1 19.811-8.205c7.717 0 14.705 3.122 19.77 8.167l.021-18.656A43.1 43.1 0 0 0 60.247 16c-7.133 0-13.899 1.943-19.832 4.999z" clip-rule="evenodd"/><path fill="var(--logo-orange)" fill-rule="evenodd" d="M80.038 79.064a27.92 27.92 0 0 1-19.808 8.205c-7.717 0-14.705-3.121-19.774-8.167l-.02 18.657a43.1 43.1 0 0 0 19.794 4.78 43.1 43.1 0 0 0 19.794-4.781z" clip-rule="evenodd"/><path fill="var(--logo-purple)" fill-rule="evenodd" d="M40.474 79.089c-5.069-5.069-8.205-12.07-8.205-19.808 0-7.717 3.121-14.704 8.167-19.773l-18.657-.02A43.1 43.1 0 0 0 17 59.281a43.1 43.1 0 0 0 4.782 19.795z" clip-rule="evenodd"/><path fill="var(--logo-green)" fill-rule="evenodd" d="M80.027 39.435a27.93 27.93 0 0 1 8.205 19.811 27.92 27.92 0 0 1-8.168 19.769l18.658.021a43.1 43.1 0 0 0 4.779-19.79 43.1 43.1 0 0 0-4.781-19.798z" clip-rule="evenodd"/></svg>',jt=document.createElement("div"),kt=function(){document.body.appendChild(jt)};jt.id="omrs-svgs-container",jt.style.display="none","complete"===document.readyState?kt():window.addEventListener("load",kt);var At='<svg xmlns="http://www.w3.org/2000/svg"><path d="M9 2H7v2h2zM4 2H2v2h2zM14 2h-2v2h2zM9 7H7v2h2zM4 7H2v2h2zM14 7h-2v2h2zM9 12H7v2h2zM4 12H2v2h2zM14 12h-2v2h2z"/></svg>',_t={"Brand color #1":{_default:"#005d5d",_type:St.Type.String},"Brand color #2":{_default:"#004144",_type:St.Type.String},"Brand color #3":{_default:"#007d79",_type:St.Type.String},patientPhotoConceptUuid:{_type:St.Type.ConceptUuid,_default:"736e8771-e501-4615-bfa7-570c03f4bef5",_description:"Used to look up the patient photo, which is stored as an attachment obs. Set to `null` in order to disable the feature and use only generated avatars. To remove the avatars entirely, use extension configuration's `remove` feature."},preferredCalendar:{_type:St.Type.Object,_description:"Keys should be locale codes, and values should be the preferred calendar for that locale. For example, {'am': 'ethiopic'}.",_default:{am:"ethiopic"},_elements:{_validators:[St.validators.oneOf(["buddhist","chinese","coptic","dangi","ethioaa","ethiopic","gregory","hebrew","indian","islamic","islamic-umalqura","islamic-tbla","islamic-civil","islamic-rgsa","iso8601","japanese","persian","roc","islamicc"])]}}};Number.MAX_SAFE_INTEGER;var Tt=w(954),Ct=w(792),It={};try{process.env.CARBON_ENABLE_CSS_CUSTOM_PROPERTIES&&"true"===process.env.CARBON_ENABLE_CSS_CUSTOM_PROPERTIES?It.enableCssCustomProperties=!0:It.enableCssCustomProperties=!1,process.env.CARBON_ENABLE_USE_CONTROLLED_STATE_WITH_VALUE&&"true"===process.env.CARBON_ENABLE_USE_CONTROLLED_STATE_WITH_VALUE?It.enableUseControlledStateWithValue=!0:It.enableUseControlledStateWithValue=!1,process.env.CARBON_ENABLE_CSS_GRID&&"true"===process.env.CARBON_ENABLE_CSS_GRID?It.enableCssGrid=!0:It.enableCssGrid=!1,process.env.CARBON_ENABLE_V11_RELEASE?"true"===process.env.CARBON_ENABLE_V11_RELEASE?It.enableV11Release=!0:It.enableV11Release=!1:It.enableV11Release=!0,process.env.CARBON_ENABLE_EXPERIMENTAL_TILE_CONTRAST&&"true"===process.env.CARBON_ENABLE_EXPERIMENTAL_TILE_CONTRAST?It.enableExperimentalTileContrast=!0:It.enableExperimentalTileContrast=!1,process.env.CARBON_ENABLE_V12_TILE_DEFAULT_ICONS&&"true"===process.env.CARBON_ENABLE_V12_TILE_DEFAULT_ICONS?It.enableV12TileDefaultIcons=!0:It.enableV12TileDefaultIcons=!1,process.env.CARBON_ENABLE_V12_OVERFLOWMENU&&"true"===process.env.CARBON_ENABLE_V12_OVERFLOWMENU?It.enableV12Overflowmenu=!0:It.enableV12Overflowmenu=!1}catch(t){It.enableCssCustomProperties=!1,It.enableUseControlledStateWithValue=!1,It.enableCssGrid=!1,It.enableV11Release=!0,It.enableExperimentalTileContrast=!1,It.enableV12TileDefaultIcons=!1,It.enableV12Overflowmenu=!1}for(var Mt=[{name:"enable-css-custom-properties",description:"Describe what the flag does",enabled:It.enableCssCustomProperties},{name:"enable-use-controlled-state-with-value",description:"Enable components to be created in either a controlled or uncontrolled mode\n",enabled:It.enableUseControlledStateWithValue},{name:"enable-css-grid",description:"Enable CSS Grid Layout in the Grid and Column React components\n",enabled:It.enableCssGrid},{name:"enable-v11-release",description:"Enable the features and functionality for the v11 Release\n",enabled:It.enableV11Release},{name:"enable-experimental-tile-contrast",description:"Enable the experimental tile improved contrast styles\n",enabled:It.enableExperimentalTileContrast},{name:"enable-v12-tile-default-icons",description:"Enable rendering of default icons in the tile components\n",enabled:It.enableV12TileDefaultIcons},{name:"enable-v12-overflowmenu",description:"Enable the use of the v12 OverflowMenu leveraging the Menu subcomponents\n",enabled:It.enableV12Overflowmenu}],Dt=function(){function t(e){var n=this;(function(t,e){if(n=t,!(null!=(r=e)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):u(n,r)))throw new TypeError("Cannot call a class as a function");var n,r})(this,t),this.flags=new Map,e&&Object.keys(e).forEach((function(t){n.flags.set(t,e[t])}))}var n,o;return n=t,o=[{key:"checkForFlag",value:function(t){if(!this.flags.has(t))throw new Error("Unable to find a feature flag with the name: `".concat(t,"`"))}},{key:"add",value:function(t,e){if(this.flags.has(t))throw new Error("The feature flag: ".concat(t," already exists"));this.flags.set(t,e)}},{key:"enable",value:function(t){this.checkForFlag(t),this.flags.set(t,!0)}},{key:"disable",value:function(t){this.checkForFlag(t),this.flags.set(t,!1)}},{key:"merge",value:function(t){var e=this;Object.keys(t).forEach((function(n){e.flags.set(n,t[n])}))}},{key:"mergeWithScope",value:function(t){var n,o=function(t){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=r(t))){e&&(t=e);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==e.return||e.return()}finally{if(u)throw i}}}}(t.flags);try{for(o.s();!(n=o.n()).done;){var i=e(n.value,2),a=i[0],u=i[1];this.flags.has(a)||this.flags.set(a,u)}}catch(t){o.e(t)}finally{o.f()}}},{key:"enabled",value:function(t){return this.checkForFlag(t),this.flags.get(t)}}],o&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,"symbol"==(void 0===(i=function(t){if("object"!=(void 0===t?"undefined":l(t))||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=(void 0===n?"undefined":l(n)))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key))?"undefined":(o=i)&&"undefined"!=typeof Symbol&&o.constructor===Symbol?"symbol":void 0===o?"undefined":l(o))?i:String(i),r)}var o,i}(n.prototype,o),Object.defineProperty(n,"prototype",{writable:!1}),t}(),Nt=new Dt(void 0),Rt=0;Rt<Mt.length;Rt++){var Lt=Mt[Rt];Nt.add(Lt.name,Lt.enabled)}!function(){Nt.merge.apply(Nt,arguments)}({"enable-css-custom-properties":!0,"enable-css-grid":!0,"enable-v11-release":!0,"enable-experimental-tile-contrast":!1}),w(279),new Ct.Subject,new Ct.Subject,new Ct.Subject,w(976),new Ct.Subject;var Ut,Bt=Object.freeze({__proto__:null,get start(){return vt},get ensureJQuerySupport(){return Q},get setBootstrapMaxTime(){return U},get setMountMaxTime(){return B},get setUnmountMaxTime(){return F},get setUnloadMaxTime(){return V},get registerApplication(){return at},get unregisterApplication(){return st},get getMountedApps(){return rt},get getAppStatus(){return it},get unloadApplication(){return ct},get checkActivityFunctions(){return ut},get getAppNames(){return ot},get pathToActiveWhen(){return pt},get navigateToUrl(){return G},get patchHistoryApi(){return J},get triggerAppChange(){return ht},get addErrorHandler(){return y},get removeErrorHandler(){return g},get mountRootParcel(){return D},get NOT_LOADED(){return Ht},get LOADING_SOURCE_CODE(){return Wt},get NOT_BOOTSTRAPPED(){return Gt},get BOOTSTRAPPING(){return Kt},get NOT_MOUNTED(){return $t},get MOUNTING(){return qt},get UPDATING(){return Yt},get LOAD_ERROR(){return Zt},get MOUNTED(){return Jt},get UNLOADING(){return Xt},get UNMOUNTING(){return Qt},get SKIP_BECAUSE_BROKEN(){return te}}),Ft=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).CustomEvent,Vt=function(){try{var t=new Ft("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?Ft:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(t,e){var n=document.createEvent("CustomEvent");return e?n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail):n.initCustomEvent(t,!1,!1,void 0),n}:function(t,e){var n=document.createEventObject();return n.type=t,e?(n.bubbles=Boolean(e.bubbles),n.cancelable=Boolean(e.cancelable),n.detail=e.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n},zt=[],Ht="NOT_LOADED",Wt="LOADING_SOURCE_CODE",Gt="NOT_BOOTSTRAPPED",Kt="BOOTSTRAPPING",$t="NOT_MOUNTED",qt="MOUNTING",Jt="MOUNTED",Yt="UPDATING",Qt="UNMOUNTING",Xt="UNLOADING",Zt="LOAD_ERROR",te="SKIP_BECAUSE_BROKEN",ee=[],ne=!1,re=!1,oe=0,ie={parcels:{}},ae={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}},ue="undefined"!=typeof window,se={hashchange:[],popstate:[]},ce=["hashchange","popstate"],le=null,fe=!1;ue&&(window.singleSpaNavigate?console.warn(m(41,!1)):window.singleSpaNavigate=G);var pe=!1,he={},de=[],ve=!1,ye=!1,ge=[],me=ue&&window.location.href;function be(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e="function"==typeof(null==t?void 0:t.then)?t:Promise.resolve(t);v.push(e.catch((function(t){return console.warn(Error(m(42,!1))),console.warn(t),!1})))},o=function(){var e=rt();t.forEach((function(t){return t.resolve(e)}));try{u(0===s.length?"no-app-change":"app-change",a()),u("routing-event",a())}catch(t){setTimeout((function(){throw t}))}if(ye=!1,ge.length>0){var n=ge;ge=[],be(n)}return e},i=function(){n||(t.forEach((function(t){K(t.eventArguments)})),K(e))},a=function(){var t,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1?arguments[1]:void 0,o={},i=(h(t={},Jt,[]),h(t,$t,[]),h(t,Ht,[]),h(t,te,[]),t);n?(p.concat(d).forEach((function(t,e){u(t,Jt)})),l.forEach((function(t){u(t,Ht)})),f.forEach((function(t){u(t,$t)}))):s.forEach((function(t){u(t)}));var a={detail:{newAppStatuses:o,appsByNewStatus:i,totalAppChanges:s.length,originalEvent:null==e?void 0:e[0],oldUrl:y,newUrl:g}};return r&&j(a.detail,r),a;function u(t,e){var n=E(t);e=e||it(n),o[n]=e,(i[e]=i[e]||[]).push(n)}},u=function(t,e){n||window.dispatchEvent(new Vt("single-spa:".concat(t),e))};if(ye)return new Promise((function(t,n){ge.push({resolve:t,reject:n,eventArguments:e})}));var s,c=function(){var t=[],e=[],n=[],r=[],o=(new Date).getTime();return de.forEach((function(i){var a=i.status!==te&&S(i);switch(i.status){case Zt:a&&o-i.loadErrorTime>=200&&n.push(i);break;case Ht:case Wt:a&&n.push(i);break;case Gt:case $t:!a&&nt(E(i))?t.push(i):a&&r.push(i);break;case Jt:a||e.push(i)}})),{appsToUnload:t,appsToUnmount:e,appsToLoad:n,appsToMount:r}}(),l=c.appsToUnload,f=c.appsToUnmount,p=c.appsToLoad,d=c.appsToMount,v=[],y=me,g=me=window.location.href;return yt()?(ye=!0,s=l.concat(p,f,d),Promise.resolve().then((function(){return u(0===s.length?"before-no-app-change":"before-app-change",a(!0)),u("before-routing-event",a(!0,{cancelNavigation:r})),Promise.all(v).then((function(n){if(n.some((function(t){return t})))return le.call(window.history,history.state,"",y.substring(location.origin.length)),me=location.href,ye=!1,be(t,e,!0);var r=l.map(Z),s=f.map(I).map((function(t){return t.then(Z)})).concat(r),c=Promise.all(s);c.then((function(){u("before-mount-routing-event",a(!0))}),(function(t){throw t}));var h=p.map((function(t){return W(t).then((function(t){return dt(t,c)}))})),v=d.filter((function(t){return p.indexOf(t)<0})).map((function(t){return dt(t,c)}));return c.catch((function(t){throw i(),t})).then((function(){return i(),Promise.all(h.concat(v)).catch((function(e){throw t.forEach((function(t){return t.reject(e)})),e})).then(o).then((function(){}),(function(t){throw t}))}))}))}))):(s=p,Promise.resolve().then((function(){var t=p.map(W);return Promise.all(t).then(i).then((function(){return[]})).catch((function(t){throw i(),t})).finally((function(){}))})))}var we=!1,Oe={getRawAppData:function(){return function(t){if(Array.isArray(t))return f(t)}(t=de)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return f(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(t,e):void 0}}(t)||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.")}();var t},reroute:be,NOT_LOADED:Ht,toLoadPromise:W,toBootstrapPromise:C,unregisterApplication:st,getProfilerData:function(){return ee}};ue&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Oe);var Se=w(685);w(45),w(254),(0,Se.createGlobalStore)("modalState",{modalContainer:null,modalStack:[]}),window.getComputedStyle(document.body).overflow,w(740),w(513),w(901),(0,Se.createGlobalStore)("workspace",{context:"",openWorkspaces:[],prompt:null,workspaceWindowState:"normal"});var Ee=null;try{Ee=n(1343).createContext()}catch(Ft){}function xe(t){return(xe=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Pe(t,e){return(Pe=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var je=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Pe(t,e)}(n,Tt.Component);var t,e=function(t){var e=function(){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(t){return!1}}();return function(){var n,r=xe(t);if(e){var o=xe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(t,e){if(e&&("object"==(void 0===e?"undefined":l(e))||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return wt(t)}(this,n)}}(n);function n(t){var r;if(function(t,e){if(n=t,!(null!=(r=e)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):u(n,r)))throw new TypeError("Cannot call a class as a function");var n,r}(this,n),bt(wt(r=e.call(this,t)),"handleRef",(function(t){r.el=t})),bt(wt(r),"addThingToDo",(function(t,e){r.state.hasError&&"unmount"!==t||(r.nextThingToDo=(r.nextThingToDo||Promise.resolve()).then((function(){if(!r.unmounted||"unmount"===t)return e.apply(void 0,arguments)})).catch((function(e){throw r.nextThingToDo=Promise.resolve(),r.setState({hasError:!0}),e&&e.message&&(e.message="During '".concat(t,"', parcel threw an error: ").concat(e.message)),r.props.handleError?r.props.handleError(e):setTimeout((function(){throw e})),e})))})),bt(wt(r),"getParcelProps",(function(){var t=mt(mt({},r.props),{},{domElement:r.el});return delete t.mountParcel,delete t.config,delete t.wrapWith,delete t.wrapStyle,delete t.appendTo,delete t.handleError,delete t.parcelDidMount,t})),r.state={hasError:!1},!t.config)throw new Error("single-spa-react's Parcel component requires the 'config' prop to either be a parcel config or a loading function that returns a promise. See https://github.com/single-spa/single-spa-react");return r}return(t=[{key:"componentDidMount",value:function(){var t=this;this.addThingToDo("mount",(function(){var e,n=t.props.mountParcel||t.mountParcel;if(!n)throw new Error("\n\t\t\t\t <Parcel /> was not passed a mountParcel prop, nor is it rendered where mountParcel is within the React context.\n\t\t\t\t If you are using <Parcel /> within a module that is not a single-spa application, you will need to import mountRootParcel from single-spa and pass it into <Parcel /> as a mountParcel prop\t\n\t\t\t\t");return t.el?e=t.el:(t.createdDomElement=e=document.createElement(t.props.wrapWith),Object.keys(t.props.wrapStyle).forEach((function(n){e.style[n]=t.props.wrapStyle[n]})),t.props.appendTo.appendChild(e)),t.parcel=n(t.props.config,mt({domElement:e},t.getParcelProps())),t.parcel.mountPromise.then(t.props.parcelDidMount),t.parcel.mountPromise}))}},{key:"componentDidUpdate",value:function(){var t=this;this.addThingToDo("update",(function(){if(t.parcel&&t.parcel.update)return t.parcel.update(t.getParcelProps())}))}},{key:"componentWillUnmount",value:function(){var t=this;this.addThingToDo("unmount",(function(){if(t.parcel&&"MOUNTED"===t.parcel.getStatus())return t.parcel.unmount()})),this.createdDomElement&&this.createdDomElement.parentNode.removeChild(this.createdDomElement),this.unmounted=!0}},{key:"render",value:function(){var t=this;if(this.props.appendTo)return Ee&&Ee.Consumer?Tt.createElement(Ee.Consumer,null,(function(e){return t.mountParcel=e?e.mountParcel:null,null})):null;var e=Ee&&Ee.Consumer?Tt.createElement(Ee.Consumer,null,(function(e){return t.mountParcel=e?e.mountParcel:null,null})):void 0;return Tt.createElement(this.props.wrapWith,{ref:this.handleRef,style:this.props.wrapStyle,className:this.props.wrapClassName},e)}}])&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(n.prototype,t),n}();bt(je,"defaultProps",{wrapWith:"div",wrapStyle:{},parcelDidMount:function(){}}),(0,Se.createGlobalStore)("left-nav",{slotName:null,basePath:window.spaBase}),w(688),w(353);w(921);var ke=function(){},Ae=void 0,_e=Object,Te=function(t){return t===Ae},Ce=function(t){return"function"==typeof t},Ie=function(t,e){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){a(t,e,n[e])}))}return t}({},t,e)},Me=new WeakMap,De=0,Ne=function(t){var e,n,r=void 0===t?"undefined":l(t),o=t&&t.constructor,i=o==Date;if(_e(t)!==t||i||o==RegExp)e=i?t.toJSON():"symbol"==r?t.toString():"string"==r?JSON.stringify(t):""+t;else{if(e=Me.get(t))return e;if(e=++De+"~",Me.set(t,e),o==Array){for(e="@",n=0;n<t.length;n++)e+=Ne(t[n])+",";Me.set(t,e)}if(o==_e){e="#";for(var a=_e.keys(t).sort();!Te(n=a.pop());)Te(t[n])||(e+=n+":"+Ne(t[n])+",");Me.set(t,e)}}return e},Re=new WeakMap,Le={},Ue={},Be="undefined",Fe=("undefined"==typeof window?"undefined":l(window))!=Be,Ve=("undefined"==typeof document?"undefined":l(document))!=Be,ze=function(t,e){var n=Re.get(t);return[function(){return!Te(e)&&t.get(e)||Le},function(r){if(!Te(e)){var o=t.get(e);e in Ue||(Ue[e]=o),n[5](e,Ie(o,r),o||Le)}},n[6],function(){return!Te(e)&&e in Ue?Ue[e]:!Te(e)&&t.get(e)||Le}]},He=!0,We=s(Fe&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[ke,ke],2),Ge=We[0],Ke=We[1],$e={isOnline:function(){return He},isVisible:function(){var t=Ve&&document.visibilityState;return Te(t)||"hidden"!==t}},qe={initFocus:function(t){return Ve&&document.addEventListener("visibilitychange",t),Ge("focus",t),function(){Ve&&document.removeEventListener("visibilitychange",t),Ke("focus",t)}},initReconnect:function(t){var e=function(){He=!0,t()},n=function(){He=!1};return Ge("online",e),Ge("offline",n),function(){Ke("online",e),Ke("offline",n)}}},Je=(Tt.default.useId,!Fe||"Deno"in window),Ye=Je?Tt.useEffect:Tt.useLayoutEffect,Qe="undefined"!=typeof navigator&&navigator.connection,Xe=!Je&&Qe&&(["slow-2g","2g"].includes(Qe.effectiveType)||Qe.saveData),Ze=function(t){if(Ce(t))try{t=t()}catch(e){t=""}var e=t;return[t="string"==typeof t?t:(Array.isArray(t)?t.length:t)?Ne(t):"",e]},tn=0,en=function(){return++tn};function nn(){return nn=i((function(){var t,e,n,r,o,a,u,c,l,f,h,d,v,y,g,m,b,w,O,S,E,x,P,j=arguments;function k(t){return A.apply(this,arguments)}function A(){return A=i((function(t){var n,r,i,a,c,l,g,m,b,w,O,S,E,x,P,j,k,A,_,T;return p(this,(function(p){switch(p.label){case 0:if(n=s(Ze(t),1),!(r=n[0]))return[2];if(i=s(ze(o,r),2),a=i[0],c=i[1],l=s(Re.get(o),4),g=l[0],m=l[1],b=l[2],w=l[3],O=function(){var t=g[r];return v&&(delete b[r],delete w[r],t&&t[0])?t[0](2).then((function(){return a().data})):a().data},e.length<3)return[2,O()];if(E=u,x=en(),m[r]=[x,0],P=!Te(d),j=a(),k=j.data,A=j._c,_=Te(A)?k:A,P&&(d=Ce(d)?d(_,k):d,c({data:d,_c:_})),Ce(E))try{E=E(_)}catch(t){S=t}return E&&function(t){return Ce(t.then)}(E)?[4,E.catch((function(t){S=t}))]:[3,2];case 1:if(E=p.sent(),x!==m[r][0]){if(S)throw S;return[2,E]}S&&P&&function(t){return"function"==typeof h?h(t):!1!==h}(S)&&(f=!0,c({data:_,_c:Ae})),p.label=2;case 2:if(f&&!S&&(Ce(f)?(T=f(E,_),c({data:T,error:Ae,_c:Ae})):c({data:E,error:Ae,_c:Ae})),m[r][1]=en(),Promise.resolve(O()).then((function(){c({_c:Ae})})),!S)return[2,E];if(y)throw S;return[2]}}))})),A.apply(this,arguments)}return p(this,(function(i){for(t=j.length,e=new Array(t),n=0;n<t;n++)e[n]=j[n];if(r=s(e,4),o=r[0],a=r[1],u=r[2],c=r[3],l=Ie({populateCache:!0,throwOnError:!0},"boolean"==typeof c?{revalidate:c}:c||{}),f=l.populateCache,h=l.rollbackOnError,d=l.optimisticData,v=!1!==l.revalidate,y=l.throwOnError,Ce(a)){g=a,m=[],b=o.keys(),w=!0,O=!1,S=void 0;try{for(E=b[Symbol.iterator]();!(w=(x=E.next()).done);w=!0)P=x.value,!/^\$(inf|sub)\$/.test(P)&&g(o.get(P)._k)&&m.push(P)}catch(t){O=!0,S=t}finally{try{w||null==E.return||E.return()}finally{if(O)throw S}}return[2,Promise.all(m.map(k))]}return[2,k(a)]}))})),nn.apply(this,arguments)}var rn=function(t,e){for(var n in t)t[n][0]&&t[n][0](e)},on=function(t,e){if(!Re.has(t)){var n=Ie(qe,e),r={},o=Ot.bind(Ae,t),i=ke,a={},u=function(t,e){var n=a[t]||[];return a[t]=n,n.push(e),function(){return n.splice(n.indexOf(e),1)}},s=function(e,n,r){t.set(e,n);var o=a[e],i=!0,u=!1,s=void 0;if(o)try{for(var c,l=o[Symbol.iterator]();!(i=(c=l.next()).done);i=!0)(0,c.value)(n,r)}catch(t){u=!0,s=t}finally{try{i||null==l.return||l.return()}finally{if(u)throw s}}},c=function(){if(!Re.has(t)&&(Re.set(t,[r,{},{},{},o,s,u]),!Je)){var e=n.initFocus(setTimeout.bind(Ae,rn.bind(Ae,r,0))),a=n.initReconnect(setTimeout.bind(Ae,rn.bind(Ae,r,1)));i=function(){e&&e(),a&&a(),Re.delete(t)}}};return c(),[t,o,c,i]}return[t,Re.get(t)[4]]},an=s(on(new Map),2),un=an[0],sn=an[1],cn=Ie({onLoadingSlow:ke,onSuccess:ke,onError:ke,onErrorRetry:function(t,e,n,r,o){var i=n.errorRetryCount,a=o.retryCount,u=~~((Math.random()+.5)*(1<<(a<8?a:8)))*n.errorRetryInterval;!Te(i)&&a>i||setTimeout(r,u,o)},onDiscarded:ke,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Xe?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:Xe?5e3:3e3,compare:function(t,e){return Ne(t)==Ne(e)},isPaused:function(){return!1},cache:un,mutate:sn,fallback:{}},$e),ln=(0,Tt.createContext)({}),fn=Fe&&window.__SWR_DEVTOOLS_USE__;(fn?window.__SWR_DEVTOOLS_USE__:[]).concat((function(t){return function(e,n,r){return t(e,n&&function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var i=s(Ze(e),1)[0],a=s(Re.get(un),4)[3];if(i.startsWith("$inf$"))return n.apply(void 0,c(r));var u=a[i];return Te(u)?n.apply(void 0,c(r)):(delete a[i],u)},r)}})),fn&&(window.__SWR_DEVTOOLS_REACT__=Tt.default);var pn;Tt.default.use;_e.defineProperty((function(t){var e=t.value,n=(0,Tt.useContext)(ln),r=Ce(e),o=(0,Tt.useMemo)((function(){return r?e(n):e}),[r,n,e]),i=(0,Tt.useMemo)((function(){return r?o:function(t,e){var n=Ie(t,e);if(e){var r=t.use,o=t.fallback,i=e.use,a=e.fallback;r&&i&&(n.use=r.concat(i)),o&&a&&(n.fallback=Ie(o,a))}return n}(n,o)}),[r,n,o]),a=o&&o.provider,u=(0,Tt.useRef)(Ae);a&&!u.current&&(u.current=on(a(i.cache||un),o));var s=u.current;return s&&(i.cache=s[0],i.mutate=s[1]),Ye((function(){if(s)return s[2]&&s[2](),s[3]}),[]),(0,Tt.createElement)(ln.Provider,Ie(t,{value:i}))}),"defaultValue",{value:cn}),w(641),(0,St.defineConfigSchema)("@openmrs/esm-styleguide",_t),pn=function(t,e){document.documentElement.style.setProperty(t,e)},(0,St.getConfigStore)("@openmrs/esm-styleguide").subscribe((function(t){t.loaded&&t.config&&(pn("--brand-01",t.config["Brand color #1"]),pn("--brand-02",t.config["Brand color #2"]),pn("--brand-03",t.config["Brand color #3"]))})),t("omrs-logo-full-color",Et),t("omrs-logo-full-mono",Et),t("omrs-logo-full-grey",Et),t("omrs-logo-partial-color",xt),t("omrs-logo-partial-mono",xt),t("omrs-logo-partial-grey",xt),t("omrs-logo-icon-color",Pt),t("omrs-logo-icon-mono",Pt),t("omrs-logo-icon-grey",Pt),t("omrs-logo-white",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 380 119"><path fill="var(--logo-white)" fill-rule="evenodd" d="M40.29 40.328a27.76 27.76 0 0 1 19.688-8.154c7.669 0 14.613 3.102 19.647 8.116l.02-18.54A42.84 42.84 0 0 0 59.978 17c-7.089 0-13.813 1.93-19.709 4.968zM79.645 79.671a27.74 27.74 0 0 1-19.684 8.154c-7.67 0-14.614-3.101-19.651-8.116l-.02 18.54A42.86 42.86 0 0 0 59.96 103a42.8 42.8 0 0 0 19.672-4.751z" clip-rule="evenodd"/><path fill="var(--logo-grey)" fill-rule="evenodd" d="M40.328 79.696c-5.038-5.037-8.154-11.995-8.154-19.685 0-7.669 3.102-14.612 8.116-19.65l-18.54-.02A42.85 42.85 0 0 0 17 60.012a42.8 42.8 0 0 0 4.752 19.672zM79.634 40.289a27.75 27.75 0 0 1 8.154 19.688 27.74 27.74 0 0 1-8.117 19.646l18.542.02a42.84 42.84 0 0 0 4.749-19.666c0-7.09-1.714-13.779-4.751-19.675z" clip-rule="evenodd"/><path fill="var(--logo-white)" fill-rule="evenodd" d="M156.184 60.003c0-8.749-6.118-15.777-15.025-15.777-8.909 0-15.025 7.028-15.025 15.776s6.116 15.78 15.025 15.78c8.907 0 15.025-7.031 15.025-15.78m-34.881 0c0-11.483 8.318-19.96 19.856-19.96 11.536 0 19.855 8.478 19.855 19.96 0 11.484-8.319 19.964-19.855 19.964-11.538 0-19.856-8.48-19.856-19.964M179.514 75.54c5.507 0 9.05-4.14 9.05-9.482s-3.543-9.483-9.05-9.483c-5.505 0-9.046 4.142-9.046 9.483s3.541 9.482 9.046 9.482M166.22 53.306h4.248v3.704h.11c2.344-2.725 5.449-4.36 9.154-4.36 8.014 0 13.408 5.67 13.408 13.408 0 7.63-5.613 13.406-12.752 13.406-4.58 0-8.231-2.29-9.81-5.178h-.11V90.87h-4.248zM217.773 63.768c-.163-4.305-3-7.193-7.686-7.193-4.685 0-7.79 2.888-8.335 7.193zm3.653 10.412c-3.001 3.868-6.596 5.284-11.339 5.284-8.01 0-12.914-5.993-12.914-13.406 0-7.901 5.559-13.407 13.08-13.407 7.196 0 12.096 4.906 12.096 13.354v1.362h-20.597c.325 4.413 3.704 8.173 8.335 8.173 3.65 0 6.105-1.307 8.12-3.868zM227.854 59.357c0-2.347-.216-4.361-.216-6.05h4.031c0 1.362.11 2.776.11 4.194h.11c1.144-2.505 4.306-4.85 8.5-4.85 6.705 0 9.699 4.252 9.699 10.41v15.748h-4.248v-15.31c0-4.253-1.856-6.924-5.833-6.924-5.503 0-7.903 3.979-7.903 9.811V78.81h-4.25zM259.211 41.009h6.708L278.8 70.79h.107l12.982-29.782h6.549v37.99h-4.506V47.124h-.106L280.192 79h-2.738l-13.629-31.875h-.107V79h-4.507zM312.392 57.752h4.023c4.992 0 11.487 0 11.487-6.282 0-5.47-4.776-6.276-9.177-6.276h-6.333zm-4.506-16.744h9.711c7.352 0 15.132 1.072 15.132 10.462 0 5.527-3.594 9.125-9.495 10.037L334.018 79h-5.525l-10.304-17.063h-5.797V79h-4.506zM358.123 47.713c-1.506-2.414-4.187-3.487-6.926-3.487-3.973 0-8.1 1.88-8.1 6.385 0 3.49 1.931 5.047 7.994 6.98 5.903 1.878 11.377 3.809 11.377 11.267 0 7.567-6.495 11.11-13.36 11.11-4.402 0-9.125-1.45-11.7-5.262l3.862-3.165c1.61 2.794 4.83 4.24 8.105 4.24 3.862 0 8.263-2.253 8.263-6.601 0-4.669-3.165-5.474-9.928-7.728-5.366-1.771-9.442-4.134-9.442-10.463 0-7.298 6.277-10.945 12.929-10.945 4.241 0 7.836 1.178 10.625 4.45z" clip-rule="evenodd"/></svg>'),t("omrs-icon-activity",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M6 14.5a.5.5 0 0 1-.46-.31L3.165 8.5H1v-1h2.5a.5.5 0 0 1 .46.31L6 12.64l4.03-10.815a.5.5 0 0 1 .47-.325.5.5 0 0 1 .465.34L12.86 7.5H15v1h-2.5a.5.5 0 0 1-.475-.34L10.5 3.5 6.47 14.175A.5.5 0 0 1 6 14.5"/></svg>'),t("omrs-icon-add",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8.5 7.5V4h-1v3.5H4v1h3.5V12h1V8.5H12v-1z"/></svg>'),t("omrs-icon-arrow-down",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M12.295 8.295 8.5 12.085V2h-1v10.085l-3.795-3.79L3 9l5 5 5-5z"/></svg>'),t("omrs-icon-arrow-left",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m7 13 .705-.705L3.915 8.5H14v-1H3.915l3.79-3.795L7 3 2 8z"/></svg>'),t("omrs-icon-arrow-right",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m9 3-.715.696 3.79 3.804H2v1h10.075l-3.79 3.787L9 13l5-5z"/></svg>'),t("omrs-icon-arrow-up",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8 2 3 7l.705.705L7.5 3.915V14h1V3.915l3.795 3.79L13 7z"/></svg>'),t("omrs-icon-calendar-heat-map",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M13 2h-2V1h-1v1H6V1H5v1H3a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1M3 3h2v1h1V3h4v1h1V3h2v2H3zm0 3h2.5v3H3zm6.5 7h-3v-3h3zm0-4h-3V6h3zm1 4v-3H13v3z"/></svg>'),t("omrs-icon-calendar",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M13 2h-2V1h-1v1H6V1H5v1H3c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h10c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1m0 11H3V6h10zm0-8H3V3h2v1h1V3h4v1h1V3h2z"/></svg>'),t("omrs-icon-caret-down",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m12 6-4 5-4-5z"/></svg>'),t("omrs-icon-caret-left",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M10 12 5 8l5-4z"/></svg>'),t("omrs-icon-caret-right",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m6 4 5 4-5 4z"/></svg>'),t("omrs-icon-caret-up",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m4 10 4-5 4 5z"/></svg>'),t("omrs-icon-chart-average",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M11.5 12c-1.8 0-2.515-2.088-3.206-4.107C7.638 5.979 6.96 4 5.5 4a1.72 1.72 0 0 0-1.527 1.16l-.947-.318C3.05 4.767 3.66 3 5.5 3c2.175 0 3.006 2.427 3.74 4.569C9.844 9.333 10.415 11 11.5 11a1.72 1.72 0 0 0 1.527-1.16l.947.318C13.95 10.233 13.34 12 11.5 12"/><path d="M2 14V8.5h1v-1H2V1H1v13a1 1 0 0 0 1 1h13v-1z"/><path d="M5 7.5H4v1h1zM7 7.5H6v1h1zM11 7.5h-1v1h1zM13 7.5h-1v1h1zM15 7.5h-1v1h1z"/></svg>'),t("omrs-icon-chemistry",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M13.616 11.81 10 6.836V2h1V1H5v1h1v4.837L2.384 11.81A2.009 2.009 0 0 0 4.01 15h7.982a2.01 2.01 0 0 0 1.625-3.19M7 7.162V2h2v5.163L10.336 9H5.664zM11.99 14H4.01a1.01 1.01 0 0 1-.817-1.603L4.936 10h6.128l1.743 2.397A1.011 1.011 0 0 1 11.991 14"/></svg>'),t("omrs-icon-chevron-down",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8 11 3 6l.7-.7L8 9.6l4.3-4.3.7.7z"/></svg>'),t("omrs-icon-chevron-left",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m5 8 5-5 .7.7L6.4 8l4.3 4.3-.7.7z"/></svg>'),t("omrs-icon-chevron-right",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m11 8-5 5-.7-.7L9.6 8 5.3 3.7 6 3z"/></svg>'),t("omrs-icon-chevron-up",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m8 5 5 5-.7.7L8 6.4l-4.3 4.3L3 10z"/></svg>'),t("omrs-icon-close",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m12 4.7-.7-.7L8 7.3 4.7 4l-.7.7L7.3 8 4 11.3l.7.7L8 8.7l3.3 3.3.7-.7L8.7 8z"/></svg>'),t("omrs-icon-close-filled",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8 1C4.1 1 1 4.1 1 8s3.1 7 7 7 7-3.1 7-7-3.1-7-7-7m2.7 10.5L8 8.8l-2.7 2.7-.8-.8L7.2 8 4.5 5.3l.8-.8L8 7.2l2.7-2.7.8.8L8.8 8l2.7 2.7z"/></svg>'),t("omrs-icon-close-outline",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8 1C4.1 1 1 4.1 1 8s3.1 7 7 7 7-3.1 7-7-3.1-7-7-7m0 13c-3.3 0-6-2.7-6-6s2.7-6 6-6 6 2.7 6 6-2.7 6-6 6"/><path d="M10.7 11.5 8 8.8l-2.7 2.7-.8-.8L7.2 8 4.5 5.3l.8-.8L8 7.2l2.7-2.7.8.8L8.8 8l2.7 2.7z"/></svg>'),t("omrs-icon-document",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m12.85 4.65-3.5-3.5C9.25 1.05 9.15 1 9 1H4c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h8c.55 0 1-.45 1-1V5c0-.15-.05-.25-.15-.35M9 2.2 11.8 5H9zM12 14H4V2h4v3c0 .55.45 1 1 1h3z"/><path d="M11 11H5v1h6zM11 8H5v1h6z"/></svg>'),t("omrs-icon-document-attachment",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M13 15H5.5a1 1 0 0 1-1-1v-3h1v3H13V3H8.5V2H13a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1"/><path d="M12 5H8.5v1H12zM12 7.5H8v1h4zM12 10H7.5v1H12zM4.5 9.5A2.503 2.503 0 0 1 2 7V1.5h1V7a1.5 1.5 0 0 0 3 0V2.5a.5.5 0 1 0-1 0v5H4v-5a1.5 1.5 0 0 1 3 0V7a2.503 2.503 0 0 1-2.5 2.5"/></svg>'),t("omrs-icon-download",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M13 12v2H3v-2H2v2a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1v-2zM13 7l-.705-.705-3.795 3.79V1h-1v9.085l-3.795-3.79L3 7l5 5z"/></svg>'),t("omrs-icon-edit",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M15 13H1v1h14zM12.7 4.5c.4-.4.4-1 0-1.4l-1.8-1.8c-.4-.4-1-.4-1.4 0L2 8.8V12h3.2zM10.2 2 12 3.8l-1.5 1.5-1.8-1.8zM3 11V9.2l5-5L9.8 6l-5 5z"/></svg>'),t("omrs-icon-event-schedule",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M10.5 15a4 4 0 1 1 0-8 4 4 0 0 1 0 8m0-7a3 3 0 1 0 0 6 3 3 0 0 0 0-6"/><path d="M11.295 12.5 10 11.205V9h1v1.795l1 1z"/><path d="M14 3a1 1 0 0 0-1-1h-2V1h-1v1H6V1H5v1H3a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h2v-1H3V3h2v1h1V3h4v1h1V3h2v3h1z"/></svg>'),t("omrs-icon-events",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M13 7h-1v1h1a1.5 1.5 0 0 1 1.5 1.5v2h1v-2A2.503 2.503 0 0 0 13 7M12 2a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m0-1a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M11.5 15h-1v-1A1.5 1.5 0 0 0 9 12.5H7A1.5 1.5 0 0 0 5.5 14v1h-1v-1A2.503 2.503 0 0 1 7 11.5h2a2.503 2.503 0 0 1 2.5 2.5zM8 6.5a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m0-1a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M4 7H3A2.503 2.503 0 0 0 .5 9.5v2h1v-2A1.5 1.5 0 0 1 3 8h1zM4 2a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m0-1a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5"/></svg>'),t("omrs-icon-group",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M15.5 15h-1v-1.5A1.5 1.5 0 0 0 13 12h-2a1.5 1.5 0 0 0-1.5 1.5V15h-1v-1.5A2.5 2.5 0 0 1 11 11h2a2.5 2.5 0 0 1 2.5 2.5zM12 6a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m0-1a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M7.5 11h-1V9.5A1.5 1.5 0 0 0 5 8H3a1.5 1.5 0 0 0-1.5 1.5V11h-1V9.5A2.5 2.5 0 0 1 3 7h2a2.5 2.5 0 0 1 2.5 2.5zM4 2a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m0-1a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5"/></svg>'),t("omrs-icon-group-access",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M4 9.5H3v-1A1.5 1.5 0 0 1 4.5 7H7v1H4.5a.5.5 0 0 0-.5.5zM6 6.5a2 2 0 1 1 0-4 2 2 0 0 1 0 4m0-3a1 1 0 1 0 0 2 1 1 0 0 0 0-2M10 10a2 2 0 1 1 0-4 2 2 0 0 1 0 4m0-3a1 1 0 1 0 0 2 1 1 0 0 0 0-2M13 13h-1v-1a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5v1H7v-1a1.5 1.5 0 0 1 1.5-1.5h3A1.5 1.5 0 0 1 13 12z"/><path d="M4 15H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h2v1H2v12h2zM14 15h-2v-1h2V2h-2V1h2a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1"/></svg>'),t("omrs-icon-hospital-bed",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M12.5 8h-4a1 1 0 0 0-1 1v3H2V7H1v8h1v-2h12v2h1v-4.5A2.503 2.503 0 0 0 12.5 8m1.5 4H8.5V9h4a1.5 1.5 0 0 1 1.5 1.5z"/><path d="M4.75 8.5a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5m0-1a1.75 1.75 0 1 0 0 3.5 1.75 1.75 0 0 0 0-3.5M10.5 3h-2V1h-1v2h-2v1h2v2h1V4h2z"/></svg>'),t("omrs-icon-image-medical",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M13 3v10H3V3zm0-1H3a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1"/><path d="M11 8V7H8.5V6H10V5H8.5V4h-1v1H6v1h1.5v1H5v1h2.5v1H5v1h2.5v1H6v1h4v-1H8.5v-1H11V9H8.5V8z"/></svg>'),t("omrs-icon-inventory-management",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M11.5 12h-2v2h2zM15 12h-2v2h2zM11.5 8.5h-2v2h2zM15 8.5h-2v2h2z"/><path d="M8.5 12H2V5h12v2.5h1V5a1 1 0 0 0-1-1h-3V2a1 1 0 0 0-1-1H6a1 1 0 0 0-1 1v2H2a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h6.5zM6 2h4v2H6z"/></svg>'),t("omrs-icon-list-checked",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M15 4H8v1h7zM3 5.295 1.705 4 1 4.705l2 2 4-4L6.295 2zM15 11H8v1h7zM3 12.295 1.705 11 1 11.705l2 2 4-4L6.295 9z"/></svg>'),t("omrs-icon-location",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8 9a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5m0-4a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3"/><path d="m8 15-4.218-4.974-.174-.226A5.44 5.44 0 0 1 2.5 6.5a5.5 5.5 0 1 1 11 0 5.44 5.44 0 0 1-1.107 3.299h-.001s-.15.198-.172.225zM4.406 9.198s.117.154.144.187L8 13.454l3.455-4.075.14-.183A4.45 4.45 0 0 0 12.5 6.5a4.5 4.5 0 1 0-9 0 4.45 4.45 0 0 0 .906 2.698"/></svg>'),t("omrs-icon-maximize",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M10 1v1h3.293L9 6.291 9.707 7 14 2.707V6h1V1zM7 9.708 6.296 9 2 13.293V10H1v5h5v-1H2.707z"/></svg>'),t("omrs-icon-medication",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M12 1H4a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1v9a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V5a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1M5 7h1.5v5H5zm6 7H5v-1h2.5V6H5V5h6zM4 4V2h8v2z"/></svg>'),t("omrs-icon-message-queue",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M14 14H2a1 1 0 0 1-1-1v-2.5h1V13h12v-2.5h1V13a1 1 0 0 1-1 1"/><path d="M12.5 10.5h-9v1h9zM12.5 8h-9v1h9zM12.5 5.5h-9v1h9zM12.5 3h-9v1h9z"/></svg>'),t("omrs-icon-microscope",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M12.697 12a3.94 3.94 0 0 0-.835-4.284 1.96 1.96 0 0 0-.542-2.207l1.388-1.388a1 1 0 0 0 0-1.415l-1.415-1.414a1 1 0 0 0-1.414 0L3.293 7.88a1 1 0 0 0 0 1.414l1.414 1.414a1 1 0 0 0 1.414 0L8.51 8.319a1.966 1.966 0 0 0 2.757.217A2.97 2.97 0 0 1 11.589 12H8v2H2v1h12v-3zm-7.283-2L4 8.586l.94-.94L6.353 9.06zM8 7q0 .19.038.376l-.977.977L5.646 6.94 10.586 2l1.415 1.414-1.625 1.625A1.99 1.99 0 0 0 8 7m2 1a1 1 0 1 1 0-2 1 1 0 0 1 0 2m3 6H9v-1h4z"/></svg>'),t("omrs-icon-money",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M15 11H1v1h14zM15 13H1v1h14zM12 5a1 1 0 1 0 0 2 1 1 0 0 0 0-2M8 8a2 2 0 1 1 0-4 2 2 0 0 1 0 4m0-3a1 1 0 1 0 0 2 1 1 0 0 0 0-2M4 5a1 1 0 1 0 0 2 1 1 0 0 0 0-2"/><path d="M14 10H2a1.003 1.003 0 0 1-1-1V3a1.003 1.003 0 0 1 1-1h12a1.003 1.003 0 0 1 1 1v6a1 1 0 0 1-1 1m0-7H2v6h12z"/></svg>'),t("omrs-icon-movement",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m12 10-.705.705 1.79 1.795H5a2 2 0 1 1 0-4h6a3 3 0 0 0 0-6H2.915L4.705.705 4 0 1 3l3 3 .705-.705L2.915 3.5H11a2 2 0 0 1 0 4H5a3 3 0 1 0 0 6h8.085l-1.79 1.795L12 16l3-3z"/></svg>'),t("omrs-icon-overflow-menu--horizontal",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M4 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2M8 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2M12 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2"/></svg>'),t("omrs-icon-overflow-menu--vertical",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8 5a1 1 0 1 0 0-2 1 1 0 0 0 0 2M8 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2M8 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2"/></svg>'),t("omrs-icon-pedestrian-family",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M10 15H8.5a1 1 0 0 1-1-1v-2.5h1V14H10v-2.5h1v-2a.5.5 0 0 0-.5-.5H6.14l-1-3H2a.5.5 0 0 0-.5.5v3h1V14h2v-3.5h1V14a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-3.5a1 1 0 0 1-1-1v-3A1.5 1.5 0 0 1 2 5h3.14a1 1 0 0 1 .948.684L6.86 8h3.64A1.5 1.5 0 0 1 12 9.5v2a1 1 0 0 1-1 1V14a1 1 0 0 1-1 1M14 15h-1V9.5h1.5v-3A.5.5 0 0 0 14 6h-2V5h2a1.5 1.5 0 0 1 1.5 1.5v3a1 1 0 0 1-1 1H14zM3.5 4.5a2 2 0 1 1 0-4 2 2 0 0 1 0 4m0-3a1 1 0 1 0 0 2 1 1 0 0 0 0-2M12.5 4.5a2 2 0 1 1 0-4 2 2 0 0 1 0 4m0-3a1 1 0 1 0 0 2 1 1 0 0 0 0-2"/><path d="M9.25 7.5a1.75 1.75 0 1 1 0-3.5 1.75 1.75 0 0 1 0 3.5m0-2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5"/></svg>'),t("omrs-icon-pen",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M13.654 3.053 15 1.707 14.293 1l-1.346 1.346L12.4 1.8a.967.967 0 0 0-1.4 0l-9 9V14h3.2l9-9a.967.967 0 0 0 0-1.4zM4.8 13H3v-1.8l8.7-8.7 1.8 1.8zM8.293 2 4.5 5.793l.707.707L9 2.707z"/></svg>'),t("omrs-icon-printer",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M14 4.5h-1.5v-3h-9v3H2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h1.5v3h9v-3H14a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1m-9.5-2h7v2h-7zm7 11h-7v-5h7zm2.5-3h-1.5v-3h-9v3H2v-5h12z"/></svg>'),t("omrs-icon-renew",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M6 5H3.39A5.5 5.5 0 0 1 13.5 8h1A6.5 6.5 0 0 0 3 3.84V2H2v4h4zM10 11h2.61A5.5 5.5 0 0 1 2.5 8h-1A6.5 6.5 0 0 0 13 12.16V14h1v-4h-4z"/></svg>'),t("omrs-icon-password",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M10.5 1a4.5 4.5 0 0 0-4.306 5.806L1 12v3h3l5.194-5.194A4.5 4.5 0 1 0 10.5 1m0 8c-.344 0-.687-.051-1.016-.151l-.573-.174-2.015 2.014L6.207 10l-.707.707.69.69-.794.792-.689-.689-.707.707.69.69L3.585 14H2v-1.586L7.325 7.09l-.174-.573A3.5 3.5 0 1 1 10.5 9"/><path d="M11 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2"/></svg>'),t("omrs-icon-reset",'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none"><path fill="#161616" d="M9 14a6 6 0 1 0-6-6v3.1L1.2 9.3l-.7.7 3 3 3-3-.7-.7L4 11.1V8a5 5 0 1 1 5 5z"/></svg>'),t("omrs-icon-search",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m14.5 13.793-3.776-3.776a5.508 5.508 0 1 0-.707.707l3.776 3.776zM2 6.5a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0"/></svg>'),t("omrs-icon-save",'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none"><path fill="#161616" d="m13.855 4.645-2.5-2.5A.5.5 0 0 0 11 2H3a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V5a.5.5 0 0 0-.145-.355M6 3h4v2H6zm4 10H6V9h4zm1 0V9a1 1 0 0 0-1-1H6a1 1 0 0 0-1 1v4H3V3h2v2a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1V3.205l2 2V13z"/></svg>'),t("omrs-icon-shopping-cart",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M5 15a1 1 0 1 0 0-2 1 1 0 0 0 0 2M12 15a1 1 0 1 0 0-2 1 1 0 0 0 0 2M14 3.5H2.91L2.5 1.4A.5.5 0 0 0 2 1H0v1h1.59l1.91 9.6a.5.5 0 0 0 .5.4h9v-1H4.41L4 9h9a.5.5 0 0 0 .5-.39l1-4.5a.5.5 0 0 0-.5-.61M12.6 8H3.81l-.7-3.5h10.265z"/></svg>'),t("omrs-icon-shopping-cart--arrow-down",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M5 15a1 1 0 1 0 0-2 1 1 0 0 0 0 2M12 15a1 1 0 1 0 0-2 1 1 0 0 0 0 2M2.49 1.402A.5.5 0 0 0 2 1H0v1h1.59l1.92 9.598A.5.5 0 0 0 4 12h9v-1H4.41l-.4-2H13a.5.5 0 0 0 .488-.392L14.622 3.5h-1.024L12.6 8H3.81z"/><path d="M10.793 3.293 9 5.086V1H8v4.086L6.207 3.293 5.5 4l3 3 3-3z"/></svg>'),t("omrs-icon-sticky-note-add",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M11.5 1h-1v2h-2v1h2v2h1V4h2V3h-2z"/><path d="M7.5 2h-4a1.003 1.003 0 0 0-1 1v10a1.003 1.003 0 0 0 1 1h6a.45.45 0 0 0 .35-.15l3.5-3.5a.45.45 0 0 0 .15-.35V7h-1v2h-3a1.003 1.003 0 0 0-1 1v3h-5V3h4zm4.8 8-2.8 2.8V10z"/></svg>'),t("omrs-icon-switcher",At),t("omrs-icon-switcher",At),t("omrs-icon-table-of-contents",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M11 3H2v1h9zM11 6H2v1h9zM11 9H2v1h9zM11 12H2v1h9zM14 3h-1v1h1zM14 6h-1v1h1zM14 9h-1v1h1zM14 12h-1v1h1z"/></svg>'),t("omrs-icon-table",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M14.5 2.5a1 1 0 0 0-1-1h-11a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1zm-1 0v2h-11v-2zm0 11h-11v-2h11zm0-3h-11v-2h11zm0-3h-11v-2h11z"/></svg>'),t("omrs-icon-time",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14M8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2"/><path d="M10.295 11 7.5 8.205V3.5h1v4.29l2.5 2.505z"/></svg>'),t("omrs-icon-tools",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M6.05 1a4.9 4.9 0 0 0-2.7.8L6.55 5a1.05 1.05 0 0 1 .1 1.5 1.05 1.05 0 0 1-1.5-.1l-3.3-3.2A4.9 4.9 0 0 0 1 6.05a5.07 5.07 0 0 0 5.05 5.05c.438.002.874-.048 1.3-.15l3.35 3.35a2.51 2.51 0 1 0 3.55-3.55L10.9 7.4q.153-.641.15-1.3a5 5 0 0 0-5-5.1m4 5.05c0 .355-.051.709-.15 1.05l-.15.55.4.4 3.35 3.35a1.44 1.44 0 0 1 .45 1.05 1.36 1.36 0 0 1-.45 1.05 1.45 1.45 0 0 1-2.1 0l-3.35-3.35-.4-.4-.55.15c-.341.099-.695.15-1.05.15A4.14 4.14 0 0 1 3.2 8.9 3.82 3.82 0 0 1 2 6.05c0-.372.051-.742.15-1.1l2.2 2.2a2.07 2.07 0 0 0 2.95.1 2.07 2.07 0 0 0-.1-2.95L5 2.1c.323-.102.66-.153 1-.15A4.14 4.14 0 0 1 8.85 3.1a4.25 4.25 0 0 1 1.2 2.95"/></svg>'),t("omrs-icon-translate",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M13.925 14.5H15L12 7h-1.175l-3 7.5H8.9l.8-2h3.425zm-3.825-3 1.31-3.28 1.315 3.28zM9 3.5v-1H5.5V1h-1v1.5H1v1h5.37a7.36 7.36 0 0 1-1.595 3.09A6.8 6.8 0 0 1 3.63 4.5H2.58a8.2 8.2 0 0 0 1.5 2.79A8.4 8.4 0 0 1 1.5 9l.375.93A9.2 9.2 0 0 0 4.765 8a8.5 8.5 0 0 0 2.88 1.92L8 9a7.2 7.2 0 0 1-2.56-1.685A8.8 8.8 0 0 0 7.4 3.5z"/></svg>'),t("omrs-icon-trash-can",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M7 6H6v6h1zM10 6H9v6h1z"/><path d="M2 3v1h1v10a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4h1V3zm2 11V4h8v10zM10 1H6v1h4z"/></svg>'),t("omrs-icon-tree-view--alt",'<svg xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#a)"><path d="M11.5 4.502h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1h-3a1 1 0 0 0-1 1v.5h-5v-.5a1 1 0 0 0-1-1h-3a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-.5h2v10a1 1 0 0 0 1 1h2v.5a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1h-3a1 1 0 0 0-1 1v.5h-2v-4.5h2v.5a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1h-3a1 1 0 0 0-1 1v.5h-2v-4.5h2v.5a1 1 0 0 0 1 1m0-3h3v2h-3zm-7 2h-3v-2h3zm7 9h3v2h-3zm0-5.5h3v2h-3z"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg>'),t("omrs-icon-user-avatar",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8 4a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5m0 4a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"/><path d="M8 1a7 7 0 1 0 7 7 7.01 7.01 0 0 0-7-7M5 13.188V12.5A1.5 1.5 0 0 1 6.5 11h3a1.5 1.5 0 0 1 1.5 1.5v.688a5.95 5.95 0 0 1-6 0m6.996-.725A2.5 2.5 0 0 0 9.5 10h-3a2.5 2.5 0 0 0-2.496 2.463 6 6 0 1 1 7.992 0"/></svg>'),t("omrs-icon-user-follow",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M16 7h-2V5h-1v2h-2v1h2v2h1V8h2zM6 2a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5m0-1a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7M11 15h-1v-2.5A2.5 2.5 0 0 0 7.5 10h-3A2.5 2.5 0 0 0 2 12.5V15H1v-2.5A3.5 3.5 0 0 1 4.5 9h3a3.5 3.5 0 0 1 3.5 3.5z"/></svg>'),t("omrs-icon-user-xray",'<svg xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#a)"><path d="M15.5 1.5h-7A.5.5 0 0 0 8 2v6.5a.5.5 0 0 0 .5.5h7a.5.5 0 0 0 .5-.5V2a.5.5 0 0 0-.5-.5m-1.5 3h-1.5V6H14v1h-1.5v1h-1V7H10V6h1.5V4.5H10v-1h1.5v-1h1v1H14zM7.5 15h-1v-2A1.473 1.473 0 0 0 5 11.5H3A1.474 1.474 0 0 0 1.5 13v2h-1v-2A2.475 2.475 0 0 1 3 10.5h2A2.476 2.476 0 0 1 7.5 13zM4 5.5a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m0-1a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg>'),t("omrs-icon-user",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8 2a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5m0-1a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7M13 15h-1v-2.5A2.5 2.5 0 0 0 9.5 10h-3A2.5 2.5 0 0 0 4 12.5V15H3v-2.5A3.5 3.5 0 0 1 6.5 9h3a3.5 3.5 0 0 1 3.5 3.5z"/></svg>'),t("omrs-icon-view-off",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m2.62 11.255.715-.71A7 7 0 0 1 1.535 8C2.55 5.465 5.35 3.5 8 3.5a6.2 6.2 0 0 1 2 .36l.775-.78A7.4 7.4 0 0 0 8 2.5 8.35 8.35 0 0 0 .53 7.83a.5.5 0 0 0 0 .34 8 8 0 0 0 2.09 3.085"/><path d="M6 7.865a2 2 0 0 1 1.85-1.85l.905-.91A3 3 0 0 0 5.09 8.77zM15.47 7.83a8.2 8.2 0 0 0-2.87-3.72L15 1.705 14.295 1 1 14.295l.705.705 2.55-2.55A7.65 7.65 0 0 0 8 13.5a8.35 8.35 0 0 0 7.47-5.33.5.5 0 0 0 0-.34M10 8a2 2 0 0 1-3 1.72L9.72 7A2 2 0 0 1 10 8m-2 4.5a6.5 6.5 0 0 1-3-.79l1.27-1.27a3 3 0 0 0 4.175-4.175L11.88 4.83A7.27 7.27 0 0 1 14.465 8C13.45 10.535 10.65 12.5 8 12.5"/></svg>'),t("omrs-icon-view",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M15.47 7.83A8.34 8.34 0 0 0 8 2.5 8.35 8.35 0 0 0 .53 7.83a.5.5 0 0 0 0 .34A8.35 8.35 0 0 0 8 13.5a8.35 8.35 0 0 0 7.47-5.33.5.5 0 0 0 0-.34M8 12.5c-2.65 0-5.45-1.965-6.465-4.5C2.55 5.465 5.35 3.5 8 3.5s5.45 1.965 6.465 4.5C13.45 10.535 10.65 12.5 8 12.5"/><path d="M8 5a3 3 0 1 0 0 6 3 3 0 0 0 0-6m0 5a2 2 0 1 1 0-4 2 2 0 0 1 0 4"/></svg>'),t("omrs-icon-warning",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1m0 13A6 6 0 1 1 8 2a6 6 0 0 1 0 12"/><path d="M8.5 4h-1v5.5h1zM8 11a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5"/></svg>')}(),function(){"use strict";w.r(O)}(),O}())}}}))},8834:(t,e,n)=>{"use strict";function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,{V:()=>mt,t:()=>gt});var o,i,a=(o=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),o.forEach((function(e){r(t,e,n[e])}))}return t}({},{address1:"Address line 1",address2:"Address line 2",address3:"Address line 3",address4:"Address line 4",address5:"Address line 5",address6:"Address line 6",city:"City",cityVillage:"City",country:"Country",countyDistrict:"District",postalCode:"Postal code",state:"State",stateProvince:"State"},{closeAllOpenedWorkspaces:"Discard changes in {{count}} workspaces",closingAllWorkspacesPromptBody:"There are unsaved changes in the following workspaces. Do you want to discard changes in the following workspaces? {{workspaceNames}}",closingAllWorkspacesPromptTitle:"You have unsaved changes",discard:"Discard",hide:"Hide",maximize:"Maximize",minimize:"Minimize",openAnyway:"Open anyway",unsavedChangesInOpenedWorkspace:"You have unsaved changes in the opened workspace. Do you want to discard these changes?",unsavedChangesInWorkspace:"There are unsaved changes in {{workspaceName}}. Please save them before opening another workspace.",unsavedChangesTitleText:"Unsaved changes",workspaceHeader:"Workspace header"}),i=null!=(i={actions:"Actions",address:"Address",age:"Age",cancel:"Cancel",change:"Change",close:"Close",confirm:"Confirm",contactAdministratorIfIssuePersists:"Contact your system administrator if the problem persists.",contactDetails:"Contact details",error:"Error",errorCopy:"Sorry, there was a problem displaying this information. You can try to reload this page, or contact the site administrator and quote the error code above.",female:"Female",hideDetails:"Hide details",loading:"Loading",male:"Male",other:"Other",patientIdentifierSticker:"Patient identifier sticker",patientLists:"Patient lists",print:"Print",printError:"Print error",printErrorExplainer:"An error occurred in {{errorLocation}}",printIdentifierSticker:"Print identifier sticker",printing:"Printing",relationships:"Relationships",resetOverrides:"Reset overrides",scriptLoadingFailed:"Error: Script failed to load",scriptLoadingError:"Failed to load overridden script from {{url}}. Please check that the bundled script is available at the expected URL. Click the button below to reset all import map overrides.",seeMoreLists:"See {{count}} more lists",sex:"Sex",showDetails:"Show details",unknown:"Unknown"})?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):function(t){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e.push.apply(e,n)}return e}(Object(i)).forEach((function(t){Object.defineProperty(o,t,Object.getOwnPropertyDescriptor(i,t))})),o),u=n(7545),s=n(5152),c=n(414),l=n(2474),f=n(1087);function p(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&(0,f.A)(t,e)}function h(t,e){if(e&&("object"==(0,u.A)(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return(0,l.A)(t)}function d(t){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},d(t)}var v=n(4586),y=n(6488),g=n(2296),m=n(5405);function b(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function w(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?b(Object(n),!0).forEach((function(e){(0,v.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var O={type:"logger",log:function(t){this.output("log",t)},warn:function(t){this.output("warn",t)},error:function(t){this.output("error",t)},output:function(t,e){console&&console[t]&&console[t].apply(console,e)}},S=new(function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,s.A)(this,t),this.init(e,n)}return(0,c.A)(t,[{key:"init",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=e.prefix||"i18next:",this.logger=t||O,this.options=e,this.debug=e.debug}},{key:"setDebug",value:function(t){this.debug=t}},{key:"log",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.forward(e,"log","",!0)}},{key:"warn",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.forward(e,"warn","",!0)}},{key:"error",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.forward(e,"error","")}},{key:"deprecate",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(t,e,n,r){return r&&!this.debug?null:("string"==typeof t[0]&&(t[0]="".concat(n).concat(this.prefix," ").concat(t[0])),this.logger[e](t))}},{key:"create",value:function(e){return new t(this.logger,w(w({},{prefix:"".concat(this.prefix,":").concat(e,":")}),this.options))}},{key:"clone",value:function(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new t(this.logger,e)}}]),t}()),E=function(){function t(){(0,s.A)(this,t),this.observers={}}return(0,c.A)(t,[{key:"on",value:function(t,e){var n=this;return t.split(" ").forEach((function(t){n.observers[t]=n.observers[t]||[],n.observers[t].push(e)})),this}},{key:"off",value:function(t,e){this.observers[t]&&(e?this.observers[t]=this.observers[t].filter((function(t){return t!==e})):delete this.observers[t])}},{key:"emit",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];this.observers[t]&&[].concat(this.observers[t]).forEach((function(t){t.apply(void 0,n)})),this.observers["*"]&&[].concat(this.observers["*"]).forEach((function(e){e.apply(e,[t].concat(n))}))}}]),t}();function x(){var t,e,n=new Promise((function(n,r){t=n,e=r}));return n.resolve=t,n.reject=e,n}function P(t){return null==t?"":""+t}function j(t,e,n){function r(t){return t&&t.indexOf("###")>-1?t.replace(/###/g,"."):t}function o(){return!t||"string"==typeof t}for(var i="string"!=typeof e?[].concat(e):e.split(".");i.length>1;){if(o())return{};var a=r(i.shift());!t[a]&&n&&(t[a]=new n),t=Object.prototype.hasOwnProperty.call(t,a)?t[a]:{}}return o()?{}:{obj:t,k:r(i.shift())}}function k(t,e,n){var r=j(t,e,Object);r.obj[r.k]=n}function A(t,e){var n=j(t,e),r=n.obj,o=n.k;if(r)return r[o]}function _(t,e,n){var r=A(t,n);return void 0!==r?r:A(e,n)}function T(t,e,n){for(var r in e)"__proto__"!==r&&"constructor"!==r&&(r in t?"string"==typeof t[r]||t[r]instanceof String||"string"==typeof e[r]||e[r]instanceof String?n&&(t[r]=e[r]):T(t[r],e[r],n):t[r]=e[r]);return t}function C(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var I={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function M(t){return"string"==typeof t?t.replace(/[&<>"'\/]/g,(function(t){return I[t]})):t}var D="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,N=[" ",",","?","!",";"];function R(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function L(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?R(Object(n),!0).forEach((function(e){(0,v.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function U(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(t){if(t[e])return t[e];for(var r=e.split(n),o=t,i=0;i<r.length;++i){if(!o)return;if("string"==typeof o[r[i]]&&i+1<r.length)return;if(void 0===o[r[i]]){for(var a=2,u=r.slice(i,i+a).join(n),s=o[u];void 0===s&&r.length>i+a;)a++,s=o[u=r.slice(i,i+a).join(n)];if(void 0===s)return;if(null===s)return null;if(e.endsWith(u)){if("string"==typeof s)return s;if(u&&"string"==typeof s[u])return s[u]}var c=r.slice(i+a).join(n);return c?U(s,c,n):void 0}o=o[r[i]]}return o}}var B=function(t){p(o,t);var e,n,r=(e=o,n=function(){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(t){return!1}}(),function(){var t,r=d(e);if(n){var o=d(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return h(this,t)});function o(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return(0,s.A)(this,o),e=r.call(this),D&&E.call((0,l.A)(e)),e.data=t||{},e.options=n,void 0===e.options.keySeparator&&(e.options.keySeparator="."),void 0===e.options.ignoreJSONStructure&&(e.options.ignoreJSONStructure=!0),e}return(0,c.A)(o,[{key:"addNamespaces",value:function(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}},{key:"removeNamespaces",value:function(t){var e=this.options.ns.indexOf(t);e>-1&&this.options.ns.splice(e,1)}},{key:"getResource",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,a=[t,e];n&&"string"!=typeof n&&(a=a.concat(n)),n&&"string"==typeof n&&(a=a.concat(o?n.split(o):n)),t.indexOf(".")>-1&&(a=t.split("."));var u=A(this.data,a);return u||!i||"string"!=typeof n?u:U(this.data&&this.data[t]&&this.data[t][e],n,o)}},{key:"addResource",value:function(t,e,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=this.options.keySeparator;void 0===i&&(i=".");var a=[t,e];n&&(a=a.concat(i?n.split(i):n)),t.indexOf(".")>-1&&(r=e,e=(a=t.split("."))[1]),this.addNamespaces(e),k(this.data,a,r),o.silent||this.emit("added",t,e,n,r)}},{key:"addResources",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var o in n)"string"!=typeof n[o]&&"[object Array]"!==Object.prototype.toString.apply(n[o])||this.addResource(t,e,o,n[o],{silent:!0});r.silent||this.emit("added",t,e,n)}},{key:"addResourceBundle",value:function(t,e,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[t,e];t.indexOf(".")>-1&&(r=n,n=e,e=(a=t.split("."))[1]),this.addNamespaces(e);var u=A(this.data,a)||{};r?T(u,n,o):u=L(L({},u),n),k(this.data,a,u),i.silent||this.emit("added",t,e,n)}},{key:"removeResourceBundle",value:function(t,e){this.hasResourceBundle(t,e)&&delete this.data[t][e],this.removeNamespaces(e),this.emit("removed",t,e)}},{key:"hasResourceBundle",value:function(t,e){return void 0!==this.getResource(t,e)}},{key:"getResourceBundle",value:function(t,e){return e||(e=this.options.defaultNS),"v1"===this.options.compatibilityAPI?L(L({},{}),this.getResource(t,e)):this.getResource(t,e)}},{key:"getDataByLanguage",value:function(t){return this.data[t]}},{key:"hasLanguageSomeTranslations",value:function(t){var e=this.getDataByLanguage(t);return!!(e&&Object.keys(e)||[]).find((function(t){return e[t]&&Object.keys(e[t]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),o}(E),F={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,e,n,r,o){var i=this;return t.forEach((function(t){i.processors[t]&&(e=i.processors[t].process(e,n,r,o))})),e}};function V(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function z(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?V(Object(n),!0).forEach((function(e){(0,v.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var H={},W=function(t){p(o,t);var e,n,r=(e=o,n=function(){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(t){return!1}}(),function(){var t,r=d(e);if(n){var o=d(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return h(this,t)});function o(t){var e,n,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,s.A)(this,o),e=r.call(this),D&&E.call((0,l.A)(e)),n=t,i=(0,l.A)(e),["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach((function(t){n[t]&&(i[t]=n[t])})),e.options=a,void 0===e.options.keySeparator&&(e.options.keySeparator="."),e.logger=S.create("translator"),e}return(0,c.A)(o,[{key:"changeLanguage",value:function(t){t&&(this.language=t)}},{key:"exists",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==t)return!1;var n=this.resolve(t,e);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(t,e){var n=void 0!==e.nsSeparator?e.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator,o=e.ns||this.options.defaultNS||[],i=n&&t.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||e.keySeparator||this.options.userDefinedNsSeparator||e.nsSeparator||function(t,e,n){e=e||"",n=n||"";var r=N.filter((function(t){return e.indexOf(t)<0&&n.indexOf(t)<0}));if(0===r.length)return!0;var o=new RegExp("(".concat(r.map((function(t){return"?"===t?"\\?":t})).join("|"),")")),i=!o.test(t);if(!i){var a=t.indexOf(n);a>0&&!o.test(t.substring(0,a))&&(i=!0)}return i}(t,n,r));if(i&&!a){var u=t.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:t,namespaces:o};var s=t.split(n);(n!==r||n===r&&this.options.ns.indexOf(s[0])>-1)&&(o=s.shift()),t=s.join(r)}return"string"==typeof o&&(o=[o]),{key:t,namespaces:o}}},{key:"translate",value:function(t,e,n){var r=this;if("object"!==(0,u.A)(e)&&this.options.overloadTranslationOptionHandler&&(e=this.options.overloadTranslationOptionHandler(arguments)),e||(e={}),null==t)return"";Array.isArray(t)||(t=[String(t)]);var i=void 0!==e.returnDetails?e.returnDetails:this.options.returnDetails,a=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator,s=this.extractFromKey(t[t.length-1],e),c=s.key,l=s.namespaces,f=l[l.length-1],p=e.lng||this.language,h=e.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(p&&"cimode"===p.toLowerCase()){if(h){var d=e.nsSeparator||this.options.nsSeparator;return i?(v.res="".concat(f).concat(d).concat(c),v):"".concat(f).concat(d).concat(c)}return i?(v.res=c,v):c}var v=this.resolve(t,e),y=v&&v.res,g=v&&v.usedKey||c,m=v&&v.exactUsedKey||c,b=Object.prototype.toString.apply(y),w=void 0!==e.joinArrays?e.joinArrays:this.options.joinArrays,O=!this.i18nFormat||this.i18nFormat.handleAsObject;if(O&&y&&"string"!=typeof y&&"boolean"!=typeof y&&"number"!=typeof y&&["[object Number]","[object Function]","[object RegExp]"].indexOf(b)<0&&("string"!=typeof w||"[object Array]"!==b)){if(!e.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var S=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,y,z(z({},e),{},{ns:l})):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");return i?(v.res=S,v):S}if(a){var E="[object Array]"===b,x=E?[]:{},P=E?m:g;for(var j in y)if(Object.prototype.hasOwnProperty.call(y,j)){var k="".concat(P).concat(a).concat(j);x[j]=this.translate(k,z(z({},e),{joinArrays:!1,ns:l})),x[j]===k&&(x[j]=y[j])}y=x}}else if(O&&"string"==typeof w&&"[object Array]"===b)(y=y.join(w))&&(y=this.extendTranslation(y,t,e,n));else{var A=!1,_=!1,T=void 0!==e.count&&"string"!=typeof e.count,C=o.hasDefaultValue(e),I=T?this.pluralResolver.getSuffix(p,e.count,e):"",M=e["defaultValue".concat(I)]||e.defaultValue;!this.isValidLookup(y)&&C&&(A=!0,y=M),this.isValidLookup(y)||(_=!0,y=c);var D=(e.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&_?void 0:y,N=C&&M!==y&&this.options.updateMissing;if(_||A||N){if(this.logger.log(N?"updateKey":"missingKey",p,f,c,N?M:y),a){var R=this.resolve(c,z(z({},e),{},{keySeparator:!1}));R&&R.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var L=[],U=this.languageUtils.getFallbackCodes(this.options.fallbackLng,e.lng||this.language);if("fallback"===this.options.saveMissingTo&&U&&U[0])for(var B=0;B<U.length;B++)L.push(U[B]);else"all"===this.options.saveMissingTo?L=this.languageUtils.toResolveHierarchy(e.lng||this.language):L.push(e.lng||this.language);var F=function(t,n,o){var i=C&&o!==y?o:D;r.options.missingKeyHandler?r.options.missingKeyHandler(t,f,n,i,N,e):r.backendConnector&&r.backendConnector.saveMissing&&r.backendConnector.saveMissing(t,f,n,i,N,e),r.emit("missingKey",t,f,n,y)};this.options.saveMissing&&(this.options.saveMissingPlurals&&T?L.forEach((function(t){r.pluralResolver.getSuffixes(t,e).forEach((function(n){F([t],c+n,e["defaultValue".concat(n)]||M)}))})):F(L,c,M))}y=this.extendTranslation(y,t,e,v,n),_&&y===c&&this.options.appendNamespaceToMissingKey&&(y="".concat(f,":").concat(c)),(_||A)&&this.options.parseMissingKeyHandler&&(y="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(f,":").concat(c):c,A?y:void 0):this.options.parseMissingKeyHandler(y))}return i?(v.res=y,v):y}},{key:"extendTranslation",value:function(t,e,n,r,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,z(z({},this.options.interpolation.defaultVariables),n),r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(z(z({},n),{interpolation:z(z({},this.options.interpolation),n.interpolation)}));var a,u="string"==typeof t&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(u){var s=t.match(this.interpolator.nestingRegexp);a=s&&s.length}var c=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(c=z(z({},this.options.interpolation.defaultVariables),c)),t=this.interpolator.interpolate(t,c,n.lng||this.language,n),u){var l=t.match(this.interpolator.nestingRegexp);a<(l&&l.length)&&(n.nest=!1)}!1!==n.nest&&(t=this.interpolator.nest(t,(function(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];return o&&o[0]===r[0]&&!n.context?(i.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(e[0])),null):i.translate.apply(i,r.concat([e]))}),n)),n.interpolation&&this.interpolator.reset()}var f=n.postProcess||this.options.postProcess,p="string"==typeof f?[f]:f;return null!=t&&p&&p.length&&!1!==n.applyPostProcessor&&(t=F.handle(p,t,e,this.options&&this.options.postProcessPassResolved?z({i18nResolved:r},n):n,this)),t}},{key:"resolve",value:function(t){var e,n,r,o,i,a=this,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof t&&(t=[t]),t.forEach((function(t){if(!a.isValidLookup(e)){var s=a.extractFromKey(t,u),c=s.key;n=c;var l=s.namespaces;a.options.fallbackNS&&(l=l.concat(a.options.fallbackNS));var f=void 0!==u.count&&"string"!=typeof u.count,p=f&&!u.ordinal&&0===u.count&&a.pluralResolver.shouldUseIntlApi(),h=void 0!==u.context&&("string"==typeof u.context||"number"==typeof u.context)&&""!==u.context,d=u.lngs?u.lngs:a.languageUtils.toResolveHierarchy(u.lng||a.language,u.fallbackLng);l.forEach((function(t){a.isValidLookup(e)||(i=t,!H["".concat(d[0],"-").concat(t)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(i)&&(H["".concat(d[0],"-").concat(t)]=!0,a.logger.warn('key "'.concat(n,'" for languages "').concat(d.join(", "),'" won\'t get resolved as namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),d.forEach((function(n){if(!a.isValidLookup(e)){o=n;var i,s=[c];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(s,c,n,t,u);else{var l;f&&(l=a.pluralResolver.getSuffix(n,u.count,u));var d="".concat(a.options.pluralSeparator,"zero");if(f&&(s.push(c+l),p&&s.push(c+d)),h){var v="".concat(c).concat(a.options.contextSeparator).concat(u.context);s.push(v),f&&(s.push(v+l),p&&s.push(v+d))}}for(;i=s.pop();)a.isValidLookup(e)||(r=i,e=a.getResource(n,t,i,u))}})))}))}})),{res:e,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:i}}},{key:"isValidLookup",value:function(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)}},{key:"getResource",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,e,n,r):this.resourceStore.getResource(t,e,n,r)}}],[{key:"hasDefaultValue",value:function(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&"defaultValue"===e.substring(0,12)&&void 0!==t[e])return!0;return!1}}]),o}(E);function G(t){return t.charAt(0).toUpperCase()+t.slice(1)}var K=function(){function t(e){(0,s.A)(this,t),this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=S.create("languageUtils")}return(0,c.A)(t,[{key:"getScriptPartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return null;var e=t.split("-");return 2===e.length?null:(e.pop(),"x"===e[e.length-1].toLowerCase()?null:this.formatLanguageCode(e.join("-")))}},{key:"getLanguagePartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return t;var e=t.split("-");return this.formatLanguageCode(e[0])}},{key:"formatLanguageCode",value:function(t){if("string"==typeof t&&t.indexOf("-")>-1){var e=["hans","hant","latn","cyrl","cans","mong","arab"],n=t.split("-");return this.options.lowerCaseLng?n=n.map((function(t){return t.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),e.indexOf(n[1].toLowerCase())>-1&&(n[1]=G(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),e.indexOf(n[1].toLowerCase())>-1&&(n[1]=G(n[1].toLowerCase())),e.indexOf(n[2].toLowerCase())>-1&&(n[2]=G(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}},{key:"isSupportedCode",value:function(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}},{key:"getBestMatchFromCodes",value:function(t){var e,n=this;return t?(t.forEach((function(t){if(!e){var r=n.formatLanguageCode(t);n.options.supportedLngs&&!n.isSupportedCode(r)||(e=r)}})),!e&&this.options.supportedLngs&&t.forEach((function(t){if(!e){var r=n.getLanguagePartFromCode(t);if(n.isSupportedCode(r))return e=r;e=n.options.supportedLngs.find((function(t){if(0===t.indexOf(r))return t}))}})),e||(e=this.getFallbackCodes(this.options.fallbackLng)[0]),e):null}},{key:"getFallbackCodes",value:function(t,e){if(!t)return[];if("function"==typeof t&&(t=t(e)),"string"==typeof t&&(t=[t]),"[object Array]"===Object.prototype.toString.apply(t))return t;if(!e)return t.default||[];var n=t[e];return n||(n=t[this.getScriptPartFromCode(e)]),n||(n=t[this.formatLanguageCode(e)]),n||(n=t[this.getLanguagePartFromCode(e)]),n||(n=t.default),n||[]}},{key:"toResolveHierarchy",value:function(t,e){var n=this,r=this.getFallbackCodes(e||this.options.fallbackLng||[],t),o=[],i=function(t){t&&(n.isSupportedCode(t)?o.push(t):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(t)))};return"string"==typeof t&&t.indexOf("-")>-1?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(t))):"string"==typeof t&&i(this.formatLanguageCode(t)),r.forEach((function(t){o.indexOf(t)<0&&i(n.formatLanguageCode(t))})),o}}]),t}(),$=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],q={1:function(t){return Number(t>1)},2:function(t){return Number(1!=t)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(0==t?0:1==t?1:2==t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(1==t?0:t>=2&&t<=4?1:2)},7:function(t){return Number(1==t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(1==t?0:2==t?1:8!=t&&11!=t?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(1==t?0:2==t?1:t<7?2:t<11?3:4)},11:function(t){return Number(1==t||11==t?0:2==t||12==t?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(0!==t)},14:function(t){return Number(1==t?0:2==t?1:3==t?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:0!==t?1:2)},17:function(t){return Number(1==t||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(0==t?0:1==t?1:2)},19:function(t){return Number(1==t?0:0==t||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(1==t?0:0==t||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(1==t?0:2==t?1:(t<0||t>10)&&t%10==0?2:3)}},J=["v1","v2","v3"],Y={zero:0,one:1,two:2,few:3,many:4,other:5},Q=function(){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,s.A)(this,t),this.languageUtils=e,this.options=r,this.logger=S.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=(n={},$.forEach((function(t){t.lngs.forEach((function(e){n[e]={numbers:t.nr,plurals:q[t.fc]}}))})),n)}return(0,c.A)(t,[{key:"addRule",value:function(t,e){this.rules[t]=e}},{key:"getRule",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(t,{type:e.ordinal?"ordinal":"cardinal"})}catch(t){return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}},{key:"needsPlural",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(t,e);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(t,n).map((function(t){return"".concat(e).concat(t)}))}},{key:"getSuffixes",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((function(t,e){return Y[t]-Y[e]})).map((function(t){return"".concat(e.options.prepend).concat(t)})):r.numbers.map((function(r){return e.getSuffix(t,r,n)})):[]}},{key:"getSuffix",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(t,n);return r?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(r.select(e)):this.getSuffixRetroCompatible(r,e):(this.logger.warn("no plural rule found for: ".concat(t)),"")}},{key:"getSuffixRetroCompatible",value:function(t,e){var n=this,r=t.noAbs?t.plurals(e):t.plurals(Math.abs(e)),o=t.numbers[r];this.options.simplifyPluralSuffix&&2===t.numbers.length&&1===t.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var i=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):i():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===t.numbers.length&&1===t.numbers[0]?i():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}},{key:"shouldUseIntlApi",value:function(){return!J.includes(this.options.compatibilityJSON)}}]),t}();function X(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Z(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?X(Object(n),!0).forEach((function(e){(0,v.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var tt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,s.A)(this,t),this.logger=S.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||function(t){return t},this.init(e)}return(0,c.A)(t,[{key:"init",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});var e=t.interpolation;this.escape=void 0!==e.escape?e.escape:M,this.escapeValue=void 0===e.escapeValue||e.escapeValue,this.useRawValueToEscape=void 0!==e.useRawValueToEscape&&e.useRawValueToEscape,this.prefix=e.prefix?C(e.prefix):e.prefixEscaped||"{{",this.suffix=e.suffix?C(e.suffix):e.suffixEscaped||"}}",this.formatSeparator=e.formatSeparator?e.formatSeparator:e.formatSeparator||",",this.unescapePrefix=e.unescapeSuffix?"":e.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":e.unescapeSuffix||"",this.nestingPrefix=e.nestingPrefix?C(e.nestingPrefix):e.nestingPrefixEscaped||C("$t("),this.nestingSuffix=e.nestingSuffix?C(e.nestingSuffix):e.nestingSuffixEscaped||C(")"),this.nestingOptionsSeparator=e.nestingOptionsSeparator?e.nestingOptionsSeparator:e.nestingOptionsSeparator||",",this.maxReplaces=e.maxReplaces?e.maxReplaces:1e3,this.alwaysFormat=void 0!==e.alwaysFormat&&e.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var t="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(t,"g");var e="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(e,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(t,e,n,r){var o,i,a,u=this,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(t){return t.replace(/\$/g,"$$$$")}var l=function(t){if(t.indexOf(u.formatSeparator)<0){var o=_(e,s,t);return u.alwaysFormat?u.format(o,void 0,n,Z(Z(Z({},r),e),{},{interpolationkey:t})):o}var i=t.split(u.formatSeparator),a=i.shift().trim(),c=i.join(u.formatSeparator).trim();return u.format(_(e,s,a),c,n,Z(Z(Z({},r),e),{},{interpolationkey:a}))};this.resetRegExp();var f=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,p=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(t){return c(t)}},{regex:this.regexp,safeValue:function(t){return u.escapeValue?c(u.escape(t)):c(t)}}].forEach((function(e){for(a=0;o=e.regex.exec(t);){var n=o[1].trim();if(void 0===(i=l(n)))if("function"==typeof f){var s=f(t,o,r);i="string"==typeof s?s:""}else if(r&&r.hasOwnProperty(n))i="";else{if(p){i=o[0];continue}u.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(t)),i=""}else"string"==typeof i||u.useRawValueToEscape||(i=P(i));var c=e.safeValue(i);if(t=t.replace(o[0],c),p?(e.regex.lastIndex+=i.length,e.regex.lastIndex-=o[0].length):e.regex.lastIndex=0,++a>=u.maxReplaces)break}})),t}},{key:"nest",value:function(t,e){var n,r,o=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=Z({},i);function u(t,e){var n=this.nestingOptionsSeparator;if(t.indexOf(n)<0)return t;var r=t.split(new RegExp("".concat(n,"[ ]*{"))),o="{".concat(r[1]);t=r[0];var i=(o=this.interpolate(o,a)).match(/'/g),u=o.match(/"/g);(i&&i.length%2==0&&!u||u.length%2!=0)&&(o=o.replace(/'/g,'"'));try{a=JSON.parse(o),e&&(a=Z(Z({},e),a))}catch(e){return this.logger.warn("failed parsing options string in nesting for key ".concat(t),e),"".concat(t).concat(n).concat(o)}return delete a.defaultValue,t}for(a.applyPostProcessor=!1,delete a.defaultValue;n=this.nestingRegexp.exec(t);){var s=[],c=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var l=n[1].split(this.formatSeparator).map((function(t){return t.trim()}));n[1]=l.shift(),s=l,c=!0}if((r=e(u.call(this,n[1].trim(),a),a))&&n[0]===t&&"string"!=typeof r)return r;"string"!=typeof r&&(r=P(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(t)),r=""),c&&(r=s.reduce((function(t,e){return o.format(t,e,i.lng,Z(Z({},i),{},{interpolationkey:n[1].trim()}))}),r.trim())),t=t.replace(n[0],r),this.regexp.lastIndex=0}return t}}]),t}();function et(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function nt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?et(Object(n),!0).forEach((function(e){(0,v.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):et(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function rt(t){var e={};return function(n,r,o){var i=r+JSON.stringify(o),a=e[i];return a||(a=t(r,o),e[i]=a),a(n)}}var ot=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,s.A)(this,t),this.logger=S.create("formatter"),this.options=e,this.formats={number:rt((function(t,e){var n=new Intl.NumberFormat(t,e);return function(t){return n.format(t)}})),currency:rt((function(t,e){var n=new Intl.NumberFormat(t,nt(nt({},e),{},{style:"currency"}));return function(t){return n.format(t)}})),datetime:rt((function(t,e){var n=new Intl.DateTimeFormat(t,nt({},e));return function(t){return n.format(t)}})),relativetime:rt((function(t,e){var n=new Intl.RelativeTimeFormat(t,nt({},e));return function(t){return n.format(t,e.range||"day")}})),list:rt((function(t,e){var n=new Intl.ListFormat(t,nt({},e));return function(t){return n.format(t)}}))},this.init(e)}return(0,c.A)(t,[{key:"init",value:function(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=e.formatSeparator?e.formatSeparator:e.formatSeparator||","}},{key:"add",value:function(t,e){this.formats[t.toLowerCase().trim()]=e}},{key:"addCached",value:function(t,e){this.formats[t.toLowerCase().trim()]=rt(e)}},{key:"format",value:function(t,e,n,r){var o=this;return e.split(this.formatSeparator).reduce((function(t,e){var i=function(t){var e=t.toLowerCase().trim(),n={};if(t.indexOf("(")>-1){var r=t.split("(");e=r[0].toLowerCase().trim();var o=r[1].substring(0,r[1].length-1);"currency"===e&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===e&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach((function(t){if(t){var e=(i=t.split(":"),(0,y.A)(i)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(i)||(0,g.A)(i)||(0,m.A)()),r=e[0],o=e.slice(1).join(":").trim().replace(/^'+|'+$/g,"");n[r.trim()]||(n[r.trim()]=o),"false"===o&&(n[r.trim()]=!1),"true"===o&&(n[r.trim()]=!0),isNaN(o)||(n[r.trim()]=parseInt(o,10))}var i}))}return{formatName:e,formatOptions:n}}(e),a=i.formatName,u=i.formatOptions;if(o.formats[a]){var s=t;try{var c=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},l=c.locale||c.lng||r.locale||r.lng||n;s=o.formats[a](t,l,nt(nt(nt({},u),r),c))}catch(t){o.logger.warn(t)}return s}return o.logger.warn("there was no format function for ".concat(a)),t}),t)}}]),t}();function it(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function at(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?it(Object(n),!0).forEach((function(e){(0,v.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):it(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ut=function(t){p(o,t);var e,n,r=(e=o,n=function(){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(t){return!1}}(),function(){var t,r=d(e);if(n){var o=d(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return h(this,t)});function o(t,e,n){var i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return(0,s.A)(this,o),i=r.call(this),D&&E.call((0,l.A)(i)),i.backend=t,i.store=e,i.services=n,i.languageUtils=n.languageUtils,i.options=a,i.logger=S.create("backendConnector"),i.waitingReads=[],i.maxParallelReads=a.maxParallelReads||10,i.readingCalls=0,i.maxRetries=a.maxRetries>=0?a.maxRetries:5,i.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(n,a.backend,a),i}return(0,c.A)(o,[{key:"queueLoad",value:function(t,e,n,r){var o=this,i={},a={},u={},s={};return t.forEach((function(t){var r=!0;e.forEach((function(e){var u="".concat(t,"|").concat(e);!n.reload&&o.store.hasResourceBundle(t,e)?o.state[u]=2:o.state[u]<0||(1===o.state[u]?void 0===a[u]&&(a[u]=!0):(o.state[u]=1,r=!1,void 0===a[u]&&(a[u]=!0),void 0===i[u]&&(i[u]=!0),void 0===s[e]&&(s[e]=!0)))})),r||(u[t]=!0)})),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(u),toLoadNamespaces:Object.keys(s)}}},{key:"loaded",value:function(t,e,n){var r=t.split("|"),o=r[0],i=r[1];e&&this.emit("failedLoading",o,i,e),n&&this.store.addResourceBundle(o,i,n),this.state[t]=e?-1:2;var a={};this.queue.forEach((function(n){var r,u,s,c,l;r=n.loaded,u=i,(c=(s=j(r,[o],Object)).obj)[l=s.k]=c[l]||[],c[l].push(u),function(t,e){void 0!==t.pending[e]&&(delete t.pending[e],t.pendingCount--)}(n,t),e&&n.errors.push(e),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((function(t){a[t]||(a[t]={});var e=n.loaded[t];e.length&&e.forEach((function(e){void 0===a[t][e]&&(a[t][e]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(t){return!t.done}))}},{key:"read",value:function(t,e,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;return t.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:t,ns:e,fcName:n,tried:o,wait:i,callback:a}):(this.readingCalls++,this.backend[n](t,e,(function(u,s){if(r.readingCalls--,r.waitingReads.length>0){var c=r.waitingReads.shift();r.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}u&&s&&o<r.maxRetries?setTimeout((function(){r.read.call(r,t,e,n,o+1,2*i,a)}),i):a(u,s)}))):a(null,{})}},{key:"prepareLoading",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();"string"==typeof t&&(t=this.languageUtils.toResolveHierarchy(t)),"string"==typeof e&&(e=[e]);var i=this.queueLoad(t,e,r,o);if(!i.toLoad.length)return i.pending.length||o(),null;i.toLoad.forEach((function(t){n.loadOne(t)}))}},{key:"load",value:function(t,e,n){this.prepareLoading(t,e,{},n)}},{key:"reload",value:function(t,e,n){this.prepareLoading(t,e,{reload:!0},n)}},{key:"loadOne",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=t.split("|"),o=r[0],i=r[1];this.read(o,i,"read",void 0,void 0,(function(r,a){r&&e.logger.warn("".concat(n,"loading namespace ").concat(i," for language ").concat(o," failed"),r),!r&&a&&e.logger.log("".concat(n,"loaded namespace ").concat(i," for language ").concat(o),a),e.loaded(t,r,a)}))}},{key:"saveMissing",value:function(t,e,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(e)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(e,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(t,e,n,r,null,at(at({},i),{},{isUpdate:o})),t&&t[0]&&this.store.addResource(t[0],e,n,r))}}]),o}(E);function st(t){return"string"==typeof t.ns&&(t.ns=[t.ns]),"string"==typeof t.fallbackLng&&(t.fallbackLng=[t.fallbackLng]),"string"==typeof t.fallbackNS&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function ct(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function lt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ct(Object(n),!0).forEach((function(e){(0,v.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ct(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ft(){}var pt=function(t){p(o,t);var e,n,r=(e=o,n=function(){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(t){return!1}}(),function(){var t,r=d(e);if(n){var o=d(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return h(this,t)});function o(){var t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if((0,s.A)(this,o),t=r.call(this),D&&E.call((0,l.A)(t)),t.options=st(n),t.services={},t.logger=S,t.modules={external:[]},e=(0,l.A)(t),Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))})),i&&!t.isInitialized&&!n.isClone){if(!t.options.initImmediate)return t.init(n,i),h(t,(0,l.A)(t));setTimeout((function(){t.init(n,i)}),0)}return t}return(0,c.A)(o,[{key:"init",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof e&&(n=e,e={}),!e.defaultNS&&!1!==e.defaultNS&&e.ns&&("string"==typeof e.ns?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));var r={debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var e={};if("object"===(0,u.A)(t[1])&&(e=t[1]),"string"==typeof t[1]&&(e.defaultValue=t[1]),"string"==typeof t[2]&&(e.tDescription=t[2]),"object"===(0,u.A)(t[2])||"object"===(0,u.A)(t[3])){var n=t[3]||t[2];Object.keys(n).forEach((function(t){e[t]=n[t]}))}return e},interpolation:{escapeValue:!0,format:function(t,e,n,r){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}};function o(t){return t?"function"==typeof t?new t:t:null}if(this.options=lt(lt(lt({},r),this.options),st(e)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=lt(lt({},r.interpolation),this.options.interpolation)),void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator),!this.options.isClone){var i;this.modules.logger?S.init(o(this.modules.logger),this.options):S.init(null,this.options),this.modules.formatter?i=this.modules.formatter:"undefined"!=typeof Intl&&(i=ot);var a=new K(this.options);this.store=new B(this.options.resources,this.options);var s=this.services;s.logger=S,s.resourceStore=this.store,s.languageUtils=a,s.pluralResolver=new Q(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!i||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(s.formatter=o(i),s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new tt(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new ut(o(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];t.emit.apply(t,[e].concat(r))})),this.modules.languageDetector&&(s.languageDetector=o(this.modules.languageDetector),s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=o(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new W(this.services,this.options),this.translator.on("*",(function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];t.emit.apply(t,[e].concat(r))})),this.modules.external.forEach((function(e){e.init&&e.init(t)}))}if(this.format=this.options.interpolation.format,n||(n=ft),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&"dev"!==c[0]&&(this.options.lng=c[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((function(e){t[e]=function(){var n;return(n=t.store)[e].apply(n,arguments)}})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((function(e){t[e]=function(){var n;return(n=t.store)[e].apply(n,arguments),t}}));var l=x(),f=function(){var e=function(e,r){t.isInitialized&&!t.initializedStoreOnce&&t.logger.warn("init: i18next is already initialized. You should call init just once!"),t.isInitialized=!0,t.options.isClone||t.logger.log("initialized",t.options),t.emit("initialized",t.options),l.resolve(r),n(e,r)};if(t.languages&&"v1"!==t.options.compatibilityAPI&&!t.isInitialized)return e(null,t.t.bind(t));t.changeLanguage(t.options.lng,e)};return this.options.resources||!this.options.initImmediate?f():setTimeout(f,0),l}},{key:"loadResources",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ft,r="string"==typeof t?t:this.language;if("function"==typeof t&&(n=t),!this.options.resources||this.options.partialBundledLanguages){if(r&&"cimode"===r.toLowerCase())return n();var o=[],i=function(t){t&&e.services.languageUtils.toResolveHierarchy(t).forEach((function(t){o.indexOf(t)<0&&o.push(t)}))};r?i(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((function(t){return i(t)})),this.options.preload&&this.options.preload.forEach((function(t){return i(t)})),this.services.backendConnector.load(o,this.options.ns,(function(t){t||e.resolvedLanguage||!e.language||e.setResolvedLanguage(e.language),n(t)}))}else n(null)}},{key:"reloadResources",value:function(t,e,n){var r=x();return t||(t=this.languages),e||(e=this.options.ns),n||(n=ft),this.services.backendConnector.reload(t,e,(function(t){r.resolve(),n(t)})),r}},{key:"use",value:function(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&F.addPostProcessor(t),"formatter"===t.type&&(this.modules.formatter=t),"3rdParty"===t.type&&this.modules.external.push(t),this}},{key:"setResolvedLanguage",value:function(t){if(t&&this.languages&&!(["cimode","dev"].indexOf(t)>-1))for(var e=0;e<this.languages.length;e++){var n=this.languages[e];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}},{key:"changeLanguage",value:function(t,e){var n=this;this.isLanguageChangingTo=t;var r=x();this.emit("languageChanging",t);var o=function(t){n.language=t,n.languages=n.services.languageUtils.toResolveHierarchy(t),n.resolvedLanguage=void 0,n.setResolvedLanguage(t)},i=function(i){t||i||!n.services.languageDetector||(i=[]);var a="string"==typeof i?i:n.services.languageUtils.getBestMatchFromCodes(i);a&&(n.language||o(a),n.translator.language||n.translator.changeLanguage(a),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(a)),n.loadResources(a,(function(t){!function(t,i){i?(o(i),n.translator.changeLanguage(i),n.isLanguageChangingTo=void 0,n.emit("languageChanged",i),n.logger.log("languageChanged",i)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),e&&e(t,(function(){return n.t.apply(n,arguments)}))}(t,a)}))};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(i):i(t):i(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(t,e,n){var r=this,o=function t(e,o){var i;if("object"!==(0,u.A)(o)){for(var a=arguments.length,s=new Array(a>2?a-2:0),c=2;c<a;c++)s[c-2]=arguments[c];i=r.options.overloadTranslationOptionHandler([e,o].concat(s))}else i=lt({},o);i.lng=i.lng||t.lng,i.lngs=i.lngs||t.lngs,i.ns=i.ns||t.ns,i.keyPrefix=i.keyPrefix||n||t.keyPrefix;var l=r.options.keySeparator||".",f=i.keyPrefix?"".concat(i.keyPrefix).concat(l).concat(e):e;return r.t(f,i)};return"string"==typeof t?o.lng=t:o.lngs=t,o.ns=e,o.keyPrefix=n,o}},{key:"t",value:function(){var t;return this.translator&&(t=this.translator).translate.apply(t,arguments)}},{key:"exists",value:function(){var t;return this.translator&&(t=this.translator).exists.apply(t,arguments)}},{key:"setDefaultNamespace",value:function(t){this.options.defaultNS=t}},{key:"hasLoadedNamespace",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.resolvedLanguage||this.languages[0],o=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(t,n){var r=e.services.backendConnector.state["".concat(t,"|").concat(n)];return-1===r||2===r};if(n.precheck){var u=n.precheck(this,a);if(void 0!==u)return u}return!(!this.hasResourceBundle(r,t)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!a(r,t)||o&&!a(i,t)))}},{key:"loadNamespaces",value:function(t,e){var n=this,r=x();return this.options.ns?("string"==typeof t&&(t=[t]),t.forEach((function(t){n.options.ns.indexOf(t)<0&&n.options.ns.push(t)})),this.loadResources((function(t){r.resolve(),e&&e(t)})),r):(e&&e(),Promise.resolve())}},{key:"loadLanguages",value:function(t,e){var n=x();"string"==typeof t&&(t=[t]);var r=this.options.preload||[],o=t.filter((function(t){return r.indexOf(t)<0}));return o.length?(this.options.preload=r.concat(o),this.loadResources((function(t){n.resolve(),e&&e(t)})),n):(e&&e(),Promise.resolve())}},{key:"dir",value:function(t){return t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),t?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(this.services.languageUtils.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr":"rtl"}},{key:"cloneInstance",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ft,r=lt(lt(lt({},this.options),e),{isClone:!0}),i=new o(r);return void 0===e.debug&&void 0===e.prefix||(i.logger=i.logger.clone(e)),["store","services","language"].forEach((function(e){i[e]=t[e]})),i.services=lt({},this.services),i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i.translator=new W(i.services,i.options),i.translator.on("*",(function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];i.emit.apply(i,[t].concat(n))})),i.init(r,n),i.translator.options=i.options,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),o}(E);(0,v.A)(pt,"createInstance",(function(){return new pt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}));var ht=pt.createInstance();ht.createInstance=pt.createInstance,ht.createInstance,ht.init,ht.loadResources,ht.reloadResources,ht.use,ht.changeLanguage,ht.getFixedT,ht.t,ht.exists,ht.setDefaultNamespace,ht.hasLoadedNamespace,ht.loadNamespaces,ht.loadLanguages;const dt=ht;function vt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var yt=dt.default||dt;function gt(t,e,n,r){return yt.t(e,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){vt(t,e,n[e])}))}return t}({ns:t,defaultValue:n},r))}function mt(t,e,n){return a[t]?gt("core",t,null!=e?e:a[t],n):(console.error("O3 Core Translations does not provide key '".concat(t,"'. The key itself is being rendered as text.")),t)}yt.on("initialized",(function(){window.i18next.loadNamespaces(["core"])}))},2238:()=>{function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function r(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}function o(t,e,n){return o="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=i(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n||t):o.value}},o(t,e,n||t)}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&c(t,e)}function u(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}function s(t,e){return!e||"object"!==p(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function c(t,e){return c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},c(t,e)}function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t,e)||h(t,e)||function(){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 f(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||h(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 p(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}function h(e,n){if(e){if("string"==typeof e)return t(e,n);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)?t(e,n):void 0}}function d(t){var e=function(){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(t){return!1}}();return function(){var n,r=i(t);if(e){var o=i(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return s(this,n)}}System.register(["dayjs"],(function(t,n){var c={};return{setters:[function(t){c.default=t.default}],execute:function(){t(function(){var t={332:function(t){t.exports=function(){"use strict";return function(t,e,n){e.prototype.isToday=function(){var t="YYYY-MM-DD",e=n();return this.format(t)===e.format(t)}}}()},14:function(t){t.exports=function(){"use strict";var t="minute",e=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,o,i){var a=o.prototype;i.utc=function(t){return new o({date:t,utc:!0,args:arguments})},a.utc=function(e){var n=i(this.toDate(),{locale:this.$L,utc:!0});return e?n.add(this.utcOffset(),t):n},a.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var u=a.parse;a.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),u.call(this,t)};var s=a.init;a.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else s.call(this)};var c=a.utcOffset;a.utcOffset=function(r,o){var i=this.$utils().u;if(i(r))return this.$u?0:i(this.$offset)?c.call(this):this.$offset;if("string"==typeof r&&(r=function(t){void 0===t&&(t="");var r=t.match(e);if(!r)return null;var o=(""+r[0]).match(n)||["-",0,0],i=o[0],a=60*+o[1]+ +o[2];return 0===a?0:"+"===i?a:-a}(r),null===r))return this;var a=Math.abs(r)<=16?60*r:r,u=this;if(o)return u.$offset=a,u.$u=0===r,u;if(0!==r){var s=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(u=this.local().add(a+s,t)).$offset=a,u.$x.$localOffset=s}else u=this.utc();return u};var l=a.format;a.format=function(t){var e=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return l.call(this,e)},a.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var f=a.toDate;a.toDate=function(t){return"s"===t&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():f.call(this)};var p=a.diff;a.diff=function(t,e,n){if(t&&this.$u===t.$u)return p.call(this,t,e,n);var r=this.local(),o=i(t).local();return p.call(r,o,e,n)}}}()},257:function(t,n,o){var i=Symbol("SemVer ANY"),a=function(){"use strict";function t(n,r){if(e(this,t),r&&"object"==(void 0===r?"undefined":p(r))||(r={loose:!!r,includePrerelease:!1}),u(n,t)){if(n.loose===!!r.loose)return n;n=n.value}h("comparator",n,r),this.options=r,this.loose=!!r.loose,this.parse(n),this.semver===i?this.value="":this.value=this.operator+this.semver.version,h("comp",this)}return r(t,[{key:"parse",value:function(t){var e=this.options.loose?c[l.COMPARATORLOOSE]:c[l.COMPARATOR],n=t.match(e);if(!n)throw new TypeError("Invalid comparator: ".concat(t));this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new d(n[2],this.options.loose):this.semver=i}},{key:"toString",value:function(){return this.value}},{key:"test",value:function(t){if(h("Comparator.test",t,this.options.loose),this.semver===i||t===i)return!0;if("string"==typeof t)try{t=new d(t,this.options)}catch(t){return!1}return f(t,this.operator,this.semver,this.options)}},{key:"intersects",value:function(e,n){if(!u(e,t))throw new TypeError("a Comparator is required");if(n&&"object"==(void 0===n?"undefined":p(n))||(n={loose:!!n,includePrerelease:!1}),""===this.operator)return""===this.value||new v(e.value,n).test(this.value);if(""===e.operator)return""===e.value||new v(this.value,n).test(e.semver);var r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),s=f(this.semver,"<",e.semver,n)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=f(this.semver,">",e.semver,n)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||o||i&&a||s||c}}],[{key:"ANY",get:function(){return i}}]),t}();t.exports=a;var s=o(765),c=s.re,l=s.t,f=o(539),h=o(225),d=o(376),v=o(902)},902:function(t,n,o){var i=function(){"use strict";function t(n,r){var o=this;if(e(this,t),r&&"object"==(void 0===r?"undefined":p(r))||(r={loose:!!r,includePrerelease:!1}),u(n,t))return n.loose===!!r.loose&&n.includePrerelease===!!r.includePrerelease?n:new t(n.raw,r);if(u(n,a))return this.raw=n.value,this.set=[[n]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=n,this.set=n.split(/\s*\|\|\s*/).map((function(t){return o.parseRange(t.trim())})).filter((function(t){return t.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(n));this.format()}return r(t,[{key:"format",value:function(){return this.range=this.set.map((function(t){return t.join(" ").trim()})).join("||").trim(),this.range}},{key:"toString",value:function(){return this.range}},{key:"parseRange",value:function(t){var e=this,n=this.options.loose;t=t.trim();var r=n?f[h.HYPHENRANGELOOSE]:f[h.HYPHENRANGE];t=t.replace(r,A(this.options.includePrerelease)),s("hyphen replace",t),t=t.replace(f[h.COMPARATORTRIM],d),s("comparator trim",t,f[h.COMPARATORTRIM]),t=(t=(t=t.replace(f[h.TILDETRIM],v)).replace(f[h.CARETTRIM],y)).split(/\s+/).join(" ");var o=n?f[h.COMPARATORLOOSE]:f[h.COMPARATOR];return t.split(" ").map((function(t){return m(t,e.options)})).join(" ").split(/\s+/).map((function(t){return k(t,e.options)})).filter(this.options.loose?function(t){return!!t.match(o)}:function(){return!0}).map((function(t){return new a(t,e.options)}))}},{key:"intersects",value:function(e,n){if(!u(e,t))throw new TypeError("a Range is required");return this.set.some((function(t){return g(t,n)&&e.set.some((function(e){return g(e,n)&&t.every((function(t){return e.every((function(e){return t.intersects(e,n)}))}))}))}))}},{key:"test",value:function(t){if(!t)return!1;if("string"==typeof t)try{t=new c(t,this.options)}catch(t){return!1}for(var e=0;e<this.set.length;e++)if(_(this.set[e],t,this.options))return!0;return!1}}]),t}();t.exports=i;var a=o(257),s=o(225),c=o(376),l=o(765),f=l.re,h=l.t,d=l.comparatorTrimReplace,v=l.tildeTrimReplace,y=l.caretTrimReplace,g=function(t,e){for(var n=!0,r=t.slice(),o=r.pop();n&&r.length;)n=r.every((function(t){return o.intersects(t,e)})),o=r.pop();return n},m=function(t,e){return s("comp",t,e),t=S(t,e),s("caret",t),t=w(t,e),s("tildes",t),t=x(t,e),s("xrange",t),t=j(t,e),s("stars",t),t},b=function(t){return!t||"x"===t.toLowerCase()||"*"===t},w=function(t,e){return t.trim().split(/\s+/).map((function(t){return O(t,e)})).join(" ")},O=function(t,e){var n=e.loose?f[h.TILDELOOSE]:f[h.TILDE];return t.replace(n,(function(e,n,r,o,i){var a;return s("tilde",t,e,n,r,o,i),b(n)?a="":b(r)?a=">=".concat(n,".0.0 <").concat(+n+1,".0.0-0"):b(o)?a=">=".concat(n,".").concat(r,".0 <").concat(n,".").concat(+r+1,".0-0"):i?(s("replaceTilde pr",i),a=">=".concat(n,".").concat(r,".").concat(o,"-").concat(i," <").concat(n,".").concat(+r+1,".0-0")):a=">=".concat(n,".").concat(r,".").concat(o," <").concat(n,".").concat(+r+1,".0-0"),s("tilde return",a),a}))},S=function(t,e){return t.trim().split(/\s+/).map((function(t){return E(t,e)})).join(" ")},E=function(t,e){s("caret",t,e);var n=e.loose?f[h.CARETLOOSE]:f[h.CARET],r=e.includePrerelease?"-0":"";return t.replace(n,(function(e,n,o,i,a){var u;return s("caret",t,e,n,o,i,a),b(n)?u="":b(o)?u=">=".concat(n,".0.0").concat(r," <").concat(+n+1,".0.0-0"):b(i)?u="0"===n?">=".concat(n,".").concat(o,".0").concat(r," <").concat(n,".").concat(+o+1,".0-0"):">=".concat(n,".").concat(o,".0").concat(r," <").concat(+n+1,".0.0-0"):a?(s("replaceCaret pr",a),u="0"===n?"0"===o?">=".concat(n,".").concat(o,".").concat(i,"-").concat(a," <").concat(n,".").concat(o,".").concat(+i+1,"-0"):">=".concat(n,".").concat(o,".").concat(i,"-").concat(a," <").concat(n,".").concat(+o+1,".0-0"):">=".concat(n,".").concat(o,".").concat(i,"-").concat(a," <").concat(+n+1,".0.0-0")):(s("no pr"),u="0"===n?"0"===o?">=".concat(n,".").concat(o,".").concat(i).concat(r," <").concat(n,".").concat(o,".").concat(+i+1,"-0"):">=".concat(n,".").concat(o,".").concat(i).concat(r," <").concat(n,".").concat(+o+1,".0-0"):">=".concat(n,".").concat(o,".").concat(i," <").concat(+n+1,".0.0-0")),s("caret return",u),u}))},x=function(t,e){return s("replaceXRanges",t,e),t.split(/\s+/).map((function(t){return P(t,e)})).join(" ")},P=function(t,e){t=t.trim();var n=e.loose?f[h.XRANGELOOSE]:f[h.XRANGE];return t.replace(n,(function(n,r,o,i,a,u){s("xRange",t,n,r,o,i,a,u);var c=b(o),l=c||b(i),f=l||b(a),p=f;return"="===r&&p&&(r=""),u=e.includePrerelease?"-0":"",c?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&p?(l&&(i=0),a=0,">"===r?(r=">=",l?(o=+o+1,i=0,a=0):(i=+i+1,a=0)):"<="===r&&(r="<",l?o=+o+1:i=+i+1),"<"===r&&(u="-0"),n="".concat(r+o,".").concat(i,".").concat(a).concat(u)):l?n=">=".concat(o,".0.0").concat(u," <").concat(+o+1,".0.0-0"):f&&(n=">=".concat(o,".").concat(i,".0").concat(u," <").concat(o,".").concat(+i+1,".0-0")),s("xRange return",n),n}))},j=function(t,e){return s("replaceStars",t,e),t.trim().replace(f[h.STAR],"")},k=function(t,e){return s("replaceGTE0",t,e),t.trim().replace(f[e.includePrerelease?h.GTE0PRE:h.GTE0],"")},A=function(t){return function(e,n,r,o,i,a,u,s,c,l,f,p,h){return"".concat(n=b(r)?"":b(o)?">=".concat(r,".0.0").concat(t?"-0":""):b(i)?">=".concat(r,".").concat(o,".0").concat(t?"-0":""):a?">=".concat(n):">=".concat(n).concat(t?"-0":"")," ").concat(s=b(c)?"":b(l)?"<".concat(+c+1,".0.0-0"):b(f)?"<".concat(c,".").concat(+l+1,".0-0"):p?"<=".concat(c,".").concat(l,".").concat(f,"-").concat(p):t?"<".concat(c,".").concat(l,".").concat(+f+1,"-0"):"<=".concat(s)).trim()}},_=function(t,e,n){for(var r=0;r<t.length;r++)if(!t[r].test(e))return!1;if(e.prerelease.length&&!n.includePrerelease){for(var o=0;o<t.length;o++)if(s(t[o].semver),t[o].semver!==a.ANY&&t[o].semver.prerelease.length>0){var i=t[o].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}},376:function(t,n,o){var i=o(225),a=o(295),s=a.MAX_LENGTH,c=a.MAX_SAFE_INTEGER,l=o(765),f=l.re,h=l.t,d=o(742).compareIdentifiers,v=function(){"use strict";function t(n,r){if(e(this,t),r&&"object"==(void 0===r?"undefined":p(r))||(r={loose:!!r,includePrerelease:!1}),u(n,t)){if(n.loose===!!r.loose&&n.includePrerelease===!!r.includePrerelease)return n;n=n.version}else if("string"!=typeof n)throw new TypeError("Invalid Version: ".concat(n));if(n.length>s)throw new TypeError("version is longer than ".concat(s," characters"));i("SemVer",n,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;var o=n.trim().match(r.loose?f[h.LOOSE]:f[h.FULL]);if(!o)throw new TypeError("Invalid Version: ".concat(n));if(this.raw=n,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>c||this.major<0)throw new TypeError("Invalid major version");if(this.minor>c||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>c||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map((function(t){if(/^[0-9]+$/.test(t)){var e=+t;if(e>=0&&e<c)return e}return t})):this.prerelease=[],this.build=o[5]?o[5].split("."):[],this.format()}return r(t,[{key:"format",value:function(){return this.version="".concat(this.major,".").concat(this.minor,".").concat(this.patch),this.prerelease.length&&(this.version+="-".concat(this.prerelease.join("."))),this.version}},{key:"toString",value:function(){return this.version}},{key:"compare",value:function(e){if(i("SemVer.compare",this.version,this.options,e),!u(e,t)){if("string"==typeof e&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}},{key:"compareMain",value:function(e){return u(e,t)||(e=new t(e,this.options)),d(this.major,e.major)||d(this.minor,e.minor)||d(this.patch,e.patch)}},{key:"comparePre",value:function(e){if(u(e,t)||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;var n=0;do{var r=this.prerelease[n],o=e.prerelease[n];if(i("prerelease compare",n,r,o),void 0===r&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===r)return-1;if(r!==o)return d(r,o)}while(++n)}},{key:"compareBuild",value:function(e){u(e,t)||(e=new t(e,this.options));var n=0;do{var r=this.build[n],o=e.build[n];if(i("prerelease compare",n,r,o),void 0===r&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===r)return-1;if(r!==o)return d(r,o)}while(++n)}},{key:"inc",value:function(t,e){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",e);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",e);break;case"prepatch":this.prerelease.length=0,this.inc("patch",e),this.inc("pre",e);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",e),this.inc("pre",e);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var n=this.prerelease.length;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error("invalid increment argument: ".concat(t))}return this.format(),this.raw=this.version,this}}]),t}();t.exports=v},507:function(t,e,n){var r=n(959);t.exports=function(t,e){var n=r(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null}},539:function(t,e,n){var r=n(718),o=n(194),i=n(312),a=n(903),u=n(544),s=n(56);t.exports=function(t,e,n,c){switch(e){case"===":return"object"==(void 0===t?"undefined":p(t))&&(t=t.version),"object"==(void 0===n?"undefined":p(n))&&(n=n.version),t===n;case"!==":return"object"==(void 0===t?"undefined":p(t))&&(t=t.version),"object"==(void 0===n?"undefined":p(n))&&(n=n.version),t!==n;case"":case"=":case"==":return r(t,n,c);case"!=":return o(t,n,c);case">":return i(t,n,c);case">=":return a(t,n,c);case"<":return u(t,n,c);case"<=":return s(t,n,c);default:throw new TypeError("Invalid operator: ".concat(e))}}},38:function(t,e,n){var r=n(376),o=n(959),i=n(765),a=i.re,s=i.t;t.exports=function(t,e){if(u(t,r))return t;if("number"==typeof t&&(t=String(t)),"string"!=typeof t)return null;var n=null;if((e=e||{}).rtl){for(var i;(i=a[s.COERCERTL].exec(t))&&(!n||n.index+n[0].length!==t.length);)n&&i.index+i[0].length===n.index+n[0].length||(n=i),a[s.COERCERTL].lastIndex=i.index+i[1].length+i[2].length;a[s.COERCERTL].lastIndex=-1}else n=t.match(a[s.COERCE]);return null===n?null:o("".concat(n[2],".").concat(n[3]||"0",".").concat(n[4]||"0"),e)}},773:function(t,e,n){var r=n(376);t.exports=function(t,e,n){var o=new r(t,n),i=new r(e,n);return o.compare(i)||o.compareBuild(i)}},880:function(t,e,n){var r=n(269);t.exports=function(t,e){return r(t,e,!0)}},269:function(t,e,n){var r=n(376);t.exports=function(t,e,n){return new r(t,n).compare(new r(e,n))}},378:function(t,e,n){var r=n(959),o=n(718);t.exports=function(t,e){if(o(t,e))return null;var n=r(t),i=r(e),a=n.prerelease.length||i.prerelease.length,u=a?"pre":"",s=a?"prerelease":"";for(var c in n)if(("major"===c||"minor"===c||"patch"===c)&&n[c]!==i[c])return u+c;return s}},718:function(t,e,n){var r=n(269);t.exports=function(t,e,n){return 0===r(t,e,n)}},312:function(t,e,n){var r=n(269);t.exports=function(t,e,n){return r(t,e,n)>0}},903:function(t,e,n){var r=n(269);t.exports=function(t,e,n){return r(t,e,n)>=0}},253:function(t,e,n){var r=n(376);t.exports=function(t,e,n,o){"string"==typeof n&&(o=n,n=void 0);try{return new r(t,n).inc(e,o).version}catch(t){return null}}},544:function(t,e,n){var r=n(269);t.exports=function(t,e,n){return r(t,e,n)<0}},56:function(t,e,n){var r=n(269);t.exports=function(t,e,n){return r(t,e,n)<=0}},679:function(t,e,n){var r=n(376);t.exports=function(t,e){return new r(t,e).major}},789:function(t,e,n){var r=n(376);t.exports=function(t,e){return new r(t,e).minor}},194:function(t,e,n){var r=n(269);t.exports=function(t,e,n){return 0!==r(t,e,n)}},959:function(t,e,n){var r=n(295).MAX_LENGTH,o=n(765),i=o.re,a=o.t,s=n(376);t.exports=function(t,e){if(e&&"object"==(void 0===e?"undefined":p(e))||(e={loose:!!e,includePrerelease:!1}),u(t,s))return t;if("string"!=typeof t)return null;if(t.length>r)return null;if(!(e.loose?i[a.LOOSE]:i[a.FULL]).test(t))return null;try{return new s(t,e)}catch(t){return null}}},358:function(t,e,n){var r=n(376);t.exports=function(t,e){return new r(t,e).patch}},559:function(t,e,n){var r=n(959);t.exports=function(t,e){var n=r(t,e);return n&&n.prerelease.length?n.prerelease:null}},795:function(t,e,n){var r=n(269);t.exports=function(t,e,n){return r(e,t,n)}},657:function(t,e,n){var r=n(773);t.exports=function(t,e){return t.sort((function(t,n){return r(n,t,e)}))}},712:function(t,e,n){var r=n(902);t.exports=function(t,e,n){try{e=new r(e,n)}catch(t){return!1}return e.test(t)}},100:function(t,e,n){var r=n(773);t.exports=function(t,e){return t.sort((function(t,n){return r(t,n,e)}))}},397:function(t,e,n){var r=n(959);t.exports=function(t,e){var n=r(t,e);return n?n.version:null}},249:function(t,e,n){var r=n(765);t.exports={re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:n(295).SEMVER_SPEC_VERSION,SemVer:n(376),compareIdentifiers:n(742).compareIdentifiers,rcompareIdentifiers:n(742).rcompareIdentifiers,parse:n(959),valid:n(397),clean:n(507),inc:n(253),diff:n(378),major:n(679),minor:n(789),patch:n(358),prerelease:n(559),compare:n(269),rcompare:n(795),compareLoose:n(880),compareBuild:n(773),sort:n(100),rsort:n(657),gt:n(312),lt:n(544),eq:n(718),neq:n(194),gte:n(903),lte:n(56),cmp:n(539),coerce:n(38),Comparator:n(257),Range:n(902),satisfies:n(712),toComparators:n(42),maxSatisfying:n(775),minSatisfying:n(649),minVersion:n(316),validRange:n(230),outside:n(826),gtr:n(606),ltr:n(32),intersects:n(937),simplifyRange:n(908),subset:n(799)}},295:function(t){var e=Number.MAX_SAFE_INTEGER||9007199254740991;t.exports={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:e,MAX_SAFE_COMPONENT_LENGTH:16}},225:function(t){var e,n="object"==("undefined"==typeof process?"undefined":p(process))&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=console).error.apply(e,["SEMVER"].concat(f(n)))}:function(){};t.exports=n},742:function(t){var e=/^[0-9]+$/,n=function(t,n){var r=e.test(t),o=e.test(n);return r&&o&&(t=+t,n=+n),t===n?0:r&&!o?-1:o&&!r?1:t<n?-1:1};t.exports={compareIdentifiers:n,rcompareIdentifiers:function(t,e){return n(e,t)}}},765:function(t,e,n){var r=n(295).MAX_SAFE_COMPONENT_LENGTH,o=n(225),i=(e=t.exports={}).re=[],a=e.src=[],u=e.t={},s=0,c=function(t,e,n){var r=s++;o(r,e),u[t]=r,a[r]=e,i[r]=new RegExp(e,n?"g":void 0)};c("NUMERICIDENTIFIER","0|[1-9]\\d*"),c("NUMERICIDENTIFIERLOOSE","[0-9]+"),c("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),c("MAINVERSION","(".concat(a[u.NUMERICIDENTIFIER],")\\.(").concat(a[u.NUMERICIDENTIFIER],")\\.(").concat(a[u.NUMERICIDENTIFIER],")")),c("MAINVERSIONLOOSE","(".concat(a[u.NUMERICIDENTIFIERLOOSE],")\\.(").concat(a[u.NUMERICIDENTIFIERLOOSE],")\\.(").concat(a[u.NUMERICIDENTIFIERLOOSE],")")),c("PRERELEASEIDENTIFIER","(?:".concat(a[u.NUMERICIDENTIFIER],"|").concat(a[u.NONNUMERICIDENTIFIER],")")),c("PRERELEASEIDENTIFIERLOOSE","(?:".concat(a[u.NUMERICIDENTIFIERLOOSE],"|").concat(a[u.NONNUMERICIDENTIFIER],")")),c("PRERELEASE","(?:-(".concat(a[u.PRERELEASEIDENTIFIER],"(?:\\.").concat(a[u.PRERELEASEIDENTIFIER],")*))")),c("PRERELEASELOOSE","(?:-?(".concat(a[u.PRERELEASEIDENTIFIERLOOSE],"(?:\\.").concat(a[u.PRERELEASEIDENTIFIERLOOSE],")*))")),c("BUILDIDENTIFIER","[0-9A-Za-z-]+"),c("BUILD","(?:\\+(".concat(a[u.BUILDIDENTIFIER],"(?:\\.").concat(a[u.BUILDIDENTIFIER],")*))")),c("FULLPLAIN","v?".concat(a[u.MAINVERSION]).concat(a[u.PRERELEASE],"?").concat(a[u.BUILD],"?")),c("FULL","^".concat(a[u.FULLPLAIN],"$")),c("LOOSEPLAIN","[v=\\s]*".concat(a[u.MAINVERSIONLOOSE]).concat(a[u.PRERELEASELOOSE],"?").concat(a[u.BUILD],"?")),c("LOOSE","^".concat(a[u.LOOSEPLAIN],"$")),c("GTLT","((?:<|>)?=?)"),c("XRANGEIDENTIFIERLOOSE","".concat(a[u.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),c("XRANGEIDENTIFIER","".concat(a[u.NUMERICIDENTIFIER],"|x|X|\\*")),c("XRANGEPLAIN","[v=\\s]*(".concat(a[u.XRANGEIDENTIFIER],")(?:\\.(").concat(a[u.XRANGEIDENTIFIER],")(?:\\.(").concat(a[u.XRANGEIDENTIFIER],")(?:").concat(a[u.PRERELEASE],")?").concat(a[u.BUILD],"?)?)?")),c("XRANGEPLAINLOOSE","[v=\\s]*(".concat(a[u.XRANGEIDENTIFIERLOOSE],")(?:\\.(").concat(a[u.XRANGEIDENTIFIERLOOSE],")(?:\\.(").concat(a[u.XRANGEIDENTIFIERLOOSE],")(?:").concat(a[u.PRERELEASELOOSE],")?").concat(a[u.BUILD],"?)?)?")),c("XRANGE","^".concat(a[u.GTLT],"\\s*").concat(a[u.XRANGEPLAIN],"$")),c("XRANGELOOSE","^".concat(a[u.GTLT],"\\s*").concat(a[u.XRANGEPLAINLOOSE],"$")),c("COERCE","(^|[^\\d])(\\d{1,".concat(r,"})(?:\\.(\\d{1,").concat(r,"}))?(?:\\.(\\d{1,").concat(r,"}))?(?:$|[^\\d])")),c("COERCERTL",a[u.COERCE],!0),c("LONETILDE","(?:~>?)"),c("TILDETRIM","(\\s*)".concat(a[u.LONETILDE],"\\s+"),!0),e.tildeTrimReplace="$1~",c("TILDE","^".concat(a[u.LONETILDE]).concat(a[u.XRANGEPLAIN],"$")),c("TILDELOOSE","^".concat(a[u.LONETILDE]).concat(a[u.XRANGEPLAINLOOSE],"$")),c("LONECARET","(?:\\^)"),c("CARETTRIM","(\\s*)".concat(a[u.LONECARET],"\\s+"),!0),e.caretTrimReplace="$1^",c("CARET","^".concat(a[u.LONECARET]).concat(a[u.XRANGEPLAIN],"$")),c("CARETLOOSE","^".concat(a[u.LONECARET]).concat(a[u.XRANGEPLAINLOOSE],"$")),c("COMPARATORLOOSE","^".concat(a[u.GTLT],"\\s*(").concat(a[u.LOOSEPLAIN],")$|^$")),c("COMPARATOR","^".concat(a[u.GTLT],"\\s*(").concat(a[u.FULLPLAIN],")$|^$")),c("COMPARATORTRIM","(\\s*)".concat(a[u.GTLT],"\\s*(").concat(a[u.LOOSEPLAIN],"|").concat(a[u.XRANGEPLAIN],")"),!0),e.comparatorTrimReplace="$1$2$3",c("HYPHENRANGE","^\\s*(".concat(a[u.XRANGEPLAIN],")\\s+-\\s+(").concat(a[u.XRANGEPLAIN],")\\s*$")),c("HYPHENRANGELOOSE","^\\s*(".concat(a[u.XRANGEPLAINLOOSE],")\\s+-\\s+(").concat(a[u.XRANGEPLAINLOOSE],")\\s*$")),c("STAR","(<|>)?=?\\s*\\*"),c("GTE0","^\\s*>=\\s*0.0.0\\s*$"),c("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")},606:function(t,e,n){var r=n(826);t.exports=function(t,e,n){return r(t,e,">",n)}},937:function(t,e,n){var r=n(902);t.exports=function(t,e,n){return t=new r(t,n),e=new r(e,n),t.intersects(e)}},32:function(t,e,n){var r=n(826);t.exports=function(t,e,n){return r(t,e,"<",n)}},775:function(t,e,n){var r=n(376),o=n(902);t.exports=function(t,e,n){var i=null,a=null,u=null;try{u=new o(e,n)}catch(t){return null}return t.forEach((function(t){u.test(t)&&(i&&-1!==a.compare(t)||(a=new r(i=t,n)))})),i}},649:function(t,e,n){var r=n(376),o=n(902);t.exports=function(t,e,n){var i=null,a=null,u=null;try{u=new o(e,n)}catch(t){return null}return t.forEach((function(t){u.test(t)&&(i&&1!==a.compare(t)||(a=new r(i=t,n)))})),i}},316:function(t,e,n){var r=n(376),o=n(902),i=n(312);t.exports=function(t,e){t=new o(t,e);var n=new r("0.0.0");if(t.test(n))return n;if(n=new r("0.0.0-0"),t.test(n))return n;n=null;for(var a=0;a<t.set.length;++a)t.set[a].forEach((function(t){var e=new r(t.semver.version);switch(t.operator){case">":0===e.prerelease.length?e.patch++:e.prerelease.push(0),e.raw=e.format();case"":case">=":n&&!i(n,e)||(n=e);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: ".concat(t.operator))}}));return n&&t.test(n)?n:null}},826:function(t,e,n){var r=n(376),o=n(257),i=o.ANY,a=n(902),u=n(712),s=n(312),c=n(544),l=n(56),f=n(903);t.exports=function(t,e,n,h){var d,v,y,g,m,b=function(n){var r=e.set[n],a=null,u=null;return r.forEach((function(t){t.semver===i&&(t=new o(">=0.0.0")),a=a||t,u=u||t,d(t.semver,a.semver,h)?a=t:y(t.semver,u.semver,h)&&(u=t)})),a.operator===g||a.operator===m?{v:!1}:u.operator&&u.operator!==g||!v(t,u.semver)?u.operator===m&&y(t,u.semver)?{v:!1}:void 0:{v:!1}};switch(t=new r(t,h),e=new a(e,h),n){case">":d=s,v=l,y=c,g=">",m=">=";break;case"<":d=c,v=f,y=s,g="<",m="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(u(t,e,h))return!1;for(var w=0;w<e.set.length;++w){var O=b(w);if("object"===p(O))return O.v}return!0}},908:function(t,e,n){var r=n(712),o=n(269);t.exports=function(t,e,n){var i=[],a=null,u=null,s=t.sort((function(t,e){return o(t,e,n)})),c=!0,f=!1,p=void 0;try{for(var h,d=s[Symbol.iterator]();!(c=(h=d.next()).done);c=!0){var v=h.value;r(v,e,n)?(u=v,a||(a=v)):(u&&i.push([a,u]),u=null,a=null)}}catch(t){f=!0,p=t}finally{try{c||null==d.return||d.return()}finally{if(f)throw p}}a&&i.push([a,null]);var y=[],g=!0,m=!1,b=void 0;try{for(var w,O=i[Symbol.iterator]();!(g=(w=O.next()).done);g=!0){var S=l(w.value,2),E=S[0],x=S[1];E===x?y.push(E):x||E!==s[0]?x?E===s[0]?y.push("<=".concat(x)):y.push("".concat(E," - ").concat(x)):y.push(">=".concat(E)):y.push("*")}}catch(t){m=!0,b=t}finally{try{g||null==O.return||O.return()}finally{if(m)throw b}}var P=y.join(" || "),j="string"==typeof e.raw?e.raw:String(e);return P.length<j.length?P:e}},799:function(t,e,n){var r=n(902),o=n(257).ANY,i=n(712),a=n(269),u=function(t,e,n){if(1===t.length&&t[0].semver===o)return 1===e.length&&e[0].semver===o;var r,u,l,f,p,h=new Set,d=!0,v=!1,y=void 0;try{for(var g,m=t[Symbol.iterator]();!(d=(g=m.next()).done);d=!0){var b=g.value;">"===b.operator||">="===b.operator?r=s(r,b,n):"<"===b.operator||"<="===b.operator?u=c(u,b,n):h.add(b.semver)}}catch(t){v=!0,y=t}finally{try{d||null==m.return||m.return()}finally{if(v)throw y}}if(h.size>1)return null;if(r&&u){if((l=a(r.semver,u.semver,n))>0)return null;if(0===l&&(">="!==r.operator||"<="!==u.operator))return null}var w=!0,O=!1,S=void 0;try{for(var E,x=h[Symbol.iterator]();!(w=(E=x.next()).done);w=!0){var P=E.value;if(r&&!i(P,String(r),n))return null;if(u&&!i(P,String(u),n))return null;var j=!0,k=!1,A=void 0;try{for(var _,T=e[Symbol.iterator]();!(j=(_=T.next()).done);j=!0){var C=_.value;if(!i(P,String(C),n))return!1}}catch(t){k=!0,A=t}finally{try{j||null==T.return||T.return()}finally{if(k)throw A}}return!0}}catch(t){O=!0,S=t}finally{try{w||null==x.return||x.return()}finally{if(O)throw S}}var I=!0,M=!1,D=void 0;try{for(var N,R=e[Symbol.iterator]();!(I=(N=R.next()).done);I=!0){var L=N.value;if(p=p||">"===L.operator||">="===L.operator,f=f||"<"===L.operator||"<="===L.operator,r)if(">"===L.operator||">="===L.operator){if(s(r,L,n)===L)return!1}else if(">="===r.operator&&!i(r.semver,String(L),n))return!1;if(u)if("<"===L.operator||"<="===L.operator){if(c(u,L,n)===L)return!1}else if("<="===u.operator&&!i(u.semver,String(L),n))return!1;if(!L.operator&&(u||r)&&0!==l)return!1}}catch(t){M=!0,D=t}finally{try{I||null==R.return||R.return()}finally{if(M)throw D}}return!(r&&f&&!u&&0!==l||u&&p&&!r&&0!==l)},s=function(t,e,n){if(!t)return e;var r=a(t.semver,e.semver,n);return r>0?t:r<0||">"===e.operator&&">="===t.operator?e:t},c=function(t,e,n){if(!t)return e;var r=a(t.semver,e.semver,n);return r<0?t:r>0||"<"===e.operator&&"<="===t.operator?e:t};t.exports=function(t,e,n){t=new r(t,n),e=new r(e,n);var o=!1,i=!0,a=!1,s=void 0;try{t:for(var c,l=t.set[Symbol.iterator]();!(i=(c=l.next()).done);i=!0){var f=c.value,p=!0,h=!1,d=void 0;try{for(var v,y=e.set[Symbol.iterator]();!(p=(v=y.next()).done);p=!0){var g=v.value,m=u(f,g,n);if(o=o||null!==m,m)continue t}}catch(t){h=!0,d=t}finally{try{p||null==y.return||y.return()}finally{if(h)throw d}}if(o)return!1}}catch(t){a=!0,s=t}finally{try{i||null==l.return||l.return()}finally{if(a)throw s}}return!0}},42:function(t,e,n){var r=n(902);t.exports=function(t,e){return new r(t,e).set.map((function(t){return t.map((function(t){return t.value})).join(" ").trim().split(" ")}))}},230:function(t,e,n){var r=n(902);t.exports=function(t,e){try{return new r(t,e).range||"*"}catch(t){return null}}},688:function(t){"use strict";t.exports=c}},n={};function h(e){var r=n[e];if(void 0!==r)return r.exports;var o=n[e]={exports:{}};return t[e].call(o.exports,o,o.exports,h),o.exports}h.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return h.d(e,{a:e}),e},h.d=function(t,e){for(var n in e)h.o(e,n)&&!h.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},h.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},h.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var v={};return function(){"use strict";var t=function(t,e){var r=t.copy(),o="hour"in r?function(t,e){return t.hour+=e.hours||0,t.minute+=e.minutes||0,t.second+=e.seconds||0,t.millisecond+=e.milliseconds||0,function(t){t.second+=Math.floor(t.millisecond/1e3),t.millisecond=w(t.millisecond,1e3),t.minute+=Math.floor(t.second/60),t.second=w(t.second,60),t.hour+=Math.floor(t.minute/60),t.minute=w(t.minute,60);var e=Math.floor(t.hour/24);return t.hour=w(t.hour,24),e}(t)}(r,e):0;n(r,e.years||0),r.calendar.balanceYearMonth&&r.calendar.balanceYearMonth(r,t),r.month+=e.months||0,c(r),y(r),r.day+=7*(e.weeks||0),r.day+=e.days||0,r.day+=o,function(t){for(;t.day<1;)t.month--,c(t),t.day+=t.calendar.getDaysInMonth(t);for(;t.day>t.calendar.getDaysInMonth(t);)t.day-=t.calendar.getDaysInMonth(t),t.month++,c(t)}(r),r.calendar.balanceDate&&r.calendar.balanceDate(r),r.year<1&&(r.year=1,r.month=1,r.day=1);var i=r.calendar.getYearsInEra(r);if(r.year>i){var a,u,s=null===(a=(u=r.calendar).isInverseEra)||void 0===a?void 0:a.call(u,r);r.year=i,r.month=s?1:r.calendar.getMonthsInYear(r),r.day=s?1:r.calendar.getDaysInMonth(r)}r.month<1&&(r.month=1,r.day=1);var l=r.calendar.getMonthsInYear(r);return r.month>l&&(r.month=l,r.day=r.calendar.getDaysInMonth(r)),r.day=Math.max(1,Math.min(r.calendar.getDaysInMonth(r),r.day)),r},n=function(t,e){var n,r;(null===(n=(r=t.calendar).isInverseEra)||void 0===n?void 0:n.call(r,t))&&(e=-e),t.year+=e},c=function(t){for(;t.month<1;)n(t,-1),t.month+=t.calendar.getMonthsInYear(t);for(var e=0;t.month>(e=t.calendar.getMonthsInYear(t));)t.month-=e,n(t,1)},y=function(t){t.month=Math.max(1,Math.min(t.calendar.getMonthsInYear(t),t.month)),t.day=Math.max(1,Math.min(t.calendar.getDaysInMonth(t),t.day))},g=function(t){t.calendar.constrainDate&&t.calendar.constrainDate(t),t.year=Math.max(1,Math.min(t.calendar.getYearsInEra(t),t.year)),y(t)},m=function(e,n){return t(e,function(t){var e={};for(var n in t)"number"==typeof t[n]&&(e[n]=-t[n]);return e}(n))},b=function(t,e){var n=t.copy();return null!=e.era&&(n.era=e.era),null!=e.year&&(n.year=e.year),null!=e.month&&(n.month=e.month),null!=e.day&&(n.day=e.day),g(n),n},w=function(t,e){var n=t%e;return n<0&&(n+=e),n},O=function(t,e,n,r){var o=t.copy();switch(e){case"era":var i=t.calendar.getEras(),a=i.indexOf(t.era);if(a<0)throw new Error("Invalid era: "+t.era);a=S(a,n,0,i.length-1,null==r?void 0:r.round),o.era=i[a],g(o);break;case"year":var u,s;(null===(u=(s=o.calendar).isInverseEra)||void 0===u?void 0:u.call(s,o))&&(n=-n),o.year=S(t.year,n,-1/0,9999,null==r?void 0:r.round),o.year===-1/0&&(o.year=1),o.calendar.balanceYearMonth&&o.calendar.balanceYearMonth(o,t);break;case"month":o.month=S(t.month,n,1,t.calendar.getMonthsInYear(t),null==r?void 0:r.round);break;case"day":o.day=S(t.day,n,1,t.calendar.getDaysInMonth(t),null==r?void 0:r.round);break;default:throw new Error("Unsupported field "+e)}return t.calendar.balanceDate&&t.calendar.balanceDate(o),g(o),o},S=function(t,e,n,r){if(arguments.length>4&&void 0!==arguments[4]&&arguments[4]){(t+=Math.sign(e))<n&&(t=r);var o=Math.abs(e);(t=e>0?Math.ceil(t/o)*o:Math.floor(t/o)*o)>r&&(t=n)}else(t+=e)<n?t=r-(n-t-1):t>r&&(t=n+(t-r-1));return t},E=function(t,e){return t.calendar.toJulianDay(t)-e.calendar.toJulianDay(e)},x=function(t){return 36e5*t.hour+6e4*t.minute+1e3*t.second+t.millisecond},P=function(){return null==Jt&&(Jt=(new Intl.DateTimeFormat).resolvedOptions().timeZone),Jt},j=function(t,e){return t-e*Math.floor(t/e)},k=function(t,e,n,r){var o=(e=_(t,e))-1,i=-2;return n<=2?i=0:A(e)&&(i=-1),1721425+365*o+Math.floor(o/4)-Math.floor(o/100)+Math.floor(o/400)+Math.floor((367*n-362)/12+i+r)},A=function(t){return t%4==0&&(t%100!=0||t%400==0)},_=function(t,e){return"BC"===t?1-e:e},T=function(t){var e="AD";return t<=0&&(e="BC",t=1-t),[e,t]},C=function(t){var e=F(t,new Zt);return"".concat(String(e.year).padStart(4,"0"),"-").concat(String(e.month).padStart(2,"0"),"-").concat(String(e.day).padStart(2,"0"))},I=function(t,e,n){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,n)},M=function(t){var e,n="object"==p(t[0])?t.shift():new Zt;if("string"==typeof t[0])e=t.shift();else{var r=n.getEras();e=r[r.length-1]}return[n,e,t.shift(),t.shift(),t.shift()]},D=function(t){return N(_((t=F(t,new Zt)).era,t.year),t.month,t.day,t.hour,t.minute,t.second,t.millisecond)},N=function(t,e,n,r,o,i,a){var u=new Date;return u.setUTCHours(r,o,i,a),u.setUTCFullYear(t,e-1,n),u.getTime()},R=function(t,e){if("UTC"===e)return 0;if(t>0&&e===P())return-6e4*new Date(t).getTimezoneOffset();var n=L(t,e),r=n.year,o=n.month,i=n.day,a=n.hour,u=n.minute,s=n.second;return N(r,o,i,a,u,s,0)-1e3*Math.floor(t/1e3)},L=function(t,e){var n=oe.get(e);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:e,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),oe.set(e,n));var r=n.formatToParts(new Date(t)),o={},i=!0,a=!1,u=void 0;try{for(var s,c=r[Symbol.iterator]();!(i=(s=c.next()).done);i=!0){var l=s.value;"literal"!==l.type&&(o[l.type]=l.value)}}catch(t){a=!0,u=t}finally{try{i||null==c.return||c.return()}finally{if(a)throw u}}return{year:"BC"===o.era||"B"===o.era?1-o.year:+o.year,month:+o.month,day:+o.day,hour:"24"===o.hour?0:+o.hour,minute:+o.minute,second:+o.second}},U=function(t,e){return new Date(function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"compatible",r=B(t);if("UTC"===e)return D(r);if(e===P()&&"compatible"===n){r=F(r,new Zt);var o=new Date,i=_(r.era,r.year);return o.setFullYear(i,r.month-1,r.day),o.setHours(r.hour,r.minute,r.second,r.millisecond),o.getTime()}var a=D(r),u=R(a-ie,e),s=R(a+ie,e),c=function(t,e,n,r){return(n===r?[n]:[n,r]).filter((function(n){return function(t,e,n){var r=L(n,e);return t.year===r.year&&t.month===r.month&&t.day===r.day&&t.hour===r.hour&&t.minute===r.minute&&t.second===r.second}(t,e,n)}))}(r,e,a-u,a-s);if(1===c.length)return c[0];if(c.length>1)switch(n){case"compatible":case"earlier":return c[0];case"later":return c[c.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(a-u,a-s);case"compatible":case"later":return Math.max(a-u,a-s);case"reject":throw new RangeError("No such absolute time found")}}(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"compatible"))},B=function(t,e){var n,r,o=0,i=0,a=0,u=0;if("timeZone"in t)o=(n=t).hour,i=n.minute,a=n.second,u=n.millisecond;else if("hour"in t&&!e)return t;return e&&(o=(r=e).hour,i=r.minute,a=r.second,u=r.millisecond),new re(t.calendar,t.era,t.year,t.month,t.day,o,i,a,u)},F=function(t,e){if(t.calendar.identifier===e.identifier)return t;var n=e.fromJulianDay(t.calendar.toJulianDay(t)),r=t.copy();return r.calendar=e,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,g(r),r},V=function(t){var e=l(T(t.year+-543),2),n=e[0],r=e[1];return new ee(n,r,t.month,t.day)},z=function(t,e,n,r){return t+365*e+Math.floor(e/4)+30*(n-1)+r-1},H=function(t,e){var n=Math.floor(4*(e-t)/1461),r=1+Math.floor((e-z(t,n,1,1))/30);return[n,r,e+1-z(t,n,r,1)]},W=function(t){return Math.floor(t%4/3)},G=function(t,e){return e%13!=0?30:W(t)+5},K=function(t){return j(7*t+1,19)<7},$=function(t){var e=Math.floor((235*t-234)/19),n=12084+13753*e,r=29*e+Math.floor(n/25920);return j(3*(r+1),7)<3&&(r+=1),r},q=function(t){return $(t)+function(t){var e=$(t-1),n=$(t);return $(t+1)-n==356?2:n-e==382?1:0}(t)},J=function(t){return q(t+1)-q(t)},Y=function(t,e){if(e>=6&&!K(t)&&e++,4===e||7===e||9===e||11===e||13===e)return 29;var n=function(t){var e=J(t);switch(e>380&&(e-=30),e){case 353:return 0;case 354:return 1;case 355:return 2}}(t);return 2===e?2===n?30:29:3===e?0===n?29:30:6===e?K(t)?30:0:30},Q=function(t,e,n,r){return r+Math.ceil(29.5*(n-1))+354*(e-1)+Math.floor((3+11*e)/30)+t-1},X=function(t,e,n){var r=Math.floor((30*(n-e)+10646)/10631),o=Math.min(12,Math.ceil((n-(29+Q(e,r,1,1)))/29.5)+1),i=n-Q(e,r,o,1)+1;return new ee(t,r,o,i)},Z=function(t){return(14+11*t)%30<11},tt=function(t){return we+Qt[t-me]},et=function(t,e){var n=1<<11-(e-1);return Yt[t-me]&n?30:29},nt=function(t,e){for(var n=tt(t),r=1;r<e;r++)n+=et(t,r);return n},rt=function(t){return Qt[t+1-me]-Qt[t-me]},ot=function(t){var e=xe.findIndex((function(e){var n=l(e,3),r=n[0],o=n[1],i=n[2];return t.year<r||t.year===r&&t.month<o||t.year===r&&t.month===o&&t.day<i}));return-1===e?xe.length-1:0===e?0:e-1},it=function(t){var e=je[ke.indexOf(t.era)];if(!e)throw new Error("Unknown era: "+t.era);return new ee(t.year+e,t.month,t.day)},at=function(t){if(1===t.year){var e=ke.indexOf(t.era);return xe[e]}},ut=function(t){return"minguo"===t.era?t.year+Ce:1-t.year+Ce},st=function(t){var e=t-Ce;return e>0?["minguo",e]:["before_minguo",1-e]},ct=function(t){var e=l(T(ut(t)),2),n=e[0],r=e[1];return new ee(n,r,t.month,t.day)},lt=function(t,e){var n=function(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}(t,e);return function(t,e){return e.get?e.get.call(t):e.value}(t,n)},ft=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},pt=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),r.forEach((function(e){ft(t,e,n[e])}))}return t},ht=function(t){return null!=t&&28===t.trim().length&&"T"===(t=t.trim())[10]&&":"===t[13]&&":"===t[16]&&"."===t[19]&&("+"===t[23]||"-"===t[23])&&(0,Me.default)(t,Ue).isValid()},dt=function(t){return(0,Me.default)(t).isToday()},vt=function(t){return ht(t)?(0,Me.default)(t,Ue).toDate():null},yt=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=(0,Me.default)(t);return e&&(n=n.utc()),n.format(Ue)},gt=function(t){return(0,Me.default)(t).format("HH:mm")},mt=function(t){return Me.default.utc(t).format("HH:mm A")},bt=function(t){return Ot(t,"DD - MMM - YYYY")},wt=function(t){return Ot(t,"DD-MMM")},Ot=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"YYYY-MMM-DD";return(0,Me.default)(t).format(e)},St=function(t){return(0,Me.default)(t).toDate()},Et=function(t,e){Ve.register(t,e)},xt=function(t){var e,n,r=null!=t?t:At();return Ve.getCalendar((e=r,(null!=(n=Intl.Locale)&&"undefined"!=typeof Symbol&&n[Symbol.hasInstance]?n[Symbol.hasInstance](e):u(e,n))?r:new Intl.Locale(r)))},Pt=function(t,e){var n,r,o=null!==(n=null==e?void 0:e.locale)&&void 0!==n?n:At(),i=new Intl.Locale(o),a=pt({},Be,{noToday:"am"===i.language},e),u=a.calendar,s=a.mode,c=a.time,l=a.day,f=a.month,p=a.year,h=a.noToday,d=a.numberingSystem,v={calendar:null!=u?u:xt(i),year:p?"numeric":void 0,month:f?"short":void 0,day:l?"2-digit":void 0,numberingSystem:d},y=(0,Me.default)(t).isToday();if(y&&!h)r=(r=new Intl.RelativeTimeFormat(o,{numeric:"auto"}).format(0,"day"))[0].toLocaleUpperCase(o)+r.slice(1);else{"en"===i.language&&(o="en-GB");var g=new Intl.DateTimeFormat(o,v).formatToParts(t);("en"===i.language||"am"===i.language)&&"standard"==s&&p&&l&&(g=g.map(ze("-"))),"wide"==s&&(g=g.map(ze(" — "))),"ethiopic"===v.calendar&&(g=g.filter((function(t,e,n){return!("era"===t.type||"literal"===t.type&&e<n.length-1&&"era"===n[e+1].type)}))),r=g.map((function(t){return t.value})).join("")}return(!0===c||y&&"for today"===c)&&(r+=", ".concat(jt(t))),r},jt=function(t){return t.toLocaleTimeString(At(),{hour:"2-digit",minute:"2-digit"})},kt=function(t,e){return Pt(t,(n=pt({},e),r=null!=(r={time:!0})?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):function(t){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e.push.apply(e,n)}return e}(Object(r)).forEach((function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(r,t))})),n));var n,r},At=function(){var t=window.i18next.language;return"ht"===(t=t.replace("_","-"))&&(t="fr-HT"),t},_t=function(t,e){var n=xt("string"==typeof e?new Intl.Locale(e):e);return n?F(t,function(t){switch(t){case"buddhist":return new ae;case"ethiopic":return new le;case"ethioaa":return new fe;case"coptic":return new pe;case"hebrew":return new de;case"indian":return new ve;case"islamic-civil":return new Oe;case"islamic-tbla":return new Se;case"islamic-umalqura":return new Ee;case"japanese":return new Ae;case"persian":return new Te;case"roc":return new Ie;default:return new Zt}}(n)):t},Tt=function(t){return(Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())-Date.UTC(t.getUTCFullYear(),0,0))/24/60/60/1e3},Ct=function(t,e){var n=t.toISOString(),r=e.toISOString();return n.slice(0,n.indexOf("T"))===r.slice(0,r.indexOf("T"))},It=function(t){var e=new Date,n=new Date(t),r=e.getUTCMonth()-n.getUTCMonth(),o=e.getUTCDate()-n.getUTCDate(),i=e.getUTCFullYear()-n.getUTCFullYear();(r<0||0===r&&o<0)&&i--;var a=r>=0?r:r+12;o<0&&a--;var u=Tt(e)-Tt(n);u<0&&(u+=365);var s=Math.floor(u/7),c=At();return 0===i?Ct(e,n)?new Intl.RelativeTimeFormat(c,{numeric:"auto"}).format(0,"day"):u<31?new Intl.NumberFormat(c,{style:"unit",unit:"day",unitDisplay:"short"}).format(u):new Intl.NumberFormat(c,{style:"unit",unit:"week",unitDisplay:"short"}).format(s):i<2?new Intl.NumberFormat(c,{style:"unit",unit:"month",unitDisplay:"short"}).format(a+12):new Intl.NumberFormat(c,{style:"unit",unit:"year",unitDisplay:"short"}).format(i)},Mt=function(t){return!window.offlineEnabled||(null!=t?t:navigator.onLine)},Dt=function(t){return Rt(Ut(t,"usual","official"))},Nt=function(t){return Dt(t)},Rt=function(t){var e;return t?null!==(e=t.text)&&void 0!==e?e:function(t){var e,n=null!==(e=t.given)&&void 0!==e?e:[];return(t.family?n.concat(t.family):n).join(" ")}(t):""},Lt=function(t){return Rt(t)},Ut=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];0==n.length&&(n=["usual"]);var o,i=!0,a=!1,u=void 0;try{for(var s,c=function(){var e,n=s.value,r=null===(e=t.name)||void 0===e?void 0:e.find((function(t){return function(t,e){return t.use?t.use===e:"usual"===e}(t,n)}));if(r)return{v:r}},l=n[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var f=c();if("object"==((o=f)&&"undefined"!=typeof Symbol&&o.constructor===Symbol?"symbol":void 0===o?"undefined":p(o)))return f.v}}catch(t){a=!0,u=t}finally{try{i||null==l.return||l.return()}finally{if(a)throw u}}},Bt=function(t,e){if(t===e||Object.is(t,e))return!0;if(Array.isArray(t)){if(!Array.isArray(e))return!1;if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}if(Array.isArray(e))return!1;if("object"!=(void 0===t?"undefined":p(t))||null===t||"object"!=(void 0===e?"undefined":p(e))||null===e)return!1;var r=Object.getOwnPropertyNames(t),o=Object.getOwnPropertyNames(e);return r.length===o.length&&r.every((function(n){return t[n]===e[n]}))},Ft=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.localStorage;try{return t.getItem("test"),!0}catch(t){return!1}},Vt=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},zt=function(t){var e,n=function(t){if(Array.isArray(t))return t}(e=t.split("."))||function(t){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,r,o=[],i=!0,a=!1;try{for(e=e.call(t);!(i=(n=e.next()).done)&&(o.push(n.value),3!==o.length);i=!0);}catch(t){a=!0,r=t}finally{try{i||null==e.return||e.return()}finally{if(a)throw r}}return o}}(e)||function(t){if(t){if("string"==typeof t)return Vt(t,3);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(e):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Vt(t,3):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=n[0],o=n[1],i=n[2];return"".concat(r,".").concat(o,".").concat(i)},Ht=function(t,e){var n=function(t){var e=t.indexOf("-");if(e>=0){var n=zt(t.slice(0,e)),r=t.slice(e+1);return"".concat(n,"-").concat(r)}return zt(t)}(e);return We.satisfies(n,t,{includePrerelease:!0})},Wt=function(t,e,n,r,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void n(t)}u.done?e(s):Promise.resolve(s).then(r,o)},Gt=function(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Wt(i,r,o,a,u,"next",t)}function u(t){Wt(i,r,o,a,u,"throw",t)}a(void 0)}))}},Kt=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},$t=function(t){return Ge.apply(this,arguments)},qt=function(t){return Ke.apply(this,arguments)};h.r(v),h.d(v,{age:function(){return It},canAccessStorage:function(){return Ft},convertToLocaleCalendar:function(){return _t},daysIntoYear:function(){return Tt},displayName:function(){return Nt},formatDate:function(){return Pt},formatDatetime:function(){return kt},formatPatientName:function(){return Rt},formatTime:function(){return jt},formattedName:function(){return Lt},getDefaultCalendar:function(){return xt},getDefaultsFromConfigSchema:function(){return He},getLocale:function(){return At},getPatientName:function(){return Dt},isOmrsDateStrict:function(){return ht},isOmrsDateToday:function(){return dt},isOnline:function(){return Mt},isSameDay:function(){return Ct},isVersionSatisfied:function(){return Ht},parseDate:function(){return St},registerDefaultCalendar:function(){return Et},retry:function(){return $t},selectPreferredName:function(){return Ut},shallowEqual:function(){return Bt},toDateObjectStrict:function(){return vt},toOmrsDateFormat:function(){return Ot},toOmrsDayDateFormat:function(){return bt},toOmrsIsoString:function(){return yt},toOmrsTimeString:function(){return mt},toOmrsTimeString24:function(){return gt},toOmrsYearlessDateFormat:function(){return wt}});var Jt=null;new Map;var Yt,Qt,Xt={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]},Zt=function(){function t(){e(this,t),this.identifier="gregory"}return r(t,[{key:"fromJulianDay",value:function(t){var e=t,n=e-1721426,r=Math.floor(n/146097),o=j(n,146097),i=Math.floor(o/36524),a=j(o,36524),u=Math.floor(a/1461),s=j(a,1461),c=Math.floor(s/365),f=l(T(400*r+100*i+4*u+c+(4!==i&&4!==c?1:0)),2),p=f[0],h=f[1],d=e-k(p,h,1,1),v=2;e<k(p,h,3,1)?v=0:A(h)&&(v=1);var y=Math.floor((12*(d+v)+373)/367),g=e-k(p,h,y,1)+1;return new ee(p,h,y,g)}},{key:"toJulianDay",value:function(t){return k(t.era,t.year,t.month,t.day)}},{key:"getDaysInMonth",value:function(t){return Xt[A(t.year)?"leapyear":"standard"][t.month-1]}},{key:"getMonthsInYear",value:function(t){return 12}},{key:"getDaysInYear",value:function(t){return A(t.year)?366:365}},{key:"getYearsInEra",value:function(t){return 9999}},{key:"getEras",value:function(){return["BC","AD"]}},{key:"isInverseEra",value:function(t){return"BC"===t.era}},{key:"balanceDate",value:function(t){t.year<=0&&(t.era="BC"===t.era?"AD":"BC",t.year=1-t.year)}}]),t}(),te=new WeakMap,ee=function(){function n(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];e(this,n),I(this,te,{writable:!0,value:void 0});var i=l(M(r),5),a=i[0],u=i[1],s=i[2],c=i[3],f=i[4];this.calendar=a,this.era=u,this.year=s,this.month=c,this.day=f,g(this)}return r(n,[{key:"copy",value:function(){return this.era?new n(this.calendar,this.era,this.year,this.month,this.day):new n(this.calendar,this.year,this.month,this.day)}},{key:"add",value:function(e){return t(this,e)}},{key:"subtract",value:function(t){return m(this,t)}},{key:"set",value:function(t){return b(this,t)}},{key:"cycle",value:function(t,e,n){return O(this,t,e,n)}},{key:"toDate",value:function(t){return U(this,t)}},{key:"toString",value:function(){return C(this)}},{key:"compare",value:function(t){return E(this,t)}}]),n}(),ne=new WeakMap,re=function(){function n(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];e(this,n),I(this,ne,{writable:!0,value:void 0});var i=l(M(r),5),a=i[0],u=i[1],s=i[2],c=i[3],f=i[4];this.calendar=a,this.era=u,this.year=s,this.month=c,this.day=f,this.hour=r.shift()||0,this.minute=r.shift()||0,this.second=r.shift()||0,this.millisecond=r.shift()||0,g(this)}return r(n,[{key:"copy",value:function(){return this.era?new n(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new n(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}},{key:"add",value:function(e){return t(this,e)}},{key:"subtract",value:function(t){return m(this,t)}},{key:"set",value:function(t){return b(function(t,e){var n,r=t.copy();return null!=e.hour&&(r.hour=e.hour),null!=e.minute&&(r.minute=e.minute),null!=e.second&&(r.second=e.second),null!=e.millisecond&&(r.millisecond=e.millisecond),(n=r).millisecond=Math.max(0,Math.min(n.millisecond,1e3)),n.second=Math.max(0,Math.min(n.second,59)),n.minute=Math.max(0,Math.min(n.minute,59)),n.hour=Math.max(0,Math.min(n.hour,23)),r}(this,t),t)}},{key:"cycle",value:function(t,e,n){switch(t){case"era":case"year":case"month":case"day":return O(this,t,e,n);default:return function(t,e,n,r){var o=t.copy();switch(e){case"hour":var i=t.hour,a=0,u=23;if(12===(null==r?void 0:r.hourCycle)){var s=i>=12;a=s?12:0,u=s?23:11}o.hour=S(i,n,a,u,null==r?void 0:r.round);break;case"minute":o.minute=S(t.minute,n,0,59,null==r?void 0:r.round);break;case"second":o.second=S(t.second,n,0,59,null==r?void 0:r.round);break;case"millisecond":o.millisecond=S(t.millisecond,n,0,999,null==r?void 0:r.round);break;default:throw new Error("Unsupported field "+e)}return o}(this,t,e,n)}}},{key:"toDate",value:function(t,e){return U(this,t,e)}},{key:"toString",value:function(){return"".concat(C(this),"T").concat((t=this,"".concat(String(t.hour).padStart(2,"0"),":").concat(String(t.minute).padStart(2,"0"),":").concat(String(t.second).padStart(2,"0")).concat(t.millisecond?String(t.millisecond/1e3).slice(1):"")));var t}},{key:"compare",value:function(t){var e=E(this,t);return 0===e?function(t,e){return x(t)-x(e)}(this,B(t)):e}}]),n}(),oe=new Map,ie=864e5,ae=function(t){a(u,t);var n=d(u);function u(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var i;return e(this,u),(i=n.call.apply(n,[this].concat(f(r)))).identifier="buddhist",s(i)}return r(u,[{key:"fromJulianDay",value:function(t){var e=o(i(u.prototype),"fromJulianDay",this).call(this,t),n=_(e.era,e.year);return new ee(this,n- -543,e.month,e.day)}},{key:"toJulianDay",value:function(t){return o(i(u.prototype),"toJulianDay",this).call(this,V(t))}},{key:"getEras",value:function(){return["BE"]}},{key:"getDaysInMonth",value:function(t){return o(i(u.prototype),"getDaysInMonth",this).call(this,V(t))}},{key:"balanceDate",value:function(){}}]),u}(Zt),ue=1723856,se=1824665,ce=5500,le=function(){function t(){e(this,t),this.identifier="ethiopic"}return r(t,[{key:"fromJulianDay",value:function(t){var e=l(H(ue,t),3),n=e[0],r=e[1],o=e[2],i="AM";return n<=0&&(i="AA",n+=ce),new ee(this,i,n,r,o)}},{key:"toJulianDay",value:function(t){var e=t.year;return"AA"===t.era&&(e-=ce),z(ue,e,t.month,t.day)}},{key:"getDaysInMonth",value:function(t){return G(t.year,t.month)}},{key:"getMonthsInYear",value:function(){return 13}},{key:"getDaysInYear",value:function(t){return 365+W(t.year)}},{key:"getYearsInEra",value:function(t){return"AA"===t.era?9999:9991}},{key:"getEras",value:function(){return["AA","AM"]}}]),t}(),fe=function(t){a(o,t);var n=d(o);function o(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];var a;return e(this,o),(a=n.call.apply(n,[this].concat(f(r)))).identifier="ethioaa",s(a)}return r(o,[{key:"fromJulianDay",value:function(t){var e=l(H(ue,t),3),n=e[0],r=e[1],o=e[2];return new ee(this,"AA",n+=ce,r,o)}},{key:"getEras",value:function(){return["AA"]}},{key:"getYearsInEra",value:function(){return 9999}}]),o}(le),pe=function(t){a(o,t);var n=d(o);function o(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];var a;return e(this,o),(a=n.call.apply(n,[this].concat(f(r)))).identifier="coptic",s(a)}return r(o,[{key:"fromJulianDay",value:function(t){var e=l(H(se,t),3),n=e[0],r=e[1],o=e[2],i="CE";return n<=0&&(i="BCE",n=1-n),new ee(this,i,n,r,o)}},{key:"toJulianDay",value:function(t){var e=t.year;return"BCE"===t.era&&(e=1-e),z(se,e,t.month,t.day)}},{key:"getDaysInMonth",value:function(t){var e=t.year;return"BCE"===t.era&&(e=1-e),G(e,t.month)}},{key:"isInverseEra",value:function(t){return"BCE"===t.era}},{key:"balanceDate",value:function(t){t.year<=0&&(t.era="BCE"===t.era?"CE":"BCE",t.year=1-t.year)}},{key:"getEras",value:function(){return["BCE","CE"]}},{key:"getYearsInEra",value:function(t){return"BCE"===t.era?9999:9715}}]),o}(le),he=347997,de=function(){function t(){e(this,t),this.identifier="hebrew"}return r(t,[{key:"fromJulianDay",value:function(t){for(var e=t-he,n=25920*e/765433,r=Math.floor((19*n+234)/235)+1,o=q(r),i=Math.floor(e-o);i<1;)r--,o=q(r),i=Math.floor(e-o);for(var a=1,u=0;u<i;)u+=Y(r,a),a++;return a--,u-=Y(r,a),new ee(this,r,a,i-u)}},{key:"toJulianDay",value:function(t){for(var e=q(t.year),n=1;n<t.month;n++)e+=Y(t.year,n);return e+t.day+he}},{key:"getDaysInMonth",value:function(t){return Y(t.year,t.month)}},{key:"getMonthsInYear",value:function(t){return K(t.year)?13:12}},{key:"getDaysInYear",value:function(t){return J(t.year)}},{key:"getYearsInEra",value:function(){return 9999}},{key:"getEras",value:function(){return["AM"]}},{key:"balanceYearMonth",value:function(t,e){e.year!==t.year&&(K(e.year)&&!K(t.year)&&e.month>6?t.month--:!K(e.year)&&K(t.year)&&e.month>6&&t.month++)}}]),t}(),ve=function(t){a(u,t);var n=d(u);function u(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var i;return e(this,u),(i=n.call.apply(n,[this].concat(f(r)))).identifier="indian",s(i)}return r(u,[{key:"fromJulianDay",value:function(t){var e,n,r,a=o(i(u.prototype),"fromJulianDay",this).call(this,t),s=a.year-78,c=t-k(a.era,a.year,1,1);if(c<80?(s--,c+=155+(e=A(a.year-1)?31:30)+90+10):(e=A(a.year)?31:30,c-=80),c<e)n=1,r=c+1;else{var l=c-e;l<155?(n=Math.floor(l/31)+2,r=l%31+1):(l-=155,n=Math.floor(l/30)+7,r=l%30+1)}return new ee(this,s,n,r)}},{key:"toJulianDay",value:function(t){var e,n,r=t.year+78,o=l(T(r),2),i=o[0],a=o[1];return A(a)?(e=31,n=k(i,a,3,21)):(e=30,n=k(i,a,3,22)),1===t.month?n+t.day-1:(n+=e+31*Math.min(t.month-2,5),t.month>=8&&(n+=30*(t.month-7)),n+=t.day-1)}},{key:"getDaysInMonth",value:function(t){return 1===t.month&&A(t.year+78)||t.month>=2&&t.month<=6?31:30}},{key:"getYearsInEra",value:function(){return 9919}},{key:"getEras",value:function(){return["saka"]}},{key:"balanceDate",value:function(){}}]),u}(Zt),ye=1948440,ge=1948439,me=1300,be=1600,we=460322,Oe=function(){function t(){e(this,t),this.identifier="islamic-civil"}return r(t,[{key:"fromJulianDay",value:function(t){return X(this,ye,t)}},{key:"toJulianDay",value:function(t){return Q(ye,t.year,t.month,t.day)}},{key:"getDaysInMonth",value:function(t){var e=29+t.month%2;return 12===t.month&&Z(t.year)&&e++,e}},{key:"getMonthsInYear",value:function(){return 12}},{key:"getDaysInYear",value:function(t){return Z(t.year)?355:354}},{key:"getYearsInEra",value:function(){return 9665}},{key:"getEras",value:function(){return["AH"]}}]),t}(),Se=function(t){a(o,t);var n=d(o);function o(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];var a;return e(this,o),(a=n.call.apply(n,[this].concat(f(r)))).identifier="islamic-tbla",s(a)}return r(o,[{key:"fromJulianDay",value:function(t){return X(this,ge,t)}},{key:"toJulianDay",value:function(t){return Q(ge,t.year,t.month,t.day)}}]),o}(Oe),Ee=function(t){a(u,t);var n=d(u);function u(){var t;if(e(this,u),(t=n.call(this)).identifier="islamic-umalqura",Yt||(Yt=new Uint16Array(Uint8Array.from(atob("qgpUDckO1AbqBmwDrQpVBakGkgepC9QF2gpcBS0NlQZKB1QLagutBa4ETwoXBYsGpQbVCtYCWwmdBE0KJg2VDawFtgm6AlsKKwWVCsoG6Qr0AnYJtgJWCcoKpAvSC9kF3AJtCU0FpQpSC6ULtAW2CVcFlwJLBaMGUgdlC2oFqworBZUMSg2lDcoF1gpXCasESwmlClILagt1BXYCtwhbBFUFqQW0BdoJ3QRuAjYJqgpUDbIN1QXaAlsJqwRVCkkLZAtxC7QFtQpVCiUNkg7JDtQG6QprCasEkwpJDaQNsg25CroEWworBZUKKgtVC1wFvQQ9Ah0JlQpKC1oLbQW2AjsJmwRVBqkGVAdqC2wFrQpVBSkLkgupC9QF2gpaBasKlQVJB2QHqgu1BbYCVgpNDiULUgtqC60FrgIvCZcESwalBqwG1gpdBZ0ETQoWDZUNqgW1BdoCWwmtBJUFygbkBuoK9QS2AlYJqgpUC9IL2QXqAm0JrQSVCkoLpQuyBbUJ1gSXCkcFkwZJB1ULagVrCisFiwpGDaMNygXWCtsEawJLCaUKUgtpC3UFdgG3CFsCKwVlBbQF2gntBG0BtgimClINqQ3UBdoKWwmrBFMGKQdiB6kLsgW1ClUFJQuSDckO0gbpCmsFqwRVCikNVA2qDbUJugQ7CpsETQqqCtUK2gJdCV4ELgqaDFUNsga5BroEXQotBZUKUguoC7QLuQXaAloJSgukDdEO6AZqC20FNQWVBkoNqA3UDdoGWwWdAisGFQtKC5ULqgWuCi4JjwwnBZUGqgbWCl0FnQI="),(function(t){return t.charCodeAt(0)})).buffer)),!Qt){Qt=new Uint32Array(be-me+1);for(var r=0,o=me;o<=be;o++){Qt[o-me]=r;for(var i=1;i<=12;i++)r+=et(o,i)}}return s(t)}return r(u,[{key:"fromJulianDay",value:function(t){var e=t-ye,n=tt(me),r=tt(be);if(e<n||e>r)return o(i(u.prototype),"fromJulianDay",this).call(this,t);for(var a=me-1,s=1,c=1;c>0;){a++,c=e-tt(a)+1;var l=rt(a);if(c===l){s=12;break}if(c<l){var f=et(a,s);for(s=1;c>f;)c-=f,s++,f=et(a,s);break}}return new ee(this,a,s,e-nt(a,s)+1)}},{key:"toJulianDay",value:function(t){return t.year<me||t.year>be?o(i(u.prototype),"toJulianDay",this).call(this,t):ye+nt(t.year,t.month)+(t.day-1)}},{key:"getDaysInMonth",value:function(t){return t.year<me||t.year>be?o(i(u.prototype),"getDaysInMonth",this).call(this,t):et(t.year,t.month)}},{key:"getDaysInYear",value:function(t){return t.year<me||t.year>be?o(i(u.prototype),"getDaysInYear",this).call(this,t):rt(t.year)}}]),u}(Oe),xe=[[1868,9,8],[1912,7,30],[1926,12,25],[1989,1,8],[2019,5,1]],Pe=[[1912,7,29],[1926,12,24],[1989,1,7],[2019,4,30]],je=[1867,1911,1925,1988,2018],ke=["meiji","taisho","showa","heisei","reiwa"],Ae=function(t){a(u,t);var n=d(u);function u(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var i;return e(this,u),(i=n.call.apply(n,[this].concat(f(r)))).identifier="japanese",s(i)}return r(u,[{key:"fromJulianDay",value:function(t){var e=o(i(u.prototype),"fromJulianDay",this).call(this,t),n=ot(e);return new ee(this,ke[n],e.year-je[n],e.month,e.day)}},{key:"toJulianDay",value:function(t){return o(i(u.prototype),"toJulianDay",this).call(this,it(t))}},{key:"balanceDate",value:function(t){var e=it(t),n=ot(e);ke[n]!==t.era&&(t.era=ke[n],t.year=e.year-je[n]),this.constrainDate(t)}},{key:"constrainDate",value:function(t){var e=ke.indexOf(t.era),n=Pe[e];if(null!=n){var r=l(n,3),o=r[0],i=r[1],a=r[2],u=o-je[e];t.year=Math.max(1,Math.min(u,t.year)),t.year===u&&(t.month=Math.min(i,t.month),t.month===i&&(t.day=Math.min(a,t.day)))}if(1===t.year&&e>=0){var s=l(xe[e],3),c=s[1],f=s[2];t.month=Math.max(c,t.month),t.month===c&&(t.day=Math.max(f,t.day))}}},{key:"getEras",value:function(){return ke}},{key:"getYearsInEra",value:function(t){var e=ke.indexOf(t.era),n=xe[e],r=xe[e+1];if(null==r)return 9999-n[0]+1;var o=r[0]-n[0];return(t.month<r[1]||t.month===r[1]&&t.day<r[2])&&o++,o}},{key:"getDaysInMonth",value:function(t){return o(i(u.prototype),"getDaysInMonth",this).call(this,it(t))}},{key:"getMinimumMonthInYear",value:function(t){var e=at(t);return e?e[1]:1}},{key:"getMinimumDayInMonth",value:function(t){var e=at(t);return e&&t.month===e[1]?e[2]:1}}]),u}(Zt),_e=[0,31,62,93,124,155,186,216,246,276,306,336],Te=function(){function t(){e(this,t),this.identifier="persian"}return r(t,[{key:"fromJulianDay",value:function(t){var e=t-1948320,n=1+Math.floor((33*e+3)/12053),r=e-(365*(n-1)+Math.floor((8*n+21)/33)),o=r<216?Math.floor(r/31):Math.floor((r-6)/30);return new ee(this,n,o+1,r-_e[o]+1)}},{key:"toJulianDay",value:function(t){var e=1948319+365*(t.year-1)+Math.floor((8*t.year+21)/33);return(e+=_e[t.month-1])+t.day}},{key:"getMonthsInYear",value:function(){return 12}},{key:"getDaysInMonth",value:function(t){return t.month<=6?31:t.month<=11||j(25*t.year+11,33)<8?30:29}},{key:"getEras",value:function(){return["AP"]}},{key:"getYearsInEra",value:function(){return 9377}}]),t}(),Ce=1911,Ie=function(t){a(u,t);var n=d(u);function u(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var i;return e(this,u),(i=n.call.apply(n,[this].concat(f(r)))).identifier="roc",s(i)}return r(u,[{key:"fromJulianDay",value:function(t){var e=o(i(u.prototype),"fromJulianDay",this).call(this,t),n=_(e.era,e.year),r=l(st(n),2),a=r[0],s=r[1];return new ee(this,a,s,e.month,e.day)}},{key:"toJulianDay",value:function(t){return o(i(u.prototype),"toJulianDay",this).call(this,ct(t))}},{key:"getEras",value:function(){return["before_minguo","minguo"]}},{key:"balanceDate",value:function(t){var e=l(st(ut(t)),2),n=e[0],r=e[1];t.era=n,t.year=r}},{key:"isInverseEra",value:function(t){return"before_minguo"===t.era}},{key:"getDaysInMonth",value:function(t){return o(i(u.prototype),"getDaysInMonth",this).call(this,ct(t))}},{key:"getYearsInEra",value:function(t){return"before_minguo"===t.era?9999:9999-Ce}}]),u}(Zt),Me=h(688),De=h(14),Ne=h.n(De),Re=h(332),Le=h.n(Re);Me.default.extend(Ne()),Me.default.extend(Le());var Ue="YYYY-MM-DDTHH:mm:ss.SSSZZ",Be={mode:"standard",time:"for today",day:!0,month:!0,year:!0,noToday:!1},Fe=new WeakMap,Ve=new(function(){function t(){var e,n;!function(t,e){if(!u(t,e))throw new TypeError("Cannot call a class as a function")}(this,t),e=Fe,n={writable:!0,value:new Map},function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(this,e),e.set(this,n),lt(this,Fe).set("am","ethiopic")}var e;return(e=[{key:"register",value:function(t,e){lt(this,Fe).set(t,e)}},{key:"getCalendar",value:function(t){if(Boolean(t)){if(t.calendar)return t.calendar;if(t.region){var e="".concat(t.language,"-").concat(t.region);if(lt(this,Fe).has(e))return lt(this,Fe).get(e)}if(t.language&&lt(this,Fe).has(t.language))return lt(this,Fe).get(t.language);var n=new Intl.DateTimeFormat(t.toString()).resolvedOptions().calendar;return lt(this,Fe).set("".concat(t.language).concat(t.region?"-".concat(t.region):""),n),n}}}])&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(t.prototype,e),t}()),ze=function(t){return function(e,n,r){return"literal"!==e.type||" "!==e.value||n<r.length-1&&"era"===r[n+1].type?e:{type:"literal",value:t}}};function He(t){var e,n={},r=!0,o=!1,i=void 0;try{for(var a,u=Object.keys(t)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=a.value;if(t[s].hasOwnProperty("_default"))n[s]=t[s]._default;else{if(s.startsWith("_"))continue;(e=t[s])&&e.constructor===Object?n[s]=He(t[s]):n[s]=t[s]}}}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}var We=h(249);function Ge(){return Ge=Gt((function(t){var e,n,r,o,i,a,u,s=arguments;return Kt(this,(function(c){switch(c.label){case 0:n=(e=s.length>1&&void 0!==s[1]?s[1]:{}).shouldRetry,r=e.getDelay,o=e.onError,n=null!=n?n:function(t){return function(t){return t<=5}(t)},r=null!=r?r:function(t){return function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2]?t+1:t;return e*Math.pow(2,n)}(t,1e3)},i=0,a=void 0,c.label=1;case 1:return c.trys.push([1,4,,5]),[4,qt(r(i))];case 2:return c.sent(),[4,t()];case 3:return[2,c.sent()];case 4:return u=c.sent(),null==o||o(u,i),a=u,[3,5];case 5:if(n(i++))return[3,1];c.label=6;case 6:throw a}}))})),Ge.apply(this,arguments)}function Ke(){return(Ke=Gt((function(t){return Kt(this,(function(e){return t<=0?[2]:[2,new Promise((function(e){return setTimeout(e,t)}))]}))}))).apply(this,arguments)}}(),v}())}}}))},6488:(t,e,n)=>{"use strict";function r(t){if(Array.isArray(t))return t}n.d(e,{A:()=>r})},5152:(t,e,n)=>{"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.d(e,{A:()=>r})},4586:(t,e,n)=>{"use strict";n.d(e,{A:()=>o});var r=n(8515);function o(t,e,n){return(e=(0,r.A)(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},5405:(t,e,n)=>{"use strict";function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}n.d(e,{A:()=>r})},2296:(t,e,n)=>{"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function o(t,e){if(t){if("string"==typeof t)return r(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}n.d(e,{A:()=>o})}}]);