@kenyaemr/esm-shr-app 5.1.1-pre.122
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/.turbo/turbo-build.log +45 -0
- package/LICENSE.md +401 -0
- package/README.md +5 -0
- package/dist/130.js +2 -0
- package/dist/130.js.LICENSE.txt +5 -0
- package/dist/130.js.map +1 -0
- package/dist/336.js +1 -0
- package/dist/336.js.map +1 -0
- package/dist/44.js +1 -0
- package/dist/44.js.map +1 -0
- package/dist/47.js +1 -0
- package/dist/47.js.map +1 -0
- package/dist/574.js +1 -0
- package/dist/588.js +1 -0
- package/dist/588.js.map +1 -0
- package/dist/591.js +2 -0
- package/dist/591.js.LICENSE.txt +32 -0
- package/dist/591.js.map +1 -0
- package/dist/625.js +2 -0
- package/dist/625.js.LICENSE.txt +35 -0
- package/dist/625.js.map +1 -0
- package/dist/784.js +2 -0
- package/dist/784.js.LICENSE.txt +9 -0
- package/dist/784.js.map +1 -0
- package/dist/964.js +1 -0
- package/dist/964.js.map +1 -0
- package/dist/kenyaemr-esm-shr-app.js +1 -0
- package/dist/kenyaemr-esm-shr-app.js.buildmanifest.json +335 -0
- package/dist/kenyaemr-esm-shr-app.js.map +1 -0
- package/dist/main.js +2 -0
- package/dist/main.js.LICENSE.txt +35 -0
- package/dist/main.js.map +1 -0
- package/dist/routes.json +1 -0
- package/package.json +52 -0
- package/src/config-schema.ts +1 -0
- package/src/dashboard.meta.ts +6 -0
- package/src/declarations.d.tsx +2 -0
- package/src/hooks/useSHRSummary.ts +14 -0
- package/src/index.ts +24 -0
- package/src/print-layout/print.component.tsx +16 -0
- package/src/print-layout/print.scss +10 -0
- package/src/routes.json +30 -0
- package/src/shrpatient-summary/root.scss +81 -0
- package/src/shrpatient-summary/shr-summary.scss +168 -0
- package/src/shrpatient-summary/shrDataTable.component.tsx +63 -0
- package/src/shrpatient-summary/shrpatient-summary.component.tsx +176 -0
- package/src/shrpatient-summary/visit-detail-overview.scss +193 -0
- package/src/types/index.ts +173 -0
- package/translations/en.json +1 -0
- package/tsconfig.json +5 -0
- package/webpack.config.js +4 -0
package/dist/130.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 130.js.LICENSE.txt */
|
|
2
|
+
(globalThis.webpackChunk_kenyaemr_esm_shr_app=globalThis.webpackChunk_kenyaemr_esm_shr_app||[]).push([[130],{3098:(e,t,n)=>{function r(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var o=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};System.register(["@openmrs/esm-config","@openmrs/esm-error-handling","@openmrs/esm-offline"],(function(e,t){var i={},a={},u={};return{setters:[function(e){i.Type=e.Type,i.defineConfigSchema=e.defineConfigSchema,i.getConfig=e.getConfig,i.navigate=e.navigate,i.validators=e.validators},function(e){a.reportError=e.reportError},function(e){u.getSynchronizationItems=e.getSynchronizationItems}],execute:function(){e(function(){var e={385:function(){System.register([],(function(e,t){return{execute:function(){e(function(){"use strict";var e=function(e,t){var n=u[e];if(n)return n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value.setState(t,!0),n.active=!0,n.value;var r=a()((function(){return t}));return u[e]={value:r,active:!0},r},t=function(e,t){var n=u[e];if(!n){var r=a()((function(){return null!=t?t:{}}));return u[e]={value:r,active:!1},r}return n.value},n=function(e,t,n){var r=t(e.getState());return e.subscribe((function(e){var o=t(e);o!==r&&(r=o,n(o))}))},r={d:function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};r.r(o),r.d(o,{createGlobalStore:function(){return e},getGlobalStore:function(){return t},subscribeTo:function(){return n}});var i=function(e){var t,n=new Set,r=function(e,r){var o="function"==typeof e?e(t):e;if(!Object.is(o,t)){var i=t;t=(null!=r?r:"object"!=typeof o)?o:Object.assign({},t,o),n.forEach((function(e){return e(t,i)}))}},o=function(){return t},i={setState:r,getState:o,subscribe:function(e){return n.add(e),function(){return n.delete(e)}},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 t=e(r,o,i),i},a=function(e){return e?i(e):i},u={};return setTimeout((function(){"development"===window.spaEnv&&(window.stores=u)}),1e3),o}())}}}))},824:function(e){"use strict";e.exports=i},254:function(e){"use strict";e.exports=a},738:function(e){"use strict";e.exports=u}},t={};function c(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,c),o.exports}c.d=function(e,t){for(var n in t)c.o(t,n)&&!c.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};return function(){"use strict";var e=function(e,t){function n(){this.constructor=e}W(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},t=function(e){return"function"==typeof e},i=function(e){setTimeout((function(){throw e}),0)},a=function(e){return e.reduce((function(e,t){return e.concat(r(t,Q)?t.errors:t)}),[])},u=function(e){return e},l=function(e){if(e||(e=Z.Promise||Promise),!e)throw new Error("no Promise impl found");return e},f=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},d=function(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)},p=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},h=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(e){return!1}},y=function(e){return e&&e.startsWith("http")?e:("/"!==e[0]&&(e="/"+e),window.openmrsBase+e)},v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof e)throw Error("The first argument to @openmrs/api's openmrsFetch function must be a url string");if("object"!=typeof t)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=y(e);if(t.headers||(t.headers={}),Se(t.body)&&(t.body=JSON.stringify(t.body)),void 0===t.headers.Accept&&(t.headers.Accept="application/json"),null===t.headers.Accept&&delete t.headers.Accept,e.startsWith(Pe)&&void 0===t.headers["Disable-WWW-Authenticate"]&&(t.headers["Disable-WWW-Authenticate"]="true"),e.startsWith(ke)){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,t).then((o=function(e){var t,r;return function(e,t){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=t.call(e,a)}catch(e){i=[6,e],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(t=e).ok?204===t.status?(t.data=null,[2,t]):[2,t.clone().text().then((function(e){try{e&&(t.data=JSON.parse(e))}catch(e){}return t}))]:[3,1];case 1:return[4,(0,Oe.getConfig)("@openmrs/esm-api")];case 2:return r=o.sent().redirectAuthFailure,n===y(Ce)&&403===t.status||r.enabled&&r.errors.includes(t.status)?((0,Oe.navigate)({to:r.url}),[2,r.resolvePromise?Promise.resolve():new Promise((function(){}))]):[2,t.clone().text().then((function(e){var r=e;try{r=JSON.parse(e)}catch(e){}throw new Ae(n,t,r,a)}),(function(e){throw new Ae(n,t,null,a)}))];case 3:return[2]}}))},i=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=o.apply(e,t);function a(e){d(i,n,r,a,u,"next",e)}function u(e){d(i,n,r,a,u,"throw",e)}a(void 0)}))},function(e){return i.apply(this,arguments)}))},b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"!=typeof t)throw Error("The second argument to openmrsObservableFetch must be either omitted or an object");var n=new AbortController;return t.signal=n.signal,new ie((function(r){var o=!1;return v(e,t).then((function(e){o=!0,r.next(e),r.complete()}),(function(e){o=!0,r.error(e)})),function(){o||n.abort()}}))},m=function(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)},g=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{includeAuthStatus:!0};return(Re<Date.now()-6e4||!Me.getState().loaded)&&S(),new ie((function(t){var n=function(n){var r;n.loaded&&(e.includeAuthStatus?t.next(n.session):t.next(null===(r=n.session)||void 0===r?void 0:r.user))};return n(Me.getState()),Me.subscribe(n)}))},w=function(){return(Re<Date.now()-6e4||!Me.getState().loaded)&&S(),Me},S=function(){return new Promise((function(e,t){Re=Date.now(),v(Ce).then((function(n){if("object"!=typeof(null==n?void 0:n.data))return t(),Promise.reject();var r,o,i,a,u,c;u=null!==(a=null==(r=n.data)||null===(o=r.user)||void 0===o||null===(i=o.userProperties)||void 0===i?void 0:i.defaultLocale)&&void 0!==a?a:r.locale,c=document.documentElement.getAttribute("lang"),function(e){if(void 0===e||"string"!=typeof e)return!1;try{new Intl.Locale(e)}catch(e){return!1}return!0}(u)&&u!==c&&document.documentElement.setAttribute("lang",u),e(n.data),Me.setState({loaded:!0,session:n.data})})).catch((function(e){return(0,Te.reportError)("Failed to fetch new session information: ".concat(e)),t(e),{sessionId:"",authenticated:!1}}))}))},O=function(){Me.setState({loaded:!0,session:{authenticated:!1,sessionId:""}})},_=function(e,t){return void 0===t?Boolean(e):!Boolean(e)||function(e,t){return"string"==typeof e?!De(t.privileges.find((function(t){return e===t.display}))):Array.isArray(e)?e.every((function(e){return!De(t.privileges.find((function(t){return e===t.display})))})):(De(e)||console.error('Could not understand privileges "'.concat(e,'"')),!0)}(e,t)||function(e){return!De(e.roles.find((function(e){return"System Developer"===e.display})))}(t)},E=function(){var e,t;return new Promise((function(n,r){var o=function(r){r.loaded&&r.session.user&&(e=r.session.user,n(r.session.user),t&&t())};o(Me.getState()),e||(t=Me.subscribe(o))}))},x=function(){return new Promise((function(e,t){g().subscribe((function(t){e(t.sessionLocation)}),t).unsubscribe()}))},j=function(e,t){return Ne.apply(this,arguments)},P=function(){(0,Oe.defineConfigSchema)("@openmrs/esm-api",{redirectAuthFailure:{enabled:{_type:Oe.Type.Boolean,_default:!0,_description:"Whether to redirect logged-out users to `redirectAuthFailure.url`"},url:{_type:Oe.Type.String,_default:"${openmrsSpaBase}/login",_validators:[Oe.validators.isUrl]},errors:{_type:Oe.Type.Array,_default:[401],_elements:{_type:Oe.Type.Number,_validators:[Oe.validators.inRange(100,600)]},_description:"The HTTP error codes for which users will be redirected"},resolvePromise:{_type:Oe.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."}}}),S()},k=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},C=function(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)},A=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){C(i,r,o,a,u,"next",e)}function u(e){C(i,r,o,a,u,"throw",e)}a(void 0)}))}},T=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return k(e,t);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)?k(e,t):void 0}}(e,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.")}()},I=function(e,t){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=t.call(e,a)}catch(e){i=[6,e],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])}}},D=function(e,t){return Ue.apply(this,arguments)},M=function(e){return Be.apply(this,arguments)},R=function(e){return function(t){return 0===e?ze:t.lift(new We(e))}},N=function(e,t){return function(n){if("function"!=typeof e)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new Ze(e,t))}},L=function(){return(0,Ie.getGlobalStore)("visit",Qe)},U=function(e,t){L().setState({patientUuid:e,manuallySetVisitUuid:t})},B=function(e,t,n){var r=null!=n?n:Je;return b("/ws/rest/v1/visit?patient=".concat(e,"&v=").concat(r),{signal:t.signal,method:"GET",headers:{"Content-type":"application/json"}}).pipe(R(1)).pipe(N((function(e){return e})))},F=function(e,t){return b("/ws/rest/v1/visit",{signal:t.signal,method:"POST",headers:{"Content-type":"application/json"},body:e})},V=function(e,t,n){return b("/ws/rest/v1/visit/".concat(e),{signal:n.signal,method:"POST",headers:{"Content-type":"application/json"},body:t})},K=function(e){return{uuid:e.uuid,display:e.display,name:e.name}},H=function(){return b("/ws/rest/v1/visittype").pipe(N((function(e){return e.data.results.map(K)}))).pipe(R(1))},$=function(e){return{uuid:e.uuid,display:e.display}},G=function(){return b("/ws/rest/v1/location").pipe(N((function(e){return e.data.results.map($)}))).pipe(R(1))};c.r(s),c.d(s,{OpenmrsFetchError:function(){return Ae},VisitMode:function(){return et},VisitStatus:function(){return tt},backendDependencies:function(){return rt},clearCurrentUser:function(){return O},defaultVisitCustomRepresentation:function(){return Je},fetchCurrentPatient:function(){return D},fhirBaseUrl:function(){return ke},getCurrentUser:function(){return g},getLocations:function(){return G},getLoggedInUser:function(){return E},getSessionLocation:function(){return x},getSessionStore:function(){return w},getStartedVisit:function(){return nt},getVisitStore:function(){return L},getVisitTypes:function(){return H},getVisitsForPatient:function(){return B},makeUrl:function(){return y},openmrsFetch:function(){return v},openmrsObservableFetch:function(){return b},refetchCurrentUser:function(){return S},restBaseUrl:function(){return Pe},saveVisit:function(){return F},sessionEndpoint:function(){return Ce},setCurrentVisit:function(){return U},setSessionLocation:function(){return j},setupApiModule:function(){return P},toLocationObject:function(){return $},toVisitTypeObject:function(){return K},updateVisit:function(){return V},userHasAccess:function(){return _}});var q,z,W=function(e,t){return W=Object.setPrototypeOf||r({__proto__:[]},Array)&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},W(e,t)},Y=!1,Z={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){e&&(new Error).stack,Y=e},get useDeprecatedSynchronousErrorHandling(){return Y}},X={closed:!0,next:function(e){},error:function(e){if(Z.useDeprecatedSynchronousErrorHandling)throw e;i(e)},complete:function(){}},J=Array.isArray||function(e){return e&&"number"==typeof e.length},Q=function(){var e=function(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this};return e.prototype=Object.create(Error.prototype),e}(),ee=function(){var e=function(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)};return e.prototype.unsubscribe=function(){var n;if(!this.closed){var o,i=this,u=i._parentOrParents,c=i._ctorUnsubscribe,s=i._unsubscribe,l=i._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,r(u,e))u.remove(this);else if(null!==u)for(var f=0;f<u.length;++f)u[f].remove(this);if(t(s)){c&&(this._unsubscribe=void 0);try{s.call(this)}catch(e){n=r(e,Q)?a(e.errors):[e]}}if(J(l)){f=-1;for(var d=l.length;++f<d;){var p=l[f];if(null!==(o=p)&&"object"==typeof o)try{p.unsubscribe()}catch(e){n=n||[],r(e,Q)?n=n.concat(a(e.errors)):n.push(e)}}}if(n)throw new Q(n)}},e.prototype.add=function(t){var n=t;if(!t)return e.EMPTY;switch(void 0===t?"undefined":o(t)){case"function":n=new e(t);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!r(n,e)){var i=n;(n=new e)._subscriptions=[i]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}var a=n._parentOrParents;if(null===a)n._parentOrParents=this;else if(r(a,e)){if(a===this)return n;n._parentOrParents=[a,this]}else{if(-1!==a.indexOf(this))return n;a.push(this)}var u=this._subscriptions;return null===u?this._subscriptions=[n]:u.push(n),n},e.prototype.remove=function(e){var t=this._subscriptions;if(t){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}},e.EMPTY=function(e){return e.closed=!0,e}(new e),e}(),te="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random(),ne=function(t){function n(e,o,i){var a=t.call(this)||this;switch(a.syncErrorValue=null,a.syncErrorThrown=!1,a.syncErrorThrowable=!1,a.isStopped=!1,arguments.length){case 0:a.destination=X;break;case 1:if(!e){a.destination=X;break}if("object"==typeof e){r(e,n)?(a.syncErrorThrowable=e.syncErrorThrowable,a.destination=e,e.add(a)):(a.syncErrorThrowable=!0,a.destination=new re(a,e));break}default:a.syncErrorThrowable=!0,a.destination=new re(a,e,o,i)}return a}return e(n,t),n.prototype[te]=function(){return this},n.create=function(e,t,r){var o=new n(e,t,r);return o.syncErrorThrowable=!1,o},n.prototype.next=function(e){this.isStopped||this._next(e)},n.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},n.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},n.prototype._next=function(e){this.destination.next(e)},n.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},n.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},n.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},n}(ee),re=function(n){var r=function(e,r,o,i){var a,u=n.call(this)||this;u._parentSubscriber=e;var c=u;return t(r)?a=r:r&&(a=r.next,o=r.error,i=r.complete,r!==X&&(t((c=Object.create(r)).unsubscribe)&&u.add(c.unsubscribe.bind(c)),c.unsubscribe=u.unsubscribe.bind(u))),u._context=c,u._next=a,u._error=o,u._complete=i,u};return e(r,n),r.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;Z.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},r.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,n=Z.useDeprecatedSynchronousErrorHandling;if(this._error)n&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)n?(t.syncErrorValue=e,t.syncErrorThrown=!0):i(e),this.unsubscribe();else{if(this.unsubscribe(),n)throw e;i(e)}}},r.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var n=function(){return e._complete.call(e._context)};Z.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},r.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),Z.useDeprecatedSynchronousErrorHandling)throw e;i(e)}},r.prototype.__tryOrSetError=function(e,t,n){if(!Z.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,n)}catch(t){return Z.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=t,e.syncErrorThrown=!0,!0):(i(t),!0)}return!1},r.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},r}(ne),oe="function"==typeof Symbol&&Symbol.observable||"@@observable",ie=function(){var e=function(e){this._isScalar=!1,e&&(this._subscribe=e)};return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var o=this.operator,i=function(e,t,n){if(e){if(r(e,ne))return e;if(e[te])return e[te]()}return e||t||n?new ne(e,t,n):new ne(X)}(e,t,n);if(o?i.add(o.call(i,this.source)):i.add(this.source||Z.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),Z.useDeprecatedSynchronousErrorHandling&&i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){Z.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),function(e){for(;e;){var t=e,n=t.closed,o=t.destination,i=t.isStopped;if(n||i)return!1;e=o&&r(o,ne)?o:null}return!0}(e)?e.error(t):console.warn(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=l(t))((function(t,r){var o;o=n.subscribe((function(t){try{e(t)}catch(e){r(e),o&&o.unsubscribe()}}),r,t)}))},e.prototype._subscribe=function(e){var t=this.source;return t&&t.subscribe(e)},e.prototype[oe]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?this:(0===(n=e).length?u:1===n.length?n[0]:function(e){return n.reduce((function(e,t){return t(e)}),e)})(this);var n},e.prototype.toPromise=function(e){var t=this;return new(e=l(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}(),ae="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ue="object"==typeof self&&self&&self.Object===Object&&self,ce=(ae||ue||Function("return this")()).Symbol,se=Object.prototype,le=se.hasOwnProperty,fe=se.toString,de=ce?ce.toStringTag:void 0,pe=Object.prototype.toString,he=ce?ce.toStringTag:void 0,ye=(q=Object.getPrototypeOf,z=Object,function(e){return q(z(e))}),ve=Function.prototype,be=Object.prototype,me=ve.toString,ge=be.hasOwnProperty,we=me.call(Object),Se=function(e){if(!function(e){return null!=e&&"object"==typeof e}(e)||"[object Object]"!=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":he&&he in Object(e)?function(e){var t=le.call(e,de),n=e[de];try{e[de]=void 0;var r=!0}catch(e){}var o=fe.call(e);return r&&(t?e[de]=n:delete e[de]),o}(e):function(e){return pe.call(e)}(e)}(e))return!1;var t=ye(e);if(null===t)return!0;var n=ge.call(t,"constructor")&&t.constructor;return"function"==typeof n&&r(n,n)&&me.call(n)==we},Oe=c(824);function _e(e,t,n){return _e=h()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&xe(o,n.prototype),o},_e.apply(null,arguments)}function Ee(e){return Ee=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ee(e)}function xe(e,t){return xe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},xe(e,t)}function je(e){var t="function"==typeof Map?new Map:void 0;return je=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return _e(e,arguments,Ee(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),xe(r,e)},je(e)}var Pe="/ws/rest/v1/",ke="/ws/fhir2/R4",Ce="".concat(Pe,"session"),Ae=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&xe(e,t)}(a,e);var t,n,i=(t=a,n=h(),function(){var e,r=Ee(t);if(n){var i=Ee(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!=((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":void 0===n?"undefined":o(n))&&"function"!=typeof t?f(e):t;var n}(this,e)});function a(e,t,n,o){var u;return function(e,t){if(!r(e,t))throw new TypeError("Cannot call a class as a function")}(this,a),p(f(u=i.call(this)),"response",void 0),p(f(u),"responseBody",void 0),u.message="Server responded with ".concat(t.status," (").concat(t.statusText,") for url ").concat(e,". Check err.responseBody or network tab in dev tools for more info"),o.message=u.message,u.responseBody=n,u.response=t,u.stack="Stacktrace for outgoing request:\n".concat(o.stack,"\nStacktrace for incoming response:\n").concat(u.stack),u}return a}(je(Error)),Te=c(254),Ie=c(385),De=function(e){return void 0===e},Me=(0,Ie.createGlobalStore)("session",{loaded:!1,session:null}),Re=0;function Ne(){var e;return e=function(e,t){return function(e,t){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=t.call(e,a)}catch(e){i=[6,e],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(n){switch(n.label){case 0:return[4,v(Ce,{method:"POST",body:{sessionLocation:e},headers:{"Content-Type":"application/json"},signal:t.signal})];case 1:return n.sent(),[4,S()];case 2:return n.sent(),[2]}}))},Ne=function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){m(i,r,o,a,u,"next",e)}function u(e){m(i,r,o,a,u,"throw",e)}a(void 0)}))},Ne.apply(this,arguments)}var Le=c(738);function Ue(){return Ue=A((function(e,t){var n,r,o,i,a,u=arguments;return I(this,(function(c){switch(c.label){case 0:return n=!(u.length>2&&void 0!==u[2])||u[2],e?(r=null,[4,Promise.all([v("".concat(ke,"/Patient/").concat(e),t).catch((function(e){return r=e})),n?M(e):Promise.resolve(null)])]):[3,2];case 1:if(o=T.apply(void 0,[c.sent(),2]),i=o[0],a=o[1],i.ok)return[2,i.data];if(a)return[2,a];if(r)throw r;c.label=2;case 2:return[2,null]}}))})),Ue.apply(this,arguments)}function Be(){return(Be=A((function(e){var t,n,r;return I(this,(function(o){switch(o.label){case 0:return[4,(0,Le.getSynchronizationItems)("patient-registration")];case 1:return t=o.sent(),n=t.find((function(t){return t.fhirPatient.id===e})),[2,null!==(r=null==n?void 0:n.fhirPatient)&&void 0!==r?r:null]}}))}))).apply(this,arguments)}var Fe=function(){var e=function(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this};return e.prototype=Object.create(Error.prototype),e}(),Ve=function(t){var n=function(e,n){var r=t.call(this)||this;return r.subject=e,r.subscriber=n,r.closed=!1,r};return e(n,t),n.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var n=t.indexOf(this.subscriber);-1!==n&&t.splice(n,1)}}},n}(ee),Ke=function(t){var n=function(e){var n=t.call(this,e)||this;return n.destination=e,n};return e(n,t),n}(ne),He=function(t){var n=function(){var e=t.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e};return e(n,t),n.prototype[te]=function(){return new Ke(this)},n.prototype.lift=function(e){var t=new $e(this,this);return t.operator=e,t},n.prototype.next=function(e){if(this.closed)throw new Fe;if(!this.isStopped)for(var t=this.observers,n=t.length,r=t.slice(),o=0;o<n;o++)r[o].next(e)},n.prototype.error=function(e){if(this.closed)throw new Fe;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,n=t.length,r=t.slice(),o=0;o<n;o++)r[o].error(e);this.observers.length=0},n.prototype.complete=function(){if(this.closed)throw new Fe;this.isStopped=!0;for(var e=this.observers,t=e.length,n=e.slice(),r=0;r<t;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(e){if(this.closed)throw new Fe;return t.prototype._trySubscribe.call(this,e)},n.prototype._subscribe=function(e){if(this.closed)throw new Fe;return this.hasError?(e.error(this.thrownError),ee.EMPTY):this.isStopped?(e.complete(),ee.EMPTY):(this.observers.push(e),new Ve(this,e))},n.prototype.asObservable=function(){var e=new ie;return e.source=this,e},n.create=function(e,t){return new $e(e,t)},n}(ie),$e=function(t){var n=function(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r};return e(n,t),n.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},n.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},n.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},n.prototype._subscribe=function(e){return this.source?this.source.subscribe(e):ee.EMPTY},n}(He),Ge=function(t){var n=function(e){var n=t.call(this)||this;return n._value=e,n};return e(n,t),Object.defineProperty(n.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),n.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return n&&!n.closed&&e.next(this._value),n},n.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new Fe;return this._value},n.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},n}(He),qe=function(){var e=function(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this};return e.prototype=Object.create(Error.prototype),e}(),ze=new ie((function(e){return e.complete()})),We=function(){var e=function(e){if(this.total=e,this.total<0)throw new qe};return e.prototype.call=function(e,t){return t.subscribe(new Ye(e,this.total))},e}(),Ye=function(t){var n=function(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r};return e(n,t),n.prototype._next=function(e){var t=this.total,n=++this.count;n<=t&&(this.destination.next(e),n===t&&(this.destination.complete(),this.unsubscribe()))},n}(ne),Ze=function(){var e=function(e,t){this.project=e,this.thisArg=t};return e.prototype.call=function(e,t){return t.subscribe(new Xe(e,this.project,this.thisArg))},e}(),Xe=function(t){var n=function(e,n,r){var o=t.call(this,e)||this;return o.project=n,o.count=0,o.thisArg=r||o,o};return e(n,t),n.prototype._next=function(e){var t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}this.destination.next(t)},n}(ne),Je="custom:(uuid,encounters:(uuid,encounterDatetime,form:(uuid,name),location:ref,encounterType:ref,encounterProviders:(uuid,display,provider:(uuid,display))),patient:(uuid,uuid),visitType:(uuid,name,display),attributes:(uuid,display,attributeType:(name,datatypeClassname,uuid),value),location:(uuid,name,display),startDatetime,stopDatetime)",Qe=function(){try{return JSON.parse(localStorage.getItem("openmrs:visitStoreState")||"null")}catch(e){return null}}()||{patientUuid:null,manuallySetVisitUuid:null};L().subscribe((function(e){var t;t=e,localStorage.setItem("openmrs:visitStoreState",JSON.stringify(t))}));var et,tt,nt=new Ge(null);!function(e){e.NEWVISIT="startVisit",e.EDITVISIT="editVisit",e.LOADING="loadingVisit"}(et||(et={})),function(e){e.NOTSTARTED="notStarted",e.ONGOING="ongoing"}(tt||(tt={}));var rt={"webservices.rest":"2.24.0",fhir2:"1.0.0-SNAPSHOT"}}(),s}())}}}))},5342:()=>{function e(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}System.register(["@openmrs/esm-state"],(function(t,n){var r={};return{setters:[function(e){r.createGlobalStore=e.createGlobalStore}],execute:function(){t(function(){"use strict";var t={685:function(e){e.exports=r}},n={};function o(e){var r=n[e];if(void 0!==r)return r.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,o),i.exports}o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return function(){var t=function(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")},n=function(e){return e&&e.sensitive?"":"i"},r=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},a=function(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return r(e,t);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)?r(e,t):void 0}}(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.")}()},u=function(t){return n=t.matcher,(null!=(r=RegExp)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):e(n,r))?t.matcher:"string"==typeof t.matcher?h(t.matcher):h(t.path);var n,r},c=function(e){return s([e])},s=function(e){var t=l(),n=e.map((function(e){return{matcher:u(e),settings:e}})),r=a(t).concat(a(n));y.setState(r,!0)},l=function(){return y.getState()},f=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},d=function(e,t){if(e.length>0){var n=v(e,t);if(n){for(var r=[n],o=v(e,n.settings.parent);void 0!==o;)r.push(o),o=v(e,o.settings.parent);return r.reverse()}}return[]},p=function(e){return d(l(),e)};function h(r,o,i){return e(r,RegExp)?function(e,t){if(!t)return e;var n=e.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)t.push({name:r,prefix:"",suffix:"",modifier:"",pattern:""});return e}(r,o):Array.isArray(r)?function(e,t,r){var o=e.map((function(e){return h(e,t,r).source}));return new RegExp("(?:"+o.join("|")+")",n(r))}(r,o,i):function(e,r,o){return function(e,r,o){void 0===o&&(o={});for(var i=o.strict,a=void 0!==i&&i,u=o.start,c=void 0===u||u,s=o.end,l=void 0===s||s,f=o.encode,d=void 0===f?function(e){return e}:f,p="["+t(o.endsWith||"")+"]|$",h="["+t(o.delimiter||"/#?")+"]",y=c?"^":"",v=0,b=e;v<b.length;v++){var m=b[v];if("string"==typeof m)y+=t(d(m));else{var g=t(d(m.prefix)),w=t(d(m.suffix));if(m.pattern)if(r&&r.push(m),g||w)if("+"===m.modifier||"*"===m.modifier){var S="*"===m.modifier?"?":"";y+="(?:"+g+"((?:"+m.pattern+")(?:"+w+g+"(?:"+m.pattern+"))*)"+w+")"+S}else y+="(?:"+g+"("+m.pattern+")"+w+")"+m.modifier;else y+="("+m.pattern+")"+m.modifier;else y+="(?:"+g+w+")"+m.modifier}}if(l)a||(y+=h+"?"),y+=o.endsWith?"(?="+p+")":"$";else{var O=e[e.length-1],_="string"==typeof O?h.indexOf(O[O.length-1])>-1:void 0===O;a||(y+="(?:"+h+"(?="+p+"))?"),_||(y+="(?="+h+"|"+p+")")}return new RegExp(y,n(o))}(function(e,n){void 0===n&&(n={});for(var r=function(e){for(var t=[],n=0;n<e.length;){var r=e[n];if("*"!==r&&"+"!==r&&"?"!==r)if("\\"!==r)if("{"!==r)if("}"!==r)if(":"!==r)if("("!==r)t.push({type:"CHAR",index:n,value:e[n++]});else{var o=1,i="";if("?"===e[u=n+1])throw new TypeError('Pattern cannot start with "?" at '+u);for(;u<e.length;)if("\\"!==e[u]){if(")"===e[u]){if(0==--o){u++;break}}else if("("===e[u]&&(o++,"?"!==e[u+1]))throw new TypeError("Capturing groups are not allowed at "+u);i+=e[u++]}else i+=e[u++]+e[u++];if(o)throw new TypeError("Unbalanced pattern at "+n);if(!i)throw new TypeError("Missing pattern at "+n);t.push({type:"PATTERN",index:n,value:i}),n=u}else{for(var a="",u=n+1;u<e.length;){var c=e.charCodeAt(u);if(!(c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||95===c))break;a+=e[u++]}if(!a)throw new TypeError("Missing parameter name at "+n);t.push({type:"NAME",index:n,value:a}),n=u}else t.push({type:"CLOSE",index:n,value:e[n++]});else t.push({type:"OPEN",index:n,value:e[n++]});else t.push({type:"ESCAPED_CHAR",index:n++,value:e[n++]});else t.push({type:"MODIFIER",index:n,value:e[n++]})}return t.push({type:"END",index:n,value:""}),t}(e),o=n.prefixes,i=void 0===o?"./":o,a="[^"+t(n.delimiter||"/#?")+"]+?",u=[],c=0,s=0,l="",f=function(e){if(s<r.length&&r[s].type===e)return r[s++].value},d=function(e){var t=f(e);if(void 0!==t)return t;var n=r[s],o=n.type,i=n.index;throw new TypeError("Unexpected "+o+" at "+i+", expected "+e)},p=function(){for(var e,t="";e=f("CHAR")||f("ESCAPED_CHAR");)t+=e;return t};s<r.length;){var h=f("CHAR"),y=f("NAME"),v=f("PATTERN");if(y||v){var b=h||"";-1===i.indexOf(b)&&(l+=b,b=""),l&&(u.push(l),l=""),u.push({name:y||c++,prefix:b,suffix:"",pattern:v||a,modifier:f("MODIFIER")||""})}else{var m=h||f("ESCAPED_CHAR");if(m)l+=m;else if(l&&(u.push(l),l=""),f("OPEN")){b=p();var g=f("NAME")||"",w=f("PATTERN")||"",S=p();d("CLOSE"),u.push({name:g||(w?c++:""),pattern:g&&!w?a:w,prefix:b,suffix:S,modifier:f("MODIFIER")||""})}else d("END")}}return u}(e,o),r,o)}(r,o,i)}o.r(i),o.d(i,{filterBreadcrumbs:function(){return d},getBreadcrumbs:function(){return l},getBreadcrumbsFor:function(){return p},registerBreadcrumb:function(){return c},registerBreadcrumbs:function(){return s}});var y=(0,o(685).createGlobalStore)("breadcrumbs",[]);function v(e,t){if(t)return function(e,t){return(n=e.filter((function(e){return e.matcher.test(t)})),function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),1!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(n)||function(e,t){if(e){if("string"==typeof e)return f(e,1);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)?f(e,1):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.")}())[0];var n}(e,t)||function(e,t){for(var n=t.split("/");n.length>1;){n.pop();var r=v(e,n.join("/"));if(r)return r}}(e,t)}}(),i}())}}}))},9947:()=>{var e=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};System.register(["@openmrs/esm-state","single-spa"],(function(t,n){var r={},o={};return{setters:[function(e){r.createGlobalStore=e.createGlobalStore,r.getGlobalStore=e.getGlobalStore},function(e){o.navigateToUrl=e.navigateToUrl}],execute:function(){t(function(){"use strict";var t={685:function(e){e.exports=r},645:function(e){e.exports=o}},n={};function i(e){var r=n[e];if(void 0!==r)return r.exports;var o=n[e]={exports:{}};return t[e](o,o.exports,i),o.exports}i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return function(){var t=function(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]},n=function(e){return function n(r){return 0===arguments.length||t(r)?n:e.apply(this,arguments)}},r=function(e){return function r(o,i){switch(arguments.length){case 0:return r;case 1:return t(o)?r:n((function(t){return e(o,t)}));default:return t(o)&&t(i)?r:t(o)?n((function(t){return e(t,i)})):t(i)?n((function(t){return e(o,t)})):e(o,i)}}},o=function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n},u=function(e,t,n){for(var r=0,o=n.length;r<o;){if(e(t,n[r]))return!0;r+=1}return!1},c=function(e,t){return Object.prototype.hasOwnProperty.call(t,e)},s=function(e,t,n,r){var i=o(e);function a(e,t){return le(e,t,n.slice(),r.slice())}return!u((function(e,t){return!u(a,t,e)}),o(t),i)},l=function(e){return function o(i,a,u){switch(arguments.length){case 0:return o;case 1:return t(i)?o:r((function(t,n){return e(i,t,n)}));case 2:return t(i)&&t(a)?o:t(i)?r((function(t,n){return e(t,a,n)})):t(a)?r((function(t,n){return e(i,t,n)})):n((function(t){return e(i,a,t)}));default:return t(i)&&t(a)&&t(u)?o:t(i)&&t(a)?r((function(t,n){return e(t,n,u)})):t(i)&&t(u)?r((function(t,n){return e(t,a,n)})):t(a)&&t(u)?r((function(t,n){return e(i,t,n)})):t(i)?n((function(t){return e(t,a,u)})):t(a)?n((function(t){return e(i,t,u)})):t(u)?n((function(t){return e(i,a,t)})):e(i,a,u)}}},f=function(e){return"[object Object]"===Object.prototype.toString.call(e)},d=function(e,t,n){for(var r=n.next();!r.done;){if((t=e["@@transducer/step"](t,r.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}r=n.next()}return e["@@transducer/result"](t)},p=function(e,t,n,r){return e["@@transducer/result"](n[r](_e(e["@@transducer/step"],e),t))},h=function(e,t){return function(n){if(!e(n))return"function"==typeof t?t(n):t}},y=function(e){return(0,Ie.getGlobalStore)("config-module-".concat(e),{config:null,loaded:!1})},v=function(){return(0,Ie.getGlobalStore)("config-extension-slots",{slots:{}})},b=function(e){return m(v().getState(),e)},m=function(e,t){var n=e.slots[t];return null!=n?n:{loaded:!1,config:{}}},g=function(){return(0,Ie.getGlobalStore)("config-extensions",{configs:{}})},w=function(e,t){var n=Object.assign({},S(g().getState(),e,t));return n.config=ye(["Display conditions","Translation overrides"],n.config),n},S=function(e,t,n){var r,o=null===(r=e.configs[t])||void 0===r?void 0:r[n];return null!=o?o:{loaded:!1,config:null}},O=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},_=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},E=function(e){for(var t=arguments,n=function(n){var r=null!=t[n]?t[n]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),o.forEach((function(t){_(e,t,r[t])}))},r=1;r<arguments.length;r++)n(r);return e},x=function(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e},j=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||k(e,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.")}()},P=function(e){return function(e){if(Array.isArray(e))return O(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||k(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.")}()},k=function(e,t){if(e){if("string"==typeof e)return O(e,t);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)?O(e,t):void 0}},C=function(e,t){var n=!0,r=!1,o=void 0;try{for(var i,a=Object.keys(e.schemas)[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var u=i.value,c=K(u,e,t);y(u).setState({loaded:!0,config:c})}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}},A=function(e,t){var n,r,o=(n=$(V(e,t)),function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=Object.entries(e)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=j(o.value,2),u=a[0],c=a[1],s=!0,l=!1,f=void 0;try{for(var d,p=Object.entries(c)[Symbol.iterator]();!(s=(d=p.next()).done);s=!0){var h=j(d.value,2),y=h[0];F(h[1],u,y)}}catch(e){l=!0,f=e}finally{try{s||null==p.return||p.return()}finally{if(l)throw f}}}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}}(r=Object.keys(n).reduce((function(e,t){var r,o;return(null===(r=n[t])||void 0===r?void 0:r.extensionSlots)&&(e[t]=null===(o=n[t])||void 0===o?void 0:o.extensionSlots),e}),{})),Object.keys(r).reduce((function(e,t){return E({},e,r[t])}),{})),i=Object.fromEntries(Object.entries(o).map((function(e){var t=j(e,2);return[t[0],{loaded:!0,config:t[1]}]}))),a=v(),u=a.getState(),c={slots:E({},u.slots,i)};fe(u,c)||a.setState(c)},T=function(e,t){var n=function(e,t){var n=Le(me(e.schemas)),r=P(e.providedConfigs.map((function(e){return[e.config,e.source]}))).concat([[t.config,"temporary config"]]),o=!0,i=!1,a=void 0;try{for(var u,c=r[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){var s=j(u.value,2);n=$([n,Ue(s[0],s[1])])}}catch(e){i=!0,a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t);Ne.setState({config:n})},I=function(e,t,n){var r={},o=!0,i=!1,a=void 0;try{for(var u,c=t.mountedExtensions[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){var s=u.value,l=B(s.slotModuleName,s.extensionModuleName,s.slotName,s.extensionId,e,n);r[s.slotName]=x(E({},r[s.slotName]),_({},s.extensionId,{config:l,loaded:!0}))}}catch(e){i=!0,a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}g().setState({configs:r})},D=function(e,t){Be(e,t);var n=he(t,He),r=De.getState();De.setState({schemas:x(E({},r.schemas),_({},e,n))})},M=function(e,t){Be(e,t);var n=he(t,He),r=De.getState();r.schemas[e]&&console.warn("Config schema for extension ".concat(e," already exists. If there are multiple extensions with this same name, one will probably crash.")),De.setState({schemas:x(E({},r.schemas),_({},e,n))})},R=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"provided",n=De.getState();De.setState({providedConfigs:P(n.providedConfigs).concat([{source:t,config:e}])})},N=function(e){return new Promise((function(t){var n=function(e){if(e.loaded&&e.config){var n=ye(["Display conditions","Translation overrides"],e.config);t(n),o&&o()}},r=y(e);n(r.getState());var o=r.subscribe(n)}))},L=function(e){return new Promise((function(t){var n=function(e){if(e.loaded&&e.config){var n=e.config;t(n),o&&o()}},r=y(e);n(r.getState());var o=r.subscribe(n)}))},U=function(e,t,n){G(e,t,n);var r=Ke(e,t);return Ve(e,r,n),r},B=function(e,t,n,r,o,i){var a,u,c,s,l=function(e){return j(e.split("#"),1)[0]}(r),f=o.schemas[l],d=f?l:t,p=V(o,i),h=H(e,p),y=null!==(s=null==h||null===(a=h.extensionSlots)||void 0===a||null===(u=a[n])||void 0===u||null===(c=u.configure)||void 0===c?void 0:c[r])&&void 0!==s?s:{},v=$([H(d,p),y]),b=null!=f?f:o.schemas[t];G(b,v,d);var m=Ke(b,v);return Ve(b,m,d),delete m.extensionSlots,m},F=function(e,t,n){var r="Extension slot config '".concat(t,".extensionSlots.").concat(n),o=Object.keys(e).filter((function(e){return!["add","remove","order","configure"].includes(e)}));o.length&&console.error(r+"' contains invalid keys '".concat(o.join("', '"),"'")),e.add&&(Array.isArray(e.add)&&e.add.every((function(e){return"string"==typeof e}))||console.error(r+".add' is invalid. Must be an array of strings (extension IDs)")),e.remove&&(Array.isArray(e.remove)&&e.remove.every((function(e){return"string"==typeof e}))||console.error(r+".remove' is invalid. Must be an array of strings (extension IDs)")),e.order&&(Array.isArray(e.order)&&e.order.every((function(e){return"string"==typeof e}))||console.error(r+".order' is invalid. Must be an array of strings (extension IDs)")),e.configure&&(Y(e.configure)||console.error(r+".configure' is invalid. Must be an object with extension IDs for keys"))},V=function(e,t){return P(e.providedConfigs.map((function(e){return e.config}))).concat([t.config])},K=function(e,t,n){if(!t.schemas.hasOwnProperty(e))throw Error("No config schema has been defined for "+e);var r=t.schemas[e],o=H(e,V(t,n));G(r,o,e);var i=Ke(r,o);return Ve(r,i,e),delete i.extensionSlots,i},H=function(e,t){return $(t.map((function(t){return t[e]})).filter((function(e){return!!e})))},$=function(e){return xe(he)({},e)},G=function(e,t){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(t)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var c=a.value,s=t[c],l=n+"."+c,f=e[c];e.hasOwnProperty(c)?Fe(f,s,l):"extensionSlots"===c&&""!==n||console.error("Unknown config key '".concat(l,"' provided. Ignoring."))}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}},q=function(e,t,n){t&&z(e,[{Array:je,Boolean:Pe,ConceptUuid:Te,Number:ke,Object:Ae,String:Ce,UUID:Te,PersonAttributeTypeUuid:Te,PatientIdentifierTypeUuid:Te}[t]],n)},z=function(e,t,n){if(t)try{var r=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var c=(0,a.value)(n);"string"==typeof c&&("object"==typeof n?console.error("Invalid configuration for ".concat(e,": ").concat(c)):console.error("Invalid configuration value ".concat(n," for ").concat(e,": ").concat(c)))}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}catch(t){console.error('Skipping invalid validator at "'.concat(e,'". Encountered error\n\t').concat(t))}},W=function(e){return!!e&&Object.keys(e).filter((function(e){return!["_default","_validators"].includes(e)})).length>0},Y=function(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e},Z=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},X=function(e,t){var n=window.getOpenmrsSpaBase().replace(/\/$/,"");return J(e,function(e){for(var t=arguments,n=function(n){var r=null!=t[n]?t[n]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),o.forEach((function(t){Z(e,t,r[t])}))},r=1;r<arguments.length;r++)n(r);return e}({openmrsBase:window.openmrsBase,openmrsSpaBase:n},t)).replace(/^\/\//,"/")},J=function(e,t){return Object.keys(t).reduce((function(e,n){return e.split("${"+n+"}").join(t[n])}),e)},Q=function(e){var t=e.to,n=e.templateParams,r=window.getOpenmrsSpaBase().replace(/\/$/,""),o=X(t,n);o.startsWith(r)?(0,$e.navigateToUrl)(o):window.location.assign(o)};i.r(a),i.d(a,{Type:function(){return be},configExtensionStore:function(){return Re},configInternalStore:function(){return De},defineConfigSchema:function(){return D},defineExtensionConfigSchema:function(){return M},getConfig:function(){return N},getConfigInternal:function(){return L},getConfigStore:function(){return y},getExtensionConfig:function(){return w},getExtensionConfigFromStore:function(){return S},getExtensionSlotConfig:function(){return b},getExtensionSlotConfigFromStore:function(){return m},getExtensionSlotsConfigStore:function(){return v},getExtensionsConfigStore:function(){return g},implementerToolsConfigStore:function(){return Ne},inRange:function(){return Ge},interpolateString:function(){return J},interpolateUrl:function(){return X},isUrl:function(){return ze},isUrlWithTemplateParameters:function(){return qe},navigate:function(){return Q},oneOf:function(){return We},processConfig:function(){return U},provide:function(){return R},temporaryConfigStore:function(){return Me},validator:function(){return h},validators:function(){return Ye}});var ee="function"==typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},te=Object.prototype.toString,ne=function(){return"[object Arguments]"===te.call(arguments)?function(e){return"[object Arguments]"===te.call(e)}:function(e){return c("callee",e)}}(),re=ne,oe=!{toString:null}.propertyIsEnumerable("toString"),ie=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],ae=function(){return arguments.propertyIsEnumerable("length")}(),ue=function(e,t){for(var n=0;n<e.length;){if(e[n]===t)return!0;n+=1}return!1},ce="function"!=typeof Object.keys||ae?n((function(e){if(Object(e)!==e)return[];var t,n,r=[],o=ae&&re(e);for(t in e)!c(t,e)||o&&"length"===t||(r[r.length]=t);if(oe)for(n=ie.length-1;n>=0;)c(t=ie[n],e)&&!ue(r,t)&&(r[r.length]=t),n-=1;return r})):n((function(e){return Object(e)!==e?[]:Object.keys(e)})),se=n((function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}));function le(t,n,r,o){if(ee(t,n))return!0;var i,a,u=se(t);if(u!==se(n))return!1;if(null==t||null==n)return!1;if("function"==typeof t["fantasy-land/equals"]||"function"==typeof n["fantasy-land/equals"])return"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](n)&&"function"==typeof n["fantasy-land/equals"]&&n["fantasy-land/equals"](t);if("function"==typeof t.equals||"function"==typeof n.equals)return"function"==typeof t.equals&&t.equals(n)&&"function"==typeof n.equals&&n.equals(t);switch(u){case"Arguments":case"Array":case"Object":if("function"==typeof t.constructor&&"Promise"===(i=t.constructor,null==(a=String(i).match(/^function (\w*)/))?"":a[1]))return t===n;break;case"Boolean":case"Number":case"String":if((void 0===t?"undefined":e(t))!=(void 0===n?"undefined":e(n))||!ee(t.valueOf(),n.valueOf()))return!1;break;case"Date":if(!ee(t.valueOf(),n.valueOf()))return!1;break;case"Error":return t.name===n.name&&t.message===n.message;case"RegExp":if(t.source!==n.source||t.global!==n.global||t.ignoreCase!==n.ignoreCase||t.multiline!==n.multiline||t.sticky!==n.sticky||t.unicode!==n.unicode)return!1}for(var l=r.length-1;l>=0;){if(r[l]===t)return o[l]===n;l-=1}switch(u){case"Map":return t.size===n.size&&s(t.entries(),n.entries(),r.concat([t]),o.concat([n]));case"Set":return t.size===n.size&&s(t.values(),n.values(),r.concat([t]),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=ce(t);if(f.length!==ce(n).length)return!1;var d=r.concat([t]),p=o.concat([n]);for(l=f.length-1;l>=0;){var h=f[l];if(!c(h,n)||!le(n[h],t[h],d,p))return!1;l-=1}return!0}var fe=r((function(e,t){return le(e,t,[],[])})),de=l((function(e,t,n){var r,o={};for(r in t)c(r,t)&&(o[r]=c(r,n)?e(r,t[r],n[r]):t[r]);for(r in n)c(r,n)&&!c(r,o)&&(o[r]=n[r]);return o})),pe=l((function e(t,n,r){return de((function(n,r,o){return f(r)&&f(o)?e(t,r,o):t(n,r,o)}),n,r)})),he=r((function(e,t){return pe((function(e,t,n){return n}),e,t)})),ye=r((function(e,t){for(var n={},r={},o=0,i=e.length;o<i;)r[e[o]]=1,o+=1;for(var a in t)r.hasOwnProperty(a)||(n[a]=t[a]);return n}));function ve(e,t,n,r){var o,i=function(o){for(var i=t.length,a=0;a<i;){if(e===t[a])return n[a];a+=1}for(var u in t[a+1]=e,n[a+1]=o,e)o[u]=r?ve(e[u],t,n,!0):e[u];return o};switch(se(e)){case"Object":return i({});case"Array":return i([]);case"Date":return new Date(e.valueOf());case"RegExp":return o=e,new RegExp(o.source,(o.global?"g":"")+(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.sticky?"y":"")+(o.unicode?"u":""));default:return e}}var be,me=n((function(e){return null!=e&&"function"==typeof e.clone?e.clone():ve(e,[],[],!0)})),ge=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)},we=n((function(e){return!!ge(e)||!!e&&"object"==typeof e&&!function(e){return"[object String]"===Object.prototype.toString.call(e)}(e)&&(1===e.nodeType?!!e.length:0===e.length||e.length>0&&e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1))})),Se=function(){var e=function(e){this.f=e};return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(e){return e},e.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},e}(),Oe=r((function(e,t){return function(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,n){return t.apply(this,arguments)};case 3:return function(e,n,r){return t.apply(this,arguments)};case 4:return function(e,n,r,o){return t.apply(this,arguments)};case 5:return function(e,n,r,o,i){return t.apply(this,arguments)};case 6:return function(e,n,r,o,i,a){return t.apply(this,arguments)};case 7:return function(e,n,r,o,i,a,u){return t.apply(this,arguments)};case 8:return function(e,n,r,o,i,a,u,c){return t.apply(this,arguments)};case 9:return function(e,n,r,o,i,a,u,c,s){return t.apply(this,arguments)};case 10:return function(e,n,r,o,i,a,u,c,s,l){return t.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}(e.length,(function(){return e.apply(t,arguments)}))})),_e=Oe,Ee="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",xe=l((function(e,t,n){if("function"==typeof e&&(e=function(e){return new Se(e)}(e)),we(n))return function(e,t,n){for(var r=0,o=n.length;r<o;){if((t=e["@@transducer/step"](t,n[r]))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}r+=1}return e["@@transducer/result"](t)}(e,t,n);if("function"==typeof n["fantasy-land/reduce"])return p(e,t,n,"fantasy-land/reduce");if(null!=n[Ee])return d(e,t,n[Ee]());if("function"==typeof n.next)return d(e,t,n);if("function"==typeof n.reduce)return p(e,t,n,"reduce");throw new TypeError("reduce: list must be array or iterable")}));!function(e){e.Array="Array",e.Boolean="Boolean",e.ConceptUuid="ConceptUuid",e.Number="Number",e.Object="Object",e.String="String",e.UUID="UUID",e.PersonAttributeTypeUuid="PersonAttributeTypeUuid",e.PatientIdentifierTypeUuid="PatientIdentifierTypeUuid"}(be||(be={}));var je=h((function(e){return Array.isArray(e)}),"must be an array"),Pe=h((function(e){return"boolean"==typeof e}),"must be a boolean"),ke=h((function(e){return"number"==typeof e}),"must be a number"),Ce=h((function(e){return"string"==typeof e}),"must be a string"),Ae=h((function(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}),"must be an object (not an array or null)"),Te=h((function(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)||/^[0-9a-f]{36}$/i.test(e)}),"must be a valid UUID or a 36-character hexadecimal string"),Ie=i(685),De=(0,Ie.createGlobalStore)("config-internal",{providedConfigs:[],schemas:{}}),Me=(0,Ie.createGlobalStore)("temporary-config",{config:function(){try{return JSON.parse(localStorage.getItem("openmrs:temporaryConfig")||"{}")}catch(e){return{}}}()});Me.subscribe((function(e){var t;t=e.config,localStorage.setItem("openmrs:temporaryConfig",JSON.stringify(t))}));var Re=(0,Ie.createGlobalStore)("config-store-of-extension-state",{mountedExtensions:[]}),Ne=(0,Ie.createGlobalStore)("config-implementer-tools",{config:{}});function Le(e){return e.hasOwnProperty("_default")?x(E({},e),{_value:e._default,_source:"default"}):Y(e)?Object.keys(e).reduce((function(t,n){return t[n]=Le(e[n]),t}),{}):{}}function Ue(e,t){return Y(e)?Object.keys(e).reduce((function(n,r){return n[r]=Ue(e[r],t),n}),{}):{_value:e,_source:t}}function Be(e,t){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,c=function(){var o=u.value,i=n+(n&&".")+o,a=t[o];if("Display conditions"===i&&console.error("".concat(e,' declares a configuration option called "Display conditions"; the "Display conditions" option is a reserved name. ').concat(r)),"Translation overrides"===i&&console.error("".concat(e,' declares a configuration option called "Translation overrides"; the "Translation overrides" option is a reserved name. ').concat(r)),!Y(a))return console.error("".concat(e," has bad config schema definition for key '").concat(i,"'. ").concat(r)),"continue";a.hasOwnProperty("_default")||Be(e,a,i);var c=a._elements;if(W(c)&&Be(e,c,i+"._elements"),a._validators){var s=!0,l=!1,f=void 0;try{for(var d,p=a._validators[Symbol.iterator]();!(s=(d=p.next()).done);s=!0){var h=d.value;"function"!=typeof h&&console.error("".concat(e," 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(h,"."))}}catch(e){l=!0,f=e}finally{try{s||null==p.return||p.return()}finally{if(l)throw f}}}var y=a._type;y&&!Object.values(be).includes(y)&&console.error("".concat(e," has invalid type for key '").concat(i,"' ").concat(r,".")+"\n\nIf you're the maintainer: the allowed types are ".concat(Object.values(be).join(", "),". ")+"Received '".concat(y,"'")),Object.keys(a).every((function(e){return["_description","_validators","_elements","_type"].includes(e)}))&&!n.includes("._elements")&&console.error("".concat(e," 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))),c&&y&&![be.Array,be.Object].includes(y)&&console.error("".concat(e," 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(y)))},s=Object.keys(t).filter((function(e){return!e.startsWith("_")}))[Symbol.iterator]();!(o=(u=s.next()).done);o=!0)c()}catch(e){i=!0,a=e}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}}function Fe(e,t,n){q(n,e._type,t),Y(t)?e._type===be.Object?function(e,t,n){if(e._elements){var 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 c=a.value,s=t[c];G(e._elements,s,"".concat(n,".").concat(c))}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}}(e,t,n):e.hasOwnProperty("_default")||G(e,t,n):e._type===be.Array&&function(e,t,n){if(W(e._elements))for(var r=0;r<t.length;r++)Fe(e._elements,t[r],"".concat(n,"[").concat(r,"]"));for(var o=0;o<t.length;o++){var i;q("".concat(n,"[").concat(o,"]"),null===(i=e._elements)||void 0===i?void 0:i._type,t[o])}}(e,t,n)}function Ve(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(e)if(t!==e._default&&z(n,e._validators,t),Y(t)){var 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 c=a.value,s=t[c],l=n+"."+c,f=e[c];e._type===be.Object&&e._elements?Ve(e._elements,s,l):Ve(f,s,l)}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}else if(Array.isArray(t)&&e._elements)for(var d=0;d<t.length;d++)Ve(e._elements,t[d],"".concat(n,"[").concat(d,"]"))}C(De.getState(),Me.getState()),De.subscribe((function(e){return C(e,Me.getState())})),Me.subscribe((function(e){return C(De.getState(),e)})),T(De.getState(),Me.getState()),De.subscribe((function(e){return T(e,Me.getState())})),Me.subscribe((function(e){return T(De.getState(),e)})),A(De.getState(),Me.getState()),De.subscribe((function(e){return A(e,Me.getState())})),Me.subscribe((function(e){return A(De.getState(),e)})),I(De.getState(),Re.getState(),Me.getState()),De.subscribe((function(e){I(e,Re.getState(),Me.getState())})),Re.subscribe((function(e){I(De.getState(),e,Me.getState())})),Me.subscribe((function(e){I(De.getState(),Re.getState(),e)}));var Ke=function(e,t){var n=me(t);if(!e)return n;var r=!0,o=!1,i=void 0;try{for(var a,u=function(){var t=a.value,r=n[t],o=e[t];if(o&&o.hasOwnProperty("_default")){n.hasOwnProperty(t)||(n[t]=o._default);var i=o._elements;if(r&&W(i))if(o._type===be.Array&&Array.isArray(r)){var u=r.map((function(e){return Ke(i,e)}));n[t]=u}else if(o._type===be.Object){var c=!0,s=!1,l=void 0;try{for(var f,d=Object.keys(r)[Symbol.iterator]();!(c=(f=d.next()).done);c=!0){var p=f.value;r[p]=Ke(i,r[p])}}catch(e){s=!0,l=e}finally{try{c||null==d.return||d.return()}finally{if(s)throw l}}}}else if(Y(o)){var h=n.hasOwnProperty(t)?r:{};Y(h)&&(n[t]=Ke(o,h))}},c=Object.keys(e)[Symbol.iterator]();!(r=(a=c.next()).done);r=!0)u()}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n},He={"Display conditions":{privileges:{_description:"The privilege(s) the user must have to use this extension",_type:be.Array,_default:[]}},"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:be.Object,_default:{}}},$e=i(645),Ge=function(e,t){return h((function(n){return e<=n&&n<=t}),"must be between ".concat(e," and ").concat(t))},qe=function(e){var t=e.concat(["openmrsBase","openmrsSpaBase"]);return h((function(e){if(!e||"string"!=typeof e)return!1;for(var n=/\${(.*?)}/g,r=n.exec(e);r;){if(!t.includes(r[1]))return!1;r=n.exec(e)}return!0}),"Should be a URL or path. The allowed template parameters are "+t.map((function(e){return"${"+e+"}"})).join(", "))},ze=qe([]),We=function(e){return h((function(t){return e.includes(t)}),"Must be one of the following: '".concat(e.join("', '"),"'."))},Ye={inRange:Ge,isUrl:ze,isUrlWithTemplateParameters:qe,oneOf:We}}(),a}())}}}))},8461:()=>{System.register([],(function(e,t){return{execute:function(){e(function(){"use strict";var e=function(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)},t=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,c,"next",t)}function c(t){e(a,o,i,u,c,"throw",t)}u(void 0)}))}},n=function(e,t){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=t.call(e,a)}catch(e){i=[6,e],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])}}},r=function(e){return e.replace(/[\/\-@]/g,"_")},o=function(e){return s.apply(this,arguments)},i=function(e,t){return l.apply(this,arguments)},a=function(){return f.apply(this,arguments)},u={d:function(e,t){for(var n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}};!function(){u.S={};var e={},t={};u.I=function(n,r){r||(r=[]);var o=t[n];if(o||(o=t[n]={}),!(r.indexOf(o)>=0)){if(r.push(o),e[n])return e[n];u.o(u.S,n)||(u.S[n]={}),u.S[n];var i=[];return e[n]=i.length?Promise.all(i).then((function(){return e[n]=1})):1}}}();var c={};function s(){return s=t((function(e){var t,o,a,c,s,l,f,d,p=arguments;return n(this,(function(n){switch(n.label){case 0:return t=p.length>1&&void 0!==p[1]?p[1]:"./start",[4,i(e,null==(o=p.length>2?p[2]:void 0)?void 0:o.importMap)];case 1:if(n.sent(),a=r(e),"object"!=typeof(h=c=window[a])||null===h||!("init"in h)||"function"!=typeof h.init||!("get"in h)||"function"!=typeof h.get)throw s="The global variable ".concat(a," does not refer to a federated module"),console.error(s),new Error(s);return c.init(u.S.default),[4,c.get(t)];case 2:if(l=n.sent(),"object"!=typeof(f=l())||null===f)throw d="Container for ".concat(e," did not return an ESM module as expected"),console.error(d),new Error(d);return[2,f]}var h}))})),s.apply(this,arguments)}function l(){return(l=t((function(e,t){var o,i,u,c,s,l;return n(this,(function(n){switch(n.label){case 0:if("string"!=typeof e||0===e.trim().length)throw o="Attempted to call importDynamic() without supplying a package to load",console.error(o),new Error(o);return i=r(e),window[i]?[3,5]:null==t?[3,1]:(c=t,[3,3]);case 1:return[4,a()];case 2:c=n.sent(),n.label=3;case 3:if(!(u=c).imports.hasOwnProperty(e))throw s="Could not find the package ".concat(e," defined in the current importmap"),console.error(s),new Error(s);return(l=u.imports[e]).startsWith("./")&&(l=window.spaBase+l.substring(1)),[4,new Promise((function(e,t){!function(e,t,n){var r=document.head.querySelector('script[src="'.concat(e,'"]')),o=window[d];if(o||(o=window[d]=new Set([])),r)if(o.has(e)){var i=function(){null==r||r.removeEventListener("load",i),t(null)};r.addEventListener("load",i);var a=function(t){console.error("Failed to load script from ".concat(e),t),null==r||r.removeEventListener("error",a),n(t.message)};r.addEventListener("error",a)}else console.warn("Script already loaded. Not loading it again.",e),t(null);else{o.add(e);var u=document.createElement("script");u.src=e,u.type="text/javascript",u.async=!0;var c=function(){o.delete(e),u.removeEventListener("load",c),t(null)};u.addEventListener("load",c);var s=function(t){o.delete(e),console.error("Failed to load script from ".concat(e),t),u.removeEventListener("error",s),n(t.message)};u.addEventListener("error",s),document.head.appendChild(u)}}(l,e,t)}))];case 4:n.sent(),n.label=5;case 5:return[2]}}))}))).apply(this,arguments)}function f(){return(f=t((function(){return n(this,(function(e){return[2,window.importMapOverrides.getCurrentPageMap()]}))}))).apply(this,arguments)}u.r(c),u.d(c,{getCurrentImportMap:function(){return a},importDynamic:function(){return o},preloadImport:function(){return i},slugify:function(){return r}});var d=Symbol("__openmrs_script_loading");return c}())}}}))},3371:()=>{System.register(["@openmrs/esm-globals"],(function(e,t){var n={};return{setters:[function(e){n.dispatchNotificationShown=e.dispatchNotificationShown}],execute:function(){e(function(){"use strict";var e={728:function(e){e.exports=n}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return function(){var e=function(e){var t=n(e);setTimeout((function(){throw t}))},t=function(){var t=Error();return function(r){n(r).stack+="\nAsync stacktrace:\n".concat(t.stack),e(r)}},n=function(e){var t,n,r,o,i;if(n=e,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 e;if(null===e)return Error("'null' was thrown as an error");if("object"==typeof e){try{t="Object thrown as error: ".concat(JSON.stringify(e))}catch(n){t="Object thrown as error with the following properties: ".concat(Object.keys(e))}return Error(t)}return void 0===e?Error("'undefined' was thrown as an error"):Error(e.toString())};r.r(o),r.d(o,{createErrorHandler:function(){return t},reportError:function(){return e}});var i=r(728);window.onerror=function(e){return console.error("Unexpected error: ",e),(0,i.dispatchNotificationShown)({description:null!=e?e:"Oops! An unexpected error occurred.",kind:"error",title:"Error"}),!1},window.onunhandledrejection=function(e){var t;console.error("Unhandled rejection: ",e.reason),(0,i.dispatchNotificationShown)({description:null!==(t=e.reason)&&void 0!==t?t:"Oops! An unhandled promise rejection occurred.",kind:"error",title:"Error"})}}(),o}())}}}))},5450:(e,t,n)=>{function r(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}e=n.nmd(e);var o=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};System.register(["@openmrs/esm-config","@openmrs/esm-state","@openmrs/esm-api","@openmrs/esm-feature-flags","single-spa"],(function(i,a){var u={},c={},s={},l={},f={};return{setters:[function(e){u.configExtensionStore=e.configExtensionStore,u.getExtensionConfigFromStore=e.getExtensionConfigFromStore,u.getExtensionSlotConfig=e.getExtensionSlotConfig,u.getExtensionSlotConfigFromStore=e.getExtensionSlotConfigFromStore,u.getExtensionSlotsConfigStore=e.getExtensionSlotsConfigStore,u.getExtensionsConfigStore=e.getExtensionsConfigStore},function(e){c.createGlobalStore=e.createGlobalStore,c.getGlobalStore=e.getGlobalStore},function(e){s.getSessionStore=e.getSessionStore,s.userHasAccess=e.userHasAccess},function(e){l.featureFlagsStore=e.featureFlagsStore},function(e){f.mountRootParcel=e.mountRootParcel}],execute:function(){i(function(){"use strict";var i={766:function(e){e.exports=s},824:function(e){e.exports=u},708:function(e){e.exports=l},685:function(e){e.exports=c},645:function(e){e.exports=f}},a={};function d(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={exports:{}};return i[e](n,n.exports,d),n.exports}d.d=function(e,t){for(var n in t)d.o(t,n)&&!d.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},d.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},d.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var p={};return function(){var i=function(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}},a=function(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}},u=function(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}},c=function(e){var t=this.__data__=new G(e);this.size=t.size},s=function(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Oe;++t<n;)this.add(e[t])},l=function(e){var t=Rt.getState(),n=e(t);n!==t&&Rt.setState(n)},f=function(e){var t=[],n=!0,r=!1,o=void 0;try{for(var i,a=Object.values(e.extensions)[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var u=i.value,c=!0,s=!1,l=void 0;try{for(var f,d=u.instances[Symbol.iterator]();!(c=(f=d.next()).done);c=!0){var p=f.value;t.push({slotModuleName:p.slotModuleName,extensionModuleName:u.moduleName,slotName:p.slotName,extensionId:p.id})}}catch(e){s=!0,l=e}finally{try{c||null==d.return||d.return()}finally{if(s)throw l}}}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}It(Dt.configExtensionStore.getState().mountedExtensions,t)||Dt.configExtensionStore.setState({mountedExtensions:t})},h=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},y=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},v=function(e){for(var t=arguments,n=function(n){var r=null!=t[n]?t[n]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),o.forEach((function(t){y(e,t,r[t])}))},r=1;r<arguments.length;r++)n(r);return e},b=function(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e},m=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||w(e,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.")}()},g=function(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||w(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},w=function(e,t){if(e){if("string"==typeof e)return h(e,t);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)?h(e,t):void 0}},S=function(e,t,n){var r={},o=!0,i=!1,a=void 0;try{for(var u,c=Object.entries(e.slots)[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){var s=m(u.value,2),l=s[0],f=s[1],d=T(l,e,(0,Dt.getExtensionSlotConfigFromStore)(t,f.name).config,n);r[l]={moduleName:f.moduleName,assignedExtensions:d}}}catch(e){i=!0,a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}It(Kt.getState().slots,r)||Kt.setState({slots:r})},O=function(e,t){return{moduleName:t,name:e,attachedIds:[],config:null}},_=function(e){return m(e.split("#"),1)[0]},E=function(e,t){var n=_(t);return e.extensions[n]},x=function(e){return E(Vt.getState(),e)},j=function(e,t){l((function(n){var r=n.slots[e];return b(v({},n),r?{slots:b(v({},n.slots),y({},e,b(v({},r),{attachedIds:g(r.attachedIds).concat([t])})))}:{slots:b(v({},n.slots),y({},e,b(v({},O(e)),{attachedIds:[t]})))})}))},P=function(e,t){l((function(n){var r=n.slots[e];return r&&r.attachedIds.includes(t)?b(v({},n),{slots:b(v({},n.slots),y({},e,b(v({},r),{attachedIds:r.attachedIds.filter((function(e){return e!==t}))})))}):n}))},k=function(e){l((function(t){var n=t.slots[e];return n?b(v({},t),{slots:b(v({},t.slots),y({},e,b(v({},n),{attachedIds:[]})))}):t}))},C=function(e,t,n,r){var o=t.indexOf(e);if(-1!==o)return o;if(void 0!==n)return 1e3+n;var i=r.indexOf(e);return-1!==i?2e3+i:-1},A=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=null!=t?t:navigator.onLine,o=null!=n?n:Object.entries(Bt.featureFlagsStore.getState().flags).filter((function(e){return m(e,2)[1].enabled})).map((function(e){return m(e,1)[0]}));return e.filter((function(e){return M(r,e.online,e.offline)})).filter((function(e){return void 0===e.featureFlag||(null==o?void 0:o.includes(e.featureFlag))}))},T=function(e,t,n,r){var o=function(e,t){var n=e.add||[],r=e.remove||[],o=e.order||[],i=Vt.getState().extensions;return g(t).concat(g(n)).filter((function(e){return!r.includes(e)})).sort((function(e,n){var r,a,u=C(e,o,null===(r=i[_(e)])||void 0===r?void 0:r.order,t),c=C(n,o,null===(a=i[_(n)])||void 0===a?void 0:a.order,t);return-1===c?-1:-1===u?1:u-c}))}(n,t.slots[e].attachedIds),i=[],a=void 0,u=!0,c=!1,s=void 0;try{for(var l,f=o[Symbol.iterator]();!(u=(l=f.next()).done);u=!0){var d=l.value,p=(0,Dt.getExtensionConfigFromStore)(r,e,d).config,h=_(d),y=t.extensions[h];if(y){var v,b,m,w,S,O=null!==(m=null!==(b=null==p||null===(v=p["Display conditions"])||void 0===v?void 0:v.privileges)&&void 0!==b?b:y.privileges)&&void 0!==m?m:[];if(O&&("string"==typeof O||Array.isArray(O)&&O.length>0)){var E;if(Ft(a)&&(a=null===(E=(0,Ut.getSessionStore)().getState().session)||void 0===E?void 0:E.user),!a)continue;if(!(0,Ut.userHasAccess)(O,a))continue}i.push({id:d,name:h,moduleName:y.moduleName,config:p,featureFlag:y.featureFlag,meta:y.meta,online:null===(w=y.online)||void 0===w||w,offline:null!==(S=y.offline)&&void 0!==S&&S})}}}catch(e){c=!0,s=e}finally{try{u||null==f.return||f.return()}finally{if(c)throw s}}return i},I=function(e){return T(e,Vt.getState(),(0,Dt.getExtensionSlotConfig)(e).config,$t.getState())},D=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return M(navigator.onLine,e,t)},M=function(e){return Boolean(e?!(arguments.length>1&&void 0!==arguments[1])||arguments[1]:arguments.length>2&&void 0!==arguments[2]&&arguments[2])},R=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},N=function(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)},L=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},U=function(e){for(var t=arguments,n=function(n){var r=null!=t[n]?t[n]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),o.forEach((function(t){L(e,t,r[t])}))},r=1;r<arguments.length;r++)n(r);return e},B=function(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e},F=function(e,t,n,r){return Zt.apply(this,arguments)};d.r(p),d.d(p,{attach:function(){return j},checkStatus:function(){return D},checkStatusFor:function(){return M},detach:function(){return P},detachAll:function(){return k},extensionStore:function(){return Xt},getAssignedExtensions:function(){return I},getConnectedExtensions:function(){return A},getExtensionInternalStore:function(){return Nt},getExtensionNameFromId:function(){return _},getExtensionRegistration:function(){return x},getExtensionRegistrationFrom:function(){return E},getExtensionStore:function(){return Lt},registerExtension:function(){return Gt},registerExtensionSlot:function(){return qt},renderExtension:function(){return F},reset:function(){return zt},updateInternalExtensionStore:function(){return l}});var V=function(e,t){return e===t||e!=e&&t!=t},K=function(e,t){for(var n=e.length;n--;)if(V(e[n][0],t))return n;return-1},H=Array.prototype.splice;i.prototype.clear=function(){this.__data__=[],this.size=0},i.prototype.delete=function(e){var t=this.__data__,n=K(t,e);return!(n<0||(n==t.length-1?t.pop():H.call(t,n,1),--this.size,0))},i.prototype.get=function(e){var t=this.__data__,n=K(t,e);return n<0?void 0:t[n][1]},i.prototype.has=function(e){return K(this.__data__,e)>-1},i.prototype.set=function(e,t){var n=this.__data__,r=K(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var $,G=i,q="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,z="object"==typeof self&&self&&self.Object===Object&&self,W=q||z||Function("return this")(),Y=W.Symbol,Z=Object.prototype,X=Z.hasOwnProperty,J=Z.toString,Q=Y?Y.toStringTag:void 0,ee=Object.prototype.toString,te=Y?Y.toStringTag:void 0,ne=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":te&&te in Object(e)?function(e){var t=X.call(e,Q),n=e[Q];try{e[Q]=void 0;var r=!0}catch(e){}var o=J.call(e);return r&&(t?e[Q]=n:delete e[Q]),o}(e):function(e){return ee.call(e)}(e)},re=function(e){var t=void 0===e?"undefined":o(e);return null!=e&&("object"==t||"function"==t)},oe=function(e){if(!re(e))return!1;var t=ne(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},ie=W["__core-js_shared__"],ae=($=/[^.]+$/.exec(ie&&ie.keys&&ie.keys.IE_PROTO||""))?"Symbol(src)_1."+$:"",ue=Function.prototype.toString,ce=function(e){if(null!=e){try{return ue.call(e)}catch(e){}try{return e+""}catch(e){}}return""},se=/^\[object .+?Constructor\]$/,le=Function.prototype,fe=Object.prototype,de=le.toString,pe=fe.hasOwnProperty,he=RegExp("^"+de.call(pe).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ye=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!re(e)||(t=e,ae&&ae in t))&&(oe(e)?he:se).test(ce(e));var t}(n)?n:void 0},ve=ye(W,"Map"),be=ye(Object,"create"),me=Object.prototype.hasOwnProperty,ge=Object.prototype.hasOwnProperty;a.prototype.clear=function(){this.__data__=be?be(null):{},this.size=0},a.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},a.prototype.get=function(e){var t=this.__data__;if(be){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return me.call(t,e)?t[e]:void 0},a.prototype.has=function(e){var t=this.__data__;return be?void 0!==t[e]:ge.call(t,e)},a.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=be&&void 0===t?"__lodash_hash_undefined__":t,this};var we=a,Se=function(e,t){var n,r,i=e.__data__;return("string"==(r=o(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map};u.prototype.clear=function(){this.size=0,this.__data__={hash:new we,map:new(ve||G),string:new we}},u.prototype.delete=function(e){var t=Se(this,e).delete(e);return this.size-=t?1:0,t},u.prototype.get=function(e){return Se(this,e).get(e)},u.prototype.has=function(e){return Se(this,e).has(e)},u.prototype.set=function(e,t){var n=Se(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};var Oe=u;c.prototype.clear=function(){this.__data__=new G,this.size=0},c.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},c.prototype.get=function(e){return this.__data__.get(e)},c.prototype.has=function(e){return this.__data__.has(e)},c.prototype.set=function(e,t){var n=this.__data__;if(r(n,G)){var o=n.__data__;if(!ve||o.length<199)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new Oe(o)}return n.set(e,t),this.size=n.size,this};var _e=c;s.prototype.add=s.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},s.prototype.has=function(e){return this.__data__.has(e)};var Ee=s,xe=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},je=function(e,t,n,r,o,i){var a=1&n,u=e.length,c=t.length;if(u!=c&&!(a&&c>u))return!1;var s=i.get(e),l=i.get(t);if(s&&l)return s==t&&l==e;var f=-1,d=!0,p=2&n?new Ee:void 0;for(i.set(e,t),i.set(t,e);++f<u;){var h=e[f],y=t[f];if(r)var v=a?r(y,h,f,t,e,i):r(h,y,f,e,t,i);if(void 0!==v){if(v)continue;d=!1;break}if(p){if(!xe(t,(function(e,t){if(a=t,!p.has(a)&&(h===e||o(h,e,n,r,i)))return p.push(t);var a}))){d=!1;break}}else if(h!==y&&!o(h,y,n,r,i)){d=!1;break}}return i.delete(e),i.delete(t),d},Pe=W.Uint8Array,ke=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n},Ce=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},Ae=Y?Y.prototype:void 0,Te=Ae?Ae.valueOf:void 0,Ie=Array.isArray,De=Object.prototype.propertyIsEnumerable,Me=Object.getOwnPropertySymbols,Re=Me?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a)&&(i[o++]=a)}return i}(Me(e),(function(t){return De.call(e,t)})))}:function(){return[]},Ne=function(e){return null!=e&&"object"==typeof e},Le=function(e){return Ne(e)&&"[object Arguments]"==ne(e)},Ue=Object.prototype,Be=Ue.hasOwnProperty,Fe=Ue.propertyIsEnumerable,Ve=Le(function(){return arguments}())?Le:function(e){return Ne(e)&&Be.call(e,"callee")&&!Fe.call(e,"callee")},Ke=Ve,He=t&&!t.nodeType&&t,$e=He&&e&&!e.nodeType&&e,Ge=$e&&$e.exports===He?W.Buffer:void 0,qe=(Ge?Ge.isBuffer:void 0)||function(){return!1},ze=/^(?:0|[1-9]\d*)$/,We=function(e,t){var n=void 0===e?"undefined":o(e);return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ze.test(e))&&e>-1&&e%1==0&&e<t},Ye=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Ze={};Ze["[object Float32Array]"]=Ze["[object Float64Array]"]=Ze["[object Int8Array]"]=Ze["[object Int16Array]"]=Ze["[object Int32Array]"]=Ze["[object Uint8Array]"]=Ze["[object Uint8ClampedArray]"]=Ze["[object Uint16Array]"]=Ze["[object Uint32Array]"]=!0,Ze["[object Arguments]"]=Ze["[object Array]"]=Ze["[object ArrayBuffer]"]=Ze["[object Boolean]"]=Ze["[object DataView]"]=Ze["[object Date]"]=Ze["[object Error]"]=Ze["[object Function]"]=Ze["[object Map]"]=Ze["[object Number]"]=Ze["[object Object]"]=Ze["[object RegExp]"]=Ze["[object Set]"]=Ze["[object String]"]=Ze["[object WeakMap]"]=!1;var Xe,Je=t&&!t.nodeType&&t,Qe=Je&&e&&!e.nodeType&&e,et=Qe&&Qe.exports===Je&&q.process,tt=function(){try{return Qe&&Qe.require&&Qe.require("util").types||et&&et.binding&&et.binding("util")}catch(e){}}(),nt=tt&&tt.isTypedArray,rt=nt?(Xe=nt,function(e){return Xe(e)}):function(e){return Ne(e)&&Ye(e.length)&&!!Ze[ne(e)]},ot=Object.prototype.hasOwnProperty,it=Object.prototype,at=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),ut=Object.prototype.hasOwnProperty,ct=function(e){return null!=(t=e)&&Ye(t.length)&&!oe(t)?function(e,t){var n=Ie(e),r=!n&&Ke(e),o=!n&&!r&&qe(e),i=!n&&!r&&!o&&rt(e),a=n||r||o||i,u=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=u.length;for(var s in e)!ot.call(e,s)||a&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||We(s,c))||u.push(s);return u}(e):function(e){if(n=(t=e)&&t.constructor,t!==("function"==typeof n&&n.prototype||it))return at(e);var t,n,r=[];for(var o in Object(e))ut.call(e,o)&&"constructor"!=o&&r.push(o);return r}(e);var t},st=function(e){return function(e,t,n){var r=t(e);return Ie(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,ct,Re)},lt=Object.prototype.hasOwnProperty,ft=ye(W,"DataView"),dt=ye(W,"Promise"),pt=ye(W,"Set"),ht=ye(W,"WeakMap"),yt="[object Map]",vt="[object Promise]",bt="[object Set]",mt="[object WeakMap]",gt="[object DataView]",wt=ce(ft),St=ce(ve),Ot=ce(dt),_t=ce(pt),Et=ce(ht),xt=ne;(ft&&xt(new ft(new ArrayBuffer(1)))!=gt||ve&&xt(new ve)!=yt||dt&&xt(dt.resolve())!=vt||pt&&xt(new pt)!=bt||ht&&xt(new ht)!=mt)&&(xt=function(e){var t=ne(e),n="[object Object]"==t?e.constructor:void 0,r=n?ce(n):"";if(r)switch(r){case wt:return gt;case St:return yt;case Ot:return vt;case _t:return bt;case Et:return mt}return t});var jt=xt,Pt="[object Arguments]",kt="[object Array]",Ct="[object Object]",At=Object.prototype.hasOwnProperty,Tt=function e(t,n,o,i,a){return t===n||(null==t||null==n||!Ne(t)&&!Ne(n)?t!=t&&n!=n:function(e,t,n,o,i,a){var u=Ie(e),c=Ie(t),s=u?kt:jt(e),l=c?kt:jt(t),f=(s=s==Pt?Ct:s)==Ct,d=(l=l==Pt?Ct:l)==Ct,p=s==l;if(p&&qe(e)){if(!qe(t))return!1;u=!0,f=!1}if(p&&!f)return a||(a=new _e),u||rt(e)?je(e,t,n,o,i,a):function(e,t,n,r,o,i,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new Pe(e),new Pe(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return V(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var u=ke;case"[object Set]":var c=1&r;if(u||(u=Ce),e.size!=t.size&&!c)return!1;var s=a.get(e);if(s)return s==t;r|=2,a.set(e,t);var l=je(u(e),u(t),r,o,i,a);return a.delete(e),l;case"[object Symbol]":if(Te)return Te.call(e)==Te.call(t)}return!1}(e,t,s,n,o,i,a);if(!(1&n)){var h=f&&At.call(e,"__wrapped__"),y=d&&At.call(t,"__wrapped__");if(h||y){var v=h?e.value():e,b=y?t.value():t;return a||(a=new _e),i(v,b,n,o,a)}}return!!p&&(a||(a=new _e),function(e,t,n,o,i,a){var u=1&n,c=st(e),s=c.length;if(s!=st(t).length&&!u)return!1;for(var l=s;l--;){var f=c[l];if(!(u?f in t:lt.call(t,f)))return!1}var d=a.get(e),p=a.get(t);if(d&&p)return d==t&&p==e;var h=!0;a.set(e,t),a.set(t,e);for(var y=u;++l<s;){var v=e[f=c[l]],b=t[f];if(o)var m=u?o(b,v,f,t,e,a):o(v,b,f,e,t,a);if(!(void 0===m?v===b||i(v,b,n,o,a):m)){h=!1;break}y||(y="constructor"==f)}if(h&&!y){var g=e.constructor,w=t.constructor;g==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&r(g,g)&&"function"==typeof w&&r(w,w)||(h=!1)}return a.delete(e),a.delete(t),h}(e,t,n,o,i,a))}(t,n,o,i,e,a))},It=function(e,t){return Tt(e,t)},Dt=d(824),Mt=d(685),Rt=(0,Mt.createGlobalStore)("extensionsInternal",{slots:{},extensions:{}}),Nt=function(){return(0,Mt.getGlobalStore)("extensionsInternal",{slots:{},extensions:{}})},Lt=function(){return(0,Mt.getGlobalStore)("extensions",{slots:{}})};f(Rt.getState()),Rt.subscribe(f);var Ut=d(766),Bt=d(708),Ft=function(e){return void 0===e},Vt=Nt(),Kt=Lt(),Ht=(0,Dt.getExtensionSlotsConfigStore)(),$t=(0,Dt.getExtensionsConfigStore)();Vt.subscribe((function(e){S(e,Ht.getState(),$t.getState())})),Ht.subscribe((function(e){S(Vt.getState(),e,$t.getState())})),$t.subscribe((function(e){S(Vt.getState(),Ht.getState(),e)}));var Gt=function(e){return Vt.setState((function(t){return t.extensions[e.name]=b(v({},e),{instances:[]}),t}))},qt=function(e,t){return Vt.setState((function(n){var r,o=null===(r=n.slots[t])||void 0===r?void 0:r.moduleName;if(o&&o!=e)return console.warn("An extension slot with the name '".concat(t,'\' already exists. Refusing to register the same slot name twice (in "registerExtensionSlot"). The existing one is from module ').concat(o,".")),n;if(o&&o==e)return n;if(n.slots[t])return b(v({},n),{slots:b(v({},n.slots),y({},t,b(v({},n.slots[t]),{moduleName:e})))});var i=O(t,e);return b(v({},n),{slots:b(v({},n.slots),y({},t,i))})}))},zt=function(){return Kt.setState((function(){return{slots:{},extensions:{}}}))},Wt=d(645),Yt=0;function Zt(){var e;return e=function(e,t,n,r){var o,i,a,u,c,s,f,d,p,h,y,v,b,m,g=arguments;return function(e,t){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=t.call(e,a)}catch(e){i=[6,e],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=g.length>4&&void 0!==g[4]?g[4]:function(e){return e},i=g.length>5&&void 0!==g[5]?g[5]:{},a=_(r),u=x(r),c=null,!e)return[3,3];if(!u)throw Error("Couldn't find extension '".concat(a,"' to attach to '").concat(t,"'"));return s=u.load,f=u.meta,d=u.moduleName,p=u.online,h=u.offline,D(p,h)?(l((function(o){var i,u={domElement:e,id:r,slotName:t,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(e){if(Array.isArray(e))return R(e)}(i)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||function(e,t){if(e){if("string"==typeof e)return R(e,t);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)?R(e,t):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,s()]):[3,2];case 1:y=w.sent(),v=y.default,b=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(y,["default"]),m=Yt++,c=(0,Wt.mountRootParcel)(o(B(U({},null!=v?v:b),{name:"".concat(t,"/").concat(a,"-").concat(m)})),B(U({},i),{_meta:f,_extensionContext:{extensionId:r,extensionSlotName:t,extensionSlotModuleName:n,extensionModuleName:d},domElement:e})),w.label=2;case 2:return[3,4];case 3:console.warn("Tried to render ".concat(r," into ").concat(t," but no DOM element was available.")),w.label=4;case 4:return[2,c]}}))},Zt=function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){N(i,r,o,a,u,"next",e)}function u(e){N(i,r,o,a,u,"throw",e)}a(void 0)}))},Zt.apply(this,arguments)}var Xt=Nt()}(),p}())}}}))},7249:()=>{System.register(["@openmrs/esm-state"],(function(e,t){var n={};return{setters:[function(e){n.getGlobalStore=e.getGlobalStore}],execute:function(){e(function(){"use strict";var e={685:function(e){e.exports=n}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return function(){var e=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},t=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},n=function(e){for(var n=arguments,r=function(r){var o=null!=n[r]?n[r]:{},i=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(o).filter((function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable})))),i.forEach((function(n){t(e,n,o[n])}))},o=1;o<arguments.length;o++)r(o);return e},i=function(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e},a=function(e,r,o){var a;d.setState((function(u){var c;return{flags:i(n({},u.flags),t({},e,{enabled:null!==(a=null===(c=u.flags[e])||void 0===c?void 0:c.enabled)&&void 0!==a&&a,label:r,description:o}))}}))},u=function(e){return d.getState().flags[e].enabled},c=function(e,t){d.subscribe((function(n){t(n.flags[e].enabled)}))},s=function(e,r){d.setState((function(o){return{flags:i(n({},o.flags),t({},e,i(n({},o.flags[e]),{enabled:r})))}}))};r.r(o),r.d(o,{featureFlagsStore:function(){return d},getFeatureFlag:function(){return u},registerFeatureFlag:function(){return a},setFeatureFlag:function(){return s},subscribeToFeatureFlag:function(){return c}});var l=r(685),f={flags:function(){var e={},t=!0,r=!1,o=void 0;try{for(var i,a=Object.keys(localStorage)[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var u=i.value;if(u.startsWith("openmrs:feature-flag:")){var c=u.replace("openmrs:feature-flag:",""),s=JSON.parse(localStorage.getItem("openmrs:feature-flag-meta:".concat(c))||"{}");e[c]=n({enabled:"true"===localStorage.getItem(u)},s)}}}catch(e){r=!0,o=e}finally{try{t||null==a.return||a.return()}finally{if(r)throw o}}return e}()},d=(0,l.getGlobalStore)("feature-flags",f);d.subscribe((function(t){var n,r=!0,o=!1,i=void 0;try{for(var a,u=Object.entries(t.flags)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var c=function(e){if(Array.isArray(e))return e}(n=a.value)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(n)||function(t,n){if(t){if("string"==typeof t)return e(t,2);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(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,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.")}(),s=c[0],l=c[1];localStorage.setItem("openmrs:feature-flag:".concat(s),l.enabled.toString()),localStorage.setItem("openmrs:feature-flag-meta:".concat(s),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}())}}}))},130:(e,t,n)=>{"use strict";n.r(t);var r=n(3098),o={};for(const e in r)"default"!==e&&(o[e]=()=>r[e]);n.d(t,o);var i=n(5342);o={};for(const e in i)"default"!==e&&(o[e]=()=>i[e]);n.d(t,o);var a=n(9947);o={};for(const e in a)"default"!==e&&(o[e]=()=>a[e]);n.d(t,o);var u=n(8461);o={};for(const e in u)"default"!==e&&(o[e]=()=>u[e]);n.d(t,o);var c=n(3371);o={};for(const e in c)"default"!==e&&(o[e]=()=>c[e]);n.d(t,o);var s=n(5450);o={};for(const e in s)"default"!==e&&(o[e]=()=>s[e]);n.d(t,o);var l=n(7249);o={};for(const e in l)"default"!==e&&(o[e]=()=>l[e]);n.d(t,o);var f=n(5120);o={};for(const e in f)"default"!==e&&(o[e]=()=>f[e]);n.d(t,o);var d=n(2263);o={};for(const e in d)"default"!==e&&(o[e]=()=>d[e]);n.d(t,o),n(4798);var p=n(9504);o={};for(const e in p)"default"!==e&&(o[e]=()=>p[e]);n.d(t,o),n(842);var h=n(4507);o={};for(const e in h)"default"!==e&&(o[e]=()=>h[e]);n.d(t,o)},5120:()=>{System.register([],(function(e,t){return{execute:function(){e(function(){"use strict";var e=function(e){window.dispatchEvent(new CustomEvent(d,{detail:{online:e}}))},t=function(e){var t=function(t){return e(t.detail)};return window.addEventListener(d,t),function(){return window.removeEventListener(d,t)}},n=function(e){return e({online:navigator.onLine}),t(e)},r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};window.dispatchEvent(new CustomEvent(p,{detail:e}))},o=function(e){var t=function(t){return e(t.detail)};return window.addEventListener(p,t),function(){return window.removeEventListener(p,t)}},i=function(e){window.dispatchEvent(new CustomEvent(h,{detail:e}))},a=function(e){window.dispatchEvent(new CustomEvent(y,{detail:e}))},u=function(e){var t=function(t){return e(t.detail)};return window.addEventListener(h,t),function(){return window.removeEventListener(h,t)}},c=function(e){var t=function(t){return e(t.detail)};return window.addEventListener(y,t),function(){return window.removeEventListener(y,t)}},s=function(e){var t=function(t){return e(t.detail)};return window.addEventListener(v,t),function(){return window.removeEventListener(v,t)}},l={d:function(e,t){for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},f={};l.r(f),l.d(f,{dispatchActionableNotificationShown:function(){return a},dispatchConnectivityChanged:function(){return e},dispatchNotificationShown:function(){return i},dispatchPrecacheStaticDependencies:function(){return r},subscribeActionableNotificationShown:function(){return c},subscribeConnectivity:function(){return n},subscribeConnectivityChanged:function(){return t},subscribeNotificationShown:function(){return u},subscribePrecacheStaticDependencies:function(){return o},subscribeToastShown:function(){return s}});var d="openmrs:connectivity-changed",p="openmrs:precache-static-dependencies",h="openmrs:notification-shown",y="openmrs:actionable-notification-shown",v="openmrs:toast-shown";return f}())}}}))},2263:(e,t,n)=>{function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){u(e,t,n[t])}))}return e}function l(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||h(e,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.")}()}function d(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(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.")}()}var p=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function h(e,t){if(e){if("string"==typeof e)return r(e,t);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)?r(e,t):void 0}}System.register(["@openmrs/esm-api","@openmrs/esm-state"],(function(e,t){var r={},i={};return{setters:[function(e){r.getLoggedInUser=e.getLoggedInUser},function(e){i.createGlobalStore=e.createGlobalStore}],execute:function(){e(function(){"use strict";var e={766:function(e){e.exports=r},685:function(e){e.exports=i}},t={};function h(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,h),o.exports}h.d=function(e,t){for(var n in t)h.o(t,n)&&!h.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},h.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},h.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var y={};return function(){var e=function(e,t){return new Promise((function(n){var r=new MessageChannel;r.port1.onmessage=function(e){n(e.data)},e.postMessage(t,[r.port2])}))},t=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},r=function(e,n){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(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(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){r&&(e=r);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[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=e[Symbol.iterator]()).next.bind(r)},i=function(e,t){var n=location.href;return new URL(e,n).href===new URL(t,n).href},v=function(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)},b=function(){},m=function(e,t){if(!t)return e&&e.then?e.then(b):Promise.resolve()},g=function(e,t){if(void 0!==Dn)return console.warn("The application's Service Worker has already been registered. The new service worker at ".concat(e," will not be registered.")),Dn;if(!("serviceWorker"in navigator))throw new Error("Registering the Service Worker is not possible due to missing browser capabilities.");var n=new In(e,t);return Dn=n.register().then((function(){return n.controlling.then((function(){return n}))}))},w=function(){return null!=Dn?Dn:Promise.resolve(void 0)},S=function(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)},O=function(e){return Ln.apply(this,arguments)},E=function(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)},x=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){E(i,r,o,a,u,"next",e)}function u(e){E(i,r,o,a,u,"throw",e)}a(void 0)}))}},j=function(e,t){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=t.call(e,a)}catch(e){i=[6,e],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)},k=function(){return Bn.apply(this,arguments)},C=function(){return Fn.apply(this,arguments)},A=function(){return Vn.apply(this,arguments)},T=function(){return{current:Hn,notAvailable:"unavailable"===Hn,active:"on"===Hn}},I=function(e){"unavailable"!==Hn&&"unavailable"!==e&&(localStorage.setItem(Kn,"on"===e?"active":"disabled"),Hn=e)},D=function(){return $n.apply(this,arguments)},M=function(e,t){return"object"!=typeof t||qn(t).forEach((function(n){e[n]=t[n]})),e},R=function(e,t){return Yn.call(e,t)},N=function(e,t){"function"==typeof t&&(t=t(Wn(e))),("undefined"==typeof Reflect?qn:Reflect.ownKeys)(t).forEach((function(n){L(e,n,t[n])}))},L=function(e,t,n,r){Zn(e,t,M(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(e){return{from:function(t){return e.prototype=Object.create(t.prototype),L(e.prototype,"constructor",e),{extend:N.bind(null,e.prototype)}}}},B=function(e,t,n){return Qn.call(e,t,n)},F=function(e,t){return t(e)},V=function(e){if(!e)throw new Error("Assertion Failed")},K=function(e){Gn.setImmediate?setImmediate(e):setTimeout(e,0)},H=function(e,t){return e.reduce((function(e,n,r){var o=t(n,r);return o&&(e[o[0]]=o[1]),e}),{})},$=function(e){var t={};for(var n in e)R(e,n)&&(t[n]=e[n]);return t},G=function(e){return nr.apply([],e)},q=function(e){ir="undefined"!=typeof WeakMap&&new WeakMap;var t=ar(e);return ir=null,t},z=function(e){return ur.call(e).slice(8,-1)},W=function(e){var t,n,r,o;if(1===arguments.length){if(zn(e))return e.slice();if(this===lr&&"string"==typeof e)return[e];if(o=sr(e)){for(n=[];!(r=o.next()).done;)n.push(r.value);return n}if(null==e)return[e];if("number"==typeof(t=e.length)){for(n=new Array(t);t--;)n[t]=e[t];return n}return[e]}for(t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];return n},Y=function(e,t){dr=e,pr=t},Z=function(e,t){var n=e.stack;return n?(t=t||0,0===n.indexOf(e.name)&&(t+=(e.name+e.message).split("\n").length),n.split("\n").slice(t).filter(pr).map((function(e){return"\n"+e})).join("")):""},X=function(e,t){this._e=yr(),this.name=e,this.message=t},J=function(e,t){return e+". Errors: "+Object.keys(t).map((function(e){return t[e].toString()})).filter((function(e,t,n){return n.indexOf(e)===t})).join("\n")},Q=function(e,t,n,r){this._e=yr(),this.failures=t,this.failedKeys=r,this.successCount=n,this.message=J(e,t)},ee=function(e,t){this._e=yr(),this.name="BulkError",this.failures=Object.keys(t).map((function(e){return t[e]})),this.failuresByPos=t,this.message=J(e,t)},te=function(){},ne=function(e){return e},re=function(e,t){return null==e||e===ne?t:function(n){return t(e(n))}},oe=function(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}},ie=function(e,t){return e===te?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var i=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?oe(r,this.onsuccess):r),o&&(this.onerror=this.onerror?oe(o,this.onerror):o),void 0!==i?i:n}},ae=function(e,t){return e===te?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?oe(n,this.onsuccess):n),r&&(this.onerror=this.onerror?oe(r,this.onerror):r)}},ue=function(e,t){return e===te?t:function(n){var r=e.apply(this,arguments);M(n,r);var o=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return o&&(this.onsuccess=this.onsuccess?oe(o,this.onsuccess):o),i&&(this.onerror=this.onerror?oe(i,this.onerror):i),void 0===r?void 0===a?void 0:a:M(r,a)}},ce=function(e,t){return e===te?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}},se=function(e,t){return e===te?t:function(){var n=e.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 t.apply(r,i)}))}return t.apply(this,arguments)}},le=function(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=te,this._lib=!1;var t=this._PSD=Kr;if(dr&&(this._stackHolder=yr(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==Er)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&de(this,this._value))}this._state=null,this._value=null,++t.ref,zr(this,e)},fe=function(e,t,n,r,o){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=o},de=function(e,t){if(Ur.push(t),null===e._state){var n=e._lib&&me();t=Fr(t),e._state=!1,e._value=t,dr&&null!==t&&"object"==typeof t&&!t._promise&&function(e,t,n){try{e.apply(null,void 0)}catch(e){}}((function(){var n=Jn(t,"stack");t._promise=e,L(t,"stack",{get:function(){return Ir?n&&(n.get?n.get.apply(t):n.value):e.stack}})})),function(e){Lr.some((function(t){return t._value===e._value}))||Lr.push(e)}(e),pe(e),n&&ge()}},pe=function(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)he(e,t[n]);var o=e._PSD;--o.ref||o.finalize(),0===$r&&(++$r,Mr((function(){0==--$r&&we()}),[]))},he=function(e,t){if(null!==e._state){var n=e._state?t.onFulfilled:t.onRejected;if(null===n)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++$r,Mr(ye,[n,e,t])}else e._listeners.push(t)},ye=function(e,t,n){try{Br=t;var r,o=t._value;t._state?r=e(o):(Ur.length&&(Ur=[]),r=e(o),-1===Ur.indexOf(o)&&function(e){for(var t=Lr.length;t;)if(Lr[--t]._value===e._value)return void Lr.splice(t,1)}(t)),n.resolve(r)}catch(e){n.reject(e)}finally{Br=null,0==--$r&&we(),--n.psd.ref||n.psd.finalize()}},ve=function(e,t){var n=t?t._numPrev+1:0;n<100&&(e._prev=t,e._numPrev=n)},be=function(){me()&&ge()},me=function(){var e=Rr;return Rr=!1,Nr=!1,e},ge=function(){var e,t,n;do{for(;Hr.length>0;)for(e=Hr,Hr=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}}while(Hr.length>0);Rr=!0,Nr=!0},we=function(){var e=Lr;Lr=[],e.forEach((function(e){e._PSD.onunhandled.call(null,e._value,e)}));for(var t=Gr.slice(0),n=t.length;n;)t[--n]()},Se=function(e){return new le(Er,!1,e)},Oe=function(e,t){var n=Kr;return function(){var r=me(),o=Kr;try{return Ce(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{Ce(o,!1),r&&ge()}}},_e=function(e,t,n,r){var o=Kr,i=Object.create(o);i.parent=o,i.ref=0,i.global=!1,i.id=++eo;var a=Vr.env;i.env=Tr?{Promise:le,PromiseProp:{value:le,configurable:!0,writable:!0},all:le.all,race:le.race,allSettled:le.allSettled,any:le.any,resolve:le.resolve,reject:le.reject,nthen:Me(a.nthen,i),gthen:Me(a.gthen,i)}:{},t&&M(i,t),++o.ref,i.finalize=function(){--this.parent.ref||this.parent.finalize()};var u=Te(i,e,n,r);return 0===i.ref&&i.finalize(),u},Ee=function(){return Yr.id||(Yr.id=++Zr),++Yr.awaits,Yr.echoes+=100,Yr.id},xe=function(){return!!Yr.awaits&&(0==--Yr.awaits&&(Yr.id=0),Yr.echoes=100*Yr.awaits,!0)},je=function(e){return Yr.echoes&&e&&e.constructor===Ar?(Ee(),e.then((function(e){return xe(),e}),(function(e){return xe(),to(e)}))):e},Pe=function(e){++Qr,Yr.echoes&&0!=--Yr.echoes||(Yr.echoes=Yr.id=0),Xr.push(Kr),Ce(e,!0)},ke=function(){var e=Xr[Xr.length-1];Xr.pop(),Ce(e,!1)},Ce=function(e,t){var n=Kr;if((t?!Yr.echoes||Jr++&&e===Kr:!Jr||--Jr&&e===Kr)||Ie(t?Pe.bind(null,e):ke),e!==Kr&&(Kr=e,n===Vr&&(Vr.env=Ae()),Tr)){var r=Vr.env.Promise,o=e.env;Pr.then=o.nthen,r.prototype.then=o.gthen,(n.global||e.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))}},Ae=function(){var e=Gn.Promise;return Tr?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(Gn,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:Pr.then,gthen:e.prototype.then}:{}},Te=function(e,t,n,r,o){var i=Kr;try{return Ce(e,!0),t(n,r,o)}finally{Ce(i,!1)}},Ie=function(e){Cr.call(jr,e)},De=function(e,t,n,r){return"function"!=typeof e?e:function(){var o=Kr;n&&Ee(),Ce(t,!0);try{return e.apply(this,arguments)}finally{Ce(o,!1),r&&Ie(xe)}}},Me=function(e,t){return function(n,r){return e.call(this,De(n,t),De(r,t))}},Re=function(e,t){var n;try{n=t.onuncatched(e)}catch(e){}if(!1!==n)try{var r,o={promise:t,reason:e};if(Gn.document&&document.createEvent?((r=document.createEvent("Event")).initEvent("unhandledrejection",!0,!0),M(r,o)):Gn.CustomEvent&&M(r=new CustomEvent("unhandledrejection",{detail:o}),o),r&&Gn.dispatchEvent&&(dispatchEvent(r),!Gn.PromiseRejectionEvent&&Gn.onunhandledrejection))try{Gn.onunhandledrejection(r)}catch(e){}dr&&r&&!r.defaultPrevented&&console.warn("Unhandled rejection: ".concat(e.stack||e))}catch(e){}},Ne=function(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t},Le=function(e){return"string"!=typeof e||/\./.test(e)?function(e){return e}:function(t){return void 0===t[e]&&e in t&&delete(t=q(t))[e],t}},Ue=function(e){var t={},n=function(n,r){if(r){for(var o=arguments.length,i=new Array(o-1);--o;)i[o-1]=arguments[o];return t[n].subscribe.apply(null,i),e}if("string"==typeof n)return t[n]};n.addEventType=i;for(var r=1,o=arguments.length;r<o;++r)i(arguments[r]);return n;function i(e,r,o){if("object"==typeof e)return function(e){qn(e).forEach((function(t){var n=e[t];if(zn(n))i(t,e[t][0],e[t][1]);else{if("asap"!==n)throw new Sr.InvalidArgument("Invalid event config");var r=i(t,ne,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];r.subscribers.forEach((function(e){K((function(){e.apply(null,t)}))}))}))}}))}(e);r||(r=ce),o||(o=te);var a={subscribers:[],fire:o,subscribe:function(e){-1===a.subscribers.indexOf(e)&&(a.subscribers.push(e),a.fire=r(a.fire,e))},unsubscribe:function(e){a.subscribers=a.subscribers.filter((function(t){return t!==e})),a.fire=a.subscribers.reduce(r,o)}};return t[e]=n[e]=a,a}},Be=function(e,t){return U(t).from({prototype:e}),t},Fe=function(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)},Ve=function(e,t){e.filter=Ne(e.filter,t)},Ke=function(e,t,n){var r=e.replayFilter;e.replayFilter=r?function(){return Ne(r(),t())}:t,e.justLimit=n&&!r},He=function(e,t){if(e.isPrimKey)return t.primaryKey;var n=t.getIndexByKeyPath(e.index);if(!n)throw new Sr.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n},$e=function(e,t,n){var r=He(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:r,range:e.range}})},Ge=function(e,t,n,r){var o=e.replayFilter?Ne(e.filter,e.replayFilter()):e.filter;if(e.or){var i={},a=function(e,n,r){if(!o||o(n,r,(function(e){return n.stop(e)}),(function(e){return n.fail(e)}))){var a=n.primaryKey,u=""+a;"[object ArrayBuffer]"===u&&(u=""+new Uint8Array(a)),R(i,u)||(i[u]=!0,t(e,n,r))}};return Promise.all([e.or._iterate(a,n),qe($e(e,r,n),e.algorithm,a,!e.keysOnly&&e.valueMapper)])}return qe($e(e,r,n),Ne(e.algorithm,o),t,!e.keysOnly&&e.valueMapper)},qe=function(e,t,n,r){var o=Oe(r?function(e,t,o){return n(r(e),t,o)}:n);return e.then((function(e){if(e)return e.start((function(){var n=function(){return e.continue()};t&&!t(e,(function(e){return n=e}),(function(t){e.stop(t),n=te}),(function(t){e.fail(t),n=te}))||o(e.value,e,(function(e){return n=e})),n()}))}))},ze=function(e){var t=void 0===e?"undefined":p(e);if("object"!==t)return t;if(ArrayBuffer.isView(e))return"binary";var n=z(e);return"ArrayBuffer"===n?"binary":n},We=function(e){return c(e,Uint8Array)?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)},Ye=function(e,t){return e<t?-1:e===t?0:1},Ze=function(e,t){return e>t?-1:e===t?0:1},Xe=function(e,t,n){var r=c(e,vo)?new e.Collection(e):e;return r._ctx.error=n?new n(t):new TypeError(t),r},Je=function(e){return new e.Collection(e,(function(){return nt("")})).limit(0)},Qe=function(e,t,n,r,o,i){for(var a=Math.min(e.length,r.length),u=-1,c=0;c<a;++c){var s=t[c];if(s!==r[c])return o(e[c],n[c])<0?e.substr(0,c)+n[c]+n.substr(c+1):o(e[c],r[c])<0?e.substr(0,c)+r[c]+n.substr(c+1):u>=0?e.substr(0,u)+t[u]+n.substr(u+1):null;o(e[c],s)<0&&(u=c)}return a<r.length&&"next"===i?e+n.substr(e.length):a<e.length&&"prev"===i?e.substr(0,n.length):u<0?null:e.substr(0,u)+r[u]+n.substr(u+1)},et=function(e,t,n,r){var o,i,a,u,c,s,l,f=n.length;if(!n.every((function(e){return"string"==typeof e})))return Xe(e,"String expected.");function d(e){o=function(e){return"next"===e?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()}}(e),i=function(e){return"next"===e?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()}}(e),a="next"===e?Ye:Ze;var t=n.map((function(e){return{lower:i(e),upper:o(e)}})).sort((function(e,t){return a(e.lower,t.lower)}));u=t.map((function(e){return e.upper})),c=t.map((function(e){return e.lower})),s=e,l="next"===e?"":r}d("next");var p=new e.Collection(e,(function(){return tt(u[0],c[f-1]+r)}));p._ondirectionchange=function(e){d(e)};var h=0;return p._addAlgorithm((function(e,n,r){var o=e.key;if("string"!=typeof o)return!1;var d=i(o);if(t(d,c,h))return!0;for(var p=null,y=h;y<f;++y){var v=Qe(o,d,u[y],c[y],a,s);null===v&&null===p?h=y+1:(null===p||a(p,v)>0)&&(p=v)}return n(null!==p?function(){e.continue(p+l)}:r),!1})),p},tt=function(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}},nt=function(e){return{type:1,lower:e,upper:e}},rt=function(e){return Oe((function(t){return ot(t),e(t.target.error),!1}))},ot=function(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()},it=function(e,t,n,r,o,i,a){return{name:e,keyPath:t,unique:n,multi:r,auto:o,compound:i,src:(n&&!a?"&":"")+(r?"*":"")+(o?"++":"")+at(t)}},at=function(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""},ut=function(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:H(n,(function(e){return[e.name,e]}))}},ct=function(e){return null==e?function(){}:"string"==typeof e?function(e){return 1===e.split(".").length?function(t){return t[e]}:function(t){return er(t,e)}}(e):function(t){return er(t,e)}},st=function(e){return[].slice.call(e)},lt=function(e){return null==e?":id":"string"==typeof e?e:"[".concat(e.join("+"),"]")},ft=function(e,t){var n=e._novip,r=t.db,o=function(e,t,n,r){var o=n.IDBKeyRange,i=(n.indexedDB,function(e,t){return t.reduce((function(e,t){return s({},e,(0,t.create)(e))}),e)}(function(e,t,n){function r(e){if(3===e.type)return null;if(4===e.type)throw new Error("Cannot convert never type to IDBKeyRange");var n=e.lower,r=e.upper,o=e.lowerOpen,i=e.upperOpen;return void 0===n?void 0===r?null:t.upperBound(r,!!i):void 0===r?t.lowerBound(n,!!o):t.bound(n,r,!!o,!!i)}var o=function(e,t){var n=st(e.objectStoreNames);return{schema:{name:e.name,tables:n.map((function(e){return t.objectStore(e)})).map((function(e){var t=e.keyPath,n=e.autoIncrement,r=zn(t),o=null==t,i={},a={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:o,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:ct(t)},indexes:st(e.indexNames).map((function(t){return e.index(t)})).map((function(e){var t=e.name,n=e.unique,r=e.multiEntry,o=e.keyPath,a={name:t,compound:zn(o),keyPath:o,unique:n,multiEntry:r,extractKey:ct(o)};return i[lt(o)]=a,a})),getIndexByKeyPath:function(e){return i[lt(e)]}};return i[":id"]=a.primaryKey,null!=t&&(i[lt(t)]=a.primaryKey),a}))},hasGetAll:n.length>0&&"getAll"in t.objectStore(n[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}(e,n),i=o.schema,a=o.hasGetAll,u=i.tables.map((function(e){return function(e){var t=e.name;return{name:t,schema:e,mutate:function(e){var n=e.trans,o=e.type,i=e.keys,a=e.values,u=e.range;return new Promise((function(e,c){e=Oe(e);var s=n.objectStore(t),l=null==s.keyPath,d="put"===o||"add"===o;if(!d&&"delete"!==o&&"deleteRange"!==o)throw new Error("Invalid operation type: "+o);var p,h=(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===h)return e({numFailures:0,failures:{},results:[],lastResult:void 0});var y=[],v=[],b=0,m=function(e){++b,ot(e)};if("deleteRange"===o){if(4===u.type)return e({numFailures:b,failures:v,results:[],lastResult:void 0});3===u.type?y.push(p=s.clear()):y.push(p=s.delete(r(u)))}else{var g=f(d?l?[a,i]:[a,null]:[i,null],2),w=g[0],S=g[1];if(d)for(var O=0;O<h;++O)y.push(p=S&&void 0!==S[O]?s[o](w[O],S[O]):s[o](w[O])),p.onerror=m;else for(var _=0;_<h;++_)y.push(p=s[o](w[_])),p.onerror=m}var E=function(t){var n=t.target.result;y.forEach((function(e,t){return null!=e.error&&(v[t]=e.error)})),e({numFailures:b,failures:v,results:"delete"===o?i:y.map((function(e){return e.result})),lastResult:n})};p.onerror=function(e){m(e),E(e)},p.onsuccess=E}))},getMany:function(e){var n=e.trans,r=e.keys;return new Promise((function(e,o){e=Oe(e);for(var i,a=n.objectStore(t),u=r.length,c=new Array(u),s=0,l=0,f=function(t){var n=t.target;c[n._pos]=n.result,++l===s&&e(c)},d=rt(o),p=0;p<u;++p)null!=r[p]&&((i=a.get(r[p]))._pos=p,i.onsuccess=f,i.onerror=d,++s);0===s&&e(c)}))},get:function(e){var n=e.trans,r=e.key;return new Promise((function(e,o){e=Oe(e);var i=n.objectStore(t).get(r);i.onsuccess=function(t){return e(t.target.result)},i.onerror=rt(o)}))},query:function(e){return function(n){return new Promise((function(o,i){o=Oe(o);var a=n.trans,u=n.values,c=n.limit,s=n.query,l=c===1/0?void 0:c,f=s.index,d=s.range,p=a.objectStore(t),h=f.isPrimaryKey?p:p.index(f.name),y=r(d);if(0===c)return o({result:[]});if(e){var v=u?h.getAll(y,l):h.getAllKeys(y,l);v.onsuccess=function(e){return o({result:e.target.result})},v.onerror=rt(i)}else{var b=0,m=u||!("openKeyCursor"in h)?h.openCursor(y):h.openKeyCursor(y),g=[];m.onsuccess=function(e){var t=m.result;return t?(g.push(u?t.value:t.primaryKey),++b===c?o({result:g}):void t.continue()):o({result:g})},m.onerror=rt(i)}}))}}(a),openCursor:function(e){var n=e.trans,o=e.values,i=e.query,a=e.reverse,u=e.unique;return new Promise((function(e,c){e=Oe(e);var s=i.index,l=i.range,f=n.objectStore(t),d=s.isPrimaryKey?f:f.index(s.name),p=a?u?"prevunique":"prev":u?"nextunique":"next",h=o||!("openKeyCursor"in d)?d.openCursor(r(l),p):d.openKeyCursor(r(l),p);h.onerror=rt(c),h.onsuccess=Oe((function(t){var r=h.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=Oe(c),r.next=function(){var e=this,t=1;return this.start((function(){return t--?e.continue():e.stop()})).then((function(){return e}))},r.start=function(e){var t=new Promise((function(e,t){e=Oe(e),h.onerror=rt(t),r.fail=t,r.stop=function(t){r.stop=r.continue=r.continuePrimaryKey=r.advance=u,e(t)}})),n=function(){if(h.result)try{e()}catch(e){r.fail(e)}else r.done=!0,r.start=function(){throw new Error("Cursor behind last entry")},r.stop()};return h.onsuccess=Oe((function(e){h.onsuccess=n,n()})),r.continue=o,r.continuePrimaryKey=i,r.advance=a,n(),t},e(r)}else e(null)}),c)}))},count:function(e){var n=e.query,o=e.trans,i=n.index,a=n.range;return new Promise((function(e,n){var u=o.objectStore(t),c=i.isPrimaryKey?u:u.index(i.name),s=r(a),l=s?c.count(s):c.count();l.onsuccess=Oe((function(t){return e(t.target.result)})),l.onerror=rt(n)}))}}}(e)})),c={};return u.forEach((function(e){return c[e.name]=e})),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(e){if(!c[e])throw new Error("Table '".concat(e,"' not found"));return c[e]},MIN_KEY:-1/0,MAX_KEY:go(t),schema:i}}(t,o,r),e.dbcore));return{dbcore:i}}(n._middlewares,r,n._deps,t);n.core=o.dbcore,n.tables.forEach((function(e){var t=e.name;n.core.schema.tables.some((function(e){return e.name===t}))&&(e.core=n.core.table(t),c(n[t],n.Table)&&(n[t].core=e.core))}))},dt=function(e,t,n,r){var o=e._novip;n.forEach((function(e){var n=r[e];t.forEach((function(t){var r=Jn(t,e);(!r||"value"in r&&void 0===r.value)&&(t===o.Transaction.prototype||c(t,o.Transaction)?L(t,e,{get:function(){return this.table(e)},set:function(t){Zn(this,e,{value:t,writable:!0,configurable:!0,enumerable:!0})}}):t[e]=new o.Table(e,n))}))}))},pt=function(e,t){var n=e._novip;t.forEach((function(e){for(var t in e)c(e[t],n.Table)&&delete e[t]}))},ht=function(e,t){return e._cfg.version-t._cfg.version},yt=function(e,t){var n,r={del:[],add:[],change:[]};for(n in e)t[n]||r.del.push(n);for(n in t){var o=e[n],i=t[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,c=i.idxByName,s=void 0;for(s in u)c[s]||a.del.push(s);for(s in c){var l=u[s],f=c[s];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},vt=function(e,t,n,r){var o=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach((function(e){return bt(o,e)})),o},bt=function(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})},mt=function(e,t,n){var r={};return B(t.objectStoreNames,0).forEach((function(e){for(var t=n.objectStore(e),o=t.keyPath,i=it(at(o),o||"",!1,!1,!!t.autoIncrement,o&&"string"!=typeof o,!0),a=[],u=0;u<t.indexNames.length;++u){var c=t.index(t.indexNames[u]);o=c.keyPath;var s=it(c.name,o,!!c.unique,!!c.multiEntry,!1,o&&"string"!=typeof o,!1);a.push(s)}r[e]=ut(e,i,a)})),r},gt=function(e,t,n){for(var r=e._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 s=0;s<u.indexNames.length;++s){var l=u.indexNames[s],f=u.index(l).keyPath,d="string"==typeof f?f:"["+B(f).join("+")+"]";if(t[a]){var p=t[a].idxByName[d];p&&(p.name=l,delete t[a].idxByName[d],t[a].idxByName[l]=p)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&Gn.WorkerGlobalScope&&c(Gn,Gn.WorkerGlobalScope)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(r._hasGetAll=!1)},wt=function(e,t){var n=e._dbNamesDB;return n||(n=e._dbNamesDB=new To("__dbnames",{addons:[],indexedDB:e,IDBKeyRange:t})).version(1).stores({dbnames:"name"}),n.table("dbnames")},St=function(e){return e&&"function"==typeof e.databases},Ot=function(e){return _e((function(){return Kr.letThrough=!0,e()}))},_t=function(){var e;return!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(t){var n=function(){return indexedDB.databases().finally(t)};e=setInterval(n,100),n()})).finally((function(){return clearInterval(e)})):Promise.resolve()},Et=function(e){var t=function(t){return e.next(t)},n=o(t),r=o((function(t){return e.throw(t)}));function o(e){return function(t){var o=e(t),i=o.value;return o.done?i:i&&"function"==typeof i.then?i.then(n,r):zn(i)?Promise.all(i).then(n,r):n(i)}}return o(t)()},xt=function(e,t,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(),[e,G(o),n]},jt=function(e,t,n){for(var r=zn(e)?e.slice():[e],o=0;o<n;++o)r.push(t);return r},Pt=function(e,t,n){try{if(!t)return null;if(t.keys.length<e.length)return null;for(var r=[],o=0,i=0;o<t.keys.length&&i<e.length;++o)0===po(t.keys[o],e[i])&&(r.push(n?q(t.values[o]):t.values[o]),++i);return r.length===e.length?r:null}catch(e){return null}},kt=function(e){return!("from"in e)},Ct=function(e,t){kt(t)||function e(t,n){var r=n.from,o=n.to,i=n.l,a=n.r;ko(t,r,o),i&&e(t,i),a&&e(t,a)}(e,t)},At=function(e){var t=kt(e)?null:{s:0,n:e};return{next:function(e){for(var n=arguments.length>0;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&po(e,t.n.from)<0;)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!n||po(e,t.n.to)<=0)return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}},Tt=function(e){var t,n,r=((null===(t=e.r)||void 0===t?void 0:t.d)||0)-((null===(n=e.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=s({},e),u=e[o];e.from=u.from,e.to=u.to,e[o]=u[o],a[o]=u[i],e[i]=a,a.d=It(a)}e.d=It(e)},It=function(e){var t=e.r,n=e.l;return(t?n?Math.max(t.d,n.d):t.d:n?n.d:0)+1},Dt=function(e,t){return qn(t).forEach((function(n){Ct(e[n]||(e[n]=new Po),t[n])})),e},Mt=function(e){var t=Ro;try{Ro=!0,bo.storagemutated.fire(e)}finally{Ro=t}},Rt=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},Nt=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},Lt=function(){return new Ko},Ut=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},Bt=function(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)},Ft=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Bt(i,r,o,a,u,"next",e)}function u(e){Bt(i,r,o,a,u,"throw",e)}a(void 0)}))}},Vt=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},Kt=function(e){for(var t=arguments,n=function(n){var r=null!=t[n]?t[n]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),o.forEach((function(t){Vt(e,t,r[t])}))},r=1;r<arguments.length;r++)n(r);return e},Ht=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ut(e,t);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)?Ut(e,t):void 0}}(e,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=function(e,t){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=t.call(e,a)}catch(e){i=[6,e],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])}}},Gt=function(){return Go},qt=function(){return qo.apply(this,arguments)},zt=function(){return Wo.apply(this,arguments)},Wt=function(e,t,n,r){return Yo.apply(this,arguments)},Yt=function(e,t,n){return Zo.apply(this,arguments)},Zt=function(e,t){return Xo.apply(this,arguments)},Xt=function(e,t){return Jo.apply(this,arguments)},Jt=function(e){return Qo.apply(this,arguments)},Qt=function(e){return ei.apply(this,arguments)},en=function(e){return ti.apply(this,arguments)},tn=function(e){var t;return!!(null===(t=$o[e])||void 0===t?void 0:t.options.onBeginEditSyncItem)},nn=function(e){return ni.apply(this,arguments)},rn=function(e){return ri.apply(this,arguments)},on=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};$o[e]={type:e,dependsOn:t,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+si()},cn=function(e){return e.startsWith(li)},sn=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},ln=function(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)},fn=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ln(i,r,o,a,u,"next",e)}function u(e){ln(i,r,o,a,u,"throw",e)}a(void 0)}))}},dn=function(e,t){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=t.call(e,a)}catch(e){i=[6,e],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)},hn=function(e){fi[e.id]&&console.warn('[setupDynamicOfflineDataHandler] Another second handler with the ID "'.concat(e.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[e.id]=e},yn=function(e){return di.apply(this,arguments)},vn=function(e,t){return pi.apply(this,arguments)},bn=function(e,t){return hi.apply(this,arguments)},mn=function(e,t,n){return yi.apply(this,arguments)},gn=function(e,t){return vi.apply(this,arguments)},wn=function(e,t,n){return bi.apply(this,arguments)},Sn=function(e,t){return mi.apply(this,arguments)},On=function(e,t,n){return gi.apply(this,arguments)},_n=function(){return wi.apply(this,arguments)},En=function(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)},xn=function(){return kn(),Si},jn=function(e,t){kn(),hn({type:"patient",displayName:t.displayName,id:e,isSynced:function(){return Promise.resolve(!0)},sync:function(e,n){return t.onOfflinePatientAdded({patientUuid:e,signal:null!=n?n:(new AbortController).signal})}})},Pn=function(e){return Oi.apply(this,arguments)},kn=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.")};h.r(y),h.d(y,{activateOfflineCapability:function(){return D},beginEditSynchronizationItem:function(){return nn},canBeginEditSynchronizationItemsOfType:function(){return tn},deleteSynchronizationItem:function(){return rn},generateOfflineUuid:function(){return un},getCurrentOfflineMode:function(){return T},getDynamicOfflineDataEntries:function(){return yn},getDynamicOfflineDataEntriesFor:function(){return vn},getDynamicOfflineDataHandlers:function(){return pn},getFullSynchronizationItems:function(){return Qt},getFullSynchronizationItemsFor:function(){return Xt},getOfflineDb:function(){return Lt},getOfflinePatientDataStore:function(){return xn},getOfflineSynchronizationStore:function(){return Gt},getOmrsServiceWorker:function(){return w},getSynchronizationItem:function(){return en},getSynchronizationItems:function(){return Jt},getSynchronizationItemsFor:function(){return Zt},isOfflineUuid:function(){return cn},messageOmrsServiceWorker:function(){return O},offlineUuidPrefix:function(){return li},omrsOfflineCachingStrategyHttpHeaderName:function(){return Nn},omrsOfflineResponseBodyHttpHeaderName:function(){return Mn},omrsOfflineResponseStatusHttpHeaderName:function(){return Rn},putDynamicOfflineData:function(){return bn},putDynamicOfflineDataFor:function(){return mn},queueSynchronizationItem:function(){return Yt},queueSynchronizationItemFor:function(){return Wt},registerOfflinePatientHandler:function(){return jn},registerOmrsServiceWorker:function(){return g},removeDynamicOfflineData:function(){return gn},removeDynamicOfflineDataFor:function(){return wn},runSynchronization:function(){return qt},setCurrentOfflineMode:function(){return I},setupDynamicOfflineDataHandler:function(){return hn},setupOfflineSync:function(){return on},syncAllDynamicOfflineData:function(){return Sn},syncDynamicOfflineData:function(){return On},syncOfflinePatientData:function(){return Pn}});try{self["workbox:window:6.5.3"]&&_()}catch(e){}try{self["workbox:core:6.5.3"]&&_()}catch(e){}var Cn=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t,e.reject=n}))},An=function(e,t){this.type=e,Object.assign(this,t)},Tn={type:"SKIP_WAITING"},In=function(t){var n,r,o=function(e,n){var r,o;return void 0===n&&(n={}),(r=t.call(this)||this).nn={},r.tn=0,r.rn=new Cn,r.en=new Cn,r.on=new Cn,r.un=0,r.an=new Set,r.cn=function(){var e=r.fn,t=e.installing;r.tn>0||!i(t.scriptURL,r.sn.toString())||performance.now()>r.un+6e4?(r.vn=t,e.removeEventListener("updatefound",r.cn)):(r.hn=t,r.an.add(t),r.rn.resolve(t)),++r.tn,t.addEventListener("statechange",r.ln)},r.ln=function(e){var t=r.fn,n=e.target,o=n.state,i=n===r.vn,a={sw:n,isExternal:i,originalEvent:e};!i&&r.mn&&(a.isUpdate=!0),r.dispatchEvent(new An(o,a)),"installed"===o?r.wn=self.setTimeout((function(){"installed"===o&&t.waiting===n&&r.dispatchEvent(new An("waiting",a))}),200):"activating"===o&&(clearTimeout(r.wn),i||r.en.resolve(n))},r.dn=function(e){var t=r.hn,n=t!==navigator.serviceWorker.controller;r.dispatchEvent(new An("controlling",{isExternal:n,originalEvent:e,sw:t,isUpdate:r.mn})),n||r.on.resolve(t)},r.gn=(o=function(e){var t=e.data,n=e.ports,o=e.source;return v(r.getSW(),(function(){r.an.has(o)&&r.dispatchEvent(new An("message",{data:t,originalEvent:e,ports:n,sw:o}))}))},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(o.apply(this,e))}catch(e){return Promise.reject(e)}}),r.sn=e,r.nn=n,navigator.serviceWorker.addEventListener("message",r.gn),r};r=t,(n=o).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r;var a,u=o.prototype;return u.register=function(e){var t=(void 0===e?{}:e).immediate,n=void 0!==t&&t;try{var r=this;return function(e,t){var n=e();return n&&n.then?n.then(t):t()}((function(){if(!n&&"complete"!==document.readyState)return m(new Promise((function(e){return window.addEventListener("load",e)})))}),(function(){return r.mn=Boolean(navigator.serviceWorker.controller),r.yn=r.pn(),v(r.bn(),(function(e){r.fn=e,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 t=r.fn.waiting;return t&&i(t.scriptURL,r.sn.toString())&&(r.hn=t,Promise.resolve().then((function(){r.dispatchEvent(new An("waiting",{sw:t,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(e){return Promise.reject(e)}},u.update=function(){try{return this.fn?m(this.fn.update()):void 0}catch(e){return Promise.reject(e)}},u.getSW=function(){return void 0!==this.hn?Promise.resolve(this.hn):this.rn.promise},u.messageSW=function(t){try{return v(this.getSW(),(function(n){return e(n,t)}))}catch(e){return Promise.reject(e)}},u.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&e(this.fn.waiting,Tn)},u.pn=function(){var e=navigator.serviceWorker.controller;return e&&i(e.scriptURL,this.sn.toString())?e:void 0},u.bn=function(){try{var e=this;return function(t,n){try{var r=v(navigator.serviceWorker.register(e.sn,e.nn),(function(t){return e.un=performance.now(),t}))}catch(e){return n(e)}return r&&r.then?r.then(void 0,n):r}(0,(function(e){throw e}))}catch(e){return Promise.reject(e)}},(a=[{key:"active",get:function(){return this.en.promise}},{key:"controlling",get:function(){return this.on.promise}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(o.prototype,a),o}(function(){var e=function(){this.Pn=new Map},t=e.prototype;return t.addEventListener=function(e,t){this.Sn(e).add(t)},t.removeEventListener=function(e,t){this.Sn(e).delete(t)},t.dispatchEvent=function(e){e.target=this;for(var t,n=r(this.Sn(e.type));!(t=n()).done;)(0,t.value)(e)},t.Sn=function(e){return this.Pn.has(e)||this.Pn.set(e,new Set),this.Pn.get(e)},e}()),Dn=void 0,Mn="x-omrs-offline-response-body",Rn="x-omrs-offline-response-status",Nn="x-omrs-offline-caching-strategy";function Ln(){return Ln=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){S(i,r,o,a,u,"next",e)}function u(e){S(i,r,o,a,u,"throw",e)}a(void 0)}))}}((function(e){var t,n;return function(e,t){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=t.call(e,a)}catch(e){i=[6,e],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(t=r.sent())?[4,t.messageSW(e)]:[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 e;return j(this,(function(t){e=window.sessionStorage;try{e.setItem("someKeyHere","test"),e.removeItem("someKeyHere")}catch(t){if(t.code===DOMException.QUOTA_EXCEEDED_ERR&&0===e.length)return[2,!0]}return[2,!1]}))})),Un.apply(this,arguments)}function Bn(){return(Bn=x((function(){return j(this,(function(e){return[2,!window.indexedDB]}))}))).apply(this,arguments)}function Fn(){return Fn=x((function(){return j(this,(function(e){return[2,new Promise((function(e){var t=indexedDB.open("test");t.onerror=function(){return e(!0)},t.onsuccess=function(){return e(!1)}}))]}))})),Fn.apply(this,arguments)}function Vn(){return(Vn=x((function(){var e,t;return j(this,(function(n){switch(n.label){case 0:return[4,C()];case 1:return(t=n.sent())?[3,3]:[4,k()];case 2:t=n.sent(),n.label=3;case 3:return(e=t)?[3,5]:[4,P()];case 4:e=n.sent(),n.label=5;case 5:return[2,e]}}))}))).apply(this,arguments)}var Kn="openmrs3:offline-mode",Hn="unavailable";function $n(){return($n=x((function(){return j(this,(function(e){switch(e.label){case 0:return[4,A()];case 1:return e.sent()||(Hn="active"===localStorage.getItem(Kn)?"on":"off"),navigator.onLine,[2]}}))}))).apply(this,arguments)}var Gn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,qn=Object.keys,zn=Array.isArray;"undefined"==typeof Promise||Gn.Promise||(Gn.Promise=Promise);var Wn=Object.getPrototypeOf,Yn={}.hasOwnProperty,Zn=Object.defineProperty,Xn=Object.getOwnPropertyDescriptor;function Jn(e,t){var n;return Xn(e,t)||(n=Wn(e))&&Jn(n,t)}var Qn=[].slice;function er(e,t){if(R(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var n=[],r=0,o=t.length;r<o;++r){var i=er(e,t[r]);n.push(i)}return n}var a=t.indexOf(".");if(-1!==a){var u=e[t.substr(0,a)];return void 0===u?void 0:er(u,t.substr(a+1))}}function tr(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){V("string"!=typeof n&&"length"in n);for(var r=0,o=t.length;r<o;++r)tr(e,t[r],n[r])}else{var i=t.indexOf(".");if(-1!==i){var a=t.substr(0,i),u=t.substr(i+1);if(""===u)void 0===n?zn(e)&&!isNaN(parseInt(a))?e.splice(a,1):delete e[a]:e[a]=n;else{var c=e[a];c&&R(e,a)||(c=e[a]={}),tr(c,u,n)}}else void 0===n?zn(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=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(e){return["Int","Uint","Float"].map((function(t){return t+e+"Array"}))})))).filter((function(e){return Gn[e]})),or=rr.map((function(e){return Gn[e]}));H(rr,(function(e){return[e,!0]}));var ir=null;function ar(e){if(!e||"object"!=typeof e)return e;var t=ir&&ir.get(e);if(t)return t;if(zn(e)){t=[],ir&&ir.set(e,t);for(var n=0,r=e.length;n<r;++n)t.push(ar(e[n]))}else if(or.indexOf(e.constructor)>=0)t=e;else{var o=Wn(e);for(var i in t=o===Object.prototype?{}:Object.create(o),ir&&ir.set(e,t),e)R(e,i)&&(t[i]=ar(e[i]))}return t}var ur={}.toString,cr="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",sr="symbol"==(void 0===cr?"undefined":p(cr))?function(e){var t;return null!=e&&(t=e[cr])&&t.apply(e)}:function(){return null},lr={},fr="undefined"!=typeof Symbol?function(e){return"AsyncFunction"===e[Symbol.toStringTag]}:function(){return!1},dr="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href),pr=function(){return!0},hr=!new Error("").stack;function yr(){if(hr)try{throw yr.arguments,new Error}catch(e){return e}return new Error}var vr=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],br=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(vr),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(X).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+Z(this._e,2))}},toString:function(){return this.name+": "+this.message}}),U(Q).from(X),U(ee).from(X);var gr=br.reduce((function(e,t){return e[t]=t+"Error",e}),{}),wr=X,Sr=br.reduce((function(e,t){var n=function(e,n){this._e=yr(),this.name=r,e?"string"==typeof e?(this.message="".concat(e).concat(n?"\n "+n:""),this.inner=n||null):"object"==typeof e&&(this.message="".concat(e.name," ").concat(e.message),this.inner=e):(this.message=mr[t]||r,this.inner=null)},r=t+"Error";return U(n).from(wr),e[t]=n,e}),{});Sr.Syntax=SyntaxError,Sr.Type=TypeError,Sr.Range=RangeError;var Or=vr.reduce((function(e,t){return e[t+"Error"]=Sr[t],e}),{}),_r=br.reduce((function(e,t){return-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=Sr[t]),e}),{});_r.ModifyError=Q,_r.DexieError=X,_r.BulkError=ee;var Er={},xr=f("undefined"==typeof Promise?[]:function(){var e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,Wn(e),e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,Wn(t),e]}(),3),jr=xr[0],Pr=xr[1],kr=xr[2],Cr=Pr&&Pr.then,Ar=jr&&jr.constructor,Tr=!!kr,Ir=!1,Dr=kr?function(){kr.then(be)}:Gn.setImmediate?setImmediate.bind(null,be):Gn.MutationObserver?function(){var e=document.createElement("div");new MutationObserver((function(){be(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:function(){setTimeout(be,0)},Mr=function(e,t){Hr.push([e,t]),Nr&&(Dr(),Nr=!1)},Rr=!0,Nr=!0,Lr=[],Ur=[],Br=null,Fr=ne,Vr={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Re,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((function(e){try{Re(e[0],e[1])}catch(e){}}))}},Kr=Vr,Hr=[],$r=0,Gr=[],qr={get:function(){var e=function(e,r){var o=this,i=!t.global&&(t!==Kr||n!==Qr),a=i&&!xe(),u=new le((function(n,u){he(o,new fe(De(e,t,i,a),De(r,t,i,a),n,u,t))}));return dr&&ve(u,this),u},t=Kr,n=Qr;return e.prototype=Er,e},set:function(e){L(this,"then",e&&e.prototype===Er?qr:{get:function(){return e},set:qr.set})}};function zr(e,t){try{t((function(t){if(null===e._state){if(t===e)throw new TypeError("A promise cannot be resolved with itself.");var n=e._lib&&me();t&&"function"==typeof t.then?zr(e,(function(e,n){c(t,le)?t._then(e,n):t.then(e,n)})):(e._state=!0,e._value=t,pe(e)),n&&ge()}}),de.bind(null,e))}catch(t){de(e,t)}}function Wr(e,t,n){if(t.length===n)return t;var r="";if(!1===e._state){var o,i,a=e._value;null!=a?(o=a.name||"Error",i=a.message||a,r=Z(a,0)):(o=a,i=""),t.push(o+(i?": "+i:"")+r)}return dr&&((r=Z(e._stackHolder,2))&&-1===t.indexOf(r)&&t.push(r),e._prev&&Wr(e._prev,t,n)),t}N(le.prototype,{then:qr,_then:function(e,t){he(this,new fe(null,null,e,t,Kr))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=arguments[0],n=arguments[1];return"function"==typeof t?this.then(null,(function(e){return c(e,t)?n(e):Se(e)})):this.then(null,(function(e){return e&&e.name===t?n(e):Se(e)}))},finally:function(e){return this.then((function(t){return e(),t}),(function(t){return e(),Se(t)}))},stack:{get:function(){if(this._stack)return this._stack;try{Ir=!0;var e=Wr(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{Ir=!1}}},timeout:function(e,t){var n=this;return e<1/0?new le((function(r,o){var i=setTimeout((function(){return o(new Sr.Timeout(t))}),e);n.then(r,o).finally(clearTimeout.bind(null,i))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&L(le.prototype,Symbol.toStringTag,"Dexie.Promise"),Vr.env=Ae(),N(le,{all:function(){var e=W.apply(null,arguments).map(je);return new le((function(t,n){0===e.length&&t([]);var r=e.length;e.forEach((function(o,i){return le.resolve(o).then((function(n){e[i]=n,--r||t(e)}),n)}))}))},resolve:function(e){if(c(e,le))return e;if(e&&"function"==typeof e.then)return new le((function(t,n){e.then(t,n)}));var t=new le(Er,!0,e);return ve(t,Br),t},reject:Se,race:function(){var e=W.apply(null,arguments).map(je);return new le((function(t,n){e.map((function(e){return le.resolve(e).then(t,n)}))}))},PSD:{get:function(){return Kr},set:function(e){return Kr=e}},totalEchoes:{get:function(){return Qr}},newPSD:_e,usePSD:Te,scheduler:{get:function(){return Mr},set:function(e){Mr=e}},rejectionMapper:{get:function(){return Fr},set:function(e){Fr=e}},follow:function(e,t){return new le((function(n,r){return _e((function(t,n){var r=Kr;r.unhandleds=[],r.onunhandled=n,r.finalize=oe((function(){var e=this;!function(e){Gr.push((function t(){e(),Gr.splice(Gr.indexOf(t),1)})),++$r,Mr((function(){0==--$r&&we()}),[])}((function(){0===e.unhandleds.length?t():n(e.unhandleds[0])}))}),r.finalize),e()}),t,n,r)}))}}),Ar&&(Ar.allSettled&&L(le,"allSettled",(function(){var e=W.apply(null,arguments).map(je);return new le((function(t){0===e.length&&t([]);var n=e.length,r=new Array(n);e.forEach((function(e,o){return le.resolve(e).then((function(e){return r[o]={status:"fulfilled",value:e}}),(function(e){return r[o]={status:"rejected",reason:e}})).then((function(){return--n||t(r)}))}))}))})),Ar.any&&"undefined"!=typeof AggregateError&&L(le,"any",(function(){var e=W.apply(null,arguments).map(je);return new le((function(t,n){0===e.length&&n(new AggregateError([]));var r=e.length,o=new Array(r);e.forEach((function(e,i){return le.resolve(e).then((function(e){return t(e)}),(function(e){o[i]=e,--r||n(new AggregateError(o))}))}))}))})));var Yr={awaits:0,echoes:0,id:0},Zr=0,Xr=[],Jr=0,Qr=0,eo=0;-1===(""+Cr).indexOf("[native code]")&&(Ee=xe=te);var to=le.reject;function no(e,t,n,r){if(e.idbdb&&(e._state.openComplete||Kr.letThrough||e._vip)){var o=e._createTransaction(t,n,e._dbSchema);try{o.create(),e._state.PR1398_maxLoop=3}catch(o){return o.name===gr.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((function(){return no(e,t,n,r)}))):to(o)}return o._promise(t,(function(e,t){return _e((function(){return Kr.trans=o,r(e,t,o)}))})).then((function(e){return o._completion.then((function(){return e}))}))}if(e._state.openComplete)return to(new Sr.DatabaseClosed(e._state.dbOpenError));if(!e._state.isBeingOpened){if(!e._options.autoOpen)return to(new Sr.DatabaseClosed);e.open().catch(te)}return e._state.dbReadyPromise.then((function(){return no(e,t,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,co=ao,so=function(e){return!/(dexie\.js|dexie\.min\.js)/.test(e)},lo={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1},fo=function(){function e(){o(this,e)}return a(e,[{key:"_trans",value:function(e,t,n){var r=function(e,n,r){if(!r.schema[i])throw new Sr.NotFound("Table "+i+" not part of transaction");return t(r.idbtrans,r)},o=this._tx||Kr.trans,i=this.name,a=me();try{return o&&o.db===this.db?o===Kr.trans?o._promise(e,r,n):_e((function(){return o._promise(e,r,n)}),{trans:o,transless:Kr.transless||Kr}):no(this.db,e,[this.name],r)}finally{a&&ge()}}},{key:"get",value:function(e,t){var n=this;return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",(function(t){return n.core.get({trans:t,key:e}).then((function(e){return n.hook.reading.fire(e)}))})).then(t)}},{key:"where",value:function(e){var t=function(e,t){try{return 0===i.cmp(e,t)}catch(e){return!1}};if("string"==typeof e)return new this.db.WhereClause(this,e);if(zn(e))return new this.db.WhereClause(this,"[".concat(e.join("+"),"]"));var n=qn(e);if(1===n.length)return this.where(n[0]).equals(e[n[0]]);var r=this.schema.indexes.concat(this.schema.primKey).filter((function(e){return e.compound&&n.every((function(t){return e.keyPath.indexOf(t)>=0}))&&e.keyPath.every((function(e){return n.indexOf(e)>=0}))}))[0];if(r&&this.db._maxKey!==ro)return this.where(r.name).equals(r.keyPath.map((function(t){return e[t]})));!r&&dr&&console.warn("The query ".concat(JSON.stringify(e)," on ").concat(this.name," would benefit of a compound index [").concat(n.join("+"),"]"));var o=this.schema.idxByName,i=this.db._deps.indexedDB,a=f(n.reduce((function(n,r){var i=f(n,2),a=i[0],u=i[1],c=o[r],s=e[r];return[a||c,a||!c?Ne(u,c&&c.multi?function(e){var n=er(e,r);return zn(n)&&n.some((function(e){return t(s,e)}))}:function(e){return t(s,er(e,r))}):u]}),[null,null]),2),u=a[0],c=a[1];return u?this.where(u.name).equals(e[u.keyPath]).filter(c):r?this.filter(c):this.where(n).equals("")}},{key:"filter",value:function(e){return this.toCollection().and(e)}},{key:"count",value:function(e){return this.toCollection().count(e)}},{key:"offset",value:function(e){return this.toCollection().offset(e)}},{key:"limit",value:function(e){return this.toCollection().limit(e)}},{key:"each",value:function(e){return this.toCollection().each(e)}},{key:"toArray",value:function(e){return this.toCollection().toArray(e)}},{key:"toCollection",value:function(){return new this.db.Collection(new this.db.WhereClause(this))}},{key:"orderBy",value:function(e){return new this.db.Collection(new this.db.WhereClause(this,zn(e)?"[".concat(e.join("+"),"]"):e))}},{key:"reverse",value:function(){return this.toCollection().reverse()}},{key:"mapToClass",value:function(e){this.schema.mappedClass=e;var t=function(t){if(!t)return t;var n=Object.create(e.prototype);for(var r in t)if(R(t,r))try{n[r]=t[r]}catch(e){}return n};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=t,this.hook("reading",t),e}},{key:"defineClass",value:function(){return this.mapToClass((function(e){M(this,e)}))}},{key:"add",value:function(e,t){var n=this,r=this.schema.primKey,o=r.auto,i=r.keyPath,a=e;return i&&o&&(a=Le(i)(e)),this._trans("readwrite",(function(e){return n.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[a]})})).then((function(e){return e.numFailures?le.reject(e.failures[0]):e.lastResult})).then((function(t){if(i)try{tr(e,i,t)}catch(e){}return t}))}},{key:"update",value:function(e,t){if("object"!=typeof e||zn(e))return this.where(":id").equals(e).modify(t);var n=er(e,this.schema.primKey.keyPath);if(void 0===n)return to(new Sr.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?qn(t).forEach((function(n){tr(e,n,t[n])})):t(e,{value:e,primKey:n})}catch(e){}return this.where(":id").equals(n).modify(t)}},{key:"put",value:function(e,t){var n=this,r=this.schema.primKey,o=r.auto,i=r.keyPath,a=e;return i&&o&&(a=Le(i)(e)),this._trans("readwrite",(function(e){return n.core.mutate({trans:e,type:"put",values:[a],keys:null!=t?[t]:null})})).then((function(e){return e.numFailures?le.reject(e.failures[0]):e.lastResult})).then((function(t){if(i)try{tr(e,i,t)}catch(e){}return t}))}},{key:"delete",value:function(e){var t=this;return this._trans("readwrite",(function(n){return t.core.mutate({trans:n,type:"delete",keys:[e]})})).then((function(e){return e.numFailures?le.reject(e.failures[0]):void 0}))}},{key:"clear",value:function(){var e=this;return this._trans("readwrite",(function(t){return e.core.mutate({trans:t,type:"deleteRange",range:lo})})).then((function(e){return e.numFailures?le.reject(e.failures[0]):void 0}))}},{key:"bulkGet",value:function(e){var t=this;return this._trans("readonly",(function(n){return t.core.getMany({keys:e,trans:n}).then((function(e){return e.map((function(e){return t.hook.reading.fire(e)}))}))}))}},{key:"bulkAdd",value:function(e,t,n){var r=this,o=Array.isArray(t)?t:void 0,i=(n=n||(o?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(function(t){var n=r,a=r.schema.primKey,u=a.auto,c=a.keyPath;if(c&&o)throw new Sr.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new Sr.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,l=c&&u?e.map(Le(c)):e;return r.core.mutate({trans:t,type:"add",keys:o,values:l,wantResults:i}).then((function(e){var t=e.numFailures,r=e.results,o=e.lastResult,a=e.failures;if(0===t)return i?r:o;throw new ee("".concat(n.name,".bulkAdd(): ").concat(t," of ").concat(s," operations failed"),a)}))}))}},{key:"bulkPut",value:function(e,t,n){var r=this,o=Array.isArray(t)?t:void 0,i=(n=n||(o?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(function(t){var n=r,a=r.schema.primKey,u=a.auto,c=a.keyPath;if(c&&o)throw new Sr.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new Sr.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,l=c&&u?e.map(Le(c)):e;return r.core.mutate({trans:t,type:"put",keys:o,values:l,wantResults:i}).then((function(e){var t=e.numFailures,r=e.results,o=e.lastResult,a=e.failures;if(0===t)return i?r:o;throw new ee("".concat(n.name,".bulkPut(): ").concat(t," of ").concat(s," operations failed"),a)}))}))}},{key:"bulkDelete",value:function(e){var t=this,n=e.length;return this._trans("readwrite",(function(n){return t.core.mutate({trans:n,type:"delete",keys:e})})).then((function(e){var r=e.numFailures,o=e.lastResult,i=e.failures;if(0===r)return o;throw new ee("".concat(t.name,".bulkDelete(): ").concat(r," of ").concat(n," operations failed"),i)}))}}]),e}();function po(e,t){try{var n=ze(e),r=ze(t);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 e>t?1:e<t?-1:0;case"binary":return function(e,t){for(var n=e.length,r=t.length,o=n<r?n:r,i=0;i<o;++i)if(e[i]!==t[i])return e[i]<t[i]?-1:1;return n===r?0:n<r?-1:1}(We(e),We(t));case"Array":return function(e,t){for(var n=e.length,r=t.length,o=n<r?n:r,i=0;i<o;++i){var a=po(e[i],t[i]);if(0!==a)return a}return n===r?0:n<r?-1:1}(e,t)}}catch(e){}return NaN}var ho=function(){function e(){o(this,e)}return a(e,[{key:"_read",value:function(e,t){var n=this._ctx;return n.error?n.table._trans(null,to.bind(null,n.error)):n.table._trans("readonly",e).then(t)}},{key:"_write",value:function(e){var t=this._ctx;return t.error?t.table._trans(null,to.bind(null,t.error)):t.table._trans("readwrite",e,"locked")}},{key:"_addAlgorithm",value:function(e){var t=this._ctx;t.algorithm=Ne(t.algorithm,e)}},{key:"_iterate",value:function(e,t){return Ge(this._ctx,e,t,this._ctx.table.core)}},{key:"clone",value:function(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&M(n,e),t._ctx=n,t}},{key:"raw",value:function(){return this._ctx.valueMapper=null,this}},{key:"each",value:function(e){var t=this._ctx;return this._read((function(n){return Ge(t,e,n,t.table.core)}))}},{key:"count",value:function(e){var t=this;return this._read((function(e){var n=t._ctx,r=n.table.core;if(Fe(n,!0))return r.count({trans:e,query:{index:He(n,r.schema),range:n.range}}).then((function(e){return Math.min(e,n.limit)}));var o=0;return Ge(n,(function(){return++o,!1}),e,r).then((function(){return o}))})).then(e)}},{key:"sortBy",value:function(e,t){var n=function(e,t){var n=a(e,i),r=a(t,i);return n<r?-u:n>r?u:0},r=e.split(".").reverse(),o=r[0],i=r.length-1;function a(e,t){return t?a(e[r[t]],t-1):e[o]}var u="next"===this._ctx.dir?1:-1;return this.toArray((function(e){return e.sort(n)})).then(t)}},{key:"toArray",value:function(e){var t=this;return this._read((function(e){var n=t._ctx;if("next"===n.dir&&Fe(n,!0)&&n.limit>0){var r=n.valueMapper,o=He(n,n.table.core.schema);return n.table.core.query({trans:e,limit:n.limit,values:!0,query:{index:o,range:n.range}}).then((function(e){var t=e.result;return r?t.map(r):t}))}var i=[];return Ge(n,(function(e){return i.push(e)}),e,n.table.core).then((function(){return i}))}),e)}},{key:"offset",value:function(e){var t=this._ctx;return e<=0||(t.offset+=e,Fe(t)?Ke(t,(function(){var t=e;return function(e,n){return 0===t||(1===t?(--t,!1):(n((function(){e.advance(t),t=0})),!1))}})):Ke(t,(function(){var t=e;return function(){return--t<0}}))),this}},{key:"limit",value:function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),Ke(this._ctx,(function(){var t=e;return function(e,n,r){return--t<=0&&n(r),t>=0}}),!0),this}},{key:"until",value:function(e,t){return Ve(this._ctx,(function(n,r,o){return!e(n.value)||(r(o),t)})),this}},{key:"first",value:function(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)}},{key:"last",value:function(e){return this.reverse().first(e)}},{key:"filter",value:function(e){var t,n;return Ve(this._ctx,(function(t){return e(t.value)})),t=this._ctx,n=e,t.isMatch=Ne(t.isMatch,n),this}},{key:"and",value:function(e){return this.filter(e)}},{key:"or",value:function(e){return new this.db.WhereClause(this._ctx.table,e,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(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.key,n)}))}},{key:"eachUniqueKey",value:function(e){return this._ctx.unique="unique",this.eachKey(e)}},{key:"eachPrimaryKey",value:function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.primaryKey,n)}))}},{key:"keys",value:function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.key)})).then((function(){return n})).then(e)}},{key:"primaryKeys",value:function(e){var t=this._ctx;if("next"===t.dir&&Fe(t,!0)&&t.limit>0)return this._read((function(e){var n=He(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})})).then((function(e){return e.result})).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.primaryKey)})).then((function(){return n})).then(e)}},{key:"uniqueKeys",value:function(e){return this._ctx.unique="unique",this.keys(e)}},{key:"firstKey",value:function(e){return this.limit(1).keys((function(e){return e[0]})).then(e)}},{key:"lastKey",value:function(e){return this.reverse().firstKey(e)}},{key:"distinct",value:function(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var n={};return Ve(this._ctx,(function(e){var t=e.primaryKey.toString(),r=R(n,t);return n[t]=!0,!r})),this}},{key:"modify",value:function(e){var t=this,n=this._ctx;return this._write((function(r){var o;if("function"==typeof e)o=e;else{var i=qn(e),a=i.length;o=function(t){for(var n=!1,r=0;r<a;++r){var o=i[r],u=e[o];er(t,o)!==u&&(tr(t,o,u),n=!0)}return n}}var u=n.table.core,c=u.schema.primaryKey,s=c.outbound,l=c.extractKey,f=t.db._options.modifyChunkSize||200,d=[],p=0,h=[],y=function(e,t){var n=t.failures,r=t.numFailures;p+=e-r;var o=!0,i=!1,a=void 0;try{for(var u,c=qn(n)[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){var s=u.value;d.push(n[s])}}catch(e){i=!0,a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}};return t.clone().primaryKeys().then((function(t){var i=function(a){var c=Math.min(f,t.length-a);return u.getMany({trans:r,keys:t.slice(a,a+c),cache:"immutable"}).then((function(d){for(var p=[],h=[],v=s?[]:null,b=[],m=0;m<c;++m){var g=d[m],w={value:q(g),primKey:t[a+m]};!1!==o.call(w,w.value,w)&&(null==w.value?b.push(t[a+m]):s||0===po(l(g),l(w.value))?(h.push(w.value),s&&v.push(t[a+m])):(b.push(t[a+m]),p.push(w.value)))}var S=Fe(n)&&n.limit===1/0&&("function"!=typeof e||e===yo)&&{index:n.index,range:n.range};return Promise.resolve(p.length>0&&u.mutate({trans:r,type:"add",values:p}).then((function(e){for(var t in e.failures)b.splice(parseInt(t),1);y(p.length,e)}))).then((function(){return(h.length>0||S&&"object"==typeof e)&&u.mutate({trans:r,type:"put",keys:v,values:h,criteria:S,changeSpec:"function"!=typeof e&&e}).then((function(e){return y(h.length,e)}))})).then((function(){return(b.length>0||S&&e===yo)&&u.mutate({trans:r,type:"delete",keys:b,criteria:S}).then((function(e){return y(b.length,e)}))})).then((function(){return t.length>a+c&&i(a+f)}))}))};return i(0).then((function(){if(d.length>0)throw new Q("Error modifying one or more objects",d,p,h);return t.length}))}))}))}},{key:"delete",value:function(){var e=this._ctx,t=e.range;return Fe(e)&&(e.isPrimKey&&!co||3===t.type)?this._write((function(n){var r=e.table.core.schema.primaryKey,o=t;return e.table.core.count({trans:n,query:{index:r,range:o}}).then((function(t){return e.table.core.mutate({trans:n,type:"deleteRange",range:o}).then((function(e){var n=e.failures,r=(e.lastResult,e.results,e.numFailures);if(r)throw new Q("Could not delete some values",Object.keys(n).map((function(e){return n[e]})),t-r);return t-r}))}))})):this.modify(yo)}}]),e}(),yo=function(e,t){return t.value=null},vo=function(){function e(){o(this,e)}return a(e,[{key:"Collection",get:function(){return this._ctx.table.db.Collection}},{key:"between",value:function(e,t,n,r){n=!1!==n,r=!0===r;try{return this._cmp(e,t)>0||0===this._cmp(e,t)&&(n||r)&&(!n||!r)?Je(this):new this.Collection(this,(function(){return tt(e,t,!n,!r)}))}catch(e){return Xe(this,oo)}}},{key:"equals",value:function(e){return null==e?Xe(this,oo):new this.Collection(this,(function(){return nt(e)}))}},{key:"above",value:function(e){return null==e?Xe(this,oo):new this.Collection(this,(function(){return tt(e,void 0,!0)}))}},{key:"aboveOrEqual",value:function(e){return null==e?Xe(this,oo):new this.Collection(this,(function(){return tt(e,void 0,!1)}))}},{key:"below",value:function(e){return null==e?Xe(this,oo):new this.Collection(this,(function(){return tt(void 0,e,!1,!0)}))}},{key:"belowOrEqual",value:function(e){return null==e?Xe(this,oo):new this.Collection(this,(function(){return tt(void 0,e)}))}},{key:"startsWith",value:function(e){return"string"!=typeof e?Xe(this,"String expected."):this.between(e,e+ro,!0,!0)}},{key:"startsWithIgnoreCase",value:function(e){return""===e?this.startsWith(e):et(this,(function(e,t){return 0===e.indexOf(t[0])}),[e],ro)}},{key:"equalsIgnoreCase",value:function(e){return et(this,(function(e,t){return e===t[0]}),[e],"")}},{key:"anyOfIgnoreCase",value:function(){var e=W.apply(lr,arguments);return 0===e.length?Je(this):et(this,(function(e,t){return-1!==t.indexOf(e)}),e,"")}},{key:"startsWithAnyOfIgnoreCase",value:function(){var e=W.apply(lr,arguments);return 0===e.length?Je(this):et(this,(function(e,t){return t.some((function(t){return 0===e.indexOf(t)}))}),e,ro)}},{key:"anyOf",value:function(){var e=this,t=W.apply(lr,arguments),n=this._cmp;try{t.sort(n)}catch(e){return Xe(this,oo)}if(0===t.length)return Je(this);var r=new this.Collection(this,(function(){return tt(t[0],t[t.length-1])}));r._ondirectionchange=function(r){n="next"===r?e._ascending:e._descending,t.sort(n)};var o=0;return r._addAlgorithm((function(e,r,i){for(var a=e.key;n(a,t[o])>0;)if(++o===t.length)return r(i),!1;return 0===n(a,t[o])||(r((function(){e.continue(t[o])})),!1)})),r}},{key:"notEqual",value:function(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}},{key:"noneOf",value:function(){var e=W.apply(lr,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return Xe(this,oo)}var t=e.reduce((function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[-1/0,t]]}),null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})}},{key:"inAnyRange",value:function(e,t){var n=this,r=function(e,t){return d(e[0],t[0])},o=this._cmp,i=this._ascending,a=this._descending,u=this._min,c=this._max;if(0===e.length)return Je(this);if(!e.every((function(e){return void 0!==e[0]&&void 0!==e[1]&&i(e[0],e[1])<=0})))return Xe(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,l=!t||!1!==t.includeLowers,f=t&&!0===t.includeUppers,d=i;try{s=e.reduce((function(e,t){for(var n=0,r=e.length;n<r;++n){var i=e[n];if(o(t[0],i[1])<0&&o(t[1],i[0])>0){i[0]=u(i[0],t[0]),i[1]=c(i[1],t[1]);break}}return n===r&&e.push(t),e}),[]),s.sort(r)}catch(e){return Xe(this,oo)}var p=0,h=f?function(e){return i(e,s[p][1])>0}:function(e){return i(e,s[p][1])>=0},y=l?function(e){return a(e,s[p][0])>0}:function(e){return a(e,s[p][0])>=0},v=h,b=new this.Collection(this,(function(){return tt(s[0][0],s[s.length-1][1],!l,!f)}));return b._ondirectionchange=function(e){"next"===e?(v=h,d=i):(v=y,d=a),s.sort(r)},b._addAlgorithm((function(e,t,r){for(var o=e.key;v(o);)if(++p===s.length)return t(r),!1;return!!function(e){return!h(e)&&!y(e)}(o)||(0===n._cmp(o,s[p][1])||0===n._cmp(o,s[p][0])||t((function(){d===i?e.continue(s[p][0]):e.continue(s[p][1])})),!1)})),b}},{key:"startsWithAnyOf",value:function(){var e=W.apply(lr,arguments);return e.every((function(e){return"string"==typeof e}))?0===e.length?Je(this):this.inAnyRange(e.map((function(e){return[e,e+ro]}))):Xe(this,"startsWithAnyOf() only works with strings")}}]),e}(),bo=Ue(null,"storagemutated"),mo=function(){function e(){o(this,e)}return a(e,[{key:"_lock",value:function(){return V(!Kr.global),++this._reculock,1!==this._reculock||Kr.global||(Kr.lockOwnerFor=this),this}},{key:"_unlock",value:function(){if(V(!Kr.global),0==--this._reculock)for(Kr.global||(Kr.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{Te(e[1],e[0])}catch(e){}}return this}},{key:"_locked",value:function(){return this._reculock&&Kr.lockOwnerFor!==this}},{key:"create",value:function(e){var t=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(V(!this.idbtrans),!e&&!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 V(null===this._completion._state),(e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):n.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=Oe((function(n){ot(n),t._reject(e.error)})),e.onabort=Oe((function(n){ot(n),t.active&&t._reject(new Sr.Abort(e.error)),t.active=!1,t.on("abort").fire(n)})),e.oncomplete=Oe((function(){t.active=!1,t._resolve(),"mutatedParts"in e&&bo.storagemutated.fire(e.mutatedParts)})),this}},{key:"_promise",value:function(e,t,n){var r=this;if("readwrite"===e&&"readwrite"!==this.mode)return to(new Sr.ReadOnly("Transaction is readonly"));if(!this.active)return to(new Sr.TransactionInactive);if(this._locked())return new le((function(o,i){var a=r;r._blockedFuncs.push([function(){a._promise(e,t,n).then(o,i)},Kr])}));if(n)return _e((function(){var e=r,n=new le((function(n,r){e._lock();var o=t(n,r,e);o&&o.then&&o.then(n,r)}));return n.finally((function(){return e._unlock()})),n._lib=!0,n}));var o=new le((function(e,n){var o=t(e,n,r);o&&o.then&&o.then(e,n)}));return o._lib=!0,o}},{key:"_root",value:function(){return this.parent?this.parent._root():this}},{key:"waitFor",value:function(e){var t=this._root(),n=le.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then((function(){return n}));else{t._waitingFor=n,t._waitingQueue=[];var r=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(r.get(-1/0).onsuccess=e)}()}var o=t._waitingFor;return new le((function(e,r){n.then((function(n){return t._waitingQueue.push(Oe(e.bind(null,n)))}),(function(e){return t._waitingQueue.push(Oe(r.bind(null,e)))})).finally((function(){t._waitingFor===o&&(t._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(e){var t=this._memoizedTables||(this._memoizedTables={});if(R(t,e))return t[e];var n=this.schema[e];if(!n)throw new Sr.NotFound("Table "+e+" not part of transaction");var r=new this.db.Table(e,n,this);return r.core=this.db.core.table(e),t[e]=r,r}}]),e}(),go=function(e){try{return e.only([[]]),go=function(){return[[]]},[[]]}catch(e){return go=function(){return ro},ro}},wo=0,So=function(){function e(){o(this,e)}return a(e,[{key:"_parseStoresSpec",value:function(e,t){qn(e).forEach((function(n){if(null!==e[n]){var r=e[n].split(",").map((function(e,t){var n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return it(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),zn(r),0===t)})),o=r.shift();if(o.multi)throw new Sr.Schema("Primary key cannot be multi-valued");r.forEach((function(e){if(e.auto)throw new Sr.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new Sr.Schema("Index must have a name and cannot be an empty string")})),t[n]=ut(n,o,r)}}))}},{key:"stores",value:function(e){var t=this.db;this._cfg.storesSource=this._cfg.storesSource?M(this._cfg.storesSource,e):e;var n=t._versions,r={},o={};return n.forEach((function(e){M(r,e._cfg.storesSource),o=e._cfg.dbschema={},e._parseStoresSpec(r,o)})),t._dbSchema=o,pt(t,[t._allTables,t,t.Transaction.prototype]),dt(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],qn(o),o),t._storeNames=qn(o),this}},{key:"upgrade",value:function(e){return this._cfg.contentUpgrade=se(this._cfg.contentUpgrade||te,e),this}}]),e}();function Oo(e,t,n,r,o){return le.resolve().then((function(){var i=Kr.transless||Kr,a=e._createTransaction(t,n,e._dbSchema,r),u={trans:a,transless:i};if(r)a.idbtrans=r.idbtrans;else try{a.create(),e._state.PR1398_maxLoop=3}catch(r){return r.name===gr.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((function(){return Oo(e,t,n,null,o)}))):to(r)}var c,s=fr(o);s&&Ee();var l=le.follow((function(){if(c=o.call(a,a))if(s){var e=xe.bind(null,null);c.then(e,e)}else"function"==typeof c.next&&"function"==typeof c.throw&&(c=Et(c))}),u);return(c&&"function"==typeof c.then?le.resolve(c).then((function(e){return a.active?e:to(new Sr.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))})):l.then((function(){return c}))).then((function(e){return r&&a._resolve(),a._completion.then((function(){return e}))})).catch((function(e){return a._reject(e),to(e)}))}))}var _o={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return l(s({},e),{table:function(t){var n=function(t){var n,r,o=t.query.index;return o.isVirtual?l(s({},t),{query:{index:o,range:(n=t.query.range,r=o.keyTail,{type:1===n.type?2:n.type,lower:jt(n.lower,n.lowerOpen?e.MAX_KEY:e.MIN_KEY,r),lowerOpen:!0,upper:jt(n.upper,n.upperOpen?e.MIN_KEY:e.MAX_KEY,r),upperOpen:!0})}}):t},r=e.table(t),o=r.schema,i={},a=[];function u(e,t,n){var r=lt(e),o=i[r]=i[r]||[],c=null==e?0:"string"==typeof e?1:e.length,f=t>0,d=l(s({},n),{isVirtual:f,keyTail:t,keyLength:c,extractKey:ct(e),unique:!f&&n.unique});return o.push(d),d.isPrimaryKey||a.push(d),c>1&&u(2===c?e[0]:e.slice(0,c-1),t+1,n),o.sort((function(e,t){return e.keyTail-t.keyTail})),d}var c=u(o.primaryKey.keyPath,0,o.primaryKey);i[":id"]=[c];var f=!0,d=!1,p=void 0;try{for(var h,y=o.indexes[Symbol.iterator]();!(f=(h=y.next()).done);f=!0){var v=h.value;u(v.keyPath,0,v)}}catch(e){d=!0,p=e}finally{try{f||null==y.return||y.return()}finally{if(d)throw p}}var b=l(s({},r),{schema:l(s({},o),{primaryKey:c,indexes:a,getIndexByKeyPath:function(e){var t=i[lt(e)];return t&&t[0]}}),count:function(e){return r.count(n(e))},query:function(e){return r.query(n(e))},openCursor:function(t){var o=t.query.index,i=o.keyTail,a=o.isVirtual,u=o.keyLength;return a?r.openCursor(n(t)).then((function(n){return n&&function(n){var r=Object.create(n,{continue:{value:function(r){null!=r?n.continue(jt(r,t.reverse?e.MAX_KEY:e.MIN_KEY,i)):t.unique?n.continue(n.key.slice(0,u).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,i)):n.continue()}},continuePrimaryKey:{value:function(t,r){n.continuePrimaryKey(jt(t,e.MAX_KEY,i),r)}},primaryKey:{get:function(){return n.primaryKey}},key:{get:function(){var e=n.key;return 1===u?e[0]:e.slice(0,u)}},value:{get:function(){return n.value}}});return r}(n)})):r.openCursor(t)}});return b}})}};function Eo(e,t,n,r){return n=n||{},r=r||"",qn(e).forEach((function(o){if(R(t,o)){var i=e[o],a=t[o];if("object"==typeof i&&"object"==typeof a&&i&&a){var u=z(i);u!==z(a)?n[r+o]=t[o]:"Object"===u?Eo(i,a,n,r+o+"."):i!==a&&(n[r+o]=t[o])}else i!==a&&(n[r+o]=t[o])}else n[r+o]=void 0})),qn(t).forEach((function(o){R(e,o)||(n[r+o]=t[o])})),n}var xo={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return l(s({},e),{table:function(t){var n=e.table(t),r=n.schema.primaryKey,o=l(s({},n),{mutate:function(e){var o=function(e){var t=Kr.trans,o=e.keys||function(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}(r,e);if(!o)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?l(s({},e),{keys:o}):s({},e)).type&&(e.values=d(e.values)),e.keys&&(e.keys=d(e.keys)),function(e,t,n){return"add"===t.type?Promise.resolve([]):e.getMany({trans:t.trans,keys:n,cache:"immutable"})}(n,e,o).then((function(i){var a=o.map((function(n,o){var a=i[o],s={onerror:null,onsuccess:null};if("delete"===e.type)u.fire.call(s,n,a,t);else if("add"===e.type||void 0===a){var l=c.fire.call(s,n,e.values[o],t);null==n&&null!=l&&(n=l,e.keys[o]=n,r.outbound||tr(e.values[o],r.keyPath,n))}else{var d=Eo(a,e.values[o]),p=f.fire.call(s,d,n,a,t);if(p){var h=e.values[o];Object.keys(p).forEach((function(e){R(h,e)?h[e]=p[e]:tr(h,e,p[e])}))}}return s}));return n.mutate(e).then((function(t){for(var n=t.failures,r=t.results,u=t.numFailures,c=t.lastResult,s=0;s<o.length;++s){var l=r?r[s]:o[s],f=a[s];null==l?f.onerror&&f.onerror(n[s]):f.onsuccess&&f.onsuccess("put"===e.type&&i[s]?e.values[s]:l)}return{failures:n,results:r,numFailures:u,lastResult:c}})).catch((function(e){return a.forEach((function(t){return t.onerror&&t.onerror(e)})),Promise.reject(e)}))}))},i=Kr.trans,a=i.table(t).hook,u=a.deleting,c=a.creating,f=a.updating;switch(e.type){case"add":if(c.fire===te)break;return i._promise("readwrite",(function(){return o(e)}),!0);case"put":if(c.fire===te&&f.fire===te)break;return i._promise("readwrite",(function(){return o(e)}),!0);case"delete":if(u.fire===te)break;return i._promise("readwrite",(function(){return o(e)}),!0);case"deleteRange":if(u.fire===te)break;return i._promise("readwrite",(function(){return function(e){return p(e.trans,e.range,1e4)}(e)}),!0)}return n.mutate(e);function p(e,t,i){return n.query({trans:e,values:!1,query:{index:r,range:t},limit:i}).then((function(n){var r=n.result;return o({type:"delete",keys:r,trans:e}).then((function(n){return n.numFailures>0?Promise.reject(n.failures[0]):r.length<i?{failures:[],numFailures:0,lastResult:void 0}:p(e,l(s({},t),{lower:r[r.length-1],lowerOpen:!0}),i)}))}))}}});return o}})}},jo={stack:"dbcore",level:-1,create:function(e){return{table:function(t){var n=e.table(t);return l(s({},n),{getMany:function(e){if(!e.cache)return n.getMany(e);var t=Pt(e.keys,e.trans._cache,"clone"===e.cache);return t?le.resolve(t):n.getMany(e).then((function(t){return e.trans._cache={keys:e.keys,values:"clone"===e.cache?q(t):t},t}))},mutate:function(e){return"add"!==e.type&&(e.trans._cache=null),n.mutate(e)}})}}}},Po=function(e,t){if(!this){var n=new Po;return e&&"d"in e&&M(n,e),n}M(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function ko(e,t,n){var r=po(t,n);if(!isNaN(r)){if(r>0)throw RangeError();if(kt(e))return M(e,{from:t,to:n,d:1});var o=e.l,i=e.r;if(po(n,e.from)<0)return o?ko(o,t,n):e.l={from:t,to:n,d:1,l:null,r:null},Tt(e);if(po(t,e.to)>0)return i?ko(i,t,n):e.r={from:t,to:n,d:1,l:null,r:null},Tt(e);po(t,e.from)<0&&(e.from=t,e.l=null,e.d=i?i.d+1:1),po(n,e.to)>0&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1);var a=!e.r;o&&!e.l&&Ct(e,o),i&&a&&Ct(e,i)}}N(Po.prototype,u({add:function(e){return Ct(this,e),this},addKey:function(e){return ko(this,e,e),this},addKeys:function(e){var t=this;return e.forEach((function(e){return ko(t,e,e)})),this}},cr,(function(){return At(this)})));var Co,Ao={stack:"dbcore",level:0,create:function(e){var t=e.schema.name,n=new Po(e.MIN_KEY,e.MAX_KEY);return l(s({},e),{table:function(r){var o=e.table(r),i=o.schema,a=i.primaryKey,u=a.extractKey,c=a.outbound,d=l(s({},o),{mutate:function(e){var a=e.trans,u=a.mutatedParts||(a.mutatedParts={}),c=function(e){var n="idb://".concat(t,"/").concat(r,"/").concat(e);return u[n]||(u[n]=new Po)},s=c(""),l=c(":dels"),d=e.type,p=f("deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[],2),h=p[0],y=p[1],v=e.trans._cache;return o.mutate(e).then((function(e){if(zn(h)){"delete"!==d&&(h=e.results),s.addKeys(h);var t=Pt(h,v);t||"add"===d||l.addKeys(h),(t||y)&&function(e,t,n,r){t.indexes.forEach((function(t){var o=function(e){return null!=e?t.extractKey(e):null},i=e(t.name||""),a=function(e){return t.multiEntry&&zn(e)?e.forEach((function(e){return i.addKey(e)})):i.addKey(e)};(n||r).forEach((function(e,t){var i=n&&o(n[t]),u=r&&o(r[t]);0!==po(i,u)&&(null!=i&&a(i),null!=u&&a(u))}))}))}(c,i,t,y)}else if(h){var r={from:h.lower,to:h.upper};l.add(r),s.add(r)}else s.add(n),l.add(n),i.indexes.forEach((function(e){return c(e.name).add(n)}));return e}))}}),p=function(t){var n,r,o=t.query,i=o.index,a=o.range;return[i,new Po(null!==(n=a.lower)&&void 0!==n?n:e.MIN_KEY,null!==(r=a.upper)&&void 0!==r?r:e.MAX_KEY)]},h={get:function(e){return[a,new Po(e.key)]},getMany:function(e){return[a,(new Po).addKeys(e.keys)]},count:p,query:p,openCursor:p};return qn(h).forEach((function(e){d[e]=function(i){var a=Kr.subscr;if(a){var d=function(e){var n="idb://".concat(t,"/").concat(r,"/").concat(e);return a[n]||(a[n]=new Po)},p=d(""),y=d(":dels"),v=f(h[e](i),2),b=v[0],m=v[1];if(d(b.name||"").add(m),!b.isPrimaryKey){if("count"!==e){var g="query"===e&&c&&i.values&&o.query(l(s({},i),{values:!1}));return o[e].apply(this,arguments).then((function(t){if("query"===e){if(c&&i.values)return g.then((function(e){var n=e.result;return p.addKeys(n),t}));var n=i.values?t.result.map(u):t.result;i.values?p.addKeys(n):y.addKeys(n)}else if("openCursor"===e){var r=t,o=i.values;return r&&Object.create(r,{key:{get:function(){return y.addKey(r.primaryKey),r.key}},primaryKey:{get:function(){var e=r.primaryKey;return y.addKey(e),e}},value:{get:function(){return o&&p.addKey(r.primaryKey),r.value}}})}return t}))}y.add(n)}}return o[e].apply(this,arguments)}})),d}})}},To=function(){function e(t,n){var r=this;o(this,e),this._middlewares={},this.verno=0;var i=e.dependencies;this._options=n=s({addons:e.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,c={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:te,dbReadyPromise:null,cancelOpen:te,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};c.dbReadyPromise=new le((function(e){c.dbReadyResolve=e})),c.openCanceller=new le((function(e,t){c.cancelOpen=t})),this._state=c,this.name=t,this.on=Ue(this,"populate","blocked","versionchange","close",{ready:[se,te]}),this.on.ready.subscribe=F(this.on.ready.subscribe,(function(t){return function(n,o){var i=r;e.vip((function(){var e=i._state;if(e.openComplete)e.dbOpenError||le.resolve().then(n),o&&t(n);else if(e.onReadyBeingFired)e.onReadyBeingFired.push(n),o&&t(n);else{t(n);var r=i;o||t((function e(){r.on.ready.unsubscribe(n),r.on.ready.unsubscribe(e)}))}}))}})),this.Collection=(u=this,Be(ho.prototype,(function(e,t){this.db=u;var n=lo,r=null;if(t)try{n=t()}catch(e){r=e}var o=e._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!==ne?a:null}}))),this.Table=function(e){return Be(fo.prototype,(function(t,n,r){this.db=e,this._tx=r,this.name=t,this.schema=n,this.hook=e._allTables[t]?e._allTables[t].hook:Ue(null,{creating:[ie,te],reading:[re,ne],updating:[ue,te],deleting:[ae,te]})}))}(this),this.Transaction=function(e){return Be(mo.prototype,(function(t,n,r,o,i){var a=this;this.db=e,this.mode=t,this.storeNames=n,this.schema=r,this.chromeTransactionDurability=o,this.idbtrans=null,this.on=Ue(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 le((function(e,t){a._resolve=e,a._reject=t})),this._completion.then((function(){a.active=!1,a.on.complete.fire()}),(function(e){var t=a.active;return a.active=!1,a.on.error.fire(e),a.parent?a.parent._reject(e):t&&a.idbtrans&&a.idbtrans.abort(),to(e)}))}))}(this),this.Version=function(e){return Be(So.prototype,(function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(e){return Be(vo.prototype,(function(t,n,r){this.db=e,this._ctx={table:t,index:":id"===n?null:n,or:r};var o=e._deps.indexedDB;if(!o)throw new Sr.MissingAPI;this._cmp=this._ascending=o.cmp.bind(o),this._descending=function(e,t){return o.cmp(t,e)},this._max=function(e,t){return o.cmp(e,t)>0?e:t},this._min=function(e,t){return o.cmp(e,t)<0?e:t},this._IDBKeyRange=e._deps.IDBKeyRange}))}(this),this.on("versionchange",(function(e){e.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(e){!e.newVersion||e.newVersion<e.oldVersion?console.warn("Dexie.delete('".concat(r.name,"') was blocked")):console.warn("Upgrade '".concat(r.name,"' blocked by other connection holding version ").concat(e.oldVersion/10))})),this._maxKey=go(n.IDBKeyRange),this._createTransaction=function(e,t,n,o){return new r.Transaction(e,t,n,r._options.chromeTransactionDurability,o)},this._fireOnBlocked=function(e){var t=r;r.on("blocked").fire(e),io.filter((function(e){return e.name===t.name&&e!==t&&!e._state.vcFired})).map((function(t){return t.on("versionchange").fire(e)}))},this.use(_o),this.use(xo),this.use(Ao),this.use(jo),this.vip=Object.create(this,{_vip:{value:!0}}),a.forEach((function(e){return e(r)}))}return a(e,[{key:"version",value:function(e){if(isNaN(e)||e<.1)throw new Sr.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new Sr.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);var t=this._versions,n=t.filter((function(t){return t._cfg.version===e}))[0];return n||(n=new this.Version(e),t.push(n),t.sort(ht),n.stores({}),this._state.autoSchema=!1,n)}},{key:"_whenReady",value:function(e){var t=this;return this.idbdb&&(this._state.openComplete||Kr.letThrough||this._vip)?e():new le((function(e,n){if(t._state.openComplete)return n(new Sr.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._options.autoOpen)return void n(new Sr.DatabaseClosed);t.open().catch(te)}t._state.dbReadyPromise.then(e,n)})).then(e)}},{key:"use",value:function(e){var t=e.stack,n=e.create,r=e.level,o=e.name;o&&this.unuse({stack:t,name:o});var i=this._middlewares[t]||(this._middlewares[t]=[]);return i.push({stack:t,create:n,level:null==r?10:r,name:o}),i.sort((function(e,t){return e.level-t.level})),this}},{key:"unuse",value:function(e){var t=e.stack,n=e.name,r=e.create;return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter((function(e){return r?e.create!==r:!!n&&e.name!==n}))),this}},{key:"open",value:function(){return function(e){var t=function(){if(n.openCanceller!==o)throw new Sr.DatabaseClosed("db.open() was cancelled")},n=e._state,r=e._deps.indexedDB;if(n.isBeingOpened||e.idbdb)return n.dbReadyPromise.then((function(){return n.dbOpenError?to(n.dbOpenError):e}));dr&&(n.openCanceller._stackHolder=yr()),n.isBeingOpened=!0,n.dbOpenError=null,n.openComplete=!1;var o=n.openCanceller,i=n.dbReadyResolve,a=null,u=!1;return le.race([o,("undefined"==typeof navigator?le.resolve():_t()).then((function(){return new le((function(o,i){if(t(),!r)throw new Sr.MissingAPI;var c=e.name,s=n.autoSchema?r.open(c):r.open(c,Math.round(10*e.verno));if(!s)throw new Sr.MissingAPI;s.onerror=rt(i),s.onblocked=Oe(e._fireOnBlocked),s.onupgradeneeded=Oe((function(t){if(a=s.transaction,n.autoSchema&&!e._options.allowEmptyDB){s.onerror=ot,a.abort(),s.result.close();var o=r.deleteDatabase(c);o.onsuccess=o.onerror=Oe((function(){i(new Sr.NoSuchDatabase("Database ".concat(c," doesnt exist")))}))}else{a.onerror=rt(i);var l=t.oldVersion>Math.pow(2,62)?0:t.oldVersion;u=l<1,e._novip.idbdb=s.result,function(e,t,n,r){var o=e._dbSchema,i=e._createTransaction("readwrite",e._storeNames,o);i.create(n),i._completion.catch(r);var a=i._reject.bind(i),u=Kr.transless||Kr;_e((function(){Kr.trans=i,Kr.transless=u,0===t?(qn(o).forEach((function(e){vt(n,e,o[e].primKey,o[e].indexes)})),ft(e,n),le.follow((function(){return e.on.populate.fire(i)})).catch(a)):function(e,t,n,r){var o=e._novip,i=[],a=o._versions,u=o._dbSchema=mt(0,o.idbdb,r),c=!1;return a.filter((function(e){return e._cfg.version>=t})).forEach((function(e){i.push((function(){var i=u,a=e._cfg.dbschema;gt(o,i,r),gt(o,a,r),u=o._dbSchema=a;var s=yt(i,a);s.add.forEach((function(e){vt(r,e[0],e[1].primKey,e[1].indexes)})),s.change.forEach((function(e){if(e.recreate)throw new Sr.Upgrade("Not yet support for changing primary key");var t=r.objectStore(e.name);e.add.forEach((function(e){return bt(t,e)})),e.change.forEach((function(e){t.deleteIndex(e.name),bt(t,e)})),e.del.forEach((function(e){return t.deleteIndex(e)}))}));var l=e._cfg.contentUpgrade;if(l&&e._cfg.version>t){ft(o,r),n._memoizedTables={},c=!0;var f=$(a);s.del.forEach((function(e){f[e]=i[e]})),pt(o,[o.Transaction.prototype]),dt(o,[o.Transaction.prototype],qn(f),f),n.schema=f;var d,p=fr(l);p&&Ee();var h=le.follow((function(){if((d=l(n))&&p){var e=xe.bind(null,null);d.then(e,e)}}));return d&&"function"==typeof d.then?le.resolve(d):h.then((function(){return d}))}})),i.push((function(t){c&&uo||function(e,t){[].slice.call(t.db.objectStoreNames).forEach((function(n){return null==e[n]&&t.db.deleteObjectStore(n)}))}(e._cfg.dbschema,t),pt(o,[o.Transaction.prototype]),dt(o,[o.Transaction.prototype],o._storeNames,o._dbSchema),n.schema=o._dbSchema}))})),function e(){return i.length?le.resolve(i.shift()(n.idbtrans)).then(e):le.resolve()}().then((function(){var e,t;t=r,qn(e=u).forEach((function(n){t.db.objectStoreNames.contains(n)||vt(t,n,e[n].primKey,e[n].indexes)}))}))}(e,t,i,n).catch(a)}))}(e,l/10,a,i)}}),i),s.onsuccess=Oe((function(){a=null;var t,r=e._novip.idbdb=s.result,i=B(r.objectStoreNames);if(i.length>0)try{var l=r.transaction(1===(t=i).length?t[0]:t,"readonly");n.autoSchema?function(e,t,n){var r=e._novip;r.verno=t.version/10;var o=r._dbSchema=mt(0,t,n);r._storeNames=B(t.objectStoreNames,0),dt(r,[r._allTables],qn(o),o)}(e,r,l):(gt(e,e._dbSchema,l),function(e,t){var n=yt(mt(0,e.idbdb,t),e._dbSchema);return!(n.add.length||n.change.some((function(e){return e.add.length||e.change.length})))}(e,l)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),ft(e,l)}catch(e){}io.push(e),r.onversionchange=Oe((function(t){n.vcFired=!0,e.on("versionchange").fire(t)})),r.onclose=Oe((function(t){e.on("close").fire(t)})),u&&function(e,t){var n=e.indexedDB,r=e.IDBKeyRange;!St(n)&&"__dbnames"!==t&&wt(n,r).put({name:t}).catch(te)}(e._deps,c),o()}),i)}))}))]).then((function(){return t(),n.onReadyBeingFired=[],le.resolve(Ot((function(){return e.on.ready.fire(e.vip)}))).then((function t(){if(n.onReadyBeingFired.length>0){var r=n.onReadyBeingFired.reduce(se,te);return n.onReadyBeingFired=[],le.resolve(Ot((function(){return r(e.vip)}))).then(t)}}))})).finally((function(){n.onReadyBeingFired=null,n.isBeingOpened=!1})).then((function(){return e})).catch((function(t){n.dbOpenError=t;try{a&&a.abort()}catch(e){}return o===n.openCanceller&&e._close(),to(t)})).finally((function(){n.openComplete=!0,i()}))}(this)}},{key:"_close",value:function(){var e=this._state,t=io.indexOf(this);if(t>=0&&io.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new le((function(t){e.dbReadyResolve=t})),e.openCanceller=new le((function(t,n){e.cancelOpen=n}))}},{key:"close",value:function(){this._close();var e=this._state;this._options.autoOpen=!1,e.dbOpenError=new Sr.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)}},{key:"delete",value:function(){var e=this,t=arguments.length>0,n=this._state;return new le((function(r,o){var i=e,a=function(){var e=i;i.close();var t=i._deps.indexedDB.deleteDatabase(i.name);t.onsuccess=Oe((function(){!function(e,t){var n=e.indexedDB,r=e.IDBKeyRange;!St(n)&&"__dbnames"!==t&&wt(n,r).delete(t).catch(te)}(e._deps,e.name),r()})),t.onerror=rt(o),t.onblocked=i._fireOnBlocked};if(t)throw new Sr.InvalidArgument("Arguments not allowed in db.delete()");n.isBeingOpened?n.dbReadyPromise.then(a):a()}))}},{key:"backendDB",value:function(){return this.idbdb}},{key:"isOpen",value:function(){return null!==this.idbdb}},{key:"hasBeenClosed",value:function(){var e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name}},{key:"hasFailed",value:function(){return null!==this._state.dbOpenError}},{key:"dynamicallyOpened",value:function(){return this._state.autoSchema}},{key:"tables",get:function(){var e=this;return qn(this._allTables).map((function(t){return e._allTables[t]}))}},{key:"transaction",value:function(){var e=xt.apply(this,arguments);return this._transaction.apply(this,e)}},{key:"_transaction",value:function(e,t,n){var r=this,o=Kr.trans;o&&o.db===this&&-1===e.indexOf("!")||(o=null);var i,a,u=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{var s=this;if(a=t.map((function(e){var t=c(e,s.Table)?e.name:e;if("string"!=typeof t)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t})),"r"==e||"readonly"===e)i="readonly";else{if("rw"!=e&&"readwrite"!=e)throw new Sr.InvalidArgument("Invalid transaction mode: "+e);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(e){if(o&&-1===o.storeNames.indexOf(e)){if(!u)throw new Sr.SubTransaction("Table "+e+" not included in parent transaction.");o=null}})),u&&o&&!o.active&&(o=null)}}catch(e){return o?o._promise(null,(function(t,n){n(e)})):to(e)}var l=Oo.bind(null,this,i,a,o,n);return o?o._promise(i,l,"lock"):Kr.trans?Te(Kr.transless,(function(){return r._whenReady(l)})):this._whenReady(l)}},{key:"table",value:function(e){if(!R(this._allTables,e))throw new Sr.InvalidTable("Table ".concat(e," does not exist"));return this._allTables[e]}}]),e}(),Io="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable",Do=function(){function e(t){o(this,e),this._subscribe=t}return a(e,[{key:"subscribe",value:function(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})}},{key:Io,value:function(){return this}}]),e}();try{Co={indexedDB:Gn.indexedDB||Gn.mozIndexedDB||Gn.webkitIndexedDB||Gn.msIndexedDB,IDBKeyRange:Gn.IDBKeyRange||Gn.webkitIDBKeyRange}}catch(e){Co={indexedDB:null,IDBKeyRange:null}}var Mo=To;N(Mo,l(s({},_r),{delete:function(e){return new Mo(e,{addons:[]}).delete()},exists:function(e){return new Mo(e,{addons:[]}).open().then((function(e){return e.close(),!0})).catch("NoSuchDatabaseError",(function(){return!1}))},getDatabaseNames:function(e){try{return function(e){var t=e.indexedDB,n=e.IDBKeyRange;return St(t)?Promise.resolve(t.databases()).then((function(e){return e.map((function(e){return e.name})).filter((function(e){return"__dbnames"!==e}))})):wt(t,n).toCollection().primaryKeys()}(Mo.dependencies).then(e)}catch(e){return to(new Sr.MissingAPI)}},defineClass:function(){return function(e){M(this,e)}},ignoreTransaction:function(e){return Kr.trans?Te(Kr.transless,e):e()},vip:Ot,async:function(e){return function(){try{var t=Et(e.apply(this,arguments));return t&&"function"==typeof t.then?t:le.resolve(t)}catch(e){return to(e)}}},spawn:function(e,t,n){try{var r=Et(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:le.resolve(r)}catch(e){return to(e)}},currentTransaction:{get:function(){return Kr.trans||null}},waitFor:function(e,t){var n=le.resolve("function"==typeof e?Mo.ignoreTransaction(e):e).timeout(t||6e4);return Kr.trans?Kr.trans.waitFor(n):n},Promise:le,debug:{get:function(){return dr},set:function(e){Y(e,"dexie"===e?function(){return!0}:so)}},derive:U,extend:M,props:N,override:F,Events:Ue,on:bo,liveQuery:function(e){return new Do((function(t){var n=function(){return qn(a).some((function(e){return i[e]&&function(e,t){var n=At(t),r=n.next();if(r.done)return!1;for(var o=r.value,i=At(e),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[e],a[e])}))},r=fr(e),o=!1,i={},a={},u={get closed(){return o},unsubscribe:function(){o=!0,bo.storagemutated.unsubscribe(l)}};t.start&&t.start(u);var c=!1,s=!1,l=function(e){Dt(i,e),n()&&f()},f=function(){if(!c&&!o){i={};var d={},p=function(t){r&&Ee();var n=function(){return _e(e,{subscr:t,trans:null})},o=Kr.trans?Te(Kr.transless,n):n();return r&&o.then(xe,xe),o}(d);s||(bo("storagemutated",l),s=!0),c=!0,Promise.resolve(p).then((function(e){c=!1,o||(n()?f():(i={},a=d,t.next&&t.next(e)))}),(function(e){c=!1,t.error&&t.error(e),u.unsubscribe()}))}};return f(),u}))},extendObservabilitySet:Dt,getByKeyPath:er,setByKeyPath:tr,delByKeyPath:function(e,t){"string"==typeof t?tr(e,t,void 0):"length"in t&&[].map.call(t,(function(t){tr(e,t,void 0)}))},shallowClone:$,deepClone:q,getObjectDiff:Eo,cmp:po,asap:K,minKey:-1/0,addons:[],connections:io,errnames:gr,dependencies:Co,semVer:"3.2.3",version:"3.2.3".split(".").map((function(e){return parseInt(e)})).reduce((function(e,t,n){return e+t/Math.pow(10,2*n)}))})),Mo.maxKey=go(Mo.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(bo("storagemutated",(function(e){var t;Ro||(ao?(t=document.createEvent("CustomEvent")).initCustomEvent("x-storagemutated-1",!0,!0,e):t=new CustomEvent("x-storagemutated-1",{detail:e}),Ro=!0,dispatchEvent(t),Ro=!1)})),addEventListener("x-storagemutated-1",(function(e){var t=e.detail;Ro||Mt(t)})));var Ro=!1;if("undefined"!=typeof BroadcastChannel){var No=new BroadcastChannel("x-storagemutated-1");"function"==typeof No.unref&&No.unref(),bo("storagemutated",(function(e){Ro||No.postMessage(e)})),No.onmessage=function(e){e.data&&Mt(e.data)}}else if("undefined"!=typeof self&&"undefined"!=typeof navigator){bo("storagemutated",(function(e){try{Ro||("undefined"!=typeof localStorage&&localStorage.setItem("x-storagemutated-1",JSON.stringify({trig:Math.random(),changedParts:e})),"object"==typeof self.clients&&d(self.clients.matchAll({includeUncontrolled:!0})).forEach((function(t){return t.postMessage({type:"x-storagemutated-1",changedParts:e})})))}catch(e){}})),"undefined"!=typeof addEventListener&&addEventListener("storage",(function(e){if("x-storagemutated-1"===e.key){var t=JSON.parse(e.newValue);t&&Mt(t.changedParts)}}));var Lo=self.document&&navigator.serviceWorker;Lo&&Lo.addEventListener("message",(function(e){var t=e.data;t&&"x-storagemutated-1"===t.type&&Mt(t.changedParts)}))}le.rejectionMapper=function(e,t){if(!e||c(e,X)||c(e,TypeError)||c(e,SyntaxError)||!e.name||!Or[e.name])return e;var n=new Or[e.name](t||e.message,e);return"stack"in e&&L(n,"stack",{get:function(){return this.inner.stack}}),n},Y(dr,so);var Uo=h(766),Bo=h(685);function Fo(e){return Fo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Fo(e)}function Vo(e,t){return Vo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Vo(e,t)}var Ko=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Vo(e,t)}(n,e);var t=function(e){var t=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(e){return!1}}();return function(){var n,r=Fo(e);if(t){var o=Fo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!=((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":void 0===n?"undefined":p(n))&&"function"!=typeof t?Rt(e):t;var n}(this,n)}}(n);function n(){var e;return function(e,t){if(!c(e,t))throw new TypeError("Cannot call a class as a function")}(this,n),Nt(Rt(e=t.call(this,"EsmOffline")),"syncQueue",void 0),Nt(Rt(e),"dynamicOfflineData",void 0),e.version(4).stores({syncQueue:"++id,userId,type,[userId+type]",dynamicOfflineData:"++id,type,identifier,*users,&[type+identifier]"}),e.syncQueue=e.table("syncQueue"),e.dynamicOfflineData=e.table("dynamicOfflineData"),e}return n}(To),Ho=new Ko,$o={},Go=(0,Bo.createGlobalStore)("offline-synchronization",{});function qo(){return qo=Ft((function(){var e,t,n,r,o,i,a,u,c,s,l,f,d;return $t(this,(function(p){switch(p.label){case 0:return Go.getState().synchronization?[2]:[4,Ho.syncQueue.count()];case 1:e=p.sent(),t={},n=Object.entries($o),r=n.length,o={},i=new AbortController,a=function(){var e,t,n=Go.getState().synchronization;Go.setState({synchronization:(e=Kt({},n),t={pendingCount:n.pendingCount-1},t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e)})},p.label=2;case 2:p.trys.push([2,,10,11]),Go.setState({synchronization:{totalCount:e,pendingCount:e,abortController:i}}),u=0,p.label=3;case 3:if(!(u<r&&n.length>0))return[3,8];c=n.length,p.label=4;case 4:return c--?(s=Ht(n[c],2),l=s[0],f=s[1],(d=f.dependsOn.map((function(e){return t[e]}))).every(Boolean)?(o[l]={},[4,Promise.all(d)]):[3,6]):[3,7];case 5:p.sent(),t[l]=function(e,t,n,r){return zo.apply(this,arguments)}(f,o,i,a),n.splice(c,1),p.label=6;case 6:return[3,4];case 7:return u++,[3,3];case 8:return[4,Promise.allSettled(Object.values(t))];case 9:return p.sent(),[3,11];case 10:return Go.setState({synchronization:void 0}),[7];case 11:return[2]}}))})),qo.apply(this,arguments)}function zo(){return zo=Ft((function(e,t,n,r){var o,i,a,u,c,s,l,f,d,p,h,y,v,b,m,g,w;return $t(this,(function(S){switch(S.label){case 0:return o=e.type,i=e.dependsOn,a=e.process,u=[],c=[],[4,zt()];case 1:return s=S.sent(),[4,Ho.syncQueue.where({type:o,userId:s}).each((function(e,t){u.push([t.primaryKey,e.content,e.descriptor]),c.push(e.content)}))];case 2:S.sent(),l=0,S.label=3;case 3:if(!(l<u.length))return[3,11];f=Ht(u[l],3),d=f[0],p=f[1],h=f[2],y=h.id,v=h.dependencies,b=void 0===v?[]:v,S.label=4;case 4:return S.trys.push([4,7,9,10]),[4,a(p,{abort:n,index:l,items:c,userId:s,dependencies:b.map((function(e){var n=e.id,r=e.type;return i.includes(r)?t[r][n]:void 0}))})];case 5:return m=S.sent(),void 0!==y&&(t[o][y]=m),[4,Ho.syncQueue.delete(d)];case 6:return S.sent(),[3,10];case 7:return g=S.sent(),[4,Ho.syncQueue.update(d,{lastError:{name:null==g?void 0:g.name,message:null!==(w=null==g?void 0:g.message)&&void 0!==w?w:null==g?void 0:g.toString()}})];case 8:return S.sent(),[3,10];case 9:return r(),[7];case 10:return l++,[3,3];case 11:return[2]}}))})),zo.apply(this,arguments)}function Wo(){return(Wo=Ft((function(){var e;return $t(this,(function(t){switch(t.label){case 0:return[4,(0,Uo.getLoggedInUser)()];case 1:return[2,(null==(e=t.sent())?void 0:e.uuid)||"*"]}}))}))).apply(this,arguments)}function Yo(){return(Yo=Ft((function(e,t,n,r){var o;return $t(this,(function(i){switch(i.label){case 0:return void 0===(o=r&&r.id)?[3,2]:[4,Ho.syncQueue.where({type:t,userId:e}).filter((function(e){return(null==e?void 0:e.descriptor.id)===o})).delete().catch(To.errnames.DatabaseClosed)];case 1:i.sent(),i.label=2;case 2:return[4,Ho.syncQueue.add({type:t,content:n,userId:e,descriptor:r||{},createdOn:new Date}).catch(To.errnames.DatabaseClosed,(function(){return-1}))];case 3:return[2,i.sent()]}}))}))).apply(this,arguments)}function Zo(){return(Zo=Ft((function(e,t,n){return $t(this,(function(r){switch(r.label){case 0:return[4,zt()];case 1:return[4,Wt(r.sent(),e,t,n)];case 2:return[2,r.sent()]}}))}))).apply(this,arguments)}function Xo(){return(Xo=Ft((function(e,t){return $t(this,(function(n){switch(n.label){case 0:return[4,Xt(e,t)];case 1:return[2,n.sent().map((function(e){return e.content}))]}}))}))).apply(this,arguments)}function Jo(){return(Jo=Ft((function(e,t){var n;return $t(this,(function(r){switch(r.label){case 0:return n=t?{type:t,userId:e}:{userId:e},[4,Ho.syncQueue.where(n).toArray().catch(To.errnames.DatabaseClosed,(function(){return[]}))];case 1:return[2,r.sent()]}}))}))).apply(this,arguments)}function Qo(){return(Qo=Ft((function(e){return $t(this,(function(t){switch(t.label){case 0:return[4,zt()];case 1:return[4,Zt(t.sent(),e)];case 2:return[2,t.sent()]}}))}))).apply(this,arguments)}function ei(){return(ei=Ft((function(e){return $t(this,(function(t){switch(t.label){case 0:return[4,zt()];case 1:return[4,Xt(t.sent(),e)];case 2:return[2,t.sent()]}}))}))).apply(this,arguments)}function ti(){return(ti=Ft((function(e){return $t(this,(function(t){switch(t.label){case 0:return[4,Ho.syncQueue.get(e).catch(To.errnames.DatabaseClosed,(function(){}))];case 1:return[2,t.sent()]}}))}))).apply(this,arguments)}function ni(){return(ni=Ft((function(e){var t,n,r;return $t(this,(function(o){switch(o.label){case 0:return[4,en(e)];case 1:if(!(n=o.sent()))throw new Error("No sync item with the ID ".concat(e," exists."));if(!(r=null===(t=$o[n.type])||void 0===t?void 0:t.options.onBeginEditSyncItem))throw new Error("A sync item with the ID ".concat(e,' 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=Ft((function(e){return $t(this,(function(t){switch(t.label){case 0:return[4,Ho.syncQueue.delete(e).catch(To.errnames.DatabaseClosed)];case 1:return t.sent(),[2]}}))}))).apply(this,arguments)}for(var oi,ii={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},ai=new Uint8Array(16),ui=[],ci=0;ci<256;++ci)ui.push((ci+256).toString(16).slice(1));var si=function(e,t,n){if(ii.randomUUID&&!t&&!e)return ii.randomUUID();var r=(e=e||{}).random||(e.rng||an)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(ui[e[t+0]]+ui[e[t+1]]+ui[e[t+2]]+ui[e[t+3]]+"-"+ui[e[t+4]]+ui[e[t+5]]+"-"+ui[e[t+6]]+ui[e[t+7]]+"-"+ui[e[t+8]]+ui[e[t+9]]+"-"+ui[e[t+10]]+ui[e[t+11]]+ui[e[t+12]]+ui[e[t+13]]+ui[e[t+14]]+ui[e[t+15]]).toLowerCase()}(r)},li="OFFLINE+",fi={};function di(){return(di=fn((function(e){return dn(this,(function(t){switch(t.label){case 0:return[4,_n()];case 1:return[4,vn(t.sent(),e)];case 2:return[2,t.sent()]}}))}))).apply(this,arguments)}function pi(){return(pi=fn((function(e,t){var n;return dn(this,(function(r){switch(r.label){case 0:return n=t?{type:t,users:e}:{users:e},[4,(new Ko).dynamicOfflineData.where(n).toArray().catch(To.errnames.DatabaseClosed,(function(){return[]}))];case 1:return[2,r.sent()]}}))}))).apply(this,arguments)}function hi(){return(hi=fn((function(e,t){return dn(this,(function(n){switch(n.label){case 0:return[4,_n()];case 1:return[4,mn(n.sent(),e,t)];case 2:return[2,n.sent()]}}))}))).apply(this,arguments)}function yi(){return yi=fn((function(e,t,n){var r,o;return dn(this,(function(i){switch(i.label){case 0:return[4,(r=new Ko).dynamicOfflineData.get({type:t,identifier:n}).catch(To.errnames.DatabaseClosed,(function(){}))];case 1:return(o=i.sent())?[3,3]:[4,r.dynamicOfflineData.add({users:[e],type:t,identifier:n}).catch(To.errnames.DatabaseClosed)];case 2:return i.sent(),[3,5];case 3:return o.users.includes(e)?[3,5]:[4,r.dynamicOfflineData.update(o.id,{users:(a=o.users,function(e){if(Array.isArray(e))return sn(e)}(a)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(a)||function(e,t){if(e){if("string"==typeof e)return sn(e,t);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)?sn(e,t):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([e])}).catch(To.errnames.DatabaseClosed)];case 4:i.sent(),i.label=5;case 5:return[2]}var a}))})),yi.apply(this,arguments)}function vi(){return(vi=fn((function(e,t){return dn(this,(function(n){switch(n.label){case 0:return[4,_n()];case 1:return[4,wn(n.sent(),e,t)];case 2:return[2,n.sent()]}}))}))).apply(this,arguments)}function bi(){return bi=fn((function(e,t,n){var r,o;return dn(this,(function(i){switch(i.label){case 0:return[4,(r=new Ko).dynamicOfflineData.get({type:t,identifier:n,users:e}).catch(To.errnames.DatabaseClosed,(function(){}))];case 1:return(o=i.sent())?o.users.length>1?[4,r.dynamicOfflineData.update(o.id,{users:o.users.filter((function(t){return t!==e}))}).catch(To.errnames.DatabaseClosed)]:[3,3]:[3,5];case 2:return i.sent(),[3,5];case 3:return[4,r.dynamicOfflineData.delete(o.id).catch(To.errnames.DatabaseClosed)];case 4:i.sent(),i.label=5;case 5:return[2]}}))})),bi.apply(this,arguments)}function mi(){return mi=fn((function(e,t){var n;return dn(this,(function(r){switch(r.label){case 0:return[4,yn(e)];case 1:return n=r.sent(),[4,Promise.all(n.map((o=fn((function(e){return dn(this,(function(n){return[2,On(e.type,e.identifier,t)]}))})),function(e){return o.apply(this,arguments)})))];case 2:return r.sent(),[2]}var o}))})),mi.apply(this,arguments)}function gi(){return gi=fn((function(e,t,n){var r,o,i,a,u,c,s,l,f;return dn(this,(function(d){switch(d.label){case 0:return[4,bn(e,t)];case 1:return d.sent(),r=new Ko,[4,_n()];case 2:return o=d.sent(),[4,r.dynamicOfflineData.get({type:e,identifier:t}).catch(To.errnames.DatabaseClosed,(function(){}))];case 3:return i=d.sent(),a=pn().filter((function(t){return t.type===e})),i?[4,Promise.all(a.map((p=fn((function(e){var r,o,i;return dn(this,(function(a){try{return e.sync(t,n),[2,{id:e.id,error:void 0}]}catch(t){return i=null!==(o=null===(r=t.message)||void 0===r?void 0:r.toString())&&void 0!==o?o:t.toString(),[2,{id:e.id,error:i}]}return[2]}))})),function(e){return p.apply(this,arguments)})))]:[2];case 4:return u=d.sent(),c=u.filter((function(e){return!e.error})).map((function(e){return e.id})),s=u.filter((function(e){return e.error})).map((function(e){return e.id})),l=u.filter((function(e){return e.error})).map((function(e){return{handlerId:e.id,message:e.error}})),f={syncedOn:new Date,syncedBy:o,succeededHandlers:c,erroredHandlers:s,errors:l},i.id?[4,r.dynamicOfflineData.update(i.id,{syncState:f}).catch(To.errnames.DatabaseClosed)]:[3,6];case 5:d.sent(),d.label=6;case 6:return[2]}var p}))})),gi.apply(this,arguments)}function wi(){return(wi=fn((function(){var e;return dn(this,(function(t){switch(t.label){case 0:return[4,(0,Uo.getLoggedInUser)()];case 1:if(!(e=t.sent().uuid))throw new Error("Using the dynamic offline data API requires a logged in user.");return[2,e]}}))}))).apply(this,arguments)}var Si=(0,Bo.createGlobalStore)("offline-patients",{offlinePatientDataSyncState:{},handlers:{}});function Oi(){return Oi=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){En(i,r,o,a,u,"next",e)}function u(e){En(i,r,o,a,u,"throw",e)}a(void 0)}))}}((function(e){return function(e,t){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=t.call(e,a)}catch(e){i=[6,e],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(t){switch(t.label){case 0:return kn(),[4,On("patient",e)];case 1:return t.sent(),[2]}}))})),Oi.apply(this,arguments)}}(),y}())}}}))},4798:(e,t,n)=>{"use strict";var r=n(5047),o=n.n(r);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function a(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)}function u(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function u(e){a(i,r,o,u,c,"next",e)}function c(e){a(i,r,o,u,c,"throw",e)}u(void 0)}))}}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){c(e,t,n[t])}))}return e}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||h(e,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.")}()}function d(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(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.")}()}e=n.hmd(e);var p=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function h(e,t){if(e){if("string"==typeof e)return i(e,t);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)?i(e,t):void 0}}System.register(["react","@openmrs/esm-config","@openmrs/esm-extensions","@openmrs/esm-globals","react-dom","react-i18next","@openmrs/esm-api","dayjs"],(function(t,r){var i={},a={},c={},h={},y={},v={},b={},m={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(y,"__esModule",{value:!0}),{setters:[function(e){Object.keys(e).forEach((function(t){i[t]=e[t]}))},function(e){a.getConfigStore=e.getConfigStore,a.getExtensionConfigFromStore=e.getExtensionConfigFromStore,a.getExtensionsConfigStore=e.getExtensionsConfigStore,a.interpolateUrl=e.interpolateUrl,a.navigate=e.navigate},function(e){c.getConnectedExtensions=e.getConnectedExtensions,c.getExtensionInternalStore=e.getExtensionInternalStore,c.getExtensionStore=e.getExtensionStore,c.registerExtensionSlot=e.registerExtensionSlot,c.renderExtension=e.renderExtension},function(e){h.subscribeConnectivityChanged=e.subscribeConnectivityChanged},function(e){Object.keys(e).forEach((function(t){y[t]=e[t]}))},function(e){v.I18nextProvider=e.I18nextProvider},function(e){b.defaultVisitCustomRepresentation=e.defaultVisitCustomRepresentation,b.fetchCurrentPatient=e.fetchCurrentPatient,b.getCurrentUser=e.getCurrentUser,b.getLocations=e.getLocations,b.getSessionStore=e.getSessionStore,b.getVisitStore=e.getVisitStore,b.getVisitTypes=e.getVisitTypes,b.openmrsFetch=e.openmrsFetch,b.userHasAccess=e.userHasAccess},function(e){m.default=e.default}],execute:function(){t(function(){var t={332:function(e){e.exports=function(e,t,n){t.prototype.isToday=function(){var e="YYYY-MM-DD",t=n();return this.format(e)===t.format(e)}}},645:function(e,t,n){var r=n(493);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},570:function(){System.register(["@openmrs/esm-state"],(function(e,t){var n={};return{setters:[function(e){n.getGlobalStore=e.getGlobalStore}],execute:function(){e(function(){var e={685:function(e){e.exports=n}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return function(){var e=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},t=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},n=function(e){for(var n=arguments,r=function(r){var o=null!=n[r]?n[r]:{},i=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(o).filter((function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable})))),i.forEach((function(n){t(e,n,o[n])}))},o=1;o<arguments.length;o++)r(o);return e},i=function(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e},a=function(e,r,o){var a;d.setState((function(u){var c;return{flags:i(n({},u.flags),t({},e,{enabled:null!==(a=null===(c=u.flags[e])||void 0===c?void 0:c.enabled)&&void 0!==a&&a,label:r,description:o}))}}))},u=function(e){return d.getState().flags[e].enabled},c=function(e,t){d.subscribe((function(n){t(n.flags[e].enabled)}))},s=function(e,r){d.setState((function(o){return{flags:i(n({},o.flags),t({},e,i(n({},o.flags[e]),{enabled:r})))}}))};r.r(o),r.d(o,{featureFlagsStore:function(){return d},getFeatureFlag:function(){return u},registerFeatureFlag:function(){return a},setFeatureFlag:function(){return s},subscribeToFeatureFlag:function(){return c}});var l=r(685),f={flags:function(){var e={},t=!0,r=!1,o=void 0;try{for(var i,a=Object.keys(localStorage)[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var u=i.value;if(u.startsWith("openmrs:feature-flag:")){var c=u.replace("openmrs:feature-flag:",""),s=JSON.parse(localStorage.getItem("openmrs:feature-flag-meta:".concat(c))||"{}");e[c]=n({enabled:"true"===localStorage.getItem(u)},s)}}}catch(e){r=!0,o=e}finally{try{t||null==a.return||a.return()}finally{if(r)throw o}}return e}()},d=(0,l.getGlobalStore)("feature-flags",f);d.subscribe((function(t){var n,r=!0,o=!1,i=void 0;try{for(var a,u=Object.entries(t.flags)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var c=function(e){if(Array.isArray(e))return e}(n=a.value)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(n)||function(t,n){if(t){if("string"==typeof t)return e(t,2);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(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,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.")}(),s=c[0],l=c[1];localStorage.setItem("openmrs:feature-flag:".concat(s),l.enabled.toString()),localStorage.setItem("openmrs:feature-flag-meta:".concat(s),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}())}}}))},385:function(){System.register([],(function(e,t){return{execute:function(){e(function(){var e=function(e,t){var n=u[e];if(n)return n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value.setState(t,!0),n.active=!0,n.value;var r=a()((function(){return t}));return u[e]={value:r,active:!0},r},t=function(e,t){var n=u[e];if(!n){var r=a()((function(){return null!=t?t:{}}));return u[e]={value:r,active:!1},r}return n.value},n=function(e,t,n){var r=t(e.getState());return e.subscribe((function(e){var o=t(e);o!==r&&(r=o,n(o))}))},r={d:function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};r.r(o),r.d(o,{createGlobalStore:function(){return e},getGlobalStore:function(){return t},subscribeTo:function(){return n}});var i=function(e){var t,n=new Set,r=function(e,r){var o="function"==typeof e?e(t):e;if(!Object.is(o,t)){var i=t;t=(null!=r?r:"object"!=typeof o)?o:Object.assign({},t,o),n.forEach((function(e){return e(t,i)}))}},o=function(){return t},i={setState:r,getState:o,subscribe:function(e){return n.add(e),function(){return n.delete(e)}},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 t=e(r,o,i),i},a=function(e){return e?i(e):i},u={};return setTimeout((function(){"development"===window.spaEnv&&(window.stores=u)}),1e3),o}())}}}))},173:function(e,t,n){var r=function(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(e){return!0}},o=n(954),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=o.useState,u=o.useEffect,c=o.useLayoutEffect,s=o.useDebugValue,l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),o=a({inst:{value:n,getSnapshot:t}}),i=o[0].inst,l=o[1];return c((function(){i.value=n,i.getSnapshot=t,r(i)&&l({inst:i})}),[e,n,t]),u((function(){return r(i)&&l({inst:i}),e((function(){r(i)&&l({inst:i})}))}),[e]),s(n),n};t.useSyncExternalStore=void 0!==o.useSyncExternalStore?o.useSyncExternalStore:l},374:function(e,t,n){e.exports=n(173)},766:function(e){e.exports=b},824:function(e){e.exports=a},45:function(e){e.exports=c},728:function(e){e.exports=h},688:function(e){e.exports=m},954:function(e){e.exports=i},493:function(e){e.exports=y},281:function(e){e.exports=v}},r={};function g(e){var n=r[e];if(void 0!==n)return n.exports;var o=r[e]={exports:{}};return t[e].call(o.exports,o,o.exports,g),o.exports}g.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return g.d(t,{a:t}),t},g.d=function(e,t){for(var n in t)g.o(t,n)&&!g.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},g.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},g.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var w={};return function(){var t=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},r=function(e){var n=e.to,r=e.templateParams,o=e.children,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["to","templateParams","children"]);return Le.default.createElement("a",function(e){for(var n=arguments,r=function(r){var o=null!=n[r]?n[r]:{},i=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(o).filter((function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable})))),i.forEach((function(n){t(e,n,o[n])}))},o=1;o<arguments.length;o++)r(o);return e}({onClick:function(e){return function(e,t,n){e.metaKey||e.ctrlKey||e.shiftKey||0!=e.button||(e.preventDefault(),(0,Be.navigate)({to:t,templateParams:n}))}(e,n,r)},href:(0,Be.interpolateUrl)(n,r)},i),o)},i=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},a=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},c=function(e){for(var t=arguments,n=function(n){var r=null!=t[n]?t[n]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),o.forEach((function(t){a(e,t,r[t])}))},r=1;r<arguments.length;r++)n(r);return e},h=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},y=function(){var e=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e)||function(e,t){if(e){if("string"==typeof e)return h(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)?h(e,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.")}()}((0,Le.useState)(window.navigator.onLine)),t=e[0],n=e[1];return(0,Le.useEffect)((function(){return(0,Ke.subscribeConnectivityChanged)((function(e){var t=e.online;return n(t)}))}),[]),t},v=function(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}},b=function(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}},m=function(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}},S=function(e){var t=this.__data__=new ze(e);this.size=t.size},O=function(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Et;++t<n;)this.add(e[t])},_=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},E=function(e){var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e)||function(e,t){if(e){if("string"==typeof e)return _(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)?_(e,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.")}()}((0,Le.useState)([])),n=t[0],r=t[1];return(0,Le.useEffect)((function(){var t=function(t){var o,i,a=null!==(i=null===(o=t.slots[e])||void 0===o?void 0:o.assignedExtensions)&&void 0!==i?i:[];Nn(a,n)||r(a)};return t((0,Fe.getExtensionStore)().getState()),(0,Fe.getExtensionStore)().subscribe(t)}),[e,n]),n},x=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},j=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},P=function(e){for(var t=arguments,n=function(n){var r=null!=t[n]?t[n]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),o.forEach((function(t){j(e,t,r[t])}))},r=1;r<arguments.length;r++)n(r);return e},k=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||C(e,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.")}()},C=function(e,t){if(e){if("string"==typeof e)return x(e,t);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)?x(e,t):void 0}},A=function(e,t){var n=function(n){r[n]=function(){var r=arguments;e.setState((function(e){for(var o,i=[e],a=0;a<r.length;a++)i.push(r[a]);return(o=t)[n].apply(o,function(e){if(Array.isArray(e))return x(e)}(u=i)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(u)||C(u)||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 u}))}};"function"==typeof t&&(t=t(e));var r={};for(var o in t)n(o);return r},T=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Un,n=arguments.length>2?arguments[2]:void 0,r=k((0,Le.useState)((function(){return t(e.getState())})),2),o=r[0],i=r[1];return(0,Le.useEffect)((function(){return(0,Ln.subscribeTo)(e,t,i)}),[e,t]),P({},o,(0,Le.useMemo)((function(){return n?A(e,n):{}}),[e,n]))},I=function(e,t){return T(e,Un,t)},D=function(e){return function(t){var n=k((0,Le.useState)(e.getState()),2),r=n[0],o=n[1];return(0,Le.useEffect)((function(){return e.subscribe((function(e){return o(e)}))}),[]),P({},r,(0,Le.useMemo)((function(){return t?A(e,t):{}}),[t]))}},M=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},R=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return M(e,t);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)?M(e,t):void 0}}(e,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=function(e){var t=y(),n=E(e),r=T(Bn.featureFlagsStore),o=(0,Le.useMemo)((function(){return Object.entries(r.flags).filter((function(e){return R(e,2)[1].enabled})).map((function(e){return R(e,1)[0]}))}),[r.flags]);return(0,Le.useMemo)((function(){return(0,Fe.getConnectedExtensions)(n,t,o)}),[n,t,o])},L=function(e){var t=(0,Le.useContext)(Ue).moduleName;if(!t)throw Error("ComponentContext has not been provided. This should come from @openmrs/esm-react-utils.");return(0,Le.useEffect)((function(){(0,Fe.registerExtensionSlot)(t,e)}),[]),{extensions:N(e),extensionSlotName:e,extensionSlotModuleName:t}},U=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},B=function(e){for(var t=arguments,n=function(n){var r=null!=t[n]?t[n]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),o.forEach((function(t){U(e,t,r[t])}))},r=1;r<arguments.length;r++)n(r);return e},F=function(e){return e},V=function(e){var t=e.name,n=e.extensionSlotName,r=e.select,o=void 0===r?F:r,i=e.children,a=e.state,u=e.style,c=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["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 s,l,f,d,p=null!=t?t:n,h=(0,Le.useRef)(null),y=L(p),v=y.extensions,b=y.extensionSlotModuleName,m=(0,Le.useMemo)((function(){return o(v)}),[o,v]),g=(0,Le.useMemo)((function(){if("function"==typeof i&&!Le.default.isValidElement(i))return m.map((function(e){return i(e)}))}),[i,m]);return Le.default.createElement("div",B({ref:h,"data-extension-slot-name":p,"data-extension-slot-module-name":b,style:(f=B({},u),d={position:"relative"},d=null!=d?d:{},Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(d)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(d)).forEach((function(e){Object.defineProperty(f,e,Object.getOwnPropertyDescriptor(d,e))})),f)},c),p&&m.map((function(e,t){return Le.default.createElement(Ue.Provider,{key:e.id,value:{moduleName:b,extension:{extensionId:e.id,extensionSlotName:p,extensionSlotModuleName:b}}},null!==(l=null!==(s=null==g?void 0:g[t])&&void 0!==s?s:"function"!=typeof i?i:null)&&void 0!==l?l:Le.default.createElement(Ve,{state:a}))})))},K=function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n},H=function(e){for(var t=arguments,n=function(n){var r=null!=t[n]?t[n]:{};n%2?K(Object(r),!0).forEach((function(t){$(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):K(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))},r=1;r<arguments.length;r++)n(r);return e},$=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},G=function(e,t){var n;if("function"!=typeof(n=t.domElement?function(){return t.domElement}:t.domElementGetter?t.domElementGetter:e.domElementGetter?e.domElementGetter:function(e){var t=e.appName||e.name;if(!t)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(t);return function(){var e=document.getElementById(n);return e||((e=document.createElement("div")).id=n,document.body.appendChild(e)),e}}(t)))throw Error("single-spa's dom-element-getter-helpers was given an invalid domElementGetter for application or parcel '".concat(t.name,"'. Expected a function, received ").concat(Kn(n)));return function(){var e=n(t);if(!s(e,HTMLElement))throw Error("single-spa's dom-element-getter-helpers: domElementGetter returned an invalid dom element for application or parcel '".concat(t.name,"'. Expected HTMLElement, received ").concat(Kn(e)));return e}},q=function(e){if("object"!==Vn(e))throw new Error("single-spa-react requires a configuration object");var t=H(H({},$n),e);if(!t.React)throw new Error("single-spa-react must be passed opts.React");if(!t.ReactDOM&&!t.ReactDOMClient)throw new Error("single-spa-react must be passed opts.ReactDOM or opts.ReactDOMClient");if(!t.rootComponent&&!t.loadRootComponent)throw new Error("single-spa-react must be passed opts.rootComponent or opts.loadRootComponent");if(t.errorBoundary&&"function"!=typeof t.errorBoundary)throw Error("The errorBoundary opt for single-spa-react must either be omitted or be a function that returns React elements");!Hn&&t.React.createContext&&(Hn=t.React.createContext()),t.SingleSpaRoot=function(e){function t(e){t.displayName="SingleSpaRoot(".concat(e.name,")")}return t.prototype=Object.create(e.React.Component.prototype),t.prototype.componentDidMount=function(){setTimeout(this.props.mountFinished)},t.prototype.componentWillUnmount=function(){setTimeout(this.props.unmountFinished)},t.prototype.render=function(){return setTimeout(this.props.updateFinished),this.props.children},t}(t);var n={bootstrap:z.bind(null,t),mount:W.bind(null,t),unmount:Y.bind(null,t)};return t.parcelCanUpdate&&(n.update=Z.bind(null,t)),n},z=function(e,t){return e.rootComponent?Promise.resolve():e.loadRootComponent(t).then((function(t){e.rootComponent=t}))},W=function(e,t){return new Promise((function(n,r){e.suppressComponentDidCatchWarning||!function(e){if(!(e&&"string"==typeof e.version&&e.version.indexOf(".")>=0))return!1;var t=e.version.slice(0,e.version.indexOf("."));try{return Number(t)>=16}catch(e){return!1}}(e.React)||e.errorBoundary||e.errorBoundaryClass||(e.rootComponent.prototype?e.rootComponent.prototype.componentDidCatch||console.warn("single-spa-react: ".concat(t.name||t.appName||t.childAppName,"'s rootComponent should implement componentDidCatch to avoid accidentally unmounting the entire single-spa application.")):console.warn("single-spa-react: ".concat(t.name||t.appName||t.childAppName,"'s rootComponent does not implement an error boundary. If using a functional component, consider providing an opts.errorBoundary to singleSpaReact(opts).")));var o=Q(e,t,(function(){n(this)})),i=G(e,t)(),a=function(e){var t=e.renderType,n=e.elementToRender,r=e.domElement,o=e.reactDom[t];if("function"!=typeof o)throw new Error('renderType "'.concat(t,'" did not return a function.'));switch(t){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:X(e),renderType:J(e)});e.domElements[t.name]=i,e.renderResults[t.name]=a}))},Y=function(e,t){return new Promise((function(n){e.unmountResolves[t.name]=n;var r=e.renderResults[t.name];r&&r.unmount?r.unmount():X(e).unmountComponentAtNode(e.domElements[t.name]),delete e.domElements[t.name],delete e.renderResults[t.name]}))},Z=function(e,t){return new Promise((function(n){e.updateResolves[t.name]||(e.updateResolves[t.name]=[]),e.updateResolves[t.name].push(n);var r=Q(e,t,null),o=e.renderResults[t.name];if(o&&o.render)o.render(r);else{var i=G(e,t)();X(e).render(r,i)}}))},X=function(e){return e.ReactDOMClient||e.ReactDOM},J=function(e){return"function"==typeof e.renderType?e.renderType():e.renderType},Q=function(e,t,n){var r=e.React.createElement(e.rootComponent,t),o=Hn?e.React.createElement(Hn.Provider,{value:t},r):r;return(e.errorBoundary||t.errorBoundary||e.errorBoundaryClass||t.errorBoundaryClass)&&(e.errorBoundaryClass=e.errorBoundaryClass||t.errorBoundaryClass||function(e,t){function n(t){e.React.Component.apply(this,arguments),this.state={caughtError:null,caughtErrorInfo:null},n.displayName="SingleSpaReactErrorBoundary(".concat(t.name,")")}return n.prototype=Object.create(e.React.Component.prototype),n.prototype.render=function(){return this.state.caughtError?(e.errorBoundary||t.errorBoundary)(this.state.caughtError,this.state.caughtErrorInfo,this.props):this.props.children},n.prototype.componentDidCatch=function(e,t){this.setState({caughtError:e,caughtErrorInfo:t})},n}(e,t),o=e.React.createElement(e.errorBoundaryClass,t,o)),e.React.createElement(e.SingleSpaRoot,H(H({},t),{},{mountFinished:n,updateFinished:function(){e.updateResolves[t.name]&&(e.updateResolves[t.name].forEach((function(e){return e()})),delete e.updateResolves[t.name])},unmountFinished:function(){e.unmountResolves[t.name]&&(e.unmountResolves[t.name](),delete e.unmountResolves[t.name])}}),o)},ee=function(e){if("object"!=typeof e||"string"!=typeof e.featureName||"string"!=typeof e.moduleName)throw new Error("Invalid options");var t=Object.assign({},Yn,e);return function(e){var n,r,o,i;return r=n=function(n){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&zn(e,t)}(i,n);var r,o=function(e){var t=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(e){return!1}}();return function(){var n,r=qn(e);if(t){var o=qn(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!=((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":void 0===n?"undefined":p(n))&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t;var n}(this,n)}}(i);function i(e){var n;return function(e,t){if(!s(e,t))throw new TypeError("Cannot call a class as a function")}(this,i),(n=o.call(this,e)).state={caughtError:null,caughtErrorInfo:null,config:{moduleName:t.moduleName,extension:e._extensionContext}},n}return(r=[{key:"componentDidCatch",value:function(e,n){n&&n.componentStack&&(e.extra=Object.assign(e.extra||{},{componentStack:n.componentStack})),t.throwErrorsToConsole&&setTimeout((function(){throw e})),this.setState({caughtError:e,caughtErrorInfo:n})}},{key:"render",value:function(){if(this.state.caughtError)return Le.default.createElement("div",null,"An error has occurred. Please try reloading the page.");var n=Le.default.createElement(Le.Suspense,{fallback:null},Le.default.createElement(Ue.Provider,{value:this.state.config},t.disableTranslations?Le.default.createElement(e,this.props):Le.default.createElement(Gn.I18nextProvider,{i18n:window.i18next,defaultNS:t.moduleName},Le.default.createElement(e,this.props))));return t.strictMode||!Le.default.StrictMode?n:Le.default.createElement(Le.default.StrictMode,null,n)}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(i.prototype,r),i}(Le.default.Component),o="displayName",i="OpenmrsReactComponent(".concat(t.featureName,")"),o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i,n}},te=function(e,t){return q({React:Le.default,ReactDOMClient:Fn,rootComponent:ee(t)(e)})},ne=function(e,t){return function(){return e().then((function(e){return te(e.default,t)}))}},re=function(e,t){return function(){return Promise.resolve(te(e,t))}},oe=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},ie=function(e){var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e)||function(e,t){if(e){if("string"==typeof e)return oe(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)?oe(e,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.")}()}((0,Le.useState)([])),n=t[0],r=t[1];return(0,Le.useEffect)((function(){return(0,Fe.getExtensionStore)().subscribe((function(t){var o,i,a=null!==(i=null===(o=t.slots[e])||void 0===o?void 0:o.assignedExtensions.map((function(e){return e.id})))&&void 0!==i?i:[];Nn(a,n)||r(a)}))}),[]),n},ae=function(e){(0,Le.useEffect)((function(){if(e){var t=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",function(){document.body.style.overflow=t}}}),[e])},ue=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},ce=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},se=function(e){for(var t=arguments,n=function(n){var r=null!=t[n]?t[n]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),o.forEach((function(t){ce(e,t,r[t])}))},r=1;r<arguments.length;r++)n(r);return e},le=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ue(e,t);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)?ue(e,t):void 0}}(e,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.")}()},fe=function(e){var t,n=(0,Le.useContext)(Ue),r=n.moduleName,o=n.extension,i=null!==(t=null==e?void 0:e.externalModuleName)&&void 0!==t?t:r;if(!i&&!o)throw Error(Jn);var a=function(e){var t=(0,Le.useMemo)((function(){return(0,Be.getConfigStore)(e)}),[e]),n=e,r=function(e){var t=le((0,Le.useState)(function(e){return function(){var t=e.getState();return t.loaded&&t.config?t.config:null}}(e)),2),n=t[0],r=t[1];return(0,Le.useEffect)((function(){return null==e?void 0:e.subscribe((function(e){e.loaded&&e.config&&r(e.config)}))}),[e]),n}(t);if(!r)throw Xn[n]||(Xn[n]=function(e){return new Promise((function(t){var n=e.subscribe((function(e){e.loaded&&e.config&&(t(e.config),n())}))}))}(t)),Xn[n];return r}(i),u=function(e){var t=(0,Le.useMemo)(Be.getExtensionsConfigStore,[]),n=function(e,t){var n=le((0,Le.useState)(function(e,t){return t?function(){var n=e.getState(),r=(0,Be.getExtensionConfigFromStore)(n,t.extensionSlotName,t.extensionId);if(r.loaded&&r.config)return r.config}:null}(e,t)),2),r=n[0],o=n[1];return(0,Le.useEffect)((function(){if(t)return e.subscribe((function(e){var n=(0,Be.getExtensionConfigFromStore)(e,t.extensionSlotName,t.extensionId);n.loaded&&n.config&&!Nn(n.config,r)&&o(n.config)}))}),[e,t,r]),r}(t,e);if(!n&&e){var r="".concat(e.extensionSlotName,"-").concat(e.extensionId);throw!Xn[r]&&t&&(Xn[r]=function(e,t){return new Promise((function(n){var r=e.subscribe((function(e){var o=(0,Be.getExtensionConfigFromStore)(e,t.extensionSlotName,t.extensionId);o.loaded&&o.config&&(n(o.config),r())}))}))}(t,e)),Xn[r]}return n||{}}(o);return(0,Le.useMemo)((function(){return(null==e?void 0:e.externalModuleName)&&i===e.externalModuleName?se({},a):se({},a,u)}),[i,null==e?void 0:e.externalModuleName,a,u])},de=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},pe=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},he=function(e){for(var t=arguments,n=function(n){var r=null!=t[n]?t[n]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),o.forEach((function(t){pe(e,t,r[t])}))},r=1;r<arguments.length;r++)n(r);return e},ye=function(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e},ve=function(){var e=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return e&&e[1]},be=function(e,t){switch(t.type){case Wn.loadPatient:return ye(he({},e),{patientUuid:t.patientUuid,patient:null,isPendingUuid:!1,isLoadingPatient:!0,err:null});case Wn.newPatient:return ye(he({},e),{patient:t.patient,isPendingUuid:!1,isLoadingPatient:!1,err:null});case Wn.loadError:return ye(he({},e),{patient:null,isPendingUuid:!1,isLoadingPatient:!1,err:t.err});default:return e}},me=function(e){var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e)||function(e,t){if(e){if("string"==typeof e)return de(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)?de(e,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.")}()}((0,Le.useReducer)(be,ye(he({},nr),{patientUuid:null!=e?e:null,isPendingUuid:!e,isLoadingPatient:!!e}))),n=t[0],r=t[1];return(0,Le.useEffect)((function(){if(n.isPendingUuid){var e=ve();r(e?{type:Wn.loadPatient,patientUuid:e}:{type:Wn.newPatient,patient:null})}var t=!0;return n.isLoadingPatient&&n.patientUuid&&(0,Qn.fetchCurrentPatient)(n.patientUuid).then((function(e){return t&&r({patient:e,type:Wn.newPatient})}),(function(e){return t&&r({err:e,type:Wn.loadError})})),function(){t=!1}}),[n.isPendingUuid,n.isLoadingPatient,n.patientUuid]),(0,Le.useEffect)((function(){var e=function(e){var t=ve();t!=n.patientUuid&&r({type:Wn.loadPatient,patientUuid:t})};return window.addEventListener("single-spa:routing-event",e),function(){return window.removeEventListener("single-spa:routing-event",e)}}),[n.patientUuid]),{isLoading:n.isPendingUuid||n.isLoadingPatient,patient:n.patient,patientUuid:null!=e?e:n.patientUuid,error:n.err}},ge=function(e){var t=N(e);return(0,Le.useMemo)((function(){return Object.fromEntries(t.map((function(e){return[e.name,e.meta]})))}),[t])},we=function(e){var t,n=T(Bn.featureFlagsStore).flags;return(0,Le.useEffect)((function(){n[e]||console.error('useFeatureFlag: Attempted to get value of non-existent flag "'.concat(e,'". Did you forget to call registerFeatureFlag?'))}),[n[e]]),null===(t=n[e])||void 0===t?void 0:t.enabled},Se=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},Oe=function(){var e=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e)||function(e,t){if(e){if("string"==typeof e)return Se(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)?Se(e,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.")}()}((0,Le.useState)(0))[1];return(0,Le.useCallback)((function(){e((function(e){return e+1}))}),[])},_e=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},Ee=function(){var e="tablet";return document.body.classList.forEach((function(t){switch(t){case"omrs-breakpoint-lt-tablet":e="phone";break;case"omrs-breakpoint-gt-small-desktop":e="large-desktop";break;case"omrs-breakpoint-gt-tablet":e="small-desktop"}})),e},xe=function(){var e=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e)||function(e,t){if(e){if("string"==typeof e)return _e(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)?_e(e,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.")}()}((0,Le.useState)(Ee)),t=e[0],n=e[1];return(0,Le.useEffect)((function(){var e=function(){n(Ee())};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[]),t},je=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},Pe=function(){var e=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e)||function(e,t){if(e){if("string"==typeof e)return je(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)?je(e,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.")}()}((0,Le.useState)([])),t=e[0],n=e[1];return(0,Le.useEffect)((function(){var e=(0,Qn.getLocations)().subscribe((function(e){n(e)}),(function(e){console.error(e)}));return function(){return e.unsubscribe()}}),[]),t},ke=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=(0,Le.useRef)(null);return(0,Le.useEffect)((function(){if(t){var r=function(t){var r;(null==n||null===(r=n.current)||void 0===r?void 0:r.contains(t.target))||e(t)};return window.addEventListener("click",r),function(){return window.removeEventListener("click",r)}}}),[e,t]),n},Ce=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},Ae=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},Te=function(){var e=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e)||function(e,t){if(e){if("string"==typeof e)return Ae(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)?Ae(e,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.")}()}((0,Le.useState)(null)),t=e[0],n=e[1],r=null;if(!t){if(er){var o=(0,Qn.getSessionStore)().getState();o.loaded&&(r=o.session)}else er=new Promise((function(e){var t=function(t){var n=t.loaded,o=t.session;n&&(e(o),r=o,tr&&tr(),tr=void 0)};t((0,Qn.getSessionStore)().getState()),r||(tr=(0,Qn.getSessionStore)().subscribe(t))}));if(!r)throw er;n(r)}(0,Le.useEffect)((function(){return tr||(tr=(0,Qn.getSessionStore)().subscribe((function(e){var t=e.loaded,o=e.session;t&&(r=o,n(o))}))),function(){tr&&tr(),tr=void 0}}),[]);var i=t||r;if(!i)throw er?(console.warn("useSession is in an unexpected state. Attempting to recover."),er):Error("useSession is in an invalid state.");return i},Ie=function(e){var t,n=T((0,Qn.getVisitStore)()),r=n.patientUuid,o=n.manuallySetVisitUuid,i=e&&r==e?o:null,a="?patient=".concat(e,"&v=").concat(Qn.defaultVisitCustomRepresentation,"&includeInactive=false"),u="/".concat(i),c=Xr(e?"/ws/rest/v1/visit".concat(a):null,Qn.openmrsFetch),s=c.data,l=c.error,f=c.mutate,d=c.isValidating,p=Xr(e&&i?"/ws/rest/v1/visit".concat(u):null,Qn.openmrsFetch),h=p.data,y=p.error,v=p.mutate,b=p.isValidating,m=(0,Le.useMemo)((function(){return null!==(t=null==s?void 0:s.data.results.find((function(e){return null===e.stopDatetime})))&&void 0!==t?t:null}),[s]),g=(0,Le.useMemo)((function(){return i?null==h?void 0:h.data:null!=m?m:null}),[h,m,i]);return{error:l||y,mutate:function(){f(),v()},isValidating:d||b,activeVisit:m,currentVisit:g,currentVisitIsRetrospective:Boolean(i),isLoading:Boolean((!s||i&&!h)&&(!l||!y))}},De=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},Me=function(){var e=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e)||function(e,t){if(e){if("string"==typeof e)return De(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)?De(e,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.")}()}((0,Le.useState)([])),t=e[0],n=e[1];return(0,Le.useEffect)((function(){var e=(0,Qn.getVisitTypes)().subscribe((function(e){n(e)}),(function(e){return console.error(e)}));return function(){return e.unsubscribe()}}),[]),t},Re=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},Ne=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:to,n=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e)||function(e,t){if(e){if("string"==typeof e)return Re(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)?Re(e,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.")}()}((0,Le.useState)(1)),r=n[0],o=n[1],i=(0,Le.useMemo)((function(){return"number"==typeof t&&t>0?Math.max(1,Math.ceil(e.length/t)):1}),[e.length,t]),a=(0,Le.useMemo)((function(){var n=(r-1)*t,o=(r+0)*t;return e.slice(n,o)}),[e,r,t]),u=(0,Le.useCallback)((function(e){o(Math.max(1,Math.min(i,e)))}),[o,i]),c=(0,Le.useCallback)((function(){r<i&&o(r+1)}),[r,i,o]),s=(0,Le.useCallback)((function(){r>1&&o(r-1)}),[r,o]);return(0,Le.useMemo)((function(){return{results:a,totalPages:i,currentPage:r,paginated:e.length>t,showNextButton:r<i,showPreviousButton:r>1,goTo:u,goToNext:c,goToPrevious:s}}),[a,i,e.length,t,r,u,c,s])};g.r(w),g.d(w,{ComponentContext:function(){return Ue},ConfigurableLink:function(){return r},Extension:function(){return Ve},ExtensionSlot:function(){return V},UserHasAccess:function(){return ar},createUseStore:function(){return D},getAsyncExtensionLifecycle:function(){return Zn},getAsyncLifecycle:function(){return ne},getLifecycle:function(){return te},getSyncLifecycle:function(){return re},isDesktop:function(){return ir},openmrsComponentDecorator:function(){return ee},useAssignedExtensionIds:function(){return ie},useAssignedExtensions:function(){return E},useBodyScrollLock:function(){return ae},useConfig:function(){return fe},useConnectedExtensions:function(){return N},useConnectivity:function(){return y},useExtensionInternalStore:function(){return rr},useExtensionSlot:function(){return L},useExtensionSlotMeta:function(){return ge},useExtensionStore:function(){return or},useFeatureFlag:function(){return we},useForceUpdate:function(){return Oe},useLayoutType:function(){return xe},useLocations:function(){return Pe},useOnClickOutside:function(){return ke},usePagination:function(){return Ne},usePatient:function(){return me},useSession:function(){return Te},useStore:function(){return T},useStoreWithActions:function(){return I},useVisit:function(){return Ie},useVisitTypes:function(){return Me}});var Le=g(954),Ue=Le.default.createContext({moduleName:""}),Be=g(824),Fe=g(45),Ve=function(e){var t=e.state,n=e.children,r=e.wrap,o=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["state","children","wrap"]),a=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e)||function(e,t){if(e){if("string"==typeof e)return i(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)?i(e,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.")}()}((0,Le.useState)()),u=a[0],l=a[1],f=(0,Le.useContext)(Ue).extension,d=(0,Le.useRef)(null),p=(0,Le.useRef)(Promise.resolve()),h=(0,Le.useRef)(!1);(0,Le.useEffect)((function(){r&&console.warn("'wrap' prop of Extension is being used ".concat((null==f?void 0:f.extensionId)?"by ".concat(f.extensionId," in ").concat(f.extensionSlotName):"",". This will be removed in a future release."))}),[]);var y=(0,Le.useCallback)((function(e){l(e)}),[l]);(0,Le.useEffect)((function(){if(null!=u&&(null==f?void 0:f.extensionSlotName)&&f.extensionSlotModuleName&&f.extensionSlotModuleName&&!d.current&&!h.current)return h.current=!0,(0,Fe.renderExtension)(u,f.extensionSlotName,f.extensionSlotModuleName,f.extensionId,void 0,t).then((function(e){d.current=e,h.current=!1})),function(){if(d&&d.current)switch(d.current.getStatus()){case"MOUNTING":d.current.mountPromise.then((function(){var e;"MOUNTED"===(null===(e=d.current)||void 0===e?void 0:e.getStatus())&&d.current.unmount()}));break;case"MOUNTED":d.current.unmount();break;case"UPDATING":p.current&&p.current.then((function(){var e;"MOUNTED"===(null===(e=d.current)||void 0===e?void 0:e.getStatus())&&d.current.unmount()}))}}}),[null==f?void 0:f.extensionSlotName,null==f?void 0:f.extensionId,null==f?void 0:f.extensionSlotModuleName,u]),(0,Le.useEffect)((function(){d.current&&d.current.update&&"UNMOUNTING"!==d.current.getStatus()&&Promise.all([d.current.mountPromise,p.current]).then((function(){var e;"MOUNTED"===(null==d||null===(e=d.current)||void 0===e?void 0:e.getStatus())&&d.current.update&&(p.current=d.current.update(c({},t)).catch((function(e){var t,n,r;if(n=e,!(null!=(r=Error)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):s(n,r))||!e.message.includes("minified message #32")||"MOUNTED"===(null===(t=d.current)||void 0===t?void 0:t.getStatus()))throw e})))}))}),[t]);var v=Le.default.createElement("div",c({ref:y,"data-extension-id":null==f?void 0:f.extensionId,style:{position:"relative"}},o));return"function"!=typeof n||Le.default.isValidElement(n)?f&&r?r(v,f):v:Le.default.createElement(Le.default.Fragment,null,n(v,f))},Ke=g(728),He=function(e,t){return e===t||e!=e&&t!=t},$e=function(e,t){for(var n=e.length;n--;)if(He(e[n][0],t))return n;return-1},Ge=Array.prototype.splice;v.prototype.clear=function(){this.__data__=[],this.size=0},v.prototype.delete=function(e){var t=this.__data__,n=$e(t,e);return!(n<0||(n==t.length-1?t.pop():Ge.call(t,n,1),--this.size,0))},v.prototype.get=function(e){var t=this.__data__,n=$e(t,e);return n<0?void 0:t[n][1]},v.prototype.has=function(e){return $e(this.__data__,e)>-1},v.prototype.set=function(e,t){var n=this.__data__,r=$e(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var qe,ze=v,We="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,Ye="object"==typeof self&&self&&self.Object===Object&&self,Ze=We||Ye||Function("return this")(),Xe=Ze.Symbol,Je=Object.prototype,Qe=Je.hasOwnProperty,et=Je.toString,tt=Xe?Xe.toStringTag:void 0,nt=Object.prototype.toString,rt=Xe?Xe.toStringTag:void 0,ot=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":rt&&rt in Object(e)?function(e){var t=Qe.call(e,tt),n=e[tt];try{e[tt]=void 0;var r=!0}catch(e){}var o=et.call(e);return r&&(t?e[tt]=n:delete e[tt]),o}(e):function(e){return nt.call(e)}(e)},it=function(e){var t=void 0===e?"undefined":p(e);return null!=e&&("object"==t||"function"==t)},at=function(e){if(!it(e))return!1;var t=ot(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},ut=Ze["__core-js_shared__"],ct=(qe=/[^.]+$/.exec(ut&&ut.keys&&ut.keys.IE_PROTO||""))?"Symbol(src)_1."+qe:"",st=Function.prototype.toString,lt=function(e){if(null!=e){try{return st.call(e)}catch(e){}try{return e+""}catch(e){}}return""},ft=/^\[object .+?Constructor\]$/,dt=Function.prototype,pt=Object.prototype,ht=dt.toString,yt=pt.hasOwnProperty,vt=RegExp("^"+ht.call(yt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),bt=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!it(e)||(t=e,ct&&ct in t))&&(at(e)?vt:ft).test(lt(e));var t}(n)?n:void 0},mt=bt(Ze,"Map"),gt=bt(Object,"create"),wt=Object.prototype.hasOwnProperty,St=Object.prototype.hasOwnProperty;b.prototype.clear=function(){this.__data__=gt?gt(null):{},this.size=0},b.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},b.prototype.get=function(e){var t=this.__data__;if(gt){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return wt.call(t,e)?t[e]:void 0},b.prototype.has=function(e){var t=this.__data__;return gt?void 0!==t[e]:St.call(t,e)},b.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=gt&&void 0===t?"__lodash_hash_undefined__":t,this};var Ot=b,_t=function(e,t){var n,r,o=e.__data__;return("string"==(r=p(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map};m.prototype.clear=function(){this.size=0,this.__data__={hash:new Ot,map:new(mt||ze),string:new Ot}},m.prototype.delete=function(e){var t=_t(this,e).delete(e);return this.size-=t?1:0,t},m.prototype.get=function(e){return _t(this,e).get(e)},m.prototype.has=function(e){return _t(this,e).has(e)},m.prototype.set=function(e,t){var n=_t(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};var Et=m;S.prototype.clear=function(){this.__data__=new ze,this.size=0},S.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},S.prototype.get=function(e){return this.__data__.get(e)},S.prototype.has=function(e){return this.__data__.has(e)},S.prototype.set=function(e,t){var n=this.__data__;if(s(n,ze)){var r=n.__data__;if(!mt||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Et(r)}return n.set(e,t),this.size=n.size,this};var xt=S;O.prototype.add=O.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},O.prototype.has=function(e){return this.__data__.has(e)};var jt=O,Pt=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},kt=function(e,t){return e.has(t)},Ct=function(e,t,n,r,o,i){var a=1&n,u=e.length,c=t.length;if(u!=c&&!(a&&c>u))return!1;var s=i.get(e),l=i.get(t);if(s&&l)return s==t&&l==e;var f=-1,d=!0,p=2&n?new jt:void 0;for(i.set(e,t),i.set(t,e);++f<u;){var h=e[f],y=t[f];if(r)var v=a?r(y,h,f,t,e,i):r(h,y,f,e,t,i);if(void 0!==v){if(v)continue;d=!1;break}if(p){if(!Pt(t,(function(e,t){if(!kt(p,t)&&(h===e||o(h,e,n,r,i)))return p.push(t)}))){d=!1;break}}else if(h!==y&&!o(h,y,n,r,i)){d=!1;break}}return i.delete(e),i.delete(t),d},At=Ze.Uint8Array,Tt=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n},It=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},Dt=Xe?Xe.prototype:void 0,Mt=Dt?Dt.valueOf:void 0,Rt=Array.isArray,Nt=Object.prototype.propertyIsEnumerable,Lt=Object.getOwnPropertySymbols,Ut=Lt?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a)&&(i[o++]=a)}return i}(Lt(e),(function(t){return Nt.call(e,t)})))}:function(){return[]},Bt=function(e){return null!=e&&"object"==typeof e},Ft=function(e){return Bt(e)&&"[object Arguments]"==ot(e)},Vt=Object.prototype,Kt=Vt.hasOwnProperty,Ht=Vt.propertyIsEnumerable,$t=Ft(function(){return arguments}())?Ft:function(e){return Bt(e)&&Kt.call(e,"callee")&&!Ht.call(e,"callee")},Gt=$t,qt="object"==typeof exports&&exports&&!exports.nodeType&&exports,zt=qt&&e&&!e.nodeType&&e,Wt=zt&&zt.exports===qt?Ze.Buffer:void 0,Yt=(Wt?Wt.isBuffer:void 0)||function(){return!1},Zt=/^(?:0|[1-9]\d*)$/,Xt=function(e,t){var n=void 0===e?"undefined":p(e);return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Zt.test(e))&&e>-1&&e%1==0&&e<t},Jt=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Qt={};Qt["[object Float32Array]"]=Qt["[object Float64Array]"]=Qt["[object Int8Array]"]=Qt["[object Int16Array]"]=Qt["[object Int32Array]"]=Qt["[object Uint8Array]"]=Qt["[object Uint8ClampedArray]"]=Qt["[object Uint16Array]"]=Qt["[object Uint32Array]"]=!0,Qt["[object Arguments]"]=Qt["[object Array]"]=Qt["[object ArrayBuffer]"]=Qt["[object Boolean]"]=Qt["[object DataView]"]=Qt["[object Date]"]=Qt["[object Error]"]=Qt["[object Function]"]=Qt["[object Map]"]=Qt["[object Number]"]=Qt["[object Object]"]=Qt["[object RegExp]"]=Qt["[object Set]"]=Qt["[object String]"]=Qt["[object WeakMap]"]=!1;var en,tn="object"==typeof exports&&exports&&!exports.nodeType&&exports,nn=tn&&e&&!e.nodeType&&e,rn=nn&&nn.exports===tn&&We.process,on=function(){try{return nn&&nn.require&&nn.require("util").types||rn&&rn.binding&&rn.binding("util")}catch(e){}}(),an=on&&on.isTypedArray,un=an?(en=an,function(e){return en(e)}):function(e){return Bt(e)&&Jt(e.length)&&!!Qt[ot(e)]},cn=Object.prototype.hasOwnProperty,sn=Object.prototype,ln=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),fn=Object.prototype.hasOwnProperty,dn=function(e){return null!=(t=e)&&Jt(t.length)&&!at(t)?function(e,t){var n=Rt(e),r=!n&&Gt(e),o=!n&&!r&&Yt(e),i=!n&&!r&&!o&&un(e),a=n||r||o||i,u=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=u.length;for(var s in e)!cn.call(e,s)||a&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||Xt(s,c))||u.push(s);return u}(e):function(e){if(n=(t=e)&&t.constructor,t!==("function"==typeof n&&n.prototype||sn))return ln(e);var t,n,r=[];for(var o in Object(e))fn.call(e,o)&&"constructor"!=o&&r.push(o);return r}(e);var t},pn=function(e){return function(e,t,n){var r=t(e);return Rt(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,dn,Ut)},hn=Object.prototype.hasOwnProperty,yn=bt(Ze,"DataView"),vn=bt(Ze,"Promise"),bn=bt(Ze,"Set"),mn=bt(Ze,"WeakMap"),gn="[object Map]",wn="[object Promise]",Sn="[object Set]",On="[object WeakMap]",_n="[object DataView]",En=lt(yn),xn=lt(mt),jn=lt(vn),Pn=lt(bn),kn=lt(mn),Cn=ot;(yn&&Cn(new yn(new ArrayBuffer(1)))!=_n||mt&&Cn(new mt)!=gn||vn&&Cn(vn.resolve())!=wn||bn&&Cn(new bn)!=Sn||mn&&Cn(new mn)!=On)&&(Cn=function(e){var t=ot(e),n="[object Object]"==t?e.constructor:void 0,r=n?lt(n):"";if(r)switch(r){case En:return _n;case xn:return gn;case jn:return wn;case Pn:return Sn;case kn:return On}return t});var An=Cn,Tn="[object Arguments]",In="[object Array]",Dn="[object Object]",Mn=Object.prototype.hasOwnProperty,Rn=function e(t,n,r,o,i){return t===n||(null==t||null==n||!Bt(t)&&!Bt(n)?t!=t&&n!=n:function(e,t,n,r,o,i){var a=Rt(e),u=Rt(t),c=a?In:An(e),l=u?In:An(t),f=(c=c==Tn?Dn:c)==Dn,d=(l=l==Tn?Dn:l)==Dn,p=c==l;if(p&&Yt(e)){if(!Yt(t))return!1;a=!0,f=!1}if(p&&!f)return i||(i=new xt),a||un(e)?Ct(e,t,n,r,o,i):function(e,t,n,r,o,i,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new At(e),new At(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return He(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var u=Tt;case"[object Set]":var c=1&r;if(u||(u=It),e.size!=t.size&&!c)return!1;var s=a.get(e);if(s)return s==t;r|=2,a.set(e,t);var l=Ct(u(e),u(t),r,o,i,a);return a.delete(e),l;case"[object Symbol]":if(Mt)return Mt.call(e)==Mt.call(t)}return!1}(e,t,c,n,r,o,i);if(!(1&n)){var h=f&&Mn.call(e,"__wrapped__"),y=d&&Mn.call(t,"__wrapped__");if(h||y){var v=h?e.value():e,b=y?t.value():t;return i||(i=new xt),o(v,b,n,r,i)}}return!!p&&(i||(i=new xt),function(e,t,n,r,o,i){var a=1&n,u=pn(e),c=u.length;if(c!=pn(t).length&&!a)return!1;for(var l=c;l--;){var f=u[l];if(!(a?f in t:hn.call(t,f)))return!1}var d=i.get(e),p=i.get(t);if(d&&p)return d==t&&p==e;var h=!0;i.set(e,t),i.set(t,e);for(var y=a;++l<c;){var v=e[f=u[l]],b=t[f];if(r)var m=a?r(b,v,f,t,e,i):r(v,b,f,e,t,i);if(!(void 0===m?v===b||o(v,b,n,r,i):m)){h=!1;break}y||(y="constructor"==f)}if(h&&!y){var g=e.constructor,w=t.constructor;g==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&s(g,g)&&"function"==typeof w&&s(w,w)||(h=!1)}return i.delete(e),i.delete(t),h}(e,t,n,r,o,i))}(t,n,r,o,e,i))},Nn=function(e,t){return Rn(e,t)},Ln=g(385),Un=function(e){return e},Bn=g(570),Fn=g(645);function Vn(e){return(Vn="function"==typeof Symbol&&"symbol"==p(Symbol.iterator)?function(e){return void 0===e?"undefined":p(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":p(e)})(e)}function Kn(e){return(Kn="function"==typeof Symbol&&"symbol"==p(Symbol.iterator)?function(e){return void 0===e?"undefined":p(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":p(e)})(e)}var Hn=null;try{Hn=n(5206).createContext()}catch(e){}var $n={React:null,ReactDOM:null,ReactDOMClient:null,rootComponent:null,loadRootComponent:null,renderType:"createRoot",errorBoundary:null,errorBoundaryClass:null,domElementGetter:null,parcelCanUpdate:!0,suppressComponentDidCatchWarning:!1,domElements:{},renderResults:{},updateResolves:{},unmountResolves:{}},Gn=g(281);function qn(e){return qn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},qn(e)}function zn(e,t){return zn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},zn(e,t)}var Wn,Yn={strictMode:!0,throwErrorsToConsole:!0,disableTranslations:!1},Zn=ne,Xn={},Jn='No ComponentContext has been provided. This should come from "openmrsComponentDecorator".\nUsually this is already applied when using "getAsyncLifecycle" or "getSyncLifecycle".',Qn=g(766);!function(e){e.loadPatient="loadPatient",e.newPatient="newPatient",e.loadError="patientLoadError"}(Wn||(Wn={}));var er,tr,nr={patientUuid:null,patient:null,isPendingUuid:!0,isLoadingPatient:!1,err:null},rr=D((0,Fe.getExtensionInternalStore)()),or=D((0,Fe.getExtensionStore)()),ir=function(e){return"small-desktop"===e||"large-desktop"===e},ar=function(e){var t=e.privilege,n=e.fallback,r=e.children,o=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e)||function(e,t){if(e){if("string"==typeof e)return Ce(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)?Ce(e,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.")}()}((0,Le.useState)(null)),i=o[0],a=o[1];return(0,Le.useEffect)((function(){var e=(0,Qn.getCurrentUser)({includeAuthStatus:!1}).subscribe(a);return function(){return e.unsubscribe()}}),[]),i&&(0,Qn.userHasAccess)(t,i)?Le.default.createElement(Le.default.Fragment,null,r):n?Le.default.createElement(Le.default.Fragment,null,n):null},ur=g(374),cr=new WeakMap,sr={},lr=function(){},fr=void 0,dr=Object,pr=function(e){return e===fr},hr=function(e){return"function"==typeof e},yr=function(e,t){return l({},e,t)},vr="undefined",br=("undefined"==typeof window?"undefined":p(window))!=vr,mr=("undefined"==typeof document?"undefined":p(document))!=vr,gr=function(e,t){var n=cr.get(e);return[function(){return e.get(t)||sr},function(r){var o=e.get(t);n[5](t,yr(o,r),o||sr)},n[6]]},wr=new WeakMap,Sr=0,Or=function(e){var t,n,r=void 0===e?"undefined":p(e),o=e&&e.constructor,i=o==Date;if(dr(e)!==e||i||o==RegExp)t=i?e.toJSON():"symbol"==r?e.toString():"string"==r?JSON.stringify(e):""+e;else{if(t=wr.get(e))return t;if(t=++Sr+"~",wr.set(e,t),o==Array){for(t="@",n=0;n<e.length;n++)t+=Or(e[n])+",";wr.set(e,t)}if(o==dr){t="#";for(var a=dr.keys(e).sort();!pr(n=a.pop());)pr(e[n])||(t+=n+":"+Or(e[n])+",");wr.set(e,t)}}return t},_r=!0,Er=f(br&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[lr,lr],2),xr=Er[0],jr=Er[1],Pr={isOnline:function(){return _r},isVisible:function(){var e=mr&&document.visibilityState;return pr(e)||"hidden"!==e}},kr={initFocus:function(e){return mr&&document.addEventListener("visibilitychange",e),xr("focus",e),function(){mr&&document.removeEventListener("visibilitychange",e),jr("focus",e)}},initReconnect:function(e){var t=function(){_r=!0,e()},n=function(){_r=!1};return xr("online",t),xr("offline",n),function(){jr("online",t),jr("offline",n)}}},Cr=!Le.default.useId,Ar=!br||"Deno"in window,Tr=Ar?Le.useEffect:Le.useLayoutEffect,Ir="undefined"!=typeof navigator&&navigator.connection,Dr=!Ar&&Ir&&(["slow-2g","2g"].includes(Ir.effectiveType)||Ir.saveData),Mr=function(e){if(hr(e))try{e=e()}catch(t){e=""}var t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?Or(e):"",t]},Rr=0,Nr=function(){return++Rr};function Lr(){return Ur.apply(this,arguments)}function Ur(){return Ur=u(o().mark((function e(){var t,n,r,i,a,c,s,l,d,p,h,y,v,b,m,g,w,S,O,_,E,x=arguments;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(_=function(e){return E.apply(this,arguments)},E=function(){return E=u(o().mark((function e(t){var r,i,u,c,l,d,m,g,w,S,O,_,E,x,j,P,k,C,A,T;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=f(Mr(t),1),i=r[0]){e.next=3;break}return e.abrupt("return");case 3:if(u=f(gr(a,i),2),c=u[0],l=u[1],d=f(cr.get(a),3),m=d[0],g=d[1],w=d[2],S=m[i],O=function(){return v&&(delete w[i],S&&S[0])?S[0](2).then((function(){return c().data})):c().data},!(n.length<3)){e.next=6;break}return e.abrupt("return",O());case 6:if(E=s,x=Nr(),g[i]=[x,0],j=!pr(y),P=c(),k=P.data,C=P._c,A=pr(C)?k:C,j&&(y=hr(y)?y(A):y,l({data:y,_c:A})),hr(E))try{E=E(A)}catch(e){_=e}if(!E||!hr(E.then)){e.next=20;break}return e.next=14,E.catch((function(e){_=e}));case 14:if(E=e.sent,x===g[i][0]){e.next=19;break}if(!_){e.next=18;break}throw _;case 18:return e.abrupt("return",E);case 19:_&&j&&function(e){return"function"==typeof h?h(e):!1!==h}(_)&&(p=!0,l({data:E=A,_c:fr}));case 20:return p&&(_||(hr(p)&&(E=p(E,A)),l({data:E,_c:fr}))),g[i][1]=Nr(),e.next=23,O();case 23:if(T=e.sent,l({_c:fr}),_){e.next=26;break}return e.abrupt("return",p?T:E);case 26:if(!b){e.next=28;break}throw _;case 28:case"end":return e.stop()}}),e)}))),E.apply(this,arguments)},t=x.length,n=new Array(t),r=0;r<t;r++)n[r]=x[r];if(i=f(n,4),a=i[0],c=i[1],s=i[2],l=i[3],d=yr({populateCache:!0,throwOnError:!0},"boolean"==typeof l?{revalidate:l}:l||{}),p=d.populateCache,h=d.rollbackOnError,y=d.optimisticData,v=!1!==d.revalidate,b=d.throwOnError,!hr(c)){e.next=12;break}for(m=c,g=[],w=a.keys(),S=w.next();!S.done;S=w.next())!(O=S.value).startsWith("$inf$")&&m(a.get(O)._k)&&g.push(O);return e.abrupt("return",Promise.all(g.map(_)));case 12:return e.abrupt("return",_(c));case 15:case"end":return e.stop()}}),e)}))),Ur.apply(this,arguments)}var Br=function(e,t){for(var n in e)e[n][0]&&e[n][0](t)},Fr=function(e,t){if(!cr.has(e)){var n=yr(kr,t),r={},o=Lr.bind(fr,e),i=lr,a={},u=function(e,t){var n=a[e]||[];return a[e]=n,n.push(t),function(){return n.splice(n.indexOf(t),1)}},c=function(t,n,r){e.set(t,n);var o=a[t];if(o)for(var i=o.length;i--;)o[i](r,n)},s=function(){if(!cr.has(e)&&(cr.set(e,[r,{},{},{},o,c,u]),!Ar)){var t=n.initFocus(setTimeout.bind(fr,Br.bind(fr,r,0))),a=n.initReconnect(setTimeout.bind(fr,Br.bind(fr,r,1)));i=function(){t&&t(),a&&a(),cr.delete(e)}}};return s(),[e,o,s,i]}return[e,cr.get(e)[4]]},Vr=f(Fr(new Map),2),Kr=Vr[0],Hr=Vr[1],$r=yr({onLoadingSlow:lr,onSuccess:lr,onError:lr,onErrorRetry:function(e,t,n,r,o){var i=n.errorRetryCount,a=o.retryCount,u=~~((Math.random()+.5)*(1<<(a<8?a:8)))*n.errorRetryInterval;!pr(i)&&a>i||setTimeout(r,u,o)},onDiscarded:lr,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Dr?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:Dr?5e3:3e3,compare:function(e,t){return Or(e)==Or(t)},isPaused:function(){return!1},cache:Kr,mutate:Hr,fallback:{}},Pr),Gr=function(e,t){var n=yr(e,t);if(t){var r=e.use,o=e.fallback,i=t.use,a=t.fallback;r&&i&&(n.use=r.concat(i)),o&&a&&(n.fallback=yr(o,a))}return n},qr=(0,Le.createContext)({}),zr=br&&window.__SWR_DEVTOOLS_USE__,Wr=(zr?window.__SWR_DEVTOOLS_USE__:[]).concat((function(e){return function(t,n,r){return e(t,n&&function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];var i=Mr(t)[0],a=f(cr.get(Kr),4),u=a[3],c=u[i];return c?(delete u[i],c):n.apply(void 0,d(r))},r)}}));zr&&(window.__SWR_DEVTOOLS_REACT__=Le.default);var Yr={dedupe:!0};dr.defineProperty((function(e){var t=e.value,n=(0,Le.useContext)(qr),r=hr(t),o=(0,Le.useMemo)((function(){return r?t(n):t}),[r,n,t]),i=(0,Le.useMemo)((function(){return r?o:Gr(n,o)}),[r,n,o]),a=o&&o.provider,u=f((0,Le.useState)((function(){return a?Fr(a(i.cache||Kr),o):fr})),1)[0];return u&&(i.cache=u[0],i.mutate=u[1]),Tr((function(){if(u)return u[2]&&u[2](),u[3]}),[]),(0,Le.createElement)(qr.Provider,yr(e,{value:i}))}),"defaultValue",{value:$r});var Zr,Xr=(Zr=function(e,t,n){var r,i=n.cache,a=n.compare,c=n.suspense,s=n.fallbackData,h=n.revalidateOnMount,y=n.refreshInterval,v=n.refreshWhenHidden,b=n.refreshWhenOffline,m=n.keepPreviousData,g=f(cr.get(i),3),w=g[0],S=g[1],O=g[2],_=f(Mr(e),2),E=_[0],x=_[1],j=(0,Le.useRef)(!1),P=(0,Le.useRef)(!1),k=(0,Le.useRef)(E),C=(0,Le.useRef)(t),A=(0,Le.useRef)(n),T=function(){return A.current},I=function(){return T().isVisible()&&T().isOnline()},D=f(gr(i,E),3),M=D[0],R=D[1],N=D[2],L=(0,Le.useRef)({}).current,U=pr(s)?n.fallback[E]:s,B=function(e,t){var n=!0;for(var r in L){var o=r;a(t[o],e[o])||"data"===o&&pr(e[o])&&a(t[o],z)||(n=!1)}return n},F=(0,Le.useMemo)((function(){var e=!!E&&!!t&&(pr(h)?!T().isPaused()&&!c:h),n=function(){var t=M(),n=yr(t);return delete n._k,e?l({isValidating:!0,isLoading:!0},n):n},r=n();return function(){var e=n();return B(e,r)?r:r=e}}),[i,E]),V=(0,ur.useSyncExternalStore)((0,Le.useCallback)((function(e){return N(E,(function(t,n){B(t,n)||e()}))}),[i,E]),F,F),K=!j.current,H=V.data,$=pr(H)?U:H,G=V.error,q=(0,Le.useRef)($),z=m?pr(H)?q.current:H:$,W=K&&!pr(h)?h:!T().isPaused()&&(c?!pr($)&&n.revalidateIfStale:pr($)||n.revalidateIfStale),Y=!!(E&&t&&K&&W),Z=pr(V.isValidating)?Y:V.isValidating,X=pr(V.isLoading)?Y:V.isLoading,J=(0,Le.useCallback)((r=u(o().mark((function e(t){var r,i,u,c,s,l,d,p,h,y,v,b,m,g,w,_;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=C.current,E&&r&&!P.current&&!T().isPaused()){e.next=3;break}return e.abrupt("return",!1);case 3:return c=!0,s=t||{},l=!O[E]||!s.dedupe,d=function(){return Cr?!P.current&&E===k.current&&j.current:E===k.current},p={isValidating:!1,isLoading:!1},h=function(){R(p)},y=function(){var e=O[E];e&&e[1]===u&&delete O[E]},v={isValidating:!0},pr(M().data)&&(v.isLoading=!0),e.prev=6,l&&(R(v),n.loadingTimeout&&pr(M().data)&&setTimeout((function(){c&&d()&&T().onLoadingSlow(E,n)}),n.loadingTimeout),O[E]=[r(x),Nr()]),b=f(O[E],2),i=b[0],u=b[1],e.next=12,i;case 12:if(i=e.sent,l&&setTimeout(y,n.dedupingInterval),O[E]&&O[E][1]===u){e.next=16;break}return e.abrupt("return",(l&&d()&&T().onDiscarded(E),!1));case 16:if(p.error=fr,m=S[E],pr(m)||!(u<=m[0]||u<=m[1]||0===m[1])){e.next=20;break}return e.abrupt("return",(h(),l&&d()&&T().onDiscarded(E),!1));case 20:g=M().data,p.data=a(g,i)?g:i,l&&d()&&T().onSuccess(i,E,n),e.next=29;break;case 24:e.prev=24,e.t0=e.catch(6),y(),w=T(),_=w.shouldRetryOnError,w.isPaused()||(p.error=e.t0,l&&d()&&(w.onError(e.t0,E,w),(!0===_||hr(_)&&_(e.t0))&&I()&&w.onErrorRetry(e.t0,E,w,J,{retryCount:(s.retryCount||0)+1,dedupe:!0})));case 29:return e.abrupt("return",(c=!1,h(),!0));case 30:case"end":return e.stop()}}),e,null,[[6,24]])}))),function(e){return r.apply(this,arguments)}),[E,i]),Q=(0,Le.useCallback)((function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Lr.apply(void 0,[i,k.current].concat(d(t)))}),[]);if(Tr((function(){C.current=t,A.current=n,pr(H)||(q.current=H)})),Tr((function(){if(E){var e=J.bind(fr,Yr),t=0,n=function(e,t,n){var r=t[e]||(t[e]=[]);return r.push(n),function(){var e=r.indexOf(n);e>=0&&(r[e]=r[r.length-1],r.pop())}}(E,w,(function(n){if(0==n){var r=Date.now();T().revalidateOnFocus&&r>t&&I()&&(t=r+T().focusThrottleInterval,e())}else if(1==n)T().revalidateOnReconnect&&I()&&e();else if(2==n)return J()}));return P.current=!1,k.current=E,j.current=!0,R({_k:x}),W&&(pr($)||Ar?e():function(e){br&&p(window.requestAnimationFrame)!=vr?window.requestAnimationFrame(e):setTimeout(e,1)}(e)),function(){P.current=!0,n()}}}),[E]),Tr((function(){var e,t=function(){var t=hr(y)?y($):y;t&&-1!==e&&(e=setTimeout(n,t))},n=function(){M().error||!v&&!T().isVisible()||!b&&!T().isOnline()?t():J(Yr).then(t)};return t(),function(){e&&(clearTimeout(e),e=-1)}}),[y,v,b,E]),(0,Le.useDebugValue)(z),c&&pr($)&&E){if(!Cr&&Ar)throw new Error("Fallback data is required when using suspense in SSR.");throw C.current=t,A.current=n,P.current=!1,pr(G)?J(Yr):G}return{mutate:Q,get data(){return L.data=!0,z},get error(){return L.error=!0,G},get isValidating(){return L.isValidating=!0,Z},get isLoading(){return L.isLoading=!0,X}}},function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=yr($r,(0,Le.useContext)(qr)),o=f(function(e){return hr(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}]}(t),3),i=o[0],a=o[1],u=o[2],c=Gr(r,u),s=Zr,l=c.use,d=(l||[]).concat(Wr),p=d.length;p--;)s=d[p](s);return s(i,a||c.fetcher||null,c)}),Jr=g(688),Qr=g(332),eo=g.n(Qr);Jr.default.extend(eo());var to=10}(),w}())}}}))},9504:()=>{System.register([],(function(e,t){return{execute:function(){e(function(){"use strict";var e=function(e,t){var n=u[e];if(n)return n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value.setState(t,!0),n.active=!0,n.value;var r=a()((function(){return t}));return u[e]={value:r,active:!0},r},t=function(e,t){var n=u[e];if(!n){var r=a()((function(){return null!=t?t:{}}));return u[e]={value:r,active:!1},r}return n.value},n=function(e,t,n){var r=t(e.getState());return e.subscribe((function(e){var o=t(e);o!==r&&(r=o,n(o))}))},r={d:function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};r.r(o),r.d(o,{createGlobalStore:function(){return e},getGlobalStore:function(){return t},subscribeTo:function(){return n}});var i=function(e){var t,n=new Set,r=function(e,r){var o="function"==typeof e?e(t):e;if(!Object.is(o,t)){var i=t;t=(null!=r?r:"object"!=typeof o)?o:Object.assign({},t,o),n.forEach((function(e){return e(t,i)}))}},o=function(){return t},i={setState:r,getState:o,subscribe:function(e){return n.add(e),function(){return n.delete(e)}},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 t=e(r,o,i),i},a=function(e){return e?i(e):i},u={};return setTimeout((function(){"development"===window.spaEnv&&(window.stores=u)}),1e3),o}())}}}))},842:(e,t,n)=>{"use strict";var r=n(5047),o=n.n(r);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function a(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)}function u(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function u(e){a(i,r,o,u,c,"next",e)}function c(e){a(i,r,o,u,c,"throw",e)}u(void 0)}))}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),e}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){f(e,t,n[t])}))}return e}function h(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||m(e,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.")}()}function v(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||m(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.")}()}e=n.hmd(e);var b=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function m(e,t){if(e){if("string"==typeof e)return i(e,t);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)?i(e,t):void 0}}System.register(["@openmrs/esm-extensions","@openmrs/esm-react-utils","@openmrs/esm-state","react","react-dom","rxjs"],(function(t,r){var i={},a={},s={},m={},g={},w={};return Object.defineProperty(m,"__esModule",{value:!0}),Object.defineProperty(g,"__esModule",{value:!0}),{setters:[function(e){i.getExtensionInternalStore=e.getExtensionInternalStore,i.getExtensionStore=e.getExtensionStore},function(){},function(e){s.createGlobalStore=e.createGlobalStore,s.getGlobalStore=e.getGlobalStore},function(e){Object.keys(e).forEach((function(t){m[t]=e[t]}))},function(e){Object.keys(e).forEach((function(t){g[t]=e[t]}))},function(e){w.BehaviorSubject=e.BehaviorSubject,w.Subject=e.Subject}],execute:function(){t(function(){var t={23:function(e){var t=function(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):d(e,t)};e.exports=function(){var e=6e4,n=36e5,r="millisecond",o="second",i="minute",a="hour",u="day",c="week",s="month",l="quarter",f="year",d="date",p="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},b=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},m={s:b,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),o=n%60;return(t<=0?"+":"-")+b(r,2,"0")+":"+b(o,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),o=t.clone().add(r,s),i=n-o<0,a=t.clone().add(r+(i?-1:1),s);return+(-(r+(n-o)/(i?o-a:a-o))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:s,y:f,w:c,d:u,D:d,h:a,m:i,s:o,ms:r,Q:l}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},g="en",w={};w[g]=v;var S=function(e){return t(e,x)},O=function e(t,n,r){var o;if(!t)return g;if("string"==typeof t){var i=t.toLowerCase();w[i]&&(o=i),n&&(w[i]=n,o=i);var a=t.split("-");if(!o&&a.length>1)return e(a[0])}else{var u=t.name;w[u]=t,o=u}return!r&&o&&(g=o),o||!r&&g},_=function(e,t){if(S(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new x(n)},E=m;E.l=O,E.i=S,E.w=function(e,t){return _(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var x=function(){var v=function(e){this.$L=O(e.locale,null,!0),this.parse(e)},b=v.prototype;return b.parse=function(e){this.$d=function(e){var n=e.date,r=e.utc;if(null===n)return new Date(NaN);if(E.u(n))return new Date;if(t(n,Date))return new Date(n);if("string"==typeof n&&!/Z$/i.test(n)){var o=n.match(h);if(o){var i=o[2]-1||0,a=(o[7]||"0").substring(0,3);return r?new Date(Date.UTC(o[1],i,o[3]||1,o[4]||0,o[5]||0,o[6]||0,a)):new Date(o[1],i,o[3]||1,o[4]||0,o[5]||0,o[6]||0,a)}}return new Date(n)}(e),this.$x=e.x||{},this.init()},b.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},b.$utils=function(){return E},b.isValid=function(){return!(this.$d.toString()===p)},b.isSame=function(e,t){var n=_(e);return this.startOf(t)<=n&&n<=this.endOf(t)},b.isAfter=function(e,t){return _(e)<this.startOf(t)},b.isBefore=function(e,t){return this.endOf(t)<_(e)},b.$g=function(e,t,n){return E.u(e)?this[t]:this.set(n,e)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(e,t){var n=this,r=!!E.u(t)||t,l=E.p(e),p=function(e,t){var o=E.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?o:o.endOf(u)},h=function(e,t){return E.w(n.toDate()[e].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},y=this.$W,v=this.$M,b=this.$D,m="set"+(this.$u?"UTC":"");switch(l){case f:return r?p(1,0):p(31,11);case s:return r?p(1,v):p(0,v+1);case c:var g=this.$locale().weekStart||0,w=(y<g?y+7:y)-g;return p(r?b-w:b+(6-w),v);case u:case d:return h(m+"Hours",0);case a:return h(m+"Minutes",1);case i:return h(m+"Seconds",2);case o:return h(m+"Milliseconds",3);default:return this.clone()}},b.endOf=function(e){return this.startOf(e,!1)},b.$set=function(e,t){var n,c=E.p(e),l="set"+(this.$u?"UTC":""),p=(n={},n[u]=l+"Date",n[d]=l+"Date",n[s]=l+"Month",n[f]=l+"FullYear",n[a]=l+"Hours",n[i]=l+"Minutes",n[o]=l+"Seconds",n[r]=l+"Milliseconds",n)[c],h=c===u?this.$D+(t-this.$W):t;if(c===s||c===f){var y=this.clone().set(d,1);y.$d[p](h),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else p&&this.$d[p](h);return this.init(),this},b.set=function(e,t){return this.clone().$set(e,t)},b.get=function(e){return this[E.p(e)]()},b.add=function(t,r){var l,d=this;t=Number(t);var p=E.p(r),h=function(e){var n=_(d);return E.w(n.date(n.date()+Math.round(e*t)),d)};if(p===s)return this.set(s,this.$M+t);if(p===f)return this.set(f,this.$y+t);if(p===u)return h(1);if(p===c)return h(7);var y=(l={},l[i]=e,l[a]=n,l[o]=1e3,l)[p]||1,v=this.$d.getTime()+t*y;return E.w(v,this)},b.subtract=function(e,t){return this.add(-1*e,t)},b.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||"YYYY-MM-DDTHH:mm:ssZ",o=E.z(this),i=this.$H,a=this.$m,u=this.$M,c=n.weekdays,s=n.months,l=function(e,n,o,i){return e&&(e[n]||e(t,r))||o[n].slice(0,i)},f=function(e){return E.s(i%12||12,e,"0")},d=n.meridiem||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r},h={YY:String(this.$y).slice(-2),YYYY:this.$y,M:u+1,MM:E.s(u+1,2,"0"),MMM:l(n.monthsShort,u,s,3),MMMM:l(s,u),D:this.$D,DD:E.s(this.$D,2,"0"),d:String(this.$W),dd:l(n.weekdaysMin,this.$W,c,2),ddd:l(n.weekdaysShort,this.$W,c,3),dddd:c[this.$W],H:String(i),HH:E.s(i,2,"0"),h:f(1),hh:f(2),a:d(i,a,!0),A:d(i,a,!1),m:String(a),mm:E.s(a,2,"0"),s:String(this.$s),ss:E.s(this.$s,2,"0"),SSS:E.s(this.$ms,3,"0"),Z:o};return r.replace(y,(function(e,t){return t||h[e]||o.replace(":","")}))},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(t,r,c){var d,p=E.p(r),h=_(t),y=(h.utcOffset()-this.utcOffset())*e,v=this-h,b=E.m(this,h);return b=(d={},d[f]=b/12,d[s]=b,d[l]=b/3,d.week=(v-y)/6048e5,d[u]=(v-y)/864e5,d[a]=v/n,d[i]=v/e,d[o]=v/1e3,d)[p]||v,c?b:E.a(b)},b.daysInMonth=function(){return this.endOf(s).$D},b.$locale=function(){return w[this.$L]},b.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=O(e,t,!0);return r&&(n.$L=r),n},b.clone=function(){return E.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},v}(),j=x.prototype;return _.prototype=j,[["$ms",r],["$s",o],["$m",i],["$H",a],["$W",u],["$M",s],["$y",f],["$D",d]].forEach((function(e){j[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),_.extend=function(e,t){return e.$i||(e(t,x,_),e.$i=!0),_},_.locale=O,_.isDayjs=S,_.unix=function(e){return _(1e3*e)},_.en=w[g],_.Ls=w,_.p={},_}()},701:function(e){e.exports=function(e,t,n){t.prototype.isToday=function(){var e="YYYY-MM-DD",t=n();return this.format(e)===t.format(e)}}},279:function(e,t,n){var r=n(493);r.createRoot,r.hydrateRoot},978:function(e,t,n){var r=function(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(e){return!0}},o=n(954),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=o.useState,u=o.useEffect,c=o.useLayoutEffect,s=o.useDebugValue,l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),o=a({inst:{value:n,getSnapshot:t}}),i=o[0].inst,l=o[1];return c((function(){i.value=n,i.getSnapshot=t,r(i)&&l({inst:i})}),[e,n,t]),u((function(){return r(i)&&l({inst:i}),e((function(){r(i)&&l({inst:i})}))}),[e]),s(n),n};t.useSyncExternalStore=void 0!==o.useSyncExternalStore?o.useSyncExternalStore:l},921:function(e,t,n){e.exports=n(978)},641:function(e,t,n){var r=function(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):d(e,t)},o=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":void 0===e?"undefined":b(e)};System.register(["@openmrs/esm-config","@openmrs/esm-error-handling","@openmrs/esm-offline"],(function(e,t){var i={},a={},u={};return{setters:[function(e){i.Type=e.Type,i.defineConfigSchema=e.defineConfigSchema,i.getConfig=e.getConfig,i.navigate=e.navigate,i.validators=e.validators},function(e){a.reportError=e.reportError},function(e){u.getSynchronizationItems=e.getSynchronizationItems}],execute:function(){e(function(){var e={385:function(){System.register([],(function(e,t){return{execute:function(){e(function(){var e=function(e,t){var n=u[e];if(n)return n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value.setState(t,!0),n.active=!0,n.value;var r=a()((function(){return t}));return u[e]={value:r,active:!0},r},t=function(e,t){var n=u[e];if(!n){var r=a()((function(){return null!=t?t:{}}));return u[e]={value:r,active:!1},r}return n.value},n=function(e,t,n){var r=t(e.getState());return e.subscribe((function(e){var o=t(e);o!==r&&(r=o,n(o))}))},r={d:function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};r.r(o),r.d(o,{createGlobalStore:function(){return e},getGlobalStore:function(){return t},subscribeTo:function(){return n}});var i=function(e){var t,n=new Set,r=function(e,r){var o="function"==typeof e?e(t):e;if(!Object.is(o,t)){var i=t;t=(null!=r?r:"object"!=typeof o)?o:Object.assign({},t,o),n.forEach((function(e){return e(t,i)}))}},o=function(){return t},i={setState:r,getState:o,subscribe:function(e){return n.add(e),function(){return n.delete(e)}},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 t=e(r,o,i),i},a=function(e){return e?i(e):i},u={};return setTimeout((function(){"development"===window.spaEnv&&(window.stores=u)}),1e3),o}())}}}))},824:function(e){e.exports=i},254:function(e){e.exports=a},738:function(e){e.exports=u}},t={};function c(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,c),o.exports}c.d=function(e,t){for(var n in t)c.o(t,n)&&!c.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};return function(){var e=function(e,t){var n=function(){this.constructor=e};W(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},t=function(e){return"function"==typeof e},i=function(e){setTimeout((function(){throw e}),0)},a=function(e){return e.reduce((function(e,t){return e.concat(r(t,Q)?t.errors:t)}),[])},u=function(e){return e},l=function(e){if(e||(e=Z.Promise||Promise),!e)throw new Error("no Promise impl found");return e},f=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},d=function(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)},p=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},h=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(e){return!1}},y=function(e){return e&&e.startsWith("http")?e:("/"!==e[0]&&(e="/"+e),window.openmrsBase+e)},v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof e)throw Error("The first argument to @openmrs/api's openmrsFetch function must be a url string");if("object"!=typeof t)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=y(e);if(t.headers||(t.headers={}),Se(t.body)&&(t.body=JSON.stringify(t.body)),void 0===t.headers.Accept&&(t.headers.Accept="application/json"),null===t.headers.Accept&&delete t.headers.Accept,e.startsWith(Pe)&&void 0===t.headers["Disable-WWW-Authenticate"]&&(t.headers["Disable-WWW-Authenticate"]="true"),e.startsWith(ke)){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,t).then((o=function(e){var t,r;return function(e,t){var n,r,o,i,a=function(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)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 u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}},u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i}(this,(function(o){switch(o.label){case 0:return(t=e).ok?204===t.status?(t.data=null,[2,t]):[2,t.clone().text().then((function(e){try{e&&(t.data=JSON.parse(e))}catch(e){}return t}))]:[3,1];case 1:return[4,(0,Oe.getConfig)("@openmrs/esm-api")];case 2:return r=o.sent().redirectAuthFailure,n===y(Ce)&&403===t.status||r.enabled&&r.errors.includes(t.status)?((0,Oe.navigate)({to:r.url}),[2,r.resolvePromise?Promise.resolve():new Promise((function(){}))]):[2,t.clone().text().then((function(e){var r=e;try{r=JSON.parse(e)}catch(e){}throw new Ae(n,t,r,a)}),(function(e){throw new Ae(n,t,null,a)}))];case 3:return[2]}}))},i=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=o.apply(e,t);function a(e){d(i,n,r,a,u,"next",e)}function u(e){d(i,n,r,a,u,"throw",e)}a(void 0)}))},function(e){return i.apply(this,arguments)}))},b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"!=typeof t)throw Error("The second argument to openmrsObservableFetch must be either omitted or an object");var n=new AbortController;return t.signal=n.signal,new ie((function(r){var o=!1;return v(e,t).then((function(e){o=!0,r.next(e),r.complete()}),(function(e){o=!0,r.error(e)})),function(){o||n.abort()}}))},m=function(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)},g=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{includeAuthStatus:!0};return(Re<Date.now()-6e4||!Me.getState().loaded)&&S(),new ie((function(t){var n=function(n){var r;n.loaded&&(e.includeAuthStatus?t.next(n.session):t.next(null===(r=n.session)||void 0===r?void 0:r.user))};return n(Me.getState()),Me.subscribe(n)}))},w=function(){return(Re<Date.now()-6e4||!Me.getState().loaded)&&S(),Me},S=function(){return new Promise((function(e,t){Re=Date.now(),v(Ce).then((function(n){if("object"!=typeof(null==n?void 0:n.data))return t(),Promise.reject();var r,o,i,a,u,c;u=null!==(a=null==(r=n.data)||null===(o=r.user)||void 0===o||null===(i=o.userProperties)||void 0===i?void 0:i.defaultLocale)&&void 0!==a?a:r.locale,c=document.documentElement.getAttribute("lang"),function(e){if(void 0===e||"string"!=typeof e)return!1;try{new Intl.Locale(e)}catch(e){return!1}return!0}(u)&&u!==c&&document.documentElement.setAttribute("lang",u),e(n.data),Me.setState({loaded:!0,session:n.data})})).catch((function(e){return(0,Te.reportError)("Failed to fetch new session information: ".concat(e)),t(e),{sessionId:"",authenticated:!1}}))}))},O=function(){Me.setState({loaded:!0,session:{authenticated:!1,sessionId:""}})},_=function(e,t){return void 0===t?Boolean(e):!Boolean(e)||function(e,t){return"string"==typeof e?!De(t.privileges.find((function(t){return e===t.display}))):Array.isArray(e)?e.every((function(e){return!De(t.privileges.find((function(t){return e===t.display})))})):(De(e)||console.error('Could not understand privileges "'.concat(e,'"')),!0)}(e,t)||function(e){return!De(e.roles.find((function(e){return"System Developer"===e.display})))}(t)},E=function(){var e,t;return new Promise((function(n,r){var o=function(r){r.loaded&&r.session.user&&(e=r.session.user,n(r.session.user),t&&t())};o(Me.getState()),e||(t=Me.subscribe(o))}))},x=function(){return new Promise((function(e,t){g().subscribe((function(t){e(t.sessionLocation)}),t).unsubscribe()}))},j=function(e,t){return Ne.apply(this,arguments)},P=function(){(0,Oe.defineConfigSchema)("@openmrs/esm-api",{redirectAuthFailure:{enabled:{_type:Oe.Type.Boolean,_default:!0,_description:"Whether to redirect logged-out users to `redirectAuthFailure.url`"},url:{_type:Oe.Type.String,_default:"${openmrsSpaBase}/login",_validators:[Oe.validators.isUrl]},errors:{_type:Oe.Type.Array,_default:[401],_elements:{_type:Oe.Type.Number,_validators:[Oe.validators.inRange(100,600)]},_description:"The HTTP error codes for which users will be redirected"},resolvePromise:{_type:Oe.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."}}}),S()},k=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},C=function(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)},A=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){C(i,r,o,a,u,"next",e)}function u(e){C(i,r,o,a,u,"throw",e)}a(void 0)}))}},T=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return k(e,t);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)?k(e,t):void 0}}(e,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.")}()},I=function(e,t){var n,r,o,i,a=function(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)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 u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}},u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i},D=function(e,t){return Ue.apply(this,arguments)},M=function(e){return Be.apply(this,arguments)},R=function(e){return function(t){return 0===e?ze:t.lift(new We(e))}},N=function(e,t){return function(n){if("function"!=typeof e)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new Ze(e,t))}},L=function(){return(0,Ie.getGlobalStore)("visit",Qe)},U=function(e,t){L().setState({patientUuid:e,manuallySetVisitUuid:t})},B=function(e,t,n){var r=null!=n?n:Je;return b("/ws/rest/v1/visit?patient=".concat(e,"&v=").concat(r),{signal:t.signal,method:"GET",headers:{"Content-type":"application/json"}}).pipe(R(1)).pipe(N((function(e){return e})))},F=function(e,t){return b("/ws/rest/v1/visit",{signal:t.signal,method:"POST",headers:{"Content-type":"application/json"},body:e})},V=function(e,t,n){return b("/ws/rest/v1/visit/".concat(e),{signal:n.signal,method:"POST",headers:{"Content-type":"application/json"},body:t})},K=function(e){return{uuid:e.uuid,display:e.display,name:e.name}},H=function(){return b("/ws/rest/v1/visittype").pipe(N((function(e){return e.data.results.map(K)}))).pipe(R(1))},$=function(e){return{uuid:e.uuid,display:e.display}},G=function(){return b("/ws/rest/v1/location").pipe(N((function(e){return e.data.results.map($)}))).pipe(R(1))};c.r(s),c.d(s,{OpenmrsFetchError:function(){return Ae},VisitMode:function(){return et},VisitStatus:function(){return tt},backendDependencies:function(){return rt},clearCurrentUser:function(){return O},defaultVisitCustomRepresentation:function(){return Je},fetchCurrentPatient:function(){return D},fhirBaseUrl:function(){return ke},getCurrentUser:function(){return g},getLocations:function(){return G},getLoggedInUser:function(){return E},getSessionLocation:function(){return x},getSessionStore:function(){return w},getStartedVisit:function(){return nt},getVisitStore:function(){return L},getVisitTypes:function(){return H},getVisitsForPatient:function(){return B},makeUrl:function(){return y},openmrsFetch:function(){return v},openmrsObservableFetch:function(){return b},refetchCurrentUser:function(){return S},restBaseUrl:function(){return Pe},saveVisit:function(){return F},sessionEndpoint:function(){return Ce},setCurrentVisit:function(){return U},setSessionLocation:function(){return j},setupApiModule:function(){return P},toLocationObject:function(){return $},toVisitTypeObject:function(){return K},updateVisit:function(){return V},userHasAccess:function(){return _}});var q,z,W=function(e,t){return W=Object.setPrototypeOf||r({__proto__:[]},Array)&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},W(e,t)},Y=!1,Z={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){e&&(new Error).stack,Y=e},get useDeprecatedSynchronousErrorHandling(){return Y}},X={closed:!0,next:function(e){},error:function(e){if(Z.useDeprecatedSynchronousErrorHandling)throw e;i(e)},complete:function(){}},J=Array.isArray||function(e){return e&&"number"==typeof e.length},Q=function(){var e=function(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this};return e.prototype=Object.create(Error.prototype),e}(),ee=function(){var e=function(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)};return e.prototype.unsubscribe=function(){var n;if(!this.closed){var o,i=this,u=i._parentOrParents,c=i._ctorUnsubscribe,s=i._unsubscribe,l=i._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,r(u,e))u.remove(this);else if(null!==u)for(var f=0;f<u.length;++f)u[f].remove(this);if(t(s)){c&&(this._unsubscribe=void 0);try{s.call(this)}catch(e){n=r(e,Q)?a(e.errors):[e]}}if(J(l)){f=-1;for(var d=l.length;++f<d;){var p=l[f];if(null!==(o=p)&&"object"==typeof o)try{p.unsubscribe()}catch(e){n=n||[],r(e,Q)?n=n.concat(a(e.errors)):n.push(e)}}}if(n)throw new Q(n)}},e.prototype.add=function(t){var n=t;if(!t)return e.EMPTY;switch(void 0===t?"undefined":o(t)){case"function":n=new e(t);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!r(n,e)){var i=n;(n=new e)._subscriptions=[i]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}var a=n._parentOrParents;if(null===a)n._parentOrParents=this;else if(r(a,e)){if(a===this)return n;n._parentOrParents=[a,this]}else{if(-1!==a.indexOf(this))return n;a.push(this)}var u=this._subscriptions;return null===u?this._subscriptions=[n]:u.push(n),n},e.prototype.remove=function(e){var t=this._subscriptions;if(t){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}},e.EMPTY=function(e){return e.closed=!0,e}(new e),e}(),te="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random(),ne=function(t){function n(e,o,i){var a=t.call(this)||this;switch(a.syncErrorValue=null,a.syncErrorThrown=!1,a.syncErrorThrowable=!1,a.isStopped=!1,arguments.length){case 0:a.destination=X;break;case 1:if(!e){a.destination=X;break}if("object"==typeof e){r(e,n)?(a.syncErrorThrowable=e.syncErrorThrowable,a.destination=e,e.add(a)):(a.syncErrorThrowable=!0,a.destination=new re(a,e));break}default:a.syncErrorThrowable=!0,a.destination=new re(a,e,o,i)}return a}return e(n,t),n.prototype[te]=function(){return this},n.create=function(e,t,r){var o=new n(e,t,r);return o.syncErrorThrowable=!1,o},n.prototype.next=function(e){this.isStopped||this._next(e)},n.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},n.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},n.prototype._next=function(e){this.destination.next(e)},n.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},n.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},n.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},n}(ee),re=function(n){var r=function(e,r,o,i){var a,u=n.call(this)||this;u._parentSubscriber=e;var c=u;return t(r)?a=r:r&&(a=r.next,o=r.error,i=r.complete,r!==X&&(t((c=Object.create(r)).unsubscribe)&&u.add(c.unsubscribe.bind(c)),c.unsubscribe=u.unsubscribe.bind(u))),u._context=c,u._next=a,u._error=o,u._complete=i,u};return e(r,n),r.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;Z.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},r.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,n=Z.useDeprecatedSynchronousErrorHandling;if(this._error)n&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)n?(t.syncErrorValue=e,t.syncErrorThrown=!0):i(e),this.unsubscribe();else{if(this.unsubscribe(),n)throw e;i(e)}}},r.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var n=function(){return e._complete.call(e._context)};Z.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},r.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),Z.useDeprecatedSynchronousErrorHandling)throw e;i(e)}},r.prototype.__tryOrSetError=function(e,t,n){if(!Z.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,n)}catch(t){return Z.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=t,e.syncErrorThrown=!0,!0):(i(t),!0)}return!1},r.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},r}(ne),oe="function"==typeof Symbol&&Symbol.observable||"@@observable",ie=function(){var e=function(e){this._isScalar=!1,e&&(this._subscribe=e)};return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var o=this.operator,i=function(e,t,n){if(e){if(r(e,ne))return e;if(e[te])return e[te]()}return e||t||n?new ne(e,t,n):new ne(X)}(e,t,n);if(o?i.add(o.call(i,this.source)):i.add(this.source||Z.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),Z.useDeprecatedSynchronousErrorHandling&&i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){Z.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),function(e){for(;e;){var t=e,n=t.closed,o=t.destination,i=t.isStopped;if(n||i)return!1;e=o&&r(o,ne)?o:null}return!0}(e)?e.error(t):console.warn(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=l(t))((function(t,r){var o;o=n.subscribe((function(t){try{e(t)}catch(e){r(e),o&&o.unsubscribe()}}),r,t)}))},e.prototype._subscribe=function(e){var t=this.source;return t&&t.subscribe(e)},e.prototype[oe]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?this:(0===(n=e).length?u:1===n.length?n[0]:function(e){return n.reduce((function(e,t){return t(e)}),e)})(this);var n},e.prototype.toPromise=function(e){var t=this;return new(e=l(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}(),ae="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ue="object"==typeof self&&self&&self.Object===Object&&self,ce=(ae||ue||Function("return this")()).Symbol,se=Object.prototype,le=se.hasOwnProperty,fe=se.toString,de=ce?ce.toStringTag:void 0,pe=Object.prototype.toString,he=ce?ce.toStringTag:void 0,ye=(q=Object.getPrototypeOf,z=Object,function(e){return q(z(e))}),ve=Function.prototype,be=Object.prototype,me=ve.toString,ge=be.hasOwnProperty,we=me.call(Object),Se=function(e){if(!function(e){return null!=e&&"object"==typeof e}(e)||"[object Object]"!=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":he&&he in Object(e)?function(e){var t=le.call(e,de),n=e[de];try{e[de]=void 0;var r=!0}catch(e){}var o=fe.call(e);return r&&(t?e[de]=n:delete e[de]),o}(e):function(e){return pe.call(e)}(e)}(e))return!1;var t=ye(e);if(null===t)return!0;var n=ge.call(t,"constructor")&&t.constructor;return"function"==typeof n&&r(n,n)&&me.call(n)==we},Oe=c(824);function _e(e,t,n){return _e=h()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&xe(o,n.prototype),o},_e.apply(null,arguments)}function Ee(e){return Ee=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ee(e)}function xe(e,t){return xe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},xe(e,t)}function je(e){var t="function"==typeof Map?new Map:void 0;return je=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return _e(e,arguments,Ee(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),xe(r,e)},je(e)}var Pe="/ws/rest/v1/",ke="/ws/fhir2/R4",Ce="".concat(Pe,"session"),Ae=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&xe(e,t)}(a,e);var t,n,i=(t=a,n=h(),function(){var e,r=Ee(t);if(n){var i=Ee(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!=((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":void 0===n?"undefined":o(n))&&"function"!=typeof t?f(e):t;var n}(this,e)});function a(e,t,n,o){var u;return function(e,t){if(!r(e,t))throw new TypeError("Cannot call a class as a function")}(this,a),p(f(u=i.call(this)),"response",void 0),p(f(u),"responseBody",void 0),u.message="Server responded with ".concat(t.status," (").concat(t.statusText,") for url ").concat(e,". Check err.responseBody or network tab in dev tools for more info"),o.message=u.message,u.responseBody=n,u.response=t,u.stack="Stacktrace for outgoing request:\n".concat(o.stack,"\nStacktrace for incoming response:\n").concat(u.stack),u}return a}(je(Error)),Te=c(254),Ie=c(385),De=function(e){return void 0===e},Me=(0,Ie.createGlobalStore)("session",{loaded:!1,session:null}),Re=0;function Ne(){var e;return e=function(e,t){return function(e,t){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=t.call(e,a)}catch(e){i=[6,e],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(n){switch(n.label){case 0:return[4,v(Ce,{method:"POST",body:{sessionLocation:e},headers:{"Content-Type":"application/json"},signal:t.signal})];case 1:return n.sent(),[4,S()];case 2:return n.sent(),[2]}}))},Ne=function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){m(i,r,o,a,u,"next",e)}function u(e){m(i,r,o,a,u,"throw",e)}a(void 0)}))},Ne.apply(this,arguments)}var Le=c(738);function Ue(){return Ue=A((function(e,t){var n,r,o,i,a,u=arguments;return I(this,(function(c){switch(c.label){case 0:return n=!(u.length>2&&void 0!==u[2])||u[2],e?(r=null,[4,Promise.all([v("".concat(ke,"/Patient/").concat(e),t).catch((function(e){return r=e})),n?M(e):Promise.resolve(null)])]):[3,2];case 1:if(o=T.apply(void 0,[c.sent(),2]),i=o[0],a=o[1],i.ok)return[2,i.data];if(a)return[2,a];if(r)throw r;c.label=2;case 2:return[2,null]}}))})),Ue.apply(this,arguments)}function Be(){return(Be=A((function(e){var t,n,r;return I(this,(function(o){switch(o.label){case 0:return[4,(0,Le.getSynchronizationItems)("patient-registration")];case 1:return t=o.sent(),n=t.find((function(t){return t.fhirPatient.id===e})),[2,null!==(r=null==n?void 0:n.fhirPatient)&&void 0!==r?r:null]}}))}))).apply(this,arguments)}var Fe=function(){var e=function(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this};return e.prototype=Object.create(Error.prototype),e}(),Ve=function(t){var n=function(e,n){var r=t.call(this)||this;return r.subject=e,r.subscriber=n,r.closed=!1,r};return e(n,t),n.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var n=t.indexOf(this.subscriber);-1!==n&&t.splice(n,1)}}},n}(ee),Ke=function(t){var n=function(e){var n=t.call(this,e)||this;return n.destination=e,n};return e(n,t),n}(ne),He=function(t){var n=function(){var e=t.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e};return e(n,t),n.prototype[te]=function(){return new Ke(this)},n.prototype.lift=function(e){var t=new $e(this,this);return t.operator=e,t},n.prototype.next=function(e){if(this.closed)throw new Fe;if(!this.isStopped)for(var t=this.observers,n=t.length,r=t.slice(),o=0;o<n;o++)r[o].next(e)},n.prototype.error=function(e){if(this.closed)throw new Fe;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,n=t.length,r=t.slice(),o=0;o<n;o++)r[o].error(e);this.observers.length=0},n.prototype.complete=function(){if(this.closed)throw new Fe;this.isStopped=!0;for(var e=this.observers,t=e.length,n=e.slice(),r=0;r<t;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(e){if(this.closed)throw new Fe;return t.prototype._trySubscribe.call(this,e)},n.prototype._subscribe=function(e){if(this.closed)throw new Fe;return this.hasError?(e.error(this.thrownError),ee.EMPTY):this.isStopped?(e.complete(),ee.EMPTY):(this.observers.push(e),new Ve(this,e))},n.prototype.asObservable=function(){var e=new ie;return e.source=this,e},n.create=function(e,t){return new $e(e,t)},n}(ie),$e=function(t){var n=function(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r};return e(n,t),n.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},n.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},n.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},n.prototype._subscribe=function(e){return this.source?this.source.subscribe(e):ee.EMPTY},n}(He),Ge=function(t){var n=function(e){var n=t.call(this)||this;return n._value=e,n};return e(n,t),Object.defineProperty(n.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),n.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return n&&!n.closed&&e.next(this._value),n},n.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new Fe;return this._value},n.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},n}(He),qe=function(){var e=function(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this};return e.prototype=Object.create(Error.prototype),e}(),ze=new ie((function(e){return e.complete()})),We=function(){var e=function(e){if(this.total=e,this.total<0)throw new qe};return e.prototype.call=function(e,t){return t.subscribe(new Ye(e,this.total))},e}(),Ye=function(t){var n=function(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r};return e(n,t),n.prototype._next=function(e){var t=this.total,n=++this.count;n<=t&&(this.destination.next(e),n===t&&(this.destination.complete(),this.unsubscribe()))},n}(ne),Ze=function(){var e=function(e,t){this.project=e,this.thisArg=t};return e.prototype.call=function(e,t){return t.subscribe(new Xe(e,this.project,this.thisArg))},e}(),Xe=function(t){var n=function(e,n,r){var o=t.call(this,e)||this;return o.project=n,o.count=0,o.thisArg=r||o,o};return e(n,t),n.prototype._next=function(e){var t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}this.destination.next(t)},n}(ne),Je="custom:(uuid,encounters:(uuid,encounterDatetime,form:(uuid,name),location:ref,encounterType:ref,encounterProviders:(uuid,display,provider:(uuid,display))),patient:(uuid,uuid),visitType:(uuid,name,display),attributes:(uuid,display,attributeType:(name,datatypeClassname,uuid),value),location:(uuid,name,display),startDatetime,stopDatetime)",Qe=function(){try{return JSON.parse(localStorage.getItem("openmrs:visitStoreState")||"null")}catch(e){return null}}()||{patientUuid:null,manuallySetVisitUuid:null};L().subscribe((function(e){var t;t=e,localStorage.setItem("openmrs:visitStoreState",JSON.stringify(t))}));var et,tt,nt=new Ge(null);!function(e){e.NEWVISIT="startVisit",e.EDITVISIT="editVisit",e.LOADING="loadingVisit"}(et||(et={})),function(e){e.NOTSTARTED="notStarted",e.ONGOING="ongoing"}(tt||(tt={}));var rt={"webservices.rest":"2.24.0",fhir2:"1.0.0-SNAPSHOT"}}(),s}())}}}))},66:function(){var e=function(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):d(e,t)};System.register(["@openmrs/esm-state"],(function(t,n){var r={};return{setters:[function(e){r.createGlobalStore=e.createGlobalStore}],execute:function(){t(function(){var t={685:function(e){e.exports=r}},n={};function o(e){var r=n[e];if(void 0!==r)return r.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,o),i.exports}o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return function(){var t=function(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")},n=function(e){return e&&e.sensitive?"":"i"},r=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},a=function(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return r(e,t);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)?r(e,t):void 0}}(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.")}()},u=function(t){return n=t.matcher,(null!=(r=RegExp)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):e(n,r))?t.matcher:"string"==typeof t.matcher?h(t.matcher):h(t.path);var n,r},c=function(e){return s([e])},s=function(e){var t=l(),n=e.map((function(e){return{matcher:u(e),settings:e}})),r=a(t).concat(a(n));y.setState(r,!0)},l=function(){return y.getState()},f=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},d=function(e,t){if(e.length>0){var n=v(e,t);if(n){for(var r=[n],o=v(e,n.settings.parent);void 0!==o;)r.push(o),o=v(e,o.settings.parent);return r.reverse()}}return[]},p=function(e){return d(l(),e)};function h(r,o,i){return e(r,RegExp)?function(e,t){if(!t)return e;var n=e.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)t.push({name:r,prefix:"",suffix:"",modifier:"",pattern:""});return e}(r,o):Array.isArray(r)?function(e,t,r){var o=e.map((function(e){return h(e,t,r).source}));return new RegExp("(?:"+o.join("|")+")",n(r))}(r,o,i):function(e,r,o){return function(e,r,o){void 0===o&&(o={});for(var i=o.strict,a=void 0!==i&&i,u=o.start,c=void 0===u||u,s=o.end,l=void 0===s||s,f=o.encode,d=void 0===f?function(e){return e}:f,p="["+t(o.endsWith||"")+"]|$",h="["+t(o.delimiter||"/#?")+"]",y=c?"^":"",v=0,b=e;v<b.length;v++){var m=b[v];if("string"==typeof m)y+=t(d(m));else{var g=t(d(m.prefix)),w=t(d(m.suffix));if(m.pattern)if(r&&r.push(m),g||w)if("+"===m.modifier||"*"===m.modifier){var S="*"===m.modifier?"?":"";y+="(?:"+g+"((?:"+m.pattern+")(?:"+w+g+"(?:"+m.pattern+"))*)"+w+")"+S}else y+="(?:"+g+"("+m.pattern+")"+w+")"+m.modifier;else y+="("+m.pattern+")"+m.modifier;else y+="(?:"+g+w+")"+m.modifier}}if(l)a||(y+=h+"?"),y+=o.endsWith?"(?="+p+")":"$";else{var O=e[e.length-1],_="string"==typeof O?h.indexOf(O[O.length-1])>-1:void 0===O;a||(y+="(?:"+h+"(?="+p+"))?"),_||(y+="(?="+h+"|"+p+")")}return new RegExp(y,n(o))}(function(e,n){void 0===n&&(n={});for(var r=function(e){for(var t=[],n=0;n<e.length;){var r=e[n];if("*"!==r&&"+"!==r&&"?"!==r)if("\\"!==r)if("{"!==r)if("}"!==r)if(":"!==r)if("("!==r)t.push({type:"CHAR",index:n,value:e[n++]});else{var o=1,i="";if("?"===e[u=n+1])throw new TypeError('Pattern cannot start with "?" at '+u);for(;u<e.length;)if("\\"!==e[u]){if(")"===e[u]){if(0==--o){u++;break}}else if("("===e[u]&&(o++,"?"!==e[u+1]))throw new TypeError("Capturing groups are not allowed at "+u);i+=e[u++]}else i+=e[u++]+e[u++];if(o)throw new TypeError("Unbalanced pattern at "+n);if(!i)throw new TypeError("Missing pattern at "+n);t.push({type:"PATTERN",index:n,value:i}),n=u}else{for(var a="",u=n+1;u<e.length;){var c=e.charCodeAt(u);if(!(c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||95===c))break;a+=e[u++]}if(!a)throw new TypeError("Missing parameter name at "+n);t.push({type:"NAME",index:n,value:a}),n=u}else t.push({type:"CLOSE",index:n,value:e[n++]});else t.push({type:"OPEN",index:n,value:e[n++]});else t.push({type:"ESCAPED_CHAR",index:n++,value:e[n++]});else t.push({type:"MODIFIER",index:n,value:e[n++]})}return t.push({type:"END",index:n,value:""}),t}(e),o=n.prefixes,i=void 0===o?"./":o,a="[^"+t(n.delimiter||"/#?")+"]+?",u=[],c=0,s=0,l="",f=function(e){if(s<r.length&&r[s].type===e)return r[s++].value},d=function(e){var t=f(e);if(void 0!==t)return t;var n=r[s],o=n.type,i=n.index;throw new TypeError("Unexpected "+o+" at "+i+", expected "+e)},p=function(){for(var e,t="";e=f("CHAR")||f("ESCAPED_CHAR");)t+=e;return t};s<r.length;){var h=f("CHAR"),y=f("NAME"),v=f("PATTERN");if(y||v){var b=h||"";-1===i.indexOf(b)&&(l+=b,b=""),l&&(u.push(l),l=""),u.push({name:y||c++,prefix:b,suffix:"",pattern:v||a,modifier:f("MODIFIER")||""})}else{var m=h||f("ESCAPED_CHAR");if(m)l+=m;else if(l&&(u.push(l),l=""),f("OPEN")){b=p();var g=f("NAME")||"",w=f("PATTERN")||"",S=p();d("CLOSE"),u.push({name:g||(w?c++:""),pattern:g&&!w?a:w,prefix:b,suffix:S,modifier:f("MODIFIER")||""})}else d("END")}}return u}(e,o),r,o)}(r,o,i)}o.r(i),o.d(i,{filterBreadcrumbs:function(){return d},getBreadcrumbs:function(){return l},getBreadcrumbsFor:function(){return p},registerBreadcrumb:function(){return c},registerBreadcrumbs:function(){return s}});var y=(0,o(685).createGlobalStore)("breadcrumbs",[]);function v(e,t){if(t)return function(e,t){return(n=e.filter((function(e){return e.matcher.test(t)})),function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),1!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(n)||function(e,t){if(e){if("string"==typeof e)return f(e,1);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)?f(e,1):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.")}())[0];var n}(e,t)||function(e,t){for(var n=t.split("/");n.length>1;){n.pop();var r=v(e,n.join("/"));if(r)return r}}(e,t)}}(),i}())}}}))},714:function(){var e=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":void 0===e?"undefined":b(e)};System.register(["@openmrs/esm-state","single-spa"],(function(t,n){var r={},o={};return{setters:[function(e){r.createGlobalStore=e.createGlobalStore,r.getGlobalStore=e.getGlobalStore},function(e){o.navigateToUrl=e.navigateToUrl}],execute:function(){t(function(){var t={685:function(e){e.exports=r},645:function(e){e.exports=o}},n={};function i(e){var r=n[e];if(void 0!==r)return r.exports;var o=n[e]={exports:{}};return t[e](o,o.exports,i),o.exports}i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return function(){var t=function(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]},n=function(e){return function n(r){return 0===arguments.length||t(r)?n:e.apply(this,arguments)}},r=function(e){return function r(o,i){switch(arguments.length){case 0:return r;case 1:return t(o)?r:n((function(t){return e(o,t)}));default:return t(o)&&t(i)?r:t(o)?n((function(t){return e(t,i)})):t(i)?n((function(t){return e(o,t)})):e(o,i)}}},o=function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n},u=function(e,t,n){for(var r=0,o=n.length;r<o;){if(e(t,n[r]))return!0;r+=1}return!1},c=function(e,t){return Object.prototype.hasOwnProperty.call(t,e)},s=function(e,t,n,r){var i=function(e,t){return le(e,t,n.slice(),r.slice())},a=o(e);return!u((function(e,t){return!u(i,t,e)}),o(t),a)},l=function(e){return function o(i,a,u){switch(arguments.length){case 0:return o;case 1:return t(i)?o:r((function(t,n){return e(i,t,n)}));case 2:return t(i)&&t(a)?o:t(i)?r((function(t,n){return e(t,a,n)})):t(a)?r((function(t,n){return e(i,t,n)})):n((function(t){return e(i,a,t)}));default:return t(i)&&t(a)&&t(u)?o:t(i)&&t(a)?r((function(t,n){return e(t,n,u)})):t(i)&&t(u)?r((function(t,n){return e(t,a,n)})):t(a)&&t(u)?r((function(t,n){return e(i,t,n)})):t(i)?n((function(t){return e(t,a,u)})):t(a)?n((function(t){return e(i,t,u)})):t(u)?n((function(t){return e(i,a,t)})):e(i,a,u)}}},f=function(e){return"[object Object]"===Object.prototype.toString.call(e)},d=function(e,t,n){for(var r=n.next();!r.done;){if((t=e["@@transducer/step"](t,r.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}r=n.next()}return e["@@transducer/result"](t)},p=function(e,t,n,r){return e["@@transducer/result"](n[r](_e(e["@@transducer/step"],e),t))},h=function(e,t){return function(n){if(!e(n))return"function"==typeof t?t(n):t}},y=function(e){return(0,Ie.getGlobalStore)("config-module-".concat(e),{config:null,loaded:!1})},v=function(){return(0,Ie.getGlobalStore)("config-extension-slots",{slots:{}})},b=function(e){return m(v().getState(),e)},m=function(e,t){var n=e.slots[t];return null!=n?n:{loaded:!1,config:{}}},g=function(){return(0,Ie.getGlobalStore)("config-extensions",{configs:{}})},w=function(e,t){var n=Object.assign({},S(g().getState(),e,t));return n.config=ye(["Display conditions","Translation overrides"],n.config),n},S=function(e,t,n){var r,o=null===(r=e.configs[t])||void 0===r?void 0:r[n];return null!=o?o:{loaded:!1,config:null}},O=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},_=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},E=function(e){for(var t=arguments,n=function(n){var r=null!=t[n]?t[n]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),o.forEach((function(t){_(e,t,r[t])}))},r=1;r<arguments.length;r++)n(r);return e},x=function(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e},j=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||k(e,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.")}()},P=function(e){return function(e){if(Array.isArray(e))return O(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||k(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.")}()},k=function(e,t){if(e){if("string"==typeof e)return O(e,t);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)?O(e,t):void 0}},C=function(e,t){var n=!0,r=!1,o=void 0;try{for(var i,a=Object.keys(e.schemas)[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var u=i.value,c=K(u,e,t);y(u).setState({loaded:!0,config:c})}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}},A=function(e,t){var n,r,o=(n=$(V(e,t)),function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=Object.entries(e)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=j(o.value,2),u=a[0],c=a[1],s=!0,l=!1,f=void 0;try{for(var d,p=Object.entries(c)[Symbol.iterator]();!(s=(d=p.next()).done);s=!0){var h=j(d.value,2),y=h[0];F(h[1],u,y)}}catch(e){l=!0,f=e}finally{try{s||null==p.return||p.return()}finally{if(l)throw f}}}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}}(r=Object.keys(n).reduce((function(e,t){var r,o;return(null===(r=n[t])||void 0===r?void 0:r.extensionSlots)&&(e[t]=null===(o=n[t])||void 0===o?void 0:o.extensionSlots),e}),{})),Object.keys(r).reduce((function(e,t){return E({},e,r[t])}),{})),i=Object.fromEntries(Object.entries(o).map((function(e){var t=j(e,2);return[t[0],{loaded:!0,config:t[1]}]}))),a=v(),u=a.getState(),c={slots:E({},u.slots,i)};fe(u,c)||a.setState(c)},T=function(e,t){var n=function(e,t){var n=Le(me(e.schemas)),r=P(e.providedConfigs.map((function(e){return[e.config,e.source]}))).concat([[t.config,"temporary config"]]),o=!0,i=!1,a=void 0;try{for(var u,c=r[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){var s=j(u.value,2);n=$([n,Ue(s[0],s[1])])}}catch(e){i=!0,a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t);Ne.setState({config:n})},I=function(e,t,n){var r={},o=!0,i=!1,a=void 0;try{for(var u,c=t.mountedExtensions[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){var s=u.value,l=B(s.slotModuleName,s.extensionModuleName,s.slotName,s.extensionId,e,n);r[s.slotName]=x(E({},r[s.slotName]),_({},s.extensionId,{config:l,loaded:!0}))}}catch(e){i=!0,a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}g().setState({configs:r})},D=function(e,t){Be(e,t);var n=he(t,He),r=De.getState();De.setState({schemas:x(E({},r.schemas),_({},e,n))})},M=function(e,t){Be(e,t);var n=he(t,He),r=De.getState();r.schemas[e]&&console.warn("Config schema for extension ".concat(e," already exists. If there are multiple extensions with this same name, one will probably crash.")),De.setState({schemas:x(E({},r.schemas),_({},e,n))})},R=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"provided",n=De.getState();De.setState({providedConfigs:P(n.providedConfigs).concat([{source:t,config:e}])})},N=function(e){return new Promise((function(t){var n=function(e){if(e.loaded&&e.config){var n=ye(["Display conditions","Translation overrides"],e.config);t(n),o&&o()}},r=y(e);n(r.getState());var o=r.subscribe(n)}))},L=function(e){return new Promise((function(t){var n=function(e){if(e.loaded&&e.config){var n=e.config;t(n),o&&o()}},r=y(e);n(r.getState());var o=r.subscribe(n)}))},U=function(e,t,n){G(e,t,n);var r=Ke(e,t);return Ve(e,r,n),r},B=function(e,t,n,r,o,i){var a,u,c,s,l=function(e){return j(e.split("#"),1)[0]}(r),f=o.schemas[l],d=f?l:t,p=V(o,i),h=H(e,p),y=null!==(s=null==h||null===(a=h.extensionSlots)||void 0===a||null===(u=a[n])||void 0===u||null===(c=u.configure)||void 0===c?void 0:c[r])&&void 0!==s?s:{},v=$([H(d,p),y]),b=null!=f?f:o.schemas[t];G(b,v,d);var m=Ke(b,v);return Ve(b,m,d),delete m.extensionSlots,m},F=function(e,t,n){var r="Extension slot config '".concat(t,".extensionSlots.").concat(n),o=Object.keys(e).filter((function(e){return!["add","remove","order","configure"].includes(e)}));o.length&&console.error(r+"' contains invalid keys '".concat(o.join("', '"),"'")),e.add&&(Array.isArray(e.add)&&e.add.every((function(e){return"string"==typeof e}))||console.error(r+".add' is invalid. Must be an array of strings (extension IDs)")),e.remove&&(Array.isArray(e.remove)&&e.remove.every((function(e){return"string"==typeof e}))||console.error(r+".remove' is invalid. Must be an array of strings (extension IDs)")),e.order&&(Array.isArray(e.order)&&e.order.every((function(e){return"string"==typeof e}))||console.error(r+".order' is invalid. Must be an array of strings (extension IDs)")),e.configure&&(Y(e.configure)||console.error(r+".configure' is invalid. Must be an object with extension IDs for keys"))},V=function(e,t){return P(e.providedConfigs.map((function(e){return e.config}))).concat([t.config])},K=function(e,t,n){if(!t.schemas.hasOwnProperty(e))throw Error("No config schema has been defined for "+e);var r=t.schemas[e],o=H(e,V(t,n));G(r,o,e);var i=Ke(r,o);return Ve(r,i,e),delete i.extensionSlots,i},H=function(e,t){return $(t.map((function(t){return t[e]})).filter((function(e){return!!e})))},$=function(e){return xe(he)({},e)},G=function(e,t){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(t)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var c=a.value,s=t[c],l=n+"."+c,f=e[c];e.hasOwnProperty(c)?Fe(f,s,l):"extensionSlots"===c&&""!==n||console.error("Unknown config key '".concat(l,"' provided. Ignoring."))}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}},q=function(e,t,n){t&&z(e,[{Array:je,Boolean:Pe,ConceptUuid:Te,Number:ke,Object:Ae,String:Ce,UUID:Te,PersonAttributeTypeUuid:Te,PatientIdentifierTypeUuid:Te}[t]],n)},z=function(e,t,n){if(t)try{var r=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var c=(0,a.value)(n);"string"==typeof c&&("object"==typeof n?console.error("Invalid configuration for ".concat(e,": ").concat(c)):console.error("Invalid configuration value ".concat(n," for ").concat(e,": ").concat(c)))}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}catch(t){console.error('Skipping invalid validator at "'.concat(e,'". Encountered error\n\t').concat(t))}},W=function(e){return!!e&&Object.keys(e).filter((function(e){return!["_default","_validators"].includes(e)})).length>0},Y=function(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e},Z=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},X=function(e,t){var n=window.getOpenmrsSpaBase().replace(/\/$/,"");return J(e,function(e){for(var t=arguments,n=function(n){var r=null!=t[n]?t[n]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),o.forEach((function(t){Z(e,t,r[t])}))},r=1;r<arguments.length;r++)n(r);return e}({openmrsBase:window.openmrsBase,openmrsSpaBase:n},t)).replace(/^\/\//,"/")},J=function(e,t){return Object.keys(t).reduce((function(e,n){return e.split("${"+n+"}").join(t[n])}),e)},Q=function(e){var t=e.to,n=e.templateParams,r=window.getOpenmrsSpaBase().replace(/\/$/,""),o=X(t,n);o.startsWith(r)?(0,$e.navigateToUrl)(o):window.location.assign(o)};i.r(a),i.d(a,{Type:function(){return be},configExtensionStore:function(){return Re},configInternalStore:function(){return De},defineConfigSchema:function(){return D},defineExtensionConfigSchema:function(){return M},getConfig:function(){return N},getConfigInternal:function(){return L},getConfigStore:function(){return y},getExtensionConfig:function(){return w},getExtensionConfigFromStore:function(){return S},getExtensionSlotConfig:function(){return b},getExtensionSlotConfigFromStore:function(){return m},getExtensionSlotsConfigStore:function(){return v},getExtensionsConfigStore:function(){return g},implementerToolsConfigStore:function(){return Ne},inRange:function(){return Ge},interpolateString:function(){return J},interpolateUrl:function(){return X},isUrl:function(){return ze},isUrlWithTemplateParameters:function(){return qe},navigate:function(){return Q},oneOf:function(){return We},processConfig:function(){return U},provide:function(){return R},temporaryConfigStore:function(){return Me},validator:function(){return h},validators:function(){return Ye}});var ee="function"==typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},te=Object.prototype.toString,ne=function(){return"[object Arguments]"===te.call(arguments)?function(e){return"[object Arguments]"===te.call(e)}:function(e){return c("callee",e)}}(),re=ne,oe=!{toString:null}.propertyIsEnumerable("toString"),ie=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],ae=function(){return arguments.propertyIsEnumerable("length")}(),ue=function(e,t){for(var n=0;n<e.length;){if(e[n]===t)return!0;n+=1}return!1},ce="function"!=typeof Object.keys||ae?n((function(e){if(Object(e)!==e)return[];var t,n,r=[],o=ae&&re(e);for(t in e)!c(t,e)||o&&"length"===t||(r[r.length]=t);if(oe)for(n=ie.length-1;n>=0;)c(t=ie[n],e)&&!ue(r,t)&&(r[r.length]=t),n-=1;return r})):n((function(e){return Object(e)!==e?[]:Object.keys(e)})),se=n((function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}));function le(t,n,r,o){if(ee(t,n))return!0;var i,a,u=se(t);if(u!==se(n))return!1;if(null==t||null==n)return!1;if("function"==typeof t["fantasy-land/equals"]||"function"==typeof n["fantasy-land/equals"])return"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](n)&&"function"==typeof n["fantasy-land/equals"]&&n["fantasy-land/equals"](t);if("function"==typeof t.equals||"function"==typeof n.equals)return"function"==typeof t.equals&&t.equals(n)&&"function"==typeof n.equals&&n.equals(t);switch(u){case"Arguments":case"Array":case"Object":if("function"==typeof t.constructor&&"Promise"===(i=t.constructor,null==(a=String(i).match(/^function (\w*)/))?"":a[1]))return t===n;break;case"Boolean":case"Number":case"String":if((void 0===t?"undefined":e(t))!=(void 0===n?"undefined":e(n))||!ee(t.valueOf(),n.valueOf()))return!1;break;case"Date":if(!ee(t.valueOf(),n.valueOf()))return!1;break;case"Error":return t.name===n.name&&t.message===n.message;case"RegExp":if(t.source!==n.source||t.global!==n.global||t.ignoreCase!==n.ignoreCase||t.multiline!==n.multiline||t.sticky!==n.sticky||t.unicode!==n.unicode)return!1}for(var l=r.length-1;l>=0;){if(r[l]===t)return o[l]===n;l-=1}switch(u){case"Map":return t.size===n.size&&s(t.entries(),n.entries(),r.concat([t]),o.concat([n]));case"Set":return t.size===n.size&&s(t.values(),n.values(),r.concat([t]),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=ce(t);if(f.length!==ce(n).length)return!1;var d=r.concat([t]),p=o.concat([n]);for(l=f.length-1;l>=0;){var h=f[l];if(!c(h,n)||!le(n[h],t[h],d,p))return!1;l-=1}return!0}var fe=r((function(e,t){return le(e,t,[],[])})),de=l((function(e,t,n){var r,o={};for(r in t)c(r,t)&&(o[r]=c(r,n)?e(r,t[r],n[r]):t[r]);for(r in n)c(r,n)&&!c(r,o)&&(o[r]=n[r]);return o})),pe=l((function e(t,n,r){return de((function(n,r,o){return f(r)&&f(o)?e(t,r,o):t(n,r,o)}),n,r)})),he=r((function(e,t){return pe((function(e,t,n){return n}),e,t)})),ye=r((function(e,t){for(var n={},r={},o=0,i=e.length;o<i;)r[e[o]]=1,o+=1;for(var a in t)r.hasOwnProperty(a)||(n[a]=t[a]);return n}));function ve(e,t,n,r){var o,i=function(o){for(var i=t.length,a=0;a<i;){if(e===t[a])return n[a];a+=1}for(var u in t[a+1]=e,n[a+1]=o,e)o[u]=r?ve(e[u],t,n,!0):e[u];return o};switch(se(e)){case"Object":return i({});case"Array":return i([]);case"Date":return new Date(e.valueOf());case"RegExp":return o=e,new RegExp(o.source,(o.global?"g":"")+(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.sticky?"y":"")+(o.unicode?"u":""));default:return e}}var be,me=n((function(e){return null!=e&&"function"==typeof e.clone?e.clone():ve(e,[],[],!0)})),ge=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)},we=n((function(e){return!!ge(e)||!!e&&"object"==typeof e&&!function(e){return"[object String]"===Object.prototype.toString.call(e)}(e)&&(1===e.nodeType?!!e.length:0===e.length||e.length>0&&e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1))})),Se=function(){var e=function(e){this.f=e};return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(e){return e},e.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},e}(),Oe=r((function(e,t){return function(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,n){return t.apply(this,arguments)};case 3:return function(e,n,r){return t.apply(this,arguments)};case 4:return function(e,n,r,o){return t.apply(this,arguments)};case 5:return function(e,n,r,o,i){return t.apply(this,arguments)};case 6:return function(e,n,r,o,i,a){return t.apply(this,arguments)};case 7:return function(e,n,r,o,i,a,u){return t.apply(this,arguments)};case 8:return function(e,n,r,o,i,a,u,c){return t.apply(this,arguments)};case 9:return function(e,n,r,o,i,a,u,c,s){return t.apply(this,arguments)};case 10:return function(e,n,r,o,i,a,u,c,s,l){return t.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}(e.length,(function(){return e.apply(t,arguments)}))})),_e=Oe,Ee="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",xe=l((function(e,t,n){if("function"==typeof e&&(e=function(e){return new Se(e)}(e)),we(n))return function(e,t,n){for(var r=0,o=n.length;r<o;){if((t=e["@@transducer/step"](t,n[r]))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}r+=1}return e["@@transducer/result"](t)}(e,t,n);if("function"==typeof n["fantasy-land/reduce"])return p(e,t,n,"fantasy-land/reduce");if(null!=n[Ee])return d(e,t,n[Ee]());if("function"==typeof n.next)return d(e,t,n);if("function"==typeof n.reduce)return p(e,t,n,"reduce");throw new TypeError("reduce: list must be array or iterable")}));!function(e){e.Array="Array",e.Boolean="Boolean",e.ConceptUuid="ConceptUuid",e.Number="Number",e.Object="Object",e.String="String",e.UUID="UUID",e.PersonAttributeTypeUuid="PersonAttributeTypeUuid",e.PatientIdentifierTypeUuid="PatientIdentifierTypeUuid"}(be||(be={}));var je=h((function(e){return Array.isArray(e)}),"must be an array"),Pe=h((function(e){return"boolean"==typeof e}),"must be a boolean"),ke=h((function(e){return"number"==typeof e}),"must be a number"),Ce=h((function(e){return"string"==typeof e}),"must be a string"),Ae=h((function(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}),"must be an object (not an array or null)"),Te=h((function(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)||/^[0-9a-f]{36}$/i.test(e)}),"must be a valid UUID or a 36-character hexadecimal string"),Ie=i(685),De=(0,Ie.createGlobalStore)("config-internal",{providedConfigs:[],schemas:{}}),Me=(0,Ie.createGlobalStore)("temporary-config",{config:function(){try{return JSON.parse(localStorage.getItem("openmrs:temporaryConfig")||"{}")}catch(e){return{}}}()});Me.subscribe((function(e){var t;t=e.config,localStorage.setItem("openmrs:temporaryConfig",JSON.stringify(t))}));var Re=(0,Ie.createGlobalStore)("config-store-of-extension-state",{mountedExtensions:[]}),Ne=(0,Ie.createGlobalStore)("config-implementer-tools",{config:{}});function Le(e){return e.hasOwnProperty("_default")?x(E({},e),{_value:e._default,_source:"default"}):Y(e)?Object.keys(e).reduce((function(t,n){return t[n]=Le(e[n]),t}),{}):{}}function Ue(e,t){return Y(e)?Object.keys(e).reduce((function(n,r){return n[r]=Ue(e[r],t),n}),{}):{_value:e,_source:t}}function Be(e,t){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,c=function(){var o=u.value,i=n+(n&&".")+o,a=t[o];if("Display conditions"===i&&console.error("".concat(e,' declares a configuration option called "Display conditions"; the "Display conditions" option is a reserved name. ').concat(r)),"Translation overrides"===i&&console.error("".concat(e,' declares a configuration option called "Translation overrides"; the "Translation overrides" option is a reserved name. ').concat(r)),!Y(a))return console.error("".concat(e," has bad config schema definition for key '").concat(i,"'. ").concat(r)),"continue";a.hasOwnProperty("_default")||Be(e,a,i);var c=a._elements;if(W(c)&&Be(e,c,i+"._elements"),a._validators){var s=!0,l=!1,f=void 0;try{for(var d,p=a._validators[Symbol.iterator]();!(s=(d=p.next()).done);s=!0){var h=d.value;"function"!=typeof h&&console.error("".concat(e," 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(h,"."))}}catch(e){l=!0,f=e}finally{try{s||null==p.return||p.return()}finally{if(l)throw f}}}var y=a._type;y&&!Object.values(be).includes(y)&&console.error("".concat(e," has invalid type for key '").concat(i,"' ").concat(r,".")+"\n\nIf you're the maintainer: the allowed types are ".concat(Object.values(be).join(", "),". ")+"Received '".concat(y,"'")),Object.keys(a).every((function(e){return["_description","_validators","_elements","_type"].includes(e)}))&&!n.includes("._elements")&&console.error("".concat(e," 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))),c&&y&&![be.Array,be.Object].includes(y)&&console.error("".concat(e," 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(y)))},s=Object.keys(t).filter((function(e){return!e.startsWith("_")}))[Symbol.iterator]();!(o=(u=s.next()).done);o=!0)c()}catch(e){i=!0,a=e}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}}function Fe(e,t,n){q(n,e._type,t),Y(t)?e._type===be.Object?function(e,t,n){if(e._elements){var 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 c=a.value,s=t[c];G(e._elements,s,"".concat(n,".").concat(c))}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}}(e,t,n):e.hasOwnProperty("_default")||G(e,t,n):e._type===be.Array&&function(e,t,n){if(W(e._elements))for(var r=0;r<t.length;r++)Fe(e._elements,t[r],"".concat(n,"[").concat(r,"]"));for(var o=0;o<t.length;o++){var i;q("".concat(n,"[").concat(o,"]"),null===(i=e._elements)||void 0===i?void 0:i._type,t[o])}}(e,t,n)}function Ve(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(e)if(t!==e._default&&z(n,e._validators,t),Y(t)){var 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 c=a.value,s=t[c],l=n+"."+c,f=e[c];e._type===be.Object&&e._elements?Ve(e._elements,s,l):Ve(f,s,l)}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}else if(Array.isArray(t)&&e._elements)for(var d=0;d<t.length;d++)Ve(e._elements,t[d],"".concat(n,"[").concat(d,"]"))}C(De.getState(),Me.getState()),De.subscribe((function(e){return C(e,Me.getState())})),Me.subscribe((function(e){return C(De.getState(),e)})),T(De.getState(),Me.getState()),De.subscribe((function(e){return T(e,Me.getState())})),Me.subscribe((function(e){return T(De.getState(),e)})),A(De.getState(),Me.getState()),De.subscribe((function(e){return A(e,Me.getState())})),Me.subscribe((function(e){return A(De.getState(),e)})),I(De.getState(),Re.getState(),Me.getState()),De.subscribe((function(e){I(e,Re.getState(),Me.getState())})),Re.subscribe((function(e){I(De.getState(),e,Me.getState())})),Me.subscribe((function(e){I(De.getState(),Re.getState(),e)}));var Ke=function(e,t){var n=me(t);if(!e)return n;var r=!0,o=!1,i=void 0;try{for(var a,u=function(){var t=a.value,r=n[t],o=e[t];if(o&&o.hasOwnProperty("_default")){n.hasOwnProperty(t)||(n[t]=o._default);var i=o._elements;if(r&&W(i))if(o._type===be.Array&&Array.isArray(r)){var u=r.map((function(e){return Ke(i,e)}));n[t]=u}else if(o._type===be.Object){var c=!0,s=!1,l=void 0;try{for(var f,d=Object.keys(r)[Symbol.iterator]();!(c=(f=d.next()).done);c=!0){var p=f.value;r[p]=Ke(i,r[p])}}catch(e){s=!0,l=e}finally{try{c||null==d.return||d.return()}finally{if(s)throw l}}}}else if(Y(o)){var h=n.hasOwnProperty(t)?r:{};Y(h)&&(n[t]=Ke(o,h))}},c=Object.keys(e)[Symbol.iterator]();!(r=(a=c.next()).done);r=!0)u()}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n},He={"Display conditions":{privileges:{_description:"The privilege(s) the user must have to use this extension",_type:be.Array,_default:[]}},"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:be.Object,_default:{}}},$e=i(645),Ge=function(e,t){return h((function(n){return e<=n&&n<=t}),"must be between ".concat(e," and ").concat(t))},qe=function(e){var t=e.concat(["openmrsBase","openmrsSpaBase"]);return h((function(e){if(!e||"string"!=typeof e)return!1;for(var n=/\${(.*?)}/g,r=n.exec(e);r;){if(!t.includes(r[1]))return!1;r=n.exec(e)}return!0}),"Should be a URL or path. The allowed template parameters are "+t.map((function(e){return"${"+e+"}"})).join(", "))},ze=qe([]),We=function(e){return h((function(t){return e.includes(t)}),"Must be one of the following: '".concat(e.join("', '"),"'."))},Ye={inRange:Ge,isUrl:ze,isUrlWithTemplateParameters:qe,oneOf:We}}(),a}())}}}))},674:function(){System.register(["@openmrs/esm-globals"],(function(e,t){var n={};return{setters:[function(e){n.dispatchNotificationShown=e.dispatchNotificationShown}],execute:function(){e(function(){var e={728:function(e){e.exports=n}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return function(){var e=function(e){var t=n(e);setTimeout((function(){throw t}))},t=function(){var t=Error();return function(r){n(r).stack+="\nAsync stacktrace:\n".concat(t.stack),e(r)}},n=function(e){var t,n,r,o,i;if(n=e,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):d(o,i)))return e;if(null===e)return Error("'null' was thrown as an error");if("object"==typeof e){try{t="Object thrown as error: ".concat(JSON.stringify(e))}catch(n){t="Object thrown as error with the following properties: ".concat(Object.keys(e))}return Error(t)}return void 0===e?Error("'undefined' was thrown as an error"):Error(e.toString())};r.r(o),r.d(o,{createErrorHandler:function(){return t},reportError:function(){return e}});var i=r(728);window.onerror=function(e){return console.error("Unexpected error: ",e),(0,i.dispatchNotificationShown)({description:null!=e?e:"Oops! An unexpected error occurred.",kind:"error",title:"Error"}),!1},window.onunhandledrejection=function(e){var t;console.error("Unhandled rejection: ",e.reason),(0,i.dispatchNotificationShown)({description:null!==(t=e.reason)&&void 0!==t?t:"Oops! An unhandled promise rejection occurred.",kind:"error",title:"Error"})}}(),o}())}}}))},570:function(){System.register(["@openmrs/esm-state"],(function(e,t){var n={};return{setters:[function(e){n.getGlobalStore=e.getGlobalStore}],execute:function(){e(function(){var e={685:function(e){e.exports=n}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return function(){var e=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},t=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},n=function(e){for(var n=arguments,r=function(r){var o=null!=n[r]?n[r]:{},i=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(o).filter((function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable})))),i.forEach((function(n){t(e,n,o[n])}))},o=1;o<arguments.length;o++)r(o);return e},i=function(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e},a=function(e,r,o){var a;d.setState((function(u){var c;return{flags:i(n({},u.flags),t({},e,{enabled:null!==(a=null===(c=u.flags[e])||void 0===c?void 0:c.enabled)&&void 0!==a&&a,label:r,description:o}))}}))},u=function(e){return d.getState().flags[e].enabled},c=function(e,t){d.subscribe((function(n){t(n.flags[e].enabled)}))},s=function(e,r){d.setState((function(o){return{flags:i(n({},o.flags),t({},e,i(n({},o.flags[e]),{enabled:r})))}}))};r.r(o),r.d(o,{featureFlagsStore:function(){return d},getFeatureFlag:function(){return u},registerFeatureFlag:function(){return a},setFeatureFlag:function(){return s},subscribeToFeatureFlag:function(){return c}});var l=r(685),f={flags:function(){var e={},t=!0,r=!1,o=void 0;try{for(var i,a=Object.keys(localStorage)[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var u=i.value;if(u.startsWith("openmrs:feature-flag:")){var c=u.replace("openmrs:feature-flag:",""),s=JSON.parse(localStorage.getItem("openmrs:feature-flag-meta:".concat(c))||"{}");e[c]=n({enabled:"true"===localStorage.getItem(u)},s)}}}catch(e){r=!0,o=e}finally{try{t||null==a.return||a.return()}finally{if(r)throw o}}return e}()},d=(0,l.getGlobalStore)("feature-flags",f);d.subscribe((function(t){var n,r=!0,o=!1,i=void 0;try{for(var a,u=Object.entries(t.flags)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var c=function(e){if(Array.isArray(e))return e}(n=a.value)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(n)||function(t,n){if(t){if("string"==typeof t)return e(t,2);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(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,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.")}(),s=c[0],l=c[1];localStorage.setItem("openmrs:feature-flag:".concat(s),l.enabled.toString()),localStorage.setItem("openmrs:feature-flag-meta:".concat(s),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}())}}}))},103:function(){System.register([],(function(e,t){return{execute:function(){e(function(){var e=function(e){window.dispatchEvent(new CustomEvent(d,{detail:{online:e}}))},t=function(e){var t=function(t){return e(t.detail)};return window.addEventListener(d,t),function(){return window.removeEventListener(d,t)}},n=function(e){return e({online:navigator.onLine}),t(e)},r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};window.dispatchEvent(new CustomEvent(p,{detail:e}))},o=function(e){var t=function(t){return e(t.detail)};return window.addEventListener(p,t),function(){return window.removeEventListener(p,t)}},i=function(e){window.dispatchEvent(new CustomEvent(h,{detail:e}))},a=function(e){window.dispatchEvent(new CustomEvent(y,{detail:e}))},u=function(e){var t=function(t){return e(t.detail)};return window.addEventListener(h,t),function(){return window.removeEventListener(h,t)}},c=function(e){var t=function(t){return e(t.detail)};return window.addEventListener(y,t),function(){return window.removeEventListener(y,t)}},s=function(e){var t=function(t){return e(t.detail)};return window.addEventListener(v,t),function(){return window.removeEventListener(v,t)}},l={d:function(e,t){for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},f={};l.r(f),l.d(f,{dispatchActionableNotificationShown:function(){return a},dispatchConnectivityChanged:function(){return e},dispatchNotificationShown:function(){return i},dispatchPrecacheStaticDependencies:function(){return r},subscribeActionableNotificationShown:function(){return c},subscribeConnectivity:function(){return n},subscribeConnectivityChanged:function(){return t},subscribeNotificationShown:function(){return u},subscribePrecacheStaticDependencies:function(){return o},subscribeToastShown:function(){return s}});var d="openmrs:connectivity-changed",p="openmrs:precache-static-dependencies",h="openmrs:notification-shown",y="openmrs:actionable-notification-shown",v="openmrs:toast-shown";return f}())}}}))},45:function(e){e.exports=i},740:function(e){e.exports=a},685:function(e){e.exports=s},954:function(e){e.exports=m},493:function(e){e.exports=g},792:function(e){e.exports=w}},r={};function S(e){var n=r[e];if(void 0!==n)return n.exports;var o=r[e]={exports:{}};return t[e].call(o.exports,o,o.exports,S),o.exports}S.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return S.d(t,{a:t}),t},S.d=function(e,t){for(var n in t)S.o(t,n)&&!S.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},S.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),S.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},S.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var O={};return function(){var t=function(e,t){var n=(new DOMParser).parseFromString(t,"text/html").querySelector("svg");n&&(n.id=e,Br.appendChild(n))},r=function(e,t){return new Promise((function(n){var r=new MessageChannel;r.port1.onmessage=function(e){n(e.data)},e.postMessage(t,[r.port2])}))},i=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},a=function(e,t){var n=location.href;return new URL(e,n).href===new URL(t,n).href},s=function(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)},m=function(){},g=function(e,t){if(!t)return e&&e.then?e.then(m):Promise.resolve()},w=function(e,t){return"object"!=typeof t||Jr(t).forEach((function(n){e[n]=t[n]})),e},O=function(e,t){return to.call(e,t)},E=function(e,t){"function"==typeof t&&(t=t(eo(e))),("undefined"==typeof Reflect?Jr:Reflect.ownKeys)(t).forEach((function(n){x(e,n,t[n])}))},x=function(e,t,n,r){no(e,t,w(n&&O(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))},j=function(e){return{from:function(t){return e.prototype=Object.create(t.prototype),x(e.prototype,"constructor",e),{extend:E.bind(null,e.prototype)}}}},P=function(e,t,n){return io.call(e,t,n)},k=function(e,t){return t(e)},C=function(e){if(!e)throw new Error("Assertion Failed")},A=function(e){Xr.setImmediate?setImmediate(e):setTimeout(e,0)},T=function(e,t){return e.reduce((function(e,n,r){var o=t(n,r);return o&&(e[o[0]]=o[1]),e}),{})},I=function(e){var t={};for(var n in e)O(e,n)&&(t[n]=e[n]);return t},D=function(e){return co.apply([],e)},M=function(e){fo="undefined"!=typeof WeakMap&&new WeakMap;var t=po(e);return fo=null,t},R=function(e){return ho.call(e).slice(8,-1)},N=function(e){var t,n,r,o;if(1===arguments.length){if(Qr(e))return e.slice();if(this===bo&&"string"==typeof e)return[e];if(o=vo(e)){for(n=[];!(r=o.next()).done;)n.push(r.value);return n}if(null==e)return[e];if("number"==typeof(t=e.length)){for(n=new Array(t);t--;)n[t]=e[t];return n}return[e]}for(t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];return n},L=function(e,t){go=e,wo=t},U=function(e,t){var n=e.stack;return n?(t=t||0,0===n.indexOf(e.name)&&(t+=(e.name+e.message).split("\n").length),n.split("\n").slice(t).filter(wo).map((function(e){return"\n"+e})).join("")):""},B=function(e,t){this._e=Oo(),this.name=e,this.message=t},F=function(e,t){return e+". Errors: "+Object.keys(t).map((function(e){return t[e].toString()})).filter((function(e,t,n){return n.indexOf(e)===t})).join("\n")},V=function(e,t,n,r){this._e=Oo(),this.failures=t,this.failedKeys=r,this.successCount=n,this.message=F(e,t)},K=function(e,t){this._e=Oo(),this.name="BulkError",this.failures=Object.keys(t).map((function(e){return t[e]})),this.failuresByPos=t,this.message=F(e,t)},H=function(){},$=function(e){return e},G=function(e,t){return null==e||e===$?t:function(n){return t(e(n))}},q=function(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}},z=function(e,t){return e===H?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var i=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?q(r,this.onsuccess):r),o&&(this.onerror=this.onerror?q(o,this.onerror):o),void 0!==i?i:n}},W=function(e,t){return e===H?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?q(n,this.onsuccess):n),r&&(this.onerror=this.onerror?q(r,this.onerror):r)}},Y=function(e,t){return e===H?t:function(n){var r=e.apply(this,arguments);w(n,r);var o=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return o&&(this.onsuccess=this.onsuccess?q(o,this.onsuccess):o),i&&(this.onerror=this.onerror?q(i,this.onerror):i),void 0===r?void 0===a?void 0:a:w(r,a)}},Z=function(e,t){return e===H?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}},X=function(e,t){return e===H?t:function(){var n=e.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 t.apply(r,i)}))}return t.apply(this,arguments)}},J=function(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=H,this._lib=!1;var t=this._PSD=Yo;if(go&&(this._stackHolder=Oo(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==To)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&ee(this,this._value))}this._state=null,this._value=null,++t.ref,ei(this,e)},Q=function(e,t,n,r,o){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=o},ee=function(e,t){if(Go.push(t),null===e._state){var n=e._lib&&ae();t=zo(t),e._state=!1,e._value=t,go&&null!==t&&"object"==typeof t&&!t._promise&&function(e,t,n){try{e.apply(null,void 0)}catch(e){}}((function(){var n=oo(t,"stack");t._promise=e,x(t,"stack",{get:function(){return Bo?n&&(n.get?n.get.apply(t):n.value):e.stack}})})),function(e){$o.some((function(t){return t._value===e._value}))||$o.push(e)}(e),te(e),n&&ue()}},te=function(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)ne(e,t[n]);var o=e._PSD;--o.ref||o.finalize(),0===Xo&&(++Xo,Vo((function(){0==--Xo&&ce()}),[]))},ne=function(e,t){if(null!==e._state){var n=e._state?t.onFulfilled:t.onRejected;if(null===n)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++Xo,Vo(re,[n,e,t])}else e._listeners.push(t)},re=function(e,t,n){try{qo=t;var r,o=t._value;t._state?r=e(o):(Go.length&&(Go=[]),r=e(o),-1===Go.indexOf(o)&&function(e){for(var t=$o.length;t;)if($o[--t]._value===e._value)return void $o.splice(t,1)}(t)),n.resolve(r)}catch(e){n.reject(e)}finally{qo=null,0==--Xo&&ce(),--n.psd.ref||n.psd.finalize()}},oe=function(e,t){var n=t?t._numPrev+1:0;n<100&&(e._prev=t,e._numPrev=n)},ie=function(){ae()&&ue()},ae=function(){var e=Ko;return Ko=!1,Ho=!1,e},ue=function(){var e,t,n;do{for(;Zo.length>0;)for(e=Zo,Zo=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}}while(Zo.length>0);Ko=!0,Ho=!0},ce=function(){var e=$o;$o=[],e.forEach((function(e){e._PSD.onunhandled.call(null,e._value,e)}));for(var t=Jo.slice(0),n=t.length;n;)t[--n]()},se=function(e){return new J(To,!1,e)},le=function(e,t){var n=Yo;return function(){var r=ae(),o=Yo;try{return be(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{be(o,!1),r&&ue()}}},fe=function(e,t,n,r){var o=Yo,i=Object.create(o);i.parent=o,i.ref=0,i.global=!1,i.id=++ui;var a=Wo.env;i.env=Uo?{Promise:J,PromiseProp:{value:J,configurable:!0,writable:!0},all:J.all,race:J.race,allSettled:J.allSettled,any:J.any,resolve:J.resolve,reject:J.reject,nthen:Oe(a.nthen,i),gthen:Oe(a.gthen,i)}:{},t&&w(i,t),++o.ref,i.finalize=function(){--this.parent.ref||this.parent.finalize()};var u=ge(i,e,n,r);return 0===i.ref&&i.finalize(),u},de=function(){return ni.id||(ni.id=++ri),++ni.awaits,ni.echoes+=100,ni.id},pe=function(){return!!ni.awaits&&(0==--ni.awaits&&(ni.id=0),ni.echoes=100*ni.awaits,!0)},he=function(e){return ni.echoes&&e&&e.constructor===Lo?(de(),e.then((function(e){return pe(),e}),(function(e){return pe(),ci(e)}))):e},ye=function(e){++ai,ni.echoes&&0!=--ni.echoes||(ni.echoes=ni.id=0),oi.push(Yo),be(e,!0)},ve=function(){var e=oi[oi.length-1];oi.pop(),be(e,!1)},be=function(e,t){var n=Yo;if((t?!ni.echoes||ii++&&e===Yo:!ii||--ii&&e===Yo)||we(t?ye.bind(null,e):ve),e!==Yo&&(Yo=e,n===Wo&&(Wo.env=me()),Uo)){var r=Wo.env.Promise,o=e.env;Mo.then=o.nthen,r.prototype.then=o.gthen,(n.global||e.global)&&(Object.defineProperty(Xr,"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))}},me=function(){var e=Xr.Promise;return Uo?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(Xr,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:Mo.then,gthen:e.prototype.then}:{}},ge=function(e,t,n,r,o){var i=Yo;try{return be(e,!0),t(n,r,o)}finally{be(i,!1)}},we=function(e){No.call(Do,e)},Se=function(e,t,n,r){return"function"!=typeof e?e:function(){var o=Yo;n&&de(),be(t,!0);try{return e.apply(this,arguments)}finally{be(o,!1),r&&we(pe)}}},Oe=function(e,t){return function(n,r){return e.call(this,Se(n,t),Se(r,t))}},_e=function(e,t){var n;try{n=t.onuncatched(e)}catch(e){}if(!1!==n)try{var r,o={promise:t,reason:e};if(Xr.document&&document.createEvent?((r=document.createEvent("Event")).initEvent("unhandledrejection",!0,!0),w(r,o)):Xr.CustomEvent&&w(r=new CustomEvent("unhandledrejection",{detail:o}),o),r&&Xr.dispatchEvent&&(dispatchEvent(r),!Xr.PromiseRejectionEvent&&Xr.onunhandledrejection))try{Xr.onunhandledrejection(r)}catch(e){}go&&r&&!r.defaultPrevented&&console.warn("Unhandled rejection: ".concat(e.stack||e))}catch(e){}},Ee=function(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t},xe=function(e){return"string"!=typeof e||/\./.test(e)?function(e){return e}:function(t){return void 0===t[e]&&e in t&&delete(t=M(t))[e],t}},je=function(e){var t={},n=function(n,r){if(r){for(var o=arguments.length,i=new Array(o-1);--o;)i[o-1]=arguments[o];return t[n].subscribe.apply(null,i),e}if("string"==typeof n)return t[n]};n.addEventType=i;for(var r=1,o=arguments.length;r<o;++r)i(arguments[r]);return n;function i(e,r,o){if("object"==typeof e)return function(e){Jr(e).forEach((function(t){var n=e[t];if(Qr(n))i(t,e[t][0],e[t][1]);else{if("asap"!==n)throw new ko.InvalidArgument("Invalid event config");var r=i(t,$,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];r.subscribers.forEach((function(e){A((function(){e.apply(null,t)}))}))}))}}))}(e);r||(r=Z),o||(o=H);var a={subscribers:[],fire:o,subscribe:function(e){-1===a.subscribers.indexOf(e)&&(a.subscribers.push(e),a.fire=r(a.fire,e))},unsubscribe:function(e){a.subscribers=a.subscribers.filter((function(t){return t!==e})),a.fire=a.subscribers.reduce(r,o)}};return t[e]=n[e]=a,a}},Pe=function(e,t){return j(t).from({prototype:e}),t},ke=function(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)},Ce=function(e,t){e.filter=Ee(e.filter,t)},Ae=function(e,t,n){var r=e.replayFilter;e.replayFilter=r?function(){return Ee(r(),t())}:t,e.justLimit=n&&!r},Te=function(e,t){if(e.isPrimKey)return t.primaryKey;var n=t.getIndexByKeyPath(e.index);if(!n)throw new ko.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n},Ie=function(e,t,n){var r=Te(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:r,range:e.range}})},De=function(e,t,n,r){var o=e.replayFilter?Ee(e.filter,e.replayFilter()):e.filter;if(e.or){var i={},a=function(e,n,r){if(!o||o(n,r,(function(e){return n.stop(e)}),(function(e){return n.fail(e)}))){var a=n.primaryKey,u=""+a;"[object ArrayBuffer]"===u&&(u=""+new Uint8Array(a)),O(i,u)||(i[u]=!0,t(e,n,r))}};return Promise.all([e.or._iterate(a,n),Me(Ie(e,r,n),e.algorithm,a,!e.keysOnly&&e.valueMapper)])}return Me(Ie(e,r,n),Ee(e.algorithm,o),t,!e.keysOnly&&e.valueMapper)},Me=function(e,t,n,r){var o=le(r?function(e,t,o){return n(r(e),t,o)}:n);return e.then((function(e){if(e)return e.start((function(){var n=function(){return e.continue()};t&&!t(e,(function(e){return n=e}),(function(t){e.stop(t),n=H}),(function(t){e.fail(t),n=H}))||o(e.value,e,(function(e){return n=e})),n()}))}))},Re=function(e){var t=void 0===e?"undefined":b(e);if("object"!==t)return t;if(ArrayBuffer.isView(e))return"binary";var n=R(e);return"ArrayBuffer"===n?"binary":n},Ne=function(e){return d(e,Uint8Array)?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)},Le=function(e,t){return e<t?-1:e===t?0:1},Ue=function(e,t){return e>t?-1:e===t?0:1},Be=function(e,t,n){var r=d(e,Oi)?new e.Collection(e):e;return r._ctx.error=n?new n(t):new TypeError(t),r},Fe=function(e){return new e.Collection(e,(function(){return $e("")})).limit(0)},Ve=function(e,t,n,r,o,i){for(var a=Math.min(e.length,r.length),u=-1,c=0;c<a;++c){var s=t[c];if(s!==r[c])return o(e[c],n[c])<0?e.substr(0,c)+n[c]+n.substr(c+1):o(e[c],r[c])<0?e.substr(0,c)+r[c]+n.substr(c+1):u>=0?e.substr(0,u)+t[u]+n.substr(u+1):null;o(e[c],s)<0&&(u=c)}return a<r.length&&"next"===i?e+n.substr(e.length):a<e.length&&"prev"===i?e.substr(0,n.length):u<0?null:e.substr(0,u)+r[u]+n.substr(u+1)},Ke=function(e,t,n,r){var o,i,a,u,c,s,l,f=n.length;if(!n.every((function(e){return"string"==typeof e})))return Be(e,"String expected.");function d(e){o=function(e){return"next"===e?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()}}(e),i=function(e){return"next"===e?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()}}(e),a="next"===e?Le:Ue;var t=n.map((function(e){return{lower:i(e),upper:o(e)}})).sort((function(e,t){return a(e.lower,t.lower)}));u=t.map((function(e){return e.upper})),c=t.map((function(e){return e.lower})),s=e,l="next"===e?"":r}d("next");var p=new e.Collection(e,(function(){return He(u[0],c[f-1]+r)}));p._ondirectionchange=function(e){d(e)};var h=0;return p._addAlgorithm((function(e,n,r){var o=e.key;if("string"!=typeof o)return!1;var d=i(o);if(t(d,c,h))return!0;for(var p=null,y=h;y<f;++y){var v=Ve(o,d,u[y],c[y],a,s);null===v&&null===p?h=y+1:(null===p||a(p,v)>0)&&(p=v)}return n(null!==p?function(){e.continue(p+l)}:r),!1})),p},He=function(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}},$e=function(e){return{type:1,lower:e,upper:e}},Ge=function(e){return le((function(t){return qe(t),e(t.target.error),!1}))},qe=function(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()},ze=function(e,t,n,r,o,i,a){return{name:e,keyPath:t,unique:n,multi:r,auto:o,compound:i,src:(n&&!a?"&":"")+(r?"*":"")+(o?"++":"")+We(t)}},We=function(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""},Ye=function(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:T(n,(function(e){return[e.name,e]}))}},Ze=function(e){return null==e?function(){}:"string"==typeof e?function(e){return 1===e.split(".").length?function(t){return t[e]}:function(t){return ao(t,e)}}(e):function(t){return ao(t,e)}},Xe=function(e){return[].slice.call(e)},Je=function(e){return null==e?":id":"string"==typeof e?e:"[".concat(e.join("+"),"]")},Qe=function(e,t){var n=e._novip,r=t.db,o=function(e,t,n,r){var o=n.IDBKeyRange,i=(n.indexedDB,function(e,t){return t.reduce((function(e,t){return p({},e,(0,t.create)(e))}),e)}(function(e,t,n){function r(e){if(3===e.type)return null;if(4===e.type)throw new Error("Cannot convert never type to IDBKeyRange");var n=e.lower,r=e.upper,o=e.lowerOpen,i=e.upperOpen;return void 0===n?void 0===r?null:t.upperBound(r,!!i):void 0===r?t.lowerBound(n,!!o):t.bound(n,r,!!o,!!i)}var o=function(e,t){var n=Xe(e.objectStoreNames);return{schema:{name:e.name,tables:n.map((function(e){return t.objectStore(e)})).map((function(e){var t=e.keyPath,n=e.autoIncrement,r=Qr(t),o=null==t,i={},a={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:o,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:Ze(t)},indexes:Xe(e.indexNames).map((function(t){return e.index(t)})).map((function(e){var t=e.name,n=e.unique,r=e.multiEntry,o=e.keyPath,a={name:t,compound:Qr(o),keyPath:o,unique:n,multiEntry:r,extractKey:Ze(o)};return i[Je(o)]=a,a})),getIndexByKeyPath:function(e){return i[Je(e)]}};return i[":id"]=a.primaryKey,null!=t&&(i[Je(t)]=a.primaryKey),a}))},hasGetAll:n.length>0&&"getAll"in t.objectStore(n[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}(e,n),i=o.schema,a=o.hasGetAll,u=i.tables.map((function(e){return function(e){var t=e.name;return{name:t,schema:e,mutate:function(e){var n=e.trans,o=e.type,i=e.keys,a=e.values,u=e.range;return new Promise((function(e,c){e=le(e);var s=n.objectStore(t),l=null==s.keyPath,f="put"===o||"add"===o;if(!f&&"delete"!==o&&"deleteRange"!==o)throw new Error("Invalid operation type: "+o);var d,p=(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===p)return e({numFailures:0,failures:{},results:[],lastResult:void 0});var h=[],v=[],b=0,m=function(e){++b,qe(e)};if("deleteRange"===o){if(4===u.type)return e({numFailures:b,failures:v,results:[],lastResult:void 0});3===u.type?h.push(d=s.clear()):h.push(d=s.delete(r(u)))}else{var g=y(f?l?[a,i]:[a,null]:[i,null],2),w=g[0],S=g[1];if(f)for(var O=0;O<p;++O)h.push(d=S&&void 0!==S[O]?s[o](w[O],S[O]):s[o](w[O])),d.onerror=m;else for(var _=0;_<p;++_)h.push(d=s[o](w[_])),d.onerror=m}var E=function(t){var n=t.target.result;h.forEach((function(e,t){return null!=e.error&&(v[t]=e.error)})),e({numFailures:b,failures:v,results:"delete"===o?i:h.map((function(e){return e.result})),lastResult:n})};d.onerror=function(e){m(e),E(e)},d.onsuccess=E}))},getMany:function(e){var n=e.trans,r=e.keys;return new Promise((function(e,o){e=le(e);for(var i,a=n.objectStore(t),u=r.length,c=new Array(u),s=0,l=0,f=function(t){var n=t.target;c[n._pos]=n.result,++l===s&&e(c)},d=Ge(o),p=0;p<u;++p)null!=r[p]&&((i=a.get(r[p]))._pos=p,i.onsuccess=f,i.onerror=d,++s);0===s&&e(c)}))},get:function(e){var n=e.trans,r=e.key;return new Promise((function(e,o){e=le(e);var i=n.objectStore(t).get(r);i.onsuccess=function(t){return e(t.target.result)},i.onerror=Ge(o)}))},query:function(e){return function(n){return new Promise((function(o,i){o=le(o);var a=n.trans,u=n.values,c=n.limit,s=n.query,l=c===1/0?void 0:c,f=s.index,d=s.range,p=a.objectStore(t),h=f.isPrimaryKey?p:p.index(f.name),y=r(d);if(0===c)return o({result:[]});if(e){var v=u?h.getAll(y,l):h.getAllKeys(y,l);v.onsuccess=function(e){return o({result:e.target.result})},v.onerror=Ge(i)}else{var b=0,m=u||!("openKeyCursor"in h)?h.openCursor(y):h.openKeyCursor(y),g=[];m.onsuccess=function(e){var t=m.result;return t?(g.push(u?t.value:t.primaryKey),++b===c?o({result:g}):void t.continue()):o({result:g})},m.onerror=Ge(i)}}))}}(a),openCursor:function(e){var n=e.trans,o=e.values,i=e.query,a=e.reverse,u=e.unique;return new Promise((function(e,c){e=le(e);var s=i.index,l=i.range,f=n.objectStore(t),d=s.isPrimaryKey?f:f.index(s.name),p=a?u?"prevunique":"prev":u?"nextunique":"next",h=o||!("openKeyCursor"in d)?d.openCursor(r(l),p):d.openKeyCursor(r(l),p);h.onerror=Ge(c),h.onsuccess=le((function(t){var r=h.result;if(r){r.___id=++ji,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=le(c),r.next=function(){var e=this,t=1;return this.start((function(){return t--?e.continue():e.stop()})).then((function(){return e}))},r.start=function(e){var t=new Promise((function(e,t){e=le(e),h.onerror=Ge(t),r.fail=t,r.stop=function(t){r.stop=r.continue=r.continuePrimaryKey=r.advance=u,e(t)}})),n=function(){if(h.result)try{e()}catch(e){r.fail(e)}else r.done=!0,r.start=function(){throw new Error("Cursor behind last entry")},r.stop()};return h.onsuccess=le((function(e){h.onsuccess=n,n()})),r.continue=o,r.continuePrimaryKey=i,r.advance=a,n(),t},e(r)}else e(null)}),c)}))},count:function(e){var n=e.query,o=e.trans,i=n.index,a=n.range;return new Promise((function(e,n){var u=o.objectStore(t),c=i.isPrimaryKey?u:u.index(i.name),s=r(a),l=s?c.count(s):c.count();l.onsuccess=le((function(t){return e(t.target.result)})),l.onerror=Ge(n)}))}}}(e)})),c={};return u.forEach((function(e){return c[e.name]=e})),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(e){if(!c[e])throw new Error("Table '".concat(e,"' not found"));return c[e]},MIN_KEY:-1/0,MAX_KEY:xi(t),schema:i}}(t,o,r),e.dbcore));return{dbcore:i}}(n._middlewares,r,n._deps,t);n.core=o.dbcore,n.tables.forEach((function(e){var t=e.name;n.core.schema.tables.some((function(e){return e.name===t}))&&(e.core=n.core.table(t),d(n[t],n.Table)&&(n[t].core=e.core))}))},et=function(e,t,n,r){var o=e._novip;n.forEach((function(e){var n=r[e];t.forEach((function(t){var r=oo(t,e);(!r||"value"in r&&void 0===r.value)&&(t===o.Transaction.prototype||d(t,o.Transaction)?x(t,e,{get:function(){return this.table(e)},set:function(t){no(this,e,{value:t,writable:!0,configurable:!0,enumerable:!0})}}):t[e]=new o.Table(e,n))}))}))},tt=function(e,t){var n=e._novip;t.forEach((function(e){for(var t in e)d(e[t],n.Table)&&delete e[t]}))},nt=function(e,t){return e._cfg.version-t._cfg.version},rt=function(e,t){var n,r={del:[],add:[],change:[]};for(n in e)t[n]||r.del.push(n);for(n in t){var o=e[n],i=t[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&&!pi)a.recreate=!0,r.change.push(a);else{var u=o.idxByName,c=i.idxByName,s=void 0;for(s in u)c[s]||a.del.push(s);for(s in c){var l=u[s],f=c[s];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},ot=function(e,t,n,r){var o=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach((function(e){return it(o,e)})),o},it=function(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})},at=function(e,t,n){var r={};return P(t.objectStoreNames,0).forEach((function(e){for(var t=n.objectStore(e),o=t.keyPath,i=ze(We(o),o||"",!1,!1,!!t.autoIncrement,o&&"string"!=typeof o,!0),a=[],u=0;u<t.indexNames.length;++u){var c=t.index(t.indexNames[u]);o=c.keyPath;var s=ze(c.name,o,!!c.unique,!!c.multiEntry,!1,o&&"string"!=typeof o,!1);a.push(s)}r[e]=Ye(e,i,a)})),r},ut=function(e,t,n){for(var r=e._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 s=u.indexNames[c],l=u.index(s).keyPath,f="string"==typeof l?l:"["+P(l).join("+")+"]";if(t[a]){var p=t[a].idxByName[f];p&&(p.name=s,delete t[a].idxByName[f],t[a].idxByName[s]=p)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&Xr.WorkerGlobalScope&&d(Xr,Xr.WorkerGlobalScope)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(r._hasGetAll=!1)},ct=function(e,t){var n=e._dbNamesDB;return n||(n=e._dbNamesDB=new Li("__dbnames",{addons:[],indexedDB:e,IDBKeyRange:t})).version(1).stores({dbnames:"name"}),n.table("dbnames")},st=function(e){return e&&"function"==typeof e.databases},lt=function(e){return fe((function(){return Yo.letThrough=!0,e()}))},ft=function(){var e;return!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(t){var n=function(){return indexedDB.databases().finally(t)};e=setInterval(n,100),n()})).finally((function(){return clearInterval(e)})):Promise.resolve()},dt=function(e){var t=function(t){return e.next(t)},n=o(t),r=o((function(t){return e.throw(t)}));function o(e){return function(t){var o=e(t),i=o.value;return o.done?i:i&&"function"==typeof i.then?i.then(n,r):Qr(i)?Promise.all(i).then(n,r):n(i)}}return o(t)()},pt=function(e,t,n){var r=arguments.length;if(r<2)throw new ko.InvalidArgument("Too few arguments");for(var o=new Array(r-1);--r;)o[r-1]=arguments[r];return n=o.pop(),[e,D(o),n]},ht=function(e,t,n){for(var r=Qr(e)?e.slice():[e],o=0;o<n;++o)r.push(t);return r},yt=function(e,t,n){try{if(!t)return null;if(t.keys.length<e.length)return null;for(var r=[],o=0,i=0;o<t.keys.length&&i<e.length;++o)0===gi(t.keys[o],e[i])&&(r.push(n?M(t.values[o]):t.values[o]),++i);return r.length===e.length?r:null}catch(e){return null}},vt=function(e){return!("from"in e)},bt=function(e,t){vt(t)||function e(t,n){var r=n.from,o=n.to,i=n.l,a=n.r;Mi(t,r,o),i&&e(t,i),a&&e(t,a)}(e,t)},mt=function(e){var t=vt(e)?null:{s:0,n:e};return{next:function(e){for(var n=arguments.length>0;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&gi(e,t.n.from)<0;)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!n||gi(e,t.n.to)<=0)return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}},gt=function(e){var t,n,r=((null===(t=e.r)||void 0===t?void 0:t.d)||0)-((null===(n=e.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=p({},e),u=e[o];e.from=u.from,e.to=u.to,e[o]=u[o],a[o]=u[i],e[i]=a,a.d=wt(a)}e.d=wt(e)},wt=function(e){var t=e.r,n=e.l;return(t?n?Math.max(t.d,n.d):t.d:n?n.d:0)+1},St=function(e,t){return Jr(t).forEach((function(n){bt(e[n]||(e[n]=new Di),t[n])})),e},Ot=function(e){var t=Vi;try{Vi=!0,_i.storagemutated.fire(e)}finally{Vi=t}},_t=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},Et=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},xt=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":void 0===e?"undefined":b(e)},jt=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},Pt=function(e,t,n){var r=Tt(e,t,n);na.length?na.forEach((function(e){return e(r)})):setTimeout((function(){throw r}))},kt=function(e){if("function"!=typeof e)throw Error(At(28,!1));na.push(e)},Ct=function(e){if("function"!=typeof e)throw Error(At(29,!1));var t=!1;return na=na.filter((function(n){var r=n===e;return t=t||r,!r})),t},At=function(e,t){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(e,": ").concat(t?t+" ":"","See https://single-spa.js.org/error/?code=").concat(e).concat(r.length?"&arg=".concat(r.join("&arg=")):"")},Tt=function(e,t,n){var r,o,i,a="".concat(Nt(t)," '").concat(Mt(t),"' died in status ").concat(t.status,": ");if(o=e,null!=(i=Error)&&"undefined"!=typeof Symbol&&i[Symbol.hasInstance]?i[Symbol.hasInstance](o):d(o,i)){try{e.message=a+e.message}catch(e){}r=e}else{console.warn(At(30,!1,t.status,Mt(t)));try{r=Error(a+JSON.stringify(e))}catch(t){r=e}}return r.appOrParcelName=Mt(t),t.status=n,r},It=function(e){return e.status===sa},Dt=function(e){try{return e.activeWhen(window.location)}catch(t){return Pt(t,e,pa),!1}},Mt=function(e){return e.name},Rt=function(e){return Boolean(e.unmountThisParcel)},Nt=function(e){return Rt(e)?"parcel":"application"},Lt=function(){for(var e=arguments.length-1;e>0;e--)for(var t in arguments[e])"__proto__"!==t&&(arguments[e-1][t]=arguments[e][t]);return arguments[0]},Ut=function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n];return null},Bt=function(e){return e&&("function"==typeof e||(t=e,Array.isArray(t)&&!Ut(t,(function(e){return"function"!=typeof e}))));var t},Ft=function(e,t){var n=e[t]||[];0===(n=Array.isArray(n)?n:[n]).length&&(n=[function(){return Promise.resolve()}]);var r=Nt(e),o=Mt(e);return function(e){return n.reduce((function(n,i,a){return n.then((function(){var n=i(e);return Vt(n)?n:Promise.reject(At(15,!1,r,o,t,a))}))}),Promise.resolve())}},Vt=function(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch},Kt=function(e,t){var n=function(){return e.status=ua,e};return Promise.resolve().then((function(){return e.status!==ia?e:(e.status=aa,e.bootstrap?Qt(e,"bootstrap").then(n).catch((function(n){if(t)throw Tt(n,e,pa);return Pt(n,e,pa),e})):Promise.resolve().then(n))}))},Ht=function(e,t){return Promise.resolve().then((function(){var n=function(){return Qt(e,"unmount").then((function(){e.status=ua})).catch((function(n){if(t)throw Tt(n,e,pa);Pt(n,e,pa)}))};if(e.status!==sa)return e;e.status=fa;var r=Object.keys(e.parcels).map((function(t){return e.parcels[t].unmountThisParcel()}));return Promise.all(r).then(n,(function(r){return n().then((function(){var n=Error(r.message);if(t)throw Tt(n,e,pa);Pt(n,e,pa)}))})).then((function(){return e}))}))},$t=function(e,t){return Promise.resolve().then((function(){return e.status!==ua?e:(ha||(window.dispatchEvent(new ta("single-spa:before-first-mount")),ha=!0),Qt(e,"mount").then((function(){return e.status=sa,ya||(window.dispatchEvent(new ta("single-spa:first-mount")),ya=!0),e})).catch((function(n){var r=function(){if(t)throw Tt(n,e,pa);return Pt(n,e,pa),e};return e.status=sa,Ht(e,!0).then(r,r)})))}))},Gt=function(){return qt.apply(ba,arguments)},qt=function(e,t){var n=this;if(!e||"object"!==Ji(e)&&"function"!=typeof e)throw Error(At(2,!1));if(e.name&&"string"!=typeof e.name)throw Error(At(3,!1,Ji(e.name)));if("object"!==Ji(t))throw Error(At(4,!1,name,Ji(t)));if(!t.domElement)throw Error(At(5,!1,name));var r,o=va++,i="function"==typeof e,a=i?e:function(){return Promise.resolve(e)},u={id:o,parcels:{},status:i?oa:ia,customProps:t,parentName:Mt(n),unmountThisParcel:function(){return d.then((function(){if(u.status!==sa)throw Error(At(6,!1,name,u.status));return Ht(u,!0)})).then((function(e){return u.parentName&&delete n.parcels[u.id],e})).then((function(e){return s(e),e})).catch((function(e){throw u.status=pa,l(e),e}))}};n.parcels[o]=u;var c=a();if(!c||"function"!=typeof c.then)throw Error(At(7,!1));var s,l,f=(c=c.then((function(e){if(!e)throw Error(At(8,!1));var t=e.name||"parcel-".concat(o);if(Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!Bt(e.bootstrap))throw Error(At(9,!1,t));if(!Bt(e.mount))throw Error(At(10,!1,t));if(!Bt(e.unmount))throw Error(At(11,!1,t));if(e.update&&!Bt(e.update))throw Error(At(12,!1,t));var n=Ft(e,"bootstrap"),i=Ft(e,"mount"),a=Ft(e,"unmount");u.status=ia,u.name=t,u.bootstrap=n,u.mount=i,u.unmount=a,u.timeouts=en(e.timeouts),e.update&&(u.update=Ft(e,"update"),r.update=function(e){return u.customProps=e,zt(function(e){return Promise.resolve().then((function(){if(e.status!==sa)throw Error(At(32,!1,Mt(e)));return e.status=la,Qt(e,"update").then((function(){return e.status=sa,e})).catch((function(t){throw Tt(t,e,pa)}))}))}(u))})}))).then((function(){return Kt(u,!0)})),d=f.then((function(){return $t(u,!0)})),p=new Promise((function(e,t){s=e,l=t}));return r={mount:function(){return zt(Promise.resolve().then((function(){if(u.status!==ua)throw Error(At(13,!1,name,u.status));return n.parcels[o]=u,$t(u)})))},unmount:function(){return zt(u.unmountThisParcel())},getStatus:function(){return u.status},loadPromise:zt(c),bootstrapPromise:zt(f),mountPromise:zt(d),unmountPromise:zt(p)}},zt=function(e){return e.then((function(){return null}))},Wt=function(e){var t=Mt(e),n="function"==typeof e.customProps?e.customProps(t,window.location):e.customProps;("object"!==Ji(n)||null===n||Array.isArray(n))&&(n={},console.warn(At(40,!1),t,n));var r=Lt({},n,{name:t,mountParcel:qt.bind(e),singleSpa:Xi});return Rt(e)&&(r.unmountSelf=e.unmountThisParcel),r},Yt=function(e,t,n){if("number"!=typeof e||e<=0)throw Error(At(16,!1));ma.bootstrap={millis:e,dieOnTimeout:t,warningMillis:n||1e3}},Zt=function(e,t,n){if("number"!=typeof e||e<=0)throw Error(At(17,!1));ma.mount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}},Xt=function(e,t,n){if("number"!=typeof e||e<=0)throw Error(At(18,!1));ma.unmount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}},Jt=function(e,t,n){if("number"!=typeof e||e<=0)throw Error(At(19,!1));ma.unload={millis:e,dieOnTimeout:t,warningMillis:n||1e3}},Qt=function(e,t){var n=e.timeouts[t],r=n.warningMillis,o=Nt(e);return new Promise((function(i,a){var u=!1,c=!1;e[t](Wt(e)).then((function(e){u=!0,i(e)})).catch((function(e){u=!0,a(e)})),setTimeout((function(){return l(1)}),r),setTimeout((function(){return l(!0)}),n.millis);var s=At(31,!1,t,o,Mt(e),n.millis);function l(e){if(!u)if(!0===e)c=!0,n.dieOnTimeout?a(Error(s)):console.error(s);else if(!c){var t=e,o=t*r;console.warn(s),o+r<n.millis&&setTimeout((function(){return l(t+1)}),r)}}}))},en=function(e){var t={};for(var n in ma)t[n]=Lt({},ma[n],e&&e[n]||{});return t},tn=function(e){return Promise.resolve().then((function(){return e.loadPromise?e.loadPromise:e.status!==ra&&e.status!==da?e:(e.status=oa,e.loadPromise=Promise.resolve().then((function(){var r=e.loadApp(Wt(e));if(!Vt(r))throw n=!0,Error(At(33,!1,Mt(e)));return r.then((function(n){var r;e.loadErrorTime=null,"object"!==Ji(t=n)&&(r=34),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!Bt(t.bootstrap)&&(r=35),Bt(t.mount)||(r=36),Bt(t.unmount)||(r=37);var o=Nt(t);if(r){var i;try{i=JSON.stringify(t)}catch(e){}return console.error(At(r,!1,o,Mt(e),i),t),Pt(void 0,e,pa),e}return t.devtools&&t.devtools.overlays&&(e.devtools.overlays=Lt({},e.devtools.overlays,t.devtools.overlays)),e.status=ia,e.bootstrap=Ft(t,"bootstrap"),e.mount=Ft(t,"mount"),e.unmount=Ft(t,"unmount"),e.unload=Ft(t,"unload"),e.timeouts=en(t.timeouts),delete e.loadPromise,e}))})).catch((function(t){var r;return delete e.loadPromise,n?r=pa:(r=da,e.loadErrorTime=(new Date).getTime()),Pt(t,e,r),e})));var t,n}))},nn=function(e){var t;if("string"==typeof e)t=e;else if(this&&this.href)t=this.href;else{if(!(e&&e.currentTarget&&e.currentTarget.href&&e.preventDefault))throw Error(At(14,!1));t=e.currentTarget.href,e.preventDefault()}var n=un(window.location.href),r=un(t);0===t.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=t:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,t)},rn=function(e){var t=this;if(e){var n=e[0].type;Sa.indexOf(n)>=0&&wa[n].forEach((function(n){try{n.apply(t,e)}catch(e){setTimeout((function(){throw e}))}}))}},on=function(){Aa([],arguments)},an=function(e,t){return function(){var n=window.location.href,r=e.apply(this,arguments),o=window.location.href;return Qi&&n===o||(Pn()?window.dispatchEvent(function(e,t){var n;try{n=new PopStateEvent("popstate",{state:e})}catch(t){(n=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,e)}return n.singleSpa=!0,n.singleSpaTrigger=t,n}(window.history.state,t)):Aa([])),r}},un=function(e){var t=document.createElement("a");return t.href=e,t},cn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(e||window.$&&window.$.fn&&window.$.fn.jquery&&(e=window.$),e&&!Ea){var t=e.fn.on,n=e.fn.off;e.fn.on=function(e,n){return sn.call(this,t,window.addEventListener,e,n,arguments)},e.fn.off=function(e,t){return sn.call(this,n,window.removeEventListener,e,t,arguments)},Ea=!0}},sn=function(e,t,n,r,o){return"string"!=typeof n?e.apply(this,o):(n.split(/\s+/).forEach((function(e){Sa.indexOf(e)>=0&&(t(e,r),n=n.replace(e,""))})),""===n.trim()?this:e.apply(this,o))},ln=function(e){return Promise.resolve().then((function(){var t=xa[Mt(e)];if(!t)return e;if(e.status===ra)return fn(e,t),e;if("UNLOADING"===e.status)return t.promise.then((function(){return e}));if(e.status!==ua&&e.status!==da)return e;var n=e.status===da?Promise.resolve():Qt(e,"unload");return e.status="UNLOADING",n.then((function(){return fn(e,t),e})).catch((function(n){return function(e,t,n){delete xa[Mt(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,Pt(n,e,pa),t.reject(n)}(e,t,n),e}))}))},fn=function(e,t){delete xa[Mt(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,e.status=ra,t.resolve()},dn=function(e,t,n,r){xa[Mt(e)]={app:e,resolve:n,reject:r},Object.defineProperty(xa[Mt(e)],"promise",{get:t})},pn=function(e){return xa[e]},hn=function(){return ja.filter(It).map(Mt)},yn=function(){return ja.map(Mt)},vn=function(e){var t=Ut(ja,(function(t){return Mt(t)===e}));return t?t.status:null},bn=function(e,t,n,r){var o=function(e,t,n,r){var o,i={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"===Ji(e)?(function(e){if(Array.isArray(e)||null===e)throw Error(At(39,!1));var t=["name","app","activeWhen","customProps"],n=Object.keys(e).reduce((function(e,n){return t.indexOf(n)>=0?e:e.concat(n)}),[]);if(0!==n.length)throw Error(At(38,!1,t.join(", "),n.join(", ")));if("string"!=typeof e.name||0===e.name.length)throw Error(At(20,!1));if("object"!==Ji(e.app)&&"function"!=typeof e.app)throw Error(At(20,!1));var r=function(e){return"string"==typeof e||"function"==typeof e};if(!(r(e.activeWhen)||Array.isArray(e.activeWhen)&&e.activeWhen.every(r)))throw Error(At(24,!1));if(!On(e.customProps))throw Error(At(22,!1))}(e),i.name=e.name,i.loadApp=e.app,i.activeWhen=e.activeWhen,i.customProps=e.customProps):(function(e,t,n,r){if("string"!=typeof e||0===e.length)throw Error(At(20,!1));if(!t)throw Error(At(23,!1));if("function"!=typeof n)throw Error(At(24,!1));if(!On(r))throw Error(At(22,!1))}(e,t,n,r),i.name=e,i.loadApp=t,i.activeWhen=n,i.customProps=r),i.loadApp="function"!=typeof(o=i.loadApp)?function(){return Promise.resolve(o)}:o,i.customProps=function(e){return e||{}}(i.customProps),i.activeWhen=function(e){var t=Array.isArray(e)?e:[e];return t=t.map((function(e){return"function"==typeof e?e:_n(e)})),function(e){return t.some((function(t){return t(e)}))}}(i.activeWhen),i}(e,t,n,r);if(-1!==yn().indexOf(o.name))throw Error(At(21,!1,o.name));ja.push(Lt({loadErrorTime:null,status:ra,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},o)),ga&&(cn(),Aa())},mn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return ja.filter((function(t){return t.activeWhen(e)})).map(Mt)},gn=function(e){if(0===ja.filter((function(t){return Mt(t)===e})).length)throw Error(At(25,!1,e));return wn(e).then((function(){var t=ja.map(Mt).indexOf(e);ja.splice(t,1)}))},wn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof e)throw Error(At(26,!1));var n=Ut(ja,(function(t){return Mt(t)===e}));if(!n)throw Error(At(27,!1,e));var r,o=pn(Mt(n));if(t&&t.waitForUnmount){if(o)return o.promise;var i=new Promise((function(e,t){dn(n,(function(){return i}),e,t)}));return i}return o?(r=o.promise,Sn(n,o.resolve,o.reject)):r=new Promise((function(e,t){dn(n,(function(){return r}),e,t),Sn(n,e,t)})),r},Sn=function(e,t,n){Ht(e).then(ln).then((function(){t(),setTimeout((function(){Aa()}))})).catch(n)},On=function(e){return!e||"function"==typeof e||"object"===Ji(e)&&null!==e&&!Array.isArray(e)},_n=function(e,t){var n=function(e,t){var n=function(n){var a=e.slice(r,n).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(i+=o?"[^/]+/?":a,n===e.length)if(o)t&&(i+="$");else{var u=t?"":".*";i="/"===i.charAt(i.length-1)?"".concat(i).concat(u,"$"):"".concat(i,"(/").concat(u,")?(#.*)?$")}o=!o,r=n},r=0,o=!1,i="^";"/"!==e[0]&&(e="/"+e);for(var a=0;a<e.length;a++){var u=e[a];(!o&&":"===u||o&&"/"===u)&&n(a)}return n(e.length),new RegExp(i,"i")}(e,t);return function(e){var t=e.origin;t||(t="".concat(e.protocol,"//").concat(e.host));var r=e.href.replace(t,"").replace(e.search,"").split("?")[0];return n.test(r)}},En=function(){return Aa()},xn=function(e,t){return Dt(e)?Kt(e).then((function(e){return t.then((function(){return Dt(e)?$t(e):e}))})):t.then((function(){return e}))},jn=function(e){var t;Ta=!0,e&&e.urlRerouteOnly&&(t=e.urlRerouteOnly,Qi=t),ga&&Aa()},Pn=function(){return Ta},kn=function(e,t){return function(n){if(!e(n))return"function"==typeof t?t(n):t}},Cn=function(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]},An=function(e){return function t(n){return 0===arguments.length||Cn(n)?t:e.apply(this,arguments)}},Tn=function(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return Cn(n)?t:An((function(t){return e(n,t)}));default:return Cn(n)&&Cn(r)?t:Cn(n)?An((function(t){return e(t,r)})):Cn(r)?An((function(t){return e(n,t)})):e(n,r)}}},In=function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n},Dn=function(e,t,n){for(var r=0,o=n.length;r<o;){if(e(t,n[r]))return!0;r+=1}return!1},Mn=function(e,t){return Object.prototype.hasOwnProperty.call(t,e)},Rn=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":void 0===e?"undefined":b(e)},Nn=function(e,t,n,r){var o=function(e,t){return $a(e,t,n.slice(),r.slice())},i=In(e);return!Dn((function(e,t){return!Dn(o,t,e)}),In(t),i)},Ln=function(e){return function t(n,r,o){switch(arguments.length){case 0:return t;case 1:return Cn(n)?t:Tn((function(t,r){return e(n,t,r)}));case 2:return Cn(n)&&Cn(r)?t:Cn(n)?Tn((function(t,n){return e(t,r,n)})):Cn(r)?Tn((function(t,r){return e(n,t,r)})):An((function(t){return e(n,r,t)}));default:return Cn(n)&&Cn(r)&&Cn(o)?t:Cn(n)&&Cn(r)?Tn((function(t,n){return e(t,n,o)})):Cn(n)&&Cn(o)?Tn((function(t,n){return e(t,r,n)})):Cn(r)&&Cn(o)?Tn((function(t,r){return e(n,t,r)})):Cn(n)?An((function(t){return e(t,r,o)})):Cn(r)?An((function(t){return e(n,t,o)})):Cn(o)?An((function(t){return e(n,r,t)})):e(n,r,o)}}},Un=function(e){return"[object Object]"===Object.prototype.toString.call(e)},Bn=function(e,t,n){for(var r=n.next();!r.done;){if((t=e["@@transducer/step"](t,r.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}r=n.next()}return e["@@transducer/result"](t)},Fn=function(e,t,n,r){return e["@@transducer/result"](n[r](iu(e["@@transducer/step"],e),t))},Vn=function(e){return(0,zr.getGlobalStore)("config-module-".concat(e),{config:null,loaded:!1})},Kn=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},Hn=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},$n=function(e){for(var t=arguments,n=function(n){var r=null!=t[n]?t[n]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),o.forEach((function(t){Hn(e,t,r[t])}))},r=1;r<arguments.length;r++)n(r);return e},Gn=function(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e},qn=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||Wn(e,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.")}()},zn=function(e){return function(e){if(Array.isArray(e))return Kn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Wn(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.")}()},Wn=function(e,t){if(e){if("string"==typeof e)return Kn(e,t);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)?Kn(e,t):void 0}},Yn=function(e,t){var n=!0,r=!1,o=void 0;try{for(var i,a=Object.keys(e.schemas)[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var u=i.value,c=nr(u,e,t);Vn(u).setState({loaded:!0,config:c})}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}},Zn=function(e,t){var n,r,o=(n=or(tr(e,t)),function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=Object.entries(e)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=qn(o.value,2),u=a[0],c=a[1],s=!0,l=!1,f=void 0;try{for(var d,p=Object.entries(c)[Symbol.iterator]();!(s=(d=p.next()).done);s=!0){var h=qn(d.value,2),y=h[0];er(h[1],u,y)}}catch(e){l=!0,f=e}finally{try{s||null==p.return||p.return()}finally{if(l)throw f}}}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}}(r=Object.keys(n).reduce((function(e,t){var r,o;return(null===(r=n[t])||void 0===r?void 0:r.extensionSlots)&&(e[t]=null===(o=n[t])||void 0===o?void 0:o.extensionSlots),e}),{})),Object.keys(r).reduce((function(e,t){return $n({},e,r[t])}),{})),i=Object.fromEntries(Object.entries(o).map((function(e){var t=qn(e,2);return[t[0],{loaded:!0,config:t[1]}]}))),a=(0,zr.getGlobalStore)("config-extension-slots",{slots:{}}),u=a.getState(),c={slots:$n({},u.slots,i)};qa(u,c)||a.setState(c)},Xn=function(e,t){var n=function(e,t){var n=mu(Qa(e.schemas)),r=zn(e.providedConfigs.map((function(e){return[e.config,e.source]}))).concat([[t.config,"temporary config"]]),o=!0,i=!1,a=void 0;try{for(var u,c=r[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){var s=qn(u.value,2);n=or([n,gu(s[0],s[1])])}}catch(e){i=!0,a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t);bu.setState({config:n})},Jn=function(e,t,n){var r={},o=!0,i=!1,a=void 0;try{for(var u,c=t.mountedExtensions[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){var s=u.value,l=Qn(s.slotModuleName,s.extensionModuleName,s.slotName,s.extensionId,e,n);r[s.slotName]=Gn($n({},r[s.slotName]),Hn({},s.extensionId,{config:l,loaded:!0}))}}catch(e){i=!0,a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}(0,zr.getGlobalStore)("config-extensions",{configs:{}}).setState({configs:r})},Qn=function(e,t,n,r,o,i){var a,u,c,s,l=function(e){return qn(e.split("#"),1)[0]}(r),f=o.schemas[l],d=f?l:t,p=tr(o,i),h=rr(e,p),y=null!==(s=null==h||null===(a=h.extensionSlots)||void 0===a||null===(u=a[n])||void 0===u||null===(c=u.configure)||void 0===c?void 0:c[r])&&void 0!==s?s:{},v=or([rr(d,p),y]),b=null!=f?f:o.schemas[t];ir(b,v,d);var m=_u(b,v);return Ou(b,m,d),delete m.extensionSlots,m},er=function(e,t,n){var r="Extension slot config '".concat(t,".extensionSlots.").concat(n),o=Object.keys(e).filter((function(e){return!["add","remove","order","configure"].includes(e)}));o.length&&console.error(r+"' contains invalid keys '".concat(o.join("', '"),"'")),e.add&&(Array.isArray(e.add)&&e.add.every((function(e){return"string"==typeof e}))||console.error(r+".add' is invalid. Must be an array of strings (extension IDs)")),e.remove&&(Array.isArray(e.remove)&&e.remove.every((function(e){return"string"==typeof e}))||console.error(r+".remove' is invalid. Must be an array of strings (extension IDs)")),e.order&&(Array.isArray(e.order)&&e.order.every((function(e){return"string"==typeof e}))||console.error(r+".order' is invalid. Must be an array of strings (extension IDs)")),e.configure&&(sr(e.configure)||console.error(r+".configure' is invalid. Must be an object with extension IDs for keys"))},tr=function(e,t){return zn(e.providedConfigs.map((function(e){return e.config}))).concat([t.config])},nr=function(e,t,n){if(!t.schemas.hasOwnProperty(e))throw Error("No config schema has been defined for "+e);var r=t.schemas[e],o=rr(e,tr(t,n));ir(r,o,e);var i=_u(r,o);return Ou(r,i,e),delete i.extensionSlots,i},rr=function(e,t){var n=t.map((function(t){return t[e]})).filter((function(e){return!!e}));return or(n)},or=function(e){return uu(Xa)({},e)},ir=function(e,t){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(t)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var c=a.value,s=t[c],l=n+"."+c,f=e[c];e.hasOwnProperty(c)?Su(f,s,l):"extensionSlots"===c&&""!==n||console.error("Unknown config key '".concat(l,"' provided. Ignoring."))}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}},ar=function(e,t,n){t&&ur(e,[{Array:cu,Boolean:su,ConceptUuid:pu,Number:lu,Object:du,String:fu,UUID:pu,PersonAttributeTypeUuid:pu,PatientIdentifierTypeUuid:pu}[t]],n)},ur=function(e,t,n){if(t)try{var r=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var c=(0,a.value)(n);"string"==typeof c&&("object"==typeof n?console.error("Invalid configuration for ".concat(e,": ").concat(c)):console.error("Invalid configuration value ".concat(n," for ").concat(e,": ").concat(c)))}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}catch(t){console.error('Skipping invalid validator at "'.concat(e,'". Encountered error\n\t').concat(t))}},cr=function(e){return!!e&&Object.keys(e).filter((function(e){return!["_default","_validators"].includes(e)})).length>0},sr=function(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e},lr=function(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}},fr=function(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}},dr=function(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}},pr=function(e){var t=this.__data__=new Cu(e);this.size=t.size},hr=function(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new ac;++t<n;)this.add(e[t])},yr=function(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):d(e,t)},vr=function(e){var t=[],n=!0,r=!1,o=void 0;try{for(var i,a=Object.values(e.extensions)[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var u=i.value,c=!0,s=!1,l=void 0;try{for(var f,d=u.instances[Symbol.iterator]();!(c=(f=d.next()).done);c=!0){var p=f.value;t.push({slotModuleName:p.slotModuleName,extensionModuleName:u.moduleName,slotName:p.slotName,extensionId:p.id})}}catch(e){s=!0,l=e}finally{try{c||null==d.return||d.return()}finally{if(s)throw l}}}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}bs(Vr.configExtensionStore.getState().mountedExtensions,t)||Vr.configExtensionStore.setState({mountedExtensions:t})},br=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},mr=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||wr(e,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.")}()},gr=function(e){return function(e){if(Array.isArray(e))return br(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||wr(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.")}()},wr=function(e,t){if(e){if("string"==typeof e)return br(e,t);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)?br(e,t):void 0}},Sr=function(e,t,n){var r={},o=!0,i=!1,a=void 0;try{for(var u,c=Object.entries(e.slots)[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){var s=mr(u.value,2),l=s[0],f=s[1],d=Er(l,e,(0,Vr.getExtensionSlotConfigFromStore)(t,f.name).config,n);r[l]={moduleName:f.moduleName,assignedExtensions:d}}}catch(e){i=!0,a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}bs(Os.getState().slots,r)||Os.setState({slots:r})},Or=function(e){return mr(e.split("#"),1)[0]},_r=function(e,t,n,r){var o=t.indexOf(e);if(-1!==o)return o;if(void 0!==n)return 1e3+n;var i=r.indexOf(e);return-1!==i?2e3+i:-1},Er=function(e,t,n,r){var o=function(e,t){var n=e.add||[],r=e.remove||[],o=e.order||[],i=Ss.getState().extensions;return gr(t).concat(gr(n)).filter((function(e){return!r.includes(e)})).sort((function(e,n){var r,a,u=_r(e,o,null===(r=i[Or(e)])||void 0===r?void 0:r.order,t),c=_r(n,o,null===(a=i[Or(n)])||void 0===a?void 0:a.order,t);return-1===c?-1:-1===u?1:u-c}))}(n,t.slots[e].attachedIds),i=[],a=void 0,u=!0,c=!1,s=void 0;try{for(var l,f=o[Symbol.iterator]();!(u=(l=f.next()).done);u=!0){var d=l.value,p=(0,Vr.getExtensionConfigFromStore)(r,e,d).config,h=Or(d),y=t.extensions[h];if(y){var v,b,m,g,w,S=null!==(m=null!==(b=null==p||null===(v=p["Display conditions"])||void 0===v?void 0:v.privileges)&&void 0!==b?b:y.privileges)&&void 0!==m?m:[];if(S&&("string"==typeof S||Array.isArray(S)&&S.length>0)){var O;if(ms(a)&&(a=null===(O=(0,$i.getSessionStore)().getState().session)||void 0===O?void 0:O.user),!a)continue;if(!(0,$i.userHasAccess)(S,a))continue}i.push({id:d,name:h,moduleName:y.moduleName,config:p,featureFlag:y.featureFlag,meta:y.meta,online:null===(g=y.online)||void 0===g||g,offline:null!==(w=y.offline)&&void 0!==w&&w})}}}catch(e){c=!0,s=e}finally{try{u||null==f.return||f.return()}finally{if(c)throw s}}return i},xr=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},jr=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},Pr=function(e){for(var t=arguments,n=function(n){var r=null!=t[n]?t[n]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),o.forEach((function(t){jr(e,t,r[t])}))},r=1;r<arguments.length;r++)n(r);return e},kr=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return xr(e,t);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)?xr(e,t):void 0}}(e,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.")}()},Cr=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},Ar=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},Tr=function(e,t){if(e){if("string"==typeof e)return Cr(e,t);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)?Cr(e,t):void 0}},Ir=function(e){return function(t){var n=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e)||Tr(e,2)||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.")}()}((0,Ps.useState)(e.getState())),r=n[0],o=n[1];return(0,Ps.useEffect)((function(){return e.subscribe((function(e){return o(e)}))}),[]),function(e){for(var t=arguments,n=function(n){var r=null!=t[n]?t[n]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),o.forEach((function(t){Ar(e,t,r[t])}))},r=1;r<arguments.length;r++)n(r);return e}({},r,(0,Ps.useMemo)((function(){return t?function(e,t){var n=function(n){r[n]=function(){var r=arguments;e.setState((function(e){for(var o,i=[e],a=0;a<r.length;a++)i.push(r[a]);return(o=t)[n].apply(o,function(e){if(Array.isArray(e))return Cr(e)}(u=i)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(u)||Tr(u)||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 u}))}};"function"==typeof t&&(t=t(e));var r={};for(var o in t)n(o);return r}(e,t):{}}),[t]))}},Dr=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||Mr(e,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.")}()},Mr=function(e,t){if(e){if("string"==typeof e)return Rr(e,t);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(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Rr(e,t):void 0}},Rr=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},Nr='<svg viewBox="0 0 380 119" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M40.29 40.3278C45.3275 35.2904 52.2878 32.1739 59.9776 32.1739C67.6466 32.1739 74.5911 35.2765 79.6245 40.29L79.6454 21.7502C73.7513 18.7143 67.0622 17 59.9776 17C52.8891 17 46.1652 18.9309 40.2692 21.9679L40.29 40.3278Z" fill="var(--logo-red)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M79.6454 79.6712C74.6079 84.7096 67.6506 87.8251 59.9608 87.8251C52.2918 87.8251 45.3473 84.7236 40.3099 79.709L40.29 98.2498C46.1871 101.285 52.8732 103 59.9608 103C67.0493 103 73.7374 101.285 79.6315 98.2488L79.6454 79.6712Z" fill="var(--logo-orange)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M40.3278 79.6961C35.2904 74.6586 32.1739 67.7012 32.1739 60.0114C32.1739 52.3425 35.2755 45.399 40.29 40.3616L21.7492 40.3417C18.7143 46.2378 17 52.9229 17 60.0114C17 67.1 18.7143 73.7881 21.7522 79.6831L40.3278 79.6961Z" fill="var(--logo-purple)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M79.6344 40.289C84.6719 45.3255 87.7883 52.2868 87.7883 59.9766C87.7883 67.6456 84.6868 74.5901 79.6712 79.6225L98.213 79.6434C101.248 73.7493 102.962 67.0612 102.962 59.9766C102.962 52.8871 101.248 46.198 98.211 40.302L79.6344 40.289Z" fill="var(--logo-green)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M156.184 60.0025C156.184 51.2543 150.066 44.2264 141.159 44.2264C132.25 44.2264 126.134 51.2543 126.134 60.0025C126.134 68.7507 132.25 75.7816 141.159 75.7816C150.066 75.7816 156.184 68.7507 156.184 60.0025ZM121.303 60.0025C121.303 48.5205 129.621 40.0436 141.159 40.0436C152.695 40.0436 161.014 48.5205 161.014 60.0025C161.014 71.4875 152.695 79.9674 141.159 79.9674C129.621 79.9674 121.303 71.4875 121.303 60.0025Z" fill="var(--logo-black)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M179.514 75.5401C185.021 75.5401 188.564 71.4 188.564 66.0585C188.564 60.717 185.021 56.575 179.514 56.575C174.009 56.575 170.468 60.717 170.468 66.0585C170.468 71.4 174.009 75.5401 179.514 75.5401ZM166.22 53.3064H170.468V57.0102H170.578C172.922 54.2853 176.027 52.6506 179.732 52.6506C187.746 52.6506 193.14 58.32 193.14 66.0585C193.14 73.6887 187.527 79.4645 180.388 79.4645C175.808 79.4645 172.157 77.1749 170.578 74.286H170.468V90.87H166.22V53.3064Z" fill="var(--logo-black)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M217.773 63.7679C217.61 59.4629 214.773 56.575 210.087 56.575C205.402 56.575 202.297 59.4629 201.752 63.7679H217.773ZM221.426 74.1796C218.425 78.0484 214.83 79.4645 210.087 79.4645C202.077 79.4645 197.173 73.4711 197.173 66.0585C197.173 58.157 202.732 52.6506 210.253 52.6506C217.449 52.6506 222.349 57.5568 222.349 66.0049V67.3673H201.752C202.077 71.7797 205.456 75.5401 210.087 75.5401C213.737 75.5401 216.192 74.2333 218.207 71.6723L221.426 74.1796Z" fill="var(--logo-black)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M227.854 59.3565C227.854 57.0102 227.638 54.9959 227.638 53.3064H231.669C231.669 54.6689 231.779 56.083 231.779 57.5012H231.889C233.033 54.9959 236.195 52.6506 240.389 52.6506C247.094 52.6506 250.088 56.9029 250.088 63.0603V78.8086H245.84V63.4986C245.84 59.2462 243.984 56.575 240.007 56.575C234.504 56.575 232.104 60.554 232.104 66.3865V78.8086H227.854V59.3565Z" fill="var(--logo-black)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M259.211 41.0085H265.919L278.8 70.7909H278.907L291.889 41.0085H298.438V78.9994H293.932V47.1242H293.826L280.192 78.9994H277.454L263.825 47.1242H263.718V78.9994H259.211V41.0085Z" fill="var(--logo-black)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M312.392 57.7516H316.415C321.407 57.7516 327.902 57.7516 327.902 51.47C327.902 45.9992 323.126 45.1943 318.725 45.1943H312.392V57.7516ZM307.886 41.0085H317.597C324.949 41.0085 332.729 42.0798 332.729 51.47C332.729 56.9973 329.135 60.5948 323.234 61.507L334.018 78.9994H328.493L318.189 61.9364H312.392V78.9994H307.886V41.0085Z" fill="var(--logo-black)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M358.123 47.7125C356.617 45.2986 353.936 44.2264 351.197 44.2264C347.224 44.2264 343.097 46.1056 343.097 50.6113C343.097 54.1005 345.028 55.6577 351.091 57.5906C356.994 59.4688 362.468 61.3997 362.468 68.858C362.468 76.4246 355.973 79.9674 349.108 79.9674C344.706 79.9674 339.983 78.5174 337.408 74.7063L341.27 71.5412C342.88 74.3347 346.1 75.7816 349.375 75.7816C353.237 75.7816 357.638 73.5277 357.638 69.18C357.638 64.5112 354.473 63.7063 347.71 61.4524C342.344 59.6805 338.268 57.3183 338.268 50.989C338.268 43.6907 344.545 40.0436 351.197 40.0436C355.438 40.0436 359.033 41.2222 361.822 44.4947L358.123 47.7125Z" fill="var(--logo-black)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M185.885 90.9982H187.309L190.043 97.3236H190.066L192.824 90.9982H194.215V99.0676H193.258V92.2971H193.234L190.34 99.0676H189.758L186.864 92.2971H186.842V99.0676H185.885V90.9982Z" fill="var(--logo-black)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M198.386 90.9982H203.457V91.8867H199.343V94.4168H203.184V95.3062H199.343V98.1782H203.663V99.0676H198.386V90.9982Z" fill="var(--logo-black)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M207.891 98.1782H209.713C211.561 98.1782 212.963 97.2431 212.963 95.0319C212.963 92.8218 211.561 91.8867 209.713 91.8867H207.891V98.1782ZM206.934 90.9982H210.034C211.617 90.9982 213.987 92.0586 213.987 95.0319C213.987 98.0083 211.617 99.0676 210.034 99.0676H206.934V90.9982Z" fill="var(--logo-black)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M217.007 99.0676H217.965V90.9982H217.007V99.0676Z" fill="var(--logo-black)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M227.105 92.6628C226.627 92.0119 225.863 91.6819 225.088 91.6819C223.288 91.6819 222.011 93.266 222.011 95.0319C222.011 96.9012 223.277 98.3839 225.088 98.3839C226.068 98.3839 226.855 97.9844 227.425 97.255L228.143 97.8582C227.425 98.8281 226.377 99.2724 225.088 99.2724C222.774 99.2724 220.986 97.4826 220.986 95.0319C220.986 92.6628 222.695 90.7935 225.088 90.7935C226.183 90.7935 227.254 91.1701 227.937 92.0586L227.105 92.6628Z" fill="var(--logo-black)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M233.557 92.2295H233.533L231.858 96.1947H235.152L233.557 92.2295ZM233.123 90.9982H234.023L237.453 99.0676H236.336L235.516 97.0841H231.482L230.65 99.0676H229.568L233.123 90.9982Z" fill="var(--logo-black)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M240.006 90.9982H240.964V98.1782H244.656V99.0676H240.006V90.9982Z" fill="var(--logo-black)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M252.793 94.5539H253.648C254.708 94.5539 256.087 94.5539 256.087 93.2203C256.087 92.0586 255.073 91.8867 254.139 91.8867H252.793V94.5539ZM251.836 90.9982H253.899C255.46 90.9982 257.113 91.2258 257.113 93.2203C257.113 94.3939 256.349 95.1582 255.095 95.3519L257.386 99.0676H256.213L254.023 95.4434H252.793V99.0676H251.836V90.9982Z" fill="var(--logo-black)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M260.51 90.9982H265.58V91.8867H261.468V94.4168H265.308V95.3062H261.468V98.1782H265.786V99.0676H260.51V90.9982Z" fill="var(--logo-black)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M274.402 92.6628C273.923 92.0119 273.16 91.6819 272.384 91.6819C270.584 91.6819 269.307 93.266 269.307 95.0319C269.307 96.9012 270.573 98.3839 272.384 98.3839C273.364 98.3839 274.151 97.9844 274.72 97.255L275.438 97.8582C274.72 98.8281 273.672 99.2724 272.384 99.2724C270.071 99.2724 268.282 97.4826 268.282 95.0319C268.282 92.6628 269.991 90.7935 272.384 90.7935C273.478 90.7935 274.55 91.1701 275.234 92.0586L274.402 92.6628Z" fill="var(--logo-black)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M284.739 95.0319C284.739 93.1746 283.439 91.6819 281.548 91.6819C279.656 91.6819 278.357 93.1746 278.357 95.0319C278.357 96.8903 279.656 98.3839 281.548 98.3839C283.439 98.3839 284.739 96.8903 284.739 95.0319ZM277.33 95.0319C277.33 92.5932 279.097 90.7935 281.548 90.7935C283.998 90.7935 285.765 92.5932 285.765 95.0319C285.765 97.4726 283.998 99.2724 281.548 99.2724C279.097 99.2724 277.33 97.4726 277.33 95.0319Z" fill="var(--logo-black)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M289.514 94.5539H290.369C291.428 94.5539 292.807 94.5539 292.807 93.2203C292.807 92.0586 291.793 91.8867 290.859 91.8867H289.514V94.5539ZM288.556 90.9982H290.618C292.181 90.9982 293.833 91.2258 293.833 93.2203C293.833 94.3939 293.07 95.1582 291.817 95.3519L294.106 99.0676H292.933L290.744 95.4434H289.514V99.0676H288.556V90.9982Z" fill="var(--logo-black)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M297.81 98.1782H299.635C301.48 98.1782 302.881 97.2431 302.881 95.0319C302.881 92.8218 301.48 91.8867 299.635 91.8867H297.81V98.1782ZM296.853 90.9982H299.953C301.538 90.9982 303.909 92.0586 303.909 95.0319C303.909 98.0083 301.538 99.0676 299.953 99.0676H296.853V90.9982Z" fill="var(--logo-black)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M315.407 92.4223C315.089 91.9095 314.517 91.6819 313.937 91.6819C313.093 91.6819 312.216 92.0814 312.216 93.0384C312.216 93.7788 312.626 94.1097 313.914 94.5202C315.168 94.9187 316.331 95.3291 316.331 96.9132C316.331 98.5201 314.951 99.2724 313.493 99.2724C312.558 99.2724 311.555 98.9643 311.007 98.1554L311.828 97.4826C312.17 98.0759 312.854 98.3839 313.549 98.3839C314.37 98.3839 315.303 97.9049 315.303 96.9807C315.303 95.9899 314.633 95.818 313.196 95.341C312.057 94.9644 311.19 94.4625 311.19 93.1189C311.19 91.5677 312.523 90.7935 313.937 90.7935C314.837 90.7935 315.601 91.0439 316.193 91.7386L315.407 92.4223Z" fill="var(--logo-black)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M320.844 95.5914L317.835 90.9982H319.054L321.323 94.6454L323.658 90.9982H324.81L321.8 95.5914V99.0676H320.844V95.5914Z" fill="var(--logo-black)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M330.565 92.4223C330.245 91.9095 329.675 91.6819 329.094 91.6819C328.251 91.6819 327.374 92.0814 327.374 93.0384C327.374 93.7788 327.784 94.1097 329.072 94.5202C330.326 94.9187 331.487 95.3291 331.487 96.9132C331.487 98.5201 330.109 99.2724 328.65 99.2724C327.716 99.2724 326.713 98.9643 326.165 98.1554L326.986 97.4826C327.328 98.0759 328.012 98.3839 328.707 98.3839C329.528 98.3839 330.461 97.9049 330.461 96.9807C330.461 95.9899 329.79 95.818 328.354 95.341C327.215 94.9644 326.348 94.4625 326.348 93.1189C326.348 91.5677 327.681 90.7935 329.094 90.7935C329.995 90.7935 330.759 91.0439 331.351 91.7386L330.565 92.4223Z" fill="var(--logo-black)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M339.283 91.8867H336.617V99.0676H335.659V91.8867H332.992V90.9982H339.283V91.8867Z" fill="var(--logo-black)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M341.665 90.9982H346.736V91.8867H342.623V94.4168H346.463V95.3062H342.623V98.1782H346.942V99.0676H341.665V90.9982Z" fill="var(--logo-black)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M349.905 90.9982H351.329L354.064 97.3236H354.087L356.845 90.9982H358.236V99.0676H357.278V92.2971H357.255L354.361 99.0676H353.779L350.884 92.2971H350.863V99.0676H349.905V90.9982Z" fill="var(--logo-black)"/>\n</svg>\n',Lr='<svg id="omrs-logo-partial" viewBox="0 0 380 119" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M40.2901 40.3278C45.3275 35.2904 52.2879 32.1739 59.9777 32.1739C67.6466 32.1739 74.5911 35.2765 79.6246 40.29L79.6454 21.7502C73.7514 18.7143 67.0623 17 59.9777 17C52.8891 17 46.1653 18.9309 40.2692 21.9679L40.2901 40.3278Z" fill="var(--logo-red)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M79.6454 79.6712C74.6079 84.7096 67.6506 87.8251 59.9608 87.8251C52.2918 87.8251 45.3473 84.7236 40.3099 79.709L40.29 98.2498C46.1871 101.285 52.8732 103 59.9608 103C67.0493 103 73.7374 101.285 79.6315 98.2488L79.6454 79.6712Z" fill="var(--logo-orange)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M40.3278 79.6961C35.2904 74.6586 32.1739 67.7012 32.1739 60.0114C32.1739 52.3425 35.2755 45.399 40.29 40.3616L21.7492 40.3417C18.7143 46.2378 17 52.9229 17 60.0114C17 67.1 18.7143 73.7881 21.7522 79.6831L40.3278 79.6961Z" fill="var(--logo-purple)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M79.6344 40.289C84.6718 45.3255 87.7883 52.2868 87.7883 59.9766C87.7883 67.6456 84.6867 74.5901 79.6712 79.6225L98.213 79.6434C101.248 73.7493 102.962 67.0612 102.962 59.9766C102.962 52.8871 101.248 46.198 98.211 40.302L79.6344 40.289Z" fill="var(--logo-green)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M156.184 60.0025C156.184 51.2543 150.066 44.2264 141.159 44.2264C132.25 44.2264 126.134 51.2543 126.134 60.0025C126.134 68.7507 132.25 75.7816 141.159 75.7816C150.066 75.7816 156.184 68.7507 156.184 60.0025ZM121.303 60.0025C121.303 48.5205 129.621 40.0436 141.159 40.0436C152.695 40.0436 161.014 48.5205 161.014 60.0025C161.014 71.4875 152.695 79.9674 141.159 79.9674C129.621 79.9674 121.303 71.4875 121.303 60.0025Z" fill="var(--logo-black)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M179.514 75.5401C185.021 75.5401 188.564 71.4 188.564 66.0585C188.564 60.717 185.021 56.575 179.514 56.575C174.009 56.575 170.468 60.717 170.468 66.0585C170.468 71.4 174.009 75.5401 179.514 75.5401ZM166.22 53.3064H170.468V57.0102H170.578C172.922 54.2853 176.027 52.6506 179.732 52.6506C187.746 52.6506 193.14 58.32 193.14 66.0585C193.14 73.6887 187.527 79.4645 180.388 79.4645C175.808 79.4645 172.157 77.1749 170.578 74.286H170.468V90.87H166.22V53.3064Z" fill="var(--logo-black)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M217.773 63.7679C217.61 59.4629 214.773 56.575 210.087 56.575C205.402 56.575 202.297 59.4629 201.752 63.7679H217.773ZM221.426 74.1796C218.425 78.0484 214.83 79.4645 210.087 79.4645C202.077 79.4645 197.173 73.4711 197.173 66.0585C197.173 58.157 202.732 52.6506 210.253 52.6506C217.449 52.6506 222.349 57.5568 222.349 66.0049V67.3673H201.752C202.077 71.7797 205.456 75.5401 210.087 75.5401C213.737 75.5401 216.192 74.2333 218.207 71.6723L221.426 74.1796Z" fill="var(--logo-black)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M227.854 59.3565C227.854 57.0102 227.638 54.9959 227.638 53.3064H231.669C231.669 54.6689 231.779 56.083 231.779 57.5012H231.889C233.033 54.9959 236.195 52.6506 240.389 52.6506C247.094 52.6506 250.088 56.9029 250.088 63.0603V78.8086H245.84V63.4986C245.84 59.2462 243.984 56.575 240.007 56.575C234.504 56.575 232.104 60.554 232.104 66.3865V78.8086H227.854V59.3565Z" fill="var(--logo-black)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M259.211 41.0085H265.919L278.8 70.7909H278.907L291.889 41.0085H298.438V78.9994H293.932V47.1242H293.826L280.192 78.9994H277.454L263.825 47.1242H263.718V78.9994H259.211V41.0085Z" fill="var(--logo-black)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M312.392 57.7516H316.415C321.407 57.7516 327.902 57.7516 327.902 51.47C327.902 45.9992 323.126 45.1943 318.725 45.1943H312.392V57.7516ZM307.886 41.0085H317.597C324.949 41.0085 332.729 42.0798 332.729 51.47C332.729 56.9973 329.135 60.5948 323.234 61.5071L334.018 78.9994H328.493L318.189 61.9364H312.392V78.9994H307.886V41.0085Z" fill="var(--logo-black)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M358.123 47.7125C356.617 45.2986 353.936 44.2264 351.197 44.2264C347.224 44.2264 343.097 46.1056 343.097 50.6113C343.097 54.1005 345.028 55.6577 351.091 57.5906C356.994 59.4688 362.468 61.3997 362.468 68.858C362.468 76.4246 355.973 79.9674 349.108 79.9674C344.706 79.9674 339.983 78.5174 337.408 74.7063L341.27 71.5412C342.88 74.3347 346.1 75.7816 349.375 75.7816C353.237 75.7816 357.638 73.5277 357.638 69.18C357.638 64.5112 354.473 63.7063 347.71 61.4524C342.344 59.6805 338.268 57.3183 338.268 50.989C338.268 43.6907 344.545 40.0436 351.197 40.0436C355.438 40.0436 359.033 41.2222 361.822 44.4947L358.123 47.7125Z" fill="var(--logo-black)"/>\n</svg>\n',Ur='<svg id="omrs-logo-icon" width="121" height="118" viewBox="0 0 121 118" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M40.436 39.474C45.505 34.405 52.509 31.269 60.247 31.269C67.964 31.269 74.952 34.391 80.017 39.436L80.038 20.78C74.107 17.725 67.376 16 60.247 16C53.114 16 46.348 17.943 40.415 20.999L40.436 39.474Z" fill="var(--logo-red)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M80.038 79.064C74.969 84.134 67.968 87.269 60.23 87.269C52.513 87.269 45.525 84.148 40.456 79.102L40.436 97.759C46.37 100.813 53.098 102.539 60.23 102.539C67.363 102.539 74.093 100.813 80.024 97.758L80.038 79.064Z" fill="var(--logo-orange)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M40.474 79.089C35.405 74.02 32.269 67.019 32.269 59.281C32.269 51.564 35.39 44.577 40.436 39.508L21.779 39.488C18.725 45.421 17 52.148 17 59.281C17 66.414 18.725 73.144 21.782 79.076L40.474 79.089Z" fill="var(--logo-purple)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M80.027 39.435C85.096 44.503 88.232 51.508 88.232 59.246C88.232 66.963 85.111 73.951 80.064 79.015L98.722 79.036C101.776 73.105 103.501 66.375 103.501 59.246C103.501 52.112 101.776 45.381 98.72 39.448L80.027 39.435Z" fill="var(--logo-green)"/>\n</svg>\n',Br=document.createElement("div"),Fr=function(){document.body.appendChild(Br)};Br.id="omrs-svgs-container",Br.style.display="none","complete"===document.readyState?Fr():window.addEventListener("load",Fr);var Vr=S(714),Kr=S(792);function Hr(e,t,n){return Hr=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(e){return!1}}()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&Gr(o,n.prototype),o},Hr.apply(null,arguments)}function $r(e){return $r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},$r(e)}function Gr(e,t){return Gr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Gr(e,t)}function qr(e){var t="function"==typeof Map?new Map:void 0;return qr=function(e){if(null===e||!function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return Hr(e,arguments,$r(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Gr(n,e)},qr(e)}"".concat("/ws/rest/v1/","session"),qr(Error),S(674);var zr=S(685);(0,zr.createGlobalStore)("session",{loaded:!1,session:null});try{self["workbox:window:6.5.3"]&&_()}catch(e){}try{self["workbox:core:6.5.3"]&&_()}catch(e){}var Wr=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t,e.reject=n}))},Yr=function(e,t){this.type=e,Object.assign(this,t)},Zr={type:"SKIP_WAITING"};!function(e){var t,n,o=function(t,n){var r,o;return void 0===n&&(n={}),(r=e.call(this)||this).nn={},r.tn=0,r.rn=new Wr,r.en=new Wr,r.on=new Wr,r.un=0,r.an=new Set,r.cn=function(){var e=r.fn,t=e.installing;r.tn>0||!a(t.scriptURL,r.sn.toString())||performance.now()>r.un+6e4?(r.vn=t,e.removeEventListener("updatefound",r.cn)):(r.hn=t,r.an.add(t),r.rn.resolve(t)),++r.tn,t.addEventListener("statechange",r.ln)},r.ln=function(e){var t=r.fn,n=e.target,o=n.state,i=n===r.vn,a={sw:n,isExternal:i,originalEvent:e};!i&&r.mn&&(a.isUpdate=!0),r.dispatchEvent(new Yr(o,a)),"installed"===o?r.wn=self.setTimeout((function(){"installed"===o&&t.waiting===n&&r.dispatchEvent(new Yr("waiting",a))}),200):"activating"===o&&(clearTimeout(r.wn),i||r.en.resolve(n))},r.dn=function(e){var t=r.hn,n=t!==navigator.serviceWorker.controller;r.dispatchEvent(new Yr("controlling",{isExternal:n,originalEvent:e,sw:t,isUpdate:r.mn})),n||r.on.resolve(t)},r.gn=(o=function(e){var t=e.data,n=e.ports,o=e.source;return s(r.getSW(),(function(){r.an.has(o)&&r.dispatchEvent(new Yr("message",{data:t,originalEvent:e,ports:n,sw:o}))}))},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(o.apply(this,e))}catch(e){return Promise.reject(e)}}),r.sn=t,r.nn=n,navigator.serviceWorker.addEventListener("message",r.gn),r};n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var i,u=o.prototype;u.register=function(e){var t=(void 0===e?{}:e).immediate,n=void 0!==t&&t;try{var r=this;return function(e,t){var n=e();return n&&n.then?n.then(t):t()}((function(){if(!n&&"complete"!==document.readyState)return g(new Promise((function(e){return window.addEventListener("load",e)})))}),(function(){return r.mn=Boolean(navigator.serviceWorker.controller),r.yn=r.pn(),s(r.bn(),(function(e){r.fn=e,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 t=r.fn.waiting;return t&&a(t.scriptURL,r.sn.toString())&&(r.hn=t,Promise.resolve().then((function(){r.dispatchEvent(new Yr("waiting",{sw:t,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(e){return Promise.reject(e)}},u.update=function(){try{return this.fn?g(this.fn.update()):void 0}catch(e){return Promise.reject(e)}},u.getSW=function(){return void 0!==this.hn?Promise.resolve(this.hn):this.rn.promise},u.messageSW=function(e){try{return s(this.getSW(),(function(t){return r(t,e)}))}catch(e){return Promise.reject(e)}},u.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&r(this.fn.waiting,Zr)},u.pn=function(){var e=navigator.serviceWorker.controller;return e&&a(e.scriptURL,this.sn.toString())?e:void 0},u.bn=function(){try{var e=this;return function(t,n){try{var r=s(navigator.serviceWorker.register(e.sn,e.nn),(function(t){return e.un=performance.now(),t}))}catch(e){return n(e)}return r&&r.then?r.then(void 0,n):r}(0,(function(e){throw e}))}catch(e){return Promise.reject(e)}},(i=[{key:"active",get:function(){return this.en.promise}},{key:"controlling",get:function(){return this.on.promise}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(o.prototype,i)}(function(){var e=function(){this.Pn=new Map},t=e.prototype;return t.addEventListener=function(e,t){this.Sn(e).add(t)},t.removeEventListener=function(e,t){this.Sn(e).delete(t)},t.dispatchEvent=function(e){e.target=this;for(var t,n=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return i(e,t);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(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e))){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}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(n=e[Symbol.iterator]()).next.bind(n)}(this.Sn(e.type));!(t=n()).done;)(0,t.value)(e)},t.Sn=function(e){return this.Pn.has(e)||this.Pn.set(e,new Set),this.Pn.get(e)},e}());var Xr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,Jr=Object.keys,Qr=Array.isArray;"undefined"==typeof Promise||Xr.Promise||(Xr.Promise=Promise);var eo=Object.getPrototypeOf,to={}.hasOwnProperty,no=Object.defineProperty,ro=Object.getOwnPropertyDescriptor;function oo(e,t){var n;return ro(e,t)||(n=eo(e))&&oo(n,t)}var io=[].slice;function ao(e,t){if(O(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var n=[],r=0,o=t.length;r<o;++r){var i=ao(e,t[r]);n.push(i)}return n}var a=t.indexOf(".");if(-1!==a){var u=e[t.substr(0,a)];return void 0===u?void 0:ao(u,t.substr(a+1))}}function uo(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){C("string"!=typeof n&&"length"in n);for(var r=0,o=t.length;r<o;++r)uo(e,t[r],n[r])}else{var i=t.indexOf(".");if(-1!==i){var a=t.substr(0,i),u=t.substr(i+1);if(""===u)void 0===n?Qr(e)&&!isNaN(parseInt(a))?e.splice(a,1):delete e[a]:e[a]=n;else{var c=e[a];c&&O(e,a)||(c=e[a]={}),uo(c,u,n)}}else void 0===n?Qr(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}var co=[].concat,so="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(D([8,16,32,64].map((function(e){return["Int","Uint","Float"].map((function(t){return t+e+"Array"}))})))).filter((function(e){return Xr[e]})),lo=so.map((function(e){return Xr[e]}));T(so,(function(e){return[e,!0]}));var fo=null;function po(e){if(!e||"object"!=typeof e)return e;var t=fo&&fo.get(e);if(t)return t;if(Qr(e)){t=[],fo&&fo.set(e,t);for(var n=0,r=e.length;n<r;++n)t.push(po(e[n]))}else if(lo.indexOf(e.constructor)>=0)t=e;else{var o=eo(e);for(var i in t=o===Object.prototype?{}:Object.create(o),fo&&fo.set(e,t),e)O(e,i)&&(t[i]=po(e[i]))}return t}var ho={}.toString,yo="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",vo="symbol"==(void 0===yo?"undefined":b(yo))?function(e){var t;return null!=e&&(t=e[yo])&&t.apply(e)}:function(){return null},bo={},mo="undefined"!=typeof Symbol?function(e){return"AsyncFunction"===e[Symbol.toStringTag]}:function(){return!1},go="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href),wo=function(){return!0},So=!new Error("").stack;function Oo(){if(So)try{throw Oo.arguments,new Error}catch(e){return e}return new Error}var _o=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Eo=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(_o),xo={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"};j(B).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+U(this._e,2))}},toString:function(){return this.name+": "+this.message}}),j(V).from(B),j(K).from(B);var jo=Eo.reduce((function(e,t){return e[t]=t+"Error",e}),{}),Po=B,ko=Eo.reduce((function(e,t){var n=function(e,n){this._e=Oo(),this.name=r,e?"string"==typeof e?(this.message="".concat(e).concat(n?"\n "+n:""),this.inner=n||null):"object"==typeof e&&(this.message="".concat(e.name," ").concat(e.message),this.inner=e):(this.message=xo[t]||r,this.inner=null)},r=t+"Error";return j(n).from(Po),e[t]=n,e}),{});ko.Syntax=SyntaxError,ko.Type=TypeError,ko.Range=RangeError;var Co=_o.reduce((function(e,t){return e[t+"Error"]=ko[t],e}),{}),Ao=Eo.reduce((function(e,t){return-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=ko[t]),e}),{});Ao.ModifyError=V,Ao.DexieError=B,Ao.BulkError=K;var To={},Io=y("undefined"==typeof Promise?[]:function(){var e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,eo(e),e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,eo(t),e]}(),3),Do=Io[0],Mo=Io[1],Ro=Io[2],No=Mo&&Mo.then,Lo=Do&&Do.constructor,Uo=!!Ro,Bo=!1,Fo=Ro?function(){Ro.then(ie)}:Xr.setImmediate?setImmediate.bind(null,ie):Xr.MutationObserver?function(){var e=document.createElement("div");new MutationObserver((function(){ie(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:function(){setTimeout(ie,0)},Vo=function(e,t){Zo.push([e,t]),Ho&&(Fo(),Ho=!1)},Ko=!0,Ho=!0,$o=[],Go=[],qo=null,zo=$,Wo={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:_e,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((function(e){try{_e(e[0],e[1])}catch(e){}}))}},Yo=Wo,Zo=[],Xo=0,Jo=[],Qo={get:function(){var e=function(e,r){var o=this,i=!t.global&&(t!==Yo||n!==ai),a=i&&!pe(),u=new J((function(n,u){ne(o,new Q(Se(e,t,i,a),Se(r,t,i,a),n,u,t))}));return go&&oe(u,this),u},t=Yo,n=ai;return e.prototype=To,e},set:function(e){x(this,"then",e&&e.prototype===To?Qo:{get:function(){return e},set:Qo.set})}};function ei(e,t){try{t((function(t){if(null===e._state){if(t===e)throw new TypeError("A promise cannot be resolved with itself.");var n=e._lib&&ae();t&&"function"==typeof t.then?ei(e,(function(e,n){d(t,J)?t._then(e,n):t.then(e,n)})):(e._state=!0,e._value=t,te(e)),n&&ue()}}),ee.bind(null,e))}catch(t){ee(e,t)}}function ti(e,t,n){if(t.length===n)return t;var r="";if(!1===e._state){var o,i,a=e._value;null!=a?(o=a.name||"Error",i=a.message||a,r=U(a,0)):(o=a,i=""),t.push(o+(i?": "+i:"")+r)}return go&&((r=U(e._stackHolder,2))&&-1===t.indexOf(r)&&t.push(r),e._prev&&ti(e._prev,t,n)),t}E(J.prototype,{then:Qo,_then:function(e,t){ne(this,new Q(null,null,e,t,Yo))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=arguments[0],n=arguments[1];return"function"==typeof t?this.then(null,(function(e){return d(e,t)?n(e):se(e)})):this.then(null,(function(e){return e&&e.name===t?n(e):se(e)}))},finally:function(e){return this.then((function(t){return e(),t}),(function(t){return e(),se(t)}))},stack:{get:function(){if(this._stack)return this._stack;try{Bo=!0;var e=ti(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{Bo=!1}}},timeout:function(e,t){var n=this;return e<1/0?new J((function(r,o){var i=setTimeout((function(){return o(new ko.Timeout(t))}),e);n.then(r,o).finally(clearTimeout.bind(null,i))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&x(J.prototype,Symbol.toStringTag,"Dexie.Promise"),Wo.env=me(),E(J,{all:function(){var e=N.apply(null,arguments).map(he);return new J((function(t,n){0===e.length&&t([]);var r=e.length;e.forEach((function(o,i){return J.resolve(o).then((function(n){e[i]=n,--r||t(e)}),n)}))}))},resolve:function(e){if(d(e,J))return e;if(e&&"function"==typeof e.then)return new J((function(t,n){e.then(t,n)}));var t=new J(To,!0,e);return oe(t,qo),t},reject:se,race:function(){var e=N.apply(null,arguments).map(he);return new J((function(t,n){e.map((function(e){return J.resolve(e).then(t,n)}))}))},PSD:{get:function(){return Yo},set:function(e){return Yo=e}},totalEchoes:{get:function(){return ai}},newPSD:fe,usePSD:ge,scheduler:{get:function(){return Vo},set:function(e){Vo=e}},rejectionMapper:{get:function(){return zo},set:function(e){zo=e}},follow:function(e,t){return new J((function(n,r){return fe((function(t,n){var r=Yo;r.unhandleds=[],r.onunhandled=n,r.finalize=q((function(){var e=this;!function(e){Jo.push((function t(){e(),Jo.splice(Jo.indexOf(t),1)})),++Xo,Vo((function(){0==--Xo&&ce()}),[])}((function(){0===e.unhandleds.length?t():n(e.unhandleds[0])}))}),r.finalize),e()}),t,n,r)}))}}),Lo&&(Lo.allSettled&&x(J,"allSettled",(function(){var e=N.apply(null,arguments).map(he);return new J((function(t){0===e.length&&t([]);var n=e.length,r=new Array(n);e.forEach((function(e,o){return J.resolve(e).then((function(e){return r[o]={status:"fulfilled",value:e}}),(function(e){return r[o]={status:"rejected",reason:e}})).then((function(){return--n||t(r)}))}))}))})),Lo.any&&"undefined"!=typeof AggregateError&&x(J,"any",(function(){var e=N.apply(null,arguments).map(he);return new J((function(t,n){0===e.length&&n(new AggregateError([]));var r=e.length,o=new Array(r);e.forEach((function(e,i){return J.resolve(e).then((function(e){return t(e)}),(function(e){o[i]=e,--r||n(new AggregateError(o))}))}))}))})));var ni={awaits:0,echoes:0,id:0},ri=0,oi=[],ii=0,ai=0,ui=0;-1===(""+No).indexOf("[native code]")&&(de=pe=H);var ci=J.reject;function si(e,t,n,r){if(e.idbdb&&(e._state.openComplete||Yo.letThrough||e._vip)){var o=e._createTransaction(t,n,e._dbSchema);try{o.create(),e._state.PR1398_maxLoop=3}catch(o){return o.name===jo.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((function(){return si(e,t,n,r)}))):ci(o)}return o._promise(t,(function(e,t){return fe((function(){return Yo.trans=o,r(e,t,o)}))})).then((function(e){return o._completion.then((function(){return e}))}))}if(e._state.openComplete)return ci(new ko.DatabaseClosed(e._state.dbOpenError));if(!e._state.isBeingOpened){if(!e._options.autoOpen)return ci(new ko.DatabaseClosed);e.open().catch(H)}return e._state.dbReadyPromise.then((function(){return si(e,t,n,r)}))}var li=String.fromCharCode(65535),fi="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",di=[],pi="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),hi=pi,yi=pi,vi=function(e){return!/(dexie\.js|dexie\.min\.js)/.test(e)},bi={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1},mi=function(){function e(){c(this,e)}return l(e,[{key:"_trans",value:function(e,t,n){var r=function(e,n,r){if(!r.schema[i])throw new ko.NotFound("Table "+i+" not part of transaction");return t(r.idbtrans,r)},o=this._tx||Yo.trans,i=this.name,a=ae();try{return o&&o.db===this.db?o===Yo.trans?o._promise(e,r,n):fe((function(){return o._promise(e,r,n)}),{trans:o,transless:Yo.transless||Yo}):si(this.db,e,[this.name],r)}finally{a&&ue()}}},{key:"get",value:function(e,t){var n=this;return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",(function(t){return n.core.get({trans:t,key:e}).then((function(e){return n.hook.reading.fire(e)}))})).then(t)}},{key:"where",value:function(e){var t=function(e,t){try{return 0===i.cmp(e,t)}catch(e){return!1}};if("string"==typeof e)return new this.db.WhereClause(this,e);if(Qr(e))return new this.db.WhereClause(this,"[".concat(e.join("+"),"]"));var n=Jr(e);if(1===n.length)return this.where(n[0]).equals(e[n[0]]);var r=this.schema.indexes.concat(this.schema.primKey).filter((function(e){return e.compound&&n.every((function(t){return e.keyPath.indexOf(t)>=0}))&&e.keyPath.every((function(e){return n.indexOf(e)>=0}))}))[0];if(r&&this.db._maxKey!==li)return this.where(r.name).equals(r.keyPath.map((function(t){return e[t]})));!r&&go&&console.warn("The query ".concat(JSON.stringify(e)," on ").concat(this.name," would benefit of a compound index [").concat(n.join("+"),"]"));var o=this.schema.idxByName,i=this.db._deps.indexedDB,a=y(n.reduce((function(n,r){var i=y(n,2),a=i[0],u=i[1],c=o[r],s=e[r];return[a||c,a||!c?Ee(u,c&&c.multi?function(e){var n=ao(e,r);return Qr(n)&&n.some((function(e){return t(s,e)}))}:function(e){return t(s,ao(e,r))}):u]}),[null,null]),2),u=a[0],c=a[1];return u?this.where(u.name).equals(e[u.keyPath]).filter(c):r?this.filter(c):this.where(n).equals("")}},{key:"filter",value:function(e){return this.toCollection().and(e)}},{key:"count",value:function(e){return this.toCollection().count(e)}},{key:"offset",value:function(e){return this.toCollection().offset(e)}},{key:"limit",value:function(e){return this.toCollection().limit(e)}},{key:"each",value:function(e){return this.toCollection().each(e)}},{key:"toArray",value:function(e){return this.toCollection().toArray(e)}},{key:"toCollection",value:function(){return new this.db.Collection(new this.db.WhereClause(this))}},{key:"orderBy",value:function(e){return new this.db.Collection(new this.db.WhereClause(this,Qr(e)?"[".concat(e.join("+"),"]"):e))}},{key:"reverse",value:function(){return this.toCollection().reverse()}},{key:"mapToClass",value:function(e){this.schema.mappedClass=e;var t=function(t){if(!t)return t;var n=Object.create(e.prototype);for(var r in t)if(O(t,r))try{n[r]=t[r]}catch(e){}return n};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=t,this.hook("reading",t),e}},{key:"defineClass",value:function(){return this.mapToClass((function(e){w(this,e)}))}},{key:"add",value:function(e,t){var n=this,r=this.schema.primKey,o=r.auto,i=r.keyPath,a=e;return i&&o&&(a=xe(i)(e)),this._trans("readwrite",(function(e){return n.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[a]})})).then((function(e){return e.numFailures?J.reject(e.failures[0]):e.lastResult})).then((function(t){if(i)try{uo(e,i,t)}catch(e){}return t}))}},{key:"update",value:function(e,t){if("object"!=typeof e||Qr(e))return this.where(":id").equals(e).modify(t);var n=ao(e,this.schema.primKey.keyPath);if(void 0===n)return ci(new ko.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?Jr(t).forEach((function(n){uo(e,n,t[n])})):t(e,{value:e,primKey:n})}catch(e){}return this.where(":id").equals(n).modify(t)}},{key:"put",value:function(e,t){var n=this,r=this.schema.primKey,o=r.auto,i=r.keyPath,a=e;return i&&o&&(a=xe(i)(e)),this._trans("readwrite",(function(e){return n.core.mutate({trans:e,type:"put",values:[a],keys:null!=t?[t]:null})})).then((function(e){return e.numFailures?J.reject(e.failures[0]):e.lastResult})).then((function(t){if(i)try{uo(e,i,t)}catch(e){}return t}))}},{key:"delete",value:function(e){var t=this;return this._trans("readwrite",(function(n){return t.core.mutate({trans:n,type:"delete",keys:[e]})})).then((function(e){return e.numFailures?J.reject(e.failures[0]):void 0}))}},{key:"clear",value:function(){var e=this;return this._trans("readwrite",(function(t){return e.core.mutate({trans:t,type:"deleteRange",range:bi})})).then((function(e){return e.numFailures?J.reject(e.failures[0]):void 0}))}},{key:"bulkGet",value:function(e){var t=this;return this._trans("readonly",(function(n){return t.core.getMany({keys:e,trans:n}).then((function(e){return e.map((function(e){return t.hook.reading.fire(e)}))}))}))}},{key:"bulkAdd",value:function(e,t,n){var r=this,o=Array.isArray(t)?t:void 0,i=(n=n||(o?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(function(t){var n=r,a=r.schema.primKey,u=a.auto,c=a.keyPath;if(c&&o)throw new ko.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new ko.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,l=c&&u?e.map(xe(c)):e;return r.core.mutate({trans:t,type:"add",keys:o,values:l,wantResults:i}).then((function(e){var t=e.numFailures,r=e.results,o=e.lastResult,a=e.failures;if(0===t)return i?r:o;throw new K("".concat(n.name,".bulkAdd(): ").concat(t," of ").concat(s," operations failed"),a)}))}))}},{key:"bulkPut",value:function(e,t,n){var r=this,o=Array.isArray(t)?t:void 0,i=(n=n||(o?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(function(t){var n=r,a=r.schema.primKey,u=a.auto,c=a.keyPath;if(c&&o)throw new ko.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new ko.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,l=c&&u?e.map(xe(c)):e;return r.core.mutate({trans:t,type:"put",keys:o,values:l,wantResults:i}).then((function(e){var t=e.numFailures,r=e.results,o=e.lastResult,a=e.failures;if(0===t)return i?r:o;throw new K("".concat(n.name,".bulkPut(): ").concat(t," of ").concat(s," operations failed"),a)}))}))}},{key:"bulkDelete",value:function(e){var t=this,n=e.length;return this._trans("readwrite",(function(n){return t.core.mutate({trans:n,type:"delete",keys:e})})).then((function(e){var r=e.numFailures,o=e.lastResult,i=e.failures;if(0===r)return o;throw new K("".concat(t.name,".bulkDelete(): ").concat(r," of ").concat(n," operations failed"),i)}))}}]),e}();function gi(e,t){try{var n=Re(e),r=Re(t);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 e>t?1:e<t?-1:0;case"binary":return function(e,t){for(var n=e.length,r=t.length,o=n<r?n:r,i=0;i<o;++i)if(e[i]!==t[i])return e[i]<t[i]?-1:1;return n===r?0:n<r?-1:1}(Ne(e),Ne(t));case"Array":return function(e,t){for(var n=e.length,r=t.length,o=n<r?n:r,i=0;i<o;++i){var a=gi(e[i],t[i]);if(0!==a)return a}return n===r?0:n<r?-1:1}(e,t)}}catch(e){}return NaN}var wi=function(){function e(){c(this,e)}return l(e,[{key:"_read",value:function(e,t){var n=this._ctx;return n.error?n.table._trans(null,ci.bind(null,n.error)):n.table._trans("readonly",e).then(t)}},{key:"_write",value:function(e){var t=this._ctx;return t.error?t.table._trans(null,ci.bind(null,t.error)):t.table._trans("readwrite",e,"locked")}},{key:"_addAlgorithm",value:function(e){var t=this._ctx;t.algorithm=Ee(t.algorithm,e)}},{key:"_iterate",value:function(e,t){return De(this._ctx,e,t,this._ctx.table.core)}},{key:"clone",value:function(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&w(n,e),t._ctx=n,t}},{key:"raw",value:function(){return this._ctx.valueMapper=null,this}},{key:"each",value:function(e){var t=this._ctx;return this._read((function(n){return De(t,e,n,t.table.core)}))}},{key:"count",value:function(e){var t=this;return this._read((function(e){var n=t._ctx,r=n.table.core;if(ke(n,!0))return r.count({trans:e,query:{index:Te(n,r.schema),range:n.range}}).then((function(e){return Math.min(e,n.limit)}));var o=0;return De(n,(function(){return++o,!1}),e,r).then((function(){return o}))})).then(e)}},{key:"sortBy",value:function(e,t){var n=function(e,t){var n=a(e,i),r=a(t,i);return n<r?-u:n>r?u:0},r=e.split(".").reverse(),o=r[0],i=r.length-1;function a(e,t){return t?a(e[r[t]],t-1):e[o]}var u="next"===this._ctx.dir?1:-1;return this.toArray((function(e){return e.sort(n)})).then(t)}},{key:"toArray",value:function(e){var t=this;return this._read((function(e){var n=t._ctx;if("next"===n.dir&&ke(n,!0)&&n.limit>0){var r=n.valueMapper,o=Te(n,n.table.core.schema);return n.table.core.query({trans:e,limit:n.limit,values:!0,query:{index:o,range:n.range}}).then((function(e){var t=e.result;return r?t.map(r):t}))}var i=[];return De(n,(function(e){return i.push(e)}),e,n.table.core).then((function(){return i}))}),e)}},{key:"offset",value:function(e){var t=this._ctx;return e<=0||(t.offset+=e,ke(t)?Ae(t,(function(){var t=e;return function(e,n){return 0===t||(1===t?(--t,!1):(n((function(){e.advance(t),t=0})),!1))}})):Ae(t,(function(){var t=e;return function(){return--t<0}}))),this}},{key:"limit",value:function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),Ae(this._ctx,(function(){var t=e;return function(e,n,r){return--t<=0&&n(r),t>=0}}),!0),this}},{key:"until",value:function(e,t){return Ce(this._ctx,(function(n,r,o){return!e(n.value)||(r(o),t)})),this}},{key:"first",value:function(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)}},{key:"last",value:function(e){return this.reverse().first(e)}},{key:"filter",value:function(e){var t,n;return Ce(this._ctx,(function(t){return e(t.value)})),t=this._ctx,n=e,t.isMatch=Ee(t.isMatch,n),this}},{key:"and",value:function(e){return this.filter(e)}},{key:"or",value:function(e){return new this.db.WhereClause(this._ctx.table,e,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(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.key,n)}))}},{key:"eachUniqueKey",value:function(e){return this._ctx.unique="unique",this.eachKey(e)}},{key:"eachPrimaryKey",value:function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.primaryKey,n)}))}},{key:"keys",value:function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.key)})).then((function(){return n})).then(e)}},{key:"primaryKeys",value:function(e){var t=this._ctx;if("next"===t.dir&&ke(t,!0)&&t.limit>0)return this._read((function(e){var n=Te(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})})).then((function(e){return e.result})).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.primaryKey)})).then((function(){return n})).then(e)}},{key:"uniqueKeys",value:function(e){return this._ctx.unique="unique",this.keys(e)}},{key:"firstKey",value:function(e){return this.limit(1).keys((function(e){return e[0]})).then(e)}},{key:"lastKey",value:function(e){return this.reverse().firstKey(e)}},{key:"distinct",value:function(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var n={};return Ce(this._ctx,(function(e){var t=e.primaryKey.toString(),r=O(n,t);return n[t]=!0,!r})),this}},{key:"modify",value:function(e){var t=this,n=this._ctx;return this._write((function(r){var o;if("function"==typeof e)o=e;else{var i=Jr(e),a=i.length;o=function(t){for(var n=!1,r=0;r<a;++r){var o=i[r],u=e[o];ao(t,o)!==u&&(uo(t,o,u),n=!0)}return n}}var u=n.table.core,c=u.schema.primaryKey,s=c.outbound,l=c.extractKey,f=t.db._options.modifyChunkSize||200,d=[],p=0,h=[],y=function(e,t){var n=t.failures,r=t.numFailures;p+=e-r;var o=!0,i=!1,a=void 0;try{for(var u,c=Jr(n)[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){var s=u.value;d.push(n[s])}}catch(e){i=!0,a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}};return t.clone().primaryKeys().then((function(t){var i=function(a){var c=Math.min(f,t.length-a);return u.getMany({trans:r,keys:t.slice(a,a+c),cache:"immutable"}).then((function(d){for(var p=[],h=[],v=s?[]:null,b=[],m=0;m<c;++m){var g=d[m],w={value:M(g),primKey:t[a+m]};!1!==o.call(w,w.value,w)&&(null==w.value?b.push(t[a+m]):s||0===gi(l(g),l(w.value))?(h.push(w.value),s&&v.push(t[a+m])):(b.push(t[a+m]),p.push(w.value)))}var S=ke(n)&&n.limit===1/0&&("function"!=typeof e||e===Si)&&{index:n.index,range:n.range};return Promise.resolve(p.length>0&&u.mutate({trans:r,type:"add",values:p}).then((function(e){for(var t in e.failures)b.splice(parseInt(t),1);y(p.length,e)}))).then((function(){return(h.length>0||S&&"object"==typeof e)&&u.mutate({trans:r,type:"put",keys:v,values:h,criteria:S,changeSpec:"function"!=typeof e&&e}).then((function(e){return y(h.length,e)}))})).then((function(){return(b.length>0||S&&e===Si)&&u.mutate({trans:r,type:"delete",keys:b,criteria:S}).then((function(e){return y(b.length,e)}))})).then((function(){return t.length>a+c&&i(a+f)}))}))};return i(0).then((function(){if(d.length>0)throw new V("Error modifying one or more objects",d,p,h);return t.length}))}))}))}},{key:"delete",value:function(){var e=this._ctx,t=e.range;return ke(e)&&(e.isPrimKey&&!yi||3===t.type)?this._write((function(n){var r=e.table.core.schema.primaryKey,o=t;return e.table.core.count({trans:n,query:{index:r,range:o}}).then((function(t){return e.table.core.mutate({trans:n,type:"deleteRange",range:o}).then((function(e){var n=e.failures,r=(e.lastResult,e.results,e.numFailures);if(r)throw new V("Could not delete some values",Object.keys(n).map((function(e){return n[e]})),t-r);return t-r}))}))})):this.modify(Si)}}]),e}(),Si=function(e,t){return t.value=null},Oi=function(){function e(){c(this,e)}return l(e,[{key:"Collection",get:function(){return this._ctx.table.db.Collection}},{key:"between",value:function(e,t,n,r){n=!1!==n,r=!0===r;try{return this._cmp(e,t)>0||0===this._cmp(e,t)&&(n||r)&&(!n||!r)?Fe(this):new this.Collection(this,(function(){return He(e,t,!n,!r)}))}catch(e){return Be(this,fi)}}},{key:"equals",value:function(e){return null==e?Be(this,fi):new this.Collection(this,(function(){return $e(e)}))}},{key:"above",value:function(e){return null==e?Be(this,fi):new this.Collection(this,(function(){return He(e,void 0,!0)}))}},{key:"aboveOrEqual",value:function(e){return null==e?Be(this,fi):new this.Collection(this,(function(){return He(e,void 0,!1)}))}},{key:"below",value:function(e){return null==e?Be(this,fi):new this.Collection(this,(function(){return He(void 0,e,!1,!0)}))}},{key:"belowOrEqual",value:function(e){return null==e?Be(this,fi):new this.Collection(this,(function(){return He(void 0,e)}))}},{key:"startsWith",value:function(e){return"string"!=typeof e?Be(this,"String expected."):this.between(e,e+li,!0,!0)}},{key:"startsWithIgnoreCase",value:function(e){return""===e?this.startsWith(e):Ke(this,(function(e,t){return 0===e.indexOf(t[0])}),[e],li)}},{key:"equalsIgnoreCase",value:function(e){return Ke(this,(function(e,t){return e===t[0]}),[e],"")}},{key:"anyOfIgnoreCase",value:function(){var e=N.apply(bo,arguments);return 0===e.length?Fe(this):Ke(this,(function(e,t){return-1!==t.indexOf(e)}),e,"")}},{key:"startsWithAnyOfIgnoreCase",value:function(){var e=N.apply(bo,arguments);return 0===e.length?Fe(this):Ke(this,(function(e,t){return t.some((function(t){return 0===e.indexOf(t)}))}),e,li)}},{key:"anyOf",value:function(){var e=this,t=N.apply(bo,arguments),n=this._cmp;try{t.sort(n)}catch(e){return Be(this,fi)}if(0===t.length)return Fe(this);var r=new this.Collection(this,(function(){return He(t[0],t[t.length-1])}));r._ondirectionchange=function(r){n="next"===r?e._ascending:e._descending,t.sort(n)};var o=0;return r._addAlgorithm((function(e,r,i){for(var a=e.key;n(a,t[o])>0;)if(++o===t.length)return r(i),!1;return 0===n(a,t[o])||(r((function(){e.continue(t[o])})),!1)})),r}},{key:"notEqual",value:function(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}},{key:"noneOf",value:function(){var e=N.apply(bo,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return Be(this,fi)}var t=e.reduce((function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[-1/0,t]]}),null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})}},{key:"inAnyRange",value:function(e,t){var n=this,r=function(e,t){return d(e[0],t[0])},o=this._cmp,i=this._ascending,a=this._descending,u=this._min,c=this._max;if(0===e.length)return Fe(this);if(!e.every((function(e){return void 0!==e[0]&&void 0!==e[1]&&i(e[0],e[1])<=0})))return Be(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",ko.InvalidArgument);var s,l=!t||!1!==t.includeLowers,f=t&&!0===t.includeUppers,d=i;try{s=e.reduce((function(e,t){for(var n=0,r=e.length;n<r;++n){var i=e[n];if(o(t[0],i[1])<0&&o(t[1],i[0])>0){i[0]=u(i[0],t[0]),i[1]=c(i[1],t[1]);break}}return n===r&&e.push(t),e}),[]),s.sort(r)}catch(e){return Be(this,fi)}var p=0,h=f?function(e){return i(e,s[p][1])>0}:function(e){return i(e,s[p][1])>=0},y=l?function(e){return a(e,s[p][0])>0}:function(e){return a(e,s[p][0])>=0},v=h,b=new this.Collection(this,(function(){return He(s[0][0],s[s.length-1][1],!l,!f)}));return b._ondirectionchange=function(e){"next"===e?(v=h,d=i):(v=y,d=a),s.sort(r)},b._addAlgorithm((function(e,t,r){for(var o=e.key;v(o);)if(++p===s.length)return t(r),!1;return!!function(e){return!h(e)&&!y(e)}(o)||(0===n._cmp(o,s[p][1])||0===n._cmp(o,s[p][0])||t((function(){d===i?e.continue(s[p][0]):e.continue(s[p][1])})),!1)})),b}},{key:"startsWithAnyOf",value:function(){var e=N.apply(bo,arguments);return e.every((function(e){return"string"==typeof e}))?0===e.length?Fe(this):this.inAnyRange(e.map((function(e){return[e,e+li]}))):Be(this,"startsWithAnyOf() only works with strings")}}]),e}(),_i=je(null,"storagemutated"),Ei=function(){function e(){c(this,e)}return l(e,[{key:"_lock",value:function(){return C(!Yo.global),++this._reculock,1!==this._reculock||Yo.global||(Yo.lockOwnerFor=this),this}},{key:"_unlock",value:function(){if(C(!Yo.global),0==--this._reculock)for(Yo.global||(Yo.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{ge(e[1],e[0])}catch(e){}}return this}},{key:"_locked",value:function(){return this._reculock&&Yo.lockOwnerFor!==this}},{key:"create",value:function(e){var t=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(C(!this.idbtrans),!e&&!n)switch(r&&r.name){case"DatabaseClosedError":throw new ko.DatabaseClosed(r);case"MissingAPIError":throw new ko.MissingAPI(r.message,r);default:throw new ko.OpenFailed(r)}if(!this.active)throw new ko.TransactionInactive;return C(null===this._completion._state),(e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):n.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=le((function(n){qe(n),t._reject(e.error)})),e.onabort=le((function(n){qe(n),t.active&&t._reject(new ko.Abort(e.error)),t.active=!1,t.on("abort").fire(n)})),e.oncomplete=le((function(){t.active=!1,t._resolve(),"mutatedParts"in e&&_i.storagemutated.fire(e.mutatedParts)})),this}},{key:"_promise",value:function(e,t,n){var r=this;if("readwrite"===e&&"readwrite"!==this.mode)return ci(new ko.ReadOnly("Transaction is readonly"));if(!this.active)return ci(new ko.TransactionInactive);if(this._locked())return new J((function(o,i){var a=r;r._blockedFuncs.push([function(){a._promise(e,t,n).then(o,i)},Yo])}));if(n)return fe((function(){var e=r,n=new J((function(n,r){e._lock();var o=t(n,r,e);o&&o.then&&o.then(n,r)}));return n.finally((function(){return e._unlock()})),n._lib=!0,n}));var o=new J((function(e,n){var o=t(e,n,r);o&&o.then&&o.then(e,n)}));return o._lib=!0,o}},{key:"_root",value:function(){return this.parent?this.parent._root():this}},{key:"waitFor",value:function(e){var t=this._root(),n=J.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then((function(){return n}));else{t._waitingFor=n,t._waitingQueue=[];var r=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(r.get(-1/0).onsuccess=e)}()}var o=t._waitingFor;return new J((function(e,r){n.then((function(n){return t._waitingQueue.push(le(e.bind(null,n)))}),(function(e){return t._waitingQueue.push(le(r.bind(null,e)))})).finally((function(){t._waitingFor===o&&(t._waitingFor=null)}))}))}},{key:"abort",value:function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new ko.Abort))}},{key:"table",value:function(e){var t=this._memoizedTables||(this._memoizedTables={});if(O(t,e))return t[e];var n=this.schema[e];if(!n)throw new ko.NotFound("Table "+e+" not part of transaction");var r=new this.db.Table(e,n,this);return r.core=this.db.core.table(e),t[e]=r,r}}]),e}(),xi=function(e){try{return e.only([[]]),xi=function(){return[[]]},[[]]}catch(e){return xi=function(){return li},li}},ji=0,Pi=function(){function e(){c(this,e)}return l(e,[{key:"_parseStoresSpec",value:function(e,t){Jr(e).forEach((function(n){if(null!==e[n]){var r=e[n].split(",").map((function(e,t){var n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return ze(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),Qr(r),0===t)})),o=r.shift();if(o.multi)throw new ko.Schema("Primary key cannot be multi-valued");r.forEach((function(e){if(e.auto)throw new ko.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new ko.Schema("Index must have a name and cannot be an empty string")})),t[n]=Ye(n,o,r)}}))}},{key:"stores",value:function(e){var t=this.db;this._cfg.storesSource=this._cfg.storesSource?w(this._cfg.storesSource,e):e;var n=t._versions,r={},o={};return n.forEach((function(e){w(r,e._cfg.storesSource),o=e._cfg.dbschema={},e._parseStoresSpec(r,o)})),t._dbSchema=o,tt(t,[t._allTables,t,t.Transaction.prototype]),et(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],Jr(o),o),t._storeNames=Jr(o),this}},{key:"upgrade",value:function(e){return this._cfg.contentUpgrade=X(this._cfg.contentUpgrade||H,e),this}}]),e}();function ki(e,t,n,r,o){return J.resolve().then((function(){var i=Yo.transless||Yo,a=e._createTransaction(t,n,e._dbSchema,r),u={trans:a,transless:i};if(r)a.idbtrans=r.idbtrans;else try{a.create(),e._state.PR1398_maxLoop=3}catch(r){return r.name===jo.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((function(){return ki(e,t,n,null,o)}))):ci(r)}var c,s=mo(o);s&&de();var l=J.follow((function(){if(c=o.call(a,a))if(s){var e=pe.bind(null,null);c.then(e,e)}else"function"==typeof c.next&&"function"==typeof c.throw&&(c=dt(c))}),u);return(c&&"function"==typeof c.then?J.resolve(c).then((function(e){return a.active?e:ci(new ko.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))})):l.then((function(){return c}))).then((function(e){return r&&a._resolve(),a._completion.then((function(){return e}))})).catch((function(e){return a._reject(e),ci(e)}))}))}var Ci={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return h(p({},e),{table:function(t){var n=function(t){var n,r,o=t.query.index;return o.isVirtual?h(p({},t),{query:{index:o,range:(n=t.query.range,r=o.keyTail,{type:1===n.type?2:n.type,lower:ht(n.lower,n.lowerOpen?e.MAX_KEY:e.MIN_KEY,r),lowerOpen:!0,upper:ht(n.upper,n.upperOpen?e.MIN_KEY:e.MAX_KEY,r),upperOpen:!0})}}):t},r=e.table(t),o=r.schema,i={},a=[];function u(e,t,n){var r=Je(e),o=i[r]=i[r]||[],c=null==e?0:"string"==typeof e?1:e.length,s=t>0,l=h(p({},n),{isVirtual:s,keyTail:t,keyLength:c,extractKey:Ze(e),unique:!s&&n.unique});return o.push(l),l.isPrimaryKey||a.push(l),c>1&&u(2===c?e[0]:e.slice(0,c-1),t+1,n),o.sort((function(e,t){return e.keyTail-t.keyTail})),l}var c=u(o.primaryKey.keyPath,0,o.primaryKey);i[":id"]=[c];var s=!0,l=!1,f=void 0;try{for(var d,y=o.indexes[Symbol.iterator]();!(s=(d=y.next()).done);s=!0){var v=d.value;u(v.keyPath,0,v)}}catch(e){l=!0,f=e}finally{try{s||null==y.return||y.return()}finally{if(l)throw f}}var b=h(p({},r),{schema:h(p({},o),{primaryKey:c,indexes:a,getIndexByKeyPath:function(e){var t=i[Je(e)];return t&&t[0]}}),count:function(e){return r.count(n(e))},query:function(e){return r.query(n(e))},openCursor:function(t){var o=t.query.index,i=o.keyTail,a=o.isVirtual,u=o.keyLength;return a?r.openCursor(n(t)).then((function(n){return n&&function(n){var r=Object.create(n,{continue:{value:function(r){null!=r?n.continue(ht(r,t.reverse?e.MAX_KEY:e.MIN_KEY,i)):t.unique?n.continue(n.key.slice(0,u).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,i)):n.continue()}},continuePrimaryKey:{value:function(t,r){n.continuePrimaryKey(ht(t,e.MAX_KEY,i),r)}},primaryKey:{get:function(){return n.primaryKey}},key:{get:function(){var e=n.key;return 1===u?e[0]:e.slice(0,u)}},value:{get:function(){return n.value}}});return r}(n)})):r.openCursor(t)}});return b}})}};function Ai(e,t,n,r){return n=n||{},r=r||"",Jr(e).forEach((function(o){if(O(t,o)){var i=e[o],a=t[o];if("object"==typeof i&&"object"==typeof a&&i&&a){var u=R(i);u!==R(a)?n[r+o]=t[o]:"Object"===u?Ai(i,a,n,r+o+"."):i!==a&&(n[r+o]=t[o])}else i!==a&&(n[r+o]=t[o])}else n[r+o]=void 0})),Jr(t).forEach((function(o){O(e,o)||(n[r+o]=t[o])})),n}var Ti={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return h(p({},e),{table:function(t){var n=e.table(t),r=n.schema.primaryKey,o=h(p({},n),{mutate:function(e){var o=function(e){var t=Yo.trans,o=e.keys||function(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}(r,e);if(!o)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?h(p({},e),{keys:o}):p({},e)).type&&(e.values=v(e.values)),e.keys&&(e.keys=v(e.keys)),function(e,t,n){return"add"===t.type?Promise.resolve([]):e.getMany({trans:t.trans,keys:n,cache:"immutable"})}(n,e,o).then((function(i){var a=o.map((function(n,o){var a=i[o],l={onerror:null,onsuccess:null};if("delete"===e.type)u.fire.call(l,n,a,t);else if("add"===e.type||void 0===a){var f=c.fire.call(l,n,e.values[o],t);null==n&&null!=f&&(n=f,e.keys[o]=n,r.outbound||uo(e.values[o],r.keyPath,n))}else{var d=Ai(a,e.values[o]),p=s.fire.call(l,d,n,a,t);if(p){var h=e.values[o];Object.keys(p).forEach((function(e){O(h,e)?h[e]=p[e]:uo(h,e,p[e])}))}}return l}));return n.mutate(e).then((function(t){for(var n=t.failures,r=t.results,u=t.numFailures,c=t.lastResult,s=0;s<o.length;++s){var l=r?r[s]:o[s],f=a[s];null==l?f.onerror&&f.onerror(n[s]):f.onsuccess&&f.onsuccess("put"===e.type&&i[s]?e.values[s]:l)}return{failures:n,results:r,numFailures:u,lastResult:c}})).catch((function(e){return a.forEach((function(t){return t.onerror&&t.onerror(e)})),Promise.reject(e)}))}))},i=Yo.trans,a=i.table(t).hook,u=a.deleting,c=a.creating,s=a.updating;switch(e.type){case"add":if(c.fire===H)break;return i._promise("readwrite",(function(){return o(e)}),!0);case"put":if(c.fire===H&&s.fire===H)break;return i._promise("readwrite",(function(){return o(e)}),!0);case"delete":if(u.fire===H)break;return i._promise("readwrite",(function(){return o(e)}),!0);case"deleteRange":if(u.fire===H)break;return i._promise("readwrite",(function(){return function(e){return l(e.trans,e.range,1e4)}(e)}),!0)}return n.mutate(e);function l(e,t,i){return n.query({trans:e,values:!1,query:{index:r,range:t},limit:i}).then((function(n){var r=n.result;return o({type:"delete",keys:r,trans:e}).then((function(n){return n.numFailures>0?Promise.reject(n.failures[0]):r.length<i?{failures:[],numFailures:0,lastResult:void 0}:l(e,h(p({},t),{lower:r[r.length-1],lowerOpen:!0}),i)}))}))}}});return o}})}},Ii={stack:"dbcore",level:-1,create:function(e){return{table:function(t){var n=e.table(t);return h(p({},n),{getMany:function(e){if(!e.cache)return n.getMany(e);var t=yt(e.keys,e.trans._cache,"clone"===e.cache);return t?J.resolve(t):n.getMany(e).then((function(t){return e.trans._cache={keys:e.keys,values:"clone"===e.cache?M(t):t},t}))},mutate:function(e){return"add"!==e.type&&(e.trans._cache=null),n.mutate(e)}})}}}},Di=function(e,t){if(!this){var n=new Di;return e&&"d"in e&&w(n,e),n}w(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function Mi(e,t,n){var r=gi(t,n);if(!isNaN(r)){if(r>0)throw RangeError();if(vt(e))return w(e,{from:t,to:n,d:1});var o=e.l,i=e.r;if(gi(n,e.from)<0)return o?Mi(o,t,n):e.l={from:t,to:n,d:1,l:null,r:null},gt(e);if(gi(t,e.to)>0)return i?Mi(i,t,n):e.r={from:t,to:n,d:1,l:null,r:null},gt(e);gi(t,e.from)<0&&(e.from=t,e.l=null,e.d=i?i.d+1:1),gi(n,e.to)>0&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1);var a=!e.r;o&&!e.l&&bt(e,o),i&&a&&bt(e,i)}}E(Di.prototype,f({add:function(e){return bt(this,e),this},addKey:function(e){return Mi(this,e,e),this},addKeys:function(e){var t=this;return e.forEach((function(e){return Mi(t,e,e)})),this}},yo,(function(){return mt(this)})));var Ri,Ni={stack:"dbcore",level:0,create:function(e){var t=e.schema.name,n=new Di(e.MIN_KEY,e.MAX_KEY);return h(p({},e),{table:function(r){var o=e.table(r),i=o.schema,a=i.primaryKey,u=a.extractKey,c=a.outbound,s=h(p({},o),{mutate:function(e){var a=e.trans,u=a.mutatedParts||(a.mutatedParts={}),c=function(e){var n="idb://".concat(t,"/").concat(r,"/").concat(e);return u[n]||(u[n]=new Di)},s=c(""),l=c(":dels"),f=e.type,d=y("deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[],2),p=d[0],h=d[1],v=e.trans._cache;return o.mutate(e).then((function(e){if(Qr(p)){"delete"!==f&&(p=e.results),s.addKeys(p);var t=yt(p,v);t||"add"===f||l.addKeys(p),(t||h)&&function(e,t,n,r){t.indexes.forEach((function(t){var o=function(e){return null!=e?t.extractKey(e):null},i=e(t.name||""),a=function(e){return t.multiEntry&&Qr(e)?e.forEach((function(e){return i.addKey(e)})):i.addKey(e)};(n||r).forEach((function(e,t){var i=n&&o(n[t]),u=r&&o(r[t]);0!==gi(i,u)&&(null!=i&&a(i),null!=u&&a(u))}))}))}(c,i,t,h)}else if(p){var r={from:p.lower,to:p.upper};l.add(r),s.add(r)}else s.add(n),l.add(n),i.indexes.forEach((function(e){return c(e.name).add(n)}));return e}))}}),l=function(t){var n,r,o=t.query,i=o.index,a=o.range;return[i,new Di(null!==(n=a.lower)&&void 0!==n?n:e.MIN_KEY,null!==(r=a.upper)&&void 0!==r?r:e.MAX_KEY)]},f={get:function(e){return[a,new Di(e.key)]},getMany:function(e){return[a,(new Di).addKeys(e.keys)]},count:l,query:l,openCursor:l};return Jr(f).forEach((function(e){s[e]=function(i){var a=Yo.subscr;if(a){var s=function(e){var n="idb://".concat(t,"/").concat(r,"/").concat(e);return a[n]||(a[n]=new Di)},l=s(""),d=s(":dels"),v=y(f[e](i),2),b=v[0],m=v[1];if(s(b.name||"").add(m),!b.isPrimaryKey){if("count"!==e){var g="query"===e&&c&&i.values&&o.query(h(p({},i),{values:!1}));return o[e].apply(this,arguments).then((function(t){if("query"===e){if(c&&i.values)return g.then((function(e){var n=e.result;return l.addKeys(n),t}));var n=i.values?t.result.map(u):t.result;i.values?l.addKeys(n):d.addKeys(n)}else if("openCursor"===e){var r=t,o=i.values;return r&&Object.create(r,{key:{get:function(){return d.addKey(r.primaryKey),r.key}},primaryKey:{get:function(){var e=r.primaryKey;return d.addKey(e),e}},value:{get:function(){return o&&l.addKey(r.primaryKey),r.value}}})}return t}))}d.add(n)}}return o[e].apply(this,arguments)}})),s}})}},Li=function(){function e(t,n){var r=this;c(this,e),this._middlewares={},this.verno=0;var o=e.dependencies;this._options=n=p({addons:e.addons,autoOpen:!0,indexedDB:o.indexedDB,IDBKeyRange:o.IDBKeyRange},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange};var i=n.addons;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var a,u={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:H,dbReadyPromise:null,cancelOpen:H,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};u.dbReadyPromise=new J((function(e){u.dbReadyResolve=e})),u.openCanceller=new J((function(e,t){u.cancelOpen=t})),this._state=u,this.name=t,this.on=je(this,"populate","blocked","versionchange","close",{ready:[X,H]}),this.on.ready.subscribe=k(this.on.ready.subscribe,(function(t){return function(n,o){var i=r;e.vip((function(){var e=i._state;if(e.openComplete)e.dbOpenError||J.resolve().then(n),o&&t(n);else if(e.onReadyBeingFired)e.onReadyBeingFired.push(n),o&&t(n);else{t(n);var r=i;o||t((function e(){r.on.ready.unsubscribe(n),r.on.ready.unsubscribe(e)}))}}))}})),this.Collection=(a=this,Pe(wi.prototype,(function(e,t){this.db=a;var n=bi,r=null;if(t)try{n=t()}catch(e){r=e}var o=e._ctx,i=o.table,u=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:u!==$?u:null}}))),this.Table=function(e){return Pe(mi.prototype,(function(t,n,r){this.db=e,this._tx=r,this.name=t,this.schema=n,this.hook=e._allTables[t]?e._allTables[t].hook:je(null,{creating:[z,H],reading:[G,$],updating:[Y,H],deleting:[W,H]})}))}(this),this.Transaction=function(e){return Pe(Ei.prototype,(function(t,n,r,o,i){var a=this;this.db=e,this.mode=t,this.storeNames=n,this.schema=r,this.chromeTransactionDurability=o,this.idbtrans=null,this.on=je(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 J((function(e,t){a._resolve=e,a._reject=t})),this._completion.then((function(){a.active=!1,a.on.complete.fire()}),(function(e){var t=a.active;return a.active=!1,a.on.error.fire(e),a.parent?a.parent._reject(e):t&&a.idbtrans&&a.idbtrans.abort(),ci(e)}))}))}(this),this.Version=function(e){return Pe(Pi.prototype,(function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(e){return Pe(Oi.prototype,(function(t,n,r){this.db=e,this._ctx={table:t,index:":id"===n?null:n,or:r};var o=e._deps.indexedDB;if(!o)throw new ko.MissingAPI;this._cmp=this._ascending=o.cmp.bind(o),this._descending=function(e,t){return o.cmp(t,e)},this._max=function(e,t){return o.cmp(e,t)>0?e:t},this._min=function(e,t){return o.cmp(e,t)<0?e:t},this._IDBKeyRange=e._deps.IDBKeyRange}))}(this),this.on("versionchange",(function(e){e.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(e){!e.newVersion||e.newVersion<e.oldVersion?console.warn("Dexie.delete('".concat(r.name,"') was blocked")):console.warn("Upgrade '".concat(r.name,"' blocked by other connection holding version ").concat(e.oldVersion/10))})),this._maxKey=xi(n.IDBKeyRange),this._createTransaction=function(e,t,n,o){return new r.Transaction(e,t,n,r._options.chromeTransactionDurability,o)},this._fireOnBlocked=function(e){var t=r;r.on("blocked").fire(e),di.filter((function(e){return e.name===t.name&&e!==t&&!e._state.vcFired})).map((function(t){return t.on("versionchange").fire(e)}))},this.use(Ci),this.use(Ti),this.use(Ni),this.use(Ii),this.vip=Object.create(this,{_vip:{value:!0}}),i.forEach((function(e){return e(r)}))}return l(e,[{key:"version",value:function(e){if(isNaN(e)||e<.1)throw new ko.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new ko.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);var t=this._versions,n=t.filter((function(t){return t._cfg.version===e}))[0];return n||(n=new this.Version(e),t.push(n),t.sort(nt),n.stores({}),this._state.autoSchema=!1,n)}},{key:"_whenReady",value:function(e){var t=this;return this.idbdb&&(this._state.openComplete||Yo.letThrough||this._vip)?e():new J((function(e,n){if(t._state.openComplete)return n(new ko.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._options.autoOpen)return void n(new ko.DatabaseClosed);t.open().catch(H)}t._state.dbReadyPromise.then(e,n)})).then(e)}},{key:"use",value:function(e){var t=e.stack,n=e.create,r=e.level,o=e.name;o&&this.unuse({stack:t,name:o});var i=this._middlewares[t]||(this._middlewares[t]=[]);return i.push({stack:t,create:n,level:null==r?10:r,name:o}),i.sort((function(e,t){return e.level-t.level})),this}},{key:"unuse",value:function(e){var t=e.stack,n=e.name,r=e.create;return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter((function(e){return r?e.create!==r:!!n&&e.name!==n}))),this}},{key:"open",value:function(){return function(e){var t=function(){if(n.openCanceller!==o)throw new ko.DatabaseClosed("db.open() was cancelled")},n=e._state,r=e._deps.indexedDB;if(n.isBeingOpened||e.idbdb)return n.dbReadyPromise.then((function(){return n.dbOpenError?ci(n.dbOpenError):e}));go&&(n.openCanceller._stackHolder=Oo()),n.isBeingOpened=!0,n.dbOpenError=null,n.openComplete=!1;var o=n.openCanceller,i=n.dbReadyResolve,a=null,u=!1;return J.race([o,("undefined"==typeof navigator?J.resolve():ft()).then((function(){return new J((function(o,i){if(t(),!r)throw new ko.MissingAPI;var c=e.name,s=n.autoSchema?r.open(c):r.open(c,Math.round(10*e.verno));if(!s)throw new ko.MissingAPI;s.onerror=Ge(i),s.onblocked=le(e._fireOnBlocked),s.onupgradeneeded=le((function(t){if(a=s.transaction,n.autoSchema&&!e._options.allowEmptyDB){s.onerror=qe,a.abort(),s.result.close();var o=r.deleteDatabase(c);o.onsuccess=o.onerror=le((function(){i(new ko.NoSuchDatabase("Database ".concat(c," doesnt exist")))}))}else{a.onerror=Ge(i);var l=t.oldVersion>Math.pow(2,62)?0:t.oldVersion;u=l<1,e._novip.idbdb=s.result,function(e,t,n,r){var o=e._dbSchema,i=e._createTransaction("readwrite",e._storeNames,o);i.create(n),i._completion.catch(r);var a=i._reject.bind(i),u=Yo.transless||Yo;fe((function(){Yo.trans=i,Yo.transless=u,0===t?(Jr(o).forEach((function(e){ot(n,e,o[e].primKey,o[e].indexes)})),Qe(e,n),J.follow((function(){return e.on.populate.fire(i)})).catch(a)):function(e,t,n,r){var o=e._novip,i=[],a=o._versions,u=o._dbSchema=at(0,o.idbdb,r),c=!1;return a.filter((function(e){return e._cfg.version>=t})).forEach((function(e){i.push((function(){var i=u,a=e._cfg.dbschema;ut(o,i,r),ut(o,a,r),u=o._dbSchema=a;var s=rt(i,a);s.add.forEach((function(e){ot(r,e[0],e[1].primKey,e[1].indexes)})),s.change.forEach((function(e){if(e.recreate)throw new ko.Upgrade("Not yet support for changing primary key");var t=r.objectStore(e.name);e.add.forEach((function(e){return it(t,e)})),e.change.forEach((function(e){t.deleteIndex(e.name),it(t,e)})),e.del.forEach((function(e){return t.deleteIndex(e)}))}));var l=e._cfg.contentUpgrade;if(l&&e._cfg.version>t){Qe(o,r),n._memoizedTables={},c=!0;var f=I(a);s.del.forEach((function(e){f[e]=i[e]})),tt(o,[o.Transaction.prototype]),et(o,[o.Transaction.prototype],Jr(f),f),n.schema=f;var d,p=mo(l);p&&de();var h=J.follow((function(){if((d=l(n))&&p){var e=pe.bind(null,null);d.then(e,e)}}));return d&&"function"==typeof d.then?J.resolve(d):h.then((function(){return d}))}})),i.push((function(t){c&&hi||function(e,t){[].slice.call(t.db.objectStoreNames).forEach((function(n){return null==e[n]&&t.db.deleteObjectStore(n)}))}(e._cfg.dbschema,t),tt(o,[o.Transaction.prototype]),et(o,[o.Transaction.prototype],o._storeNames,o._dbSchema),n.schema=o._dbSchema}))})),function e(){return i.length?J.resolve(i.shift()(n.idbtrans)).then(e):J.resolve()}().then((function(){var e,t;t=r,Jr(e=u).forEach((function(n){t.db.objectStoreNames.contains(n)||ot(t,n,e[n].primKey,e[n].indexes)}))}))}(e,t,i,n).catch(a)}))}(e,l/10,a,i)}}),i),s.onsuccess=le((function(){a=null;var t,r=e._novip.idbdb=s.result,i=P(r.objectStoreNames);if(i.length>0)try{var l=r.transaction(1===(t=i).length?t[0]:t,"readonly");n.autoSchema?function(e,t,n){var r=e._novip;r.verno=t.version/10;var o=r._dbSchema=at(0,t,n);r._storeNames=P(t.objectStoreNames,0),et(r,[r._allTables],Jr(o),o)}(e,r,l):(ut(e,e._dbSchema,l),function(e,t){var n=rt(at(0,e.idbdb,t),e._dbSchema);return!(n.add.length||n.change.some((function(e){return e.add.length||e.change.length})))}(e,l)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),Qe(e,l)}catch(e){}di.push(e),r.onversionchange=le((function(t){n.vcFired=!0,e.on("versionchange").fire(t)})),r.onclose=le((function(t){e.on("close").fire(t)})),u&&function(e,t){var n=e.indexedDB,r=e.IDBKeyRange;!st(n)&&"__dbnames"!==t&&ct(n,r).put({name:t}).catch(H)}(e._deps,c),o()}),i)}))}))]).then((function(){return t(),n.onReadyBeingFired=[],J.resolve(lt((function(){return e.on.ready.fire(e.vip)}))).then((function t(){if(n.onReadyBeingFired.length>0){var r=n.onReadyBeingFired.reduce(X,H);return n.onReadyBeingFired=[],J.resolve(lt((function(){return r(e.vip)}))).then(t)}}))})).finally((function(){n.onReadyBeingFired=null,n.isBeingOpened=!1})).then((function(){return e})).catch((function(t){n.dbOpenError=t;try{a&&a.abort()}catch(e){}return o===n.openCanceller&&e._close(),ci(t)})).finally((function(){n.openComplete=!0,i()}))}(this)}},{key:"_close",value:function(){var e=this._state,t=di.indexOf(this);if(t>=0&&di.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new J((function(t){e.dbReadyResolve=t})),e.openCanceller=new J((function(t,n){e.cancelOpen=n}))}},{key:"close",value:function(){this._close();var e=this._state;this._options.autoOpen=!1,e.dbOpenError=new ko.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)}},{key:"delete",value:function(){var e=this,t=arguments.length>0,n=this._state;return new J((function(r,o){var i=e,a=function(){var e=i;i.close();var t=i._deps.indexedDB.deleteDatabase(i.name);t.onsuccess=le((function(){!function(e,t){var n=e.indexedDB,r=e.IDBKeyRange;!st(n)&&"__dbnames"!==t&&ct(n,r).delete(t).catch(H)}(e._deps,e.name),r()})),t.onerror=Ge(o),t.onblocked=i._fireOnBlocked};if(t)throw new ko.InvalidArgument("Arguments not allowed in db.delete()");n.isBeingOpened?n.dbReadyPromise.then(a):a()}))}},{key:"backendDB",value:function(){return this.idbdb}},{key:"isOpen",value:function(){return null!==this.idbdb}},{key:"hasBeenClosed",value:function(){var e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name}},{key:"hasFailed",value:function(){return null!==this._state.dbOpenError}},{key:"dynamicallyOpened",value:function(){return this._state.autoSchema}},{key:"tables",get:function(){var e=this;return Jr(this._allTables).map((function(t){return e._allTables[t]}))}},{key:"transaction",value:function(){var e=pt.apply(this,arguments);return this._transaction.apply(this,e)}},{key:"_transaction",value:function(e,t,n){var r=this,o=Yo.trans;o&&o.db===this&&-1===e.indexOf("!")||(o=null);var i,a,u=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{var c=this;if(a=t.map((function(e){var t=d(e,c.Table)?e.name:e;if("string"!=typeof t)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t})),"r"==e||"readonly"===e)i="readonly";else{if("rw"!=e&&"readwrite"!=e)throw new ko.InvalidArgument("Invalid transaction mode: "+e);i="readwrite"}if(o){if("readonly"===o.mode&&"readwrite"===i){if(!u)throw new ko.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");o=null}o&&a.forEach((function(e){if(o&&-1===o.storeNames.indexOf(e)){if(!u)throw new ko.SubTransaction("Table "+e+" not included in parent transaction.");o=null}})),u&&o&&!o.active&&(o=null)}}catch(e){return o?o._promise(null,(function(t,n){n(e)})):ci(e)}var s=ki.bind(null,this,i,a,o,n);return o?o._promise(i,s,"lock"):Yo.trans?ge(Yo.transless,(function(){return r._whenReady(s)})):this._whenReady(s)}},{key:"table",value:function(e){if(!O(this._allTables,e))throw new ko.InvalidTable("Table ".concat(e," does not exist"));return this._allTables[e]}}]),e}(),Ui="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable",Bi=function(){function e(t){c(this,e),this._subscribe=t}return l(e,[{key:"subscribe",value:function(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})}},{key:Ui,value:function(){return this}}]),e}();try{Ri={indexedDB:Xr.indexedDB||Xr.mozIndexedDB||Xr.webkitIndexedDB||Xr.msIndexedDB,IDBKeyRange:Xr.IDBKeyRange||Xr.webkitIDBKeyRange}}catch(e){Ri={indexedDB:null,IDBKeyRange:null}}var Fi=Li;E(Fi,h(p({},Ao),{delete:function(e){return new Fi(e,{addons:[]}).delete()},exists:function(e){return new Fi(e,{addons:[]}).open().then((function(e){return e.close(),!0})).catch("NoSuchDatabaseError",(function(){return!1}))},getDatabaseNames:function(e){try{return function(e){var t=e.indexedDB,n=e.IDBKeyRange;return st(t)?Promise.resolve(t.databases()).then((function(e){return e.map((function(e){return e.name})).filter((function(e){return"__dbnames"!==e}))})):ct(t,n).toCollection().primaryKeys()}(Fi.dependencies).then(e)}catch(e){return ci(new ko.MissingAPI)}},defineClass:function(){return function(e){w(this,e)}},ignoreTransaction:function(e){return Yo.trans?ge(Yo.transless,e):e()},vip:lt,async:function(e){return function(){try{var t=dt(e.apply(this,arguments));return t&&"function"==typeof t.then?t:J.resolve(t)}catch(e){return ci(e)}}},spawn:function(e,t,n){try{var r=dt(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:J.resolve(r)}catch(e){return ci(e)}},currentTransaction:{get:function(){return Yo.trans||null}},waitFor:function(e,t){var n=J.resolve("function"==typeof e?Fi.ignoreTransaction(e):e).timeout(t||6e4);return Yo.trans?Yo.trans.waitFor(n):n},Promise:J,debug:{get:function(){return go},set:function(e){L(e,"dexie"===e?function(){return!0}:vi)}},derive:j,extend:w,props:E,override:k,Events:je,on:_i,liveQuery:function(e){return new Bi((function(t){var n=function(){return Jr(a).some((function(e){return i[e]&&function(e,t){var n=mt(t),r=n.next();if(r.done)return!1;for(var o=r.value,i=mt(e),a=i.next(o.from),u=a.value;!r.done&&!a.done;){if(gi(u.from,o.to)<=0&&gi(u.to,o.from)>=0)return!0;gi(o.from,u.from)<0?o=(r=n.next(u.from)).value:u=(a=i.next(o.from)).value}return!1}(i[e],a[e])}))},r=mo(e),o=!1,i={},a={},u={get closed(){return o},unsubscribe:function(){o=!0,_i.storagemutated.unsubscribe(l)}};t.start&&t.start(u);var c=!1,s=!1,l=function(e){St(i,e),n()&&f()},f=function(){if(!c&&!o){i={};var d={},p=function(t){r&&de();var n=function(){return fe(e,{subscr:t,trans:null})},o=Yo.trans?ge(Yo.transless,n):n();return r&&o.then(pe,pe),o}(d);s||(_i("storagemutated",l),s=!0),c=!0,Promise.resolve(p).then((function(e){c=!1,o||(n()?f():(i={},a=d,t.next&&t.next(e)))}),(function(e){c=!1,t.error&&t.error(e),u.unsubscribe()}))}};return f(),u}))},extendObservabilitySet:St,getByKeyPath:ao,setByKeyPath:uo,delByKeyPath:function(e,t){"string"==typeof t?uo(e,t,void 0):"length"in t&&[].map.call(t,(function(t){uo(e,t,void 0)}))},shallowClone:I,deepClone:M,getObjectDiff:Ai,cmp:gi,asap:A,minKey:-1/0,addons:[],connections:di,errnames:jo,dependencies:Ri,semVer:"3.2.3",version:"3.2.3".split(".").map((function(e){return parseInt(e)})).reduce((function(e,t,n){return e+t/Math.pow(10,2*n)}))})),Fi.maxKey=xi(Fi.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(_i("storagemutated",(function(e){var t;Vi||(pi?(t=document.createEvent("CustomEvent")).initCustomEvent("x-storagemutated-1",!0,!0,e):t=new CustomEvent("x-storagemutated-1",{detail:e}),Vi=!0,dispatchEvent(t),Vi=!1)})),addEventListener("x-storagemutated-1",(function(e){var t=e.detail;Vi||Ot(t)})));var Vi=!1;if("undefined"!=typeof BroadcastChannel){var Ki=new BroadcastChannel("x-storagemutated-1");"function"==typeof Ki.unref&&Ki.unref(),_i("storagemutated",(function(e){Vi||Ki.postMessage(e)})),Ki.onmessage=function(e){e.data&&Ot(e.data)}}else if("undefined"!=typeof self&&"undefined"!=typeof navigator){_i("storagemutated",(function(e){try{Vi||("undefined"!=typeof localStorage&&localStorage.setItem("x-storagemutated-1",JSON.stringify({trig:Math.random(),changedParts:e})),"object"==typeof self.clients&&v(self.clients.matchAll({includeUncontrolled:!0})).forEach((function(t){return t.postMessage({type:"x-storagemutated-1",changedParts:e})})))}catch(e){}})),"undefined"!=typeof addEventListener&&addEventListener("storage",(function(e){if("x-storagemutated-1"===e.key){var t=JSON.parse(e.newValue);t&&Ot(t.changedParts)}}));var Hi=self.document&&navigator.serviceWorker;Hi&&Hi.addEventListener("message",(function(e){var t=e.data;t&&"x-storagemutated-1"===t.type&&Ot(t.changedParts)}))}J.rejectionMapper=function(e,t){if(!e||d(e,B)||d(e,TypeError)||d(e,SyntaxError)||!e.name||!Co[e.name])return e;var n=new Co[e.name](t||e.message,e);return"stack"in e&&x(n,"stack",{get:function(){return this.inner.stack}}),n},L(go,vi);var $i=S(641);function Gi(e){return Gi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Gi(e)}function qi(e,t){return qi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},qi(e,t)}new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&qi(e,t)}(n,e);var t=function(e){var t=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(e){return!1}}();return function(){var n,r=Gi(e);if(t){var o=Gi(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!=((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":void 0===n?"undefined":b(n))&&"function"!=typeof t?_t(e):t;var n}(this,n)}}(n);function n(){var e;return function(e,t){if(!d(e,t))throw new TypeError("Cannot call a class as a function")}(this,n),Et(_t(e=t.call(this,"EsmOffline")),"syncQueue",void 0),Et(_t(e),"dynamicOfflineData",void 0),e.version(4).stores({syncQueue:"++id,userId,type,[userId+type]",dynamicOfflineData:"++id,type,identifier,*users,&[type+identifier]"}),e.syncQueue=e.table("syncQueue"),e.dynamicOfflineData=e.table("dynamicOfflineData"),e}return n}(Li)),(0,zr.createGlobalStore)("offline-synchronization",{}),(0,zr.createGlobalStore)("offline-patients",{offlinePatientDataSyncState:{},handlers:{}});var zi,Wi,Yi,Zi=function(){try{return JSON.parse(localStorage.getItem("openmrs:visitStoreState")||"null")}catch(e){return null}}()||{patientUuid:null,manuallySetVisitUuid:null};(0,zr.getGlobalStore)("visit",Zi).subscribe((function(e){var t;t=e,localStorage.setItem("openmrs:visitStoreState",JSON.stringify(t))})),new Kr.BehaviorSubject(null),function(e){e.NEWVISIT="startVisit",e.EDITVISIT="editVisit",e.LOADING="loadingVisit"}(zi||(zi={})),function(e){e.NOTSTARTED="notStarted",e.ONGOING="ongoing"}(Wi||(Wi={})),S(66),function(e){e.Array="Array",e.Boolean="Boolean",e.ConceptUuid="ConceptUuid",e.Number="Number",e.Object="Object",e.String="String",e.UUID="UUID",e.PersonAttributeTypeUuid="PersonAttributeTypeUuid",e.PatientIdentifierTypeUuid="PatientIdentifierTypeUuid"}(Yi||(Yi={}));var Xi=Object.freeze({__proto__:null,get start(){return jn},get ensureJQuerySupport(){return cn},get setBootstrapMaxTime(){return Yt},get setMountMaxTime(){return Zt},get setUnmountMaxTime(){return Xt},get setUnloadMaxTime(){return Jt},get registerApplication(){return bn},get unregisterApplication(){return gn},get getMountedApps(){return hn},get getAppStatus(){return vn},get unloadApplication(){return wn},get checkActivityFunctions(){return mn},get getAppNames(){return yn},get pathToActiveWhen(){return _n},get navigateToUrl(){return nn},get triggerAppChange(){return En},get addErrorHandler(){return kt},get removeErrorHandler(){return Ct},get mountRootParcel(){return Gt},get NOT_LOADED(){return ra},get LOADING_SOURCE_CODE(){return oa},get NOT_BOOTSTRAPPED(){return ia},get BOOTSTRAPPING(){return aa},get NOT_MOUNTED(){return ua},get MOUNTING(){return ca},get UPDATING(){return la},get LOAD_ERROR(){return da},get MOUNTED(){return sa},get UNMOUNTING(){return fa},get SKIP_BECAUSE_BROKEN(){return pa}});function Ji(e){return(Ji="function"==typeof Symbol&&"symbol"==xt(Symbol.iterator)?function(e){return void 0===e?"undefined":xt(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":xt(e)})(e)}var Qi,ea=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==S.g?S.g:"undefined"!=typeof self?self:{}).CustomEvent,ta=function(){try{var e=new ea("cat",{detail:{foo:"bar"}});return"cat"===e.type&&"bar"===e.detail.foo}catch(e){}return!1}()?ea:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(e,t){var n=document.createEvent("CustomEvent");return t?n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):n.initCustomEvent(e,!1,!1,void 0),n}:function(e,t){var n=document.createEventObject();return n.type=e,t?(n.bubbles=Boolean(t.bubbles),n.cancelable=Boolean(t.cancelable),n.detail=t.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n},na=[],ra="NOT_LOADED",oa="LOADING_SOURCE_CODE",ia="NOT_BOOTSTRAPPED",aa="BOOTSTRAPPING",ua="NOT_MOUNTED",ca="MOUNTING",sa="MOUNTED",la="UPDATING",fa="UNMOUNTING",da="LOAD_ERROR",pa="SKIP_BECAUSE_BROKEN",ha=!1,ya=!1,va=0,ba={parcels:{}},ma={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}},ga="undefined"!=typeof window,wa={hashchange:[],popstate:[]},Sa=["hashchange","popstate"];if(ga){window.addEventListener("hashchange",on),window.addEventListener("popstate",on);var Oa=window.addEventListener,_a=window.removeEventListener;window.addEventListener=function(e,t){if(!("function"==typeof t&&Sa.indexOf(e)>=0)||Ut(wa[e],(function(e){return e===t})))return Oa.apply(this,arguments);wa[e].push(t)},window.removeEventListener=function(e,t){if(!("function"==typeof t&&Sa.indexOf(e)>=0))return _a.apply(this,arguments);wa[e]=wa[e].filter((function(e){return e!==t}))},window.history.pushState=an(window.history.pushState,"pushState"),window.history.replaceState=an(window.history.replaceState,"replaceState"),window.singleSpaNavigate?console.warn(At(41,!1)):window.singleSpaNavigate=nn}var Ea=!1,xa={},ja=[],Pa=!1,ka=[],Ca=ga&&window.location.href;function Aa(){var e=function(){d=!0},t=function(){var e=hn();o.forEach((function(t){return t.resolve(e)}));try{var t=0===a.length?"single-spa:no-app-change":"single-spa:app-change";window.dispatchEvent(new ta(t,r())),window.dispatchEvent(new ta("single-spa:routing-event",r()))}catch(e){setTimeout((function(){throw e}))}if(Pa=!1,ka.length>0){var n=ka;ka=[],Aa(n)}return e},n=function(){o.forEach((function(e){rn(e.eventArguments)})),rn(i)},r=function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1?arguments[1]:void 0,r={},o=(jt(e={},sa,[]),jt(e,ua,[]),jt(e,ra,[]),jt(e,pa,[]),e);t?(l.concat(f).forEach((function(e,t){y(e,sa)})),c.forEach((function(e){y(e,ra)})),s.forEach((function(e){y(e,ua)}))):a.forEach((function(e){y(e)}));var u={detail:{newAppStatuses:r,appsByNewStatus:o,totalAppChanges:a.length,originalEvent:null==i?void 0:i[0],oldUrl:p,newUrl:h,navigationIsCanceled:d}};return n&&Lt(u.detail,n),u;function y(e,t){var n=Mt(e);t=t||vn(n),r[n]=t,(o[t]=o[t]||[]).push(n)}},o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1?arguments[1]:void 0;if(Pa)return new Promise((function(e,t){ka.push({resolve:e,reject:t,eventArguments:i})}));var a,u=function(){var e=[],t=[],n=[],r=[],o=(new Date).getTime();return ja.forEach((function(i){var a=i.status!==pa&&Dt(i);switch(i.status){case da:a&&o-i.loadErrorTime>=200&&n.push(i);break;case ra:case oa:a&&n.push(i);break;case ia:case ua:!a&&pn(Mt(i))?e.push(i):a&&r.push(i);break;case sa:a||t.push(i)}})),{appsToUnload:e,appsToUnmount:t,appsToLoad:n,appsToMount:r}}(),c=u.appsToUnload,s=u.appsToUnmount,l=u.appsToLoad,f=u.appsToMount,d=!1,p=Ca,h=Ca=window.location.href;return Pn()?(Pa=!0,a=c.concat(l,s,f),Promise.resolve().then((function(){if(window.dispatchEvent(new ta(0===a.length?"single-spa:before-no-app-change":"single-spa:before-app-change",r(!0))),window.dispatchEvent(new ta("single-spa:before-routing-event",r(!0,{cancelNavigation:e}))),d)return window.dispatchEvent(new ta("single-spa:before-mount-routing-event",r(!0))),t(),void nn(p);var i=c.map(ln),u=s.map(Ht).map((function(e){return e.then(ln)})).concat(i),h=Promise.all(u);h.then((function(){window.dispatchEvent(new ta("single-spa:before-mount-routing-event",r(!0)))}));var y=l.map((function(e){return tn(e).then((function(e){return xn(e,h)}))})),v=f.filter((function(e){return l.indexOf(e)<0})).map((function(e){return xn(e,h)}));return h.catch((function(e){throw n(),e})).then((function(){return n(),Promise.all(y.concat(v)).catch((function(e){throw o.forEach((function(t){return t.reject(e)})),e})).then(t)}))}))):(a=l,Promise.resolve().then((function(){var e=l.map(tn);return Promise.all(e).then(n).then((function(){return[]})).catch((function(e){throw n(),e}))})))}var Ta=!1;ga&&setTimeout((function(){Ta||console.warn(At(1,!1))}),5e3);var Ia,Da={getRawAppData:function(){return[].concat(ja)},reroute:Aa,NOT_LOADED:ra,toLoadPromise:tn,toBootstrapPromise:Kt,unregisterApplication:gn};ga&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Da),kn((function(e){if(!e||"string"!=typeof e)return!1;for(var t=/\${(.*?)}/g,n=t.exec(e);n;){if(!Ia.includes(n[1]))return!1;n=t.exec(e)}return!0}),"Should be a URL or path. The allowed template parameters are "+(Ia=[].concat(["openmrsBase","openmrsSpaBase"])).map((function(e){return"${"+e+"}"})).join(", "));var Ma="function"==typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},Ra=Object.prototype.toString,Na=function(){return"[object Arguments]"===Ra.call(arguments)?function(e){return"[object Arguments]"===Ra.call(e)}:function(e){return Mn("callee",e)}}(),La=Na,Ua=!{toString:null}.propertyIsEnumerable("toString"),Ba=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],Fa=function(){return arguments.propertyIsEnumerable("length")}(),Va=function(e,t){for(var n=0;n<e.length;){if(e[n]===t)return!0;n+=1}return!1},Ka="function"!=typeof Object.keys||Fa?An((function(e){if(Object(e)!==e)return[];var t,n,r=[],o=Fa&&La(e);for(t in e)!Mn(t,e)||o&&"length"===t||(r[r.length]=t);if(Ua)for(n=Ba.length-1;n>=0;)Mn(t=Ba[n],e)&&!Va(r,t)&&(r[r.length]=t),n-=1;return r})):An((function(e){return Object(e)!==e?[]:Object.keys(e)})),Ha=An((function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}));function $a(e,t,n,r){if(Ma(e,t))return!0;var o=Ha(e);if(o!==Ha(t))return!1;if(null==e||null==t)return!1;if("function"==typeof e["fantasy-land/equals"]||"function"==typeof t["fantasy-land/equals"])return"function"==typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](t)&&"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](e);if("function"==typeof e.equals||"function"==typeof t.equals)return"function"==typeof e.equals&&e.equals(t)&&"function"==typeof t.equals&&t.equals(e);switch(o){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===function(e){var t=String(e).match(/^function (\w*)/);return null==t?"":t[1]}(e.constructor))return e===t;break;case"Boolean":case"Number":case"String":if((void 0===e?"undefined":Rn(e))!==(void 0===t?"undefined":Rn(t))||!Ma(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!Ma(e.valueOf(),t.valueOf()))return!1;break;case"Error":return e.name===t.name&&e.message===t.message;case"RegExp":if(e.source!==t.source||e.global!==t.global||e.ignoreCase!==t.ignoreCase||e.multiline!==t.multiline||e.sticky!==t.sticky||e.unicode!==t.unicode)return!1}for(var i=n.length-1;i>=0;){if(n[i]===e)return r[i]===t;i-=1}switch(o){case"Map":return e.size===t.size&&Nn(e.entries(),t.entries(),n.concat([e]),r.concat([t]));case"Set":return e.size===t.size&&Nn(e.values(),t.values(),n.concat([e]),r.concat([t]));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 a=Ka(e);if(a.length!==Ka(t).length)return!1;var u=n.concat([e]),c=r.concat([t]);for(i=a.length-1;i>=0;){var s=a[i];if(!Mn(s,t)||!$a(t[s],e[s],u,c))return!1;i-=1}return!0}var Ga=Tn((function(e,t){return $a(e,t,[],[])})),qa=Ga,za=Ln((function(e,t,n){var r,o={};for(r in t)Mn(r,t)&&(o[r]=Mn(r,n)?e(r,t[r],n[r]):t[r]);for(r in n)Mn(r,n)&&!Mn(r,o)&&(o[r]=n[r]);return o})),Wa=za,Ya=Ln((function e(t,n,r){return Wa((function(n,r,o){return Un(r)&&Un(o)?e(t,r,o):t(n,r,o)}),n,r)})),Za=Ya,Xa=Tn((function(e,t){return Za((function(e,t,n){return n}),e,t)}));function Ja(e,t,n,r){var o,i=function(o){for(var i=t.length,a=0;a<i;){if(e===t[a])return n[a];a+=1}for(var u in t[a+1]=e,n[a+1]=o,e)o[u]=r?Ja(e[u],t,n,!0):e[u];return o};switch(Ha(e)){case"Object":return i({});case"Array":return i([]);case"Date":return new Date(e.valueOf());case"RegExp":return o=e,new RegExp(o.source,(o.global?"g":"")+(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.sticky?"y":"")+(o.unicode?"u":""));default:return e}}var Qa=An((function(e){return null!=e&&"function"==typeof e.clone?e.clone():Ja(e,[],[],!0)})),eu=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)},tu=An((function(e){return!!eu(e)||!!e&&"object"==typeof e&&!function(e){return"[object String]"===Object.prototype.toString.call(e)}(e)&&(1===e.nodeType?!!e.length:0===e.length||e.length>0&&e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1))})),nu=tu,ru=function(){var e=function(e){this.f=e};return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(e){return e},e.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},e}(),ou=Tn((function(e,t){return function(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,n){return t.apply(this,arguments)};case 3:return function(e,n,r){return t.apply(this,arguments)};case 4:return function(e,n,r,o){return t.apply(this,arguments)};case 5:return function(e,n,r,o,i){return t.apply(this,arguments)};case 6:return function(e,n,r,o,i,a){return t.apply(this,arguments)};case 7:return function(e,n,r,o,i,a,u){return t.apply(this,arguments)};case 8:return function(e,n,r,o,i,a,u,c){return t.apply(this,arguments)};case 9:return function(e,n,r,o,i,a,u,c,s){return t.apply(this,arguments)};case 10:return function(e,n,r,o,i,a,u,c,s,l){return t.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}(e.length,(function(){return e.apply(t,arguments)}))})),iu=ou,au="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",uu=Ln((function(e,t,n){if("function"==typeof e&&(e=function(e){return new ru(e)}(e)),nu(n))return function(e,t,n){for(var r=0,o=n.length;r<o;){if((t=e["@@transducer/step"](t,n[r]))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}r+=1}return e["@@transducer/result"](t)}(e,t,n);if("function"==typeof n["fantasy-land/reduce"])return Fn(e,t,n,"fantasy-land/reduce");if(null!=n[au])return Bn(e,t,n[au]());if("function"==typeof n.next)return Bn(e,t,n);if("function"==typeof n.reduce)return Fn(e,t,n,"reduce");throw new TypeError("reduce: list must be array or iterable")})),cu=kn((function(e){return Array.isArray(e)}),"must be an array"),su=kn((function(e){return"boolean"==typeof e}),"must be a boolean"),lu=kn((function(e){return"number"==typeof e}),"must be a number"),fu=kn((function(e){return"string"==typeof e}),"must be a string"),du=kn((function(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}),"must be an object (not an array or null)"),pu=kn((function(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)||/^[0-9a-f]{36}$/i.test(e)}),"must be a valid UUID or a 36-character hexadecimal string"),hu=(0,zr.createGlobalStore)("config-internal",{providedConfigs:[],schemas:{}}),yu=(0,zr.createGlobalStore)("temporary-config",{config:function(){try{return JSON.parse(localStorage.getItem("openmrs:temporaryConfig")||"{}")}catch(e){return{}}}()});yu.subscribe((function(e){var t;t=e.config,localStorage.setItem("openmrs:temporaryConfig",JSON.stringify(t))}));var vu=(0,zr.createGlobalStore)("config-store-of-extension-state",{mountedExtensions:[]}),bu=(0,zr.createGlobalStore)("config-implementer-tools",{config:{}});function mu(e){return e.hasOwnProperty("_default")?Gn($n({},e),{_value:e._default,_source:"default"}):sr(e)?Object.keys(e).reduce((function(t,n){return t[n]=mu(e[n]),t}),{}):{}}function gu(e,t){return sr(e)?Object.keys(e).reduce((function(n,r){return n[r]=gu(e[r],t),n}),{}):{_value:e,_source:t}}function wu(e,t){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,c=function(){var o=u.value,i=n+(n&&".")+o,a=t[o];if("Display conditions"===i&&console.error("".concat(e,' declares a configuration option called "Display conditions"; the "Display conditions" option is a reserved name. ').concat(r)),"Translation overrides"===i&&console.error("".concat(e,' declares a configuration option called "Translation overrides"; the "Translation overrides" option is a reserved name. ').concat(r)),!sr(a))return console.error("".concat(e," has bad config schema definition for key '").concat(i,"'. ").concat(r)),"continue";a.hasOwnProperty("_default")||wu(e,a,i);var c=a._elements;if(cr(c)&&wu(e,c,i+"._elements"),a._validators){var s=!0,l=!1,f=void 0;try{for(var d,p=a._validators[Symbol.iterator]();!(s=(d=p.next()).done);s=!0){var h=d.value;"function"!=typeof h&&console.error("".concat(e," 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(h,"."))}}catch(e){l=!0,f=e}finally{try{s||null==p.return||p.return()}finally{if(l)throw f}}}var y=a._type;y&&!Object.values(Yi).includes(y)&&console.error("".concat(e," has invalid type for key '").concat(i,"' ").concat(r,".")+"\n\nIf you're the maintainer: the allowed types are ".concat(Object.values(Yi).join(", "),". ")+"Received '".concat(y,"'")),Object.keys(a).every((function(e){return["_description","_validators","_elements","_type"].includes(e)}))&&!n.includes("._elements")&&console.error("".concat(e," 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))),c&&y&&![Yi.Array,Yi.Object].includes(y)&&console.error("".concat(e," 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(y)))},s=Object.keys(t).filter((function(e){return!e.startsWith("_")}))[Symbol.iterator]();!(o=(u=s.next()).done);o=!0)c()}catch(e){i=!0,a=e}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}}function Su(e,t,n){ar(n,e._type,t),sr(t)?e._type===Yi.Object?function(e,t,n){if(e._elements){var 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 c=a.value,s=t[c];ir(e._elements,s,"".concat(n,".").concat(c))}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}}(e,t,n):e.hasOwnProperty("_default")||ir(e,t,n):e._type===Yi.Array&&function(e,t,n){if(cr(e._elements))for(var r=0;r<t.length;r++)Su(e._elements,t[r],"".concat(n,"[").concat(r,"]"));for(var o=0;o<t.length;o++){var i;ar("".concat(n,"[").concat(o,"]"),null===(i=e._elements)||void 0===i?void 0:i._type,t[o])}}(e,t,n)}function Ou(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(e)if(t!==e._default&&ur(n,e._validators,t),sr(t)){var 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 c=a.value,s=t[c],l=n+"."+c,f=e[c];e._type===Yi.Object&&e._elements?Ou(e._elements,s,l):Ou(f,s,l)}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}else if(Array.isArray(t)&&e._elements)for(var d=0;d<t.length;d++)Ou(e._elements,t[d],"".concat(n,"[").concat(d,"]"))}Yn(hu.getState(),yu.getState()),hu.subscribe((function(e){return Yn(e,yu.getState())})),yu.subscribe((function(e){return Yn(hu.getState(),e)})),Xn(hu.getState(),yu.getState()),hu.subscribe((function(e){return Xn(e,yu.getState())})),yu.subscribe((function(e){return Xn(hu.getState(),e)})),Zn(hu.getState(),yu.getState()),hu.subscribe((function(e){return Zn(e,yu.getState())})),yu.subscribe((function(e){return Zn(hu.getState(),e)})),Jn(hu.getState(),vu.getState(),yu.getState()),hu.subscribe((function(e){Jn(e,vu.getState(),yu.getState())})),vu.subscribe((function(e){Jn(hu.getState(),e,yu.getState())})),yu.subscribe((function(e){Jn(hu.getState(),vu.getState(),e)}));var _u=function(e,t){var n=Qa(t);if(!e)return n;var r=!0,o=!1,i=void 0;try{for(var a,u=function(){var t=a.value,r=n[t],o=e[t];if(o&&o.hasOwnProperty("_default")){n.hasOwnProperty(t)||(n[t]=o._default);var i=o._elements;if(r&&cr(i))if(o._type===Yi.Array&&Array.isArray(r)){var u=r.map((function(e){return _u(i,e)}));n[t]=u}else if(o._type===Yi.Object){var c=!0,s=!1,l=void 0;try{for(var f,d=Object.keys(r)[Symbol.iterator]();!(c=(f=d.next()).done);c=!0){var p=f.value;r[p]=_u(i,r[p])}}catch(e){s=!0,l=e}finally{try{c||null==d.return||d.return()}finally{if(s)throw l}}}}else if(sr(o)){var h=n.hasOwnProperty(t)?r:{};sr(h)&&(n[t]=_u(o,h))}},c=Object.keys(e)[Symbol.iterator]();!(r=(a=c.next()).done);r=!0)u()}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n},Eu={"Display conditions":{privileges:{_description:"The privilege(s) the user must have to use this extension",_type:Yi.Array,_default:[]}},"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:Yi.Object,_default:{}}};S(570);var xu=function(e,t){return e===t||e!=e&&t!=t},ju=function(e,t){for(var n=e.length;n--;)if(xu(e[n][0],t))return n;return-1},Pu=Array.prototype.splice;lr.prototype.clear=function(){this.__data__=[],this.size=0},lr.prototype.delete=function(e){var t=this.__data__,n=ju(t,e);return!(n<0||(n==t.length-1?t.pop():Pu.call(t,n,1),--this.size,0))},lr.prototype.get=function(e){var t=this.__data__,n=ju(t,e);return n<0?void 0:t[n][1]},lr.prototype.has=function(e){return ju(this.__data__,e)>-1},lr.prototype.set=function(e,t){var n=this.__data__,r=ju(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var ku,Cu=lr,Au="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,Tu="object"==typeof self&&self&&self.Object===Object&&self,Iu=Au||Tu||Function("return this")(),Du=Iu.Symbol,Mu=Object.prototype,Ru=Mu.hasOwnProperty,Nu=Mu.toString,Lu=Du?Du.toStringTag:void 0,Uu=Object.prototype.toString,Bu=Du?Du.toStringTag:void 0,Fu=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Bu&&Bu in Object(e)?function(e){var t=Ru.call(e,Lu),n=e[Lu];try{e[Lu]=void 0;var r=!0}catch(e){}var o=Nu.call(e);return r&&(t?e[Lu]=n:delete e[Lu]),o}(e):function(e){return Uu.call(e)}(e)},Vu=function(e){var t,n=void 0===e?"undefined":(t=e)&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":void 0===t?"undefined":b(t);return null!=e&&("object"==n||"function"==n)},Ku=function(e){if(!Vu(e))return!1;var t=Fu(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Hu=Iu["__core-js_shared__"],$u=(ku=/[^.]+$/.exec(Hu&&Hu.keys&&Hu.keys.IE_PROTO||""))?"Symbol(src)_1."+ku:"",Gu=Function.prototype.toString,qu=function(e){if(null!=e){try{return Gu.call(e)}catch(e){}try{return e+""}catch(e){}}return""},zu=/^\[object .+?Constructor\]$/,Wu=Function.prototype,Yu=Object.prototype,Zu=Wu.toString,Xu=Yu.hasOwnProperty,Ju=RegExp("^"+Zu.call(Xu).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Qu=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Vu(e)||(t=e,$u&&$u in t))&&(Ku(e)?Ju:zu).test(qu(e));var t}(n)?n:void 0},ec=Qu(Iu,"Map"),tc=Qu(Object,"create"),nc=Object.prototype.hasOwnProperty,rc=Object.prototype.hasOwnProperty;fr.prototype.clear=function(){this.__data__=tc?tc(null):{},this.size=0},fr.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},fr.prototype.get=function(e){var t=this.__data__;if(tc){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return nc.call(t,e)?t[e]:void 0},fr.prototype.has=function(e){var t=this.__data__;return tc?void 0!==t[e]:rc.call(t,e)},fr.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=tc&&void 0===t?"__lodash_hash_undefined__":t,this};var oc=fr,ic=function(e,t){var n,r,o,i=e.__data__;return("string"==(o=void 0===(n=t)?"undefined":(r=n)&&"undefined"!=typeof Symbol&&r.constructor===Symbol?"symbol":void 0===r?"undefined":b(r))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map};dr.prototype.clear=function(){this.size=0,this.__data__={hash:new oc,map:new(ec||Cu),string:new oc}},dr.prototype.delete=function(e){var t=ic(this,e).delete(e);return this.size-=t?1:0,t},dr.prototype.get=function(e){return ic(this,e).get(e)},dr.prototype.has=function(e){return ic(this,e).has(e)},dr.prototype.set=function(e,t){var n=ic(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};var ac=dr;pr.prototype.clear=function(){this.__data__=new Cu,this.size=0},pr.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},pr.prototype.get=function(e){return this.__data__.get(e)},pr.prototype.has=function(e){return this.__data__.has(e)},pr.prototype.set=function(e,t){var n,r,o=this.__data__;if(n=o,null!=(r=Cu)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):d(n,r)){var i=o.__data__;if(!ec||i.length<199)return i.push([e,t]),this.size=++o.size,this;o=this.__data__=new ac(i)}return o.set(e,t),this.size=o.size,this};var uc=pr;hr.prototype.add=hr.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},hr.prototype.has=function(e){return this.__data__.has(e)};var cc=hr,sc=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},lc=function(e,t){return e.has(t)},fc=function(e,t,n,r,o,i){var a=1&n,u=e.length,c=t.length;if(u!=c&&!(a&&c>u))return!1;var s=i.get(e),l=i.get(t);if(s&&l)return s==t&&l==e;var f=-1,d=!0,p=2&n?new cc:void 0;for(i.set(e,t),i.set(t,e);++f<u;){var h=e[f],y=t[f];if(r)var v=a?r(y,h,f,t,e,i):r(h,y,f,e,t,i);if(void 0!==v){if(v)continue;d=!1;break}if(p){if(!sc(t,(function(e,t){if(!lc(p,t)&&(h===e||o(h,e,n,r,i)))return p.push(t)}))){d=!1;break}}else if(h!==y&&!o(h,y,n,r,i)){d=!1;break}}return i.delete(e),i.delete(t),d},dc=Iu.Uint8Array,pc=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n},hc=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},yc=Du?Du.prototype:void 0,vc=yc?yc.valueOf:void 0,bc=Array.isArray,mc=Object.prototype.propertyIsEnumerable,gc=Object.getOwnPropertySymbols,wc=gc?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a)&&(i[o++]=a)}return i}(gc(e),(function(t){return mc.call(e,t)})))}:function(){return[]},Sc=function(e){return null!=e&&"object"==typeof e},Oc=function(e){return Sc(e)&&"[object Arguments]"==Fu(e)},_c=Object.prototype,Ec=_c.hasOwnProperty,xc=_c.propertyIsEnumerable,jc=Oc(function(){return arguments}())?Oc:function(e){return Sc(e)&&Ec.call(e,"callee")&&!xc.call(e,"callee")},Pc=jc,kc="object"==typeof exports&&exports&&!exports.nodeType&&exports,Cc=kc&&e&&!e.nodeType&&e,Ac=Cc&&Cc.exports===kc?Iu.Buffer:void 0,Tc=(Ac?Ac.isBuffer:void 0)||function(){return!1},Ic=/^(?:0|[1-9]\d*)$/,Dc=function(e,t){var n,r=void 0===e?"undefined":(n=e)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":void 0===n?"undefined":b(n);return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&Ic.test(e))&&e>-1&&e%1==0&&e<t},Mc=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Rc={};Rc["[object Float32Array]"]=Rc["[object Float64Array]"]=Rc["[object Int8Array]"]=Rc["[object Int16Array]"]=Rc["[object Int32Array]"]=Rc["[object Uint8Array]"]=Rc["[object Uint8ClampedArray]"]=Rc["[object Uint16Array]"]=Rc["[object Uint32Array]"]=!0,Rc["[object Arguments]"]=Rc["[object Array]"]=Rc["[object ArrayBuffer]"]=Rc["[object Boolean]"]=Rc["[object DataView]"]=Rc["[object Date]"]=Rc["[object Error]"]=Rc["[object Function]"]=Rc["[object Map]"]=Rc["[object Number]"]=Rc["[object Object]"]=Rc["[object RegExp]"]=Rc["[object Set]"]=Rc["[object String]"]=Rc["[object WeakMap]"]=!1;var Nc,Lc="object"==typeof exports&&exports&&!exports.nodeType&&exports,Uc=Lc&&e&&!e.nodeType&&e,Bc=Uc&&Uc.exports===Lc&&Au.process,Fc=function(){try{return Uc&&Uc.require&&Uc.require("util").types||Bc&&Bc.binding&&Bc.binding("util")}catch(e){}}(),Vc=Fc&&Fc.isTypedArray,Kc=Vc?(Nc=Vc,function(e){return Nc(e)}):function(e){return Sc(e)&&Mc(e.length)&&!!Rc[Fu(e)]},Hc=Object.prototype.hasOwnProperty,$c=Object.prototype,Gc=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),qc=Object.prototype.hasOwnProperty,zc=function(e){return null!=(t=e)&&Mc(t.length)&&!Ku(t)?function(e,t){var n=bc(e),r=!n&&Pc(e),o=!n&&!r&&Tc(e),i=!n&&!r&&!o&&Kc(e),a=n||r||o||i,u=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=u.length;for(var s in e)!Hc.call(e,s)||a&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||Dc(s,c))||u.push(s);return u}(e):function(e){if(n=(t=e)&&t.constructor,t!==("function"==typeof n&&n.prototype||$c))return Gc(e);var t,n,r=[];for(var o in Object(e))qc.call(e,o)&&"constructor"!=o&&r.push(o);return r}(e);var t},Wc=function(e){return function(e,t,n){var r=t(e);return bc(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,zc,wc)},Yc=Object.prototype.hasOwnProperty,Zc=Qu(Iu,"DataView"),Xc=Qu(Iu,"Promise"),Jc=Qu(Iu,"Set"),Qc=Qu(Iu,"WeakMap"),es="[object Map]",ts="[object Promise]",ns="[object Set]",rs="[object WeakMap]",os="[object DataView]",is=qu(Zc),as=qu(ec),us=qu(Xc),cs=qu(Jc),ss=qu(Qc),ls=Fu;(Zc&&ls(new Zc(new ArrayBuffer(1)))!=os||ec&&ls(new ec)!=es||Xc&&ls(Xc.resolve())!=ts||Jc&&ls(new Jc)!=ns||Qc&&ls(new Qc)!=rs)&&(ls=function(e){var t=Fu(e),n="[object Object]"==t?e.constructor:void 0,r=n?qu(n):"";if(r)switch(r){case is:return os;case as:return es;case us:return ts;case cs:return ns;case ss:return rs}return t});var fs=ls,ds="[object Arguments]",ps="[object Array]",hs="[object Object]",ys=Object.prototype.hasOwnProperty,vs=function e(t,n,r,o,i){return t===n||(null==t||null==n||!Sc(t)&&!Sc(n)?t!=t&&n!=n:function(e,t,n,r,o,i){var a=bc(e),u=bc(t),c=a?ps:fs(e),s=u?ps:fs(t),l=(c=c==ds?hs:c)==hs,f=(s=s==ds?hs:s)==hs,d=c==s;if(d&&Tc(e)){if(!Tc(t))return!1;a=!0,l=!1}if(d&&!l)return i||(i=new uc),a||Kc(e)?fc(e,t,n,r,o,i):function(e,t,n,r,o,i,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new dc(e),new dc(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return xu(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var u=pc;case"[object Set]":var c=1&r;if(u||(u=hc),e.size!=t.size&&!c)return!1;var s=a.get(e);if(s)return s==t;r|=2,a.set(e,t);var l=fc(u(e),u(t),r,o,i,a);return a.delete(e),l;case"[object Symbol]":if(vc)return vc.call(e)==vc.call(t)}return!1}(e,t,c,n,r,o,i);if(!(1&n)){var p=l&&ys.call(e,"__wrapped__"),h=f&&ys.call(t,"__wrapped__");if(p||h){var y=p?e.value():e,v=h?t.value():t;return i||(i=new uc),o(y,v,n,r,i)}}return!!d&&(i||(i=new uc),function(e,t,n,r,o,i){var a=1&n,u=Wc(e),c=u.length;if(c!=Wc(t).length&&!a)return!1;for(var s=c;s--;){var l=u[s];if(!(a?l in t:Yc.call(t,l)))return!1}var f=i.get(e),d=i.get(t);if(f&&d)return f==t&&d==e;var p=!0;i.set(e,t),i.set(t,e);for(var h=a;++s<c;){var y=e[l=u[s]],v=t[l];if(r)var b=a?r(v,y,l,t,e,i):r(y,v,l,e,t,i);if(!(void 0===b?y===v||o(y,v,n,r,i):b)){p=!1;break}h||(h="constructor"==l)}if(p&&!h){var m=e.constructor,g=t.constructor;m==g||!("constructor"in e)||!("constructor"in t)||"function"==typeof m&&yr(m,m)&&"function"==typeof g&&yr(g,g)||(p=!1)}return i.delete(e),i.delete(t),p}(e,t,n,r,o,i))}(t,n,r,o,e,i))},bs=function(e,t){return vs(e,t)},ms=function(e){return void 0===e},gs=(0,zr.createGlobalStore)("extensionsInternal",{slots:{},extensions:{}}),ws=function(){return(0,zr.getGlobalStore)("extensionsInternal",{slots:{},extensions:{}})};vr(gs.getState()),gs.subscribe(vr),ws();var Ss=ws(),Os=(0,zr.getGlobalStore)("extensions",{slots:{}}),_s=(0,Vr.getExtensionSlotsConfigStore)(),Es=(0,Vr.getExtensionsConfigStore)();Ss.subscribe((function(e){Sr(e,_s.getState(),Es.getState())})),_s.subscribe((function(e){Sr(Ss.getState(),e,Es.getState())})),Es.subscribe((function(e){Sr(Ss.getState(),_s.getState(),e)}));var xs={flags:function(){var e={},t=!0,n=!1,r=void 0;try{for(var o,i=Object.keys(localStorage)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value;if(a.startsWith("openmrs:feature-flag:")){var u=a.replace("openmrs:feature-flag:",""),c=JSON.parse(localStorage.getItem("openmrs:feature-flag-meta:".concat(u))||"{}");e[u]=Pr({enabled:"true"===localStorage.getItem(a)},c)}}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return e}()};(0,zr.getGlobalStore)("feature-flags",xs).subscribe((function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=Object.entries(e.flags)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=kr(o.value,2),u=a[0],c=a[1];localStorage.setItem("openmrs:feature-flag:".concat(u),c.enabled.toString()),localStorage.setItem("openmrs:feature-flag-meta:".concat(u),JSON.stringify({label:c.label,description:c.description}))}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}}));var js,Ps=S(954),ks=S(45);Ps.default.createContext({moduleName:""}),S(103),S(279);try{n(5206).createContext()}catch(e){}!function(e){e.loadPatient="loadPatient",e.newPatient="newPatient",e.loadError="patientLoadError"}(js||(js={})),Ir((0,ks.getExtensionInternalStore)()),Ir((0,ks.getExtensionStore)()),S(921);var Cs=new WeakMap,As={},Ts=function(){},Is=void 0,Ds=Object,Ms=function(e){return e===Is},Rs=function(e){return"function"==typeof e},Ns=function(e,t){return p({},e,t)},Ls="undefined",Us=("undefined"==typeof window?"undefined":b(window))!=Ls,Bs=("undefined"==typeof document?"undefined":b(document))!=Ls,Fs=function(e,t){var n=Cs.get(e);return[function(){return e.get(t)||As},function(r){var o=e.get(t);n[5](t,Ns(o,r),o||As)},n[6]]},Vs=new WeakMap,Ks=0,Hs=function(e){var t,n,r=void 0===e?"undefined":b(e),o=e&&e.constructor,i=o==Date;if(Ds(e)!==e||i||o==RegExp)t=i?e.toJSON():"symbol"==r?e.toString():"string"==r?JSON.stringify(e):""+e;else{if(t=Vs.get(e))return t;if(t=++Ks+"~",Vs.set(e,t),o==Array){for(t="@",n=0;n<e.length;n++)t+=Hs(e[n])+",";Vs.set(e,t)}if(o==Ds){t="#";for(var a=Ds.keys(e).sort();!Ms(n=a.pop());)Ms(e[n])||(t+=n+":"+Hs(e[n])+",");Vs.set(e,t)}}return t},$s=!0,Gs=y(Us&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Ts,Ts],2),qs=Gs[0],zs=Gs[1],Ws={isOnline:function(){return $s},isVisible:function(){var e=Bs&&document.visibilityState;return Ms(e)||"hidden"!==e}},Ys={initFocus:function(e){return Bs&&document.addEventListener("visibilitychange",e),qs("focus",e),function(){Bs&&document.removeEventListener("visibilitychange",e),zs("focus",e)}},initReconnect:function(e){var t=function(){$s=!0,e()},n=function(){$s=!1};return qs("online",t),qs("offline",n),function(){zs("online",t),zs("offline",n)}}},Zs=(Ps.default.useId,!Us||"Deno"in window),Xs=Zs?Ps.useEffect:Ps.useLayoutEffect,Js="undefined"!=typeof navigator&&navigator.connection,Qs=!Zs&&Js&&(["slow-2g","2g"].includes(Js.effectiveType)||Js.saveData),el=function(e){if(Rs(e))try{e=e()}catch(t){e=""}var t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?Hs(e):"",t]},tl=0,nl=function(){return++tl};function rl(){return ol.apply(this,arguments)}function ol(){return ol=u(o().mark((function e(){var t,n,r,i,a,c,s,l,f,d,p,h,v,b,m,g,w,S,O,_,E,x=arguments;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(_=function(e){return E.apply(this,arguments)},E=function(){return E=u(o().mark((function e(t){var r,i,u,c,l,f,m,g,w,S,O,_,E,x,j,P,k,C,A,T;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=y(el(t),1),i=r[0]){e.next=3;break}return e.abrupt("return");case 3:if(u=y(Fs(a,i),2),c=u[0],l=u[1],f=y(Cs.get(a),3),m=f[0],g=f[1],w=f[2],S=m[i],O=function(){return v&&(delete w[i],S&&S[0])?S[0](2).then((function(){return c().data})):c().data},!(n.length<3)){e.next=6;break}return e.abrupt("return",O());case 6:if(E=s,x=nl(),g[i]=[x,0],j=!Ms(h),P=c(),k=P.data,C=P._c,A=Ms(C)?k:C,j&&(h=Rs(h)?h(A):h,l({data:h,_c:A})),Rs(E))try{E=E(A)}catch(e){_=e}if(!E||!Rs(E.then)){e.next=20;break}return e.next=14,E.catch((function(e){_=e}));case 14:if(E=e.sent,x===g[i][0]){e.next=19;break}if(!_){e.next=18;break}throw _;case 18:return e.abrupt("return",E);case 19:_&&j&&function(e){return"function"==typeof p?p(e):!1!==p}(_)&&(d=!0,l({data:E=A,_c:Is}));case 20:return d&&(_||(Rs(d)&&(E=d(E,A)),l({data:E,_c:Is}))),g[i][1]=nl(),e.next=23,O();case 23:if(T=e.sent,l({_c:Is}),_){e.next=26;break}return e.abrupt("return",d?T:E);case 26:if(!b){e.next=28;break}throw _;case 28:case"end":return e.stop()}}),e)}))),E.apply(this,arguments)},t=x.length,n=new Array(t),r=0;r<t;r++)n[r]=x[r];if(i=y(n,4),a=i[0],c=i[1],s=i[2],l=i[3],f=Ns({populateCache:!0,throwOnError:!0},"boolean"==typeof l?{revalidate:l}:l||{}),d=f.populateCache,p=f.rollbackOnError,h=f.optimisticData,v=!1!==f.revalidate,b=f.throwOnError,!Rs(c)){e.next=12;break}for(m=c,g=[],w=a.keys(),S=w.next();!S.done;S=w.next())!(O=S.value).startsWith("$inf$")&&m(a.get(O)._k)&&g.push(O);return e.abrupt("return",Promise.all(g.map(_)));case 12:return e.abrupt("return",_(c));case 15:case"end":return e.stop()}}),e)}))),ol.apply(this,arguments)}var il=function(e,t){for(var n in e)e[n][0]&&e[n][0](t)},al=function(e,t){if(!Cs.has(e)){var n=Ns(Ys,t),r={},o=rl.bind(Is,e),i=Ts,a={},u=function(e,t){var n=a[e]||[];return a[e]=n,n.push(t),function(){return n.splice(n.indexOf(t),1)}},c=function(t,n,r){e.set(t,n);var o=a[t];if(o)for(var i=o.length;i--;)o[i](r,n)},s=function(){if(!Cs.has(e)&&(Cs.set(e,[r,{},{},{},o,c,u]),!Zs)){var t=n.initFocus(setTimeout.bind(Is,il.bind(Is,r,0))),a=n.initReconnect(setTimeout.bind(Is,il.bind(Is,r,1)));i=function(){t&&t(),a&&a(),Cs.delete(e)}}};return s(),[e,o,s,i]}return[e,Cs.get(e)[4]]},ul=y(al(new Map),2),cl=ul[0],sl=ul[1],ll=Ns({onLoadingSlow:Ts,onSuccess:Ts,onError:Ts,onErrorRetry:function(e,t,n,r,o){var i=n.errorRetryCount,a=o.retryCount,u=~~((Math.random()+.5)*(1<<(a<8?a:8)))*n.errorRetryInterval;!Ms(i)&&a>i||setTimeout(r,u,o)},onDiscarded:Ts,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Qs?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:Qs?5e3:3e3,compare:function(e,t){return Hs(e)==Hs(t)},isPaused:function(){return!1},cache:cl,mutate:sl,fallback:{}},Ws),fl=(0,Ps.createContext)({}),dl=Us&&window.__SWR_DEVTOOLS_USE__;(dl?window.__SWR_DEVTOOLS_USE__:[]).concat((function(e){return function(t,n,r){return e(t,n&&function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];var i=el(t)[0],a=y(Cs.get(cl),4),u=a[3],c=u[i];return c?(delete u[i],c):n.apply(void 0,v(r))},r)}})),dl&&(window.__SWR_DEVTOOLS_REACT__=Ps.default),Ds.defineProperty((function(e){var t=e.value,n=(0,Ps.useContext)(fl),r=Rs(t),o=(0,Ps.useMemo)((function(){return r?t(n):t}),[r,n,t]),i=(0,Ps.useMemo)((function(){return r?o:function(e,t){var n=Ns(e,t);if(t){var r=e.use,o=e.fallback,i=t.use,a=t.fallback;r&&i&&(n.use=r.concat(i)),o&&a&&(n.fallback=Ns(o,a))}return n}(n,o)}),[r,n,o]),a=o&&o.provider,u=y((0,Ps.useState)((function(){return a?al(a(i.cache||cl),o):Is})),1)[0];return u&&(i.cache=u[0],i.mutate=u[1]),Xs((function(){if(u)return u[2]&&u[2](),u[3]}),[]),(0,Ps.createElement)(fl.Provider,Ns(e,{value:i}))}),"defaultValue",{value:ll});var pl=S(23),hl=S.n(pl),yl=S(701),vl=S.n(yl);hl().extend(vl());var bl={};setTimeout((function(){"development"===window.spaEnv&&(window.stores=bl)}),1e3);var ml={};try{process.env.CARBON_ENABLE_CSS_CUSTOM_PROPERTIES&&"true"===process.env.CARBON_ENABLE_CSS_CUSTOM_PROPERTIES?ml.enableCssCustomProperties=!0:ml.enableCssCustomProperties=!1,process.env.CARBON_ENABLE_USE_CONTROLLED_STATE_WITH_VALUE&&"true"===process.env.CARBON_ENABLE_USE_CONTROLLED_STATE_WITH_VALUE?ml.enableUseControlledStateWithValue=!0:ml.enableUseControlledStateWithValue=!1,process.env.CARBON_ENABLE_CSS_GRID&&"true"===process.env.CARBON_ENABLE_CSS_GRID?ml.enableCssGrid=!0:ml.enableCssGrid=!1,process.env.CARBON_ENABLE_V11_RELEASE&&"true"===process.env.CARBON_ENABLE_V11_RELEASE?ml.enableV11Release=!0:ml.enableV11Release=!1}catch(e){ml.enableCssCustomProperties=!1,ml.enableUseControlledStateWithValue=!1,ml.enableCssGrid=!1,ml.enableV11Release=!1}for(var gl=[{name:"enable-css-custom-properties",description:"Describe what the flag does",enabled:ml.enableCssCustomProperties},{name:"enable-use-controlled-state-with-value",description:"Enable components to be created in either a controlled or uncontrolled mode\n",enabled:ml.enableUseControlledStateWithValue},{name:"enable-css-grid",description:"Enable CSS Grid Layout in the Grid and Column React components\n",enabled:ml.enableCssGrid},{name:"enable-v11-release",description:"Enable the features and functionality for the v11 Release\n",enabled:ml.enableV11Release}],wl=function(){function e(t){var n=this;(function(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):d(n,r)))throw new TypeError("Cannot call a class as a function");var n,r})(this,e),this.flags=new Map,t&&Object.keys(t).forEach((function(e){n.flags.set(e,t[e])}))}var t,n;return t=e,n=[{key:"checkForFlag",value:function(e){if(!this.flags.has(e))throw new Error("Unable to find a feature flag with the name: `".concat(e,"`"))}},{key:"add",value:function(e,t){if(this.flags.has(e))throw new Error("The feature flag: ".concat(e," already exists"));this.flags.set(e,t)}},{key:"enable",value:function(e){this.checkForFlag(e),this.flags.set(e,!0)}},{key:"disable",value:function(e){this.checkForFlag(e),this.flags.set(e,!1)}},{key:"merge",value:function(e){var t=this;Object.keys(e).forEach((function(n){t.flags.set(n,e[n])}))}},{key:"mergeWithScope",value:function(e){var t,n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Mr(e))){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},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(){n=n.call(e)},n:function e(){var t=e.next();return a=t.done,t},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(e.flags);try{for(n.s();!(t=n.n()).done;){var r=Dr(t.value,2),o=r[0],i=r[1];this.flags.has(o)||this.flags.set(o,i)}}catch(e){n.e(e)}finally{n.f()}}},{key:"enabled",value:function(e){return this.checkForFlag(e),this.flags.get(e)}}],n&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),Sl=new wl(void 0),Ol=0;Ol<gl.length;Ol++){var _l=gl[Ol];Sl.add(_l.name,_l.enabled)}!function(){Sl.merge.apply(Sl,arguments)}({"enable-css-custom-properties":!0,"enable-css-grid":!0,"enable-v11-release":!0}),new Kr.Subject,new Kr.Subject,new Kr.Subject,(0,zr.createGlobalStore)("globalModalState",{modalContainer:null,modalStack:[]}),window.getComputedStyle(document.body).overflow,S(740),(0,zr.createGlobalStore)("left-nav",{slotName:null,basePath:window.spaBase});var El,xl={"Brand color #1":{_default:"#005d5d",_type:Yi.String},"Brand color #2":{_default:"#004144",_type:Yi.String},"Brand color #3":{_default:"#007d79",_type:Yi.String},preferredCalendar:{_type:Yi.Object,_default:{am:"ethiopic"}}};Number.MAX_SAFE_INTEGER,function(e,t){wu(e,t);var n=Xa(t,Eu),r=hu.getState();hu.setState({schemas:Gn($n({},r.schemas),Hn({},e,n))})}("@openmrs/esm-styleguide",xl),El=function(e,t){document.documentElement.style.setProperty(e,t)},(0,Vr.getConfigStore)("@openmrs/esm-styleguide").subscribe((function(e){e.loaded&&e.config&&(El("--brand-01",e.config["Brand color #1"]),El("--brand-02",e.config["Brand color #2"]),El("--brand-03",e.config["Brand color #3"]))})),t("omrs-logo-full-color",Nr),t("omrs-logo-full-mono",Nr),t("omrs-logo-full-grey",Nr),t("omrs-logo-partial-color",Lr),t("omrs-logo-partial-mono",Lr),t("omrs-logo-partial-grey",Lr),t("omrs-logo-icon-color",Ur),t("omrs-logo-icon-mono",Ur),t("omrs-logo-icon-grey",Ur),t("omrs-logo-white",'<svg id="omrs-logo-white" viewBox="0 0 380 119" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M40.2901 40.3278C45.3275 35.2904 52.2879 32.1739 59.9777 32.1739C67.6466 32.1739 74.5911 35.2765 79.6246 40.29L79.6454 21.7502C73.7514 18.7143 67.0623 17 59.9777 17C52.8891 17 46.1653 18.9309 40.2692 21.9679L40.2901 40.3278Z" fill="var(--logo-white)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M79.6454 79.6712C74.6079 84.7096 67.6506 87.8251 59.9608 87.8251C52.2918 87.8251 45.3473 84.7236 40.3099 79.709L40.29 98.2498C46.1871 101.285 52.8732 103 59.9608 103C67.0493 103 73.7374 101.285 79.6315 98.2488L79.6454 79.6712Z" fill="var(--logo-white)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M40.3278 79.6961C35.2904 74.6586 32.1739 67.7012 32.1739 60.0114C32.1739 52.3425 35.2755 45.399 40.29 40.3616L21.7492 40.3417C18.7143 46.2378 17 52.9229 17 60.0114C17 67.1 18.7143 73.7881 21.7522 79.6831L40.3278 79.6961Z" fill="var(--logo-grey)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M79.6344 40.289C84.6718 45.3255 87.7883 52.2868 87.7883 59.9766C87.7883 67.6456 84.6867 74.5901 79.6712 79.6225L98.213 79.6434C101.248 73.7493 102.962 67.0612 102.962 59.9766C102.962 52.8871 101.248 46.198 98.211 40.302L79.6344 40.289Z" fill="var(--logo-grey)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M156.184 60.0025C156.184 51.2543 150.066 44.2264 141.159 44.2264C132.25 44.2264 126.134 51.2543 126.134 60.0025C126.134 68.7507 132.25 75.7816 141.159 75.7816C150.066 75.7816 156.184 68.7507 156.184 60.0025ZM121.303 60.0025C121.303 48.5205 129.621 40.0436 141.159 40.0436C152.695 40.0436 161.014 48.5205 161.014 60.0025C161.014 71.4875 152.695 79.9674 141.159 79.9674C129.621 79.9674 121.303 71.4875 121.303 60.0025Z" fill="var(--logo-white)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M179.514 75.5401C185.021 75.5401 188.564 71.4 188.564 66.0585C188.564 60.717 185.021 56.575 179.514 56.575C174.009 56.575 170.468 60.717 170.468 66.0585C170.468 71.4 174.009 75.5401 179.514 75.5401ZM166.22 53.3064H170.468V57.0102H170.578C172.922 54.2853 176.027 52.6506 179.732 52.6506C187.746 52.6506 193.14 58.32 193.14 66.0585C193.14 73.6887 187.527 79.4645 180.388 79.4645C175.808 79.4645 172.157 77.1749 170.578 74.286H170.468V90.87H166.22V53.3064Z" fill="var(--logo-white)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M217.773 63.7679C217.61 59.4629 214.773 56.575 210.087 56.575C205.402 56.575 202.297 59.4629 201.752 63.7679H217.773ZM221.426 74.1796C218.425 78.0484 214.83 79.4645 210.087 79.4645C202.077 79.4645 197.173 73.4711 197.173 66.0585C197.173 58.157 202.732 52.6506 210.253 52.6506C217.449 52.6506 222.349 57.5568 222.349 66.0049V67.3673H201.752C202.077 71.7797 205.456 75.5401 210.087 75.5401C213.737 75.5401 216.192 74.2333 218.207 71.6723L221.426 74.1796Z" fill="var(--logo-white)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M227.854 59.3565C227.854 57.0102 227.638 54.9959 227.638 53.3064H231.669C231.669 54.6689 231.779 56.083 231.779 57.5012H231.889C233.033 54.9959 236.195 52.6506 240.389 52.6506C247.094 52.6506 250.088 56.9029 250.088 63.0603V78.8086H245.84V63.4986C245.84 59.2462 243.984 56.575 240.007 56.575C234.504 56.575 232.104 60.554 232.104 66.3865V78.8086H227.854V59.3565Z" fill="var(--logo-white)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M259.211 41.0085H265.919L278.8 70.7909H278.907L291.889 41.0085H298.438V78.9994H293.932V47.1242H293.826L280.192 78.9994H277.454L263.825 47.1242H263.718V78.9994H259.211V41.0085Z" fill="var(--logo-white)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M312.392 57.7516H316.415C321.407 57.7516 327.902 57.7516 327.902 51.47C327.902 45.9992 323.126 45.1943 318.725 45.1943H312.392V57.7516ZM307.886 41.0085H317.597C324.949 41.0085 332.729 42.0798 332.729 51.47C332.729 56.9973 329.135 60.5948 323.234 61.5071L334.018 78.9994H328.493L318.189 61.9364H312.392V78.9994H307.886V41.0085Z" fill="var(--logo-white)"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M358.123 47.7125C356.617 45.2986 353.936 44.2264 351.197 44.2264C347.224 44.2264 343.097 46.1056 343.097 50.6113C343.097 54.1005 345.028 55.6577 351.091 57.5906C356.994 59.4688 362.468 61.3997 362.468 68.858C362.468 76.4246 355.973 79.9674 349.108 79.9674C344.706 79.9674 339.983 78.5174 337.408 74.7063L341.27 71.5412C342.88 74.3347 346.1 75.7816 349.375 75.7816C353.237 75.7816 357.638 73.5277 357.638 69.18C357.638 64.5112 354.473 63.7063 347.71 61.4524C342.344 59.6805 338.268 57.3183 338.268 50.989C338.268 43.6907 344.545 40.0436 351.197 40.0436C355.438 40.0436 359.033 41.2222 361.822 44.4947L358.123 47.7125Z" fill="var(--logo-white)"/>\n</svg>\n'),t("omrs-icon-visibility",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <g id="icon/action/visibility_24px">\n <path id="icon/action/visibility_24px_2" fill-rule="evenodd" clip-rule="evenodd" d="M12 4.5C7 4.5 2.72998 7.60999 1 12C2.72998 16.39 7 19.5 12 19.5C17 19.5 21.27 16.39 23 12C21.27 7.60999 17 4.5 12 4.5ZM12 17C9.23999 17 7 14.76 7 12C7 9.23999 9.23999 7 12 7C14.76 7 17 9.23999 17 12C17 14.76 14.76 17 12 17ZM9 12C9 10.34 10.34 9 12 9C13.66 9 15 10.34 15 12C15 13.66 13.66 15 12 15C10.34 15 9 13.66 9 12Z"/>\n </g>\n <title>Visibility rounded</title>\n</svg>\n'),t("omrs-icon-menu",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <g id="icon/navigation/menu_24px">\n <path id="icon/navigation/menu_24px_2" fill-rule="evenodd" clip-rule="evenodd" d="M4 8C3.44995 8 3 7.54999 3 7C3 6.45001 3.44995 6 4 6H20C20.55 6 21 6.45001 21 7C21 7.54999 20.55 8 20 8H4ZM4 13H20C20.55 13 21 12.55 21 12C21 11.45 20.55 11 20 11H4C3.44995 11 3 11.45 3 12C3 12.55 3.44995 13 4 13ZM4 18H20C20.55 18 21 17.55 21 17C21 16.45 20.55 16 20 16H4C3.44995 16 3 16.45 3 17C3 17.55 3.44995 18 4 18Z"/>\n </g>\n <title>Menu rounded</title>\n</svg>\n'),t("omrs-icon-search",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <g id="icon/action/search_24px">\n <path id="icon/action/search_24px_2" fill-rule="evenodd" clip-rule="evenodd" d="M15.1865 14.4716H15.9765L20.2165 18.7316C20.6266 19.1416 20.6266 19.8116 20.2165 20.2216C19.8065 20.6316 19.1366 20.6316 18.7265 20.2216L14.4765 15.9716V15.1816L14.2065 14.9016C12.8065 16.1016 10.8966 16.7216 8.86655 16.3816C6.08652 15.9116 3.86655 13.5916 3.52658 10.7916C3.00656 6.56158 6.5665 3.00158 10.7966 3.52157C13.5965 3.86157 15.9166 6.08157 16.3866 8.86157C16.7265 10.8916 16.1065 12.8016 14.9066 14.2016L15.1865 14.4716ZM5.47653 9.97155C5.47653 12.4615 7.48654 14.4716 9.97653 14.4716C12.4665 14.4716 14.4765 12.4615 14.4765 9.97155C14.4765 7.48156 12.4665 5.47155 9.97653 5.47155C7.48654 5.47155 5.47653 7.48156 5.47653 9.97155Z"/>\n </g>\n <title>Search rounded</title>\n</svg>\n'),t("omrs-icon-arrow-back",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <g id="icon/navigation/arrow_back_24px">\n <path id="icon/navigation/arrow_back_24px_2" d="M18.7912 11.005H7.62124L12.5012 6.12499C12.8912 5.73499 12.8912 5.09499 12.5012 4.70499C12.3144 4.51774 12.0608 4.41251 11.7962 4.41251C11.5317 4.41251 11.2781 4.51774 11.0912 4.70499L4.50124 11.295C4.11124 11.685 4.11124 12.315 4.50124 12.705L11.0912 19.295C11.4812 19.685 12.1112 19.685 12.5012 19.295C12.8912 18.905 12.8912 18.275 12.5012 17.885L7.62124 13.005H18.7912C19.3412 13.005 19.7912 12.555 19.7912 12.005C19.7912 11.455 19.3412 11.005 18.7912 11.005Z"/>\n </g>\n <title>Arrow back rounded</title>\n</svg>\n'),t("omrs-icon-arrow-forward",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M5 13h11.17l-4.88 4.88c-.39.39-.39 1.03 0 1.42.39.39 1.02.39 1.41 0l6.59-6.59c.39-.39.39-1.02 0-1.41l-6.58-6.6c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41L16.17 11H5c-.55 0-1 .45-1 1s.45 1 1 1z"/>\n <title>Arrow forward rounded</title>\n</svg>'),t("omrs-icon-arrow-downward",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <g id="icon/navigation/arrow_downward_24px">\n <path id="icon/navigation/arrow_downward_24px_2" d="M11.005 5.20874V16.3787L6.12498 11.4987C5.73498 11.1087 5.09498 11.1087 4.70498 11.4987C4.31498 11.8887 4.31498 12.5187 4.70498 12.9087L11.295 19.4987C11.685 19.8887 12.315 19.8887 12.705 19.4987L19.295 12.9087C19.685 12.5187 19.685 11.8887 19.295 11.4987C19.1081 11.3115 18.8545 11.2063 18.59 11.2063C18.3255 11.2063 18.0718 11.3115 17.885 11.4987L13.005 16.3787V5.20874C13.005 4.65874 12.555 4.20874 12.005 4.20874C11.455 4.20874 11.005 4.65874 11.005 5.20874Z"/>\n </g>\n <title>Arrow downward rounded</title>\n</svg>\n'),t("omrs-icon-arrow-upward",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <g id="icon/navigation/arrow_upward_24px">\n <path id="icon/navigation/arrow_upward_24px_2" d="M13 18.7913V7.62126L17.88 12.5013C18.27 12.8913 18.91 12.8913 19.3 12.5013C19.69 12.1113 19.69 11.4813 19.3 11.0913L12.71 4.50126C12.5231 4.314 12.2695 4.20877 12.005 4.20877C11.7405 4.20877 11.4868 4.314 11.3 4.50126L4.69997 11.0813C4.30997 11.4713 4.30997 12.1013 4.69997 12.4913C5.08997 12.8813 5.71997 12.8813 6.10997 12.4913L11 7.62126V18.7913C11 19.3413 11.45 19.7913 12 19.7913C12.55 19.7913 13 19.3413 13 18.7913Z"/>\n </g>\n <title>Arrow upward rounded </title>\n</svg>\n'),t("omrs-icon-chevron-left",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <g id="icon/navigation/chevron_left_24px">\n <path id="icon/navigation/chevron_left_24px_2" d="M15 6.70499C14.8132 6.51774 14.5595 6.41251 14.295 6.41251C14.0305 6.41251 13.7769 6.51774 13.59 6.70499L9.00002 11.295C8.61002 11.685 8.61002 12.315 9.00002 12.705L13.59 17.295C13.98 17.685 14.61 17.685 15 17.295C15.39 16.905 15.39 16.275 15 15.885L11.12 11.995L15 8.11499C15.39 7.72499 15.38 7.08499 15 6.70499Z"/>\n </g>\n <title>Chevron left</title>\n</svg>\n'),t("omrs-icon-chevron-right",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <g id="icon/navigation/chevron_right_24px">\n <path id="icon/navigation/chevron_right_24px_2" d="M9.00002 6.71063C8.61002 7.10063 8.61002 7.73063 9.00002 8.12063L12.88 12.0006L9.00002 15.8806C8.61002 16.2706 8.61002 16.9006 9.00002 17.2906C9.39002 17.6806 10.02 17.6806 10.41 17.2906L15 12.7006C15.39 12.3106 15.39 11.6806 15 11.2906L10.41 6.70063C10.03 6.32063 9.39002 6.32063 9.00002 6.71063Z"/>\n </g>\n <title>Chevron right</title>\n</svg>\n'),t("omrs-icon-chevron-up",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <g id="icon/navigation/chevron_up_24px">\n <path d="M11.29 8.71L6.7 13.3c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 10.83l3.88 3.88c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L12.7 8.71c-.38-.39-1.02-.39-1.41 0z"/>\n </g>\n <title>Chevron up</title>\n</svg>\n'),t("omrs-icon-chevron-down",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <g id="icon/navigation/chevron_down_24px">\n <path id="icon/navigation/chevron_down_24px" d="M8.12 9.29L12 13.17l3.88-3.88c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41l-4.59 4.59c-.39.39-1.02.39-1.41 0L6.7 10.7c-.39-.39-.39-1.02 0-1.41.39-.38 1.03-.39 1.42 0z"/>\n </g>\n <title>Chevron down</title>\n</svg>\n'),t("omrs-icon-supervised-user-circle",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <g id="icon/action/supervised_user_circle_24px">\n <path id="icon/action/supervised_user_circle_24px_2" fill-rule="evenodd" clip-rule="evenodd" d="M12 2C6.47998 2 2 6.48001 2 12C2 17.52 6.47998 22 12 22C17.52 22 22 17.52 22 12C22 6.48001 17.52 2 12 2ZM15.61 8.34C16.6801 8.34 17.54 9.19998 17.54 10.27C17.54 11.34 16.6801 12.2 15.61 12.2C14.54 12.2 13.6801 11.34 13.6801 10.27C13.67 9.19998 14.54 8.34 15.61 8.34ZM11.97 9.12C11.97 7.82001 10.91 6.76001 9.60999 6.76001C8.30005 6.76001 7.25 7.81 7.25 9.12C7.25 10.42 8.31006 11.48 9.60999 11.48C10.91 11.48 11.97 10.42 11.97 9.12ZM9.60999 15.89V19.64C7.20996 18.89 5.30994 17.04 4.46997 14.68C5.52002 13.56 8.14001 12.99 9.60999 12.99C10.14 12.99 10.8099 13.07 11.51 13.21C9.87 14.08 9.60999 15.23 9.60999 15.89ZM11.21 19.96C11.47 19.99 11.73 20 12 20C15.39 20 18.2799 17.88 19.45 14.91C18.5299 14.15 16.6799 13.76 15.61 13.76C14.1499 13.76 11.21 14.47 11.21 15.89V19.96Z"/>\n </g>\n <title>Supervised user circle rounded</title>\n</svg>\n'),t("omrs-icon-home",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n<g id="icon/navigation/home_24px">\n <path id="icon/navigation/home_24px" d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z"/>\n</g>\n<title>Home rounded</title>\n</svg>'),t("omrs-icon-close",'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">\n <path d="M18.3 5.71c-.39-.39-1.02-.39-1.41 0L12 10.59 7.11 5.7c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4z"/>\n <title>Close icon</title>\n</svg>'),t("omrs-icon-important-notification",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <g id="icon/important_notification_24px_rounded">\n <path d="M12 23c1.1 0 1.99-.89 1.99-1.99h-3.98c0 1.1.89 1.99 1.99 1.99zm8.29-4.71L19 17v-6c0-3.35-2.36-6.15-5.5-6.83V3c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v1.17C7.36 4.85 5 7.65 5 11v6l-1.29 1.29c-.63.63-.19 1.71.7 1.71h15.17c.9 0 1.34-1.08.71-1.71zM13 16h-2v-2h2v2zm0-5c0 .55-.45 1-1 1s-1-.45-1-1V9c0-.55.45-1 1-1s1 .45 1 1v2z"/>\n </g>\n <title>Important notification</title>\n</svg>\n'),t("omrs-icon-calendar",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <g id="icon/callend/calendar24px">\n <path d="M20 3h-1V2c0-.55-.45-1-1-1s-1 .45-1 1v1H7V2c0-.55-.45-1-1-1s-1 .45-1 1v1H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-1 18H5c-.55 0-1-.45-1-1V8h16v12c0 .55-.45 1-1 1z"/>\n </g>\n <title>Calendar rounded</title>\n</svg>'),t("omrs-icon-access-time",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <g id="icon/callend/access_time24px">\n <path id="icon/callend/access_time24px" d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm-.22-13h-.06c-.4 0-.72.32-.72.72v4.72c0 .35.18.68.49.86l4.15 2.49c.34.2.78.1.98-.24.21-.34.1-.79-.25-.99l-3.87-2.3V7.72c0-.4-.32-.72-.72-.72z" />\n </g>\n <title>Access time rounded</title>\n</svg>'),t("omrs-icon-add",'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">\n <g id="icon/content/add-24px">\n <path d="M18 13h-5v5c0 .55-.45 1-1 1s-1-.45-1-1v-5H6c-.55 0-1-.45-1-1s.45-1 1-1h5V6c0-.55.45-1 1-1s1 .45 1 1v5h5c.55 0 1 .45 1 1s-.45 1-1 1z"/>\n </g>\n <title>Add rounded</title>\n</svg>\n'),t("omrs-icon-remove",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <g id="icon/content/add-24px">\n <path d="M18 13H6c-.55 0-1-.45-1-1s.45-1 1-1h12c.55 0 1 .45 1 1s-.45 1-1 1z"/>\n </g>\n <title>Remove rounded</title>\n</svg>\n'),t("omrs-icon-check-circle",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/>\n <title>Check circle</title>\n</svg>\n'),t("omrs-icon-zoomoutmap",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <g id="icon/action/visibility_24px">\n <path d="M15.85 3.85L17.3 5.3l-2.18 2.16c-.39.39-.39 1.03 0 1.42.39.39 1.03.39 1.42 0L18.7 6.7l1.45 1.45c.31.31.85.09.85-.36V3.5c0-.28-.22-.5-.5-.5h-4.29c-.45 0-.67.54-.36.85zm-12 4.3L5.3 6.7l2.16 2.18c.39.39 1.03.39 1.42 0 .39-.39.39-1.03 0-1.42L6.7 5.3l1.45-1.45c.31-.31.09-.85-.36-.85H3.5c-.28 0-.5.22-.5.5v4.29c0 .45.54.67.85.36zm4.3 12L6.7 18.7l2.18-2.16c.39-.39.39-1.03 0-1.42-.39-.39-1.03-.39-1.42 0L5.3 17.3l-1.45-1.45c-.31-.31-.85-.09-.85.36v4.29c0 .28.22.5.5.5h4.29c.45 0 .67-.54.36-.85zm12-4.3L18.7 17.3l-2.16-2.18c-.39-.39-1.03-.39-1.42 0-.39.39-.39 1.03 0 1.42l2.18 2.16-1.45 1.45c-.31.31-.09.85.36.85h4.29c.28 0 .5-.22.5-.5v-4.29c0-.45-.54-.67-.85-.36z" />\n </g>\n <title>\n Zoom Out \n </title>\n</svg>'),t("omrs-icon-location",'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24">\n <path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"/>\n <path d="M0 0h24v24H0z" class="omrs-icon-location"/>\n <title>Location icon</title>\n</svg>'),t("omrs-icon-download",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">\n <path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM17 13l-5 5-5-5h3V9h4v4h3z" />\n <title>Download icon</title>\n</svg>')}(),S.r(O),O}())}}}))},4507:()=>{function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function r(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}function o(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||u(e,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.")}()}function a(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||u(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 u(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(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}System.register(["dayjs","i18next"],(function(e,n){var u={},c={};return{setters:[function(e){u.default=e.default},function(e){c.default=e.default}],execute:function(){e(function(){var e={332:function(e){e.exports=function(){"use strict";return function(e,t,n){t.prototype.isToday=function(){var e="YYYY-MM-DD",t=n();return this.format(e)===t.format(e)}}}()},14:function(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,o,i){var a=o.prototype;i.utc=function(e){return new o({date:e,utc:!0,args:arguments})},a.utc=function(t){var n=i(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},a.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var u=a.parse;a.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),u.call(this,e)};var c=a.init;a.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else c.call(this)};var s=a.utcOffset;a.utcOffset=function(r,o){var i=this.$utils().u;if(i(r))return this.$u?0:i(this.$offset)?s.call(this):this.$offset;if("string"==typeof r&&(r=function(e){void 0===e&&(e="");var r=e.match(t);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 c=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(u=this.local().add(a+c,e)).$offset=a,u.$x.$localOffset=c}else u=this.utc();return u};var l=a.format;a.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return l.call(this,t)},a.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},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(e){return"s"===e&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():f.call(this)};var d=a.diff;a.diff=function(e,t,n){if(e&&this.$u===e.$u)return d.call(this,e,t,n);var r=this.local(),o=i(e).local();return d.call(r,o,t,n)}}}()},74:function(e,n,i){var a=Symbol("SemVer ANY"),u=function(){"use strict";function e(n,r){if(t(this,e),r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),o(n,e)){if(n.loose===!!r.loose)return n;n=n.value}d("comparator",n,r),this.options=r,this.loose=!!r.loose,this.parse(n),this.semver===a?this.value="":this.value=this.operator+this.semver.version,d("comp",this)}return r(e,[{key:"parse",value:function(e){var t=this.options.loose?s[l.COMPARATORLOOSE]:s[l.COMPARATOR],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: ".concat(e));this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new p(n[2],this.options.loose):this.semver=a}},{key:"toString",value:function(){return this.value}},{key:"test",value:function(e){if(d("Comparator.test",e,this.options.loose),this.semver===a||e===a)return!0;if("string"==typeof e)try{e=new p(e,this.options)}catch(e){return!1}return f(e,this.operator,this.semver,this.options)}},{key:"intersects",value:function(t,n){if(!o(t,e))throw new TypeError("a Comparator is required");if(n&&"object"==typeof n||(n={loose:!!n,includePrerelease:!1}),""===this.operator)return""===this.value||new h(t.value,n).test(this.value);if(""===t.operator)return""===t.value||new h(this.value,n).test(t.semver);var r=!(">="!==this.operator&&">"!==this.operator||">="!==t.operator&&">"!==t.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==t.operator&&"<"!==t.operator),a=this.semver.version===t.semver.version,u=!(">="!==this.operator&&"<="!==this.operator||">="!==t.operator&&"<="!==t.operator),c=f(this.semver,"<",t.semver,n)&&(">="===this.operator||">"===this.operator)&&("<="===t.operator||"<"===t.operator),s=f(this.semver,">",t.semver,n)&&("<="===this.operator||"<"===this.operator)&&(">="===t.operator||">"===t.operator);return r||i||a&&u||c||s}}],[{key:"ANY",get:function(){return a}}]),e}();e.exports=u;var c=i(887),s=c.re,l=c.t,f=i(401),d=i(843),p=i(405),h=i(355)},355:function(e,n,i){var a=function(){"use strict";function e(n,r){var i=this;if(t(this,e),r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),o(n,e))return n.loose===!!r.loose&&n.includePrerelease===!!r.includePrerelease?n:new e(n.raw,r);if(o(n,u))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(e){return i.parseRange(e.trim())})).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(n));this.format()}return r(e,[{key:"format",value:function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range}},{key:"toString",value:function(){return this.range}},{key:"parseRange",value:function(e){var t=this,n=this.options.loose;e=e.trim();var r=n?f[d.HYPHENRANGELOOSE]:f[d.HYPHENRANGE];e=e.replace(r,P(this.options.includePrerelease)),c("hyphen replace",e),e=e.replace(f[d.COMPARATORTRIM],p),c("comparator trim",e,f[d.COMPARATORTRIM]),e=(e=(e=e.replace(f[d.TILDETRIM],h)).replace(f[d.CARETTRIM],y)).split(/\s+/).join(" ");var o=n?f[d.COMPARATORLOOSE]:f[d.COMPARATOR];return e.split(" ").map((function(e){return b(e,t.options)})).join(" ").split(/\s+/).map((function(e){return j(e,t.options)})).filter(this.options.loose?function(e){return!!e.match(o)}:function(){return!0}).map((function(e){return new u(e,t.options)}))}},{key:"intersects",value:function(t,n){if(!o(t,e))throw new TypeError("a Range is required");return this.set.some((function(e){return v(e,n)&&t.set.some((function(t){return v(t,n)&&e.every((function(e){return t.every((function(t){return e.intersects(t,n)}))}))}))}))}},{key:"test",value:function(e){if(!e)return!1;if("string"==typeof e)try{e=new s(e,this.options)}catch(e){return!1}for(var t=0;t<this.set.length;t++)if(k(this.set[t],e,this.options))return!0;return!1}}]),e}();e.exports=a;var u=i(74),c=i(843),s=i(405),l=i(887),f=l.re,d=l.t,p=l.comparatorTrimReplace,h=l.tildeTrimReplace,y=l.caretTrimReplace,v=function(e,t){for(var n=!0,r=e.slice(),o=r.pop();n&&r.length;)n=r.every((function(e){return o.intersects(e,t)})),o=r.pop();return n},b=function(e,t){return c("comp",e,t),e=S(e,t),c("caret",e),e=g(e,t),c("tildes",e),e=_(e,t),c("xrange",e),e=x(e,t),c("stars",e),e},m=function(e){return!e||"x"===e.toLowerCase()||"*"===e},g=function(e,t){return e.trim().split(/\s+/).map((function(e){return w(e,t)})).join(" ")},w=function(e,t){var n=t.loose?f[d.TILDELOOSE]:f[d.TILDE];return e.replace(n,(function(t,n,r,o,i){var a;return c("tilde",e,t,n,r,o,i),m(n)?a="":m(r)?a=">=".concat(n,".0.0 <").concat(+n+1,".0.0-0"):m(o)?a=">=".concat(n,".").concat(r,".0 <").concat(n,".").concat(+r+1,".0-0"):i?(c("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"),c("tilde return",a),a}))},S=function(e,t){return e.trim().split(/\s+/).map((function(e){return O(e,t)})).join(" ")},O=function(e,t){c("caret",e,t);var n=t.loose?f[d.CARETLOOSE]:f[d.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,(function(t,n,o,i,a){var u;return c("caret",e,t,n,o,i,a),m(n)?u="":m(o)?u=">=".concat(n,".0.0").concat(r," <").concat(+n+1,".0.0-0"):m(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?(c("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")):(c("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")),c("caret return",u),u}))},_=function(e,t){return c("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return E(e,t)})).join(" ")},E=function(e,t){e=e.trim();var n=t.loose?f[d.XRANGELOOSE]:f[d.XRANGE];return e.replace(n,(function(n,r,o,i,a,u){c("xRange",e,n,r,o,i,a,u);var s=m(o),l=s||m(i),f=l||m(a),d=f;return"="===r&&d&&(r=""),u=t.includePrerelease?"-0":"",s?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(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")),c("xRange return",n),n}))},x=function(e,t){return c("replaceStars",e,t),e.trim().replace(f[d.STAR],"")},j=function(e,t){return c("replaceGTE0",e,t),e.trim().replace(f[t.includePrerelease?d.GTE0PRE:d.GTE0],"")},P=function(e){return function(t,n,r,o,i,a,u,c,s,l,f,d,p){return"".concat(n=m(r)?"":m(o)?">=".concat(r,".0.0").concat(e?"-0":""):m(i)?">=".concat(r,".").concat(o,".0").concat(e?"-0":""):a?">=".concat(n):">=".concat(n).concat(e?"-0":"")," ").concat(c=m(s)?"":m(l)?"<".concat(+s+1,".0.0-0"):m(f)?"<".concat(s,".").concat(+l+1,".0-0"):d?"<=".concat(s,".").concat(l,".").concat(f,"-").concat(d):e?"<".concat(s,".").concat(l,".").concat(+f+1,"-0"):"<=".concat(c)).trim()}},k=function(e,t,n){for(var r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(var o=0;o<e.length;o++)if(c(e[o].semver),e[o].semver!==u.ANY&&e[o].semver.prerelease.length>0){var i=e[o].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}},405:function(e,n,i){var a=i(843),u=i(202),c=u.MAX_LENGTH,s=u.MAX_SAFE_INTEGER,l=i(887),f=l.re,d=l.t,p=i(630).compareIdentifiers,h=function(){"use strict";function e(n,r){if(t(this,e),r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),o(n,e)){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>c)throw new TypeError("version is longer than ".concat(c," characters"));a("SemVer",n,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;var i=n.trim().match(r.loose?f[d.LOOSE]:f[d.FULL]);if(!i)throw new TypeError("Invalid Version: ".concat(n));if(this.raw=n,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t<s)return t}return e})):this.prerelease=[],this.build=i[5]?i[5].split("."):[],this.format()}return r(e,[{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(t){if(a("SemVer.compare",this.version,this.options,t),!o(t,e)){if("string"==typeof t&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}},{key:"compareMain",value:function(t){return o(t,e)||(t=new e(t,this.options)),p(this.major,t.major)||p(this.minor,t.minor)||p(this.patch,t.patch)}},{key:"comparePre",value:function(t){if(o(t,e)||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;var n=0;do{var r=this.prerelease[n],i=t.prerelease[n];if(a("prerelease compare",n,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return p(r,i)}while(++n)}},{key:"compareBuild",value:function(t){o(t,e)||(t=new e(t,this.options));var n=0;do{var r=this.build[n],i=t.build[n];if(a("prerelease compare",n,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return p(r,i)}while(++n)}},{key:"inc",value:function(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);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)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: ".concat(e))}return this.format(),this.raw=this.version,this}}]),e}();e.exports=h},953:function(e,t,n){var r=n(497);e.exports=function(e,t){var n=r(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}},401:function(e,t,n){var r=n(896),o=n(378),i=n(261),a=n(647),u=n(433),c=n(622);e.exports=function(e,t,n,s){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return r(e,n,s);case"!=":return o(e,n,s);case">":return i(e,n,s);case">=":return a(e,n,s);case"<":return u(e,n,s);case"<=":return c(e,n,s);default:throw new TypeError("Invalid operator: ".concat(t))}}},839:function(e,t,n){var r=n(405),i=n(497),a=n(887),u=a.re,c=a.t;e.exports=function(e,t){if(o(e,r))return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;var n=null;if((t=t||{}).rtl){for(var a;(a=u[c.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&a.index+a[0].length===n.index+n[0].length||(n=a),u[c.COERCERTL].lastIndex=a.index+a[1].length+a[2].length;u[c.COERCERTL].lastIndex=-1}else n=e.match(u[c.COERCE]);return null===n?null:i("".concat(n[2],".").concat(n[3]||"0",".").concat(n[4]||"0"),t)}},218:function(e,t,n){var r=n(405);e.exports=function(e,t,n){var o=new r(e,n),i=new r(t,n);return o.compare(i)||o.compareBuild(i)}},643:function(e,t,n){var r=n(308);e.exports=function(e,t){return r(e,t,!0)}},308:function(e,t,n){var r=n(405);e.exports=function(e,t,n){return new r(e,n).compare(new r(t,n))}},948:function(e,t,n){var r=n(497),o=n(896);e.exports=function(e,t){if(o(e,t))return null;var n=r(e),i=r(t),a=n.prerelease.length||i.prerelease.length,u=a?"pre":"",c=a?"prerelease":"";for(var s in n)if(("major"===s||"minor"===s||"patch"===s)&&n[s]!==i[s])return u+s;return c}},896:function(e,t,n){var r=n(308);e.exports=function(e,t,n){return 0===r(e,t,n)}},261:function(e,t,n){var r=n(308);e.exports=function(e,t,n){return r(e,t,n)>0}},647:function(e,t,n){var r=n(308);e.exports=function(e,t,n){return r(e,t,n)>=0}},791:function(e,t,n){var r=n(405);e.exports=function(e,t,n,o){"string"==typeof n&&(o=n,n=void 0);try{return new r(e,n).inc(t,o).version}catch(e){return null}}},433:function(e,t,n){var r=n(308);e.exports=function(e,t,n){return r(e,t,n)<0}},622:function(e,t,n){var r=n(308);e.exports=function(e,t,n){return r(e,t,n)<=0}},629:function(e,t,n){var r=n(405);e.exports=function(e,t){return new r(e,t).major}},986:function(e,t,n){var r=n(405);e.exports=function(e,t){return new r(e,t).minor}},378:function(e,t,n){var r=n(308);e.exports=function(e,t,n){return 0!==r(e,t,n)}},497:function(e,t,n){var r=n(202).MAX_LENGTH,i=n(887),a=i.re,u=i.t,c=n(405);e.exports=function(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),o(e,c))return e;if("string"!=typeof e)return null;if(e.length>r)return null;if(!(t.loose?a[u.LOOSE]:a[u.FULL]).test(e))return null;try{return new c(e,t)}catch(e){return null}}},800:function(e,t,n){var r=n(405);e.exports=function(e,t){return new r(e,t).patch}},408:function(e,t,n){var r=n(497);e.exports=function(e,t){var n=r(e,t);return n&&n.prerelease.length?n.prerelease:null}},762:function(e,t,n){var r=n(308);e.exports=function(e,t,n){return r(t,e,n)}},743:function(e,t,n){var r=n(218);e.exports=function(e,t){return e.sort((function(e,n){return r(n,e,t)}))}},312:function(e,t,n){var r=n(355);e.exports=function(e,t,n){try{t=new r(t,n)}catch(e){return!1}return t.test(e)}},354:function(e,t,n){var r=n(218);e.exports=function(e,t){return e.sort((function(e,n){return r(e,n,t)}))}},512:function(e,t,n){var r=n(497);e.exports=function(e,t){var n=r(e,t);return n?n.version:null}},770:function(e,t,n){var r=n(887);e.exports={re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:n(202).SEMVER_SPEC_VERSION,SemVer:n(405),compareIdentifiers:n(630).compareIdentifiers,rcompareIdentifiers:n(630).rcompareIdentifiers,parse:n(497),valid:n(512),clean:n(953),inc:n(791),diff:n(948),major:n(629),minor:n(986),patch:n(800),prerelease:n(408),compare:n(308),rcompare:n(762),compareLoose:n(643),compareBuild:n(218),sort:n(354),rsort:n(743),gt:n(261),lt:n(433),eq:n(896),neq:n(378),gte:n(647),lte:n(622),cmp:n(401),coerce:n(839),Comparator:n(74),Range:n(355),satisfies:n(312),toComparators:n(663),maxSatisfying:n(931),minSatisfying:n(891),minVersion:n(925),validRange:n(965),outside:n(260),gtr:n(715),ltr:n(6),intersects:n(560),simplifyRange:n(795),subset:n(732)}},202:function(e){var t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:t,MAX_SAFE_COMPONENT_LENGTH:16}},843:function(e){var t,n="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=console).error.apply(t,["SEMVER"].concat(a(n)))}:function(){};e.exports=n},630:function(e){var t=/^[0-9]+$/,n=function(e,n){var r=t.test(e),o=t.test(n);return r&&o&&(e=+e,n=+n),e===n?0:r&&!o?-1:o&&!r?1:e<n?-1:1};e.exports={compareIdentifiers:n,rcompareIdentifiers:function(e,t){return n(t,e)}}},887:function(e,t,n){var r=n(202).MAX_SAFE_COMPONENT_LENGTH,o=n(843),i=(t=e.exports={}).re=[],a=t.src=[],u=t.t={},c=0,s=function(e,t,n){var r=c++;o(r,t),u[e]=r,a[r]=t,i[r]=new RegExp(t,n?"g":void 0)};s("NUMERICIDENTIFIER","0|[1-9]\\d*"),s("NUMERICIDENTIFIERLOOSE","[0-9]+"),s("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),s("MAINVERSION","(".concat(a[u.NUMERICIDENTIFIER],")\\.(").concat(a[u.NUMERICIDENTIFIER],")\\.(").concat(a[u.NUMERICIDENTIFIER],")")),s("MAINVERSIONLOOSE","(".concat(a[u.NUMERICIDENTIFIERLOOSE],")\\.(").concat(a[u.NUMERICIDENTIFIERLOOSE],")\\.(").concat(a[u.NUMERICIDENTIFIERLOOSE],")")),s("PRERELEASEIDENTIFIER","(?:".concat(a[u.NUMERICIDENTIFIER],"|").concat(a[u.NONNUMERICIDENTIFIER],")")),s("PRERELEASEIDENTIFIERLOOSE","(?:".concat(a[u.NUMERICIDENTIFIERLOOSE],"|").concat(a[u.NONNUMERICIDENTIFIER],")")),s("PRERELEASE","(?:-(".concat(a[u.PRERELEASEIDENTIFIER],"(?:\\.").concat(a[u.PRERELEASEIDENTIFIER],")*))")),s("PRERELEASELOOSE","(?:-?(".concat(a[u.PRERELEASEIDENTIFIERLOOSE],"(?:\\.").concat(a[u.PRERELEASEIDENTIFIERLOOSE],")*))")),s("BUILDIDENTIFIER","[0-9A-Za-z-]+"),s("BUILD","(?:\\+(".concat(a[u.BUILDIDENTIFIER],"(?:\\.").concat(a[u.BUILDIDENTIFIER],")*))")),s("FULLPLAIN","v?".concat(a[u.MAINVERSION]).concat(a[u.PRERELEASE],"?").concat(a[u.BUILD],"?")),s("FULL","^".concat(a[u.FULLPLAIN],"$")),s("LOOSEPLAIN","[v=\\s]*".concat(a[u.MAINVERSIONLOOSE]).concat(a[u.PRERELEASELOOSE],"?").concat(a[u.BUILD],"?")),s("LOOSE","^".concat(a[u.LOOSEPLAIN],"$")),s("GTLT","((?:<|>)?=?)"),s("XRANGEIDENTIFIERLOOSE","".concat(a[u.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),s("XRANGEIDENTIFIER","".concat(a[u.NUMERICIDENTIFIER],"|x|X|\\*")),s("XRANGEPLAIN","[v=\\s]*(".concat(a[u.XRANGEIDENTIFIER],")(?:\\.(").concat(a[u.XRANGEIDENTIFIER],")(?:\\.(").concat(a[u.XRANGEIDENTIFIER],")(?:").concat(a[u.PRERELEASE],")?").concat(a[u.BUILD],"?)?)?")),s("XRANGEPLAINLOOSE","[v=\\s]*(".concat(a[u.XRANGEIDENTIFIERLOOSE],")(?:\\.(").concat(a[u.XRANGEIDENTIFIERLOOSE],")(?:\\.(").concat(a[u.XRANGEIDENTIFIERLOOSE],")(?:").concat(a[u.PRERELEASELOOSE],")?").concat(a[u.BUILD],"?)?)?")),s("XRANGE","^".concat(a[u.GTLT],"\\s*").concat(a[u.XRANGEPLAIN],"$")),s("XRANGELOOSE","^".concat(a[u.GTLT],"\\s*").concat(a[u.XRANGEPLAINLOOSE],"$")),s("COERCE","(^|[^\\d])(\\d{1,".concat(r,"})(?:\\.(\\d{1,").concat(r,"}))?(?:\\.(\\d{1,").concat(r,"}))?(?:$|[^\\d])")),s("COERCERTL",a[u.COERCE],!0),s("LONETILDE","(?:~>?)"),s("TILDETRIM","(\\s*)".concat(a[u.LONETILDE],"\\s+"),!0),t.tildeTrimReplace="$1~",s("TILDE","^".concat(a[u.LONETILDE]).concat(a[u.XRANGEPLAIN],"$")),s("TILDELOOSE","^".concat(a[u.LONETILDE]).concat(a[u.XRANGEPLAINLOOSE],"$")),s("LONECARET","(?:\\^)"),s("CARETTRIM","(\\s*)".concat(a[u.LONECARET],"\\s+"),!0),t.caretTrimReplace="$1^",s("CARET","^".concat(a[u.LONECARET]).concat(a[u.XRANGEPLAIN],"$")),s("CARETLOOSE","^".concat(a[u.LONECARET]).concat(a[u.XRANGEPLAINLOOSE],"$")),s("COMPARATORLOOSE","^".concat(a[u.GTLT],"\\s*(").concat(a[u.LOOSEPLAIN],")$|^$")),s("COMPARATOR","^".concat(a[u.GTLT],"\\s*(").concat(a[u.FULLPLAIN],")$|^$")),s("COMPARATORTRIM","(\\s*)".concat(a[u.GTLT],"\\s*(").concat(a[u.LOOSEPLAIN],"|").concat(a[u.XRANGEPLAIN],")"),!0),t.comparatorTrimReplace="$1$2$3",s("HYPHENRANGE","^\\s*(".concat(a[u.XRANGEPLAIN],")\\s+-\\s+(").concat(a[u.XRANGEPLAIN],")\\s*$")),s("HYPHENRANGELOOSE","^\\s*(".concat(a[u.XRANGEPLAINLOOSE],")\\s+-\\s+(").concat(a[u.XRANGEPLAINLOOSE],")\\s*$")),s("STAR","(<|>)?=?\\s*\\*"),s("GTE0","^\\s*>=\\s*0.0.0\\s*$"),s("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")},715:function(e,t,n){var r=n(260);e.exports=function(e,t,n){return r(e,t,">",n)}},560:function(e,t,n){var r=n(355);e.exports=function(e,t,n){return e=new r(e,n),t=new r(t,n),e.intersects(t)}},6:function(e,t,n){var r=n(260);e.exports=function(e,t,n){return r(e,t,"<",n)}},931:function(e,t,n){var r=n(405),o=n(355);e.exports=function(e,t,n){var i=null,a=null,u=null;try{u=new o(t,n)}catch(e){return null}return e.forEach((function(e){u.test(e)&&(i&&-1!==a.compare(e)||(a=new r(i=e,n)))})),i}},891:function(e,t,n){var r=n(405),o=n(355);e.exports=function(e,t,n){var i=null,a=null,u=null;try{u=new o(t,n)}catch(e){return null}return e.forEach((function(e){u.test(e)&&(i&&1!==a.compare(e)||(a=new r(i=e,n)))})),i}},925:function(e,t,n){var r=n(405),o=n(355),i=n(261);e.exports=function(e,t){e=new o(e,t);var n=new r("0.0.0");if(e.test(n))return n;if(n=new r("0.0.0-0"),e.test(n))return n;n=null;for(var a=0;a<e.set.length;++a)e.set[a].forEach((function(e){var t=new r(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":n&&!i(n,t)||(n=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: ".concat(e.operator))}}));return n&&e.test(n)?n:null}},260:function(e,t,n){var r=n(405),o=n(74),i=o.ANY,a=n(355),u=n(312),c=n(261),s=n(433),l=n(622),f=n(647);e.exports=function(e,t,n,d){var p,h,y,v,b;switch(e=new r(e,d),t=new a(t,d),n){case">":p=c,h=l,y=s,v=">",b=">=";break;case"<":p=s,h=f,y=c,v="<",b="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(u(e,t,d))return!1;for(var m=0;m<t.set.length;++m){var g=t.set[m],w=null,S=null;if(g.forEach((function(e){e.semver===i&&(e=new o(">=0.0.0")),w=w||e,S=S||e,p(e.semver,w.semver,d)?w=e:y(e.semver,S.semver,d)&&(S=e)})),w.operator===v||w.operator===b)return!1;if((!S.operator||S.operator===v)&&h(e,S.semver))return!1;if(S.operator===b&&y(e,S.semver))return!1}return!0}},795:function(e,t,n){var r=n(312),o=n(308);e.exports=function(e,t,n){var a=[],u=null,c=null,s=e.sort((function(e,t){return o(e,t,n)})),l=!0,f=!1,d=void 0;try{for(var p,h=s[Symbol.iterator]();!(l=(p=h.next()).done);l=!0){var y=p.value;r(y,t,n)?(c=y,u||(u=y)):(c&&a.push([u,c]),c=null,u=null)}}catch(e){f=!0,d=e}finally{try{l||null==h.return||h.return()}finally{if(f)throw d}}u&&a.push([u,null]);var v=[],b=!0,m=!1,g=void 0;try{for(var w,S=a[Symbol.iterator]();!(b=(w=S.next()).done);b=!0){var O=i(w.value,2),_=O[0],E=O[1];_===E?v.push(_):E||_!==s[0]?E?_===s[0]?v.push("<=".concat(E)):v.push("".concat(_," - ").concat(E)):v.push(">=".concat(_)):v.push("*")}}catch(e){m=!0,g=e}finally{try{b||null==S.return||S.return()}finally{if(m)throw g}}var x=v.join(" || "),j="string"==typeof t.raw?t.raw:String(t);return x.length<j.length?x:t}},732:function(e,t,n){var r=n(355),o=n(74).ANY,i=n(312),a=n(308),u=function(e,t,n){if(1===e.length&&e[0].semver===o)return 1===t.length&&t[0].semver===o;var r,u,l,f,d,p=new Set,h=!0,y=!1,v=void 0;try{for(var b,m=e[Symbol.iterator]();!(h=(b=m.next()).done);h=!0){var g=b.value;">"===g.operator||">="===g.operator?r=c(r,g,n):"<"===g.operator||"<="===g.operator?u=s(u,g,n):p.add(g.semver)}}catch(e){y=!0,v=e}finally{try{h||null==m.return||m.return()}finally{if(y)throw v}}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=p[Symbol.iterator]();!(w=(_=E.next()).done);w=!0){var x=_.value;if(r&&!i(x,String(r),n))return null;if(u&&!i(x,String(u),n))return null;var j=!0,P=!1,k=void 0;try{for(var C,A=t[Symbol.iterator]();!(j=(C=A.next()).done);j=!0){var T=C.value;if(!i(x,String(T),n))return!1}}catch(e){P=!0,k=e}finally{try{j||null==A.return||A.return()}finally{if(P)throw k}}return!0}}catch(e){S=!0,O=e}finally{try{w||null==E.return||E.return()}finally{if(S)throw O}}var I=!0,D=!1,M=void 0;try{for(var R,N=t[Symbol.iterator]();!(I=(R=N.next()).done);I=!0){var L=R.value;if(d=d||">"===L.operator||">="===L.operator,f=f||"<"===L.operator||"<="===L.operator,r)if(">"===L.operator||">="===L.operator){if(c(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(s(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(e){D=!0,M=e}finally{try{I||null==N.return||N.return()}finally{if(D)throw M}}return!(r&&f&&!u&&0!==l||u&&d&&!r&&0!==l)},c=function(e,t,n){if(!e)return t;var r=a(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},s=function(e,t,n){if(!e)return t;var r=a(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=function(e,t,n){e=new r(e,n),t=new r(t,n);var o=!1,i=!0,a=!1,c=void 0;try{e:for(var s,l=e.set[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var f=s.value,d=!0,p=!1,h=void 0;try{for(var y,v=t.set[Symbol.iterator]();!(d=(y=v.next()).done);d=!0){var b=y.value,m=u(f,b,n);if(o=o||null!==m,m)continue e}}catch(e){p=!0,h=e}finally{try{d||null==v.return||v.return()}finally{if(p)throw h}}if(o)return!1}}catch(e){a=!0,c=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw c}}return!0}},663:function(e,t,n){var r=n(355);e.exports=function(e,t){return new r(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))}},965:function(e,t,n){var r=n(355);e.exports=function(e,t){try{return new r(e,t).range||"*"}catch(e){return null}}},688:function(e){"use strict";e.exports=u},64:function(e){"use strict";e.exports=c}},n={};function s(t){var r=n[t];if(void 0!==r)return r.exports;var o=n[t]={exports:{}};return e[t].call(o.exports,o,o.exports,s),o.exports}s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};return function(){"use strict";var e=function(e){return(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())-Date.UTC(e.getUTCFullYear(),0,0))/24/60/60/1e3},t=function(e,t){var n=e.toISOString(),r=t.toISOString();return n.slice(0,n.indexOf("T"))===r.slice(0,r.indexOf("T"))},n=function(n){var r=new Date,o=new Date(n),i=r.getUTCMonth()-o.getUTCMonth(),a=r.getUTCDate()-o.getUTCDate(),u=r.getUTCFullYear()-o.getUTCFullYear();(i<0||0===i&&a<0)&&u--;var c=i>=0?i:i+12;a<0&&c--;var s=c>0?"".concat(c," mo"):"",l=e(r)-e(o);l<0&&(l+=365);var f=Math.floor(l/7),d=l-7*f;return 0===u?t(r,o)?"Today":f<4||0===f?"".concat(l," day"):d>0?"".concat(f," wk ").concat(d," d"):"".concat(f," week"):u<2?"".concat(s," ").concat(u," yr").trim():u<18?"".concat(u," yr ").concat(s).trim():"".concat(u," years")},r=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},o=function(e){for(var t=arguments,n=function(n){var o=null!=t[n]?t[n]:{},i=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(o).filter((function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable})))),i.forEach((function(t){r(e,t,o[t])}))},o=1;o<arguments.length;o++)n(o);return e},i=function(e){return null!=e&&28===e.trim().length&&"T"===(e=e.trim())[10]&&":"===e[13]&&":"===e[16]&&"."===e[19]&&"+"===e[23]&&":"!==e[26]&&(0,T.default)(e,N).isValid()},a=function(e){return(0,T.default)(e).isToday()},u=function(e){return i(e)?(0,T.default)(e,N).toDate():null},c=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=(0,T.default)(e);return t&&(n=n.utc()),n.format(N)},f=function(e){return(0,T.default)(e).format("HH:mm")},d=function(e){return T.default.utc(e).format("HH:mm A")},p=function(e){return y(e,"DD - MMM - YYYY")},h=function(e){return y(e,"DD-MMM")},y=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"YYYY-MMM-DD";return(0,T.default)(e).format(t)},v=function(e){return(0,T.default)(e).toDate()},b=function(e,t){var n,r=o({},L,t),i=r.mode,a=r.time,u=r.day,c=r.year,s=r.noToday,l={year:c?"numeric":void 0,month:"short",day:u?"2-digit":void 0},f=w(),d=(0,T.default)(e).isToday();if(d&&!s)n=(n=new Intl.RelativeTimeFormat(f,{numeric:"auto"}).format(0,"day"))[0].toLocaleUpperCase(f)+n.slice(1);else if("en"==f&&(f="en-GB"),n=e.toLocaleDateString(f,l),"en-GB"==f&&"standard"==i&&c&&u&&(n=n.replace(/ /g,"-")),"wide"==i&&(n=n.replace(/ /g," — "),/ru.*/.test(f))){var p=n.length;n=n.slice(0,p-5)+n.slice(p-5).replace(" — "," ")}return(!0===a||d&&"for today"===a)&&(n+=", ".concat(m(e))),n},m=function(e){return e.toLocaleTimeString(w(),{hour:"2-digit",minute:"2-digit"})},g=function(e,t){return b(e,(n=o({},t),r=null!=(r={time:!0})?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))})),n));var n,r},w=function(){var e=window.i18next.language;return"ht"===(e=e.replace("_","-"))&&(e="fr-HT"),e},S=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},O=function(e,t,n,r){return(U.default.default||U.default).t(t,function(e){for(var t=arguments,n=function(n){var r=null!=t[n]?t[n]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),o.forEach((function(t){S(e,t,r[t])}))},r=1;r<arguments.length;r++)n(r);return e}({ns:e,defaultValue:n},r))},_=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},E=function(e){var t,n=function(e){if(Array.isArray(e))return e}(t=e.split("."))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),3!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t)||function(e,t){if(e){if("string"==typeof e)return _(e,3);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)?_(e,3):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=n[2];return"".concat(r,".").concat(o,".").concat(i)},x=function(e,t){var n=function(e){var t=e.indexOf("-");if(t>=0){var n=E(e.slice(0,t)),r=e.slice(t+1);return"".concat(n,"-").concat(r)}return E(e)}(t);return B.satisfies(n,e,{includePrerelease:!0})},j=function(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)},P=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){j(i,r,o,a,u,"next",e)}function u(e){j(i,r,o,a,u,"throw",e)}a(void 0)}))}},k=function(e,t){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=t.call(e,a)}catch(e){i=[6,e],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])}}},C=function(e){return F.apply(this,arguments)},A=function(e){return V.apply(this,arguments)};s.r(l),s.d(l,{age:function(){return n},daysIntoYear:function(){return e},formatDate:function(){return b},formatDatetime:function(){return g},formatTime:function(){return m},getLocale:function(){return w},isOmrsDateStrict:function(){return i},isOmrsDateToday:function(){return a},isSameDay:function(){return t},isVersionSatisfied:function(){return x},parseDate:function(){return v},retry:function(){return C},toDateObjectStrict:function(){return u},toOmrsDateFormat:function(){return y},toOmrsDayDateFormat:function(){return p},toOmrsIsoString:function(){return c},toOmrsTimeString:function(){return d},toOmrsTimeString24:function(){return f},toOmrsYearlessDateFormat:function(){return h},translateFrom:function(){return O}});var T=s(688),I=s(14),D=s.n(I),M=s(332),R=s.n(M);T.default.extend(D()),T.default.extend(R());var N="YYYY-MM-DDTHH:mm:ss.SSSZZ",L={mode:"standard",time:"for today",day:!0,year:!0,noToday:!1},U=s(64),B=s(770);function F(){return F=P((function(e){var t,n,r,o,i,a,u,c=arguments;return k(this,(function(s){switch(s.label){case 0:n=(t=c.length>1&&void 0!==c[1]?c[1]:{}).shouldRetry,r=t.getDelay,o=t.onError,n=null!=n?n:function(e){return function(e,t){return e<=5}(e)},r=null!=r?r:function(e){return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2]?e+1:e;return t*Math.pow(2,n)}(e,1e3)},i=0,a=void 0,s.label=1;case 1:return s.trys.push([1,4,,5]),[4,A(r(i))];case 2:return s.sent(),[4,e()];case 3:return[2,s.sent()];case 4:return u=s.sent(),null==o||o(u,i),a=u,[3,5];case 5:if(n(i++))return[3,1];s.label=6;case 6:throw a}}))})),F.apply(this,arguments)}function V(){return(V=P((function(e){return k(this,(function(t){return e<=0?[2]:[2,new Promise((function(t){return setTimeout(t,e)}))]}))}))).apply(this,arguments)}}(),l}())}}}))}}]);
|