@openmrs/esm-framework 5.0.2 → 5.0.3-pre.826

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.
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see openmrs-esm-framework.js.LICENSE.txt */
2
- var _openmrs_esm_framework;(()=>{var e,t,n={7840:(e,t,n)=>{System.register(["@openmrs/esm-config","@openmrs/esm-error-handling","@openmrs/esm-offline"],(function(e,t){var r={},o={},i={};return{setters:[function(e){r.Type=e.Type,r.defineConfigSchema=e.defineConfigSchema,r.getConfig=e.getConfig,r.navigate=e.navigate,r.validators=e.validators},function(e){o.reportError=e.reportError},function(e){i.getSynchronizationItems=e.getSynchronizationItems}],execute:function(){e((()=>{var e={403:()=>{System.register([],(function(e,t){return{execute:function(){e((()=>{var e={968:(e,t,n)=>{const r=n(577).R;t.s=function(e){if(e||(e=1),!n.y.meta||!n.y.meta.url)throw console.error("__system_context__",n.y),Error("systemjs-webpack-interop was provided an unknown SystemJS context. Expected context.meta.url, but none was provided");n.p=r(n.y.meta.url,e)}},577:(e,t,n)=>{t.R=function(e,t){var n=document.createElement("a");n.href=e;for(var r="/"===n.pathname[0]?n.pathname:"/"+n.pathname,o=0,i=r.length;o!==t&&i>=0;)"/"===r[--i]&&o++;if(o!==t)throw Error("systemjs-webpack-interop: rootDirectoryLevel ("+t+") is greater than the number of directories ("+o+") in the URL path "+e);var s=r.slice(0,i+1);return n.protocol+"//"+n.host+s},Number.isInteger}},n={};function r(t){var o=n[t];if(void 0!==o)return o.exports;var i=n[t]={exports:{}};return e[t](i,i.exports,r),i.exports}r.y=t,r.d=(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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&!e;)e=n[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})();var o={};return(0,r(968).s)(1),(()=>{"use strict";r.r(o),r.d(o,{createAppState:()=>a,createGlobalStore:()=>i,getAppState:()=>c,getGlobalStore:()=>s,subscribeTo:()=>u});const e=e=>{let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!=typeof o)?o:Object.assign({},t,o),n.forEach((n=>n(t,e)))}},o=()=>t,i={setState:r,getState:o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{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},t=t=>t?e(t):e,n={};function i(e,r){const o=n[e];if(o)return o.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):o.value.setState(r,!0),o.active=!0,o.value;{const o=t()((()=>r));return n[e]={value:o,active:!0},o}}function s(e,r){const o=n[e];if(!o){const o=t()((()=>null!=r?r:{}));return n[e]={value:o,active:!1},o}return o.value}function a(e){return i("app",e)}function c(){return s("app",{})}function u(e,t,n){let r=t(e.getState());return e.subscribe((e=>{const o=t(e);o!==r&&(r=o,n(o))}))}})(),o})())}}}))},968:(e,t,n)=>{const r=n(577).R;t.s=function(e){if(e||(e=1),!n.y.meta||!n.y.meta.url)throw console.error("__system_context__",n.y),Error("systemjs-webpack-interop was provided an unknown SystemJS context. Expected context.meta.url, but none was provided");n.p=r(n.y.meta.url,e)}},577:(e,t,n)=>{t.R=function(e,t){var n=document.createElement("a");n.href=e;for(var r="/"===n.pathname[0]?n.pathname:"/"+n.pathname,o=0,i=r.length;o!==t&&i>=0;)"/"===r[--i]&&o++;if(o!==t)throw Error("systemjs-webpack-interop: rootDirectoryLevel ("+t+") is greater than the number of directories ("+o+") in the URL path "+e);var s=r.slice(0,i+1);return n.protocol+"//"+n.host+s},Number.isInteger},824:e=>{"use strict";e.exports=r},254:e=>{"use strict";e.exports=o},738:e=>{"use strict";e.exports=i}},s={};function a(t){var n=s[t];if(void 0!==n)return n.exports;var r=s[t]={exports:{}};return e[t](r,r.exports,a),r.exports}a.y=t,a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&!e;)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})();var c={};return(0,a(968).s)(1),(()=>{"use strict";a.r(c),a.d(c,{OpenmrsFetchError:()=>G,VisitMode:()=>Me,VisitStatus:()=>Le,backendDependencies:()=>Ke,clearCurrentUser:()=>oe,defaultVisitCustomRepresentation:()=>Te,fetchCurrentPatient:()=>he,fhirBaseUrl:()=>K,getCurrentUser:()=>te,getLocations:()=>Fe,getLoggedInUser:()=>se,getSessionLocation:()=>ae,getSessionStore:()=>ne,getStartedVisit:()=>Ne,getVisitTypes:()=>Ue,getVisitsForPatient:()=>De,makeUrl:()=>q,openmrsFetch:()=>H,openmrsObservableFetch:()=>W,refetchCurrentUser:()=>re,restBaseUrl:()=>F,saveVisit:()=>Ie,sessionEndpoint:()=>V,setSessionLocation:()=>ce,setupApiModule:()=>le,toLocationObject:()=>ze,toVisitTypeObject:()=>Be,updateVisit:()=>Re,userHasAccess:()=>ie});var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};function t(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}function r(e){return"function"==typeof e}var o=!1,i={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){e&&(new Error).stack,o=e},get useDeprecatedSynchronousErrorHandling(){return o}};function s(e){setTimeout((function(){throw e}),0)}var u={closed:!0,next:function(e){},error:function(e){if(i.useDeprecatedSynchronousErrorHandling)throw e;s(e)},complete:function(){}},l=Array.isArray||function(e){return e&&"number"==typeof e.length},f=function(){function e(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}(),p=function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return e.prototype.unsubscribe=function(){var t;if(!this.closed){var n,o=this,i=o._parentOrParents,s=o._ctorUnsubscribe,a=o._unsubscribe,c=o._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,i instanceof e)i.remove(this);else if(null!==i)for(var u=0;u<i.length;++u)i[u].remove(this);if(r(a)){s&&(this._unsubscribe=void 0);try{a.call(this)}catch(e){t=e instanceof f?d(e.errors):[e]}}if(l(c)){u=-1;for(var p=c.length;++u<p;){var h=c[u];if(null!==(n=h)&&"object"==typeof n)try{h.unsubscribe()}catch(e){t=t||[],e instanceof f?t=t.concat(d(e.errors)):t.push(e)}}}if(t)throw new f(t)}},e.prototype.add=function(t){var n=t;if(!t)return e.EMPTY;switch(typeof 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(!(n instanceof e)){var r=n;(n=new e)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}var o=n._parentOrParents;if(null===o)n._parentOrParents=this;else if(o instanceof e){if(o===this)return n;n._parentOrParents=[o,this]}else{if(-1!==o.indexOf(this))return n;o.push(this)}var i=this._subscriptions;return null===i?this._subscriptions=[n]:i.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}();function d(e){return e.reduce((function(e,t){return e.concat(t instanceof f?t.errors:t)}),[])}var h="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random(),y=function(e){function n(t,r,o){var i=e.call(this)||this;switch(i.syncErrorValue=null,i.syncErrorThrown=!1,i.syncErrorThrowable=!1,i.isStopped=!1,arguments.length){case 0:i.destination=u;break;case 1:if(!t){i.destination=u;break}if("object"==typeof t){t instanceof n?(i.syncErrorThrowable=t.syncErrorThrowable,i.destination=t,t.add(i)):(i.syncErrorThrowable=!0,i.destination=new g(i,t));break}default:i.syncErrorThrowable=!0,i.destination=new g(i,t,r,o)}return i}return t(n,e),n.prototype[h]=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,e.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}(p),g=function(e){function n(t,n,o,i){var s,a=e.call(this)||this;a._parentSubscriber=t;var c=a;return r(n)?s=n:n&&(s=n.next,o=n.error,i=n.complete,n!==u&&(r((c=Object.create(n)).unsubscribe)&&a.add(c.unsubscribe.bind(c)),c.unsubscribe=a.unsubscribe.bind(a))),a._context=c,a._next=s,a._error=o,a._complete=i,a}return t(n,e),n.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;i.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},n.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,n=i.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):s(e),this.unsubscribe();else{if(this.unsubscribe(),n)throw e;s(e)}}},n.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)};i.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},n.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),i.useDeprecatedSynchronousErrorHandling)throw e;s(e)}},n.prototype.__tryOrSetError=function(e,t,n){if(!i.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,n)}catch(t){return i.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=t,e.syncErrorThrown=!0,!0):(s(t),!0)}return!1},n.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},n}(y),m="function"==typeof Symbol&&Symbol.observable||"@@observable";function b(e){return e}var v=function(){function e(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 r=this.operator,o=function(e,t,n){if(e){if(e instanceof y)return e;if(e[h])return e[h]()}return e||t||n?new y(e,t,n):new y(u)}(e,t,n);if(r?o.add(r.call(o,this.source)):o.add(this.source||i.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),i.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){i.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),function(e){for(;e;){var t=e,n=t.closed,r=t.destination,o=t.isStopped;if(n||o)return!1;e=r&&r instanceof y?r:null}return!0}(e)?e.error(t):console.warn(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=w(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[m]=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?b: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=w(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}();function w(e){if(e||(e=i.Promise||Promise),!e)throw new Error("no Promise impl found");return e}const O="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;var S="object"==typeof self&&self&&self.Object===Object&&self;const E=(O||S||Function("return this")()).Symbol;var x=Object.prototype,_=x.hasOwnProperty,j=x.toString,k=E?E.toStringTag:void 0,P=Object.prototype.toString,$=E?E.toStringTag:void 0;const A=(C=Object.getPrototypeOf,T=Object,function(e){return C(T(e))});var C,T,D=Function.prototype,I=Object.prototype,R=D.toString,N=I.hasOwnProperty,M=R.call(Object);const L=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]":$&&$ in Object(e)?function(e){var t=_.call(e,k),n=e[k];try{e[k]=void 0;var r=!0}catch(e){}var o=j.call(e);return r&&(t?e[k]=n:delete e[k]),o}(e):function(e){return P.call(e)}(e)}(e))return!1;var t=A(e);if(null===t)return!0;var n=N.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&R.call(n)==M};var B=a(824);function U(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function z(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const F="/ws/rest/v1/",K="/ws/fhir2/R4",V=`${F}session`;function q(e){return e&&e.startsWith("http")?e:("/"!==e[0]&&(e="/"+e),window.openmrsBase+e)}function H(e,t={}){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.");let n=q(e);if(t.headers||(t.headers={}),L(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(F)&&void 0===t.headers["Disable-WWW-Authenticate"]&&(t.headers["Disable-WWW-Authenticate"]="true"),e.startsWith(K)){const e=new URL(n,window.location.toString());e.searchParams.has("_summary")||(e.searchParams.set("_summary","data"),n=e.toString())}const r=Error();return window.fetch(n,t).then((o=function*(e){const t=e;if(t.ok)return 204===t.status?(t.data=null,t):t.clone().text().then((e=>{try{e&&(t.data=JSON.parse(e))}catch(e){}return t}));{const{redirectAuthFailure:e}=yield(0,B.getConfig)("@openmrs/esm-api");return n===q(V)&&403===t.status||e.enabled&&e.errors.includes(t.status)?((0,B.navigate)({to:e.url}),e.resolvePromise?Promise.resolve():new Promise((()=>{}))):t.clone().text().then((e=>{let o=e;try{o=JSON.parse(e)}catch(e){}throw new G(n,t,o,r)}),(e=>{throw new G(n,t,null,r)}))}},i=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=o.apply(e,t);function s(e){U(i,n,r,s,a,"next",e)}function a(e){U(i,n,r,s,a,"throw",e)}s(void 0)}))},function(e){return i.apply(this,arguments)}));var o,i}function W(e,t={}){if("object"!=typeof t)throw Error("The second argument to openmrsObservableFetch must be either omitted or an object");const n=new AbortController;return t.signal=n.signal,new v((r=>{let o=!1;return H(e,t).then((e=>{o=!0,r.next(e),r.complete()}),(e=>{o=!0,r.error(e)})),()=>{o||n.abort()}}))}let G=class extends Error{constructor(e,t,n,r){super(),z(this,"response",void 0),z(this,"responseBody",void 0),this.message=`Server responded with ${t.status} (${t.statusText}) for url ${e}. Check err.responseBody or network tab in dev tools for more info`,r.message=this.message,this.responseBody=n,this.response=t,this.stack=`Stacktrace for outgoing request:\n${r.stack}\nStacktrace for incoming response:\n${this.stack}`}};var Z=a(254),Y=a(403);const X=function(e){return void 0===e};function Q(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}const J=(0,Y.createGlobalStore)("session",{loaded:!1,session:null});let ee=0;function te(e={includeAuthStatus:!0}){return(ee<Date.now()-6e4||!J.getState().loaded)&&re(),new v((t=>{const n=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(J.getState()),J.subscribe(n)}))}function ne(){return(ee<Date.now()-6e4||!J.getState().loaded)&&re(),J}function re(){return new Promise(((e,t)=>{ee=Date.now(),H(V).then((n=>{if("object"!=typeof(null==n?void 0:n.data))return t(),Promise.reject();!function(e){var t,n,r;const o=null!==(r=null==e||null===(t=e.user)||void 0===t||null===(n=t.userProperties)||void 0===n?void 0:n.defaultLocale)&&void 0!==r?r:e.locale;o!==document.documentElement.getAttribute("lang")&&document.documentElement.setAttribute("lang",o)}(n.data),e(n.data),J.setState({loaded:!0,session:n.data})})).catch((e=>((0,Z.reportError)(`Failed to fetch new session information: ${e}`),t(e),{sessionId:"",authenticated:!1})))}))}function oe(){J.setState({loaded:!0,session:{authenticated:!1,sessionId:""}})}function ie(e,t){return void 0===t?Boolean(e):!Boolean(e)||function(e,t){return"string"==typeof e?!X(t.privileges.find((t=>e===t.display))):Array.isArray(e)?e.every((e=>!X(t.privileges.find((t=>e===t.display))))):(X(e)||console.error(`Could not understand privileges "${e}"`),!0)}(e,t)||function(e){return!X(e.roles.find((e=>"System Developer"===e.display)))}(t)}function se(){let e,t;return new Promise(((n,r)=>{const o=r=>{r.loaded&&r.session.user&&(e=r.session.user,n(r.session.user),t&&t())};o(J.getState()),e||(t=J.subscribe(o))}))}function ae(){return new Promise(((e,t)=>{te().subscribe((t=>{e(t.sessionLocation)}),t).unsubscribe()}))}function ce(e,t){return ue.apply(this,arguments)}function ue(){var e;return e=function*(e,t){yield H(V,{method:"POST",body:{sessionLocation:e},headers:{"Content-Type":"application/json"},signal:t.signal}),yield re()},ue=function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){Q(i,r,o,s,a,"next",e)}function a(e){Q(i,r,o,s,a,"throw",e)}s(void 0)}))},ue.apply(this,arguments)}function le(){(0,B.defineConfigSchema)("@openmrs/esm-api",{redirectAuthFailure:{enabled:{_type:B.Type.Boolean,_default:!0,_description:"Whether to redirect logged-out users to `redirectAuthFailure.url`"},url:{_type:B.Type.String,_default:"${openmrsSpaBase}/login",_validators:[B.validators.isUrl]},errors:{_type:B.Type.Array,_default:[401],_elements:{_type:B.Type.Number,_validators:[B.validators.inRange(100,600)]},_description:"The HTTP error codes for which users will be redirected"},resolvePromise:{_type:B.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."}}}),re()}var fe=a(738);function pe(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function de(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){pe(i,r,o,s,a,"next",e)}function a(e){pe(i,r,o,s,a,"throw",e)}s(void 0)}))}}function he(e,t){return ye.apply(this,arguments)}function ye(){return(ye=de((function*(e,t,n=!0){if(e){let r=null;const[o,i]=yield Promise.all([H(`${K}/Patient/${e}`,t).catch((e=>r=e)),n?ge(e):Promise.resolve(null)]);if(o.ok)return o.data;if(i)return i;if(r)throw r}return null}))).apply(this,arguments)}function ge(e){return me.apply(this,arguments)}function me(){return(me=de((function*(e){const t=(yield(0,fe.getSynchronizationItems)("patient-registration")).find((t=>t.fhirPatient.id===e));var n;return null!==(n=null==t?void 0:t.fhirPatient)&&void 0!==n?n:null}))).apply(this,arguments)}var be=function(){function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e}(),ve=function(e){function n(t,n){var r=e.call(this)||this;return r.subject=t,r.subscriber=n,r.closed=!1,r}return t(n,e),n.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var 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}(p),we=function(e){function n(t){var n=e.call(this,t)||this;return n.destination=t,n}return t(n,e),n}(y),Oe=function(e){function n(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return t(n,e),n.prototype[h]=function(){return new we(this)},n.prototype.lift=function(e){var t=new Se(this,this);return t.operator=e,t},n.prototype.next=function(e){if(this.closed)throw new be;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 be;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 be;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(t){if(this.closed)throw new be;return e.prototype._trySubscribe.call(this,t)},n.prototype._subscribe=function(e){if(this.closed)throw new be;return this.hasError?(e.error(this.thrownError),p.EMPTY):this.isStopped?(e.complete(),p.EMPTY):(this.observers.push(e),new ve(this,e))},n.prototype.asObservable=function(){var e=new v;return e.source=this,e},n.create=function(e,t){return new Se(e,t)},n}(v),Se=function(e){function n(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return t(n,e),n.prototype.next=function(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):p.EMPTY},n}(Oe),Ee=function(e){function n(t){var n=e.call(this)||this;return n._value=t,n}return t(n,e),Object.defineProperty(n.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),n.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return n&&!n.closed&&t.next(this._value),n},n.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new be;return this._value},n.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},n}(Oe),xe=function(){function e(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return e.prototype=Object.create(Error.prototype),e}(),_e=new v((function(e){return e.complete()}));function je(e){return function(t){return 0===e?_e:t.lift(new ke(e))}}var ke=function(){function e(e){if(this.total=e,this.total<0)throw new xe}return e.prototype.call=function(e,t){return t.subscribe(new Pe(e,this.total))},e}(),Pe=function(e){function n(t,n){var r=e.call(this,t)||this;return r.total=n,r.count=0,r}return t(n,e),n.prototype._next=function(e){var t=this.total,n=++this.count;n<=t&&(this.destination.next(e),n===t&&(this.destination.complete(),this.unsubscribe()))},n}(y);function $e(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 Ae(e,t))}}var Ae=function(){function e(e,t){this.project=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new Ce(e,this.project,this.thisArg))},e}(),Ce=function(e){function n(t,n,r){var o=e.call(this,t)||this;return o.project=n,o.count=0,o.thisArg=r||o,o}return t(n,e),n.prototype._next=function(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}(y);const Te="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)";function De(e,t,n){return W(`/ws/rest/v1/visit?patient=${e}&v=${null!=n?n:Te}`,{signal:t.signal,method:"GET",headers:{"Content-type":"application/json"}}).pipe(je(1)).pipe($e((e=>e)))}function Ie(e,t){return W("/ws/rest/v1/visit",{signal:t.signal,method:"POST",headers:{"Content-type":"application/json"},body:e})}function Re(e,t,n){return W(`/ws/rest/v1/visit/${e}`,{signal:n.signal,method:"POST",headers:{"Content-type":"application/json"},body:t})}const Ne=new Ee(null);var Me,Le;function Be(e){return{uuid:e.uuid,display:e.display,name:e.name}}function Ue(){return W("/ws/rest/v1/visittype").pipe($e((e=>e.data.results.map(Be)))).pipe(je(1))}function ze(e){return{uuid:e.uuid,display:e.display}}function Fe(){return W("/ws/rest/v1/location").pipe($e((e=>e.data.results.map(ze)))).pipe(je(1))}!function(e){e.NEWVISIT="startVisit",e.EDITVISIT="editVisit",e.LOADING="loadingVisit"}(Me||(Me={})),function(e){e.NOTSTARTED="notStarted",e.ONGOING="ongoing"}(Le||(Le={}));const Ke={"webservices.rest":"2.24.0",fhir2:"1.0.0-SNAPSHOT"}})(),c})())}}}))},2601:(e,t,n)=>{"use strict";n.d(t,{nF:()=>S,u4:()=>oe,Rx:()=>ie,Wf:()=>le,Ze:()=>T,I$:()=>J,Vy:()=>z,DN:()=>m,ts:()=>$,JC:()=>ue,r:()=>I,WK:()=>R,KJ:()=>A,$X:()=>re,P9:()=>ae,nx:()=>ee,bf:()=>v,vb:()=>w,uj:()=>O,VJ:()=>C,YC:()=>g,bX:()=>te,z$:()=>b,jK:()=>N,Lq:()=>ce,VF:()=>se,ym:()=>ne,y9:()=>D});var r=n(4666),o=n(963);const i=(0,n(6899).Z)(Object.getPrototypeOf,Object);var s=n(4897),a=Function.prototype,c=Object.prototype,u=a.toString,l=c.hasOwnProperty,f=u.call(Object);const p=function(e){if(!(0,s.Z)(e)||"[object Object]"!=(0,o.Z)(e))return!1;var t=i(e);if(null===t)return!0;var n=l.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&u.call(n)==f};var d=n(3741);function h(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const g="/ws/rest/v1/",m="/ws/fhir2/R4",b=`${g}session`;function v(e){return e&&e.startsWith("http")?e:("/"!==e[0]&&(e="/"+e),window.openmrsBase+e)}function w(e,t={}){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.");let n=v(e);if(t.headers||(t.headers={}),p(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(g)&&void 0===t.headers["Disable-WWW-Authenticate"]&&(t.headers["Disable-WWW-Authenticate"]="true"),e.startsWith(m)){const e=new URL(n,window.location.toString());e.searchParams.has("_summary")||(e.searchParams.set("_summary","data"),n=e.toString())}const r=Error();return window.fetch(n,t).then((o=function*(e){const t=e;if(t.ok)return 204===t.status?(t.data=null,t):t.clone().text().then((e=>{try{e&&(t.data=JSON.parse(e))}catch(e){}return t}));{const{redirectAuthFailure:e}=yield(0,d.getConfig)("@openmrs/esm-api");return n===v(b)&&403===t.status||e.enabled&&e.errors.includes(t.status)?((0,d.navigate)({to:e.url}),e.resolvePromise?Promise.resolve():new Promise((()=>{}))):t.clone().text().then((e=>{let o=e;try{o=JSON.parse(e)}catch(e){}throw new S(n,t,o,r)}),(e=>{throw new S(n,t,null,r)}))}},i=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=o.apply(e,t);function s(e){h(i,n,r,s,a,"next",e)}function a(e){h(i,n,r,s,a,"throw",e)}s(void 0)}))},function(e){return i.apply(this,arguments)}));var o,i}function O(e,t={}){if("object"!=typeof t)throw Error("The second argument to openmrsObservableFetch must be either omitted or an object");const n=new AbortController;return t.signal=n.signal,new r.Observable((r=>{let o=!1;return w(e,t).then((e=>{o=!0,r.next(e),r.complete()}),(e=>{o=!0,r.error(e)})),()=>{o||n.abort()}}))}class S extends Error{constructor(e,t,n,r){super(),y(this,"response",void 0),y(this,"responseBody",void 0),this.message=`Server responded with ${t.status} (${t.statusText}) for url ${e}. Check err.responseBody or network tab in dev tools for more info`,r.message=this.message,this.responseBody=n,this.response=t,this.stack=`Stacktrace for outgoing request:\n${r.stack}\nStacktrace for incoming response:\n${this.stack}`}}var E=n(151),x=n(403),_=n(9789);function j(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}const k=(0,x.createGlobalStore)("session",{loaded:!1,session:null});let P=0;function $(e={includeAuthStatus:!0}){return(P<Date.now()-6e4||!k.getState().loaded)&&C(),new r.Observable((t=>{const n=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(k.getState()),k.subscribe(n)}))}function A(){return(P<Date.now()-6e4||!k.getState().loaded)&&C(),k}function C(){return new Promise(((e,t)=>{P=Date.now(),w(b).then((n=>{if("object"!=typeof(null==n?void 0:n.data))return t(),Promise.reject();!function(e){var t,n,r;const o=null!==(r=null==e||null===(t=e.user)||void 0===t||null===(n=t.userProperties)||void 0===n?void 0:n.defaultLocale)&&void 0!==r?r:e.locale;o!==document.documentElement.getAttribute("lang")&&document.documentElement.setAttribute("lang",o)}(n.data),e(n.data),k.setState({loaded:!0,session:n.data})})).catch((e=>((0,E.reportError)(`Failed to fetch new session information: ${e}`),t(e),{sessionId:"",authenticated:!1})))}))}function T(){k.setState({loaded:!0,session:{authenticated:!1,sessionId:""}})}function D(e,t){return void 0===t?Boolean(e):!Boolean(e)||function(e,t){return"string"==typeof e?!(0,_.Z)(t.privileges.find((t=>e===t.display))):Array.isArray(e)?e.every((e=>!(0,_.Z)(t.privileges.find((t=>e===t.display))))):((0,_.Z)(e)||console.error(`Could not understand privileges "${e}"`),!0)}(e,t)||function(e){return!(0,_.Z)(e.roles.find((e=>"System Developer"===e.display)))}(t)}function I(){let e,t;return new Promise(((n,r)=>{const o=r=>{r.loaded&&r.session.user&&(e=r.session.user,n(r.session.user),t&&t())};o(k.getState()),e||(t=k.subscribe(o))}))}function R(){return new Promise(((e,t)=>{$().subscribe((t=>{e(t.sessionLocation)}),t).unsubscribe()}))}function N(e,t){return M.apply(this,arguments)}function M(){var e;return e=function*(e,t){yield w(b,{method:"POST",body:{sessionLocation:e},headers:{"Content-Type":"application/json"},signal:t.signal}),yield C()},M=function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){j(i,r,o,s,a,"next",e)}function a(e){j(i,r,o,s,a,"throw",e)}s(void 0)}))},M.apply(this,arguments)}var L=n(8809);function B(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.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 s(e){B(i,r,o,s,a,"next",e)}function a(e){B(i,r,o,s,a,"throw",e)}s(void 0)}))}}function z(e,t){return F.apply(this,arguments)}function F(){return(F=U((function*(e,t,n=!0){if(e){let r=null;const[o,i]=yield Promise.all([w(`${m}/Patient/${e}`,t).catch((e=>r=e)),n?K(e):Promise.resolve(null)]);if(o.ok)return o.data;if(i)return i;if(r)throw r}return null}))).apply(this,arguments)}function K(e){return V.apply(this,arguments)}function V(){return(V=U((function*(e){const t=(yield(0,L.getSynchronizationItems)("patient-registration")).find((t=>t.fhirPatient.id===e));var n;return null!==(n=null==t?void 0:t.fhirPatient)&&void 0!==n?n:null}))).apply(this,arguments)}var q=n(7080),H=n(7811),W=n(1760),G=n(70);function Z(e){return function(t){return 0===e?(0,G.c)():t.lift(new Y(e))}}var Y=function(){function e(e){if(this.total=e,this.total<0)throw new W.W}return e.prototype.call=function(e,t){return t.subscribe(new X(e,this.total))},e}(),X=function(e){function t(t,n){var r=e.call(this,t)||this;return r.total=n,r.count=0,r}return q.ZT(t,e),t.prototype._next=function(e){var t=this.total,n=++this.count;n<=t&&(this.destination.next(e),n===t&&(this.destination.complete(),this.unsubscribe()))},t}(H.L),Q=n(5725);const J="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)";function ee(e,t,n){return O(`/ws/rest/v1/visit?patient=${e}&v=${null!=n?n:J}`,{signal:t.signal,method:"GET",headers:{"Content-type":"application/json"}}).pipe(Z(1)).pipe((0,Q.U)((e=>e)))}function te(e,t){return O("/ws/rest/v1/visit",{signal:t.signal,method:"POST",headers:{"Content-type":"application/json"},body:e})}function ne(e,t,n){return O(`/ws/rest/v1/visit/${e}`,{signal:n.signal,method:"POST",headers:{"Content-type":"application/json"},body:t})}const re=new r.BehaviorSubject(null);var oe,ie;function se(e){return{uuid:e.uuid,display:e.display,name:e.name}}function ae(){return O("/ws/rest/v1/visittype").pipe((0,Q.U)((e=>e.data.results.map(se)))).pipe(Z(1))}function ce(e){return{uuid:e.uuid,display:e.display}}function ue(){return O("/ws/rest/v1/location").pipe((0,Q.U)((e=>e.data.results.map(ce)))).pipe(Z(1))}!function(e){e.NEWVISIT="startVisit",e.EDITVISIT="editVisit",e.LOADING="loadingVisit"}(oe||(oe={})),function(e){e.NOTSTARTED="notStarted",e.ONGOING="ongoing"}(ie||(ie={}));const le={"webservices.rest":"2.24.0",fhir2:"1.0.0-SNAPSHOT"}},789:()=>{System.register(["@openmrs/esm-state"],(function(e,t){var n={};return{setters:[function(e){n.createGlobalStore=e.createGlobalStore}],execute:function(){e((()=>{var e={968:(e,t,n)=>{const r=n(577).R;t.s=function(e){if(e||(e=1),!n.y.meta||!n.y.meta.url)throw console.error("__system_context__",n.y),Error("systemjs-webpack-interop was provided an unknown SystemJS context. Expected context.meta.url, but none was provided");n.p=r(n.y.meta.url,e)}},577:(e,t,n)=>{t.R=function(e,t){var n=document.createElement("a");n.href=e;for(var r="/"===n.pathname[0]?n.pathname:"/"+n.pathname,o=0,i=r.length;o!==t&&i>=0;)"/"===r[--i]&&o++;if(o!==t)throw Error("systemjs-webpack-interop: rootDirectoryLevel ("+t+") is greater than the number of directories ("+o+") in the URL path "+e);var s=r.slice(0,i+1);return n.protocol+"//"+n.host+s},Number.isInteger},685:e=>{"use strict";e.exports=n}},r={};function o(t){var n=r[t];if(void 0!==n)return n.exports;var i=r[t]={exports:{}};return e[t](i,i.exports,o),i.exports}o.y=t,o.d=(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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&!e;)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})();var i={};return(0,o(968).s)(1),(()=>{"use strict";function e(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function t(e){return e&&e.sensitive?"":"i"}function n(n,r,o){return function(n,r,o){void 0===o&&(o={});for(var i=o.strict,s=void 0!==i&&i,a=o.start,c=void 0===a||a,u=o.end,l=void 0===u||u,f=o.encode,p=void 0===f?function(e){return e}:f,d="["+e(o.endsWith||"")+"]|$",h="["+e(o.delimiter||"/#?")+"]",y=c?"^":"",g=0,m=n;g<m.length;g++){var b=m[g];if("string"==typeof b)y+=e(p(b));else{var v=e(p(b.prefix)),w=e(p(b.suffix));if(b.pattern)if(r&&r.push(b),v||w)if("+"===b.modifier||"*"===b.modifier){var O="*"===b.modifier?"?":"";y+="(?:"+v+"((?:"+b.pattern+")(?:"+w+v+"(?:"+b.pattern+"))*)"+w+")"+O}else y+="(?:"+v+"("+b.pattern+")"+w+")"+b.modifier;else y+="("+b.pattern+")"+b.modifier;else y+="(?:"+v+w+")"+b.modifier}}if(l)s||(y+=h+"?"),y+=o.endsWith?"(?="+d+")":"$";else{var S=n[n.length-1],E="string"==typeof S?h.indexOf(S[S.length-1])>-1:void 0===S;s||(y+="(?:"+h+"(?="+d+"))?"),E||(y+="(?="+h+"|"+d+")")}return new RegExp(y,t(o))}(function(t,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[a=n+1])throw new TypeError('Pattern cannot start with "?" at '+a);for(;a<e.length;)if("\\"!==e[a]){if(")"===e[a]){if(0==--o){a++;break}}else if("("===e[a]&&(o++,"?"!==e[a+1]))throw new TypeError("Capturing groups are not allowed at "+a);i+=e[a++]}else i+=e[a++]+e[a++];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=a}else{for(var s="",a=n+1;a<e.length;){var c=e.charCodeAt(a);if(!(c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||95===c))break;s+=e[a++]}if(!s)throw new TypeError("Missing parameter name at "+n);t.push({type:"NAME",index:n,value:s}),n=a}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}(t),o=n.prefixes,i=void 0===o?"./":o,s="[^"+e(n.delimiter||"/#?")+"]+?",a=[],c=0,u=0,l="",f=function(e){if(u<r.length&&r[u].type===e)return r[u++].value},p=function(e){var t=f(e);if(void 0!==t)return t;var n=r[u],o=n.type,i=n.index;throw new TypeError("Unexpected "+o+" at "+i+", expected "+e)},d=function(){for(var e,t="";e=f("CHAR")||f("ESCAPED_CHAR");)t+=e;return t};u<r.length;){var h=f("CHAR"),y=f("NAME"),g=f("PATTERN");if(y||g){var m=h||"";-1===i.indexOf(m)&&(l+=m,m=""),l&&(a.push(l),l=""),a.push({name:y||c++,prefix:m,suffix:"",pattern:g||s,modifier:f("MODIFIER")||""})}else{var b=h||f("ESCAPED_CHAR");if(b)l+=b;else if(l&&(a.push(l),l=""),f("OPEN")){m=d();var v=f("NAME")||"",w=f("PATTERN")||"",O=d();p("CLOSE"),a.push({name:v||(w?c++:""),pattern:v&&!w?s:w,prefix:m,suffix:O,modifier:f("MODIFIER")||""})}else p("END")}}return a}(n,o),r,o)}function r(e,o,i){return e instanceof 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}(e,o):Array.isArray(e)?function(e,n,o){var i=e.map((function(e){return r(e,n,o).source}));return new RegExp("(?:"+i.join("|")+")",t(o))}(e,o,i):n(e,o,i)}o.r(i),o.d(i,{filterBreadcrumbs:()=>p,getBreadcrumbs:()=>l,getBreadcrumbsFor:()=>d,registerBreadcrumb:()=>c,registerBreadcrumbs:()=>u});const s=(0,o(685).createGlobalStore)("breadcrumbs",[]);function a(e){return e.matcher instanceof RegExp?e.matcher:"string"==typeof e.matcher?r(e.matcher):r(e.path)}function c(e){return u([e])}function u(e){const t=[...l(),...e.map((e=>({matcher:a(e),settings:e})))];s.setState(t,!0)}function l(){return s.getState()}function f(e,t){if(t)return function(e,t){const[n]=e.filter((e=>e.matcher.test(t)));return n}(e,t)||function(e,t){const n=t.split("/");for(;n.length>1;){n.pop();const t=f(e,n.join("/"));if(t)return t}}(e,t)}function p(e,t){if(e.length>0){const n=f(e,t);if(n){const t=[n];let r=f(e,n.settings.parent);for(;void 0!==r;)t.push(r),r=f(e,r.settings.parent);return t.reverse()}}return[]}function d(e){return p(l(),e)}})(),i})())}}}))},3741:()=>{System.register(["@openmrs/esm-state","single-spa"],(function(e,t){var n={},r={};return{setters:[function(e){n.createGlobalStore=e.createGlobalStore,n.getGlobalStore=e.getGlobalStore},function(e){r.navigateToUrl=e.navigateToUrl}],execute:function(){e((()=>{"use strict";var e={685:e=>{e.exports=n},645:e=>{e.exports=r}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,o),i.exports}o.d=(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=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{function e(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function t(t){return function n(r){return 0===arguments.length||e(r)?n:t.apply(this,arguments)}}function n(n){return function r(o,i){switch(arguments.length){case 0:return r;case 1:return e(o)?r:t((function(e){return n(o,e)}));default:return e(o)&&e(i)?r:e(o)?t((function(e){return n(e,i)})):e(i)?t((function(e){return n(o,e)})):n(o,i)}}}function r(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function s(e,t,n){for(var r=0,o=n.length;r<o;){if(e(t,n[r]))return!0;r+=1}return!1}function a(e,t){return Object.prototype.hasOwnProperty.call(t,e)}o.r(i),o.d(i,{Type:()=>L,configExtensionStore:()=>Z,configInternalStore:()=>W,defineConfigSchema:()=>fe,defineExtensionConfigSchema:()=>pe,getConfig:()=>he,getConfigInternal:()=>ye,getConfigStore:()=>Y,getExtensionConfig:()=>te,getExtensionConfigFromStore:()=>ne,getExtensionSlotConfig:()=>Q,getExtensionSlotConfigFromStore:()=>J,getExtensionSlotsConfigStore:()=>X,getExtensionsConfigStore:()=>ee,implementerToolsConfigStore:()=>re,inRange:()=>Ue,interpolateString:()=>Le,interpolateUrl:()=>Me,isUrl:()=>Fe,isUrlWithTemplateParameters:()=>ze,navigate:()=>Be,oneOf:()=>Ke,processConfig:()=>ge,provide:()=>de,temporaryConfigStore:()=>G,validator:()=>B,validators:()=>Ve});const c="function"==typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};var u=Object.prototype.toString,l=function(){return"[object Arguments]"===u.call(arguments)?function(e){return"[object Arguments]"===u.call(e)}:function(e){return a("callee",e)}}();const f=l;var p=!{toString:null}.propertyIsEnumerable("toString"),d=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],h=function(){return arguments.propertyIsEnumerable("length")}(),y=function(e,t){for(var n=0;n<e.length;){if(e[n]===t)return!0;n+=1}return!1};const g="function"!=typeof Object.keys||h?t((function(e){if(Object(e)!==e)return[];var t,n,r=[],o=h&&f(e);for(t in e)!a(t,e)||o&&"length"===t||(r[r.length]=t);if(p)for(n=d.length-1;n>=0;)a(t=d[n],e)&&!y(r,t)&&(r[r.length]=t),n-=1;return r})):t((function(e){return Object(e)!==e?[]:Object.keys(e)})),m=t((function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}));function b(e,t,n,o){var i=r(e);function a(e,t){return v(e,t,n.slice(),o.slice())}return!s((function(e,t){return!s(a,t,e)}),r(t),i)}function v(e,t,n,r){if(c(e,t))return!0;var o,i,s=m(e);if(s!==m(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(s){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===(o=e.constructor,null==(i=String(o).match(/^function (\w*)/))?"":i[1]))return e===t;break;case"Boolean":case"Number":case"String":if(typeof e!=typeof t||!c(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!c(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 u=n.length-1;u>=0;){if(n[u]===e)return r[u]===t;u-=1}switch(s){case"Map":return e.size===t.size&&b(e.entries(),t.entries(),n.concat([e]),r.concat([t]));case"Set":return e.size===t.size&&b(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 l=g(e);if(l.length!==g(t).length)return!1;var f=n.concat([e]),p=r.concat([t]);for(u=l.length-1;u>=0;){var d=l[u];if(!a(d,t)||!v(t[d],e[d],f,p))return!1;u-=1}return!0}const w=n((function(e,t){return v(e,t,[],[])}));function O(r){return function o(i,s,a){switch(arguments.length){case 0:return o;case 1:return e(i)?o:n((function(e,t){return r(i,e,t)}));case 2:return e(i)&&e(s)?o:e(i)?n((function(e,t){return r(e,s,t)})):e(s)?n((function(e,t){return r(i,e,t)})):t((function(e){return r(i,s,e)}));default:return e(i)&&e(s)&&e(a)?o:e(i)&&e(s)?n((function(e,t){return r(e,t,a)})):e(i)&&e(a)?n((function(e,t){return r(e,s,t)})):e(s)&&e(a)?n((function(e,t){return r(i,e,t)})):e(i)?t((function(e){return r(e,s,a)})):e(s)?t((function(e){return r(i,e,a)})):e(a)?t((function(e){return r(i,s,e)})):r(i,s,a)}}}function S(e){return"[object Object]"===Object.prototype.toString.call(e)}const E=O((function(e,t,n){var r,o={};for(r in t)a(r,t)&&(o[r]=a(r,n)?e(r,t[r],n[r]):t[r]);for(r in n)a(r,n)&&!a(r,o)&&(o[r]=n[r]);return o})),x=O((function e(t,n,r){return E((function(n,r,o){return S(r)&&S(o)?e(t,r,o):t(n,r,o)}),n,r)})),_=n((function(e,t){return x((function(e,t,n){return n}),e,t)})),j=n((function(e,t){for(var n={},r={},o=0,i=e.length;o<i;)r[e[o]]=1,o+=1;for(var s in t)r.hasOwnProperty(s)||(n[s]=t[s]);return n}));function k(e,t,n,r){var o,i=function(o){for(var i=t.length,s=0;s<i;){if(e===t[s])return n[s];s+=1}for(var a in t[s+1]=e,n[s+1]=o,e)o[a]=r?k(e[a],t,n,!0):e[a];return o};switch(m(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}}const P=t((function(e){return null!=e&&"function"==typeof e.clone?e.clone():k(e,[],[],!0)})),$=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)},A=t((function(e){return!!$(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))}));var C=function(){function e(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}(),T=n((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,s){return t.apply(this,arguments)};case 7:return function(e,n,r,o,i,s,a){return t.apply(this,arguments)};case 8:return function(e,n,r,o,i,s,a,c){return t.apply(this,arguments)};case 9:return function(e,n,r,o,i,s,a,c,u){return t.apply(this,arguments)};case 10:return function(e,n,r,o,i,s,a,c,u,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)}))}));const D=T;function I(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)}function R(e,t,n,r){return e["@@transducer/result"](n[r](D(e["@@transducer/step"],e),t))}var N="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";const M=O((function(e,t,n){if("function"==typeof e&&(e=function(e){return new C(e)}(e)),A(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 R(e,t,n,"fantasy-land/reduce");if(null!=n[N])return I(e,t,n[N]());if("function"==typeof n.next)return I(e,t,n);if("function"==typeof n.reduce)return R(e,t,n,"reduce");throw new TypeError("reduce: list must be array or iterable")}));var L;function B(e,t){return n=>{if(!e(n))return"function"==typeof t?t(n):t}}!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"}(L||(L={}));const U=B((e=>Array.isArray(e)),"must be an array"),z=B((e=>"boolean"==typeof e),"must be a boolean"),F=B((e=>"number"==typeof e),"must be a number"),K=B((e=>"string"==typeof e),"must be a string"),V=B((e=>"object"==typeof e&&!Array.isArray(e)&&null!==e),"must be an object (not an array or null)"),q=B((e=>/^[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");var H=o(685);const W=(0,H.createGlobalStore)("config-internal",{providedConfigs:[],schemas:{}}),G=(0,H.createGlobalStore)("temporary-config",{config:function(){try{return JSON.parse(localStorage.getItem("openmrs:temporaryConfig")||"{}")}catch(e){return{}}}()});G.subscribe((e=>{var t;t=e.config,localStorage.setItem("openmrs:temporaryConfig",JSON.stringify(t))}));const Z=(0,H.createGlobalStore)("config-store-of-extension-state",{mountedExtensions:[]});function Y(e){return(0,H.getGlobalStore)(`config-module-${e}`,{config:null,loaded:!1})}function X(){return(0,H.getGlobalStore)("config-extension-slots",{slots:{}})}function Q(e){return J(X().getState(),e)}function J(e,t){const n=e.slots[t];return null!=n?n:{loaded:!1,config:{}}}function ee(){return(0,H.getGlobalStore)("config-extensions",{configs:{}})}function te(e,t){const n=Object.assign({},ne(ee().getState(),e,t));return n.config=j(["Display conditions","Translation overrides"],n.config),n}function ne(e,t,n){var r;const o=null===(r=e.configs[t])||void 0===r?void 0:r[n];return null!=o?o:{loaded:!1,config:null}}const re=(0,H.createGlobalStore)("config-implementer-tools",{config:{}});function oe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ie(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){oe(e,t,n[t])}))}return e}function se(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 ae(e,t){for(let n of Object.keys(e.schemas)){const r=Ee(n,e,t);Y(n).setState({loaded:!0,config:r})}}function ce(e,t){const n=function(e,t){const n=_e(Oe(e,t)),r=Object.keys(n).reduce(((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}),{});return function(e){for(let[t,n]of Object.entries(e))for(let[e,r]of Object.entries(n))we(r,t,e)}(r),Object.keys(r).reduce(((e,t)=>ie({},e,r[t])),{})}(e,t),r=Object.fromEntries(Object.entries(n).map((([e,t])=>[e,{loaded:!0,config:t}]))),o=X(),i=o.getState(),s={slots:ie({},i.slots,r)};w(i,s)||o.setState(s)}function ue(e,t){const n=function(e,t){let n=be(P(e.schemas));const r=[...e.providedConfigs.map((e=>[e.config,e.source])),[t.config,"temporary config"]];for(let[e,t]of r)n=_e([n,ve(e,t)]);return n}(e,t);re.setState({config:n})}function le(e,t,n){const r={};for(let o of t.mountedExtensions){const t=me(o.slotModuleName,o.extensionModuleName,o.slotName,o.extensionId,e,n);r[o.slotName]=se(ie({},r[o.slotName]),{[o.extensionId]:{config:t,loaded:!0}})}ee().setState({configs:r})}function fe(e,t){Se(e,t);const n=_(t,Ie),r=W.getState();W.setState({schemas:se(ie({},r.schemas),{[e]:n})})}function pe(e,t){Se(e,t);const n=_(t,Ie),r=W.getState();r.schemas[e]&&console.warn(`Config schema for extension ${e} already exists. If there are multiple extensions with this same name, one will probably crash.`),W.setState({schemas:se(ie({},r.schemas),{[e]:n})})}function de(e,t="provided"){const n=W.getState();W.setState({providedConfigs:[...n.providedConfigs,{source:t,config:e}]})}function he(e){return new Promise((t=>{const n=Y(e);function r(e){if(e.loaded&&e.config){const n=j(["Display conditions","Translation overrides"],e.config);t(n),o&&o()}}r(n.getState());const o=n.subscribe(r)}))}function ye(e){return new Promise((t=>{const n=Y(e);function r(e){if(e.loaded&&e.config){const n=e.config;t(n),o&&o()}}r(n.getState());const o=n.subscribe(r)}))}function ge(e,t,n){je(e,t,n);const r=Ce(e,t);return Pe(e,r,n),r}function me(e,t,n,r,o,i){var s,a,c;const u=function(e){const[t]=e.split("#");return t}(r),l=o.schemas[u],f=l?u:t,p=Oe(o,i),d=xe(e,p);var h;const y=null!==(h=null==d||null===(s=d.extensionSlots)||void 0===s||null===(a=s[n])||void 0===a||null===(c=a.configure)||void 0===c?void 0:c[r])&&void 0!==h?h:{},g=_e([xe(f,p),y]),m=null!=l?l:o.schemas[t];je(m,g,f);const b=Ce(m,g);return Pe(m,b,f),delete b.extensionSlots,b}function be(e){return e.hasOwnProperty("_default")?se(ie({},e),{_value:e._default,_source:"default"}):De(e)?Object.keys(e).reduce(((t,n)=>(t[n]=be(e[n]),t)),{}):{}}function ve(e,t){return De(e)?Object.keys(e).reduce(((n,r)=>(n[r]=ve(e[r],t),n)),{}):{_value:e,_source:t}}function we(e,t,n){const r=`Extension slot config '${t}.extensionSlots.${n}`,o=Object.keys(e).filter((e=>!["add","remove","order","configure"].includes(e)));o.length&&console.error(r+`' contains invalid keys '${o.join("', '")}'`),e.add&&(Array.isArray(e.add)&&e.add.every((e=>"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((e=>"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((e=>"string"==typeof e))||console.error(r+".order' is invalid. Must be an array of strings (extension IDs)")),e.configure&&(De(e.configure)||console.error(r+".configure' is invalid. Must be an object with extension IDs for keys"))}function Oe(e,t){return[...e.providedConfigs.map((e=>e.config)),t.config]}function Se(e,t,n=""){const r="Please verify that you are running the latest version and, if so, alert the maintainer.";for(const o of Object.keys(t).filter((e=>!e.startsWith("_")))){const i=n+(n&&".")+o,s=t[o];if("Display conditions"===i&&console.error(`${e} declares a configuration option called "Display conditions"; the "Display conditions" option is a reserved name. ${r}`),"Translation overrides"===i&&console.error(`${e} declares a configuration option called "Translation overrides"; the "Translation overrides" option is a reserved name. ${r}`),!De(s)){console.error(`${e} has bad config schema definition for key '${i}'. ${r}`);continue}s.hasOwnProperty("_default")||Se(e,s,i);const a=s._elements;if(Te(a)&&Se(e,a,i+"._elements"),s._validators)for(let t of s._validators)"function"!=typeof t&&console.error(`${e} has invalid validator for key '${i}' ${r}.\n\nIf you're the maintainer: validators must be functions that return either undefined or an error string. Received ${t}.`);const c=s._type;c&&!Object.values(L).includes(c)&&console.error(`${e} has invalid type for key '${i}' ${r}.\n\nIf you're the maintainer: the allowed types are ${Object.values(L).join(", ")}. Received '${c}'`),Object.keys(s).every((e=>["_description","_validators","_elements","_type"].includes(e)))&&!n.includes("._elements")&&console.error(`${e} has bad config schema definition for key '${i}'. ${r}.\n\nIf you're the maintainer: all config elements must have a default. Received ${JSON.stringify(s)}`),a&&c&&![L.Array,L.Object].includes(c)&&console.error(`${e} has bad config schema definition for key '${i}'. ${r}.\n\nIf you're the maintainer: the 'elements' key only works with '_type' equal to 'Array' or 'Object'. Received ${JSON.stringify(c)}`)}}function Ee(e,t,n){if(!t.schemas.hasOwnProperty(e))throw Error("No config schema has been defined for "+e);const r=t.schemas[e],o=xe(e,Oe(t,n));je(r,o,e);const i=Ce(r,o);return Pe(r,i,e),delete i.extensionSlots,i}function xe(e,t){return _e(t.map((({[e]:t})=>t)).filter((e=>!!e)))}function _e(e){return M(_)({},e)}function je(e,t,n=""){for(const r of Object.keys(t)){const o=t[r],i=n+"."+r,s=e[r];e.hasOwnProperty(r)?ke(s,o,i):"extensionSlots"===r&&""!==n||console.error(`Unknown config key '${i}' provided. Ignoring.`)}}function ke(e,t,n){$e(n,e._type,t),De(t)?e._type===L.Object?function(e,t,n){if(e._elements)for(const r of Object.keys(t)){const o=t[r];je(e._elements,o,`${n}.${r}`)}}(e,t,n):e.hasOwnProperty("_default")||je(e,t,n):e._type===L.Array&&function(e,t,n){if(Te(e._elements))for(let r=0;r<t.length;r++)ke(e._elements,t[r],`${n}[${r}]`);for(let o=0;o<t.length;o++){var r;$e(`${n}[${o}]`,null===(r=e._elements)||void 0===r?void 0:r._type,t[o])}}(e,t,n)}function Pe(e,t,n=""){if(e)if(t!==e._default&&Ae(n,e._validators,t),De(t))for(const r of Object.keys(t)){const o=t[r],i=n+"."+r,s=e[r];e._type===L.Object&&e._elements?Pe(e._elements,o,i):Pe(s,o,i)}else if(Array.isArray(t)&&e._elements)for(let r=0;r<t.length;r++)Pe(e._elements,t[r],`${n}[${r}]`)}function $e(e,t,n){t&&Ae(e,[{Array:U,Boolean:z,ConceptUuid:q,Number:F,Object:V,String:K,UUID:q,PersonAttributeTypeUuid:q,PatientIdentifierTypeUuid:q}[t]],n)}function Ae(e,t,n){if(t)try{for(let r of t){const t=r(n);"string"==typeof t&&("object"==typeof n?console.error(`Invalid configuration for ${e}: ${t}`):console.error(`Invalid configuration value ${n} for ${e}: ${t}`))}}catch(t){console.error(`Skipping invalid validator at "${e}". Encountered error\n\t${t}`)}}ae(W.getState(),G.getState()),W.subscribe((e=>ae(e,G.getState()))),G.subscribe((e=>ae(W.getState(),e))),ue(W.getState(),G.getState()),W.subscribe((e=>ue(e,G.getState()))),G.subscribe((e=>ue(W.getState(),e))),ce(W.getState(),G.getState()),W.subscribe((e=>ce(e,G.getState()))),G.subscribe((e=>ce(W.getState(),e))),le(W.getState(),Z.getState(),G.getState()),W.subscribe((e=>{le(e,Z.getState(),G.getState())})),Z.subscribe((e=>{le(W.getState(),e,G.getState())})),G.subscribe((e=>{le(W.getState(),Z.getState(),e)}));const Ce=(e,t)=>{const n=P(t);if(!e)return n;for(const t of Object.keys(e)){const r=n[t],o=e[t];if(o&&o.hasOwnProperty("_default")){n.hasOwnProperty(t)||(n[t]=o._default);const e=o._elements;if(r&&Te(e))if(o._type===L.Array&&Array.isArray(r)){const o=r.map((t=>Ce(e,t)));n[t]=o}else if(o._type===L.Object)for(let t of Object.keys(r))r[t]=Ce(e,r[t])}else if(De(o)){const e=n.hasOwnProperty(t)?r:{};De(e)&&(n[t]=Ce(o,e))}}return n};function Te(e){return!!e&&Object.keys(e).filter((e=>!["_default","_validators"].includes(e))).length>0}function De(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}const Ie={"Display conditions":{privileges:{_description:"The privilege(s) the user must have to use this extension",_type:L.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:L.Object,_default:{}}};var Re=o(645);function Ne(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Me(e,t){const n=window.getOpenmrsSpaBase().replace(/\/$/,"");return Le(e,function(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){Ne(e,t,n[t])}))}return e}({openmrsBase:window.openmrsBase,openmrsSpaBase:n},t)).replace(/^\/\//,"/")}function Le(e,t){return Object.keys(t).reduce(((e,n)=>e.split("${"+n+"}").join(t[n])),e)}function Be({to:e,templateParams:t}){const n=window.getOpenmrsSpaBase().replace(/\/$/,""),r=Me(e,t);r.startsWith(n)?(0,Re.navigateToUrl)(r):window.location.assign(r)}const Ue=(e,t)=>B((n=>e<=n&&n<=t),`must be between ${e} and ${t}`),ze=e=>{const t=e.concat(["openmrsBase","openmrsSpaBase"]);return B((e=>{if(!e||"string"!=typeof e)return!1;const n=/\${(.*?)}/g;let r=n.exec(e);for(;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((e=>"${"+e+"}")).join(", "))},Fe=ze([]),Ke=e=>B((t=>e.includes(t)),`Must be one of the following: '${e.join("', '")}'.`),Ve={inRange:Ue,isUrl:Fe,isUrlWithTemplateParameters:ze,oneOf:Ke}})(),i})())}}}))},7521:(e,t,n)=>{"use strict";var r;function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){const n=window.getOpenmrsSpaBase().replace(/\/$/,"");return s(e,function(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){o(e,t,n[t])}))}return e}({openmrsBase:window.openmrsBase,openmrsSpaBase:n},t)).replace(/^\/\//,"/")}function s(e,t){return Object.keys(t).reduce(((e,n)=>e.split("${"+n+"}").join(t[n])),e)}n.d(t,{Dy:()=>r,SH:()=>ye,Tj:()=>ge,iE:()=>be,pR:()=>se,Z2:()=>l,IT:()=>s,ll:()=>i,CB:()=>p,gZ:()=>f,c4:()=>c,kw:()=>d,JJ:()=>me,sC:()=>u,z2:()=>h}),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"}(r||(r={}));var a=n(5875);function c({to:e,templateParams:t}){const n=window.getOpenmrsSpaBase().replace(/\/$/,""),r=i(e,t);r.startsWith(n)?(0,a.navigateToUrl)(r):window.location.assign(r)}function u(e,t){return n=>{if(!e(n))return"function"==typeof t?t(n):t}}const l=(e,t)=>u((n=>e<=n&&n<=t),`must be between ${e} and ${t}`),f=e=>{const t=e.concat(["openmrsBase","openmrsSpaBase"]);return u((e=>{if(!e||"string"!=typeof e)return!1;const n=/\${(.*?)}/g;let r=n.exec(e);for(;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((e=>"${"+e+"}")).join(", "))},p=f([]),d=e=>u((t=>e.includes(t)),`Must be one of the following: '${e.join("', '")}'.`),h={inRange:l,isUrl:p,isUrlWithTemplateParameters:f,oneOf:d};function y(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function g(e){return function t(n){return 0===arguments.length||y(n)?t:e.apply(this,arguments)}}function m(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return y(n)?t:g((function(t){return e(n,t)}));default:return y(n)&&y(r)?t:y(n)?g((function(t){return e(t,r)})):y(r)?g((function(t){return e(n,t)})):e(n,r)}}}function b(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function v(e,t,n){for(var r=0,o=n.length;r<o;){if(e(t,n[r]))return!0;r+=1}return!1}function w(e,t){return Object.prototype.hasOwnProperty.call(t,e)}const O="function"==typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};var S=Object.prototype.toString;const E=function(){return"[object Arguments]"===S.call(arguments)?function(e){return"[object Arguments]"===S.call(e)}:function(e){return w("callee",e)}}();var x=!{toString:null}.propertyIsEnumerable("toString"),_=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],j=function(){return arguments.propertyIsEnumerable("length")}(),k=function(e,t){for(var n=0;n<e.length;){if(e[n]===t)return!0;n+=1}return!1};const P="function"!=typeof Object.keys||j?g((function(e){if(Object(e)!==e)return[];var t,n,r=[],o=j&&E(e);for(t in e)!w(t,e)||o&&"length"===t||(r[r.length]=t);if(x)for(n=_.length-1;n>=0;)w(t=_[n],e)&&!k(r,t)&&(r[r.length]=t),n-=1;return r})):g((function(e){return Object(e)!==e?[]:Object.keys(e)})),$=g((function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}));function A(e,t,n,r){var o=b(e);function i(e,t){return C(e,t,n.slice(),r.slice())}return!v((function(e,t){return!v(i,t,e)}),b(t),o)}function C(e,t,n,r){if(O(e,t))return!0;var o,i,s=$(e);if(s!==$(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(s){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===(o=e.constructor,null==(i=String(o).match(/^function (\w*)/))?"":i[1]))return e===t;break;case"Boolean":case"Number":case"String":if(typeof e!=typeof t||!O(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!O(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 a=n.length-1;a>=0;){if(n[a]===e)return r[a]===t;a-=1}switch(s){case"Map":return e.size===t.size&&A(e.entries(),t.entries(),n.concat([e]),r.concat([t]));case"Set":return e.size===t.size&&A(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 c=P(e);if(c.length!==P(t).length)return!1;var u=n.concat([e]),l=r.concat([t]);for(a=c.length-1;a>=0;){var f=c[a];if(!w(f,t)||!C(t[f],e[f],u,l))return!1;a-=1}return!0}const T=m((function(e,t){return C(e,t,[],[])}));function D(e){return function t(n,r,o){switch(arguments.length){case 0:return t;case 1:return y(n)?t:m((function(t,r){return e(n,t,r)}));case 2:return y(n)&&y(r)?t:y(n)?m((function(t,n){return e(t,r,n)})):y(r)?m((function(t,r){return e(n,t,r)})):g((function(t){return e(n,r,t)}));default:return y(n)&&y(r)&&y(o)?t:y(n)&&y(r)?m((function(t,n){return e(t,n,o)})):y(n)&&y(o)?m((function(t,n){return e(t,r,n)})):y(r)&&y(o)?m((function(t,r){return e(n,t,r)})):y(n)?g((function(t){return e(t,r,o)})):y(r)?g((function(t){return e(n,t,o)})):y(o)?g((function(t){return e(n,r,t)})):e(n,r,o)}}}function I(e){return"[object Object]"===Object.prototype.toString.call(e)}const R=D((function(e,t,n){var r,o={};for(r in t)w(r,t)&&(o[r]=w(r,n)?e(r,t[r],n[r]):t[r]);for(r in n)w(r,n)&&!w(r,o)&&(o[r]=n[r]);return o})),N=D((function e(t,n,r){return R((function(n,r,o){return I(r)&&I(o)?e(t,r,o):t(n,r,o)}),n,r)})),M=m((function(e,t){return N((function(e,t,n){return n}),e,t)})),L=m((function(e,t){for(var n={},r={},o=0,i=e.length;o<i;)r[e[o]]=1,o+=1;for(var s in t)r.hasOwnProperty(s)||(n[s]=t[s]);return n}));function B(e,t,n,r){var o,i=function(o){for(var i=t.length,s=0;s<i;){if(e===t[s])return n[s];s+=1}for(var a in t[s+1]=e,n[s+1]=o,e)o[a]=r?B(e[a],t,n,!0):e[a];return o};switch($(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}}const U=g((function(e){return null!=e&&"function"==typeof e.clone?e.clone():B(e,[],[],!0)})),z=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)},F=g((function(e){return!!z(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))}));var K=function(){function e(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}();const V=m((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,s){return t.apply(this,arguments)};case 7:return function(e,n,r,o,i,s,a){return t.apply(this,arguments)};case 8:return function(e,n,r,o,i,s,a,c){return t.apply(this,arguments)};case 9:return function(e,n,r,o,i,s,a,c,u){return t.apply(this,arguments)};case 10:return function(e,n,r,o,i,s,a,c,u,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)}))}));function q(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)}function H(e,t,n,r){return e["@@transducer/result"](n[r](V(e["@@transducer/step"],e),t))}var W="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";function G(e,t,n){if("function"==typeof e&&(e=function(e){return new K(e)}(e)),F(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 H(e,t,n,"fantasy-land/reduce");if(null!=n[W])return q(e,t,n[W]());if("function"==typeof n.next)return q(e,t,n);if("function"==typeof n.reduce)return H(e,t,n,"reduce");throw new TypeError("reduce: list must be array or iterable")}const Z=D(G),Y=u((e=>Array.isArray(e)),"must be an array"),X=u((e=>"boolean"==typeof e),"must be a boolean"),Q=u((e=>"number"==typeof e),"must be a number"),J=u((e=>"string"==typeof e),"must be a string"),ee=u((e=>"object"==typeof e&&!Array.isArray(e)&&null!==e),"must be an object (not an array or null)"),te=u((e=>/^[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");var ne=n(403);const re=(0,ne.createGlobalStore)("config-internal",{providedConfigs:[],schemas:{}}),oe=(0,ne.createGlobalStore)("temporary-config",{config:function(){try{return JSON.parse(localStorage.getItem("openmrs:temporaryConfig")||"{}")}catch(e){return{}}}()});oe.subscribe((e=>{var t;t=e.config,localStorage.setItem("openmrs:temporaryConfig",JSON.stringify(t))}));const ie=(0,ne.createGlobalStore)("config-store-of-extension-state",{mountedExtensions:[]});function se(e){return(0,ne.getGlobalStore)(`config-module-${e}`,{config:null,loaded:!1})}const ae=(0,ne.createGlobalStore)("config-implementer-tools",{config:{}});function ce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ue(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){ce(e,t,n[t])}))}return e}function le(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 fe(e,t){for(let n of Object.keys(e.schemas)){const r=_e(n,e,t);se(n).setState({loaded:!0,config:r})}}function pe(e,t){const n=function(e,t){const n=ke(Ee(e,t)),r=Object.keys(n).reduce(((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}),{});!function(e){for(let[t,n]of Object.entries(e))for(let[e,r]of Object.entries(n))Se(r,t,e)}(r);return Object.keys(r).reduce(((e,t)=>ue({},e,r[t])),{})}(e,t),r=Object.fromEntries(Object.entries(n).map((([e,t])=>[e,{loaded:!0,config:t}]))),o=(0,ne.getGlobalStore)("config-extension-slots",{slots:{}}),i=o.getState(),s={slots:ue({},i.slots,r)};T(i,s)||o.setState(s)}function de(e,t){const n=function(e,t){let n=we(U(e.schemas));const r=[...e.providedConfigs.map((e=>[e.config,e.source])),[t.config,"temporary config"]];for(let[e,t]of r)n=ke([n,Oe(e,t)]);return n}(e,t);ae.setState({config:n})}function he(e,t,n){const r={};for(let o of t.mountedExtensions){const t=ve(o.slotModuleName,o.extensionModuleName,o.slotName,o.extensionId,e,n);r[o.slotName]=le(ue({},r[o.slotName]),{[o.extensionId]:{config:t,loaded:!0}})}(0,ne.getGlobalStore)("config-extensions",{configs:{}}).setState({configs:r})}function ye(e,t){xe(e,t);const n=M(t,Ne),r=re.getState();re.setState({schemas:le(ue({},r.schemas),{[e]:n})})}function ge(e,t){xe(e,t);const n=M(t,Ne),r=re.getState();r.schemas[e]&&console.warn(`Config schema for extension ${e} already exists. If there are multiple extensions with this same name, one will probably crash.`),re.setState({schemas:le(ue({},r.schemas),{[e]:n})})}function me(e,t="provided"){const n=re.getState();re.setState({providedConfigs:[...n.providedConfigs,{source:t,config:e}]})}function be(e){return new Promise((t=>{const n=se(e);function r(e){if(e.loaded&&e.config){const n=L(["Display conditions","Translation overrides"],e.config);t(n),o&&o()}}r(n.getState());const o=n.subscribe(r)}))}function ve(e,t,n,r,o,i){var s,a,c;const u=function(e){const[t]=e.split("#");return t}(r),l=o.schemas[u],f=l?u:t,p=Ee(o,i),d=je(e,p);var h;const y=null!==(h=null==d||null===(s=d.extensionSlots)||void 0===s||null===(a=s[n])||void 0===a||null===(c=a.configure)||void 0===c?void 0:c[r])&&void 0!==h?h:{},g=ke([je(f,p),y]),m=null!=l?l:o.schemas[t];Pe(m,g,f);const b=De(m,g);return Ae(m,b,f),delete b.extensionSlots,b}function we(e){return e.hasOwnProperty("_default")?le(ue({},e),{_value:e._default,_source:"default"}):Re(e)?Object.keys(e).reduce(((t,n)=>(t[n]=we(e[n]),t)),{}):{}}function Oe(e,t){return Re(e)?Object.keys(e).reduce(((n,r)=>(n[r]=Oe(e[r],t),n)),{}):{_value:e,_source:t}}function Se(e,t,n){const r=`Extension slot config '${t}.extensionSlots.${n}`,o=Object.keys(e).filter((e=>!["add","remove","order","configure"].includes(e)));o.length&&console.error(r+`' contains invalid keys '${o.join("', '")}'`),e.add&&(Array.isArray(e.add)&&e.add.every((e=>"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((e=>"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((e=>"string"==typeof e))||console.error(r+".order' is invalid. Must be an array of strings (extension IDs)")),e.configure&&(Re(e.configure)||console.error(r+".configure' is invalid. Must be an object with extension IDs for keys"))}function Ee(e,t){return[...e.providedConfigs.map((e=>e.config)),t.config]}function xe(e,t,n=""){const o="Please verify that you are running the latest version and, if so, alert the maintainer.";for(const i of Object.keys(t).filter((e=>!e.startsWith("_")))){const s=n+(n&&".")+i,a=t[i];if("Display conditions"===s&&console.error(`${e} declares a configuration option called "Display conditions"; the "Display conditions" option is a reserved name. ${o}`),"Translation overrides"===s&&console.error(`${e} declares a configuration option called "Translation overrides"; the "Translation overrides" option is a reserved name. ${o}`),!Re(a)){console.error(`${e} has bad config schema definition for key '${s}'. ${o}`);continue}a.hasOwnProperty("_default")||xe(e,a,s);const c=a._elements;if(Ie(c)&&xe(e,c,s+"._elements"),a._validators)for(let t of a._validators)"function"!=typeof t&&console.error(`${e} has invalid validator for key '${s}' ${o}.\n\nIf you're the maintainer: validators must be functions that return either undefined or an error string. Received ${t}.`);const u=a._type;u&&!Object.values(r).includes(u)&&console.error(`${e} has invalid type for key '${s}' ${o}.\n\nIf you're the maintainer: the allowed types are ${Object.values(r).join(", ")}. Received '${u}'`),Object.keys(a).every((e=>["_description","_validators","_elements","_type"].includes(e)))&&!n.includes("._elements")&&console.error(`${e} has bad config schema definition for key '${s}'. ${o}.\n\nIf you're the maintainer: all config elements must have a default. Received ${JSON.stringify(a)}`),c&&u&&![r.Array,r.Object].includes(u)&&console.error(`${e} has bad config schema definition for key '${s}'. ${o}.\n\nIf you're the maintainer: the 'elements' key only works with '_type' equal to 'Array' or 'Object'. Received ${JSON.stringify(u)}`)}}function _e(e,t,n){if(!t.schemas.hasOwnProperty(e))throw Error("No config schema has been defined for "+e);const r=t.schemas[e],o=je(e,Ee(t,n));Pe(r,o,e);const i=De(r,o);return Ae(r,i,e),delete i.extensionSlots,i}function je(e,t){return ke(t.map((({[e]:t})=>t)).filter((e=>!!e)))}function ke(e){return Z(M)({},e)}function Pe(e,t,n=""){for(const r of Object.keys(t)){const o=t[r],i=n+"."+r,s=e[r];e.hasOwnProperty(r)?$e(s,o,i):"extensionSlots"===r&&""!==n||console.error(`Unknown config key '${i}' provided. Ignoring.`)}}function $e(e,t,n){Ce(n,e._type,t),Re(t)?e._type===r.Object?function(e,t,n){if(e._elements)for(const r of Object.keys(t)){const o=t[r];Pe(e._elements,o,`${n}.${r}`)}}(e,t,n):e.hasOwnProperty("_default")||Pe(e,t,n):e._type===r.Array&&function(e,t,n){if(Ie(e._elements))for(let r=0;r<t.length;r++)$e(e._elements,t[r],`${n}[${r}]`);for(let o=0;o<t.length;o++){var r;Ce(`${n}[${o}]`,null===(r=e._elements)||void 0===r?void 0:r._type,t[o])}}(e,t,n)}function Ae(e,t,n=""){if(e)if(t!==e._default&&Te(n,e._validators,t),Re(t))for(const o of Object.keys(t)){const i=t[o],s=n+"."+o,a=e[o];e._type===r.Object&&e._elements?Ae(e._elements,i,s):Ae(a,i,s)}else if(Array.isArray(t)&&e._elements)for(let r=0;r<t.length;r++)Ae(e._elements,t[r],`${n}[${r}]`)}function Ce(e,t,n){t&&Te(e,[{Array:Y,Boolean:X,ConceptUuid:te,Number:Q,Object:ee,String:J,UUID:te,PersonAttributeTypeUuid:te,PatientIdentifierTypeUuid:te}[t]],n)}function Te(e,t,n){if(t)try{for(let r of t){const t=r(n);"string"==typeof t&&("object"==typeof n?console.error(`Invalid configuration for ${e}: ${t}`):console.error(`Invalid configuration value ${n} for ${e}: ${t}`))}}catch(t){console.error(`Skipping invalid validator at "${e}". Encountered error\n\t${t}`)}}fe(re.getState(),oe.getState()),re.subscribe((e=>fe(e,oe.getState()))),oe.subscribe((e=>fe(re.getState(),e))),de(re.getState(),oe.getState()),re.subscribe((e=>de(e,oe.getState()))),oe.subscribe((e=>de(re.getState(),e))),pe(re.getState(),oe.getState()),re.subscribe((e=>pe(e,oe.getState()))),oe.subscribe((e=>pe(re.getState(),e))),he(re.getState(),ie.getState(),oe.getState()),re.subscribe((e=>{he(e,ie.getState(),oe.getState())})),ie.subscribe((e=>{he(re.getState(),e,oe.getState())})),oe.subscribe((e=>{he(re.getState(),ie.getState(),e)}));const De=(e,t)=>{const n=U(t);if(!e)return n;for(const t of Object.keys(e)){const o=n[t],i=e[t];if(i&&i.hasOwnProperty("_default")){n.hasOwnProperty(t)||(n[t]=i._default);const e=i._elements;if(o&&Ie(e))if(i._type===r.Array&&Array.isArray(o)){const r=o.map((t=>De(e,t)));n[t]=r}else if(i._type===r.Object)for(let t of Object.keys(o))o[t]=De(e,o[t])}else if(Re(i)){const e=n.hasOwnProperty(t)?o:{};Re(e)&&(n[t]=De(i,e))}}return n};function Ie(e){return!!e&&Object.keys(e).filter((e=>!["_default","_validators"].includes(e))).length>0}function Re(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}const Ne={"Display conditions":{privileges:{_description:"The privilege(s) the user must have to use this extension",_type:r.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:r.Object,_default:{}}}},3662:(e,t,n)=>{"use strict";function r(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function o(e){return i.apply(this,arguments)}function i(){var e;return e=function*(e,t="./start"){if("string"!=typeof e||0===e.trim().length){const e="Attempted to call importDynamic() without supplying a package to load";throw console.error(e),new Error(e)}const r=e.replace(/[\/\-@]/g,"_");if(!window[r]){const t=yield window.importMapOverrides.getCurrentPageMap();if(!t.imports.hasOwnProperty(e)){const t=`Could not find the package ${e} defined in the current importmap`;throw console.error(t),new Error(t)}let n=t.imports[e];n.startsWith("./")&&(n=window.spaBase+n.substring(1)),yield new Promise(((e,t)=>{!function(e,t,n){const r=document.head.querySelector(`script[src="${e}"]`);let o=window[s];if(o||(o=window[s]=new Set([])),r)if(o.has(e)){const o=()=>{null==r||r.removeEventListener("load",o),t(null)};r.addEventListener("load",o);const i=t=>{console.error(`Failed to load script from ${e}`,t),null==r||r.removeEventListener("error",i),n(t.message)};r.addEventListener("error",i)}else console.warn("Script already loaded. Not loading it again.",e),t(null);else{o.add(e);const r=document.createElement("script");r.src=e,r.type="text/javascript",r.async=!0;const i=()=>{o.delete(e),r.removeEventListener("load",i),t(null)};r.addEventListener("load",i);const s=t=>{o.delete(e),console.error(`Failed to load script from ${e}`,t),r.removeEventListener("error",s),n(t.message)};r.addEventListener("error",s),document.head.appendChild(r)}}(n,e,t)}))}const o=window[r];if("object"!=typeof(i=o)||null===i||!("init"in i)||"function"!=typeof i.init||!("get"in i)||"function"!=typeof i.get){const e=`The global variable ${r} does not refer to a federated module`;throw console.error(e),new Error(e)}var i;o.init(n.S.default);const a=(yield o.get(t))();if("object"!=typeof a||null===a){const t=`Container for ${e} did not return an ESM module as expected`;throw console.error(t),new Error(t)}return a},i=function(){var t=this,n=arguments;return new Promise((function(o,i){var s=e.apply(t,n);function a(e){r(s,o,i,a,c,"next",e)}function c(e){r(s,o,i,a,c,"throw",e)}a(void 0)}))},i.apply(this,arguments)}n.d(t,{c:()=>o});const s="__openmrs_script_loading"},151:()=>{System.register(["@openmrs/esm-globals"],(function(e,t){var n={};return{setters:[function(e){n.dispatchNotificationShown=e.dispatchNotificationShown}],execute:function(){e((()=>{var e={968:(e,t,n)=>{const r=n(577).R;t.s=function(e){if(e||(e=1),!n.y.meta||!n.y.meta.url)throw console.error("__system_context__",n.y),Error("systemjs-webpack-interop was provided an unknown SystemJS context. Expected context.meta.url, but none was provided");n.p=r(n.y.meta.url,e)}},577:(e,t,n)=>{t.R=function(e,t){var n=document.createElement("a");n.href=e;for(var r="/"===n.pathname[0]?n.pathname:"/"+n.pathname,o=0,i=r.length;o!==t&&i>=0;)"/"===r[--i]&&o++;if(o!==t)throw Error("systemjs-webpack-interop: rootDirectoryLevel ("+t+") is greater than the number of directories ("+o+") in the URL path "+e);var s=r.slice(0,i+1);return n.protocol+"//"+n.host+s},Number.isInteger},728:e=>{"use strict";e.exports=n}},r={};function o(t){var n=r[t];if(void 0!==n)return n.exports;var i=r[t]={exports:{}};return e[t](i,i.exports,o),i.exports}o.y=t,o.d=(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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&!e;)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})();var i={};return(0,o(968).s)(1),(()=>{"use strict";o.r(i),o.d(i,{createErrorHandler:()=>n,reportError:()=>t});var e=o(728);function t(e){const t=r(e);setTimeout((()=>{throw t}))}function n(){const e=Error();return n=>{r(n).stack+=`\nAsync stacktrace:\n${e.stack}`,t(n)}}function r(e){let t;if(e instanceof Error)return e;if(null===e)return Error("'null' was thrown as an error");if("object"==typeof e){try{t=`Object thrown as error: ${JSON.stringify(e)}`}catch(n){t=`Object thrown as error with the following properties: ${Object.keys(e)}`}return Error(t)}return void 0===e?Error("'undefined' was thrown as an error"):Error(e.toString())}window.onerror=function(t){return console.error("Unexpected error: ",t),(0,e.dispatchNotificationShown)({description:null!=t?t:"Oops! An unexpected error occurred.",kind:"error",title:"Error"}),!1},window.onunhandledrejection=function(t){var n;console.error("Unhandled rejection: ",t.reason),(0,e.dispatchNotificationShown)({description:null!==(n=t.reason)&&void 0!==n?n:"Oops! An unhandled promise rejection occurred.",kind:"error",title:"Error"})}})(),i})())}}}))},3196:(e,t,n)=>{e=n.nmd(e),System.register(["@openmrs/esm-config","@openmrs/esm-state","@openmrs/esm-api","single-spa"],(function(r,o){var i={},s={},a={},c={};return{setters:[function(e){i.configExtensionStore=e.configExtensionStore,i.getExtensionConfigFromStore=e.getExtensionConfigFromStore,i.getExtensionSlotConfig=e.getExtensionSlotConfig,i.getExtensionSlotConfigFromStore=e.getExtensionSlotConfigFromStore,i.getExtensionSlotsConfigStore=e.getExtensionSlotsConfigStore,i.getExtensionsConfigStore=e.getExtensionsConfigStore},function(e){s.createGlobalStore=e.createGlobalStore,s.getGlobalStore=e.getGlobalStore},function(e){a.getSessionStore=e.getSessionStore,a.userHasAccess=e.userHasAccess},function(e){c.mountRootParcel=e.mountRootParcel}],execute:function(){r((()=>{var r={968:(e,t,n)=>{const r=n(577).R;t.s=function(e){if(e||(e=1),!n.y.meta||!n.y.meta.url)throw console.error("__system_context__",n.y),Error("systemjs-webpack-interop was provided an unknown SystemJS context. Expected context.meta.url, but none was provided");n.p=r(n.y.meta.url,e)}},577:(e,t,n)=>{t.R=function(e,t){var n=document.createElement("a");n.href=e;for(var r="/"===n.pathname[0]?n.pathname:"/"+n.pathname,o=0,i=r.length;o!==t&&i>=0;)"/"===r[--i]&&o++;if(o!==t)throw Error("systemjs-webpack-interop: rootDirectoryLevel ("+t+") is greater than the number of directories ("+o+") in the URL path "+e);var s=r.slice(0,i+1);return n.protocol+"//"+n.host+s},Number.isInteger},766:e=>{"use strict";e.exports=a},824:e=>{"use strict";e.exports=i},685:e=>{"use strict";e.exports=s},645:e=>{"use strict";e.exports=c}},u={};function l(e){var t=u[e];if(void 0!==t)return t.exports;var n=u[e]={exports:{}};return r[e](n,n.exports,l),n.exports}l.y=o,l.d=(e,t)=>{for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;l.g.importScripts&&(e=l.g.location+"");var t=l.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&!e;)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),l.p=e})();var f={};return(0,l(968).s)(1),(()=>{"use strict";l.r(f),l.d(f,{attach:()=>_t,checkStatus:()=>It,checkStatusFor:()=>Rt,detach:()=>jt,detachAll:()=>kt,extensionStore:()=>Kt,getAssignedExtensions:()=>Ct,getConnectedExtensions:()=>$t,getExtensionInternalStore:()=>st,getExtensionNameFromId:()=>Ot,getExtensionRegistration:()=>Et,getExtensionRegistrationFrom:()=>St,getExtensionStore:()=>ct,registerExtension:()=>xt,registerExtensionSlot:()=>Tt,renderExtension:()=>zt,reset:()=>Dt,updateInternalExtensionStore:()=>at});const r=function(e,t){return e===t||e!=e&&t!=t},o=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1};var i=Array.prototype.splice;function s(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.prototype.clear=function(){this.__data__=[],this.size=0},s.prototype.delete=function(e){var t=this.__data__,n=o(t,e);return!(n<0||(n==t.length-1?t.pop():i.call(t,n,1),--this.size,0))},s.prototype.get=function(e){var t=this.__data__,n=o(t,e);return n<0?void 0:t[n][1]},s.prototype.has=function(e){return o(this.__data__,e)>-1},s.prototype.set=function(e,t){var n=this.__data__,r=o(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};const a=s,c="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;var u="object"==typeof self&&self&&self.Object===Object&&self;const p=c||u||Function("return this")(),d=p.Symbol;var h=Object.prototype,y=h.hasOwnProperty,g=h.toString,m=d?d.toStringTag:void 0,b=Object.prototype.toString,v=d?d.toStringTag:void 0;const w=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":v&&v in Object(e)?function(e){var t=y.call(e,m),n=e[m];try{e[m]=void 0;var r=!0}catch(e){}var o=g.call(e);return r&&(t?e[m]=n:delete e[m]),o}(e):function(e){return b.call(e)}(e)},O=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},S=function(e){if(!O(e))return!1;var t=w(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},E=p["__core-js_shared__"];var x,_=(x=/[^.]+$/.exec(E&&E.keys&&E.keys.IE_PROTO||""))?"Symbol(src)_1."+x:"",j=Function.prototype.toString;const k=function(e){if(null!=e){try{return j.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var P=/^\[object .+?Constructor\]$/,$=Function.prototype,A=Object.prototype,C=$.toString,T=A.hasOwnProperty,D=RegExp("^"+C.call(T).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const I=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!O(e)||(t=e,_&&_ in t))&&(S(e)?D:P).test(k(e));var t}(n)?n:void 0},R=I(p,"Map"),N=I(Object,"create");var M=Object.prototype.hasOwnProperty,L=Object.prototype.hasOwnProperty;function B(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.prototype.clear=function(){this.__data__=N?N(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(N){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return M.call(t,e)?t[e]:void 0},B.prototype.has=function(e){var t=this.__data__;return N?void 0!==t[e]:L.call(t,e)},B.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=N&&void 0===t?"__lodash_hash_undefined__":t,this};const U=B,z=function(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map};function F(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])}}F.prototype.clear=function(){this.size=0,this.__data__={hash:new U,map:new(R||a),string:new U}},F.prototype.delete=function(e){var t=z(this,e).delete(e);return this.size-=t?1:0,t},F.prototype.get=function(e){return z(this,e).get(e)},F.prototype.has=function(e){return z(this,e).has(e)},F.prototype.set=function(e,t){var n=z(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};const K=F;function V(e){var t=this.__data__=new a(e);this.size=t.size}V.prototype.clear=function(){this.__data__=new a,this.size=0},V.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},V.prototype.get=function(e){return this.__data__.get(e)},V.prototype.has=function(e){return this.__data__.has(e)},V.prototype.set=function(e,t){var n=this.__data__;if(n instanceof a){var r=n.__data__;if(!R||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new K(r)}return n.set(e,t),this.size=n.size,this};const q=V;function H(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new K;++t<n;)this.add(e[t])}H.prototype.add=H.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},H.prototype.has=function(e){return this.__data__.has(e)};const W=H,G=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},Z=function(e,t,n,r,o,i){var s=1&n,a=e.length,c=t.length;if(a!=c&&!(s&&c>a))return!1;var u=i.get(e),l=i.get(t);if(u&&l)return u==t&&l==e;var f=-1,p=!0,d=2&n?new W:void 0;for(i.set(e,t),i.set(t,e);++f<a;){var h=e[f],y=t[f];if(r)var g=s?r(y,h,f,t,e,i):r(h,y,f,e,t,i);if(void 0!==g){if(g)continue;p=!1;break}if(d){if(!G(t,(function(e,t){if(s=t,!d.has(s)&&(h===e||o(h,e,n,r,i)))return d.push(t);var s}))){p=!1;break}}else if(h!==y&&!o(h,y,n,r,i)){p=!1;break}}return i.delete(e),i.delete(t),p},Y=p.Uint8Array,X=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n},Q=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n};var J=d?d.prototype:void 0,ee=J?J.valueOf:void 0;const te=Array.isArray;var ne=Object.prototype.propertyIsEnumerable,re=Object.getOwnPropertySymbols;const oe=re?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 s=e[n];t(s)&&(i[o++]=s)}return i}(re(e),(function(t){return ne.call(e,t)})))}:function(){return[]},ie=function(e){return null!=e&&"object"==typeof e},se=function(e){return ie(e)&&"[object Arguments]"==w(e)};var ae=Object.prototype,ce=ae.hasOwnProperty,ue=ae.propertyIsEnumerable,le=se(function(){return arguments}())?se:function(e){return ie(e)&&ce.call(e,"callee")&&!ue.call(e,"callee")};const fe=le;var pe=t&&!t.nodeType&&t,de=pe&&e&&!e.nodeType&&e,he=de&&de.exports===pe?p.Buffer:void 0;const ye=(he?he.isBuffer:void 0)||function(){return!1};var ge=/^(?:0|[1-9]\d*)$/;const me=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ge.test(e))&&e>-1&&e%1==0&&e<t},be=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var ve={};ve["[object Float32Array]"]=ve["[object Float64Array]"]=ve["[object Int8Array]"]=ve["[object Int16Array]"]=ve["[object Int32Array]"]=ve["[object Uint8Array]"]=ve["[object Uint8ClampedArray]"]=ve["[object Uint16Array]"]=ve["[object Uint32Array]"]=!0,ve["[object Arguments]"]=ve["[object Array]"]=ve["[object ArrayBuffer]"]=ve["[object Boolean]"]=ve["[object DataView]"]=ve["[object Date]"]=ve["[object Error]"]=ve["[object Function]"]=ve["[object Map]"]=ve["[object Number]"]=ve["[object Object]"]=ve["[object RegExp]"]=ve["[object Set]"]=ve["[object String]"]=ve["[object WeakMap]"]=!1;var we=t&&!t.nodeType&&t,Oe=we&&e&&!e.nodeType&&e,Se=Oe&&Oe.exports===we&&c.process,Ee=function(){try{return Oe&&Oe.require&&Oe.require("util").types||Se&&Se.binding&&Se.binding("util")}catch(e){}}(),xe=Ee&&Ee.isTypedArray;const _e=xe?(je=xe,function(e){return je(e)}):function(e){return ie(e)&&be(e.length)&&!!ve[w(e)]};var je,ke=Object.prototype.hasOwnProperty,Pe=Object.prototype;const $e=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object);var Ae=Object.prototype.hasOwnProperty;const Ce=function(e){return null!=(t=e)&&be(t.length)&&!S(t)?function(e,t){var n=te(e),r=!n&&fe(e),o=!n&&!r&&ye(e),i=!n&&!r&&!o&&_e(e),s=n||r||o||i,a=s?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=a.length;for(var u in e)!ke.call(e,u)||s&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||me(u,c))||a.push(u);return a}(e):function(e){if(n=(t=e)&&t.constructor,t!==("function"==typeof n&&n.prototype||Pe))return $e(e);var t,n,r=[];for(var o in Object(e))Ae.call(e,o)&&"constructor"!=o&&r.push(o);return r}(e);var t},Te=function(e){return function(e,t,n){var r=t(e);return te(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,Ce,oe)};var De=Object.prototype.hasOwnProperty;const Ie=I(p,"DataView"),Re=I(p,"Promise"),Ne=I(p,"Set"),Me=I(p,"WeakMap");var Le="[object Map]",Be="[object Promise]",Ue="[object Set]",ze="[object WeakMap]",Fe="[object DataView]",Ke=k(Ie),Ve=k(R),qe=k(Re),He=k(Ne),We=k(Me),Ge=w;(Ie&&Ge(new Ie(new ArrayBuffer(1)))!=Fe||R&&Ge(new R)!=Le||Re&&Ge(Re.resolve())!=Be||Ne&&Ge(new Ne)!=Ue||Me&&Ge(new Me)!=ze)&&(Ge=function(e){var t=w(e),n="[object Object]"==t?e.constructor:void 0,r=n?k(n):"";if(r)switch(r){case Ke:return Fe;case Ve:return Le;case qe:return Be;case He:return Ue;case We:return ze}return t});const Ze=Ge;var Ye="[object Arguments]",Xe="[object Array]",Qe="[object Object]",Je=Object.prototype.hasOwnProperty;const et=function(e,t,n,o,i,s){var a=te(e),c=te(t),u=a?Xe:Ze(e),l=c?Xe:Ze(t),f=(u=u==Ye?Qe:u)==Qe,p=(l=l==Ye?Qe:l)==Qe,d=u==l;if(d&&ye(e)){if(!ye(t))return!1;a=!0,f=!1}if(d&&!f)return s||(s=new q),a||_e(e)?Z(e,t,n,o,i,s):function(e,t,n,o,i,s,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||!s(new Y(e),new Y(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return r(+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 c=X;case"[object Set]":var u=1&o;if(c||(c=Q),e.size!=t.size&&!u)return!1;var l=a.get(e);if(l)return l==t;o|=2,a.set(e,t);var f=Z(c(e),c(t),o,i,s,a);return a.delete(e),f;case"[object Symbol]":if(ee)return ee.call(e)==ee.call(t)}return!1}(e,t,u,n,o,i,s);if(!(1&n)){var h=f&&Je.call(e,"__wrapped__"),y=p&&Je.call(t,"__wrapped__");if(h||y){var g=h?e.value():e,m=y?t.value():t;return s||(s=new q),i(g,m,n,o,s)}}return!!d&&(s||(s=new q),function(e,t,n,r,o,i){var s=1&n,a=Te(e),c=a.length;if(c!=Te(t).length&&!s)return!1;for(var u=c;u--;){var l=a[u];if(!(s?l in t:De.call(t,l)))return!1}var f=i.get(e),p=i.get(t);if(f&&p)return f==t&&p==e;var d=!0;i.set(e,t),i.set(t,e);for(var h=s;++u<c;){var y=e[l=a[u]],g=t[l];if(r)var m=s?r(g,y,l,t,e,i):r(y,g,l,e,t,i);if(!(void 0===m?y===g||o(y,g,n,r,i):m)){d=!1;break}h||(h="constructor"==l)}if(d&&!h){var b=e.constructor,v=t.constructor;b==v||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof v&&v instanceof v||(d=!1)}return i.delete(e),i.delete(t),d}(e,t,n,o,i,s))},tt=function e(t,n,r,o,i){return t===n||(null==t||null==n||!ie(t)&&!ie(n)?t!=t&&n!=n:et(t,n,r,o,e,i))},nt=function(e,t){return tt(e,t)};var rt=l(824),ot=l(685);const it=(0,ot.createGlobalStore)("extensionsInternal",{slots:{},extensions:{}}),st=()=>(0,ot.getGlobalStore)("extensionsInternal",{slots:{},extensions:{}});function at(e){const t=it.getState(),n=e(t);n!==t&&it.setState(n)}const ct=()=>(0,ot.getGlobalStore)("extensions",{slots:{}});function ut(e){const t=[];for(let n of Object.values(e.extensions))for(let e of n.instances)t.push({slotModuleName:e.slotModuleName,extensionModuleName:n.moduleName,slotName:e.slotName,extensionId:e.id});nt(rt.configExtensionStore.getState().mountedExtensions,t)||rt.configExtensionStore.setState({mountedExtensions:t})}ut(it.getState()),it.subscribe(ut);var lt=l(766);const ft=function(e){return void 0===e};function pt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dt(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){pt(e,t,n[t])}))}return e}function ht(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}const yt=st(),gt=ct(),mt=(0,rt.getExtensionSlotsConfigStore)(),bt=(0,rt.getExtensionsConfigStore)();function vt(e,t,n){const r={};for(let[o,i]of Object.entries(e.slots)){const{config:s}=(0,rt.getExtensionSlotConfigFromStore)(t,i.name),a=At(o,e,s,n);r[o]={moduleName:i.moduleName,assignedExtensions:a}}nt(gt.getState().slots,r)||gt.setState({slots:r})}function wt(e,t){return{moduleName:t,name:e,attachedIds:[],config:null}}function Ot(e){const[t]=e.split("#");return t}function St(e,t){const n=Ot(t);return e.extensions[n]}function Et(e){return St(yt.getState(),e)}yt.subscribe((e=>{vt(e,mt.getState(),bt.getState())})),mt.subscribe((e=>{vt(yt.getState(),e,bt.getState())})),bt.subscribe((e=>{vt(yt.getState(),mt.getState(),e)}));const xt=e=>yt.setState((t=>(t.extensions[e.name]=ht(dt({},e),{instances:[]}),t)));function _t(e,t){at((n=>{const r=n.slots[e];return ht(dt({},n),r?{slots:ht(dt({},n.slots),{[e]:ht(dt({},r),{attachedIds:[...r.attachedIds,t]})})}:{slots:ht(dt({},n.slots),{[e]:ht(dt({},wt(e)),{attachedIds:[t]})})})}))}function jt(e,t){at((n=>{const r=n.slots[e];return r&&r.attachedIds.includes(t)?ht(dt({},n),{slots:ht(dt({},n.slots),{[e]:ht(dt({},r),{attachedIds:r.attachedIds.filter((e=>e!==t))})})}):n}))}function kt(e){at((t=>{const n=t.slots[e];return n?ht(dt({},t),{slots:ht(dt({},t.slots),{[e]:ht(dt({},n),{attachedIds:[]})})}):t}))}function Pt(e,t,n,r){const o=t.indexOf(e);if(-1!==o)return o;if(void 0!==n)return 1e3+n;{const t=r.indexOf(e);return-1!==t?2e3+t:-1}}function $t(e,t=null){const n=null!=t?t:navigator.onLine;return e.filter((e=>Rt(n,e.online,e.offline)))}function At(e,t,n,r){const o=function(e,t){const n=e.add||[],r=e.remove||[],o=e.order||[],{extensions:i}=yt.getState();return[...t,...n].filter((e=>!r.includes(e))).sort(((e,n)=>{var r,s;const a=Pt(e,o,null===(r=i[Ot(e)])||void 0===r?void 0:r.order,t),c=Pt(n,o,null===(s=i[Ot(n)])||void 0===s?void 0:s.order,t);return-1===c?-1:-1===a?1:a-c}))}(n,t.slots[e].attachedIds),i=[];let s;for(let n of o){const{config:o}=(0,rt.getExtensionConfigFromStore)(r,e,n),f=Ot(n),p=t.extensions[f];if(p){var a,c,u;const e=null!==(u=null!==(c=null==o||null===(a=o["Display conditions"])||void 0===a?void 0:a.privileges)&&void 0!==c?c:p.privileges)&&void 0!==u?u:[];if(e&&("string"==typeof e||Array.isArray(e)&&e.length>0)){var l;if(ft(s)&&(s=null===(l=(0,lt.getSessionStore)().getState().session)||void 0===l?void 0:l.user),!s)continue;if(!(0,lt.userHasAccess)(e,s))continue}i.push({id:n,name:f,moduleName:p.moduleName,config:o,meta:p.meta})}}return i}function Ct(e){const t=yt.getState(),{config:n}=(0,rt.getExtensionSlotConfig)(e);return At(e,t,n,bt.getState())}const Tt=(e,t)=>yt.setState((n=>{var r;const 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 '${t}' already exists. Refusing to register the same slot name twice (in "registerExtensionSlot"). The existing one is from module ${o}.`),n;if(o&&o==e)return n;if(n.slots[t])return ht(dt({},n),{slots:ht(dt({},n.slots),{[t]:ht(dt({},n.slots[t]),{moduleName:e})})});const i=wt(t,e);return ht(dt({},n),{slots:ht(dt({},n.slots),{[t]:i})})})),Dt=()=>gt.setState((()=>({slots:{},extensions:{}})));function It(e=!0,t=!1){return Rt(navigator.onLine,e,t)}function Rt(e,t=!0,n=!1){return Boolean(e?t:n)}var Nt=l(645);function Mt(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function Lt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bt(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){Lt(e,t,n[t])}))}return e}function Ut(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 zt(e,t,n,r){return Ft.apply(this,arguments)}function Ft(){var e;return e=function*(e,t,n,r,o=(e=>e),i={}){const s=Ot(r),a=Et(r);let c=null;if(e){if(!a)throw Error(`Couldn't find extension '${s}' to attach to '${t}'`);const{load:u,meta:l,moduleName:f,online:p,offline:d}=a;if(It(p,d)){at((o=>{const i={domElement:e,id:r,slotName:t,slotModuleName:n};return Ut(Bt({},o),{extensions:Ut(Bt({},o.extensions),{[s]:Ut(Bt({},o.extensions[s]),{instances:[...o.extensions[s].instances,i]})})})}));const a=yield u(),{default:p}=a,d=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}(a,["default"]);c=(0,Nt.mountRootParcel)(o(null!=p?p:d),Ut(Bt({},i),{_meta:l,_extensionContext:{extensionId:r,extensionSlotName:t,extensionSlotModuleName:n,extensionModuleName:f},domElement:e}))}}else console.warn(`Tried to render ${r} into ${t} but no DOM element was available.`);return c},Ft=function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){Mt(i,r,o,s,a,"next",e)}function a(e){Mt(i,r,o,s,a,"throw",e)}s(void 0)}))},Ft.apply(this,arguments)}const Kt=st()})(),f})())}}}))},9559:(e,t,n)=>{"use strict";n.d(t,{ub:()=>T,og:()=>D,lW:()=>I,h6:()=>L,Kq:()=>N,EB:()=>A,yw:()=>f,ix:()=>C,Qq:()=>B,H8:()=>v});var r=n(7840),o=n(3741),i=n(3202),s=n(9789),a=n(403);const c=(0,a.createGlobalStore)("extensionsInternal",{slots:{},extensions:{}}),u=()=>(0,a.getGlobalStore)("extensionsInternal",{slots:{},extensions:{}});function l(e){const t=c.getState(),n=e(t);n!==t&&c.setState(n)}const f=()=>(0,a.getGlobalStore)("extensions",{slots:{}});function p(e){const t=[];for(let n of Object.values(e.extensions))for(let e of n.instances)t.push({slotModuleName:e.slotModuleName,extensionModuleName:n.moduleName,slotName:e.slotName,extensionId:e.id});(0,i.Z)(o.configExtensionStore.getState().mountedExtensions,t)||o.configExtensionStore.setState({mountedExtensions:t})}function d(e,t=!0,n=!1){return Boolean(e?t:n)}p(c.getState()),c.subscribe(p);var h=n(5875);function y(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(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){g(e,t,n[t])}))}return e}function b(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 v(e,t,n,r){return w.apply(this,arguments)}function w(){var e;return e=function*(e,t,n,r,o=(e=>e),i={}){const s=A(r),a=function(e){return function(e,t){const n=A(t);return e.extensions[n]}(x.getState(),e)}(r);let c=null;if(e){if(!a)throw Error(`Couldn't find extension '${s}' to attach to '${t}'`);const{load:u,meta:f,moduleName:p,online:y,offline:g}=a;if(function(e=!0,t=!1){return d(navigator.onLine,e,t)}(y,g)){l((o=>{const i={domElement:e,id:r,slotName:t,slotModuleName:n};return b(m({},o),{extensions:b(m({},o.extensions),{[s]:b(m({},o.extensions[s]),{instances:[...o.extensions[s].instances,i]})})})}));const a=yield u(),{default:d}=a,y=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}(a,["default"]);c=(0,h.mountRootParcel)(o(null!=d?d:y),b(m({},i),{_meta:f,_extensionContext:{extensionId:r,extensionSlotName:t,extensionSlotModuleName:n,extensionModuleName:p},domElement:e}))}}else console.warn(`Tried to render ${r} into ${t} but no DOM element was available.`);return c},w=function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){y(i,r,o,s,a,"next",e)}function a(e){y(i,r,o,s,a,"throw",e)}s(void 0)}))},w.apply(this,arguments)}function O(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){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){O(e,t,n[t])}))}return e}function E(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}u();const x=u(),_=f(),j=(0,o.getExtensionSlotsConfigStore)(),k=(0,o.getExtensionsConfigStore)();function P(e,t,n){const r={};for(let[i,s]of Object.entries(e.slots)){const{config:a}=(0,o.getExtensionSlotConfigFromStore)(t,s.name),c=M(i,e,a,n);r[i]={moduleName:s.moduleName,assignedExtensions:c}}(0,i.Z)(_.getState().slots,r)||_.setState({slots:r})}function $(e,t){return{moduleName:t,name:e,attachedIds:[],config:null}}function A(e){const[t]=e.split("#");return t}x.subscribe((e=>{P(e,j.getState(),k.getState())})),j.subscribe((e=>{P(x.getState(),e,k.getState())})),k.subscribe((e=>{P(x.getState(),j.getState(),e)}));const C=e=>x.setState((t=>(t.extensions[e.name]=E(S({},e),{instances:[]}),t)));function T(e,t){l((n=>{const r=n.slots[e];return E(S({},n),r?{slots:E(S({},n.slots),{[e]:E(S({},r),{attachedIds:[...r.attachedIds,t]})})}:{slots:E(S({},n.slots),{[e]:E(S({},$(e)),{attachedIds:[t]})})})}))}function D(e,t){l((n=>{const r=n.slots[e];return r&&r.attachedIds.includes(t)?E(S({},n),{slots:E(S({},n.slots),{[e]:E(S({},r),{attachedIds:r.attachedIds.filter((e=>e!==t))})})}):n}))}function I(e){l((t=>{const n=t.slots[e];return n?E(S({},t),{slots:E(S({},t.slots),{[e]:E(S({},n),{attachedIds:[]})})}):t}))}function R(e,t,n,r){const o=t.indexOf(e);if(-1!==o)return o;if(void 0!==n)return 1e3+n;{const t=r.indexOf(e);return-1!==t?2e3+t:-1}}function N(e,t=null){const n=null!=t?t:navigator.onLine;return e.filter((e=>d(n,e.online,e.offline)))}function M(e,t,n,i){const a=function(e,t){const n=e.add||[],r=e.remove||[],o=e.order||[],{extensions:i}=x.getState();return[...t,...n].filter((e=>!r.includes(e))).sort(((e,n)=>{var r,s;const a=R(e,o,null===(r=i[A(e)])||void 0===r?void 0:r.order,t),c=R(n,o,null===(s=i[A(n)])||void 0===s?void 0:s.order,t);return-1===c?-1:-1===a?1:a-c}))}(n,t.slots[e].attachedIds),c=[];let u;for(let n of a){const{config:a}=(0,o.getExtensionConfigFromStore)(i,e,n),h=A(n),y=t.extensions[h];if(y){var l,f,p;const e=null!==(p=null!==(f=null==a||null===(l=a["Display conditions"])||void 0===l?void 0:l.privileges)&&void 0!==f?f:y.privileges)&&void 0!==p?p:[];if(e&&("string"==typeof e||Array.isArray(e)&&e.length>0)){var d;if((0,s.Z)(u)&&(u=null===(d=(0,r.getSessionStore)().getState().session)||void 0===d?void 0:d.user),!u)continue;if(!(0,r.userHasAccess)(e,u))continue}c.push({id:n,name:h,moduleName:y.moduleName,config:a,meta:y.meta})}}return c}function L(e){const t=x.getState(),{config:n}=(0,o.getExtensionSlotConfig)(e);return M(e,t,n,k.getState())}const B=(e,t)=>x.setState((n=>{var r;const 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 '${t}' already exists. Refusing to register the same slot name twice (in "registerExtensionSlot"). The existing one is from module ${o}.`),n;if(o&&o==e)return n;if(n.slots[t])return E(S({},n),{slots:E(S({},n.slots),{[t]:E(S({},n.slots[t]),{moduleName:e})})});const i=$(t,e);return E(S({},n),{slots:E(S({},n.slots),{[t]:i})})}))},7025:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ConfigurableLink:()=>p.w,ErrorState:()=>h.Te,Extension:()=>p.hj,ExtensionSlot:()=>p.dT,LeftNavMenu:()=>h.cW,OpenmrsFetchError:()=>r.nF,Type:()=>s.Dy,UserHasAccess:()=>p.Vz,VisitMode:()=>r.u4,VisitStatus:()=>r.Rx,attach:()=>u.ub,backendDependencies:()=>r.Wf,beginEditSynchronizationItem:()=>f.jp,canBeginEditSynchronizationItemsOfType:()=>f.Qd,clearCurrentUser:()=>r.Ze,createGlobalStore:()=>d.jk,createUseStore:()=>p.NV,defaultVisitCustomRepresentation:()=>r.I$,defineConfigSchema:()=>s.SH,defineExtensionConfigSchema:()=>s.Tj,deleteSynchronizationItem:()=>f.Gy,detach:()=>u.og,detachAll:()=>u.lW,fetchCurrentPatient:()=>r.Vy,fhirBaseUrl:()=>r.DN,generateOfflineUuid:()=>f.sF,getAppState:()=>d.W5,getAssignedExtensions:()=>u.h6,getAsyncExtensionLifecycle:()=>p.D$,getAsyncLifecycle:()=>p.Ae,getConfig:()=>s.iE,getConfigStore:()=>s.pR,getConnectedExtensions:()=>u.Kq,getCurrentOfflineMode:()=>f.vm,getCurrentUser:()=>r.ts,getDynamicOfflineDataEntries:()=>f.xA,getDynamicOfflineDataEntriesFor:()=>f.H_,getDynamicOfflineDataHandlers:()=>f.Ui,getExtensionNameFromId:()=>u.EB,getExtensionStore:()=>u.yw,getFullSynchronizationItems:()=>f.D2,getFullSynchronizationItemsFor:()=>f.WB,getGlobalStore:()=>d.zJ,getLifecycle:()=>p.tl,getLocations:()=>r.JC,getLoggedInUser:()=>r.r,getOfflineDb:()=>f.aA,getOfflinePatientDataStore:()=>f.k1,getSessionLocation:()=>r.WK,getSessionStore:()=>r.KJ,getStartedVisit:()=>r.$X,getSyncLifecycle:()=>p.a$,getSynchronizationItem:()=>f.TI,getSynchronizationItems:()=>f.Q2,getVisitTypes:()=>r.P9,getVisitsForPatient:()=>r.nx,importDynamic:()=>a.c,inRange:()=>s.Z2,interpolateString:()=>s.IT,interpolateUrl:()=>s.ll,isDesktop:()=>p.nI,isOfflineUuid:()=>f.z7,isUrl:()=>s.CB,isUrlWithTemplateParameters:()=>s.gZ,makeUrl:()=>r.bf,messageOmrsServiceWorker:()=>f.gp,navigate:()=>s.c4,offlineUuidPrefix:()=>f.a7,omrsOfflineCachingStrategyHttpHeaderName:()=>f.Rz,omrsOfflineResponseBodyHttpHeaderName:()=>f.QI,omrsOfflineResponseStatusHttpHeaderName:()=>f.$9,oneOf:()=>s.kw,openmrsFetch:()=>r.vb,openmrsObservableFetch:()=>r.uj,provide:()=>s.JJ,putDynamicOfflineData:()=>f.cV,putDynamicOfflineDataFor:()=>f.fR,queueSynchronizationItem:()=>f.X2,refetchCurrentUser:()=>r.VJ,registerExtension:()=>u.ix,registerExtensionSlot:()=>u.Qq,registerOfflinePatientHandler:()=>f.dt,removeDynamicOfflineData:()=>f.pO,removeDynamicOfflineDataFor:()=>f.ME,renderExtension:()=>u.H8,restBaseUrl:()=>r.YC,saveVisit:()=>r.bX,sessionEndpoint:()=>r.z$,setLeftNav:()=>h.VM,setSessionLocation:()=>r.jK,setupDynamicOfflineDataHandler:()=>f.Xc,setupOfflineSync:()=>f.Kb,showActionableNotification:()=>h.fu,showModal:()=>h.K4,showNotification:()=>h.c0,showToast:()=>h.CF,subscribeActionableNotificationShown:()=>l.V9,subscribeConnectivity:()=>l.BW,subscribeConnectivityChanged:()=>l.XS,subscribeNotificationShown:()=>l.NQ,subscribePrecacheStaticDependencies:()=>l.dY,subscribeTo:()=>d.se,subscribeToastShown:()=>l.id,syncAllDynamicOfflineData:()=>f.ps,syncDynamicOfflineData:()=>f.mF,syncOfflinePatientData:()=>f.MO,toLocationObject:()=>r.Lq,toVisitTypeObject:()=>r.VF,unsetLeftNav:()=>h.$d,updateVisit:()=>r.ym,useAssignedExtensionIds:()=>p.YV,useAssignedExtensions:()=>p.P3,useBodyScrollLock:()=>p.yn,useConfig:()=>p.ZR,useConnectedExtensions:()=>p.BL,useConnectivity:()=>p.Y9,useExtensionSlotMeta:()=>p.qd,useExtensionStore:()=>p.jf,useLayoutType:()=>p.mr,useLocations:()=>p.Z_,useOnClickOutside:()=>p.t$,usePagination:()=>p.h0,usePatient:()=>p.lm,useSession:()=>p.kP,useStore:()=>p.oR,useStoreWithActions:()=>p.xQ,useVisit:()=>p.JF,useVisitTypes:()=>p.NN,userHasAccess:()=>r.y9,validator:()=>s.sC,validators:()=>s.z2});var r=n(2601),o=n(789),i={};for(const e in o)["default","OpenmrsFetchError","VisitMode","VisitStatus","backendDependencies","clearCurrentUser","defaultVisitCustomRepresentation","fetchCurrentPatient","fhirBaseUrl","getCurrentUser","getLocations","getLoggedInUser","getSessionLocation","getSessionStore","getStartedVisit","getVisitTypes","getVisitsForPatient","makeUrl","openmrsFetch","openmrsObservableFetch","refetchCurrentUser","restBaseUrl","saveVisit","sessionEndpoint","setSessionLocation","toLocationObject","toVisitTypeObject","updateVisit","userHasAccess"].indexOf(e)<0&&(i[e]=()=>o[e]);n.d(t,i);var s=n(7521),a=n(3662),c=n(151);i={};for(const e in c)["default","OpenmrsFetchError","VisitMode","VisitStatus","backendDependencies","clearCurrentUser","defaultVisitCustomRepresentation","fetchCurrentPatient","fhirBaseUrl","getCurrentUser","getLocations","getLoggedInUser","getSessionLocation","getSessionStore","getStartedVisit","getVisitTypes","getVisitsForPatient","makeUrl","openmrsFetch","openmrsObservableFetch","refetchCurrentUser","restBaseUrl","saveVisit","sessionEndpoint","setSessionLocation","toLocationObject","toVisitTypeObject","updateVisit","userHasAccess","Type","defineConfigSchema","defineExtensionConfigSchema","getConfig","getConfigStore","inRange","interpolateString","interpolateUrl","isUrl","isUrlWithTemplateParameters","navigate","oneOf","provide","validator","validators","importDynamic"].indexOf(e)<0&&(i[e]=()=>c[e]);n.d(t,i);var u=n(9559),l=n(1954),f=n(7352),p=n(4011),d=n(1686),h=n(171),y=n(1990);i={};for(const e in y)["default","OpenmrsFetchError","VisitMode","VisitStatus","backendDependencies","clearCurrentUser","defaultVisitCustomRepresentation","fetchCurrentPatient","fhirBaseUrl","getCurrentUser","getLocations","getLoggedInUser","getSessionLocation","getSessionStore","getStartedVisit","getVisitTypes","getVisitsForPatient","makeUrl","openmrsFetch","openmrsObservableFetch","refetchCurrentUser","restBaseUrl","saveVisit","sessionEndpoint","setSessionLocation","toLocationObject","toVisitTypeObject","updateVisit","userHasAccess","Type","defineConfigSchema","defineExtensionConfigSchema","getConfig","getConfigStore","inRange","interpolateString","interpolateUrl","isUrl","isUrlWithTemplateParameters","navigate","oneOf","provide","validator","validators","importDynamic","attach","detach","detachAll","getAssignedExtensions","getConnectedExtensions","getExtensionNameFromId","getExtensionStore","registerExtension","registerExtensionSlot","renderExtension","subscribeActionableNotificationShown","subscribeConnectivity","subscribeConnectivityChanged","subscribeNotificationShown","subscribePrecacheStaticDependencies","subscribeToastShown","beginEditSynchronizationItem","canBeginEditSynchronizationItemsOfType","deleteSynchronizationItem","generateOfflineUuid","getCurrentOfflineMode","getDynamicOfflineDataEntries","getDynamicOfflineDataEntriesFor","getDynamicOfflineDataHandlers","getFullSynchronizationItems","getFullSynchronizationItemsFor","getOfflineDb","getOfflinePatientDataStore","getSynchronizationItem","getSynchronizationItems","isOfflineUuid","messageOmrsServiceWorker","offlineUuidPrefix","omrsOfflineCachingStrategyHttpHeaderName","omrsOfflineResponseBodyHttpHeaderName","omrsOfflineResponseStatusHttpHeaderName","putDynamicOfflineData","putDynamicOfflineDataFor","queueSynchronizationItem","registerOfflinePatientHandler","removeDynamicOfflineData","removeDynamicOfflineDataFor","setupDynamicOfflineDataHandler","setupOfflineSync","syncAllDynamicOfflineData","syncDynamicOfflineData","syncOfflinePatientData","ConfigurableLink","Extension","ExtensionSlot","UserHasAccess","createUseStore","getAsyncExtensionLifecycle","getAsyncLifecycle","getLifecycle","getSyncLifecycle","isDesktop","useAssignedExtensionIds","useAssignedExtensions","useBodyScrollLock","useConfig","useConnectedExtensions","useConnectivity","useExtensionSlotMeta","useExtensionStore","useLayoutType","useLocations","useOnClickOutside","usePagination","usePatient","useSession","useStore","useStoreWithActions","useVisit","useVisitTypes","createGlobalStore","getAppState","getGlobalStore","subscribeTo","ErrorState","LeftNavMenu","setLeftNav","showActionableNotification","showModal","showNotification","showToast","unsetLeftNav"].indexOf(e)<0&&(i[e]=()=>y[e]);n.d(t,i)},8758:()=>{System.register([],(function(e,t){return{execute:function(){e((()=>{var e={968:(e,t,n)=>{const r=n(577).R;t.s=function(e){if(e||(e=1),!n.y.meta||!n.y.meta.url)throw console.error("__system_context__",n.y),Error("systemjs-webpack-interop was provided an unknown SystemJS context. Expected context.meta.url, but none was provided");n.p=r(n.y.meta.url,e)}},577:(e,t,n)=>{t.R=function(e,t){var n=document.createElement("a");n.href=e;for(var r="/"===n.pathname[0]?n.pathname:"/"+n.pathname,o=0,i=r.length;o!==t&&i>=0;)"/"===r[--i]&&o++;if(o!==t)throw Error("systemjs-webpack-interop: rootDirectoryLevel ("+t+") is greater than the number of directories ("+o+") in the URL path "+e);var s=r.slice(0,i+1);return n.protocol+"//"+n.host+s},Number.isInteger}},n={};function r(t){var o=n[t];if(void 0!==o)return o.exports;var i=n[t]={exports:{}};return e[t](i,i.exports,r),i.exports}r.y=t,r.d=(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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&!e;)e=n[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})();var o={};return(0,r(968).s)(1),(()=>{"use strict";r.r(o),r.d(o,{dispatchActionableNotificationShown:()=>d,dispatchConnectivityChanged:()=>t,dispatchNotificationShown:()=>p,dispatchPrecacheStaticDependencies:()=>a,subscribeActionableNotificationShown:()=>y,subscribeConnectivity:()=>i,subscribeConnectivityChanged:()=>n,subscribeNotificationShown:()=>h,subscribePrecacheStaticDependencies:()=>c,subscribeToastShown:()=>g});const e="openmrs:connectivity-changed";function t(t){window.dispatchEvent(new CustomEvent(e,{detail:{online:t}}))}function n(t){const n=e=>t(e.detail);return window.addEventListener(e,n),()=>window.removeEventListener(e,n)}function i(e){return e({online:navigator.onLine}),n(e)}const s="openmrs:precache-static-dependencies";function a(e={}){window.dispatchEvent(new CustomEvent(s,{detail:e}))}function c(e){const t=t=>e(t.detail);return window.addEventListener(s,t),()=>window.removeEventListener(s,t)}const u="openmrs:notification-shown",l="openmrs:actionable-notification-shown",f="openmrs:toast-shown";function p(e){window.dispatchEvent(new CustomEvent(u,{detail:e}))}function d(e){window.dispatchEvent(new CustomEvent(l,{detail:e}))}function h(e){const t=t=>e(t.detail);return window.addEventListener(u,t),()=>window.removeEventListener(u,t)}function y(e){const t=t=>e(t.detail);return window.addEventListener(l,t),()=>window.removeEventListener(l,t)}function g(e){const t=t=>e(t.detail);return window.addEventListener(f,t),()=>window.removeEventListener(f,t)}})(),o})())}}}))},1954:(e,t,n)=>{"use strict";n.d(t,{V9:()=>p,BW:()=>i,XS:()=>o,NQ:()=>f,dY:()=>a,id:()=>d});const r="openmrs:connectivity-changed";function o(e){const t=t=>e(t.detail);return window.addEventListener(r,t),()=>window.removeEventListener(r,t)}function i(e){return e({online:navigator.onLine}),o(e)}const s="openmrs:precache-static-dependencies";function a(e){const t=t=>e(t.detail);return window.addEventListener(s,t),()=>window.removeEventListener(s,t)}const c="openmrs:notification-shown",u="openmrs:actionable-notification-shown",l="openmrs:toast-shown";function f(e){const t=t=>e(t.detail);return window.addEventListener(c,t),()=>window.removeEventListener(c,t)}function p(e){const t=t=>e(t.detail);return window.addEventListener(u,t),()=>window.removeEventListener(u,t)}function d(e){const t=t=>e(t.detail);return window.addEventListener(l,t),()=>window.removeEventListener(l,t)}},8809:(e,t,n)=>{function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(t){r(e,t,n[t])}))}return e}function i(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}System.register(["@openmrs/esm-api","@openmrs/esm-state"],(function(e,t){var r={},s={};return{setters:[function(e){r.getLoggedInUser=e.getLoggedInUser},function(e){s.createGlobalStore=e.createGlobalStore}],execute:function(){e((()=>{var e={968:(e,t,n)=>{const r=n(577).R;t.s=function(e){if(e||(e=1),!n.y.meta||!n.y.meta.url)throw console.error("__system_context__",n.y),Error("systemjs-webpack-interop was provided an unknown SystemJS context. Expected context.meta.url, but none was provided");n.p=r(n.y.meta.url,e)}},577:(e,t,n)=>{t.R=function(e,t){var n=document.createElement("a");n.href=e;for(var r="/"===n.pathname[0]?n.pathname:"/"+n.pathname,o=0,i=r.length;o!==t&&i>=0;)"/"===r[--i]&&o++;if(o!==t)throw Error("systemjs-webpack-interop: rootDirectoryLevel ("+t+") is greater than the number of directories ("+o+") in the URL path "+e);var s=r.slice(0,i+1);return n.protocol+"//"+n.host+s},Number.isInteger},766:e=>{"use strict";e.exports=r},685:e=>{"use strict";e.exports=s}},a={};function c(t){var n=a[t];if(void 0!==n)return n.exports;var r=a[t]={exports:{}};return e[t](r,r.exports,c),r.exports}c.y=t,c.d=(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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;c.g.importScripts&&(e=c.g.location+"");var t=c.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&!e;)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),c.p=e})();var u={};return(0,c(968).s)(1),(()=>{"use strict";c.r(u),c.d(u,{activateOfflineCapability:()=>N,beginEditSynchronizationItem:()=>uo,canBeginEditSynchronizationItemsOfType:()=>co,deleteSynchronizationItem:()=>fo,generateOfflineUuid:()=>So,getCurrentOfflineMode:()=>I,getDynamicOfflineDataEntries:()=>$o,getDynamicOfflineDataEntriesFor:()=>Co,getDynamicOfflineDataHandlers:()=>ko,getFullSynchronizationItems:()=>oo,getFullSynchronizationItemsFor:()=>eo,getOfflineDb:()=>Dr,getOfflinePatientDataStore:()=>Zo,getOfflineSynchronizationStore:()=>zr,getOmrsServiceWorker:()=>b,getSynchronizationItem:()=>so,getSynchronizationItems:()=>no,getSynchronizationItemsFor:()=>Qr,isOfflineUuid:()=>Eo,messageOmrsServiceWorker:()=>E,offlineUuidPrefix:()=>Oo,omrsOfflineCachingStrategyHttpHeaderName:()=>O,omrsOfflineResponseBodyHttpHeaderName:()=>v,omrsOfflineResponseStatusHttpHeaderName:()=>w,putDynamicOfflineData:()=>Do,putDynamicOfflineDataFor:()=>Ro,queueSynchronizationItem:()=>Yr,queueSynchronizationItemFor:()=>Gr,registerOfflinePatientHandler:()=>Yo,registerOmrsServiceWorker:()=>m,removeDynamicOfflineData:()=>Mo,removeDynamicOfflineDataFor:()=>Bo,runSynchronization:()=>Fr,setCurrentOfflineMode:()=>R,setupDynamicOfflineDataHandler:()=>Po,setupOfflineSync:()=>ho,syncAllDynamicOfflineData:()=>zo,syncDynamicOfflineData:()=>Ko,syncOfflinePatientData:()=>Xo});try{self["workbox:window:6.5.3"]&&_()}catch(e){}function e(e,t){return new Promise((function(n){var r=new MessageChannel;r.port1.onmessage=function(e){n(e.data)},e.postMessage(t,[r.port2])}))}function t(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 r(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)}try{self["workbox:core:6.5.3"]&&_()}catch(e){}var s=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t,e.reject=n}))};function a(e,t){var n=location.href;return new URL(e,n).href===new URL(t,n).href}var l=function(e,t){this.type=e,Object.assign(this,t)};function f(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function p(){}var d={type:"SKIP_WAITING"};function h(e,t){if(!t)return e&&e.then?e.then(p):Promise.resolve()}var y=function(t){var n,r;function o(e,n){var r,o;return void 0===n&&(n={}),(r=t.call(this)||this).nn={},r.tn=0,r.rn=new s,r.en=new s,r.on=new s,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,s={sw:n,isExternal:i,originalEvent:e};!i&&r.mn&&(s.isUpdate=!0),r.dispatchEvent(new l(o,s)),"installed"===o?r.wn=self.setTimeout((function(){"installed"===o&&t.waiting===n&&r.dispatchEvent(new l("waiting",s))}),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 l("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 f(r.getSW(),(function(){r.an.has(o)&&r.dispatchEvent(new l("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 i,c=o.prototype;return c.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 h(new Promise((function(e){return window.addEventListener("load",e)})))}),(function(){return r.mn=Boolean(navigator.serviceWorker.controller),r.yn=r.pn(),f(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 l("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)}},c.update=function(){try{return this.fn?h(this.fn.update()):void 0}catch(e){return Promise.reject(e)}},c.getSW=function(){return void 0!==this.hn?Promise.resolve(this.hn):this.rn.promise},c.messageSW=function(t){try{return f(this.getSW(),(function(n){return e(n,t)}))}catch(e){return Promise.reject(e)}},c.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&e(this.fn.waiting,d)},c.pn=function(){var e=navigator.serviceWorker.controller;return e&&a(e.scriptURL,this.sn.toString())?e:void 0},c.bn=function(){try{var e=this;return function(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}((function(){return f(navigator.serviceWorker.register(e.sn,e.nn),(function(t){return e.un=performance.now(),t}))}),(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),o}(function(){function e(){this.Pn=new Map}var 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}());let g;function m(e,t){if(void 0!==g)return console.warn(`The application's Service Worker has already been registered. The new service worker at ${e} will not be registered.`),g;if(!("serviceWorker"in navigator))throw new Error("Registering the Service Worker is not possible due to missing browser capabilities.");const n=new y(e,t);return g=n.register().then((()=>n.controlling.then((()=>n)))),g}function b(){return null!=g?g:Promise.resolve(void 0)}const v="x-omrs-offline-response-body",w="x-omrs-offline-response-status",O="x-omrs-offline-caching-strategy";function S(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function E(e){return x.apply(this,arguments)}function x(){return x=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){S(i,r,o,s,a,"next",e)}function a(e){S(i,r,o,s,a,"throw",e)}s(void 0)}))}}((function*(e){const t=yield b();return t?yield t.messageSW(e):{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."}})),x.apply(this,arguments)}function j(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function k(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){j(i,r,o,s,a,"next",e)}function a(e){j(i,r,o,s,a,"throw",e)}s(void 0)}))}}function P(){return P=k((function*(){const e=window.sessionStorage;try{e.setItem("someKeyHere","test"),e.removeItem("someKeyHere")}catch(t){if(t.code===DOMException.QUOTA_EXCEEDED_ERR&&0===e.length)return!0}return!1})),P.apply(this,arguments)}function $(){return($=k((function*(){return!window.indexedDB}))).apply(this,arguments)}function A(){return A=k((function*(){return new Promise((e=>{const t=indexedDB.open("test");t.onerror=()=>e(!0),t.onsuccess=()=>e(!1)}))})),A.apply(this,arguments)}function C(){return C=k((function*(){return(yield function(){return A.apply(this,arguments)}())||(yield function(){return $.apply(this,arguments)}())||(yield function(){return P.apply(this,arguments)}())})),C.apply(this,arguments)}const T="openmrs3:offline-mode";let D="unavailable";function I(){return{current:D,notAvailable:"unavailable"===D,active:"on"===D}}function R(e){"unavailable"!==D&&"unavailable"!==e&&(localStorage.setItem(T,"on"===e?"active":"disabled"),D=e)}function N(){return M.apply(this,arguments)}function M(){return M=k((function*(){const e=yield function(){return C.apply(this,arguments)}();e||(D="active"===localStorage.getItem(T)?"on":"off"),navigator.onLine})),M.apply(this,arguments)}const L="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,B=Object.keys,U=Array.isArray;function z(e,t){return"object"!=typeof t||B(t).forEach((function(n){e[n]=t[n]})),e}"undefined"==typeof Promise||L.Promise||(L.Promise=Promise);const F=Object.getPrototypeOf,K={}.hasOwnProperty;function V(e,t){return K.call(e,t)}function q(e,t){"function"==typeof t&&(t=t(F(e))),("undefined"==typeof Reflect?B:Reflect.ownKeys)(t).forEach((n=>{W(e,n,t[n])}))}const H=Object.defineProperty;function W(e,t,n,r){H(e,t,z(n&&V(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function G(e){return{from:function(t){return e.prototype=Object.create(t.prototype),W(e.prototype,"constructor",e),{extend:q.bind(null,e.prototype)}}}}const Z=Object.getOwnPropertyDescriptor;function Y(e,t){let n;return Z(e,t)||(n=F(e))&&Y(n,t)}const X=[].slice;function Q(e,t,n){return X.call(e,t,n)}function J(e,t){return t(e)}function ee(e){if(!e)throw new Error("Assertion Failed")}function te(e){L.setImmediate?setImmediate(e):setTimeout(e,0)}function ne(e,t){return e.reduce(((e,n,r)=>{var o=t(n,r);return o&&(e[o[0]]=o[1]),e}),{})}function re(e,t){if(V(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=re(e,t[r]);n.push(i)}return n}var s=t.indexOf(".");if(-1!==s){var a=e[t.substr(0,s)];return void 0===a?void 0:re(a,t.substr(s+1))}}function oe(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){ee("string"!=typeof n&&"length"in n);for(var r=0,o=t.length;r<o;++r)oe(e,t[r],n[r])}else{var i=t.indexOf(".");if(-1!==i){var s=t.substr(0,i),a=t.substr(i+1);if(""===a)void 0===n?U(e)&&!isNaN(parseInt(s))?e.splice(s,1):delete e[s]:e[s]=n;else{var c=e[s];c&&V(e,s)||(c=e[s]={}),oe(c,a,n)}}else void 0===n?U(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function ie(e){var t={};for(var n in e)V(e,n)&&(t[n]=e[n]);return t}const se=[].concat;function ae(e){return se.apply([],e)}const ce="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(ae([8,16,32,64].map((e=>["Int","Uint","Float"].map((t=>t+e+"Array")))))).filter((e=>L[e])),ue=ce.map((e=>L[e]));ne(ce,(e=>[e,!0]));let le=null;function fe(e){le="undefined"!=typeof WeakMap&&new WeakMap;const t=pe(e);return le=null,t}function pe(e){if(!e||"object"!=typeof e)return e;let t=le&&le.get(e);if(t)return t;if(U(e)){t=[],le&&le.set(e,t);for(var n=0,r=e.length;n<r;++n)t.push(pe(e[n]))}else if(ue.indexOf(e.constructor)>=0)t=e;else{const n=F(e);for(var o in t=n===Object.prototype?{}:Object.create(n),le&&le.set(e,t),e)V(e,o)&&(t[o]=pe(e[o]))}return t}const{toString:de}={};function he(e){return de.call(e).slice(8,-1)}const ye="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",ge="symbol"==typeof ye?function(e){var t;return null!=e&&(t=e[ye])&&t.apply(e)}:function(){return null},me={};function be(e){var t,n,r,o;if(1===arguments.length){if(U(e))return e.slice();if(this===me&&"string"==typeof e)return[e];if(o=ge(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}const ve="undefined"!=typeof Symbol?e=>"AsyncFunction"===e[Symbol.toStringTag]:()=>!1;var we="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Oe(e,t){we=e,Se=t}var Se=()=>!0;const Ee=!new Error("").stack;function xe(){if(Ee)try{throw xe.arguments,new Error}catch(e){return e}return new Error}function _e(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(Se).map((e=>"\n"+e)).join("")):""}var je=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],ke=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(je),Pe={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"};function $e(e,t){this._e=xe(),this.name=e,this.message=t}function Ae(e,t){return e+". Errors: "+Object.keys(t).map((e=>t[e].toString())).filter(((e,t,n)=>n.indexOf(e)===t)).join("\n")}function Ce(e,t,n,r){this._e=xe(),this.failures=t,this.failedKeys=r,this.successCount=n,this.message=Ae(e,t)}function Te(e,t){this._e=xe(),this.name="BulkError",this.failures=Object.keys(t).map((e=>t[e])),this.failuresByPos=t,this.message=Ae(e,t)}G($e).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+_e(this._e,2))}},toString:function(){return this.name+": "+this.message}}),G(Ce).from($e),G(Te).from($e);var De=ke.reduce(((e,t)=>(e[t]=t+"Error",e)),{});const Ie=$e;var Re=ke.reduce(((e,t)=>{var n=t+"Error";function r(e,r){this._e=xe(),this.name=n,e?"string"==typeof e?(this.message=`${e}${r?"\n "+r:""}`,this.inner=r||null):"object"==typeof e&&(this.message=`${e.name} ${e.message}`,this.inner=e):(this.message=Pe[t]||n,this.inner=null)}return G(r).from(Ie),e[t]=r,e}),{});Re.Syntax=SyntaxError,Re.Type=TypeError,Re.Range=RangeError;var Ne=je.reduce(((e,t)=>(e[t+"Error"]=Re[t],e)),{}),Me=ke.reduce(((e,t)=>(-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=Re[t]),e)),{});function Le(){}function Be(e){return e}function Ue(e,t){return null==e||e===Be?t:function(n){return t(e(n))}}function ze(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function Fe(e,t){return e===Le?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?ze(r,this.onsuccess):r),o&&(this.onerror=this.onerror?ze(o,this.onerror):o),void 0!==i?i:n}}function Ke(e,t){return e===Le?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?ze(n,this.onsuccess):n),r&&(this.onerror=this.onerror?ze(r,this.onerror):r)}}function Ve(e,t){return e===Le?t:function(n){var r=e.apply(this,arguments);z(n,r);var o=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var s=t.apply(this,arguments);return o&&(this.onsuccess=this.onsuccess?ze(o,this.onsuccess):o),i&&(this.onerror=this.onerror?ze(i,this.onerror):i),void 0===r?void 0===s?void 0:s:z(r,s)}}function qe(e,t){return e===Le?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function He(e,t){return e===Le?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)}}Me.ModifyError=Ce,Me.DexieError=$e,Me.BulkError=Te;var We={};const[Ge,Ze,Ye]="undefined"==typeof Promise?[]:(()=>{let e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,F(e),e];const t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,F(t),e]})(),Xe=Ze&&Ze.then,Qe=Ge&&Ge.constructor,Je=!!Ye;var et=!1,tt=Ye?()=>{Ye.then(xt)}:L.setImmediate?setImmediate.bind(null,xt):L.MutationObserver?()=>{var e=document.createElement("div");new MutationObserver((()=>{xt(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:()=>{setTimeout(xt,0)},nt=function(e,t){ft.push([e,t]),ot&&(tt(),ot=!1)},rt=!0,ot=!0,it=[],st=[],at=null,ct=Be,ut={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Gt,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((e=>{try{Gt(e[0],e[1])}catch(e){}}))}},lt=ut,ft=[],pt=0,dt=[];function ht(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=Le,this._lib=!1;var t=this._PSD=lt;if(we&&(this._stackHolder=xe(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==We)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&bt(this,this._value))}this._state=null,this._value=null,++t.ref,mt(this,e)}const yt={get:function(){var e=lt,t=It;function n(n,r){var o=!e.global&&(e!==lt||t!==It);const i=o&&!Lt();var s=new ht(((t,s)=>{wt(this,new gt(Ht(n,e,o,i),Ht(r,e,o,i),t,s,e))}));return we&&Et(s,this),s}return n.prototype=We,n},set:function(e){W(this,"then",e&&e.prototype===We?yt:{get:function(){return e},set:yt.set})}};function gt(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}function mt(e,t){try{t((t=>{if(null===e._state){if(t===e)throw new TypeError("A promise cannot be resolved with itself.");var n=e._lib&&_t();t&&"function"==typeof t.then?mt(e,((e,n)=>{t instanceof ht?t._then(e,n):t.then(e,n)})):(e._state=!0,e._value=t,vt(e)),n&&jt()}}),bt.bind(null,e))}catch(t){bt(e,t)}}function bt(e,t){if(st.push(t),null===e._state){var n=e._lib&&_t();t=ct(t),e._state=!1,e._value=t,we&&null!==t&&"object"==typeof t&&!t._promise&&function(e,t,n){try{e.apply(null,void 0)}catch(e){}}((()=>{var n=Y(t,"stack");t._promise=e,W(t,"stack",{get:()=>et?n&&(n.get?n.get.apply(t):n.value):e.stack})})),function(e){it.some((t=>t._value===e._value))||it.push(e)}(e),vt(e),n&&jt()}}function vt(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)wt(e,t[n]);var o=e._PSD;--o.ref||o.finalize(),0===pt&&(++pt,nt((()=>{0==--pt&&kt()}),[]))}function wt(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,++pt,nt(Ot,[n,e,t])}else e._listeners.push(t)}function Ot(e,t,n){try{at=t;var r,o=t._value;t._state?r=e(o):(st.length&&(st=[]),r=e(o),-1===st.indexOf(o)&&function(e){for(var t=it.length;t;)if(it[--t]._value===e._value)return void it.splice(t,1)}(t)),n.resolve(r)}catch(e){n.reject(e)}finally{at=null,0==--pt&&kt(),--n.psd.ref||n.psd.finalize()}}function St(e,t,n){if(t.length===n)return t;var r="";if(!1===e._state){var o,i,s=e._value;null!=s?(o=s.name||"Error",i=s.message||s,r=_e(s,0)):(o=s,i=""),t.push(o+(i?": "+i:"")+r)}return we&&((r=_e(e._stackHolder,2))&&-1===t.indexOf(r)&&t.push(r),e._prev&&St(e._prev,t,n)),t}function Et(e,t){var n=t?t._numPrev+1:0;n<100&&(e._prev=t,e._numPrev=n)}function xt(){_t()&&jt()}function _t(){var e=rt;return rt=!1,ot=!1,e}function jt(){var e,t,n;do{for(;ft.length>0;)for(e=ft,ft=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}}while(ft.length>0);rt=!0,ot=!0}function kt(){var e=it;it=[],e.forEach((e=>{e._PSD.onunhandled.call(null,e._value,e)}));for(var t=dt.slice(0),n=t.length;n;)t[--n]()}function Pt(e){return new ht(We,!1,e)}function $t(e,t){var n=lt;return function(){var r=_t(),o=lt;try{return Ft(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{Ft(o,!1),r&&jt()}}}q(ht.prototype,{then:yt,_then:function(e,t){wt(this,new gt(null,null,e,t,lt))},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,(e=>e instanceof t?n(e):Pt(e))):this.then(null,(e=>e&&e.name===t?n(e):Pt(e)))},finally:function(e){return this.then((t=>(e(),t)),(t=>(e(),Pt(t))))},stack:{get:function(){if(this._stack)return this._stack;try{et=!0;var e=St(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{et=!1}}},timeout:function(e,t){return e<1/0?new ht(((n,r)=>{var o=setTimeout((()=>r(new Re.Timeout(t))),e);this.then(n,r).finally(clearTimeout.bind(null,o))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&W(ht.prototype,Symbol.toStringTag,"Dexie.Promise"),ut.env=Kt(),q(ht,{all:function(){var e=be.apply(null,arguments).map(Bt);return new ht((function(t,n){0===e.length&&t([]);var r=e.length;e.forEach(((o,i)=>ht.resolve(o).then((n=>{e[i]=n,--r||t(e)}),n)))}))},resolve:e=>{if(e instanceof ht)return e;if(e&&"function"==typeof e.then)return new ht(((t,n)=>{e.then(t,n)}));var t=new ht(We,!0,e);return Et(t,at),t},reject:Pt,race:function(){var e=be.apply(null,arguments).map(Bt);return new ht(((t,n)=>{e.map((e=>ht.resolve(e).then(t,n)))}))},PSD:{get:()=>lt,set:e=>lt=e},totalEchoes:{get:()=>It},newPSD:Nt,usePSD:Vt,scheduler:{get:()=>nt,set:e=>{nt=e}},rejectionMapper:{get:()=>ct,set:e=>{ct=e}},follow:(e,t)=>new ht(((n,r)=>Nt(((t,n)=>{var r=lt;r.unhandleds=[],r.onunhandled=n,r.finalize=ze((function(){!function(e){dt.push((function t(){e(),dt.splice(dt.indexOf(t),1)})),++pt,nt((()=>{0==--pt&&kt()}),[])}((()=>{0===this.unhandleds.length?t():n(this.unhandleds[0])}))}),r.finalize),e()}),t,n,r)))}),Qe&&(Qe.allSettled&&W(ht,"allSettled",(function(){const e=be.apply(null,arguments).map(Bt);return new ht((t=>{0===e.length&&t([]);let n=e.length;const r=new Array(n);e.forEach(((e,o)=>ht.resolve(e).then((e=>r[o]={status:"fulfilled",value:e}),(e=>r[o]={status:"rejected",reason:e})).then((()=>--n||t(r)))))}))})),Qe.any&&"undefined"!=typeof AggregateError&&W(ht,"any",(function(){const e=be.apply(null,arguments).map(Bt);return new ht(((t,n)=>{0===e.length&&n(new AggregateError([]));let r=e.length;const o=new Array(r);e.forEach(((e,i)=>ht.resolve(e).then((e=>t(e)),(e=>{o[i]=e,--r||n(new AggregateError(o))}))))}))})));const At={awaits:0,echoes:0,id:0};var Ct=0,Tt=[],Dt=0,It=0,Rt=0;function Nt(e,t,n,r){var o=lt,i=Object.create(o);i.parent=o,i.ref=0,i.global=!1,i.id=++Rt;var s=ut.env;i.env=Je?{Promise:ht,PromiseProp:{value:ht,configurable:!0,writable:!0},all:ht.all,race:ht.race,allSettled:ht.allSettled,any:ht.any,resolve:ht.resolve,reject:ht.reject,nthen:Wt(s.nthen,i),gthen:Wt(s.gthen,i)}:{},t&&z(i,t),++o.ref,i.finalize=function(){--this.parent.ref||this.parent.finalize()};var a=Vt(i,e,n,r);return 0===i.ref&&i.finalize(),a}function Mt(){return At.id||(At.id=++Ct),++At.awaits,At.echoes+=100,At.id}function Lt(){return!!At.awaits&&(0==--At.awaits&&(At.id=0),At.echoes=100*At.awaits,!0)}function Bt(e){return At.echoes&&e&&e.constructor===Qe?(Mt(),e.then((e=>(Lt(),e)),(e=>(Lt(),Zt(e))))):e}function Ut(e){++It,At.echoes&&0!=--At.echoes||(At.echoes=At.id=0),Tt.push(lt),Ft(e,!0)}function zt(){var e=Tt[Tt.length-1];Tt.pop(),Ft(e,!1)}function Ft(e,t){var n=lt;if((t?!At.echoes||Dt++&&e===lt:!Dt||--Dt&&e===lt)||qt(t?Ut.bind(null,e):zt),e!==lt&&(lt=e,n===ut&&(ut.env=Kt()),Je)){var r=ut.env.Promise,o=e.env;Ze.then=o.nthen,r.prototype.then=o.gthen,(n.global||e.global)&&(Object.defineProperty(L,"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))}}function Kt(){var e=L.Promise;return Je?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(L,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:Ze.then,gthen:e.prototype.then}:{}}function Vt(e,t,n,r,o){var i=lt;try{return Ft(e,!0),t(n,r,o)}finally{Ft(i,!1)}}function qt(e){Xe.call(Ge,e)}function Ht(e,t,n,r){return"function"!=typeof e?e:function(){var o=lt;n&&Mt(),Ft(t,!0);try{return e.apply(this,arguments)}finally{Ft(o,!1),r&&qt(Lt)}}}function Wt(e,t){return function(n,r){return e.call(this,Ht(n,t),Ht(r,t))}}function Gt(e,t){var n;try{n=t.onuncatched(e)}catch(e){}if(!1!==n)try{var r,o={promise:t,reason:e};if(L.document&&document.createEvent?((r=document.createEvent("Event")).initEvent("unhandledrejection",!0,!0),z(r,o)):L.CustomEvent&&z(r=new CustomEvent("unhandledrejection",{detail:o}),o),r&&L.dispatchEvent&&(dispatchEvent(r),!L.PromiseRejectionEvent&&L.onunhandledrejection))try{L.onunhandledrejection(r)}catch(e){}we&&r&&!r.defaultPrevented&&console.warn(`Unhandled rejection: ${e.stack||e}`)}catch(e){}}-1===(""+Xe).indexOf("[native code]")&&(Mt=Lt=Le);var Zt=ht.reject;function Yt(e,t,n,r){if(e.idbdb&&(e._state.openComplete||lt.letThrough||e._vip)){var o=e._createTransaction(t,n,e._dbSchema);try{o.create(),e._state.PR1398_maxLoop=3}catch(o){return o.name===De.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>Yt(e,t,n,r)))):Zt(o)}return o._promise(t,((e,t)=>Nt((()=>(lt.trans=o,r(e,t,o)))))).then((e=>o._completion.then((()=>e))))}if(e._state.openComplete)return Zt(new Re.DatabaseClosed(e._state.dbOpenError));if(!e._state.isBeingOpened){if(!e._options.autoOpen)return Zt(new Re.DatabaseClosed);e.open().catch(Le)}return e._state.dbReadyPromise.then((()=>Yt(e,t,n,r)))}const Xt=String.fromCharCode(65535),Qt="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Jt=[],en="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),tn=en,nn=en,rn=e=>!/(dexie\.js|dexie\.min\.js)/.test(e);function on(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}const sn={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function an(e){return"string"!=typeof e||/\./.test(e)?e=>e:t=>(void 0===t[e]&&e in t&&delete(t=fe(t))[e],t)}let cn=class{_trans(e,t,n){const r=this._tx||lt.trans,o=this.name;function i(e,n,r){if(!r.schema[o])throw new Re.NotFound("Table "+o+" not part of transaction");return t(r.idbtrans,r)}const s=_t();try{return r&&r.db===this.db?r===lt.trans?r._promise(e,i,n):Nt((()=>r._promise(e,i,n)),{trans:r,transless:lt.transless||lt}):Yt(this.db,e,[this.name],i)}finally{s&&jt()}}get(e,t){return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",(t=>this.core.get({trans:t,key:e}).then((e=>this.hook.reading.fire(e))))).then(t)}where(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(U(e))return new this.db.WhereClause(this,`[${e.join("+")}]`);const t=B(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);const n=this.schema.indexes.concat(this.schema.primKey).filter((e=>e.compound&&t.every((t=>e.keyPath.indexOf(t)>=0))&&e.keyPath.every((e=>t.indexOf(e)>=0))))[0];if(n&&this.db._maxKey!==Xt)return this.where(n.name).equals(n.keyPath.map((t=>e[t])));!n&&we&&console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit of a compound index [${t.join("+")}]`);const{idxByName:r}=this.schema,o=this.db._deps.indexedDB;function i(e,t){try{return 0===o.cmp(e,t)}catch(e){return!1}}const[s,a]=t.reduce((([t,n],o)=>{const s=r[o],a=e[o];return[t||s,t||!s?on(n,s&&s.multi?e=>{const t=re(e,o);return U(t)&&t.some((e=>i(a,e)))}:e=>i(a,re(e,o))):n]}),[null,null]);return s?this.where(s.name).equals(e[s.keyPath]).filter(a):n?this.filter(a):this.where(t).equals("")}filter(e){return this.toCollection().and(e)}count(e){return this.toCollection().count(e)}offset(e){return this.toCollection().offset(e)}limit(e){return this.toCollection().limit(e)}each(e){return this.toCollection().each(e)}toArray(e){return this.toCollection().toArray(e)}toCollection(){return new this.db.Collection(new this.db.WhereClause(this))}orderBy(e){return new this.db.Collection(new this.db.WhereClause(this,U(e)?`[${e.join("+")}]`:e))}reverse(){return this.toCollection().reverse()}mapToClass(e){this.schema.mappedClass=e;const t=t=>{if(!t)return t;const n=Object.create(e.prototype);for(var r in t)if(V(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}defineClass(){return this.mapToClass((function(e){z(this,e)}))}add(e,t){const{auto:n,keyPath:r}=this.schema.primKey;let o=e;return r&&n&&(o=an(r)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[o]}))).then((e=>e.numFailures?ht.reject(e.failures[0]):e.lastResult)).then((t=>{if(r)try{oe(e,r,t)}catch(e){}return t}))}update(e,t){if("object"!=typeof e||U(e))return this.where(":id").equals(e).modify(t);{const n=re(e,this.schema.primKey.keyPath);if(void 0===n)return Zt(new Re.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?B(t).forEach((n=>{oe(e,n,t[n])})):t(e,{value:e,primKey:n})}catch(e){}return this.where(":id").equals(n).modify(t)}}put(e,t){const{auto:n,keyPath:r}=this.schema.primKey;let o=e;return r&&n&&(o=an(r)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"put",values:[o],keys:null!=t?[t]:null}))).then((e=>e.numFailures?ht.reject(e.failures[0]):e.lastResult)).then((t=>{if(r)try{oe(e,r,t)}catch(e){}return t}))}delete(e){return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"delete",keys:[e]}))).then((e=>e.numFailures?ht.reject(e.failures[0]):void 0))}clear(){return this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"deleteRange",range:sn}))).then((e=>e.numFailures?ht.reject(e.failures[0]):void 0))}bulkGet(e){return this._trans("readonly",(t=>this.core.getMany({keys:e,trans:t}).then((e=>e.map((e=>this.hook.reading.fire(e)))))))}bulkAdd(e,t,n){const r=Array.isArray(t)?t:void 0,o=(n=n||(r?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(t=>{const{auto:n,keyPath:i}=this.schema.primKey;if(i&&r)throw new Re.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(r&&r.length!==e.length)throw new Re.InvalidArgument("Arguments objects and keys must have the same length");const s=e.length;let a=i&&n?e.map(an(i)):e;return this.core.mutate({trans:t,type:"add",keys:r,values:a,wantResults:o}).then((({numFailures:e,results:t,lastResult:n,failures:r})=>{if(0===e)return o?t:n;throw new Te(`${this.name}.bulkAdd(): ${e} of ${s} operations failed`,r)}))}))}bulkPut(e,t,n){const r=Array.isArray(t)?t:void 0,o=(n=n||(r?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(t=>{const{auto:n,keyPath:i}=this.schema.primKey;if(i&&r)throw new Re.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(r&&r.length!==e.length)throw new Re.InvalidArgument("Arguments objects and keys must have the same length");const s=e.length;let a=i&&n?e.map(an(i)):e;return this.core.mutate({trans:t,type:"put",keys:r,values:a,wantResults:o}).then((({numFailures:e,results:t,lastResult:n,failures:r})=>{if(0===e)return o?t:n;throw new Te(`${this.name}.bulkPut(): ${e} of ${s} operations failed`,r)}))}))}bulkDelete(e){const t=e.length;return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"delete",keys:e}))).then((({numFailures:e,lastResult:n,failures:r})=>{if(0===e)return n;throw new Te(`${this.name}.bulkDelete(): ${e} of ${t} operations failed`,r)}))}};function un(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){B(e).forEach((function(t){var n=e[t];if(U(n))i(t,e[t][0],e[t][1]);else{if("asap"!==n)throw new Re.InvalidArgument("Invalid event config");var r=i(t,Be,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];r.subscribers.forEach((function(e){te((function(){e.apply(null,t)}))}))}))}}))}(e);r||(r=qe),o||(o=Le);var s={subscribers:[],fire:o,subscribe:function(e){-1===s.subscribers.indexOf(e)&&(s.subscribers.push(e),s.fire=r(s.fire,e))},unsubscribe:function(e){s.subscribers=s.subscribers.filter((function(t){return t!==e})),s.fire=s.subscribers.reduce(r,o)}};return t[e]=n[e]=s,s}}function ln(e,t){return G(t).from({prototype:e}),t}function fn(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function pn(e,t){e.filter=on(e.filter,t)}function dn(e,t,n){var r=e.replayFilter;e.replayFilter=r?()=>on(r(),t()):t,e.justLimit=n&&!r}function hn(e,t){if(e.isPrimKey)return t.primaryKey;const n=t.getIndexByKeyPath(e.index);if(!n)throw new Re.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function yn(e,t,n){const r=hn(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:r,range:e.range}})}function gn(e,t,n,r){const o=e.replayFilter?on(e.filter,e.replayFilter()):e.filter;if(e.or){const i={},s=(e,n,r)=>{if(!o||o(n,r,(e=>n.stop(e)),(e=>n.fail(e)))){var s=n.primaryKey,a=""+s;"[object ArrayBuffer]"===a&&(a=""+new Uint8Array(s)),V(i,a)||(i[a]=!0,t(e,n,r))}};return Promise.all([e.or._iterate(s,n),mn(yn(e,r,n),e.algorithm,s,!e.keysOnly&&e.valueMapper)])}return mn(yn(e,r,n),on(e.algorithm,o),t,!e.keysOnly&&e.valueMapper)}function mn(e,t,n,r){var o=$t(r?(e,t,o)=>n(r(e),t,o):n);return e.then((e=>{if(e)return e.start((()=>{var n=()=>e.continue();t&&!t(e,(e=>n=e),(t=>{e.stop(t),n=Le}),(t=>{e.fail(t),n=Le}))||o(e.value,e,(e=>n=e)),n()}))}))}function bn(e,t){try{const n=vn(e),r=vn(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){const n=e.length,r=t.length,o=n<r?n:r;for(let n=0;n<o;++n)if(e[n]!==t[n])return e[n]<t[n]?-1:1;return n===r?0:n<r?-1:1}(wn(e),wn(t));case"Array":return function(e,t){const n=e.length,r=t.length,o=n<r?n:r;for(let n=0;n<o;++n){const r=bn(e[n],t[n]);if(0!==r)return r}return n===r?0:n<r?-1:1}(e,t)}}catch(e){}return NaN}function vn(e){const t=typeof e;if("object"!==t)return t;if(ArrayBuffer.isView(e))return"binary";const n=he(e);return"ArrayBuffer"===n?"binary":n}function wn(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}let On=class{_read(e,t){var n=this._ctx;return n.error?n.table._trans(null,Zt.bind(null,n.error)):n.table._trans("readonly",e).then(t)}_write(e){var t=this._ctx;return t.error?t.table._trans(null,Zt.bind(null,t.error)):t.table._trans("readwrite",e,"locked")}_addAlgorithm(e){var t=this._ctx;t.algorithm=on(t.algorithm,e)}_iterate(e,t){return gn(this._ctx,e,t,this._ctx.table.core)}clone(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&z(n,e),t._ctx=n,t}raw(){return this._ctx.valueMapper=null,this}each(e){var t=this._ctx;return this._read((n=>gn(t,e,n,t.table.core)))}count(e){return this._read((e=>{const t=this._ctx,n=t.table.core;if(fn(t,!0))return n.count({trans:e,query:{index:hn(t,n.schema),range:t.range}}).then((e=>Math.min(e,t.limit)));var r=0;return gn(t,(()=>(++r,!1)),e,n).then((()=>r))})).then(e)}sortBy(e,t){const n=e.split(".").reverse(),r=n[0],o=n.length-1;function i(e,t){return t?i(e[n[t]],t-1):e[r]}var s="next"===this._ctx.dir?1:-1;function a(e,t){var n=i(e,o),r=i(t,o);return n<r?-s:n>r?s:0}return this.toArray((function(e){return e.sort(a)})).then(t)}toArray(e){return this._read((e=>{var t=this._ctx;if("next"===t.dir&&fn(t,!0)&&t.limit>0){const{valueMapper:n}=t,r=hn(t,t.table.core.schema);return t.table.core.query({trans:e,limit:t.limit,values:!0,query:{index:r,range:t.range}}).then((({result:e})=>n?e.map(n):e))}{const n=[];return gn(t,(e=>n.push(e)),e,t.table.core).then((()=>n))}}),e)}offset(e){var t=this._ctx;return e<=0||(t.offset+=e,fn(t)?dn(t,(()=>{var t=e;return(e,n)=>0===t||(1===t?(--t,!1):(n((()=>{e.advance(t),t=0})),!1))})):dn(t,(()=>{var t=e;return()=>--t<0}))),this}limit(e){return this._ctx.limit=Math.min(this._ctx.limit,e),dn(this._ctx,(()=>{var t=e;return function(e,n,r){return--t<=0&&n(r),t>=0}}),!0),this}until(e,t){return pn(this._ctx,(function(n,r,o){return!e(n.value)||(r(o),t)})),this}first(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)}last(e){return this.reverse().first(e)}filter(e){var t,n;return pn(this._ctx,(function(t){return e(t.value)})),t=this._ctx,n=e,t.isMatch=on(t.isMatch,n),this}and(e){return this.filter(e)}or(e){return new this.db.WhereClause(this._ctx.table,e,this)}reverse(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this}desc(){return this.reverse()}eachKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.key,n)}))}eachUniqueKey(e){return this._ctx.unique="unique",this.eachKey(e)}eachPrimaryKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.primaryKey,n)}))}keys(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)}primaryKeys(e){var t=this._ctx;if("next"===t.dir&&fn(t,!0)&&t.limit>0)return this._read((e=>{var n=hn(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})})).then((({result:e})=>e)).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.primaryKey)})).then((function(){return n})).then(e)}uniqueKeys(e){return this._ctx.unique="unique",this.keys(e)}firstKey(e){return this.limit(1).keys((function(e){return e[0]})).then(e)}lastKey(e){return this.reverse().firstKey(e)}distinct(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var n={};return pn(this._ctx,(function(e){var t=e.primaryKey.toString(),r=V(n,t);return n[t]=!0,!r})),this}modify(e){var t=this._ctx;return this._write((n=>{var r;if("function"==typeof e)r=e;else{var o=B(e),i=o.length;r=function(t){for(var n=!1,r=0;r<i;++r){var s=o[r],a=e[s];re(t,s)!==a&&(oe(t,s,a),n=!0)}return n}}const s=t.table.core,{outbound:a,extractKey:c}=s.schema.primaryKey,u=this.db._options.modifyChunkSize||200,l=[];let f=0;const p=[],d=(e,t)=>{const{failures:n,numFailures:r}=t;f+=e-r;for(let e of B(n))l.push(n[e])};return this.clone().primaryKeys().then((o=>{const i=l=>{const f=Math.min(u,o.length-l);return s.getMany({trans:n,keys:o.slice(l,l+f),cache:"immutable"}).then((p=>{const h=[],y=[],g=a?[]:null,m=[];for(let e=0;e<f;++e){const t=p[e],n={value:fe(t),primKey:o[l+e]};!1!==r.call(n,n.value,n)&&(null==n.value?m.push(o[l+e]):a||0===bn(c(t),c(n.value))?(y.push(n.value),a&&g.push(o[l+e])):(m.push(o[l+e]),h.push(n.value)))}const b=fn(t)&&t.limit===1/0&&("function"!=typeof e||e===Sn)&&{index:t.index,range:t.range};return Promise.resolve(h.length>0&&s.mutate({trans:n,type:"add",values:h}).then((e=>{for(let t in e.failures)m.splice(parseInt(t),1);d(h.length,e)}))).then((()=>(y.length>0||b&&"object"==typeof e)&&s.mutate({trans:n,type:"put",keys:g,values:y,criteria:b,changeSpec:"function"!=typeof e&&e}).then((e=>d(y.length,e))))).then((()=>(m.length>0||b&&e===Sn)&&s.mutate({trans:n,type:"delete",keys:m,criteria:b}).then((e=>d(m.length,e))))).then((()=>o.length>l+f&&i(l+u)))}))};return i(0).then((()=>{if(l.length>0)throw new Ce("Error modifying one or more objects",l,f,p);return o.length}))}))}))}delete(){var e=this._ctx,t=e.range;return fn(e)&&(e.isPrimKey&&!nn||3===t.type)?this._write((n=>{const{primaryKey:r}=e.table.core.schema,o=t;return e.table.core.count({trans:n,query:{index:r,range:o}}).then((t=>e.table.core.mutate({trans:n,type:"deleteRange",range:o}).then((({failures:e,lastResult:n,results:r,numFailures:o})=>{if(o)throw new Ce("Could not delete some values",Object.keys(e).map((t=>e[t])),t-o);return t-o}))))})):this.modify(Sn)}};const Sn=(e,t)=>t.value=null;function En(e,t){return e<t?-1:e===t?0:1}function xn(e,t){return e>t?-1:e===t?0:1}function _n(e,t,n){var r=e instanceof Cn?new e.Collection(e):e;return r._ctx.error=n?new n(t):new TypeError(t),r}function jn(e){return new e.Collection(e,(()=>An(""))).limit(0)}function kn(e,t,n,r,o,i){for(var s=Math.min(e.length,r.length),a=-1,c=0;c<s;++c){var u=t[c];if(u!==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):a>=0?e.substr(0,a)+t[a]+n.substr(a+1):null;o(e[c],u)<0&&(a=c)}return s<r.length&&"next"===i?e+n.substr(e.length):s<e.length&&"prev"===i?e.substr(0,n.length):a<0?null:e.substr(0,a)+r[a]+n.substr(a+1)}function Pn(e,t,n,r){var o,i,s,a,c,u,l,f=n.length;if(!n.every((e=>"string"==typeof e)))return _n(e,"String expected.");function p(e){o=function(e){return"next"===e?e=>e.toUpperCase():e=>e.toLowerCase()}(e),i=function(e){return"next"===e?e=>e.toLowerCase():e=>e.toUpperCase()}(e),s="next"===e?En:xn;var t=n.map((function(e){return{lower:i(e),upper:o(e)}})).sort((function(e,t){return s(e.lower,t.lower)}));a=t.map((function(e){return e.upper})),c=t.map((function(e){return e.lower})),u=e,l="next"===e?"":r}p("next");var d=new e.Collection(e,(()=>$n(a[0],c[f-1]+r)));d._ondirectionchange=function(e){p(e)};var h=0;return d._addAlgorithm((function(e,n,r){var o=e.key;if("string"!=typeof o)return!1;var p=i(o);if(t(p,c,h))return!0;for(var d=null,y=h;y<f;++y){var g=kn(o,p,a[y],c[y],s,u);null===g&&null===d?h=y+1:(null===d||s(d,g)>0)&&(d=g)}return n(null!==d?function(){e.continue(d+l)}:r),!1})),d}function $n(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function An(e){return{type:1,lower:e,upper:e}}let Cn=class{get Collection(){return this._ctx.table.db.Collection}between(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)?jn(this):new this.Collection(this,(()=>$n(e,t,!n,!r)))}catch(e){return _n(this,Qt)}}equals(e){return null==e?_n(this,Qt):new this.Collection(this,(()=>An(e)))}above(e){return null==e?_n(this,Qt):new this.Collection(this,(()=>$n(e,void 0,!0)))}aboveOrEqual(e){return null==e?_n(this,Qt):new this.Collection(this,(()=>$n(e,void 0,!1)))}below(e){return null==e?_n(this,Qt):new this.Collection(this,(()=>$n(void 0,e,!1,!0)))}belowOrEqual(e){return null==e?_n(this,Qt):new this.Collection(this,(()=>$n(void 0,e)))}startsWith(e){return"string"!=typeof e?_n(this,"String expected."):this.between(e,e+Xt,!0,!0)}startsWithIgnoreCase(e){return""===e?this.startsWith(e):Pn(this,((e,t)=>0===e.indexOf(t[0])),[e],Xt)}equalsIgnoreCase(e){return Pn(this,((e,t)=>e===t[0]),[e],"")}anyOfIgnoreCase(){var e=be.apply(me,arguments);return 0===e.length?jn(this):Pn(this,((e,t)=>-1!==t.indexOf(e)),e,"")}startsWithAnyOfIgnoreCase(){var e=be.apply(me,arguments);return 0===e.length?jn(this):Pn(this,((e,t)=>t.some((t=>0===e.indexOf(t)))),e,Xt)}anyOf(){const e=be.apply(me,arguments);let t=this._cmp;try{e.sort(t)}catch(e){return _n(this,Qt)}if(0===e.length)return jn(this);const n=new this.Collection(this,(()=>$n(e[0],e[e.length-1])));n._ondirectionchange=n=>{t="next"===n?this._ascending:this._descending,e.sort(t)};let r=0;return n._addAlgorithm(((n,o,i)=>{const s=n.key;for(;t(s,e[r])>0;)if(++r,r===e.length)return o(i),!1;return 0===t(s,e[r])||(o((()=>{n.continue(e[r])})),!1)})),n}notEqual(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){const e=be.apply(me,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return _n(this,Qt)}const t=e.reduce(((e,t)=>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})}inAnyRange(e,t){const n=this._cmp,r=this._ascending,o=this._descending,i=this._min,s=this._max;if(0===e.length)return jn(this);if(!e.every((e=>void 0!==e[0]&&void 0!==e[1]&&r(e[0],e[1])<=0)))return _n(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Re.InvalidArgument);const a=!t||!1!==t.includeLowers,c=t&&!0===t.includeUppers;let u,l=r;function f(e,t){return l(e[0],t[0])}try{u=e.reduce((function(e,t){let r=0,o=e.length;for(;r<o;++r){const o=e[r];if(n(t[0],o[1])<0&&n(t[1],o[0])>0){o[0]=i(o[0],t[0]),o[1]=s(o[1],t[1]);break}}return r===o&&e.push(t),e}),[]),u.sort(f)}catch(e){return _n(this,Qt)}let p=0;const d=c?e=>r(e,u[p][1])>0:e=>r(e,u[p][1])>=0,h=a?e=>o(e,u[p][0])>0:e=>o(e,u[p][0])>=0;let y=d;const g=new this.Collection(this,(()=>$n(u[0][0],u[u.length-1][1],!a,!c)));return g._ondirectionchange=e=>{"next"===e?(y=d,l=r):(y=h,l=o),u.sort(f)},g._addAlgorithm(((e,t,n)=>{for(var o=e.key;y(o);)if(++p,p===u.length)return t(n),!1;return!!function(e){return!d(e)&&!h(e)}(o)||(0===this._cmp(o,u[p][1])||0===this._cmp(o,u[p][0])||t((()=>{l===r?e.continue(u[p][0]):e.continue(u[p][1])})),!1)})),g}startsWithAnyOf(){const e=be.apply(me,arguments);return e.every((e=>"string"==typeof e))?0===e.length?jn(this):this.inAnyRange(e.map((e=>[e,e+Xt]))):_n(this,"startsWithAnyOf() only works with strings")}};function Tn(e){return $t((function(t){return Dn(t),e(t.target.error),!1}))}function Dn(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}const In=un(null,"storagemutated");let Rn=class{_lock(){return ee(!lt.global),++this._reculock,1!==this._reculock||lt.global||(lt.lockOwnerFor=this),this}_unlock(){if(ee(!lt.global),0==--this._reculock)for(lt.global||(lt.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{Vt(e[1],e[0])}catch(e){}}return this}_locked(){return this._reculock&&lt.lockOwnerFor!==this}create(e){if(!this.mode)return this;const t=this.db.idbdb,n=this.db._state.dbOpenError;if(ee(!this.idbtrans),!e&&!t)switch(n&&n.name){case"DatabaseClosedError":throw new Re.DatabaseClosed(n);case"MissingAPIError":throw new Re.MissingAPI(n.message,n);default:throw new Re.OpenFailed(n)}if(!this.active)throw new Re.TransactionInactive;return ee(null===this._completion._state),(e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):t.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=$t((t=>{Dn(t),this._reject(e.error)})),e.onabort=$t((t=>{Dn(t),this.active&&this._reject(new Re.Abort(e.error)),this.active=!1,this.on("abort").fire(t)})),e.oncomplete=$t((()=>{this.active=!1,this._resolve(),"mutatedParts"in e&&In.storagemutated.fire(e.mutatedParts)})),this}_promise(e,t,n){if("readwrite"===e&&"readwrite"!==this.mode)return Zt(new Re.ReadOnly("Transaction is readonly"));if(!this.active)return Zt(new Re.TransactionInactive);if(this._locked())return new ht(((r,o)=>{this._blockedFuncs.push([()=>{this._promise(e,t,n).then(r,o)},lt])}));if(n)return Nt((()=>{var e=new ht(((e,n)=>{this._lock();const r=t(e,n,this);r&&r.then&&r.then(e,n)}));return e.finally((()=>this._unlock())),e._lib=!0,e}));var r=new ht(((e,n)=>{var r=t(e,n,this);r&&r.then&&r.then(e,n)}));return r._lib=!0,r}_root(){return this.parent?this.parent._root():this}waitFor(e){var t=this._root();const n=ht.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then((()=>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 ht(((e,r)=>{n.then((n=>t._waitingQueue.push($t(e.bind(null,n)))),(e=>t._waitingQueue.push($t(r.bind(null,e))))).finally((()=>{t._waitingFor===o&&(t._waitingFor=null)}))}))}abort(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Re.Abort))}table(e){const t=this._memoizedTables||(this._memoizedTables={});if(V(t,e))return t[e];const n=this.schema[e];if(!n)throw new Re.NotFound("Table "+e+" not part of transaction");const r=new this.db.Table(e,n,this);return r.core=this.db.core.table(e),t[e]=r,r}};function Nn(e,t,n,r,o,i,s){return{name:e,keyPath:t,unique:n,multi:r,auto:o,compound:i,src:(n&&!s?"&":"")+(r?"*":"")+(o?"++":"")+Mn(t)}}function Mn(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function Ln(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:ne(n,(e=>[e.name,e]))}}let Bn=e=>{try{return e.only([[]]),Bn=()=>[[]],[[]]}catch(e){return Bn=()=>Xt,Xt}};function Un(e){return null==e?()=>{}:"string"==typeof e?function(e){return 1===e.split(".").length?t=>t[e]:t=>re(t,e)}(e):t=>re(t,e)}function zn(e){return[].slice.call(e)}let Fn=0;function Kn(e){return null==e?":id":"string"==typeof e?e:`[${e.join("+")}]`}function Vn({_novip:e},t){const n=t.db,r=function(e,t,{IDBKeyRange:n,indexedDB:r},i){const s=function(e,t){return t.reduce(((e,{create:t})=>o({},e,t(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");const{lower:n,upper:r,lowerOpen:o,upperOpen:i}=e;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)}const{schema:o,hasGetAll:i}=function(e,t){const n=zn(e.objectStoreNames);return{schema:{name:e.name,tables:n.map((e=>t.objectStore(e))).map((e=>{const{keyPath:t,autoIncrement:n}=e,r=U(t),o=null==t,i={},s={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:o,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:Un(t)},indexes:zn(e.indexNames).map((t=>e.index(t))).map((e=>{const{name:t,unique:n,multiEntry:r,keyPath:o}=e,s={name:t,compound:U(o),keyPath:o,unique:n,multiEntry:r,extractKey:Un(o)};return i[Kn(o)]=s,s})),getIndexByKeyPath:e=>i[Kn(e)]};return i[":id"]=s.primaryKey,null!=t&&(i[Kn(t)]=s.primaryKey),s}))},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),s=o.tables.map((e=>function(e){const t=e.name;return{name:t,schema:e,mutate:function({trans:e,type:n,keys:o,values:i,range:s}){return new Promise(((a,c)=>{a=$t(a);const u=e.objectStore(t),l=null==u.keyPath,f="put"===n||"add"===n;if(!f&&"delete"!==n&&"deleteRange"!==n)throw new Error("Invalid operation type: "+n);const{length:p}=o||i||{length:1};if(o&&i&&o.length!==i.length)throw new Error("Given keys array must have same length as given values array.");if(0===p)return a({numFailures:0,failures:{},results:[],lastResult:void 0});let d;const h=[],y=[];let g=0;const m=e=>{++g,Dn(e)};if("deleteRange"===n){if(4===s.type)return a({numFailures:g,failures:y,results:[],lastResult:void 0});3===s.type?h.push(d=u.clear()):h.push(d=u.delete(r(s)))}else{const[e,t]=f?l?[i,o]:[i,null]:[o,null];if(f)for(let r=0;r<p;++r)h.push(d=t&&void 0!==t[r]?u[n](e[r],t[r]):u[n](e[r])),d.onerror=m;else for(let t=0;t<p;++t)h.push(d=u[n](e[t])),d.onerror=m}const b=e=>{const t=e.target.result;h.forEach(((e,t)=>null!=e.error&&(y[t]=e.error))),a({numFailures:g,failures:y,results:"delete"===n?o:h.map((e=>e.result)),lastResult:t})};d.onerror=e=>{m(e),b(e)},d.onsuccess=b}))},getMany:({trans:e,keys:n})=>new Promise(((r,o)=>{r=$t(r);const i=e.objectStore(t),s=n.length,a=new Array(s);let c,u=0,l=0;const f=e=>{const t=e.target;a[t._pos]=t.result,++l===u&&r(a)},p=Tn(o);for(let e=0;e<s;++e)null!=n[e]&&(c=i.get(n[e]),c._pos=e,c.onsuccess=f,c.onerror=p,++u);0===u&&r(a)})),get:({trans:e,key:n})=>new Promise(((r,o)=>{r=$t(r);const i=e.objectStore(t).get(n);i.onsuccess=e=>r(e.target.result),i.onerror=Tn(o)})),query:function(e){return n=>new Promise(((o,i)=>{o=$t(o);const{trans:s,values:a,limit:c,query:u}=n,l=c===1/0?void 0:c,{index:f,range:p}=u,d=s.objectStore(t),h=f.isPrimaryKey?d:d.index(f.name),y=r(p);if(0===c)return o({result:[]});if(e){const e=a?h.getAll(y,l):h.getAllKeys(y,l);e.onsuccess=e=>o({result:e.target.result}),e.onerror=Tn(i)}else{let e=0;const t=a||!("openKeyCursor"in h)?h.openCursor(y):h.openKeyCursor(y),n=[];t.onsuccess=r=>{const i=t.result;return i?(n.push(a?i.value:i.primaryKey),++e===c?o({result:n}):void i.continue()):o({result:n})},t.onerror=Tn(i)}}))}(i),openCursor:function({trans:e,values:n,query:o,reverse:i,unique:s}){return new Promise(((a,c)=>{a=$t(a);const{index:u,range:l}=o,f=e.objectStore(t),p=u.isPrimaryKey?f:f.index(u.name),d=i?s?"prevunique":"prev":s?"nextunique":"next",h=n||!("openKeyCursor"in p)?p.openCursor(r(l),d):p.openKeyCursor(r(l),d);h.onerror=Tn(c),h.onsuccess=$t((t=>{const n=h.result;if(!n)return void a(null);n.___id=++Fn,n.done=!1;const r=n.continue.bind(n);let o=n.continuePrimaryKey;o&&(o=o.bind(n));const i=n.advance.bind(n),s=()=>{throw new Error("Cursor not stopped")};n.trans=e,n.stop=n.continue=n.continuePrimaryKey=n.advance=()=>{throw new Error("Cursor not started")},n.fail=$t(c),n.next=function(){let e=1;return this.start((()=>e--?this.continue():this.stop())).then((()=>this))},n.start=e=>{const t=new Promise(((e,t)=>{e=$t(e),h.onerror=Tn(t),n.fail=t,n.stop=t=>{n.stop=n.continue=n.continuePrimaryKey=n.advance=s,e(t)}})),a=()=>{if(h.result)try{e()}catch(e){n.fail(e)}else n.done=!0,n.start=()=>{throw new Error("Cursor behind last entry")},n.stop()};return h.onsuccess=$t((e=>{h.onsuccess=a,a()})),n.continue=r,n.continuePrimaryKey=o,n.advance=i,a(),t},a(n)}),c)}))},count({query:e,trans:n}){const{index:o,range:i}=e;return new Promise(((e,s)=>{const a=n.objectStore(t),c=o.isPrimaryKey?a:a.index(o.name),u=r(i),l=u?c.count(u):c.count();l.onsuccess=$t((t=>e(t.target.result))),l.onerror=Tn(s)}))}}}(e))),a={};return s.forEach((e=>a[e.name]=e)),{stack:"dbcore",transaction:e.transaction.bind(e),table(e){if(!a[e])throw new Error(`Table '${e}' not found`);return a[e]},MIN_KEY:-1/0,MAX_KEY:Bn(t),schema:o}}(t,n,i),e.dbcore);return{dbcore:s}}(e._middlewares,n,e._deps,t);e.core=r.dbcore,e.tables.forEach((t=>{const n=t.name;e.core.schema.tables.some((e=>e.name===n))&&(t.core=e.core.table(n),e[n]instanceof e.Table&&(e[n].core=t.core))}))}function qn({_novip:e},t,n,r){n.forEach((n=>{const o=r[n];t.forEach((t=>{const r=Y(t,n);(!r||"value"in r&&void 0===r.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?W(t,n,{get(){return this.table(n)},set(e){H(this,n,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[n]=new e.Table(n,o))}))}))}function Hn({_novip:e},t){t.forEach((t=>{for(let n in t)t[n]instanceof e.Table&&delete t[n]}))}function Wn(e,t){return e._cfg.version-t._cfg.version}function Gn(e,t){const n={del:[],add:[],change:[]};let r;for(r in e)t[r]||n.del.push(r);for(r in t){const o=e[r],i=t[r];if(o){const e={name:r,def:i,recreate:!1,del:[],add:[],change:[]};if(""+(o.primKey.keyPath||"")!=""+(i.primKey.keyPath||"")||o.primKey.auto!==i.primKey.auto&&!en)e.recreate=!0,n.change.push(e);else{const t=o.idxByName,r=i.idxByName;let s;for(s in t)r[s]||e.del.push(s);for(s in r){const n=t[s],o=r[s];n?n.src!==o.src&&e.change.push(o):e.add.push(o)}(e.del.length>0||e.add.length>0||e.change.length>0)&&n.change.push(e)}}else n.add.push([r,i])}return n}function Zn(e,t,n,r){const o=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach((e=>Yn(o,e))),o}function Yn(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function Xn(e,t,n){const r={};return Q(t.objectStoreNames,0).forEach((e=>{const t=n.objectStore(e);let o=t.keyPath;const i=Nn(Mn(o),o||"",!1,!1,!!t.autoIncrement,o&&"string"!=typeof o,!0),s=[];for(let e=0;e<t.indexNames.length;++e){const n=t.index(t.indexNames[e]);o=n.keyPath;var a=Nn(n.name,o,!!n.unique,!!n.multiEntry,!1,o&&"string"!=typeof o,!1);s.push(a)}r[e]=Ln(e,i,s)})),r}function Qn({_novip:e},t,n){const r=n.db.objectStoreNames;for(let o=0;o<r.length;++o){const i=r[o],s=n.objectStore(i);e._hasGetAll="getAll"in s;for(let e=0;e<s.indexNames.length;++e){const n=s.indexNames[e],r=s.index(n).keyPath,o="string"==typeof r?r:"["+Q(r).join("+")+"]";if(t[i]){const e=t[i].idxByName[o];e&&(e.name=n,delete t[i].idxByName[o],t[i].idxByName[n]=e)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&L.WorkerGlobalScope&&L instanceof L.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}let Jn=class{_parseStoresSpec(e,t){B(e).forEach((n=>{if(null!==e[n]){var r=e[n].split(",").map(((e,t)=>{const n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return Nn(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),U(r),0===t)})),o=r.shift();if(o.multi)throw new Re.Schema("Primary key cannot be multi-valued");r.forEach((e=>{if(e.auto)throw new Re.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new Re.Schema("Index must have a name and cannot be an empty string")})),t[n]=Ln(n,o,r)}}))}stores(e){const t=this.db;this._cfg.storesSource=this._cfg.storesSource?z(this._cfg.storesSource,e):e;const n=t._versions,r={};let o={};return n.forEach((e=>{z(r,e._cfg.storesSource),o=e._cfg.dbschema={},e._parseStoresSpec(r,o)})),t._dbSchema=o,Hn(t,[t._allTables,t,t.Transaction.prototype]),qn(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],B(o),o),t._storeNames=B(o),this}upgrade(e){return this._cfg.contentUpgrade=He(this._cfg.contentUpgrade||Le,e),this}};function er(e,t){let n=e._dbNamesDB;return n||(n=e._dbNamesDB=new Or("__dbnames",{addons:[],indexedDB:e,IDBKeyRange:t}),n.version(1).stores({dbnames:"name"})),n.table("dbnames")}function tr(e){return e&&"function"==typeof e.databases}function nr(e){return Nt((function(){return lt.letThrough=!0,e()}))}function rr(){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()}function or(e){var t=t=>e.next(t),n=o(t),r=o((t=>e.throw(t)));function o(e){return t=>{var o=e(t),i=o.value;return o.done?i:i&&"function"==typeof i.then?i.then(n,r):U(i)?Promise.all(i).then(n,r):n(i)}}return o(t)()}function ir(e,t,n){var r=arguments.length;if(r<2)throw new Re.InvalidArgument("Too few arguments");for(var o=new Array(r-1);--r;)o[r-1]=arguments[r];return n=o.pop(),[e,ae(o),n]}function sr(e,t,n,r,o){return ht.resolve().then((()=>{const i=lt.transless||lt,s=e._createTransaction(t,n,e._dbSchema,r),a={trans:s,transless:i};if(r)s.idbtrans=r.idbtrans;else try{s.create(),e._state.PR1398_maxLoop=3}catch(r){return r.name===De.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>sr(e,t,n,null,o)))):Zt(r)}const c=ve(o);let u;c&&Mt();const l=ht.follow((()=>{if(u=o.call(s,s),u)if(c){var e=Lt.bind(null,null);u.then(e,e)}else"function"==typeof u.next&&"function"==typeof u.throw&&(u=or(u))}),a);return(u&&"function"==typeof u.then?ht.resolve(u).then((e=>s.active?e:Zt(new Re.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn")))):l.then((()=>u))).then((e=>(r&&s._resolve(),s._completion.then((()=>e))))).catch((e=>(s._reject(e),Zt(e))))}))}function ar(e,t,n){const r=U(e)?e.slice():[e];for(let e=0;e<n;++e)r.push(t);return r}const cr={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return i(o({},e),{table(t){const n=e.table(t),{schema:r}=n,s={},a=[];function c(e,t,n){const r=Kn(e),u=s[r]=s[r]||[],l=null==e?0:"string"==typeof e?1:e.length,f=t>0,p=i(o({},n),{isVirtual:f,keyTail:t,keyLength:l,extractKey:Un(e),unique:!f&&n.unique});return u.push(p),p.isPrimaryKey||a.push(p),l>1&&c(2===l?e[0]:e.slice(0,l-1),t+1,n),u.sort(((e,t)=>e.keyTail-t.keyTail)),p}const u=c(r.primaryKey.keyPath,0,r.primaryKey);s[":id"]=[u];for(const e of r.indexes)c(e.keyPath,0,e);function l(t){const n=t.query.index;return n.isVirtual?i(o({},t),{query:{index:n,range:(r=t.query.range,s=n.keyTail,{type:1===r.type?2:r.type,lower:ar(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,s),lowerOpen:!0,upper:ar(r.upper,r.upperOpen?e.MIN_KEY:e.MAX_KEY,s),upperOpen:!0})}}):t;var r,s}const f=i(o({},n),{schema:i(o({},r),{primaryKey:u,indexes:a,getIndexByKeyPath:function(e){const t=s[Kn(e)];return t&&t[0]}}),count:e=>n.count(l(e)),query:e=>n.query(l(e)),openCursor(t){const{keyTail:r,isVirtual:o,keyLength:i}=t.query.index;return o?n.openCursor(l(t)).then((n=>n&&function(n){const o=Object.create(n,{continue:{value:function(o){null!=o?n.continue(ar(o,t.reverse?e.MAX_KEY:e.MIN_KEY,r)):t.unique?n.continue(n.key.slice(0,i).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,r)):n.continue()}},continuePrimaryKey:{value(t,o){n.continuePrimaryKey(ar(t,e.MAX_KEY,r),o)}},primaryKey:{get:()=>n.primaryKey},key:{get(){const e=n.key;return 1===i?e[0]:e.slice(0,i)}},value:{get:()=>n.value}});return o}(n))):n.openCursor(t)}});return f}})}};function ur(e,t,n,r){return n=n||{},r=r||"",B(e).forEach((o=>{if(V(t,o)){var i=e[o],s=t[o];if("object"==typeof i&&"object"==typeof s&&i&&s){const e=he(i);e!==he(s)?n[r+o]=t[o]:"Object"===e?ur(i,s,n,r+o+"."):i!==s&&(n[r+o]=t[o])}else i!==s&&(n[r+o]=t[o])}else n[r+o]=void 0})),B(t).forEach((o=>{V(e,o)||(n[r+o]=t[o])})),n}const lr={stack:"dbcore",name:"HooksMiddleware",level:2,create:e=>i(o({},e),{table(t){const n=e.table(t),{primaryKey:r}=n.schema,s=i(o({},n),{mutate(e){const s=lt.trans,{deleting:a,creating:c,updating:u}=s.table(t).hook;switch(e.type){case"add":if(c.fire===Le)break;return s._promise("readwrite",(()=>l(e)),!0);case"put":if(c.fire===Le&&u.fire===Le)break;return s._promise("readwrite",(()=>l(e)),!0);case"delete":if(a.fire===Le)break;return s._promise("readwrite",(()=>l(e)),!0);case"deleteRange":if(a.fire===Le)break;return s._promise("readwrite",(()=>function(e){return f(e.trans,e.range,1e4)}(e)),!0)}return n.mutate(e);function l(e){const t=lt.trans,s=e.keys||function(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}(r,e);if(!s)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?i(o({},e),{keys:s}):o({},e)).type&&(e.values=[...e.values]),e.keys&&(e.keys=[...e.keys]),function(e,t,n){return"add"===t.type?Promise.resolve([]):e.getMany({trans:t.trans,keys:n,cache:"immutable"})}(n,e,s).then((o=>{const i=s.map(((n,i)=>{const s=o[i],l={onerror:null,onsuccess:null};if("delete"===e.type)a.fire.call(l,n,s,t);else if("add"===e.type||void 0===s){const o=c.fire.call(l,n,e.values[i],t);null==n&&null!=o&&(n=o,e.keys[i]=n,r.outbound||oe(e.values[i],r.keyPath,n))}else{const r=ur(s,e.values[i]),o=u.fire.call(l,r,n,s,t);if(o){const t=e.values[i];Object.keys(o).forEach((e=>{V(t,e)?t[e]=o[e]:oe(t,e,o[e])}))}}return l}));return n.mutate(e).then((({failures:t,results:n,numFailures:r,lastResult:a})=>{for(let r=0;r<s.length;++r){const a=n?n[r]:s[r],c=i[r];null==a?c.onerror&&c.onerror(t[r]):c.onsuccess&&c.onsuccess("put"===e.type&&o[r]?e.values[r]:a)}return{failures:t,results:n,numFailures:r,lastResult:a}})).catch((e=>(i.forEach((t=>t.onerror&&t.onerror(e))),Promise.reject(e))))}))}function f(e,t,s){return n.query({trans:e,values:!1,query:{index:r,range:t},limit:s}).then((({result:n})=>l({type:"delete",keys:n,trans:e}).then((r=>r.numFailures>0?Promise.reject(r.failures[0]):n.length<s?{failures:[],numFailures:0,lastResult:void 0}:f(e,i(o({},t),{lower:n[n.length-1],lowerOpen:!0}),s)))))}}});return s}})};function fr(e,t,n){try{if(!t)return null;if(t.keys.length<e.length)return null;const r=[];for(let o=0,i=0;o<t.keys.length&&i<e.length;++o)0===bn(t.keys[o],e[i])&&(r.push(n?fe(t.values[o]):t.values[o]),++i);return r.length===e.length?r:null}catch(e){return null}}const pr={stack:"dbcore",level:-1,create:e=>({table:t=>{const n=e.table(t);return i(o({},n),{getMany:e=>{if(!e.cache)return n.getMany(e);const t=fr(e.keys,e.trans._cache,"clone"===e.cache);return t?ht.resolve(t):n.getMany(e).then((t=>(e.trans._cache={keys:e.keys,values:"clone"===e.cache?fe(t):t},t)))},mutate:e=>("add"!==e.type&&(e.trans._cache=null),n.mutate(e))})}})};function dr(e){return!("from"in e)}const hr=function(e,t){if(!this){const t=new hr;return e&&"d"in e&&z(t,e),t}z(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function yr(e,t,n){const r=bn(t,n);if(isNaN(r))return;if(r>0)throw RangeError();if(dr(e))return z(e,{from:t,to:n,d:1});const o=e.l,i=e.r;if(bn(n,e.from)<0)return o?yr(o,t,n):e.l={from:t,to:n,d:1,l:null,r:null},br(e);if(bn(t,e.to)>0)return i?yr(i,t,n):e.r={from:t,to:n,d:1,l:null,r:null},br(e);bn(t,e.from)<0&&(e.from=t,e.l=null,e.d=i?i.d+1:1),bn(n,e.to)>0&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1);const s=!e.r;o&&!e.l&&gr(e,o),i&&s&&gr(e,i)}function gr(e,t){dr(t)||function e(t,{from:n,to:r,l:o,r:i}){yr(t,n,r),o&&e(t,o),i&&e(t,i)}(e,t)}function mr(e){let t=dr(e)?null:{s:0,n:e};return{next(e){const n=arguments.length>0;for(;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&bn(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||bn(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}}}}function br(e){var t,n;const 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),i=r>1?"r":r<-1?"l":"";if(i){const t="r"===i?"l":"r",n=o({},e),r=e[i];e.from=r.from,e.to=r.to,e[i]=r[i],n[i]=r[t],e[t]=n,n.d=vr(n)}e.d=vr(e)}function vr({r:e,l:t}){return(e?t?Math.max(e.d,t.d):e.d:t?t.d:0)+1}q(hr.prototype,{add(e){return gr(this,e),this},addKey(e){return yr(this,e,e),this},addKeys(e){return e.forEach((e=>yr(this,e,e))),this},[ye](){return mr(this)}});const wr={stack:"dbcore",level:0,create:e=>{const t=e.schema.name,n=new hr(e.MIN_KEY,e.MAX_KEY);return i(o({},e),{table:r=>{const s=e.table(r),{schema:a}=s,{primaryKey:c}=a,{extractKey:u,outbound:l}=c,f=i(o({},s),{mutate:e=>{const o=e.trans,i=o.mutatedParts||(o.mutatedParts={}),c=e=>{const n=`idb://${t}/${r}/${e}`;return i[n]||(i[n]=new hr)},u=c(""),l=c(":dels"),{type:f}=e;let[p,d]="deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[];const h=e.trans._cache;return s.mutate(e).then((e=>{if(U(p)){"delete"!==f&&(p=e.results),u.addKeys(p);const t=fr(p,h);t||"add"===f||l.addKeys(p),(t||d)&&function(e,t,n,r){t.indexes.forEach((function(t){const o=e(t.name||"");function i(e){return null!=e?t.extractKey(e):null}const s=e=>t.multiEntry&&U(e)?e.forEach((e=>o.addKey(e))):o.addKey(e);(n||r).forEach(((e,t)=>{const o=n&&i(n[t]),a=r&&i(r[t]);0!==bn(o,a)&&(null!=o&&s(o),null!=a&&s(a))}))}))}(c,a,t,d)}else if(p){const e={from:p.lower,to:p.upper};l.add(e),u.add(e)}else u.add(n),l.add(n),a.indexes.forEach((e=>c(e.name).add(n)));return e}))}}),p=({query:{index:t,range:n}})=>{var r,o;return[t,new hr(null!==(r=n.lower)&&void 0!==r?r:e.MIN_KEY,null!==(o=n.upper)&&void 0!==o?o:e.MAX_KEY)]},d={get:e=>[c,new hr(e.key)],getMany:e=>[c,(new hr).addKeys(e.keys)],count:p,query:p,openCursor:p};return B(d).forEach((e=>{f[e]=function(a){const{subscr:c}=lt;if(c){const f=e=>{const n=`idb://${t}/${r}/${e}`;return c[n]||(c[n]=new hr)},p=f(""),h=f(":dels"),[y,g]=d[e](a);if(f(y.name||"").add(g),!y.isPrimaryKey){if("count"!==e){const t="query"===e&&l&&a.values&&s.query(i(o({},a),{values:!1}));return s[e].apply(this,arguments).then((n=>{if("query"===e){if(l&&a.values)return t.then((({result:e})=>(p.addKeys(e),n)));const e=a.values?n.result.map(u):n.result;a.values?p.addKeys(e):h.addKeys(e)}else if("openCursor"===e){const e=n,t=a.values;return e&&Object.create(e,{key:{get:()=>(h.addKey(e.primaryKey),e.key)},primaryKey:{get(){const t=e.primaryKey;return h.addKey(t),t}},value:{get:()=>(t&&p.addKey(e.primaryKey),e.value)}})}return n}))}h.add(n)}}return s[e].apply(this,arguments)}})),f}})}};let Or=class e{version(e){if(isNaN(e)||e<.1)throw new Re.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new Re.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);const t=this._versions;var n=t.filter((t=>t._cfg.version===e))[0];return n||(n=new this.Version(e),t.push(n),t.sort(Wn),n.stores({}),this._state.autoSchema=!1,n)}_whenReady(e){return this.idbdb&&(this._state.openComplete||lt.letThrough||this._vip)?e():new ht(((e,t)=>{if(this._state.openComplete)return t(new Re.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void t(new Re.DatabaseClosed);this.open().catch(Le)}this._state.dbReadyPromise.then(e,t)})).then(e)}use({stack:e,create:t,level:n,name:r}){r&&this.unuse({stack:e,name:r});const o=this._middlewares[e]||(this._middlewares[e]=[]);return o.push({stack:e,create:t,level:null==n?10:n,name:r}),o.sort(((e,t)=>e.level-t.level)),this}unuse({stack:e,name:t,create:n}){return e&&this._middlewares[e]&&(this._middlewares[e]=this._middlewares[e].filter((e=>n?e.create!==n:!!t&&e.name!==t))),this}open(){return function(e){const t=e._state,{indexedDB:n}=e._deps;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((()=>t.dbOpenError?Zt(t.dbOpenError):e));we&&(t.openCanceller._stackHolder=xe()),t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;const r=t.openCanceller;function o(){if(t.openCanceller!==r)throw new Re.DatabaseClosed("db.open() was cancelled")}let i=t.dbReadyResolve,s=null,a=!1;return ht.race([r,("undefined"==typeof navigator?ht.resolve():rr()).then((()=>new ht(((r,i)=>{if(o(),!n)throw new Re.MissingAPI;const c=e.name,u=t.autoSchema?n.open(c):n.open(c,Math.round(10*e.verno));if(!u)throw new Re.MissingAPI;u.onerror=Tn(i),u.onblocked=$t(e._fireOnBlocked),u.onupgradeneeded=$t((r=>{if(s=u.transaction,t.autoSchema&&!e._options.allowEmptyDB){u.onerror=Dn,s.abort(),u.result.close();const e=n.deleteDatabase(c);e.onsuccess=e.onerror=$t((()=>{i(new Re.NoSuchDatabase(`Database ${c} doesnt exist`))}))}else{s.onerror=Tn(i);var o=r.oldVersion>Math.pow(2,62)?0:r.oldVersion;a=o<1,e._novip.idbdb=u.result,function(e,t,n,r){const o=e._dbSchema,i=e._createTransaction("readwrite",e._storeNames,o);i.create(n),i._completion.catch(r);const s=i._reject.bind(i),a=lt.transless||lt;Nt((()=>{lt.trans=i,lt.transless=a,0===t?(B(o).forEach((e=>{Zn(n,e,o[e].primKey,o[e].indexes)})),Vn(e,n),ht.follow((()=>e.on.populate.fire(i))).catch(s)):function({_novip:e},t,n,r){const o=[],i=e._versions;let s=e._dbSchema=Xn(0,e.idbdb,r),a=!1;return i.filter((e=>e._cfg.version>=t)).forEach((i=>{o.push((()=>{const o=s,c=i._cfg.dbschema;Qn(e,o,r),Qn(e,c,r),s=e._dbSchema=c;const u=Gn(o,c);u.add.forEach((e=>{Zn(r,e[0],e[1].primKey,e[1].indexes)})),u.change.forEach((e=>{if(e.recreate)throw new Re.Upgrade("Not yet support for changing primary key");{const t=r.objectStore(e.name);e.add.forEach((e=>Yn(t,e))),e.change.forEach((e=>{t.deleteIndex(e.name),Yn(t,e)})),e.del.forEach((e=>t.deleteIndex(e)))}}));const l=i._cfg.contentUpgrade;if(l&&i._cfg.version>t){Vn(e,r),n._memoizedTables={},a=!0;let t=ie(c);u.del.forEach((e=>{t[e]=o[e]})),Hn(e,[e.Transaction.prototype]),qn(e,[e.Transaction.prototype],B(t),t),n.schema=t;const i=ve(l);let s;i&&Mt();const f=ht.follow((()=>{if(s=l(n),s&&i){var e=Lt.bind(null,null);s.then(e,e)}}));return s&&"function"==typeof s.then?ht.resolve(s):f.then((()=>s))}})),o.push((t=>{a&&tn||function(e,t){[].slice.call(t.db.objectStoreNames).forEach((n=>null==e[n]&&t.db.deleteObjectStore(n)))}(i._cfg.dbschema,t),Hn(e,[e.Transaction.prototype]),qn(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),n.schema=e._dbSchema}))})),function e(){return o.length?ht.resolve(o.shift()(n.idbtrans)).then(e):ht.resolve()}().then((()=>{var e,t;t=r,B(e=s).forEach((n=>{t.db.objectStoreNames.contains(n)||Zn(t,n,e[n].primKey,e[n].indexes)}))}))}(e,t,i,n).catch(s)}))}(e,o/10,s,i)}}),i),u.onsuccess=$t((()=>{s=null;const n=e._novip.idbdb=u.result,o=Q(n.objectStoreNames);if(o.length>0)try{const r=n.transaction(1===(i=o).length?i[0]:i,"readonly");t.autoSchema?function({_novip:e},t,n){e.verno=t.version/10;const r=e._dbSchema=Xn(0,t,n);e._storeNames=Q(t.objectStoreNames,0),qn(e,[e._allTables],B(r),r)}(e,n,r):(Qn(e,e._dbSchema,r),function(e,t){const n=Gn(Xn(0,e.idbdb,t),e._dbSchema);return!(n.add.length||n.change.some((e=>e.add.length||e.change.length)))}(e,r)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),Vn(e,r)}catch(e){}var i;Jt.push(e),n.onversionchange=$t((n=>{t.vcFired=!0,e.on("versionchange").fire(n)})),n.onclose=$t((t=>{e.on("close").fire(t)})),a&&function({indexedDB:e,IDBKeyRange:t},n){!tr(e)&&"__dbnames"!==n&&er(e,t).put({name:n}).catch(Le)}(e._deps,c),r()}),i)}))))]).then((()=>(o(),t.onReadyBeingFired=[],ht.resolve(nr((()=>e.on.ready.fire(e.vip)))).then((function n(){if(t.onReadyBeingFired.length>0){let r=t.onReadyBeingFired.reduce(He,Le);return t.onReadyBeingFired=[],ht.resolve(nr((()=>r(e.vip)))).then(n)}}))))).finally((()=>{t.onReadyBeingFired=null,t.isBeingOpened=!1})).then((()=>e)).catch((n=>{t.dbOpenError=n;try{s&&s.abort()}catch(e){}return r===t.openCanceller&&e._close(),Zt(n)})).finally((()=>{t.openComplete=!0,i()}))}(this)}_close(){const e=this._state,t=Jt.indexOf(this);if(t>=0&&Jt.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new ht((t=>{e.dbReadyResolve=t})),e.openCanceller=new ht(((t,n)=>{e.cancelOpen=n}))}close(){this._close();const e=this._state;this._options.autoOpen=!1,e.dbOpenError=new Re.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)}delete(){const e=arguments.length>0,t=this._state;return new ht(((n,r)=>{const o=()=>{this.close();var e=this._deps.indexedDB.deleteDatabase(this.name);e.onsuccess=$t((()=>{!function({indexedDB:e,IDBKeyRange:t},n){!tr(e)&&"__dbnames"!==n&&er(e,t).delete(n).catch(Le)}(this._deps,this.name),n()})),e.onerror=Tn(r),e.onblocked=this._fireOnBlocked};if(e)throw new Re.InvalidArgument("Arguments not allowed in db.delete()");t.isBeingOpened?t.dbReadyPromise.then(o):o()}))}backendDB(){return this.idbdb}isOpen(){return null!==this.idbdb}hasBeenClosed(){const e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name}hasFailed(){return null!==this._state.dbOpenError}dynamicallyOpened(){return this._state.autoSchema}get tables(){return B(this._allTables).map((e=>this._allTables[e]))}transaction(){const e=ir.apply(this,arguments);return this._transaction.apply(this,e)}_transaction(e,t,n){let r=lt.trans;r&&r.db===this&&-1===e.indexOf("!")||(r=null);const o=-1!==e.indexOf("?");let i,s;e=e.replace("!","").replace("?","");try{if(s=t.map((e=>{var t=e instanceof this.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 Re.InvalidArgument("Invalid transaction mode: "+e);i="readwrite"}if(r){if("readonly"===r.mode&&"readwrite"===i){if(!o)throw new Re.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");r=null}r&&s.forEach((e=>{if(r&&-1===r.storeNames.indexOf(e)){if(!o)throw new Re.SubTransaction("Table "+e+" not included in parent transaction.");r=null}})),o&&r&&!r.active&&(r=null)}}catch(e){return r?r._promise(null,((t,n)=>{n(e)})):Zt(e)}const a=sr.bind(null,this,i,s,r,n);return r?r._promise(i,a,"lock"):lt.trans?Vt(lt.transless,(()=>this._whenReady(a))):this._whenReady(a)}table(e){if(!V(this._allTables,e))throw new Re.InvalidTable(`Table ${e} does not exist`);return this._allTables[e]}constructor(t,n){this._middlewares={},this.verno=0;const r=e.dependencies;this._options=n=o({addons:e.addons,autoOpen:!0,indexedDB:r.indexedDB,IDBKeyRange:r.IDBKeyRange},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange};const{addons:i}=n;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;const s={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Le,dbReadyPromise:null,cancelOpen:Le,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};var a;s.dbReadyPromise=new ht((e=>{s.dbReadyResolve=e})),s.openCanceller=new ht(((e,t)=>{s.cancelOpen=t})),this._state=s,this.name=t,this.on=un(this,"populate","blocked","versionchange","close",{ready:[He,Le]}),this.on.ready.subscribe=J(this.on.ready.subscribe,(t=>(n,r)=>{e.vip((()=>{const e=this._state;if(e.openComplete)e.dbOpenError||ht.resolve().then(n),r&&t(n);else if(e.onReadyBeingFired)e.onReadyBeingFired.push(n),r&&t(n);else{t(n);const e=this;r||t((function t(){e.on.ready.unsubscribe(n),e.on.ready.unsubscribe(t)}))}}))})),this.Collection=(a=this,ln(On.prototype,(function(e,t){this.db=a;let n=sn,r=null;if(t)try{n=t()}catch(e){r=e}const o=e._ctx,i=o.table,s=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:s!==Be?s:null}}))),this.Table=function(e){return ln(cn.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:un(null,{creating:[Fe,Le],reading:[Ue,Be],updating:[Ve,Le],deleting:[Ke,Le]})}))}(this),this.Transaction=function(e){return ln(Rn.prototype,(function(t,n,r,o,i){this.db=e,this.mode=t,this.storeNames=n,this.schema=r,this.chromeTransactionDurability=o,this.idbtrans=null,this.on=un(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 ht(((e,t)=>{this._resolve=e,this._reject=t})),this._completion.then((()=>{this.active=!1,this.on.complete.fire()}),(e=>{var t=this.active;return this.active=!1,this.on.error.fire(e),this.parent?this.parent._reject(e):t&&this.idbtrans&&this.idbtrans.abort(),Zt(e)}))}))}(this),this.Version=function(e){return ln(Jn.prototype,(function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(e){return ln(Cn.prototype,(function(t,n,r){this.db=e,this._ctx={table:t,index:":id"===n?null:n,or:r};const o=e._deps.indexedDB;if(!o)throw new Re.MissingAPI;this._cmp=this._ascending=o.cmp.bind(o),this._descending=(e,t)=>o.cmp(t,e),this._max=(e,t)=>o.cmp(e,t)>0?e:t,this._min=(e,t)=>o.cmp(e,t)<0?e:t,this._IDBKeyRange=e._deps.IDBKeyRange}))}(this),this.on("versionchange",(e=>{e.newVersion>0?console.warn(`Another connection wants to upgrade database '${this.name}'. Closing db now to resume the upgrade.`):console.warn(`Another connection wants to delete database '${this.name}'. Closing db now to resume the delete request.`),this.close()})),this.on("blocked",(e=>{!e.newVersion||e.newVersion<e.oldVersion?console.warn(`Dexie.delete('${this.name}') was blocked`):console.warn(`Upgrade '${this.name}' blocked by other connection holding version ${e.oldVersion/10}`)})),this._maxKey=Bn(n.IDBKeyRange),this._createTransaction=(e,t,n,r)=>new this.Transaction(e,t,n,this._options.chromeTransactionDurability,r),this._fireOnBlocked=e=>{this.on("blocked").fire(e),Jt.filter((e=>e.name===this.name&&e!==this&&!e._state.vcFired)).map((t=>t.on("versionchange").fire(e)))},this.use(cr),this.use(lr),this.use(wr),this.use(pr),this.vip=Object.create(this,{_vip:{value:!0}}),i.forEach((e=>e(this)))}};const Sr="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";let Er,xr=class{subscribe(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})}[Sr](){return this}constructor(e){this._subscribe=e}};function _r(e,t){return B(t).forEach((n=>{gr(e[n]||(e[n]=new hr),t[n])})),e}try{Er={indexedDB:L.indexedDB||L.mozIndexedDB||L.webkitIndexedDB||L.msIndexedDB,IDBKeyRange:L.IDBKeyRange||L.webkitIDBKeyRange}}catch(r){Er={indexedDB:null,IDBKeyRange:null}}const jr=Or;function kr(e){let t=Pr;try{Pr=!0,In.storagemutated.fire(e)}finally{Pr=t}}q(jr,i(o({},Me),{delete:e=>new jr(e,{addons:[]}).delete(),exists:e=>new jr(e,{addons:[]}).open().then((e=>(e.close(),!0))).catch("NoSuchDatabaseError",(()=>!1)),getDatabaseNames(e){try{return function({indexedDB:e,IDBKeyRange:t}){return tr(e)?Promise.resolve(e.databases()).then((e=>e.map((e=>e.name)).filter((e=>"__dbnames"!==e)))):er(e,t).toCollection().primaryKeys()}(jr.dependencies).then(e)}catch(e){return Zt(new Re.MissingAPI)}},defineClass:()=>function(e){z(this,e)},ignoreTransaction:e=>lt.trans?Vt(lt.transless,e):e(),vip:nr,async:function(e){return function(){try{var t=or(e.apply(this,arguments));return t&&"function"==typeof t.then?t:ht.resolve(t)}catch(e){return Zt(e)}}},spawn:function(e,t,n){try{var r=or(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:ht.resolve(r)}catch(e){return Zt(e)}},currentTransaction:{get:()=>lt.trans||null},waitFor:function(e,t){const n=ht.resolve("function"==typeof e?jr.ignoreTransaction(e):e).timeout(t||6e4);return lt.trans?lt.trans.waitFor(n):n},Promise:ht,debug:{get:()=>we,set:e=>{Oe(e,"dexie"===e?()=>!0:rn)}},derive:G,extend:z,props:q,override:J,Events:un,on:In,liveQuery:function(e){return new xr((t=>{const n=ve(e);let r=!1,o={},i={};const s={get closed(){return r},unsubscribe:()=>{r=!0,In.storagemutated.unsubscribe(l)}};t.start&&t.start(s);let a=!1,c=!1;function u(){return B(i).some((e=>o[e]&&function(e,t){const n=mr(t);let r=n.next();if(r.done)return!1;let o=r.value;const i=mr(e);let s=i.next(o.from),a=s.value;for(;!r.done&&!s.done;){if(bn(a.from,o.to)<=0&&bn(a.to,o.from)>=0)return!0;bn(o.from,a.from)<0?o=(r=n.next(a.from)).value:a=(s=i.next(o.from)).value}return!1}(o[e],i[e])))}const l=e=>{_r(o,e),u()&&f()},f=()=>{if(a||r)return;o={};const p={},d=function(t){n&&Mt();const r=()=>Nt(e,{subscr:t,trans:null}),o=lt.trans?Vt(lt.transless,r):r();return n&&o.then(Lt,Lt),o}(p);c||(In("storagemutated",l),c=!0),a=!0,Promise.resolve(d).then((e=>{a=!1,r||(u()?f():(o={},i=p,t.next&&t.next(e)))}),(e=>{a=!1,t.error&&t.error(e),s.unsubscribe()}))};return f(),s}))},extendObservabilitySet:_r,getByKeyPath:re,setByKeyPath:oe,delByKeyPath:function(e,t){"string"==typeof t?oe(e,t,void 0):"length"in t&&[].map.call(t,(function(t){oe(e,t,void 0)}))},shallowClone:ie,deepClone:fe,getObjectDiff:ur,cmp:bn,asap:te,minKey:-1/0,addons:[],connections:Jt,errnames:De,dependencies:Er,semVer:"3.2.3",version:"3.2.3".split(".").map((e=>parseInt(e))).reduce(((e,t,n)=>e+t/Math.pow(10,2*n)))})),jr.maxKey=Bn(jr.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(In("storagemutated",(e=>{if(!Pr){let t;en?(t=document.createEvent("CustomEvent"),t.initCustomEvent("x-storagemutated-1",!0,!0,e)):t=new CustomEvent("x-storagemutated-1",{detail:e}),Pr=!0,dispatchEvent(t),Pr=!1}})),addEventListener("x-storagemutated-1",(({detail:e})=>{Pr||kr(e)})));let Pr=!1;if("undefined"!=typeof BroadcastChannel){const e=new BroadcastChannel("x-storagemutated-1");"function"==typeof e.unref&&e.unref(),In("storagemutated",(t=>{Pr||e.postMessage(t)})),e.onmessage=e=>{e.data&&kr(e.data)}}else if("undefined"!=typeof self&&"undefined"!=typeof navigator){In("storagemutated",(e=>{try{Pr||("undefined"!=typeof localStorage&&localStorage.setItem("x-storagemutated-1",JSON.stringify({trig:Math.random(),changedParts:e})),"object"==typeof self.clients&&[...self.clients.matchAll({includeUncontrolled:!0})].forEach((t=>t.postMessage({type:"x-storagemutated-1",changedParts:e}))))}catch(e){}})),"undefined"!=typeof addEventListener&&addEventListener("storage",(e=>{if("x-storagemutated-1"===e.key){const t=JSON.parse(e.newValue);t&&kr(t.changedParts)}}));const e=self.document&&navigator.serviceWorker;e&&e.addEventListener("message",(function({data:e}){e&&"x-storagemutated-1"===e.type&&kr(e.changedParts)}))}ht.rejectionMapper=function(e,t){if(!e||e instanceof $e||e instanceof TypeError||e instanceof SyntaxError||!e.name||!Ne[e.name])return e;var n=new Ne[e.name](t||e.message,e);return"stack"in e&&W(n,"stack",{get:function(){return this.inner.stack}}),n},Oe(we,rn);var $r=c(766),Ar=c(685);function Cr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Tr=class extends Or{constructor(){super("EsmOffline"),Cr(this,"syncQueue",void 0),Cr(this,"dynamicOfflineData",void 0),this.version(4).stores({syncQueue:"++id,userId,type,[userId+type]",dynamicOfflineData:"++id,type,identifier,*users,&[type+identifier]"}),this.syncQueue=this.table("syncQueue"),this.dynamicOfflineData=this.table("dynamicOfflineData")}};function Dr(){return new Tr}function Ir(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function Rr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){Ir(i,r,o,s,a,"next",e)}function a(e){Ir(i,r,o,s,a,"throw",e)}s(void 0)}))}}function Nr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mr(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){Nr(e,t,n[t])}))}return e}const Lr=new Tr,Br={},Ur=(0,Ar.createGlobalStore)("offline-synchronization",{});function zr(){return Ur}function Fr(){return Kr.apply(this,arguments)}function Kr(){return Kr=Rr((function*(){if(Ur.getState().synchronization)return;const e=yield Lr.syncQueue.count(),t={},n=Object.entries(Br),r=n.length,o={},i=new AbortController,s=()=>{const e=Ur.getState().synchronization;var t,n;Ur.setState({synchronization:(t=Mr({},e),n={pendingCount:e.pendingCount-1},n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})),t)})};try{Ur.setState({synchronization:{totalCount:e,pendingCount:e,abortController:i}});for(let e=0;e<r&&n.length>0;e++)for(let e=n.length;e--;){const[r,a]=n[e],c=a.dependsOn.map((e=>t[e]));c.every(Boolean)&&(o[r]={},yield Promise.all(c),t[r]=Vr(a,o,i,s),n.splice(e,1))}yield Promise.allSettled(Object.values(t))}finally{Ur.setState({synchronization:void 0})}})),Kr.apply(this,arguments)}function Vr(e,t,n,r){return qr.apply(this,arguments)}function qr(){return qr=Rr((function*({type:e,dependsOn:t,process:n},r,o,i){const s=[],a=[],c=yield Hr();yield Lr.syncQueue.where({type:e,userId:c}).each(((e,t)=>{s.push([t.primaryKey,e.content,e.descriptor]),a.push(e.content)}));for(let l=0;l<s.length;l++){const[f,p,{id:d,dependencies:h=[]}]=s[l];try{const i=yield n(p,{abort:o,index:l,items:a,userId:c,dependencies:h.map((({id:e,type:n})=>t.includes(n)?r[n][e]:void 0))});void 0!==d&&(r[e][d]=i),yield Lr.syncQueue.delete(f)}catch(e){var u;yield Lr.syncQueue.update(f,{lastError:{name:null==e?void 0:e.name,message:null!==(u=null==e?void 0:e.message)&&void 0!==u?u:null==e?void 0:e.toString()}})}finally{i()}}})),qr.apply(this,arguments)}function Hr(){return Wr.apply(this,arguments)}function Wr(){return(Wr=Rr((function*(){const e=yield(0,$r.getLoggedInUser)();return(null==e?void 0:e.uuid)||"*"}))).apply(this,arguments)}function Gr(e,t,n,r){return Zr.apply(this,arguments)}function Zr(){return(Zr=Rr((function*(e,t,n,r){const o=r&&r.id;return void 0!==o&&(yield Lr.syncQueue.where({type:t,userId:e}).filter((e=>(null==e?void 0:e.descriptor.id)===o)).delete().catch(Or.errnames.DatabaseClosed)),yield Lr.syncQueue.add({type:t,content:n,userId:e,descriptor:r||{},createdOn:new Date}).catch(Or.errnames.DatabaseClosed,(()=>-1))}))).apply(this,arguments)}function Yr(e,t,n){return Xr.apply(this,arguments)}function Xr(){return(Xr=Rr((function*(e,t,n){const r=yield Hr();return yield Gr(r,e,t,n)}))).apply(this,arguments)}function Qr(e,t){return Jr.apply(this,arguments)}function Jr(){return(Jr=Rr((function*(e,t){return(yield eo(e,t)).map((e=>e.content))}))).apply(this,arguments)}function eo(e,t){return to.apply(this,arguments)}function to(){return(to=Rr((function*(e,t){const n=t?{type:t,userId:e}:{userId:e};return yield Lr.syncQueue.where(n).toArray().catch(Or.errnames.DatabaseClosed,(()=>[]))}))).apply(this,arguments)}function no(e){return ro.apply(this,arguments)}function ro(){return(ro=Rr((function*(e){const t=yield Hr();return yield Qr(t,e)}))).apply(this,arguments)}function oo(e){return io.apply(this,arguments)}function io(){return(io=Rr((function*(e){const t=yield Hr();return yield eo(t,e)}))).apply(this,arguments)}function so(e){return ao.apply(this,arguments)}function ao(){return(ao=Rr((function*(e){return yield Lr.syncQueue.get(e).catch(Or.errnames.DatabaseClosed,(()=>{}))}))).apply(this,arguments)}function co(e){var t;return!!(null===(t=Br[e])||void 0===t?void 0:t.options.onBeginEditSyncItem)}function uo(e){return lo.apply(this,arguments)}function lo(){return(lo=Rr((function*(e){var t;const n=yield so(e);if(!n)throw new Error(`No sync item with the ID ${e} exists.`);const r=null===(t=Br[n.type])||void 0===t?void 0:t.options.onBeginEditSyncItem;if(!r)throw new Error(`A sync item with the ID ${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 "${n.type}" supports editing items.`);r(n)}))).apply(this,arguments)}function fo(e){return po.apply(this,arguments)}function po(){return(po=Rr((function*(e){yield Lr.syncQueue.delete(e).catch(Or.errnames.DatabaseClosed)}))).apply(this,arguments)}function ho(e,t,n,r={}){Br[e]={type:e,dependsOn:t,process:n,options:r}}const yo={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let go;const mo=new Uint8Array(16);function bo(){if(!go&&(go="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!go))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return go(mo)}const vo=[];for(let e=0;e<256;++e)vo.push((e+256).toString(16).slice(1));const wo=function(e,t,n){if(yo.randomUUID&&!t&&!e)return yo.randomUUID();const r=(e=e||{}).random||(e.rng||bo)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return(vo[e[t+0]]+vo[e[t+1]]+vo[e[t+2]]+vo[e[t+3]]+"-"+vo[e[t+4]]+vo[e[t+5]]+"-"+vo[e[t+6]]+vo[e[t+7]]+"-"+vo[e[t+8]]+vo[e[t+9]]+"-"+vo[e[t+10]]+vo[e[t+11]]+vo[e[t+12]]+vo[e[t+13]]+vo[e[t+14]]+vo[e[t+15]]).toLowerCase()}(r)},Oo="OFFLINE+";function So(){return Oo+wo()}function Eo(e){return e.startsWith(Oo)}function xo(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function _o(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){xo(i,r,o,s,a,"next",e)}function a(e){xo(i,r,o,s,a,"throw",e)}s(void 0)}))}}const jo={};function ko(){return Object.values(jo)}function Po(e){jo[e.id]&&console.warn(`[setupDynamicOfflineDataHandler] Another second handler with the ID "${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.`),jo[e.id]=e}function $o(e){return Ao.apply(this,arguments)}function Ao(){return(Ao=_o((function*(e){const t=yield qo();return yield Co(t,e)}))).apply(this,arguments)}function Co(e,t){return To.apply(this,arguments)}function To(){return To=_o((function*(e,t){const n=t?{type:t,users:e}:{users:e},r=new Tr;return yield r.dynamicOfflineData.where(n).toArray().catch(Or.errnames.DatabaseClosed,(()=>[]))})),To.apply(this,arguments)}function Do(e,t){return Io.apply(this,arguments)}function Io(){return(Io=_o((function*(e,t){const n=yield qo();return yield Ro(n,e,t)}))).apply(this,arguments)}function Ro(e,t,n){return No.apply(this,arguments)}function No(){return No=_o((function*(e,t,n){const r=new Tr,o=yield r.dynamicOfflineData.get({type:t,identifier:n}).catch(Or.errnames.DatabaseClosed,(()=>{}));o?o.users.includes(e)||(yield r.dynamicOfflineData.update(o.id,{users:[...o.users,e]}).catch(Or.errnames.DatabaseClosed)):yield r.dynamicOfflineData.add({users:[e],type:t,identifier:n}).catch(Or.errnames.DatabaseClosed)})),No.apply(this,arguments)}function Mo(e,t){return Lo.apply(this,arguments)}function Lo(){return(Lo=_o((function*(e,t){const n=yield qo();return yield Bo(n,e,t)}))).apply(this,arguments)}function Bo(e,t,n){return Uo.apply(this,arguments)}function Uo(){return Uo=_o((function*(e,t,n){const r=new Tr,o=yield r.dynamicOfflineData.get({type:t,identifier:n,users:e}).catch(Or.errnames.DatabaseClosed,(()=>{}));o&&(o.users.length>1?yield r.dynamicOfflineData.update(o.id,{users:o.users.filter((t=>t!==e))}).catch(Or.errnames.DatabaseClosed):yield r.dynamicOfflineData.delete(o.id).catch(Or.errnames.DatabaseClosed))})),Uo.apply(this,arguments)}function zo(e,t){return Fo.apply(this,arguments)}function Fo(){return Fo=_o((function*(e,t){const n=yield $o(e);var r;yield Promise.all(n.map((r=_o((function*(e){return Ko(e.type,e.identifier,t)})),function(e){return r.apply(this,arguments)})))})),Fo.apply(this,arguments)}function Ko(e,t,n){return Vo.apply(this,arguments)}function Vo(){return Vo=_o((function*(e,t,n){yield Do(e,t);const r=new Tr,o=yield qo(),i=yield r.dynamicOfflineData.get({type:e,identifier:t}).catch(Or.errnames.DatabaseClosed,(()=>{})),s=ko().filter((t=>t.type===e));if(!i)return;const a=yield Promise.all(s.map((c=_o((function*(e){try{return e.sync(t,n),{id:e.id,error:void 0}}catch(t){var r,o;const n=null!==(o=null===(r=t.message)||void 0===r?void 0:r.toString())&&void 0!==o?o:t.toString();return{id:e.id,error:n}}})),function(e){return c.apply(this,arguments)})));var c;const u=a.filter((e=>!e.error)).map((e=>e.id)),l=a.filter((e=>e.error)).map((e=>e.id)),f=a.filter((e=>e.error)).map((e=>({handlerId:e.id,message:e.error}))),p={syncedOn:new Date,syncedBy:o,succeededHandlers:u,erroredHandlers:l,errors:f};i.id&&(yield r.dynamicOfflineData.update(i.id,{syncState:p}).catch(Or.errnames.DatabaseClosed))})),Vo.apply(this,arguments)}function qo(){return Ho.apply(this,arguments)}function Ho(){return(Ho=_o((function*(){const e=(yield(0,$r.getLoggedInUser)()).uuid;if(!e)throw new Error("Using the dynamic offline data API requires a logged in user.");return e}))).apply(this,arguments)}function Wo(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}const Go=(0,Ar.createGlobalStore)("offline-patients",{offlinePatientDataSyncState:{},handlers:{}});function Zo(){return Jo(),Go}function Yo(e,t){Jo(),Po({type:"patient",displayName:t.displayName,id:e,isSynced:()=>Promise.resolve(!0),sync:(e,n)=>t.onOfflinePatientAdded({patientUuid:e,signal:null!=n?n:(new AbortController).signal})})}function Xo(e){return Qo.apply(this,arguments)}function Qo(){return Qo=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){Wo(i,r,o,s,a,"next",e)}function a(e){Wo(i,r,o,s,a,"throw",e)}s(void 0)}))}}((function*(e){Jo(),yield Ko("patient",e)})),Qo.apply(this,arguments)}function Jo(){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.")}})(),u})())}}}))},7352:(e,t,n)=>{"use strict";n.d(t,{jp:()=>_o,Qd:()=>xo,Gy:()=>ko,sF:()=>ro,vm:()=>o,xA:()=>ur,H_:()=>fr,Ui:()=>ar,D2:()=>wo,WB:()=>go,aA:()=>rr,k1:()=>$r,TI:()=>So,Q2:()=>bo,z7:()=>oo,gp:()=>qr,a7:()=>no,Rz:()=>Zr,QI:()=>Wr,$9:()=>Gr,cV:()=>dr,fR:()=>yr,X2:()=>po,dt:()=>Ar,pO:()=>mr,ME:()=>vr,Xc:()=>cr,Kb:()=>$o,ps:()=>Or,mF:()=>Er,MO:()=>Cr});let r="unavailable";function o(){return{current:r,notAvailable:"unavailable"===r,active:"on"===r}}var i=n(403),s=n(7840);const a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,c=Object.keys,u=Array.isArray;function l(e,t){return"object"!=typeof t||c(t).forEach((function(n){e[n]=t[n]})),e}"undefined"==typeof Promise||a.Promise||(a.Promise=Promise);const f=Object.getPrototypeOf,p={}.hasOwnProperty;function d(e,t){return p.call(e,t)}function h(e,t){"function"==typeof t&&(t=t(f(e))),("undefined"==typeof Reflect?c:Reflect.ownKeys)(t).forEach((n=>{g(e,n,t[n])}))}const y=Object.defineProperty;function g(e,t,n,r){y(e,t,l(n&&d(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function m(e){return{from:function(t){return e.prototype=Object.create(t.prototype),g(e.prototype,"constructor",e),{extend:h.bind(null,e.prototype)}}}}const b=Object.getOwnPropertyDescriptor;function v(e,t){let n;return b(e,t)||(n=f(e))&&v(n,t)}const w=[].slice;function O(e,t,n){return w.call(e,t,n)}function S(e,t){return t(e)}function E(e){if(!e)throw new Error("Assertion Failed")}function x(e){a.setImmediate?setImmediate(e):setTimeout(e,0)}function j(e,t){return e.reduce(((e,n,r)=>{var o=t(n,r);return o&&(e[o[0]]=o[1]),e}),{})}function k(e,t){if(d(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=k(e,t[r]);n.push(i)}return n}var s=t.indexOf(".");if(-1!==s){var a=e[t.substr(0,s)];return void 0===a?void 0:k(a,t.substr(s+1))}}function P(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){E("string"!=typeof n&&"length"in n);for(var r=0,o=t.length;r<o;++r)P(e,t[r],n[r])}else{var i=t.indexOf(".");if(-1!==i){var s=t.substr(0,i),a=t.substr(i+1);if(""===a)void 0===n?u(e)&&!isNaN(parseInt(s))?e.splice(s,1):delete e[s]:e[s]=n;else{var c=e[s];c&&d(e,s)||(c=e[s]={}),P(c,a,n)}}else void 0===n?u(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function $(e){var t={};for(var n in e)d(e,n)&&(t[n]=e[n]);return t}const A=[].concat;function C(e){return A.apply([],e)}const T="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(C([8,16,32,64].map((e=>["Int","Uint","Float"].map((t=>t+e+"Array")))))).filter((e=>a[e])),D=T.map((e=>a[e]));j(T,(e=>[e,!0]));let I=null;function R(e){I="undefined"!=typeof WeakMap&&new WeakMap;const t=N(e);return I=null,t}function N(e){if(!e||"object"!=typeof e)return e;let t=I&&I.get(e);if(t)return t;if(u(e)){t=[],I&&I.set(e,t);for(var n=0,r=e.length;n<r;++n)t.push(N(e[n]))}else if(D.indexOf(e.constructor)>=0)t=e;else{const n=f(e);for(var o in t=n===Object.prototype?{}:Object.create(n),I&&I.set(e,t),e)d(e,o)&&(t[o]=N(e[o]))}return t}const{toString:M}={};function L(e){return M.call(e).slice(8,-1)}const B="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",U="symbol"==typeof B?function(e){var t;return null!=e&&(t=e[B])&&t.apply(e)}:function(){return null},z={};function F(e){var t,n,r,o;if(1===arguments.length){if(u(e))return e.slice();if(this===z&&"string"==typeof e)return[e];if(o=U(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}const K="undefined"!=typeof Symbol?e=>"AsyncFunction"===e[Symbol.toStringTag]:()=>!1;var V="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function q(e,t){V=e,H=t}var H=()=>!0;const W=!new Error("").stack;function G(){if(W)try{throw G.arguments,new Error}catch(e){return e}return new Error}function Z(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(H).map((e=>"\n"+e)).join("")):""}var Y=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],X=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Y),Q={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"};function J(e,t){this._e=G(),this.name=e,this.message=t}function ee(e,t){return e+". Errors: "+Object.keys(t).map((e=>t[e].toString())).filter(((e,t,n)=>n.indexOf(e)===t)).join("\n")}function te(e,t,n,r){this._e=G(),this.failures=t,this.failedKeys=r,this.successCount=n,this.message=ee(e,t)}function ne(e,t){this._e=G(),this.name="BulkError",this.failures=Object.keys(t).map((e=>t[e])),this.failuresByPos=t,this.message=ee(e,t)}m(J).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}}),m(te).from(J),m(ne).from(J);var re=X.reduce(((e,t)=>(e[t]=t+"Error",e)),{});const oe=J;var ie=X.reduce(((e,t)=>{var n=t+"Error";function r(e,r){this._e=G(),this.name=n,e?"string"==typeof e?(this.message=`${e}${r?"\n "+r:""}`,this.inner=r||null):"object"==typeof e&&(this.message=`${e.name} ${e.message}`,this.inner=e):(this.message=Q[t]||n,this.inner=null)}return m(r).from(oe),e[t]=r,e}),{});ie.Syntax=SyntaxError,ie.Type=TypeError,ie.Range=RangeError;var se=Y.reduce(((e,t)=>(e[t+"Error"]=ie[t],e)),{}),ae=X.reduce(((e,t)=>(-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=ie[t]),e)),{});function ce(){}function ue(e){return e}function le(e,t){return null==e||e===ue?t:function(n){return t(e(n))}}function fe(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function pe(e,t){return e===ce?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?fe(r,this.onsuccess):r),o&&(this.onerror=this.onerror?fe(o,this.onerror):o),void 0!==i?i:n}}function de(e,t){return e===ce?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?fe(n,this.onsuccess):n),r&&(this.onerror=this.onerror?fe(r,this.onerror):r)}}function he(e,t){return e===ce?t:function(n){var r=e.apply(this,arguments);l(n,r);var o=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var s=t.apply(this,arguments);return o&&(this.onsuccess=this.onsuccess?fe(o,this.onsuccess):o),i&&(this.onerror=this.onerror?fe(i,this.onerror):i),void 0===r?void 0===s?void 0:s:l(r,s)}}function ye(e,t){return e===ce?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function ge(e,t){return e===ce?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)}}ae.ModifyError=te,ae.DexieError=J,ae.BulkError=ne;var me={};const[be,ve,we]="undefined"==typeof Promise?[]:(()=>{let e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,f(e),e];const t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,f(t),e]})(),Oe=ve&&ve.then,Se=be&&be.constructor,Ee=!!we;var xe=!1,_e=we?()=>{we.then(Ge)}:a.setImmediate?setImmediate.bind(null,Ge):a.MutationObserver?()=>{var e=document.createElement("div");new MutationObserver((()=>{Ge(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:()=>{setTimeout(Ge,0)},je=function(e,t){Re.push([e,t]),Pe&&(_e(),Pe=!1)},ke=!0,Pe=!0,$e=[],Ae=[],Ce=null,Te=ue,De={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:bt,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((e=>{try{bt(e[0],e[1])}catch(e){}}))}},Ie=De,Re=[],Ne=0,Me=[];function Le(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=ce,this._lib=!1;var t=this._PSD=Ie;if(V&&(this._stackHolder=G(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==me)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&Fe(this,this._value))}this._state=null,this._value=null,++t.ref,ze(this,e)}const Be={get:function(){var e=Ie,t=ot;function n(n,r){var o=!e.global&&(e!==Ie||t!==ot);const i=o&&!ct();var s=new Le(((t,s)=>{Ve(this,new Ue(gt(n,e,o,i),gt(r,e,o,i),t,s,e))}));return V&&We(s,this),s}return n.prototype=me,n},set:function(e){g(this,"then",e&&e.prototype===me?Be:{get:function(){return e},set:Be.set})}};function Ue(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}function ze(e,t){try{t((t=>{if(null===e._state){if(t===e)throw new TypeError("A promise cannot be resolved with itself.");var n=e._lib&&Ze();t&&"function"==typeof t.then?ze(e,((e,n)=>{t instanceof Le?t._then(e,n):t.then(e,n)})):(e._state=!0,e._value=t,Ke(e)),n&&Ye()}}),Fe.bind(null,e))}catch(t){Fe(e,t)}}function Fe(e,t){if(Ae.push(t),null===e._state){var n=e._lib&&Ze();t=Te(t),e._state=!1,e._value=t,V&&null!==t&&"object"==typeof t&&!t._promise&&function(e,t,n){try{e.apply(null,void 0)}catch(e){}}((()=>{var n=v(t,"stack");t._promise=e,g(t,"stack",{get:()=>xe?n&&(n.get?n.get.apply(t):n.value):e.stack})})),function(e){$e.some((t=>t._value===e._value))||$e.push(e)}(e),Ke(e),n&&Ye()}}function Ke(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)Ve(e,t[n]);var o=e._PSD;--o.ref||o.finalize(),0===Ne&&(++Ne,je((()=>{0==--Ne&&Xe()}),[]))}function Ve(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,++Ne,je(qe,[n,e,t])}else e._listeners.push(t)}function qe(e,t,n){try{Ce=t;var r,o=t._value;t._state?r=e(o):(Ae.length&&(Ae=[]),r=e(o),-1===Ae.indexOf(o)&&function(e){for(var t=$e.length;t;)if($e[--t]._value===e._value)return void $e.splice(t,1)}(t)),n.resolve(r)}catch(e){n.reject(e)}finally{Ce=null,0==--Ne&&Xe(),--n.psd.ref||n.psd.finalize()}}function He(e,t,n){if(t.length===n)return t;var r="";if(!1===e._state){var o,i,s=e._value;null!=s?(o=s.name||"Error",i=s.message||s,r=Z(s,0)):(o=s,i=""),t.push(o+(i?": "+i:"")+r)}return V&&((r=Z(e._stackHolder,2))&&-1===t.indexOf(r)&&t.push(r),e._prev&&He(e._prev,t,n)),t}function We(e,t){var n=t?t._numPrev+1:0;n<100&&(e._prev=t,e._numPrev=n)}function Ge(){Ze()&&Ye()}function Ze(){var e=ke;return ke=!1,Pe=!1,e}function Ye(){var e,t,n;do{for(;Re.length>0;)for(e=Re,Re=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}}while(Re.length>0);ke=!0,Pe=!0}function Xe(){var e=$e;$e=[],e.forEach((e=>{e._PSD.onunhandled.call(null,e._value,e)}));for(var t=Me.slice(0),n=t.length;n;)t[--n]()}function Qe(e){return new Le(me,!1,e)}function Je(e,t){var n=Ie;return function(){var r=Ze(),o=Ie;try{return pt(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{pt(o,!1),r&&Ye()}}}h(Le.prototype,{then:Be,_then:function(e,t){Ve(this,new Ue(null,null,e,t,Ie))},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,(e=>e instanceof t?n(e):Qe(e))):this.then(null,(e=>e&&e.name===t?n(e):Qe(e)))},finally:function(e){return this.then((t=>(e(),t)),(t=>(e(),Qe(t))))},stack:{get:function(){if(this._stack)return this._stack;try{xe=!0;var e=He(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{xe=!1}}},timeout:function(e,t){return e<1/0?new Le(((n,r)=>{var o=setTimeout((()=>r(new ie.Timeout(t))),e);this.then(n,r).finally(clearTimeout.bind(null,o))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&g(Le.prototype,Symbol.toStringTag,"Dexie.Promise"),De.env=dt(),h(Le,{all:function(){var e=F.apply(null,arguments).map(ut);return new Le((function(t,n){0===e.length&&t([]);var r=e.length;e.forEach(((o,i)=>Le.resolve(o).then((n=>{e[i]=n,--r||t(e)}),n)))}))},resolve:e=>{if(e instanceof Le)return e;if(e&&"function"==typeof e.then)return new Le(((t,n)=>{e.then(t,n)}));var t=new Le(me,!0,e);return We(t,Ce),t},reject:Qe,race:function(){var e=F.apply(null,arguments).map(ut);return new Le(((t,n)=>{e.map((e=>Le.resolve(e).then(t,n)))}))},PSD:{get:()=>Ie,set:e=>Ie=e},totalEchoes:{get:()=>ot},newPSD:st,usePSD:ht,scheduler:{get:()=>je,set:e=>{je=e}},rejectionMapper:{get:()=>Te,set:e=>{Te=e}},follow:(e,t)=>new Le(((n,r)=>st(((t,n)=>{var r=Ie;r.unhandleds=[],r.onunhandled=n,r.finalize=fe((function(){!function(e){Me.push((function t(){e(),Me.splice(Me.indexOf(t),1)})),++Ne,je((()=>{0==--Ne&&Xe()}),[])}((()=>{0===this.unhandleds.length?t():n(this.unhandleds[0])}))}),r.finalize),e()}),t,n,r)))}),Se&&(Se.allSettled&&g(Le,"allSettled",(function(){const e=F.apply(null,arguments).map(ut);return new Le((t=>{0===e.length&&t([]);let n=e.length;const r=new Array(n);e.forEach(((e,o)=>Le.resolve(e).then((e=>r[o]={status:"fulfilled",value:e}),(e=>r[o]={status:"rejected",reason:e})).then((()=>--n||t(r)))))}))})),Se.any&&"undefined"!=typeof AggregateError&&g(Le,"any",(function(){const e=F.apply(null,arguments).map(ut);return new Le(((t,n)=>{0===e.length&&n(new AggregateError([]));let r=e.length;const o=new Array(r);e.forEach(((e,i)=>Le.resolve(e).then((e=>t(e)),(e=>{o[i]=e,--r||n(new AggregateError(o))}))))}))})));const et={awaits:0,echoes:0,id:0};var tt=0,nt=[],rt=0,ot=0,it=0;function st(e,t,n,r){var o=Ie,i=Object.create(o);i.parent=o,i.ref=0,i.global=!1,i.id=++it;var s=De.env;i.env=Ee?{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:mt(s.nthen,i),gthen:mt(s.gthen,i)}:{},t&&l(i,t),++o.ref,i.finalize=function(){--this.parent.ref||this.parent.finalize()};var a=ht(i,e,n,r);return 0===i.ref&&i.finalize(),a}function at(){return et.id||(et.id=++tt),++et.awaits,et.echoes+=100,et.id}function ct(){return!!et.awaits&&(0==--et.awaits&&(et.id=0),et.echoes=100*et.awaits,!0)}function ut(e){return et.echoes&&e&&e.constructor===Se?(at(),e.then((e=>(ct(),e)),(e=>(ct(),vt(e))))):e}function lt(e){++ot,et.echoes&&0!=--et.echoes||(et.echoes=et.id=0),nt.push(Ie),pt(e,!0)}function ft(){var e=nt[nt.length-1];nt.pop(),pt(e,!1)}function pt(e,t){var n=Ie;if((t?!et.echoes||rt++&&e===Ie:!rt||--rt&&e===Ie)||yt(t?lt.bind(null,e):ft),e!==Ie&&(Ie=e,n===De&&(De.env=dt()),Ee)){var r=De.env.Promise,o=e.env;ve.then=o.nthen,r.prototype.then=o.gthen,(n.global||e.global)&&(Object.defineProperty(a,"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))}}function dt(){var e=a.Promise;return Ee?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(a,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:ve.then,gthen:e.prototype.then}:{}}function ht(e,t,n,r,o){var i=Ie;try{return pt(e,!0),t(n,r,o)}finally{pt(i,!1)}}function yt(e){Oe.call(be,e)}function gt(e,t,n,r){return"function"!=typeof e?e:function(){var o=Ie;n&&at(),pt(t,!0);try{return e.apply(this,arguments)}finally{pt(o,!1),r&&yt(ct)}}}function mt(e,t){return function(n,r){return e.call(this,gt(n,t),gt(r,t))}}function bt(e,t){var n;try{n=t.onuncatched(e)}catch(e){}if(!1!==n)try{var r,o={promise:t,reason:e};if(a.document&&document.createEvent?((r=document.createEvent("Event")).initEvent("unhandledrejection",!0,!0),l(r,o)):a.CustomEvent&&l(r=new CustomEvent("unhandledrejection",{detail:o}),o),r&&a.dispatchEvent&&(dispatchEvent(r),!a.PromiseRejectionEvent&&a.onunhandledrejection))try{a.onunhandledrejection(r)}catch(e){}V&&r&&!r.defaultPrevented&&console.warn(`Unhandled rejection: ${e.stack||e}`)}catch(e){}}-1===(""+Oe).indexOf("[native code]")&&(at=ct=ce);var vt=Le.reject;function wt(e,t,n,r){if(e.idbdb&&(e._state.openComplete||Ie.letThrough||e._vip)){var o=e._createTransaction(t,n,e._dbSchema);try{o.create(),e._state.PR1398_maxLoop=3}catch(o){return o.name===re.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>wt(e,t,n,r)))):vt(o)}return o._promise(t,((e,t)=>st((()=>(Ie.trans=o,r(e,t,o)))))).then((e=>o._completion.then((()=>e))))}if(e._state.openComplete)return vt(new ie.DatabaseClosed(e._state.dbOpenError));if(!e._state.isBeingOpened){if(!e._options.autoOpen)return vt(new ie.DatabaseClosed);e.open().catch(ce)}return e._state.dbReadyPromise.then((()=>wt(e,t,n,r)))}const Ot=String.fromCharCode(65535),St="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Et=[],xt="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),_t=xt,jt=xt,kt=e=>!/(dexie\.js|dexie\.min\.js)/.test(e);function Pt(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}const $t={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function At(e){return"string"!=typeof e||/\./.test(e)?e=>e:t=>(void 0===t[e]&&e in t&&delete(t=R(t))[e],t)}class Ct{_trans(e,t,n){const r=this._tx||Ie.trans,o=this.name;function i(e,n,r){if(!r.schema[o])throw new ie.NotFound("Table "+o+" not part of transaction");return t(r.idbtrans,r)}const s=Ze();try{return r&&r.db===this.db?r===Ie.trans?r._promise(e,i,n):st((()=>r._promise(e,i,n)),{trans:r,transless:Ie.transless||Ie}):wt(this.db,e,[this.name],i)}finally{s&&Ye()}}get(e,t){return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",(t=>this.core.get({trans:t,key:e}).then((e=>this.hook.reading.fire(e))))).then(t)}where(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(u(e))return new this.db.WhereClause(this,`[${e.join("+")}]`);const t=c(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);const n=this.schema.indexes.concat(this.schema.primKey).filter((e=>e.compound&&t.every((t=>e.keyPath.indexOf(t)>=0))&&e.keyPath.every((e=>t.indexOf(e)>=0))))[0];if(n&&this.db._maxKey!==Ot)return this.where(n.name).equals(n.keyPath.map((t=>e[t])));!n&&V&&console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit of a compound index [${t.join("+")}]`);const{idxByName:r}=this.schema,o=this.db._deps.indexedDB;function i(e,t){try{return 0===o.cmp(e,t)}catch(e){return!1}}const[s,a]=t.reduce((([t,n],o)=>{const s=r[o],a=e[o];return[t||s,t||!s?Pt(n,s&&s.multi?e=>{const t=k(e,o);return u(t)&&t.some((e=>i(a,e)))}:e=>i(a,k(e,o))):n]}),[null,null]);return s?this.where(s.name).equals(e[s.keyPath]).filter(a):n?this.filter(a):this.where(t).equals("")}filter(e){return this.toCollection().and(e)}count(e){return this.toCollection().count(e)}offset(e){return this.toCollection().offset(e)}limit(e){return this.toCollection().limit(e)}each(e){return this.toCollection().each(e)}toArray(e){return this.toCollection().toArray(e)}toCollection(){return new this.db.Collection(new this.db.WhereClause(this))}orderBy(e){return new this.db.Collection(new this.db.WhereClause(this,u(e)?`[${e.join("+")}]`:e))}reverse(){return this.toCollection().reverse()}mapToClass(e){this.schema.mappedClass=e;const t=t=>{if(!t)return t;const n=Object.create(e.prototype);for(var r in t)if(d(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}defineClass(){return this.mapToClass((function(e){l(this,e)}))}add(e,t){const{auto:n,keyPath:r}=this.schema.primKey;let o=e;return r&&n&&(o=At(r)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[o]}))).then((e=>e.numFailures?Le.reject(e.failures[0]):e.lastResult)).then((t=>{if(r)try{P(e,r,t)}catch(e){}return t}))}update(e,t){if("object"!=typeof e||u(e))return this.where(":id").equals(e).modify(t);{const n=k(e,this.schema.primKey.keyPath);if(void 0===n)return vt(new ie.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?c(t).forEach((n=>{P(e,n,t[n])})):t(e,{value:e,primKey:n})}catch(e){}return this.where(":id").equals(n).modify(t)}}put(e,t){const{auto:n,keyPath:r}=this.schema.primKey;let o=e;return r&&n&&(o=At(r)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"put",values:[o],keys:null!=t?[t]:null}))).then((e=>e.numFailures?Le.reject(e.failures[0]):e.lastResult)).then((t=>{if(r)try{P(e,r,t)}catch(e){}return t}))}delete(e){return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"delete",keys:[e]}))).then((e=>e.numFailures?Le.reject(e.failures[0]):void 0))}clear(){return this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"deleteRange",range:$t}))).then((e=>e.numFailures?Le.reject(e.failures[0]):void 0))}bulkGet(e){return this._trans("readonly",(t=>this.core.getMany({keys:e,trans:t}).then((e=>e.map((e=>this.hook.reading.fire(e)))))))}bulkAdd(e,t,n){const r=Array.isArray(t)?t:void 0,o=(n=n||(r?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(t=>{const{auto:n,keyPath:i}=this.schema.primKey;if(i&&r)throw new ie.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(r&&r.length!==e.length)throw new ie.InvalidArgument("Arguments objects and keys must have the same length");const s=e.length;let a=i&&n?e.map(At(i)):e;return this.core.mutate({trans:t,type:"add",keys:r,values:a,wantResults:o}).then((({numFailures:e,results:t,lastResult:n,failures:r})=>{if(0===e)return o?t:n;throw new ne(`${this.name}.bulkAdd(): ${e} of ${s} operations failed`,r)}))}))}bulkPut(e,t,n){const r=Array.isArray(t)?t:void 0,o=(n=n||(r?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(t=>{const{auto:n,keyPath:i}=this.schema.primKey;if(i&&r)throw new ie.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(r&&r.length!==e.length)throw new ie.InvalidArgument("Arguments objects and keys must have the same length");const s=e.length;let a=i&&n?e.map(At(i)):e;return this.core.mutate({trans:t,type:"put",keys:r,values:a,wantResults:o}).then((({numFailures:e,results:t,lastResult:n,failures:r})=>{if(0===e)return o?t:n;throw new ne(`${this.name}.bulkPut(): ${e} of ${s} operations failed`,r)}))}))}bulkDelete(e){const t=e.length;return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"delete",keys:e}))).then((({numFailures:e,lastResult:n,failures:r})=>{if(0===e)return n;throw new ne(`${this.name}.bulkDelete(): ${e} of ${t} operations failed`,r)}))}}function Tt(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 s(e);r||(r=ye),o||(o=ce);var i={subscribers:[],fire:o,subscribe:function(e){-1===i.subscribers.indexOf(e)&&(i.subscribers.push(e),i.fire=r(i.fire,e))},unsubscribe:function(e){i.subscribers=i.subscribers.filter((function(t){return t!==e})),i.fire=i.subscribers.reduce(r,o)}};return t[e]=n[e]=i,i}function s(e){c(e).forEach((function(t){var n=e[t];if(u(n))i(t,e[t][0],e[t][1]);else{if("asap"!==n)throw new ie.InvalidArgument("Invalid event config");var r=i(t,ue,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];r.subscribers.forEach((function(e){x((function(){e.apply(null,t)}))}))}))}}))}}function Dt(e,t){return m(t).from({prototype:e}),t}function It(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function Rt(e,t){e.filter=Pt(e.filter,t)}function Nt(e,t,n){var r=e.replayFilter;e.replayFilter=r?()=>Pt(r(),t()):t,e.justLimit=n&&!r}function Mt(e,t){if(e.isPrimKey)return t.primaryKey;const n=t.getIndexByKeyPath(e.index);if(!n)throw new ie.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function Lt(e,t,n){const r=Mt(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:r,range:e.range}})}function Bt(e,t,n,r){const o=e.replayFilter?Pt(e.filter,e.replayFilter()):e.filter;if(e.or){const i={},s=(e,n,r)=>{if(!o||o(n,r,(e=>n.stop(e)),(e=>n.fail(e)))){var s=n.primaryKey,a=""+s;"[object ArrayBuffer]"===a&&(a=""+new Uint8Array(s)),d(i,a)||(i[a]=!0,t(e,n,r))}};return Promise.all([e.or._iterate(s,n),Ut(Lt(e,r,n),e.algorithm,s,!e.keysOnly&&e.valueMapper)])}return Ut(Lt(e,r,n),Pt(e.algorithm,o),t,!e.keysOnly&&e.valueMapper)}function Ut(e,t,n,r){var o=Je(r?(e,t,o)=>n(r(e),t,o):n);return e.then((e=>{if(e)return e.start((()=>{var n=()=>e.continue();t&&!t(e,(e=>n=e),(t=>{e.stop(t),n=ce}),(t=>{e.fail(t),n=ce}))||o(e.value,e,(e=>n=e)),n()}))}))}function zt(e,t){try{const n=Ft(e),r=Ft(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){const n=e.length,r=t.length,o=n<r?n:r;for(let n=0;n<o;++n)if(e[n]!==t[n])return e[n]<t[n]?-1:1;return n===r?0:n<r?-1:1}(Kt(e),Kt(t));case"Array":return function(e,t){const n=e.length,r=t.length,o=n<r?n:r;for(let n=0;n<o;++n){const r=zt(e[n],t[n]);if(0!==r)return r}return n===r?0:n<r?-1:1}(e,t)}}catch(e){}return NaN}function Ft(e){const t=typeof e;if("object"!==t)return t;if(ArrayBuffer.isView(e))return"binary";const n=L(e);return"ArrayBuffer"===n?"binary":n}function Kt(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}class Vt{_read(e,t){var n=this._ctx;return n.error?n.table._trans(null,vt.bind(null,n.error)):n.table._trans("readonly",e).then(t)}_write(e){var t=this._ctx;return t.error?t.table._trans(null,vt.bind(null,t.error)):t.table._trans("readwrite",e,"locked")}_addAlgorithm(e){var t=this._ctx;t.algorithm=Pt(t.algorithm,e)}_iterate(e,t){return Bt(this._ctx,e,t,this._ctx.table.core)}clone(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&l(n,e),t._ctx=n,t}raw(){return this._ctx.valueMapper=null,this}each(e){var t=this._ctx;return this._read((n=>Bt(t,e,n,t.table.core)))}count(e){return this._read((e=>{const t=this._ctx,n=t.table.core;if(It(t,!0))return n.count({trans:e,query:{index:Mt(t,n.schema),range:t.range}}).then((e=>Math.min(e,t.limit)));var r=0;return Bt(t,(()=>(++r,!1)),e,n).then((()=>r))})).then(e)}sortBy(e,t){const n=e.split(".").reverse(),r=n[0],o=n.length-1;function i(e,t){return t?i(e[n[t]],t-1):e[r]}var s="next"===this._ctx.dir?1:-1;function a(e,t){var n=i(e,o),r=i(t,o);return n<r?-s:n>r?s:0}return this.toArray((function(e){return e.sort(a)})).then(t)}toArray(e){return this._read((e=>{var t=this._ctx;if("next"===t.dir&&It(t,!0)&&t.limit>0){const{valueMapper:n}=t,r=Mt(t,t.table.core.schema);return t.table.core.query({trans:e,limit:t.limit,values:!0,query:{index:r,range:t.range}}).then((({result:e})=>n?e.map(n):e))}{const n=[];return Bt(t,(e=>n.push(e)),e,t.table.core).then((()=>n))}}),e)}offset(e){var t=this._ctx;return e<=0||(t.offset+=e,It(t)?Nt(t,(()=>{var t=e;return(e,n)=>0===t||(1===t?(--t,!1):(n((()=>{e.advance(t),t=0})),!1))})):Nt(t,(()=>{var t=e;return()=>--t<0}))),this}limit(e){return this._ctx.limit=Math.min(this._ctx.limit,e),Nt(this._ctx,(()=>{var t=e;return function(e,n,r){return--t<=0&&n(r),t>=0}}),!0),this}until(e,t){return Rt(this._ctx,(function(n,r,o){return!e(n.value)||(r(o),t)})),this}first(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)}last(e){return this.reverse().first(e)}filter(e){var t,n;return Rt(this._ctx,(function(t){return e(t.value)})),t=this._ctx,n=e,t.isMatch=Pt(t.isMatch,n),this}and(e){return this.filter(e)}or(e){return new this.db.WhereClause(this._ctx.table,e,this)}reverse(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this}desc(){return this.reverse()}eachKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.key,n)}))}eachUniqueKey(e){return this._ctx.unique="unique",this.eachKey(e)}eachPrimaryKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.primaryKey,n)}))}keys(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)}primaryKeys(e){var t=this._ctx;if("next"===t.dir&&It(t,!0)&&t.limit>0)return this._read((e=>{var n=Mt(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})})).then((({result:e})=>e)).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.primaryKey)})).then((function(){return n})).then(e)}uniqueKeys(e){return this._ctx.unique="unique",this.keys(e)}firstKey(e){return this.limit(1).keys((function(e){return e[0]})).then(e)}lastKey(e){return this.reverse().firstKey(e)}distinct(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var n={};return Rt(this._ctx,(function(e){var t=e.primaryKey.toString(),r=d(n,t);return n[t]=!0,!r})),this}modify(e){var t=this._ctx;return this._write((n=>{var r;if("function"==typeof e)r=e;else{var o=c(e),i=o.length;r=function(t){for(var n=!1,r=0;r<i;++r){var s=o[r],a=e[s];k(t,s)!==a&&(P(t,s,a),n=!0)}return n}}const s=t.table.core,{outbound:a,extractKey:u}=s.schema.primaryKey,l=this.db._options.modifyChunkSize||200,f=[];let p=0;const d=[],h=(e,t)=>{const{failures:n,numFailures:r}=t;p+=e-r;for(let e of c(n))f.push(n[e])};return this.clone().primaryKeys().then((o=>{const i=c=>{const f=Math.min(l,o.length-c);return s.getMany({trans:n,keys:o.slice(c,c+f),cache:"immutable"}).then((p=>{const d=[],y=[],g=a?[]:null,m=[];for(let e=0;e<f;++e){const t=p[e],n={value:R(t),primKey:o[c+e]};!1!==r.call(n,n.value,n)&&(null==n.value?m.push(o[c+e]):a||0===zt(u(t),u(n.value))?(y.push(n.value),a&&g.push(o[c+e])):(m.push(o[c+e]),d.push(n.value)))}const b=It(t)&&t.limit===1/0&&("function"!=typeof e||e===qt)&&{index:t.index,range:t.range};return Promise.resolve(d.length>0&&s.mutate({trans:n,type:"add",values:d}).then((e=>{for(let t in e.failures)m.splice(parseInt(t),1);h(d.length,e)}))).then((()=>(y.length>0||b&&"object"==typeof e)&&s.mutate({trans:n,type:"put",keys:g,values:y,criteria:b,changeSpec:"function"!=typeof e&&e}).then((e=>h(y.length,e))))).then((()=>(m.length>0||b&&e===qt)&&s.mutate({trans:n,type:"delete",keys:m,criteria:b}).then((e=>h(m.length,e))))).then((()=>o.length>c+f&&i(c+l)))}))};return i(0).then((()=>{if(f.length>0)throw new te("Error modifying one or more objects",f,p,d);return o.length}))}))}))}delete(){var e=this._ctx,t=e.range;return It(e)&&(e.isPrimKey&&!jt||3===t.type)?this._write((n=>{const{primaryKey:r}=e.table.core.schema,o=t;return e.table.core.count({trans:n,query:{index:r,range:o}}).then((t=>e.table.core.mutate({trans:n,type:"deleteRange",range:o}).then((({failures:e,lastResult:n,results:r,numFailures:o})=>{if(o)throw new te("Could not delete some values",Object.keys(e).map((t=>e[t])),t-o);return t-o}))))})):this.modify(qt)}}const qt=(e,t)=>t.value=null;function Ht(e,t){return e<t?-1:e===t?0:1}function Wt(e,t){return e>t?-1:e===t?0:1}function Gt(e,t,n){var r=e instanceof en?new e.Collection(e):e;return r._ctx.error=n?new n(t):new TypeError(t),r}function Zt(e){return new e.Collection(e,(()=>Jt(""))).limit(0)}function Yt(e,t,n,r,o,i){for(var s=Math.min(e.length,r.length),a=-1,c=0;c<s;++c){var u=t[c];if(u!==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):a>=0?e.substr(0,a)+t[a]+n.substr(a+1):null;o(e[c],u)<0&&(a=c)}return s<r.length&&"next"===i?e+n.substr(e.length):s<e.length&&"prev"===i?e.substr(0,n.length):a<0?null:e.substr(0,a)+r[a]+n.substr(a+1)}function Xt(e,t,n,r){var o,i,s,a,c,u,l,f=n.length;if(!n.every((e=>"string"==typeof e)))return Gt(e,"String expected.");function p(e){o=function(e){return"next"===e?e=>e.toUpperCase():e=>e.toLowerCase()}(e),i=function(e){return"next"===e?e=>e.toLowerCase():e=>e.toUpperCase()}(e),s="next"===e?Ht:Wt;var t=n.map((function(e){return{lower:i(e),upper:o(e)}})).sort((function(e,t){return s(e.lower,t.lower)}));a=t.map((function(e){return e.upper})),c=t.map((function(e){return e.lower})),u=e,l="next"===e?"":r}p("next");var d=new e.Collection(e,(()=>Qt(a[0],c[f-1]+r)));d._ondirectionchange=function(e){p(e)};var h=0;return d._addAlgorithm((function(e,n,r){var o=e.key;if("string"!=typeof o)return!1;var p=i(o);if(t(p,c,h))return!0;for(var d=null,y=h;y<f;++y){var g=Yt(o,p,a[y],c[y],s,u);null===g&&null===d?h=y+1:(null===d||s(d,g)>0)&&(d=g)}return n(null!==d?function(){e.continue(d+l)}:r),!1})),d}function Qt(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function Jt(e){return{type:1,lower:e,upper:e}}class en{get Collection(){return this._ctx.table.db.Collection}between(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)?Zt(this):new this.Collection(this,(()=>Qt(e,t,!n,!r)))}catch(e){return Gt(this,St)}}equals(e){return null==e?Gt(this,St):new this.Collection(this,(()=>Jt(e)))}above(e){return null==e?Gt(this,St):new this.Collection(this,(()=>Qt(e,void 0,!0)))}aboveOrEqual(e){return null==e?Gt(this,St):new this.Collection(this,(()=>Qt(e,void 0,!1)))}below(e){return null==e?Gt(this,St):new this.Collection(this,(()=>Qt(void 0,e,!1,!0)))}belowOrEqual(e){return null==e?Gt(this,St):new this.Collection(this,(()=>Qt(void 0,e)))}startsWith(e){return"string"!=typeof e?Gt(this,"String expected."):this.between(e,e+Ot,!0,!0)}startsWithIgnoreCase(e){return""===e?this.startsWith(e):Xt(this,((e,t)=>0===e.indexOf(t[0])),[e],Ot)}equalsIgnoreCase(e){return Xt(this,((e,t)=>e===t[0]),[e],"")}anyOfIgnoreCase(){var e=F.apply(z,arguments);return 0===e.length?Zt(this):Xt(this,((e,t)=>-1!==t.indexOf(e)),e,"")}startsWithAnyOfIgnoreCase(){var e=F.apply(z,arguments);return 0===e.length?Zt(this):Xt(this,((e,t)=>t.some((t=>0===e.indexOf(t)))),e,Ot)}anyOf(){const e=F.apply(z,arguments);let t=this._cmp;try{e.sort(t)}catch(e){return Gt(this,St)}if(0===e.length)return Zt(this);const n=new this.Collection(this,(()=>Qt(e[0],e[e.length-1])));n._ondirectionchange=n=>{t="next"===n?this._ascending:this._descending,e.sort(t)};let r=0;return n._addAlgorithm(((n,o,i)=>{const s=n.key;for(;t(s,e[r])>0;)if(++r,r===e.length)return o(i),!1;return 0===t(s,e[r])||(o((()=>{n.continue(e[r])})),!1)})),n}notEqual(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){const e=F.apply(z,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return Gt(this,St)}const t=e.reduce(((e,t)=>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})}inAnyRange(e,t){const n=this._cmp,r=this._ascending,o=this._descending,i=this._min,s=this._max;if(0===e.length)return Zt(this);if(!e.every((e=>void 0!==e[0]&&void 0!==e[1]&&r(e[0],e[1])<=0)))return Gt(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",ie.InvalidArgument);const a=!t||!1!==t.includeLowers,c=t&&!0===t.includeUppers;let u,l=r;function f(e,t){return l(e[0],t[0])}try{u=e.reduce((function(e,t){let r=0,o=e.length;for(;r<o;++r){const o=e[r];if(n(t[0],o[1])<0&&n(t[1],o[0])>0){o[0]=i(o[0],t[0]),o[1]=s(o[1],t[1]);break}}return r===o&&e.push(t),e}),[]),u.sort(f)}catch(e){return Gt(this,St)}let p=0;const d=c?e=>r(e,u[p][1])>0:e=>r(e,u[p][1])>=0,h=a?e=>o(e,u[p][0])>0:e=>o(e,u[p][0])>=0;let y=d;const g=new this.Collection(this,(()=>Qt(u[0][0],u[u.length-1][1],!a,!c)));return g._ondirectionchange=e=>{"next"===e?(y=d,l=r):(y=h,l=o),u.sort(f)},g._addAlgorithm(((e,t,n)=>{for(var o=e.key;y(o);)if(++p,p===u.length)return t(n),!1;return!!function(e){return!d(e)&&!h(e)}(o)||(0===this._cmp(o,u[p][1])||0===this._cmp(o,u[p][0])||t((()=>{l===r?e.continue(u[p][0]):e.continue(u[p][1])})),!1)})),g}startsWithAnyOf(){const e=F.apply(z,arguments);return e.every((e=>"string"==typeof e))?0===e.length?Zt(this):this.inAnyRange(e.map((e=>[e,e+Ot]))):Gt(this,"startsWithAnyOf() only works with strings")}}function tn(e){return Je((function(t){return nn(t),e(t.target.error),!1}))}function nn(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}const rn=Tt(null,"storagemutated");class on{_lock(){return E(!Ie.global),++this._reculock,1!==this._reculock||Ie.global||(Ie.lockOwnerFor=this),this}_unlock(){if(E(!Ie.global),0==--this._reculock)for(Ie.global||(Ie.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{ht(e[1],e[0])}catch(e){}}return this}_locked(){return this._reculock&&Ie.lockOwnerFor!==this}create(e){if(!this.mode)return this;const t=this.db.idbdb,n=this.db._state.dbOpenError;if(E(!this.idbtrans),!e&&!t)switch(n&&n.name){case"DatabaseClosedError":throw new ie.DatabaseClosed(n);case"MissingAPIError":throw new ie.MissingAPI(n.message,n);default:throw new ie.OpenFailed(n)}if(!this.active)throw new ie.TransactionInactive;return E(null===this._completion._state),(e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):t.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=Je((t=>{nn(t),this._reject(e.error)})),e.onabort=Je((t=>{nn(t),this.active&&this._reject(new ie.Abort(e.error)),this.active=!1,this.on("abort").fire(t)})),e.oncomplete=Je((()=>{this.active=!1,this._resolve(),"mutatedParts"in e&&rn.storagemutated.fire(e.mutatedParts)})),this}_promise(e,t,n){if("readwrite"===e&&"readwrite"!==this.mode)return vt(new ie.ReadOnly("Transaction is readonly"));if(!this.active)return vt(new ie.TransactionInactive);if(this._locked())return new Le(((r,o)=>{this._blockedFuncs.push([()=>{this._promise(e,t,n).then(r,o)},Ie])}));if(n)return st((()=>{var e=new Le(((e,n)=>{this._lock();const r=t(e,n,this);r&&r.then&&r.then(e,n)}));return e.finally((()=>this._unlock())),e._lib=!0,e}));var r=new Le(((e,n)=>{var r=t(e,n,this);r&&r.then&&r.then(e,n)}));return r._lib=!0,r}_root(){return this.parent?this.parent._root():this}waitFor(e){var t=this._root();const n=Le.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then((()=>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(((e,r)=>{n.then((n=>t._waitingQueue.push(Je(e.bind(null,n)))),(e=>t._waitingQueue.push(Je(r.bind(null,e))))).finally((()=>{t._waitingFor===o&&(t._waitingFor=null)}))}))}abort(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new ie.Abort))}table(e){const t=this._memoizedTables||(this._memoizedTables={});if(d(t,e))return t[e];const n=this.schema[e];if(!n)throw new ie.NotFound("Table "+e+" not part of transaction");const r=new this.db.Table(e,n,this);return r.core=this.db.core.table(e),t[e]=r,r}}function sn(e,t,n,r,o,i,s){return{name:e,keyPath:t,unique:n,multi:r,auto:o,compound:i,src:(n&&!s?"&":"")+(r?"*":"")+(o?"++":"")+an(t)}}function an(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function cn(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:j(n,(e=>[e.name,e]))}}let un=e=>{try{return e.only([[]]),un=()=>[[]],[[]]}catch(e){return un=()=>Ot,Ot}};function ln(e){return null==e?()=>{}:"string"==typeof e?function(e){return 1===e.split(".").length?t=>t[e]:t=>k(t,e)}(e):t=>k(t,e)}function fn(e){return[].slice.call(e)}let pn=0;function dn(e){return null==e?":id":"string"==typeof e?e:`[${e.join("+")}]`}function hn(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");const{lower:n,upper:r,lowerOpen:o,upperOpen:i}=e;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)}const{schema:o,hasGetAll:i}=function(e,t){const n=fn(e.objectStoreNames);return{schema:{name:e.name,tables:n.map((e=>t.objectStore(e))).map((e=>{const{keyPath:t,autoIncrement:n}=e,r=u(t),o=null==t,i={},s={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:o,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:ln(t)},indexes:fn(e.indexNames).map((t=>e.index(t))).map((e=>{const{name:t,unique:n,multiEntry:r,keyPath:o}=e,s={name:t,compound:u(o),keyPath:o,unique:n,multiEntry:r,extractKey:ln(o)};return i[dn(o)]=s,s})),getIndexByKeyPath:e=>i[dn(e)]};return i[":id"]=s.primaryKey,null!=t&&(i[dn(t)]=s.primaryKey),s}))},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),s=o.tables.map((e=>function(e){const t=e.name;return{name:t,schema:e,mutate:function({trans:e,type:n,keys:o,values:i,range:s}){return new Promise(((a,c)=>{a=Je(a);const u=e.objectStore(t),l=null==u.keyPath,f="put"===n||"add"===n;if(!f&&"delete"!==n&&"deleteRange"!==n)throw new Error("Invalid operation type: "+n);const{length:p}=o||i||{length:1};if(o&&i&&o.length!==i.length)throw new Error("Given keys array must have same length as given values array.");if(0===p)return a({numFailures:0,failures:{},results:[],lastResult:void 0});let d;const h=[],y=[];let g=0;const m=e=>{++g,nn(e)};if("deleteRange"===n){if(4===s.type)return a({numFailures:g,failures:y,results:[],lastResult:void 0});3===s.type?h.push(d=u.clear()):h.push(d=u.delete(r(s)))}else{const[e,t]=f?l?[i,o]:[i,null]:[o,null];if(f)for(let r=0;r<p;++r)h.push(d=t&&void 0!==t[r]?u[n](e[r],t[r]):u[n](e[r])),d.onerror=m;else for(let t=0;t<p;++t)h.push(d=u[n](e[t])),d.onerror=m}const b=e=>{const t=e.target.result;h.forEach(((e,t)=>null!=e.error&&(y[t]=e.error))),a({numFailures:g,failures:y,results:"delete"===n?o:h.map((e=>e.result)),lastResult:t})};d.onerror=e=>{m(e),b(e)},d.onsuccess=b}))},getMany:({trans:e,keys:n})=>new Promise(((r,o)=>{r=Je(r);const i=e.objectStore(t),s=n.length,a=new Array(s);let c,u=0,l=0;const f=e=>{const t=e.target;a[t._pos]=t.result,++l===u&&r(a)},p=tn(o);for(let e=0;e<s;++e)null!=n[e]&&(c=i.get(n[e]),c._pos=e,c.onsuccess=f,c.onerror=p,++u);0===u&&r(a)})),get:({trans:e,key:n})=>new Promise(((r,o)=>{r=Je(r);const i=e.objectStore(t).get(n);i.onsuccess=e=>r(e.target.result),i.onerror=tn(o)})),query:function(e){return n=>new Promise(((o,i)=>{o=Je(o);const{trans:s,values:a,limit:c,query:u}=n,l=c===1/0?void 0:c,{index:f,range:p}=u,d=s.objectStore(t),h=f.isPrimaryKey?d:d.index(f.name),y=r(p);if(0===c)return o({result:[]});if(e){const e=a?h.getAll(y,l):h.getAllKeys(y,l);e.onsuccess=e=>o({result:e.target.result}),e.onerror=tn(i)}else{let e=0;const t=a||!("openKeyCursor"in h)?h.openCursor(y):h.openKeyCursor(y),n=[];t.onsuccess=r=>{const i=t.result;return i?(n.push(a?i.value:i.primaryKey),++e===c?o({result:n}):void i.continue()):o({result:n})},t.onerror=tn(i)}}))}(i),openCursor:function({trans:e,values:n,query:o,reverse:i,unique:s}){return new Promise(((a,c)=>{a=Je(a);const{index:u,range:l}=o,f=e.objectStore(t),p=u.isPrimaryKey?f:f.index(u.name),d=i?s?"prevunique":"prev":s?"nextunique":"next",h=n||!("openKeyCursor"in p)?p.openCursor(r(l),d):p.openKeyCursor(r(l),d);h.onerror=tn(c),h.onsuccess=Je((t=>{const n=h.result;if(!n)return void a(null);n.___id=++pn,n.done=!1;const r=n.continue.bind(n);let o=n.continuePrimaryKey;o&&(o=o.bind(n));const i=n.advance.bind(n),s=()=>{throw new Error("Cursor not stopped")};n.trans=e,n.stop=n.continue=n.continuePrimaryKey=n.advance=()=>{throw new Error("Cursor not started")},n.fail=Je(c),n.next=function(){let e=1;return this.start((()=>e--?this.continue():this.stop())).then((()=>this))},n.start=e=>{const t=new Promise(((e,t)=>{e=Je(e),h.onerror=tn(t),n.fail=t,n.stop=t=>{n.stop=n.continue=n.continuePrimaryKey=n.advance=s,e(t)}})),a=()=>{if(h.result)try{e()}catch(e){n.fail(e)}else n.done=!0,n.start=()=>{throw new Error("Cursor behind last entry")},n.stop()};return h.onsuccess=Je((e=>{h.onsuccess=a,a()})),n.continue=r,n.continuePrimaryKey=o,n.advance=i,a(),t},a(n)}),c)}))},count({query:e,trans:n}){const{index:o,range:i}=e;return new Promise(((e,s)=>{const a=n.objectStore(t),c=o.isPrimaryKey?a:a.index(o.name),u=r(i),l=u?c.count(u):c.count();l.onsuccess=Je((t=>e(t.target.result))),l.onerror=tn(s)}))}}}(e))),a={};return s.forEach((e=>a[e.name]=e)),{stack:"dbcore",transaction:e.transaction.bind(e),table(e){if(!a[e])throw new Error(`Table '${e}' not found`);return a[e]},MIN_KEY:-1/0,MAX_KEY:un(t),schema:o}}function yn({_novip:e},t){const n=t.db,r=function(e,t,{IDBKeyRange:n,indexedDB:r},o){const i=function(e,t){return t.reduce(((e,{create:t})=>({...e,...t(e)})),e)}(hn(t,n,o),e.dbcore);return{dbcore:i}}(e._middlewares,n,e._deps,t);e.core=r.dbcore,e.tables.forEach((t=>{const n=t.name;e.core.schema.tables.some((e=>e.name===n))&&(t.core=e.core.table(n),e[n]instanceof e.Table&&(e[n].core=t.core))}))}function gn({_novip:e},t,n,r){n.forEach((n=>{const o=r[n];t.forEach((t=>{const r=v(t,n);(!r||"value"in r&&void 0===r.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?g(t,n,{get(){return this.table(n)},set(e){y(this,n,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[n]=new e.Table(n,o))}))}))}function mn({_novip:e},t){t.forEach((t=>{for(let n in t)t[n]instanceof e.Table&&delete t[n]}))}function bn(e,t){return e._cfg.version-t._cfg.version}function vn(e,t,n,r){const o=e._dbSchema,i=e._createTransaction("readwrite",e._storeNames,o);i.create(n),i._completion.catch(r);const s=i._reject.bind(i),a=Ie.transless||Ie;st((()=>{Ie.trans=i,Ie.transless=a,0===t?(c(o).forEach((e=>{On(n,e,o[e].primKey,o[e].indexes)})),yn(e,n),Le.follow((()=>e.on.populate.fire(i))).catch(s)):function({_novip:e},t,n,r){const o=[],i=e._versions;let s=e._dbSchema=En(0,e.idbdb,r),a=!1;return i.filter((e=>e._cfg.version>=t)).forEach((i=>{o.push((()=>{const o=s,u=i._cfg.dbschema;xn(e,o,r),xn(e,u,r),s=e._dbSchema=u;const l=wn(o,u);l.add.forEach((e=>{On(r,e[0],e[1].primKey,e[1].indexes)})),l.change.forEach((e=>{if(e.recreate)throw new ie.Upgrade("Not yet support for changing primary key");{const t=r.objectStore(e.name);e.add.forEach((e=>Sn(t,e))),e.change.forEach((e=>{t.deleteIndex(e.name),Sn(t,e)})),e.del.forEach((e=>t.deleteIndex(e)))}}));const f=i._cfg.contentUpgrade;if(f&&i._cfg.version>t){yn(e,r),n._memoizedTables={},a=!0;let t=$(u);l.del.forEach((e=>{t[e]=o[e]})),mn(e,[e.Transaction.prototype]),gn(e,[e.Transaction.prototype],c(t),t),n.schema=t;const i=K(f);let s;i&&at();const p=Le.follow((()=>{if(s=f(n),s&&i){var e=ct.bind(null,null);s.then(e,e)}}));return s&&"function"==typeof s.then?Le.resolve(s):p.then((()=>s))}})),o.push((t=>{a&&_t||function(e,t){[].slice.call(t.db.objectStoreNames).forEach((n=>null==e[n]&&t.db.deleteObjectStore(n)))}(i._cfg.dbschema,t),mn(e,[e.Transaction.prototype]),gn(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),n.schema=e._dbSchema}))})),function e(){return o.length?Le.resolve(o.shift()(n.idbtrans)).then(e):Le.resolve()}().then((()=>{var e,t;t=r,c(e=s).forEach((n=>{t.db.objectStoreNames.contains(n)||On(t,n,e[n].primKey,e[n].indexes)}))}))}(e,t,i,n).catch(s)}))}function wn(e,t){const n={del:[],add:[],change:[]};let r;for(r in e)t[r]||n.del.push(r);for(r in t){const o=e[r],i=t[r];if(o){const e={name:r,def:i,recreate:!1,del:[],add:[],change:[]};if(""+(o.primKey.keyPath||"")!=""+(i.primKey.keyPath||"")||o.primKey.auto!==i.primKey.auto&&!xt)e.recreate=!0,n.change.push(e);else{const t=o.idxByName,r=i.idxByName;let s;for(s in t)r[s]||e.del.push(s);for(s in r){const n=t[s],o=r[s];n?n.src!==o.src&&e.change.push(o):e.add.push(o)}(e.del.length>0||e.add.length>0||e.change.length>0)&&n.change.push(e)}}else n.add.push([r,i])}return n}function On(e,t,n,r){const o=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach((e=>Sn(o,e))),o}function Sn(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function En(e,t,n){const r={};return O(t.objectStoreNames,0).forEach((e=>{const t=n.objectStore(e);let o=t.keyPath;const i=sn(an(o),o||"",!1,!1,!!t.autoIncrement,o&&"string"!=typeof o,!0),s=[];for(let e=0;e<t.indexNames.length;++e){const n=t.index(t.indexNames[e]);o=n.keyPath;var a=sn(n.name,o,!!n.unique,!!n.multiEntry,!1,o&&"string"!=typeof o,!1);s.push(a)}r[e]=cn(e,i,s)})),r}function xn({_novip:e},t,n){const r=n.db.objectStoreNames;for(let o=0;o<r.length;++o){const i=r[o],s=n.objectStore(i);e._hasGetAll="getAll"in s;for(let e=0;e<s.indexNames.length;++e){const n=s.indexNames[e],r=s.index(n).keyPath,o="string"==typeof r?r:"["+O(r).join("+")+"]";if(t[i]){const e=t[i].idxByName[o];e&&(e.name=n,delete t[i].idxByName[o],t[i].idxByName[n]=e)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&a.WorkerGlobalScope&&a instanceof a.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}class _n{_parseStoresSpec(e,t){c(e).forEach((n=>{if(null!==e[n]){var r=e[n].split(",").map(((e,t)=>{const n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return sn(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),u(r),0===t)})),o=r.shift();if(o.multi)throw new ie.Schema("Primary key cannot be multi-valued");r.forEach((e=>{if(e.auto)throw new ie.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new ie.Schema("Index must have a name and cannot be an empty string")})),t[n]=cn(n,o,r)}}))}stores(e){const t=this.db;this._cfg.storesSource=this._cfg.storesSource?l(this._cfg.storesSource,e):e;const n=t._versions,r={};let o={};return n.forEach((e=>{l(r,e._cfg.storesSource),o=e._cfg.dbschema={},e._parseStoresSpec(r,o)})),t._dbSchema=o,mn(t,[t._allTables,t,t.Transaction.prototype]),gn(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],c(o),o),t._storeNames=c(o),this}upgrade(e){return this._cfg.contentUpgrade=ge(this._cfg.contentUpgrade||ce,e),this}}function jn(e,t){let n=e._dbNamesDB;return n||(n=e._dbNamesDB=new Wn("__dbnames",{addons:[],indexedDB:e,IDBKeyRange:t}),n.version(1).stores({dbnames:"name"})),n.table("dbnames")}function kn(e){return e&&"function"==typeof e.databases}function Pn(e){return st((function(){return Ie.letThrough=!0,e()}))}function $n(){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()}function An(e){var t=t=>e.next(t),n=o(t),r=o((t=>e.throw(t)));function o(e){return t=>{var o=e(t),i=o.value;return o.done?i:i&&"function"==typeof i.then?i.then(n,r):u(i)?Promise.all(i).then(n,r):n(i)}}return o(t)()}function Cn(e,t,n){var r=arguments.length;if(r<2)throw new ie.InvalidArgument("Too few arguments");for(var o=new Array(r-1);--r;)o[r-1]=arguments[r];return n=o.pop(),[e,C(o),n]}function Tn(e,t,n,r,o){return Le.resolve().then((()=>{const i=Ie.transless||Ie,s=e._createTransaction(t,n,e._dbSchema,r),a={trans:s,transless:i};if(r)s.idbtrans=r.idbtrans;else try{s.create(),e._state.PR1398_maxLoop=3}catch(r){return r.name===re.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>Tn(e,t,n,null,o)))):vt(r)}const c=K(o);let u;c&&at();const l=Le.follow((()=>{if(u=o.call(s,s),u)if(c){var e=ct.bind(null,null);u.then(e,e)}else"function"==typeof u.next&&"function"==typeof u.throw&&(u=An(u))}),a);return(u&&"function"==typeof u.then?Le.resolve(u).then((e=>s.active?e:vt(new ie.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn")))):l.then((()=>u))).then((e=>(r&&s._resolve(),s._completion.then((()=>e))))).catch((e=>(s._reject(e),vt(e))))}))}function Dn(e,t,n){const r=u(e)?e.slice():[e];for(let e=0;e<n;++e)r.push(t);return r}const In={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return{...e,table(t){const n=e.table(t),{schema:r}=n,o={},i=[];function s(e,t,n){const r=dn(e),a=o[r]=o[r]||[],c=null==e?0:"string"==typeof e?1:e.length,u=t>0,l={...n,isVirtual:u,keyTail:t,keyLength:c,extractKey:ln(e),unique:!u&&n.unique};return a.push(l),l.isPrimaryKey||i.push(l),c>1&&s(2===c?e[0]:e.slice(0,c-1),t+1,n),a.sort(((e,t)=>e.keyTail-t.keyTail)),l}const a=s(r.primaryKey.keyPath,0,r.primaryKey);o[":id"]=[a];for(const e of r.indexes)s(e.keyPath,0,e);function c(t){const n=t.query.index;return n.isVirtual?{...t,query:{index:n,range:(r=t.query.range,o=n.keyTail,{type:1===r.type?2:r.type,lower:Dn(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,o),lowerOpen:!0,upper:Dn(r.upper,r.upperOpen?e.MIN_KEY:e.MAX_KEY,o),upperOpen:!0})}}:t;var r,o}const u={...n,schema:{...r,primaryKey:a,indexes:i,getIndexByKeyPath:function(e){const t=o[dn(e)];return t&&t[0]}},count:e=>n.count(c(e)),query:e=>n.query(c(e)),openCursor(t){const{keyTail:r,isVirtual:o,keyLength:i}=t.query.index;return o?n.openCursor(c(t)).then((n=>n&&function(n){const o=Object.create(n,{continue:{value:function(o){null!=o?n.continue(Dn(o,t.reverse?e.MAX_KEY:e.MIN_KEY,r)):t.unique?n.continue(n.key.slice(0,i).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,r)):n.continue()}},continuePrimaryKey:{value(t,o){n.continuePrimaryKey(Dn(t,e.MAX_KEY,r),o)}},primaryKey:{get:()=>n.primaryKey},key:{get(){const e=n.key;return 1===i?e[0]:e.slice(0,i)}},value:{get:()=>n.value}});return o}(n))):n.openCursor(t)}};return u}}}};function Rn(e,t,n,r){return n=n||{},r=r||"",c(e).forEach((o=>{if(d(t,o)){var i=e[o],s=t[o];if("object"==typeof i&&"object"==typeof s&&i&&s){const e=L(i);e!==L(s)?n[r+o]=t[o]:"Object"===e?Rn(i,s,n,r+o+"."):i!==s&&(n[r+o]=t[o])}else i!==s&&(n[r+o]=t[o])}else n[r+o]=void 0})),c(t).forEach((o=>{d(e,o)||(n[r+o]=t[o])})),n}const Nn={stack:"dbcore",name:"HooksMiddleware",level:2,create:e=>({...e,table(t){const n=e.table(t),{primaryKey:r}=n.schema,o={...n,mutate(e){const o=Ie.trans,{deleting:i,creating:s,updating:a}=o.table(t).hook;switch(e.type){case"add":if(s.fire===ce)break;return o._promise("readwrite",(()=>c(e)),!0);case"put":if(s.fire===ce&&a.fire===ce)break;return o._promise("readwrite",(()=>c(e)),!0);case"delete":if(i.fire===ce)break;return o._promise("readwrite",(()=>c(e)),!0);case"deleteRange":if(i.fire===ce)break;return o._promise("readwrite",(()=>function(e){return u(e.trans,e.range,1e4)}(e)),!0)}return n.mutate(e);function c(e){const t=Ie.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?{...e,keys:o}:{...e}).type&&(e.values=[...e.values]),e.keys&&(e.keys=[...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((c=>{const u=o.map(((n,o)=>{const u=c[o],l={onerror:null,onsuccess:null};if("delete"===e.type)i.fire.call(l,n,u,t);else if("add"===e.type||void 0===u){const i=s.fire.call(l,n,e.values[o],t);null==n&&null!=i&&(n=i,e.keys[o]=n,r.outbound||P(e.values[o],r.keyPath,n))}else{const r=Rn(u,e.values[o]),i=a.fire.call(l,r,n,u,t);if(i){const t=e.values[o];Object.keys(i).forEach((e=>{d(t,e)?t[e]=i[e]:P(t,e,i[e])}))}}return l}));return n.mutate(e).then((({failures:t,results:n,numFailures:r,lastResult:i})=>{for(let r=0;r<o.length;++r){const i=n?n[r]:o[r],s=u[r];null==i?s.onerror&&s.onerror(t[r]):s.onsuccess&&s.onsuccess("put"===e.type&&c[r]?e.values[r]:i)}return{failures:t,results:n,numFailures:r,lastResult:i}})).catch((e=>(u.forEach((t=>t.onerror&&t.onerror(e))),Promise.reject(e))))}))}function u(e,t,o){return n.query({trans:e,values:!1,query:{index:r,range:t},limit:o}).then((({result:n})=>c({type:"delete",keys:n,trans:e}).then((r=>r.numFailures>0?Promise.reject(r.failures[0]):n.length<o?{failures:[],numFailures:0,lastResult:void 0}:u(e,{...t,lower:n[n.length-1],lowerOpen:!0},o)))))}}};return o}})};function Mn(e,t,n){try{if(!t)return null;if(t.keys.length<e.length)return null;const r=[];for(let o=0,i=0;o<t.keys.length&&i<e.length;++o)0===zt(t.keys[o],e[i])&&(r.push(n?R(t.values[o]):t.values[o]),++i);return r.length===e.length?r:null}catch(e){return null}}const Ln={stack:"dbcore",level:-1,create:e=>({table:t=>{const n=e.table(t);return{...n,getMany:e=>{if(!e.cache)return n.getMany(e);const t=Mn(e.keys,e.trans._cache,"clone"===e.cache);return t?Le.resolve(t):n.getMany(e).then((t=>(e.trans._cache={keys:e.keys,values:"clone"===e.cache?R(t):t},t)))},mutate:e=>("add"!==e.type&&(e.trans._cache=null),n.mutate(e))}}})};function Bn(e){return!("from"in e)}const Un=function(e,t){if(!this){const t=new Un;return e&&"d"in e&&l(t,e),t}l(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function zn(e,t,n){const r=zt(t,n);if(isNaN(r))return;if(r>0)throw RangeError();if(Bn(e))return l(e,{from:t,to:n,d:1});const o=e.l,i=e.r;if(zt(n,e.from)<0)return o?zn(o,t,n):e.l={from:t,to:n,d:1,l:null,r:null},Vn(e);if(zt(t,e.to)>0)return i?zn(i,t,n):e.r={from:t,to:n,d:1,l:null,r:null},Vn(e);zt(t,e.from)<0&&(e.from=t,e.l=null,e.d=i?i.d+1:1),zt(n,e.to)>0&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1);const s=!e.r;o&&!e.l&&Fn(e,o),i&&s&&Fn(e,i)}function Fn(e,t){Bn(t)||function e(t,{from:n,to:r,l:o,r:i}){zn(t,n,r),o&&e(t,o),i&&e(t,i)}(e,t)}function Kn(e){let t=Bn(e)?null:{s:0,n:e};return{next(e){const n=arguments.length>0;for(;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&zt(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||zt(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}}}}function Vn(e){var t,n;const 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){const t="r"===o?"l":"r",n={...e},r=e[o];e.from=r.from,e.to=r.to,e[o]=r[o],n[o]=r[t],e[t]=n,n.d=qn(n)}e.d=qn(e)}function qn({r:e,l:t}){return(e?t?Math.max(e.d,t.d):e.d:t?t.d:0)+1}h(Un.prototype,{add(e){return Fn(this,e),this},addKey(e){return zn(this,e,e),this},addKeys(e){return e.forEach((e=>zn(this,e,e))),this},[B](){return Kn(this)}});const Hn={stack:"dbcore",level:0,create:e=>{const t=e.schema.name,n=new Un(e.MIN_KEY,e.MAX_KEY);return{...e,table:r=>{const o=e.table(r),{schema:i}=o,{primaryKey:s}=i,{extractKey:a,outbound:l}=s,f={...o,mutate:e=>{const s=e.trans,a=s.mutatedParts||(s.mutatedParts={}),c=e=>{const n=`idb://${t}/${r}/${e}`;return a[n]||(a[n]=new Un)},l=c(""),f=c(":dels"),{type:p}=e;let[d,h]="deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[];const y=e.trans._cache;return o.mutate(e).then((e=>{if(u(d)){"delete"!==p&&(d=e.results),l.addKeys(d);const t=Mn(d,y);t||"add"===p||f.addKeys(d),(t||h)&&function(e,t,n,r){t.indexes.forEach((function(t){const o=e(t.name||"");function i(e){return null!=e?t.extractKey(e):null}const s=e=>t.multiEntry&&u(e)?e.forEach((e=>o.addKey(e))):o.addKey(e);(n||r).forEach(((e,t)=>{const o=n&&i(n[t]),a=r&&i(r[t]);0!==zt(o,a)&&(null!=o&&s(o),null!=a&&s(a))}))}))}(c,i,t,h)}else if(d){const e={from:d.lower,to:d.upper};f.add(e),l.add(e)}else l.add(n),f.add(n),i.indexes.forEach((e=>c(e.name).add(n)));return e}))}},p=({query:{index:t,range:n}})=>{var r,o;return[t,new Un(null!==(r=n.lower)&&void 0!==r?r:e.MIN_KEY,null!==(o=n.upper)&&void 0!==o?o:e.MAX_KEY)]},d={get:e=>[s,new Un(e.key)],getMany:e=>[s,(new Un).addKeys(e.keys)],count:p,query:p,openCursor:p};return c(d).forEach((e=>{f[e]=function(i){const{subscr:s}=Ie;if(s){const c=e=>{const n=`idb://${t}/${r}/${e}`;return s[n]||(s[n]=new Un)},u=c(""),f=c(":dels"),[p,h]=d[e](i);if(c(p.name||"").add(h),!p.isPrimaryKey){if("count"!==e){const t="query"===e&&l&&i.values&&o.query({...i,values:!1});return o[e].apply(this,arguments).then((n=>{if("query"===e){if(l&&i.values)return t.then((({result:e})=>(u.addKeys(e),n)));const e=i.values?n.result.map(a):n.result;i.values?u.addKeys(e):f.addKeys(e)}else if("openCursor"===e){const e=n,t=i.values;return e&&Object.create(e,{key:{get:()=>(f.addKey(e.primaryKey),e.key)},primaryKey:{get(){const t=e.primaryKey;return f.addKey(t),t}},value:{get:()=>(t&&u.addKey(e.primaryKey),e.value)}})}return n}))}f.add(n)}}return o[e].apply(this,arguments)}})),f}}}};class Wn{constructor(e,t){this._middlewares={},this.verno=0;const n=Wn.dependencies;this._options=t={addons:Wn.addons,autoOpen:!0,indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange,...t},this._deps={indexedDB:t.indexedDB,IDBKeyRange:t.IDBKeyRange};const{addons:r}=t;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;const o={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:ce,dbReadyPromise:null,cancelOpen:ce,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};var i;o.dbReadyPromise=new Le((e=>{o.dbReadyResolve=e})),o.openCanceller=new Le(((e,t)=>{o.cancelOpen=t})),this._state=o,this.name=e,this.on=Tt(this,"populate","blocked","versionchange","close",{ready:[ge,ce]}),this.on.ready.subscribe=S(this.on.ready.subscribe,(e=>(t,n)=>{Wn.vip((()=>{const r=this._state;if(r.openComplete)r.dbOpenError||Le.resolve().then(t),n&&e(t);else if(r.onReadyBeingFired)r.onReadyBeingFired.push(t),n&&e(t);else{e(t);const r=this;n||e((function e(){r.on.ready.unsubscribe(t),r.on.ready.unsubscribe(e)}))}}))})),this.Collection=(i=this,Dt(Vt.prototype,(function(e,t){this.db=i;let n=$t,r=null;if(t)try{n=t()}catch(e){r=e}const o=e._ctx,s=o.table,a=s.hook.reading.fire;this._ctx={table:s,index:o.index,isPrimKey:!o.index||s.schema.primKey.keyPath&&o.index===s.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!==ue?a:null}}))),this.Table=function(e){return Dt(Ct.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:Tt(null,{creating:[pe,ce],reading:[le,ue],updating:[he,ce],deleting:[de,ce]})}))}(this),this.Transaction=function(e){return Dt(on.prototype,(function(t,n,r,o,i){this.db=e,this.mode=t,this.storeNames=n,this.schema=r,this.chromeTransactionDurability=o,this.idbtrans=null,this.on=Tt(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(((e,t)=>{this._resolve=e,this._reject=t})),this._completion.then((()=>{this.active=!1,this.on.complete.fire()}),(e=>{var t=this.active;return this.active=!1,this.on.error.fire(e),this.parent?this.parent._reject(e):t&&this.idbtrans&&this.idbtrans.abort(),vt(e)}))}))}(this),this.Version=function(e){return Dt(_n.prototype,(function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(e){return Dt(en.prototype,(function(t,n,r){this.db=e,this._ctx={table:t,index:":id"===n?null:n,or:r};const o=e._deps.indexedDB;if(!o)throw new ie.MissingAPI;this._cmp=this._ascending=o.cmp.bind(o),this._descending=(e,t)=>o.cmp(t,e),this._max=(e,t)=>o.cmp(e,t)>0?e:t,this._min=(e,t)=>o.cmp(e,t)<0?e:t,this._IDBKeyRange=e._deps.IDBKeyRange}))}(this),this.on("versionchange",(e=>{e.newVersion>0?console.warn(`Another connection wants to upgrade database '${this.name}'. Closing db now to resume the upgrade.`):console.warn(`Another connection wants to delete database '${this.name}'. Closing db now to resume the delete request.`),this.close()})),this.on("blocked",(e=>{!e.newVersion||e.newVersion<e.oldVersion?console.warn(`Dexie.delete('${this.name}') was blocked`):console.warn(`Upgrade '${this.name}' blocked by other connection holding version ${e.oldVersion/10}`)})),this._maxKey=un(t.IDBKeyRange),this._createTransaction=(e,t,n,r)=>new this.Transaction(e,t,n,this._options.chromeTransactionDurability,r),this._fireOnBlocked=e=>{this.on("blocked").fire(e),Et.filter((e=>e.name===this.name&&e!==this&&!e._state.vcFired)).map((t=>t.on("versionchange").fire(e)))},this.use(In),this.use(Nn),this.use(Hn),this.use(Ln),this.vip=Object.create(this,{_vip:{value:!0}}),r.forEach((e=>e(this)))}version(e){if(isNaN(e)||e<.1)throw new ie.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new ie.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);const t=this._versions;var n=t.filter((t=>t._cfg.version===e))[0];return n||(n=new this.Version(e),t.push(n),t.sort(bn),n.stores({}),this._state.autoSchema=!1,n)}_whenReady(e){return this.idbdb&&(this._state.openComplete||Ie.letThrough||this._vip)?e():new Le(((e,t)=>{if(this._state.openComplete)return t(new ie.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void t(new ie.DatabaseClosed);this.open().catch(ce)}this._state.dbReadyPromise.then(e,t)})).then(e)}use({stack:e,create:t,level:n,name:r}){r&&this.unuse({stack:e,name:r});const o=this._middlewares[e]||(this._middlewares[e]=[]);return o.push({stack:e,create:t,level:null==n?10:n,name:r}),o.sort(((e,t)=>e.level-t.level)),this}unuse({stack:e,name:t,create:n}){return e&&this._middlewares[e]&&(this._middlewares[e]=this._middlewares[e].filter((e=>n?e.create!==n:!!t&&e.name!==t))),this}open(){return function(e){const t=e._state,{indexedDB:n}=e._deps;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((()=>t.dbOpenError?vt(t.dbOpenError):e));V&&(t.openCanceller._stackHolder=G()),t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;const r=t.openCanceller;function o(){if(t.openCanceller!==r)throw new ie.DatabaseClosed("db.open() was cancelled")}let i=t.dbReadyResolve,s=null,a=!1;return Le.race([r,("undefined"==typeof navigator?Le.resolve():$n()).then((()=>new Le(((r,i)=>{if(o(),!n)throw new ie.MissingAPI;const u=e.name,l=t.autoSchema?n.open(u):n.open(u,Math.round(10*e.verno));if(!l)throw new ie.MissingAPI;l.onerror=tn(i),l.onblocked=Je(e._fireOnBlocked),l.onupgradeneeded=Je((r=>{if(s=l.transaction,t.autoSchema&&!e._options.allowEmptyDB){l.onerror=nn,s.abort(),l.result.close();const e=n.deleteDatabase(u);e.onsuccess=e.onerror=Je((()=>{i(new ie.NoSuchDatabase(`Database ${u} doesnt exist`))}))}else{s.onerror=tn(i);var o=r.oldVersion>Math.pow(2,62)?0:r.oldVersion;a=o<1,e._novip.idbdb=l.result,vn(e,o/10,s,i)}}),i),l.onsuccess=Je((()=>{s=null;const n=e._novip.idbdb=l.result,o=O(n.objectStoreNames);if(o.length>0)try{const r=n.transaction(1===(i=o).length?i[0]:i,"readonly");t.autoSchema?function({_novip:e},t,n){e.verno=t.version/10;const r=e._dbSchema=En(0,t,n);e._storeNames=O(t.objectStoreNames,0),gn(e,[e._allTables],c(r),r)}(e,n,r):(xn(e,e._dbSchema,r),function(e,t){const n=wn(En(0,e.idbdb,t),e._dbSchema);return!(n.add.length||n.change.some((e=>e.add.length||e.change.length)))}(e,r)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),yn(e,r)}catch(e){}var i;Et.push(e),n.onversionchange=Je((n=>{t.vcFired=!0,e.on("versionchange").fire(n)})),n.onclose=Je((t=>{e.on("close").fire(t)})),a&&function({indexedDB:e,IDBKeyRange:t},n){!kn(e)&&"__dbnames"!==n&&jn(e,t).put({name:n}).catch(ce)}(e._deps,u),r()}),i)}))))]).then((()=>(o(),t.onReadyBeingFired=[],Le.resolve(Pn((()=>e.on.ready.fire(e.vip)))).then((function n(){if(t.onReadyBeingFired.length>0){let r=t.onReadyBeingFired.reduce(ge,ce);return t.onReadyBeingFired=[],Le.resolve(Pn((()=>r(e.vip)))).then(n)}}))))).finally((()=>{t.onReadyBeingFired=null,t.isBeingOpened=!1})).then((()=>e)).catch((n=>{t.dbOpenError=n;try{s&&s.abort()}catch(e){}return r===t.openCanceller&&e._close(),vt(n)})).finally((()=>{t.openComplete=!0,i()}))}(this)}_close(){const e=this._state,t=Et.indexOf(this);if(t>=0&&Et.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new Le((t=>{e.dbReadyResolve=t})),e.openCanceller=new Le(((t,n)=>{e.cancelOpen=n}))}close(){this._close();const e=this._state;this._options.autoOpen=!1,e.dbOpenError=new ie.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)}delete(){const e=arguments.length>0,t=this._state;return new Le(((n,r)=>{const o=()=>{this.close();var e=this._deps.indexedDB.deleteDatabase(this.name);e.onsuccess=Je((()=>{!function({indexedDB:e,IDBKeyRange:t},n){!kn(e)&&"__dbnames"!==n&&jn(e,t).delete(n).catch(ce)}(this._deps,this.name),n()})),e.onerror=tn(r),e.onblocked=this._fireOnBlocked};if(e)throw new ie.InvalidArgument("Arguments not allowed in db.delete()");t.isBeingOpened?t.dbReadyPromise.then(o):o()}))}backendDB(){return this.idbdb}isOpen(){return null!==this.idbdb}hasBeenClosed(){const e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name}hasFailed(){return null!==this._state.dbOpenError}dynamicallyOpened(){return this._state.autoSchema}get tables(){return c(this._allTables).map((e=>this._allTables[e]))}transaction(){const e=Cn.apply(this,arguments);return this._transaction.apply(this,e)}_transaction(e,t,n){let r=Ie.trans;r&&r.db===this&&-1===e.indexOf("!")||(r=null);const o=-1!==e.indexOf("?");let i,s;e=e.replace("!","").replace("?","");try{if(s=t.map((e=>{var t=e instanceof this.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 ie.InvalidArgument("Invalid transaction mode: "+e);i="readwrite"}if(r){if("readonly"===r.mode&&"readwrite"===i){if(!o)throw new ie.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");r=null}r&&s.forEach((e=>{if(r&&-1===r.storeNames.indexOf(e)){if(!o)throw new ie.SubTransaction("Table "+e+" not included in parent transaction.");r=null}})),o&&r&&!r.active&&(r=null)}}catch(e){return r?r._promise(null,((t,n)=>{n(e)})):vt(e)}const a=Tn.bind(null,this,i,s,r,n);return r?r._promise(i,a,"lock"):Ie.trans?ht(Ie.transless,(()=>this._whenReady(a))):this._whenReady(a)}table(e){if(!d(this._allTables,e))throw new ie.InvalidTable(`Table ${e} does not exist`);return this._allTables[e]}}const Gn="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";class Zn{constructor(e){this._subscribe=e}subscribe(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})}[Gn](){return this}}function Yn(e,t){return c(t).forEach((n=>{Fn(e[n]||(e[n]=new Un),t[n])})),e}let Xn;try{Xn={indexedDB:a.indexedDB||a.mozIndexedDB||a.webkitIndexedDB||a.msIndexedDB,IDBKeyRange:a.IDBKeyRange||a.webkitIDBKeyRange}}catch(a){Xn={indexedDB:null,IDBKeyRange:null}}const Qn=Wn;function Jn(e){let t=er;try{er=!0,rn.storagemutated.fire(e)}finally{er=t}}h(Qn,{...ae,delete:e=>new Qn(e,{addons:[]}).delete(),exists:e=>new Qn(e,{addons:[]}).open().then((e=>(e.close(),!0))).catch("NoSuchDatabaseError",(()=>!1)),getDatabaseNames(e){try{return function({indexedDB:e,IDBKeyRange:t}){return kn(e)?Promise.resolve(e.databases()).then((e=>e.map((e=>e.name)).filter((e=>"__dbnames"!==e)))):jn(e,t).toCollection().primaryKeys()}(Qn.dependencies).then(e)}catch(e){return vt(new ie.MissingAPI)}},defineClass:()=>function(e){l(this,e)},ignoreTransaction:e=>Ie.trans?ht(Ie.transless,e):e(),vip:Pn,async:function(e){return function(){try{var t=An(e.apply(this,arguments));return t&&"function"==typeof t.then?t:Le.resolve(t)}catch(e){return vt(e)}}},spawn:function(e,t,n){try{var r=An(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:Le.resolve(r)}catch(e){return vt(e)}},currentTransaction:{get:()=>Ie.trans||null},waitFor:function(e,t){const n=Le.resolve("function"==typeof e?Qn.ignoreTransaction(e):e).timeout(t||6e4);return Ie.trans?Ie.trans.waitFor(n):n},Promise:Le,debug:{get:()=>V,set:e=>{q(e,"dexie"===e?()=>!0:kt)}},derive:m,extend:l,props:h,override:S,Events:Tt,on:rn,liveQuery:function(e){return new Zn((t=>{const n=K(e);let r=!1,o={},i={};const s={get closed(){return r},unsubscribe:()=>{r=!0,rn.storagemutated.unsubscribe(f)}};t.start&&t.start(s);let a=!1,u=!1;function l(){return c(i).some((e=>o[e]&&function(e,t){const n=Kn(t);let r=n.next();if(r.done)return!1;let o=r.value;const i=Kn(e);let s=i.next(o.from),a=s.value;for(;!r.done&&!s.done;){if(zt(a.from,o.to)<=0&&zt(a.to,o.from)>=0)return!0;zt(o.from,a.from)<0?o=(r=n.next(a.from)).value:a=(s=i.next(o.from)).value}return!1}(o[e],i[e])))}const f=e=>{Yn(o,e),l()&&p()},p=()=>{if(a||r)return;o={};const c={},d=function(t){n&&at();const r=()=>st(e,{subscr:t,trans:null}),o=Ie.trans?ht(Ie.transless,r):r();return n&&o.then(ct,ct),o}(c);u||(rn("storagemutated",f),u=!0),a=!0,Promise.resolve(d).then((e=>{a=!1,r||(l()?p():(o={},i=c,t.next&&t.next(e)))}),(e=>{a=!1,t.error&&t.error(e),s.unsubscribe()}))};return p(),s}))},extendObservabilitySet:Yn,getByKeyPath:k,setByKeyPath:P,delByKeyPath:function(e,t){"string"==typeof t?P(e,t,void 0):"length"in t&&[].map.call(t,(function(t){P(e,t,void 0)}))},shallowClone:$,deepClone:R,getObjectDiff:Rn,cmp:zt,asap:x,minKey:-1/0,addons:[],connections:Et,errnames:re,dependencies:Xn,semVer:"3.2.3",version:"3.2.3".split(".").map((e=>parseInt(e))).reduce(((e,t,n)=>e+t/Math.pow(10,2*n)))}),Qn.maxKey=un(Qn.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(rn("storagemutated",(e=>{if(!er){let t;xt?(t=document.createEvent("CustomEvent"),t.initCustomEvent("x-storagemutated-1",!0,!0,e)):t=new CustomEvent("x-storagemutated-1",{detail:e}),er=!0,dispatchEvent(t),er=!1}})),addEventListener("x-storagemutated-1",(({detail:e})=>{er||Jn(e)})));let er=!1;if("undefined"!=typeof BroadcastChannel){const e=new BroadcastChannel("x-storagemutated-1");"function"==typeof e.unref&&e.unref(),rn("storagemutated",(t=>{er||e.postMessage(t)})),e.onmessage=e=>{e.data&&Jn(e.data)}}else if("undefined"!=typeof self&&"undefined"!=typeof navigator){rn("storagemutated",(e=>{try{er||("undefined"!=typeof localStorage&&localStorage.setItem("x-storagemutated-1",JSON.stringify({trig:Math.random(),changedParts:e})),"object"==typeof self.clients&&[...self.clients.matchAll({includeUncontrolled:!0})].forEach((t=>t.postMessage({type:"x-storagemutated-1",changedParts:e}))))}catch(e){}})),"undefined"!=typeof addEventListener&&addEventListener("storage",(e=>{if("x-storagemutated-1"===e.key){const t=JSON.parse(e.newValue);t&&Jn(t.changedParts)}}));const e=self.document&&navigator.serviceWorker;e&&e.addEventListener("message",(function({data:e}){e&&"x-storagemutated-1"===e.type&&Jn(e.changedParts)}))}function tr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Le.rejectionMapper=function(e,t){if(!e||e instanceof J||e instanceof TypeError||e instanceof SyntaxError||!e.name||!se[e.name])return e;var n=new se[e.name](t||e.message,e);return"stack"in e&&g(n,"stack",{get:function(){return this.inner.stack}}),n},q(V,kt);class nr extends Wn{constructor(){super("EsmOffline"),tr(this,"syncQueue",void 0),tr(this,"dynamicOfflineData",void 0),this.version(4).stores({syncQueue:"++id,userId,type,[userId+type]",dynamicOfflineData:"++id,type,identifier,*users,&[type+identifier]"}),this.syncQueue=this.table("syncQueue"),this.dynamicOfflineData=this.table("dynamicOfflineData")}}function rr(){return new nr}function or(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function ir(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){or(i,r,o,s,a,"next",e)}function a(e){or(i,r,o,s,a,"throw",e)}s(void 0)}))}}const sr={};function ar(){return Object.values(sr)}function cr(e){sr[e.id]&&console.warn(`[setupDynamicOfflineDataHandler] Another second handler with the ID "${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.`),sr[e.id]=e}function ur(e){return lr.apply(this,arguments)}function lr(){return(lr=ir((function*(e){const t=yield _r();return yield fr(t,e)}))).apply(this,arguments)}function fr(e,t){return pr.apply(this,arguments)}function pr(){return pr=ir((function*(e,t){const n=t?{type:t,users:e}:{users:e},r=new nr;return yield r.dynamicOfflineData.where(n).toArray().catch(Wn.errnames.DatabaseClosed,(()=>[]))})),pr.apply(this,arguments)}function dr(e,t){return hr.apply(this,arguments)}function hr(){return(hr=ir((function*(e,t){const n=yield _r();return yield yr(n,e,t)}))).apply(this,arguments)}function yr(e,t,n){return gr.apply(this,arguments)}function gr(){return gr=ir((function*(e,t,n){const r=new nr,o=yield r.dynamicOfflineData.get({type:t,identifier:n}).catch(Wn.errnames.DatabaseClosed,(()=>{}));o?o.users.includes(e)||(yield r.dynamicOfflineData.update(o.id,{users:[...o.users,e]}).catch(Wn.errnames.DatabaseClosed)):yield r.dynamicOfflineData.add({users:[e],type:t,identifier:n}).catch(Wn.errnames.DatabaseClosed)})),gr.apply(this,arguments)}function mr(e,t){return br.apply(this,arguments)}function br(){return(br=ir((function*(e,t){const n=yield _r();return yield vr(n,e,t)}))).apply(this,arguments)}function vr(e,t,n){return wr.apply(this,arguments)}function wr(){return wr=ir((function*(e,t,n){const r=new nr,o=yield r.dynamicOfflineData.get({type:t,identifier:n,users:e}).catch(Wn.errnames.DatabaseClosed,(()=>{}));o&&(o.users.length>1?yield r.dynamicOfflineData.update(o.id,{users:o.users.filter((t=>t!==e))}).catch(Wn.errnames.DatabaseClosed):yield r.dynamicOfflineData.delete(o.id).catch(Wn.errnames.DatabaseClosed))})),wr.apply(this,arguments)}function Or(e,t){return Sr.apply(this,arguments)}function Sr(){return Sr=ir((function*(e,t){const n=yield ur(e);var r;yield Promise.all(n.map((r=ir((function*(e){return Er(e.type,e.identifier,t)})),function(e){return r.apply(this,arguments)})))})),Sr.apply(this,arguments)}function Er(e,t,n){return xr.apply(this,arguments)}function xr(){return xr=ir((function*(e,t,n){yield dr(e,t);const r=new nr,o=yield _r(),i=yield r.dynamicOfflineData.get({type:e,identifier:t}).catch(Wn.errnames.DatabaseClosed,(()=>{})),s=ar().filter((t=>t.type===e));if(!i)return;const a=yield Promise.all(s.map((c=ir((function*(e){try{return e.sync(t,n),{id:e.id,error:void 0}}catch(t){var r,o;const n=null!==(o=null===(r=t.message)||void 0===r?void 0:r.toString())&&void 0!==o?o:t.toString();return{id:e.id,error:n}}})),function(e){return c.apply(this,arguments)})));var c;const u=a.filter((e=>!e.error)).map((e=>e.id)),l=a.filter((e=>e.error)).map((e=>e.id)),f=a.filter((e=>e.error)).map((e=>({handlerId:e.id,message:e.error}))),p={syncedOn:new Date,syncedBy:o,succeededHandlers:u,erroredHandlers:l,errors:f};i.id&&(yield r.dynamicOfflineData.update(i.id,{syncState:p}).catch(Wn.errnames.DatabaseClosed))})),xr.apply(this,arguments)}function _r(){return jr.apply(this,arguments)}function jr(){return(jr=ir((function*(){const e=(yield(0,s.getLoggedInUser)()).uuid;if(!e)throw new Error("Using the dynamic offline data API requires a logged in user.");return e}))).apply(this,arguments)}function kr(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}const Pr=(0,i.createGlobalStore)("offline-patients",{offlinePatientDataSyncState:{},handlers:{}});function $r(){return Dr(),Pr}function Ar(e,t){Dr(),cr({type:"patient",displayName:t.displayName,id:e,isSynced:()=>Promise.resolve(!0),sync:(e,n)=>t.onOfflinePatientAdded({patientUuid:e,signal:null!=n?n:(new AbortController).signal})})}function Cr(e){return Tr.apply(this,arguments)}function Tr(){return Tr=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){kr(i,r,o,s,a,"next",e)}function a(e){kr(i,r,o,s,a,"throw",e)}s(void 0)}))}}((function*(e){Dr(),yield Er("patient",e)})),Tr.apply(this,arguments)}function Dr(){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.")}try{self["workbox:window:6.5.3"]&&_()}catch(u){}function Ir(e,t){return new Promise((function(n){var r=new MessageChannel;r.port1.onmessage=function(e){n(e.data)},e.postMessage(t,[r.port2])}))}function Rr(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}try{self["workbox:core:6.5.3"]&&_()}catch(u){}var Nr=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t,e.reject=n}))};function Mr(e,t){var n=location.href;return new URL(e,n).href===new URL(t,n).href}var Lr=function(e,t){this.type=e,Object.assign(this,t)};function Br(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function Ur(){}var zr={type:"SKIP_WAITING"};function Fr(e,t){if(!t)return e&&e.then?e.then(Ur):Promise.resolve()}let Kr;function Vr(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function qr(e){return Hr.apply(this,arguments)}function Hr(){return Hr=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){Vr(i,r,o,s,a,"next",e)}function a(e){Vr(i,r,o,s,a,"throw",e)}s(void 0)}))}}((function*(e){const t=yield null!=Kr?Kr:Promise.resolve(void 0);return t?yield t.messageSW(e):{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."}})),Hr.apply(this,arguments)}!function(e){var t,n;function r(t,n){var r,o;return void 0===n&&(n={}),(r=e.call(this)||this).nn={},r.tn=0,r.rn=new Nr,r.en=new Nr,r.on=new Nr,r.un=0,r.an=new Set,r.cn=function(){var e=r.fn,t=e.installing;r.tn>0||!Mr(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,s={sw:n,isExternal:i,originalEvent:e};!i&&r.mn&&(s.isUpdate=!0),r.dispatchEvent(new Lr(o,s)),"installed"===o?r.wn=self.setTimeout((function(){"installed"===o&&t.waiting===n&&r.dispatchEvent(new Lr("waiting",s))}),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 Lr("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 Br(r.getSW(),(function(){r.an.has(o)&&r.dispatchEvent(new Lr("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=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var o,i=r.prototype;i.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 Fr(new Promise((function(e){return window.addEventListener("load",e)})))}),(function(){return r.mn=Boolean(navigator.serviceWorker.controller),r.yn=r.pn(),Br(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&&Mr(t.scriptURL,r.sn.toString())&&(r.hn=t,Promise.resolve().then((function(){r.dispatchEvent(new Lr("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)}},i.update=function(){try{return this.fn?Fr(this.fn.update()):void 0}catch(e){return Promise.reject(e)}},i.getSW=function(){return void 0!==this.hn?Promise.resolve(this.hn):this.rn.promise},i.messageSW=function(e){try{return Br(this.getSW(),(function(t){return Ir(t,e)}))}catch(e){return Promise.reject(e)}},i.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&Ir(this.fn.waiting,zr)},i.pn=function(){var e=navigator.serviceWorker.controller;return e&&Mr(e.scriptURL,this.sn.toString())?e:void 0},i.bn=function(){try{var e=this;return function(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}((function(){return Br(navigator.serviceWorker.register(e.sn,e.nn),(function(t){return e.un=performance.now(),t}))}),(function(e){throw e}))}catch(e){return Promise.reject(e)}},(o=[{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)}}(r.prototype,o)}(function(){function e(){this.Pn=new Map}var 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 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}}(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}());const Wr="x-omrs-offline-response-body",Gr="x-omrs-offline-response-status",Zr="x-omrs-offline-caching-strategy",Yr={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Xr;const Qr=new Uint8Array(16);function Jr(){if(!Xr&&(Xr="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Xr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Xr(Qr)}const eo=[];for(let e=0;e<256;++e)eo.push((e+256).toString(16).slice(1));const to=function(e,t,n){if(Yr.randomUUID&&!t&&!e)return Yr.randomUUID();const r=(e=e||{}).random||(e.rng||Jr)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return(eo[e[t+0]]+eo[e[t+1]]+eo[e[t+2]]+eo[e[t+3]]+"-"+eo[e[t+4]]+eo[e[t+5]]+"-"+eo[e[t+6]]+eo[e[t+7]]+"-"+eo[e[t+8]]+eo[e[t+9]]+"-"+eo[e[t+10]]+eo[e[t+11]]+eo[e[t+12]]+eo[e[t+13]]+eo[e[t+14]]+eo[e[t+15]]).toLowerCase()}(r)},no="OFFLINE+";function ro(){return no+to()}function oo(e){return e.startsWith(no)}function io(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function so(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){io(i,r,o,s,a,"next",e)}function a(e){io(i,r,o,s,a,"throw",e)}s(void 0)}))}}const ao=new nr,co={};function uo(){return lo.apply(this,arguments)}function lo(){return(lo=so((function*(){const e=yield(0,s.getLoggedInUser)();return(null==e?void 0:e.uuid)||"*"}))).apply(this,arguments)}function fo(){return(fo=so((function*(e,t,n,r){const o=r&&r.id;return void 0!==o&&(yield ao.syncQueue.where({type:t,userId:e}).filter((e=>(null==e?void 0:e.descriptor.id)===o)).delete().catch(Wn.errnames.DatabaseClosed)),yield ao.syncQueue.add({type:t,content:n,userId:e,descriptor:r||{},createdOn:new Date}).catch(Wn.errnames.DatabaseClosed,(()=>-1))}))).apply(this,arguments)}function po(e,t,n){return ho.apply(this,arguments)}function ho(){return ho=so((function*(e,t,n){const r=yield uo();return yield function(e,t,n,r){return fo.apply(this,arguments)}(r,e,t,n)})),ho.apply(this,arguments)}function yo(){return(yo=so((function*(e,t){return(yield go(e,t)).map((e=>e.content))}))).apply(this,arguments)}function go(e,t){return mo.apply(this,arguments)}function mo(){return(mo=so((function*(e,t){const n=t?{type:t,userId:e}:{userId:e};return yield ao.syncQueue.where(n).toArray().catch(Wn.errnames.DatabaseClosed,(()=>[]))}))).apply(this,arguments)}function bo(e){return vo.apply(this,arguments)}function vo(){return vo=so((function*(e){const t=yield uo();return yield function(e,t){return yo.apply(this,arguments)}(t,e)})),vo.apply(this,arguments)}function wo(e){return Oo.apply(this,arguments)}function Oo(){return(Oo=so((function*(e){const t=yield uo();return yield go(t,e)}))).apply(this,arguments)}function So(e){return Eo.apply(this,arguments)}function Eo(){return(Eo=so((function*(e){return yield ao.syncQueue.get(e).catch(Wn.errnames.DatabaseClosed,(()=>{}))}))).apply(this,arguments)}function xo(e){var t;return!!(null===(t=co[e])||void 0===t?void 0:t.options.onBeginEditSyncItem)}function _o(e){return jo.apply(this,arguments)}function jo(){return(jo=so((function*(e){var t;const n=yield So(e);if(!n)throw new Error(`No sync item with the ID ${e} exists.`);const r=null===(t=co[n.type])||void 0===t?void 0:t.options.onBeginEditSyncItem;if(!r)throw new Error(`A sync item with the ID ${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 "${n.type}" supports editing items.`);r(n)}))).apply(this,arguments)}function ko(e){return Po.apply(this,arguments)}function Po(){return(Po=so((function*(e){yield ao.syncQueue.delete(e).catch(Wn.errnames.DatabaseClosed)}))).apply(this,arguments)}function $o(e,t,n,r={}){co[e]={type:e,dependsOn:t,process:n,options:r}}(0,i.createGlobalStore)("offline-synchronization",{})},5492:(e,t,n)=>{function r(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var s=e.apply(t,n);function a(e){r(s,o,i,a,c,"next",e)}function c(e){r(s,o,i,a,c,"throw",e)}a(void 0)}))}}function i(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){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){i(e,t,n[t])}))}return e}e=n.nmd(e),System.register(["react","@openmrs/esm-config","@openmrs/esm-extensions","@openmrs/esm-globals","react-dom","i18next","react-i18next","@openmrs/esm-api","dayjs"],(function(r,i){var a={},c={},u={},l={},f={},p={},d={},h={},y={};return Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(f,"__esModule",{value:!0}),{setters:[function(e){Object.keys(e).forEach((function(t){a[t]=e[t]}))},function(e){c.getConfigStore=e.getConfigStore,c.getExtensionConfigFromStore=e.getExtensionConfigFromStore,c.getExtensionsConfigStore=e.getExtensionsConfigStore,c.interpolateUrl=e.interpolateUrl,c.navigate=e.navigate},function(e){u.getConnectedExtensions=e.getConnectedExtensions,u.getExtensionInternalStore=e.getExtensionInternalStore,u.getExtensionStore=e.getExtensionStore,u.registerExtensionSlot=e.registerExtensionSlot,u.renderExtension=e.renderExtension},function(e){l.subscribeConnectivityChanged=e.subscribeConnectivityChanged},function(e){Object.keys(e).forEach((function(t){f[t]=e[t]}))},function(e){p.default=e.default},function(e){d.I18nextProvider=e.I18nextProvider},function(e){h.defaultVisitCustomRepresentation=e.defaultVisitCustomRepresentation,h.fetchCurrentPatient=e.fetchCurrentPatient,h.getCurrentUser=e.getCurrentUser,h.getLocations=e.getLocations,h.getSessionStore=e.getSessionStore,h.getVisitTypes=e.getVisitTypes,h.openmrsFetch=e.openmrsFetch,h.userHasAccess=e.userHasAccess},function(e){y.default=e.default}],execute:function(){r((()=>{var r={403:()=>{System.register([],(function(e,t){return{execute:function(){e((()=>{var e={968:(e,t,n)=>{const r=n(577).R;t.s=function(e){if(e||(e=1),!n.y.meta||!n.y.meta.url)throw console.error("__system_context__",n.y),Error("systemjs-webpack-interop was provided an unknown SystemJS context. Expected context.meta.url, but none was provided");n.p=r(n.y.meta.url,e)}},577:(e,t,n)=>{t.R=function(e,t){var n=document.createElement("a");n.href=e;for(var r="/"===n.pathname[0]?n.pathname:"/"+n.pathname,o=0,i=r.length;o!==t&&i>=0;)"/"===r[--i]&&o++;if(o!==t)throw Error("systemjs-webpack-interop: rootDirectoryLevel ("+t+") is greater than the number of directories ("+o+") in the URL path "+e);var s=r.slice(0,i+1);return n.protocol+"//"+n.host+s},Number.isInteger}},n={};function r(t){var o=n[t];if(void 0!==o)return o.exports;var i=n[t]={exports:{}};return e[t](i,i.exports,r),i.exports}r.y=t,r.d=(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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&!e;)e=n[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})();var o={};return(0,r(968).s)(1),(()=>{"use strict";r.r(o),r.d(o,{createAppState:()=>a,createGlobalStore:()=>i,getAppState:()=>c,getGlobalStore:()=>s,subscribeTo:()=>u});const e=e=>{let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!=typeof o)?o:Object.assign({},t,o),n.forEach((n=>n(t,e)))}},o=()=>t,i={setState:r,getState:o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{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},t=t=>t?e(t):e,n={};function i(e,r){const o=n[e];if(o)return o.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):o.value.setState(r,!0),o.active=!0,o.value;{const o=t()((()=>r));return n[e]={value:o,active:!0},o}}function s(e,r){const o=n[e];if(!o){const o=t()((()=>null!=r?r:{}));return n[e]={value:o,active:!1},o}return o.value}function a(e){return i("app",e)}function c(){return s("app",{})}function u(e,t,n){let r=t(e.getState());return e.subscribe((e=>{const o=t(e);o!==r&&(r=o,n(o))}))}})(),o})())}}}))},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)}}}()},645:(e,t,n)=>{"use strict";var r=n(493);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},968:(e,t,n)=>{const r=n(577).R;t.s=function(e){if(e||(e=1),!n.y.meta||!n.y.meta.url)throw console.error("__system_context__",n.y),Error("systemjs-webpack-interop was provided an unknown SystemJS context. Expected context.meta.url, but none was provided");n.p=r(n.y.meta.url,e)}},577:(e,t,n)=>{t.R=function(e,t){var n=document.createElement("a");n.href=e;for(var r="/"===n.pathname[0]?n.pathname:"/"+n.pathname,o=0,i=r.length;o!==t&&i>=0;)"/"===r[--i]&&o++;if(o!==t)throw Error("systemjs-webpack-interop: rootDirectoryLevel ("+t+") is greater than the number of directories ("+o+") in the URL path "+e);var s=r.slice(0,i+1);return n.protocol+"//"+n.host+s},Number.isInteger},173:(e,t,n)=>{"use strict";var r=n(954),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,s=r.useEffect,a=r.useLayoutEffect,c=r.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,l=r[1];return a((function(){o.value=n,o.getSnapshot=t,u(o)&&l({inst:o})}),[e,n,t]),s((function(){return u(o)&&l({inst:o}),e((function(){u(o)&&l({inst:o})}))}),[e]),c(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:l},374:(e,t,n)=>{"use strict";e.exports=n(173)},766:e=>{"use strict";e.exports=h},824:e=>{"use strict";e.exports=c},45:e=>{"use strict";e.exports=u},728:e=>{"use strict";e.exports=l},688:e=>{"use strict";e.exports=y},64:e=>{"use strict";e.exports=p},954:e=>{"use strict";e.exports=a},493:e=>{"use strict";e.exports=f},281:e=>{"use strict";e.exports=d}},g={};function m(e){var t=g[e];if(void 0!==t)return t.exports;var n=g[e]={exports:{}};return r[e].call(n.exports,n,n.exports,m),n.exports}m.y=i,m.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return m.d(t,{a:t}),t},m.d=(e,t)=>{for(var n in t)m.o(t,n)&&!m.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},m.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),m.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),m.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;m.g.importScripts&&(e=m.g.location+"");var t=m.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&!e;)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),m.p=e})();var b={};return(0,m(968).s)(1),(()=>{"use strict";m.r(b),m.d(b,{ComponentContext:()=>i,ConfigurableLink:()=>u,Extension:()=>y,ExtensionSlot:()=>xt,UserHasAccess:()=>En,createUseStore:()=>f,getAsyncExtensionLifecycle:()=>Xt,getAsyncLifecycle:()=>Zt,getLifecycle:()=>Gt,getSyncLifecycle:()=>Yt,isDesktop:()=>wn,openmrsComponentDecorator:()=>Wt,useAssignedExtensionIds:()=>Qt,useAssignedExtensions:()=>bt,useBodyScrollLock:()=>Jt,useConfig:()=>rn,useConnectedExtensions:()=>vt,useConnectivity:()=>v,useExtensionInternalStore:()=>hn,useExtensionSlot:()=>wt,useExtensionSlotMeta:()=>yn,useExtensionStore:()=>gn,useForceUpdate:()=>mn,useLayoutType:()=>vn,useLocations:()=>On,useOnClickOutside:()=>Sn,usePagination:()=>kr,usePatient:()=>dn,useSession:()=>jn,useStore:()=>An,useStoreWithActions:()=>Cn,useVisit:()=>xr,useVisitTypes:()=>_r});var r=m(954);const i=r.default.createContext({moduleName:""});var a=m(824);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 u(e){var{to:t,templateParams:n,children:o}=e,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 r.default.createElement("a",function(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}({onClick:e=>function(e,t,n){e.metaKey||e.ctrlKey||e.shiftKey||0!=e.button||(e.preventDefault(),(0,a.navigate)({to:t,templateParams:n}))}(e,t,n),href:(0,a.interpolateUrl)(t,n)},i),o)}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e){return function(t){const[n,o]=(0,r.useState)(e.getState());(0,r.useEffect)((()=>e.subscribe((e=>o(e)))),[]);let i=(0,r.useMemo)((()=>t?function(e,t){"function"==typeof t&&(t=t(e));const n={};for(let r in t)n[r]=()=>{const n=arguments;e.setState((e=>{let o=[e];for(let e=0;e<n.length;e++)o.push(n[e]);return t[r](o)}))};return n}(e,t):{}),[t]);return function(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){l(e,t,n[t])}))}return e}({},n,i)}}var p=m(45);function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(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){d(e,t,n[t])}))}return e}const y=e=>{var{state:t,children:n,wrap:o}=e,s=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"]);const[a,c]=(0,r.useState)(),{extension:u}=(0,r.useContext)(i),l=(0,r.useRef)(null),f=(0,r.useRef)(null);(0,r.useEffect)((()=>{o&&console.warn(`'wrap' prop of Extension is being used ${(null==u?void 0:u.extensionId)?`by ${u.extensionId} in ${u.extensionSlotName}`:""}. This will be removed in a future release.`)}),[]);const d=(0,r.useCallback)((e=>{c(e)}),[c]);(0,r.useEffect)((()=>{if(null!=a&&u&&!l.current)return(0,p.renderExtension)(a,u.extensionSlotName,u.extensionSlotModuleName,u.extensionId,void 0,t).then((e=>{l.current=e})),()=>{if(l&&l.current)switch(l.current.getStatus()){case"MOUNTING":l.current.mountPromise.then(l.current.unmount);break;case"MOUNTED":l.current.unmount();break;case"UPDATING":f.current&&f.current.then((()=>{l.current&&"MOUNTED"===l.current.getStatus()&&l.current.unmount()}))}}}),[null==u?void 0:u.extensionSlotName,null==u?void 0:u.extensionId,null==u?void 0:u.extensionSlotModuleName,a]),(0,r.useEffect)((()=>(l.current&&l.current.update&&("MOUNTED"===l.current.getStatus()?l.current.update(h({},t)):"MOUNTING"===l.current.getStatus()&&l.current.mountPromise.then((()=>{l.current&&l.current.update&&(f.current=l.current.update(h({},t)))}))),()=>{f.current=null})),[t]);const y=r.default.createElement("div",h({ref:d,"data-extension-id":null==u?void 0:u.extensionId,style:{position:"relative"}},s));return"function"!=typeof n||r.default.isValidElement(n)?u&&o?o(y,u):y:r.default.createElement(r.default.Fragment,null,n(y,u))};var g=m(728);function v(){let[e,t]=(0,r.useState)(window.navigator.onLine);return(0,r.useEffect)((()=>(0,g.subscribeConnectivityChanged)((({online:e})=>t(e)))),[]),e}const w=function(e,t){return e===t||e!=e&&t!=t},O=function(e,t){for(var n=e.length;n--;)if(w(e[n][0],t))return n;return-1};var S=Array.prototype.splice;function E(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])}}E.prototype.clear=function(){this.__data__=[],this.size=0},E.prototype.delete=function(e){var t=this.__data__,n=O(t,e);return!(n<0||(n==t.length-1?t.pop():S.call(t,n,1),--this.size,0))},E.prototype.get=function(e){var t=this.__data__,n=O(t,e);return n<0?void 0:t[n][1]},E.prototype.has=function(e){return O(this.__data__,e)>-1},E.prototype.set=function(e,t){var n=this.__data__,r=O(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};const x=E,_="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;var j="object"==typeof self&&self&&self.Object===Object&&self;const k=_||j||Function("return this")(),P=k.Symbol;var $=Object.prototype,A=$.hasOwnProperty,C=$.toString,T=P?P.toStringTag:void 0,D=Object.prototype.toString,I=P?P.toStringTag:void 0;const R=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":I&&I in Object(e)?function(e){var t=A.call(e,T),n=e[T];try{e[T]=void 0;var r=!0}catch(e){}var o=C.call(e);return r&&(t?e[T]=n:delete e[T]),o}(e):function(e){return D.call(e)}(e)},N=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},M=function(e){if(!N(e))return!1;var t=R(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},L=k["__core-js_shared__"];var B,U=(B=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+B:"",z=Function.prototype.toString;const F=function(e){if(null!=e){try{return z.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var K=/^\[object .+?Constructor\]$/,V=Function.prototype,q=Object.prototype,H=V.toString,W=q.hasOwnProperty,G=RegExp("^"+H.call(W).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const Z=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!N(e)||(t=e,U&&U in t))&&(M(e)?G:K).test(F(e));var t}(n)?n:void 0},Y=Z(k,"Map"),X=Z(Object,"create");var Q=Object.prototype.hasOwnProperty,J=Object.prototype.hasOwnProperty;function ee(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])}}ee.prototype.clear=function(){this.__data__=X?X(null):{},this.size=0},ee.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ee.prototype.get=function(e){var t=this.__data__;if(X){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Q.call(t,e)?t[e]:void 0},ee.prototype.has=function(e){var t=this.__data__;return X?void 0!==t[e]:J.call(t,e)},ee.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=X&&void 0===t?"__lodash_hash_undefined__":t,this};const te=ee,ne=function(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map};function re(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])}}re.prototype.clear=function(){this.size=0,this.__data__={hash:new te,map:new(Y||x),string:new te}},re.prototype.delete=function(e){var t=ne(this,e).delete(e);return this.size-=t?1:0,t},re.prototype.get=function(e){return ne(this,e).get(e)},re.prototype.has=function(e){return ne(this,e).has(e)},re.prototype.set=function(e,t){var n=ne(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};const oe=re;function ie(e){var t=this.__data__=new x(e);this.size=t.size}ie.prototype.clear=function(){this.__data__=new x,this.size=0},ie.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ie.prototype.get=function(e){return this.__data__.get(e)},ie.prototype.has=function(e){return this.__data__.has(e)},ie.prototype.set=function(e,t){var n=this.__data__;if(n instanceof x){var r=n.__data__;if(!Y||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new oe(r)}return n.set(e,t),this.size=n.size,this};const se=ie;function ae(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new oe;++t<n;)this.add(e[t])}ae.prototype.add=ae.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},ae.prototype.has=function(e){return this.__data__.has(e)};const ce=ae,ue=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},le=function(e,t){return e.has(t)},fe=function(e,t,n,r,o,i){var s=1&n,a=e.length,c=t.length;if(a!=c&&!(s&&c>a))return!1;var u=i.get(e),l=i.get(t);if(u&&l)return u==t&&l==e;var f=-1,p=!0,d=2&n?new ce:void 0;for(i.set(e,t),i.set(t,e);++f<a;){var h=e[f],y=t[f];if(r)var g=s?r(y,h,f,t,e,i):r(h,y,f,e,t,i);if(void 0!==g){if(g)continue;p=!1;break}if(d){if(!ue(t,(function(e,t){if(!le(d,t)&&(h===e||o(h,e,n,r,i)))return d.push(t)}))){p=!1;break}}else if(h!==y&&!o(h,y,n,r,i)){p=!1;break}}return i.delete(e),i.delete(t),p},pe=k.Uint8Array,de=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n},he=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n};var ye=P?P.prototype:void 0,ge=ye?ye.valueOf:void 0;const me=Array.isArray;var be=Object.prototype.propertyIsEnumerable,ve=Object.getOwnPropertySymbols;const we=ve?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 s=e[n];t(s)&&(i[o++]=s)}return i}(ve(e),(function(t){return be.call(e,t)})))}:function(){return[]},Oe=function(e){return null!=e&&"object"==typeof e},Se=function(e){return Oe(e)&&"[object Arguments]"==R(e)};var Ee=Object.prototype,xe=Ee.hasOwnProperty,_e=Ee.propertyIsEnumerable,je=Se(function(){return arguments}())?Se:function(e){return Oe(e)&&xe.call(e,"callee")&&!_e.call(e,"callee")};const ke=je;var Pe=t&&!t.nodeType&&t,$e=Pe&&e&&!e.nodeType&&e,Ae=$e&&$e.exports===Pe?k.Buffer:void 0;const Ce=(Ae?Ae.isBuffer:void 0)||function(){return!1};var Te=/^(?:0|[1-9]\d*)$/;const De=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Te.test(e))&&e>-1&&e%1==0&&e<t},Ie=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var Re={};Re["[object Float32Array]"]=Re["[object Float64Array]"]=Re["[object Int8Array]"]=Re["[object Int16Array]"]=Re["[object Int32Array]"]=Re["[object Uint8Array]"]=Re["[object Uint8ClampedArray]"]=Re["[object Uint16Array]"]=Re["[object Uint32Array]"]=!0,Re["[object Arguments]"]=Re["[object Array]"]=Re["[object ArrayBuffer]"]=Re["[object Boolean]"]=Re["[object DataView]"]=Re["[object Date]"]=Re["[object Error]"]=Re["[object Function]"]=Re["[object Map]"]=Re["[object Number]"]=Re["[object Object]"]=Re["[object RegExp]"]=Re["[object Set]"]=Re["[object String]"]=Re["[object WeakMap]"]=!1;var Ne=t&&!t.nodeType&&t,Me=Ne&&e&&!e.nodeType&&e,Le=Me&&Me.exports===Ne&&_.process,Be=function(){try{return Me&&Me.require&&Me.require("util").types||Le&&Le.binding&&Le.binding("util")}catch(e){}}(),Ue=Be&&Be.isTypedArray;const ze=Ue?(Fe=Ue,function(e){return Fe(e)}):function(e){return Oe(e)&&Ie(e.length)&&!!Re[R(e)]};var Fe,Ke=Object.prototype.hasOwnProperty,Ve=Object.prototype;const qe=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object);var He=Object.prototype.hasOwnProperty;const We=function(e){return null!=(t=e)&&Ie(t.length)&&!M(t)?function(e,t){var n=me(e),r=!n&&ke(e),o=!n&&!r&&Ce(e),i=!n&&!r&&!o&&ze(e),s=n||r||o||i,a=s?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=a.length;for(var u in e)!Ke.call(e,u)||s&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||De(u,c))||a.push(u);return a}(e):function(e){if(n=(t=e)&&t.constructor,t!==("function"==typeof n&&n.prototype||Ve))return qe(e);var t,n,r=[];for(var o in Object(e))He.call(e,o)&&"constructor"!=o&&r.push(o);return r}(e);var t},Ge=function(e){return function(e,t,n){var r=t(e);return me(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,We,we)};var Ze=Object.prototype.hasOwnProperty;const Ye=Z(k,"DataView"),Xe=Z(k,"Promise"),Qe=Z(k,"Set"),Je=Z(k,"WeakMap");var et="[object Map]",tt="[object Promise]",nt="[object Set]",rt="[object WeakMap]",ot="[object DataView]",it=F(Ye),st=F(Y),at=F(Xe),ct=F(Qe),ut=F(Je),lt=R;(Ye&&lt(new Ye(new ArrayBuffer(1)))!=ot||Y&&lt(new Y)!=et||Xe&&lt(Xe.resolve())!=tt||Qe&&lt(new Qe)!=nt||Je&&lt(new Je)!=rt)&&(lt=function(e){var t=R(e),n="[object Object]"==t?e.constructor:void 0,r=n?F(n):"";if(r)switch(r){case it:return ot;case st:return et;case at:return tt;case ct:return nt;case ut:return rt}return t});const ft=lt;var pt="[object Arguments]",dt="[object Array]",ht="[object Object]",yt=Object.prototype.hasOwnProperty;const gt=function e(t,n,r,o,i){return t===n||(null==t||null==n||!Oe(t)&&!Oe(n)?t!=t&&n!=n:function(e,t,n,r,o,i){var s=me(e),a=me(t),c=s?dt:ft(e),u=a?dt:ft(t),l=(c=c==pt?ht:c)==ht,f=(u=u==pt?ht:u)==ht,p=c==u;if(p&&Ce(e)){if(!Ce(t))return!1;s=!0,l=!1}if(p&&!l)return i||(i=new se),s||ze(e)?fe(e,t,n,r,o,i):function(e,t,n,r,o,i,s){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 w(+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 a=de;case"[object Set]":var c=1&r;if(a||(a=he),e.size!=t.size&&!c)return!1;var u=s.get(e);if(u)return u==t;r|=2,s.set(e,t);var l=fe(a(e),a(t),r,o,i,s);return s.delete(e),l;case"[object Symbol]":if(ge)return ge.call(e)==ge.call(t)}return!1}(e,t,c,n,r,o,i);if(!(1&n)){var d=l&&yt.call(e,"__wrapped__"),h=f&&yt.call(t,"__wrapped__");if(d||h){var y=d?e.value():e,g=h?t.value():t;return i||(i=new se),o(y,g,n,r,i)}}return!!p&&(i||(i=new se),function(e,t,n,r,o,i){var s=1&n,a=Ge(e),c=a.length;if(c!=Ge(t).length&&!s)return!1;for(var u=c;u--;){var l=a[u];if(!(s?l in t:Ze.call(t,l)))return!1}var f=i.get(e),p=i.get(t);if(f&&p)return f==t&&p==e;var d=!0;i.set(e,t),i.set(t,e);for(var h=s;++u<c;){var y=e[l=a[u]],g=t[l];if(r)var m=s?r(g,y,l,t,e,i):r(y,g,l,e,t,i);if(!(void 0===m?y===g||o(y,g,n,r,i):m)){d=!1;break}h||(h="constructor"==l)}if(d&&!h){var b=e.constructor,v=t.constructor;b==v||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof v&&v instanceof v||(d=!1)}return i.delete(e),i.delete(t),d}(e,t,n,r,o,i))}(t,n,r,o,e,i))},mt=function(e,t){return gt(e,t)};function bt(e){const[t,n]=(0,r.useState)([]);return(0,r.useEffect)((()=>{function r(r){var o,i;const s=null!==(i=null===(o=r.slots[e])||void 0===o?void 0:o.assignedExtensions)&&void 0!==i?i:[];mt(s,t)||n(s)}return r((0,p.getExtensionStore)().getState()),(0,p.getExtensionStore)().subscribe(r)}),[e,t]),t}function vt(e){const t=v(),n=bt(e);return(0,r.useMemo)((()=>(0,p.getConnectedExtensions)(n,t)),[n,t])}function wt(e){const{moduleName:t}=(0,r.useContext)(i);if(!t)throw Error("ComponentContext has not been provided. This should come from @openmrs/esm-react-utils.");return(0,r.useEffect)((()=>{(0,p.registerExtensionSlot)(t,e)}),[]),{extensions:vt(e),extensionSlotName:e,extensionSlotModuleName:t}}function Ot(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function St(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){Ot(e,t,n[t])}))}return e}function Et(e){return e}function xt(e){var{name:t,extensionSlotName:n,select:o=Et,children:s,state:a,style:c}=e,u=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(s&&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.");const l=null!=t?t:n,f=(0,r.useRef)(null),{extensions:p,extensionSlotModuleName:d}=wt(l),h=(0,r.useMemo)((()=>o(p)),[o,p]),g=(0,r.useMemo)((()=>{if("function"==typeof s&&!r.default.isValidElement(s))return h.map((e=>s(e)))}),[s,h]);var m,b,v,w;return r.default.createElement("div",St({ref:f,"data-extension-slot-name":l,"data-extension-slot-module-name":d,style:(v=St({},c),w={position:"relative"},w=null!=w?w:{},Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(w)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(w)).forEach((function(e){Object.defineProperty(v,e,Object.getOwnPropertyDescriptor(w,e))})),v)},u),l&&h.map(((e,t)=>r.default.createElement(i.Provider,{key:e.id,value:{moduleName:d,extension:{extensionId:e.id,extensionSlotName:l,extensionSlotModuleName:d}}},null!==(b=null!==(m=null==g?void 0:g[t])&&void 0!==m?m:"function"!=typeof s?s:null)&&void 0!==b?b:r.default.createElement(y,{state:a})))))}var _t=m(645);function jt(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}function kt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jt(Object(n),!0).forEach((function(t){$t(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Pt(e){return(Pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function At(e){return(At="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ct(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(At(n)));return function(){var e=n(t);if(!(e instanceof 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(At(e)));return e}}var Tt=null;try{Tt=n(5776).createContext()}catch(jt){}var Dt={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:{}};function It(e){if("object"!==Pt(e))throw new Error("single-spa-react requires a configuration object");var t=kt(kt({},Dt),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");!Tt&&t.React.createContext&&(Tt=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:Rt.bind(null,t),mount:Nt.bind(null,t),unmount:Mt.bind(null,t)};return t.parcelCanUpdate&&(n.update=Lt.bind(null,t)),n}function Rt(e,t){return e.rootComponent?Promise.resolve():e.loadRootComponent(t).then((function(t){e.rootComponent=t}))}function Nt(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=zt(e,t,(function(){n(this)})),i=Ct(e,t)(),s=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:Bt(e),renderType:Ut(e)});e.domElements[t.name]=i,e.renderResults[t.name]=s}))}function Mt(e,t){return new Promise((function(n){e.unmountResolves[t.name]=n;var r=e.renderResults[t.name];r&&r.unmount?r.unmount():Bt(e).unmountComponentAtNode(e.domElements[t.name]),delete e.domElements[t.name],delete e.renderResults[t.name]}))}function Lt(e,t){return new Promise((function(n){e.updateResolves[t.name]||(e.updateResolves[t.name]=[]),e.updateResolves[t.name].push(n);var r=zt(e,t,null),o=e.renderResults[t.name];if(o&&o.render)o.render(r);else{var i=Ct(e,t)();Bt(e).render(r,i)}}))}function Bt(e){return e.ReactDOMClient||e.ReactDOM}function Ut(e){return"function"==typeof e.renderType?e.renderType():e.renderType}function zt(e,t,n){var r=e.React.createElement(e.rootComponent,t),o=Tt?e.React.createElement(Tt.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,kt(kt({},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)}var Ft=m(64),Kt=m(281);const Vt=Ft.default.default||Ft.default,qt={strictMode:!0,throwErrorsToConsole:!0,disableTranslations:!1},Ht=e=>{(0,r.useEffect)((()=>(Vt.on("languageChanged",e.forceUpdate),()=>Vt.off("languageChanged",e.forceUpdate))),[e.forceUpdate]);const t=(0,r.useRef)(null);if(t.current)throw t.current;if(!Vt.hasLoadedNamespace(e.ns)){const n=setTimeout((()=>{console.warn(`openmrsComponentDecorator: the React suspense promise for i18next.loadNamespaces(['${e.ns}']) did not resolve nor reject after three seconds. This could mean you have multiple versions of i18next and haven't made i18next a webpack external in all projects.`)}),3e3);throw Vt.loadNamespaces([e.ns]).then((()=>clearTimeout(n))).catch((e=>{clearTimeout(n),t.current=e}))}return r.default.createElement(r.default.Fragment,null,e.children)};function Wt(e){if("object"!=typeof e||"string"!=typeof e.featureName||"string"!=typeof e.moduleName)throw new Error("Invalid options");const t=Object.assign({},qt,e);return function(e){var n,o,s,a;return o=n=class extends r.default.Component{componentDidCatch(e,n){n&&n.componentStack&&(e.extra=Object.assign(e.extra||{},{componentStack:n.componentStack})),t.throwErrorsToConsole&&setTimeout((()=>{throw e})),this.setState({caughtError:e,caughtErrorInfo:n})}render(){if(this.state.caughtError)return r.default.createElement("div",null,"An error has occurred. Please try reloading the page.");{const n=r.default.createElement(i.Provider,{value:this.state.config},r.default.createElement(r.default.Suspense,{fallback:null},t.disableTranslations?r.default.createElement(e,this.props):r.default.createElement(Ht,{ns:t.moduleName,forceUpdate:()=>this.forceUpdate()},r.default.createElement(Kt.I18nextProvider,{i18n:Vt,defaultNS:t.moduleName},r.default.createElement(e,this.props)))));return t.strictMode||!r.default.StrictMode?n:r.default.createElement(r.default.StrictMode,null,n)}}constructor(e){super(e),this.state={caughtError:null,caughtErrorInfo:null,config:{moduleName:t.moduleName,extension:e._extensionContext}}}},s="displayName",a=`OpenmrsReactComponent(${t.featureName})`,s in o?Object.defineProperty(o,s,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[s]=a,n}}function Gt(e,t){return It({React:r.default,ReactDOMClient:_t,rootComponent:Wt(t)(e)})}function Zt(e,t){return()=>e().then((({default:e})=>Gt(e,t)))}function Yt(e,t){return()=>Promise.resolve(Gt(e,t))}const Xt=Zt;function Qt(e){const[t,n]=(0,r.useState)([]);return(0,r.useEffect)((()=>(0,p.getExtensionStore)().subscribe((r=>{var o,i;const s=null!==(i=null===(o=r.slots[e])||void 0===o?void 0:o.assignedExtensions.map((e=>e.id)))&&void 0!==i?i:[];mt(s,t)||n(s)}))),[]),t}function Jt(e){(0,r.useEffect)((()=>{if(e){const e=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}}),[e])}function en(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const tn={},nn='No ComponentContext has been provided. This should come from "openmrsComponentDecorator".\nUsually this is already applied when using "getAsyncLifecycle" or "getSyncLifecycle".';function rn(){const{moduleName:e,extension:t}=(0,r.useContext)(i);if(!e&&!t)throw Error(nn);const n=function(e){const t=(0,r.useMemo)((()=>(0,a.getConfigStore)(e)),[e]),n=e,o=function(e){const[t,n]=(0,r.useState)(function(e){return()=>{const t=e.getState();return t.loaded&&t.config?t.config:null}}(e));return(0,r.useEffect)((()=>null==e?void 0:e.subscribe((e=>{e.loaded&&e.config&&n(e.config)}))),[e]),t}(t);if(!o)throw tn[n]||(tn[n]=function(e){return new Promise((t=>{const n=e.subscribe((e=>{e.loaded&&e.config&&(t(e.config),n())}))}))}(t)),tn[n];return o}(e),o=function(e){const t=(0,r.useMemo)(a.getExtensionsConfigStore,[]),n=function(e,t){const[n,o]=(0,r.useState)(function(e,t){return t?()=>{const n=e.getState(),r=(0,a.getExtensionConfigFromStore)(n,t.extensionSlotName,t.extensionId);if(r.loaded&&r.config)return r.config}:null}(e,t));return(0,r.useEffect)((()=>{if(t)return e.subscribe((e=>{const r=(0,a.getExtensionConfigFromStore)(e,t.extensionSlotName,t.extensionId);r.loaded&&r.config&&!mt(r.config,n)&&o(r.config)}))}),[e,t,n]),n}(t,e);if(!n&&e){const n=`${e.extensionSlotName}-${e.extensionId}`;throw!tn[n]&&t&&(tn[n]=function(e,t){return new Promise((n=>{const r=e.subscribe((e=>{const o=(0,a.getExtensionConfigFromStore)(e,t.extensionSlotName,t.extensionId);o.loaded&&o.config&&(n(o.config),r())}))}))}(t,e)),tn[n]}return n||{}}(t),s=(0,r.useMemo)((()=>function(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){en(e,t,n[t])}))}return e}({},n,o)),[n,o]);return s}var on,sn=m(766);function an(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cn(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){an(e,t,n[t])}))}return e}function un(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(e){e.loadPatient="loadPatient",e.newPatient="newPatient",e.loadError="patientLoadError"}(on||(on={}));const ln={patientUuid:null,patient:null,isPendingUuid:!0,isLoadingPatient:!1,err:null};function fn(){const e=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return e&&e[1]}function pn(e,t){switch(t.type){case on.loadPatient:return un(cn({},e),{patientUuid:t.patientUuid,patient:null,isPendingUuid:!1,isLoadingPatient:!0,err:null});case on.newPatient:return un(cn({},e),{patient:t.patient,isPendingUuid:!1,isLoadingPatient:!1,err:null});case on.loadError:return un(cn({},e),{patient:null,isPendingUuid:!1,isLoadingPatient:!1,err:t.err});default:return e}}function dn(e){const[t,n]=(0,r.useReducer)(pn,un(cn({},ln),{patientUuid:null!=e?e:null,isPendingUuid:!e,isLoadingPatient:!!e}));return(0,r.useEffect)((()=>{if(t.isPendingUuid){const e=fn();n(e?{type:on.loadPatient,patientUuid:e}:{type:on.newPatient,patient:null})}let e=!0;return t.isLoadingPatient&&t.patientUuid&&(0,sn.fetchCurrentPatient)(t.patientUuid).then((t=>e&&n({patient:t,type:on.newPatient})),(t=>e&&n({err:t,type:on.loadError}))),()=>{e=!1}}),[t.isPendingUuid,t.isLoadingPatient,t.patientUuid]),(0,r.useEffect)((()=>{const e=e=>{const r=fn();r!=t.patientUuid&&n({type:on.loadPatient,patientUuid:r})};return window.addEventListener("single-spa:routing-event",e),()=>window.removeEventListener("single-spa:routing-event",e)}),[t.patientUuid]),{isLoading:t.isPendingUuid||t.isLoadingPatient,patient:t.patient,patientUuid:null!=e?e:t.patientUuid,error:t.err}}const hn=f((0,p.getExtensionInternalStore)());function yn(e){const t=vt(e);return(0,r.useMemo)((()=>Object.fromEntries(t.map((e=>[e.name,e.meta])))),[t])}const gn=f((0,p.getExtensionStore)());function mn(){const[,e]=(0,r.useState)(0);return(0,r.useCallback)((()=>{e((e=>e+1))}),[])}function bn(){let e="tablet";return document.body.classList.forEach((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}function vn(){const[e,t]=(0,r.useState)(bn);return(0,r.useEffect)((()=>{const e=()=>{t(bn())};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),e}const wn=e=>"small-desktop"===e||"large-desktop"===e;function On(){const[e,t]=(0,r.useState)([]);return(0,r.useEffect)((()=>{const e=(0,sn.getLocations)().subscribe((e=>{t(e)}),(e=>{console.error(e)}));return()=>e.unsubscribe()}),[]),e}function Sn(e,t=!0){const n=(0,r.useRef)(null);return(0,r.useEffect)((()=>{if(t){const t=t=>{var r;(null==n||null===(r=n.current)||void 0===r?void 0:r.contains(t.target))||e(t)};return window.addEventListener("click",t),()=>window.removeEventListener("click",t)}}),[e,t]),n}const En=({privilege:e,fallback:t,children:n})=>{const[o,i]=(0,r.useState)(null);return(0,r.useEffect)((()=>{const e=(0,sn.getCurrentUser)({includeAuthStatus:!1}).subscribe(i);return()=>e.unsubscribe()}),[]),o&&(0,sn.userHasAccess)(e,o)?r.default.createElement(r.default.Fragment,null,n):t?r.default.createElement(r.default.Fragment,null,t):null};let xn,_n;function jn(){const[e,t]=(0,r.useState)(null);let n=null;if(!e){if(xn){const e=(0,sn.getSessionStore)().getState();e.loaded&&(n=e.session)}else xn=new Promise((e=>{const t=({loaded:t,session:r})=>{t&&(e(r),n=r,_n&&_n(),_n=void 0)};t((0,sn.getSessionStore)().getState()),n||(_n=(0,sn.getSessionStore)().subscribe(t))}));if(!n)throw xn;t(n)}(0,r.useEffect)((()=>(_n||(_n=(0,sn.getSessionStore)().subscribe((({loaded:e,session:r})=>{e&&(n=r,t(r))}))),()=>{_n&&_n(),_n=void 0})),[]);const o=e||n;if(!o)throw xn?(console.warn("useSession is in an unexpected state. Attempting to recover."),xn):Error("useSession is in an invalid state.");return o}var kn=m(403);function Pn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const $n=e=>e;function An(e,t=$n,n){const[o,i]=(0,r.useState)((()=>t(e.getState())));(0,r.useEffect)((()=>(0,kn.subscribeTo)(e,t,i)),[e,t]);let s=(0,r.useMemo)((()=>n?function(e,t){"function"==typeof t&&(t=t(e));const n={};for(let r in t)n[r]=()=>{const n=arguments;e.setState((e=>{let o=[e];for(let e=0;e<n.length;e++)o.push(n[e]);return t[r](...o)}))};return n}(e,n):{}),[e,n]);return function(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){Pn(e,t,n[t])}))}return e}({},o,s)}function Cn(e,t){return An(e,$n,t)}var Tn=m(374);const Dn=new WeakMap,In={},Rn=()=>{},Nn=void 0,Mn=Object,Ln=e=>e===Nn,Bn=e=>"function"==typeof e,Un=(e,t)=>s({},e,t),zn="undefined",Fn=typeof window!=zn,Kn=typeof document!=zn,Vn=(e,t)=>{const n=Dn.get(e);return[()=>e.get(t)||In,r=>{const o=e.get(t);n[5](t,Un(o,r),o||In)},n[6]]},qn=new WeakMap;let Hn=0;const Wn=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let o,i;if(Mn(e)!==e||r||n==RegExp)o=r?e.toJSON():"symbol"==t?e.toString():"string"==t?JSON.stringify(e):""+e;else{if(o=qn.get(e),o)return o;if(o=++Hn+"~",qn.set(e,o),n==Array){for(o="@",i=0;i<e.length;i++)o+=Wn(e[i])+",";qn.set(e,o)}if(n==Mn){o="#";const t=Mn.keys(e).sort();for(;!Ln(i=t.pop());)Ln(e[i])||(o+=i+":"+Wn(e[i])+",");qn.set(e,o)}}return o};let Gn=!0;const[Zn,Yn]=Fn&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Rn,Rn],Xn={isOnline:()=>Gn,isVisible:()=>{const e=Kn&&document.visibilityState;return Ln(e)||"hidden"!==e}},Qn={initFocus:e=>(Kn&&document.addEventListener("visibilitychange",e),Zn("focus",e),()=>{Kn&&document.removeEventListener("visibilitychange",e),Yn("focus",e)}),initReconnect:e=>{const t=()=>{Gn=!0,e()},n=()=>{Gn=!1};return Zn("online",t),Zn("offline",n),()=>{Yn("online",t),Yn("offline",n)}}},Jn=!r.default.useId,er=!Fn||"Deno"in window,tr=er?r.useEffect:r.useLayoutEffect,nr="undefined"!=typeof navigator&&navigator.connection,rr=!er&&nr&&(["slow-2g","2g"].includes(nr.effectiveType)||nr.saveData),or=e=>{if(Bn(e))try{e=e()}catch(t){e=""}const t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?Wn(e):"",t]};let ir=0;const sr=()=>++ir;function ar(){return cr.apply(this,arguments)}function cr(){return cr=o((function*(...e){const[t,n,r,i]=e,s=Un({populateCache:!0,throwOnError:!0},"boolean"==typeof i?{revalidate:i}:i||{});let a=s.populateCache;const c=s.rollbackOnError;let u=s.optimisticData;const l=!1!==s.revalidate,f=s.throwOnError;if(Bn(n)){const e=n,r=[],o=t.keys();for(let n=o.next();!n.done;n=o.next()){const o=n.value;!o.startsWith("$inf$")&&e(t.get(o)._k)&&r.push(o)}return Promise.all(r.map(p))}return p(n);function p(e){return d.apply(this,arguments)}function d(){return d=o((function*(n){const[o]=or(n);if(!o)return;const[i,s]=Vn(t,o),[p,d,h]=Dn.get(t),y=p[o],g=()=>l&&(delete h[o],y&&y[0])?y[0](2).then((()=>i().data)):i().data;if(e.length<3)return g();let m,b=r;const v=sr();d[o]=[v,0];const w=!Ln(u),O=i(),S=O.data,E=O._c,x=Ln(E)?S:E;if(w&&(u=Bn(u)?u(x):u,s({data:u,_c:x})),Bn(b))try{b=b(x)}catch(e){m=e}if(b&&Bn(b.then)){if(b=yield b.catch((e=>{m=e})),v!==d[o][0]){if(m)throw m;return b}m&&w&&(e=>"function"==typeof c?c(e):!1!==c)(m)&&(a=!0,b=x,s({data:b,_c:Nn}))}a&&(m||(Bn(a)&&(b=a(b,x)),s({data:b,_c:Nn}))),d[o][1]=sr();const _=yield g();if(s({_c:Nn}),!m)return a?_:b;if(f)throw m})),d.apply(this,arguments)}})),cr.apply(this,arguments)}const ur=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},lr=(e,t)=>{if(!Dn.has(e)){const n=Un(Qn,t),r={},o=ar.bind(Nn,e);let i=Rn;const s={},a=(e,t)=>{const n=s[e]||[];return s[e]=n,n.push(t),()=>n.splice(n.indexOf(t),1)},c=(t,n,r)=>{e.set(t,n);const o=s[t];if(o)for(let e=o.length;e--;)o[e](r,n)},u=()=>{if(!Dn.has(e)&&(Dn.set(e,[r,{},{},{},o,c,a]),!er)){const t=n.initFocus(setTimeout.bind(Nn,ur.bind(Nn,r,0))),o=n.initReconnect(setTimeout.bind(Nn,ur.bind(Nn,r,1)));i=()=>{t&&t(),o&&o(),Dn.delete(e)}}};return u(),[e,o,u,i]}return[e,Dn.get(e)[4]]},[fr,pr]=lr(new Map),dr=Un({onLoadingSlow:Rn,onSuccess:Rn,onError:Rn,onErrorRetry:(e,t,n,r,o)=>{const i=n.errorRetryCount,s=o.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!Ln(i)&&s>i||setTimeout(r,a,o)},onDiscarded:Rn,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:rr?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:rr?5e3:3e3,compare:(e,t)=>Wn(e)==Wn(t),isPaused:()=>!1,cache:fr,mutate:pr,fallback:{}},Xn),hr=(e,t)=>{const n=Un(e,t);if(t){const{use:r,fallback:o}=e,{use:i,fallback:s}=t;r&&i&&(n.use=r.concat(i)),o&&s&&(n.fallback=Un(o,s))}return n},yr=(0,r.createContext)({}),gr=Fn&&window.__SWR_DEVTOOLS_USE__,mr=(gr?window.__SWR_DEVTOOLS_USE__:[]).concat((e=>(t,n,r)=>e(t,n&&((...e)=>{const r=or(t)[0],[,,,o]=Dn.get(fr),i=o[r];return i?(delete o[r],i):n(...e)}),r)));gr&&(window.__SWR_DEVTOOLS_REACT__=r.default);const br={dedupe:!0};Mn.defineProperty((e=>{const{value:t}=e,n=(0,r.useContext)(yr),o=Bn(t),i=(0,r.useMemo)((()=>o?t(n):t),[o,n,t]),s=(0,r.useMemo)((()=>o?i:hr(n,i)),[o,n,i]),a=i&&i.provider,[c]=(0,r.useState)((()=>a?lr(a(s.cache||fr),i):Nn));return c&&(s.cache=c[0],s.mutate=c[1]),tr((()=>{if(c)return c[2]&&c[2](),c[3]}),[]),(0,r.createElement)(yr.Provider,Un(e,{value:s}))}),"defaultValue",{value:dr});var vr,wr=(vr=(e,t,n)=>{const{cache:i,compare:a,suspense:c,fallbackData:u,revalidateOnMount:l,refreshInterval:f,refreshWhenHidden:p,refreshWhenOffline:d,keepPreviousData:h}=n,[y,g,m]=Dn.get(i),[b,v]=or(e),w=(0,r.useRef)(!1),O=(0,r.useRef)(!1),S=(0,r.useRef)(b),E=(0,r.useRef)(t),x=(0,r.useRef)(n),_=()=>x.current,j=()=>_().isVisible()&&_().isOnline(),[k,P,$]=Vn(i,b),A=(0,r.useRef)({}).current,C=Ln(u)?n.fallback[b]:u,T=(e,t)=>{let n=!0;for(const r in A){const o=r;a(t[o],e[o])||"data"===o&&Ln(e[o])&&a(t[o],U)||(n=!1)}return n},D=(0,r.useMemo)((()=>{const e=!!b&&!!t&&(Ln(l)?!_().isPaused()&&!c:l),n=()=>{const t=k(),n=Un(t);return delete n._k,e?s({isValidating:!0,isLoading:!0},n):n};let r=n();return()=>{const e=n();return T(e,r)?r:r=e}}),[i,b]),I=(0,Tn.useSyncExternalStore)((0,r.useCallback)((e=>$(b,((t,n)=>{T(t,n)||e()}))),[i,b]),D,D),R=!w.current,N=I.data,M=Ln(N)?C:N,L=I.error,B=(0,r.useRef)(M),U=h?Ln(N)?B.current:N:M,z=R&&!Ln(l)?l:!_().isPaused()&&(c?!Ln(M)&&n.revalidateIfStale:Ln(M)||n.revalidateIfStale),F=!!(b&&t&&R&&z),K=Ln(I.isValidating)?F:I.isValidating,V=Ln(I.isLoading)?F:I.isLoading,q=(0,r.useCallback)((W=o((function*(e){const t=E.current;if(!b||!t||O.current||_().isPaused())return!1;let r,o,i=!0;const s=e||{},c=!m[b]||!s.dedupe,u=()=>Jn?!O.current&&b===S.current&&w.current:b===S.current,l={isValidating:!1,isLoading:!1},f=()=>{P(l)},p=()=>{const e=m[b];e&&e[1]===o&&delete m[b]},d={isValidating:!0};Ln(k().data)&&(d.isLoading=!0);try{if(c&&(P(d),n.loadingTimeout&&Ln(k().data)&&setTimeout((()=>{i&&u()&&_().onLoadingSlow(b,n)}),n.loadingTimeout),m[b]=[t(v),sr()]),[r,o]=m[b],r=yield r,c&&setTimeout(p,n.dedupingInterval),!m[b]||m[b][1]!==o)return c&&u()&&_().onDiscarded(b),!1;l.error=Nn;const e=g[b];if(!Ln(e)&&(o<=e[0]||o<=e[1]||0===e[1]))return f(),c&&u()&&_().onDiscarded(b),!1;const s=k().data;l.data=a(s,r)?s:r,c&&u()&&_().onSuccess(r,b,n)}catch(e){p();const t=_(),{shouldRetryOnError:n}=t;t.isPaused()||(l.error=e,c&&u()&&(t.onError(e,b,t),(!0===n||Bn(n)&&n(e))&&j()&&t.onErrorRetry(e,b,t,q,{retryCount:(s.retryCount||0)+1,dedupe:!0})))}return i=!1,f(),!0})),function(e){return W.apply(this,arguments)}),[b,i]),H=(0,r.useCallback)(((...e)=>ar(i,S.current,...e)),[]);var W;if(tr((()=>{E.current=t,x.current=n,Ln(N)||(B.current=N)})),tr((()=>{if(!b)return;const e=q.bind(Nn,br);let t=0;const n=((e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const e=r.indexOf(n);e>=0&&(r[e]=r[r.length-1],r.pop())}})(b,y,(n=>{if(0==n){const n=Date.now();_().revalidateOnFocus&&n>t&&j()&&(t=n+_().focusThrottleInterval,e())}else if(1==n)_().revalidateOnReconnect&&j()&&e();else if(2==n)return q()}));return O.current=!1,S.current=b,w.current=!0,P({_k:v}),z&&(Ln(M)||er?e():(e=>{Fn&&typeof window.requestAnimationFrame!=zn?window.requestAnimationFrame(e):setTimeout(e,1)})(e)),()=>{O.current=!0,n()}}),[b]),tr((()=>{let e;function t(){const t=Bn(f)?f(M):f;t&&-1!==e&&(e=setTimeout(n,t))}function n(){k().error||!p&&!_().isVisible()||!d&&!_().isOnline()?t():q(br).then(t)}return t(),()=>{e&&(clearTimeout(e),e=-1)}}),[f,p,d,b]),(0,r.useDebugValue)(U),c&&Ln(M)&&b){if(!Jn&&er)throw new Error("Fallback data is required when using suspense in SSR.");throw E.current=t,x.current=n,O.current=!1,Ln(L)?q(br):L}return{mutate:H,get data(){return A.data=!0,U},get error(){return A.error=!0,L},get isValidating(){return A.isValidating=!0,K},get isLoading(){return A.isLoading=!0,V}}},function(...e){const t=Un(dr,(0,r.useContext)(yr)),[n,o,i]=(e=>Bn(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}])(e),s=hr(t,i);let a=vr;const{use:c}=s,u=(c||[]).concat(mr);for(let e=u.length;e--;)a=u[e](a);return a(n,o||s.fetcher||null,s)}),Or=m(688),Sr=m(332),Er=m.n(Sr);function xr(e){const{data:t,error:n,mutate:o,isValidating:i}=wr(e?`/ws/rest/v1/visit?patient=${e}&v=${sn.defaultVisitCustomRepresentation}&includeInactive=false`:null,sn.openmrsFetch);var s;return{error:n,mutate:o,isValidating:i,currentVisit:(0,r.useMemo)((()=>null!==(s=null==t?void 0:t.data.results.find((e=>null===e.stopDatetime)))&&void 0!==s?s:null),[null==t?void 0:t.data.results]),isLoading:!t&&!n}}function _r(){const[e,t]=(0,r.useState)([]);return(0,r.useEffect)((()=>{const e=(0,sn.getVisitTypes)().subscribe((e=>{t(e)}),(e=>console.error(e)));return()=>e.unsubscribe()}),[]),e}Or.default.extend(Er());const jr=10;function kr(e=[],t=jr){const[n,o]=(0,r.useState)(1),i=(0,r.useMemo)((()=>"number"==typeof t&&t>0?Math.max(1,Math.ceil(e.length/t)):1),[e.length,t]);return{results:(0,r.useMemo)((()=>{const r=(n-1)*t,o=(n+0)*t;return e.slice(r,o)}),[e,n,t]),totalPages:i,currentPage:n,paginated:e.length>t,showNextButton:n<i,showPreviousButton:n>1,goTo(e){o(Math.max(1,Math.min(i,e)))},goToNext(){n<i&&o(n+1)},goToPrevious(){n>1&&o(n-1)}}}})(),b})())}}}))},4011:(e,t,n)=>{"use strict";n.d(t,{w:()=>a,hj:()=>jt,dT:()=>w,Vz:()=>be,NV:()=>u,D$:()=>G,Ae:()=>H,tl:()=>q,a$:()=>W,nI:()=>ye,YV:()=>Z,P3:()=>y,yn:()=>Y,ZR:()=>te,BL:()=>g,Y9:()=>d,qd:()=>fe,jf:()=>pe,mr:()=>he,Z_:()=>ge,t$:()=>me,h0:()=>Et,lm:()=>le,kP:()=>Oe,oR:()=>_e,xQ:()=>je,JF:()=>wt,NN:()=>Ot});var r=n(5776),o=n.n(r),i=n(3741);function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){var{to:t,templateParams:n,children:r}=e,a=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 o().createElement("a",function(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){s(e,t,n[t])}))}return e}({onClick:e=>function(e,t,n){e.metaKey||e.ctrlKey||e.shiftKey||0!=e.button||(e.preventDefault(),(0,i.navigate)({to:t,templateParams:n}))}(e,t,n),href:(0,i.interpolateUrl)(t,n)},a),r)}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 u(e){return function(t){const[n,o]=(0,r.useState)(e.getState());(0,r.useEffect)((()=>e.subscribe((e=>o(e)))),[]);let i=(0,r.useMemo)((()=>t?function(e,t){"function"==typeof t&&(t=t(e));const n={};for(let r in t)n[r]=()=>{const n=arguments;e.setState((e=>{let o=[e];for(let e=0;e<n.length;e++)o.push(n[e]);return t[r](o)}))};return n}(e,t):{}),[t]);return function(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}({},n,i)}}var l=n(3196);const f=o().createContext({moduleName:""});var p=n(8758);function d(){let[e,t]=(0,r.useState)(window.navigator.onLine);return(0,r.useEffect)((()=>(0,p.subscribeConnectivityChanged)((({online:e})=>t(e)))),[]),e}var h=n(3202);function y(e){const[t,n]=(0,r.useState)([]);return(0,r.useEffect)((()=>{function r(r){var o,i;const s=null!==(i=null===(o=r.slots[e])||void 0===o?void 0:o.assignedExtensions)&&void 0!==i?i:[];(0,h.Z)(s,t)||n(s)}return r((0,l.getExtensionStore)().getState()),(0,l.getExtensionStore)().subscribe(r)}),[e,t]),t}function g(e){const t=d(),n=y(e);return(0,r.useMemo)((()=>(0,l.getConnectedExtensions)(n,t)),[n,t])}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(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){m(e,t,n[t])}))}return e}function v(e){return e}function w(e){var{name:t,extensionSlotName:n,select:i=v,children:s,state:a,style:c}=e,u=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(s&&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.");const p=null!=t?t:n,d=(0,r.useRef)(null),{extensions:h,extensionSlotModuleName:y}=function(e){const{moduleName:t}=(0,r.useContext)(f);if(!t)throw Error("ComponentContext has not been provided. This should come from @openmrs/esm-react-utils.");return(0,r.useEffect)((()=>{(0,l.registerExtensionSlot)(t,e)}),[]),{extensions:g(e),extensionSlotName:e,extensionSlotModuleName:t}}(p),m=(0,r.useMemo)((()=>i(h)),[i,h]),w=(0,r.useMemo)((()=>{if("function"==typeof s&&!o().isValidElement(s))return m.map((e=>s(e)))}),[s,m]);var O,S,E,x;return o().createElement("div",b({ref:d,"data-extension-slot-name":p,"data-extension-slot-module-name":y,style:(E=b({},c),x={position:"relative"},x=null!=x?x:{},Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(x)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(x)).forEach((function(e){Object.defineProperty(E,e,Object.getOwnPropertyDescriptor(x,e))})),E)},u),p&&m.map(((e,t)=>o().createElement(f.Provider,{key:e.id,value:{moduleName:y,extension:{extensionId:e.id,extensionSlotName:p,extensionSlotModuleName:y}}},null!==(S=null!==(O=null==w?void 0:w[t])&&void 0!==O?O:"function"!=typeof s?s:null)&&void 0!==S?S:o().createElement(jt,{state:a})))))}var O=n(4645);function S(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}function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach((function(t){_(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function x(e){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(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}function j(e){return(j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function k(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(j(n)));return function(){var e=n(t);if(!(e instanceof 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(j(e)));return e}}var P=null;try{P=require("react").createContext()}catch(S){}var $={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:{}};function A(e){if("object"!==x(e))throw new Error("single-spa-react requires a configuration object");var t=E(E({},$),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");!P&&t.React.createContext&&(P=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:C.bind(null,t),mount:T.bind(null,t),unmount:D.bind(null,t)};return t.parcelCanUpdate&&(n.update=I.bind(null,t)),n}function C(e,t){return e.rootComponent?Promise.resolve():e.loadRootComponent(t).then((function(t){e.rootComponent=t}))}function T(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=M(e,t,(function(){n(this)})),i=k(e,t)(),s=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:R(e),renderType:N(e)});e.domElements[t.name]=i,e.renderResults[t.name]=s}))}function D(e,t){return new Promise((function(n){e.unmountResolves[t.name]=n;var r=e.renderResults[t.name];r&&r.unmount?r.unmount():R(e).unmountComponentAtNode(e.domElements[t.name]),delete e.domElements[t.name],delete e.renderResults[t.name]}))}function I(e,t){return new Promise((function(n){e.updateResolves[t.name]||(e.updateResolves[t.name]=[]),e.updateResolves[t.name].push(n);var r=M(e,t,null),o=e.renderResults[t.name];if(o&&o.render)o.render(r);else{var i=k(e,t)();R(e).render(r,i)}}))}function R(e){return e.ReactDOMClient||e.ReactDOM}function N(e){return"function"==typeof e.renderType?e.renderType():e.renderType}function M(e,t,n){var r=e.React.createElement(e.rootComponent,t),o=P?e.React.createElement(P.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,E(E({},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)}var L=n(7319),B=n.n(L),U=n(2680);const z=B().default||B(),F={strictMode:!0,throwErrorsToConsole:!0,disableTranslations:!1},K=e=>{(0,r.useEffect)((()=>(z.on("languageChanged",e.forceUpdate),()=>z.off("languageChanged",e.forceUpdate))),[e.forceUpdate]);const t=(0,r.useRef)(null);if(t.current)throw t.current;if(!z.hasLoadedNamespace(e.ns)){const n=setTimeout((()=>{console.warn(`openmrsComponentDecorator: the React suspense promise for i18next.loadNamespaces(['${e.ns}']) did not resolve nor reject after three seconds. This could mean you have multiple versions of i18next and haven't made i18next a webpack external in all projects.`)}),3e3);throw z.loadNamespaces([e.ns]).then((()=>clearTimeout(n))).catch((e=>{clearTimeout(n),t.current=e}))}return o().createElement(o().Fragment,null,e.children)};function V(e){if("object"!=typeof e||"string"!=typeof e.featureName||"string"!=typeof e.moduleName)throw new Error("Invalid options");const t=Object.assign({},F,e);return function(e){var n,r,i,s;return r=n=class extends o().Component{componentDidCatch(e,n){n&&n.componentStack&&(e.extra=Object.assign(e.extra||{},{componentStack:n.componentStack})),t.throwErrorsToConsole&&setTimeout((()=>{throw e})),this.setState({caughtError:e,caughtErrorInfo:n})}render(){if(this.state.caughtError)return o().createElement("div",null,"An error has occurred. Please try reloading the page.");{const n=o().createElement(f.Provider,{value:this.state.config},o().createElement(o().Suspense,{fallback:null},t.disableTranslations?o().createElement(e,this.props):o().createElement(K,{ns:t.moduleName,forceUpdate:()=>this.forceUpdate()},o().createElement(U.I18nextProvider,{i18n:z,defaultNS:t.moduleName},o().createElement(e,this.props)))));return t.strictMode||!o().StrictMode?n:o().createElement(o().StrictMode,null,n)}}constructor(e){super(e),this.state={caughtError:null,caughtErrorInfo:null,config:{moduleName:t.moduleName,extension:e._extensionContext}}}},i="displayName",s=`OpenmrsReactComponent(${t.featureName})`,i in r?Object.defineProperty(r,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[i]=s,n}}function q(e,t){return A({React:o(),ReactDOMClient:O,rootComponent:V(t)(e)})}function H(e,t){return()=>e().then((({default:e})=>q(e,t)))}function W(e,t){return()=>Promise.resolve(q(e,t))}const G=H;function Z(e){const[t,n]=(0,r.useState)([]);return(0,r.useEffect)((()=>(0,l.getExtensionStore)().subscribe((r=>{var o,i;const s=null!==(i=null===(o=r.slots[e])||void 0===o?void 0:o.assignedExtensions.map((e=>e.id)))&&void 0!==i?i:[];(0,h.Z)(s,t)||n(s)}))),[]),t}function Y(e){(0,r.useEffect)((()=>{if(e){const e=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}}),[e])}function X(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Q={},J='No ComponentContext has been provided. This should come from "openmrsComponentDecorator".\nUsually this is already applied when using "getAsyncLifecycle" or "getSyncLifecycle".';function ee(e){const t=(0,r.useMemo)(i.getExtensionsConfigStore,[]),n=function(e,t){const[n,o]=(0,r.useState)(function(e,t){return t?()=>{const n=e.getState(),r=(0,i.getExtensionConfigFromStore)(n,t.extensionSlotName,t.extensionId);if(r.loaded&&r.config)return r.config}:null}(e,t));return(0,r.useEffect)((()=>{if(t)return e.subscribe((e=>{const r=(0,i.getExtensionConfigFromStore)(e,t.extensionSlotName,t.extensionId);r.loaded&&r.config&&!(0,h.Z)(r.config,n)&&o(r.config)}))}),[e,t,n]),n}(t,e);if(!n&&e){const n=`${e.extensionSlotName}-${e.extensionId}`;throw!Q[n]&&t&&(Q[n]=function(e,t){return new Promise((n=>{const r=e.subscribe((e=>{const o=(0,i.getExtensionConfigFromStore)(e,t.extensionSlotName,t.extensionId);o.loaded&&o.config&&(n(o.config),r())}))}))}(t,e)),Q[n]}return n||{}}function te(){const{moduleName:e,extension:t}=(0,r.useContext)(f);if(!e&&!t)throw Error(J);const n=function(e){const t=(0,r.useMemo)((()=>(0,i.getConfigStore)(e)),[e]),n=e,o=function(e){const[t,n]=(0,r.useState)(function(e){return()=>{const t=e.getState();return t.loaded&&t.config?t.config:null}}(e));return(0,r.useEffect)((()=>null==e?void 0:e.subscribe((e=>{e.loaded&&e.config&&n(e.config)}))),[e]),t}(t);if(!o)throw Q[n]||(Q[n]=function(e){return new Promise((t=>{const n=e.subscribe((e=>{e.loaded&&e.config&&(t(e.config),n())}))}))}(t)),Q[n];return o}(e),o=ee(t),s=(0,r.useMemo)((()=>function(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){X(e,t,n[t])}))}return e}({},n,o)),[n,o]);return s}var ne,re=n(7840);function oe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ie(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){oe(e,t,n[t])}))}return e}function se(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(e){e.loadPatient="loadPatient",e.newPatient="newPatient",e.loadError="patientLoadError"}(ne||(ne={}));const ae={patientUuid:null,patient:null,isPendingUuid:!0,isLoadingPatient:!1,err:null};function ce(){const e=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return e&&e[1]}function ue(e,t){switch(t.type){case ne.loadPatient:return se(ie({},e),{patientUuid:t.patientUuid,patient:null,isPendingUuid:!1,isLoadingPatient:!0,err:null});case ne.newPatient:return se(ie({},e),{patient:t.patient,isPendingUuid:!1,isLoadingPatient:!1,err:null});case ne.loadError:return se(ie({},e),{patient:null,isPendingUuid:!1,isLoadingPatient:!1,err:t.err});default:return e}}function le(e){const[t,n]=(0,r.useReducer)(ue,se(ie({},ae),{patientUuid:null!=e?e:null,isPendingUuid:!e,isLoadingPatient:!!e}));return(0,r.useEffect)((()=>{if(t.isPendingUuid){const e=ce();n(e?{type:ne.loadPatient,patientUuid:e}:{type:ne.newPatient,patient:null})}let e=!0;return t.isLoadingPatient&&t.patientUuid&&(0,re.fetchCurrentPatient)(t.patientUuid).then((t=>e&&n({patient:t,type:ne.newPatient})),(t=>e&&n({err:t,type:ne.loadError}))),()=>{e=!1}}),[t.isPendingUuid,t.isLoadingPatient,t.patientUuid]),(0,r.useEffect)((()=>{const e=e=>{const r=ce();r!=t.patientUuid&&n({type:ne.loadPatient,patientUuid:r})};return window.addEventListener("single-spa:routing-event",e),()=>window.removeEventListener("single-spa:routing-event",e)}),[t.patientUuid]),{isLoading:t.isPendingUuid||t.isLoadingPatient,patient:t.patient,patientUuid:null!=e?e:t.patientUuid,error:t.err}}function fe(e){const t=g(e);return(0,r.useMemo)((()=>Object.fromEntries(t.map((e=>[e.name,e.meta])))),[t])}u((0,l.getExtensionInternalStore)());const pe=u((0,l.getExtensionStore)());function de(){let e="tablet";return document.body.classList.forEach((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}function he(){const[e,t]=(0,r.useState)(de);return(0,r.useEffect)((()=>{const e=()=>{t(de())};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),e}const ye=e=>"small-desktop"===e||"large-desktop"===e;function ge(){const[e,t]=(0,r.useState)([]);return(0,r.useEffect)((()=>{const e=(0,re.getLocations)().subscribe((e=>{t(e)}),(e=>{console.error(e)}));return()=>e.unsubscribe()}),[]),e}function me(e,t=!0){const n=(0,r.useRef)(null);return(0,r.useEffect)((()=>{if(t){const t=t=>{var r;(null==n||null===(r=n.current)||void 0===r?void 0:r.contains(t.target))||e(t)};return window.addEventListener("click",t),()=>window.removeEventListener("click",t)}}),[e,t]),n}const be=({privilege:e,fallback:t,children:n})=>{const[i,s]=(0,r.useState)(null);return(0,r.useEffect)((()=>{const e=(0,re.getCurrentUser)({includeAuthStatus:!1}).subscribe(s);return()=>e.unsubscribe()}),[]),i&&(0,re.userHasAccess)(e,i)?o().createElement(o().Fragment,null,n):t?o().createElement(o().Fragment,null,t):null};let ve,we;function Oe(){const[e,t]=(0,r.useState)(null);let n=null;if(!e){if(ve){const e=(0,re.getSessionStore)().getState();e.loaded&&(n=e.session)}else ve=new Promise((e=>{const t=({loaded:t,session:r})=>{t&&(e(r),n=r,we&&we(),we=void 0)};t((0,re.getSessionStore)().getState()),n||(we=(0,re.getSessionStore)().subscribe(t))}));if(!n)throw ve;t(n)}(0,r.useEffect)((()=>(we||(we=(0,re.getSessionStore)().subscribe((({loaded:e,session:r})=>{e&&(n=r,t(r))}))),()=>{we&&we(),we=void 0})),[]);const o=e||n;if(!o)throw ve?(console.warn("useSession is in an unexpected state. Attempting to recover."),ve):Error("useSession is in an invalid state.");return o}var Se=n(403);function Ee(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const xe=e=>e;function _e(e,t=xe,n){const[o,i]=(0,r.useState)((()=>t(e.getState())));(0,r.useEffect)((()=>(0,Se.subscribeTo)(e,t,i)),[e,t]);let s=(0,r.useMemo)((()=>n?function(e,t){"function"==typeof t&&(t=t(e));const n={};for(let r in t)n[r]=()=>{const n=arguments;e.setState((e=>{let o=[e];for(let e=0;e<n.length;e++)o.push(n[e]);return t[r](...o)}))};return n}(e,n):{}),[e,n]);return function(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){Ee(e,t,n[t])}))}return e}({},o,s)}function je(e,t){return _e(e,xe,t)}var ke=n(1374);const Pe=new WeakMap,$e={},Ae=()=>{},Ce=Ae(),Te=Object,De=e=>e===Ce,Ie=e=>"function"==typeof e,Re=(e,t)=>({...e,...t}),Ne="undefined",Me=typeof window!=Ne,Le=typeof document!=Ne,Be=(e,t)=>{const n=Pe.get(e);return[()=>e.get(t)||$e,r=>{const o=e.get(t);n[5](t,Re(o,r),o||$e)},n[6]]},Ue=new WeakMap;let ze=0;const Fe=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let o,i;if(Te(e)!==e||r||n==RegExp)o=r?e.toJSON():"symbol"==t?e.toString():"string"==t?JSON.stringify(e):""+e;else{if(o=Ue.get(e),o)return o;if(o=++ze+"~",Ue.set(e,o),n==Array){for(o="@",i=0;i<e.length;i++)o+=Fe(e[i])+",";Ue.set(e,o)}if(n==Te){o="#";const t=Te.keys(e).sort();for(;!De(i=t.pop());)De(e[i])||(o+=i+":"+Fe(e[i])+",");Ue.set(e,o)}}return o};let Ke=!0;const[Ve,qe]=Me&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Ae,Ae],He={isOnline:()=>Ke,isVisible:()=>{const e=Le&&document.visibilityState;return De(e)||"hidden"!==e}},We={initFocus:e=>(Le&&document.addEventListener("visibilitychange",e),Ve("focus",e),()=>{Le&&document.removeEventListener("visibilitychange",e),qe("focus",e)}),initReconnect:e=>{const t=()=>{Ke=!0,e()},n=()=>{Ke=!1};return Ve("online",t),Ve("offline",n),()=>{qe("online",t),qe("offline",n)}}},Ge=!r.useId,Ze=!Me||"Deno"in window,Ye=Ze?r.useEffect:r.useLayoutEffect,Xe="undefined"!=typeof navigator&&navigator.connection,Qe=!Ze&&Xe&&(["slow-2g","2g"].includes(Xe.effectiveType)||Xe.saveData),Je=e=>{if(Ie(e))try{e=e()}catch(t){e=""}const t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?Fe(e):"",t]};let et=0;const tt=()=>++et;async function nt(...e){const[t,n,r,o]=e,i=Re({populateCache:!0,throwOnError:!0},"boolean"==typeof o?{revalidate:o}:o||{});let s=i.populateCache;const a=i.rollbackOnError;let c=i.optimisticData;const u=!1!==i.revalidate,l=i.throwOnError;if(Ie(n)){const e=n,r=[],o=t.keys();for(let n=o.next();!n.done;n=o.next()){const o=n.value;!o.startsWith("$inf$")&&e(t.get(o)._k)&&r.push(o)}return Promise.all(r.map(f))}return f(n);async function f(n){const[o]=Je(n);if(!o)return;const[i,f]=Be(t,o),[p,d,h]=Pe.get(t),y=p[o],g=()=>u&&(delete h[o],y&&y[0])?y[0](2).then((()=>i().data)):i().data;if(e.length<3)return g();let m,b=r;const v=tt();d[o]=[v,0];const w=!De(c),O=i(),S=O.data,E=O._c,x=De(E)?S:E;if(w&&(c=Ie(c)?c(x):c,f({data:c,_c:x})),Ie(b))try{b=b(x)}catch(e){m=e}if(b&&Ie(b.then)){if(b=await b.catch((e=>{m=e})),v!==d[o][0]){if(m)throw m;return b}m&&w&&(e=>"function"==typeof a?a(e):!1!==a)(m)&&(s=!0,b=x,f({data:b,_c:Ce}))}s&&(m||(Ie(s)&&(b=s(b,x)),f({data:b,_c:Ce}))),d[o][1]=tt();const _=await g();if(f({_c:Ce}),!m)return s?_:b;if(l)throw m}}const rt=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},ot=(e,t)=>{if(!Pe.has(e)){const n=Re(We,t),r={},o=nt.bind(Ce,e);let i=Ae;const s={},a=(e,t)=>{const n=s[e]||[];return s[e]=n,n.push(t),()=>n.splice(n.indexOf(t),1)},c=(t,n,r)=>{e.set(t,n);const o=s[t];if(o)for(let e=o.length;e--;)o[e](r,n)},u=()=>{if(!Pe.has(e)&&(Pe.set(e,[r,{},{},{},o,c,a]),!Ze)){const t=n.initFocus(setTimeout.bind(Ce,rt.bind(Ce,r,0))),o=n.initReconnect(setTimeout.bind(Ce,rt.bind(Ce,r,1)));i=()=>{t&&t(),o&&o(),Pe.delete(e)}}};return u(),[e,o,u,i]}return[e,Pe.get(e)[4]]},[it,st]=ot(new Map),at=Re({onLoadingSlow:Ae,onSuccess:Ae,onError:Ae,onErrorRetry:(e,t,n,r,o)=>{const i=n.errorRetryCount,s=o.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!De(i)&&s>i||setTimeout(r,a,o)},onDiscarded:Ae,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Qe?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:Qe?5e3:3e3,compare:(e,t)=>Fe(e)==Fe(t),isPaused:()=>!1,cache:it,mutate:st,fallback:{}},He),ct=(e,t)=>{const n=Re(e,t);if(t){const{use:r,fallback:o}=e,{use:i,fallback:s}=t;r&&i&&(n.use=r.concat(i)),o&&s&&(n.fallback=Re(o,s))}return n},ut=(0,r.createContext)({}),lt=Me&&window.__SWR_DEVTOOLS_USE__,ft=lt?window.__SWR_DEVTOOLS_USE__:[],pt=ft.concat((e=>(t,n,r)=>e(t,n&&((...e)=>{const r=Je(t)[0],[,,,o]=Pe.get(it),i=o[r];return i?(delete o[r],i):n(...e)}),r)));lt&&(window.__SWR_DEVTOOLS_REACT__=r);const dt={dedupe:!0};Te.defineProperty((e=>{const{value:t}=e,n=(0,r.useContext)(ut),o=Ie(t),i=(0,r.useMemo)((()=>o?t(n):t),[o,n,t]),s=(0,r.useMemo)((()=>o?i:ct(n,i)),[o,n,i]),a=i&&i.provider,[c]=(0,r.useState)((()=>a?ot(a(s.cache||it),i):Ce));return c&&(s.cache=c[0],s.mutate=c[1]),Ye((()=>{if(c)return c[2]&&c[2](),c[3]}),[]),(0,r.createElement)(ut.Provider,Re(e,{value:s}))}),"defaultValue",{value:at});var ht,yt=(ht=(e,t,n)=>{const{cache:o,compare:i,suspense:s,fallbackData:a,revalidateOnMount:c,refreshInterval:u,refreshWhenHidden:l,refreshWhenOffline:f,keepPreviousData:p}=n,[d,h,y]=Pe.get(o),[g,m]=Je(e),b=(0,r.useRef)(!1),v=(0,r.useRef)(!1),w=(0,r.useRef)(g),O=(0,r.useRef)(t),S=(0,r.useRef)(n),E=()=>S.current,x=()=>E().isVisible()&&E().isOnline(),[_,j,k]=Be(o,g),P=(0,r.useRef)({}).current,$=De(a)?n.fallback[g]:a,A=(e,t)=>{let n=!0;for(const r in P){const o=r;i(t[o],e[o])||"data"===o&&De(e[o])&&i(t[o],L)||(n=!1)}return n},C=(0,r.useMemo)((()=>{const e=!!g&&!!t&&(De(c)?!E().isPaused()&&!s:c),n=()=>{const t=_(),n=Re(t);return delete n._k,e?{isValidating:!0,isLoading:!0,...n}:n};let r=n();return()=>{const e=n();return A(e,r)?r:r=e}}),[o,g]),T=(0,ke.useSyncExternalStore)((0,r.useCallback)((e=>k(g,((t,n)=>{A(t,n)||e()}))),[o,g]),C,C),D=!b.current,I=T.data,R=De(I)?$:I,N=T.error,M=(0,r.useRef)(R),L=p?De(I)?M.current:I:R,B=D&&!De(c)?c:!E().isPaused()&&(s?!De(R)&&n.revalidateIfStale:De(R)||n.revalidateIfStale),U=!!(g&&t&&D&&B),z=De(T.isValidating)?U:T.isValidating,F=De(T.isLoading)?U:T.isLoading,K=(0,r.useCallback)((async e=>{const t=O.current;if(!g||!t||v.current||E().isPaused())return!1;let r,o,s=!0;const a=e||{},c=!y[g]||!a.dedupe,u=()=>Ge?!v.current&&g===w.current&&b.current:g===w.current,l={isValidating:!1,isLoading:!1},f=()=>{j(l)},p=()=>{const e=y[g];e&&e[1]===o&&delete y[g]},d={isValidating:!0};De(_().data)&&(d.isLoading=!0);try{if(c&&(j(d),n.loadingTimeout&&De(_().data)&&setTimeout((()=>{s&&u()&&E().onLoadingSlow(g,n)}),n.loadingTimeout),y[g]=[t(m),tt()]),[r,o]=y[g],r=await r,c&&setTimeout(p,n.dedupingInterval),!y[g]||y[g][1]!==o)return c&&u()&&E().onDiscarded(g),!1;l.error=Ce;const e=h[g];if(!De(e)&&(o<=e[0]||o<=e[1]||0===e[1]))return f(),c&&u()&&E().onDiscarded(g),!1;const a=_().data;l.data=i(a,r)?a:r,c&&u()&&E().onSuccess(r,g,n)}catch(e){p();const t=E(),{shouldRetryOnError:n}=t;t.isPaused()||(l.error=e,c&&u()&&(t.onError(e,g,t),(!0===n||Ie(n)&&n(e))&&x()&&t.onErrorRetry(e,g,t,K,{retryCount:(a.retryCount||0)+1,dedupe:!0})))}return s=!1,f(),!0}),[g,o]),V=(0,r.useCallback)(((...e)=>nt(o,w.current,...e)),[]);if(Ye((()=>{O.current=t,S.current=n,De(I)||(M.current=I)})),Ye((()=>{if(!g)return;const e=K.bind(Ce,dt);let t=0;const n=((e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const e=r.indexOf(n);e>=0&&(r[e]=r[r.length-1],r.pop())}})(g,d,(n=>{if(0==n){const n=Date.now();E().revalidateOnFocus&&n>t&&x()&&(t=n+E().focusThrottleInterval,e())}else if(1==n)E().revalidateOnReconnect&&x()&&e();else if(2==n)return K()}));return v.current=!1,w.current=g,b.current=!0,j({_k:m}),B&&(De(R)||Ze?e():(e=>{Me&&typeof window.requestAnimationFrame!=Ne?window.requestAnimationFrame(e):setTimeout(e,1)})(e)),()=>{v.current=!0,n()}}),[g]),Ye((()=>{let e;function t(){const t=Ie(u)?u(R):u;t&&-1!==e&&(e=setTimeout(n,t))}function n(){_().error||!l&&!E().isVisible()||!f&&!E().isOnline()?t():K(dt).then(t)}return t(),()=>{e&&(clearTimeout(e),e=-1)}}),[u,l,f,g]),(0,r.useDebugValue)(L),s&&De(R)&&g){if(!Ge&&Ze)throw new Error("Fallback data is required when using suspense in SSR.");throw O.current=t,S.current=n,v.current=!1,De(N)?K(dt):N}return{mutate:V,get data(){return P.data=!0,L},get error(){return P.error=!0,N},get isValidating(){return P.isValidating=!0,z},get isLoading(){return P.isLoading=!0,F}}},function(...e){const t=Re(at,(0,r.useContext)(ut)),[n,o,i]=(e=>Ie(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}])(e),s=ct(t,i);let a=ht;const{use:c}=s,u=(c||[]).concat(pt);for(let e=u.length;e--;)a=u[e](a);return a(n,o||s.fetcher||null,s)}),gt=n(9442),mt=n.n(gt),bt=n(4332),vt=n.n(bt);function wt(e){const{data:t,error:n,mutate:o,isValidating:i}=yt(e?`/ws/rest/v1/visit?patient=${e}&v=${re.defaultVisitCustomRepresentation}&includeInactive=false`:null,re.openmrsFetch);var s;return{error:n,mutate:o,isValidating:i,currentVisit:(0,r.useMemo)((()=>null!==(s=null==t?void 0:t.data.results.find((e=>null===e.stopDatetime)))&&void 0!==s?s:null),[null==t?void 0:t.data.results]),isLoading:!t&&!n}}function Ot(){const[e,t]=(0,r.useState)([]);return(0,r.useEffect)((()=>{const e=(0,re.getVisitTypes)().subscribe((e=>{t(e)}),(e=>console.error(e)));return()=>e.unsubscribe()}),[]),e}mt().extend(vt());const St=10;function Et(e=[],t=St){const[n,o]=(0,r.useState)(1),i=(0,r.useMemo)((()=>"number"==typeof t&&t>0?Math.max(1,Math.ceil(e.length/t)):1),[e.length,t]);return{results:(0,r.useMemo)((()=>{const r=(n-1)*t,o=(n+0)*t;return e.slice(r,o)}),[e,n,t]),totalPages:i,currentPage:n,paginated:e.length>t,showNextButton:n<i,showPreviousButton:n>1,goTo(e){o(Math.max(1,Math.min(i,e)))},goToNext(){n<i&&o(n+1)},goToPrevious(){n>1&&o(n-1)}}}function xt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _t(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){xt(e,t,n[t])}))}return e}const jt=e=>{var{state:t,children:n,wrap:i}=e,s=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"]);const[a,c]=(0,r.useState)(),{extension:u}=(0,r.useContext)(f),p=(0,r.useRef)(null),d=(0,r.useRef)(null);(0,r.useEffect)((()=>{i&&console.warn(`'wrap' prop of Extension is being used ${(null==u?void 0:u.extensionId)?`by ${u.extensionId} in ${u.extensionSlotName}`:""}. This will be removed in a future release.`)}),[]);const h=(0,r.useCallback)((e=>{c(e)}),[c]);(0,r.useEffect)((()=>{if(null!=a&&u&&!p.current)return(0,l.renderExtension)(a,u.extensionSlotName,u.extensionSlotModuleName,u.extensionId,void 0,t).then((e=>{p.current=e})),()=>{if(p&&p.current)switch(p.current.getStatus()){case"MOUNTING":p.current.mountPromise.then(p.current.unmount);break;case"MOUNTED":p.current.unmount();break;case"UPDATING":d.current&&d.current.then((()=>{p.current&&"MOUNTED"===p.current.getStatus()&&p.current.unmount()}))}}}),[null==u?void 0:u.extensionSlotName,null==u?void 0:u.extensionId,null==u?void 0:u.extensionSlotModuleName,a]),(0,r.useEffect)((()=>(p.current&&p.current.update&&("MOUNTED"===p.current.getStatus()?p.current.update(_t({},t)):"MOUNTING"===p.current.getStatus()&&p.current.mountPromise.then((()=>{p.current&&p.current.update&&(d.current=p.current.update(_t({},t)))}))),()=>{d.current=null})),[t]);const y=o().createElement("div",_t({ref:h,"data-extension-id":null==u?void 0:u.extensionId,style:{position:"relative"}},s));return"function"!=typeof n||o().isValidElement(n)?u&&i?i(y,u):y:o().createElement(o().Fragment,null,n(y,u))}},403:()=>{System.register([],(function(e,t){return{execute:function(){e((()=>{var e={968:(e,t,n)=>{const r=n(577).R;t.s=function(e){if(e||(e=1),!n.y.meta||!n.y.meta.url)throw console.error("__system_context__",n.y),Error("systemjs-webpack-interop was provided an unknown SystemJS context. Expected context.meta.url, but none was provided");n.p=r(n.y.meta.url,e)}},577:(e,t,n)=>{t.R=function(e,t){var n=document.createElement("a");n.href=e;for(var r="/"===n.pathname[0]?n.pathname:"/"+n.pathname,o=0,i=r.length;o!==t&&i>=0;)"/"===r[--i]&&o++;if(o!==t)throw Error("systemjs-webpack-interop: rootDirectoryLevel ("+t+") is greater than the number of directories ("+o+") in the URL path "+e);var s=r.slice(0,i+1);return n.protocol+"//"+n.host+s},Number.isInteger}},n={};function r(t){var o=n[t];if(void 0!==o)return o.exports;var i=n[t]={exports:{}};return e[t](i,i.exports,r),i.exports}r.y=t,r.d=(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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&!e;)e=n[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})();var o={};return(0,r(968).s)(1),(()=>{"use strict";r.r(o),r.d(o,{createAppState:()=>a,createGlobalStore:()=>i,getAppState:()=>c,getGlobalStore:()=>s,subscribeTo:()=>u});const e=e=>{let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!=typeof o)?o:Object.assign({},t,o),n.forEach((n=>n(t,e)))}},o=()=>t,i={setState:r,getState:o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{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},t=t=>t?e(t):e,n={};function i(e,r){const o=n[e];if(o)return o.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):o.value.setState(r,!0),o.active=!0,o.value;{const o=t()((()=>r));return n[e]={value:o,active:!0},o}}function s(e,r){const o=n[e];if(!o){const o=t()((()=>null!=r?r:{}));return n[e]={value:o,active:!1},o}return o.value}function a(e){return i("app",e)}function c(){return s("app",{})}function u(e,t,n){let r=t(e.getState());return e.subscribe((e=>{const o=t(e);o!==r&&(r=o,n(o))}))}})(),o})())}}}))},1686:(e,t,n)=>{"use strict";n.d(t,{jk:()=>s,W5:()=>c,zJ:()=>a,se:()=>u});const r=e=>{let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!=typeof o)?o:Object.assign({},t,o),n.forEach((n=>n(t,e)))}},o=()=>t,i={setState:r,getState:o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{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},o=e=>e?r(e):r,i={};function s(e,t){const n=i[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;{const n=o()((()=>t));return i[e]={value:n,active:!0},n}}function a(e,t){const n=i[e];if(!n){const n=o()((()=>null!=t?t:{}));return i[e]={value:n,active:!1},n}return n.value}function c(){return a("app",{})}function u(e,t,n){let r=t(e.getState());return e.subscribe((e=>{const o=t(e);o!==r&&(r=o,n(o))}))}},171:(e,t,n)=>{"use strict";n.d(t,{Te:()=>rn,cW:()=>Qt,VM:()=>Yt,fu:()=>Ot,K4:()=>Ct,c0:()=>wt,CF:()=>_t,$d:()=>Xt});var r=n(5776),o=n.n(r),i=n(4666),s={};try{process.env.CARBON_ENABLE_CSS_CUSTOM_PROPERTIES&&"true"===process.env.CARBON_ENABLE_CSS_CUSTOM_PROPERTIES?s.enableCssCustomProperties=!0:s.enableCssCustomProperties=!1,process.env.CARBON_ENABLE_USE_CONTROLLED_STATE_WITH_VALUE&&"true"===process.env.CARBON_ENABLE_USE_CONTROLLED_STATE_WITH_VALUE?s.enableUseControlledStateWithValue=!0:s.enableUseControlledStateWithValue=!1,process.env.CARBON_ENABLE_CSS_GRID&&"true"===process.env.CARBON_ENABLE_CSS_GRID?s.enableCssGrid=!0:s.enableCssGrid=!1,process.env.CARBON_ENABLE_V11_RELEASE&&"true"===process.env.CARBON_ENABLE_V11_RELEASE?s.enableV11Release=!0:s.enableV11Release=!1}catch(e){s.enableCssCustomProperties=!1,s.enableUseControlledStateWithValue=!1,s.enableCssGrid=!1,s.enableV11Release=!1}var a=[{name:"enable-css-custom-properties",description:"Describe what the flag does",enabled:s.enableCssCustomProperties},{name:"enable-use-controlled-state-with-value",description:"Enable components to be created in either a controlled or uncontrolled mode\n",enabled:s.enableUseControlledStateWithValue},{name:"enable-css-grid",description:"Enable CSS Grid Layout in the Grid and Column React components\n",enabled:s.enableCssGrid},{name:"enable-v11-release",description:"Enable the features and functionality for the v11 Release\n",enabled:s.enableV11Release}];function c(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 u(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=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);s=!0);}catch(e){a=!0,o=e}finally{try{s||null==n.return||n.return()}finally{if(a)throw o}}return i}}(e,t)||l(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 l(e,t){if(e){if("string"==typeof e)return f(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)?f(e,t):void 0}}function f(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}for(var p=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(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=l(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,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}(e.flags);try{for(n.s();!(t=n.n()).done;){var r=u(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&&c(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),d=new p(undefined),h=0;h<a.length;h++){var y=a[h];d.add(y.name,y.enabled)}function g(){return d.enabled.apply(d,arguments)}function m(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}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){S(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function w(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 O(e,t,n){return t&&w(e.prototype,t),n&&w(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function S(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E(){return E=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},E.apply(this,arguments)}function x(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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&j(e,t)}function _(e){return _=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_(e)}function j(e,t){return j=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},j(e,t)}function k(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}function P(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}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=_(e);if(t){var o=_(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return P(e)}(this,n)}}function A(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=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);s=!0);}catch(e){a=!0,o=e}finally{try{s||null==n.return||n.return()}finally{if(a)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.")}()}function C(e,t){if(e){if("string"==typeof e)return T(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)?T(e,t):void 0}}function T(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(){d.merge.apply(d,arguments)}({"enable-css-custom-properties":!0,"enable-css-grid":!0,"enable-v11-release":!0});var D=n(216),I=n.n(D),R=n(841),N=n.n(R);function M(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}function L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?M(Object(n),!0).forEach((function(t){B(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function B(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function U(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}var z=["width","height","viewBox"],F=["tabindex"],K={focusable:"false",preserveAspectRatio:"xMidYMid meet"};function V(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}function q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?V(Object(n),!0).forEach((function(t){H(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function H(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W(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}var G=["className","children","tabIndex"],Z=["tabindex"],Y=o().forwardRef((function(e,t){var n=e.className,r=e.children,i=e.tabIndex,s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,n=e.height,r=e.viewBox,o=void 0===r?"0 0 ".concat(t," ").concat(n):r,i=U(e,z),s=i.tabindex,a=U(i,F),c=L(L(L({},K),a),{},{width:t,height:n,viewBox:o});return c["aria-label"]||c["aria-labelledby"]||c.title?(c.role="img",null!=s&&(c.focusable="true",c.tabindex=s)):c["aria-hidden"]=!0,c}(q(q({},W(e,G)),{},{tabindex:i})),a=s.tabindex,c=W(s,Z);return n&&(c.className=n),null!=a&&(c.tabIndex=a),t&&(c.ref=t),o().createElement("svg",c,r)}));Y.displayName="Icon",Y.propTypes={"aria-hidden":I().string,"aria-label":I().string,"aria-labelledby":I().string,children:I().node,className:I().string,height:I().oneOfType([I().number,I().string]),preserveAspectRatio:I().string,tabIndex:I().string,viewBox:I().string,width:I().oneOfType([I().number,I().string]),xmlns:I().string},Y.defaultProps={xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid meet"},I().oneOfType([I().number,I().string]);var X,Q,J,ee,te,ne,re=["children","size"],oe=["children","size"],ie=["children","size"],se=o().forwardRef((function(e,t){var n=e.children,r=e.size,i=void 0===r?16:r,s=W(e,re);return o().createElement(Y,q({width:i,height:i,ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},s),X||(X=o().createElement("path",{d:"M26,4H6A2,2,0,0,0,4,6V26a2,2,0,0,0,2,2H26a2,2,0,0,0,2-2V6A2,2,0,0,0,26,4ZM6,26V6H26V26Z"})),n)})),ae=o().forwardRef((function(e,t){var n=e.children,r=e.size,i=void 0===r?16:r,s=W(e,oe);return o().createElement(Y,q({width:i,height:i,ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},s),Q||(Q=o().createElement("path",{d:"M26,4H6A2,2,0,0,0,4,6V26a2,2,0,0,0,2,2H26a2,2,0,0,0,2-2V6A2,2,0,0,0,26,4ZM14,21.5,9,16.5427,10.5908,15,14,18.3456,21.4087,11l1.5918,1.5772Z"})),J||(J=o().createElement("path",{fill:"none",d:"M14,21.5,9,16.5427,10.5908,15,14,18.3456,21.4087,11l1.5918,1.5772Z","data-icon-path":"inner-path"})),n)})),ce=o().forwardRef((function(e,t){var n=e.children,r=e.size,i=void 0===r?16:r,s=W(e,ie);return"glyph"===i||"glyph"===i||"glyphpx"===i?o().createElement(Y,q({width:i,height:i,ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 10 6",fill:"currentColor"},s),ee||(ee=o().createElement("path",{d:"M5 6L0 1 0.7 0.3 5 4.6 9.3 0.3 10 1z"})),n):16===i||"16"===i||"16px"===i?o().createElement(Y,q({width:i,height:i,ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},s),te||(te=o().createElement("path",{d:"M8 11L3 6 3.7 5.3 8 9.6 12.3 5.3 13 6z"})),n):o().createElement(Y,q({width:i,height:i,ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},s),ne||(ne=o().createElement("path",{d:"M16 22L6 12 7.4 10.6 16 19.2 24.6 10.6 26 12z"})),n)})),ue=o().createContext("cds");function le(){return o().useContext(ue)}var fe=["children","className","href","disabled","inline","visited","renderIcon","size"],pe=o().forwardRef((function(e,t){var n,r=e.children,i=e.className,s=e.href,a=e.disabled,c=void 0!==a&&a,u=e.inline,l=void 0!==u&&u,f=e.visited,p=void 0!==f&&f,d=e.renderIcon,h=e.size,y=k(e,fe),g=le(),m={className:N()("".concat(g,"--link"),i,(S(n={},"".concat(g,"--link--disabled"),c),S(n,"".concat(g,"--link--inline"),l),S(n,"".concat(g,"--link--visited"),p),S(n,"".concat(g,"--link--").concat(h),h),n)),rel:"_blank"===y.target?"noopener":null};return c?(m.role="link",m["aria-disabled"]=!0):m.href=s,o().createElement("a",E({ref:t},m,y),r,!l&&d&&o().createElement("div",{className:"".concat(g,"--link__icon")},o().createElement(d,null)))}));pe.displayName="Link",pe.propTypes={children:I().node,className:I().string,disabled:I().bool,href:I().string,inline:I().bool,renderIcon:I().oneOfType([I().func,I().object]),size:I().oneOf(["sm","md","lg"]),visited:I().bool};var de=pe,he={};function ye(e,t){return function(t,n,r){if(void 0!==t[n]){he[r]&&he[r][n]||(he[r]=b(b({},he[r]),{},S({},n,!0)));for(var o=arguments.length,i=new Array(o>3?o-3:0),s=3;s<o;s++)i[s-3]=arguments[s];return e.apply(void 0,[t,n,r].concat(i))}}}var ge=function(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];for(var i=0;i<e.length&&!t.defaultPrevented;i++)"function"==typeof e[i]&&e[i].apply(e,[t].concat(r))}},me="undefined"!=typeof window?r.useLayoutEffect:r.useEffect;function be(e){if(function(e){if(e.tabIndex<0)return!1;if(e.disabled)return!1;switch(e.nodeName){case"A":return!!e.href&&"ignore"!==e.rel;case"INPUT":return"hidden"!==e.type;case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}}(e))return e;var t,n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=C(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,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}(e.childNodes);try{for(n.s();!(t=n.n()).done;){var r=be(t.value);if(r)return r}}catch(e){n.e(e)}finally{n.f()}return null}function ve(e,t){for(var n=0;n<t.length;n++)if(we(e,t[n]))return!0;return!1}function we(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.key,r=t.which,o=t.keyCode,i=t.code;return"string"==typeof e?e===n:"number"==typeof e?e===r||e===o:e.key&&Array.isArray(n)?-1!==n.indexOf(e.key):e.key===n||e.which===r||e.keyCode===o||e.code===i}var Oe,Se,Ee,xe,_e={key:"Enter",which:13,keyCode:13,code:"Enter"},je={key:" ",which:32,keyCode:32,code:"Space"},ke=["children","className","light"],Pe=["children","className","clicked","href","light","onClick","onKeyDown"],$e=["children","className","disabled","id","light","name","onClick","onChange","onKeyDown","selected","tabIndex","title","value"],Ae=["tabIndex","className","children","expanded","tileMaxHeight","tilePadding","onClick","onKeyUp","tileCollapsedIconText","tileExpandedIconText","tileCollapsedLabel","tileExpandedLabel","light"],Ce=o().forwardRef((function(e,t){var n=e.children,r=e.className,i=e.light,s=void 0!==i&&i,a=k(e,ke),c=le(),u=N()("".concat(c,"--tile"),S({},"".concat(c,"--tile--light"),s),r);return o().createElement("div",E({className:u,ref:t},a),n)}));Ce.displayName="Tile",Ce.propTypes={children:I().node,className:I().string,light:ye(I().bool)};var Te=o().forwardRef((function(e,t){var n,i=e.children,s=e.className,a=e.clicked,c=void 0!==a&&a,u=e.href,l=e.light,f=e.onClick,p=void 0===f?function(){}:f,d=e.onKeyDown,h=void 0===d?function(){}:d,y=k(e,Pe),g=le(),m=N()("".concat(g,"--tile"),"".concat(g,"--tile--clickable"),(S(n={},"".concat(g,"--tile--is-clicked"),c),S(n,"".concat(g,"--tile--light"),l),n),s),b=A((0,r.useState)(c),2),v=b[0],w=b[1];return o().createElement(de,E({className:m,href:u,onClick:function(e){e.persist(),w(!v),p(e)},onKeyDown:function(e){e.persist(),ve(e,[_e,je])&&(e.preventDefault(),w(!v),h(e)),h(e)},ref:t},y),i)}));Te.displayName="ClickableTile",Te.propTypes={children:I().node,className:I().string,clicked:I().bool,href:I().string,light:ye(I().bool),onClick:I().func,onKeyDown:I().func,rel:I().string};var De=o().forwardRef((function(e,t){var n,i=e.children,s=e.className,a=e.disabled,c=e.id,u=e.light,l=e.name,f=e.onClick,p=void 0===f?function(){}:f,d=e.onChange,h=void 0===d?function(){}:d,y=e.onKeyDown,g=void 0===y?function(){}:y,m=e.selected,b=void 0!==m&&m,v=e.tabIndex,w=void 0===v?0:v,O=e.title,x=void 0===O?"title":O,_=e.value,j=void 0===_?"value":_,P=k(e,$e),$=le(),C=p,T=g,D=A((0,r.useState)(b),2),I=D[0],R=D[1],M=A((0,r.useState)(b),2),L=M[0],B=M[1],U=N()("".concat($,"--tile"),"".concat($,"--tile--selectable"),(S(n={},"".concat($,"--tile--is-selected"),I),S(n,"".concat($,"--tile--light"),u),S(n,"".concat($,"--tile--disabled"),a),n),s),z=N()("".concat($,"--tile-input"),S({},"".concat($,"--tile-input--checked"),I));return b!==L&&(R(b),B(b)),o().createElement(o().Fragment,null,o().createElement("input",{checked:I,className:z,disabled:a,id:c,name:l,onChange:a?null:function(e){R(e.target.checked),h(e)},ref:t,tabIndex:-1,title:x,type:"checkbox",value:j}),o().createElement("label",E({className:U,htmlFor:c,onClick:a?null:function(e){e.preventDefault(),e.persist(),R(!I),C(e),h(e)},onKeyDown:a?null:function(e){e.persist(),ve(e,[_e,je])&&(e.preventDefault(),R(!I),h(e)),T(e)},tabIndex:a?null:w},P),o().createElement("span",{className:"".concat($,"--tile__checkmark ").concat($,"--tile__checkmark--persistent")},I?Oe||(Oe=o().createElement(ae,null)):Se||(Se=o().createElement(se,null))),o().createElement("span",{className:"".concat($,"--tile-content")},i)))}));function Ie(e){var t,n,i=e.tabIndex,s=e.className,a=e.children,c=e.expanded,u=e.tileMaxHeight,l=e.tilePadding,f=e.onClick,p=e.onKeyUp,d=e.tileCollapsedIconText,h=e.tileExpandedIconText,y=e.tileCollapsedLabel,g=e.tileExpandedLabel,m=e.light,b=k(e,Ae),v=A((0,r.useState)(u),2),w=v[0],O=v[1],x=A((0,r.useState)(l),2),_=x[0],j=x[1],P=A((0,r.useState)(c),2),$=P[0],C=P[1],T=A((0,r.useState)(u),2),D=T[0],I=T[1],R=A((0,r.useState)(l),2),M=R[0],L=R[1],B=A((0,r.useState)(c),2),U=B[0],z=B[1],F=A((0,r.useState)(!1),2),K=F[0],V=F[1],q=(0,r.useRef)(null),H=(0,r.useRef)(null),W=(0,r.useRef)(null),G=(0,r.useRef)(null),Z=le();function Y(){U&&O(W.current.getBoundingClientRect().height),O(q.current.getBoundingClientRect().height)}function X(e){e.persist(),z(!U),Y(),f&&f(e)}function Q(e){e.target!==G.current&&ve(e,[_e,je])&&e.preventDefault()}c!==$&&(z(c),C(c),Y()),u!==D&&(O(u),I(u)),l!==M&&(j(l),L(l));var J=N()("".concat(Z,"--tile"),"".concat(Z,"--tile--expandable"),(S(t={},"".concat(Z,"--tile--is-expanded"),U),S(t,"".concat(Z,"--tile--light"),m),t),s),ee=N()("".concat(Z,"--tile"),"".concat(Z,"--tile--expandable"),"".concat(Z,"--tile--expandable--interactive"),(S(n={},"".concat(Z,"--tile--is-expanded"),U),S(n,"".concat(Z,"--tile--light"),m),n),s),te=N()("".concat(Z,"--tile__chevron"),"".concat(Z,"--tile__chevron--interactive")),ne={maxHeight:U?null:w+_},re=o().Children.toArray(a);return me((function(){var e=window.getComputedStyle(G.current,null),t=q.current.getBoundingClientRect().height,n=parseInt(e.getPropertyValue("padding-top"),10),r=parseInt(e.getPropertyValue("padding-bottom"),10);O(t),j(n+r)}),[]),me((function(){(be(H.current)||be(q.current))&&V(!0)}),[]),(0,r.useEffect)((function(){var e=new ResizeObserver((function(e){var t=A(e,1)[0];O(t.contentRect.height)}));return e.observe(q.current),function(){return e.disconnect()}}),[]),K?o().createElement("div",E({ref:G,style:ne,className:ee,"aria-expanded":U},b),o().createElement("div",{ref:W},o().createElement("div",{ref:q,className:"".concat(Z,"--tile-content")},re[0]),o().createElement("button",{type:"button","aria-expanded":U,onKeyUp:ge([p,Q]),onClick:ge([f,X]),"aria-label":U?h:d,className:te},Ee||(Ee=o().createElement(ce,null))),o().createElement("div",{ref:H,className:"".concat(Z,"--tile-content")},re[1]))):o().createElement("button",E({type:"button",ref:G,style:ne,className:J,"aria-expanded":U,title:U?h:d},b,{onKeyUp:ge([p,Q]),onClick:ge([f,X]),tabIndex:i}),o().createElement("div",{ref:W},o().createElement("div",{ref:q,className:"".concat(Z,"--tile-content")},re[0]),o().createElement("div",{className:"".concat(Z,"--tile__chevron")},o().createElement("span",null,U?g:y),xe||(xe=o().createElement(ce,null))),o().createElement("div",{ref:H,className:"".concat(Z,"--tile-content")},re[1])))}De.displayName="SelectableTile",De.propTypes={children:I().node,className:I().string,disabled:I().bool,id:I().string,light:ye(I().bool),name:I().string,onChange:I().func,onClick:I().func,onKeyDown:I().func,selected:I().bool,tabIndex:I().number,title:I().string,value:I().oneOfType([I().string,I().number]).isRequired},Ie.propTypes={children:I().node,className:I().string,expanded:I().bool,id:I().string,light:ye(I().bool),onClick:I().func,onKeyUp:I().func,tabIndex:I().number,tileCollapsedIconText:I().string,tileCollapsedLabel:I().string,tileExpandedIconText:I().string,tileExpandedLabel:I().string},Ie.defaultProps={tabIndex:0,expanded:!1,tileMaxHeight:0,tilePadding:0,onClick:function(){},tileCollapsedIconText:"Interact to expand Tile",tileExpandedIconText:"Interact to collapse Tile"},Ie.displayName="ExpandableTile";var Re=o().forwardRef((function(e,t){var n=e.children,r=le();return o().createElement("span",{ref:t,className:"".concat(r,"--tile-content__above-the-fold")},n)}));Re.propTypes={children:I().node},Re.displayName="TileAboveTheFoldContent";var Ne,Me,Le,Be=o().forwardRef((function(e,t){var n=e.children,r=le();return o().createElement("span",{ref:t,className:"".concat(r,"--tile-content__below-the-fold")},n)}));Be.propTypes={children:I().node},Be.displayName="TileBelowTheFoldContent";var Ue=["children","className","light"],ze=["children","href","className","handleClick","handleKeyDown","onClick","onKeyDown","clicked","light"],Fe=["children","id","tabIndex","value","name","title","iconDescription","className","handleClick","handleKeyDown","onClick","onChange","onKeyDown","light","disabled","selected"],Ke=["tabIndex","className","expanded","tileMaxHeight","tilePadding","handleClick","onKeyUp","tileCollapsedIconText","tileExpandedIconText","tileCollapsedLabel","tileExpandedLabel","onBeforeClick","light"],Ve=function(e){x(n,e);var t=$(n);function n(){return v(this,n),t.apply(this,arguments)}return O(n,[{key:"render",value:function(){var e=this.context,t=this.props,n=t.children,r=t.className,i=t.light,s=k(t,Ue),a=N()("".concat(e,"--tile"),S({},"".concat(e,"--tile--light"),i),r);return o().createElement("div",E({className:a},s),n)}}]),n}(r.Component);S(Ve,"propTypes",{children:I().node,className:I().string,light:I().bool}),S(Ve,"contextType",ue),S(Ve,"defaultProps",{light:!1});var qe=function(e){x(n,e);var t=$(n);function n(){var e;v(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return S(P(e=t.call.apply(t,[this].concat(o))),"state",{}),S(P(e),"handleClick",(function(t){t.persist(),e.setState({clicked:!e.state.clicked},(function(){var n,r,o,i;(null===(n=(r=e.props).handleClick)||void 0===n?void 0:n.call(r,t))||null===(o=(i=e.props).onClick)||void 0===o||o.call(i,t)}))})),S(P(e),"handleKeyDown",(function(t){var n,r;t.persist(),ve(t,[_e,je])?e.setState({clicked:!e.state.clicked},(function(){var n,r;(null===(n=(r=e.props).handleKeyDown)||void 0===n?void 0:n.call(r,t))||e.props.onKeyDown(t)})):(null===(n=(r=e.props).handleKeyDown)||void 0===n?void 0:n.call(r,t))||e.props.onKeyDown(t)})),e}return O(n,[{key:"render",value:function(){var e,t=this.context,n=this.props,r=n.children,i=n.href,s=n.className;n.handleClick,n.handleKeyDown,n.onClick,n.onKeyDown,n.clicked;var a=n.light,c=k(n,ze),u=N()("".concat(t,"--tile"),"".concat(t,"--tile--clickable"),(S(e={},"".concat(t,"--tile--is-clicked"),this.state.clicked),S(e,"".concat(t,"--tile--light"),a),e),s);return o().createElement(de,E({href:i,className:u},c,{onClick:this.handleClick,onKeyDown:this.handleKeyDown}),r)}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.clicked;return t.prevClicked===n?null:{clicked:n,prevClicked:n}}}]),n}(r.Component);function He(e){var t,n=e.children,i=e.id,s=e.tabIndex,a=e.value,c=e.name,u=e.title;e.iconDescription;var l=e.className,f=e.handleClick,p=e.handleKeyDown,d=e.onClick,h=e.onChange,y=e.onKeyDown,g=e.light,m=e.disabled,b=e.selected,v=k(e,Fe),w=le(),O=f||d,x=p||y,_=A((0,r.useState)(b),2),j=_[0],P=_[1],$=(0,r.useRef)(null),C=N()("".concat(w,"--tile"),"".concat(w,"--tile--selectable"),(S(t={},"".concat(w,"--tile--is-selected"),j),S(t,"".concat(w,"--tile--light"),g),S(t,"".concat(w,"--tile--disabled"),m),t),l),T=N()("".concat(w,"--tile-input"),S({},"".concat(w,"--tile-input--checked"),j));return(0,r.useEffect)((function(){P(b)}),[b]),o().createElement(o().Fragment,null,o().createElement("input",{ref:$,tabIndex:-1,id:i,className:T,value:a,onChange:m?null:function(e){P(e.target.checked),h(e)},type:"checkbox",disabled:m,name:c,title:u,checked:j}),o().createElement("label",E({htmlFor:i,className:C,tabIndex:m?null:s},v,{onClick:m?null:function(e){e.preventDefault(),e.persist(),P(!j),O(e),h(e)},onKeyDown:m?null:function(e){e.persist(),ve(e,[_e,je])&&(e.preventDefault(),P(!j),h(e)),x(e)}}),o().createElement("span",{className:"".concat(w,"--tile__checkmark ").concat(w,"--tile__checkmark--persistent")},j?Ne||(Ne=o().createElement(ae,null)):Me||(Me=o().createElement(se,null))),o().createElement("span",{className:"".concat(w,"--tile-content")},n)))}S(qe,"propTypes",{children:I().node,className:I().string,handleClick:ye(I().func),handleKeyDown:ye(I().func),href:I().string,light:I().bool,onClick:I().func,onKeyDown:I().func,rel:I().string}),S(qe,"contextType",ue),S(qe,"defaultProps",{clicked:!1,onClick:function(){},onKeyDown:function(){},light:!1}),He.defaultProps={value:"value",title:"title",selected:!1,tabIndex:0,light:!1,onClick:function(){},onChange:function(){},onKeyDown:function(){}},He.propTypes={children:I().node,className:I().string,disabled:I().bool,handleClick:ye(I().func),handleKeyDown:ye(I().func),iconDescription:ye(I().string),id:I().string,light:I().bool,name:I().string,onChange:I().func,onClick:I().func,onKeyDown:I().func,selected:I().bool,tabIndex:I().number,title:I().string,value:I().oneOfType([I().string,I().number]).isRequired};var We=function(e){x(n,e);var t=$(n);function n(){var e;v(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return S(P(e=t.call.apply(t,[this].concat(i))),"state",{}),S(P(e),"resizeObserver",null),S(P(e),"componentDidMount",(function(){if(e.resizeObserver=new ResizeObserver((function(t){var n=A(t,1)[0];e.setState({tileMaxHeight:n.contentRect.height})})),e.tile){var t=window.getComputedStyle(e.tile,null);e.aboveTheFold&&(e.resizeObserver.observe(e.aboveTheFold),e.setState({tileMaxHeight:e.aboveTheFold.getBoundingClientRect().height,tilePadding:parseInt(t.getPropertyValue("padding-top"),10)+parseInt(t.getPropertyValue("padding-bottom"),10)}))}})),S(P(e),"componentDidUpdate",(function(t){t.expanded!==e.props.expanded&&e.setMaxHeight()})),S(P(e),"setMaxHeight",(function(){(e.state.expanded?e.tileContent:e.aboveTheFold)&&e.setState({tileMaxHeight:e.state.expanded?e.tileContent.getBoundingClientRect().height:e.aboveTheFold.getBoundingClientRect().height})})),S(P(e),"handleClick",(function(t){e.props.onBeforeClick(t)&&"INPUT"!==t.target.tagName&&(t.persist(),e.setState({expanded:!e.state.expanded},(function(){var n,r,o,i;e.setMaxHeight(),(null===(n=(r=e.props).handleClick)||void 0===n?void 0:n.call(r,t))||null===(o=(i=e.props).onClick)||void 0===o||o.call(i,t)})))})),S(P(e),"handleKeyUp",(function(t){t.target!==e.tile&&ve(t,[_e,je])&&t.preventDefault()})),S(P(e),"getChildren",(function(){return o().Children.toArray(e.props.children)})),e}return O(n,[{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect()}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.tabIndex,i=n.className;n.expanded,n.tileMaxHeight,n.tilePadding,n.handleClick;var s=n.onKeyUp,a=n.tileCollapsedIconText,c=n.tileExpandedIconText,u=n.tileCollapsedLabel,l=n.tileExpandedLabel;n.onBeforeClick;var f=n.light,p=k(n,Ke),d=this.context,h=this.state.expanded,y=N()("".concat(d,"--tile"),"".concat(d,"--tile--expandable"),(S(e={},"".concat(d,"--tile--is-expanded"),h),S(e,"".concat(d,"--tile--light"),f),e),i),g={maxHeight:h?null:this.state.tileMaxHeight+this.state.tilePadding},m=this.getChildren();return o().createElement("button",E({type:"button",ref:function(e){t.tile=e},style:g,className:y,"aria-expanded":h,title:h?c:a},p,{onKeyUp:ge([s,this.handleKeyUp]),onClick:this.handleClick,tabIndex:r}),o().createElement("div",{ref:function(e){t.tileContent=e}},o().createElement("div",{ref:function(e){t.aboveTheFold=e},className:"".concat(d,"--tile-content")},m[0]),o().createElement("div",{className:"".concat(d,"--tile__chevron")},o().createElement("span",null,h?l:u),Le||(Le=o().createElement(ce,null))),o().createElement("div",{className:"".concat(d,"--tile-content")},m[1])))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.expanded,r=e.tileMaxHeight,o=e.tilePadding,i=t.prevExpanded,s=t.prevTileMaxHeight,a=t.prevTilePadding,c=t.expanded,u=t.tileMaxHeight,l=t.tilePadding,f=i!==n,p=s!==r,d=a!==o;return f||p||d?{expanded:f?n:c,tileMaxHeight:p?r:u,tilePadding:d?o:l,prevExpanded:n,prevTileMaxHeight:r,prevTilePadding:o}:null}}]),n}(r.Component);S(We,"propTypes",{children:I().node,className:I().string,expanded:I().bool,handleClick:ye(I().func),id:I().string,light:I().bool,onBeforeClick:I().func,onClick:I().func,onKeyUp:I().func,tabIndex:I().number,tileCollapsedIconText:I().string,tileCollapsedLabel:I().string,tileExpandedIconText:I().string,tileExpandedLabel:I().string}),S(We,"contextType",ue),S(We,"defaultProps",{tabIndex:0,expanded:!1,tileMaxHeight:0,tilePadding:0,onBeforeClick:function(){return!0},onClick:function(){},tileCollapsedIconText:"Interact to expand Tile",tileExpandedIconText:"Interact to collapse Tile",light:!1});var Ge=function(e){x(n,e);var t=$(n);function n(){return v(this,n),t.apply(this,arguments)}return O(n,[{key:"render",value:function(){var e=this.context,t=this.props.children;return o().createElement("span",{className:"".concat(e,"--tile-content__above-the-fold")},t)}}]),n}(r.Component);S(Ge,"propTypes",{children:I().node}),S(Ge,"contextType",ue);var Ze=function(e){x(n,e);var t=$(n);function n(){return v(this,n),t.apply(this,arguments)}return O(n,[{key:"render",value:function(){var e=this.props.children,t=this.context;return o().createElement("span",{className:"".concat(t,"--tile-content__below-the-fold")},e)}}]),n}(r.Component);S(Ze,"propTypes",{children:I().node}),S(Ze,"contextType",ue);var Ye=g("enable-v11-release")?Ce:Ve;g("enable-v11-release"),g("enable-v11-release"),g("enable-v11-release"),g("enable-v11-release"),g("enable-v11-release");var Xe,Qe=(Xe={"aria-label":I().string,"aria-labelledby":I().string},Object.keys(Xe).reduce((function(e,t){return b(b({},e),{},S({},t,(n=Xe[t],function(e,t,r){for(var o=arguments.length,i=new Array(o>3?o-3:0),s=3;s<o;s++)i[s-3]=arguments[s];return n.apply(void 0,[e,t,r].concat(i))})));var n}),{})),Je=["SideNavFooter","SideNavHeader","SideNavItems","SideNavMenu"],et=["expanded","defaultExpanded","isChildOfHeader","aria-label","aria-labelledby","children","onToggle","className","isFixedNav","isRail","isPersistent","addFocusListeners","addMouseListeners","onOverlayClick"],tt=o().forwardRef((function(e,t){var n,i,s=e.expanded,a=e.defaultExpanded,c=e.isChildOfHeader,u=e["aria-label"],l=e["aria-labelledby"],f=e.children,p=e.onToggle,d=e.className,h=e.isFixedNav,y=e.isRail,g=e.isPersistent,m=e.addFocusListeners,v=e.addMouseListeners,w=e.onOverlayClick,O=k(e,et),x=le(),_=(0,r.useRef)(void 0!==s).current,j=A((0,r.useState)(a),2),P=j[0],$=j[1],C=A((0,r.useState)(a),2),T=C[0],D=C[1],I=_?s:P,R=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:!I;_||$(t),p&&p(e,t),(_||y)&&D(t)},M={"aria-label":u,"aria-labelledby":l},L=N()((S(n={},"".concat(x,"--side-nav"),!0),S(n,"".concat(x,"--side-nav--expanded"),I||T),S(n,"".concat(x,"--side-nav--collapsed"),!I&&h),S(n,"".concat(x,"--side-nav--rail"),y),S(n,d,!!d),S(n,"".concat(x,"--side-nav--ux"),c),S(n,"".concat(x,"--side-nav--hidden"),!g),n)),B=N()((S(i={},"".concat(x,"--side-nav__overlay"),!0),S(i,"".concat(x,"--side-nav__overlay-active"),I||T),i)),U=f;y&&(U=o().Children.map(f,(function(e){var t,n,r,i=_&&T||I;return o().cloneElement(e,b({},Je.includes(null!==(t=null===(n=e.type)||void 0===n?void 0:n.displayName)&&void 0!==t?t:null===(r=e.type)||void 0===r?void 0:r.name)?{isSideNavExpanded:i}:{}))})));var z={};return m&&(z.onFocus=function(e){e.currentTarget.contains(e.relatedTarget)||R(e,!0)},z.onBlur=function(e){e.currentTarget.contains(e.relatedTarget)||R(e,!1)}),v&&y&&(z.onMouseEnter=function(){return R(!0,!0)},z.onMouseLeave=function(){return R(!1,!1)}),o().createElement(o().Fragment,null,h?null:o().createElement("div",{className:B,onClick:w}),o().createElement("nav",E({ref:t,className:"".concat(x,"--side-nav__navigation ").concat(L)},M,z,O),U))}));tt.displayName="SideNav",tt.defaultProps={defaultExpanded:!1,isChildOfHeader:!0,isFixedNav:!1,isPersistent:!0,addFocusListeners:!0,addMouseListeners:!0},tt.propTypes=b(b({},Qe),{},{addFocusListeners:I().bool,addMouseListeners:I().bool,className:I().string,defaultExpanded:I().bool,expanded:I().bool,isChildOfHeader:I().bool,isFixedNav:I().bool,isPersistent:I().bool,isRail:I().bool,onOverlayClick:I().func,onToggle:I().func});var nt=tt,rt=n(9295),ot=n(606),it=n(175),st=n(6575),at=n(6905),ct=n(595),ut=n(9494),lt=n(8396),ft=Object.prototype.hasOwnProperty;const pt=function(e){if(null==e)return!0;if((0,at.Z)(e)&&((0,st.Z)(e)||"string"==typeof e||"function"==typeof e.splice||(0,ct.Z)(e)||(0,lt.Z)(e)||(0,it.Z)(e)))return!e.length;var t=(0,ot.Z)(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if((0,ut.Z)(e))return!(0,rt.Z)(e).length;for(var n in e)if(ft.call(e,n))return!1;return!0};function dt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ht(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){dt(e,t,n[t])}))}return e}function yt(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}n(4645);const gt=new i.Subject;let mt=0;const bt=new i.Subject;let vt=0;function wt(e){var t;e&&("string"==typeof(t=e.description)?t.trim().length>0:"object"==typeof t&&!pt(t))?setTimeout((()=>{gt.next(yt(ht({},e),{id:mt++}))}),0):console.error("showNotification must be called with an object having a 'description' property that is a non-empty string or object")}function Ot(e){var t;e&&("string"==typeof(t=e.actionButtonLabel)?t.trim().length>0:"object"==typeof t&&!pt(t))?setTimeout((()=>{bt.next(yt(ht({},e),{id:vt++}))}),0):console.error("showActionableNotification must be called with an actionButtonLabel that is a non-empty string")}function St(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Et=new i.Subject;let xt=0;function _t(e){var t;e&&("string"==typeof(t=e.description)?t.trim().length>0:"object"==typeof t&&!pt(t))?setTimeout((()=>{var t,n;Et.next((t=function(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){St(e,t,n[t])}))}return e}({},e),n=null!=(n={id:xt++})?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})),t))}),0):console.error("showToast must be called with an object having a 'description' property that is a non-empty string or object")}n(3196);var jt=n(403);function kt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pt(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){kt(e,t,n[t])}))}return e}function $t(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}const At=(0,jt.createGlobalStore)("globalModalState",{modalContainer:null,modalStack:[]});function Ct(e,t={},n=(()=>{})){const r=()=>{const e=At.getState().modalStack.find((e=>e.onClose===n));e&&function(e){const t=At.getState(),n=t.modalStack.map((t=>t===e?$t(Pt({},t),{state:"TO_BE_DELETED"}):t));At.setState($t(Pt({},t),{modalStack:n}))}(e)};return function(e){const t=At.getState(),n=[e,...t.modalStack];At.setState($t(Pt({},t),{modalStack:n}))}({state:"NEW",onClose:n,extensionId:e,props:Pt({extensionId:e,close:r},t)}),r}window.getComputedStyle(document.body).overflow;var Tt=n(5492),Dt=n(487),It=n.n(Dt),Rt=n(631),Nt=n.n(Rt),Mt=n(2052),Lt=n.n(Mt),Bt=n(4010),Ut=n.n(Bt),zt=n(1469),Ft=n.n(zt),Kt=n(9329),Vt=n.n(Kt),qt=n(6618),Ht={};Ht.styleTagTransform=Vt(),Ht.setAttributes=Ut(),Ht.insert=Lt().bind(null,"head"),Ht.domAPI=Nt(),Ht.insertStyleElement=Ft(),It()(qt.Z,Ht);const Wt=qt.Z&&qt.Z.locals?qt.Z.locals:void 0;function Gt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Zt=(0,jt.createGlobalStore)("left-nav",{slotName:null,basePath:window.spaBase});function Yt({name:e,basePath:t}){Zt.setState({slotName:e,basePath:t})}function Xt(e){Zt.getState().slotName==e&&Zt.setState({slotName:null})}const Qt=o().forwardRef(((e,t)=>{const{slotName:n,basePath:r}=(0,Tt.useStore)(Zt);var i;const s=null!==(i=window.location)&&void 0!==i?i:{pathname:""};return o().createElement(nt,function(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){Gt(e,t,n[t])}))}return e}({ref:t,expanded:!0,"aria-label":"Left navigation",className:Wt.leftNav},e),o().createElement(Tt.ExtensionSlot,{name:"global-nav-menu-slot"}),n?o().createElement(Tt.ExtensionSlot,{name:n,state:{basePath:r,currentPath:s}}):null)}));var Jt=n(2680),en=n(7909),tn={};tn.styleTagTransform=Vt(),tn.setAttributes=Ut(),tn.insert=Lt().bind(null,"head"),tn.domAPI=Nt(),tn.insertStyleElement=Ft(),It()(en.Z,tn);const nn=en.Z&&en.Z.locals?en.Z.locals:void 0,rn=({error:e,headerTitle:t})=>{var n,r;const{t:i}=(0,Jt.useTranslation)(),s="tablet"===(0,Tt.useLayoutType)();return o().createElement(Ye,{light:!0,className:nn.tile},o().createElement("div",{className:s?nn.tabletHeading:nn.desktopHeading},o().createElement("h4",null,t)),o().createElement("p",{className:nn.errorMessage},i("error","Error")," ",`${null==e||null===(n=e.response)||void 0===n?void 0:n.status}: `,null==e||null===(r=e.response)||void 0===r?void 0:r.statusText),o().createElement("p",{className:nn.errorCopy},i("errorCopy","Sorry, there was a problem displaying this information. You can try to reload this page, or contact the site administrator and quote the error code above.")))}},1990:()=>{System.register(["dayjs","i18next"],(function(e,t){var n={},r={};return{setters:[function(e){n.default=e.default},function(e){r.default=e.default}],execute:function(){e((()=>{var e={4332: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)}}}()},9014: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 s=o.prototype;i.utc=function(e){return new o({date:e,utc:!0,args:arguments})},s.utc=function(t){var n=i(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},s.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var a=s.parse;s.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),a.call(this,e)};var c=s.init;s.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 u=s.utcOffset;s.utcOffset=function(r,o){var i=this.$utils().u;if(i(r))return this.$u?0:i(this.$offset)?u.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],s=60*+o[1]+ +o[2];return 0===s?0:"+"===i?s:-s}(r),null===r))return this;var s=Math.abs(r)<=16?60*r:r,a=this;if(o)return a.$offset=s,a.$u=0===r,a;if(0!==r){var c=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(a=this.local().add(s+c,e)).$offset=s,a.$x.$localOffset=c}else a=this.utc();return a};var l=s.format;s.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return l.call(this,t)},s.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},s.isUTC=function(){return!!this.$u},s.toISOString=function(){return this.toDate().toISOString()},s.toString=function(){return this.toDate().toUTCString()};var f=s.toDate;s.toDate=function(e){return"s"===e&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():f.call(this)};var p=s.diff;s.diff=function(e,t,n){if(e&&this.$u===e.$u)return p.call(this,e,t,n);var r=this.local(),o=i(e).local();return p.call(r,o,t,n)}}}()},4074:(e,t,n)=>{const r=Symbol("SemVer ANY");e.exports=class e{static get ANY(){return r}parse(e){const t=this.options.loose?o[i.COMPARATORLOOSE]:o[i.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new c(n[2],this.options.loose):this.semver=r}toString(){return this.value}test(e){if(a("Comparator.test",e,this.options.loose),this.semver===r||e===r)return!0;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}return s(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Comparator is required");if(n&&"object"==typeof n||(n={loose:!!n,includePrerelease:!1}),""===this.operator)return""===this.value||new u(t.value,n).test(this.value);if(""===t.operator)return""===t.value||new u(this.value,n).test(t.semver);const r=!(">="!==this.operator&&">"!==this.operator||">="!==t.operator&&">"!==t.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==t.operator&&"<"!==t.operator),i=this.semver.version===t.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==t.operator&&"<="!==t.operator),c=s(this.semver,"<",t.semver,n)&&(">="===this.operator||">"===this.operator)&&("<="===t.operator||"<"===t.operator),l=s(this.semver,">",t.semver,n)&&("<="===this.operator||"<"===this.operator)&&(">="===t.operator||">"===t.operator);return r||o||i&&a||c||l}constructor(t,n){if(n&&"object"==typeof n||(n={loose:!!n,includePrerelease:!1}),t instanceof e){if(t.loose===!!n.loose)return t;t=t.value}a("comparator",t,n),this.options=n,this.loose=!!n.loose,this.parse(t),this.semver===r?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}};const{re:o,t:i}=n(887),s=n(2401),a=n(3843),c=n(9405),u=n(4355)},4355:(e,t,n)=>{e.exports=class e{format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const t=this.options.loose;e=e.trim();const n=t?s[a.HYPHENRANGELOOSE]:s[a.HYPHENRANGE];e=e.replace(n,S(this.options.includePrerelease)),o("hyphen replace",e),e=e.replace(s[a.COMPARATORTRIM],c),o("comparator trim",e,s[a.COMPARATORTRIM]),e=(e=(e=e.replace(s[a.TILDETRIM],u)).replace(s[a.CARETTRIM],l)).split(/\s+/).join(" ");const i=t?s[a.COMPARATORLOOSE]:s[a.COMPARATOR];return e.split(" ").map((e=>p(e,this.options))).join(" ").split(/\s+/).map((e=>O(e,this.options))).filter(this.options.loose?e=>!!e.match(i):()=>!0).map((e=>new r(e,this.options)))}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some((e=>f(e,n)&&t.set.some((t=>f(t,n)&&e.every((e=>t.every((t=>e.intersects(t,n)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new i(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(E(this.set[t],e,this.options))return!0;return!1}constructor(t,n){if(n&&"object"==typeof n||(n={loose:!!n,includePrerelease:!1}),t instanceof e)return t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease?t:new e(t.raw,n);if(t instanceof r)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=t,this.set=t.split(/\s*\|\|\s*/).map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${t}`);this.format()}};const r=n(4074),o=n(3843),i=n(9405),{re:s,t:a,comparatorTrimReplace:c,tildeTrimReplace:u,caretTrimReplace:l}=n(887),f=(e,t)=>{let n=!0;const r=e.slice();let o=r.pop();for(;n&&r.length;)n=r.every((e=>o.intersects(e,t))),o=r.pop();return n},p=(e,t)=>(o("comp",e,t),e=g(e,t),o("caret",e),e=h(e,t),o("tildes",e),e=b(e,t),o("xrange",e),e=w(e,t),o("stars",e),e),d=e=>!e||"x"===e.toLowerCase()||"*"===e,h=(e,t)=>e.trim().split(/\s+/).map((e=>y(e,t))).join(" "),y=(e,t)=>{const n=t.loose?s[a.TILDELOOSE]:s[a.TILDE];return e.replace(n,((t,n,r,i,s)=>{let a;return o("tilde",e,t,n,r,i,s),d(n)?a="":d(r)?a=`>=${n}.0.0 <${+n+1}.0.0-0`:d(i)?a=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:s?(o("replaceTilde pr",s),a=`>=${n}.${r}.${i}-${s} <${n}.${+r+1}.0-0`):a=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,o("tilde return",a),a}))},g=(e,t)=>e.trim().split(/\s+/).map((e=>m(e,t))).join(" "),m=(e,t)=>{o("caret",e,t);const n=t.loose?s[a.CARETLOOSE]:s[a.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,((t,n,i,s,a)=>{let c;return o("caret",e,t,n,i,s,a),d(n)?c="":d(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:d(s)?c="0"===n?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:a?(o("replaceCaret pr",a),c="0"===n?"0"===i?`>=${n}.${i}.${s}-${a} <${n}.${i}.${+s+1}-0`:`>=${n}.${i}.${s}-${a} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${s}-${a} <${+n+1}.0.0-0`):(o("no pr"),c="0"===n?"0"===i?`>=${n}.${i}.${s}${r} <${n}.${i}.${+s+1}-0`:`>=${n}.${i}.${s}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${s} <${+n+1}.0.0-0`),o("caret return",c),c}))},b=(e,t)=>(o("replaceXRanges",e,t),e.split(/\s+/).map((e=>v(e,t))).join(" ")),v=(e,t)=>{e=e.trim();const n=t.loose?s[a.XRANGELOOSE]:s[a.XRANGE];return e.replace(n,((n,r,i,s,a,c)=>{o("xRange",e,n,r,i,s,a,c);const u=d(i),l=u||d(s),f=l||d(a),p=f;return"="===r&&p&&(r=""),c=t.includePrerelease?"-0":"",u?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&p?(l&&(s=0),a=0,">"===r?(r=">=",l?(i=+i+1,s=0,a=0):(s=+s+1,a=0)):"<="===r&&(r="<",l?i=+i+1:s=+s+1),"<"===r&&(c="-0"),n=`${r+i}.${s}.${a}${c}`):l?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:f&&(n=`>=${i}.${s}.0${c} <${i}.${+s+1}.0-0`),o("xRange return",n),n}))},w=(e,t)=>(o("replaceStars",e,t),e.trim().replace(s[a.STAR],"")),O=(e,t)=>(o("replaceGTE0",e,t),e.trim().replace(s[t.includePrerelease?a.GTE0PRE:a.GTE0],"")),S=e=>(t,n,r,o,i,s,a,c,u,l,f,p,h)=>`${n=d(r)?"":d(o)?`>=${r}.0.0${e?"-0":""}`:d(i)?`>=${r}.${o}.0${e?"-0":""}`:s?`>=${n}`:`>=${n}${e?"-0":""}`} ${c=d(u)?"":d(l)?`<${+u+1}.0.0-0`:d(f)?`<${u}.${+l+1}.0-0`:p?`<=${u}.${l}.${f}-${p}`:e?`<${u}.${l}.${+f+1}-0`:`<=${c}`}`.trim(),E=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(o(e[n].semver),e[n].semver!==r.ANY&&e[n].semver.prerelease.length>0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}},9405:(e,t,n)=>{const r=n(3843),{MAX_LENGTH:o,MAX_SAFE_INTEGER:i}=n(8202),{re:s,t:a}=n(887),{compareIdentifiers:c}=n(1630);e.exports=class e{format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(r("SemVer.compare",this.version,this.options,t),!(t instanceof 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)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),c(this.major,t.major)||c(this.minor,t.minor)||c(this.patch,t.patch)}comparePre(t){if(t instanceof 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;let n=0;do{const e=this.prerelease[n],o=t.prerelease[n];if(r("prerelease compare",n,e,o),void 0===e&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===e)return-1;if(e!==o)return c(e,o)}while(++n)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let n=0;do{const e=this.build[n],o=t.build[n];if(r("prerelease compare",n,e,o),void 0===e&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===e)return-1;if(e!==o)return c(e,o)}while(++n)}inc(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{let e=this.prerelease.length;for(;--e>=0;)"number"==typeof this.prerelease[e]&&(this.prerelease[e]++,e=-2);-1===e&&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: ${e}`)}return this.format(),this.raw=this.version,this}constructor(t,n){if(n&&"object"==typeof n||(n={loose:!!n,includePrerelease:!1}),t instanceof e){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if("string"!=typeof t)throw new TypeError(`Invalid Version: ${t}`);if(t.length>o)throw new TypeError(`version is longer than ${o} characters`);r("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const c=t.trim().match(n.loose?s[a.LOOSE]:s[a.FULL]);if(!c)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+c[1],this.minor=+c[2],this.patch=+c[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");c[4]?this.prerelease=c[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<i)return t}return e})):this.prerelease=[],this.build=c[5]?c[5].split("."):[],this.format()}}},953:(e,t,n)=>{const r=n(5497);e.exports=(e,t)=>{const n=r(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}},2401:(e,t,n)=>{const r=n(8896),o=n(8378),i=n(9261),s=n(6647),a=n(3433),c=n(4622);e.exports=(e,t,n,u)=>{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,u);case"!=":return o(e,n,u);case">":return i(e,n,u);case">=":return s(e,n,u);case"<":return a(e,n,u);case"<=":return c(e,n,u);default:throw new TypeError(`Invalid operator: ${t}`)}}},6839:(e,t,n)=>{const r=n(9405),o=n(5497),{re:i,t:s}=n(887);e.exports=(e,t)=>{if(e instanceof r)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){let t;for(;(t=i[s.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&t.index+t[0].length===n.index+n[0].length||(n=t),i[s.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;i[s.COERCERTL].lastIndex=-1}else n=e.match(i[s.COERCE]);return null===n?null:o(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,t)}},6218:(e,t,n)=>{const r=n(9405);e.exports=(e,t,n)=>{const o=new r(e,n),i=new r(t,n);return o.compare(i)||o.compareBuild(i)}},9643:(e,t,n)=>{const r=n(3308);e.exports=(e,t)=>r(e,t,!0)},3308:(e,t,n)=>{const r=n(9405);e.exports=(e,t,n)=>new r(e,n).compare(new r(t,n))},3948:(e,t,n)=>{const r=n(5497),o=n(8896);e.exports=(e,t)=>{if(o(e,t))return null;{const n=r(e),o=r(t),i=n.prerelease.length||o.prerelease.length,s=i?"pre":"",a=i?"prerelease":"";for(const e in n)if(("major"===e||"minor"===e||"patch"===e)&&n[e]!==o[e])return s+e;return a}}},8896:(e,t,n)=>{const r=n(3308);e.exports=(e,t,n)=>0===r(e,t,n)},9261:(e,t,n)=>{const r=n(3308);e.exports=(e,t,n)=>r(e,t,n)>0},6647:(e,t,n)=>{const r=n(3308);e.exports=(e,t,n)=>r(e,t,n)>=0},5791:(e,t,n)=>{const r=n(9405);e.exports=(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}}},3433:(e,t,n)=>{const r=n(3308);e.exports=(e,t,n)=>r(e,t,n)<0},4622:(e,t,n)=>{const r=n(3308);e.exports=(e,t,n)=>r(e,t,n)<=0},629:(e,t,n)=>{const r=n(9405);e.exports=(e,t)=>new r(e,t).major},9986:(e,t,n)=>{const r=n(9405);e.exports=(e,t)=>new r(e,t).minor},8378:(e,t,n)=>{const r=n(3308);e.exports=(e,t,n)=>0!==r(e,t,n)},5497:(e,t,n)=>{const{MAX_LENGTH:r}=n(8202),{re:o,t:i}=n(887),s=n(9405);e.exports=(e,t)=>{if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof s)return e;if("string"!=typeof e)return null;if(e.length>r)return null;if(!(t.loose?o[i.LOOSE]:o[i.FULL]).test(e))return null;try{return new s(e,t)}catch(e){return null}}},9800:(e,t,n)=>{const r=n(9405);e.exports=(e,t)=>new r(e,t).patch},4408:(e,t,n)=>{const r=n(5497);e.exports=(e,t)=>{const n=r(e,t);return n&&n.prerelease.length?n.prerelease:null}},762:(e,t,n)=>{const r=n(3308);e.exports=(e,t,n)=>r(t,e,n)},2743:(e,t,n)=>{const r=n(6218);e.exports=(e,t)=>e.sort(((e,n)=>r(n,e,t)))},5312:(e,t,n)=>{const r=n(4355);e.exports=(e,t,n)=>{try{t=new r(t,n)}catch(e){return!1}return t.test(e)}},2354:(e,t,n)=>{const r=n(6218);e.exports=(e,t)=>e.sort(((e,n)=>r(e,n,t)))},4512:(e,t,n)=>{const r=n(5497);e.exports=(e,t)=>{const n=r(e,t);return n?n.version:null}},4770:(e,t,n)=>{const r=n(887);e.exports={re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:n(8202).SEMVER_SPEC_VERSION,SemVer:n(9405),compareIdentifiers:n(1630).compareIdentifiers,rcompareIdentifiers:n(1630).rcompareIdentifiers,parse:n(5497),valid:n(4512),clean:n(953),inc:n(5791),diff:n(3948),major:n(629),minor:n(9986),patch:n(9800),prerelease:n(4408),compare:n(3308),rcompare:n(762),compareLoose:n(9643),compareBuild:n(6218),sort:n(2354),rsort:n(2743),gt:n(9261),lt:n(3433),eq:n(8896),neq:n(8378),gte:n(6647),lte:n(4622),cmp:n(2401),coerce:n(6839),Comparator:n(4074),Range:n(4355),satisfies:n(5312),toComparators:n(9663),maxSatisfying:n(4931),minSatisfying:n(5891),minVersion:n(4925),validRange:n(9965),outside:n(3260),gtr:n(715),ltr:n(6),intersects:n(9560),simplifyRange:n(7795),subset:n(7732)}},8202:e=>{const 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}},3843:e=>{const t="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=t},1630:e=>{const t=/^[0-9]+$/,n=(e,n)=>{const 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:(e,t)=>n(t,e)}},887:(e,t,n)=>{const{MAX_SAFE_COMPONENT_LENGTH:r}=n(8202),o=n(3843),i=(t=e.exports={}).re=[],s=t.src=[],a=t.t={};let c=0;const u=(e,t,n)=>{const r=c++;o(r,t),a[e]=r,s[r]=t,i[r]=new RegExp(t,n?"g":void 0)};u("NUMERICIDENTIFIER","0|[1-9]\\d*"),u("NUMERICIDENTIFIERLOOSE","[0-9]+"),u("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),u("MAINVERSION",`(${s[a.NUMERICIDENTIFIER]})\\.(${s[a.NUMERICIDENTIFIER]})\\.(${s[a.NUMERICIDENTIFIER]})`),u("MAINVERSIONLOOSE",`(${s[a.NUMERICIDENTIFIERLOOSE]})\\.(${s[a.NUMERICIDENTIFIERLOOSE]})\\.(${s[a.NUMERICIDENTIFIERLOOSE]})`),u("PRERELEASEIDENTIFIER",`(?:${s[a.NUMERICIDENTIFIER]}|${s[a.NONNUMERICIDENTIFIER]})`),u("PRERELEASEIDENTIFIERLOOSE",`(?:${s[a.NUMERICIDENTIFIERLOOSE]}|${s[a.NONNUMERICIDENTIFIER]})`),u("PRERELEASE",`(?:-(${s[a.PRERELEASEIDENTIFIER]}(?:\\.${s[a.PRERELEASEIDENTIFIER]})*))`),u("PRERELEASELOOSE",`(?:-?(${s[a.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${s[a.PRERELEASEIDENTIFIERLOOSE]})*))`),u("BUILDIDENTIFIER","[0-9A-Za-z-]+"),u("BUILD",`(?:\\+(${s[a.BUILDIDENTIFIER]}(?:\\.${s[a.BUILDIDENTIFIER]})*))`),u("FULLPLAIN",`v?${s[a.MAINVERSION]}${s[a.PRERELEASE]}?${s[a.BUILD]}?`),u("FULL",`^${s[a.FULLPLAIN]}$`),u("LOOSEPLAIN",`[v=\\s]*${s[a.MAINVERSIONLOOSE]}${s[a.PRERELEASELOOSE]}?${s[a.BUILD]}?`),u("LOOSE",`^${s[a.LOOSEPLAIN]}$`),u("GTLT","((?:<|>)?=?)"),u("XRANGEIDENTIFIERLOOSE",`${s[a.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),u("XRANGEIDENTIFIER",`${s[a.NUMERICIDENTIFIER]}|x|X|\\*`),u("XRANGEPLAIN",`[v=\\s]*(${s[a.XRANGEIDENTIFIER]})(?:\\.(${s[a.XRANGEIDENTIFIER]})(?:\\.(${s[a.XRANGEIDENTIFIER]})(?:${s[a.PRERELEASE]})?${s[a.BUILD]}?)?)?`),u("XRANGEPLAINLOOSE",`[v=\\s]*(${s[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[a.XRANGEIDENTIFIERLOOSE]})(?:${s[a.PRERELEASELOOSE]})?${s[a.BUILD]}?)?)?`),u("XRANGE",`^${s[a.GTLT]}\\s*${s[a.XRANGEPLAIN]}$`),u("XRANGELOOSE",`^${s[a.GTLT]}\\s*${s[a.XRANGEPLAINLOOSE]}$`),u("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),u("COERCERTL",s[a.COERCE],!0),u("LONETILDE","(?:~>?)"),u("TILDETRIM",`(\\s*)${s[a.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",u("TILDE",`^${s[a.LONETILDE]}${s[a.XRANGEPLAIN]}$`),u("TILDELOOSE",`^${s[a.LONETILDE]}${s[a.XRANGEPLAINLOOSE]}$`),u("LONECARET","(?:\\^)"),u("CARETTRIM",`(\\s*)${s[a.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",u("CARET",`^${s[a.LONECARET]}${s[a.XRANGEPLAIN]}$`),u("CARETLOOSE",`^${s[a.LONECARET]}${s[a.XRANGEPLAINLOOSE]}$`),u("COMPARATORLOOSE",`^${s[a.GTLT]}\\s*(${s[a.LOOSEPLAIN]})$|^$`),u("COMPARATOR",`^${s[a.GTLT]}\\s*(${s[a.FULLPLAIN]})$|^$`),u("COMPARATORTRIM",`(\\s*)${s[a.GTLT]}\\s*(${s[a.LOOSEPLAIN]}|${s[a.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",u("HYPHENRANGE",`^\\s*(${s[a.XRANGEPLAIN]})\\s+-\\s+(${s[a.XRANGEPLAIN]})\\s*$`),u("HYPHENRANGELOOSE",`^\\s*(${s[a.XRANGEPLAINLOOSE]})\\s+-\\s+(${s[a.XRANGEPLAINLOOSE]})\\s*$`),u("STAR","(<|>)?=?\\s*\\*"),u("GTE0","^\\s*>=\\s*0.0.0\\s*$"),u("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")},715:(e,t,n)=>{const r=n(3260);e.exports=(e,t,n)=>r(e,t,">",n)},9560:(e,t,n)=>{const r=n(4355);e.exports=(e,t,n)=>(e=new r(e,n),t=new r(t,n),e.intersects(t))},6:(e,t,n)=>{const r=n(3260);e.exports=(e,t,n)=>r(e,t,"<",n)},4931:(e,t,n)=>{const r=n(9405),o=n(4355);e.exports=(e,t,n)=>{let i=null,s=null,a=null;try{a=new o(t,n)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(i&&-1!==s.compare(e)||(i=e,s=new r(i,n)))})),i}},5891:(e,t,n)=>{const r=n(9405),o=n(4355);e.exports=(e,t,n)=>{let i=null,s=null,a=null;try{a=new o(t,n)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(i&&1!==s.compare(e)||(i=e,s=new r(i,n)))})),i}},4925:(e,t,n)=>{const r=n(9405),o=n(4355),i=n(9261);e.exports=(e,t)=>{e=new o(e,t);let 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(let t=0;t<e.set.length;++t)e.set[t].forEach((e=>{const 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: ${e.operator}`)}}));return n&&e.test(n)?n:null}},3260:(e,t,n)=>{const r=n(9405),o=n(4074),{ANY:i}=o,s=n(4355),a=n(5312),c=n(9261),u=n(3433),l=n(4622),f=n(6647);e.exports=(e,t,n,p)=>{let d,h,y,g,m;switch(e=new r(e,p),t=new s(t,p),n){case">":d=c,h=l,y=u,g=">",m=">=";break;case"<":d=u,h=f,y=c,g="<",m="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,p))return!1;for(let n=0;n<t.set.length;++n){const r=t.set[n];let s=null,a=null;if(r.forEach((e=>{e.semver===i&&(e=new o(">=0.0.0")),s=s||e,a=a||e,d(e.semver,s.semver,p)?s=e:y(e.semver,a.semver,p)&&(a=e)})),s.operator===g||s.operator===m)return!1;if((!a.operator||a.operator===g)&&h(e,a.semver))return!1;if(a.operator===m&&y(e,a.semver))return!1}return!0}},7795:(e,t,n)=>{const r=n(5312),o=n(3308);e.exports=(e,t,n)=>{const i=[];let s=null,a=null;const c=e.sort(((e,t)=>o(e,t,n)));for(const e of c)r(e,t,n)?(a=e,s||(s=e)):(a&&i.push([s,a]),a=null,s=null);s&&i.push([s,null]);const u=[];for(const[e,t]of i)e===t?u.push(e):t||e!==c[0]?t?e===c[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");const l=u.join(" || "),f="string"==typeof t.raw?t.raw:String(t);return l.length<f.length?l:t}},7732:(e,t,n)=>{const r=n(4355),{ANY:o}=n(4074),i=n(5312),s=n(3308),a=(e,t,n)=>{if(1===e.length&&e[0].semver===o)return 1===t.length&&t[0].semver===o;const r=new Set;let a,l,f,p,d,h,y;for(const t of e)">"===t.operator||">="===t.operator?a=c(a,t,n):"<"===t.operator||"<="===t.operator?l=u(l,t,n):r.add(t.semver);if(r.size>1)return null;if(a&&l){if(f=s(a.semver,l.semver,n),f>0)return null;if(0===f&&(">="!==a.operator||"<="!==l.operator))return null}for(const e of r){if(a&&!i(e,String(a),n))return null;if(l&&!i(e,String(l),n))return null;for(const r of t)if(!i(e,String(r),n))return!1;return!0}for(const e of t){if(y=y||">"===e.operator||">="===e.operator,h=h||"<"===e.operator||"<="===e.operator,a)if(">"===e.operator||">="===e.operator){if(p=c(a,e,n),p===e)return!1}else if(">="===a.operator&&!i(a.semver,String(e),n))return!1;if(l)if("<"===e.operator||"<="===e.operator){if(d=u(l,e,n),d===e)return!1}else if("<="===l.operator&&!i(l.semver,String(e),n))return!1;if(!e.operator&&(l||a)&&0!==f)return!1}return!(a&&h&&!l&&0!==f||l&&y&&!a&&0!==f)},c=(e,t,n)=>{if(!e)return t;const r=s(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},u=(e,t,n)=>{if(!e)return t;const r=s(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,n)=>{e=new r(e,n),t=new r(t,n);let o=!1;e:for(const r of e.set){for(const e of t.set){const t=a(r,e,n);if(o=o||null!==t,t)continue e}if(o)return!1}return!0}},9663:(e,t,n)=>{const r=n(4355);e.exports=(e,t)=>new r(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},9965:(e,t,n)=>{const r=n(4355);e.exports=(e,t)=>{try{return new r(e,t).range||"*"}catch(e){return null}}},7968:(e,t,n)=>{const r=n(1577).R;t.s=function(e){if(e||(e=1),!n.y.meta||!n.y.meta.url)throw console.error("__system_context__",n.y),Error("systemjs-webpack-interop was provided an unknown SystemJS context. Expected context.meta.url, but none was provided");n.p=r(n.y.meta.url,e)}},1577:(e,t,n)=>{t.R=function(e,t){var n=document.createElement("a");n.href=e;for(var r="/"===n.pathname[0]?n.pathname:"/"+n.pathname,o=0,i=r.length;o!==t&&i>=0;)"/"===r[--i]&&o++;if(o!==t)throw Error("systemjs-webpack-interop: rootDirectoryLevel ("+t+") is greater than the number of directories ("+o+") in the URL path "+e);var s=r.slice(0,i+1);return n.protocol+"//"+n.host+s},Number.isInteger},9688:e=>{"use strict";e.exports=n},7064:e=>{"use strict";e.exports=r}},o={};function i(t){var n=o[t];if(void 0!==n)return n.exports;var r=o[t]={exports:{}};return e[t].call(r.exports,r,r.exports,i),r.exports}i.y=t,i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;i.g.importScripts&&(e=i.g.location+"");var t=i.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&!e;)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e})();var s={};return(0,i(7968).s)(1),(()=>{"use strict";function e(e){return(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())-Date.UTC(e.getUTCFullYear(),0,0))/24/60/60/1e3}function t(e,t){const n=e.toISOString(),r=t.toISOString();return n.slice(0,n.indexOf("T"))===r.slice(0,r.indexOf("T"))}function n(n){const r=new Date,o=new Date(n),i=r.getUTCMonth()-o.getUTCMonth(),s=r.getUTCDate()-o.getUTCDate();let a=r.getUTCFullYear()-o.getUTCFullYear();(i<0||0===i&&s<0)&&a--;let c=i>=0?i:i+12;s<0&&c--;const u=c>0?`${c} mo`:"";let l=e(r)-e(o);l<0&&(l+=365);const f=Math.floor(l/7),p=l-7*f;return 0===a?t(r,o)?"Today":f<4||0===f?`${l} day`:p>0?`${f} wk ${p} d`:`${f} week`:a<2?`${u} ${a} yr`.trim():a<18?`${a} yr ${u}`.trim():`${a} years`}i.r(s),i.d(s,{age:()=>n,daysIntoYear:()=>e,formatDate:()=>x,formatDatetime:()=>j,formatTime:()=>_,isOmrsDateStrict:()=>d,isOmrsDateToday:()=>h,isSameDay:()=>t,isVersionSatisfied:()=>D,parseDate:()=>S,retry:()=>N,toDateObjectStrict:()=>y,toOmrsDateFormat:()=>O,toOmrsDayDateFormat:()=>v,toOmrsIsoString:()=>g,toOmrsTimeString:()=>b,toOmrsTimeString24:()=>m,toOmrsYearlessDateFormat:()=>w,translateFrom:()=>A});var r=i(9688),o=i(9014),a=i.n(o),c=i(4332),u=i.n(c);function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(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){l(e,t,n[t])}))}return e}r.default.extend(a()),r.default.extend(u());const p="YYYY-MM-DDTHH:mm:ss.SSSZZ";function d(e){return null!=e&&28===e.trim().length&&"T"===(e=e.trim())[10]&&":"===e[13]&&":"===e[16]&&"."===e[19]&&"+"===e[23]&&":"!==e[26]&&(0,r.default)(e,p).isValid()}function h(e){return(0,r.default)(e).isToday()}function y(e){return d(e)?(0,r.default)(e,p).toDate():null}function g(e,t=!1){let n=(0,r.default)(e);return t&&(n=n.utc()),n.format(p)}function m(e){return(0,r.default)(e).format("HH:mm")}function b(e){return r.default.utc(e).format("HH:mm A")}function v(e){return O(e,"DD - MMM - YYYY")}function w(e){return O(e,"DD-MMM")}function O(e,t="YYYY-MMM-DD"){return(0,r.default)(e).format(t)}function S(e){return(0,r.default)(e).toDate()}const E={mode:"standard",time:"for today",day:!0,year:!0};function x(e,t){const{mode:n,time:o,day:i,year:s}=f({},E,t),a={year:s?"numeric":void 0,month:"short",day:i?"2-digit":void 0};let c,u=k();const l=(0,r.default)(e).isToday();if(l)c=new Intl.RelativeTimeFormat(u,{numeric:"auto"}).format(0,"day"),c=c[0].toLocaleUpperCase(u)+c.slice(1);else if("en"==u&&(u="en-GB"),c=e.toLocaleDateString(u,a),"en-GB"==u&&"standard"==n&&s&&i&&(c=c.replace(/ /g,"-")),"wide"==n&&(c=c.replace(/ /g," — "),/ru.*/.test(u))){const e=c.length;c=c.slice(0,e-5)+c.slice(e-5).replace(" — "," ")}return(!0===o||l&&"for today"===o)&&(c+=`, ${_(e)}`),c}function _(e){return e.toLocaleTimeString(k(),{hour:"2-digit",minute:"2-digit"})}function j(e,t){return x(e,(n=f({},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}function k(){let e=window.i18next.language;return e=e.replace("_","-"),"ht"===e&&(e="fr-HT"),e}var P=i(7064);function $(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A(e,t,n,r){return(P.default.default||P.default).t(t,function(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){$(e,t,n[t])}))}return e}({ns:e,defaultValue:n},r))}var C=i(4770);function T(e){const[t,n,r]=e.split(".");return`${t}.${n}.${r}`}function D(e,t){const n=function(e){const t=e.indexOf("-");return t>=0?`${T(e.slice(0,t))}-${e.slice(t+1)}`:T(e)}(t);return C.satisfies(n,e,{includePrerelease:!0})}function I(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function R(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){I(i,r,o,s,a,"next",e)}function a(e){I(i,r,o,s,a,"throw",e)}s(void 0)}))}}function N(e){return M.apply(this,arguments)}function M(){return(M=R((function*(e,t={}){let{shouldRetry:n,getDelay:r,onError:o}=t;n=null!=n?n:e=>function(e,t){return e<=5}(e),r=null!=r?r:e=>function(e,t,n=!1){const r=n?e+1:e;return 1e3*Math.pow(2,r)}(e);let i,s=0;do{try{return yield L(r(s)),yield e()}catch(e){null==o||o(e,s),i=e}}while(n(s++));throw i}))).apply(this,arguments)}function L(e){return B.apply(this,arguments)}function B(){return(B=R((function*(e){if(!(e<=0))return new Promise((t=>setTimeout(t,e)))}))).apply(this,arguments)}})(),s})())}}}))},841:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var s=o.apply(null,n);s&&e.push(s)}}else if("object"===i){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var a in n)r.call(n,a)&&n[a]&&e.push(a)}}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},7909:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(9233),o=n.n(r),i=n(361),s=n.n(i)()(o());s.push([e.id,':root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.FZ33ihINl\\+8YUVozv7ZwXw\\=\\={font-size:var(--cds-heading-compact-02-font-size, 1rem);font-weight:var(--cds-heading-compact-02-font-weight, 600);line-height:var(--cds-heading-compact-02-line-height, 1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing, 0);margin-top:2.25rem;margin-bottom:.5rem}.jx2T8vrDO9pVp2FeSg6R\\+w\\=\\={margin-bottom:.5rem;font-size:var(--cds-body-01-font-size, 0.875rem);font-weight:var(--cds-body-01-font-weight, 400);line-height:var(--cds-body-01-line-height, 1.42857);letter-spacing:var(--cds-body-01-letter-spacing, 0.16px);color:#525252}.cwU9zKw\\+qDdXGFxN1tD4Xg\\=\\= h4{font-size:var(--cds-heading-compact-02-font-size, 1rem);font-weight:var(--cds-heading-compact-02-font-weight, 600);line-height:var(--cds-heading-compact-02-line-height, 1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing, 0);color:#525252}.gOCpwZibZuK7xHHy\\+IDIHQ\\=\\= h4{font-size:var(--cds-heading-03-font-size, 1.25rem);font-weight:var(--cds-heading-03-font-weight, 400);line-height:var(--cds-heading-03-line-height, 1.4);letter-spacing:var(--cds-heading-03-letter-spacing, 0);color:#525252}.cwU9zKw\\+qDdXGFxN1tD4Xg\\=\\=,.gOCpwZibZuK7xHHy\\+IDIHQ\\=\\={text-align:left;text-transform:capitalize;margin-bottom:1rem}.cwU9zKw\\+qDdXGFxN1tD4Xg\\=\\= h4:after,.gOCpwZibZuK7xHHy\\+IDIHQ\\=\\= h4:after{content:"";display:block;width:2rem;padding-top:.188rem;border-bottom:.375rem solid var(--brand-03)}.ztmVxMaymtPTKnWjzbgENg\\=\\={text-align:center;border:1px solid #e0e0e0}',"",{version:3,sources:["webpack://./../esm-styleguide/src/_vars.scss","webpack://./../esm-styleguide/src/error-state/error-state.module.scss","webpack://./../../../node_modules/@carbon/type/scss/_styles.scss","webpack://./../../../node_modules/@carbon/layout/scss/generated/_spacing.scss"],names:[],mappings:"AAoDA,MACE,mBAAA,CACA,mBAAA,CACA,mBAAA,CCnDF,6BCq0BI,uDAAA,CAAA,0DAAA,CAAA,4DAAA,CAAA,8DAAA,CDl0BF,kBAAA,CACA,mBEaW,CFVb,6BACE,mBESW,CDozBT,gDAAA,CAAA,+CAAA,CAAA,mDAAA,CAAA,wDAAA,CD3zBF,aDTQ,CCaR,gCCuzBE,uDAAA,CAAA,0DAAA,CAAA,4DAAA,CAAA,8DAAA,CDrzBA,aDfM,CCoBR,gCCgzBE,kDAAA,CAAA,kDAAA,CAAA,kDAAA,CAAA,sDAAA,CD9yBA,aDtBM,CC0BV,0DAEE,eAAA,CACA,yBAAA,CACA,kBEJW,CFMX,4EACE,UAAA,CACA,aAAA,CACA,UAAA,CACA,mBAAA,CACA,2CAAA,CAIJ,4BACE,iBAAA,CACA,wBAAA",sourcesContent:["$ui-01: #f4f4f4;\n$ui-02: #ffffff;\n$ui-03: #e0e0e0;\n$ui-04: #8d8d8d;\n$ui-05: #161616;\n$text-02: #525252;\n$text-03: #a8a8a8;\n$ui-background: #ffffff;\n$color-gray-30: #c6c6c6;\n$color-gray-70: #525252;\n$color-gray-100: #161616;\n$color-blue-60-2: #0f62fe;\n$color-blue-10: #edf5ff;\n$color-yellow-50: #feecae;\n$carbon--red-50: #fa4d56;\n$inverse-link: #78a9ff;\n$support-02: #24a148;\n$inverse-support-03: #f1c21b;\n$warning-background: #fff8e1;\n$openmrs-background-grey: #f4f4f4;\n$danger: #da1e28;\n$interactive-01: #0f62fe;\n$field-01: #f4f4f4;\n$grey-2: #e0e0e0;\n$labeldropdown: #c6c6c6;\n\n$brand-primary-10: #d9fbfb;\n$brand-primary-20: #9ef0f0;\n$brand-primary-30: #3ddbd9;\n$brand-primary-40: #08bdba;\n$brand-primary-50: #009d9a;\n\n/* 60,70 and 80 are already declared as brand-01, 02 and 03 respectively */\n\n$brand-primary-90: #022b30;\n$brand-primary-100: #081a1c;\n\n@mixin brand-01($property) {\n #{$property}: #005d5d;\n #{$property}: var(--brand-01);\n}\n\n@mixin brand-02($property) {\n #{$property}: #004144;\n #{$property}: var(--brand-02);\n}\n\n@mixin brand-03($property) {\n #{$property}: #007d79;\n #{$property}: var(--brand-03);\n}\n\n:root {\n --brand-01: #005d5d;\n --brand-02: #004144;\n --brand-03: #007d79;\n}\n\n$breakpoint-phone-min: 0px;\n$breakpoint-phone-max: 600px;\n$breakpoint-tablet-min: 601px;\n$breakpoint-tablet-max: 1023px;\n$breakpoint-small-desktop-min: 1024px;\n$breakpoint-small-desktop-max: 1439px;\n$breakpoint-large-desktop-min: 1440px;\n$breakpoint-large-desktop-max: 99999999px;\n\n/* These color variables will be removed in a future release */\n$brand-teal-01: #007d79;\n$brand-01: #005d5d;\n$brand-02: #004144;\n",'@use "@carbon/styles/scss/spacing";\n@use "@carbon/styles/scss/type";\n@import "~@openmrs/esm-styleguide/src/vars";\n\n.errorMessage {\n @include type.type-style("heading-compact-02");\n\n margin-top: 2.25rem;\n margin-bottom: spacing.$spacing-03;\n}\n\n.errorCopy {\n margin-bottom: spacing.$spacing-03;\n @include type.type-style("body-01");\n color: $text-02;\n}\n\n.desktopHeading {\n h4 {\n @include type.type-style("heading-compact-02");\n color: $text-02;\n }\n}\n\n.tabletHeading {\n h4 {\n @include type.type-style("heading-03");\n color: $text-02;\n }\n}\n\n.desktopHeading,\n.tabletHeading {\n text-align: left;\n text-transform: capitalize;\n margin-bottom: spacing.$spacing-05;\n\n h4:after {\n content: "";\n display: block;\n width: 2rem;\n padding-top: 0.188rem;\n border-bottom: 0.375rem solid var(--brand-03);\n }\n}\n\n.tile {\n text-align: center;\n border: 1px solid $ui-03;\n}\n',"//\n// Copyright IBM Corp. 2018, 2018\n//\n// This source code is licensed under the Apache-2.0 license found in the\n// LICENSE file in the root directory of this source tree.\n//\n\n// stylelint-disable number-max-precision\n\n@use 'sass:map';\n@use 'sass:math';\n@use '@carbon/grid/scss/config' as gridconfig;\n@use '@carbon/grid/scss/breakpoint' as grid;\n@use 'prefix' as *;\n@use 'font-family';\n@use 'scale';\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$label-01: (\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$label-02: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$legal-01: (\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$legal-02: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @deprecated\n/// @group @carbon/type\n$helper-text-01: (\n font-size: scale.type-scale(1),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @deprecated\n/// @group @carbon/type\n$helper-text-02: (\n font-size: carbon--type-scale(2),\n font-weight: carbon--font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-short-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-compact-01: $body-short-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-long-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.42857,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-01: $body-long-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-short-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.375,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-compact-02: $body-short-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-long-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.5,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-02: $body-long-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$code-01: (\n font-family: font-family.font-family('mono'),\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$code-02: (\n font-family: font-family.font-family('mono'),\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.42857,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.42857,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-compact-01: $productive-heading-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.5,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.375,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-compact-02: $productive-heading-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-03: (\n font-size: scale.type-scale(5),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.4,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-03: $productive-heading-03 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-04: (\n font-size: scale.type-scale(7),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-04: $productive-heading-04 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-05: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('light'),\n line-height: 1.25,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-05: $productive-heading-05 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-06: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n // Extra digit needed for precision in Chrome\n line-height: 1.199,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-06: $productive-heading-06 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-07: (\n font-size: scale.type-scale(12),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-07: $productive-heading-07 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-01: $heading-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-02: $heading-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-03: (\n font-size: scale.type-scale(5),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.4,\n letter-spacing: 0,\n breakpoints: (\n xlg: (\n font-size: scale.type-scale(5),\n line-height: 1.25,\n ),\n max: (\n font-size: scale.type-scale(6),\n line-height: 1.334,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-03: $expressive-heading-03 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-04: (\n font-size: scale.type-scale(7),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0,\n breakpoints: (\n xlg: (\n font-size: scale.type-scale(8),\n line-height: 1.25,\n font-weight: font-family.font-weight('light'),\n ),\n max: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('light'),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-04: $expressive-heading-04 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-05: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('light'),\n line-height: 1.25,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(9),\n line-height: 1.22,\n ),\n lg: (\n font-size: scale.type-scale(10),\n line-height: 1.19,\n ),\n xlg: (\n font-size: scale.type-scale(11),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(13),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-05: $expressive-heading-05 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-06: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.25,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(9),\n line-height: 1.22,\n ),\n lg: (\n font-size: scale.type-scale(10),\n line-height: 1.19,\n ),\n xlg: (\n font-size: scale.type-scale(11),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(13),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-06: $expressive-heading-06 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-paragraph-01: (\n font-size: scale.type-scale(6),\n font-weight: font-family.font-weight('light'),\n line-height: 1.334,\n letter-spacing: 0,\n breakpoints: (\n lg: (\n font-size: scale.type-scale(7),\n line-height: 1.28572,\n ),\n max: (\n font-size: scale.type-scale(8),\n line-height: 1.25,\n ),\n ),\n);\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-paragraph-01: $expressive-paragraph-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$quotation-01: (\n font-family: font-family.font-family('serif'),\n font-size: scale.type-scale(5),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.3,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(5),\n ),\n lg: (\n font-size: scale.type-scale(6),\n line-height: 1.334,\n ),\n xlg: (\n font-size: scale.type-scale(7),\n line-height: 1.28572,\n ),\n max: (\n font-size: scale.type-scale(8),\n line-height: 1.25,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-quotation-01: $quotation-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$quotation-02: (\n font-family: font-family.font-family('serif'),\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('light'),\n line-height: 1.25,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(9),\n line-height: 1.22,\n ),\n lg: (\n font-size: scale.type-scale(10),\n line-height: 1.19,\n ),\n xlg: (\n font-size: scale.type-scale(11),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(13),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-quotation-02: $quotation-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-01: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(10),\n ),\n lg: (\n font-size: scale.type-scale(12),\n ),\n xlg: (\n font-size: scale.type-scale(13),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(15),\n line-height: 1.13,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-01: $display-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-02: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(10),\n ),\n lg: (\n font-size: scale.type-scale(12),\n ),\n xlg: (\n font-size: scale.type-scale(13),\n line-height: 1.16,\n ),\n max: (\n font-size: scale.type-scale(15),\n line-height: 1.13,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-02: $display-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-03: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(12),\n line-height: 1.18,\n ),\n lg: (\n font-size: scale.type-scale(13),\n line-height: 1.16,\n letter-spacing: -0.64px,\n ),\n xlg: (\n font-size: scale.type-scale(15),\n line-height: 1.13,\n letter-spacing: -0.64px,\n ),\n max: (\n font-size: scale.type-scale(16),\n line-height: 1.11,\n letter-spacing: -0.96px,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-03: $display-03 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-04: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(14),\n line-height: 1.15,\n ),\n lg: (\n font-size: scale.type-scale(17),\n line-height: 1.11,\n letter-spacing: -0.64px,\n ),\n xlg: (\n font-size: scale.type-scale(20),\n line-height: 1.07,\n letter-spacing: -0.64px,\n ),\n max: (\n font-size: scale.type-scale(23),\n line-height: 1.05,\n letter-spacing: -0.96px,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-04: $display-04 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$tokens: (\n label-01: $label-01,\n label-02: $label-02,\n helper-text-01: $helper-text-01,\n helper-text-02: $helper-text-02,\n body-short-01: $body-short-01,\n body-short-02: $body-short-02,\n body-long-01: $body-long-01,\n body-long-02: $body-long-02,\n code-01: $code-01,\n code-02: $code-02,\n heading-01: $heading-01,\n heading-02: $heading-02,\n productive-heading-01: $productive-heading-01,\n productive-heading-02: $productive-heading-02,\n productive-heading-03: $productive-heading-03,\n productive-heading-04: $productive-heading-04,\n productive-heading-05: $productive-heading-05,\n productive-heading-06: $productive-heading-06,\n productive-heading-07: $productive-heading-07,\n expressive-paragraph-01: $expressive-paragraph-01,\n expressive-heading-01: $expressive-heading-01,\n expressive-heading-02: $expressive-heading-02,\n expressive-heading-03: $expressive-heading-03,\n expressive-heading-04: $expressive-heading-04,\n expressive-heading-05: $expressive-heading-05,\n expressive-heading-06: $expressive-heading-06,\n quotation-01: $quotation-01,\n quotation-02: $quotation-02,\n display-01: $display-01,\n display-02: $display-02,\n display-03: $display-03,\n display-04: $display-04,\n // V11 Tokens\n legal-01: $legal-01,\n legal-02: $legal-02,\n body-compact-01: $body-compact-01,\n body-compact-02: $body-compact-02,\n heading-compact-01: $heading-compact-01,\n heading-compact-02: $heading-compact-02,\n body-01: $body-01,\n body-02: $body-02,\n heading-03: $heading-03,\n heading-04: $heading-04,\n heading-05: $heading-05,\n heading-06: $heading-06,\n heading-07: $heading-07,\n fluid-heading-03: $fluid-heading-03,\n fluid-heading-04: $fluid-heading-04,\n fluid-heading-05: $fluid-heading-05,\n fluid-heading-06: $fluid-heading-06,\n fluid-paragraph-01: $fluid-paragraph-01,\n fluid-quotation-01: $fluid-quotation-01,\n fluid-quotation-02: $fluid-quotation-02,\n fluid-display-01: $fluid-display-01,\n fluid-display-02: $fluid-display-02,\n fluid-display-03: $fluid-display-03,\n fluid-display-04: $fluid-display-04,\n);\n\n/// @param {Map} $map\n/// @access public\n/// @group @carbon/type\n@mixin properties($map) {\n @each $name, $value in $map {\n #{$name}: $value;\n }\n}\n\n/// @param {Number} $value - Number with units\n/// @return {Number} Without units\n/// @access public\n/// @group @carbon/type\n@function strip-unit($value) {\n @return math.div($value, $value * 0 + 1);\n}\n\n/// This helper includes fluid type styles for the given token value. Fluid type\n/// means that the `font-size` is computed using `calc()` in order to be\n/// determined by the screen size instead of a breakpoint. As a result, fluid\n/// styles should be used with caution in fixed width contexts.\n///\n/// In addition, we make use of %-based line-heights so that the line-height of\n/// each type style is computed correctly due to the dynamic nature of the\n/// `font-size`.\n///\n/// Most of the logic for this work comes from CSS Tricks:\n/// https://css-tricks.com/snippets/css/fluid-typography/\n///\n/// @param {Map} $type-styles - The value of a given type token\n/// @param {Map} $breakpoints [$grid-breakpoints] - Custom breakpoints to use\n/// @access public\n/// @group @carbon/type\n@mixin fluid-type($type-styles, $breakpoints: gridconfig.$grid-breakpoints) {\n // Include the initial styles for the given token by default without any\n // media query guard. This includes `font-size` as a fallback in the case\n // that a browser does not support `calc()`\n @include properties(map.remove($type-styles, breakpoints));\n // We also need to include the `sm` styles by default since they don't\n // appear in the fluid styles for tokens\n @include fluid-type-size($type-styles, sm, $breakpoints);\n\n // Finally, we need to go through all the breakpoints defined in the type\n // token and apply the properties and fluid type size for that given\n // breakpoint\n @each $name, $values in map.get($type-styles, breakpoints) {\n @include grid.breakpoint($name) {\n @include properties($values);\n @include fluid-type-size($type-styles, $name, $breakpoints);\n }\n }\n}\n\n/// Computes the fluid `font-size` for a given type style and breakpoint\n/// @param {Map} $type-styles - The styles for a given token\n/// @param {String} $name - The name of the breakpoint to which we apply the fluid\n/// @param {Map} $breakpoints [$grid-breakpoints] - The breakpoints for the grid system\n/// @access public\n/// @group @carbon/type\n@mixin fluid-type-size(\n $type-styles,\n $name,\n $breakpoints: gridconfig.$grid-breakpoints\n) {\n // Get the information about the breakpoint we're currently working in. Useful\n // for getting initial width information\n $breakpoint: map.get($breakpoints, $name);\n\n // Our fluid styles are captured under the 'breakpoints' property in our type\n // styles map. These define what values to treat as `max-` variables below\n $fluid-sizes: map.get($type-styles, breakpoints);\n $fluid-breakpoint: ();\n // Special case for `sm` because the styles for small are on the type style\n // directly\n @if $name == sm {\n $fluid-breakpoint: map.remove($type-styles, breakpoints);\n } @else {\n $fluid-breakpoint: map.get($fluid-sizes, $name);\n }\n\n // Initialize our font-sizes to the default size for the type style\n $max-font-size: map.get($type-styles, font-size);\n $min-font-size: map.get($type-styles, font-size);\n @if map.has-key($fluid-breakpoint, font-size) {\n $min-font-size: map.get($fluid-breakpoint, font-size);\n }\n\n // Initialize our min and max width to the width of the current breakpoint\n $max-vw: map.get($breakpoint, width);\n $min-vw: map.get($breakpoint, width);\n\n // We can use `breakpoint-next` to see if there is another breakpoint we can\n // use to update `max-font-size` and `max-vw` with larger values\n $next-breakpoint-available: grid.breakpoint-next($name, $breakpoints);\n $next-fluid-breakpoint-name: null;\n\n // We need to figure out what the next available fluid breakpoint is for our\n // given $type-styles. In this loop we try and iterate through breakpoints\n // until we either manually set $next-breakpoint-available to null or\n // `breakpoint-next` returns null.\n @while $next-breakpoint-available {\n @if map.has-key($fluid-sizes, $next-breakpoint-available) {\n $next-fluid-breakpoint-name: $next-breakpoint-available;\n $next-breakpoint-available: null;\n } @else {\n $next-breakpoint-available: grid.breakpoint-next(\n $next-breakpoint-available,\n $breakpoints\n );\n }\n }\n\n // If we have found the next available fluid breakpoint name, then we know\n // that we have values that we can use to set max-font-size and max-vw as both\n // values derive from the next breakpoint\n @if $next-fluid-breakpoint-name {\n $next-fluid-breakpoint: map.get($breakpoints, $next-fluid-breakpoint-name);\n $max-font-size: map.get(\n map.get($fluid-sizes, $next-fluid-breakpoint-name),\n font-size\n );\n $max-vw: map.get($next-fluid-breakpoint, width);\n\n // prettier-ignore\n font-size: calc(#{$min-font-size} +\n #{strip-unit($max-font-size - $min-font-size)} *\n ((100vw - #{$min-vw}) / #{strip-unit($max-vw - $min-vw)})\n );\n } @else {\n // Otherwise, just default to setting the font size found from the type\n // style or the given fluid breakpoint in the type style\n font-size: $min-font-size;\n }\n}\n\n// TODO move following variable and `custom-property` mixin into shared file for\n// both `@carbon/type` and `@carbon/themes`\n\n/// @access private\n/// @group @carbon/type\n@mixin custom-properties($name, $value) {\n @each $property, $value in $value {\n #{$property}: var(\n --#{$custom-property-prefix}-#{$name}-#{$property},\n #{$value}\n );\n }\n}\n\n/// Helper mixin to include the styles for a given token in any selector in your\n/// project. Also includes an optional fluid option that will enable fluid\n/// styles for the token if they are defined. Fluid styles will cause the\n/// token's font-size to be computed based on the viewport size. As a result, use\n/// with caution in fixed contexts.\n/// @param {String} $name - The name of the token to get the styles for\n/// @param {Boolean} $fluid [false] - Specify whether to include fluid styles for the\n/// @param {Map} $breakpoints [$grid-breakpoints] - Provide a custom breakpoint map to use\n/// @access public\n/// @group @carbon/type\n@mixin type-style(\n $name,\n $fluid: false,\n $breakpoints: gridconfig.$grid-breakpoints\n) {\n @if not map.has-key($tokens, $name) {\n @error 'Unable to find a token with the name: `#{$name}`';\n }\n\n $token: map.get($tokens, $name);\n\n // If $fluid is set to true and the token has breakpoints defined for fluid\n // styles, delegate to the fluid-type helper for the given token\n @if $fluid == true and map.has-key($token, 'breakpoints') {\n @include fluid-type($token, $breakpoints);\n } @else {\n @include custom-properties($name, $token);\n }\n}\n","// Code generated by @carbon/layout. DO NOT EDIT.\n//\n// Copyright IBM Corp. 2018, 2021\n//\n// This source code is licensed under the Apache-2.0 license found in the\n// LICENSE file in the root directory of this source tree.\n//\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-01: 0.125rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-02: 0.25rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-03: 0.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-04: 0.75rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-05: 1rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-06: 1.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-07: 2rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-08: 2.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-09: 3rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-10: 4rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-11: 5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-12: 6rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-13: 10rem !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/layout\n$spacing: (\n spacing-01: $spacing-01,\n spacing-02: $spacing-02,\n spacing-03: $spacing-03,\n spacing-04: $spacing-04,\n spacing-05: $spacing-05,\n spacing-06: $spacing-06,\n spacing-07: $spacing-07,\n spacing-08: $spacing-08,\n spacing-09: $spacing-09,\n spacing-10: $spacing-10,\n spacing-11: $spacing-11,\n spacing-12: $spacing-12,\n spacing-13: $spacing-13,\n);\n"],sourceRoot:""}]),s.locals={errorMessage:"FZ33ihINl+8YUVozv7ZwXw==",errorCopy:"jx2T8vrDO9pVp2FeSg6R+w==",desktopHeading:"cwU9zKw+qDdXGFxN1tD4Xg==",tabletHeading:"gOCpwZibZuK7xHHy+IDIHQ==",tile:"ztmVxMaymtPTKnWjzbgENg=="};const a=s},6618:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(9233),o=n.n(r),i=n(361),s=n.n(i)()(o());s.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.Y3Q\\+kOxLLWMt9RIQX8EZ2w\\=\\={border-right:1px solid #e0e0e0;padding-top:1rem}.Y3Q\\+kOxLLWMt9RIQX8EZ2w\\=\\= .cds--side-nav__link{color:#525252;font-size:var(--cds-heading-compact-01-font-size, 0.875rem);font-weight:var(--cds-heading-compact-01-font-weight, 600);line-height:var(--cds-heading-compact-01-line-height, 1.28572);letter-spacing:var(--cds-heading-compact-01-letter-spacing, 0.16px)}.Y3Q\\+kOxLLWMt9RIQX8EZ2w\\=\\= .cds--side-nav__link:focus,.Y3Q\\+kOxLLWMt9RIQX8EZ2w\\=\\= .cds--side-nav__link:hover{background-color:#f4f4f4}.Y3Q\\+kOxLLWMt9RIQX8EZ2w\\=\\= .cds--side-nav__link.active-left-nav-link{color:#161616;border-left:.25rem solid var(--brand-01);background-color:#e0e0e0;outline:none;padding:0 .75rem}.omrs-breakpoint-gt-tablet .cds--side-nav__link{height:2rem}.omrs-breakpoint-lt-desktop .cds--side-nav__link{height:3rem}","",{version:3,sources:["webpack://./../esm-styleguide/src/_vars.scss","webpack://./../esm-styleguide/src/left-nav/left-nav.module.scss","webpack://./../../../node_modules/@carbon/type/scss/_styles.scss"],names:[],mappings:"AAoDA,MACE,mBAAA,CACA,mBAAA,CACA,mBAAA,CCpDF,6BACE,8BAAA,CACA,gBAAA,CAGA,kDACE,aDJM,CEo0BN,2DAAA,CAAA,0DAAA,CAAA,8DAAA,CAAA,mEAAA,CD7zBA,gHAEE,wBDdE,CCkBJ,uEACE,aDfE,CCgBF,wCAAA,CACA,wBDnBE,CCoBF,YAAA,CACA,gBAAA,CAOJ,gDACE,WAAA,CAMF,iDACE,WAAA",sourcesContent:["$ui-01: #f4f4f4;\n$ui-02: #ffffff;\n$ui-03: #e0e0e0;\n$ui-04: #8d8d8d;\n$ui-05: #161616;\n$text-02: #525252;\n$text-03: #a8a8a8;\n$ui-background: #ffffff;\n$color-gray-30: #c6c6c6;\n$color-gray-70: #525252;\n$color-gray-100: #161616;\n$color-blue-60-2: #0f62fe;\n$color-blue-10: #edf5ff;\n$color-yellow-50: #feecae;\n$carbon--red-50: #fa4d56;\n$inverse-link: #78a9ff;\n$support-02: #24a148;\n$inverse-support-03: #f1c21b;\n$warning-background: #fff8e1;\n$openmrs-background-grey: #f4f4f4;\n$danger: #da1e28;\n$interactive-01: #0f62fe;\n$field-01: #f4f4f4;\n$grey-2: #e0e0e0;\n$labeldropdown: #c6c6c6;\n\n$brand-primary-10: #d9fbfb;\n$brand-primary-20: #9ef0f0;\n$brand-primary-30: #3ddbd9;\n$brand-primary-40: #08bdba;\n$brand-primary-50: #009d9a;\n\n/* 60,70 and 80 are already declared as brand-01, 02 and 03 respectively */\n\n$brand-primary-90: #022b30;\n$brand-primary-100: #081a1c;\n\n@mixin brand-01($property) {\n #{$property}: #005d5d;\n #{$property}: var(--brand-01);\n}\n\n@mixin brand-02($property) {\n #{$property}: #004144;\n #{$property}: var(--brand-02);\n}\n\n@mixin brand-03($property) {\n #{$property}: #007d79;\n #{$property}: var(--brand-03);\n}\n\n:root {\n --brand-01: #005d5d;\n --brand-02: #004144;\n --brand-03: #007d79;\n}\n\n$breakpoint-phone-min: 0px;\n$breakpoint-phone-max: 600px;\n$breakpoint-tablet-min: 601px;\n$breakpoint-tablet-max: 1023px;\n$breakpoint-small-desktop-min: 1024px;\n$breakpoint-small-desktop-max: 1439px;\n$breakpoint-large-desktop-min: 1440px;\n$breakpoint-large-desktop-max: 99999999px;\n\n/* These color variables will be removed in a future release */\n$brand-teal-01: #007d79;\n$brand-01: #005d5d;\n$brand-02: #004144;\n",'@use "@carbon/styles/scss/type";\n@import "../vars";\n\n.leftNav {\n border-right: 1px solid $ui-03;\n padding-top: 1rem;\n\n // Left nav menu item\n :global(.cds--side-nav__link) {\n color: $text-02;\n @include type.type-style("heading-compact-01");\n\n &:focus,\n &:hover {\n background-color: $ui-01;\n }\n\n // Active menu item\n &:global(.active-left-nav-link) {\n color: $ui-05;\n border-left: 0.25rem solid var(--brand-01);\n background-color: $ui-03;\n outline: none;\n padding: 0 0.75rem;\n }\n }\n}\n\n/* Desktop */\n:global(.omrs-breakpoint-gt-tablet) {\n :global(.cds--side-nav__link) {\n height: 2rem;\n }\n}\n\n/* Tablet */\n:global(.omrs-breakpoint-lt-desktop) {\n :global(.cds--side-nav__link) {\n height: 3rem;\n }\n}\n',"//\n// Copyright IBM Corp. 2018, 2018\n//\n// This source code is licensed under the Apache-2.0 license found in the\n// LICENSE file in the root directory of this source tree.\n//\n\n// stylelint-disable number-max-precision\n\n@use 'sass:map';\n@use 'sass:math';\n@use '@carbon/grid/scss/config' as gridconfig;\n@use '@carbon/grid/scss/breakpoint' as grid;\n@use 'prefix' as *;\n@use 'font-family';\n@use 'scale';\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$label-01: (\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$label-02: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$legal-01: (\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$legal-02: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @deprecated\n/// @group @carbon/type\n$helper-text-01: (\n font-size: scale.type-scale(1),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @deprecated\n/// @group @carbon/type\n$helper-text-02: (\n font-size: carbon--type-scale(2),\n font-weight: carbon--font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-short-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-compact-01: $body-short-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-long-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.42857,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-01: $body-long-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-short-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.375,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-compact-02: $body-short-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-long-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.5,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-02: $body-long-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$code-01: (\n font-family: font-family.font-family('mono'),\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$code-02: (\n font-family: font-family.font-family('mono'),\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.42857,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.42857,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-compact-01: $productive-heading-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.5,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.375,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-compact-02: $productive-heading-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-03: (\n font-size: scale.type-scale(5),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.4,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-03: $productive-heading-03 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-04: (\n font-size: scale.type-scale(7),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-04: $productive-heading-04 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-05: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('light'),\n line-height: 1.25,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-05: $productive-heading-05 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-06: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n // Extra digit needed for precision in Chrome\n line-height: 1.199,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-06: $productive-heading-06 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-07: (\n font-size: scale.type-scale(12),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-07: $productive-heading-07 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-01: $heading-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-02: $heading-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-03: (\n font-size: scale.type-scale(5),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.4,\n letter-spacing: 0,\n breakpoints: (\n xlg: (\n font-size: scale.type-scale(5),\n line-height: 1.25,\n ),\n max: (\n font-size: scale.type-scale(6),\n line-height: 1.334,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-03: $expressive-heading-03 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-04: (\n font-size: scale.type-scale(7),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0,\n breakpoints: (\n xlg: (\n font-size: scale.type-scale(8),\n line-height: 1.25,\n font-weight: font-family.font-weight('light'),\n ),\n max: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('light'),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-04: $expressive-heading-04 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-05: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('light'),\n line-height: 1.25,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(9),\n line-height: 1.22,\n ),\n lg: (\n font-size: scale.type-scale(10),\n line-height: 1.19,\n ),\n xlg: (\n font-size: scale.type-scale(11),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(13),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-05: $expressive-heading-05 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-06: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.25,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(9),\n line-height: 1.22,\n ),\n lg: (\n font-size: scale.type-scale(10),\n line-height: 1.19,\n ),\n xlg: (\n font-size: scale.type-scale(11),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(13),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-06: $expressive-heading-06 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-paragraph-01: (\n font-size: scale.type-scale(6),\n font-weight: font-family.font-weight('light'),\n line-height: 1.334,\n letter-spacing: 0,\n breakpoints: (\n lg: (\n font-size: scale.type-scale(7),\n line-height: 1.28572,\n ),\n max: (\n font-size: scale.type-scale(8),\n line-height: 1.25,\n ),\n ),\n);\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-paragraph-01: $expressive-paragraph-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$quotation-01: (\n font-family: font-family.font-family('serif'),\n font-size: scale.type-scale(5),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.3,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(5),\n ),\n lg: (\n font-size: scale.type-scale(6),\n line-height: 1.334,\n ),\n xlg: (\n font-size: scale.type-scale(7),\n line-height: 1.28572,\n ),\n max: (\n font-size: scale.type-scale(8),\n line-height: 1.25,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-quotation-01: $quotation-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$quotation-02: (\n font-family: font-family.font-family('serif'),\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('light'),\n line-height: 1.25,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(9),\n line-height: 1.22,\n ),\n lg: (\n font-size: scale.type-scale(10),\n line-height: 1.19,\n ),\n xlg: (\n font-size: scale.type-scale(11),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(13),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-quotation-02: $quotation-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-01: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(10),\n ),\n lg: (\n font-size: scale.type-scale(12),\n ),\n xlg: (\n font-size: scale.type-scale(13),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(15),\n line-height: 1.13,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-01: $display-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-02: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(10),\n ),\n lg: (\n font-size: scale.type-scale(12),\n ),\n xlg: (\n font-size: scale.type-scale(13),\n line-height: 1.16,\n ),\n max: (\n font-size: scale.type-scale(15),\n line-height: 1.13,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-02: $display-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-03: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(12),\n line-height: 1.18,\n ),\n lg: (\n font-size: scale.type-scale(13),\n line-height: 1.16,\n letter-spacing: -0.64px,\n ),\n xlg: (\n font-size: scale.type-scale(15),\n line-height: 1.13,\n letter-spacing: -0.64px,\n ),\n max: (\n font-size: scale.type-scale(16),\n line-height: 1.11,\n letter-spacing: -0.96px,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-03: $display-03 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-04: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(14),\n line-height: 1.15,\n ),\n lg: (\n font-size: scale.type-scale(17),\n line-height: 1.11,\n letter-spacing: -0.64px,\n ),\n xlg: (\n font-size: scale.type-scale(20),\n line-height: 1.07,\n letter-spacing: -0.64px,\n ),\n max: (\n font-size: scale.type-scale(23),\n line-height: 1.05,\n letter-spacing: -0.96px,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-04: $display-04 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$tokens: (\n label-01: $label-01,\n label-02: $label-02,\n helper-text-01: $helper-text-01,\n helper-text-02: $helper-text-02,\n body-short-01: $body-short-01,\n body-short-02: $body-short-02,\n body-long-01: $body-long-01,\n body-long-02: $body-long-02,\n code-01: $code-01,\n code-02: $code-02,\n heading-01: $heading-01,\n heading-02: $heading-02,\n productive-heading-01: $productive-heading-01,\n productive-heading-02: $productive-heading-02,\n productive-heading-03: $productive-heading-03,\n productive-heading-04: $productive-heading-04,\n productive-heading-05: $productive-heading-05,\n productive-heading-06: $productive-heading-06,\n productive-heading-07: $productive-heading-07,\n expressive-paragraph-01: $expressive-paragraph-01,\n expressive-heading-01: $expressive-heading-01,\n expressive-heading-02: $expressive-heading-02,\n expressive-heading-03: $expressive-heading-03,\n expressive-heading-04: $expressive-heading-04,\n expressive-heading-05: $expressive-heading-05,\n expressive-heading-06: $expressive-heading-06,\n quotation-01: $quotation-01,\n quotation-02: $quotation-02,\n display-01: $display-01,\n display-02: $display-02,\n display-03: $display-03,\n display-04: $display-04,\n // V11 Tokens\n legal-01: $legal-01,\n legal-02: $legal-02,\n body-compact-01: $body-compact-01,\n body-compact-02: $body-compact-02,\n heading-compact-01: $heading-compact-01,\n heading-compact-02: $heading-compact-02,\n body-01: $body-01,\n body-02: $body-02,\n heading-03: $heading-03,\n heading-04: $heading-04,\n heading-05: $heading-05,\n heading-06: $heading-06,\n heading-07: $heading-07,\n fluid-heading-03: $fluid-heading-03,\n fluid-heading-04: $fluid-heading-04,\n fluid-heading-05: $fluid-heading-05,\n fluid-heading-06: $fluid-heading-06,\n fluid-paragraph-01: $fluid-paragraph-01,\n fluid-quotation-01: $fluid-quotation-01,\n fluid-quotation-02: $fluid-quotation-02,\n fluid-display-01: $fluid-display-01,\n fluid-display-02: $fluid-display-02,\n fluid-display-03: $fluid-display-03,\n fluid-display-04: $fluid-display-04,\n);\n\n/// @param {Map} $map\n/// @access public\n/// @group @carbon/type\n@mixin properties($map) {\n @each $name, $value in $map {\n #{$name}: $value;\n }\n}\n\n/// @param {Number} $value - Number with units\n/// @return {Number} Without units\n/// @access public\n/// @group @carbon/type\n@function strip-unit($value) {\n @return math.div($value, $value * 0 + 1);\n}\n\n/// This helper includes fluid type styles for the given token value. Fluid type\n/// means that the `font-size` is computed using `calc()` in order to be\n/// determined by the screen size instead of a breakpoint. As a result, fluid\n/// styles should be used with caution in fixed width contexts.\n///\n/// In addition, we make use of %-based line-heights so that the line-height of\n/// each type style is computed correctly due to the dynamic nature of the\n/// `font-size`.\n///\n/// Most of the logic for this work comes from CSS Tricks:\n/// https://css-tricks.com/snippets/css/fluid-typography/\n///\n/// @param {Map} $type-styles - The value of a given type token\n/// @param {Map} $breakpoints [$grid-breakpoints] - Custom breakpoints to use\n/// @access public\n/// @group @carbon/type\n@mixin fluid-type($type-styles, $breakpoints: gridconfig.$grid-breakpoints) {\n // Include the initial styles for the given token by default without any\n // media query guard. This includes `font-size` as a fallback in the case\n // that a browser does not support `calc()`\n @include properties(map.remove($type-styles, breakpoints));\n // We also need to include the `sm` styles by default since they don't\n // appear in the fluid styles for tokens\n @include fluid-type-size($type-styles, sm, $breakpoints);\n\n // Finally, we need to go through all the breakpoints defined in the type\n // token and apply the properties and fluid type size for that given\n // breakpoint\n @each $name, $values in map.get($type-styles, breakpoints) {\n @include grid.breakpoint($name) {\n @include properties($values);\n @include fluid-type-size($type-styles, $name, $breakpoints);\n }\n }\n}\n\n/// Computes the fluid `font-size` for a given type style and breakpoint\n/// @param {Map} $type-styles - The styles for a given token\n/// @param {String} $name - The name of the breakpoint to which we apply the fluid\n/// @param {Map} $breakpoints [$grid-breakpoints] - The breakpoints for the grid system\n/// @access public\n/// @group @carbon/type\n@mixin fluid-type-size(\n $type-styles,\n $name,\n $breakpoints: gridconfig.$grid-breakpoints\n) {\n // Get the information about the breakpoint we're currently working in. Useful\n // for getting initial width information\n $breakpoint: map.get($breakpoints, $name);\n\n // Our fluid styles are captured under the 'breakpoints' property in our type\n // styles map. These define what values to treat as `max-` variables below\n $fluid-sizes: map.get($type-styles, breakpoints);\n $fluid-breakpoint: ();\n // Special case for `sm` because the styles for small are on the type style\n // directly\n @if $name == sm {\n $fluid-breakpoint: map.remove($type-styles, breakpoints);\n } @else {\n $fluid-breakpoint: map.get($fluid-sizes, $name);\n }\n\n // Initialize our font-sizes to the default size for the type style\n $max-font-size: map.get($type-styles, font-size);\n $min-font-size: map.get($type-styles, font-size);\n @if map.has-key($fluid-breakpoint, font-size) {\n $min-font-size: map.get($fluid-breakpoint, font-size);\n }\n\n // Initialize our min and max width to the width of the current breakpoint\n $max-vw: map.get($breakpoint, width);\n $min-vw: map.get($breakpoint, width);\n\n // We can use `breakpoint-next` to see if there is another breakpoint we can\n // use to update `max-font-size` and `max-vw` with larger values\n $next-breakpoint-available: grid.breakpoint-next($name, $breakpoints);\n $next-fluid-breakpoint-name: null;\n\n // We need to figure out what the next available fluid breakpoint is for our\n // given $type-styles. In this loop we try and iterate through breakpoints\n // until we either manually set $next-breakpoint-available to null or\n // `breakpoint-next` returns null.\n @while $next-breakpoint-available {\n @if map.has-key($fluid-sizes, $next-breakpoint-available) {\n $next-fluid-breakpoint-name: $next-breakpoint-available;\n $next-breakpoint-available: null;\n } @else {\n $next-breakpoint-available: grid.breakpoint-next(\n $next-breakpoint-available,\n $breakpoints\n );\n }\n }\n\n // If we have found the next available fluid breakpoint name, then we know\n // that we have values that we can use to set max-font-size and max-vw as both\n // values derive from the next breakpoint\n @if $next-fluid-breakpoint-name {\n $next-fluid-breakpoint: map.get($breakpoints, $next-fluid-breakpoint-name);\n $max-font-size: map.get(\n map.get($fluid-sizes, $next-fluid-breakpoint-name),\n font-size\n );\n $max-vw: map.get($next-fluid-breakpoint, width);\n\n // prettier-ignore\n font-size: calc(#{$min-font-size} +\n #{strip-unit($max-font-size - $min-font-size)} *\n ((100vw - #{$min-vw}) / #{strip-unit($max-vw - $min-vw)})\n );\n } @else {\n // Otherwise, just default to setting the font size found from the type\n // style or the given fluid breakpoint in the type style\n font-size: $min-font-size;\n }\n}\n\n// TODO move following variable and `custom-property` mixin into shared file for\n// both `@carbon/type` and `@carbon/themes`\n\n/// @access private\n/// @group @carbon/type\n@mixin custom-properties($name, $value) {\n @each $property, $value in $value {\n #{$property}: var(\n --#{$custom-property-prefix}-#{$name}-#{$property},\n #{$value}\n );\n }\n}\n\n/// Helper mixin to include the styles for a given token in any selector in your\n/// project. Also includes an optional fluid option that will enable fluid\n/// styles for the token if they are defined. Fluid styles will cause the\n/// token's font-size to be computed based on the viewport size. As a result, use\n/// with caution in fixed contexts.\n/// @param {String} $name - The name of the token to get the styles for\n/// @param {Boolean} $fluid [false] - Specify whether to include fluid styles for the\n/// @param {Map} $breakpoints [$grid-breakpoints] - Provide a custom breakpoint map to use\n/// @access public\n/// @group @carbon/type\n@mixin type-style(\n $name,\n $fluid: false,\n $breakpoints: gridconfig.$grid-breakpoints\n) {\n @if not map.has-key($tokens, $name) {\n @error 'Unable to find a token with the name: `#{$name}`';\n }\n\n $token: map.get($tokens, $name);\n\n // If $fluid is set to true and the token has breakpoints defined for fluid\n // styles, delegate to the fluid-type helper for the given token\n @if $fluid == true and map.has-key($token, 'breakpoints') {\n @include fluid-type($token, $breakpoints);\n } @else {\n @include custom-properties($name, $token);\n }\n}\n"],sourceRoot:""}]),s.locals={leftNav:"Y3Q+kOxLLWMt9RIQX8EZ2w=="};const a=s},361:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var i=0;i<this.length;i++){var s=this[i][0];null!=s&&(o[s]=!0)}for(var a=0;a<e.length;a++){var c=[].concat(e[a]);r&&o[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),t.push(c))}},t}},9233:e=>{"use strict";function t(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.exports=function(e){var n,r,o=(r=4,function(e){if(Array.isArray(e))return e}(n=e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=n){var r,o,i=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);s=!0);}catch(e){a=!0,o=e}finally{try{s||null==n.return||n.return()}finally{if(a)throw o}}return i}}(n,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}}(n,r)||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=o[1],s=o[3];if(!s)return i;if("function"==typeof btoa){var a=btoa(unescape(encodeURIComponent(JSON.stringify(s)))),c="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(a),u="/*# ".concat(c," */"),l=s.sources.map((function(e){return"/*# sourceURL=".concat(s.sourceRoot||"").concat(e," */")}));return[i].concat(l).concat([u]).join("\n")}return[i].join("\n")}},4332: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)}}}()},459:(e,t,n)=>{"use strict";var r=n(5704);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,s){if(s!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},216:(e,t,n)=>{e.exports=n(459)()},5704:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4645:(e,t,n)=>{"use strict";var r=n(6551);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},6196:(e,t,n)=>{"use strict";n.d(t,{y:()=>l});var r=n(6022),o=n(7811),i=n(9714),s=n(2412),a=n(4002),c=n(6295),u=n(5769),l=function(){function e(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 r=this.operator,a=function(e,t,n){if(e){if(e instanceof o.L)return e;if(e[i.b])return e[i.b]()}return e||t||n?new o.L(e,t,n):new o.L(s.c)}(e,t,n);if(r?a.add(r.call(a,this.source)):a.add(this.source||u.v.useDeprecatedSynchronousErrorHandling&&!a.syncErrorThrowable?this._subscribe(a):this._trySubscribe(a)),u.v.useDeprecatedSynchronousErrorHandling&&a.syncErrorThrowable&&(a.syncErrorThrowable=!1,a.syncErrorThrown))throw a.syncErrorValue;return a},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){u.v.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),(0,r._)(e)?e.error(t):console.warn(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=f(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[a.L]=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,c.U)(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=f(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}();function f(e){if(e||(e=u.v.Promise||Promise),!e)throw new Error("no Promise impl found");return e}},2412:(e,t,n)=>{"use strict";n.d(t,{c:()=>i});var r=n(5769),o=n(1450),i={closed:!0,next:function(e){},error:function(e){if(r.v.useDeprecatedSynchronousErrorHandling)throw e;(0,o.z)(e)},complete:function(){}}},7811:(e,t,n)=>{"use strict";n.d(t,{L:()=>l});var r=n(7080),o=n(9147),i=n(2412),s=n(1736),a=n(9714),c=n(5769),u=n(1450),l=function(e){function t(n,r,o){var s=e.call(this)||this;switch(s.syncErrorValue=null,s.syncErrorThrown=!1,s.syncErrorThrowable=!1,s.isStopped=!1,arguments.length){case 0:s.destination=i.c;break;case 1:if(!n){s.destination=i.c;break}if("object"==typeof n){n instanceof t?(s.syncErrorThrowable=n.syncErrorThrowable,s.destination=n,n.add(s)):(s.syncErrorThrowable=!0,s.destination=new f(s,n));break}default:s.syncErrorThrowable=!0,s.destination=new f(s,n,r,o)}return s}return r.ZT(t,e),t.prototype[a.b]=function(){return this},t.create=function(e,n,r){var o=new t(e,n,r);return o.syncErrorThrowable=!1,o},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},t}(s.w),f=function(e){function t(t,n,r,s){var a,c=e.call(this)||this;c._parentSubscriber=t;var u=c;return(0,o.m)(n)?a=n:n&&(a=n.next,r=n.error,s=n.complete,n!==i.c&&(u=Object.create(n),(0,o.m)(u.unsubscribe)&&c.add(u.unsubscribe.bind(u)),u.unsubscribe=c.unsubscribe.bind(c))),c._context=u,c._next=a,c._error=r,c._complete=s,c}return r.ZT(t,e),t.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;c.v.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},t.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,n=c.v.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):(0,u.z)(e),this.unsubscribe();else{if(this.unsubscribe(),n)throw e;(0,u.z)(e)}}},t.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)};c.v.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),c.v.useDeprecatedSynchronousErrorHandling)throw e;(0,u.z)(e)}},t.prototype.__tryOrSetError=function(e,t,n){if(!c.v.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,n)}catch(t){return c.v.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=t,e.syncErrorThrown=!0,!0):((0,u.z)(t),!0)}return!1},t.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},t}(l)},1736:(e,t,n)=>{"use strict";n.d(t,{w:()=>a});var r=n(4724),o=n(1167),i=n(9147),s=n(8961),a=function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}var t;return e.prototype.unsubscribe=function(){var t;if(!this.closed){var n=this,a=n._parentOrParents,u=n._ctorUnsubscribe,l=n._unsubscribe,f=n._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,a instanceof e)a.remove(this);else if(null!==a)for(var p=0;p<a.length;++p)a[p].remove(this);if((0,i.m)(l)){u&&(this._unsubscribe=void 0);try{l.call(this)}catch(e){t=e instanceof s.B?c(e.errors):[e]}}if((0,r.k)(f)){p=-1;for(var d=f.length;++p<d;){var h=f[p];if((0,o.K)(h))try{h.unsubscribe()}catch(e){t=t||[],e instanceof s.B?t=t.concat(c(e.errors)):t.push(e)}}}if(t)throw new s.B(t)}},e.prototype.add=function(t){var n=t;if(!t)return e.EMPTY;switch(typeof 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(!(n instanceof e)){var r=n;(n=new e)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}var o=n._parentOrParents;if(null===o)n._parentOrParents=this;else if(o instanceof e){if(o===this)return n;n._parentOrParents=[o,this]}else{if(-1!==o.indexOf(this))return n;o.push(this)}var i=this._subscriptions;return null===i?this._subscriptions=[n]:i.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=((t=new e).closed=!0,t),e}();function c(e){return e.reduce((function(e,t){return e.concat(t instanceof s.B?t.errors:t)}),[])}},5769:(e,t,n)=>{"use strict";n.d(t,{v:()=>o});var r=!1,o={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){e&&(new Error).stack,r=e},get useDeprecatedSynchronousErrorHandling(){return r}}},70:(e,t,n)=>{"use strict";n.d(t,{E:()=>o,c:()=>i});var r=n(6196),o=new r.y((function(e){return e.complete()}));function i(e){return e?function(e){return new r.y((function(t){return e.schedule((function(){return t.complete()}))}))}(e):o}},5725:(e,t,n)=>{"use strict";n.d(t,{U:()=>i});var r=n(7080),o=n(7811);function i(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 s(e,t))}}var s=function(){function e(e,t){this.project=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.project,this.thisArg))},e}(),a=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.project=n,o.count=0,o.thisArg=r||o,o}return r.ZT(t,e),t.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)},t}(o.L)},4002:(e,t,n)=>{"use strict";n.d(t,{L:()=>r});var r=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}()},9714:(e,t,n)=>{"use strict";n.d(t,{b:()=>r});var r=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}()},1760:(e,t,n)=>{"use strict";n.d(t,{W:()=>r});var r=function(){function e(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return e.prototype=Object.create(Error.prototype),e}()},8961:(e,t,n)=>{"use strict";n.d(t,{B:()=>r});var r=function(){function e(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}()},6022:(e,t,n)=>{"use strict";n.d(t,{_:()=>o});var r=n(7811);function o(e){for(;e;){var t=e,n=t.closed,o=t.destination,i=t.isStopped;if(n||i)return!1;e=o&&o instanceof r.L?o:null}return!0}},1450:(e,t,n)=>{"use strict";function r(e){setTimeout((function(){throw e}),0)}n.d(t,{z:()=>r})},7430:(e,t,n)=>{"use strict";function r(e){return e}n.d(t,{y:()=>r})},4724:(e,t,n)=>{"use strict";n.d(t,{k:()=>r});var r=function(){return Array.isArray||function(e){return e&&"number"==typeof e.length}}()},9147:(e,t,n)=>{"use strict";function r(e){return"function"==typeof e}n.d(t,{m:()=>r})},1167:(e,t,n)=>{"use strict";function r(e){return null!==e&&"object"==typeof e}n.d(t,{K:()=>r})},6295:(e,t,n)=>{"use strict";n.d(t,{U:()=>i,z:()=>o});var r=n(7430);function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i(e)}function i(e){return 0===e.length?r.y:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}},7080:(e,t,n)=>{"use strict";n.d(t,{ZT:()=>o});var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},r(e,t)};function o(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}},487:e=>{"use strict";var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var i={},s=[],a=0;a<e.length;a++){var c=e[a],u=r.base?c[0]+r.base:c[0],l=i[u]||0,f="".concat(u," ").concat(l);i[u]=l+1;var p=n(f),d={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==p)t[p].references++,t[p].updater(d);else{var h=o(d,r);r.byIndex=a,t.splice(a,0,{identifier:f,updater:h,references:1})}s.push(f)}return s}function o(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,o){var i=r(e=e||[],o=o||{});return function(e){e=e||[];for(var s=0;s<i.length;s++){var a=n(i[s]);t[a].references--}for(var c=r(e,o),u=0;u<i.length;u++){var l=n(i[u]);0===t[l].references&&(t[l].updater(),t.splice(l,1))}i=c}}},2052:e=>{"use strict";var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},1469:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},4010:(e,t,n)=>{"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},631:e=>{"use strict";e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,o&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var i=n.sourceMap;i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},9329:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},2173:(e,t,n)=>{"use strict";var r=n(5776),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,s=r.useEffect,a=r.useLayoutEffect,c=r.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,l=r[1];return a((function(){o.value=n,o.getSnapshot=t,u(o)&&l({inst:o})}),[e,n,t]),s((function(){return u(o)&&l({inst:o}),e((function(){u(o)&&l({inst:o})}))}),[e]),c(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:l},1374:(e,t,n)=>{"use strict";e.exports=n(2173)},6763:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(682),o=n(658);const i=(0,r.Z)(o.Z,"Map")},7851:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=n(658).Z.Symbol},963:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(7851),o=Object.prototype,i=o.hasOwnProperty,s=o.toString,a=r.Z?r.Z.toStringTag:void 0;var c=Object.prototype.toString;var u=r.Z?r.Z.toStringTag:void 0;const l=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":u&&u in Object(e)?function(e){var t=i.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch(e){}var o=s.call(e);return r&&(t?e[a]=n:delete e[a]),o}(e):function(e){return c.call(e)}(e)}},9295:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(9494);const o=(0,n(6899).Z)(Object.keys,Object);var i=Object.prototype.hasOwnProperty;const s=function(e){if(!(0,r.Z)(e))return o(e);var t=[];for(var n in Object(e))i.call(e,n)&&"constructor"!=n&&t.push(n);return t}},5852:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r="object"==typeof global&&global&&global.Object===Object&&global},682:(e,t,n)=>{"use strict";n.d(t,{Z:()=>g});var r=n(3200);const o=n(658).Z["__core-js_shared__"];var i,s=(i=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+i:"";var a=n(7275),c=n(9441),u=/^\[object .+?Constructor\]$/,l=Function.prototype,f=Object.prototype,p=l.toString,d=f.hasOwnProperty,h=RegExp("^"+p.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const y=function(e){return!(!(0,a.Z)(e)||(t=e,s&&s in t))&&((0,r.Z)(e)?h:u).test((0,c.Z)(e));var t},g=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return y(n)?n:void 0}},606:(e,t,n)=>{"use strict";n.d(t,{Z:()=>E});var r=n(682),o=n(658);const i=(0,r.Z)(o.Z,"DataView");var s=n(6763);const a=(0,r.Z)(o.Z,"Promise"),c=(0,r.Z)(o.Z,"Set"),u=(0,r.Z)(o.Z,"WeakMap");var l=n(963),f=n(9441),p="[object Map]",d="[object Promise]",h="[object Set]",y="[object WeakMap]",g="[object DataView]",m=(0,f.Z)(i),b=(0,f.Z)(s.Z),v=(0,f.Z)(a),w=(0,f.Z)(c),O=(0,f.Z)(u),S=l.Z;(i&&S(new i(new ArrayBuffer(1)))!=g||s.Z&&S(new s.Z)!=p||a&&S(a.resolve())!=d||c&&S(new c)!=h||u&&S(new u)!=y)&&(S=function(e){var t=(0,l.Z)(e),n="[object Object]"==t?e.constructor:void 0,r=n?(0,f.Z)(n):"";if(r)switch(r){case m:return g;case b:return p;case v:return d;case w:return h;case O:return y}return t});const E=S},9494:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=Object.prototype;const o=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||r)}},6899:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=function(e,t){return function(n){return e(t(n))}}},658:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(5852),o="object"==typeof self&&self&&self.Object===Object&&self;const i=r.Z||o||Function("return this")()},9441:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=Function.prototype.toString;const o=function(e){if(null!=e){try{return r.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},175:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(963),o=n(4897);const i=function(e){return(0,o.Z)(e)&&"[object Arguments]"==(0,r.Z)(e)};var s=Object.prototype,a=s.hasOwnProperty,c=s.propertyIsEnumerable;const u=i(function(){return arguments}())?i:function(e){return(0,o.Z)(e)&&a.call(e,"callee")&&!c.call(e,"callee")}},6575:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=Array.isArray},6905:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(3200),o=n(3492);const i=function(e){return null!=e&&(0,o.Z)(e.length)&&!(0,r.Z)(e)}},595:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(658);var o="object"==typeof exports&&exports&&!exports.nodeType&&exports,i=o&&"object"==typeof module&&module&&!module.nodeType&&module,s=i&&i.exports===o?r.Z.Buffer:void 0;const a=(s?s.isBuffer:void 0)||function(){return!1}},3202:(e,t,n)=>{"use strict";n.d(t,{Z:()=>J});const r=function(e,t){return e===t||e!=e&&t!=t},o=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1};var i=Array.prototype.splice;function s(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.prototype.clear=function(){this.__data__=[],this.size=0},s.prototype.delete=function(e){var t=this.__data__,n=o(t,e);return!(n<0||(n==t.length-1?t.pop():i.call(t,n,1),--this.size,0))},s.prototype.get=function(e){var t=this.__data__,n=o(t,e);return n<0?void 0:t[n][1]},s.prototype.has=function(e){return o(this.__data__,e)>-1},s.prototype.set=function(e,t){var n=this.__data__,r=o(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};const a=s;var c=n(6763);const u=(0,n(682).Z)(Object,"create");var l=Object.prototype.hasOwnProperty;var f=Object.prototype.hasOwnProperty;function p(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])}}p.prototype.clear=function(){this.__data__=u?u(null):{},this.size=0},p.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},p.prototype.get=function(e){var t=this.__data__;if(u){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return l.call(t,e)?t[e]:void 0},p.prototype.has=function(e){var t=this.__data__;return u?void 0!==t[e]:f.call(t,e)},p.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=u&&void 0===t?"__lodash_hash_undefined__":t,this};const d=p,h=function(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map};function y(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])}}y.prototype.clear=function(){this.size=0,this.__data__={hash:new d,map:new(c.Z||a),string:new d}},y.prototype.delete=function(e){var t=h(this,e).delete(e);return this.size-=t?1:0,t},y.prototype.get=function(e){return h(this,e).get(e)},y.prototype.has=function(e){return h(this,e).has(e)},y.prototype.set=function(e,t){var n=h(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};const g=y;function m(e){var t=this.__data__=new a(e);this.size=t.size}m.prototype.clear=function(){this.__data__=new a,this.size=0},m.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},m.prototype.get=function(e){return this.__data__.get(e)},m.prototype.has=function(e){return this.__data__.has(e)},m.prototype.set=function(e,t){var n=this.__data__;if(n instanceof a){var r=n.__data__;if(!c.Z||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new g(r)}return n.set(e,t),this.size=n.size,this};const b=m;function v(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new g;++t<n;)this.add(e[t])}v.prototype.add=v.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},v.prototype.has=function(e){return this.__data__.has(e)};const w=v,O=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},S=function(e,t,n,r,o,i){var s=1&n,a=e.length,c=t.length;if(a!=c&&!(s&&c>a))return!1;var u=i.get(e),l=i.get(t);if(u&&l)return u==t&&l==e;var f=-1,p=!0,d=2&n?new w:void 0;for(i.set(e,t),i.set(t,e);++f<a;){var h=e[f],y=t[f];if(r)var g=s?r(y,h,f,t,e,i):r(h,y,f,e,t,i);if(void 0!==g){if(g)continue;p=!1;break}if(d){if(!O(t,(function(e,t){if(s=t,!d.has(s)&&(h===e||o(h,e,n,r,i)))return d.push(t);var s}))){p=!1;break}}else if(h!==y&&!o(h,y,n,r,i)){p=!1;break}}return i.delete(e),i.delete(t),p};var E=n(7851);const x=n(658).Z.Uint8Array,_=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n},j=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n};var k=E.Z?E.Z.prototype:void 0,P=k?k.valueOf:void 0;var $=n(6575);var A=Object.prototype.propertyIsEnumerable,C=Object.getOwnPropertySymbols;const T=C?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 s=e[n];t(s,n,e)&&(i[o++]=s)}return i}(C(e),(function(t){return A.call(e,t)})))}:function(){return[]};var D=n(175),I=n(595),R=/^(?:0|[1-9]\d*)$/;const N=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&R.test(e))&&e>-1&&e%1==0&&e<t};var M=n(8396),L=Object.prototype.hasOwnProperty;const B=function(e,t){var n=(0,$.Z)(e),r=!n&&(0,D.Z)(e),o=!n&&!r&&(0,I.Z)(e),i=!n&&!r&&!o&&(0,M.Z)(e),s=n||r||o||i,a=s?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=a.length;for(var u in e)!t&&!L.call(e,u)||s&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||N(u,c))||a.push(u);return a};var U=n(9295),z=n(6905);const F=function(e){return(0,z.Z)(e)?B(e):(0,U.Z)(e)},K=function(e){return function(e,t,n){var r=t(e);return(0,$.Z)(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,F,T)};var V=Object.prototype.hasOwnProperty;var q=n(606),H="[object Arguments]",W="[object Array]",G="[object Object]",Z=Object.prototype.hasOwnProperty;const Y=function(e,t,n,o,i,s){var a=(0,$.Z)(e),c=(0,$.Z)(t),u=a?W:(0,q.Z)(e),l=c?W:(0,q.Z)(t),f=(u=u==H?G:u)==G,p=(l=l==H?G:l)==G,d=u==l;if(d&&(0,I.Z)(e)){if(!(0,I.Z)(t))return!1;a=!0,f=!1}if(d&&!f)return s||(s=new b),a||(0,M.Z)(e)?S(e,t,n,o,i,s):function(e,t,n,o,i,s,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||!s(new x(e),new x(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return r(+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 c=_;case"[object Set]":var u=1&o;if(c||(c=j),e.size!=t.size&&!u)return!1;var l=a.get(e);if(l)return l==t;o|=2,a.set(e,t);var f=S(c(e),c(t),o,i,s,a);return a.delete(e),f;case"[object Symbol]":if(P)return P.call(e)==P.call(t)}return!1}(e,t,u,n,o,i,s);if(!(1&n)){var h=f&&Z.call(e,"__wrapped__"),y=p&&Z.call(t,"__wrapped__");if(h||y){var g=h?e.value():e,m=y?t.value():t;return s||(s=new b),i(g,m,n,o,s)}}return!!d&&(s||(s=new b),function(e,t,n,r,o,i){var s=1&n,a=K(e),c=a.length;if(c!=K(t).length&&!s)return!1;for(var u=c;u--;){var l=a[u];if(!(s?l in t:V.call(t,l)))return!1}var f=i.get(e),p=i.get(t);if(f&&p)return f==t&&p==e;var d=!0;i.set(e,t),i.set(t,e);for(var h=s;++u<c;){var y=e[l=a[u]],g=t[l];if(r)var m=s?r(g,y,l,t,e,i):r(y,g,l,e,t,i);if(!(void 0===m?y===g||o(y,g,n,r,i):m)){d=!1;break}h||(h="constructor"==l)}if(d&&!h){var b=e.constructor,v=t.constructor;b==v||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof v&&v instanceof v||(d=!1)}return i.delete(e),i.delete(t),d}(e,t,n,o,i,s))};var X=n(4897);const Q=function e(t,n,r,o,i){return t===n||(null==t||null==n||!(0,X.Z)(t)&&!(0,X.Z)(n)?t!=t&&n!=n:Y(t,n,r,o,e,i))},J=function(e,t){return Q(e,t)}},3200:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(963),o=n(7275);const i=function(e){if(!(0,o.Z)(e))return!1;var t=(0,r.Z)(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},3492:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},7275:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},4897:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=function(e){return null!=e&&"object"==typeof e}},8396:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(963),o=n(3492),i=n(4897),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1;var a=n(5852),c="object"==typeof exports&&exports&&!exports.nodeType&&exports,u=c&&"object"==typeof module&&module&&!module.nodeType&&module,l=u&&u.exports===c&&a.Z.process,f=function(){try{return u&&u.require&&u.require("util").types||l&&l.binding&&l.binding("util")}catch(e){}}(),p=f&&f.isTypedArray;const d=p?(h=p,function(e){return h(e)}):function(e){return(0,i.Z)(e)&&(0,o.Z)(e.length)&&!!s[(0,r.Z)(e)]};var h},9789:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=function(e){return void 0===e}}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={id:e,loaded:!1,exports:{}};return n[e].call(i.exports,i,i.exports,o),i.loaded=!0,i.exports}o.m=n,o.c=r,o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(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.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,n)=>(o.f[n](e,t),t)),[])),o.u=e=>e+".openmrs-esm-framework.js",o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="_openmrs_esm_framework:",o.l=(n,r,i,s)=>{if(e[n])e[n].push(r);else{var a,c;if(void 0!==i)for(var u=document.getElementsByTagName("script"),l=0;l<u.length;l++){var f=u[l];if(f.getAttribute("src")==n||f.getAttribute("data-webpack")==t+i){a=f;break}}a||(c=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,o.nc&&a.setAttribute("nonce",o.nc),a.setAttribute("data-webpack",t+i),a.src=n),e[n]=[r];var p=(t,r)=>{a.onerror=a.onload=null,clearTimeout(d);var o=e[n];if(delete e[n],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach((e=>e(r))),t)return t(r)},d=setTimeout(p.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),c&&document.head.appendChild(a)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{o.S={};var e={},t={};o.I=(n,r)=>{r||(r=[]);var i=t[n];if(i||(i=t[n]={}),!(r.indexOf(i)>=0)){if(r.push(i),e[n])return e[n];o.o(o.S,n)||(o.S[n]={});var s=o.S[n],a="_openmrs_esm_framework",c=(e,t,n,r)=>{var o=s[e]=s[e]||{},i=o[t];(!i||!i.loaded&&(!r!=!i.eager?r:a>i.from))&&(o[t]={get:n,from:a,eager:!!r})},u=[];return"default"===n&&(c("dayjs","1.11.5",(()=>o.e(530).then((()=>()=>o(7530))))),c("i18next","19.9.2",(()=>o.e(585).then((()=>()=>o(3585))))),c("react-dom","18.2.0",(()=>o.e(788).then((()=>()=>o(2788))))),c("react-i18next","11.18.6",(()=>o.e(71).then((()=>()=>o(71))))),c("react","18.2.0",(()=>o.e(735).then((()=>()=>o(2735))))),c("rxjs","6.6.7",(()=>o.e(645).then((()=>()=>o(1645))))),c("single-spa","5.9.4",(()=>o.e(710).then((()=>()=>o(3710)))))),e[n]=u.length?Promise.all(u).then((()=>e[n]=1)):1}}})(),(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&!e;)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),(()=>{var e=e=>{var t=e=>e.split(".").map((e=>+e==e?+e:e)),n=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),r=n[1]?t(n[1]):[];return n[2]&&(r.length++,r.push.apply(r,t(n[2]))),n[3]&&(r.push([]),r.push.apply(r,t(n[3]))),r},t=e=>{var n=e[0],r="";if(1===e.length)return"*";if(n+.5){r+=0==n?">=":-1==n?"<":1==n?"^":2==n?"~":n>0?"=":"!=";for(var o=1,i=1;i<e.length;i++)o--,r+="u"==(typeof(a=e[i]))[0]?"-":(o>0?".":"")+(o=2,a);return r}var s=[];for(i=1;i<e.length;i++){var a=e[i];s.push(0===a?"not("+c()+")":1===a?"("+c()+" || "+c()+")":2===a?s.pop()+" "+s.pop():t(a))}return c();function c(){return s.pop().replace(/^\((.+)\)$/,"$1")}},n=(t,r)=>{if(0 in t){r=e(r);var o=t[0],i=o<0;i&&(o=-o-1);for(var s=0,a=1,c=!0;;a++,s++){var u,l,f=a<t.length?(typeof t[a])[0]:"";if(s>=r.length||"o"==(l=(typeof(u=r[s]))[0]))return!c||("u"==f?a>o&&!i:""==f!=i);if("u"==l){if(!c||"u"!=f)return!1}else if(c)if(f==l)if(a<=o){if(u!=t[a])return!1}else{if(i?u>t[a]:u<t[a])return!1;u!=t[a]&&(c=!1)}else if("s"!=f&&"n"!=f){if(i||a<=o)return!1;c=!1,a--}else{if(a<=o||l<f!=i)return!1;c=!1}else"s"!=f&&"n"!=f&&(c=!1,a--)}}var p=[],d=p.pop.bind(p);for(s=1;s<t.length;s++){var h=t[s];p.push(1==h?d()|d():2==h?d()&d():h?n(h,r):!d())}return!!d()},r=(t,n)=>{var r=t[n];return Object.keys(r).reduce(((t,n)=>!t||!r[t].loaded&&((t,n)=>{t=e(t),n=e(n);for(var r=0;;){if(r>=t.length)return r<n.length&&"u"!=(typeof n[r])[0];var o=t[r],i=(typeof o)[0];if(r>=n.length)return"u"==i;var s=n[r],a=(typeof s)[0];if(i!=a)return"o"==i&&"n"==a||"s"==a||"u"==i;if("o"!=i&&"u"!=i&&o!=s)return o<s;r++}})(t,n)?n:t),0)},i=(e,o,i,c)=>{var u=r(e,i);return n(c,u)||s(((e,n,r,o)=>"Unsatisfied version "+r+" from "+(r&&e[n][r].from)+" of shared singleton module "+n+" (required "+t(o)+")")(e,i,u,c)),a(e[i][u])},s=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},a=e=>(e.loaded=1,e.get()),c=(e=>function(t,n,r,i){var s=o.I(t);return s&&s.then?s.then(e.bind(e,t,o.S[t],n,r,i)):e(t,o.S[t],n,r,i)})(((e,t,n,r,s)=>t&&o.o(t,n)?i(t,0,n,r):s())),u={},l={4666:()=>c("default","rxjs",[1,6],(()=>o.e(645).then((()=>()=>o(1645))))),5875:()=>c("default","single-spa",[1,5],(()=>o.e(710).then((()=>()=>o(3710))))),5776:()=>c("default","react",[1,18],(()=>o.e(735).then((()=>()=>o(2735))))),6551:()=>c("default","react-dom",[1,18],(()=>o.e(788).then((()=>()=>o(2788))))),7319:()=>c("default","i18next",[1,19],(()=>o.e(585).then((()=>()=>o(3585))))),2680:()=>c("default","react-i18next",[1,11],(()=>o.e(71).then((()=>()=>o(71))))),9442:()=>c("default","dayjs",[1,1],(()=>o.e(530).then((()=>()=>o(7530)))))};[4666,5875,5776,6551,7319,2680,9442].forEach((e=>{o.m[e]=t=>{u[e]=0,delete o.c[e];var n=l[e]();if("function"!=typeof n)throw new Error("Shared module is not available for eager consumption: "+e);t.exports=n()}}));var f={};o.f.consumes=(e,t)=>{o.o(f,e)&&f[e].forEach((e=>{if(o.o(u,e))return t.push(u[e]);var n=t=>{u[e]=0,o.m[e]=n=>{delete o.c[e],n.exports=t()}},r=t=>{delete u[e],o.m[e]=n=>{throw delete o.c[e],t}};try{var i=l[e]();i.then?t.push(u[e]=i.then(n).catch(r)):n(i)}catch(e){r(e)}}))}})(),(()=>{var e={179:0};o.f.j=(t,n)=>{var r=o.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var i=new Promise(((n,o)=>r=e[t]=[n,o]));n.push(r[2]=i);var s=o.p+o.u(t),a=new Error;o.l(s,(n=>{if(o.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var i=n&&("load"===n.type?"missing":n.type),s=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+i+": "+s+")",a.name="ChunkLoadError",a.type=i,a.request=s,r[1](a)}}),"chunk-"+t,t)}};var t=(t,n)=>{var r,i,[s,a,c]=n,u=0;if(s.some((t=>0!==e[t]))){for(r in a)o.o(a,r)&&(o.m[r]=a[r]);c&&c(o)}for(t&&t(n);u<s.length;u++)i=s[u],o.o(e,i)&&e[i]&&e[i][0](),e[i]=0},n=globalThis.webpackChunk_openmrs_esm_framework=globalThis.webpackChunk_openmrs_esm_framework||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),o.nc=void 0;var i=o(7025);_openmrs_esm_framework=i})();
2
+ System.register([],(function(e,t){return{execute:function(){e((()=>{var e,t,n={7840:(e,t,n)=>{System.register(["@openmrs/esm-config","@openmrs/esm-error-handling","@openmrs/esm-offline"],(function(e,t){var r={},o={},i={};return{setters:[function(e){r.Type=e.Type,r.defineConfigSchema=e.defineConfigSchema,r.getConfig=e.getConfig,r.navigate=e.navigate,r.validators=e.validators},function(e){o.reportError=e.reportError},function(e){i.getSynchronizationItems=e.getSynchronizationItems}],execute:function(){e((()=>{var e={403:()=>{System.register([],(function(e,t){return{execute:function(){e((()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{createAppState:()=>a,createGlobalStore:()=>i,getAppState:()=>c,getGlobalStore:()=>s,subscribeTo:()=>u});const n=e=>{let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!=typeof o)?o:Object.assign({},t,o),n.forEach((n=>n(t,e)))}},o=()=>t,i={setState:r,getState:o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{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},r=e=>e?n(e):n,o={};function i(e,t){const n=o[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;{const n=r()((()=>t));return o[e]={value:n,active:!0},n}}function s(e,t){const n=o[e];if(!n){const n=r()((()=>null!=t?t:{}));return o[e]={value:n,active:!1},n}return n.value}function a(e){return i("app",e)}function c(){return s("app",{})}function u(e,t,n){let r=t(e.getState());return e.subscribe((e=>{const o=t(e);o!==r&&(r=o,n(o))}))}return t})())}}}))},824:e=>{"use strict";e.exports=r},254:e=>{"use strict";e.exports=o},738:e=>{"use strict";e.exports=i}},t={};function s(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,s),o.exports}s.d=(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=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{"use strict";s.r(a),s.d(a,{OpenmrsFetchError:()=>G,VisitMode:()=>Me,VisitStatus:()=>Le,backendDependencies:()=>Ke,clearCurrentUser:()=>oe,defaultVisitCustomRepresentation:()=>Te,fetchCurrentPatient:()=>he,fhirBaseUrl:()=>K,getCurrentUser:()=>te,getLocations:()=>Fe,getLoggedInUser:()=>se,getSessionLocation:()=>ae,getSessionStore:()=>ne,getStartedVisit:()=>Ne,getVisitTypes:()=>Ue,getVisitsForPatient:()=>De,makeUrl:()=>q,openmrsFetch:()=>H,openmrsObservableFetch:()=>W,refetchCurrentUser:()=>re,restBaseUrl:()=>F,saveVisit:()=>Ie,sessionEndpoint:()=>V,setSessionLocation:()=>ce,setupApiModule:()=>le,toLocationObject:()=>ze,toVisitTypeObject:()=>Be,updateVisit:()=>Re,userHasAccess:()=>ie});var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};function t(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}function r(e){return"function"==typeof e}var o=!1,i={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){e&&(new Error).stack,o=e},get useDeprecatedSynchronousErrorHandling(){return o}};function c(e){setTimeout((function(){throw e}),0)}var u={closed:!0,next:function(e){},error:function(e){if(i.useDeprecatedSynchronousErrorHandling)throw e;c(e)},complete:function(){}},l=Array.isArray||function(e){return e&&"number"==typeof e.length},f=function(){function e(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}(),p=function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return e.prototype.unsubscribe=function(){var t;if(!this.closed){var n,o=this,i=o._parentOrParents,s=o._ctorUnsubscribe,a=o._unsubscribe,c=o._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,i instanceof e)i.remove(this);else if(null!==i)for(var u=0;u<i.length;++u)i[u].remove(this);if(r(a)){s&&(this._unsubscribe=void 0);try{a.call(this)}catch(e){t=e instanceof f?d(e.errors):[e]}}if(l(c)){u=-1;for(var p=c.length;++u<p;){var h=c[u];if(null!==(n=h)&&"object"==typeof n)try{h.unsubscribe()}catch(e){t=t||[],e instanceof f?t=t.concat(d(e.errors)):t.push(e)}}}if(t)throw new f(t)}},e.prototype.add=function(t){var n=t;if(!t)return e.EMPTY;switch(typeof 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(!(n instanceof e)){var r=n;(n=new e)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}var o=n._parentOrParents;if(null===o)n._parentOrParents=this;else if(o instanceof e){if(o===this)return n;n._parentOrParents=[o,this]}else{if(-1!==o.indexOf(this))return n;o.push(this)}var i=this._subscriptions;return null===i?this._subscriptions=[n]:i.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}();function d(e){return e.reduce((function(e,t){return e.concat(t instanceof f?t.errors:t)}),[])}var h="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random(),y=function(e){function n(t,r,o){var i=e.call(this)||this;switch(i.syncErrorValue=null,i.syncErrorThrown=!1,i.syncErrorThrowable=!1,i.isStopped=!1,arguments.length){case 0:i.destination=u;break;case 1:if(!t){i.destination=u;break}if("object"==typeof t){t instanceof n?(i.syncErrorThrowable=t.syncErrorThrowable,i.destination=t,t.add(i)):(i.syncErrorThrowable=!0,i.destination=new g(i,t));break}default:i.syncErrorThrowable=!0,i.destination=new g(i,t,r,o)}return i}return t(n,e),n.prototype[h]=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,e.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}(p),g=function(e){function n(t,n,o,i){var s,a=e.call(this)||this;a._parentSubscriber=t;var c=a;return r(n)?s=n:n&&(s=n.next,o=n.error,i=n.complete,n!==u&&(r((c=Object.create(n)).unsubscribe)&&a.add(c.unsubscribe.bind(c)),c.unsubscribe=a.unsubscribe.bind(a))),a._context=c,a._next=s,a._error=o,a._complete=i,a}return t(n,e),n.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;i.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},n.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,n=i.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):c(e),this.unsubscribe();else{if(this.unsubscribe(),n)throw e;c(e)}}},n.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)};i.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},n.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),i.useDeprecatedSynchronousErrorHandling)throw e;c(e)}},n.prototype.__tryOrSetError=function(e,t,n){if(!i.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,n)}catch(t){return i.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=t,e.syncErrorThrown=!0,!0):(c(t),!0)}return!1},n.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},n}(y),m="function"==typeof Symbol&&Symbol.observable||"@@observable";function b(e){return e}var v=function(){function e(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 r=this.operator,o=function(e,t,n){if(e){if(e instanceof y)return e;if(e[h])return e[h]()}return e||t||n?new y(e,t,n):new y(u)}(e,t,n);if(r?o.add(r.call(o,this.source)):o.add(this.source||i.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),i.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){i.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),function(e){for(;e;){var t=e,n=t.closed,r=t.destination,o=t.isStopped;if(n||o)return!1;e=r&&r instanceof y?r:null}return!0}(e)?e.error(t):console.warn(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=w(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[m]=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?b: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=w(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}();function w(e){if(e||(e=i.Promise||Promise),!e)throw new Error("no Promise impl found");return e}const O="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;var S="object"==typeof self&&self&&self.Object===Object&&self;const x=(O||S||Function("return this")()).Symbol;var E=Object.prototype,_=E.hasOwnProperty,j=E.toString,k=x?x.toStringTag:void 0,P=Object.prototype.toString,$=x?x.toStringTag:void 0;const C=(A=Object.getPrototypeOf,T=Object,function(e){return A(T(e))});var A,T,D=Function.prototype,I=Object.prototype,R=D.toString,N=I.hasOwnProperty,M=R.call(Object);const L=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]":$&&$ in Object(e)?function(e){var t=_.call(e,k),n=e[k];try{e[k]=void 0;var r=!0}catch(e){}var o=j.call(e);return r&&(t?e[k]=n:delete e[k]),o}(e):function(e){return P.call(e)}(e)}(e))return!1;var t=C(e);if(null===t)return!0;var n=N.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&R.call(n)==M};var B=s(824);function U(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function z(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const F="/ws/rest/v1/",K="/ws/fhir2/R4",V=`${F}session`;function q(e){return e&&e.startsWith("http")?e:("/"!==e[0]&&(e="/"+e),window.openmrsBase+e)}function H(e,t={}){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.");let n=q(e);if(t.headers||(t.headers={}),L(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(F)&&void 0===t.headers["Disable-WWW-Authenticate"]&&(t.headers["Disable-WWW-Authenticate"]="true"),e.startsWith(K)){const e=new URL(n,window.location.toString());e.searchParams.has("_summary")||(e.searchParams.set("_summary","data"),n=e.toString())}const r=Error();return window.fetch(n,t).then((o=function*(e){const t=e;if(t.ok)return 204===t.status?(t.data=null,t):t.clone().text().then((e=>{try{e&&(t.data=JSON.parse(e))}catch(e){}return t}));{const{redirectAuthFailure:e}=yield(0,B.getConfig)("@openmrs/esm-api");return n===q(V)&&403===t.status||e.enabled&&e.errors.includes(t.status)?((0,B.navigate)({to:e.url}),e.resolvePromise?Promise.resolve():new Promise((()=>{}))):t.clone().text().then((e=>{let o=e;try{o=JSON.parse(e)}catch(e){}throw new G(n,t,o,r)}),(e=>{throw new G(n,t,null,r)}))}},i=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=o.apply(e,t);function s(e){U(i,n,r,s,a,"next",e)}function a(e){U(i,n,r,s,a,"throw",e)}s(void 0)}))},function(e){return i.apply(this,arguments)}));var o,i}function W(e,t={}){if("object"!=typeof t)throw Error("The second argument to openmrsObservableFetch must be either omitted or an object");const n=new AbortController;return t.signal=n.signal,new v((r=>{let o=!1;return H(e,t).then((e=>{o=!0,r.next(e),r.complete()}),(e=>{o=!0,r.error(e)})),()=>{o||n.abort()}}))}let G=class extends Error{constructor(e,t,n,r){super(),z(this,"response",void 0),z(this,"responseBody",void 0),this.message=`Server responded with ${t.status} (${t.statusText}) for url ${e}. Check err.responseBody or network tab in dev tools for more info`,r.message=this.message,this.responseBody=n,this.response=t,this.stack=`Stacktrace for outgoing request:\n${r.stack}\nStacktrace for incoming response:\n${this.stack}`}};var Z=s(254),Y=s(403);const X=function(e){return void 0===e};function Q(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}const J=(0,Y.createGlobalStore)("session",{loaded:!1,session:null});let ee=0;function te(e={includeAuthStatus:!0}){return(ee<Date.now()-6e4||!J.getState().loaded)&&re(),new v((t=>{const n=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(J.getState()),J.subscribe(n)}))}function ne(){return(ee<Date.now()-6e4||!J.getState().loaded)&&re(),J}function re(){return new Promise(((e,t)=>{ee=Date.now(),H(V).then((n=>{if("object"!=typeof(null==n?void 0:n.data))return t(),Promise.reject();!function(e){var t,n,r;const o=null!==(r=null==e||null===(t=e.user)||void 0===t||null===(n=t.userProperties)||void 0===n?void 0:n.defaultLocale)&&void 0!==r?r:e.locale;o!==document.documentElement.getAttribute("lang")&&document.documentElement.setAttribute("lang",o)}(n.data),e(n.data),J.setState({loaded:!0,session:n.data})})).catch((e=>((0,Z.reportError)(`Failed to fetch new session information: ${e}`),t(e),{sessionId:"",authenticated:!1})))}))}function oe(){J.setState({loaded:!0,session:{authenticated:!1,sessionId:""}})}function ie(e,t){return void 0===t?Boolean(e):!Boolean(e)||function(e,t){return"string"==typeof e?!X(t.privileges.find((t=>e===t.display))):Array.isArray(e)?e.every((e=>!X(t.privileges.find((t=>e===t.display))))):(X(e)||console.error(`Could not understand privileges "${e}"`),!0)}(e,t)||function(e){return!X(e.roles.find((e=>"System Developer"===e.display)))}(t)}function se(){let e,t;return new Promise(((n,r)=>{const o=r=>{r.loaded&&r.session.user&&(e=r.session.user,n(r.session.user),t&&t())};o(J.getState()),e||(t=J.subscribe(o))}))}function ae(){return new Promise(((e,t)=>{te().subscribe((t=>{e(t.sessionLocation)}),t).unsubscribe()}))}function ce(e,t){return ue.apply(this,arguments)}function ue(){var e;return e=function*(e,t){yield H(V,{method:"POST",body:{sessionLocation:e},headers:{"Content-Type":"application/json"},signal:t.signal}),yield re()},ue=function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){Q(i,r,o,s,a,"next",e)}function a(e){Q(i,r,o,s,a,"throw",e)}s(void 0)}))},ue.apply(this,arguments)}function le(){(0,B.defineConfigSchema)("@openmrs/esm-api",{redirectAuthFailure:{enabled:{_type:B.Type.Boolean,_default:!0,_description:"Whether to redirect logged-out users to `redirectAuthFailure.url`"},url:{_type:B.Type.String,_default:"${openmrsSpaBase}/login",_validators:[B.validators.isUrl]},errors:{_type:B.Type.Array,_default:[401],_elements:{_type:B.Type.Number,_validators:[B.validators.inRange(100,600)]},_description:"The HTTP error codes for which users will be redirected"},resolvePromise:{_type:B.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."}}}),re()}var fe=s(738);function pe(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function de(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){pe(i,r,o,s,a,"next",e)}function a(e){pe(i,r,o,s,a,"throw",e)}s(void 0)}))}}function he(e,t){return ye.apply(this,arguments)}function ye(){return(ye=de((function*(e,t,n=!0){if(e){let r=null;const[o,i]=yield Promise.all([H(`${K}/Patient/${e}`,t).catch((e=>r=e)),n?ge(e):Promise.resolve(null)]);if(o.ok)return o.data;if(i)return i;if(r)throw r}return null}))).apply(this,arguments)}function ge(e){return me.apply(this,arguments)}function me(){return(me=de((function*(e){const t=(yield(0,fe.getSynchronizationItems)("patient-registration")).find((t=>t.fhirPatient.id===e));var n;return null!==(n=null==t?void 0:t.fhirPatient)&&void 0!==n?n:null}))).apply(this,arguments)}var be=function(){function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e}(),ve=function(e){function n(t,n){var r=e.call(this)||this;return r.subject=t,r.subscriber=n,r.closed=!1,r}return t(n,e),n.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var 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}(p),we=function(e){function n(t){var n=e.call(this,t)||this;return n.destination=t,n}return t(n,e),n}(y),Oe=function(e){function n(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return t(n,e),n.prototype[h]=function(){return new we(this)},n.prototype.lift=function(e){var t=new Se(this,this);return t.operator=e,t},n.prototype.next=function(e){if(this.closed)throw new be;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 be;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 be;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(t){if(this.closed)throw new be;return e.prototype._trySubscribe.call(this,t)},n.prototype._subscribe=function(e){if(this.closed)throw new be;return this.hasError?(e.error(this.thrownError),p.EMPTY):this.isStopped?(e.complete(),p.EMPTY):(this.observers.push(e),new ve(this,e))},n.prototype.asObservable=function(){var e=new v;return e.source=this,e},n.create=function(e,t){return new Se(e,t)},n}(v),Se=function(e){function n(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return t(n,e),n.prototype.next=function(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):p.EMPTY},n}(Oe),xe=function(e){function n(t){var n=e.call(this)||this;return n._value=t,n}return t(n,e),Object.defineProperty(n.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),n.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return n&&!n.closed&&t.next(this._value),n},n.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new be;return this._value},n.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},n}(Oe),Ee=function(){function e(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return e.prototype=Object.create(Error.prototype),e}(),_e=new v((function(e){return e.complete()}));function je(e){return function(t){return 0===e?_e:t.lift(new ke(e))}}var ke=function(){function e(e){if(this.total=e,this.total<0)throw new Ee}return e.prototype.call=function(e,t){return t.subscribe(new Pe(e,this.total))},e}(),Pe=function(e){function n(t,n){var r=e.call(this,t)||this;return r.total=n,r.count=0,r}return t(n,e),n.prototype._next=function(e){var t=this.total,n=++this.count;n<=t&&(this.destination.next(e),n===t&&(this.destination.complete(),this.unsubscribe()))},n}(y);function $e(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 Ce(e,t))}}var Ce=function(){function e(e,t){this.project=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new Ae(e,this.project,this.thisArg))},e}(),Ae=function(e){function n(t,n,r){var o=e.call(this,t)||this;return o.project=n,o.count=0,o.thisArg=r||o,o}return t(n,e),n.prototype._next=function(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}(y);const Te="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)";function De(e,t,n){return W(`/ws/rest/v1/visit?patient=${e}&v=${null!=n?n:Te}`,{signal:t.signal,method:"GET",headers:{"Content-type":"application/json"}}).pipe(je(1)).pipe($e((e=>e)))}function Ie(e,t){return W("/ws/rest/v1/visit",{signal:t.signal,method:"POST",headers:{"Content-type":"application/json"},body:e})}function Re(e,t,n){return W(`/ws/rest/v1/visit/${e}`,{signal:n.signal,method:"POST",headers:{"Content-type":"application/json"},body:t})}const Ne=new xe(null);var Me,Le;function Be(e){return{uuid:e.uuid,display:e.display,name:e.name}}function Ue(){return W("/ws/rest/v1/visittype").pipe($e((e=>e.data.results.map(Be)))).pipe(je(1))}function ze(e){return{uuid:e.uuid,display:e.display}}function Fe(){return W("/ws/rest/v1/location").pipe($e((e=>e.data.results.map(ze)))).pipe(je(1))}!function(e){e.NEWVISIT="startVisit",e.EDITVISIT="editVisit",e.LOADING="loadingVisit"}(Me||(Me={})),function(e){e.NOTSTARTED="notStarted",e.ONGOING="ongoing"}(Le||(Le={}));const Ke={"webservices.rest":"2.24.0",fhir2:"1.0.0-SNAPSHOT"}})(),a})())}}}))},2601:(e,t,n)=>{"use strict";n.d(t,{nF:()=>S,u4:()=>oe,Rx:()=>ie,Wf:()=>le,Ze:()=>T,I$:()=>J,Vy:()=>z,DN:()=>m,ts:()=>$,JC:()=>ue,r:()=>I,WK:()=>R,KJ:()=>C,$X:()=>re,P9:()=>ae,nx:()=>ee,bf:()=>v,vb:()=>w,uj:()=>O,VJ:()=>A,YC:()=>g,bX:()=>te,z$:()=>b,jK:()=>N,Lq:()=>ce,VF:()=>se,ym:()=>ne,y9:()=>D});var r=n(4666),o=n(963);const i=(0,n(6899).Z)(Object.getPrototypeOf,Object);var s=n(4897),a=Function.prototype,c=Object.prototype,u=a.toString,l=c.hasOwnProperty,f=u.call(Object);const p=function(e){if(!(0,s.Z)(e)||"[object Object]"!=(0,o.Z)(e))return!1;var t=i(e);if(null===t)return!0;var n=l.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&u.call(n)==f};var d=n(3741);function h(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const g="/ws/rest/v1/",m="/ws/fhir2/R4",b=`${g}session`;function v(e){return e&&e.startsWith("http")?e:("/"!==e[0]&&(e="/"+e),window.openmrsBase+e)}function w(e,t={}){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.");let n=v(e);if(t.headers||(t.headers={}),p(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(g)&&void 0===t.headers["Disable-WWW-Authenticate"]&&(t.headers["Disable-WWW-Authenticate"]="true"),e.startsWith(m)){const e=new URL(n,window.location.toString());e.searchParams.has("_summary")||(e.searchParams.set("_summary","data"),n=e.toString())}const r=Error();return window.fetch(n,t).then((o=function*(e){const t=e;if(t.ok)return 204===t.status?(t.data=null,t):t.clone().text().then((e=>{try{e&&(t.data=JSON.parse(e))}catch(e){}return t}));{const{redirectAuthFailure:e}=yield(0,d.getConfig)("@openmrs/esm-api");return n===v(b)&&403===t.status||e.enabled&&e.errors.includes(t.status)?((0,d.navigate)({to:e.url}),e.resolvePromise?Promise.resolve():new Promise((()=>{}))):t.clone().text().then((e=>{let o=e;try{o=JSON.parse(e)}catch(e){}throw new S(n,t,o,r)}),(e=>{throw new S(n,t,null,r)}))}},i=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=o.apply(e,t);function s(e){h(i,n,r,s,a,"next",e)}function a(e){h(i,n,r,s,a,"throw",e)}s(void 0)}))},function(e){return i.apply(this,arguments)}));var o,i}function O(e,t={}){if("object"!=typeof t)throw Error("The second argument to openmrsObservableFetch must be either omitted or an object");const n=new AbortController;return t.signal=n.signal,new r.Observable((r=>{let o=!1;return w(e,t).then((e=>{o=!0,r.next(e),r.complete()}),(e=>{o=!0,r.error(e)})),()=>{o||n.abort()}}))}class S extends Error{constructor(e,t,n,r){super(),y(this,"response",void 0),y(this,"responseBody",void 0),this.message=`Server responded with ${t.status} (${t.statusText}) for url ${e}. Check err.responseBody or network tab in dev tools for more info`,r.message=this.message,this.responseBody=n,this.response=t,this.stack=`Stacktrace for outgoing request:\n${r.stack}\nStacktrace for incoming response:\n${this.stack}`}}var x=n(151),E=n(403),_=n(9789);function j(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}const k=(0,E.createGlobalStore)("session",{loaded:!1,session:null});let P=0;function $(e={includeAuthStatus:!0}){return(P<Date.now()-6e4||!k.getState().loaded)&&A(),new r.Observable((t=>{const n=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(k.getState()),k.subscribe(n)}))}function C(){return(P<Date.now()-6e4||!k.getState().loaded)&&A(),k}function A(){return new Promise(((e,t)=>{P=Date.now(),w(b).then((n=>{if("object"!=typeof(null==n?void 0:n.data))return t(),Promise.reject();!function(e){var t,n,r;const o=null!==(r=null==e||null===(t=e.user)||void 0===t||null===(n=t.userProperties)||void 0===n?void 0:n.defaultLocale)&&void 0!==r?r:e.locale;o!==document.documentElement.getAttribute("lang")&&document.documentElement.setAttribute("lang",o)}(n.data),e(n.data),k.setState({loaded:!0,session:n.data})})).catch((e=>((0,x.reportError)(`Failed to fetch new session information: ${e}`),t(e),{sessionId:"",authenticated:!1})))}))}function T(){k.setState({loaded:!0,session:{authenticated:!1,sessionId:""}})}function D(e,t){return void 0===t?Boolean(e):!Boolean(e)||function(e,t){return"string"==typeof e?!(0,_.Z)(t.privileges.find((t=>e===t.display))):Array.isArray(e)?e.every((e=>!(0,_.Z)(t.privileges.find((t=>e===t.display))))):((0,_.Z)(e)||console.error(`Could not understand privileges "${e}"`),!0)}(e,t)||function(e){return!(0,_.Z)(e.roles.find((e=>"System Developer"===e.display)))}(t)}function I(){let e,t;return new Promise(((n,r)=>{const o=r=>{r.loaded&&r.session.user&&(e=r.session.user,n(r.session.user),t&&t())};o(k.getState()),e||(t=k.subscribe(o))}))}function R(){return new Promise(((e,t)=>{$().subscribe((t=>{e(t.sessionLocation)}),t).unsubscribe()}))}function N(e,t){return M.apply(this,arguments)}function M(){var e;return e=function*(e,t){yield w(b,{method:"POST",body:{sessionLocation:e},headers:{"Content-Type":"application/json"},signal:t.signal}),yield A()},M=function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){j(i,r,o,s,a,"next",e)}function a(e){j(i,r,o,s,a,"throw",e)}s(void 0)}))},M.apply(this,arguments)}var L=n(8809);function B(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.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 s(e){B(i,r,o,s,a,"next",e)}function a(e){B(i,r,o,s,a,"throw",e)}s(void 0)}))}}function z(e,t){return F.apply(this,arguments)}function F(){return(F=U((function*(e,t,n=!0){if(e){let r=null;const[o,i]=yield Promise.all([w(`${m}/Patient/${e}`,t).catch((e=>r=e)),n?K(e):Promise.resolve(null)]);if(o.ok)return o.data;if(i)return i;if(r)throw r}return null}))).apply(this,arguments)}function K(e){return V.apply(this,arguments)}function V(){return(V=U((function*(e){const t=(yield(0,L.getSynchronizationItems)("patient-registration")).find((t=>t.fhirPatient.id===e));var n;return null!==(n=null==t?void 0:t.fhirPatient)&&void 0!==n?n:null}))).apply(this,arguments)}var q=n(7080),H=n(7811),W=n(1760),G=n(70);function Z(e){return function(t){return 0===e?(0,G.c)():t.lift(new Y(e))}}var Y=function(){function e(e){if(this.total=e,this.total<0)throw new W.W}return e.prototype.call=function(e,t){return t.subscribe(new X(e,this.total))},e}(),X=function(e){function t(t,n){var r=e.call(this,t)||this;return r.total=n,r.count=0,r}return q.ZT(t,e),t.prototype._next=function(e){var t=this.total,n=++this.count;n<=t&&(this.destination.next(e),n===t&&(this.destination.complete(),this.unsubscribe()))},t}(H.L),Q=n(5725);const J="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)";function ee(e,t,n){return O(`/ws/rest/v1/visit?patient=${e}&v=${null!=n?n:J}`,{signal:t.signal,method:"GET",headers:{"Content-type":"application/json"}}).pipe(Z(1)).pipe((0,Q.U)((e=>e)))}function te(e,t){return O("/ws/rest/v1/visit",{signal:t.signal,method:"POST",headers:{"Content-type":"application/json"},body:e})}function ne(e,t,n){return O(`/ws/rest/v1/visit/${e}`,{signal:n.signal,method:"POST",headers:{"Content-type":"application/json"},body:t})}const re=new r.BehaviorSubject(null);var oe,ie;function se(e){return{uuid:e.uuid,display:e.display,name:e.name}}function ae(){return O("/ws/rest/v1/visittype").pipe((0,Q.U)((e=>e.data.results.map(se)))).pipe(Z(1))}function ce(e){return{uuid:e.uuid,display:e.display}}function ue(){return O("/ws/rest/v1/location").pipe((0,Q.U)((e=>e.data.results.map(ce)))).pipe(Z(1))}!function(e){e.NEWVISIT="startVisit",e.EDITVISIT="editVisit",e.LOADING="loadingVisit"}(oe||(oe={})),function(e){e.NOTSTARTED="notStarted",e.ONGOING="ongoing"}(ie||(ie={}));const le={"webservices.rest":"2.24.0",fhir2:"1.0.0-SNAPSHOT"}},789:()=>{System.register(["@openmrs/esm-state"],(function(e,t){var n={};return{setters:[function(e){n.createGlobalStore=e.createGlobalStore}],execute:function(){e((()=>{"use strict";var e={685: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=(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=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{function e(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function t(e){return e&&e.sensitive?"":"i"}function n(n,r,o){return function(n,r,o){void 0===o&&(o={});for(var i=o.strict,s=void 0!==i&&i,a=o.start,c=void 0===a||a,u=o.end,l=void 0===u||u,f=o.encode,p=void 0===f?function(e){return e}:f,d="["+e(o.endsWith||"")+"]|$",h="["+e(o.delimiter||"/#?")+"]",y=c?"^":"",g=0,m=n;g<m.length;g++){var b=m[g];if("string"==typeof b)y+=e(p(b));else{var v=e(p(b.prefix)),w=e(p(b.suffix));if(b.pattern)if(r&&r.push(b),v||w)if("+"===b.modifier||"*"===b.modifier){var O="*"===b.modifier?"?":"";y+="(?:"+v+"((?:"+b.pattern+")(?:"+w+v+"(?:"+b.pattern+"))*)"+w+")"+O}else y+="(?:"+v+"("+b.pattern+")"+w+")"+b.modifier;else y+="("+b.pattern+")"+b.modifier;else y+="(?:"+v+w+")"+b.modifier}}if(l)s||(y+=h+"?"),y+=o.endsWith?"(?="+d+")":"$";else{var S=n[n.length-1],x="string"==typeof S?h.indexOf(S[S.length-1])>-1:void 0===S;s||(y+="(?:"+h+"(?="+d+"))?"),x||(y+="(?="+h+"|"+d+")")}return new RegExp(y,t(o))}(function(t,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[a=n+1])throw new TypeError('Pattern cannot start with "?" at '+a);for(;a<e.length;)if("\\"!==e[a]){if(")"===e[a]){if(0==--o){a++;break}}else if("("===e[a]&&(o++,"?"!==e[a+1]))throw new TypeError("Capturing groups are not allowed at "+a);i+=e[a++]}else i+=e[a++]+e[a++];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=a}else{for(var s="",a=n+1;a<e.length;){var c=e.charCodeAt(a);if(!(c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||95===c))break;s+=e[a++]}if(!s)throw new TypeError("Missing parameter name at "+n);t.push({type:"NAME",index:n,value:s}),n=a}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}(t),o=n.prefixes,i=void 0===o?"./":o,s="[^"+e(n.delimiter||"/#?")+"]+?",a=[],c=0,u=0,l="",f=function(e){if(u<r.length&&r[u].type===e)return r[u++].value},p=function(e){var t=f(e);if(void 0!==t)return t;var n=r[u],o=n.type,i=n.index;throw new TypeError("Unexpected "+o+" at "+i+", expected "+e)},d=function(){for(var e,t="";e=f("CHAR")||f("ESCAPED_CHAR");)t+=e;return t};u<r.length;){var h=f("CHAR"),y=f("NAME"),g=f("PATTERN");if(y||g){var m=h||"";-1===i.indexOf(m)&&(l+=m,m=""),l&&(a.push(l),l=""),a.push({name:y||c++,prefix:m,suffix:"",pattern:g||s,modifier:f("MODIFIER")||""})}else{var b=h||f("ESCAPED_CHAR");if(b)l+=b;else if(l&&(a.push(l),l=""),f("OPEN")){m=d();var v=f("NAME")||"",w=f("PATTERN")||"",O=d();p("CLOSE"),a.push({name:v||(w?c++:""),pattern:v&&!w?s:w,prefix:m,suffix:O,modifier:f("MODIFIER")||""})}else p("END")}}return a}(n,o),r,o)}function i(e,r,o){return e instanceof 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}(e,r):Array.isArray(e)?function(e,n,r){var o=e.map((function(e){return i(e,n,r).source}));return new RegExp("(?:"+o.join("|")+")",t(r))}(e,r,o):n(e,r,o)}r.r(o),r.d(o,{filterBreadcrumbs:()=>p,getBreadcrumbs:()=>l,getBreadcrumbsFor:()=>d,registerBreadcrumb:()=>c,registerBreadcrumbs:()=>u});const s=(0,r(685).createGlobalStore)("breadcrumbs",[]);function a(e){return e.matcher instanceof RegExp?e.matcher:"string"==typeof e.matcher?i(e.matcher):i(e.path)}function c(e){return u([e])}function u(e){const t=[...l(),...e.map((e=>({matcher:a(e),settings:e})))];s.setState(t,!0)}function l(){return s.getState()}function f(e,t){if(t)return function(e,t){const[n]=e.filter((e=>e.matcher.test(t)));return n}(e,t)||function(e,t){const n=t.split("/");for(;n.length>1;){n.pop();const t=f(e,n.join("/"));if(t)return t}}(e,t)}function p(e,t){if(e.length>0){const n=f(e,t);if(n){const t=[n];let r=f(e,n.settings.parent);for(;void 0!==r;)t.push(r),r=f(e,r.settings.parent);return t.reverse()}}return[]}function d(e){return p(l(),e)}})(),o})())}}}))},3741:()=>{System.register(["@openmrs/esm-state","single-spa"],(function(e,t){var n={},r={};return{setters:[function(e){n.createGlobalStore=e.createGlobalStore,n.getGlobalStore=e.getGlobalStore},function(e){r.navigateToUrl=e.navigateToUrl}],execute:function(){e((()=>{"use strict";var e={685:e=>{e.exports=n},645:e=>{e.exports=r}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,o),i.exports}o.d=(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=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{function e(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function t(t){return function n(r){return 0===arguments.length||e(r)?n:t.apply(this,arguments)}}function n(n){return function r(o,i){switch(arguments.length){case 0:return r;case 1:return e(o)?r:t((function(e){return n(o,e)}));default:return e(o)&&e(i)?r:e(o)?t((function(e){return n(e,i)})):e(i)?t((function(e){return n(o,e)})):n(o,i)}}}function r(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function s(e,t,n){for(var r=0,o=n.length;r<o;){if(e(t,n[r]))return!0;r+=1}return!1}function a(e,t){return Object.prototype.hasOwnProperty.call(t,e)}o.r(i),o.d(i,{Type:()=>L,configExtensionStore:()=>Z,configInternalStore:()=>W,defineConfigSchema:()=>fe,defineExtensionConfigSchema:()=>pe,getConfig:()=>he,getConfigInternal:()=>ye,getConfigStore:()=>Y,getExtensionConfig:()=>te,getExtensionConfigFromStore:()=>ne,getExtensionSlotConfig:()=>Q,getExtensionSlotConfigFromStore:()=>J,getExtensionSlotsConfigStore:()=>X,getExtensionsConfigStore:()=>ee,implementerToolsConfigStore:()=>re,inRange:()=>Ue,interpolateString:()=>Le,interpolateUrl:()=>Me,isUrl:()=>Fe,isUrlWithTemplateParameters:()=>ze,navigate:()=>Be,oneOf:()=>Ke,processConfig:()=>ge,provide:()=>de,temporaryConfigStore:()=>G,validator:()=>B,validators:()=>Ve});const c="function"==typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};var u=Object.prototype.toString,l=function(){return"[object Arguments]"===u.call(arguments)?function(e){return"[object Arguments]"===u.call(e)}:function(e){return a("callee",e)}}();const f=l;var p=!{toString:null}.propertyIsEnumerable("toString"),d=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],h=function(){return arguments.propertyIsEnumerable("length")}(),y=function(e,t){for(var n=0;n<e.length;){if(e[n]===t)return!0;n+=1}return!1};const g="function"!=typeof Object.keys||h?t((function(e){if(Object(e)!==e)return[];var t,n,r=[],o=h&&f(e);for(t in e)!a(t,e)||o&&"length"===t||(r[r.length]=t);if(p)for(n=d.length-1;n>=0;)a(t=d[n],e)&&!y(r,t)&&(r[r.length]=t),n-=1;return r})):t((function(e){return Object(e)!==e?[]:Object.keys(e)})),m=t((function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}));function b(e,t,n,o){var i=r(e);function a(e,t){return v(e,t,n.slice(),o.slice())}return!s((function(e,t){return!s(a,t,e)}),r(t),i)}function v(e,t,n,r){if(c(e,t))return!0;var o,i,s=m(e);if(s!==m(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(s){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===(o=e.constructor,null==(i=String(o).match(/^function (\w*)/))?"":i[1]))return e===t;break;case"Boolean":case"Number":case"String":if(typeof e!=typeof t||!c(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!c(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 u=n.length-1;u>=0;){if(n[u]===e)return r[u]===t;u-=1}switch(s){case"Map":return e.size===t.size&&b(e.entries(),t.entries(),n.concat([e]),r.concat([t]));case"Set":return e.size===t.size&&b(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 l=g(e);if(l.length!==g(t).length)return!1;var f=n.concat([e]),p=r.concat([t]);for(u=l.length-1;u>=0;){var d=l[u];if(!a(d,t)||!v(t[d],e[d],f,p))return!1;u-=1}return!0}const w=n((function(e,t){return v(e,t,[],[])}));function O(r){return function o(i,s,a){switch(arguments.length){case 0:return o;case 1:return e(i)?o:n((function(e,t){return r(i,e,t)}));case 2:return e(i)&&e(s)?o:e(i)?n((function(e,t){return r(e,s,t)})):e(s)?n((function(e,t){return r(i,e,t)})):t((function(e){return r(i,s,e)}));default:return e(i)&&e(s)&&e(a)?o:e(i)&&e(s)?n((function(e,t){return r(e,t,a)})):e(i)&&e(a)?n((function(e,t){return r(e,s,t)})):e(s)&&e(a)?n((function(e,t){return r(i,e,t)})):e(i)?t((function(e){return r(e,s,a)})):e(s)?t((function(e){return r(i,e,a)})):e(a)?t((function(e){return r(i,s,e)})):r(i,s,a)}}}function S(e){return"[object Object]"===Object.prototype.toString.call(e)}const x=O((function(e,t,n){var r,o={};for(r in t)a(r,t)&&(o[r]=a(r,n)?e(r,t[r],n[r]):t[r]);for(r in n)a(r,n)&&!a(r,o)&&(o[r]=n[r]);return o})),E=O((function e(t,n,r){return x((function(n,r,o){return S(r)&&S(o)?e(t,r,o):t(n,r,o)}),n,r)})),_=n((function(e,t){return E((function(e,t,n){return n}),e,t)})),j=n((function(e,t){for(var n={},r={},o=0,i=e.length;o<i;)r[e[o]]=1,o+=1;for(var s in t)r.hasOwnProperty(s)||(n[s]=t[s]);return n}));function k(e,t,n,r){var o,i=function(o){for(var i=t.length,s=0;s<i;){if(e===t[s])return n[s];s+=1}for(var a in t[s+1]=e,n[s+1]=o,e)o[a]=r?k(e[a],t,n,!0):e[a];return o};switch(m(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}}const P=t((function(e){return null!=e&&"function"==typeof e.clone?e.clone():k(e,[],[],!0)})),$=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)},C=t((function(e){return!!$(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))}));var A=function(){function e(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}(),T=n((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,s){return t.apply(this,arguments)};case 7:return function(e,n,r,o,i,s,a){return t.apply(this,arguments)};case 8:return function(e,n,r,o,i,s,a,c){return t.apply(this,arguments)};case 9:return function(e,n,r,o,i,s,a,c,u){return t.apply(this,arguments)};case 10:return function(e,n,r,o,i,s,a,c,u,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)}))}));const D=T;function I(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)}function R(e,t,n,r){return e["@@transducer/result"](n[r](D(e["@@transducer/step"],e),t))}var N="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";const M=O((function(e,t,n){if("function"==typeof e&&(e=function(e){return new A(e)}(e)),C(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 R(e,t,n,"fantasy-land/reduce");if(null!=n[N])return I(e,t,n[N]());if("function"==typeof n.next)return I(e,t,n);if("function"==typeof n.reduce)return R(e,t,n,"reduce");throw new TypeError("reduce: list must be array or iterable")}));var L;function B(e,t){return n=>{if(!e(n))return"function"==typeof t?t(n):t}}!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"}(L||(L={}));const U=B((e=>Array.isArray(e)),"must be an array"),z=B((e=>"boolean"==typeof e),"must be a boolean"),F=B((e=>"number"==typeof e),"must be a number"),K=B((e=>"string"==typeof e),"must be a string"),V=B((e=>"object"==typeof e&&!Array.isArray(e)&&null!==e),"must be an object (not an array or null)"),q=B((e=>/^[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");var H=o(685);const W=(0,H.createGlobalStore)("config-internal",{providedConfigs:[],schemas:{}}),G=(0,H.createGlobalStore)("temporary-config",{config:function(){try{return JSON.parse(localStorage.getItem("openmrs:temporaryConfig")||"{}")}catch(e){return{}}}()});G.subscribe((e=>{var t;t=e.config,localStorage.setItem("openmrs:temporaryConfig",JSON.stringify(t))}));const Z=(0,H.createGlobalStore)("config-store-of-extension-state",{mountedExtensions:[]});function Y(e){return(0,H.getGlobalStore)(`config-module-${e}`,{config:null,loaded:!1})}function X(){return(0,H.getGlobalStore)("config-extension-slots",{slots:{}})}function Q(e){return J(X().getState(),e)}function J(e,t){const n=e.slots[t];return null!=n?n:{loaded:!1,config:{}}}function ee(){return(0,H.getGlobalStore)("config-extensions",{configs:{}})}function te(e,t){const n=Object.assign({},ne(ee().getState(),e,t));return n.config=j(["Display conditions","Translation overrides"],n.config),n}function ne(e,t,n){var r;const o=null===(r=e.configs[t])||void 0===r?void 0:r[n];return null!=o?o:{loaded:!1,config:null}}const re=(0,H.createGlobalStore)("config-implementer-tools",{config:{}});function oe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ie(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){oe(e,t,n[t])}))}return e}function se(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 ae(e,t){for(let n of Object.keys(e.schemas)){const r=xe(n,e,t);Y(n).setState({loaded:!0,config:r})}}function ce(e,t){const n=function(e,t){const n=_e(Oe(e,t)),r=Object.keys(n).reduce(((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}),{});return function(e){for(let[t,n]of Object.entries(e))for(let[e,r]of Object.entries(n))we(r,t,e)}(r),Object.keys(r).reduce(((e,t)=>ie({},e,r[t])),{})}(e,t),r=Object.fromEntries(Object.entries(n).map((([e,t])=>[e,{loaded:!0,config:t}]))),o=X(),i=o.getState(),s={slots:ie({},i.slots,r)};w(i,s)||o.setState(s)}function ue(e,t){const n=function(e,t){let n=be(P(e.schemas));const r=[...e.providedConfigs.map((e=>[e.config,e.source])),[t.config,"temporary config"]];for(let[e,t]of r)n=_e([n,ve(e,t)]);return n}(e,t);re.setState({config:n})}function le(e,t,n){const r={};for(let o of t.mountedExtensions){const t=me(o.slotModuleName,o.extensionModuleName,o.slotName,o.extensionId,e,n);r[o.slotName]=se(ie({},r[o.slotName]),{[o.extensionId]:{config:t,loaded:!0}})}ee().setState({configs:r})}function fe(e,t){Se(e,t);const n=_(t,Ie),r=W.getState();W.setState({schemas:se(ie({},r.schemas),{[e]:n})})}function pe(e,t){Se(e,t);const n=_(t,Ie),r=W.getState();r.schemas[e]&&console.warn(`Config schema for extension ${e} already exists. If there are multiple extensions with this same name, one will probably crash.`),W.setState({schemas:se(ie({},r.schemas),{[e]:n})})}function de(e,t="provided"){const n=W.getState();W.setState({providedConfigs:[...n.providedConfigs,{source:t,config:e}]})}function he(e){return new Promise((t=>{const n=Y(e);function r(e){if(e.loaded&&e.config){const n=j(["Display conditions","Translation overrides"],e.config);t(n),o&&o()}}r(n.getState());const o=n.subscribe(r)}))}function ye(e){return new Promise((t=>{const n=Y(e);function r(e){if(e.loaded&&e.config){const n=e.config;t(n),o&&o()}}r(n.getState());const o=n.subscribe(r)}))}function ge(e,t,n){je(e,t,n);const r=Ae(e,t);return Pe(e,r,n),r}function me(e,t,n,r,o,i){var s,a,c;const u=function(e){const[t]=e.split("#");return t}(r),l=o.schemas[u],f=l?u:t,p=Oe(o,i),d=Ee(e,p);var h;const y=null!==(h=null==d||null===(s=d.extensionSlots)||void 0===s||null===(a=s[n])||void 0===a||null===(c=a.configure)||void 0===c?void 0:c[r])&&void 0!==h?h:{},g=_e([Ee(f,p),y]),m=null!=l?l:o.schemas[t];je(m,g,f);const b=Ae(m,g);return Pe(m,b,f),delete b.extensionSlots,b}function be(e){return e.hasOwnProperty("_default")?se(ie({},e),{_value:e._default,_source:"default"}):De(e)?Object.keys(e).reduce(((t,n)=>(t[n]=be(e[n]),t)),{}):{}}function ve(e,t){return De(e)?Object.keys(e).reduce(((n,r)=>(n[r]=ve(e[r],t),n)),{}):{_value:e,_source:t}}function we(e,t,n){const r=`Extension slot config '${t}.extensionSlots.${n}`,o=Object.keys(e).filter((e=>!["add","remove","order","configure"].includes(e)));o.length&&console.error(r+`' contains invalid keys '${o.join("', '")}'`),e.add&&(Array.isArray(e.add)&&e.add.every((e=>"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((e=>"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((e=>"string"==typeof e))||console.error(r+".order' is invalid. Must be an array of strings (extension IDs)")),e.configure&&(De(e.configure)||console.error(r+".configure' is invalid. Must be an object with extension IDs for keys"))}function Oe(e,t){return[...e.providedConfigs.map((e=>e.config)),t.config]}function Se(e,t,n=""){const r="Please verify that you are running the latest version and, if so, alert the maintainer.";for(const o of Object.keys(t).filter((e=>!e.startsWith("_")))){const i=n+(n&&".")+o,s=t[o];if("Display conditions"===i&&console.error(`${e} declares a configuration option called "Display conditions"; the "Display conditions" option is a reserved name. ${r}`),"Translation overrides"===i&&console.error(`${e} declares a configuration option called "Translation overrides"; the "Translation overrides" option is a reserved name. ${r}`),!De(s)){console.error(`${e} has bad config schema definition for key '${i}'. ${r}`);continue}s.hasOwnProperty("_default")||Se(e,s,i);const a=s._elements;if(Te(a)&&Se(e,a,i+"._elements"),s._validators)for(let t of s._validators)"function"!=typeof t&&console.error(`${e} has invalid validator for key '${i}' ${r}.\n\nIf you're the maintainer: validators must be functions that return either undefined or an error string. Received ${t}.`);const c=s._type;c&&!Object.values(L).includes(c)&&console.error(`${e} has invalid type for key '${i}' ${r}.\n\nIf you're the maintainer: the allowed types are ${Object.values(L).join(", ")}. Received '${c}'`),Object.keys(s).every((e=>["_description","_validators","_elements","_type"].includes(e)))&&!n.includes("._elements")&&console.error(`${e} has bad config schema definition for key '${i}'. ${r}.\n\nIf you're the maintainer: all config elements must have a default. Received ${JSON.stringify(s)}`),a&&c&&![L.Array,L.Object].includes(c)&&console.error(`${e} has bad config schema definition for key '${i}'. ${r}.\n\nIf you're the maintainer: the 'elements' key only works with '_type' equal to 'Array' or 'Object'. Received ${JSON.stringify(c)}`)}}function xe(e,t,n){if(!t.schemas.hasOwnProperty(e))throw Error("No config schema has been defined for "+e);const r=t.schemas[e],o=Ee(e,Oe(t,n));je(r,o,e);const i=Ae(r,o);return Pe(r,i,e),delete i.extensionSlots,i}function Ee(e,t){return _e(t.map((({[e]:t})=>t)).filter((e=>!!e)))}function _e(e){return M(_)({},e)}function je(e,t,n=""){for(const r of Object.keys(t)){const o=t[r],i=n+"."+r,s=e[r];e.hasOwnProperty(r)?ke(s,o,i):"extensionSlots"===r&&""!==n||console.error(`Unknown config key '${i}' provided. Ignoring.`)}}function ke(e,t,n){$e(n,e._type,t),De(t)?e._type===L.Object?function(e,t,n){if(e._elements)for(const r of Object.keys(t)){const o=t[r];je(e._elements,o,`${n}.${r}`)}}(e,t,n):e.hasOwnProperty("_default")||je(e,t,n):e._type===L.Array&&function(e,t,n){if(Te(e._elements))for(let r=0;r<t.length;r++)ke(e._elements,t[r],`${n}[${r}]`);for(let o=0;o<t.length;o++){var r;$e(`${n}[${o}]`,null===(r=e._elements)||void 0===r?void 0:r._type,t[o])}}(e,t,n)}function Pe(e,t,n=""){if(e)if(t!==e._default&&Ce(n,e._validators,t),De(t))for(const r of Object.keys(t)){const o=t[r],i=n+"."+r,s=e[r];e._type===L.Object&&e._elements?Pe(e._elements,o,i):Pe(s,o,i)}else if(Array.isArray(t)&&e._elements)for(let r=0;r<t.length;r++)Pe(e._elements,t[r],`${n}[${r}]`)}function $e(e,t,n){t&&Ce(e,[{Array:U,Boolean:z,ConceptUuid:q,Number:F,Object:V,String:K,UUID:q,PersonAttributeTypeUuid:q,PatientIdentifierTypeUuid:q}[t]],n)}function Ce(e,t,n){if(t)try{for(let r of t){const t=r(n);"string"==typeof t&&("object"==typeof n?console.error(`Invalid configuration for ${e}: ${t}`):console.error(`Invalid configuration value ${n} for ${e}: ${t}`))}}catch(t){console.error(`Skipping invalid validator at "${e}". Encountered error\n\t${t}`)}}ae(W.getState(),G.getState()),W.subscribe((e=>ae(e,G.getState()))),G.subscribe((e=>ae(W.getState(),e))),ue(W.getState(),G.getState()),W.subscribe((e=>ue(e,G.getState()))),G.subscribe((e=>ue(W.getState(),e))),ce(W.getState(),G.getState()),W.subscribe((e=>ce(e,G.getState()))),G.subscribe((e=>ce(W.getState(),e))),le(W.getState(),Z.getState(),G.getState()),W.subscribe((e=>{le(e,Z.getState(),G.getState())})),Z.subscribe((e=>{le(W.getState(),e,G.getState())})),G.subscribe((e=>{le(W.getState(),Z.getState(),e)}));const Ae=(e,t)=>{const n=P(t);if(!e)return n;for(const t of Object.keys(e)){const r=n[t],o=e[t];if(o&&o.hasOwnProperty("_default")){n.hasOwnProperty(t)||(n[t]=o._default);const e=o._elements;if(r&&Te(e))if(o._type===L.Array&&Array.isArray(r)){const o=r.map((t=>Ae(e,t)));n[t]=o}else if(o._type===L.Object)for(let t of Object.keys(r))r[t]=Ae(e,r[t])}else if(De(o)){const e=n.hasOwnProperty(t)?r:{};De(e)&&(n[t]=Ae(o,e))}}return n};function Te(e){return!!e&&Object.keys(e).filter((e=>!["_default","_validators"].includes(e))).length>0}function De(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}const Ie={"Display conditions":{privileges:{_description:"The privilege(s) the user must have to use this extension",_type:L.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:L.Object,_default:{}}};var Re=o(645);function Ne(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Me(e,t){const n=window.getOpenmrsSpaBase().replace(/\/$/,"");return Le(e,function(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){Ne(e,t,n[t])}))}return e}({openmrsBase:window.openmrsBase,openmrsSpaBase:n},t)).replace(/^\/\//,"/")}function Le(e,t){return Object.keys(t).reduce(((e,n)=>e.split("${"+n+"}").join(t[n])),e)}function Be({to:e,templateParams:t}){const n=window.getOpenmrsSpaBase().replace(/\/$/,""),r=Me(e,t);r.startsWith(n)?(0,Re.navigateToUrl)(r):window.location.assign(r)}const Ue=(e,t)=>B((n=>e<=n&&n<=t),`must be between ${e} and ${t}`),ze=e=>{const t=e.concat(["openmrsBase","openmrsSpaBase"]);return B((e=>{if(!e||"string"!=typeof e)return!1;const n=/\${(.*?)}/g;let r=n.exec(e);for(;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((e=>"${"+e+"}")).join(", "))},Fe=ze([]),Ke=e=>B((t=>e.includes(t)),`Must be one of the following: '${e.join("', '")}'.`),Ve={inRange:Ue,isUrl:Fe,isUrlWithTemplateParameters:ze,oneOf:Ke}})(),i})())}}}))},7521:(e,t,n)=>{"use strict";var r;function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){const n=window.getOpenmrsSpaBase().replace(/\/$/,"");return s(e,function(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){o(e,t,n[t])}))}return e}({openmrsBase:window.openmrsBase,openmrsSpaBase:n},t)).replace(/^\/\//,"/")}function s(e,t){return Object.keys(t).reduce(((e,n)=>e.split("${"+n+"}").join(t[n])),e)}n.d(t,{Dy:()=>r,SH:()=>me,Tj:()=>be,iE:()=>we,pR:()=>ce,Z2:()=>l,IT:()=>s,ll:()=>i,CB:()=>p,gZ:()=>f,c4:()=>c,kw:()=>d,JJ:()=>ve,sC:()=>u,z2:()=>h}),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"}(r||(r={}));var a=n(5875);function c({to:e,templateParams:t}){const n=window.getOpenmrsSpaBase().replace(/\/$/,""),r=i(e,t);r.startsWith(n)?(0,a.navigateToUrl)(r):window.location.assign(r)}function u(e,t){return n=>{if(!e(n))return"function"==typeof t?t(n):t}}const l=(e,t)=>u((n=>e<=n&&n<=t),`must be between ${e} and ${t}`),f=e=>{const t=e.concat(["openmrsBase","openmrsSpaBase"]);return u((e=>{if(!e||"string"!=typeof e)return!1;const n=/\${(.*?)}/g;let r=n.exec(e);for(;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((e=>"${"+e+"}")).join(", "))},p=f([]),d=e=>u((t=>e.includes(t)),`Must be one of the following: '${e.join("', '")}'.`),h={inRange:l,isUrl:p,isUrlWithTemplateParameters:f,oneOf:d};function y(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function g(e){return function t(n){return 0===arguments.length||y(n)?t:e.apply(this,arguments)}}function m(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return y(n)?t:g((function(t){return e(n,t)}));default:return y(n)&&y(r)?t:y(n)?g((function(t){return e(t,r)})):y(r)?g((function(t){return e(n,t)})):e(n,r)}}}function b(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function v(e,t,n){for(var r=0,o=n.length;r<o;){if(e(t,n[r]))return!0;r+=1}return!1}function w(e,t){return Object.prototype.hasOwnProperty.call(t,e)}const O="function"==typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};var S=Object.prototype.toString,x=function(){return"[object Arguments]"===S.call(arguments)?function(e){return"[object Arguments]"===S.call(e)}:function(e){return w("callee",e)}}();const E=x;var _=!{toString:null}.propertyIsEnumerable("toString"),j=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],k=function(){return arguments.propertyIsEnumerable("length")}(),P=function(e,t){for(var n=0;n<e.length;){if(e[n]===t)return!0;n+=1}return!1};const $="function"!=typeof Object.keys||k?g((function(e){if(Object(e)!==e)return[];var t,n,r=[],o=k&&E(e);for(t in e)!w(t,e)||o&&"length"===t||(r[r.length]=t);if(_)for(n=j.length-1;n>=0;)w(t=j[n],e)&&!P(r,t)&&(r[r.length]=t),n-=1;return r})):g((function(e){return Object(e)!==e?[]:Object.keys(e)})),C=g((function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}));function A(e,t,n,r){var o=b(e);function i(e,t){return T(e,t,n.slice(),r.slice())}return!v((function(e,t){return!v(i,t,e)}),b(t),o)}function T(e,t,n,r){if(O(e,t))return!0;var o,i,s=C(e);if(s!==C(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(s){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===(o=e.constructor,null==(i=String(o).match(/^function (\w*)/))?"":i[1]))return e===t;break;case"Boolean":case"Number":case"String":if(typeof e!=typeof t||!O(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!O(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 a=n.length-1;a>=0;){if(n[a]===e)return r[a]===t;a-=1}switch(s){case"Map":return e.size===t.size&&A(e.entries(),t.entries(),n.concat([e]),r.concat([t]));case"Set":return e.size===t.size&&A(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 c=$(e);if(c.length!==$(t).length)return!1;var u=n.concat([e]),l=r.concat([t]);for(a=c.length-1;a>=0;){var f=c[a];if(!w(f,t)||!T(t[f],e[f],u,l))return!1;a-=1}return!0}const D=m((function(e,t){return T(e,t,[],[])}));function I(e){return function t(n,r,o){switch(arguments.length){case 0:return t;case 1:return y(n)?t:m((function(t,r){return e(n,t,r)}));case 2:return y(n)&&y(r)?t:y(n)?m((function(t,n){return e(t,r,n)})):y(r)?m((function(t,r){return e(n,t,r)})):g((function(t){return e(n,r,t)}));default:return y(n)&&y(r)&&y(o)?t:y(n)&&y(r)?m((function(t,n){return e(t,n,o)})):y(n)&&y(o)?m((function(t,n){return e(t,r,n)})):y(r)&&y(o)?m((function(t,r){return e(n,t,r)})):y(n)?g((function(t){return e(t,r,o)})):y(r)?g((function(t){return e(n,t,o)})):y(o)?g((function(t){return e(n,r,t)})):e(n,r,o)}}}function R(e){return"[object Object]"===Object.prototype.toString.call(e)}const N=I((function(e,t,n){var r,o={};for(r in t)w(r,t)&&(o[r]=w(r,n)?e(r,t[r],n[r]):t[r]);for(r in n)w(r,n)&&!w(r,o)&&(o[r]=n[r]);return o})),M=I((function e(t,n,r){return N((function(n,r,o){return R(r)&&R(o)?e(t,r,o):t(n,r,o)}),n,r)})),L=m((function(e,t){return M((function(e,t,n){return n}),e,t)})),B=m((function(e,t){for(var n={},r={},o=0,i=e.length;o<i;)r[e[o]]=1,o+=1;for(var s in t)r.hasOwnProperty(s)||(n[s]=t[s]);return n}));function U(e,t,n,r){var o,i=function(o){for(var i=t.length,s=0;s<i;){if(e===t[s])return n[s];s+=1}for(var a in t[s+1]=e,n[s+1]=o,e)o[a]=r?U(e[a],t,n,!0):e[a];return o};switch(C(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}}const z=g((function(e){return null!=e&&"function"==typeof e.clone?e.clone():U(e,[],[],!0)})),F=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)},K=g((function(e){return!!F(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))}));var V=function(){function e(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}(),q=m((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,s){return t.apply(this,arguments)};case 7:return function(e,n,r,o,i,s,a){return t.apply(this,arguments)};case 8:return function(e,n,r,o,i,s,a,c){return t.apply(this,arguments)};case 9:return function(e,n,r,o,i,s,a,c,u){return t.apply(this,arguments)};case 10:return function(e,n,r,o,i,s,a,c,u,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)}))}));const H=q;function W(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)}function G(e,t,n,r){return e["@@transducer/result"](n[r](H(e["@@transducer/step"],e),t))}var Z="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";function Y(e,t,n){if("function"==typeof e&&(e=function(e){return new V(e)}(e)),K(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 G(e,t,n,"fantasy-land/reduce");if(null!=n[Z])return W(e,t,n[Z]());if("function"==typeof n.next)return W(e,t,n);if("function"==typeof n.reduce)return G(e,t,n,"reduce");throw new TypeError("reduce: list must be array or iterable")}const X=I(Y),Q=u((e=>Array.isArray(e)),"must be an array"),J=u((e=>"boolean"==typeof e),"must be a boolean"),ee=u((e=>"number"==typeof e),"must be a number"),te=u((e=>"string"==typeof e),"must be a string"),ne=u((e=>"object"==typeof e&&!Array.isArray(e)&&null!==e),"must be an object (not an array or null)"),re=u((e=>/^[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");var oe=n(403);const ie=(0,oe.createGlobalStore)("config-internal",{providedConfigs:[],schemas:{}}),se=(0,oe.createGlobalStore)("temporary-config",{config:function(){try{return JSON.parse(localStorage.getItem("openmrs:temporaryConfig")||"{}")}catch(e){return{}}}()});se.subscribe((e=>{var t;t=e.config,localStorage.setItem("openmrs:temporaryConfig",JSON.stringify(t))}));const ae=(0,oe.createGlobalStore)("config-store-of-extension-state",{mountedExtensions:[]});function ce(e){return(0,oe.getGlobalStore)(`config-module-${e}`,{config:null,loaded:!1})}const ue=(0,oe.createGlobalStore)("config-implementer-tools",{config:{}});function le(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fe(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){le(e,t,n[t])}))}return e}function pe(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 de(e,t){for(let n of Object.keys(e.schemas)){const r=ke(n,e,t);ce(n).setState({loaded:!0,config:r})}}function he(e,t){const n=function(e,t){const n=$e(_e(e,t)),r=Object.keys(n).reduce(((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}),{});!function(e){for(let[t,n]of Object.entries(e))for(let[e,r]of Object.entries(n))Ee(r,t,e)}(r);return Object.keys(r).reduce(((e,t)=>fe({},e,r[t])),{})}(e,t),r=Object.fromEntries(Object.entries(n).map((([e,t])=>[e,{loaded:!0,config:t}]))),o=(0,oe.getGlobalStore)("config-extension-slots",{slots:{}}),i=o.getState(),s={slots:fe({},i.slots,r)};D(i,s)||o.setState(s)}function ye(e,t){const n=function(e,t){let n=Se(z(e.schemas));const r=[...e.providedConfigs.map((e=>[e.config,e.source])),[t.config,"temporary config"]];for(let[e,t]of r)n=$e([n,xe(e,t)]);return n}(e,t);ue.setState({config:n})}function ge(e,t,n){const r={};for(let o of t.mountedExtensions){const t=Oe(o.slotModuleName,o.extensionModuleName,o.slotName,o.extensionId,e,n);r[o.slotName]=pe(fe({},r[o.slotName]),{[o.extensionId]:{config:t,loaded:!0}})}(0,oe.getGlobalStore)("config-extensions",{configs:{}}).setState({configs:r})}function me(e,t){je(e,t);const n=L(t,Le),r=ie.getState();ie.setState({schemas:pe(fe({},r.schemas),{[e]:n})})}function be(e,t){je(e,t);const n=L(t,Le),r=ie.getState();r.schemas[e]&&console.warn(`Config schema for extension ${e} already exists. If there are multiple extensions with this same name, one will probably crash.`),ie.setState({schemas:pe(fe({},r.schemas),{[e]:n})})}function ve(e,t="provided"){const n=ie.getState();ie.setState({providedConfigs:[...n.providedConfigs,{source:t,config:e}]})}function we(e){return new Promise((t=>{const n=ce(e);function r(e){if(e.loaded&&e.config){const n=B(["Display conditions","Translation overrides"],e.config);t(n),o&&o()}}r(n.getState());const o=n.subscribe(r)}))}function Oe(e,t,n,r,o,i){var s,a,c;const u=function(e){const[t]=e.split("#");return t}(r),l=o.schemas[u],f=l?u:t,p=_e(o,i),d=Pe(e,p);var h;const y=null!==(h=null==d||null===(s=d.extensionSlots)||void 0===s||null===(a=s[n])||void 0===a||null===(c=a.configure)||void 0===c?void 0:c[r])&&void 0!==h?h:{},g=$e([Pe(f,p),y]),m=null!=l?l:o.schemas[t];Ce(m,g,f);const b=Re(m,g);return Te(m,b,f),delete b.extensionSlots,b}function Se(e){return e.hasOwnProperty("_default")?pe(fe({},e),{_value:e._default,_source:"default"}):Me(e)?Object.keys(e).reduce(((t,n)=>(t[n]=Se(e[n]),t)),{}):{}}function xe(e,t){return Me(e)?Object.keys(e).reduce(((n,r)=>(n[r]=xe(e[r],t),n)),{}):{_value:e,_source:t}}function Ee(e,t,n){const r=`Extension slot config '${t}.extensionSlots.${n}`,o=Object.keys(e).filter((e=>!["add","remove","order","configure"].includes(e)));o.length&&console.error(r+`' contains invalid keys '${o.join("', '")}'`),e.add&&(Array.isArray(e.add)&&e.add.every((e=>"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((e=>"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((e=>"string"==typeof e))||console.error(r+".order' is invalid. Must be an array of strings (extension IDs)")),e.configure&&(Me(e.configure)||console.error(r+".configure' is invalid. Must be an object with extension IDs for keys"))}function _e(e,t){return[...e.providedConfigs.map((e=>e.config)),t.config]}function je(e,t,n=""){const o="Please verify that you are running the latest version and, if so, alert the maintainer.";for(const i of Object.keys(t).filter((e=>!e.startsWith("_")))){const s=n+(n&&".")+i,a=t[i];if("Display conditions"===s&&console.error(`${e} declares a configuration option called "Display conditions"; the "Display conditions" option is a reserved name. ${o}`),"Translation overrides"===s&&console.error(`${e} declares a configuration option called "Translation overrides"; the "Translation overrides" option is a reserved name. ${o}`),!Me(a)){console.error(`${e} has bad config schema definition for key '${s}'. ${o}`);continue}a.hasOwnProperty("_default")||je(e,a,s);const c=a._elements;if(Ne(c)&&je(e,c,s+"._elements"),a._validators)for(let t of a._validators)"function"!=typeof t&&console.error(`${e} has invalid validator for key '${s}' ${o}.\n\nIf you're the maintainer: validators must be functions that return either undefined or an error string. Received ${t}.`);const u=a._type;u&&!Object.values(r).includes(u)&&console.error(`${e} has invalid type for key '${s}' ${o}.\n\nIf you're the maintainer: the allowed types are ${Object.values(r).join(", ")}. Received '${u}'`),Object.keys(a).every((e=>["_description","_validators","_elements","_type"].includes(e)))&&!n.includes("._elements")&&console.error(`${e} has bad config schema definition for key '${s}'. ${o}.\n\nIf you're the maintainer: all config elements must have a default. Received ${JSON.stringify(a)}`),c&&u&&![r.Array,r.Object].includes(u)&&console.error(`${e} has bad config schema definition for key '${s}'. ${o}.\n\nIf you're the maintainer: the 'elements' key only works with '_type' equal to 'Array' or 'Object'. Received ${JSON.stringify(u)}`)}}function ke(e,t,n){if(!t.schemas.hasOwnProperty(e))throw Error("No config schema has been defined for "+e);const r=t.schemas[e],o=Pe(e,_e(t,n));Ce(r,o,e);const i=Re(r,o);return Te(r,i,e),delete i.extensionSlots,i}function Pe(e,t){return $e(t.map((({[e]:t})=>t)).filter((e=>!!e)))}function $e(e){return X(L)({},e)}function Ce(e,t,n=""){for(const r of Object.keys(t)){const o=t[r],i=n+"."+r,s=e[r];e.hasOwnProperty(r)?Ae(s,o,i):"extensionSlots"===r&&""!==n||console.error(`Unknown config key '${i}' provided. Ignoring.`)}}function Ae(e,t,n){De(n,e._type,t),Me(t)?e._type===r.Object?function(e,t,n){if(e._elements)for(const r of Object.keys(t)){const o=t[r];Ce(e._elements,o,`${n}.${r}`)}}(e,t,n):e.hasOwnProperty("_default")||Ce(e,t,n):e._type===r.Array&&function(e,t,n){if(Ne(e._elements))for(let r=0;r<t.length;r++)Ae(e._elements,t[r],`${n}[${r}]`);for(let o=0;o<t.length;o++){var r;De(`${n}[${o}]`,null===(r=e._elements)||void 0===r?void 0:r._type,t[o])}}(e,t,n)}function Te(e,t,n=""){if(e)if(t!==e._default&&Ie(n,e._validators,t),Me(t))for(const o of Object.keys(t)){const i=t[o],s=n+"."+o,a=e[o];e._type===r.Object&&e._elements?Te(e._elements,i,s):Te(a,i,s)}else if(Array.isArray(t)&&e._elements)for(let r=0;r<t.length;r++)Te(e._elements,t[r],`${n}[${r}]`)}function De(e,t,n){t&&Ie(e,[{Array:Q,Boolean:J,ConceptUuid:re,Number:ee,Object:ne,String:te,UUID:re,PersonAttributeTypeUuid:re,PatientIdentifierTypeUuid:re}[t]],n)}function Ie(e,t,n){if(t)try{for(let r of t){const t=r(n);"string"==typeof t&&("object"==typeof n?console.error(`Invalid configuration for ${e}: ${t}`):console.error(`Invalid configuration value ${n} for ${e}: ${t}`))}}catch(t){console.error(`Skipping invalid validator at "${e}". Encountered error\n\t${t}`)}}de(ie.getState(),se.getState()),ie.subscribe((e=>de(e,se.getState()))),se.subscribe((e=>de(ie.getState(),e))),ye(ie.getState(),se.getState()),ie.subscribe((e=>ye(e,se.getState()))),se.subscribe((e=>ye(ie.getState(),e))),he(ie.getState(),se.getState()),ie.subscribe((e=>he(e,se.getState()))),se.subscribe((e=>he(ie.getState(),e))),ge(ie.getState(),ae.getState(),se.getState()),ie.subscribe((e=>{ge(e,ae.getState(),se.getState())})),ae.subscribe((e=>{ge(ie.getState(),e,se.getState())})),se.subscribe((e=>{ge(ie.getState(),ae.getState(),e)}));const Re=(e,t)=>{const n=z(t);if(!e)return n;for(const t of Object.keys(e)){const o=n[t],i=e[t];if(i&&i.hasOwnProperty("_default")){n.hasOwnProperty(t)||(n[t]=i._default);const e=i._elements;if(o&&Ne(e))if(i._type===r.Array&&Array.isArray(o)){const r=o.map((t=>Re(e,t)));n[t]=r}else if(i._type===r.Object)for(let t of Object.keys(o))o[t]=Re(e,o[t])}else if(Me(i)){const e=n.hasOwnProperty(t)?o:{};Me(e)&&(n[t]=Re(i,e))}}return n};function Ne(e){return!!e&&Object.keys(e).filter((e=>!["_default","_validators"].includes(e))).length>0}function Me(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}const Le={"Display conditions":{privileges:{_description:"The privilege(s) the user must have to use this extension",_type:r.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:r.Object,_default:{}}}},3662:(e,t,n)=>{"use strict";function r(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function o(e){return i.apply(this,arguments)}function i(){var e;return e=function*(e,t="./start"){if("string"!=typeof e||0===e.trim().length){const e="Attempted to call importDynamic() without supplying a package to load";throw console.error(e),new Error(e)}const r=e.replace(/[\/\-@]/g,"_");if(!window[r]){const t=yield window.importMapOverrides.getCurrentPageMap();if(!t.imports.hasOwnProperty(e)){const t=`Could not find the package ${e} defined in the current importmap`;throw console.error(t),new Error(t)}let n=t.imports[e];n.startsWith("./")&&(n=window.spaBase+n.substring(1)),yield new Promise(((e,t)=>{!function(e,t,n){const r=document.head.querySelector(`script[src="${e}"]`);let o=window[s];if(o||(o=window[s]=new Set([])),r)if(o.has(e)){const o=()=>{null==r||r.removeEventListener("load",o),t(null)};r.addEventListener("load",o);const i=t=>{console.error(`Failed to load script from ${e}`,t),null==r||r.removeEventListener("error",i),n(t.message)};r.addEventListener("error",i)}else console.warn("Script already loaded. Not loading it again.",e),t(null);else{o.add(e);const r=document.createElement("script");r.src=e,r.type="text/javascript",r.async=!0;const i=()=>{o.delete(e),r.removeEventListener("load",i),t(null)};r.addEventListener("load",i);const s=t=>{o.delete(e),console.error(`Failed to load script from ${e}`,t),r.removeEventListener("error",s),n(t.message)};r.addEventListener("error",s),document.head.appendChild(r)}}(n,e,t)}))}const o=window[r];if("object"!=typeof(i=o)||null===i||!("init"in i)||"function"!=typeof i.init||!("get"in i)||"function"!=typeof i.get){const e=`The global variable ${r} does not refer to a federated module`;throw console.error(e),new Error(e)}var i;o.init(n.S.default);const a=(yield o.get(t))();if("object"!=typeof a||null===a){const t=`Container for ${e} did not return an ESM module as expected`;throw console.error(t),new Error(t)}return a},i=function(){var t=this,n=arguments;return new Promise((function(o,i){var s=e.apply(t,n);function a(e){r(s,o,i,a,c,"next",e)}function c(e){r(s,o,i,a,c,"throw",e)}a(void 0)}))},i.apply(this,arguments)}n.d(t,{c:()=>o});const s="__openmrs_script_loading"},151:()=>{System.register(["@openmrs/esm-globals"],(function(e,t){var n={};return{setters:[function(e){n.dispatchNotificationShown=e.dispatchNotificationShown}],execute:function(){e((()=>{"use strict";var e={728: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=(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=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{r.r(o),r.d(o,{createErrorHandler:()=>n,reportError:()=>t});var e=r(728);function t(e){const t=i(e);setTimeout((()=>{throw t}))}function n(){const e=Error();return n=>{i(n).stack+=`\nAsync stacktrace:\n${e.stack}`,t(n)}}function i(e){let t;if(e instanceof Error)return e;if(null===e)return Error("'null' was thrown as an error");if("object"==typeof e){try{t=`Object thrown as error: ${JSON.stringify(e)}`}catch(n){t=`Object thrown as error with the following properties: ${Object.keys(e)}`}return Error(t)}return void 0===e?Error("'undefined' was thrown as an error"):Error(e.toString())}window.onerror=function(t){return console.error("Unexpected error: ",t),(0,e.dispatchNotificationShown)({description:null!=t?t:"Oops! An unexpected error occurred.",kind:"error",title:"Error"}),!1},window.onunhandledrejection=function(t){var n;console.error("Unhandled rejection: ",t.reason),(0,e.dispatchNotificationShown)({description:null!==(n=t.reason)&&void 0!==n?n:"Oops! An unhandled promise rejection occurred.",kind:"error",title:"Error"})}})(),o})())}}}))},3196:(e,t,n)=>{e=n.nmd(e),System.register(["@openmrs/esm-config","@openmrs/esm-state","@openmrs/esm-api","single-spa"],(function(r,o){var i={},s={},a={},c={};return{setters:[function(e){i.configExtensionStore=e.configExtensionStore,i.getExtensionConfigFromStore=e.getExtensionConfigFromStore,i.getExtensionSlotConfig=e.getExtensionSlotConfig,i.getExtensionSlotConfigFromStore=e.getExtensionSlotConfigFromStore,i.getExtensionSlotsConfigStore=e.getExtensionSlotsConfigStore,i.getExtensionsConfigStore=e.getExtensionsConfigStore},function(e){s.createGlobalStore=e.createGlobalStore,s.getGlobalStore=e.getGlobalStore},function(e){a.getSessionStore=e.getSessionStore,a.userHasAccess=e.userHasAccess},function(e){c.mountRootParcel=e.mountRootParcel}],execute:function(){r((()=>{"use strict";var r={766:e=>{e.exports=a},824:e=>{e.exports=i},685:e=>{e.exports=s},645:e=>{e.exports=c}},o={};function u(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return r[e](n,n.exports,u),n.exports}u.d=(e,t)=>{for(var n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),u.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};return(()=>{u.r(l),u.d(l,{attach:()=>_t,checkStatus:()=>It,checkStatusFor:()=>Rt,detach:()=>jt,detachAll:()=>kt,extensionStore:()=>Kt,getAssignedExtensions:()=>At,getConnectedExtensions:()=>$t,getExtensionInternalStore:()=>st,getExtensionNameFromId:()=>Ot,getExtensionRegistration:()=>xt,getExtensionRegistrationFrom:()=>St,getExtensionStore:()=>ct,registerExtension:()=>Et,registerExtensionSlot:()=>Tt,renderExtension:()=>zt,reset:()=>Dt,updateInternalExtensionStore:()=>at});const r=function(e,t){return e===t||e!=e&&t!=t},o=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1};var i=Array.prototype.splice;function s(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.prototype.clear=function(){this.__data__=[],this.size=0},s.prototype.delete=function(e){var t=this.__data__,n=o(t,e);return!(n<0||(n==t.length-1?t.pop():i.call(t,n,1),--this.size,0))},s.prototype.get=function(e){var t=this.__data__,n=o(t,e);return n<0?void 0:t[n][1]},s.prototype.has=function(e){return o(this.__data__,e)>-1},s.prototype.set=function(e,t){var n=this.__data__,r=o(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};const a=s,c="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;var f="object"==typeof self&&self&&self.Object===Object&&self;const p=c||f||Function("return this")(),d=p.Symbol;var h=Object.prototype,y=h.hasOwnProperty,g=h.toString,m=d?d.toStringTag:void 0,b=Object.prototype.toString,v=d?d.toStringTag:void 0;const w=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":v&&v in Object(e)?function(e){var t=y.call(e,m),n=e[m];try{e[m]=void 0;var r=!0}catch(e){}var o=g.call(e);return r&&(t?e[m]=n:delete e[m]),o}(e):function(e){return b.call(e)}(e)},O=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},S=function(e){if(!O(e))return!1;var t=w(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},x=p["__core-js_shared__"];var E,_=(E=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||""))?"Symbol(src)_1."+E:"",j=Function.prototype.toString;const k=function(e){if(null!=e){try{return j.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var P=/^\[object .+?Constructor\]$/,$=Function.prototype,C=Object.prototype,A=$.toString,T=C.hasOwnProperty,D=RegExp("^"+A.call(T).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const I=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!O(e)||(t=e,_&&_ in t))&&(S(e)?D:P).test(k(e));var t}(n)?n:void 0},R=I(p,"Map"),N=I(Object,"create");var M=Object.prototype.hasOwnProperty,L=Object.prototype.hasOwnProperty;function B(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.prototype.clear=function(){this.__data__=N?N(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(N){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return M.call(t,e)?t[e]:void 0},B.prototype.has=function(e){var t=this.__data__;return N?void 0!==t[e]:L.call(t,e)},B.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=N&&void 0===t?"__lodash_hash_undefined__":t,this};const U=B,z=function(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map};function F(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])}}F.prototype.clear=function(){this.size=0,this.__data__={hash:new U,map:new(R||a),string:new U}},F.prototype.delete=function(e){var t=z(this,e).delete(e);return this.size-=t?1:0,t},F.prototype.get=function(e){return z(this,e).get(e)},F.prototype.has=function(e){return z(this,e).has(e)},F.prototype.set=function(e,t){var n=z(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};const K=F;function V(e){var t=this.__data__=new a(e);this.size=t.size}V.prototype.clear=function(){this.__data__=new a,this.size=0},V.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},V.prototype.get=function(e){return this.__data__.get(e)},V.prototype.has=function(e){return this.__data__.has(e)},V.prototype.set=function(e,t){var n=this.__data__;if(n instanceof a){var r=n.__data__;if(!R||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new K(r)}return n.set(e,t),this.size=n.size,this};const q=V;function H(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new K;++t<n;)this.add(e[t])}H.prototype.add=H.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},H.prototype.has=function(e){return this.__data__.has(e)};const W=H,G=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},Z=function(e,t,n,r,o,i){var s=1&n,a=e.length,c=t.length;if(a!=c&&!(s&&c>a))return!1;var u=i.get(e),l=i.get(t);if(u&&l)return u==t&&l==e;var f=-1,p=!0,d=2&n?new W:void 0;for(i.set(e,t),i.set(t,e);++f<a;){var h=e[f],y=t[f];if(r)var g=s?r(y,h,f,t,e,i):r(h,y,f,e,t,i);if(void 0!==g){if(g)continue;p=!1;break}if(d){if(!G(t,(function(e,t){if(s=t,!d.has(s)&&(h===e||o(h,e,n,r,i)))return d.push(t);var s}))){p=!1;break}}else if(h!==y&&!o(h,y,n,r,i)){p=!1;break}}return i.delete(e),i.delete(t),p},Y=p.Uint8Array,X=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n},Q=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n};var J=d?d.prototype:void 0,ee=J?J.valueOf:void 0;const te=Array.isArray;var ne=Object.prototype.propertyIsEnumerable,re=Object.getOwnPropertySymbols;const oe=re?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 s=e[n];t(s)&&(i[o++]=s)}return i}(re(e),(function(t){return ne.call(e,t)})))}:function(){return[]},ie=function(e){return null!=e&&"object"==typeof e},se=function(e){return ie(e)&&"[object Arguments]"==w(e)};var ae=Object.prototype,ce=ae.hasOwnProperty,ue=ae.propertyIsEnumerable,le=se(function(){return arguments}())?se:function(e){return ie(e)&&ce.call(e,"callee")&&!ue.call(e,"callee")};const fe=le;var pe=t&&!t.nodeType&&t,de=pe&&e&&!e.nodeType&&e,he=de&&de.exports===pe?p.Buffer:void 0;const ye=(he?he.isBuffer:void 0)||function(){return!1};var ge=/^(?:0|[1-9]\d*)$/;const me=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ge.test(e))&&e>-1&&e%1==0&&e<t},be=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var ve={};ve["[object Float32Array]"]=ve["[object Float64Array]"]=ve["[object Int8Array]"]=ve["[object Int16Array]"]=ve["[object Int32Array]"]=ve["[object Uint8Array]"]=ve["[object Uint8ClampedArray]"]=ve["[object Uint16Array]"]=ve["[object Uint32Array]"]=!0,ve["[object Arguments]"]=ve["[object Array]"]=ve["[object ArrayBuffer]"]=ve["[object Boolean]"]=ve["[object DataView]"]=ve["[object Date]"]=ve["[object Error]"]=ve["[object Function]"]=ve["[object Map]"]=ve["[object Number]"]=ve["[object Object]"]=ve["[object RegExp]"]=ve["[object Set]"]=ve["[object String]"]=ve["[object WeakMap]"]=!1;var we=t&&!t.nodeType&&t,Oe=we&&e&&!e.nodeType&&e,Se=Oe&&Oe.exports===we&&c.process,xe=function(){try{return Oe&&Oe.require&&Oe.require("util").types||Se&&Se.binding&&Se.binding("util")}catch(e){}}(),Ee=xe&&xe.isTypedArray;const _e=Ee?(je=Ee,function(e){return je(e)}):function(e){return ie(e)&&be(e.length)&&!!ve[w(e)]};var je,ke=Object.prototype.hasOwnProperty,Pe=Object.prototype;const $e=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object);var Ce=Object.prototype.hasOwnProperty;const Ae=function(e){return null!=(t=e)&&be(t.length)&&!S(t)?function(e,t){var n=te(e),r=!n&&fe(e),o=!n&&!r&&ye(e),i=!n&&!r&&!o&&_e(e),s=n||r||o||i,a=s?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=a.length;for(var u in e)!ke.call(e,u)||s&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||me(u,c))||a.push(u);return a}(e):function(e){if(n=(t=e)&&t.constructor,t!==("function"==typeof n&&n.prototype||Pe))return $e(e);var t,n,r=[];for(var o in Object(e))Ce.call(e,o)&&"constructor"!=o&&r.push(o);return r}(e);var t},Te=function(e){return function(e,t,n){var r=t(e);return te(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,Ae,oe)};var De=Object.prototype.hasOwnProperty;const Ie=I(p,"DataView"),Re=I(p,"Promise"),Ne=I(p,"Set"),Me=I(p,"WeakMap");var Le="[object Map]",Be="[object Promise]",Ue="[object Set]",ze="[object WeakMap]",Fe="[object DataView]",Ke=k(Ie),Ve=k(R),qe=k(Re),He=k(Ne),We=k(Me),Ge=w;(Ie&&Ge(new Ie(new ArrayBuffer(1)))!=Fe||R&&Ge(new R)!=Le||Re&&Ge(Re.resolve())!=Be||Ne&&Ge(new Ne)!=Ue||Me&&Ge(new Me)!=ze)&&(Ge=function(e){var t=w(e),n="[object Object]"==t?e.constructor:void 0,r=n?k(n):"";if(r)switch(r){case Ke:return Fe;case Ve:return Le;case qe:return Be;case He:return Ue;case We:return ze}return t});const Ze=Ge;var Ye="[object Arguments]",Xe="[object Array]",Qe="[object Object]",Je=Object.prototype.hasOwnProperty;const et=function(e,t,n,o,i,s){var a=te(e),c=te(t),u=a?Xe:Ze(e),l=c?Xe:Ze(t),f=(u=u==Ye?Qe:u)==Qe,p=(l=l==Ye?Qe:l)==Qe,d=u==l;if(d&&ye(e)){if(!ye(t))return!1;a=!0,f=!1}if(d&&!f)return s||(s=new q),a||_e(e)?Z(e,t,n,o,i,s):function(e,t,n,o,i,s,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||!s(new Y(e),new Y(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return r(+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 c=X;case"[object Set]":var u=1&o;if(c||(c=Q),e.size!=t.size&&!u)return!1;var l=a.get(e);if(l)return l==t;o|=2,a.set(e,t);var f=Z(c(e),c(t),o,i,s,a);return a.delete(e),f;case"[object Symbol]":if(ee)return ee.call(e)==ee.call(t)}return!1}(e,t,u,n,o,i,s);if(!(1&n)){var h=f&&Je.call(e,"__wrapped__"),y=p&&Je.call(t,"__wrapped__");if(h||y){var g=h?e.value():e,m=y?t.value():t;return s||(s=new q),i(g,m,n,o,s)}}return!!d&&(s||(s=new q),function(e,t,n,r,o,i){var s=1&n,a=Te(e),c=a.length;if(c!=Te(t).length&&!s)return!1;for(var u=c;u--;){var l=a[u];if(!(s?l in t:De.call(t,l)))return!1}var f=i.get(e),p=i.get(t);if(f&&p)return f==t&&p==e;var d=!0;i.set(e,t),i.set(t,e);for(var h=s;++u<c;){var y=e[l=a[u]],g=t[l];if(r)var m=s?r(g,y,l,t,e,i):r(y,g,l,e,t,i);if(!(void 0===m?y===g||o(y,g,n,r,i):m)){d=!1;break}h||(h="constructor"==l)}if(d&&!h){var b=e.constructor,v=t.constructor;b==v||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof v&&v instanceof v||(d=!1)}return i.delete(e),i.delete(t),d}(e,t,n,o,i,s))},tt=function e(t,n,r,o,i){return t===n||(null==t||null==n||!ie(t)&&!ie(n)?t!=t&&n!=n:et(t,n,r,o,e,i))},nt=function(e,t){return tt(e,t)};var rt=u(824),ot=u(685);const it=(0,ot.createGlobalStore)("extensionsInternal",{slots:{},extensions:{}}),st=()=>(0,ot.getGlobalStore)("extensionsInternal",{slots:{},extensions:{}});function at(e){const t=it.getState(),n=e(t);n!==t&&it.setState(n)}const ct=()=>(0,ot.getGlobalStore)("extensions",{slots:{}});function ut(e){const t=[];for(let n of Object.values(e.extensions))for(let e of n.instances)t.push({slotModuleName:e.slotModuleName,extensionModuleName:n.moduleName,slotName:e.slotName,extensionId:e.id});nt(rt.configExtensionStore.getState().mountedExtensions,t)||rt.configExtensionStore.setState({mountedExtensions:t})}ut(it.getState()),it.subscribe(ut);var lt=u(766);const ft=function(e){return void 0===e};function pt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dt(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){pt(e,t,n[t])}))}return e}function ht(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}const yt=st(),gt=ct(),mt=(0,rt.getExtensionSlotsConfigStore)(),bt=(0,rt.getExtensionsConfigStore)();function vt(e,t,n){const r={};for(let[o,i]of Object.entries(e.slots)){const{config:s}=(0,rt.getExtensionSlotConfigFromStore)(t,i.name),a=Ct(o,e,s,n);r[o]={moduleName:i.moduleName,assignedExtensions:a}}nt(gt.getState().slots,r)||gt.setState({slots:r})}function wt(e,t){return{moduleName:t,name:e,attachedIds:[],config:null}}function Ot(e){const[t]=e.split("#");return t}function St(e,t){const n=Ot(t);return e.extensions[n]}function xt(e){return St(yt.getState(),e)}yt.subscribe((e=>{vt(e,mt.getState(),bt.getState())})),mt.subscribe((e=>{vt(yt.getState(),e,bt.getState())})),bt.subscribe((e=>{vt(yt.getState(),mt.getState(),e)}));const Et=e=>yt.setState((t=>(t.extensions[e.name]=ht(dt({},e),{instances:[]}),t)));function _t(e,t){at((n=>{const r=n.slots[e];return ht(dt({},n),r?{slots:ht(dt({},n.slots),{[e]:ht(dt({},r),{attachedIds:[...r.attachedIds,t]})})}:{slots:ht(dt({},n.slots),{[e]:ht(dt({},wt(e)),{attachedIds:[t]})})})}))}function jt(e,t){at((n=>{const r=n.slots[e];return r&&r.attachedIds.includes(t)?ht(dt({},n),{slots:ht(dt({},n.slots),{[e]:ht(dt({},r),{attachedIds:r.attachedIds.filter((e=>e!==t))})})}):n}))}function kt(e){at((t=>{const n=t.slots[e];return n?ht(dt({},t),{slots:ht(dt({},t.slots),{[e]:ht(dt({},n),{attachedIds:[]})})}):t}))}function Pt(e,t,n,r){const o=t.indexOf(e);if(-1!==o)return o;if(void 0!==n)return 1e3+n;{const t=r.indexOf(e);return-1!==t?2e3+t:-1}}function $t(e,t=null){const n=null!=t?t:navigator.onLine;return e.filter((e=>Rt(n,e.online,e.offline)))}function Ct(e,t,n,r){const o=function(e,t){const n=e.add||[],r=e.remove||[],o=e.order||[],{extensions:i}=yt.getState();return[...t,...n].filter((e=>!r.includes(e))).sort(((e,n)=>{var r,s;const a=Pt(e,o,null===(r=i[Ot(e)])||void 0===r?void 0:r.order,t),c=Pt(n,o,null===(s=i[Ot(n)])||void 0===s?void 0:s.order,t);return-1===c?-1:-1===a?1:a-c}))}(n,t.slots[e].attachedIds),i=[];let s;for(let n of o){const{config:o}=(0,rt.getExtensionConfigFromStore)(r,e,n),f=Ot(n),p=t.extensions[f];if(p){var a,c,u;const e=null!==(u=null!==(c=null==o||null===(a=o["Display conditions"])||void 0===a?void 0:a.privileges)&&void 0!==c?c:p.privileges)&&void 0!==u?u:[];if(e&&("string"==typeof e||Array.isArray(e)&&e.length>0)){var l;if(ft(s)&&(s=null===(l=(0,lt.getSessionStore)().getState().session)||void 0===l?void 0:l.user),!s)continue;if(!(0,lt.userHasAccess)(e,s))continue}i.push({id:n,name:f,moduleName:p.moduleName,config:o,meta:p.meta})}}return i}function At(e){const t=yt.getState(),{config:n}=(0,rt.getExtensionSlotConfig)(e);return Ct(e,t,n,bt.getState())}const Tt=(e,t)=>yt.setState((n=>{var r;const 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 '${t}' already exists. Refusing to register the same slot name twice (in "registerExtensionSlot"). The existing one is from module ${o}.`),n;if(o&&o==e)return n;if(n.slots[t])return ht(dt({},n),{slots:ht(dt({},n.slots),{[t]:ht(dt({},n.slots[t]),{moduleName:e})})});const i=wt(t,e);return ht(dt({},n),{slots:ht(dt({},n.slots),{[t]:i})})})),Dt=()=>gt.setState((()=>({slots:{},extensions:{}})));function It(e=!0,t=!1){return Rt(navigator.onLine,e,t)}function Rt(e,t=!0,n=!1){return Boolean(e?t:n)}var Nt=u(645);function Mt(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function Lt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bt(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){Lt(e,t,n[t])}))}return e}function Ut(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 zt(e,t,n,r){return Ft.apply(this,arguments)}function Ft(){var e;return e=function*(e,t,n,r,o=(e=>e),i={}){const s=Ot(r),a=xt(r);let c=null;if(e){if(!a)throw Error(`Couldn't find extension '${s}' to attach to '${t}'`);const{load:u,meta:l,moduleName:f,online:p,offline:d}=a;if(It(p,d)){at((o=>{const i={domElement:e,id:r,slotName:t,slotModuleName:n};return Ut(Bt({},o),{extensions:Ut(Bt({},o.extensions),{[s]:Ut(Bt({},o.extensions[s]),{instances:[...o.extensions[s].instances,i]})})})}));const a=yield u(),{default:p}=a,d=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}(a,["default"]);c=(0,Nt.mountRootParcel)(o(null!=p?p:d),Ut(Bt({},i),{_meta:l,_extensionContext:{extensionId:r,extensionSlotName:t,extensionSlotModuleName:n,extensionModuleName:f},domElement:e}))}}else console.warn(`Tried to render ${r} into ${t} but no DOM element was available.`);return c},Ft=function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){Mt(i,r,o,s,a,"next",e)}function a(e){Mt(i,r,o,s,a,"throw",e)}s(void 0)}))},Ft.apply(this,arguments)}const Kt=st()})(),l})())}}}))},9559:(e,t,n)=>{"use strict";n.d(t,{ub:()=>T,og:()=>D,lW:()=>I,h6:()=>L,Kq:()=>N,EB:()=>C,yw:()=>f,ix:()=>A,Qq:()=>B,H8:()=>v});var r=n(7840),o=n(3741),i=n(3202),s=n(9789),a=n(403);const c=(0,a.createGlobalStore)("extensionsInternal",{slots:{},extensions:{}}),u=()=>(0,a.getGlobalStore)("extensionsInternal",{slots:{},extensions:{}});function l(e){const t=c.getState(),n=e(t);n!==t&&c.setState(n)}const f=()=>(0,a.getGlobalStore)("extensions",{slots:{}});function p(e){const t=[];for(let n of Object.values(e.extensions))for(let e of n.instances)t.push({slotModuleName:e.slotModuleName,extensionModuleName:n.moduleName,slotName:e.slotName,extensionId:e.id});(0,i.Z)(o.configExtensionStore.getState().mountedExtensions,t)||o.configExtensionStore.setState({mountedExtensions:t})}function d(e,t=!0,n=!1){return Boolean(e?t:n)}p(c.getState()),c.subscribe(p);var h=n(5875);function y(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(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){g(e,t,n[t])}))}return e}function b(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 v(e,t,n,r){return w.apply(this,arguments)}function w(){var e;return e=function*(e,t,n,r,o=(e=>e),i={}){const s=C(r),a=function(e){return function(e,t){const n=C(t);return e.extensions[n]}(E.getState(),e)}(r);let c=null;if(e){if(!a)throw Error(`Couldn't find extension '${s}' to attach to '${t}'`);const{load:u,meta:f,moduleName:p,online:y,offline:g}=a;if(function(e=!0,t=!1){return d(navigator.onLine,e,t)}(y,g)){l((o=>{const i={domElement:e,id:r,slotName:t,slotModuleName:n};return b(m({},o),{extensions:b(m({},o.extensions),{[s]:b(m({},o.extensions[s]),{instances:[...o.extensions[s].instances,i]})})})}));const a=yield u(),{default:d}=a,y=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}(a,["default"]);c=(0,h.mountRootParcel)(o(null!=d?d:y),b(m({},i),{_meta:f,_extensionContext:{extensionId:r,extensionSlotName:t,extensionSlotModuleName:n,extensionModuleName:p},domElement:e}))}}else console.warn(`Tried to render ${r} into ${t} but no DOM element was available.`);return c},w=function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){y(i,r,o,s,a,"next",e)}function a(e){y(i,r,o,s,a,"throw",e)}s(void 0)}))},w.apply(this,arguments)}function O(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){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){O(e,t,n[t])}))}return e}function x(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}u();const E=u(),_=f(),j=(0,o.getExtensionSlotsConfigStore)(),k=(0,o.getExtensionsConfigStore)();function P(e,t,n){const r={};for(let[i,s]of Object.entries(e.slots)){const{config:a}=(0,o.getExtensionSlotConfigFromStore)(t,s.name),c=M(i,e,a,n);r[i]={moduleName:s.moduleName,assignedExtensions:c}}(0,i.Z)(_.getState().slots,r)||_.setState({slots:r})}function $(e,t){return{moduleName:t,name:e,attachedIds:[],config:null}}function C(e){const[t]=e.split("#");return t}E.subscribe((e=>{P(e,j.getState(),k.getState())})),j.subscribe((e=>{P(E.getState(),e,k.getState())})),k.subscribe((e=>{P(E.getState(),j.getState(),e)}));const A=e=>E.setState((t=>(t.extensions[e.name]=x(S({},e),{instances:[]}),t)));function T(e,t){l((n=>{const r=n.slots[e];return x(S({},n),r?{slots:x(S({},n.slots),{[e]:x(S({},r),{attachedIds:[...r.attachedIds,t]})})}:{slots:x(S({},n.slots),{[e]:x(S({},$(e)),{attachedIds:[t]})})})}))}function D(e,t){l((n=>{const r=n.slots[e];return r&&r.attachedIds.includes(t)?x(S({},n),{slots:x(S({},n.slots),{[e]:x(S({},r),{attachedIds:r.attachedIds.filter((e=>e!==t))})})}):n}))}function I(e){l((t=>{const n=t.slots[e];return n?x(S({},t),{slots:x(S({},t.slots),{[e]:x(S({},n),{attachedIds:[]})})}):t}))}function R(e,t,n,r){const o=t.indexOf(e);if(-1!==o)return o;if(void 0!==n)return 1e3+n;{const t=r.indexOf(e);return-1!==t?2e3+t:-1}}function N(e,t=null){const n=null!=t?t:navigator.onLine;return e.filter((e=>d(n,e.online,e.offline)))}function M(e,t,n,i){const a=function(e,t){const n=e.add||[],r=e.remove||[],o=e.order||[],{extensions:i}=E.getState();return[...t,...n].filter((e=>!r.includes(e))).sort(((e,n)=>{var r,s;const a=R(e,o,null===(r=i[C(e)])||void 0===r?void 0:r.order,t),c=R(n,o,null===(s=i[C(n)])||void 0===s?void 0:s.order,t);return-1===c?-1:-1===a?1:a-c}))}(n,t.slots[e].attachedIds),c=[];let u;for(let n of a){const{config:a}=(0,o.getExtensionConfigFromStore)(i,e,n),h=C(n),y=t.extensions[h];if(y){var l,f,p;const e=null!==(p=null!==(f=null==a||null===(l=a["Display conditions"])||void 0===l?void 0:l.privileges)&&void 0!==f?f:y.privileges)&&void 0!==p?p:[];if(e&&("string"==typeof e||Array.isArray(e)&&e.length>0)){var d;if((0,s.Z)(u)&&(u=null===(d=(0,r.getSessionStore)().getState().session)||void 0===d?void 0:d.user),!u)continue;if(!(0,r.userHasAccess)(e,u))continue}c.push({id:n,name:h,moduleName:y.moduleName,config:a,meta:y.meta})}}return c}function L(e){const t=E.getState(),{config:n}=(0,o.getExtensionSlotConfig)(e);return M(e,t,n,k.getState())}const B=(e,t)=>E.setState((n=>{var r;const 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 '${t}' already exists. Refusing to register the same slot name twice (in "registerExtensionSlot"). The existing one is from module ${o}.`),n;if(o&&o==e)return n;if(n.slots[t])return x(S({},n),{slots:x(S({},n.slots),{[t]:x(S({},n.slots[t]),{moduleName:e})})});const i=$(t,e);return x(S({},n),{slots:x(S({},n.slots),{[t]:i})})}))},7025:(e,t,n)=>{"use strict";n.r(t),n.d(t,{ConfigurableLink:()=>p.w,ErrorState:()=>h.Te,Extension:()=>p.hj,ExtensionSlot:()=>p.dT,LeftNavMenu:()=>h.cW,OpenmrsFetchError:()=>r.nF,Type:()=>s.Dy,UserHasAccess:()=>p.Vz,VisitMode:()=>r.u4,VisitStatus:()=>r.Rx,attach:()=>u.ub,backendDependencies:()=>r.Wf,beginEditSynchronizationItem:()=>f.jp,canBeginEditSynchronizationItemsOfType:()=>f.Qd,clearCurrentUser:()=>r.Ze,createGlobalStore:()=>d.jk,createUseStore:()=>p.NV,defaultVisitCustomRepresentation:()=>r.I$,defineConfigSchema:()=>s.SH,defineExtensionConfigSchema:()=>s.Tj,deleteSynchronizationItem:()=>f.Gy,detach:()=>u.og,detachAll:()=>u.lW,fetchCurrentPatient:()=>r.Vy,fhirBaseUrl:()=>r.DN,generateOfflineUuid:()=>f.sF,getAppState:()=>d.W5,getAssignedExtensions:()=>u.h6,getAsyncExtensionLifecycle:()=>p.D$,getAsyncLifecycle:()=>p.Ae,getConfig:()=>s.iE,getConfigStore:()=>s.pR,getConnectedExtensions:()=>u.Kq,getCurrentOfflineMode:()=>f.vm,getCurrentUser:()=>r.ts,getDynamicOfflineDataEntries:()=>f.xA,getDynamicOfflineDataEntriesFor:()=>f.H_,getDynamicOfflineDataHandlers:()=>f.Ui,getExtensionNameFromId:()=>u.EB,getExtensionStore:()=>u.yw,getFullSynchronizationItems:()=>f.D2,getFullSynchronizationItemsFor:()=>f.WB,getGlobalStore:()=>d.zJ,getLifecycle:()=>p.tl,getLocations:()=>r.JC,getLoggedInUser:()=>r.r,getOfflineDb:()=>f.aA,getOfflinePatientDataStore:()=>f.k1,getSessionLocation:()=>r.WK,getSessionStore:()=>r.KJ,getStartedVisit:()=>r.$X,getSyncLifecycle:()=>p.a$,getSynchronizationItem:()=>f.TI,getSynchronizationItems:()=>f.Q2,getVisitTypes:()=>r.P9,getVisitsForPatient:()=>r.nx,importDynamic:()=>a.c,inRange:()=>s.Z2,interpolateString:()=>s.IT,interpolateUrl:()=>s.ll,isDesktop:()=>p.nI,isOfflineUuid:()=>f.z7,isUrl:()=>s.CB,isUrlWithTemplateParameters:()=>s.gZ,makeUrl:()=>r.bf,messageOmrsServiceWorker:()=>f.gp,navigate:()=>s.c4,offlineUuidPrefix:()=>f.a7,omrsOfflineCachingStrategyHttpHeaderName:()=>f.Rz,omrsOfflineResponseBodyHttpHeaderName:()=>f.QI,omrsOfflineResponseStatusHttpHeaderName:()=>f.$9,oneOf:()=>s.kw,openmrsFetch:()=>r.vb,openmrsObservableFetch:()=>r.uj,provide:()=>s.JJ,putDynamicOfflineData:()=>f.cV,putDynamicOfflineDataFor:()=>f.fR,queueSynchronizationItem:()=>f.X2,refetchCurrentUser:()=>r.VJ,registerExtension:()=>u.ix,registerExtensionSlot:()=>u.Qq,registerOfflinePatientHandler:()=>f.dt,removeDynamicOfflineData:()=>f.pO,removeDynamicOfflineDataFor:()=>f.ME,renderExtension:()=>u.H8,restBaseUrl:()=>r.YC,saveVisit:()=>r.bX,sessionEndpoint:()=>r.z$,setLeftNav:()=>h.VM,setSessionLocation:()=>r.jK,setupDynamicOfflineDataHandler:()=>f.Xc,setupOfflineSync:()=>f.Kb,showActionableNotification:()=>h.fu,showModal:()=>h.K4,showNotification:()=>h.c0,showToast:()=>h.CF,subscribeActionableNotificationShown:()=>l.V9,subscribeConnectivity:()=>l.BW,subscribeConnectivityChanged:()=>l.XS,subscribeNotificationShown:()=>l.NQ,subscribePrecacheStaticDependencies:()=>l.dY,subscribeTo:()=>d.se,subscribeToastShown:()=>l.id,syncAllDynamicOfflineData:()=>f.ps,syncDynamicOfflineData:()=>f.mF,syncOfflinePatientData:()=>f.MO,toLocationObject:()=>r.Lq,toVisitTypeObject:()=>r.VF,unsetLeftNav:()=>h.$d,updateVisit:()=>r.ym,useAssignedExtensionIds:()=>p.YV,useAssignedExtensions:()=>p.P3,useBodyScrollLock:()=>p.yn,useConfig:()=>p.ZR,useConnectedExtensions:()=>p.BL,useConnectivity:()=>p.Y9,useExtensionSlotMeta:()=>p.qd,useExtensionStore:()=>p.jf,useLayoutType:()=>p.mr,useLocations:()=>p.Z_,useOnClickOutside:()=>p.t$,usePagination:()=>p.h0,usePatient:()=>p.lm,useSession:()=>p.kP,useStore:()=>p.oR,useStoreWithActions:()=>p.xQ,useVisit:()=>p.JF,useVisitTypes:()=>p.NN,userHasAccess:()=>r.y9,validator:()=>s.sC,validators:()=>s.z2});var r=n(2601),o=n(789),i={};for(const e in o)["default","OpenmrsFetchError","VisitMode","VisitStatus","backendDependencies","clearCurrentUser","defaultVisitCustomRepresentation","fetchCurrentPatient","fhirBaseUrl","getCurrentUser","getLocations","getLoggedInUser","getSessionLocation","getSessionStore","getStartedVisit","getVisitTypes","getVisitsForPatient","makeUrl","openmrsFetch","openmrsObservableFetch","refetchCurrentUser","restBaseUrl","saveVisit","sessionEndpoint","setSessionLocation","toLocationObject","toVisitTypeObject","updateVisit","userHasAccess"].indexOf(e)<0&&(i[e]=()=>o[e]);n.d(t,i);var s=n(7521),a=n(3662),c=n(151);i={};for(const e in c)["default","OpenmrsFetchError","VisitMode","VisitStatus","backendDependencies","clearCurrentUser","defaultVisitCustomRepresentation","fetchCurrentPatient","fhirBaseUrl","getCurrentUser","getLocations","getLoggedInUser","getSessionLocation","getSessionStore","getStartedVisit","getVisitTypes","getVisitsForPatient","makeUrl","openmrsFetch","openmrsObservableFetch","refetchCurrentUser","restBaseUrl","saveVisit","sessionEndpoint","setSessionLocation","toLocationObject","toVisitTypeObject","updateVisit","userHasAccess","Type","defineConfigSchema","defineExtensionConfigSchema","getConfig","getConfigStore","inRange","interpolateString","interpolateUrl","isUrl","isUrlWithTemplateParameters","navigate","oneOf","provide","validator","validators","importDynamic"].indexOf(e)<0&&(i[e]=()=>c[e]);n.d(t,i);var u=n(9559),l=n(1954),f=n(7352),p=n(4011),d=n(1686),h=n(171),y=n(1990);i={};for(const e in y)["default","OpenmrsFetchError","VisitMode","VisitStatus","backendDependencies","clearCurrentUser","defaultVisitCustomRepresentation","fetchCurrentPatient","fhirBaseUrl","getCurrentUser","getLocations","getLoggedInUser","getSessionLocation","getSessionStore","getStartedVisit","getVisitTypes","getVisitsForPatient","makeUrl","openmrsFetch","openmrsObservableFetch","refetchCurrentUser","restBaseUrl","saveVisit","sessionEndpoint","setSessionLocation","toLocationObject","toVisitTypeObject","updateVisit","userHasAccess","Type","defineConfigSchema","defineExtensionConfigSchema","getConfig","getConfigStore","inRange","interpolateString","interpolateUrl","isUrl","isUrlWithTemplateParameters","navigate","oneOf","provide","validator","validators","importDynamic","attach","detach","detachAll","getAssignedExtensions","getConnectedExtensions","getExtensionNameFromId","getExtensionStore","registerExtension","registerExtensionSlot","renderExtension","subscribeActionableNotificationShown","subscribeConnectivity","subscribeConnectivityChanged","subscribeNotificationShown","subscribePrecacheStaticDependencies","subscribeToastShown","beginEditSynchronizationItem","canBeginEditSynchronizationItemsOfType","deleteSynchronizationItem","generateOfflineUuid","getCurrentOfflineMode","getDynamicOfflineDataEntries","getDynamicOfflineDataEntriesFor","getDynamicOfflineDataHandlers","getFullSynchronizationItems","getFullSynchronizationItemsFor","getOfflineDb","getOfflinePatientDataStore","getSynchronizationItem","getSynchronizationItems","isOfflineUuid","messageOmrsServiceWorker","offlineUuidPrefix","omrsOfflineCachingStrategyHttpHeaderName","omrsOfflineResponseBodyHttpHeaderName","omrsOfflineResponseStatusHttpHeaderName","putDynamicOfflineData","putDynamicOfflineDataFor","queueSynchronizationItem","registerOfflinePatientHandler","removeDynamicOfflineData","removeDynamicOfflineDataFor","setupDynamicOfflineDataHandler","setupOfflineSync","syncAllDynamicOfflineData","syncDynamicOfflineData","syncOfflinePatientData","ConfigurableLink","Extension","ExtensionSlot","UserHasAccess","createUseStore","getAsyncExtensionLifecycle","getAsyncLifecycle","getLifecycle","getSyncLifecycle","isDesktop","useAssignedExtensionIds","useAssignedExtensions","useBodyScrollLock","useConfig","useConnectedExtensions","useConnectivity","useExtensionSlotMeta","useExtensionStore","useLayoutType","useLocations","useOnClickOutside","usePagination","usePatient","useSession","useStore","useStoreWithActions","useVisit","useVisitTypes","createGlobalStore","getAppState","getGlobalStore","subscribeTo","ErrorState","LeftNavMenu","setLeftNav","showActionableNotification","showModal","showNotification","showToast","unsetLeftNav"].indexOf(e)<0&&(i[e]=()=>y[e]);n.d(t,i)},8758:()=>{System.register([],(function(e,t){return{execute:function(){e((()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{dispatchActionableNotificationShown:()=>d,dispatchConnectivityChanged:()=>r,dispatchNotificationShown:()=>p,dispatchPrecacheStaticDependencies:()=>a,subscribeActionableNotificationShown:()=>y,subscribeConnectivity:()=>i,subscribeConnectivityChanged:()=>o,subscribeNotificationShown:()=>h,subscribePrecacheStaticDependencies:()=>c,subscribeToastShown:()=>g});const n="openmrs:connectivity-changed";function r(e){window.dispatchEvent(new CustomEvent(n,{detail:{online:e}}))}function o(e){const t=t=>e(t.detail);return window.addEventListener(n,t),()=>window.removeEventListener(n,t)}function i(e){return e({online:navigator.onLine}),o(e)}const s="openmrs:precache-static-dependencies";function a(e={}){window.dispatchEvent(new CustomEvent(s,{detail:e}))}function c(e){const t=t=>e(t.detail);return window.addEventListener(s,t),()=>window.removeEventListener(s,t)}const u="openmrs:notification-shown",l="openmrs:actionable-notification-shown",f="openmrs:toast-shown";function p(e){window.dispatchEvent(new CustomEvent(u,{detail:e}))}function d(e){window.dispatchEvent(new CustomEvent(l,{detail:e}))}function h(e){const t=t=>e(t.detail);return window.addEventListener(u,t),()=>window.removeEventListener(u,t)}function y(e){const t=t=>e(t.detail);return window.addEventListener(l,t),()=>window.removeEventListener(l,t)}function g(e){const t=t=>e(t.detail);return window.addEventListener(f,t),()=>window.removeEventListener(f,t)}return t})())}}}))},1954:(e,t,n)=>{"use strict";n.d(t,{V9:()=>p,BW:()=>i,XS:()=>o,NQ:()=>f,dY:()=>a,id:()=>d});const r="openmrs:connectivity-changed";function o(e){const t=t=>e(t.detail);return window.addEventListener(r,t),()=>window.removeEventListener(r,t)}function i(e){return e({online:navigator.onLine}),o(e)}const s="openmrs:precache-static-dependencies";function a(e){const t=t=>e(t.detail);return window.addEventListener(s,t),()=>window.removeEventListener(s,t)}const c="openmrs:notification-shown",u="openmrs:actionable-notification-shown",l="openmrs:toast-shown";function f(e){const t=t=>e(t.detail);return window.addEventListener(c,t),()=>window.removeEventListener(c,t)}function p(e){const t=t=>e(t.detail);return window.addEventListener(u,t),()=>window.removeEventListener(u,t)}function d(e){const t=t=>e(t.detail);return window.addEventListener(l,t),()=>window.removeEventListener(l,t)}},8809:(e,t,n)=>{function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(t){r(e,t,n[t])}))}return e}function i(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}System.register(["@openmrs/esm-api","@openmrs/esm-state"],(function(e,t){var r={},s={};return{setters:[function(e){r.getLoggedInUser=e.getLoggedInUser},function(e){s.createGlobalStore=e.createGlobalStore}],execute:function(){e((()=>{"use strict";var e={766:e=>{e.exports=r},685:e=>{e.exports=s}},t={};function a(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,a),o.exports}a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var c={};return(()=>{a.r(c),a.d(c,{activateOfflineCapability:()=>N,beginEditSynchronizationItem:()=>uo,canBeginEditSynchronizationItemsOfType:()=>co,deleteSynchronizationItem:()=>fo,generateOfflineUuid:()=>So,getCurrentOfflineMode:()=>I,getDynamicOfflineDataEntries:()=>$o,getDynamicOfflineDataEntriesFor:()=>Ao,getDynamicOfflineDataHandlers:()=>ko,getFullSynchronizationItems:()=>oo,getFullSynchronizationItemsFor:()=>eo,getOfflineDb:()=>Dr,getOfflinePatientDataStore:()=>Zo,getOfflineSynchronizationStore:()=>zr,getOmrsServiceWorker:()=>b,getSynchronizationItem:()=>so,getSynchronizationItems:()=>no,getSynchronizationItemsFor:()=>Qr,isOfflineUuid:()=>xo,messageOmrsServiceWorker:()=>x,offlineUuidPrefix:()=>Oo,omrsOfflineCachingStrategyHttpHeaderName:()=>O,omrsOfflineResponseBodyHttpHeaderName:()=>v,omrsOfflineResponseStatusHttpHeaderName:()=>w,putDynamicOfflineData:()=>Do,putDynamicOfflineDataFor:()=>Ro,queueSynchronizationItem:()=>Yr,queueSynchronizationItemFor:()=>Gr,registerOfflinePatientHandler:()=>Yo,registerOmrsServiceWorker:()=>m,removeDynamicOfflineData:()=>Mo,removeDynamicOfflineDataFor:()=>Bo,runSynchronization:()=>Fr,setCurrentOfflineMode:()=>R,setupDynamicOfflineDataHandler:()=>Po,setupOfflineSync:()=>ho,syncAllDynamicOfflineData:()=>zo,syncDynamicOfflineData:()=>Ko,syncOfflinePatientData:()=>Xo});try{self["workbox:window:6.5.3"]&&_()}catch(e){}function e(e,t){return new Promise((function(n){var r=new MessageChannel;r.port1.onmessage=function(e){n(e.data)},e.postMessage(t,[r.port2])}))}function t(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 r(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)}try{self["workbox:core:6.5.3"]&&_()}catch(e){}var s=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t,e.reject=n}))};function u(e,t){var n=location.href;return new URL(e,n).href===new URL(t,n).href}var l=function(e,t){this.type=e,Object.assign(this,t)};function f(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function p(){}var d={type:"SKIP_WAITING"};function h(e,t){if(!t)return e&&e.then?e.then(p):Promise.resolve()}var y=function(t){var n,r;function o(e,n){var r,o;return void 0===n&&(n={}),(r=t.call(this)||this).nn={},r.tn=0,r.rn=new s,r.en=new s,r.on=new s,r.un=0,r.an=new Set,r.cn=function(){var e=r.fn,t=e.installing;r.tn>0||!u(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,s={sw:n,isExternal:i,originalEvent:e};!i&&r.mn&&(s.isUpdate=!0),r.dispatchEvent(new l(o,s)),"installed"===o?r.wn=self.setTimeout((function(){"installed"===o&&t.waiting===n&&r.dispatchEvent(new l("waiting",s))}),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 l("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 f(r.getSW(),(function(){r.an.has(o)&&r.dispatchEvent(new l("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 i,a=o.prototype;return a.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 h(new Promise((function(e){return window.addEventListener("load",e)})))}),(function(){return r.mn=Boolean(navigator.serviceWorker.controller),r.yn=r.pn(),f(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&&u(t.scriptURL,r.sn.toString())&&(r.hn=t,Promise.resolve().then((function(){r.dispatchEvent(new l("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)}},a.update=function(){try{return this.fn?h(this.fn.update()):void 0}catch(e){return Promise.reject(e)}},a.getSW=function(){return void 0!==this.hn?Promise.resolve(this.hn):this.rn.promise},a.messageSW=function(t){try{return f(this.getSW(),(function(n){return e(n,t)}))}catch(e){return Promise.reject(e)}},a.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&e(this.fn.waiting,d)},a.pn=function(){var e=navigator.serviceWorker.controller;return e&&u(e.scriptURL,this.sn.toString())?e:void 0},a.bn=function(){try{var e=this;return function(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}((function(){return f(navigator.serviceWorker.register(e.sn,e.nn),(function(t){return e.un=performance.now(),t}))}),(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),o}(function(){function e(){this.Pn=new Map}var 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}());let g;function m(e,t){if(void 0!==g)return console.warn(`The application's Service Worker has already been registered. The new service worker at ${e} will not be registered.`),g;if(!("serviceWorker"in navigator))throw new Error("Registering the Service Worker is not possible due to missing browser capabilities.");const n=new y(e,t);return g=n.register().then((()=>n.controlling.then((()=>n)))),g}function b(){return null!=g?g:Promise.resolve(void 0)}const v="x-omrs-offline-response-body",w="x-omrs-offline-response-status",O="x-omrs-offline-caching-strategy";function S(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function x(e){return E.apply(this,arguments)}function E(){return E=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){S(i,r,o,s,a,"next",e)}function a(e){S(i,r,o,s,a,"throw",e)}s(void 0)}))}}((function*(e){const t=yield b();return t?yield t.messageSW(e):{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."}})),E.apply(this,arguments)}function j(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function k(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){j(i,r,o,s,a,"next",e)}function a(e){j(i,r,o,s,a,"throw",e)}s(void 0)}))}}function P(){return P=k((function*(){const e=window.sessionStorage;try{e.setItem("someKeyHere","test"),e.removeItem("someKeyHere")}catch(t){if(t.code===DOMException.QUOTA_EXCEEDED_ERR&&0===e.length)return!0}return!1})),P.apply(this,arguments)}function $(){return($=k((function*(){return!window.indexedDB}))).apply(this,arguments)}function C(){return C=k((function*(){return new Promise((e=>{const t=indexedDB.open("test");t.onerror=()=>e(!0),t.onsuccess=()=>e(!1)}))})),C.apply(this,arguments)}function A(){return A=k((function*(){return(yield function(){return C.apply(this,arguments)}())||(yield function(){return $.apply(this,arguments)}())||(yield function(){return P.apply(this,arguments)}())})),A.apply(this,arguments)}const T="openmrs3:offline-mode";let D="unavailable";function I(){return{current:D,notAvailable:"unavailable"===D,active:"on"===D}}function R(e){"unavailable"!==D&&"unavailable"!==e&&(localStorage.setItem(T,"on"===e?"active":"disabled"),D=e)}function N(){return M.apply(this,arguments)}function M(){return M=k((function*(){const e=yield function(){return A.apply(this,arguments)}();e||(D="active"===localStorage.getItem(T)?"on":"off"),navigator.onLine})),M.apply(this,arguments)}const L="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,B=Object.keys,U=Array.isArray;function z(e,t){return"object"!=typeof t||B(t).forEach((function(n){e[n]=t[n]})),e}"undefined"==typeof Promise||L.Promise||(L.Promise=Promise);const F=Object.getPrototypeOf,K={}.hasOwnProperty;function V(e,t){return K.call(e,t)}function q(e,t){"function"==typeof t&&(t=t(F(e))),("undefined"==typeof Reflect?B:Reflect.ownKeys)(t).forEach((n=>{W(e,n,t[n])}))}const H=Object.defineProperty;function W(e,t,n,r){H(e,t,z(n&&V(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function G(e){return{from:function(t){return e.prototype=Object.create(t.prototype),W(e.prototype,"constructor",e),{extend:q.bind(null,e.prototype)}}}}const Z=Object.getOwnPropertyDescriptor;function Y(e,t){let n;return Z(e,t)||(n=F(e))&&Y(n,t)}const X=[].slice;function Q(e,t,n){return X.call(e,t,n)}function J(e,t){return t(e)}function ee(e){if(!e)throw new Error("Assertion Failed")}function te(e){L.setImmediate?setImmediate(e):setTimeout(e,0)}function ne(e,t){return e.reduce(((e,n,r)=>{var o=t(n,r);return o&&(e[o[0]]=o[1]),e}),{})}function re(e,t){if(V(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=re(e,t[r]);n.push(i)}return n}var s=t.indexOf(".");if(-1!==s){var a=e[t.substr(0,s)];return void 0===a?void 0:re(a,t.substr(s+1))}}function oe(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){ee("string"!=typeof n&&"length"in n);for(var r=0,o=t.length;r<o;++r)oe(e,t[r],n[r])}else{var i=t.indexOf(".");if(-1!==i){var s=t.substr(0,i),a=t.substr(i+1);if(""===a)void 0===n?U(e)&&!isNaN(parseInt(s))?e.splice(s,1):delete e[s]:e[s]=n;else{var c=e[s];c&&V(e,s)||(c=e[s]={}),oe(c,a,n)}}else void 0===n?U(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function ie(e){var t={};for(var n in e)V(e,n)&&(t[n]=e[n]);return t}const se=[].concat;function ae(e){return se.apply([],e)}const ce="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(ae([8,16,32,64].map((e=>["Int","Uint","Float"].map((t=>t+e+"Array")))))).filter((e=>L[e])),ue=ce.map((e=>L[e]));ne(ce,(e=>[e,!0]));let le=null;function fe(e){le="undefined"!=typeof WeakMap&&new WeakMap;const t=pe(e);return le=null,t}function pe(e){if(!e||"object"!=typeof e)return e;let t=le&&le.get(e);if(t)return t;if(U(e)){t=[],le&&le.set(e,t);for(var n=0,r=e.length;n<r;++n)t.push(pe(e[n]))}else if(ue.indexOf(e.constructor)>=0)t=e;else{const n=F(e);for(var o in t=n===Object.prototype?{}:Object.create(n),le&&le.set(e,t),e)V(e,o)&&(t[o]=pe(e[o]))}return t}const{toString:de}={};function he(e){return de.call(e).slice(8,-1)}const ye="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",ge="symbol"==typeof ye?function(e){var t;return null!=e&&(t=e[ye])&&t.apply(e)}:function(){return null},me={};function be(e){var t,n,r,o;if(1===arguments.length){if(U(e))return e.slice();if(this===me&&"string"==typeof e)return[e];if(o=ge(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}const ve="undefined"!=typeof Symbol?e=>"AsyncFunction"===e[Symbol.toStringTag]:()=>!1;var we="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Oe(e,t){we=e,Se=t}var Se=()=>!0;const xe=!new Error("").stack;function Ee(){if(xe)try{throw Ee.arguments,new Error}catch(e){return e}return new Error}function _e(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(Se).map((e=>"\n"+e)).join("")):""}var je=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],ke=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(je),Pe={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"};function $e(e,t){this._e=Ee(),this.name=e,this.message=t}function Ce(e,t){return e+". Errors: "+Object.keys(t).map((e=>t[e].toString())).filter(((e,t,n)=>n.indexOf(e)===t)).join("\n")}function Ae(e,t,n,r){this._e=Ee(),this.failures=t,this.failedKeys=r,this.successCount=n,this.message=Ce(e,t)}function Te(e,t){this._e=Ee(),this.name="BulkError",this.failures=Object.keys(t).map((e=>t[e])),this.failuresByPos=t,this.message=Ce(e,t)}G($e).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+_e(this._e,2))}},toString:function(){return this.name+": "+this.message}}),G(Ae).from($e),G(Te).from($e);var De=ke.reduce(((e,t)=>(e[t]=t+"Error",e)),{});const Ie=$e;var Re=ke.reduce(((e,t)=>{var n=t+"Error";function r(e,r){this._e=Ee(),this.name=n,e?"string"==typeof e?(this.message=`${e}${r?"\n "+r:""}`,this.inner=r||null):"object"==typeof e&&(this.message=`${e.name} ${e.message}`,this.inner=e):(this.message=Pe[t]||n,this.inner=null)}return G(r).from(Ie),e[t]=r,e}),{});Re.Syntax=SyntaxError,Re.Type=TypeError,Re.Range=RangeError;var Ne=je.reduce(((e,t)=>(e[t+"Error"]=Re[t],e)),{}),Me=ke.reduce(((e,t)=>(-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=Re[t]),e)),{});function Le(){}function Be(e){return e}function Ue(e,t){return null==e||e===Be?t:function(n){return t(e(n))}}function ze(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function Fe(e,t){return e===Le?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?ze(r,this.onsuccess):r),o&&(this.onerror=this.onerror?ze(o,this.onerror):o),void 0!==i?i:n}}function Ke(e,t){return e===Le?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?ze(n,this.onsuccess):n),r&&(this.onerror=this.onerror?ze(r,this.onerror):r)}}function Ve(e,t){return e===Le?t:function(n){var r=e.apply(this,arguments);z(n,r);var o=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var s=t.apply(this,arguments);return o&&(this.onsuccess=this.onsuccess?ze(o,this.onsuccess):o),i&&(this.onerror=this.onerror?ze(i,this.onerror):i),void 0===r?void 0===s?void 0:s:z(r,s)}}function qe(e,t){return e===Le?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function He(e,t){return e===Le?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)}}Me.ModifyError=Ae,Me.DexieError=$e,Me.BulkError=Te;var We={};const[Ge,Ze,Ye]="undefined"==typeof Promise?[]:(()=>{let e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,F(e),e];const t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,F(t),e]})(),Xe=Ze&&Ze.then,Qe=Ge&&Ge.constructor,Je=!!Ye;var et=!1,tt=Ye?()=>{Ye.then(Et)}:L.setImmediate?setImmediate.bind(null,Et):L.MutationObserver?()=>{var e=document.createElement("div");new MutationObserver((()=>{Et(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:()=>{setTimeout(Et,0)},nt=function(e,t){ft.push([e,t]),ot&&(tt(),ot=!1)},rt=!0,ot=!0,it=[],st=[],at=null,ct=Be,ut={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Gt,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((e=>{try{Gt(e[0],e[1])}catch(e){}}))}},lt=ut,ft=[],pt=0,dt=[];function ht(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=Le,this._lib=!1;var t=this._PSD=lt;if(we&&(this._stackHolder=Ee(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==We)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&bt(this,this._value))}this._state=null,this._value=null,++t.ref,mt(this,e)}const yt={get:function(){var e=lt,t=It;function n(n,r){var o=!e.global&&(e!==lt||t!==It);const i=o&&!Lt();var s=new ht(((t,s)=>{wt(this,new gt(Ht(n,e,o,i),Ht(r,e,o,i),t,s,e))}));return we&&xt(s,this),s}return n.prototype=We,n},set:function(e){W(this,"then",e&&e.prototype===We?yt:{get:function(){return e},set:yt.set})}};function gt(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}function mt(e,t){try{t((t=>{if(null===e._state){if(t===e)throw new TypeError("A promise cannot be resolved with itself.");var n=e._lib&&_t();t&&"function"==typeof t.then?mt(e,((e,n)=>{t instanceof ht?t._then(e,n):t.then(e,n)})):(e._state=!0,e._value=t,vt(e)),n&&jt()}}),bt.bind(null,e))}catch(t){bt(e,t)}}function bt(e,t){if(st.push(t),null===e._state){var n=e._lib&&_t();t=ct(t),e._state=!1,e._value=t,we&&null!==t&&"object"==typeof t&&!t._promise&&function(e,t,n){try{e.apply(null,void 0)}catch(e){}}((()=>{var n=Y(t,"stack");t._promise=e,W(t,"stack",{get:()=>et?n&&(n.get?n.get.apply(t):n.value):e.stack})})),function(e){it.some((t=>t._value===e._value))||it.push(e)}(e),vt(e),n&&jt()}}function vt(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)wt(e,t[n]);var o=e._PSD;--o.ref||o.finalize(),0===pt&&(++pt,nt((()=>{0==--pt&&kt()}),[]))}function wt(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,++pt,nt(Ot,[n,e,t])}else e._listeners.push(t)}function Ot(e,t,n){try{at=t;var r,o=t._value;t._state?r=e(o):(st.length&&(st=[]),r=e(o),-1===st.indexOf(o)&&function(e){for(var t=it.length;t;)if(it[--t]._value===e._value)return void it.splice(t,1)}(t)),n.resolve(r)}catch(e){n.reject(e)}finally{at=null,0==--pt&&kt(),--n.psd.ref||n.psd.finalize()}}function St(e,t,n){if(t.length===n)return t;var r="";if(!1===e._state){var o,i,s=e._value;null!=s?(o=s.name||"Error",i=s.message||s,r=_e(s,0)):(o=s,i=""),t.push(o+(i?": "+i:"")+r)}return we&&((r=_e(e._stackHolder,2))&&-1===t.indexOf(r)&&t.push(r),e._prev&&St(e._prev,t,n)),t}function xt(e,t){var n=t?t._numPrev+1:0;n<100&&(e._prev=t,e._numPrev=n)}function Et(){_t()&&jt()}function _t(){var e=rt;return rt=!1,ot=!1,e}function jt(){var e,t,n;do{for(;ft.length>0;)for(e=ft,ft=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}}while(ft.length>0);rt=!0,ot=!0}function kt(){var e=it;it=[],e.forEach((e=>{e._PSD.onunhandled.call(null,e._value,e)}));for(var t=dt.slice(0),n=t.length;n;)t[--n]()}function Pt(e){return new ht(We,!1,e)}function $t(e,t){var n=lt;return function(){var r=_t(),o=lt;try{return Ft(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{Ft(o,!1),r&&jt()}}}q(ht.prototype,{then:yt,_then:function(e,t){wt(this,new gt(null,null,e,t,lt))},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,(e=>e instanceof t?n(e):Pt(e))):this.then(null,(e=>e&&e.name===t?n(e):Pt(e)))},finally:function(e){return this.then((t=>(e(),t)),(t=>(e(),Pt(t))))},stack:{get:function(){if(this._stack)return this._stack;try{et=!0;var e=St(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{et=!1}}},timeout:function(e,t){return e<1/0?new ht(((n,r)=>{var o=setTimeout((()=>r(new Re.Timeout(t))),e);this.then(n,r).finally(clearTimeout.bind(null,o))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&W(ht.prototype,Symbol.toStringTag,"Dexie.Promise"),ut.env=Kt(),q(ht,{all:function(){var e=be.apply(null,arguments).map(Bt);return new ht((function(t,n){0===e.length&&t([]);var r=e.length;e.forEach(((o,i)=>ht.resolve(o).then((n=>{e[i]=n,--r||t(e)}),n)))}))},resolve:e=>{if(e instanceof ht)return e;if(e&&"function"==typeof e.then)return new ht(((t,n)=>{e.then(t,n)}));var t=new ht(We,!0,e);return xt(t,at),t},reject:Pt,race:function(){var e=be.apply(null,arguments).map(Bt);return new ht(((t,n)=>{e.map((e=>ht.resolve(e).then(t,n)))}))},PSD:{get:()=>lt,set:e=>lt=e},totalEchoes:{get:()=>It},newPSD:Nt,usePSD:Vt,scheduler:{get:()=>nt,set:e=>{nt=e}},rejectionMapper:{get:()=>ct,set:e=>{ct=e}},follow:(e,t)=>new ht(((n,r)=>Nt(((t,n)=>{var r=lt;r.unhandleds=[],r.onunhandled=n,r.finalize=ze((function(){!function(e){dt.push((function t(){e(),dt.splice(dt.indexOf(t),1)})),++pt,nt((()=>{0==--pt&&kt()}),[])}((()=>{0===this.unhandleds.length?t():n(this.unhandleds[0])}))}),r.finalize),e()}),t,n,r)))}),Qe&&(Qe.allSettled&&W(ht,"allSettled",(function(){const e=be.apply(null,arguments).map(Bt);return new ht((t=>{0===e.length&&t([]);let n=e.length;const r=new Array(n);e.forEach(((e,o)=>ht.resolve(e).then((e=>r[o]={status:"fulfilled",value:e}),(e=>r[o]={status:"rejected",reason:e})).then((()=>--n||t(r)))))}))})),Qe.any&&"undefined"!=typeof AggregateError&&W(ht,"any",(function(){const e=be.apply(null,arguments).map(Bt);return new ht(((t,n)=>{0===e.length&&n(new AggregateError([]));let r=e.length;const o=new Array(r);e.forEach(((e,i)=>ht.resolve(e).then((e=>t(e)),(e=>{o[i]=e,--r||n(new AggregateError(o))}))))}))})));const Ct={awaits:0,echoes:0,id:0};var At=0,Tt=[],Dt=0,It=0,Rt=0;function Nt(e,t,n,r){var o=lt,i=Object.create(o);i.parent=o,i.ref=0,i.global=!1,i.id=++Rt;var s=ut.env;i.env=Je?{Promise:ht,PromiseProp:{value:ht,configurable:!0,writable:!0},all:ht.all,race:ht.race,allSettled:ht.allSettled,any:ht.any,resolve:ht.resolve,reject:ht.reject,nthen:Wt(s.nthen,i),gthen:Wt(s.gthen,i)}:{},t&&z(i,t),++o.ref,i.finalize=function(){--this.parent.ref||this.parent.finalize()};var a=Vt(i,e,n,r);return 0===i.ref&&i.finalize(),a}function Mt(){return Ct.id||(Ct.id=++At),++Ct.awaits,Ct.echoes+=100,Ct.id}function Lt(){return!!Ct.awaits&&(0==--Ct.awaits&&(Ct.id=0),Ct.echoes=100*Ct.awaits,!0)}function Bt(e){return Ct.echoes&&e&&e.constructor===Qe?(Mt(),e.then((e=>(Lt(),e)),(e=>(Lt(),Zt(e))))):e}function Ut(e){++It,Ct.echoes&&0!=--Ct.echoes||(Ct.echoes=Ct.id=0),Tt.push(lt),Ft(e,!0)}function zt(){var e=Tt[Tt.length-1];Tt.pop(),Ft(e,!1)}function Ft(e,t){var n=lt;if((t?!Ct.echoes||Dt++&&e===lt:!Dt||--Dt&&e===lt)||qt(t?Ut.bind(null,e):zt),e!==lt&&(lt=e,n===ut&&(ut.env=Kt()),Je)){var r=ut.env.Promise,o=e.env;Ze.then=o.nthen,r.prototype.then=o.gthen,(n.global||e.global)&&(Object.defineProperty(L,"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))}}function Kt(){var e=L.Promise;return Je?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(L,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:Ze.then,gthen:e.prototype.then}:{}}function Vt(e,t,n,r,o){var i=lt;try{return Ft(e,!0),t(n,r,o)}finally{Ft(i,!1)}}function qt(e){Xe.call(Ge,e)}function Ht(e,t,n,r){return"function"!=typeof e?e:function(){var o=lt;n&&Mt(),Ft(t,!0);try{return e.apply(this,arguments)}finally{Ft(o,!1),r&&qt(Lt)}}}function Wt(e,t){return function(n,r){return e.call(this,Ht(n,t),Ht(r,t))}}function Gt(e,t){var n;try{n=t.onuncatched(e)}catch(e){}if(!1!==n)try{var r,o={promise:t,reason:e};if(L.document&&document.createEvent?((r=document.createEvent("Event")).initEvent("unhandledrejection",!0,!0),z(r,o)):L.CustomEvent&&z(r=new CustomEvent("unhandledrejection",{detail:o}),o),r&&L.dispatchEvent&&(dispatchEvent(r),!L.PromiseRejectionEvent&&L.onunhandledrejection))try{L.onunhandledrejection(r)}catch(e){}we&&r&&!r.defaultPrevented&&console.warn(`Unhandled rejection: ${e.stack||e}`)}catch(e){}}-1===(""+Xe).indexOf("[native code]")&&(Mt=Lt=Le);var Zt=ht.reject;function Yt(e,t,n,r){if(e.idbdb&&(e._state.openComplete||lt.letThrough||e._vip)){var o=e._createTransaction(t,n,e._dbSchema);try{o.create(),e._state.PR1398_maxLoop=3}catch(o){return o.name===De.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>Yt(e,t,n,r)))):Zt(o)}return o._promise(t,((e,t)=>Nt((()=>(lt.trans=o,r(e,t,o)))))).then((e=>o._completion.then((()=>e))))}if(e._state.openComplete)return Zt(new Re.DatabaseClosed(e._state.dbOpenError));if(!e._state.isBeingOpened){if(!e._options.autoOpen)return Zt(new Re.DatabaseClosed);e.open().catch(Le)}return e._state.dbReadyPromise.then((()=>Yt(e,t,n,r)))}const Xt=String.fromCharCode(65535),Qt="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Jt=[],en="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),tn=en,nn=en,rn=e=>!/(dexie\.js|dexie\.min\.js)/.test(e);function on(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}const sn={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function an(e){return"string"!=typeof e||/\./.test(e)?e=>e:t=>(void 0===t[e]&&e in t&&delete(t=fe(t))[e],t)}let cn=class{_trans(e,t,n){const r=this._tx||lt.trans,o=this.name;function i(e,n,r){if(!r.schema[o])throw new Re.NotFound("Table "+o+" not part of transaction");return t(r.idbtrans,r)}const s=_t();try{return r&&r.db===this.db?r===lt.trans?r._promise(e,i,n):Nt((()=>r._promise(e,i,n)),{trans:r,transless:lt.transless||lt}):Yt(this.db,e,[this.name],i)}finally{s&&jt()}}get(e,t){return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",(t=>this.core.get({trans:t,key:e}).then((e=>this.hook.reading.fire(e))))).then(t)}where(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(U(e))return new this.db.WhereClause(this,`[${e.join("+")}]`);const t=B(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);const n=this.schema.indexes.concat(this.schema.primKey).filter((e=>e.compound&&t.every((t=>e.keyPath.indexOf(t)>=0))&&e.keyPath.every((e=>t.indexOf(e)>=0))))[0];if(n&&this.db._maxKey!==Xt)return this.where(n.name).equals(n.keyPath.map((t=>e[t])));!n&&we&&console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit of a compound index [${t.join("+")}]`);const{idxByName:r}=this.schema,o=this.db._deps.indexedDB;function i(e,t){try{return 0===o.cmp(e,t)}catch(e){return!1}}const[s,a]=t.reduce((([t,n],o)=>{const s=r[o],a=e[o];return[t||s,t||!s?on(n,s&&s.multi?e=>{const t=re(e,o);return U(t)&&t.some((e=>i(a,e)))}:e=>i(a,re(e,o))):n]}),[null,null]);return s?this.where(s.name).equals(e[s.keyPath]).filter(a):n?this.filter(a):this.where(t).equals("")}filter(e){return this.toCollection().and(e)}count(e){return this.toCollection().count(e)}offset(e){return this.toCollection().offset(e)}limit(e){return this.toCollection().limit(e)}each(e){return this.toCollection().each(e)}toArray(e){return this.toCollection().toArray(e)}toCollection(){return new this.db.Collection(new this.db.WhereClause(this))}orderBy(e){return new this.db.Collection(new this.db.WhereClause(this,U(e)?`[${e.join("+")}]`:e))}reverse(){return this.toCollection().reverse()}mapToClass(e){this.schema.mappedClass=e;const t=t=>{if(!t)return t;const n=Object.create(e.prototype);for(var r in t)if(V(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}defineClass(){return this.mapToClass((function(e){z(this,e)}))}add(e,t){const{auto:n,keyPath:r}=this.schema.primKey;let o=e;return r&&n&&(o=an(r)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[o]}))).then((e=>e.numFailures?ht.reject(e.failures[0]):e.lastResult)).then((t=>{if(r)try{oe(e,r,t)}catch(e){}return t}))}update(e,t){if("object"!=typeof e||U(e))return this.where(":id").equals(e).modify(t);{const n=re(e,this.schema.primKey.keyPath);if(void 0===n)return Zt(new Re.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?B(t).forEach((n=>{oe(e,n,t[n])})):t(e,{value:e,primKey:n})}catch(e){}return this.where(":id").equals(n).modify(t)}}put(e,t){const{auto:n,keyPath:r}=this.schema.primKey;let o=e;return r&&n&&(o=an(r)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"put",values:[o],keys:null!=t?[t]:null}))).then((e=>e.numFailures?ht.reject(e.failures[0]):e.lastResult)).then((t=>{if(r)try{oe(e,r,t)}catch(e){}return t}))}delete(e){return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"delete",keys:[e]}))).then((e=>e.numFailures?ht.reject(e.failures[0]):void 0))}clear(){return this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"deleteRange",range:sn}))).then((e=>e.numFailures?ht.reject(e.failures[0]):void 0))}bulkGet(e){return this._trans("readonly",(t=>this.core.getMany({keys:e,trans:t}).then((e=>e.map((e=>this.hook.reading.fire(e)))))))}bulkAdd(e,t,n){const r=Array.isArray(t)?t:void 0,o=(n=n||(r?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(t=>{const{auto:n,keyPath:i}=this.schema.primKey;if(i&&r)throw new Re.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(r&&r.length!==e.length)throw new Re.InvalidArgument("Arguments objects and keys must have the same length");const s=e.length;let a=i&&n?e.map(an(i)):e;return this.core.mutate({trans:t,type:"add",keys:r,values:a,wantResults:o}).then((({numFailures:e,results:t,lastResult:n,failures:r})=>{if(0===e)return o?t:n;throw new Te(`${this.name}.bulkAdd(): ${e} of ${s} operations failed`,r)}))}))}bulkPut(e,t,n){const r=Array.isArray(t)?t:void 0,o=(n=n||(r?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(t=>{const{auto:n,keyPath:i}=this.schema.primKey;if(i&&r)throw new Re.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(r&&r.length!==e.length)throw new Re.InvalidArgument("Arguments objects and keys must have the same length");const s=e.length;let a=i&&n?e.map(an(i)):e;return this.core.mutate({trans:t,type:"put",keys:r,values:a,wantResults:o}).then((({numFailures:e,results:t,lastResult:n,failures:r})=>{if(0===e)return o?t:n;throw new Te(`${this.name}.bulkPut(): ${e} of ${s} operations failed`,r)}))}))}bulkDelete(e){const t=e.length;return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"delete",keys:e}))).then((({numFailures:e,lastResult:n,failures:r})=>{if(0===e)return n;throw new Te(`${this.name}.bulkDelete(): ${e} of ${t} operations failed`,r)}))}};function un(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){B(e).forEach((function(t){var n=e[t];if(U(n))i(t,e[t][0],e[t][1]);else{if("asap"!==n)throw new Re.InvalidArgument("Invalid event config");var r=i(t,Be,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];r.subscribers.forEach((function(e){te((function(){e.apply(null,t)}))}))}))}}))}(e);r||(r=qe),o||(o=Le);var s={subscribers:[],fire:o,subscribe:function(e){-1===s.subscribers.indexOf(e)&&(s.subscribers.push(e),s.fire=r(s.fire,e))},unsubscribe:function(e){s.subscribers=s.subscribers.filter((function(t){return t!==e})),s.fire=s.subscribers.reduce(r,o)}};return t[e]=n[e]=s,s}}function ln(e,t){return G(t).from({prototype:e}),t}function fn(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function pn(e,t){e.filter=on(e.filter,t)}function dn(e,t,n){var r=e.replayFilter;e.replayFilter=r?()=>on(r(),t()):t,e.justLimit=n&&!r}function hn(e,t){if(e.isPrimKey)return t.primaryKey;const n=t.getIndexByKeyPath(e.index);if(!n)throw new Re.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function yn(e,t,n){const r=hn(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:r,range:e.range}})}function gn(e,t,n,r){const o=e.replayFilter?on(e.filter,e.replayFilter()):e.filter;if(e.or){const i={},s=(e,n,r)=>{if(!o||o(n,r,(e=>n.stop(e)),(e=>n.fail(e)))){var s=n.primaryKey,a=""+s;"[object ArrayBuffer]"===a&&(a=""+new Uint8Array(s)),V(i,a)||(i[a]=!0,t(e,n,r))}};return Promise.all([e.or._iterate(s,n),mn(yn(e,r,n),e.algorithm,s,!e.keysOnly&&e.valueMapper)])}return mn(yn(e,r,n),on(e.algorithm,o),t,!e.keysOnly&&e.valueMapper)}function mn(e,t,n,r){var o=$t(r?(e,t,o)=>n(r(e),t,o):n);return e.then((e=>{if(e)return e.start((()=>{var n=()=>e.continue();t&&!t(e,(e=>n=e),(t=>{e.stop(t),n=Le}),(t=>{e.fail(t),n=Le}))||o(e.value,e,(e=>n=e)),n()}))}))}function bn(e,t){try{const n=vn(e),r=vn(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){const n=e.length,r=t.length,o=n<r?n:r;for(let n=0;n<o;++n)if(e[n]!==t[n])return e[n]<t[n]?-1:1;return n===r?0:n<r?-1:1}(wn(e),wn(t));case"Array":return function(e,t){const n=e.length,r=t.length,o=n<r?n:r;for(let n=0;n<o;++n){const r=bn(e[n],t[n]);if(0!==r)return r}return n===r?0:n<r?-1:1}(e,t)}}catch(e){}return NaN}function vn(e){const t=typeof e;if("object"!==t)return t;if(ArrayBuffer.isView(e))return"binary";const n=he(e);return"ArrayBuffer"===n?"binary":n}function wn(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}let On=class{_read(e,t){var n=this._ctx;return n.error?n.table._trans(null,Zt.bind(null,n.error)):n.table._trans("readonly",e).then(t)}_write(e){var t=this._ctx;return t.error?t.table._trans(null,Zt.bind(null,t.error)):t.table._trans("readwrite",e,"locked")}_addAlgorithm(e){var t=this._ctx;t.algorithm=on(t.algorithm,e)}_iterate(e,t){return gn(this._ctx,e,t,this._ctx.table.core)}clone(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&z(n,e),t._ctx=n,t}raw(){return this._ctx.valueMapper=null,this}each(e){var t=this._ctx;return this._read((n=>gn(t,e,n,t.table.core)))}count(e){return this._read((e=>{const t=this._ctx,n=t.table.core;if(fn(t,!0))return n.count({trans:e,query:{index:hn(t,n.schema),range:t.range}}).then((e=>Math.min(e,t.limit)));var r=0;return gn(t,(()=>(++r,!1)),e,n).then((()=>r))})).then(e)}sortBy(e,t){const n=e.split(".").reverse(),r=n[0],o=n.length-1;function i(e,t){return t?i(e[n[t]],t-1):e[r]}var s="next"===this._ctx.dir?1:-1;function a(e,t){var n=i(e,o),r=i(t,o);return n<r?-s:n>r?s:0}return this.toArray((function(e){return e.sort(a)})).then(t)}toArray(e){return this._read((e=>{var t=this._ctx;if("next"===t.dir&&fn(t,!0)&&t.limit>0){const{valueMapper:n}=t,r=hn(t,t.table.core.schema);return t.table.core.query({trans:e,limit:t.limit,values:!0,query:{index:r,range:t.range}}).then((({result:e})=>n?e.map(n):e))}{const n=[];return gn(t,(e=>n.push(e)),e,t.table.core).then((()=>n))}}),e)}offset(e){var t=this._ctx;return e<=0||(t.offset+=e,fn(t)?dn(t,(()=>{var t=e;return(e,n)=>0===t||(1===t?(--t,!1):(n((()=>{e.advance(t),t=0})),!1))})):dn(t,(()=>{var t=e;return()=>--t<0}))),this}limit(e){return this._ctx.limit=Math.min(this._ctx.limit,e),dn(this._ctx,(()=>{var t=e;return function(e,n,r){return--t<=0&&n(r),t>=0}}),!0),this}until(e,t){return pn(this._ctx,(function(n,r,o){return!e(n.value)||(r(o),t)})),this}first(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)}last(e){return this.reverse().first(e)}filter(e){var t,n;return pn(this._ctx,(function(t){return e(t.value)})),t=this._ctx,n=e,t.isMatch=on(t.isMatch,n),this}and(e){return this.filter(e)}or(e){return new this.db.WhereClause(this._ctx.table,e,this)}reverse(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this}desc(){return this.reverse()}eachKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.key,n)}))}eachUniqueKey(e){return this._ctx.unique="unique",this.eachKey(e)}eachPrimaryKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.primaryKey,n)}))}keys(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)}primaryKeys(e){var t=this._ctx;if("next"===t.dir&&fn(t,!0)&&t.limit>0)return this._read((e=>{var n=hn(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})})).then((({result:e})=>e)).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.primaryKey)})).then((function(){return n})).then(e)}uniqueKeys(e){return this._ctx.unique="unique",this.keys(e)}firstKey(e){return this.limit(1).keys((function(e){return e[0]})).then(e)}lastKey(e){return this.reverse().firstKey(e)}distinct(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var n={};return pn(this._ctx,(function(e){var t=e.primaryKey.toString(),r=V(n,t);return n[t]=!0,!r})),this}modify(e){var t=this._ctx;return this._write((n=>{var r;if("function"==typeof e)r=e;else{var o=B(e),i=o.length;r=function(t){for(var n=!1,r=0;r<i;++r){var s=o[r],a=e[s];re(t,s)!==a&&(oe(t,s,a),n=!0)}return n}}const s=t.table.core,{outbound:a,extractKey:c}=s.schema.primaryKey,u=this.db._options.modifyChunkSize||200,l=[];let f=0;const p=[],d=(e,t)=>{const{failures:n,numFailures:r}=t;f+=e-r;for(let e of B(n))l.push(n[e])};return this.clone().primaryKeys().then((o=>{const i=l=>{const f=Math.min(u,o.length-l);return s.getMany({trans:n,keys:o.slice(l,l+f),cache:"immutable"}).then((p=>{const h=[],y=[],g=a?[]:null,m=[];for(let e=0;e<f;++e){const t=p[e],n={value:fe(t),primKey:o[l+e]};!1!==r.call(n,n.value,n)&&(null==n.value?m.push(o[l+e]):a||0===bn(c(t),c(n.value))?(y.push(n.value),a&&g.push(o[l+e])):(m.push(o[l+e]),h.push(n.value)))}const b=fn(t)&&t.limit===1/0&&("function"!=typeof e||e===Sn)&&{index:t.index,range:t.range};return Promise.resolve(h.length>0&&s.mutate({trans:n,type:"add",values:h}).then((e=>{for(let t in e.failures)m.splice(parseInt(t),1);d(h.length,e)}))).then((()=>(y.length>0||b&&"object"==typeof e)&&s.mutate({trans:n,type:"put",keys:g,values:y,criteria:b,changeSpec:"function"!=typeof e&&e}).then((e=>d(y.length,e))))).then((()=>(m.length>0||b&&e===Sn)&&s.mutate({trans:n,type:"delete",keys:m,criteria:b}).then((e=>d(m.length,e))))).then((()=>o.length>l+f&&i(l+u)))}))};return i(0).then((()=>{if(l.length>0)throw new Ae("Error modifying one or more objects",l,f,p);return o.length}))}))}))}delete(){var e=this._ctx,t=e.range;return fn(e)&&(e.isPrimKey&&!nn||3===t.type)?this._write((n=>{const{primaryKey:r}=e.table.core.schema,o=t;return e.table.core.count({trans:n,query:{index:r,range:o}}).then((t=>e.table.core.mutate({trans:n,type:"deleteRange",range:o}).then((({failures:e,lastResult:n,results:r,numFailures:o})=>{if(o)throw new Ae("Could not delete some values",Object.keys(e).map((t=>e[t])),t-o);return t-o}))))})):this.modify(Sn)}};const Sn=(e,t)=>t.value=null;function xn(e,t){return e<t?-1:e===t?0:1}function En(e,t){return e>t?-1:e===t?0:1}function _n(e,t,n){var r=e instanceof An?new e.Collection(e):e;return r._ctx.error=n?new n(t):new TypeError(t),r}function jn(e){return new e.Collection(e,(()=>Cn(""))).limit(0)}function kn(e,t,n,r,o,i){for(var s=Math.min(e.length,r.length),a=-1,c=0;c<s;++c){var u=t[c];if(u!==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):a>=0?e.substr(0,a)+t[a]+n.substr(a+1):null;o(e[c],u)<0&&(a=c)}return s<r.length&&"next"===i?e+n.substr(e.length):s<e.length&&"prev"===i?e.substr(0,n.length):a<0?null:e.substr(0,a)+r[a]+n.substr(a+1)}function Pn(e,t,n,r){var o,i,s,a,c,u,l,f=n.length;if(!n.every((e=>"string"==typeof e)))return _n(e,"String expected.");function p(e){o=function(e){return"next"===e?e=>e.toUpperCase():e=>e.toLowerCase()}(e),i=function(e){return"next"===e?e=>e.toLowerCase():e=>e.toUpperCase()}(e),s="next"===e?xn:En;var t=n.map((function(e){return{lower:i(e),upper:o(e)}})).sort((function(e,t){return s(e.lower,t.lower)}));a=t.map((function(e){return e.upper})),c=t.map((function(e){return e.lower})),u=e,l="next"===e?"":r}p("next");var d=new e.Collection(e,(()=>$n(a[0],c[f-1]+r)));d._ondirectionchange=function(e){p(e)};var h=0;return d._addAlgorithm((function(e,n,r){var o=e.key;if("string"!=typeof o)return!1;var p=i(o);if(t(p,c,h))return!0;for(var d=null,y=h;y<f;++y){var g=kn(o,p,a[y],c[y],s,u);null===g&&null===d?h=y+1:(null===d||s(d,g)>0)&&(d=g)}return n(null!==d?function(){e.continue(d+l)}:r),!1})),d}function $n(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function Cn(e){return{type:1,lower:e,upper:e}}let An=class{get Collection(){return this._ctx.table.db.Collection}between(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)?jn(this):new this.Collection(this,(()=>$n(e,t,!n,!r)))}catch(e){return _n(this,Qt)}}equals(e){return null==e?_n(this,Qt):new this.Collection(this,(()=>Cn(e)))}above(e){return null==e?_n(this,Qt):new this.Collection(this,(()=>$n(e,void 0,!0)))}aboveOrEqual(e){return null==e?_n(this,Qt):new this.Collection(this,(()=>$n(e,void 0,!1)))}below(e){return null==e?_n(this,Qt):new this.Collection(this,(()=>$n(void 0,e,!1,!0)))}belowOrEqual(e){return null==e?_n(this,Qt):new this.Collection(this,(()=>$n(void 0,e)))}startsWith(e){return"string"!=typeof e?_n(this,"String expected."):this.between(e,e+Xt,!0,!0)}startsWithIgnoreCase(e){return""===e?this.startsWith(e):Pn(this,((e,t)=>0===e.indexOf(t[0])),[e],Xt)}equalsIgnoreCase(e){return Pn(this,((e,t)=>e===t[0]),[e],"")}anyOfIgnoreCase(){var e=be.apply(me,arguments);return 0===e.length?jn(this):Pn(this,((e,t)=>-1!==t.indexOf(e)),e,"")}startsWithAnyOfIgnoreCase(){var e=be.apply(me,arguments);return 0===e.length?jn(this):Pn(this,((e,t)=>t.some((t=>0===e.indexOf(t)))),e,Xt)}anyOf(){const e=be.apply(me,arguments);let t=this._cmp;try{e.sort(t)}catch(e){return _n(this,Qt)}if(0===e.length)return jn(this);const n=new this.Collection(this,(()=>$n(e[0],e[e.length-1])));n._ondirectionchange=n=>{t="next"===n?this._ascending:this._descending,e.sort(t)};let r=0;return n._addAlgorithm(((n,o,i)=>{const s=n.key;for(;t(s,e[r])>0;)if(++r,r===e.length)return o(i),!1;return 0===t(s,e[r])||(o((()=>{n.continue(e[r])})),!1)})),n}notEqual(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){const e=be.apply(me,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return _n(this,Qt)}const t=e.reduce(((e,t)=>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})}inAnyRange(e,t){const n=this._cmp,r=this._ascending,o=this._descending,i=this._min,s=this._max;if(0===e.length)return jn(this);if(!e.every((e=>void 0!==e[0]&&void 0!==e[1]&&r(e[0],e[1])<=0)))return _n(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Re.InvalidArgument);const a=!t||!1!==t.includeLowers,c=t&&!0===t.includeUppers;let u,l=r;function f(e,t){return l(e[0],t[0])}try{u=e.reduce((function(e,t){let r=0,o=e.length;for(;r<o;++r){const o=e[r];if(n(t[0],o[1])<0&&n(t[1],o[0])>0){o[0]=i(o[0],t[0]),o[1]=s(o[1],t[1]);break}}return r===o&&e.push(t),e}),[]),u.sort(f)}catch(e){return _n(this,Qt)}let p=0;const d=c?e=>r(e,u[p][1])>0:e=>r(e,u[p][1])>=0,h=a?e=>o(e,u[p][0])>0:e=>o(e,u[p][0])>=0;let y=d;const g=new this.Collection(this,(()=>$n(u[0][0],u[u.length-1][1],!a,!c)));return g._ondirectionchange=e=>{"next"===e?(y=d,l=r):(y=h,l=o),u.sort(f)},g._addAlgorithm(((e,t,n)=>{for(var o=e.key;y(o);)if(++p,p===u.length)return t(n),!1;return!!function(e){return!d(e)&&!h(e)}(o)||(0===this._cmp(o,u[p][1])||0===this._cmp(o,u[p][0])||t((()=>{l===r?e.continue(u[p][0]):e.continue(u[p][1])})),!1)})),g}startsWithAnyOf(){const e=be.apply(me,arguments);return e.every((e=>"string"==typeof e))?0===e.length?jn(this):this.inAnyRange(e.map((e=>[e,e+Xt]))):_n(this,"startsWithAnyOf() only works with strings")}};function Tn(e){return $t((function(t){return Dn(t),e(t.target.error),!1}))}function Dn(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}const In=un(null,"storagemutated");let Rn=class{_lock(){return ee(!lt.global),++this._reculock,1!==this._reculock||lt.global||(lt.lockOwnerFor=this),this}_unlock(){if(ee(!lt.global),0==--this._reculock)for(lt.global||(lt.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{Vt(e[1],e[0])}catch(e){}}return this}_locked(){return this._reculock&&lt.lockOwnerFor!==this}create(e){if(!this.mode)return this;const t=this.db.idbdb,n=this.db._state.dbOpenError;if(ee(!this.idbtrans),!e&&!t)switch(n&&n.name){case"DatabaseClosedError":throw new Re.DatabaseClosed(n);case"MissingAPIError":throw new Re.MissingAPI(n.message,n);default:throw new Re.OpenFailed(n)}if(!this.active)throw new Re.TransactionInactive;return ee(null===this._completion._state),(e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):t.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=$t((t=>{Dn(t),this._reject(e.error)})),e.onabort=$t((t=>{Dn(t),this.active&&this._reject(new Re.Abort(e.error)),this.active=!1,this.on("abort").fire(t)})),e.oncomplete=$t((()=>{this.active=!1,this._resolve(),"mutatedParts"in e&&In.storagemutated.fire(e.mutatedParts)})),this}_promise(e,t,n){if("readwrite"===e&&"readwrite"!==this.mode)return Zt(new Re.ReadOnly("Transaction is readonly"));if(!this.active)return Zt(new Re.TransactionInactive);if(this._locked())return new ht(((r,o)=>{this._blockedFuncs.push([()=>{this._promise(e,t,n).then(r,o)},lt])}));if(n)return Nt((()=>{var e=new ht(((e,n)=>{this._lock();const r=t(e,n,this);r&&r.then&&r.then(e,n)}));return e.finally((()=>this._unlock())),e._lib=!0,e}));var r=new ht(((e,n)=>{var r=t(e,n,this);r&&r.then&&r.then(e,n)}));return r._lib=!0,r}_root(){return this.parent?this.parent._root():this}waitFor(e){var t=this._root();const n=ht.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then((()=>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 ht(((e,r)=>{n.then((n=>t._waitingQueue.push($t(e.bind(null,n)))),(e=>t._waitingQueue.push($t(r.bind(null,e))))).finally((()=>{t._waitingFor===o&&(t._waitingFor=null)}))}))}abort(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Re.Abort))}table(e){const t=this._memoizedTables||(this._memoizedTables={});if(V(t,e))return t[e];const n=this.schema[e];if(!n)throw new Re.NotFound("Table "+e+" not part of transaction");const r=new this.db.Table(e,n,this);return r.core=this.db.core.table(e),t[e]=r,r}};function Nn(e,t,n,r,o,i,s){return{name:e,keyPath:t,unique:n,multi:r,auto:o,compound:i,src:(n&&!s?"&":"")+(r?"*":"")+(o?"++":"")+Mn(t)}}function Mn(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function Ln(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:ne(n,(e=>[e.name,e]))}}let Bn=e=>{try{return e.only([[]]),Bn=()=>[[]],[[]]}catch(e){return Bn=()=>Xt,Xt}};function Un(e){return null==e?()=>{}:"string"==typeof e?function(e){return 1===e.split(".").length?t=>t[e]:t=>re(t,e)}(e):t=>re(t,e)}function zn(e){return[].slice.call(e)}let Fn=0;function Kn(e){return null==e?":id":"string"==typeof e?e:`[${e.join("+")}]`}function Vn({_novip:e},t){const n=t.db,r=function(e,t,{IDBKeyRange:n,indexedDB:r},i){const s=function(e,t){return t.reduce(((e,{create:t})=>o({},e,t(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");const{lower:n,upper:r,lowerOpen:o,upperOpen:i}=e;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)}const{schema:o,hasGetAll:i}=function(e,t){const n=zn(e.objectStoreNames);return{schema:{name:e.name,tables:n.map((e=>t.objectStore(e))).map((e=>{const{keyPath:t,autoIncrement:n}=e,r=U(t),o=null==t,i={},s={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:o,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:Un(t)},indexes:zn(e.indexNames).map((t=>e.index(t))).map((e=>{const{name:t,unique:n,multiEntry:r,keyPath:o}=e,s={name:t,compound:U(o),keyPath:o,unique:n,multiEntry:r,extractKey:Un(o)};return i[Kn(o)]=s,s})),getIndexByKeyPath:e=>i[Kn(e)]};return i[":id"]=s.primaryKey,null!=t&&(i[Kn(t)]=s.primaryKey),s}))},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),s=o.tables.map((e=>function(e){const t=e.name;return{name:t,schema:e,mutate:function({trans:e,type:n,keys:o,values:i,range:s}){return new Promise(((a,c)=>{a=$t(a);const u=e.objectStore(t),l=null==u.keyPath,f="put"===n||"add"===n;if(!f&&"delete"!==n&&"deleteRange"!==n)throw new Error("Invalid operation type: "+n);const{length:p}=o||i||{length:1};if(o&&i&&o.length!==i.length)throw new Error("Given keys array must have same length as given values array.");if(0===p)return a({numFailures:0,failures:{},results:[],lastResult:void 0});let d;const h=[],y=[];let g=0;const m=e=>{++g,Dn(e)};if("deleteRange"===n){if(4===s.type)return a({numFailures:g,failures:y,results:[],lastResult:void 0});3===s.type?h.push(d=u.clear()):h.push(d=u.delete(r(s)))}else{const[e,t]=f?l?[i,o]:[i,null]:[o,null];if(f)for(let r=0;r<p;++r)h.push(d=t&&void 0!==t[r]?u[n](e[r],t[r]):u[n](e[r])),d.onerror=m;else for(let t=0;t<p;++t)h.push(d=u[n](e[t])),d.onerror=m}const b=e=>{const t=e.target.result;h.forEach(((e,t)=>null!=e.error&&(y[t]=e.error))),a({numFailures:g,failures:y,results:"delete"===n?o:h.map((e=>e.result)),lastResult:t})};d.onerror=e=>{m(e),b(e)},d.onsuccess=b}))},getMany:({trans:e,keys:n})=>new Promise(((r,o)=>{r=$t(r);const i=e.objectStore(t),s=n.length,a=new Array(s);let c,u=0,l=0;const f=e=>{const t=e.target;a[t._pos]=t.result,++l===u&&r(a)},p=Tn(o);for(let e=0;e<s;++e)null!=n[e]&&(c=i.get(n[e]),c._pos=e,c.onsuccess=f,c.onerror=p,++u);0===u&&r(a)})),get:({trans:e,key:n})=>new Promise(((r,o)=>{r=$t(r);const i=e.objectStore(t).get(n);i.onsuccess=e=>r(e.target.result),i.onerror=Tn(o)})),query:function(e){return n=>new Promise(((o,i)=>{o=$t(o);const{trans:s,values:a,limit:c,query:u}=n,l=c===1/0?void 0:c,{index:f,range:p}=u,d=s.objectStore(t),h=f.isPrimaryKey?d:d.index(f.name),y=r(p);if(0===c)return o({result:[]});if(e){const e=a?h.getAll(y,l):h.getAllKeys(y,l);e.onsuccess=e=>o({result:e.target.result}),e.onerror=Tn(i)}else{let e=0;const t=a||!("openKeyCursor"in h)?h.openCursor(y):h.openKeyCursor(y),n=[];t.onsuccess=r=>{const i=t.result;return i?(n.push(a?i.value:i.primaryKey),++e===c?o({result:n}):void i.continue()):o({result:n})},t.onerror=Tn(i)}}))}(i),openCursor:function({trans:e,values:n,query:o,reverse:i,unique:s}){return new Promise(((a,c)=>{a=$t(a);const{index:u,range:l}=o,f=e.objectStore(t),p=u.isPrimaryKey?f:f.index(u.name),d=i?s?"prevunique":"prev":s?"nextunique":"next",h=n||!("openKeyCursor"in p)?p.openCursor(r(l),d):p.openKeyCursor(r(l),d);h.onerror=Tn(c),h.onsuccess=$t((t=>{const n=h.result;if(!n)return void a(null);n.___id=++Fn,n.done=!1;const r=n.continue.bind(n);let o=n.continuePrimaryKey;o&&(o=o.bind(n));const i=n.advance.bind(n),s=()=>{throw new Error("Cursor not stopped")};n.trans=e,n.stop=n.continue=n.continuePrimaryKey=n.advance=()=>{throw new Error("Cursor not started")},n.fail=$t(c),n.next=function(){let e=1;return this.start((()=>e--?this.continue():this.stop())).then((()=>this))},n.start=e=>{const t=new Promise(((e,t)=>{e=$t(e),h.onerror=Tn(t),n.fail=t,n.stop=t=>{n.stop=n.continue=n.continuePrimaryKey=n.advance=s,e(t)}})),a=()=>{if(h.result)try{e()}catch(e){n.fail(e)}else n.done=!0,n.start=()=>{throw new Error("Cursor behind last entry")},n.stop()};return h.onsuccess=$t((e=>{h.onsuccess=a,a()})),n.continue=r,n.continuePrimaryKey=o,n.advance=i,a(),t},a(n)}),c)}))},count({query:e,trans:n}){const{index:o,range:i}=e;return new Promise(((e,s)=>{const a=n.objectStore(t),c=o.isPrimaryKey?a:a.index(o.name),u=r(i),l=u?c.count(u):c.count();l.onsuccess=$t((t=>e(t.target.result))),l.onerror=Tn(s)}))}}}(e))),a={};return s.forEach((e=>a[e.name]=e)),{stack:"dbcore",transaction:e.transaction.bind(e),table(e){if(!a[e])throw new Error(`Table '${e}' not found`);return a[e]},MIN_KEY:-1/0,MAX_KEY:Bn(t),schema:o}}(t,n,i),e.dbcore);return{dbcore:s}}(e._middlewares,n,e._deps,t);e.core=r.dbcore,e.tables.forEach((t=>{const n=t.name;e.core.schema.tables.some((e=>e.name===n))&&(t.core=e.core.table(n),e[n]instanceof e.Table&&(e[n].core=t.core))}))}function qn({_novip:e},t,n,r){n.forEach((n=>{const o=r[n];t.forEach((t=>{const r=Y(t,n);(!r||"value"in r&&void 0===r.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?W(t,n,{get(){return this.table(n)},set(e){H(this,n,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[n]=new e.Table(n,o))}))}))}function Hn({_novip:e},t){t.forEach((t=>{for(let n in t)t[n]instanceof e.Table&&delete t[n]}))}function Wn(e,t){return e._cfg.version-t._cfg.version}function Gn(e,t){const n={del:[],add:[],change:[]};let r;for(r in e)t[r]||n.del.push(r);for(r in t){const o=e[r],i=t[r];if(o){const e={name:r,def:i,recreate:!1,del:[],add:[],change:[]};if(""+(o.primKey.keyPath||"")!=""+(i.primKey.keyPath||"")||o.primKey.auto!==i.primKey.auto&&!en)e.recreate=!0,n.change.push(e);else{const t=o.idxByName,r=i.idxByName;let s;for(s in t)r[s]||e.del.push(s);for(s in r){const n=t[s],o=r[s];n?n.src!==o.src&&e.change.push(o):e.add.push(o)}(e.del.length>0||e.add.length>0||e.change.length>0)&&n.change.push(e)}}else n.add.push([r,i])}return n}function Zn(e,t,n,r){const o=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach((e=>Yn(o,e))),o}function Yn(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function Xn(e,t,n){const r={};return Q(t.objectStoreNames,0).forEach((e=>{const t=n.objectStore(e);let o=t.keyPath;const i=Nn(Mn(o),o||"",!1,!1,!!t.autoIncrement,o&&"string"!=typeof o,!0),s=[];for(let e=0;e<t.indexNames.length;++e){const n=t.index(t.indexNames[e]);o=n.keyPath;var a=Nn(n.name,o,!!n.unique,!!n.multiEntry,!1,o&&"string"!=typeof o,!1);s.push(a)}r[e]=Ln(e,i,s)})),r}function Qn({_novip:e},t,n){const r=n.db.objectStoreNames;for(let o=0;o<r.length;++o){const i=r[o],s=n.objectStore(i);e._hasGetAll="getAll"in s;for(let e=0;e<s.indexNames.length;++e){const n=s.indexNames[e],r=s.index(n).keyPath,o="string"==typeof r?r:"["+Q(r).join("+")+"]";if(t[i]){const e=t[i].idxByName[o];e&&(e.name=n,delete t[i].idxByName[o],t[i].idxByName[n]=e)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&L.WorkerGlobalScope&&L instanceof L.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}let Jn=class{_parseStoresSpec(e,t){B(e).forEach((n=>{if(null!==e[n]){var r=e[n].split(",").map(((e,t)=>{const n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return Nn(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),U(r),0===t)})),o=r.shift();if(o.multi)throw new Re.Schema("Primary key cannot be multi-valued");r.forEach((e=>{if(e.auto)throw new Re.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new Re.Schema("Index must have a name and cannot be an empty string")})),t[n]=Ln(n,o,r)}}))}stores(e){const t=this.db;this._cfg.storesSource=this._cfg.storesSource?z(this._cfg.storesSource,e):e;const n=t._versions,r={};let o={};return n.forEach((e=>{z(r,e._cfg.storesSource),o=e._cfg.dbschema={},e._parseStoresSpec(r,o)})),t._dbSchema=o,Hn(t,[t._allTables,t,t.Transaction.prototype]),qn(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],B(o),o),t._storeNames=B(o),this}upgrade(e){return this._cfg.contentUpgrade=He(this._cfg.contentUpgrade||Le,e),this}};function er(e,t){let n=e._dbNamesDB;return n||(n=e._dbNamesDB=new Or("__dbnames",{addons:[],indexedDB:e,IDBKeyRange:t}),n.version(1).stores({dbnames:"name"})),n.table("dbnames")}function tr(e){return e&&"function"==typeof e.databases}function nr(e){return Nt((function(){return lt.letThrough=!0,e()}))}function rr(){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()}function or(e){var t=t=>e.next(t),n=o(t),r=o((t=>e.throw(t)));function o(e){return t=>{var o=e(t),i=o.value;return o.done?i:i&&"function"==typeof i.then?i.then(n,r):U(i)?Promise.all(i).then(n,r):n(i)}}return o(t)()}function ir(e,t,n){var r=arguments.length;if(r<2)throw new Re.InvalidArgument("Too few arguments");for(var o=new Array(r-1);--r;)o[r-1]=arguments[r];return n=o.pop(),[e,ae(o),n]}function sr(e,t,n,r,o){return ht.resolve().then((()=>{const i=lt.transless||lt,s=e._createTransaction(t,n,e._dbSchema,r),a={trans:s,transless:i};if(r)s.idbtrans=r.idbtrans;else try{s.create(),e._state.PR1398_maxLoop=3}catch(r){return r.name===De.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>sr(e,t,n,null,o)))):Zt(r)}const c=ve(o);let u;c&&Mt();const l=ht.follow((()=>{if(u=o.call(s,s),u)if(c){var e=Lt.bind(null,null);u.then(e,e)}else"function"==typeof u.next&&"function"==typeof u.throw&&(u=or(u))}),a);return(u&&"function"==typeof u.then?ht.resolve(u).then((e=>s.active?e:Zt(new Re.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn")))):l.then((()=>u))).then((e=>(r&&s._resolve(),s._completion.then((()=>e))))).catch((e=>(s._reject(e),Zt(e))))}))}function ar(e,t,n){const r=U(e)?e.slice():[e];for(let e=0;e<n;++e)r.push(t);return r}const cr={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return i(o({},e),{table(t){const n=e.table(t),{schema:r}=n,s={},a=[];function c(e,t,n){const r=Kn(e),u=s[r]=s[r]||[],l=null==e?0:"string"==typeof e?1:e.length,f=t>0,p=i(o({},n),{isVirtual:f,keyTail:t,keyLength:l,extractKey:Un(e),unique:!f&&n.unique});return u.push(p),p.isPrimaryKey||a.push(p),l>1&&c(2===l?e[0]:e.slice(0,l-1),t+1,n),u.sort(((e,t)=>e.keyTail-t.keyTail)),p}const u=c(r.primaryKey.keyPath,0,r.primaryKey);s[":id"]=[u];for(const e of r.indexes)c(e.keyPath,0,e);function l(t){const n=t.query.index;return n.isVirtual?i(o({},t),{query:{index:n,range:(r=t.query.range,s=n.keyTail,{type:1===r.type?2:r.type,lower:ar(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,s),lowerOpen:!0,upper:ar(r.upper,r.upperOpen?e.MIN_KEY:e.MAX_KEY,s),upperOpen:!0})}}):t;var r,s}const f=i(o({},n),{schema:i(o({},r),{primaryKey:u,indexes:a,getIndexByKeyPath:function(e){const t=s[Kn(e)];return t&&t[0]}}),count:e=>n.count(l(e)),query:e=>n.query(l(e)),openCursor(t){const{keyTail:r,isVirtual:o,keyLength:i}=t.query.index;return o?n.openCursor(l(t)).then((n=>n&&function(n){const o=Object.create(n,{continue:{value:function(o){null!=o?n.continue(ar(o,t.reverse?e.MAX_KEY:e.MIN_KEY,r)):t.unique?n.continue(n.key.slice(0,i).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,r)):n.continue()}},continuePrimaryKey:{value(t,o){n.continuePrimaryKey(ar(t,e.MAX_KEY,r),o)}},primaryKey:{get:()=>n.primaryKey},key:{get(){const e=n.key;return 1===i?e[0]:e.slice(0,i)}},value:{get:()=>n.value}});return o}(n))):n.openCursor(t)}});return f}})}};function ur(e,t,n,r){return n=n||{},r=r||"",B(e).forEach((o=>{if(V(t,o)){var i=e[o],s=t[o];if("object"==typeof i&&"object"==typeof s&&i&&s){const e=he(i);e!==he(s)?n[r+o]=t[o]:"Object"===e?ur(i,s,n,r+o+"."):i!==s&&(n[r+o]=t[o])}else i!==s&&(n[r+o]=t[o])}else n[r+o]=void 0})),B(t).forEach((o=>{V(e,o)||(n[r+o]=t[o])})),n}const lr={stack:"dbcore",name:"HooksMiddleware",level:2,create:e=>i(o({},e),{table(t){const n=e.table(t),{primaryKey:r}=n.schema,s=i(o({},n),{mutate(e){const s=lt.trans,{deleting:a,creating:c,updating:u}=s.table(t).hook;switch(e.type){case"add":if(c.fire===Le)break;return s._promise("readwrite",(()=>l(e)),!0);case"put":if(c.fire===Le&&u.fire===Le)break;return s._promise("readwrite",(()=>l(e)),!0);case"delete":if(a.fire===Le)break;return s._promise("readwrite",(()=>l(e)),!0);case"deleteRange":if(a.fire===Le)break;return s._promise("readwrite",(()=>function(e){return f(e.trans,e.range,1e4)}(e)),!0)}return n.mutate(e);function l(e){const t=lt.trans,s=e.keys||function(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}(r,e);if(!s)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?i(o({},e),{keys:s}):o({},e)).type&&(e.values=[...e.values]),e.keys&&(e.keys=[...e.keys]),function(e,t,n){return"add"===t.type?Promise.resolve([]):e.getMany({trans:t.trans,keys:n,cache:"immutable"})}(n,e,s).then((o=>{const i=s.map(((n,i)=>{const s=o[i],l={onerror:null,onsuccess:null};if("delete"===e.type)a.fire.call(l,n,s,t);else if("add"===e.type||void 0===s){const o=c.fire.call(l,n,e.values[i],t);null==n&&null!=o&&(n=o,e.keys[i]=n,r.outbound||oe(e.values[i],r.keyPath,n))}else{const r=ur(s,e.values[i]),o=u.fire.call(l,r,n,s,t);if(o){const t=e.values[i];Object.keys(o).forEach((e=>{V(t,e)?t[e]=o[e]:oe(t,e,o[e])}))}}return l}));return n.mutate(e).then((({failures:t,results:n,numFailures:r,lastResult:a})=>{for(let r=0;r<s.length;++r){const a=n?n[r]:s[r],c=i[r];null==a?c.onerror&&c.onerror(t[r]):c.onsuccess&&c.onsuccess("put"===e.type&&o[r]?e.values[r]:a)}return{failures:t,results:n,numFailures:r,lastResult:a}})).catch((e=>(i.forEach((t=>t.onerror&&t.onerror(e))),Promise.reject(e))))}))}function f(e,t,s){return n.query({trans:e,values:!1,query:{index:r,range:t},limit:s}).then((({result:n})=>l({type:"delete",keys:n,trans:e}).then((r=>r.numFailures>0?Promise.reject(r.failures[0]):n.length<s?{failures:[],numFailures:0,lastResult:void 0}:f(e,i(o({},t),{lower:n[n.length-1],lowerOpen:!0}),s)))))}}});return s}})};function fr(e,t,n){try{if(!t)return null;if(t.keys.length<e.length)return null;const r=[];for(let o=0,i=0;o<t.keys.length&&i<e.length;++o)0===bn(t.keys[o],e[i])&&(r.push(n?fe(t.values[o]):t.values[o]),++i);return r.length===e.length?r:null}catch(e){return null}}const pr={stack:"dbcore",level:-1,create:e=>({table:t=>{const n=e.table(t);return i(o({},n),{getMany:e=>{if(!e.cache)return n.getMany(e);const t=fr(e.keys,e.trans._cache,"clone"===e.cache);return t?ht.resolve(t):n.getMany(e).then((t=>(e.trans._cache={keys:e.keys,values:"clone"===e.cache?fe(t):t},t)))},mutate:e=>("add"!==e.type&&(e.trans._cache=null),n.mutate(e))})}})};function dr(e){return!("from"in e)}const hr=function(e,t){if(!this){const t=new hr;return e&&"d"in e&&z(t,e),t}z(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function yr(e,t,n){const r=bn(t,n);if(isNaN(r))return;if(r>0)throw RangeError();if(dr(e))return z(e,{from:t,to:n,d:1});const o=e.l,i=e.r;if(bn(n,e.from)<0)return o?yr(o,t,n):e.l={from:t,to:n,d:1,l:null,r:null},br(e);if(bn(t,e.to)>0)return i?yr(i,t,n):e.r={from:t,to:n,d:1,l:null,r:null},br(e);bn(t,e.from)<0&&(e.from=t,e.l=null,e.d=i?i.d+1:1),bn(n,e.to)>0&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1);const s=!e.r;o&&!e.l&&gr(e,o),i&&s&&gr(e,i)}function gr(e,t){dr(t)||function e(t,{from:n,to:r,l:o,r:i}){yr(t,n,r),o&&e(t,o),i&&e(t,i)}(e,t)}function mr(e){let t=dr(e)?null:{s:0,n:e};return{next(e){const n=arguments.length>0;for(;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&bn(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||bn(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}}}}function br(e){var t,n;const 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),i=r>1?"r":r<-1?"l":"";if(i){const t="r"===i?"l":"r",n=o({},e),r=e[i];e.from=r.from,e.to=r.to,e[i]=r[i],n[i]=r[t],e[t]=n,n.d=vr(n)}e.d=vr(e)}function vr({r:e,l:t}){return(e?t?Math.max(e.d,t.d):e.d:t?t.d:0)+1}q(hr.prototype,{add(e){return gr(this,e),this},addKey(e){return yr(this,e,e),this},addKeys(e){return e.forEach((e=>yr(this,e,e))),this},[ye](){return mr(this)}});const wr={stack:"dbcore",level:0,create:e=>{const t=e.schema.name,n=new hr(e.MIN_KEY,e.MAX_KEY);return i(o({},e),{table:r=>{const s=e.table(r),{schema:a}=s,{primaryKey:c}=a,{extractKey:u,outbound:l}=c,f=i(o({},s),{mutate:e=>{const o=e.trans,i=o.mutatedParts||(o.mutatedParts={}),c=e=>{const n=`idb://${t}/${r}/${e}`;return i[n]||(i[n]=new hr)},u=c(""),l=c(":dels"),{type:f}=e;let[p,d]="deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[];const h=e.trans._cache;return s.mutate(e).then((e=>{if(U(p)){"delete"!==f&&(p=e.results),u.addKeys(p);const t=fr(p,h);t||"add"===f||l.addKeys(p),(t||d)&&function(e,t,n,r){t.indexes.forEach((function(t){const o=e(t.name||"");function i(e){return null!=e?t.extractKey(e):null}const s=e=>t.multiEntry&&U(e)?e.forEach((e=>o.addKey(e))):o.addKey(e);(n||r).forEach(((e,t)=>{const o=n&&i(n[t]),a=r&&i(r[t]);0!==bn(o,a)&&(null!=o&&s(o),null!=a&&s(a))}))}))}(c,a,t,d)}else if(p){const e={from:p.lower,to:p.upper};l.add(e),u.add(e)}else u.add(n),l.add(n),a.indexes.forEach((e=>c(e.name).add(n)));return e}))}}),p=({query:{index:t,range:n}})=>{var r,o;return[t,new hr(null!==(r=n.lower)&&void 0!==r?r:e.MIN_KEY,null!==(o=n.upper)&&void 0!==o?o:e.MAX_KEY)]},d={get:e=>[c,new hr(e.key)],getMany:e=>[c,(new hr).addKeys(e.keys)],count:p,query:p,openCursor:p};return B(d).forEach((e=>{f[e]=function(a){const{subscr:c}=lt;if(c){const f=e=>{const n=`idb://${t}/${r}/${e}`;return c[n]||(c[n]=new hr)},p=f(""),h=f(":dels"),[y,g]=d[e](a);if(f(y.name||"").add(g),!y.isPrimaryKey){if("count"!==e){const t="query"===e&&l&&a.values&&s.query(i(o({},a),{values:!1}));return s[e].apply(this,arguments).then((n=>{if("query"===e){if(l&&a.values)return t.then((({result:e})=>(p.addKeys(e),n)));const e=a.values?n.result.map(u):n.result;a.values?p.addKeys(e):h.addKeys(e)}else if("openCursor"===e){const e=n,t=a.values;return e&&Object.create(e,{key:{get:()=>(h.addKey(e.primaryKey),e.key)},primaryKey:{get(){const t=e.primaryKey;return h.addKey(t),t}},value:{get:()=>(t&&p.addKey(e.primaryKey),e.value)}})}return n}))}h.add(n)}}return s[e].apply(this,arguments)}})),f}})}};let Or=class e{version(e){if(isNaN(e)||e<.1)throw new Re.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new Re.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);const t=this._versions;var n=t.filter((t=>t._cfg.version===e))[0];return n||(n=new this.Version(e),t.push(n),t.sort(Wn),n.stores({}),this._state.autoSchema=!1,n)}_whenReady(e){return this.idbdb&&(this._state.openComplete||lt.letThrough||this._vip)?e():new ht(((e,t)=>{if(this._state.openComplete)return t(new Re.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void t(new Re.DatabaseClosed);this.open().catch(Le)}this._state.dbReadyPromise.then(e,t)})).then(e)}use({stack:e,create:t,level:n,name:r}){r&&this.unuse({stack:e,name:r});const o=this._middlewares[e]||(this._middlewares[e]=[]);return o.push({stack:e,create:t,level:null==n?10:n,name:r}),o.sort(((e,t)=>e.level-t.level)),this}unuse({stack:e,name:t,create:n}){return e&&this._middlewares[e]&&(this._middlewares[e]=this._middlewares[e].filter((e=>n?e.create!==n:!!t&&e.name!==t))),this}open(){return function(e){const t=e._state,{indexedDB:n}=e._deps;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((()=>t.dbOpenError?Zt(t.dbOpenError):e));we&&(t.openCanceller._stackHolder=Ee()),t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;const r=t.openCanceller;function o(){if(t.openCanceller!==r)throw new Re.DatabaseClosed("db.open() was cancelled")}let i=t.dbReadyResolve,s=null,a=!1;return ht.race([r,("undefined"==typeof navigator?ht.resolve():rr()).then((()=>new ht(((r,i)=>{if(o(),!n)throw new Re.MissingAPI;const c=e.name,u=t.autoSchema?n.open(c):n.open(c,Math.round(10*e.verno));if(!u)throw new Re.MissingAPI;u.onerror=Tn(i),u.onblocked=$t(e._fireOnBlocked),u.onupgradeneeded=$t((r=>{if(s=u.transaction,t.autoSchema&&!e._options.allowEmptyDB){u.onerror=Dn,s.abort(),u.result.close();const e=n.deleteDatabase(c);e.onsuccess=e.onerror=$t((()=>{i(new Re.NoSuchDatabase(`Database ${c} doesnt exist`))}))}else{s.onerror=Tn(i);var o=r.oldVersion>Math.pow(2,62)?0:r.oldVersion;a=o<1,e._novip.idbdb=u.result,function(e,t,n,r){const o=e._dbSchema,i=e._createTransaction("readwrite",e._storeNames,o);i.create(n),i._completion.catch(r);const s=i._reject.bind(i),a=lt.transless||lt;Nt((()=>{lt.trans=i,lt.transless=a,0===t?(B(o).forEach((e=>{Zn(n,e,o[e].primKey,o[e].indexes)})),Vn(e,n),ht.follow((()=>e.on.populate.fire(i))).catch(s)):function({_novip:e},t,n,r){const o=[],i=e._versions;let s=e._dbSchema=Xn(0,e.idbdb,r),a=!1;return i.filter((e=>e._cfg.version>=t)).forEach((i=>{o.push((()=>{const o=s,c=i._cfg.dbschema;Qn(e,o,r),Qn(e,c,r),s=e._dbSchema=c;const u=Gn(o,c);u.add.forEach((e=>{Zn(r,e[0],e[1].primKey,e[1].indexes)})),u.change.forEach((e=>{if(e.recreate)throw new Re.Upgrade("Not yet support for changing primary key");{const t=r.objectStore(e.name);e.add.forEach((e=>Yn(t,e))),e.change.forEach((e=>{t.deleteIndex(e.name),Yn(t,e)})),e.del.forEach((e=>t.deleteIndex(e)))}}));const l=i._cfg.contentUpgrade;if(l&&i._cfg.version>t){Vn(e,r),n._memoizedTables={},a=!0;let t=ie(c);u.del.forEach((e=>{t[e]=o[e]})),Hn(e,[e.Transaction.prototype]),qn(e,[e.Transaction.prototype],B(t),t),n.schema=t;const i=ve(l);let s;i&&Mt();const f=ht.follow((()=>{if(s=l(n),s&&i){var e=Lt.bind(null,null);s.then(e,e)}}));return s&&"function"==typeof s.then?ht.resolve(s):f.then((()=>s))}})),o.push((t=>{a&&tn||function(e,t){[].slice.call(t.db.objectStoreNames).forEach((n=>null==e[n]&&t.db.deleteObjectStore(n)))}(i._cfg.dbschema,t),Hn(e,[e.Transaction.prototype]),qn(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),n.schema=e._dbSchema}))})),function e(){return o.length?ht.resolve(o.shift()(n.idbtrans)).then(e):ht.resolve()}().then((()=>{var e,t;t=r,B(e=s).forEach((n=>{t.db.objectStoreNames.contains(n)||Zn(t,n,e[n].primKey,e[n].indexes)}))}))}(e,t,i,n).catch(s)}))}(e,o/10,s,i)}}),i),u.onsuccess=$t((()=>{s=null;const n=e._novip.idbdb=u.result,o=Q(n.objectStoreNames);if(o.length>0)try{const r=n.transaction(1===(i=o).length?i[0]:i,"readonly");t.autoSchema?function({_novip:e},t,n){e.verno=t.version/10;const r=e._dbSchema=Xn(0,t,n);e._storeNames=Q(t.objectStoreNames,0),qn(e,[e._allTables],B(r),r)}(e,n,r):(Qn(e,e._dbSchema,r),function(e,t){const n=Gn(Xn(0,e.idbdb,t),e._dbSchema);return!(n.add.length||n.change.some((e=>e.add.length||e.change.length)))}(e,r)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),Vn(e,r)}catch(e){}var i;Jt.push(e),n.onversionchange=$t((n=>{t.vcFired=!0,e.on("versionchange").fire(n)})),n.onclose=$t((t=>{e.on("close").fire(t)})),a&&function({indexedDB:e,IDBKeyRange:t},n){!tr(e)&&"__dbnames"!==n&&er(e,t).put({name:n}).catch(Le)}(e._deps,c),r()}),i)}))))]).then((()=>(o(),t.onReadyBeingFired=[],ht.resolve(nr((()=>e.on.ready.fire(e.vip)))).then((function n(){if(t.onReadyBeingFired.length>0){let r=t.onReadyBeingFired.reduce(He,Le);return t.onReadyBeingFired=[],ht.resolve(nr((()=>r(e.vip)))).then(n)}}))))).finally((()=>{t.onReadyBeingFired=null,t.isBeingOpened=!1})).then((()=>e)).catch((n=>{t.dbOpenError=n;try{s&&s.abort()}catch(e){}return r===t.openCanceller&&e._close(),Zt(n)})).finally((()=>{t.openComplete=!0,i()}))}(this)}_close(){const e=this._state,t=Jt.indexOf(this);if(t>=0&&Jt.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new ht((t=>{e.dbReadyResolve=t})),e.openCanceller=new ht(((t,n)=>{e.cancelOpen=n}))}close(){this._close();const e=this._state;this._options.autoOpen=!1,e.dbOpenError=new Re.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)}delete(){const e=arguments.length>0,t=this._state;return new ht(((n,r)=>{const o=()=>{this.close();var e=this._deps.indexedDB.deleteDatabase(this.name);e.onsuccess=$t((()=>{!function({indexedDB:e,IDBKeyRange:t},n){!tr(e)&&"__dbnames"!==n&&er(e,t).delete(n).catch(Le)}(this._deps,this.name),n()})),e.onerror=Tn(r),e.onblocked=this._fireOnBlocked};if(e)throw new Re.InvalidArgument("Arguments not allowed in db.delete()");t.isBeingOpened?t.dbReadyPromise.then(o):o()}))}backendDB(){return this.idbdb}isOpen(){return null!==this.idbdb}hasBeenClosed(){const e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name}hasFailed(){return null!==this._state.dbOpenError}dynamicallyOpened(){return this._state.autoSchema}get tables(){return B(this._allTables).map((e=>this._allTables[e]))}transaction(){const e=ir.apply(this,arguments);return this._transaction.apply(this,e)}_transaction(e,t,n){let r=lt.trans;r&&r.db===this&&-1===e.indexOf("!")||(r=null);const o=-1!==e.indexOf("?");let i,s;e=e.replace("!","").replace("?","");try{if(s=t.map((e=>{var t=e instanceof this.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 Re.InvalidArgument("Invalid transaction mode: "+e);i="readwrite"}if(r){if("readonly"===r.mode&&"readwrite"===i){if(!o)throw new Re.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");r=null}r&&s.forEach((e=>{if(r&&-1===r.storeNames.indexOf(e)){if(!o)throw new Re.SubTransaction("Table "+e+" not included in parent transaction.");r=null}})),o&&r&&!r.active&&(r=null)}}catch(e){return r?r._promise(null,((t,n)=>{n(e)})):Zt(e)}const a=sr.bind(null,this,i,s,r,n);return r?r._promise(i,a,"lock"):lt.trans?Vt(lt.transless,(()=>this._whenReady(a))):this._whenReady(a)}table(e){if(!V(this._allTables,e))throw new Re.InvalidTable(`Table ${e} does not exist`);return this._allTables[e]}constructor(t,n){this._middlewares={},this.verno=0;const r=e.dependencies;this._options=n=o({addons:e.addons,autoOpen:!0,indexedDB:r.indexedDB,IDBKeyRange:r.IDBKeyRange},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange};const{addons:i}=n;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;const s={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Le,dbReadyPromise:null,cancelOpen:Le,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};var a;s.dbReadyPromise=new ht((e=>{s.dbReadyResolve=e})),s.openCanceller=new ht(((e,t)=>{s.cancelOpen=t})),this._state=s,this.name=t,this.on=un(this,"populate","blocked","versionchange","close",{ready:[He,Le]}),this.on.ready.subscribe=J(this.on.ready.subscribe,(t=>(n,r)=>{e.vip((()=>{const e=this._state;if(e.openComplete)e.dbOpenError||ht.resolve().then(n),r&&t(n);else if(e.onReadyBeingFired)e.onReadyBeingFired.push(n),r&&t(n);else{t(n);const e=this;r||t((function t(){e.on.ready.unsubscribe(n),e.on.ready.unsubscribe(t)}))}}))})),this.Collection=(a=this,ln(On.prototype,(function(e,t){this.db=a;let n=sn,r=null;if(t)try{n=t()}catch(e){r=e}const o=e._ctx,i=o.table,s=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:s!==Be?s:null}}))),this.Table=function(e){return ln(cn.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:un(null,{creating:[Fe,Le],reading:[Ue,Be],updating:[Ve,Le],deleting:[Ke,Le]})}))}(this),this.Transaction=function(e){return ln(Rn.prototype,(function(t,n,r,o,i){this.db=e,this.mode=t,this.storeNames=n,this.schema=r,this.chromeTransactionDurability=o,this.idbtrans=null,this.on=un(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 ht(((e,t)=>{this._resolve=e,this._reject=t})),this._completion.then((()=>{this.active=!1,this.on.complete.fire()}),(e=>{var t=this.active;return this.active=!1,this.on.error.fire(e),this.parent?this.parent._reject(e):t&&this.idbtrans&&this.idbtrans.abort(),Zt(e)}))}))}(this),this.Version=function(e){return ln(Jn.prototype,(function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(e){return ln(An.prototype,(function(t,n,r){this.db=e,this._ctx={table:t,index:":id"===n?null:n,or:r};const o=e._deps.indexedDB;if(!o)throw new Re.MissingAPI;this._cmp=this._ascending=o.cmp.bind(o),this._descending=(e,t)=>o.cmp(t,e),this._max=(e,t)=>o.cmp(e,t)>0?e:t,this._min=(e,t)=>o.cmp(e,t)<0?e:t,this._IDBKeyRange=e._deps.IDBKeyRange}))}(this),this.on("versionchange",(e=>{e.newVersion>0?console.warn(`Another connection wants to upgrade database '${this.name}'. Closing db now to resume the upgrade.`):console.warn(`Another connection wants to delete database '${this.name}'. Closing db now to resume the delete request.`),this.close()})),this.on("blocked",(e=>{!e.newVersion||e.newVersion<e.oldVersion?console.warn(`Dexie.delete('${this.name}') was blocked`):console.warn(`Upgrade '${this.name}' blocked by other connection holding version ${e.oldVersion/10}`)})),this._maxKey=Bn(n.IDBKeyRange),this._createTransaction=(e,t,n,r)=>new this.Transaction(e,t,n,this._options.chromeTransactionDurability,r),this._fireOnBlocked=e=>{this.on("blocked").fire(e),Jt.filter((e=>e.name===this.name&&e!==this&&!e._state.vcFired)).map((t=>t.on("versionchange").fire(e)))},this.use(cr),this.use(lr),this.use(wr),this.use(pr),this.vip=Object.create(this,{_vip:{value:!0}}),i.forEach((e=>e(this)))}};const Sr="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";let xr,Er=class{subscribe(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})}[Sr](){return this}constructor(e){this._subscribe=e}};function _r(e,t){return B(t).forEach((n=>{gr(e[n]||(e[n]=new hr),t[n])})),e}try{xr={indexedDB:L.indexedDB||L.mozIndexedDB||L.webkitIndexedDB||L.msIndexedDB,IDBKeyRange:L.IDBKeyRange||L.webkitIDBKeyRange}}catch(r){xr={indexedDB:null,IDBKeyRange:null}}const jr=Or;function kr(e){let t=Pr;try{Pr=!0,In.storagemutated.fire(e)}finally{Pr=t}}q(jr,i(o({},Me),{delete:e=>new jr(e,{addons:[]}).delete(),exists:e=>new jr(e,{addons:[]}).open().then((e=>(e.close(),!0))).catch("NoSuchDatabaseError",(()=>!1)),getDatabaseNames(e){try{return function({indexedDB:e,IDBKeyRange:t}){return tr(e)?Promise.resolve(e.databases()).then((e=>e.map((e=>e.name)).filter((e=>"__dbnames"!==e)))):er(e,t).toCollection().primaryKeys()}(jr.dependencies).then(e)}catch(e){return Zt(new Re.MissingAPI)}},defineClass:()=>function(e){z(this,e)},ignoreTransaction:e=>lt.trans?Vt(lt.transless,e):e(),vip:nr,async:function(e){return function(){try{var t=or(e.apply(this,arguments));return t&&"function"==typeof t.then?t:ht.resolve(t)}catch(e){return Zt(e)}}},spawn:function(e,t,n){try{var r=or(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:ht.resolve(r)}catch(e){return Zt(e)}},currentTransaction:{get:()=>lt.trans||null},waitFor:function(e,t){const n=ht.resolve("function"==typeof e?jr.ignoreTransaction(e):e).timeout(t||6e4);return lt.trans?lt.trans.waitFor(n):n},Promise:ht,debug:{get:()=>we,set:e=>{Oe(e,"dexie"===e?()=>!0:rn)}},derive:G,extend:z,props:q,override:J,Events:un,on:In,liveQuery:function(e){return new Er((t=>{const n=ve(e);let r=!1,o={},i={};const s={get closed(){return r},unsubscribe:()=>{r=!0,In.storagemutated.unsubscribe(l)}};t.start&&t.start(s);let a=!1,c=!1;function u(){return B(i).some((e=>o[e]&&function(e,t){const n=mr(t);let r=n.next();if(r.done)return!1;let o=r.value;const i=mr(e);let s=i.next(o.from),a=s.value;for(;!r.done&&!s.done;){if(bn(a.from,o.to)<=0&&bn(a.to,o.from)>=0)return!0;bn(o.from,a.from)<0?o=(r=n.next(a.from)).value:a=(s=i.next(o.from)).value}return!1}(o[e],i[e])))}const l=e=>{_r(o,e),u()&&f()},f=()=>{if(a||r)return;o={};const p={},d=function(t){n&&Mt();const r=()=>Nt(e,{subscr:t,trans:null}),o=lt.trans?Vt(lt.transless,r):r();return n&&o.then(Lt,Lt),o}(p);c||(In("storagemutated",l),c=!0),a=!0,Promise.resolve(d).then((e=>{a=!1,r||(u()?f():(o={},i=p,t.next&&t.next(e)))}),(e=>{a=!1,t.error&&t.error(e),s.unsubscribe()}))};return f(),s}))},extendObservabilitySet:_r,getByKeyPath:re,setByKeyPath:oe,delByKeyPath:function(e,t){"string"==typeof t?oe(e,t,void 0):"length"in t&&[].map.call(t,(function(t){oe(e,t,void 0)}))},shallowClone:ie,deepClone:fe,getObjectDiff:ur,cmp:bn,asap:te,minKey:-1/0,addons:[],connections:Jt,errnames:De,dependencies:xr,semVer:"3.2.3",version:"3.2.3".split(".").map((e=>parseInt(e))).reduce(((e,t,n)=>e+t/Math.pow(10,2*n)))})),jr.maxKey=Bn(jr.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(In("storagemutated",(e=>{if(!Pr){let t;en?(t=document.createEvent("CustomEvent"),t.initCustomEvent("x-storagemutated-1",!0,!0,e)):t=new CustomEvent("x-storagemutated-1",{detail:e}),Pr=!0,dispatchEvent(t),Pr=!1}})),addEventListener("x-storagemutated-1",(({detail:e})=>{Pr||kr(e)})));let Pr=!1;if("undefined"!=typeof BroadcastChannel){const e=new BroadcastChannel("x-storagemutated-1");"function"==typeof e.unref&&e.unref(),In("storagemutated",(t=>{Pr||e.postMessage(t)})),e.onmessage=e=>{e.data&&kr(e.data)}}else if("undefined"!=typeof self&&"undefined"!=typeof navigator){In("storagemutated",(e=>{try{Pr||("undefined"!=typeof localStorage&&localStorage.setItem("x-storagemutated-1",JSON.stringify({trig:Math.random(),changedParts:e})),"object"==typeof self.clients&&[...self.clients.matchAll({includeUncontrolled:!0})].forEach((t=>t.postMessage({type:"x-storagemutated-1",changedParts:e}))))}catch(e){}})),"undefined"!=typeof addEventListener&&addEventListener("storage",(e=>{if("x-storagemutated-1"===e.key){const t=JSON.parse(e.newValue);t&&kr(t.changedParts)}}));const e=self.document&&navigator.serviceWorker;e&&e.addEventListener("message",(function({data:e}){e&&"x-storagemutated-1"===e.type&&kr(e.changedParts)}))}ht.rejectionMapper=function(e,t){if(!e||e instanceof $e||e instanceof TypeError||e instanceof SyntaxError||!e.name||!Ne[e.name])return e;var n=new Ne[e.name](t||e.message,e);return"stack"in e&&W(n,"stack",{get:function(){return this.inner.stack}}),n},Oe(we,rn);var $r=a(766),Cr=a(685);function Ar(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}let Tr=class extends Or{constructor(){super("EsmOffline"),Ar(this,"syncQueue",void 0),Ar(this,"dynamicOfflineData",void 0),this.version(4).stores({syncQueue:"++id,userId,type,[userId+type]",dynamicOfflineData:"++id,type,identifier,*users,&[type+identifier]"}),this.syncQueue=this.table("syncQueue"),this.dynamicOfflineData=this.table("dynamicOfflineData")}};function Dr(){return new Tr}function Ir(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function Rr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){Ir(i,r,o,s,a,"next",e)}function a(e){Ir(i,r,o,s,a,"throw",e)}s(void 0)}))}}function Nr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mr(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){Nr(e,t,n[t])}))}return e}const Lr=new Tr,Br={},Ur=(0,Cr.createGlobalStore)("offline-synchronization",{});function zr(){return Ur}function Fr(){return Kr.apply(this,arguments)}function Kr(){return Kr=Rr((function*(){if(Ur.getState().synchronization)return;const e=yield Lr.syncQueue.count(),t={},n=Object.entries(Br),r=n.length,o={},i=new AbortController,s=()=>{const e=Ur.getState().synchronization;var t,n;Ur.setState({synchronization:(t=Mr({},e),n={pendingCount:e.pendingCount-1},n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})),t)})};try{Ur.setState({synchronization:{totalCount:e,pendingCount:e,abortController:i}});for(let e=0;e<r&&n.length>0;e++)for(let e=n.length;e--;){const[r,a]=n[e],c=a.dependsOn.map((e=>t[e]));c.every(Boolean)&&(o[r]={},yield Promise.all(c),t[r]=Vr(a,o,i,s),n.splice(e,1))}yield Promise.allSettled(Object.values(t))}finally{Ur.setState({synchronization:void 0})}})),Kr.apply(this,arguments)}function Vr(e,t,n,r){return qr.apply(this,arguments)}function qr(){return qr=Rr((function*({type:e,dependsOn:t,process:n},r,o,i){const s=[],a=[],c=yield Hr();yield Lr.syncQueue.where({type:e,userId:c}).each(((e,t)=>{s.push([t.primaryKey,e.content,e.descriptor]),a.push(e.content)}));for(let l=0;l<s.length;l++){const[f,p,{id:d,dependencies:h=[]}]=s[l];try{const i=yield n(p,{abort:o,index:l,items:a,userId:c,dependencies:h.map((({id:e,type:n})=>t.includes(n)?r[n][e]:void 0))});void 0!==d&&(r[e][d]=i),yield Lr.syncQueue.delete(f)}catch(e){var u;yield Lr.syncQueue.update(f,{lastError:{name:null==e?void 0:e.name,message:null!==(u=null==e?void 0:e.message)&&void 0!==u?u:null==e?void 0:e.toString()}})}finally{i()}}})),qr.apply(this,arguments)}function Hr(){return Wr.apply(this,arguments)}function Wr(){return(Wr=Rr((function*(){const e=yield(0,$r.getLoggedInUser)();return(null==e?void 0:e.uuid)||"*"}))).apply(this,arguments)}function Gr(e,t,n,r){return Zr.apply(this,arguments)}function Zr(){return(Zr=Rr((function*(e,t,n,r){const o=r&&r.id;return void 0!==o&&(yield Lr.syncQueue.where({type:t,userId:e}).filter((e=>(null==e?void 0:e.descriptor.id)===o)).delete().catch(Or.errnames.DatabaseClosed)),yield Lr.syncQueue.add({type:t,content:n,userId:e,descriptor:r||{},createdOn:new Date}).catch(Or.errnames.DatabaseClosed,(()=>-1))}))).apply(this,arguments)}function Yr(e,t,n){return Xr.apply(this,arguments)}function Xr(){return(Xr=Rr((function*(e,t,n){const r=yield Hr();return yield Gr(r,e,t,n)}))).apply(this,arguments)}function Qr(e,t){return Jr.apply(this,arguments)}function Jr(){return(Jr=Rr((function*(e,t){return(yield eo(e,t)).map((e=>e.content))}))).apply(this,arguments)}function eo(e,t){return to.apply(this,arguments)}function to(){return(to=Rr((function*(e,t){const n=t?{type:t,userId:e}:{userId:e};return yield Lr.syncQueue.where(n).toArray().catch(Or.errnames.DatabaseClosed,(()=>[]))}))).apply(this,arguments)}function no(e){return ro.apply(this,arguments)}function ro(){return(ro=Rr((function*(e){const t=yield Hr();return yield Qr(t,e)}))).apply(this,arguments)}function oo(e){return io.apply(this,arguments)}function io(){return(io=Rr((function*(e){const t=yield Hr();return yield eo(t,e)}))).apply(this,arguments)}function so(e){return ao.apply(this,arguments)}function ao(){return(ao=Rr((function*(e){return yield Lr.syncQueue.get(e).catch(Or.errnames.DatabaseClosed,(()=>{}))}))).apply(this,arguments)}function co(e){var t;return!!(null===(t=Br[e])||void 0===t?void 0:t.options.onBeginEditSyncItem)}function uo(e){return lo.apply(this,arguments)}function lo(){return(lo=Rr((function*(e){var t;const n=yield so(e);if(!n)throw new Error(`No sync item with the ID ${e} exists.`);const r=null===(t=Br[n.type])||void 0===t?void 0:t.options.onBeginEditSyncItem;if(!r)throw new Error(`A sync item with the ID ${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 "${n.type}" supports editing items.`);r(n)}))).apply(this,arguments)}function fo(e){return po.apply(this,arguments)}function po(){return(po=Rr((function*(e){yield Lr.syncQueue.delete(e).catch(Or.errnames.DatabaseClosed)}))).apply(this,arguments)}function ho(e,t,n,r={}){Br[e]={type:e,dependsOn:t,process:n,options:r}}const yo={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let go;const mo=new Uint8Array(16);function bo(){if(!go&&(go="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!go))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return go(mo)}const vo=[];for(let e=0;e<256;++e)vo.push((e+256).toString(16).slice(1));const wo=function(e,t,n){if(yo.randomUUID&&!t&&!e)return yo.randomUUID();const r=(e=e||{}).random||(e.rng||bo)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return(vo[e[t+0]]+vo[e[t+1]]+vo[e[t+2]]+vo[e[t+3]]+"-"+vo[e[t+4]]+vo[e[t+5]]+"-"+vo[e[t+6]]+vo[e[t+7]]+"-"+vo[e[t+8]]+vo[e[t+9]]+"-"+vo[e[t+10]]+vo[e[t+11]]+vo[e[t+12]]+vo[e[t+13]]+vo[e[t+14]]+vo[e[t+15]]).toLowerCase()}(r)},Oo="OFFLINE+";function So(){return Oo+wo()}function xo(e){return e.startsWith(Oo)}function Eo(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function _o(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){Eo(i,r,o,s,a,"next",e)}function a(e){Eo(i,r,o,s,a,"throw",e)}s(void 0)}))}}const jo={};function ko(){return Object.values(jo)}function Po(e){jo[e.id]&&console.warn(`[setupDynamicOfflineDataHandler] Another second handler with the ID "${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.`),jo[e.id]=e}function $o(e){return Co.apply(this,arguments)}function Co(){return(Co=_o((function*(e){const t=yield qo();return yield Ao(t,e)}))).apply(this,arguments)}function Ao(e,t){return To.apply(this,arguments)}function To(){return To=_o((function*(e,t){const n=t?{type:t,users:e}:{users:e},r=new Tr;return yield r.dynamicOfflineData.where(n).toArray().catch(Or.errnames.DatabaseClosed,(()=>[]))})),To.apply(this,arguments)}function Do(e,t){return Io.apply(this,arguments)}function Io(){return(Io=_o((function*(e,t){const n=yield qo();return yield Ro(n,e,t)}))).apply(this,arguments)}function Ro(e,t,n){return No.apply(this,arguments)}function No(){return No=_o((function*(e,t,n){const r=new Tr,o=yield r.dynamicOfflineData.get({type:t,identifier:n}).catch(Or.errnames.DatabaseClosed,(()=>{}));o?o.users.includes(e)||(yield r.dynamicOfflineData.update(o.id,{users:[...o.users,e]}).catch(Or.errnames.DatabaseClosed)):yield r.dynamicOfflineData.add({users:[e],type:t,identifier:n}).catch(Or.errnames.DatabaseClosed)})),No.apply(this,arguments)}function Mo(e,t){return Lo.apply(this,arguments)}function Lo(){return(Lo=_o((function*(e,t){const n=yield qo();return yield Bo(n,e,t)}))).apply(this,arguments)}function Bo(e,t,n){return Uo.apply(this,arguments)}function Uo(){return Uo=_o((function*(e,t,n){const r=new Tr,o=yield r.dynamicOfflineData.get({type:t,identifier:n,users:e}).catch(Or.errnames.DatabaseClosed,(()=>{}));o&&(o.users.length>1?yield r.dynamicOfflineData.update(o.id,{users:o.users.filter((t=>t!==e))}).catch(Or.errnames.DatabaseClosed):yield r.dynamicOfflineData.delete(o.id).catch(Or.errnames.DatabaseClosed))})),Uo.apply(this,arguments)}function zo(e,t){return Fo.apply(this,arguments)}function Fo(){return Fo=_o((function*(e,t){const n=yield $o(e);var r;yield Promise.all(n.map((r=_o((function*(e){return Ko(e.type,e.identifier,t)})),function(e){return r.apply(this,arguments)})))})),Fo.apply(this,arguments)}function Ko(e,t,n){return Vo.apply(this,arguments)}function Vo(){return Vo=_o((function*(e,t,n){yield Do(e,t);const r=new Tr,o=yield qo(),i=yield r.dynamicOfflineData.get({type:e,identifier:t}).catch(Or.errnames.DatabaseClosed,(()=>{})),s=ko().filter((t=>t.type===e));if(!i)return;const a=yield Promise.all(s.map((c=_o((function*(e){try{return e.sync(t,n),{id:e.id,error:void 0}}catch(t){var r,o;const n=null!==(o=null===(r=t.message)||void 0===r?void 0:r.toString())&&void 0!==o?o:t.toString();return{id:e.id,error:n}}})),function(e){return c.apply(this,arguments)})));var c;const u=a.filter((e=>!e.error)).map((e=>e.id)),l=a.filter((e=>e.error)).map((e=>e.id)),f=a.filter((e=>e.error)).map((e=>({handlerId:e.id,message:e.error}))),p={syncedOn:new Date,syncedBy:o,succeededHandlers:u,erroredHandlers:l,errors:f};i.id&&(yield r.dynamicOfflineData.update(i.id,{syncState:p}).catch(Or.errnames.DatabaseClosed))})),Vo.apply(this,arguments)}function qo(){return Ho.apply(this,arguments)}function Ho(){return(Ho=_o((function*(){const e=(yield(0,$r.getLoggedInUser)()).uuid;if(!e)throw new Error("Using the dynamic offline data API requires a logged in user.");return e}))).apply(this,arguments)}function Wo(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}const Go=(0,Cr.createGlobalStore)("offline-patients",{offlinePatientDataSyncState:{},handlers:{}});function Zo(){return Jo(),Go}function Yo(e,t){Jo(),Po({type:"patient",displayName:t.displayName,id:e,isSynced:()=>Promise.resolve(!0),sync:(e,n)=>t.onOfflinePatientAdded({patientUuid:e,signal:null!=n?n:(new AbortController).signal})})}function Xo(e){return Qo.apply(this,arguments)}function Qo(){return Qo=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){Wo(i,r,o,s,a,"next",e)}function a(e){Wo(i,r,o,s,a,"throw",e)}s(void 0)}))}}((function*(e){Jo(),yield Ko("patient",e)})),Qo.apply(this,arguments)}function Jo(){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.")}})(),c})())}}}))},7352:(e,t,n)=>{"use strict";n.d(t,{jp:()=>_o,Qd:()=>Eo,Gy:()=>ko,sF:()=>ro,vm:()=>o,xA:()=>ur,H_:()=>fr,Ui:()=>ar,D2:()=>wo,WB:()=>go,aA:()=>rr,k1:()=>$r,TI:()=>So,Q2:()=>bo,z7:()=>oo,gp:()=>qr,a7:()=>no,Rz:()=>Zr,QI:()=>Wr,$9:()=>Gr,cV:()=>dr,fR:()=>yr,X2:()=>po,dt:()=>Cr,pO:()=>mr,ME:()=>vr,Xc:()=>cr,Kb:()=>$o,ps:()=>Or,mF:()=>xr,MO:()=>Ar});let r="unavailable";function o(){return{current:r,notAvailable:"unavailable"===r,active:"on"===r}}var i=n(403),s=n(7840);const a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,c=Object.keys,u=Array.isArray;function l(e,t){return"object"!=typeof t||c(t).forEach((function(n){e[n]=t[n]})),e}"undefined"==typeof Promise||a.Promise||(a.Promise=Promise);const f=Object.getPrototypeOf,p={}.hasOwnProperty;function d(e,t){return p.call(e,t)}function h(e,t){"function"==typeof t&&(t=t(f(e))),("undefined"==typeof Reflect?c:Reflect.ownKeys)(t).forEach((n=>{g(e,n,t[n])}))}const y=Object.defineProperty;function g(e,t,n,r){y(e,t,l(n&&d(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function m(e){return{from:function(t){return e.prototype=Object.create(t.prototype),g(e.prototype,"constructor",e),{extend:h.bind(null,e.prototype)}}}}const b=Object.getOwnPropertyDescriptor;function v(e,t){let n;return b(e,t)||(n=f(e))&&v(n,t)}const w=[].slice;function O(e,t,n){return w.call(e,t,n)}function S(e,t){return t(e)}function x(e){if(!e)throw new Error("Assertion Failed")}function E(e){a.setImmediate?setImmediate(e):setTimeout(e,0)}function j(e,t){return e.reduce(((e,n,r)=>{var o=t(n,r);return o&&(e[o[0]]=o[1]),e}),{})}function k(e,t){if(d(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=k(e,t[r]);n.push(i)}return n}var s=t.indexOf(".");if(-1!==s){var a=e[t.substr(0,s)];return void 0===a?void 0:k(a,t.substr(s+1))}}function P(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){x("string"!=typeof n&&"length"in n);for(var r=0,o=t.length;r<o;++r)P(e,t[r],n[r])}else{var i=t.indexOf(".");if(-1!==i){var s=t.substr(0,i),a=t.substr(i+1);if(""===a)void 0===n?u(e)&&!isNaN(parseInt(s))?e.splice(s,1):delete e[s]:e[s]=n;else{var c=e[s];c&&d(e,s)||(c=e[s]={}),P(c,a,n)}}else void 0===n?u(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function $(e){var t={};for(var n in e)d(e,n)&&(t[n]=e[n]);return t}const C=[].concat;function A(e){return C.apply([],e)}const T="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(A([8,16,32,64].map((e=>["Int","Uint","Float"].map((t=>t+e+"Array")))))).filter((e=>a[e])),D=T.map((e=>a[e]));j(T,(e=>[e,!0]));let I=null;function R(e){I="undefined"!=typeof WeakMap&&new WeakMap;const t=N(e);return I=null,t}function N(e){if(!e||"object"!=typeof e)return e;let t=I&&I.get(e);if(t)return t;if(u(e)){t=[],I&&I.set(e,t);for(var n=0,r=e.length;n<r;++n)t.push(N(e[n]))}else if(D.indexOf(e.constructor)>=0)t=e;else{const n=f(e);for(var o in t=n===Object.prototype?{}:Object.create(n),I&&I.set(e,t),e)d(e,o)&&(t[o]=N(e[o]))}return t}const{toString:M}={};function L(e){return M.call(e).slice(8,-1)}const B="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",U="symbol"==typeof B?function(e){var t;return null!=e&&(t=e[B])&&t.apply(e)}:function(){return null},z={};function F(e){var t,n,r,o;if(1===arguments.length){if(u(e))return e.slice();if(this===z&&"string"==typeof e)return[e];if(o=U(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}const K="undefined"!=typeof Symbol?e=>"AsyncFunction"===e[Symbol.toStringTag]:()=>!1;var V="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function q(e,t){V=e,H=t}var H=()=>!0;const W=!new Error("").stack;function G(){if(W)try{throw G.arguments,new Error}catch(e){return e}return new Error}function Z(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(H).map((e=>"\n"+e)).join("")):""}var Y=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],X=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Y),Q={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"};function J(e,t){this._e=G(),this.name=e,this.message=t}function ee(e,t){return e+". Errors: "+Object.keys(t).map((e=>t[e].toString())).filter(((e,t,n)=>n.indexOf(e)===t)).join("\n")}function te(e,t,n,r){this._e=G(),this.failures=t,this.failedKeys=r,this.successCount=n,this.message=ee(e,t)}function ne(e,t){this._e=G(),this.name="BulkError",this.failures=Object.keys(t).map((e=>t[e])),this.failuresByPos=t,this.message=ee(e,t)}m(J).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}}),m(te).from(J),m(ne).from(J);var re=X.reduce(((e,t)=>(e[t]=t+"Error",e)),{});const oe=J;var ie=X.reduce(((e,t)=>{var n=t+"Error";function r(e,r){this._e=G(),this.name=n,e?"string"==typeof e?(this.message=`${e}${r?"\n "+r:""}`,this.inner=r||null):"object"==typeof e&&(this.message=`${e.name} ${e.message}`,this.inner=e):(this.message=Q[t]||n,this.inner=null)}return m(r).from(oe),e[t]=r,e}),{});ie.Syntax=SyntaxError,ie.Type=TypeError,ie.Range=RangeError;var se=Y.reduce(((e,t)=>(e[t+"Error"]=ie[t],e)),{}),ae=X.reduce(((e,t)=>(-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=ie[t]),e)),{});function ce(){}function ue(e){return e}function le(e,t){return null==e||e===ue?t:function(n){return t(e(n))}}function fe(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function pe(e,t){return e===ce?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?fe(r,this.onsuccess):r),o&&(this.onerror=this.onerror?fe(o,this.onerror):o),void 0!==i?i:n}}function de(e,t){return e===ce?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?fe(n,this.onsuccess):n),r&&(this.onerror=this.onerror?fe(r,this.onerror):r)}}function he(e,t){return e===ce?t:function(n){var r=e.apply(this,arguments);l(n,r);var o=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var s=t.apply(this,arguments);return o&&(this.onsuccess=this.onsuccess?fe(o,this.onsuccess):o),i&&(this.onerror=this.onerror?fe(i,this.onerror):i),void 0===r?void 0===s?void 0:s:l(r,s)}}function ye(e,t){return e===ce?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function ge(e,t){return e===ce?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)}}ae.ModifyError=te,ae.DexieError=J,ae.BulkError=ne;var me={};const[be,ve,we]="undefined"==typeof Promise?[]:(()=>{let e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,f(e),e];const t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,f(t),e]})(),Oe=ve&&ve.then,Se=be&&be.constructor,xe=!!we;var Ee=!1,_e=we?()=>{we.then(Ge)}:a.setImmediate?setImmediate.bind(null,Ge):a.MutationObserver?()=>{var e=document.createElement("div");new MutationObserver((()=>{Ge(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:()=>{setTimeout(Ge,0)},je=function(e,t){Re.push([e,t]),Pe&&(_e(),Pe=!1)},ke=!0,Pe=!0,$e=[],Ce=[],Ae=null,Te=ue,De={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:bt,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((e=>{try{bt(e[0],e[1])}catch(e){}}))}},Ie=De,Re=[],Ne=0,Me=[];function Le(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=ce,this._lib=!1;var t=this._PSD=Ie;if(V&&(this._stackHolder=G(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==me)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&Fe(this,this._value))}this._state=null,this._value=null,++t.ref,ze(this,e)}const Be={get:function(){var e=Ie,t=ot;function n(n,r){var o=!e.global&&(e!==Ie||t!==ot);const i=o&&!ct();var s=new Le(((t,s)=>{Ve(this,new Ue(gt(n,e,o,i),gt(r,e,o,i),t,s,e))}));return V&&We(s,this),s}return n.prototype=me,n},set:function(e){g(this,"then",e&&e.prototype===me?Be:{get:function(){return e},set:Be.set})}};function Ue(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}function ze(e,t){try{t((t=>{if(null===e._state){if(t===e)throw new TypeError("A promise cannot be resolved with itself.");var n=e._lib&&Ze();t&&"function"==typeof t.then?ze(e,((e,n)=>{t instanceof Le?t._then(e,n):t.then(e,n)})):(e._state=!0,e._value=t,Ke(e)),n&&Ye()}}),Fe.bind(null,e))}catch(t){Fe(e,t)}}function Fe(e,t){if(Ce.push(t),null===e._state){var n=e._lib&&Ze();t=Te(t),e._state=!1,e._value=t,V&&null!==t&&"object"==typeof t&&!t._promise&&function(e,t,n){try{e.apply(null,void 0)}catch(e){}}((()=>{var n=v(t,"stack");t._promise=e,g(t,"stack",{get:()=>Ee?n&&(n.get?n.get.apply(t):n.value):e.stack})})),function(e){$e.some((t=>t._value===e._value))||$e.push(e)}(e),Ke(e),n&&Ye()}}function Ke(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)Ve(e,t[n]);var o=e._PSD;--o.ref||o.finalize(),0===Ne&&(++Ne,je((()=>{0==--Ne&&Xe()}),[]))}function Ve(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,++Ne,je(qe,[n,e,t])}else e._listeners.push(t)}function qe(e,t,n){try{Ae=t;var r,o=t._value;t._state?r=e(o):(Ce.length&&(Ce=[]),r=e(o),-1===Ce.indexOf(o)&&function(e){for(var t=$e.length;t;)if($e[--t]._value===e._value)return void $e.splice(t,1)}(t)),n.resolve(r)}catch(e){n.reject(e)}finally{Ae=null,0==--Ne&&Xe(),--n.psd.ref||n.psd.finalize()}}function He(e,t,n){if(t.length===n)return t;var r="";if(!1===e._state){var o,i,s=e._value;null!=s?(o=s.name||"Error",i=s.message||s,r=Z(s,0)):(o=s,i=""),t.push(o+(i?": "+i:"")+r)}return V&&((r=Z(e._stackHolder,2))&&-1===t.indexOf(r)&&t.push(r),e._prev&&He(e._prev,t,n)),t}function We(e,t){var n=t?t._numPrev+1:0;n<100&&(e._prev=t,e._numPrev=n)}function Ge(){Ze()&&Ye()}function Ze(){var e=ke;return ke=!1,Pe=!1,e}function Ye(){var e,t,n;do{for(;Re.length>0;)for(e=Re,Re=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}}while(Re.length>0);ke=!0,Pe=!0}function Xe(){var e=$e;$e=[],e.forEach((e=>{e._PSD.onunhandled.call(null,e._value,e)}));for(var t=Me.slice(0),n=t.length;n;)t[--n]()}function Qe(e){return new Le(me,!1,e)}function Je(e,t){var n=Ie;return function(){var r=Ze(),o=Ie;try{return pt(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{pt(o,!1),r&&Ye()}}}h(Le.prototype,{then:Be,_then:function(e,t){Ve(this,new Ue(null,null,e,t,Ie))},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,(e=>e instanceof t?n(e):Qe(e))):this.then(null,(e=>e&&e.name===t?n(e):Qe(e)))},finally:function(e){return this.then((t=>(e(),t)),(t=>(e(),Qe(t))))},stack:{get:function(){if(this._stack)return this._stack;try{Ee=!0;var e=He(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{Ee=!1}}},timeout:function(e,t){return e<1/0?new Le(((n,r)=>{var o=setTimeout((()=>r(new ie.Timeout(t))),e);this.then(n,r).finally(clearTimeout.bind(null,o))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&g(Le.prototype,Symbol.toStringTag,"Dexie.Promise"),De.env=dt(),h(Le,{all:function(){var e=F.apply(null,arguments).map(ut);return new Le((function(t,n){0===e.length&&t([]);var r=e.length;e.forEach(((o,i)=>Le.resolve(o).then((n=>{e[i]=n,--r||t(e)}),n)))}))},resolve:e=>{if(e instanceof Le)return e;if(e&&"function"==typeof e.then)return new Le(((t,n)=>{e.then(t,n)}));var t=new Le(me,!0,e);return We(t,Ae),t},reject:Qe,race:function(){var e=F.apply(null,arguments).map(ut);return new Le(((t,n)=>{e.map((e=>Le.resolve(e).then(t,n)))}))},PSD:{get:()=>Ie,set:e=>Ie=e},totalEchoes:{get:()=>ot},newPSD:st,usePSD:ht,scheduler:{get:()=>je,set:e=>{je=e}},rejectionMapper:{get:()=>Te,set:e=>{Te=e}},follow:(e,t)=>new Le(((n,r)=>st(((t,n)=>{var r=Ie;r.unhandleds=[],r.onunhandled=n,r.finalize=fe((function(){!function(e){Me.push((function t(){e(),Me.splice(Me.indexOf(t),1)})),++Ne,je((()=>{0==--Ne&&Xe()}),[])}((()=>{0===this.unhandleds.length?t():n(this.unhandleds[0])}))}),r.finalize),e()}),t,n,r)))}),Se&&(Se.allSettled&&g(Le,"allSettled",(function(){const e=F.apply(null,arguments).map(ut);return new Le((t=>{0===e.length&&t([]);let n=e.length;const r=new Array(n);e.forEach(((e,o)=>Le.resolve(e).then((e=>r[o]={status:"fulfilled",value:e}),(e=>r[o]={status:"rejected",reason:e})).then((()=>--n||t(r)))))}))})),Se.any&&"undefined"!=typeof AggregateError&&g(Le,"any",(function(){const e=F.apply(null,arguments).map(ut);return new Le(((t,n)=>{0===e.length&&n(new AggregateError([]));let r=e.length;const o=new Array(r);e.forEach(((e,i)=>Le.resolve(e).then((e=>t(e)),(e=>{o[i]=e,--r||n(new AggregateError(o))}))))}))})));const et={awaits:0,echoes:0,id:0};var tt=0,nt=[],rt=0,ot=0,it=0;function st(e,t,n,r){var o=Ie,i=Object.create(o);i.parent=o,i.ref=0,i.global=!1,i.id=++it;var s=De.env;i.env=xe?{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:mt(s.nthen,i),gthen:mt(s.gthen,i)}:{},t&&l(i,t),++o.ref,i.finalize=function(){--this.parent.ref||this.parent.finalize()};var a=ht(i,e,n,r);return 0===i.ref&&i.finalize(),a}function at(){return et.id||(et.id=++tt),++et.awaits,et.echoes+=100,et.id}function ct(){return!!et.awaits&&(0==--et.awaits&&(et.id=0),et.echoes=100*et.awaits,!0)}function ut(e){return et.echoes&&e&&e.constructor===Se?(at(),e.then((e=>(ct(),e)),(e=>(ct(),vt(e))))):e}function lt(e){++ot,et.echoes&&0!=--et.echoes||(et.echoes=et.id=0),nt.push(Ie),pt(e,!0)}function ft(){var e=nt[nt.length-1];nt.pop(),pt(e,!1)}function pt(e,t){var n=Ie;if((t?!et.echoes||rt++&&e===Ie:!rt||--rt&&e===Ie)||yt(t?lt.bind(null,e):ft),e!==Ie&&(Ie=e,n===De&&(De.env=dt()),xe)){var r=De.env.Promise,o=e.env;ve.then=o.nthen,r.prototype.then=o.gthen,(n.global||e.global)&&(Object.defineProperty(a,"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))}}function dt(){var e=a.Promise;return xe?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(a,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:ve.then,gthen:e.prototype.then}:{}}function ht(e,t,n,r,o){var i=Ie;try{return pt(e,!0),t(n,r,o)}finally{pt(i,!1)}}function yt(e){Oe.call(be,e)}function gt(e,t,n,r){return"function"!=typeof e?e:function(){var o=Ie;n&&at(),pt(t,!0);try{return e.apply(this,arguments)}finally{pt(o,!1),r&&yt(ct)}}}function mt(e,t){return function(n,r){return e.call(this,gt(n,t),gt(r,t))}}function bt(e,t){var n;try{n=t.onuncatched(e)}catch(e){}if(!1!==n)try{var r,o={promise:t,reason:e};if(a.document&&document.createEvent?((r=document.createEvent("Event")).initEvent("unhandledrejection",!0,!0),l(r,o)):a.CustomEvent&&l(r=new CustomEvent("unhandledrejection",{detail:o}),o),r&&a.dispatchEvent&&(dispatchEvent(r),!a.PromiseRejectionEvent&&a.onunhandledrejection))try{a.onunhandledrejection(r)}catch(e){}V&&r&&!r.defaultPrevented&&console.warn(`Unhandled rejection: ${e.stack||e}`)}catch(e){}}-1===(""+Oe).indexOf("[native code]")&&(at=ct=ce);var vt=Le.reject;function wt(e,t,n,r){if(e.idbdb&&(e._state.openComplete||Ie.letThrough||e._vip)){var o=e._createTransaction(t,n,e._dbSchema);try{o.create(),e._state.PR1398_maxLoop=3}catch(o){return o.name===re.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>wt(e,t,n,r)))):vt(o)}return o._promise(t,((e,t)=>st((()=>(Ie.trans=o,r(e,t,o)))))).then((e=>o._completion.then((()=>e))))}if(e._state.openComplete)return vt(new ie.DatabaseClosed(e._state.dbOpenError));if(!e._state.isBeingOpened){if(!e._options.autoOpen)return vt(new ie.DatabaseClosed);e.open().catch(ce)}return e._state.dbReadyPromise.then((()=>wt(e,t,n,r)))}const Ot=String.fromCharCode(65535),St="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",xt=[],Et="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),_t=Et,jt=Et,kt=e=>!/(dexie\.js|dexie\.min\.js)/.test(e);function Pt(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}const $t={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Ct(e){return"string"!=typeof e||/\./.test(e)?e=>e:t=>(void 0===t[e]&&e in t&&delete(t=R(t))[e],t)}class At{_trans(e,t,n){const r=this._tx||Ie.trans,o=this.name;function i(e,n,r){if(!r.schema[o])throw new ie.NotFound("Table "+o+" not part of transaction");return t(r.idbtrans,r)}const s=Ze();try{return r&&r.db===this.db?r===Ie.trans?r._promise(e,i,n):st((()=>r._promise(e,i,n)),{trans:r,transless:Ie.transless||Ie}):wt(this.db,e,[this.name],i)}finally{s&&Ye()}}get(e,t){return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",(t=>this.core.get({trans:t,key:e}).then((e=>this.hook.reading.fire(e))))).then(t)}where(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(u(e))return new this.db.WhereClause(this,`[${e.join("+")}]`);const t=c(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);const n=this.schema.indexes.concat(this.schema.primKey).filter((e=>e.compound&&t.every((t=>e.keyPath.indexOf(t)>=0))&&e.keyPath.every((e=>t.indexOf(e)>=0))))[0];if(n&&this.db._maxKey!==Ot)return this.where(n.name).equals(n.keyPath.map((t=>e[t])));!n&&V&&console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit of a compound index [${t.join("+")}]`);const{idxByName:r}=this.schema,o=this.db._deps.indexedDB;function i(e,t){try{return 0===o.cmp(e,t)}catch(e){return!1}}const[s,a]=t.reduce((([t,n],o)=>{const s=r[o],a=e[o];return[t||s,t||!s?Pt(n,s&&s.multi?e=>{const t=k(e,o);return u(t)&&t.some((e=>i(a,e)))}:e=>i(a,k(e,o))):n]}),[null,null]);return s?this.where(s.name).equals(e[s.keyPath]).filter(a):n?this.filter(a):this.where(t).equals("")}filter(e){return this.toCollection().and(e)}count(e){return this.toCollection().count(e)}offset(e){return this.toCollection().offset(e)}limit(e){return this.toCollection().limit(e)}each(e){return this.toCollection().each(e)}toArray(e){return this.toCollection().toArray(e)}toCollection(){return new this.db.Collection(new this.db.WhereClause(this))}orderBy(e){return new this.db.Collection(new this.db.WhereClause(this,u(e)?`[${e.join("+")}]`:e))}reverse(){return this.toCollection().reverse()}mapToClass(e){this.schema.mappedClass=e;const t=t=>{if(!t)return t;const n=Object.create(e.prototype);for(var r in t)if(d(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}defineClass(){return this.mapToClass((function(e){l(this,e)}))}add(e,t){const{auto:n,keyPath:r}=this.schema.primKey;let o=e;return r&&n&&(o=Ct(r)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[o]}))).then((e=>e.numFailures?Le.reject(e.failures[0]):e.lastResult)).then((t=>{if(r)try{P(e,r,t)}catch(e){}return t}))}update(e,t){if("object"!=typeof e||u(e))return this.where(":id").equals(e).modify(t);{const n=k(e,this.schema.primKey.keyPath);if(void 0===n)return vt(new ie.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?c(t).forEach((n=>{P(e,n,t[n])})):t(e,{value:e,primKey:n})}catch(e){}return this.where(":id").equals(n).modify(t)}}put(e,t){const{auto:n,keyPath:r}=this.schema.primKey;let o=e;return r&&n&&(o=Ct(r)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"put",values:[o],keys:null!=t?[t]:null}))).then((e=>e.numFailures?Le.reject(e.failures[0]):e.lastResult)).then((t=>{if(r)try{P(e,r,t)}catch(e){}return t}))}delete(e){return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"delete",keys:[e]}))).then((e=>e.numFailures?Le.reject(e.failures[0]):void 0))}clear(){return this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"deleteRange",range:$t}))).then((e=>e.numFailures?Le.reject(e.failures[0]):void 0))}bulkGet(e){return this._trans("readonly",(t=>this.core.getMany({keys:e,trans:t}).then((e=>e.map((e=>this.hook.reading.fire(e)))))))}bulkAdd(e,t,n){const r=Array.isArray(t)?t:void 0,o=(n=n||(r?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(t=>{const{auto:n,keyPath:i}=this.schema.primKey;if(i&&r)throw new ie.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(r&&r.length!==e.length)throw new ie.InvalidArgument("Arguments objects and keys must have the same length");const s=e.length;let a=i&&n?e.map(Ct(i)):e;return this.core.mutate({trans:t,type:"add",keys:r,values:a,wantResults:o}).then((({numFailures:e,results:t,lastResult:n,failures:r})=>{if(0===e)return o?t:n;throw new ne(`${this.name}.bulkAdd(): ${e} of ${s} operations failed`,r)}))}))}bulkPut(e,t,n){const r=Array.isArray(t)?t:void 0,o=(n=n||(r?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(t=>{const{auto:n,keyPath:i}=this.schema.primKey;if(i&&r)throw new ie.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(r&&r.length!==e.length)throw new ie.InvalidArgument("Arguments objects and keys must have the same length");const s=e.length;let a=i&&n?e.map(Ct(i)):e;return this.core.mutate({trans:t,type:"put",keys:r,values:a,wantResults:o}).then((({numFailures:e,results:t,lastResult:n,failures:r})=>{if(0===e)return o?t:n;throw new ne(`${this.name}.bulkPut(): ${e} of ${s} operations failed`,r)}))}))}bulkDelete(e){const t=e.length;return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"delete",keys:e}))).then((({numFailures:e,lastResult:n,failures:r})=>{if(0===e)return n;throw new ne(`${this.name}.bulkDelete(): ${e} of ${t} operations failed`,r)}))}}function Tt(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 s(e);r||(r=ye),o||(o=ce);var i={subscribers:[],fire:o,subscribe:function(e){-1===i.subscribers.indexOf(e)&&(i.subscribers.push(e),i.fire=r(i.fire,e))},unsubscribe:function(e){i.subscribers=i.subscribers.filter((function(t){return t!==e})),i.fire=i.subscribers.reduce(r,o)}};return t[e]=n[e]=i,i}function s(e){c(e).forEach((function(t){var n=e[t];if(u(n))i(t,e[t][0],e[t][1]);else{if("asap"!==n)throw new ie.InvalidArgument("Invalid event config");var r=i(t,ue,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];r.subscribers.forEach((function(e){E((function(){e.apply(null,t)}))}))}))}}))}}function Dt(e,t){return m(t).from({prototype:e}),t}function It(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function Rt(e,t){e.filter=Pt(e.filter,t)}function Nt(e,t,n){var r=e.replayFilter;e.replayFilter=r?()=>Pt(r(),t()):t,e.justLimit=n&&!r}function Mt(e,t){if(e.isPrimKey)return t.primaryKey;const n=t.getIndexByKeyPath(e.index);if(!n)throw new ie.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function Lt(e,t,n){const r=Mt(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:r,range:e.range}})}function Bt(e,t,n,r){const o=e.replayFilter?Pt(e.filter,e.replayFilter()):e.filter;if(e.or){const i={},s=(e,n,r)=>{if(!o||o(n,r,(e=>n.stop(e)),(e=>n.fail(e)))){var s=n.primaryKey,a=""+s;"[object ArrayBuffer]"===a&&(a=""+new Uint8Array(s)),d(i,a)||(i[a]=!0,t(e,n,r))}};return Promise.all([e.or._iterate(s,n),Ut(Lt(e,r,n),e.algorithm,s,!e.keysOnly&&e.valueMapper)])}return Ut(Lt(e,r,n),Pt(e.algorithm,o),t,!e.keysOnly&&e.valueMapper)}function Ut(e,t,n,r){var o=Je(r?(e,t,o)=>n(r(e),t,o):n);return e.then((e=>{if(e)return e.start((()=>{var n=()=>e.continue();t&&!t(e,(e=>n=e),(t=>{e.stop(t),n=ce}),(t=>{e.fail(t),n=ce}))||o(e.value,e,(e=>n=e)),n()}))}))}function zt(e,t){try{const n=Ft(e),r=Ft(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){const n=e.length,r=t.length,o=n<r?n:r;for(let n=0;n<o;++n)if(e[n]!==t[n])return e[n]<t[n]?-1:1;return n===r?0:n<r?-1:1}(Kt(e),Kt(t));case"Array":return function(e,t){const n=e.length,r=t.length,o=n<r?n:r;for(let n=0;n<o;++n){const r=zt(e[n],t[n]);if(0!==r)return r}return n===r?0:n<r?-1:1}(e,t)}}catch(e){}return NaN}function Ft(e){const t=typeof e;if("object"!==t)return t;if(ArrayBuffer.isView(e))return"binary";const n=L(e);return"ArrayBuffer"===n?"binary":n}function Kt(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}class Vt{_read(e,t){var n=this._ctx;return n.error?n.table._trans(null,vt.bind(null,n.error)):n.table._trans("readonly",e).then(t)}_write(e){var t=this._ctx;return t.error?t.table._trans(null,vt.bind(null,t.error)):t.table._trans("readwrite",e,"locked")}_addAlgorithm(e){var t=this._ctx;t.algorithm=Pt(t.algorithm,e)}_iterate(e,t){return Bt(this._ctx,e,t,this._ctx.table.core)}clone(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&l(n,e),t._ctx=n,t}raw(){return this._ctx.valueMapper=null,this}each(e){var t=this._ctx;return this._read((n=>Bt(t,e,n,t.table.core)))}count(e){return this._read((e=>{const t=this._ctx,n=t.table.core;if(It(t,!0))return n.count({trans:e,query:{index:Mt(t,n.schema),range:t.range}}).then((e=>Math.min(e,t.limit)));var r=0;return Bt(t,(()=>(++r,!1)),e,n).then((()=>r))})).then(e)}sortBy(e,t){const n=e.split(".").reverse(),r=n[0],o=n.length-1;function i(e,t){return t?i(e[n[t]],t-1):e[r]}var s="next"===this._ctx.dir?1:-1;function a(e,t){var n=i(e,o),r=i(t,o);return n<r?-s:n>r?s:0}return this.toArray((function(e){return e.sort(a)})).then(t)}toArray(e){return this._read((e=>{var t=this._ctx;if("next"===t.dir&&It(t,!0)&&t.limit>0){const{valueMapper:n}=t,r=Mt(t,t.table.core.schema);return t.table.core.query({trans:e,limit:t.limit,values:!0,query:{index:r,range:t.range}}).then((({result:e})=>n?e.map(n):e))}{const n=[];return Bt(t,(e=>n.push(e)),e,t.table.core).then((()=>n))}}),e)}offset(e){var t=this._ctx;return e<=0||(t.offset+=e,It(t)?Nt(t,(()=>{var t=e;return(e,n)=>0===t||(1===t?(--t,!1):(n((()=>{e.advance(t),t=0})),!1))})):Nt(t,(()=>{var t=e;return()=>--t<0}))),this}limit(e){return this._ctx.limit=Math.min(this._ctx.limit,e),Nt(this._ctx,(()=>{var t=e;return function(e,n,r){return--t<=0&&n(r),t>=0}}),!0),this}until(e,t){return Rt(this._ctx,(function(n,r,o){return!e(n.value)||(r(o),t)})),this}first(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)}last(e){return this.reverse().first(e)}filter(e){var t,n;return Rt(this._ctx,(function(t){return e(t.value)})),t=this._ctx,n=e,t.isMatch=Pt(t.isMatch,n),this}and(e){return this.filter(e)}or(e){return new this.db.WhereClause(this._ctx.table,e,this)}reverse(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this}desc(){return this.reverse()}eachKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.key,n)}))}eachUniqueKey(e){return this._ctx.unique="unique",this.eachKey(e)}eachPrimaryKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.primaryKey,n)}))}keys(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)}primaryKeys(e){var t=this._ctx;if("next"===t.dir&&It(t,!0)&&t.limit>0)return this._read((e=>{var n=Mt(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})})).then((({result:e})=>e)).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.primaryKey)})).then((function(){return n})).then(e)}uniqueKeys(e){return this._ctx.unique="unique",this.keys(e)}firstKey(e){return this.limit(1).keys((function(e){return e[0]})).then(e)}lastKey(e){return this.reverse().firstKey(e)}distinct(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var n={};return Rt(this._ctx,(function(e){var t=e.primaryKey.toString(),r=d(n,t);return n[t]=!0,!r})),this}modify(e){var t=this._ctx;return this._write((n=>{var r;if("function"==typeof e)r=e;else{var o=c(e),i=o.length;r=function(t){for(var n=!1,r=0;r<i;++r){var s=o[r],a=e[s];k(t,s)!==a&&(P(t,s,a),n=!0)}return n}}const s=t.table.core,{outbound:a,extractKey:u}=s.schema.primaryKey,l=this.db._options.modifyChunkSize||200,f=[];let p=0;const d=[],h=(e,t)=>{const{failures:n,numFailures:r}=t;p+=e-r;for(let e of c(n))f.push(n[e])};return this.clone().primaryKeys().then((o=>{const i=c=>{const f=Math.min(l,o.length-c);return s.getMany({trans:n,keys:o.slice(c,c+f),cache:"immutable"}).then((p=>{const d=[],y=[],g=a?[]:null,m=[];for(let e=0;e<f;++e){const t=p[e],n={value:R(t),primKey:o[c+e]};!1!==r.call(n,n.value,n)&&(null==n.value?m.push(o[c+e]):a||0===zt(u(t),u(n.value))?(y.push(n.value),a&&g.push(o[c+e])):(m.push(o[c+e]),d.push(n.value)))}const b=It(t)&&t.limit===1/0&&("function"!=typeof e||e===qt)&&{index:t.index,range:t.range};return Promise.resolve(d.length>0&&s.mutate({trans:n,type:"add",values:d}).then((e=>{for(let t in e.failures)m.splice(parseInt(t),1);h(d.length,e)}))).then((()=>(y.length>0||b&&"object"==typeof e)&&s.mutate({trans:n,type:"put",keys:g,values:y,criteria:b,changeSpec:"function"!=typeof e&&e}).then((e=>h(y.length,e))))).then((()=>(m.length>0||b&&e===qt)&&s.mutate({trans:n,type:"delete",keys:m,criteria:b}).then((e=>h(m.length,e))))).then((()=>o.length>c+f&&i(c+l)))}))};return i(0).then((()=>{if(f.length>0)throw new te("Error modifying one or more objects",f,p,d);return o.length}))}))}))}delete(){var e=this._ctx,t=e.range;return It(e)&&(e.isPrimKey&&!jt||3===t.type)?this._write((n=>{const{primaryKey:r}=e.table.core.schema,o=t;return e.table.core.count({trans:n,query:{index:r,range:o}}).then((t=>e.table.core.mutate({trans:n,type:"deleteRange",range:o}).then((({failures:e,lastResult:n,results:r,numFailures:o})=>{if(o)throw new te("Could not delete some values",Object.keys(e).map((t=>e[t])),t-o);return t-o}))))})):this.modify(qt)}}const qt=(e,t)=>t.value=null;function Ht(e,t){return e<t?-1:e===t?0:1}function Wt(e,t){return e>t?-1:e===t?0:1}function Gt(e,t,n){var r=e instanceof en?new e.Collection(e):e;return r._ctx.error=n?new n(t):new TypeError(t),r}function Zt(e){return new e.Collection(e,(()=>Jt(""))).limit(0)}function Yt(e,t,n,r,o,i){for(var s=Math.min(e.length,r.length),a=-1,c=0;c<s;++c){var u=t[c];if(u!==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):a>=0?e.substr(0,a)+t[a]+n.substr(a+1):null;o(e[c],u)<0&&(a=c)}return s<r.length&&"next"===i?e+n.substr(e.length):s<e.length&&"prev"===i?e.substr(0,n.length):a<0?null:e.substr(0,a)+r[a]+n.substr(a+1)}function Xt(e,t,n,r){var o,i,s,a,c,u,l,f=n.length;if(!n.every((e=>"string"==typeof e)))return Gt(e,"String expected.");function p(e){o=function(e){return"next"===e?e=>e.toUpperCase():e=>e.toLowerCase()}(e),i=function(e){return"next"===e?e=>e.toLowerCase():e=>e.toUpperCase()}(e),s="next"===e?Ht:Wt;var t=n.map((function(e){return{lower:i(e),upper:o(e)}})).sort((function(e,t){return s(e.lower,t.lower)}));a=t.map((function(e){return e.upper})),c=t.map((function(e){return e.lower})),u=e,l="next"===e?"":r}p("next");var d=new e.Collection(e,(()=>Qt(a[0],c[f-1]+r)));d._ondirectionchange=function(e){p(e)};var h=0;return d._addAlgorithm((function(e,n,r){var o=e.key;if("string"!=typeof o)return!1;var p=i(o);if(t(p,c,h))return!0;for(var d=null,y=h;y<f;++y){var g=Yt(o,p,a[y],c[y],s,u);null===g&&null===d?h=y+1:(null===d||s(d,g)>0)&&(d=g)}return n(null!==d?function(){e.continue(d+l)}:r),!1})),d}function Qt(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function Jt(e){return{type:1,lower:e,upper:e}}class en{get Collection(){return this._ctx.table.db.Collection}between(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)?Zt(this):new this.Collection(this,(()=>Qt(e,t,!n,!r)))}catch(e){return Gt(this,St)}}equals(e){return null==e?Gt(this,St):new this.Collection(this,(()=>Jt(e)))}above(e){return null==e?Gt(this,St):new this.Collection(this,(()=>Qt(e,void 0,!0)))}aboveOrEqual(e){return null==e?Gt(this,St):new this.Collection(this,(()=>Qt(e,void 0,!1)))}below(e){return null==e?Gt(this,St):new this.Collection(this,(()=>Qt(void 0,e,!1,!0)))}belowOrEqual(e){return null==e?Gt(this,St):new this.Collection(this,(()=>Qt(void 0,e)))}startsWith(e){return"string"!=typeof e?Gt(this,"String expected."):this.between(e,e+Ot,!0,!0)}startsWithIgnoreCase(e){return""===e?this.startsWith(e):Xt(this,((e,t)=>0===e.indexOf(t[0])),[e],Ot)}equalsIgnoreCase(e){return Xt(this,((e,t)=>e===t[0]),[e],"")}anyOfIgnoreCase(){var e=F.apply(z,arguments);return 0===e.length?Zt(this):Xt(this,((e,t)=>-1!==t.indexOf(e)),e,"")}startsWithAnyOfIgnoreCase(){var e=F.apply(z,arguments);return 0===e.length?Zt(this):Xt(this,((e,t)=>t.some((t=>0===e.indexOf(t)))),e,Ot)}anyOf(){const e=F.apply(z,arguments);let t=this._cmp;try{e.sort(t)}catch(e){return Gt(this,St)}if(0===e.length)return Zt(this);const n=new this.Collection(this,(()=>Qt(e[0],e[e.length-1])));n._ondirectionchange=n=>{t="next"===n?this._ascending:this._descending,e.sort(t)};let r=0;return n._addAlgorithm(((n,o,i)=>{const s=n.key;for(;t(s,e[r])>0;)if(++r,r===e.length)return o(i),!1;return 0===t(s,e[r])||(o((()=>{n.continue(e[r])})),!1)})),n}notEqual(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){const e=F.apply(z,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return Gt(this,St)}const t=e.reduce(((e,t)=>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})}inAnyRange(e,t){const n=this._cmp,r=this._ascending,o=this._descending,i=this._min,s=this._max;if(0===e.length)return Zt(this);if(!e.every((e=>void 0!==e[0]&&void 0!==e[1]&&r(e[0],e[1])<=0)))return Gt(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",ie.InvalidArgument);const a=!t||!1!==t.includeLowers,c=t&&!0===t.includeUppers;let u,l=r;function f(e,t){return l(e[0],t[0])}try{u=e.reduce((function(e,t){let r=0,o=e.length;for(;r<o;++r){const o=e[r];if(n(t[0],o[1])<0&&n(t[1],o[0])>0){o[0]=i(o[0],t[0]),o[1]=s(o[1],t[1]);break}}return r===o&&e.push(t),e}),[]),u.sort(f)}catch(e){return Gt(this,St)}let p=0;const d=c?e=>r(e,u[p][1])>0:e=>r(e,u[p][1])>=0,h=a?e=>o(e,u[p][0])>0:e=>o(e,u[p][0])>=0;let y=d;const g=new this.Collection(this,(()=>Qt(u[0][0],u[u.length-1][1],!a,!c)));return g._ondirectionchange=e=>{"next"===e?(y=d,l=r):(y=h,l=o),u.sort(f)},g._addAlgorithm(((e,t,n)=>{for(var o=e.key;y(o);)if(++p,p===u.length)return t(n),!1;return!!function(e){return!d(e)&&!h(e)}(o)||(0===this._cmp(o,u[p][1])||0===this._cmp(o,u[p][0])||t((()=>{l===r?e.continue(u[p][0]):e.continue(u[p][1])})),!1)})),g}startsWithAnyOf(){const e=F.apply(z,arguments);return e.every((e=>"string"==typeof e))?0===e.length?Zt(this):this.inAnyRange(e.map((e=>[e,e+Ot]))):Gt(this,"startsWithAnyOf() only works with strings")}}function tn(e){return Je((function(t){return nn(t),e(t.target.error),!1}))}function nn(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}const rn=Tt(null,"storagemutated");class on{_lock(){return x(!Ie.global),++this._reculock,1!==this._reculock||Ie.global||(Ie.lockOwnerFor=this),this}_unlock(){if(x(!Ie.global),0==--this._reculock)for(Ie.global||(Ie.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{ht(e[1],e[0])}catch(e){}}return this}_locked(){return this._reculock&&Ie.lockOwnerFor!==this}create(e){if(!this.mode)return this;const t=this.db.idbdb,n=this.db._state.dbOpenError;if(x(!this.idbtrans),!e&&!t)switch(n&&n.name){case"DatabaseClosedError":throw new ie.DatabaseClosed(n);case"MissingAPIError":throw new ie.MissingAPI(n.message,n);default:throw new ie.OpenFailed(n)}if(!this.active)throw new ie.TransactionInactive;return x(null===this._completion._state),(e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):t.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=Je((t=>{nn(t),this._reject(e.error)})),e.onabort=Je((t=>{nn(t),this.active&&this._reject(new ie.Abort(e.error)),this.active=!1,this.on("abort").fire(t)})),e.oncomplete=Je((()=>{this.active=!1,this._resolve(),"mutatedParts"in e&&rn.storagemutated.fire(e.mutatedParts)})),this}_promise(e,t,n){if("readwrite"===e&&"readwrite"!==this.mode)return vt(new ie.ReadOnly("Transaction is readonly"));if(!this.active)return vt(new ie.TransactionInactive);if(this._locked())return new Le(((r,o)=>{this._blockedFuncs.push([()=>{this._promise(e,t,n).then(r,o)},Ie])}));if(n)return st((()=>{var e=new Le(((e,n)=>{this._lock();const r=t(e,n,this);r&&r.then&&r.then(e,n)}));return e.finally((()=>this._unlock())),e._lib=!0,e}));var r=new Le(((e,n)=>{var r=t(e,n,this);r&&r.then&&r.then(e,n)}));return r._lib=!0,r}_root(){return this.parent?this.parent._root():this}waitFor(e){var t=this._root();const n=Le.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then((()=>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(((e,r)=>{n.then((n=>t._waitingQueue.push(Je(e.bind(null,n)))),(e=>t._waitingQueue.push(Je(r.bind(null,e))))).finally((()=>{t._waitingFor===o&&(t._waitingFor=null)}))}))}abort(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new ie.Abort))}table(e){const t=this._memoizedTables||(this._memoizedTables={});if(d(t,e))return t[e];const n=this.schema[e];if(!n)throw new ie.NotFound("Table "+e+" not part of transaction");const r=new this.db.Table(e,n,this);return r.core=this.db.core.table(e),t[e]=r,r}}function sn(e,t,n,r,o,i,s){return{name:e,keyPath:t,unique:n,multi:r,auto:o,compound:i,src:(n&&!s?"&":"")+(r?"*":"")+(o?"++":"")+an(t)}}function an(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function cn(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:j(n,(e=>[e.name,e]))}}let un=e=>{try{return e.only([[]]),un=()=>[[]],[[]]}catch(e){return un=()=>Ot,Ot}};function ln(e){return null==e?()=>{}:"string"==typeof e?function(e){return 1===e.split(".").length?t=>t[e]:t=>k(t,e)}(e):t=>k(t,e)}function fn(e){return[].slice.call(e)}let pn=0;function dn(e){return null==e?":id":"string"==typeof e?e:`[${e.join("+")}]`}function hn(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");const{lower:n,upper:r,lowerOpen:o,upperOpen:i}=e;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)}const{schema:o,hasGetAll:i}=function(e,t){const n=fn(e.objectStoreNames);return{schema:{name:e.name,tables:n.map((e=>t.objectStore(e))).map((e=>{const{keyPath:t,autoIncrement:n}=e,r=u(t),o=null==t,i={},s={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:o,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:ln(t)},indexes:fn(e.indexNames).map((t=>e.index(t))).map((e=>{const{name:t,unique:n,multiEntry:r,keyPath:o}=e,s={name:t,compound:u(o),keyPath:o,unique:n,multiEntry:r,extractKey:ln(o)};return i[dn(o)]=s,s})),getIndexByKeyPath:e=>i[dn(e)]};return i[":id"]=s.primaryKey,null!=t&&(i[dn(t)]=s.primaryKey),s}))},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),s=o.tables.map((e=>function(e){const t=e.name;return{name:t,schema:e,mutate:function({trans:e,type:n,keys:o,values:i,range:s}){return new Promise(((a,c)=>{a=Je(a);const u=e.objectStore(t),l=null==u.keyPath,f="put"===n||"add"===n;if(!f&&"delete"!==n&&"deleteRange"!==n)throw new Error("Invalid operation type: "+n);const{length:p}=o||i||{length:1};if(o&&i&&o.length!==i.length)throw new Error("Given keys array must have same length as given values array.");if(0===p)return a({numFailures:0,failures:{},results:[],lastResult:void 0});let d;const h=[],y=[];let g=0;const m=e=>{++g,nn(e)};if("deleteRange"===n){if(4===s.type)return a({numFailures:g,failures:y,results:[],lastResult:void 0});3===s.type?h.push(d=u.clear()):h.push(d=u.delete(r(s)))}else{const[e,t]=f?l?[i,o]:[i,null]:[o,null];if(f)for(let r=0;r<p;++r)h.push(d=t&&void 0!==t[r]?u[n](e[r],t[r]):u[n](e[r])),d.onerror=m;else for(let t=0;t<p;++t)h.push(d=u[n](e[t])),d.onerror=m}const b=e=>{const t=e.target.result;h.forEach(((e,t)=>null!=e.error&&(y[t]=e.error))),a({numFailures:g,failures:y,results:"delete"===n?o:h.map((e=>e.result)),lastResult:t})};d.onerror=e=>{m(e),b(e)},d.onsuccess=b}))},getMany:({trans:e,keys:n})=>new Promise(((r,o)=>{r=Je(r);const i=e.objectStore(t),s=n.length,a=new Array(s);let c,u=0,l=0;const f=e=>{const t=e.target;a[t._pos]=t.result,++l===u&&r(a)},p=tn(o);for(let e=0;e<s;++e)null!=n[e]&&(c=i.get(n[e]),c._pos=e,c.onsuccess=f,c.onerror=p,++u);0===u&&r(a)})),get:({trans:e,key:n})=>new Promise(((r,o)=>{r=Je(r);const i=e.objectStore(t).get(n);i.onsuccess=e=>r(e.target.result),i.onerror=tn(o)})),query:function(e){return n=>new Promise(((o,i)=>{o=Je(o);const{trans:s,values:a,limit:c,query:u}=n,l=c===1/0?void 0:c,{index:f,range:p}=u,d=s.objectStore(t),h=f.isPrimaryKey?d:d.index(f.name),y=r(p);if(0===c)return o({result:[]});if(e){const e=a?h.getAll(y,l):h.getAllKeys(y,l);e.onsuccess=e=>o({result:e.target.result}),e.onerror=tn(i)}else{let e=0;const t=a||!("openKeyCursor"in h)?h.openCursor(y):h.openKeyCursor(y),n=[];t.onsuccess=r=>{const i=t.result;return i?(n.push(a?i.value:i.primaryKey),++e===c?o({result:n}):void i.continue()):o({result:n})},t.onerror=tn(i)}}))}(i),openCursor:function({trans:e,values:n,query:o,reverse:i,unique:s}){return new Promise(((a,c)=>{a=Je(a);const{index:u,range:l}=o,f=e.objectStore(t),p=u.isPrimaryKey?f:f.index(u.name),d=i?s?"prevunique":"prev":s?"nextunique":"next",h=n||!("openKeyCursor"in p)?p.openCursor(r(l),d):p.openKeyCursor(r(l),d);h.onerror=tn(c),h.onsuccess=Je((t=>{const n=h.result;if(!n)return void a(null);n.___id=++pn,n.done=!1;const r=n.continue.bind(n);let o=n.continuePrimaryKey;o&&(o=o.bind(n));const i=n.advance.bind(n),s=()=>{throw new Error("Cursor not stopped")};n.trans=e,n.stop=n.continue=n.continuePrimaryKey=n.advance=()=>{throw new Error("Cursor not started")},n.fail=Je(c),n.next=function(){let e=1;return this.start((()=>e--?this.continue():this.stop())).then((()=>this))},n.start=e=>{const t=new Promise(((e,t)=>{e=Je(e),h.onerror=tn(t),n.fail=t,n.stop=t=>{n.stop=n.continue=n.continuePrimaryKey=n.advance=s,e(t)}})),a=()=>{if(h.result)try{e()}catch(e){n.fail(e)}else n.done=!0,n.start=()=>{throw new Error("Cursor behind last entry")},n.stop()};return h.onsuccess=Je((e=>{h.onsuccess=a,a()})),n.continue=r,n.continuePrimaryKey=o,n.advance=i,a(),t},a(n)}),c)}))},count({query:e,trans:n}){const{index:o,range:i}=e;return new Promise(((e,s)=>{const a=n.objectStore(t),c=o.isPrimaryKey?a:a.index(o.name),u=r(i),l=u?c.count(u):c.count();l.onsuccess=Je((t=>e(t.target.result))),l.onerror=tn(s)}))}}}(e))),a={};return s.forEach((e=>a[e.name]=e)),{stack:"dbcore",transaction:e.transaction.bind(e),table(e){if(!a[e])throw new Error(`Table '${e}' not found`);return a[e]},MIN_KEY:-1/0,MAX_KEY:un(t),schema:o}}function yn({_novip:e},t){const n=t.db,r=function(e,t,{IDBKeyRange:n,indexedDB:r},o){const i=function(e,t){return t.reduce(((e,{create:t})=>({...e,...t(e)})),e)}(hn(t,n,o),e.dbcore);return{dbcore:i}}(e._middlewares,n,e._deps,t);e.core=r.dbcore,e.tables.forEach((t=>{const n=t.name;e.core.schema.tables.some((e=>e.name===n))&&(t.core=e.core.table(n),e[n]instanceof e.Table&&(e[n].core=t.core))}))}function gn({_novip:e},t,n,r){n.forEach((n=>{const o=r[n];t.forEach((t=>{const r=v(t,n);(!r||"value"in r&&void 0===r.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?g(t,n,{get(){return this.table(n)},set(e){y(this,n,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[n]=new e.Table(n,o))}))}))}function mn({_novip:e},t){t.forEach((t=>{for(let n in t)t[n]instanceof e.Table&&delete t[n]}))}function bn(e,t){return e._cfg.version-t._cfg.version}function vn(e,t,n,r){const o=e._dbSchema,i=e._createTransaction("readwrite",e._storeNames,o);i.create(n),i._completion.catch(r);const s=i._reject.bind(i),a=Ie.transless||Ie;st((()=>{Ie.trans=i,Ie.transless=a,0===t?(c(o).forEach((e=>{On(n,e,o[e].primKey,o[e].indexes)})),yn(e,n),Le.follow((()=>e.on.populate.fire(i))).catch(s)):function({_novip:e},t,n,r){const o=[],i=e._versions;let s=e._dbSchema=xn(0,e.idbdb,r),a=!1;return i.filter((e=>e._cfg.version>=t)).forEach((i=>{o.push((()=>{const o=s,u=i._cfg.dbschema;En(e,o,r),En(e,u,r),s=e._dbSchema=u;const l=wn(o,u);l.add.forEach((e=>{On(r,e[0],e[1].primKey,e[1].indexes)})),l.change.forEach((e=>{if(e.recreate)throw new ie.Upgrade("Not yet support for changing primary key");{const t=r.objectStore(e.name);e.add.forEach((e=>Sn(t,e))),e.change.forEach((e=>{t.deleteIndex(e.name),Sn(t,e)})),e.del.forEach((e=>t.deleteIndex(e)))}}));const f=i._cfg.contentUpgrade;if(f&&i._cfg.version>t){yn(e,r),n._memoizedTables={},a=!0;let t=$(u);l.del.forEach((e=>{t[e]=o[e]})),mn(e,[e.Transaction.prototype]),gn(e,[e.Transaction.prototype],c(t),t),n.schema=t;const i=K(f);let s;i&&at();const p=Le.follow((()=>{if(s=f(n),s&&i){var e=ct.bind(null,null);s.then(e,e)}}));return s&&"function"==typeof s.then?Le.resolve(s):p.then((()=>s))}})),o.push((t=>{a&&_t||function(e,t){[].slice.call(t.db.objectStoreNames).forEach((n=>null==e[n]&&t.db.deleteObjectStore(n)))}(i._cfg.dbschema,t),mn(e,[e.Transaction.prototype]),gn(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),n.schema=e._dbSchema}))})),function e(){return o.length?Le.resolve(o.shift()(n.idbtrans)).then(e):Le.resolve()}().then((()=>{var e,t;t=r,c(e=s).forEach((n=>{t.db.objectStoreNames.contains(n)||On(t,n,e[n].primKey,e[n].indexes)}))}))}(e,t,i,n).catch(s)}))}function wn(e,t){const n={del:[],add:[],change:[]};let r;for(r in e)t[r]||n.del.push(r);for(r in t){const o=e[r],i=t[r];if(o){const e={name:r,def:i,recreate:!1,del:[],add:[],change:[]};if(""+(o.primKey.keyPath||"")!=""+(i.primKey.keyPath||"")||o.primKey.auto!==i.primKey.auto&&!Et)e.recreate=!0,n.change.push(e);else{const t=o.idxByName,r=i.idxByName;let s;for(s in t)r[s]||e.del.push(s);for(s in r){const n=t[s],o=r[s];n?n.src!==o.src&&e.change.push(o):e.add.push(o)}(e.del.length>0||e.add.length>0||e.change.length>0)&&n.change.push(e)}}else n.add.push([r,i])}return n}function On(e,t,n,r){const o=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach((e=>Sn(o,e))),o}function Sn(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function xn(e,t,n){const r={};return O(t.objectStoreNames,0).forEach((e=>{const t=n.objectStore(e);let o=t.keyPath;const i=sn(an(o),o||"",!1,!1,!!t.autoIncrement,o&&"string"!=typeof o,!0),s=[];for(let e=0;e<t.indexNames.length;++e){const n=t.index(t.indexNames[e]);o=n.keyPath;var a=sn(n.name,o,!!n.unique,!!n.multiEntry,!1,o&&"string"!=typeof o,!1);s.push(a)}r[e]=cn(e,i,s)})),r}function En({_novip:e},t,n){const r=n.db.objectStoreNames;for(let o=0;o<r.length;++o){const i=r[o],s=n.objectStore(i);e._hasGetAll="getAll"in s;for(let e=0;e<s.indexNames.length;++e){const n=s.indexNames[e],r=s.index(n).keyPath,o="string"==typeof r?r:"["+O(r).join("+")+"]";if(t[i]){const e=t[i].idxByName[o];e&&(e.name=n,delete t[i].idxByName[o],t[i].idxByName[n]=e)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&a.WorkerGlobalScope&&a instanceof a.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}class _n{_parseStoresSpec(e,t){c(e).forEach((n=>{if(null!==e[n]){var r=e[n].split(",").map(((e,t)=>{const n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return sn(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),u(r),0===t)})),o=r.shift();if(o.multi)throw new ie.Schema("Primary key cannot be multi-valued");r.forEach((e=>{if(e.auto)throw new ie.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new ie.Schema("Index must have a name and cannot be an empty string")})),t[n]=cn(n,o,r)}}))}stores(e){const t=this.db;this._cfg.storesSource=this._cfg.storesSource?l(this._cfg.storesSource,e):e;const n=t._versions,r={};let o={};return n.forEach((e=>{l(r,e._cfg.storesSource),o=e._cfg.dbschema={},e._parseStoresSpec(r,o)})),t._dbSchema=o,mn(t,[t._allTables,t,t.Transaction.prototype]),gn(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],c(o),o),t._storeNames=c(o),this}upgrade(e){return this._cfg.contentUpgrade=ge(this._cfg.contentUpgrade||ce,e),this}}function jn(e,t){let n=e._dbNamesDB;return n||(n=e._dbNamesDB=new Wn("__dbnames",{addons:[],indexedDB:e,IDBKeyRange:t}),n.version(1).stores({dbnames:"name"})),n.table("dbnames")}function kn(e){return e&&"function"==typeof e.databases}function Pn(e){return st((function(){return Ie.letThrough=!0,e()}))}function $n(){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()}function Cn(e){var t=t=>e.next(t),n=o(t),r=o((t=>e.throw(t)));function o(e){return t=>{var o=e(t),i=o.value;return o.done?i:i&&"function"==typeof i.then?i.then(n,r):u(i)?Promise.all(i).then(n,r):n(i)}}return o(t)()}function An(e,t,n){var r=arguments.length;if(r<2)throw new ie.InvalidArgument("Too few arguments");for(var o=new Array(r-1);--r;)o[r-1]=arguments[r];return n=o.pop(),[e,A(o),n]}function Tn(e,t,n,r,o){return Le.resolve().then((()=>{const i=Ie.transless||Ie,s=e._createTransaction(t,n,e._dbSchema,r),a={trans:s,transless:i};if(r)s.idbtrans=r.idbtrans;else try{s.create(),e._state.PR1398_maxLoop=3}catch(r){return r.name===re.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>Tn(e,t,n,null,o)))):vt(r)}const c=K(o);let u;c&&at();const l=Le.follow((()=>{if(u=o.call(s,s),u)if(c){var e=ct.bind(null,null);u.then(e,e)}else"function"==typeof u.next&&"function"==typeof u.throw&&(u=Cn(u))}),a);return(u&&"function"==typeof u.then?Le.resolve(u).then((e=>s.active?e:vt(new ie.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn")))):l.then((()=>u))).then((e=>(r&&s._resolve(),s._completion.then((()=>e))))).catch((e=>(s._reject(e),vt(e))))}))}function Dn(e,t,n){const r=u(e)?e.slice():[e];for(let e=0;e<n;++e)r.push(t);return r}const In={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return{...e,table(t){const n=e.table(t),{schema:r}=n,o={},i=[];function s(e,t,n){const r=dn(e),a=o[r]=o[r]||[],c=null==e?0:"string"==typeof e?1:e.length,u=t>0,l={...n,isVirtual:u,keyTail:t,keyLength:c,extractKey:ln(e),unique:!u&&n.unique};return a.push(l),l.isPrimaryKey||i.push(l),c>1&&s(2===c?e[0]:e.slice(0,c-1),t+1,n),a.sort(((e,t)=>e.keyTail-t.keyTail)),l}const a=s(r.primaryKey.keyPath,0,r.primaryKey);o[":id"]=[a];for(const e of r.indexes)s(e.keyPath,0,e);function c(t){const n=t.query.index;return n.isVirtual?{...t,query:{index:n,range:(r=t.query.range,o=n.keyTail,{type:1===r.type?2:r.type,lower:Dn(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,o),lowerOpen:!0,upper:Dn(r.upper,r.upperOpen?e.MIN_KEY:e.MAX_KEY,o),upperOpen:!0})}}:t;var r,o}const u={...n,schema:{...r,primaryKey:a,indexes:i,getIndexByKeyPath:function(e){const t=o[dn(e)];return t&&t[0]}},count:e=>n.count(c(e)),query:e=>n.query(c(e)),openCursor(t){const{keyTail:r,isVirtual:o,keyLength:i}=t.query.index;return o?n.openCursor(c(t)).then((n=>n&&function(n){const o=Object.create(n,{continue:{value:function(o){null!=o?n.continue(Dn(o,t.reverse?e.MAX_KEY:e.MIN_KEY,r)):t.unique?n.continue(n.key.slice(0,i).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,r)):n.continue()}},continuePrimaryKey:{value(t,o){n.continuePrimaryKey(Dn(t,e.MAX_KEY,r),o)}},primaryKey:{get:()=>n.primaryKey},key:{get(){const e=n.key;return 1===i?e[0]:e.slice(0,i)}},value:{get:()=>n.value}});return o}(n))):n.openCursor(t)}};return u}}}};function Rn(e,t,n,r){return n=n||{},r=r||"",c(e).forEach((o=>{if(d(t,o)){var i=e[o],s=t[o];if("object"==typeof i&&"object"==typeof s&&i&&s){const e=L(i);e!==L(s)?n[r+o]=t[o]:"Object"===e?Rn(i,s,n,r+o+"."):i!==s&&(n[r+o]=t[o])}else i!==s&&(n[r+o]=t[o])}else n[r+o]=void 0})),c(t).forEach((o=>{d(e,o)||(n[r+o]=t[o])})),n}const Nn={stack:"dbcore",name:"HooksMiddleware",level:2,create:e=>({...e,table(t){const n=e.table(t),{primaryKey:r}=n.schema,o={...n,mutate(e){const o=Ie.trans,{deleting:i,creating:s,updating:a}=o.table(t).hook;switch(e.type){case"add":if(s.fire===ce)break;return o._promise("readwrite",(()=>c(e)),!0);case"put":if(s.fire===ce&&a.fire===ce)break;return o._promise("readwrite",(()=>c(e)),!0);case"delete":if(i.fire===ce)break;return o._promise("readwrite",(()=>c(e)),!0);case"deleteRange":if(i.fire===ce)break;return o._promise("readwrite",(()=>function(e){return u(e.trans,e.range,1e4)}(e)),!0)}return n.mutate(e);function c(e){const t=Ie.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?{...e,keys:o}:{...e}).type&&(e.values=[...e.values]),e.keys&&(e.keys=[...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((c=>{const u=o.map(((n,o)=>{const u=c[o],l={onerror:null,onsuccess:null};if("delete"===e.type)i.fire.call(l,n,u,t);else if("add"===e.type||void 0===u){const i=s.fire.call(l,n,e.values[o],t);null==n&&null!=i&&(n=i,e.keys[o]=n,r.outbound||P(e.values[o],r.keyPath,n))}else{const r=Rn(u,e.values[o]),i=a.fire.call(l,r,n,u,t);if(i){const t=e.values[o];Object.keys(i).forEach((e=>{d(t,e)?t[e]=i[e]:P(t,e,i[e])}))}}return l}));return n.mutate(e).then((({failures:t,results:n,numFailures:r,lastResult:i})=>{for(let r=0;r<o.length;++r){const i=n?n[r]:o[r],s=u[r];null==i?s.onerror&&s.onerror(t[r]):s.onsuccess&&s.onsuccess("put"===e.type&&c[r]?e.values[r]:i)}return{failures:t,results:n,numFailures:r,lastResult:i}})).catch((e=>(u.forEach((t=>t.onerror&&t.onerror(e))),Promise.reject(e))))}))}function u(e,t,o){return n.query({trans:e,values:!1,query:{index:r,range:t},limit:o}).then((({result:n})=>c({type:"delete",keys:n,trans:e}).then((r=>r.numFailures>0?Promise.reject(r.failures[0]):n.length<o?{failures:[],numFailures:0,lastResult:void 0}:u(e,{...t,lower:n[n.length-1],lowerOpen:!0},o)))))}}};return o}})};function Mn(e,t,n){try{if(!t)return null;if(t.keys.length<e.length)return null;const r=[];for(let o=0,i=0;o<t.keys.length&&i<e.length;++o)0===zt(t.keys[o],e[i])&&(r.push(n?R(t.values[o]):t.values[o]),++i);return r.length===e.length?r:null}catch(e){return null}}const Ln={stack:"dbcore",level:-1,create:e=>({table:t=>{const n=e.table(t);return{...n,getMany:e=>{if(!e.cache)return n.getMany(e);const t=Mn(e.keys,e.trans._cache,"clone"===e.cache);return t?Le.resolve(t):n.getMany(e).then((t=>(e.trans._cache={keys:e.keys,values:"clone"===e.cache?R(t):t},t)))},mutate:e=>("add"!==e.type&&(e.trans._cache=null),n.mutate(e))}}})};function Bn(e){return!("from"in e)}const Un=function(e,t){if(!this){const t=new Un;return e&&"d"in e&&l(t,e),t}l(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function zn(e,t,n){const r=zt(t,n);if(isNaN(r))return;if(r>0)throw RangeError();if(Bn(e))return l(e,{from:t,to:n,d:1});const o=e.l,i=e.r;if(zt(n,e.from)<0)return o?zn(o,t,n):e.l={from:t,to:n,d:1,l:null,r:null},Vn(e);if(zt(t,e.to)>0)return i?zn(i,t,n):e.r={from:t,to:n,d:1,l:null,r:null},Vn(e);zt(t,e.from)<0&&(e.from=t,e.l=null,e.d=i?i.d+1:1),zt(n,e.to)>0&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1);const s=!e.r;o&&!e.l&&Fn(e,o),i&&s&&Fn(e,i)}function Fn(e,t){Bn(t)||function e(t,{from:n,to:r,l:o,r:i}){zn(t,n,r),o&&e(t,o),i&&e(t,i)}(e,t)}function Kn(e){let t=Bn(e)?null:{s:0,n:e};return{next(e){const n=arguments.length>0;for(;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&zt(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||zt(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}}}}function Vn(e){var t,n;const 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){const t="r"===o?"l":"r",n={...e},r=e[o];e.from=r.from,e.to=r.to,e[o]=r[o],n[o]=r[t],e[t]=n,n.d=qn(n)}e.d=qn(e)}function qn({r:e,l:t}){return(e?t?Math.max(e.d,t.d):e.d:t?t.d:0)+1}h(Un.prototype,{add(e){return Fn(this,e),this},addKey(e){return zn(this,e,e),this},addKeys(e){return e.forEach((e=>zn(this,e,e))),this},[B](){return Kn(this)}});const Hn={stack:"dbcore",level:0,create:e=>{const t=e.schema.name,n=new Un(e.MIN_KEY,e.MAX_KEY);return{...e,table:r=>{const o=e.table(r),{schema:i}=o,{primaryKey:s}=i,{extractKey:a,outbound:l}=s,f={...o,mutate:e=>{const s=e.trans,a=s.mutatedParts||(s.mutatedParts={}),c=e=>{const n=`idb://${t}/${r}/${e}`;return a[n]||(a[n]=new Un)},l=c(""),f=c(":dels"),{type:p}=e;let[d,h]="deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[];const y=e.trans._cache;return o.mutate(e).then((e=>{if(u(d)){"delete"!==p&&(d=e.results),l.addKeys(d);const t=Mn(d,y);t||"add"===p||f.addKeys(d),(t||h)&&function(e,t,n,r){t.indexes.forEach((function(t){const o=e(t.name||"");function i(e){return null!=e?t.extractKey(e):null}const s=e=>t.multiEntry&&u(e)?e.forEach((e=>o.addKey(e))):o.addKey(e);(n||r).forEach(((e,t)=>{const o=n&&i(n[t]),a=r&&i(r[t]);0!==zt(o,a)&&(null!=o&&s(o),null!=a&&s(a))}))}))}(c,i,t,h)}else if(d){const e={from:d.lower,to:d.upper};f.add(e),l.add(e)}else l.add(n),f.add(n),i.indexes.forEach((e=>c(e.name).add(n)));return e}))}},p=({query:{index:t,range:n}})=>{var r,o;return[t,new Un(null!==(r=n.lower)&&void 0!==r?r:e.MIN_KEY,null!==(o=n.upper)&&void 0!==o?o:e.MAX_KEY)]},d={get:e=>[s,new Un(e.key)],getMany:e=>[s,(new Un).addKeys(e.keys)],count:p,query:p,openCursor:p};return c(d).forEach((e=>{f[e]=function(i){const{subscr:s}=Ie;if(s){const c=e=>{const n=`idb://${t}/${r}/${e}`;return s[n]||(s[n]=new Un)},u=c(""),f=c(":dels"),[p,h]=d[e](i);if(c(p.name||"").add(h),!p.isPrimaryKey){if("count"!==e){const t="query"===e&&l&&i.values&&o.query({...i,values:!1});return o[e].apply(this,arguments).then((n=>{if("query"===e){if(l&&i.values)return t.then((({result:e})=>(u.addKeys(e),n)));const e=i.values?n.result.map(a):n.result;i.values?u.addKeys(e):f.addKeys(e)}else if("openCursor"===e){const e=n,t=i.values;return e&&Object.create(e,{key:{get:()=>(f.addKey(e.primaryKey),e.key)},primaryKey:{get(){const t=e.primaryKey;return f.addKey(t),t}},value:{get:()=>(t&&u.addKey(e.primaryKey),e.value)}})}return n}))}f.add(n)}}return o[e].apply(this,arguments)}})),f}}}};class Wn{constructor(e,t){this._middlewares={},this.verno=0;const n=Wn.dependencies;this._options=t={addons:Wn.addons,autoOpen:!0,indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange,...t},this._deps={indexedDB:t.indexedDB,IDBKeyRange:t.IDBKeyRange};const{addons:r}=t;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;const o={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:ce,dbReadyPromise:null,cancelOpen:ce,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};var i;o.dbReadyPromise=new Le((e=>{o.dbReadyResolve=e})),o.openCanceller=new Le(((e,t)=>{o.cancelOpen=t})),this._state=o,this.name=e,this.on=Tt(this,"populate","blocked","versionchange","close",{ready:[ge,ce]}),this.on.ready.subscribe=S(this.on.ready.subscribe,(e=>(t,n)=>{Wn.vip((()=>{const r=this._state;if(r.openComplete)r.dbOpenError||Le.resolve().then(t),n&&e(t);else if(r.onReadyBeingFired)r.onReadyBeingFired.push(t),n&&e(t);else{e(t);const r=this;n||e((function e(){r.on.ready.unsubscribe(t),r.on.ready.unsubscribe(e)}))}}))})),this.Collection=(i=this,Dt(Vt.prototype,(function(e,t){this.db=i;let n=$t,r=null;if(t)try{n=t()}catch(e){r=e}const o=e._ctx,s=o.table,a=s.hook.reading.fire;this._ctx={table:s,index:o.index,isPrimKey:!o.index||s.schema.primKey.keyPath&&o.index===s.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!==ue?a:null}}))),this.Table=function(e){return Dt(At.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:Tt(null,{creating:[pe,ce],reading:[le,ue],updating:[he,ce],deleting:[de,ce]})}))}(this),this.Transaction=function(e){return Dt(on.prototype,(function(t,n,r,o,i){this.db=e,this.mode=t,this.storeNames=n,this.schema=r,this.chromeTransactionDurability=o,this.idbtrans=null,this.on=Tt(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(((e,t)=>{this._resolve=e,this._reject=t})),this._completion.then((()=>{this.active=!1,this.on.complete.fire()}),(e=>{var t=this.active;return this.active=!1,this.on.error.fire(e),this.parent?this.parent._reject(e):t&&this.idbtrans&&this.idbtrans.abort(),vt(e)}))}))}(this),this.Version=function(e){return Dt(_n.prototype,(function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(e){return Dt(en.prototype,(function(t,n,r){this.db=e,this._ctx={table:t,index:":id"===n?null:n,or:r};const o=e._deps.indexedDB;if(!o)throw new ie.MissingAPI;this._cmp=this._ascending=o.cmp.bind(o),this._descending=(e,t)=>o.cmp(t,e),this._max=(e,t)=>o.cmp(e,t)>0?e:t,this._min=(e,t)=>o.cmp(e,t)<0?e:t,this._IDBKeyRange=e._deps.IDBKeyRange}))}(this),this.on("versionchange",(e=>{e.newVersion>0?console.warn(`Another connection wants to upgrade database '${this.name}'. Closing db now to resume the upgrade.`):console.warn(`Another connection wants to delete database '${this.name}'. Closing db now to resume the delete request.`),this.close()})),this.on("blocked",(e=>{!e.newVersion||e.newVersion<e.oldVersion?console.warn(`Dexie.delete('${this.name}') was blocked`):console.warn(`Upgrade '${this.name}' blocked by other connection holding version ${e.oldVersion/10}`)})),this._maxKey=un(t.IDBKeyRange),this._createTransaction=(e,t,n,r)=>new this.Transaction(e,t,n,this._options.chromeTransactionDurability,r),this._fireOnBlocked=e=>{this.on("blocked").fire(e),xt.filter((e=>e.name===this.name&&e!==this&&!e._state.vcFired)).map((t=>t.on("versionchange").fire(e)))},this.use(In),this.use(Nn),this.use(Hn),this.use(Ln),this.vip=Object.create(this,{_vip:{value:!0}}),r.forEach((e=>e(this)))}version(e){if(isNaN(e)||e<.1)throw new ie.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new ie.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);const t=this._versions;var n=t.filter((t=>t._cfg.version===e))[0];return n||(n=new this.Version(e),t.push(n),t.sort(bn),n.stores({}),this._state.autoSchema=!1,n)}_whenReady(e){return this.idbdb&&(this._state.openComplete||Ie.letThrough||this._vip)?e():new Le(((e,t)=>{if(this._state.openComplete)return t(new ie.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void t(new ie.DatabaseClosed);this.open().catch(ce)}this._state.dbReadyPromise.then(e,t)})).then(e)}use({stack:e,create:t,level:n,name:r}){r&&this.unuse({stack:e,name:r});const o=this._middlewares[e]||(this._middlewares[e]=[]);return o.push({stack:e,create:t,level:null==n?10:n,name:r}),o.sort(((e,t)=>e.level-t.level)),this}unuse({stack:e,name:t,create:n}){return e&&this._middlewares[e]&&(this._middlewares[e]=this._middlewares[e].filter((e=>n?e.create!==n:!!t&&e.name!==t))),this}open(){return function(e){const t=e._state,{indexedDB:n}=e._deps;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((()=>t.dbOpenError?vt(t.dbOpenError):e));V&&(t.openCanceller._stackHolder=G()),t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;const r=t.openCanceller;function o(){if(t.openCanceller!==r)throw new ie.DatabaseClosed("db.open() was cancelled")}let i=t.dbReadyResolve,s=null,a=!1;return Le.race([r,("undefined"==typeof navigator?Le.resolve():$n()).then((()=>new Le(((r,i)=>{if(o(),!n)throw new ie.MissingAPI;const u=e.name,l=t.autoSchema?n.open(u):n.open(u,Math.round(10*e.verno));if(!l)throw new ie.MissingAPI;l.onerror=tn(i),l.onblocked=Je(e._fireOnBlocked),l.onupgradeneeded=Je((r=>{if(s=l.transaction,t.autoSchema&&!e._options.allowEmptyDB){l.onerror=nn,s.abort(),l.result.close();const e=n.deleteDatabase(u);e.onsuccess=e.onerror=Je((()=>{i(new ie.NoSuchDatabase(`Database ${u} doesnt exist`))}))}else{s.onerror=tn(i);var o=r.oldVersion>Math.pow(2,62)?0:r.oldVersion;a=o<1,e._novip.idbdb=l.result,vn(e,o/10,s,i)}}),i),l.onsuccess=Je((()=>{s=null;const n=e._novip.idbdb=l.result,o=O(n.objectStoreNames);if(o.length>0)try{const r=n.transaction(1===(i=o).length?i[0]:i,"readonly");t.autoSchema?function({_novip:e},t,n){e.verno=t.version/10;const r=e._dbSchema=xn(0,t,n);e._storeNames=O(t.objectStoreNames,0),gn(e,[e._allTables],c(r),r)}(e,n,r):(En(e,e._dbSchema,r),function(e,t){const n=wn(xn(0,e.idbdb,t),e._dbSchema);return!(n.add.length||n.change.some((e=>e.add.length||e.change.length)))}(e,r)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),yn(e,r)}catch(e){}var i;xt.push(e),n.onversionchange=Je((n=>{t.vcFired=!0,e.on("versionchange").fire(n)})),n.onclose=Je((t=>{e.on("close").fire(t)})),a&&function({indexedDB:e,IDBKeyRange:t},n){!kn(e)&&"__dbnames"!==n&&jn(e,t).put({name:n}).catch(ce)}(e._deps,u),r()}),i)}))))]).then((()=>(o(),t.onReadyBeingFired=[],Le.resolve(Pn((()=>e.on.ready.fire(e.vip)))).then((function n(){if(t.onReadyBeingFired.length>0){let r=t.onReadyBeingFired.reduce(ge,ce);return t.onReadyBeingFired=[],Le.resolve(Pn((()=>r(e.vip)))).then(n)}}))))).finally((()=>{t.onReadyBeingFired=null,t.isBeingOpened=!1})).then((()=>e)).catch((n=>{t.dbOpenError=n;try{s&&s.abort()}catch(e){}return r===t.openCanceller&&e._close(),vt(n)})).finally((()=>{t.openComplete=!0,i()}))}(this)}_close(){const e=this._state,t=xt.indexOf(this);if(t>=0&&xt.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new Le((t=>{e.dbReadyResolve=t})),e.openCanceller=new Le(((t,n)=>{e.cancelOpen=n}))}close(){this._close();const e=this._state;this._options.autoOpen=!1,e.dbOpenError=new ie.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)}delete(){const e=arguments.length>0,t=this._state;return new Le(((n,r)=>{const o=()=>{this.close();var e=this._deps.indexedDB.deleteDatabase(this.name);e.onsuccess=Je((()=>{!function({indexedDB:e,IDBKeyRange:t},n){!kn(e)&&"__dbnames"!==n&&jn(e,t).delete(n).catch(ce)}(this._deps,this.name),n()})),e.onerror=tn(r),e.onblocked=this._fireOnBlocked};if(e)throw new ie.InvalidArgument("Arguments not allowed in db.delete()");t.isBeingOpened?t.dbReadyPromise.then(o):o()}))}backendDB(){return this.idbdb}isOpen(){return null!==this.idbdb}hasBeenClosed(){const e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name}hasFailed(){return null!==this._state.dbOpenError}dynamicallyOpened(){return this._state.autoSchema}get tables(){return c(this._allTables).map((e=>this._allTables[e]))}transaction(){const e=An.apply(this,arguments);return this._transaction.apply(this,e)}_transaction(e,t,n){let r=Ie.trans;r&&r.db===this&&-1===e.indexOf("!")||(r=null);const o=-1!==e.indexOf("?");let i,s;e=e.replace("!","").replace("?","");try{if(s=t.map((e=>{var t=e instanceof this.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 ie.InvalidArgument("Invalid transaction mode: "+e);i="readwrite"}if(r){if("readonly"===r.mode&&"readwrite"===i){if(!o)throw new ie.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");r=null}r&&s.forEach((e=>{if(r&&-1===r.storeNames.indexOf(e)){if(!o)throw new ie.SubTransaction("Table "+e+" not included in parent transaction.");r=null}})),o&&r&&!r.active&&(r=null)}}catch(e){return r?r._promise(null,((t,n)=>{n(e)})):vt(e)}const a=Tn.bind(null,this,i,s,r,n);return r?r._promise(i,a,"lock"):Ie.trans?ht(Ie.transless,(()=>this._whenReady(a))):this._whenReady(a)}table(e){if(!d(this._allTables,e))throw new ie.InvalidTable(`Table ${e} does not exist`);return this._allTables[e]}}const Gn="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";class Zn{constructor(e){this._subscribe=e}subscribe(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})}[Gn](){return this}}function Yn(e,t){return c(t).forEach((n=>{Fn(e[n]||(e[n]=new Un),t[n])})),e}let Xn;try{Xn={indexedDB:a.indexedDB||a.mozIndexedDB||a.webkitIndexedDB||a.msIndexedDB,IDBKeyRange:a.IDBKeyRange||a.webkitIDBKeyRange}}catch(a){Xn={indexedDB:null,IDBKeyRange:null}}const Qn=Wn;function Jn(e){let t=er;try{er=!0,rn.storagemutated.fire(e)}finally{er=t}}h(Qn,{...ae,delete:e=>new Qn(e,{addons:[]}).delete(),exists:e=>new Qn(e,{addons:[]}).open().then((e=>(e.close(),!0))).catch("NoSuchDatabaseError",(()=>!1)),getDatabaseNames(e){try{return function({indexedDB:e,IDBKeyRange:t}){return kn(e)?Promise.resolve(e.databases()).then((e=>e.map((e=>e.name)).filter((e=>"__dbnames"!==e)))):jn(e,t).toCollection().primaryKeys()}(Qn.dependencies).then(e)}catch(e){return vt(new ie.MissingAPI)}},defineClass:()=>function(e){l(this,e)},ignoreTransaction:e=>Ie.trans?ht(Ie.transless,e):e(),vip:Pn,async:function(e){return function(){try{var t=Cn(e.apply(this,arguments));return t&&"function"==typeof t.then?t:Le.resolve(t)}catch(e){return vt(e)}}},spawn:function(e,t,n){try{var r=Cn(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:Le.resolve(r)}catch(e){return vt(e)}},currentTransaction:{get:()=>Ie.trans||null},waitFor:function(e,t){const n=Le.resolve("function"==typeof e?Qn.ignoreTransaction(e):e).timeout(t||6e4);return Ie.trans?Ie.trans.waitFor(n):n},Promise:Le,debug:{get:()=>V,set:e=>{q(e,"dexie"===e?()=>!0:kt)}},derive:m,extend:l,props:h,override:S,Events:Tt,on:rn,liveQuery:function(e){return new Zn((t=>{const n=K(e);let r=!1,o={},i={};const s={get closed(){return r},unsubscribe:()=>{r=!0,rn.storagemutated.unsubscribe(f)}};t.start&&t.start(s);let a=!1,u=!1;function l(){return c(i).some((e=>o[e]&&function(e,t){const n=Kn(t);let r=n.next();if(r.done)return!1;let o=r.value;const i=Kn(e);let s=i.next(o.from),a=s.value;for(;!r.done&&!s.done;){if(zt(a.from,o.to)<=0&&zt(a.to,o.from)>=0)return!0;zt(o.from,a.from)<0?o=(r=n.next(a.from)).value:a=(s=i.next(o.from)).value}return!1}(o[e],i[e])))}const f=e=>{Yn(o,e),l()&&p()},p=()=>{if(a||r)return;o={};const c={},d=function(t){n&&at();const r=()=>st(e,{subscr:t,trans:null}),o=Ie.trans?ht(Ie.transless,r):r();return n&&o.then(ct,ct),o}(c);u||(rn("storagemutated",f),u=!0),a=!0,Promise.resolve(d).then((e=>{a=!1,r||(l()?p():(o={},i=c,t.next&&t.next(e)))}),(e=>{a=!1,t.error&&t.error(e),s.unsubscribe()}))};return p(),s}))},extendObservabilitySet:Yn,getByKeyPath:k,setByKeyPath:P,delByKeyPath:function(e,t){"string"==typeof t?P(e,t,void 0):"length"in t&&[].map.call(t,(function(t){P(e,t,void 0)}))},shallowClone:$,deepClone:R,getObjectDiff:Rn,cmp:zt,asap:E,minKey:-1/0,addons:[],connections:xt,errnames:re,dependencies:Xn,semVer:"3.2.3",version:"3.2.3".split(".").map((e=>parseInt(e))).reduce(((e,t,n)=>e+t/Math.pow(10,2*n)))}),Qn.maxKey=un(Qn.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(rn("storagemutated",(e=>{if(!er){let t;Et?(t=document.createEvent("CustomEvent"),t.initCustomEvent("x-storagemutated-1",!0,!0,e)):t=new CustomEvent("x-storagemutated-1",{detail:e}),er=!0,dispatchEvent(t),er=!1}})),addEventListener("x-storagemutated-1",(({detail:e})=>{er||Jn(e)})));let er=!1;if("undefined"!=typeof BroadcastChannel){const e=new BroadcastChannel("x-storagemutated-1");"function"==typeof e.unref&&e.unref(),rn("storagemutated",(t=>{er||e.postMessage(t)})),e.onmessage=e=>{e.data&&Jn(e.data)}}else if("undefined"!=typeof self&&"undefined"!=typeof navigator){rn("storagemutated",(e=>{try{er||("undefined"!=typeof localStorage&&localStorage.setItem("x-storagemutated-1",JSON.stringify({trig:Math.random(),changedParts:e})),"object"==typeof self.clients&&[...self.clients.matchAll({includeUncontrolled:!0})].forEach((t=>t.postMessage({type:"x-storagemutated-1",changedParts:e}))))}catch(e){}})),"undefined"!=typeof addEventListener&&addEventListener("storage",(e=>{if("x-storagemutated-1"===e.key){const t=JSON.parse(e.newValue);t&&Jn(t.changedParts)}}));const e=self.document&&navigator.serviceWorker;e&&e.addEventListener("message",(function({data:e}){e&&"x-storagemutated-1"===e.type&&Jn(e.changedParts)}))}function tr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Le.rejectionMapper=function(e,t){if(!e||e instanceof J||e instanceof TypeError||e instanceof SyntaxError||!e.name||!se[e.name])return e;var n=new se[e.name](t||e.message,e);return"stack"in e&&g(n,"stack",{get:function(){return this.inner.stack}}),n},q(V,kt);class nr extends Wn{constructor(){super("EsmOffline"),tr(this,"syncQueue",void 0),tr(this,"dynamicOfflineData",void 0),this.version(4).stores({syncQueue:"++id,userId,type,[userId+type]",dynamicOfflineData:"++id,type,identifier,*users,&[type+identifier]"}),this.syncQueue=this.table("syncQueue"),this.dynamicOfflineData=this.table("dynamicOfflineData")}}function rr(){return new nr}function or(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function ir(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){or(i,r,o,s,a,"next",e)}function a(e){or(i,r,o,s,a,"throw",e)}s(void 0)}))}}const sr={};function ar(){return Object.values(sr)}function cr(e){sr[e.id]&&console.warn(`[setupDynamicOfflineDataHandler] Another second handler with the ID "${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.`),sr[e.id]=e}function ur(e){return lr.apply(this,arguments)}function lr(){return(lr=ir((function*(e){const t=yield _r();return yield fr(t,e)}))).apply(this,arguments)}function fr(e,t){return pr.apply(this,arguments)}function pr(){return pr=ir((function*(e,t){const n=t?{type:t,users:e}:{users:e},r=new nr;return yield r.dynamicOfflineData.where(n).toArray().catch(Wn.errnames.DatabaseClosed,(()=>[]))})),pr.apply(this,arguments)}function dr(e,t){return hr.apply(this,arguments)}function hr(){return(hr=ir((function*(e,t){const n=yield _r();return yield yr(n,e,t)}))).apply(this,arguments)}function yr(e,t,n){return gr.apply(this,arguments)}function gr(){return gr=ir((function*(e,t,n){const r=new nr,o=yield r.dynamicOfflineData.get({type:t,identifier:n}).catch(Wn.errnames.DatabaseClosed,(()=>{}));o?o.users.includes(e)||(yield r.dynamicOfflineData.update(o.id,{users:[...o.users,e]}).catch(Wn.errnames.DatabaseClosed)):yield r.dynamicOfflineData.add({users:[e],type:t,identifier:n}).catch(Wn.errnames.DatabaseClosed)})),gr.apply(this,arguments)}function mr(e,t){return br.apply(this,arguments)}function br(){return(br=ir((function*(e,t){const n=yield _r();return yield vr(n,e,t)}))).apply(this,arguments)}function vr(e,t,n){return wr.apply(this,arguments)}function wr(){return wr=ir((function*(e,t,n){const r=new nr,o=yield r.dynamicOfflineData.get({type:t,identifier:n,users:e}).catch(Wn.errnames.DatabaseClosed,(()=>{}));o&&(o.users.length>1?yield r.dynamicOfflineData.update(o.id,{users:o.users.filter((t=>t!==e))}).catch(Wn.errnames.DatabaseClosed):yield r.dynamicOfflineData.delete(o.id).catch(Wn.errnames.DatabaseClosed))})),wr.apply(this,arguments)}function Or(e,t){return Sr.apply(this,arguments)}function Sr(){return Sr=ir((function*(e,t){const n=yield ur(e);var r;yield Promise.all(n.map((r=ir((function*(e){return xr(e.type,e.identifier,t)})),function(e){return r.apply(this,arguments)})))})),Sr.apply(this,arguments)}function xr(e,t,n){return Er.apply(this,arguments)}function Er(){return Er=ir((function*(e,t,n){yield dr(e,t);const r=new nr,o=yield _r(),i=yield r.dynamicOfflineData.get({type:e,identifier:t}).catch(Wn.errnames.DatabaseClosed,(()=>{})),s=ar().filter((t=>t.type===e));if(!i)return;const a=yield Promise.all(s.map((c=ir((function*(e){try{return e.sync(t,n),{id:e.id,error:void 0}}catch(t){var r,o;const n=null!==(o=null===(r=t.message)||void 0===r?void 0:r.toString())&&void 0!==o?o:t.toString();return{id:e.id,error:n}}})),function(e){return c.apply(this,arguments)})));var c;const u=a.filter((e=>!e.error)).map((e=>e.id)),l=a.filter((e=>e.error)).map((e=>e.id)),f=a.filter((e=>e.error)).map((e=>({handlerId:e.id,message:e.error}))),p={syncedOn:new Date,syncedBy:o,succeededHandlers:u,erroredHandlers:l,errors:f};i.id&&(yield r.dynamicOfflineData.update(i.id,{syncState:p}).catch(Wn.errnames.DatabaseClosed))})),Er.apply(this,arguments)}function _r(){return jr.apply(this,arguments)}function jr(){return(jr=ir((function*(){const e=(yield(0,s.getLoggedInUser)()).uuid;if(!e)throw new Error("Using the dynamic offline data API requires a logged in user.");return e}))).apply(this,arguments)}function kr(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}const Pr=(0,i.createGlobalStore)("offline-patients",{offlinePatientDataSyncState:{},handlers:{}});function $r(){return Dr(),Pr}function Cr(e,t){Dr(),cr({type:"patient",displayName:t.displayName,id:e,isSynced:()=>Promise.resolve(!0),sync:(e,n)=>t.onOfflinePatientAdded({patientUuid:e,signal:null!=n?n:(new AbortController).signal})})}function Ar(e){return Tr.apply(this,arguments)}function Tr(){return Tr=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){kr(i,r,o,s,a,"next",e)}function a(e){kr(i,r,o,s,a,"throw",e)}s(void 0)}))}}((function*(e){Dr(),yield xr("patient",e)})),Tr.apply(this,arguments)}function Dr(){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.")}try{self["workbox:window:6.5.3"]&&_()}catch(u){}function Ir(e,t){return new Promise((function(n){var r=new MessageChannel;r.port1.onmessage=function(e){n(e.data)},e.postMessage(t,[r.port2])}))}function Rr(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}try{self["workbox:core:6.5.3"]&&_()}catch(u){}var Nr=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t,e.reject=n}))};function Mr(e,t){var n=location.href;return new URL(e,n).href===new URL(t,n).href}var Lr=function(e,t){this.type=e,Object.assign(this,t)};function Br(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function Ur(){}var zr={type:"SKIP_WAITING"};function Fr(e,t){if(!t)return e&&e.then?e.then(Ur):Promise.resolve()}let Kr;function Vr(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function qr(e){return Hr.apply(this,arguments)}function Hr(){return Hr=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){Vr(i,r,o,s,a,"next",e)}function a(e){Vr(i,r,o,s,a,"throw",e)}s(void 0)}))}}((function*(e){const t=yield null!=Kr?Kr:Promise.resolve(void 0);return t?yield t.messageSW(e):{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."}})),Hr.apply(this,arguments)}!function(e){var t,n;function r(t,n){var r,o;return void 0===n&&(n={}),(r=e.call(this)||this).nn={},r.tn=0,r.rn=new Nr,r.en=new Nr,r.on=new Nr,r.un=0,r.an=new Set,r.cn=function(){var e=r.fn,t=e.installing;r.tn>0||!Mr(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,s={sw:n,isExternal:i,originalEvent:e};!i&&r.mn&&(s.isUpdate=!0),r.dispatchEvent(new Lr(o,s)),"installed"===o?r.wn=self.setTimeout((function(){"installed"===o&&t.waiting===n&&r.dispatchEvent(new Lr("waiting",s))}),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 Lr("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 Br(r.getSW(),(function(){r.an.has(o)&&r.dispatchEvent(new Lr("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=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var o,i=r.prototype;i.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 Fr(new Promise((function(e){return window.addEventListener("load",e)})))}),(function(){return r.mn=Boolean(navigator.serviceWorker.controller),r.yn=r.pn(),Br(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&&Mr(t.scriptURL,r.sn.toString())&&(r.hn=t,Promise.resolve().then((function(){r.dispatchEvent(new Lr("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)}},i.update=function(){try{return this.fn?Fr(this.fn.update()):void 0}catch(e){return Promise.reject(e)}},i.getSW=function(){return void 0!==this.hn?Promise.resolve(this.hn):this.rn.promise},i.messageSW=function(e){try{return Br(this.getSW(),(function(t){return Ir(t,e)}))}catch(e){return Promise.reject(e)}},i.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&Ir(this.fn.waiting,zr)},i.pn=function(){var e=navigator.serviceWorker.controller;return e&&Mr(e.scriptURL,this.sn.toString())?e:void 0},i.bn=function(){try{var e=this;return function(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}((function(){return Br(navigator.serviceWorker.register(e.sn,e.nn),(function(t){return e.un=performance.now(),t}))}),(function(e){throw e}))}catch(e){return Promise.reject(e)}},(o=[{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)}}(r.prototype,o)}(function(){function e(){this.Pn=new Map}var 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 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}}(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}());const Wr="x-omrs-offline-response-body",Gr="x-omrs-offline-response-status",Zr="x-omrs-offline-caching-strategy",Yr={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Xr;const Qr=new Uint8Array(16);function Jr(){if(!Xr&&(Xr="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Xr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Xr(Qr)}const eo=[];for(let e=0;e<256;++e)eo.push((e+256).toString(16).slice(1));const to=function(e,t,n){if(Yr.randomUUID&&!t&&!e)return Yr.randomUUID();const r=(e=e||{}).random||(e.rng||Jr)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return(eo[e[t+0]]+eo[e[t+1]]+eo[e[t+2]]+eo[e[t+3]]+"-"+eo[e[t+4]]+eo[e[t+5]]+"-"+eo[e[t+6]]+eo[e[t+7]]+"-"+eo[e[t+8]]+eo[e[t+9]]+"-"+eo[e[t+10]]+eo[e[t+11]]+eo[e[t+12]]+eo[e[t+13]]+eo[e[t+14]]+eo[e[t+15]]).toLowerCase()}(r)},no="OFFLINE+";function ro(){return no+to()}function oo(e){return e.startsWith(no)}function io(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function so(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){io(i,r,o,s,a,"next",e)}function a(e){io(i,r,o,s,a,"throw",e)}s(void 0)}))}}const ao=new nr,co={};function uo(){return lo.apply(this,arguments)}function lo(){return(lo=so((function*(){const e=yield(0,s.getLoggedInUser)();return(null==e?void 0:e.uuid)||"*"}))).apply(this,arguments)}function fo(){return(fo=so((function*(e,t,n,r){const o=r&&r.id;return void 0!==o&&(yield ao.syncQueue.where({type:t,userId:e}).filter((e=>(null==e?void 0:e.descriptor.id)===o)).delete().catch(Wn.errnames.DatabaseClosed)),yield ao.syncQueue.add({type:t,content:n,userId:e,descriptor:r||{},createdOn:new Date}).catch(Wn.errnames.DatabaseClosed,(()=>-1))}))).apply(this,arguments)}function po(e,t,n){return ho.apply(this,arguments)}function ho(){return ho=so((function*(e,t,n){const r=yield uo();return yield function(e,t,n,r){return fo.apply(this,arguments)}(r,e,t,n)})),ho.apply(this,arguments)}function yo(){return(yo=so((function*(e,t){return(yield go(e,t)).map((e=>e.content))}))).apply(this,arguments)}function go(e,t){return mo.apply(this,arguments)}function mo(){return(mo=so((function*(e,t){const n=t?{type:t,userId:e}:{userId:e};return yield ao.syncQueue.where(n).toArray().catch(Wn.errnames.DatabaseClosed,(()=>[]))}))).apply(this,arguments)}function bo(e){return vo.apply(this,arguments)}function vo(){return vo=so((function*(e){const t=yield uo();return yield function(e,t){return yo.apply(this,arguments)}(t,e)})),vo.apply(this,arguments)}function wo(e){return Oo.apply(this,arguments)}function Oo(){return(Oo=so((function*(e){const t=yield uo();return yield go(t,e)}))).apply(this,arguments)}function So(e){return xo.apply(this,arguments)}function xo(){return(xo=so((function*(e){return yield ao.syncQueue.get(e).catch(Wn.errnames.DatabaseClosed,(()=>{}))}))).apply(this,arguments)}function Eo(e){var t;return!!(null===(t=co[e])||void 0===t?void 0:t.options.onBeginEditSyncItem)}function _o(e){return jo.apply(this,arguments)}function jo(){return(jo=so((function*(e){var t;const n=yield So(e);if(!n)throw new Error(`No sync item with the ID ${e} exists.`);const r=null===(t=co[n.type])||void 0===t?void 0:t.options.onBeginEditSyncItem;if(!r)throw new Error(`A sync item with the ID ${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 "${n.type}" supports editing items.`);r(n)}))).apply(this,arguments)}function ko(e){return Po.apply(this,arguments)}function Po(){return(Po=so((function*(e){yield ao.syncQueue.delete(e).catch(Wn.errnames.DatabaseClosed)}))).apply(this,arguments)}function $o(e,t,n,r={}){co[e]={type:e,dependsOn:t,process:n,options:r}}(0,i.createGlobalStore)("offline-synchronization",{})},5492:(e,t,n)=>{function r(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(o,i){var s=e.apply(t,n);function a(e){r(s,o,i,a,c,"next",e)}function c(e){r(s,o,i,a,c,"throw",e)}a(void 0)}))}}function i(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){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){i(e,t,n[t])}))}return e}e=n.nmd(e),System.register(["react","@openmrs/esm-config","@openmrs/esm-extensions","@openmrs/esm-globals","react-dom","i18next","react-i18next","@openmrs/esm-api","dayjs"],(function(r,i){var a={},c={},u={},l={},f={},p={},d={},h={},y={};return Object.defineProperty(a,"__esModule",{value:!0}),Object.defineProperty(f,"__esModule",{value:!0}),{setters:[function(e){Object.keys(e).forEach((function(t){a[t]=e[t]}))},function(e){c.getConfigStore=e.getConfigStore,c.getExtensionConfigFromStore=e.getExtensionConfigFromStore,c.getExtensionsConfigStore=e.getExtensionsConfigStore,c.interpolateUrl=e.interpolateUrl,c.navigate=e.navigate},function(e){u.getConnectedExtensions=e.getConnectedExtensions,u.getExtensionInternalStore=e.getExtensionInternalStore,u.getExtensionStore=e.getExtensionStore,u.registerExtensionSlot=e.registerExtensionSlot,u.renderExtension=e.renderExtension},function(e){l.subscribeConnectivityChanged=e.subscribeConnectivityChanged},function(e){Object.keys(e).forEach((function(t){f[t]=e[t]}))},function(e){p.default=e.default},function(e){d.I18nextProvider=e.I18nextProvider},function(e){h.defaultVisitCustomRepresentation=e.defaultVisitCustomRepresentation,h.fetchCurrentPatient=e.fetchCurrentPatient,h.getCurrentUser=e.getCurrentUser,h.getLocations=e.getLocations,h.getSessionStore=e.getSessionStore,h.getVisitTypes=e.getVisitTypes,h.openmrsFetch=e.openmrsFetch,h.userHasAccess=e.userHasAccess},function(e){y.default=e.default}],execute:function(){r((()=>{var r={403:()=>{System.register([],(function(e,t){return{execute:function(){e((()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{createAppState:()=>a,createGlobalStore:()=>i,getAppState:()=>c,getGlobalStore:()=>s,subscribeTo:()=>u});const n=e=>{let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!=typeof o)?o:Object.assign({},t,o),n.forEach((n=>n(t,e)))}},o=()=>t,i={setState:r,getState:o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{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},r=e=>e?n(e):n,o={};function i(e,t){const n=o[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;{const n=r()((()=>t));return o[e]={value:n,active:!0},n}}function s(e,t){const n=o[e];if(!n){const n=r()((()=>null!=t?t:{}));return o[e]={value:n,active:!1},n}return n.value}function a(e){return i("app",e)}function c(){return s("app",{})}function u(e,t,n){let r=t(e.getState());return e.subscribe((e=>{const o=t(e);o!==r&&(r=o,n(o))}))}return t})())}}}))},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)}}}()},645:(e,t,n)=>{"use strict";var r=n(493);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},173:(e,t,n)=>{"use strict";var r=n(954),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,s=r.useEffect,a=r.useLayoutEffect,c=r.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,l=r[1];return a((function(){o.value=n,o.getSnapshot=t,u(o)&&l({inst:o})}),[e,n,t]),s((function(){return u(o)&&l({inst:o}),e((function(){u(o)&&l({inst:o})}))}),[e]),c(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:l},374:(e,t,n)=>{"use strict";e.exports=n(173)},766:e=>{"use strict";e.exports=h},824:e=>{"use strict";e.exports=c},45:e=>{"use strict";e.exports=u},728:e=>{"use strict";e.exports=l},688:e=>{"use strict";e.exports=y},64:e=>{"use strict";e.exports=p},954:e=>{"use strict";e.exports=a},493:e=>{"use strict";e.exports=f},281:e=>{"use strict";e.exports=d}},i={};function g(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={exports:{}};return r[e].call(n.exports,n,n.exports,g),n.exports}g.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return g.d(t,{a:t}),t},g.d=(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=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),g.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var m={};return(()=>{"use strict";g.r(m),g.d(m,{ComponentContext:()=>i,ConfigurableLink:()=>u,Extension:()=>y,ExtensionSlot:()=>Et,UserHasAccess:()=>xn,createUseStore:()=>f,getAsyncExtensionLifecycle:()=>Xt,getAsyncLifecycle:()=>Zt,getLifecycle:()=>Gt,getSyncLifecycle:()=>Yt,isDesktop:()=>wn,openmrsComponentDecorator:()=>Wt,useAssignedExtensionIds:()=>Qt,useAssignedExtensions:()=>bt,useBodyScrollLock:()=>Jt,useConfig:()=>rn,useConnectedExtensions:()=>vt,useConnectivity:()=>v,useExtensionInternalStore:()=>hn,useExtensionSlot:()=>wt,useExtensionSlotMeta:()=>yn,useExtensionStore:()=>gn,useForceUpdate:()=>mn,useLayoutType:()=>vn,useLocations:()=>On,useOnClickOutside:()=>Sn,usePagination:()=>kr,usePatient:()=>dn,useSession:()=>jn,useStore:()=>Cn,useStoreWithActions:()=>An,useVisit:()=>Er,useVisitTypes:()=>_r});var r=g(954);const i=r.default.createContext({moduleName:""});var a=g(824);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 u(e){var{to:t,templateParams:n,children:o}=e,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 r.default.createElement("a",function(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}({onClick:e=>function(e,t,n){e.metaKey||e.ctrlKey||e.shiftKey||0!=e.button||(e.preventDefault(),(0,a.navigate)({to:t,templateParams:n}))}(e,t,n),href:(0,a.interpolateUrl)(t,n)},i),o)}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(e){return function(t){const[n,o]=(0,r.useState)(e.getState());(0,r.useEffect)((()=>e.subscribe((e=>o(e)))),[]);let i=(0,r.useMemo)((()=>t?function(e,t){"function"==typeof t&&(t=t(e));const n={};for(let r in t)n[r]=()=>{const n=arguments;e.setState((e=>{let o=[e];for(let e=0;e<n.length;e++)o.push(n[e]);return t[r](o)}))};return n}(e,t):{}),[t]);return function(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){l(e,t,n[t])}))}return e}({},n,i)}}var p=g(45);function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(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){d(e,t,n[t])}))}return e}const y=e=>{var{state:t,children:n,wrap:o}=e,s=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"]);const[a,c]=(0,r.useState)(),{extension:u}=(0,r.useContext)(i),l=(0,r.useRef)(null),f=(0,r.useRef)(null);(0,r.useEffect)((()=>{o&&console.warn(`'wrap' prop of Extension is being used ${(null==u?void 0:u.extensionId)?`by ${u.extensionId} in ${u.extensionSlotName}`:""}. This will be removed in a future release.`)}),[]);const d=(0,r.useCallback)((e=>{c(e)}),[c]);(0,r.useEffect)((()=>{if(null!=a&&u&&!l.current)return(0,p.renderExtension)(a,u.extensionSlotName,u.extensionSlotModuleName,u.extensionId,void 0,t).then((e=>{l.current=e})),()=>{if(l&&l.current)switch(l.current.getStatus()){case"MOUNTING":l.current.mountPromise.then(l.current.unmount);break;case"MOUNTED":l.current.unmount();break;case"UPDATING":f.current&&f.current.then((()=>{l.current&&"MOUNTED"===l.current.getStatus()&&l.current.unmount()}))}}}),[null==u?void 0:u.extensionSlotName,null==u?void 0:u.extensionId,null==u?void 0:u.extensionSlotModuleName,a]),(0,r.useEffect)((()=>(l.current&&l.current.update&&("MOUNTED"===l.current.getStatus()?l.current.update(h({},t)):"MOUNTING"===l.current.getStatus()&&l.current.mountPromise.then((()=>{l.current&&l.current.update&&(f.current=l.current.update(h({},t)))}))),()=>{f.current=null})),[t]);const y=r.default.createElement("div",h({ref:d,"data-extension-id":null==u?void 0:u.extensionId,style:{position:"relative"}},s));return"function"!=typeof n||r.default.isValidElement(n)?u&&o?o(y,u):y:r.default.createElement(r.default.Fragment,null,n(y,u))};var b=g(728);function v(){let[e,t]=(0,r.useState)(window.navigator.onLine);return(0,r.useEffect)((()=>(0,b.subscribeConnectivityChanged)((({online:e})=>t(e)))),[]),e}const w=function(e,t){return e===t||e!=e&&t!=t},O=function(e,t){for(var n=e.length;n--;)if(w(e[n][0],t))return n;return-1};var S=Array.prototype.splice;function x(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])}}x.prototype.clear=function(){this.__data__=[],this.size=0},x.prototype.delete=function(e){var t=this.__data__,n=O(t,e);return!(n<0||(n==t.length-1?t.pop():S.call(t,n,1),--this.size,0))},x.prototype.get=function(e){var t=this.__data__,n=O(t,e);return n<0?void 0:t[n][1]},x.prototype.has=function(e){return O(this.__data__,e)>-1},x.prototype.set=function(e,t){var n=this.__data__,r=O(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};const E=x,_="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;var j="object"==typeof self&&self&&self.Object===Object&&self;const k=_||j||Function("return this")(),P=k.Symbol;var $=Object.prototype,C=$.hasOwnProperty,A=$.toString,T=P?P.toStringTag:void 0,D=Object.prototype.toString,I=P?P.toStringTag:void 0;const R=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":I&&I in Object(e)?function(e){var t=C.call(e,T),n=e[T];try{e[T]=void 0;var r=!0}catch(e){}var o=A.call(e);return r&&(t?e[T]=n:delete e[T]),o}(e):function(e){return D.call(e)}(e)},N=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},M=function(e){if(!N(e))return!1;var t=R(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},L=k["__core-js_shared__"];var B,U=(B=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+B:"",z=Function.prototype.toString;const F=function(e){if(null!=e){try{return z.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var K=/^\[object .+?Constructor\]$/,V=Function.prototype,q=Object.prototype,H=V.toString,W=q.hasOwnProperty,G=RegExp("^"+H.call(W).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const Z=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!N(e)||(t=e,U&&U in t))&&(M(e)?G:K).test(F(e));var t}(n)?n:void 0},Y=Z(k,"Map"),X=Z(Object,"create");var Q=Object.prototype.hasOwnProperty,J=Object.prototype.hasOwnProperty;function ee(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])}}ee.prototype.clear=function(){this.__data__=X?X(null):{},this.size=0},ee.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ee.prototype.get=function(e){var t=this.__data__;if(X){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Q.call(t,e)?t[e]:void 0},ee.prototype.has=function(e){var t=this.__data__;return X?void 0!==t[e]:J.call(t,e)},ee.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=X&&void 0===t?"__lodash_hash_undefined__":t,this};const te=ee,ne=function(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map};function re(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])}}re.prototype.clear=function(){this.size=0,this.__data__={hash:new te,map:new(Y||E),string:new te}},re.prototype.delete=function(e){var t=ne(this,e).delete(e);return this.size-=t?1:0,t},re.prototype.get=function(e){return ne(this,e).get(e)},re.prototype.has=function(e){return ne(this,e).has(e)},re.prototype.set=function(e,t){var n=ne(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};const oe=re;function ie(e){var t=this.__data__=new E(e);this.size=t.size}ie.prototype.clear=function(){this.__data__=new E,this.size=0},ie.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ie.prototype.get=function(e){return this.__data__.get(e)},ie.prototype.has=function(e){return this.__data__.has(e)},ie.prototype.set=function(e,t){var n=this.__data__;if(n instanceof E){var r=n.__data__;if(!Y||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new oe(r)}return n.set(e,t),this.size=n.size,this};const se=ie;function ae(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new oe;++t<n;)this.add(e[t])}ae.prototype.add=ae.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},ae.prototype.has=function(e){return this.__data__.has(e)};const ce=ae,ue=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},le=function(e,t){return e.has(t)},fe=function(e,t,n,r,o,i){var s=1&n,a=e.length,c=t.length;if(a!=c&&!(s&&c>a))return!1;var u=i.get(e),l=i.get(t);if(u&&l)return u==t&&l==e;var f=-1,p=!0,d=2&n?new ce:void 0;for(i.set(e,t),i.set(t,e);++f<a;){var h=e[f],y=t[f];if(r)var g=s?r(y,h,f,t,e,i):r(h,y,f,e,t,i);if(void 0!==g){if(g)continue;p=!1;break}if(d){if(!ue(t,(function(e,t){if(!le(d,t)&&(h===e||o(h,e,n,r,i)))return d.push(t)}))){p=!1;break}}else if(h!==y&&!o(h,y,n,r,i)){p=!1;break}}return i.delete(e),i.delete(t),p},pe=k.Uint8Array,de=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n},he=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n};var ye=P?P.prototype:void 0,ge=ye?ye.valueOf:void 0;const me=Array.isArray;var be=Object.prototype.propertyIsEnumerable,ve=Object.getOwnPropertySymbols;const we=ve?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 s=e[n];t(s)&&(i[o++]=s)}return i}(ve(e),(function(t){return be.call(e,t)})))}:function(){return[]},Oe=function(e){return null!=e&&"object"==typeof e},Se=function(e){return Oe(e)&&"[object Arguments]"==R(e)};var xe=Object.prototype,Ee=xe.hasOwnProperty,_e=xe.propertyIsEnumerable,je=Se(function(){return arguments}())?Se:function(e){return Oe(e)&&Ee.call(e,"callee")&&!_e.call(e,"callee")};const ke=je;var Pe=t&&!t.nodeType&&t,$e=Pe&&e&&!e.nodeType&&e,Ce=$e&&$e.exports===Pe?k.Buffer:void 0;const Ae=(Ce?Ce.isBuffer:void 0)||function(){return!1};var Te=/^(?:0|[1-9]\d*)$/;const De=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Te.test(e))&&e>-1&&e%1==0&&e<t},Ie=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var Re={};Re["[object Float32Array]"]=Re["[object Float64Array]"]=Re["[object Int8Array]"]=Re["[object Int16Array]"]=Re["[object Int32Array]"]=Re["[object Uint8Array]"]=Re["[object Uint8ClampedArray]"]=Re["[object Uint16Array]"]=Re["[object Uint32Array]"]=!0,Re["[object Arguments]"]=Re["[object Array]"]=Re["[object ArrayBuffer]"]=Re["[object Boolean]"]=Re["[object DataView]"]=Re["[object Date]"]=Re["[object Error]"]=Re["[object Function]"]=Re["[object Map]"]=Re["[object Number]"]=Re["[object Object]"]=Re["[object RegExp]"]=Re["[object Set]"]=Re["[object String]"]=Re["[object WeakMap]"]=!1;var Ne=t&&!t.nodeType&&t,Me=Ne&&e&&!e.nodeType&&e,Le=Me&&Me.exports===Ne&&_.process,Be=function(){try{return Me&&Me.require&&Me.require("util").types||Le&&Le.binding&&Le.binding("util")}catch(e){}}(),Ue=Be&&Be.isTypedArray;const ze=Ue?(Fe=Ue,function(e){return Fe(e)}):function(e){return Oe(e)&&Ie(e.length)&&!!Re[R(e)]};var Fe,Ke=Object.prototype.hasOwnProperty,Ve=Object.prototype;const qe=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object);var He=Object.prototype.hasOwnProperty;const We=function(e){return null!=(t=e)&&Ie(t.length)&&!M(t)?function(e,t){var n=me(e),r=!n&&ke(e),o=!n&&!r&&Ae(e),i=!n&&!r&&!o&&ze(e),s=n||r||o||i,a=s?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=a.length;for(var u in e)!Ke.call(e,u)||s&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||De(u,c))||a.push(u);return a}(e):function(e){if(n=(t=e)&&t.constructor,t!==("function"==typeof n&&n.prototype||Ve))return qe(e);var t,n,r=[];for(var o in Object(e))He.call(e,o)&&"constructor"!=o&&r.push(o);return r}(e);var t},Ge=function(e){return function(e,t,n){var r=t(e);return me(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,We,we)};var Ze=Object.prototype.hasOwnProperty;const Ye=Z(k,"DataView"),Xe=Z(k,"Promise"),Qe=Z(k,"Set"),Je=Z(k,"WeakMap");var et="[object Map]",tt="[object Promise]",nt="[object Set]",rt="[object WeakMap]",ot="[object DataView]",it=F(Ye),st=F(Y),at=F(Xe),ct=F(Qe),ut=F(Je),lt=R;(Ye&&lt(new Ye(new ArrayBuffer(1)))!=ot||Y&&lt(new Y)!=et||Xe&&lt(Xe.resolve())!=tt||Qe&&lt(new Qe)!=nt||Je&&lt(new Je)!=rt)&&(lt=function(e){var t=R(e),n="[object Object]"==t?e.constructor:void 0,r=n?F(n):"";if(r)switch(r){case it:return ot;case st:return et;case at:return tt;case ct:return nt;case ut:return rt}return t});const ft=lt;var pt="[object Arguments]",dt="[object Array]",ht="[object Object]",yt=Object.prototype.hasOwnProperty;const gt=function e(t,n,r,o,i){return t===n||(null==t||null==n||!Oe(t)&&!Oe(n)?t!=t&&n!=n:function(e,t,n,r,o,i){var s=me(e),a=me(t),c=s?dt:ft(e),u=a?dt:ft(t),l=(c=c==pt?ht:c)==ht,f=(u=u==pt?ht:u)==ht,p=c==u;if(p&&Ae(e)){if(!Ae(t))return!1;s=!0,l=!1}if(p&&!l)return i||(i=new se),s||ze(e)?fe(e,t,n,r,o,i):function(e,t,n,r,o,i,s){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 w(+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 a=de;case"[object Set]":var c=1&r;if(a||(a=he),e.size!=t.size&&!c)return!1;var u=s.get(e);if(u)return u==t;r|=2,s.set(e,t);var l=fe(a(e),a(t),r,o,i,s);return s.delete(e),l;case"[object Symbol]":if(ge)return ge.call(e)==ge.call(t)}return!1}(e,t,c,n,r,o,i);if(!(1&n)){var d=l&&yt.call(e,"__wrapped__"),h=f&&yt.call(t,"__wrapped__");if(d||h){var y=d?e.value():e,g=h?t.value():t;return i||(i=new se),o(y,g,n,r,i)}}return!!p&&(i||(i=new se),function(e,t,n,r,o,i){var s=1&n,a=Ge(e),c=a.length;if(c!=Ge(t).length&&!s)return!1;for(var u=c;u--;){var l=a[u];if(!(s?l in t:Ze.call(t,l)))return!1}var f=i.get(e),p=i.get(t);if(f&&p)return f==t&&p==e;var d=!0;i.set(e,t),i.set(t,e);for(var h=s;++u<c;){var y=e[l=a[u]],g=t[l];if(r)var m=s?r(g,y,l,t,e,i):r(y,g,l,e,t,i);if(!(void 0===m?y===g||o(y,g,n,r,i):m)){d=!1;break}h||(h="constructor"==l)}if(d&&!h){var b=e.constructor,v=t.constructor;b==v||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof v&&v instanceof v||(d=!1)}return i.delete(e),i.delete(t),d}(e,t,n,r,o,i))}(t,n,r,o,e,i))},mt=function(e,t){return gt(e,t)};function bt(e){const[t,n]=(0,r.useState)([]);return(0,r.useEffect)((()=>{function r(r){var o,i;const s=null!==(i=null===(o=r.slots[e])||void 0===o?void 0:o.assignedExtensions)&&void 0!==i?i:[];mt(s,t)||n(s)}return r((0,p.getExtensionStore)().getState()),(0,p.getExtensionStore)().subscribe(r)}),[e,t]),t}function vt(e){const t=v(),n=bt(e);return(0,r.useMemo)((()=>(0,p.getConnectedExtensions)(n,t)),[n,t])}function wt(e){const{moduleName:t}=(0,r.useContext)(i);if(!t)throw Error("ComponentContext has not been provided. This should come from @openmrs/esm-react-utils.");return(0,r.useEffect)((()=>{(0,p.registerExtensionSlot)(t,e)}),[]),{extensions:vt(e),extensionSlotName:e,extensionSlotModuleName:t}}function Ot(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function St(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){Ot(e,t,n[t])}))}return e}function xt(e){return e}function Et(e){var{name:t,extensionSlotName:n,select:o=xt,children:s,state:a,style:c}=e,u=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(s&&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.");const l=null!=t?t:n,f=(0,r.useRef)(null),{extensions:p,extensionSlotModuleName:d}=wt(l),h=(0,r.useMemo)((()=>o(p)),[o,p]),g=(0,r.useMemo)((()=>{if("function"==typeof s&&!r.default.isValidElement(s))return h.map((e=>s(e)))}),[s,h]);var m,b,v,w;return r.default.createElement("div",St({ref:f,"data-extension-slot-name":l,"data-extension-slot-module-name":d,style:(v=St({},c),w={position:"relative"},w=null!=w?w:{},Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(w)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(w)).forEach((function(e){Object.defineProperty(v,e,Object.getOwnPropertyDescriptor(w,e))})),v)},u),l&&h.map(((e,t)=>r.default.createElement(i.Provider,{key:e.id,value:{moduleName:d,extension:{extensionId:e.id,extensionSlotName:l,extensionSlotModuleName:d}}},null!==(b=null!==(m=null==g?void 0:g[t])&&void 0!==m?m:"function"!=typeof s?s:null)&&void 0!==b?b:r.default.createElement(y,{state:a})))))}var _t=g(645);function jt(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}function kt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jt(Object(n),!0).forEach((function(t){$t(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Pt(e){return(Pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $t(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ct(e){return(Ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function At(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(Ct(n)));return function(){var e=n(t);if(!(e instanceof 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(Ct(e)));return e}}var Tt=null;try{Tt=n(5776).createContext()}catch(jt){}var Dt={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:{}};function It(e){if("object"!==Pt(e))throw new Error("single-spa-react requires a configuration object");var t=kt(kt({},Dt),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");!Tt&&t.React.createContext&&(Tt=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:Rt.bind(null,t),mount:Nt.bind(null,t),unmount:Mt.bind(null,t)};return t.parcelCanUpdate&&(n.update=Lt.bind(null,t)),n}function Rt(e,t){return e.rootComponent?Promise.resolve():e.loadRootComponent(t).then((function(t){e.rootComponent=t}))}function Nt(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=zt(e,t,(function(){n(this)})),i=At(e,t)(),s=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:Bt(e),renderType:Ut(e)});e.domElements[t.name]=i,e.renderResults[t.name]=s}))}function Mt(e,t){return new Promise((function(n){e.unmountResolves[t.name]=n;var r=e.renderResults[t.name];r&&r.unmount?r.unmount():Bt(e).unmountComponentAtNode(e.domElements[t.name]),delete e.domElements[t.name],delete e.renderResults[t.name]}))}function Lt(e,t){return new Promise((function(n){e.updateResolves[t.name]||(e.updateResolves[t.name]=[]),e.updateResolves[t.name].push(n);var r=zt(e,t,null),o=e.renderResults[t.name];if(o&&o.render)o.render(r);else{var i=At(e,t)();Bt(e).render(r,i)}}))}function Bt(e){return e.ReactDOMClient||e.ReactDOM}function Ut(e){return"function"==typeof e.renderType?e.renderType():e.renderType}function zt(e,t,n){var r=e.React.createElement(e.rootComponent,t),o=Tt?e.React.createElement(Tt.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,kt(kt({},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)}var Ft=g(64),Kt=g(281);const Vt=Ft.default.default||Ft.default,qt={strictMode:!0,throwErrorsToConsole:!0,disableTranslations:!1},Ht=e=>{(0,r.useEffect)((()=>(Vt.on("languageChanged",e.forceUpdate),()=>Vt.off("languageChanged",e.forceUpdate))),[e.forceUpdate]);const t=(0,r.useRef)(null);if(t.current)throw t.current;if(!Vt.hasLoadedNamespace(e.ns)){const n=setTimeout((()=>{console.warn(`openmrsComponentDecorator: the React suspense promise for i18next.loadNamespaces(['${e.ns}']) did not resolve nor reject after three seconds. This could mean you have multiple versions of i18next and haven't made i18next a webpack external in all projects.`)}),3e3);throw Vt.loadNamespaces([e.ns]).then((()=>clearTimeout(n))).catch((e=>{clearTimeout(n),t.current=e}))}return r.default.createElement(r.default.Fragment,null,e.children)};function Wt(e){if("object"!=typeof e||"string"!=typeof e.featureName||"string"!=typeof e.moduleName)throw new Error("Invalid options");const t=Object.assign({},qt,e);return function(e){var n,o,s,a;return o=n=class extends r.default.Component{componentDidCatch(e,n){n&&n.componentStack&&(e.extra=Object.assign(e.extra||{},{componentStack:n.componentStack})),t.throwErrorsToConsole&&setTimeout((()=>{throw e})),this.setState({caughtError:e,caughtErrorInfo:n})}render(){if(this.state.caughtError)return r.default.createElement("div",null,"An error has occurred. Please try reloading the page.");{const n=r.default.createElement(i.Provider,{value:this.state.config},r.default.createElement(r.default.Suspense,{fallback:null},t.disableTranslations?r.default.createElement(e,this.props):r.default.createElement(Ht,{ns:t.moduleName,forceUpdate:()=>this.forceUpdate()},r.default.createElement(Kt.I18nextProvider,{i18n:Vt,defaultNS:t.moduleName},r.default.createElement(e,this.props)))));return t.strictMode||!r.default.StrictMode?n:r.default.createElement(r.default.StrictMode,null,n)}}constructor(e){super(e),this.state={caughtError:null,caughtErrorInfo:null,config:{moduleName:t.moduleName,extension:e._extensionContext}}}},s="displayName",a=`OpenmrsReactComponent(${t.featureName})`,s in o?Object.defineProperty(o,s,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[s]=a,n}}function Gt(e,t){return It({React:r.default,ReactDOMClient:_t,rootComponent:Wt(t)(e)})}function Zt(e,t){return()=>e().then((({default:e})=>Gt(e,t)))}function Yt(e,t){return()=>Promise.resolve(Gt(e,t))}const Xt=Zt;function Qt(e){const[t,n]=(0,r.useState)([]);return(0,r.useEffect)((()=>(0,p.getExtensionStore)().subscribe((r=>{var o,i;const s=null!==(i=null===(o=r.slots[e])||void 0===o?void 0:o.assignedExtensions.map((e=>e.id)))&&void 0!==i?i:[];mt(s,t)||n(s)}))),[]),t}function Jt(e){(0,r.useEffect)((()=>{if(e){const e=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}}),[e])}function en(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const tn={},nn='No ComponentContext has been provided. This should come from "openmrsComponentDecorator".\nUsually this is already applied when using "getAsyncLifecycle" or "getSyncLifecycle".';function rn(){const{moduleName:e,extension:t}=(0,r.useContext)(i);if(!e&&!t)throw Error(nn);const n=function(e){const t=(0,r.useMemo)((()=>(0,a.getConfigStore)(e)),[e]),n=e,o=function(e){const[t,n]=(0,r.useState)(function(e){return()=>{const t=e.getState();return t.loaded&&t.config?t.config:null}}(e));return(0,r.useEffect)((()=>null==e?void 0:e.subscribe((e=>{e.loaded&&e.config&&n(e.config)}))),[e]),t}(t);if(!o)throw tn[n]||(tn[n]=function(e){return new Promise((t=>{const n=e.subscribe((e=>{e.loaded&&e.config&&(t(e.config),n())}))}))}(t)),tn[n];return o}(e),o=function(e){const t=(0,r.useMemo)(a.getExtensionsConfigStore,[]),n=function(e,t){const[n,o]=(0,r.useState)(function(e,t){return t?()=>{const n=e.getState(),r=(0,a.getExtensionConfigFromStore)(n,t.extensionSlotName,t.extensionId);if(r.loaded&&r.config)return r.config}:null}(e,t));return(0,r.useEffect)((()=>{if(t)return e.subscribe((e=>{const r=(0,a.getExtensionConfigFromStore)(e,t.extensionSlotName,t.extensionId);r.loaded&&r.config&&!mt(r.config,n)&&o(r.config)}))}),[e,t,n]),n}(t,e);if(!n&&e){const n=`${e.extensionSlotName}-${e.extensionId}`;throw!tn[n]&&t&&(tn[n]=function(e,t){return new Promise((n=>{const r=e.subscribe((e=>{const o=(0,a.getExtensionConfigFromStore)(e,t.extensionSlotName,t.extensionId);o.loaded&&o.config&&(n(o.config),r())}))}))}(t,e)),tn[n]}return n||{}}(t),s=(0,r.useMemo)((()=>function(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){en(e,t,n[t])}))}return e}({},n,o)),[n,o]);return s}var on,sn=g(766);function an(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cn(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){an(e,t,n[t])}))}return e}function un(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(e){e.loadPatient="loadPatient",e.newPatient="newPatient",e.loadError="patientLoadError"}(on||(on={}));const ln={patientUuid:null,patient:null,isPendingUuid:!0,isLoadingPatient:!1,err:null};function fn(){const e=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return e&&e[1]}function pn(e,t){switch(t.type){case on.loadPatient:return un(cn({},e),{patientUuid:t.patientUuid,patient:null,isPendingUuid:!1,isLoadingPatient:!0,err:null});case on.newPatient:return un(cn({},e),{patient:t.patient,isPendingUuid:!1,isLoadingPatient:!1,err:null});case on.loadError:return un(cn({},e),{patient:null,isPendingUuid:!1,isLoadingPatient:!1,err:t.err});default:return e}}function dn(e){const[t,n]=(0,r.useReducer)(pn,un(cn({},ln),{patientUuid:null!=e?e:null,isPendingUuid:!e,isLoadingPatient:!!e}));return(0,r.useEffect)((()=>{if(t.isPendingUuid){const e=fn();n(e?{type:on.loadPatient,patientUuid:e}:{type:on.newPatient,patient:null})}let e=!0;return t.isLoadingPatient&&t.patientUuid&&(0,sn.fetchCurrentPatient)(t.patientUuid).then((t=>e&&n({patient:t,type:on.newPatient})),(t=>e&&n({err:t,type:on.loadError}))),()=>{e=!1}}),[t.isPendingUuid,t.isLoadingPatient,t.patientUuid]),(0,r.useEffect)((()=>{const e=e=>{const r=fn();r!=t.patientUuid&&n({type:on.loadPatient,patientUuid:r})};return window.addEventListener("single-spa:routing-event",e),()=>window.removeEventListener("single-spa:routing-event",e)}),[t.patientUuid]),{isLoading:t.isPendingUuid||t.isLoadingPatient,patient:t.patient,patientUuid:null!=e?e:t.patientUuid,error:t.err}}const hn=f((0,p.getExtensionInternalStore)());function yn(e){const t=vt(e);return(0,r.useMemo)((()=>Object.fromEntries(t.map((e=>[e.name,e.meta])))),[t])}const gn=f((0,p.getExtensionStore)());function mn(){const[,e]=(0,r.useState)(0);return(0,r.useCallback)((()=>{e((e=>e+1))}),[])}function bn(){let e="tablet";return document.body.classList.forEach((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}function vn(){const[e,t]=(0,r.useState)(bn);return(0,r.useEffect)((()=>{const e=()=>{t(bn())};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),e}const wn=e=>"small-desktop"===e||"large-desktop"===e;function On(){const[e,t]=(0,r.useState)([]);return(0,r.useEffect)((()=>{const e=(0,sn.getLocations)().subscribe((e=>{t(e)}),(e=>{console.error(e)}));return()=>e.unsubscribe()}),[]),e}function Sn(e,t=!0){const n=(0,r.useRef)(null);return(0,r.useEffect)((()=>{if(t){const t=t=>{var r;(null==n||null===(r=n.current)||void 0===r?void 0:r.contains(t.target))||e(t)};return window.addEventListener("click",t),()=>window.removeEventListener("click",t)}}),[e,t]),n}const xn=({privilege:e,fallback:t,children:n})=>{const[o,i]=(0,r.useState)(null);return(0,r.useEffect)((()=>{const e=(0,sn.getCurrentUser)({includeAuthStatus:!1}).subscribe(i);return()=>e.unsubscribe()}),[]),o&&(0,sn.userHasAccess)(e,o)?r.default.createElement(r.default.Fragment,null,n):t?r.default.createElement(r.default.Fragment,null,t):null};let En,_n;function jn(){const[e,t]=(0,r.useState)(null);let n=null;if(!e){if(En){const e=(0,sn.getSessionStore)().getState();e.loaded&&(n=e.session)}else En=new Promise((e=>{const t=({loaded:t,session:r})=>{t&&(e(r),n=r,_n&&_n(),_n=void 0)};t((0,sn.getSessionStore)().getState()),n||(_n=(0,sn.getSessionStore)().subscribe(t))}));if(!n)throw En;t(n)}(0,r.useEffect)((()=>(_n||(_n=(0,sn.getSessionStore)().subscribe((({loaded:e,session:r})=>{e&&(n=r,t(r))}))),()=>{_n&&_n(),_n=void 0})),[]);const o=e||n;if(!o)throw En?(console.warn("useSession is in an unexpected state. Attempting to recover."),En):Error("useSession is in an invalid state.");return o}var kn=g(403);function Pn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const $n=e=>e;function Cn(e,t=$n,n){const[o,i]=(0,r.useState)((()=>t(e.getState())));(0,r.useEffect)((()=>(0,kn.subscribeTo)(e,t,i)),[e,t]);let s=(0,r.useMemo)((()=>n?function(e,t){"function"==typeof t&&(t=t(e));const n={};for(let r in t)n[r]=()=>{const n=arguments;e.setState((e=>{let o=[e];for(let e=0;e<n.length;e++)o.push(n[e]);return t[r](...o)}))};return n}(e,n):{}),[e,n]);return function(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){Pn(e,t,n[t])}))}return e}({},o,s)}function An(e,t){return Cn(e,$n,t)}var Tn=g(374);const Dn=new WeakMap,In={},Rn=()=>{},Nn=void 0,Mn=Object,Ln=e=>e===Nn,Bn=e=>"function"==typeof e,Un=(e,t)=>s({},e,t),zn="undefined",Fn=typeof window!=zn,Kn=typeof document!=zn,Vn=(e,t)=>{const n=Dn.get(e);return[()=>e.get(t)||In,r=>{const o=e.get(t);n[5](t,Un(o,r),o||In)},n[6]]},qn=new WeakMap;let Hn=0;const Wn=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let o,i;if(Mn(e)!==e||r||n==RegExp)o=r?e.toJSON():"symbol"==t?e.toString():"string"==t?JSON.stringify(e):""+e;else{if(o=qn.get(e),o)return o;if(o=++Hn+"~",qn.set(e,o),n==Array){for(o="@",i=0;i<e.length;i++)o+=Wn(e[i])+",";qn.set(e,o)}if(n==Mn){o="#";const t=Mn.keys(e).sort();for(;!Ln(i=t.pop());)Ln(e[i])||(o+=i+":"+Wn(e[i])+",");qn.set(e,o)}}return o};let Gn=!0;const[Zn,Yn]=Fn&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Rn,Rn],Xn={isOnline:()=>Gn,isVisible:()=>{const e=Kn&&document.visibilityState;return Ln(e)||"hidden"!==e}},Qn={initFocus:e=>(Kn&&document.addEventListener("visibilitychange",e),Zn("focus",e),()=>{Kn&&document.removeEventListener("visibilitychange",e),Yn("focus",e)}),initReconnect:e=>{const t=()=>{Gn=!0,e()},n=()=>{Gn=!1};return Zn("online",t),Zn("offline",n),()=>{Yn("online",t),Yn("offline",n)}}},Jn=!r.default.useId,er=!Fn||"Deno"in window,tr=er?r.useEffect:r.useLayoutEffect,nr="undefined"!=typeof navigator&&navigator.connection,rr=!er&&nr&&(["slow-2g","2g"].includes(nr.effectiveType)||nr.saveData),or=e=>{if(Bn(e))try{e=e()}catch(t){e=""}const t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?Wn(e):"",t]};let ir=0;const sr=()=>++ir;function ar(){return cr.apply(this,arguments)}function cr(){return cr=o((function*(...e){const[t,n,r,i]=e,s=Un({populateCache:!0,throwOnError:!0},"boolean"==typeof i?{revalidate:i}:i||{});let a=s.populateCache;const c=s.rollbackOnError;let u=s.optimisticData;const l=!1!==s.revalidate,f=s.throwOnError;if(Bn(n)){const e=n,r=[],o=t.keys();for(let n=o.next();!n.done;n=o.next()){const o=n.value;!o.startsWith("$inf$")&&e(t.get(o)._k)&&r.push(o)}return Promise.all(r.map(p))}return p(n);function p(e){return d.apply(this,arguments)}function d(){return d=o((function*(n){const[o]=or(n);if(!o)return;const[i,s]=Vn(t,o),[p,d,h]=Dn.get(t),y=p[o],g=()=>l&&(delete h[o],y&&y[0])?y[0](2).then((()=>i().data)):i().data;if(e.length<3)return g();let m,b=r;const v=sr();d[o]=[v,0];const w=!Ln(u),O=i(),S=O.data,x=O._c,E=Ln(x)?S:x;if(w&&(u=Bn(u)?u(E):u,s({data:u,_c:E})),Bn(b))try{b=b(E)}catch(e){m=e}if(b&&Bn(b.then)){if(b=yield b.catch((e=>{m=e})),v!==d[o][0]){if(m)throw m;return b}m&&w&&(e=>"function"==typeof c?c(e):!1!==c)(m)&&(a=!0,b=E,s({data:b,_c:Nn}))}a&&(m||(Bn(a)&&(b=a(b,E)),s({data:b,_c:Nn}))),d[o][1]=sr();const _=yield g();if(s({_c:Nn}),!m)return a?_:b;if(f)throw m})),d.apply(this,arguments)}})),cr.apply(this,arguments)}const ur=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},lr=(e,t)=>{if(!Dn.has(e)){const n=Un(Qn,t),r={},o=ar.bind(Nn,e);let i=Rn;const s={},a=(e,t)=>{const n=s[e]||[];return s[e]=n,n.push(t),()=>n.splice(n.indexOf(t),1)},c=(t,n,r)=>{e.set(t,n);const o=s[t];if(o)for(let e=o.length;e--;)o[e](r,n)},u=()=>{if(!Dn.has(e)&&(Dn.set(e,[r,{},{},{},o,c,a]),!er)){const t=n.initFocus(setTimeout.bind(Nn,ur.bind(Nn,r,0))),o=n.initReconnect(setTimeout.bind(Nn,ur.bind(Nn,r,1)));i=()=>{t&&t(),o&&o(),Dn.delete(e)}}};return u(),[e,o,u,i]}return[e,Dn.get(e)[4]]},[fr,pr]=lr(new Map),dr=Un({onLoadingSlow:Rn,onSuccess:Rn,onError:Rn,onErrorRetry:(e,t,n,r,o)=>{const i=n.errorRetryCount,s=o.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!Ln(i)&&s>i||setTimeout(r,a,o)},onDiscarded:Rn,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:rr?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:rr?5e3:3e3,compare:(e,t)=>Wn(e)==Wn(t),isPaused:()=>!1,cache:fr,mutate:pr,fallback:{}},Xn),hr=(e,t)=>{const n=Un(e,t);if(t){const{use:r,fallback:o}=e,{use:i,fallback:s}=t;r&&i&&(n.use=r.concat(i)),o&&s&&(n.fallback=Un(o,s))}return n},yr=(0,r.createContext)({}),gr=Fn&&window.__SWR_DEVTOOLS_USE__,mr=(gr?window.__SWR_DEVTOOLS_USE__:[]).concat((e=>(t,n,r)=>e(t,n&&((...e)=>{const r=or(t)[0],[,,,o]=Dn.get(fr),i=o[r];return i?(delete o[r],i):n(...e)}),r)));gr&&(window.__SWR_DEVTOOLS_REACT__=r.default);const br={dedupe:!0};Mn.defineProperty((e=>{const{value:t}=e,n=(0,r.useContext)(yr),o=Bn(t),i=(0,r.useMemo)((()=>o?t(n):t),[o,n,t]),s=(0,r.useMemo)((()=>o?i:hr(n,i)),[o,n,i]),a=i&&i.provider,[c]=(0,r.useState)((()=>a?lr(a(s.cache||fr),i):Nn));return c&&(s.cache=c[0],s.mutate=c[1]),tr((()=>{if(c)return c[2]&&c[2](),c[3]}),[]),(0,r.createElement)(yr.Provider,Un(e,{value:s}))}),"defaultValue",{value:dr});var vr,wr=(vr=(e,t,n)=>{const{cache:i,compare:a,suspense:c,fallbackData:u,revalidateOnMount:l,refreshInterval:f,refreshWhenHidden:p,refreshWhenOffline:d,keepPreviousData:h}=n,[y,g,m]=Dn.get(i),[b,v]=or(e),w=(0,r.useRef)(!1),O=(0,r.useRef)(!1),S=(0,r.useRef)(b),x=(0,r.useRef)(t),E=(0,r.useRef)(n),_=()=>E.current,j=()=>_().isVisible()&&_().isOnline(),[k,P,$]=Vn(i,b),C=(0,r.useRef)({}).current,A=Ln(u)?n.fallback[b]:u,T=(e,t)=>{let n=!0;for(const r in C){const o=r;a(t[o],e[o])||"data"===o&&Ln(e[o])&&a(t[o],U)||(n=!1)}return n},D=(0,r.useMemo)((()=>{const e=!!b&&!!t&&(Ln(l)?!_().isPaused()&&!c:l),n=()=>{const t=k(),n=Un(t);return delete n._k,e?s({isValidating:!0,isLoading:!0},n):n};let r=n();return()=>{const e=n();return T(e,r)?r:r=e}}),[i,b]),I=(0,Tn.useSyncExternalStore)((0,r.useCallback)((e=>$(b,((t,n)=>{T(t,n)||e()}))),[i,b]),D,D),R=!w.current,N=I.data,M=Ln(N)?A:N,L=I.error,B=(0,r.useRef)(M),U=h?Ln(N)?B.current:N:M,z=R&&!Ln(l)?l:!_().isPaused()&&(c?!Ln(M)&&n.revalidateIfStale:Ln(M)||n.revalidateIfStale),F=!!(b&&t&&R&&z),K=Ln(I.isValidating)?F:I.isValidating,V=Ln(I.isLoading)?F:I.isLoading,q=(0,r.useCallback)((W=o((function*(e){const t=x.current;if(!b||!t||O.current||_().isPaused())return!1;let r,o,i=!0;const s=e||{},c=!m[b]||!s.dedupe,u=()=>Jn?!O.current&&b===S.current&&w.current:b===S.current,l={isValidating:!1,isLoading:!1},f=()=>{P(l)},p=()=>{const e=m[b];e&&e[1]===o&&delete m[b]},d={isValidating:!0};Ln(k().data)&&(d.isLoading=!0);try{if(c&&(P(d),n.loadingTimeout&&Ln(k().data)&&setTimeout((()=>{i&&u()&&_().onLoadingSlow(b,n)}),n.loadingTimeout),m[b]=[t(v),sr()]),[r,o]=m[b],r=yield r,c&&setTimeout(p,n.dedupingInterval),!m[b]||m[b][1]!==o)return c&&u()&&_().onDiscarded(b),!1;l.error=Nn;const e=g[b];if(!Ln(e)&&(o<=e[0]||o<=e[1]||0===e[1]))return f(),c&&u()&&_().onDiscarded(b),!1;const s=k().data;l.data=a(s,r)?s:r,c&&u()&&_().onSuccess(r,b,n)}catch(e){p();const t=_(),{shouldRetryOnError:n}=t;t.isPaused()||(l.error=e,c&&u()&&(t.onError(e,b,t),(!0===n||Bn(n)&&n(e))&&j()&&t.onErrorRetry(e,b,t,q,{retryCount:(s.retryCount||0)+1,dedupe:!0})))}return i=!1,f(),!0})),function(e){return W.apply(this,arguments)}),[b,i]),H=(0,r.useCallback)(((...e)=>ar(i,S.current,...e)),[]);var W;if(tr((()=>{x.current=t,E.current=n,Ln(N)||(B.current=N)})),tr((()=>{if(!b)return;const e=q.bind(Nn,br);let t=0;const n=((e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const e=r.indexOf(n);e>=0&&(r[e]=r[r.length-1],r.pop())}})(b,y,(n=>{if(0==n){const n=Date.now();_().revalidateOnFocus&&n>t&&j()&&(t=n+_().focusThrottleInterval,e())}else if(1==n)_().revalidateOnReconnect&&j()&&e();else if(2==n)return q()}));return O.current=!1,S.current=b,w.current=!0,P({_k:v}),z&&(Ln(M)||er?e():(e=>{Fn&&typeof window.requestAnimationFrame!=zn?window.requestAnimationFrame(e):setTimeout(e,1)})(e)),()=>{O.current=!0,n()}}),[b]),tr((()=>{let e;function t(){const t=Bn(f)?f(M):f;t&&-1!==e&&(e=setTimeout(n,t))}function n(){k().error||!p&&!_().isVisible()||!d&&!_().isOnline()?t():q(br).then(t)}return t(),()=>{e&&(clearTimeout(e),e=-1)}}),[f,p,d,b]),(0,r.useDebugValue)(U),c&&Ln(M)&&b){if(!Jn&&er)throw new Error("Fallback data is required when using suspense in SSR.");throw x.current=t,E.current=n,O.current=!1,Ln(L)?q(br):L}return{mutate:H,get data(){return C.data=!0,U},get error(){return C.error=!0,L},get isValidating(){return C.isValidating=!0,K},get isLoading(){return C.isLoading=!0,V}}},function(...e){const t=Un(dr,(0,r.useContext)(yr)),[n,o,i]=(e=>Bn(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}])(e),s=hr(t,i);let a=vr;const{use:c}=s,u=(c||[]).concat(mr);for(let e=u.length;e--;)a=u[e](a);return a(n,o||s.fetcher||null,s)}),Or=g(688),Sr=g(332),xr=g.n(Sr);function Er(e){const{data:t,error:n,mutate:o,isValidating:i}=wr(e?`/ws/rest/v1/visit?patient=${e}&v=${sn.defaultVisitCustomRepresentation}&includeInactive=false`:null,sn.openmrsFetch);var s;return{error:n,mutate:o,isValidating:i,currentVisit:(0,r.useMemo)((()=>null!==(s=null==t?void 0:t.data.results.find((e=>null===e.stopDatetime)))&&void 0!==s?s:null),[null==t?void 0:t.data.results]),isLoading:!t&&!n}}function _r(){const[e,t]=(0,r.useState)([]);return(0,r.useEffect)((()=>{const e=(0,sn.getVisitTypes)().subscribe((e=>{t(e)}),(e=>console.error(e)));return()=>e.unsubscribe()}),[]),e}Or.default.extend(xr());const jr=10;function kr(e=[],t=jr){const[n,o]=(0,r.useState)(1),i=(0,r.useMemo)((()=>"number"==typeof t&&t>0?Math.max(1,Math.ceil(e.length/t)):1),[e.length,t]);return{results:(0,r.useMemo)((()=>{const r=(n-1)*t,o=(n+0)*t;return e.slice(r,o)}),[e,n,t]),totalPages:i,currentPage:n,paginated:e.length>t,showNextButton:n<i,showPreviousButton:n>1,goTo(e){o(Math.max(1,Math.min(i,e)))},goToNext(){n<i&&o(n+1)},goToPrevious(){n>1&&o(n-1)}}}})(),m})())}}}))},4011:(e,t,n)=>{"use strict";n.d(t,{w:()=>a,hj:()=>jt,dT:()=>w,Vz:()=>be,NV:()=>u,D$:()=>G,Ae:()=>H,tl:()=>q,a$:()=>W,nI:()=>ye,YV:()=>Z,P3:()=>y,yn:()=>Y,ZR:()=>te,BL:()=>g,Y9:()=>d,qd:()=>fe,jf:()=>pe,mr:()=>he,Z_:()=>ge,t$:()=>me,h0:()=>xt,lm:()=>le,kP:()=>Oe,oR:()=>_e,xQ:()=>je,JF:()=>wt,NN:()=>Ot});var r=n(5776),o=n.n(r),i=n(3741);function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){var{to:t,templateParams:n,children:r}=e,a=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 o().createElement("a",function(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){s(e,t,n[t])}))}return e}({onClick:e=>function(e,t,n){e.metaKey||e.ctrlKey||e.shiftKey||0!=e.button||(e.preventDefault(),(0,i.navigate)({to:t,templateParams:n}))}(e,t,n),href:(0,i.interpolateUrl)(t,n)},a),r)}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 u(e){return function(t){const[n,o]=(0,r.useState)(e.getState());(0,r.useEffect)((()=>e.subscribe((e=>o(e)))),[]);let i=(0,r.useMemo)((()=>t?function(e,t){"function"==typeof t&&(t=t(e));const n={};for(let r in t)n[r]=()=>{const n=arguments;e.setState((e=>{let o=[e];for(let e=0;e<n.length;e++)o.push(n[e]);return t[r](o)}))};return n}(e,t):{}),[t]);return function(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}({},n,i)}}var l=n(3196);const f=o().createContext({moduleName:""});var p=n(8758);function d(){let[e,t]=(0,r.useState)(window.navigator.onLine);return(0,r.useEffect)((()=>(0,p.subscribeConnectivityChanged)((({online:e})=>t(e)))),[]),e}var h=n(3202);function y(e){const[t,n]=(0,r.useState)([]);return(0,r.useEffect)((()=>{function r(r){var o,i;const s=null!==(i=null===(o=r.slots[e])||void 0===o?void 0:o.assignedExtensions)&&void 0!==i?i:[];(0,h.Z)(s,t)||n(s)}return r((0,l.getExtensionStore)().getState()),(0,l.getExtensionStore)().subscribe(r)}),[e,t]),t}function g(e){const t=d(),n=y(e);return(0,r.useMemo)((()=>(0,l.getConnectedExtensions)(n,t)),[n,t])}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(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){m(e,t,n[t])}))}return e}function v(e){return e}function w(e){var{name:t,extensionSlotName:n,select:i=v,children:s,state:a,style:c}=e,u=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(s&&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.");const p=null!=t?t:n,d=(0,r.useRef)(null),{extensions:h,extensionSlotModuleName:y}=function(e){const{moduleName:t}=(0,r.useContext)(f);if(!t)throw Error("ComponentContext has not been provided. This should come from @openmrs/esm-react-utils.");return(0,r.useEffect)((()=>{(0,l.registerExtensionSlot)(t,e)}),[]),{extensions:g(e),extensionSlotName:e,extensionSlotModuleName:t}}(p),m=(0,r.useMemo)((()=>i(h)),[i,h]),w=(0,r.useMemo)((()=>{if("function"==typeof s&&!o().isValidElement(s))return m.map((e=>s(e)))}),[s,m]);var O,S,x,E;return o().createElement("div",b({ref:d,"data-extension-slot-name":p,"data-extension-slot-module-name":y,style:(x=b({},c),E={position:"relative"},E=null!=E?E:{},Object.getOwnPropertyDescriptors?Object.defineProperties(x,Object.getOwnPropertyDescriptors(E)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(E)).forEach((function(e){Object.defineProperty(x,e,Object.getOwnPropertyDescriptor(E,e))})),x)},u),p&&m.map(((e,t)=>o().createElement(f.Provider,{key:e.id,value:{moduleName:y,extension:{extensionId:e.id,extensionSlotName:p,extensionSlotModuleName:y}}},null!==(S=null!==(O=null==w?void 0:w[t])&&void 0!==O?O:"function"!=typeof s?s:null)&&void 0!==S?S:o().createElement(jt,{state:a})))))}var O=n(4645);function S(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}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach((function(t){_(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function E(e){return(E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(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}function j(e){return(j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function k(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(j(n)));return function(){var e=n(t);if(!(e instanceof 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(j(e)));return e}}var P=null;try{P=require("react").createContext()}catch(S){}var $={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:{}};function C(e){if("object"!==E(e))throw new Error("single-spa-react requires a configuration object");var t=x(x({},$),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");!P&&t.React.createContext&&(P=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:A.bind(null,t),mount:T.bind(null,t),unmount:D.bind(null,t)};return t.parcelCanUpdate&&(n.update=I.bind(null,t)),n}function A(e,t){return e.rootComponent?Promise.resolve():e.loadRootComponent(t).then((function(t){e.rootComponent=t}))}function T(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=M(e,t,(function(){n(this)})),i=k(e,t)(),s=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:R(e),renderType:N(e)});e.domElements[t.name]=i,e.renderResults[t.name]=s}))}function D(e,t){return new Promise((function(n){e.unmountResolves[t.name]=n;var r=e.renderResults[t.name];r&&r.unmount?r.unmount():R(e).unmountComponentAtNode(e.domElements[t.name]),delete e.domElements[t.name],delete e.renderResults[t.name]}))}function I(e,t){return new Promise((function(n){e.updateResolves[t.name]||(e.updateResolves[t.name]=[]),e.updateResolves[t.name].push(n);var r=M(e,t,null),o=e.renderResults[t.name];if(o&&o.render)o.render(r);else{var i=k(e,t)();R(e).render(r,i)}}))}function R(e){return e.ReactDOMClient||e.ReactDOM}function N(e){return"function"==typeof e.renderType?e.renderType():e.renderType}function M(e,t,n){var r=e.React.createElement(e.rootComponent,t),o=P?e.React.createElement(P.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,x(x({},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)}var L=n(7319),B=n.n(L),U=n(2680);const z=B().default||B(),F={strictMode:!0,throwErrorsToConsole:!0,disableTranslations:!1},K=e=>{(0,r.useEffect)((()=>(z.on("languageChanged",e.forceUpdate),()=>z.off("languageChanged",e.forceUpdate))),[e.forceUpdate]);const t=(0,r.useRef)(null);if(t.current)throw t.current;if(!z.hasLoadedNamespace(e.ns)){const n=setTimeout((()=>{console.warn(`openmrsComponentDecorator: the React suspense promise for i18next.loadNamespaces(['${e.ns}']) did not resolve nor reject after three seconds. This could mean you have multiple versions of i18next and haven't made i18next a webpack external in all projects.`)}),3e3);throw z.loadNamespaces([e.ns]).then((()=>clearTimeout(n))).catch((e=>{clearTimeout(n),t.current=e}))}return o().createElement(o().Fragment,null,e.children)};function V(e){if("object"!=typeof e||"string"!=typeof e.featureName||"string"!=typeof e.moduleName)throw new Error("Invalid options");const t=Object.assign({},F,e);return function(e){var n,r,i,s;return r=n=class extends o().Component{componentDidCatch(e,n){n&&n.componentStack&&(e.extra=Object.assign(e.extra||{},{componentStack:n.componentStack})),t.throwErrorsToConsole&&setTimeout((()=>{throw e})),this.setState({caughtError:e,caughtErrorInfo:n})}render(){if(this.state.caughtError)return o().createElement("div",null,"An error has occurred. Please try reloading the page.");{const n=o().createElement(f.Provider,{value:this.state.config},o().createElement(o().Suspense,{fallback:null},t.disableTranslations?o().createElement(e,this.props):o().createElement(K,{ns:t.moduleName,forceUpdate:()=>this.forceUpdate()},o().createElement(U.I18nextProvider,{i18n:z,defaultNS:t.moduleName},o().createElement(e,this.props)))));return t.strictMode||!o().StrictMode?n:o().createElement(o().StrictMode,null,n)}}constructor(e){super(e),this.state={caughtError:null,caughtErrorInfo:null,config:{moduleName:t.moduleName,extension:e._extensionContext}}}},i="displayName",s=`OpenmrsReactComponent(${t.featureName})`,i in r?Object.defineProperty(r,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[i]=s,n}}function q(e,t){return C({React:o(),ReactDOMClient:O,rootComponent:V(t)(e)})}function H(e,t){return()=>e().then((({default:e})=>q(e,t)))}function W(e,t){return()=>Promise.resolve(q(e,t))}const G=H;function Z(e){const[t,n]=(0,r.useState)([]);return(0,r.useEffect)((()=>(0,l.getExtensionStore)().subscribe((r=>{var o,i;const s=null!==(i=null===(o=r.slots[e])||void 0===o?void 0:o.assignedExtensions.map((e=>e.id)))&&void 0!==i?i:[];(0,h.Z)(s,t)||n(s)}))),[]),t}function Y(e){(0,r.useEffect)((()=>{if(e){const e=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}}),[e])}function X(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Q={},J='No ComponentContext has been provided. This should come from "openmrsComponentDecorator".\nUsually this is already applied when using "getAsyncLifecycle" or "getSyncLifecycle".';function ee(e){const t=(0,r.useMemo)(i.getExtensionsConfigStore,[]),n=function(e,t){const[n,o]=(0,r.useState)(function(e,t){return t?()=>{const n=e.getState(),r=(0,i.getExtensionConfigFromStore)(n,t.extensionSlotName,t.extensionId);if(r.loaded&&r.config)return r.config}:null}(e,t));return(0,r.useEffect)((()=>{if(t)return e.subscribe((e=>{const r=(0,i.getExtensionConfigFromStore)(e,t.extensionSlotName,t.extensionId);r.loaded&&r.config&&!(0,h.Z)(r.config,n)&&o(r.config)}))}),[e,t,n]),n}(t,e);if(!n&&e){const n=`${e.extensionSlotName}-${e.extensionId}`;throw!Q[n]&&t&&(Q[n]=function(e,t){return new Promise((n=>{const r=e.subscribe((e=>{const o=(0,i.getExtensionConfigFromStore)(e,t.extensionSlotName,t.extensionId);o.loaded&&o.config&&(n(o.config),r())}))}))}(t,e)),Q[n]}return n||{}}function te(){const{moduleName:e,extension:t}=(0,r.useContext)(f);if(!e&&!t)throw Error(J);const n=function(e){const t=(0,r.useMemo)((()=>(0,i.getConfigStore)(e)),[e]),n=e,o=function(e){const[t,n]=(0,r.useState)(function(e){return()=>{const t=e.getState();return t.loaded&&t.config?t.config:null}}(e));return(0,r.useEffect)((()=>null==e?void 0:e.subscribe((e=>{e.loaded&&e.config&&n(e.config)}))),[e]),t}(t);if(!o)throw Q[n]||(Q[n]=function(e){return new Promise((t=>{const n=e.subscribe((e=>{e.loaded&&e.config&&(t(e.config),n())}))}))}(t)),Q[n];return o}(e),o=ee(t),s=(0,r.useMemo)((()=>function(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){X(e,t,n[t])}))}return e}({},n,o)),[n,o]);return s}var ne,re=n(7840);function oe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ie(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){oe(e,t,n[t])}))}return e}function se(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(e){e.loadPatient="loadPatient",e.newPatient="newPatient",e.loadError="patientLoadError"}(ne||(ne={}));const ae={patientUuid:null,patient:null,isPendingUuid:!0,isLoadingPatient:!1,err:null};function ce(){const e=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return e&&e[1]}function ue(e,t){switch(t.type){case ne.loadPatient:return se(ie({},e),{patientUuid:t.patientUuid,patient:null,isPendingUuid:!1,isLoadingPatient:!0,err:null});case ne.newPatient:return se(ie({},e),{patient:t.patient,isPendingUuid:!1,isLoadingPatient:!1,err:null});case ne.loadError:return se(ie({},e),{patient:null,isPendingUuid:!1,isLoadingPatient:!1,err:t.err});default:return e}}function le(e){const[t,n]=(0,r.useReducer)(ue,se(ie({},ae),{patientUuid:null!=e?e:null,isPendingUuid:!e,isLoadingPatient:!!e}));return(0,r.useEffect)((()=>{if(t.isPendingUuid){const e=ce();n(e?{type:ne.loadPatient,patientUuid:e}:{type:ne.newPatient,patient:null})}let e=!0;return t.isLoadingPatient&&t.patientUuid&&(0,re.fetchCurrentPatient)(t.patientUuid).then((t=>e&&n({patient:t,type:ne.newPatient})),(t=>e&&n({err:t,type:ne.loadError}))),()=>{e=!1}}),[t.isPendingUuid,t.isLoadingPatient,t.patientUuid]),(0,r.useEffect)((()=>{const e=e=>{const r=ce();r!=t.patientUuid&&n({type:ne.loadPatient,patientUuid:r})};return window.addEventListener("single-spa:routing-event",e),()=>window.removeEventListener("single-spa:routing-event",e)}),[t.patientUuid]),{isLoading:t.isPendingUuid||t.isLoadingPatient,patient:t.patient,patientUuid:null!=e?e:t.patientUuid,error:t.err}}function fe(e){const t=g(e);return(0,r.useMemo)((()=>Object.fromEntries(t.map((e=>[e.name,e.meta])))),[t])}u((0,l.getExtensionInternalStore)());const pe=u((0,l.getExtensionStore)());function de(){let e="tablet";return document.body.classList.forEach((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}function he(){const[e,t]=(0,r.useState)(de);return(0,r.useEffect)((()=>{const e=()=>{t(de())};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),e}const ye=e=>"small-desktop"===e||"large-desktop"===e;function ge(){const[e,t]=(0,r.useState)([]);return(0,r.useEffect)((()=>{const e=(0,re.getLocations)().subscribe((e=>{t(e)}),(e=>{console.error(e)}));return()=>e.unsubscribe()}),[]),e}function me(e,t=!0){const n=(0,r.useRef)(null);return(0,r.useEffect)((()=>{if(t){const t=t=>{var r;(null==n||null===(r=n.current)||void 0===r?void 0:r.contains(t.target))||e(t)};return window.addEventListener("click",t),()=>window.removeEventListener("click",t)}}),[e,t]),n}const be=({privilege:e,fallback:t,children:n})=>{const[i,s]=(0,r.useState)(null);return(0,r.useEffect)((()=>{const e=(0,re.getCurrentUser)({includeAuthStatus:!1}).subscribe(s);return()=>e.unsubscribe()}),[]),i&&(0,re.userHasAccess)(e,i)?o().createElement(o().Fragment,null,n):t?o().createElement(o().Fragment,null,t):null};let ve,we;function Oe(){const[e,t]=(0,r.useState)(null);let n=null;if(!e){if(ve){const e=(0,re.getSessionStore)().getState();e.loaded&&(n=e.session)}else ve=new Promise((e=>{const t=({loaded:t,session:r})=>{t&&(e(r),n=r,we&&we(),we=void 0)};t((0,re.getSessionStore)().getState()),n||(we=(0,re.getSessionStore)().subscribe(t))}));if(!n)throw ve;t(n)}(0,r.useEffect)((()=>(we||(we=(0,re.getSessionStore)().subscribe((({loaded:e,session:r})=>{e&&(n=r,t(r))}))),()=>{we&&we(),we=void 0})),[]);const o=e||n;if(!o)throw ve?(console.warn("useSession is in an unexpected state. Attempting to recover."),ve):Error("useSession is in an invalid state.");return o}var Se=n(403);function xe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ee=e=>e;function _e(e,t=Ee,n){const[o,i]=(0,r.useState)((()=>t(e.getState())));(0,r.useEffect)((()=>(0,Se.subscribeTo)(e,t,i)),[e,t]);let s=(0,r.useMemo)((()=>n?function(e,t){"function"==typeof t&&(t=t(e));const n={};for(let r in t)n[r]=()=>{const n=arguments;e.setState((e=>{let o=[e];for(let e=0;e<n.length;e++)o.push(n[e]);return t[r](...o)}))};return n}(e,n):{}),[e,n]);return function(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){xe(e,t,n[t])}))}return e}({},o,s)}function je(e,t){return _e(e,Ee,t)}var ke=n(1374);const Pe=new WeakMap,$e={},Ce=()=>{},Ae=Ce(),Te=Object,De=e=>e===Ae,Ie=e=>"function"==typeof e,Re=(e,t)=>({...e,...t}),Ne="undefined",Me=typeof window!=Ne,Le=typeof document!=Ne,Be=(e,t)=>{const n=Pe.get(e);return[()=>e.get(t)||$e,r=>{const o=e.get(t);n[5](t,Re(o,r),o||$e)},n[6]]},Ue=new WeakMap;let ze=0;const Fe=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let o,i;if(Te(e)!==e||r||n==RegExp)o=r?e.toJSON():"symbol"==t?e.toString():"string"==t?JSON.stringify(e):""+e;else{if(o=Ue.get(e),o)return o;if(o=++ze+"~",Ue.set(e,o),n==Array){for(o="@",i=0;i<e.length;i++)o+=Fe(e[i])+",";Ue.set(e,o)}if(n==Te){o="#";const t=Te.keys(e).sort();for(;!De(i=t.pop());)De(e[i])||(o+=i+":"+Fe(e[i])+",");Ue.set(e,o)}}return o};let Ke=!0;const[Ve,qe]=Me&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Ce,Ce],He={isOnline:()=>Ke,isVisible:()=>{const e=Le&&document.visibilityState;return De(e)||"hidden"!==e}},We={initFocus:e=>(Le&&document.addEventListener("visibilitychange",e),Ve("focus",e),()=>{Le&&document.removeEventListener("visibilitychange",e),qe("focus",e)}),initReconnect:e=>{const t=()=>{Ke=!0,e()},n=()=>{Ke=!1};return Ve("online",t),Ve("offline",n),()=>{qe("online",t),qe("offline",n)}}},Ge=!r.useId,Ze=!Me||"Deno"in window,Ye=Ze?r.useEffect:r.useLayoutEffect,Xe="undefined"!=typeof navigator&&navigator.connection,Qe=!Ze&&Xe&&(["slow-2g","2g"].includes(Xe.effectiveType)||Xe.saveData),Je=e=>{if(Ie(e))try{e=e()}catch(t){e=""}const t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?Fe(e):"",t]};let et=0;const tt=()=>++et;async function nt(...e){const[t,n,r,o]=e,i=Re({populateCache:!0,throwOnError:!0},"boolean"==typeof o?{revalidate:o}:o||{});let s=i.populateCache;const a=i.rollbackOnError;let c=i.optimisticData;const u=!1!==i.revalidate,l=i.throwOnError;if(Ie(n)){const e=n,r=[],o=t.keys();for(let n=o.next();!n.done;n=o.next()){const o=n.value;!o.startsWith("$inf$")&&e(t.get(o)._k)&&r.push(o)}return Promise.all(r.map(f))}return f(n);async function f(n){const[o]=Je(n);if(!o)return;const[i,f]=Be(t,o),[p,d,h]=Pe.get(t),y=p[o],g=()=>u&&(delete h[o],y&&y[0])?y[0](2).then((()=>i().data)):i().data;if(e.length<3)return g();let m,b=r;const v=tt();d[o]=[v,0];const w=!De(c),O=i(),S=O.data,x=O._c,E=De(x)?S:x;if(w&&(c=Ie(c)?c(E):c,f({data:c,_c:E})),Ie(b))try{b=b(E)}catch(e){m=e}if(b&&Ie(b.then)){if(b=await b.catch((e=>{m=e})),v!==d[o][0]){if(m)throw m;return b}m&&w&&(e=>"function"==typeof a?a(e):!1!==a)(m)&&(s=!0,b=E,f({data:b,_c:Ae}))}s&&(m||(Ie(s)&&(b=s(b,E)),f({data:b,_c:Ae}))),d[o][1]=tt();const _=await g();if(f({_c:Ae}),!m)return s?_:b;if(l)throw m}}const rt=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},ot=(e,t)=>{if(!Pe.has(e)){const n=Re(We,t),r={},o=nt.bind(Ae,e);let i=Ce;const s={},a=(e,t)=>{const n=s[e]||[];return s[e]=n,n.push(t),()=>n.splice(n.indexOf(t),1)},c=(t,n,r)=>{e.set(t,n);const o=s[t];if(o)for(let e=o.length;e--;)o[e](r,n)},u=()=>{if(!Pe.has(e)&&(Pe.set(e,[r,{},{},{},o,c,a]),!Ze)){const t=n.initFocus(setTimeout.bind(Ae,rt.bind(Ae,r,0))),o=n.initReconnect(setTimeout.bind(Ae,rt.bind(Ae,r,1)));i=()=>{t&&t(),o&&o(),Pe.delete(e)}}};return u(),[e,o,u,i]}return[e,Pe.get(e)[4]]},[it,st]=ot(new Map),at=Re({onLoadingSlow:Ce,onSuccess:Ce,onError:Ce,onErrorRetry:(e,t,n,r,o)=>{const i=n.errorRetryCount,s=o.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!De(i)&&s>i||setTimeout(r,a,o)},onDiscarded:Ce,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Qe?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:Qe?5e3:3e3,compare:(e,t)=>Fe(e)==Fe(t),isPaused:()=>!1,cache:it,mutate:st,fallback:{}},He),ct=(e,t)=>{const n=Re(e,t);if(t){const{use:r,fallback:o}=e,{use:i,fallback:s}=t;r&&i&&(n.use=r.concat(i)),o&&s&&(n.fallback=Re(o,s))}return n},ut=(0,r.createContext)({}),lt=Me&&window.__SWR_DEVTOOLS_USE__,ft=lt?window.__SWR_DEVTOOLS_USE__:[],pt=ft.concat((e=>(t,n,r)=>e(t,n&&((...e)=>{const r=Je(t)[0],[,,,o]=Pe.get(it),i=o[r];return i?(delete o[r],i):n(...e)}),r)));lt&&(window.__SWR_DEVTOOLS_REACT__=r);const dt={dedupe:!0};Te.defineProperty((e=>{const{value:t}=e,n=(0,r.useContext)(ut),o=Ie(t),i=(0,r.useMemo)((()=>o?t(n):t),[o,n,t]),s=(0,r.useMemo)((()=>o?i:ct(n,i)),[o,n,i]),a=i&&i.provider,[c]=(0,r.useState)((()=>a?ot(a(s.cache||it),i):Ae));return c&&(s.cache=c[0],s.mutate=c[1]),Ye((()=>{if(c)return c[2]&&c[2](),c[3]}),[]),(0,r.createElement)(ut.Provider,Re(e,{value:s}))}),"defaultValue",{value:at});var ht,yt=(ht=(e,t,n)=>{const{cache:o,compare:i,suspense:s,fallbackData:a,revalidateOnMount:c,refreshInterval:u,refreshWhenHidden:l,refreshWhenOffline:f,keepPreviousData:p}=n,[d,h,y]=Pe.get(o),[g,m]=Je(e),b=(0,r.useRef)(!1),v=(0,r.useRef)(!1),w=(0,r.useRef)(g),O=(0,r.useRef)(t),S=(0,r.useRef)(n),x=()=>S.current,E=()=>x().isVisible()&&x().isOnline(),[_,j,k]=Be(o,g),P=(0,r.useRef)({}).current,$=De(a)?n.fallback[g]:a,C=(e,t)=>{let n=!0;for(const r in P){const o=r;i(t[o],e[o])||"data"===o&&De(e[o])&&i(t[o],L)||(n=!1)}return n},A=(0,r.useMemo)((()=>{const e=!!g&&!!t&&(De(c)?!x().isPaused()&&!s:c),n=()=>{const t=_(),n=Re(t);return delete n._k,e?{isValidating:!0,isLoading:!0,...n}:n};let r=n();return()=>{const e=n();return C(e,r)?r:r=e}}),[o,g]),T=(0,ke.useSyncExternalStore)((0,r.useCallback)((e=>k(g,((t,n)=>{C(t,n)||e()}))),[o,g]),A,A),D=!b.current,I=T.data,R=De(I)?$:I,N=T.error,M=(0,r.useRef)(R),L=p?De(I)?M.current:I:R,B=D&&!De(c)?c:!x().isPaused()&&(s?!De(R)&&n.revalidateIfStale:De(R)||n.revalidateIfStale),U=!!(g&&t&&D&&B),z=De(T.isValidating)?U:T.isValidating,F=De(T.isLoading)?U:T.isLoading,K=(0,r.useCallback)((async e=>{const t=O.current;if(!g||!t||v.current||x().isPaused())return!1;let r,o,s=!0;const a=e||{},c=!y[g]||!a.dedupe,u=()=>Ge?!v.current&&g===w.current&&b.current:g===w.current,l={isValidating:!1,isLoading:!1},f=()=>{j(l)},p=()=>{const e=y[g];e&&e[1]===o&&delete y[g]},d={isValidating:!0};De(_().data)&&(d.isLoading=!0);try{if(c&&(j(d),n.loadingTimeout&&De(_().data)&&setTimeout((()=>{s&&u()&&x().onLoadingSlow(g,n)}),n.loadingTimeout),y[g]=[t(m),tt()]),[r,o]=y[g],r=await r,c&&setTimeout(p,n.dedupingInterval),!y[g]||y[g][1]!==o)return c&&u()&&x().onDiscarded(g),!1;l.error=Ae;const e=h[g];if(!De(e)&&(o<=e[0]||o<=e[1]||0===e[1]))return f(),c&&u()&&x().onDiscarded(g),!1;const a=_().data;l.data=i(a,r)?a:r,c&&u()&&x().onSuccess(r,g,n)}catch(e){p();const t=x(),{shouldRetryOnError:n}=t;t.isPaused()||(l.error=e,c&&u()&&(t.onError(e,g,t),(!0===n||Ie(n)&&n(e))&&E()&&t.onErrorRetry(e,g,t,K,{retryCount:(a.retryCount||0)+1,dedupe:!0})))}return s=!1,f(),!0}),[g,o]),V=(0,r.useCallback)(((...e)=>nt(o,w.current,...e)),[]);if(Ye((()=>{O.current=t,S.current=n,De(I)||(M.current=I)})),Ye((()=>{if(!g)return;const e=K.bind(Ae,dt);let t=0;const n=((e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const e=r.indexOf(n);e>=0&&(r[e]=r[r.length-1],r.pop())}})(g,d,(n=>{if(0==n){const n=Date.now();x().revalidateOnFocus&&n>t&&E()&&(t=n+x().focusThrottleInterval,e())}else if(1==n)x().revalidateOnReconnect&&E()&&e();else if(2==n)return K()}));return v.current=!1,w.current=g,b.current=!0,j({_k:m}),B&&(De(R)||Ze?e():(e=>{Me&&typeof window.requestAnimationFrame!=Ne?window.requestAnimationFrame(e):setTimeout(e,1)})(e)),()=>{v.current=!0,n()}}),[g]),Ye((()=>{let e;function t(){const t=Ie(u)?u(R):u;t&&-1!==e&&(e=setTimeout(n,t))}function n(){_().error||!l&&!x().isVisible()||!f&&!x().isOnline()?t():K(dt).then(t)}return t(),()=>{e&&(clearTimeout(e),e=-1)}}),[u,l,f,g]),(0,r.useDebugValue)(L),s&&De(R)&&g){if(!Ge&&Ze)throw new Error("Fallback data is required when using suspense in SSR.");throw O.current=t,S.current=n,v.current=!1,De(N)?K(dt):N}return{mutate:V,get data(){return P.data=!0,L},get error(){return P.error=!0,N},get isValidating(){return P.isValidating=!0,z},get isLoading(){return P.isLoading=!0,F}}},function(...e){const t=Re(at,(0,r.useContext)(ut)),[n,o,i]=(e=>Ie(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}])(e),s=ct(t,i);let a=ht;const{use:c}=s,u=(c||[]).concat(pt);for(let e=u.length;e--;)a=u[e](a);return a(n,o||s.fetcher||null,s)}),gt=n(9442),mt=n.n(gt),bt=n(4332),vt=n.n(bt);function wt(e){const{data:t,error:n,mutate:o,isValidating:i}=yt(e?`/ws/rest/v1/visit?patient=${e}&v=${re.defaultVisitCustomRepresentation}&includeInactive=false`:null,re.openmrsFetch);var s;return{error:n,mutate:o,isValidating:i,currentVisit:(0,r.useMemo)((()=>null!==(s=null==t?void 0:t.data.results.find((e=>null===e.stopDatetime)))&&void 0!==s?s:null),[null==t?void 0:t.data.results]),isLoading:!t&&!n}}function Ot(){const[e,t]=(0,r.useState)([]);return(0,r.useEffect)((()=>{const e=(0,re.getVisitTypes)().subscribe((e=>{t(e)}),(e=>console.error(e)));return()=>e.unsubscribe()}),[]),e}mt().extend(vt());const St=10;function xt(e=[],t=St){const[n,o]=(0,r.useState)(1),i=(0,r.useMemo)((()=>"number"==typeof t&&t>0?Math.max(1,Math.ceil(e.length/t)):1),[e.length,t]);return{results:(0,r.useMemo)((()=>{const r=(n-1)*t,o=(n+0)*t;return e.slice(r,o)}),[e,n,t]),totalPages:i,currentPage:n,paginated:e.length>t,showNextButton:n<i,showPreviousButton:n>1,goTo(e){o(Math.max(1,Math.min(i,e)))},goToNext(){n<i&&o(n+1)},goToPrevious(){n>1&&o(n-1)}}}function Et(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _t(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){Et(e,t,n[t])}))}return e}const jt=e=>{var{state:t,children:n,wrap:i}=e,s=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"]);const[a,c]=(0,r.useState)(),{extension:u}=(0,r.useContext)(f),p=(0,r.useRef)(null),d=(0,r.useRef)(null);(0,r.useEffect)((()=>{i&&console.warn(`'wrap' prop of Extension is being used ${(null==u?void 0:u.extensionId)?`by ${u.extensionId} in ${u.extensionSlotName}`:""}. This will be removed in a future release.`)}),[]);const h=(0,r.useCallback)((e=>{c(e)}),[c]);(0,r.useEffect)((()=>{if(null!=a&&u&&!p.current)return(0,l.renderExtension)(a,u.extensionSlotName,u.extensionSlotModuleName,u.extensionId,void 0,t).then((e=>{p.current=e})),()=>{if(p&&p.current)switch(p.current.getStatus()){case"MOUNTING":p.current.mountPromise.then(p.current.unmount);break;case"MOUNTED":p.current.unmount();break;case"UPDATING":d.current&&d.current.then((()=>{p.current&&"MOUNTED"===p.current.getStatus()&&p.current.unmount()}))}}}),[null==u?void 0:u.extensionSlotName,null==u?void 0:u.extensionId,null==u?void 0:u.extensionSlotModuleName,a]),(0,r.useEffect)((()=>(p.current&&p.current.update&&("MOUNTED"===p.current.getStatus()?p.current.update(_t({},t)):"MOUNTING"===p.current.getStatus()&&p.current.mountPromise.then((()=>{p.current&&p.current.update&&(d.current=p.current.update(_t({},t)))}))),()=>{d.current=null})),[t]);const y=o().createElement("div",_t({ref:h,"data-extension-id":null==u?void 0:u.extensionId,style:{position:"relative"}},s));return"function"!=typeof n||o().isValidElement(n)?u&&i?i(y,u):y:o().createElement(o().Fragment,null,n(y,u))}},403:()=>{System.register([],(function(e,t){return{execute:function(){e((()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{createAppState:()=>a,createGlobalStore:()=>i,getAppState:()=>c,getGlobalStore:()=>s,subscribeTo:()=>u});const n=e=>{let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!=typeof o)?o:Object.assign({},t,o),n.forEach((n=>n(t,e)))}},o=()=>t,i={setState:r,getState:o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{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},r=e=>e?n(e):n,o={};function i(e,t){const n=o[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;{const n=r()((()=>t));return o[e]={value:n,active:!0},n}}function s(e,t){const n=o[e];if(!n){const n=r()((()=>null!=t?t:{}));return o[e]={value:n,active:!1},n}return n.value}function a(e){return i("app",e)}function c(){return s("app",{})}function u(e,t,n){let r=t(e.getState());return e.subscribe((e=>{const o=t(e);o!==r&&(r=o,n(o))}))}return t})())}}}))},1686:(e,t,n)=>{"use strict";n.d(t,{jk:()=>s,W5:()=>c,zJ:()=>a,se:()=>u});const r=e=>{let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!=typeof o)?o:Object.assign({},t,o),n.forEach((n=>n(t,e)))}},o=()=>t,i={setState:r,getState:o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{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},o=e=>e?r(e):r,i={};function s(e,t){const n=i[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;{const n=o()((()=>t));return i[e]={value:n,active:!0},n}}function a(e,t){const n=i[e];if(!n){const n=o()((()=>null!=t?t:{}));return i[e]={value:n,active:!1},n}return n.value}function c(){return a("app",{})}function u(e,t,n){let r=t(e.getState());return e.subscribe((e=>{const o=t(e);o!==r&&(r=o,n(o))}))}},171:(e,t,n)=>{"use strict";n.d(t,{Te:()=>rn,cW:()=>Qt,VM:()=>Yt,fu:()=>Ot,K4:()=>At,c0:()=>wt,CF:()=>_t,$d:()=>Xt});var r=n(5776),o=n.n(r),i=n(4666),s={};try{process.env.CARBON_ENABLE_CSS_CUSTOM_PROPERTIES&&"true"===process.env.CARBON_ENABLE_CSS_CUSTOM_PROPERTIES?s.enableCssCustomProperties=!0:s.enableCssCustomProperties=!1,process.env.CARBON_ENABLE_USE_CONTROLLED_STATE_WITH_VALUE&&"true"===process.env.CARBON_ENABLE_USE_CONTROLLED_STATE_WITH_VALUE?s.enableUseControlledStateWithValue=!0:s.enableUseControlledStateWithValue=!1,process.env.CARBON_ENABLE_CSS_GRID&&"true"===process.env.CARBON_ENABLE_CSS_GRID?s.enableCssGrid=!0:s.enableCssGrid=!1,process.env.CARBON_ENABLE_V11_RELEASE&&"true"===process.env.CARBON_ENABLE_V11_RELEASE?s.enableV11Release=!0:s.enableV11Release=!1}catch(e){s.enableCssCustomProperties=!1,s.enableUseControlledStateWithValue=!1,s.enableCssGrid=!1,s.enableV11Release=!1}var a=[{name:"enable-css-custom-properties",description:"Describe what the flag does",enabled:s.enableCssCustomProperties},{name:"enable-use-controlled-state-with-value",description:"Enable components to be created in either a controlled or uncontrolled mode\n",enabled:s.enableUseControlledStateWithValue},{name:"enable-css-grid",description:"Enable CSS Grid Layout in the Grid and Column React components\n",enabled:s.enableCssGrid},{name:"enable-v11-release",description:"Enable the features and functionality for the v11 Release\n",enabled:s.enableV11Release}];function c(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 u(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=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);s=!0);}catch(e){a=!0,o=e}finally{try{s||null==n.return||n.return()}finally{if(a)throw o}}return i}}(e,t)||l(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 l(e,t){if(e){if("string"==typeof e)return f(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)?f(e,t):void 0}}function f(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}for(var p=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(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=l(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,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}(e.flags);try{for(n.s();!(t=n.n()).done;){var r=u(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&&c(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),d=new p(undefined),h=0;h<a.length;h++){var y=a[h];d.add(y.name,y.enabled)}function g(){return d.enabled.apply(d,arguments)}function m(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}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){S(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function w(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 O(e,t,n){return t&&w(e.prototype,t),n&&w(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function S(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x(){return x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},x.apply(this,arguments)}function E(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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&j(e,t)}function _(e){return _=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_(e)}function j(e,t){return j=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},j(e,t)}function k(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}function P(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}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=_(e);if(t){var o=_(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return P(e)}(this,n)}}function C(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=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);s=!0);}catch(e){a=!0,o=e}finally{try{s||null==n.return||n.return()}finally{if(a)throw o}}return i}}(e,t)||A(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(e,t){if(e){if("string"==typeof e)return T(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)?T(e,t):void 0}}function T(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(){d.merge.apply(d,arguments)}({"enable-css-custom-properties":!0,"enable-css-grid":!0,"enable-v11-release":!0});var D=n(216),I=n.n(D),R=n(841),N=n.n(R);function M(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}function L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?M(Object(n),!0).forEach((function(t){B(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function B(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function U(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}var z=["width","height","viewBox"],F=["tabindex"],K={focusable:"false",preserveAspectRatio:"xMidYMid meet"};function V(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}function q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?V(Object(n),!0).forEach((function(t){H(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function H(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W(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}var G=["className","children","tabIndex"],Z=["tabindex"],Y=o().forwardRef((function(e,t){var n=e.className,r=e.children,i=e.tabIndex,s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.width,n=e.height,r=e.viewBox,o=void 0===r?"0 0 ".concat(t," ").concat(n):r,i=U(e,z),s=i.tabindex,a=U(i,F),c=L(L(L({},K),a),{},{width:t,height:n,viewBox:o});return c["aria-label"]||c["aria-labelledby"]||c.title?(c.role="img",null!=s&&(c.focusable="true",c.tabindex=s)):c["aria-hidden"]=!0,c}(q(q({},W(e,G)),{},{tabindex:i})),a=s.tabindex,c=W(s,Z);return n&&(c.className=n),null!=a&&(c.tabIndex=a),t&&(c.ref=t),o().createElement("svg",c,r)}));Y.displayName="Icon",Y.propTypes={"aria-hidden":I().string,"aria-label":I().string,"aria-labelledby":I().string,children:I().node,className:I().string,height:I().oneOfType([I().number,I().string]),preserveAspectRatio:I().string,tabIndex:I().string,viewBox:I().string,width:I().oneOfType([I().number,I().string]),xmlns:I().string},Y.defaultProps={xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid meet"},I().oneOfType([I().number,I().string]);var X,Q,J,ee,te,ne,re=["children","size"],oe=["children","size"],ie=["children","size"],se=o().forwardRef((function(e,t){var n=e.children,r=e.size,i=void 0===r?16:r,s=W(e,re);return o().createElement(Y,q({width:i,height:i,ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},s),X||(X=o().createElement("path",{d:"M26,4H6A2,2,0,0,0,4,6V26a2,2,0,0,0,2,2H26a2,2,0,0,0,2-2V6A2,2,0,0,0,26,4ZM6,26V6H26V26Z"})),n)})),ae=o().forwardRef((function(e,t){var n=e.children,r=e.size,i=void 0===r?16:r,s=W(e,oe);return o().createElement(Y,q({width:i,height:i,ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},s),Q||(Q=o().createElement("path",{d:"M26,4H6A2,2,0,0,0,4,6V26a2,2,0,0,0,2,2H26a2,2,0,0,0,2-2V6A2,2,0,0,0,26,4ZM14,21.5,9,16.5427,10.5908,15,14,18.3456,21.4087,11l1.5918,1.5772Z"})),J||(J=o().createElement("path",{fill:"none",d:"M14,21.5,9,16.5427,10.5908,15,14,18.3456,21.4087,11l1.5918,1.5772Z","data-icon-path":"inner-path"})),n)})),ce=o().forwardRef((function(e,t){var n=e.children,r=e.size,i=void 0===r?16:r,s=W(e,ie);return"glyph"===i||"glyph"===i||"glyphpx"===i?o().createElement(Y,q({width:i,height:i,ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 10 6",fill:"currentColor"},s),ee||(ee=o().createElement("path",{d:"M5 6L0 1 0.7 0.3 5 4.6 9.3 0.3 10 1z"})),n):16===i||"16"===i||"16px"===i?o().createElement(Y,q({width:i,height:i,ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},s),te||(te=o().createElement("path",{d:"M8 11L3 6 3.7 5.3 8 9.6 12.3 5.3 13 6z"})),n):o().createElement(Y,q({width:i,height:i,ref:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor"},s),ne||(ne=o().createElement("path",{d:"M16 22L6 12 7.4 10.6 16 19.2 24.6 10.6 26 12z"})),n)})),ue=o().createContext("cds");function le(){return o().useContext(ue)}var fe=["children","className","href","disabled","inline","visited","renderIcon","size"],pe=o().forwardRef((function(e,t){var n,r=e.children,i=e.className,s=e.href,a=e.disabled,c=void 0!==a&&a,u=e.inline,l=void 0!==u&&u,f=e.visited,p=void 0!==f&&f,d=e.renderIcon,h=e.size,y=k(e,fe),g=le(),m={className:N()("".concat(g,"--link"),i,(S(n={},"".concat(g,"--link--disabled"),c),S(n,"".concat(g,"--link--inline"),l),S(n,"".concat(g,"--link--visited"),p),S(n,"".concat(g,"--link--").concat(h),h),n)),rel:"_blank"===y.target?"noopener":null};return c?(m.role="link",m["aria-disabled"]=!0):m.href=s,o().createElement("a",x({ref:t},m,y),r,!l&&d&&o().createElement("div",{className:"".concat(g,"--link__icon")},o().createElement(d,null)))}));pe.displayName="Link",pe.propTypes={children:I().node,className:I().string,disabled:I().bool,href:I().string,inline:I().bool,renderIcon:I().oneOfType([I().func,I().object]),size:I().oneOf(["sm","md","lg"]),visited:I().bool};var de=pe,he={};function ye(e,t){return function(t,n,r){if(void 0!==t[n]){he[r]&&he[r][n]||(he[r]=b(b({},he[r]),{},S({},n,!0)));for(var o=arguments.length,i=new Array(o>3?o-3:0),s=3;s<o;s++)i[s-3]=arguments[s];return e.apply(void 0,[t,n,r].concat(i))}}}var ge=function(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];for(var i=0;i<e.length&&!t.defaultPrevented;i++)"function"==typeof e[i]&&e[i].apply(e,[t].concat(r))}},me="undefined"!=typeof window?r.useLayoutEffect:r.useEffect;function be(e){if(function(e){if(e.tabIndex<0)return!1;if(e.disabled)return!1;switch(e.nodeName){case"A":return!!e.href&&"ignore"!==e.rel;case"INPUT":return"hidden"!==e.type;case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}}(e))return e;var t,n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=A(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,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}(e.childNodes);try{for(n.s();!(t=n.n()).done;){var r=be(t.value);if(r)return r}}catch(e){n.e(e)}finally{n.f()}return null}function ve(e,t){for(var n=0;n<t.length;n++)if(we(e,t[n]))return!0;return!1}function we(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.key,r=t.which,o=t.keyCode,i=t.code;return"string"==typeof e?e===n:"number"==typeof e?e===r||e===o:e.key&&Array.isArray(n)?-1!==n.indexOf(e.key):e.key===n||e.which===r||e.keyCode===o||e.code===i}var Oe,Se,xe,Ee,_e={key:"Enter",which:13,keyCode:13,code:"Enter"},je={key:" ",which:32,keyCode:32,code:"Space"},ke=["children","className","light"],Pe=["children","className","clicked","href","light","onClick","onKeyDown"],$e=["children","className","disabled","id","light","name","onClick","onChange","onKeyDown","selected","tabIndex","title","value"],Ce=["tabIndex","className","children","expanded","tileMaxHeight","tilePadding","onClick","onKeyUp","tileCollapsedIconText","tileExpandedIconText","tileCollapsedLabel","tileExpandedLabel","light"],Ae=o().forwardRef((function(e,t){var n=e.children,r=e.className,i=e.light,s=void 0!==i&&i,a=k(e,ke),c=le(),u=N()("".concat(c,"--tile"),S({},"".concat(c,"--tile--light"),s),r);return o().createElement("div",x({className:u,ref:t},a),n)}));Ae.displayName="Tile",Ae.propTypes={children:I().node,className:I().string,light:ye(I().bool)};var Te=o().forwardRef((function(e,t){var n,i=e.children,s=e.className,a=e.clicked,c=void 0!==a&&a,u=e.href,l=e.light,f=e.onClick,p=void 0===f?function(){}:f,d=e.onKeyDown,h=void 0===d?function(){}:d,y=k(e,Pe),g=le(),m=N()("".concat(g,"--tile"),"".concat(g,"--tile--clickable"),(S(n={},"".concat(g,"--tile--is-clicked"),c),S(n,"".concat(g,"--tile--light"),l),n),s),b=C((0,r.useState)(c),2),v=b[0],w=b[1];return o().createElement(de,x({className:m,href:u,onClick:function(e){e.persist(),w(!v),p(e)},onKeyDown:function(e){e.persist(),ve(e,[_e,je])&&(e.preventDefault(),w(!v),h(e)),h(e)},ref:t},y),i)}));Te.displayName="ClickableTile",Te.propTypes={children:I().node,className:I().string,clicked:I().bool,href:I().string,light:ye(I().bool),onClick:I().func,onKeyDown:I().func,rel:I().string};var De=o().forwardRef((function(e,t){var n,i=e.children,s=e.className,a=e.disabled,c=e.id,u=e.light,l=e.name,f=e.onClick,p=void 0===f?function(){}:f,d=e.onChange,h=void 0===d?function(){}:d,y=e.onKeyDown,g=void 0===y?function(){}:y,m=e.selected,b=void 0!==m&&m,v=e.tabIndex,w=void 0===v?0:v,O=e.title,E=void 0===O?"title":O,_=e.value,j=void 0===_?"value":_,P=k(e,$e),$=le(),A=p,T=g,D=C((0,r.useState)(b),2),I=D[0],R=D[1],M=C((0,r.useState)(b),2),L=M[0],B=M[1],U=N()("".concat($,"--tile"),"".concat($,"--tile--selectable"),(S(n={},"".concat($,"--tile--is-selected"),I),S(n,"".concat($,"--tile--light"),u),S(n,"".concat($,"--tile--disabled"),a),n),s),z=N()("".concat($,"--tile-input"),S({},"".concat($,"--tile-input--checked"),I));return b!==L&&(R(b),B(b)),o().createElement(o().Fragment,null,o().createElement("input",{checked:I,className:z,disabled:a,id:c,name:l,onChange:a?null:function(e){R(e.target.checked),h(e)},ref:t,tabIndex:-1,title:E,type:"checkbox",value:j}),o().createElement("label",x({className:U,htmlFor:c,onClick:a?null:function(e){e.preventDefault(),e.persist(),R(!I),A(e),h(e)},onKeyDown:a?null:function(e){e.persist(),ve(e,[_e,je])&&(e.preventDefault(),R(!I),h(e)),T(e)},tabIndex:a?null:w},P),o().createElement("span",{className:"".concat($,"--tile__checkmark ").concat($,"--tile__checkmark--persistent")},I?Oe||(Oe=o().createElement(ae,null)):Se||(Se=o().createElement(se,null))),o().createElement("span",{className:"".concat($,"--tile-content")},i)))}));function Ie(e){var t,n,i=e.tabIndex,s=e.className,a=e.children,c=e.expanded,u=e.tileMaxHeight,l=e.tilePadding,f=e.onClick,p=e.onKeyUp,d=e.tileCollapsedIconText,h=e.tileExpandedIconText,y=e.tileCollapsedLabel,g=e.tileExpandedLabel,m=e.light,b=k(e,Ce),v=C((0,r.useState)(u),2),w=v[0],O=v[1],E=C((0,r.useState)(l),2),_=E[0],j=E[1],P=C((0,r.useState)(c),2),$=P[0],A=P[1],T=C((0,r.useState)(u),2),D=T[0],I=T[1],R=C((0,r.useState)(l),2),M=R[0],L=R[1],B=C((0,r.useState)(c),2),U=B[0],z=B[1],F=C((0,r.useState)(!1),2),K=F[0],V=F[1],q=(0,r.useRef)(null),H=(0,r.useRef)(null),W=(0,r.useRef)(null),G=(0,r.useRef)(null),Z=le();function Y(){U&&O(W.current.getBoundingClientRect().height),O(q.current.getBoundingClientRect().height)}function X(e){e.persist(),z(!U),Y(),f&&f(e)}function Q(e){e.target!==G.current&&ve(e,[_e,je])&&e.preventDefault()}c!==$&&(z(c),A(c),Y()),u!==D&&(O(u),I(u)),l!==M&&(j(l),L(l));var J=N()("".concat(Z,"--tile"),"".concat(Z,"--tile--expandable"),(S(t={},"".concat(Z,"--tile--is-expanded"),U),S(t,"".concat(Z,"--tile--light"),m),t),s),ee=N()("".concat(Z,"--tile"),"".concat(Z,"--tile--expandable"),"".concat(Z,"--tile--expandable--interactive"),(S(n={},"".concat(Z,"--tile--is-expanded"),U),S(n,"".concat(Z,"--tile--light"),m),n),s),te=N()("".concat(Z,"--tile__chevron"),"".concat(Z,"--tile__chevron--interactive")),ne={maxHeight:U?null:w+_},re=o().Children.toArray(a);return me((function(){var e=window.getComputedStyle(G.current,null),t=q.current.getBoundingClientRect().height,n=parseInt(e.getPropertyValue("padding-top"),10),r=parseInt(e.getPropertyValue("padding-bottom"),10);O(t),j(n+r)}),[]),me((function(){(be(H.current)||be(q.current))&&V(!0)}),[]),(0,r.useEffect)((function(){var e=new ResizeObserver((function(e){var t=C(e,1)[0];O(t.contentRect.height)}));return e.observe(q.current),function(){return e.disconnect()}}),[]),K?o().createElement("div",x({ref:G,style:ne,className:ee,"aria-expanded":U},b),o().createElement("div",{ref:W},o().createElement("div",{ref:q,className:"".concat(Z,"--tile-content")},re[0]),o().createElement("button",{type:"button","aria-expanded":U,onKeyUp:ge([p,Q]),onClick:ge([f,X]),"aria-label":U?h:d,className:te},xe||(xe=o().createElement(ce,null))),o().createElement("div",{ref:H,className:"".concat(Z,"--tile-content")},re[1]))):o().createElement("button",x({type:"button",ref:G,style:ne,className:J,"aria-expanded":U,title:U?h:d},b,{onKeyUp:ge([p,Q]),onClick:ge([f,X]),tabIndex:i}),o().createElement("div",{ref:W},o().createElement("div",{ref:q,className:"".concat(Z,"--tile-content")},re[0]),o().createElement("div",{className:"".concat(Z,"--tile__chevron")},o().createElement("span",null,U?g:y),Ee||(Ee=o().createElement(ce,null))),o().createElement("div",{ref:H,className:"".concat(Z,"--tile-content")},re[1])))}De.displayName="SelectableTile",De.propTypes={children:I().node,className:I().string,disabled:I().bool,id:I().string,light:ye(I().bool),name:I().string,onChange:I().func,onClick:I().func,onKeyDown:I().func,selected:I().bool,tabIndex:I().number,title:I().string,value:I().oneOfType([I().string,I().number]).isRequired},Ie.propTypes={children:I().node,className:I().string,expanded:I().bool,id:I().string,light:ye(I().bool),onClick:I().func,onKeyUp:I().func,tabIndex:I().number,tileCollapsedIconText:I().string,tileCollapsedLabel:I().string,tileExpandedIconText:I().string,tileExpandedLabel:I().string},Ie.defaultProps={tabIndex:0,expanded:!1,tileMaxHeight:0,tilePadding:0,onClick:function(){},tileCollapsedIconText:"Interact to expand Tile",tileExpandedIconText:"Interact to collapse Tile"},Ie.displayName="ExpandableTile";var Re=o().forwardRef((function(e,t){var n=e.children,r=le();return o().createElement("span",{ref:t,className:"".concat(r,"--tile-content__above-the-fold")},n)}));Re.propTypes={children:I().node},Re.displayName="TileAboveTheFoldContent";var Ne,Me,Le,Be=o().forwardRef((function(e,t){var n=e.children,r=le();return o().createElement("span",{ref:t,className:"".concat(r,"--tile-content__below-the-fold")},n)}));Be.propTypes={children:I().node},Be.displayName="TileBelowTheFoldContent";var Ue=["children","className","light"],ze=["children","href","className","handleClick","handleKeyDown","onClick","onKeyDown","clicked","light"],Fe=["children","id","tabIndex","value","name","title","iconDescription","className","handleClick","handleKeyDown","onClick","onChange","onKeyDown","light","disabled","selected"],Ke=["tabIndex","className","expanded","tileMaxHeight","tilePadding","handleClick","onKeyUp","tileCollapsedIconText","tileExpandedIconText","tileCollapsedLabel","tileExpandedLabel","onBeforeClick","light"],Ve=function(e){E(n,e);var t=$(n);function n(){return v(this,n),t.apply(this,arguments)}return O(n,[{key:"render",value:function(){var e=this.context,t=this.props,n=t.children,r=t.className,i=t.light,s=k(t,Ue),a=N()("".concat(e,"--tile"),S({},"".concat(e,"--tile--light"),i),r);return o().createElement("div",x({className:a},s),n)}}]),n}(r.Component);S(Ve,"propTypes",{children:I().node,className:I().string,light:I().bool}),S(Ve,"contextType",ue),S(Ve,"defaultProps",{light:!1});var qe=function(e){E(n,e);var t=$(n);function n(){var e;v(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return S(P(e=t.call.apply(t,[this].concat(o))),"state",{}),S(P(e),"handleClick",(function(t){t.persist(),e.setState({clicked:!e.state.clicked},(function(){var n,r,o,i;(null===(n=(r=e.props).handleClick)||void 0===n?void 0:n.call(r,t))||null===(o=(i=e.props).onClick)||void 0===o||o.call(i,t)}))})),S(P(e),"handleKeyDown",(function(t){var n,r;t.persist(),ve(t,[_e,je])?e.setState({clicked:!e.state.clicked},(function(){var n,r;(null===(n=(r=e.props).handleKeyDown)||void 0===n?void 0:n.call(r,t))||e.props.onKeyDown(t)})):(null===(n=(r=e.props).handleKeyDown)||void 0===n?void 0:n.call(r,t))||e.props.onKeyDown(t)})),e}return O(n,[{key:"render",value:function(){var e,t=this.context,n=this.props,r=n.children,i=n.href,s=n.className;n.handleClick,n.handleKeyDown,n.onClick,n.onKeyDown,n.clicked;var a=n.light,c=k(n,ze),u=N()("".concat(t,"--tile"),"".concat(t,"--tile--clickable"),(S(e={},"".concat(t,"--tile--is-clicked"),this.state.clicked),S(e,"".concat(t,"--tile--light"),a),e),s);return o().createElement(de,x({href:i,className:u},c,{onClick:this.handleClick,onKeyDown:this.handleKeyDown}),r)}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.clicked;return t.prevClicked===n?null:{clicked:n,prevClicked:n}}}]),n}(r.Component);function He(e){var t,n=e.children,i=e.id,s=e.tabIndex,a=e.value,c=e.name,u=e.title;e.iconDescription;var l=e.className,f=e.handleClick,p=e.handleKeyDown,d=e.onClick,h=e.onChange,y=e.onKeyDown,g=e.light,m=e.disabled,b=e.selected,v=k(e,Fe),w=le(),O=f||d,E=p||y,_=C((0,r.useState)(b),2),j=_[0],P=_[1],$=(0,r.useRef)(null),A=N()("".concat(w,"--tile"),"".concat(w,"--tile--selectable"),(S(t={},"".concat(w,"--tile--is-selected"),j),S(t,"".concat(w,"--tile--light"),g),S(t,"".concat(w,"--tile--disabled"),m),t),l),T=N()("".concat(w,"--tile-input"),S({},"".concat(w,"--tile-input--checked"),j));return(0,r.useEffect)((function(){P(b)}),[b]),o().createElement(o().Fragment,null,o().createElement("input",{ref:$,tabIndex:-1,id:i,className:T,value:a,onChange:m?null:function(e){P(e.target.checked),h(e)},type:"checkbox",disabled:m,name:c,title:u,checked:j}),o().createElement("label",x({htmlFor:i,className:A,tabIndex:m?null:s},v,{onClick:m?null:function(e){e.preventDefault(),e.persist(),P(!j),O(e),h(e)},onKeyDown:m?null:function(e){e.persist(),ve(e,[_e,je])&&(e.preventDefault(),P(!j),h(e)),E(e)}}),o().createElement("span",{className:"".concat(w,"--tile__checkmark ").concat(w,"--tile__checkmark--persistent")},j?Ne||(Ne=o().createElement(ae,null)):Me||(Me=o().createElement(se,null))),o().createElement("span",{className:"".concat(w,"--tile-content")},n)))}S(qe,"propTypes",{children:I().node,className:I().string,handleClick:ye(I().func),handleKeyDown:ye(I().func),href:I().string,light:I().bool,onClick:I().func,onKeyDown:I().func,rel:I().string}),S(qe,"contextType",ue),S(qe,"defaultProps",{clicked:!1,onClick:function(){},onKeyDown:function(){},light:!1}),He.defaultProps={value:"value",title:"title",selected:!1,tabIndex:0,light:!1,onClick:function(){},onChange:function(){},onKeyDown:function(){}},He.propTypes={children:I().node,className:I().string,disabled:I().bool,handleClick:ye(I().func),handleKeyDown:ye(I().func),iconDescription:ye(I().string),id:I().string,light:I().bool,name:I().string,onChange:I().func,onClick:I().func,onKeyDown:I().func,selected:I().bool,tabIndex:I().number,title:I().string,value:I().oneOfType([I().string,I().number]).isRequired};var We=function(e){E(n,e);var t=$(n);function n(){var e;v(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return S(P(e=t.call.apply(t,[this].concat(i))),"state",{}),S(P(e),"resizeObserver",null),S(P(e),"componentDidMount",(function(){if(e.resizeObserver=new ResizeObserver((function(t){var n=C(t,1)[0];e.setState({tileMaxHeight:n.contentRect.height})})),e.tile){var t=window.getComputedStyle(e.tile,null);e.aboveTheFold&&(e.resizeObserver.observe(e.aboveTheFold),e.setState({tileMaxHeight:e.aboveTheFold.getBoundingClientRect().height,tilePadding:parseInt(t.getPropertyValue("padding-top"),10)+parseInt(t.getPropertyValue("padding-bottom"),10)}))}})),S(P(e),"componentDidUpdate",(function(t){t.expanded!==e.props.expanded&&e.setMaxHeight()})),S(P(e),"setMaxHeight",(function(){(e.state.expanded?e.tileContent:e.aboveTheFold)&&e.setState({tileMaxHeight:e.state.expanded?e.tileContent.getBoundingClientRect().height:e.aboveTheFold.getBoundingClientRect().height})})),S(P(e),"handleClick",(function(t){e.props.onBeforeClick(t)&&"INPUT"!==t.target.tagName&&(t.persist(),e.setState({expanded:!e.state.expanded},(function(){var n,r,o,i;e.setMaxHeight(),(null===(n=(r=e.props).handleClick)||void 0===n?void 0:n.call(r,t))||null===(o=(i=e.props).onClick)||void 0===o||o.call(i,t)})))})),S(P(e),"handleKeyUp",(function(t){t.target!==e.tile&&ve(t,[_e,je])&&t.preventDefault()})),S(P(e),"getChildren",(function(){return o().Children.toArray(e.props.children)})),e}return O(n,[{key:"componentWillUnmount",value:function(){this.resizeObserver&&this.resizeObserver.disconnect()}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.tabIndex,i=n.className;n.expanded,n.tileMaxHeight,n.tilePadding,n.handleClick;var s=n.onKeyUp,a=n.tileCollapsedIconText,c=n.tileExpandedIconText,u=n.tileCollapsedLabel,l=n.tileExpandedLabel;n.onBeforeClick;var f=n.light,p=k(n,Ke),d=this.context,h=this.state.expanded,y=N()("".concat(d,"--tile"),"".concat(d,"--tile--expandable"),(S(e={},"".concat(d,"--tile--is-expanded"),h),S(e,"".concat(d,"--tile--light"),f),e),i),g={maxHeight:h?null:this.state.tileMaxHeight+this.state.tilePadding},m=this.getChildren();return o().createElement("button",x({type:"button",ref:function(e){t.tile=e},style:g,className:y,"aria-expanded":h,title:h?c:a},p,{onKeyUp:ge([s,this.handleKeyUp]),onClick:this.handleClick,tabIndex:r}),o().createElement("div",{ref:function(e){t.tileContent=e}},o().createElement("div",{ref:function(e){t.aboveTheFold=e},className:"".concat(d,"--tile-content")},m[0]),o().createElement("div",{className:"".concat(d,"--tile__chevron")},o().createElement("span",null,h?l:u),Le||(Le=o().createElement(ce,null))),o().createElement("div",{className:"".concat(d,"--tile-content")},m[1])))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=e.expanded,r=e.tileMaxHeight,o=e.tilePadding,i=t.prevExpanded,s=t.prevTileMaxHeight,a=t.prevTilePadding,c=t.expanded,u=t.tileMaxHeight,l=t.tilePadding,f=i!==n,p=s!==r,d=a!==o;return f||p||d?{expanded:f?n:c,tileMaxHeight:p?r:u,tilePadding:d?o:l,prevExpanded:n,prevTileMaxHeight:r,prevTilePadding:o}:null}}]),n}(r.Component);S(We,"propTypes",{children:I().node,className:I().string,expanded:I().bool,handleClick:ye(I().func),id:I().string,light:I().bool,onBeforeClick:I().func,onClick:I().func,onKeyUp:I().func,tabIndex:I().number,tileCollapsedIconText:I().string,tileCollapsedLabel:I().string,tileExpandedIconText:I().string,tileExpandedLabel:I().string}),S(We,"contextType",ue),S(We,"defaultProps",{tabIndex:0,expanded:!1,tileMaxHeight:0,tilePadding:0,onBeforeClick:function(){return!0},onClick:function(){},tileCollapsedIconText:"Interact to expand Tile",tileExpandedIconText:"Interact to collapse Tile",light:!1});var Ge=function(e){E(n,e);var t=$(n);function n(){return v(this,n),t.apply(this,arguments)}return O(n,[{key:"render",value:function(){var e=this.context,t=this.props.children;return o().createElement("span",{className:"".concat(e,"--tile-content__above-the-fold")},t)}}]),n}(r.Component);S(Ge,"propTypes",{children:I().node}),S(Ge,"contextType",ue);var Ze=function(e){E(n,e);var t=$(n);function n(){return v(this,n),t.apply(this,arguments)}return O(n,[{key:"render",value:function(){var e=this.props.children,t=this.context;return o().createElement("span",{className:"".concat(t,"--tile-content__below-the-fold")},e)}}]),n}(r.Component);S(Ze,"propTypes",{children:I().node}),S(Ze,"contextType",ue);var Ye=g("enable-v11-release")?Ae:Ve;g("enable-v11-release"),g("enable-v11-release"),g("enable-v11-release"),g("enable-v11-release"),g("enable-v11-release");var Xe,Qe=(Xe={"aria-label":I().string,"aria-labelledby":I().string},Object.keys(Xe).reduce((function(e,t){return b(b({},e),{},S({},t,(n=Xe[t],function(e,t,r){for(var o=arguments.length,i=new Array(o>3?o-3:0),s=3;s<o;s++)i[s-3]=arguments[s];return n.apply(void 0,[e,t,r].concat(i))})));var n}),{})),Je=["SideNavFooter","SideNavHeader","SideNavItems","SideNavMenu"],et=["expanded","defaultExpanded","isChildOfHeader","aria-label","aria-labelledby","children","onToggle","className","isFixedNav","isRail","isPersistent","addFocusListeners","addMouseListeners","onOverlayClick"],tt=o().forwardRef((function(e,t){var n,i,s=e.expanded,a=e.defaultExpanded,c=e.isChildOfHeader,u=e["aria-label"],l=e["aria-labelledby"],f=e.children,p=e.onToggle,d=e.className,h=e.isFixedNav,y=e.isRail,g=e.isPersistent,m=e.addFocusListeners,v=e.addMouseListeners,w=e.onOverlayClick,O=k(e,et),E=le(),_=(0,r.useRef)(void 0!==s).current,j=C((0,r.useState)(a),2),P=j[0],$=j[1],A=C((0,r.useState)(a),2),T=A[0],D=A[1],I=_?s:P,R=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:!I;_||$(t),p&&p(e,t),(_||y)&&D(t)},M={"aria-label":u,"aria-labelledby":l},L=N()((S(n={},"".concat(E,"--side-nav"),!0),S(n,"".concat(E,"--side-nav--expanded"),I||T),S(n,"".concat(E,"--side-nav--collapsed"),!I&&h),S(n,"".concat(E,"--side-nav--rail"),y),S(n,d,!!d),S(n,"".concat(E,"--side-nav--ux"),c),S(n,"".concat(E,"--side-nav--hidden"),!g),n)),B=N()((S(i={},"".concat(E,"--side-nav__overlay"),!0),S(i,"".concat(E,"--side-nav__overlay-active"),I||T),i)),U=f;y&&(U=o().Children.map(f,(function(e){var t,n,r,i=_&&T||I;return o().cloneElement(e,b({},Je.includes(null!==(t=null===(n=e.type)||void 0===n?void 0:n.displayName)&&void 0!==t?t:null===(r=e.type)||void 0===r?void 0:r.name)?{isSideNavExpanded:i}:{}))})));var z={};return m&&(z.onFocus=function(e){e.currentTarget.contains(e.relatedTarget)||R(e,!0)},z.onBlur=function(e){e.currentTarget.contains(e.relatedTarget)||R(e,!1)}),v&&y&&(z.onMouseEnter=function(){return R(!0,!0)},z.onMouseLeave=function(){return R(!1,!1)}),o().createElement(o().Fragment,null,h?null:o().createElement("div",{className:B,onClick:w}),o().createElement("nav",x({ref:t,className:"".concat(E,"--side-nav__navigation ").concat(L)},M,z,O),U))}));tt.displayName="SideNav",tt.defaultProps={defaultExpanded:!1,isChildOfHeader:!0,isFixedNav:!1,isPersistent:!0,addFocusListeners:!0,addMouseListeners:!0},tt.propTypes=b(b({},Qe),{},{addFocusListeners:I().bool,addMouseListeners:I().bool,className:I().string,defaultExpanded:I().bool,expanded:I().bool,isChildOfHeader:I().bool,isFixedNav:I().bool,isPersistent:I().bool,isRail:I().bool,onOverlayClick:I().func,onToggle:I().func});var nt=tt,rt=n(9295),ot=n(606),it=n(175),st=n(6575),at=n(6905),ct=n(595),ut=n(9494),lt=n(8396),ft=Object.prototype.hasOwnProperty;const pt=function(e){if(null==e)return!0;if((0,at.Z)(e)&&((0,st.Z)(e)||"string"==typeof e||"function"==typeof e.splice||(0,ct.Z)(e)||(0,lt.Z)(e)||(0,it.Z)(e)))return!e.length;var t=(0,ot.Z)(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if((0,ut.Z)(e))return!(0,rt.Z)(e).length;for(var n in e)if(ft.call(e,n))return!1;return!0};function dt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ht(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){dt(e,t,n[t])}))}return e}function yt(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}n(4645);const gt=new i.Subject;let mt=0;const bt=new i.Subject;let vt=0;function wt(e){var t;e&&("string"==typeof(t=e.description)?t.trim().length>0:"object"==typeof t&&(t instanceof Error||!pt(t)))?(e.description instanceof Error&&(e.description=e.description.toLocaleString()),setTimeout((()=>{gt.next(yt(ht({},e),{id:mt++}))}),0)):console.error("showNotification must be called with an object having a 'description' property that is a non-empty string or object")}function Ot(e){var t;e&&("string"==typeof(t=e.actionButtonLabel)?t.trim().length>0:"object"==typeof t&&!pt(t))?setTimeout((()=>{bt.next(yt(ht({},e),{id:vt++}))}),0):console.error("showActionableNotification must be called with an actionButtonLabel that is a non-empty string")}function St(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const xt=new i.Subject;let Et=0;function _t(e){var t;e&&("string"==typeof(t=e.description)?t.trim().length>0:"object"==typeof t&&!pt(t))?setTimeout((()=>{var t,n;xt.next((t=function(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){St(e,t,n[t])}))}return e}({},e),n=null!=(n={id:Et++})?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})),t))}),0):console.error("showToast must be called with an object having a 'description' property that is a non-empty string or object")}n(3196);var jt=n(403);function kt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pt(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){kt(e,t,n[t])}))}return e}function $t(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}const Ct=(0,jt.createGlobalStore)("globalModalState",{modalContainer:null,modalStack:[]});function At(e,t={},n=(()=>{})){const r=()=>{const e=Ct.getState().modalStack.find((e=>e.onClose===n));e&&function(e){const t=Ct.getState(),n=t.modalStack.map((t=>t===e?$t(Pt({},t),{state:"TO_BE_DELETED"}):t));Ct.setState($t(Pt({},t),{modalStack:n}))}(e)};return function(e){const t=Ct.getState(),n=[e,...t.modalStack];Ct.setState($t(Pt({},t),{modalStack:n}))}({state:"NEW",onClose:n,extensionId:e,props:Pt({extensionId:e,close:r},t)}),r}window.getComputedStyle(document.body).overflow;var Tt=n(5492),Dt=n(487),It=n.n(Dt),Rt=n(631),Nt=n.n(Rt),Mt=n(2052),Lt=n.n(Mt),Bt=n(4010),Ut=n.n(Bt),zt=n(1469),Ft=n.n(zt),Kt=n(9329),Vt=n.n(Kt),qt=n(6618),Ht={};Ht.styleTagTransform=Vt(),Ht.setAttributes=Ut(),Ht.insert=Lt().bind(null,"head"),Ht.domAPI=Nt(),Ht.insertStyleElement=Ft(),It()(qt.Z,Ht);const Wt=qt.Z&&qt.Z.locals?qt.Z.locals:void 0;function Gt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Zt=(0,jt.createGlobalStore)("left-nav",{slotName:null,basePath:window.spaBase});function Yt({name:e,basePath:t}){Zt.setState({slotName:e,basePath:t})}function Xt(e){Zt.getState().slotName==e&&Zt.setState({slotName:null})}const Qt=o().forwardRef(((e,t)=>{const{slotName:n,basePath:r}=(0,Tt.useStore)(Zt);var i;const s=null!==(i=window.location)&&void 0!==i?i:{pathname:""};return o().createElement(nt,function(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){Gt(e,t,n[t])}))}return e}({ref:t,expanded:!0,"aria-label":"Left navigation",className:Wt.leftNav},e),o().createElement(Tt.ExtensionSlot,{name:"global-nav-menu-slot"}),n?o().createElement(Tt.ExtensionSlot,{name:n,state:{basePath:r,currentPath:s}}):null)}));var Jt=n(2680),en=n(7909),tn={};tn.styleTagTransform=Vt(),tn.setAttributes=Ut(),tn.insert=Lt().bind(null,"head"),tn.domAPI=Nt(),tn.insertStyleElement=Ft(),It()(en.Z,tn);const nn=en.Z&&en.Z.locals?en.Z.locals:void 0,rn=({error:e,headerTitle:t})=>{var n,r;const{t:i}=(0,Jt.useTranslation)(),s="tablet"===(0,Tt.useLayoutType)();return o().createElement(Ye,{light:!0,className:nn.tile},o().createElement("div",{className:s?nn.tabletHeading:nn.desktopHeading},o().createElement("h4",null,t)),o().createElement("p",{className:nn.errorMessage},i("error","Error")," ",`${null==e||null===(n=e.response)||void 0===n?void 0:n.status}: `,null==e||null===(r=e.response)||void 0===r?void 0:r.statusText),o().createElement("p",{className:nn.errorCopy},i("errorCopy","Sorry, there was a problem displaying this information. You can try to reload this page, or contact the site administrator and quote the error code above.")))}},1990:()=>{System.register(["dayjs","i18next"],(function(e,t){var n={},r={};return{setters:[function(e){n.default=e.default},function(e){r.default=e.default}],execute:function(){e((()=>{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 s=o.prototype;i.utc=function(e){return new o({date:e,utc:!0,args:arguments})},s.utc=function(t){var n=i(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},s.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var a=s.parse;s.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),a.call(this,e)};var c=s.init;s.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 u=s.utcOffset;s.utcOffset=function(r,o){var i=this.$utils().u;if(i(r))return this.$u?0:i(this.$offset)?u.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],s=60*+o[1]+ +o[2];return 0===s?0:"+"===i?s:-s}(r),null===r))return this;var s=Math.abs(r)<=16?60*r:r,a=this;if(o)return a.$offset=s,a.$u=0===r,a;if(0!==r){var c=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(a=this.local().add(s+c,e)).$offset=s,a.$x.$localOffset=c}else a=this.utc();return a};var l=s.format;s.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return l.call(this,t)},s.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},s.isUTC=function(){return!!this.$u},s.toISOString=function(){return this.toDate().toISOString()},s.toString=function(){return this.toDate().toUTCString()};var f=s.toDate;s.toDate=function(e){return"s"===e&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():f.call(this)};var p=s.diff;s.diff=function(e,t,n){if(e&&this.$u===e.$u)return p.call(this,e,t,n);var r=this.local(),o=i(e).local();return p.call(r,o,t,n)}}}()},74:(e,t,n)=>{const r=Symbol("SemVer ANY");e.exports=class e{static get ANY(){return r}parse(e){const t=this.options.loose?o[i.COMPARATORLOOSE]:o[i.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new c(n[2],this.options.loose):this.semver=r}toString(){return this.value}test(e){if(a("Comparator.test",e,this.options.loose),this.semver===r||e===r)return!0;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}return s(e,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Comparator is required");if(n&&"object"==typeof n||(n={loose:!!n,includePrerelease:!1}),""===this.operator)return""===this.value||new u(t.value,n).test(this.value);if(""===t.operator)return""===t.value||new u(this.value,n).test(t.semver);const r=!(">="!==this.operator&&">"!==this.operator||">="!==t.operator&&">"!==t.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==t.operator&&"<"!==t.operator),i=this.semver.version===t.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==t.operator&&"<="!==t.operator),c=s(this.semver,"<",t.semver,n)&&(">="===this.operator||">"===this.operator)&&("<="===t.operator||"<"===t.operator),l=s(this.semver,">",t.semver,n)&&("<="===this.operator||"<"===this.operator)&&(">="===t.operator||">"===t.operator);return r||o||i&&a||c||l}constructor(t,n){if(n&&"object"==typeof n||(n={loose:!!n,includePrerelease:!1}),t instanceof e){if(t.loose===!!n.loose)return t;t=t.value}a("comparator",t,n),this.options=n,this.loose=!!n.loose,this.parse(t),this.semver===r?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}};const{re:o,t:i}=n(887),s=n(401),a=n(843),c=n(405),u=n(355)},355:(e,t,n)=>{e.exports=class e{format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const t=this.options.loose;e=e.trim();const n=t?s[a.HYPHENRANGELOOSE]:s[a.HYPHENRANGE];e=e.replace(n,S(this.options.includePrerelease)),o("hyphen replace",e),e=e.replace(s[a.COMPARATORTRIM],c),o("comparator trim",e,s[a.COMPARATORTRIM]),e=(e=(e=e.replace(s[a.TILDETRIM],u)).replace(s[a.CARETTRIM],l)).split(/\s+/).join(" ");const i=t?s[a.COMPARATORLOOSE]:s[a.COMPARATOR];return e.split(" ").map((e=>p(e,this.options))).join(" ").split(/\s+/).map((e=>O(e,this.options))).filter(this.options.loose?e=>!!e.match(i):()=>!0).map((e=>new r(e,this.options)))}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some((e=>f(e,n)&&t.set.some((t=>f(t,n)&&e.every((e=>t.every((t=>e.intersects(t,n)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new i(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(x(this.set[t],e,this.options))return!0;return!1}constructor(t,n){if(n&&"object"==typeof n||(n={loose:!!n,includePrerelease:!1}),t instanceof e)return t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease?t:new e(t.raw,n);if(t instanceof r)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=t,this.set=t.split(/\s*\|\|\s*/).map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${t}`);this.format()}};const r=n(74),o=n(843),i=n(405),{re:s,t:a,comparatorTrimReplace:c,tildeTrimReplace:u,caretTrimReplace:l}=n(887),f=(e,t)=>{let n=!0;const r=e.slice();let o=r.pop();for(;n&&r.length;)n=r.every((e=>o.intersects(e,t))),o=r.pop();return n},p=(e,t)=>(o("comp",e,t),e=g(e,t),o("caret",e),e=h(e,t),o("tildes",e),e=b(e,t),o("xrange",e),e=w(e,t),o("stars",e),e),d=e=>!e||"x"===e.toLowerCase()||"*"===e,h=(e,t)=>e.trim().split(/\s+/).map((e=>y(e,t))).join(" "),y=(e,t)=>{const n=t.loose?s[a.TILDELOOSE]:s[a.TILDE];return e.replace(n,((t,n,r,i,s)=>{let a;return o("tilde",e,t,n,r,i,s),d(n)?a="":d(r)?a=`>=${n}.0.0 <${+n+1}.0.0-0`:d(i)?a=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:s?(o("replaceTilde pr",s),a=`>=${n}.${r}.${i}-${s} <${n}.${+r+1}.0-0`):a=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,o("tilde return",a),a}))},g=(e,t)=>e.trim().split(/\s+/).map((e=>m(e,t))).join(" "),m=(e,t)=>{o("caret",e,t);const n=t.loose?s[a.CARETLOOSE]:s[a.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,((t,n,i,s,a)=>{let c;return o("caret",e,t,n,i,s,a),d(n)?c="":d(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:d(s)?c="0"===n?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:a?(o("replaceCaret pr",a),c="0"===n?"0"===i?`>=${n}.${i}.${s}-${a} <${n}.${i}.${+s+1}-0`:`>=${n}.${i}.${s}-${a} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${s}-${a} <${+n+1}.0.0-0`):(o("no pr"),c="0"===n?"0"===i?`>=${n}.${i}.${s}${r} <${n}.${i}.${+s+1}-0`:`>=${n}.${i}.${s}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${s} <${+n+1}.0.0-0`),o("caret return",c),c}))},b=(e,t)=>(o("replaceXRanges",e,t),e.split(/\s+/).map((e=>v(e,t))).join(" ")),v=(e,t)=>{e=e.trim();const n=t.loose?s[a.XRANGELOOSE]:s[a.XRANGE];return e.replace(n,((n,r,i,s,a,c)=>{o("xRange",e,n,r,i,s,a,c);const u=d(i),l=u||d(s),f=l||d(a),p=f;return"="===r&&p&&(r=""),c=t.includePrerelease?"-0":"",u?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&p?(l&&(s=0),a=0,">"===r?(r=">=",l?(i=+i+1,s=0,a=0):(s=+s+1,a=0)):"<="===r&&(r="<",l?i=+i+1:s=+s+1),"<"===r&&(c="-0"),n=`${r+i}.${s}.${a}${c}`):l?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:f&&(n=`>=${i}.${s}.0${c} <${i}.${+s+1}.0-0`),o("xRange return",n),n}))},w=(e,t)=>(o("replaceStars",e,t),e.trim().replace(s[a.STAR],"")),O=(e,t)=>(o("replaceGTE0",e,t),e.trim().replace(s[t.includePrerelease?a.GTE0PRE:a.GTE0],"")),S=e=>(t,n,r,o,i,s,a,c,u,l,f,p,h)=>`${n=d(r)?"":d(o)?`>=${r}.0.0${e?"-0":""}`:d(i)?`>=${r}.${o}.0${e?"-0":""}`:s?`>=${n}`:`>=${n}${e?"-0":""}`} ${c=d(u)?"":d(l)?`<${+u+1}.0.0-0`:d(f)?`<${u}.${+l+1}.0-0`:p?`<=${u}.${l}.${f}-${p}`:e?`<${u}.${l}.${+f+1}-0`:`<=${c}`}`.trim(),x=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(o(e[n].semver),e[n].semver!==r.ANY&&e[n].semver.prerelease.length>0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}},405:(e,t,n)=>{const r=n(843),{MAX_LENGTH:o,MAX_SAFE_INTEGER:i}=n(202),{re:s,t:a}=n(887),{compareIdentifiers:c}=n(630);e.exports=class e{format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(r("SemVer.compare",this.version,this.options,t),!(t instanceof 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)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),c(this.major,t.major)||c(this.minor,t.minor)||c(this.patch,t.patch)}comparePre(t){if(t instanceof 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;let n=0;do{const e=this.prerelease[n],o=t.prerelease[n];if(r("prerelease compare",n,e,o),void 0===e&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===e)return-1;if(e!==o)return c(e,o)}while(++n)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let n=0;do{const e=this.build[n],o=t.build[n];if(r("prerelease compare",n,e,o),void 0===e&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===e)return-1;if(e!==o)return c(e,o)}while(++n)}inc(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{let e=this.prerelease.length;for(;--e>=0;)"number"==typeof this.prerelease[e]&&(this.prerelease[e]++,e=-2);-1===e&&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: ${e}`)}return this.format(),this.raw=this.version,this}constructor(t,n){if(n&&"object"==typeof n||(n={loose:!!n,includePrerelease:!1}),t instanceof e){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if("string"!=typeof t)throw new TypeError(`Invalid Version: ${t}`);if(t.length>o)throw new TypeError(`version is longer than ${o} characters`);r("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const c=t.trim().match(n.loose?s[a.LOOSE]:s[a.FULL]);if(!c)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+c[1],this.minor=+c[2],this.patch=+c[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");c[4]?this.prerelease=c[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<i)return t}return e})):this.prerelease=[],this.build=c[5]?c[5].split("."):[],this.format()}}},953:(e,t,n)=>{const r=n(497);e.exports=(e,t)=>{const n=r(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}},401:(e,t,n)=>{const r=n(896),o=n(378),i=n(261),s=n(647),a=n(433),c=n(622);e.exports=(e,t,n,u)=>{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,u);case"!=":return o(e,n,u);case">":return i(e,n,u);case">=":return s(e,n,u);case"<":return a(e,n,u);case"<=":return c(e,n,u);default:throw new TypeError(`Invalid operator: ${t}`)}}},839:(e,t,n)=>{const r=n(405),o=n(497),{re:i,t:s}=n(887);e.exports=(e,t)=>{if(e instanceof r)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){let t;for(;(t=i[s.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&t.index+t[0].length===n.index+n[0].length||(n=t),i[s.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;i[s.COERCERTL].lastIndex=-1}else n=e.match(i[s.COERCE]);return null===n?null:o(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,t)}},218:(e,t,n)=>{const r=n(405);e.exports=(e,t,n)=>{const o=new r(e,n),i=new r(t,n);return o.compare(i)||o.compareBuild(i)}},643:(e,t,n)=>{const r=n(308);e.exports=(e,t)=>r(e,t,!0)},308:(e,t,n)=>{const r=n(405);e.exports=(e,t,n)=>new r(e,n).compare(new r(t,n))},948:(e,t,n)=>{const r=n(497),o=n(896);e.exports=(e,t)=>{if(o(e,t))return null;{const n=r(e),o=r(t),i=n.prerelease.length||o.prerelease.length,s=i?"pre":"",a=i?"prerelease":"";for(const e in n)if(("major"===e||"minor"===e||"patch"===e)&&n[e]!==o[e])return s+e;return a}}},896:(e,t,n)=>{const r=n(308);e.exports=(e,t,n)=>0===r(e,t,n)},261:(e,t,n)=>{const r=n(308);e.exports=(e,t,n)=>r(e,t,n)>0},647:(e,t,n)=>{const r=n(308);e.exports=(e,t,n)=>r(e,t,n)>=0},791:(e,t,n)=>{const r=n(405);e.exports=(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:(e,t,n)=>{const r=n(308);e.exports=(e,t,n)=>r(e,t,n)<0},622:(e,t,n)=>{const r=n(308);e.exports=(e,t,n)=>r(e,t,n)<=0},629:(e,t,n)=>{const r=n(405);e.exports=(e,t)=>new r(e,t).major},986:(e,t,n)=>{const r=n(405);e.exports=(e,t)=>new r(e,t).minor},378:(e,t,n)=>{const r=n(308);e.exports=(e,t,n)=>0!==r(e,t,n)},497:(e,t,n)=>{const{MAX_LENGTH:r}=n(202),{re:o,t:i}=n(887),s=n(405);e.exports=(e,t)=>{if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof s)return e;if("string"!=typeof e)return null;if(e.length>r)return null;if(!(t.loose?o[i.LOOSE]:o[i.FULL]).test(e))return null;try{return new s(e,t)}catch(e){return null}}},800:(e,t,n)=>{const r=n(405);e.exports=(e,t)=>new r(e,t).patch},408:(e,t,n)=>{const r=n(497);e.exports=(e,t)=>{const n=r(e,t);return n&&n.prerelease.length?n.prerelease:null}},762:(e,t,n)=>{const r=n(308);e.exports=(e,t,n)=>r(t,e,n)},743:(e,t,n)=>{const r=n(218);e.exports=(e,t)=>e.sort(((e,n)=>r(n,e,t)))},312:(e,t,n)=>{const r=n(355);e.exports=(e,t,n)=>{try{t=new r(t,n)}catch(e){return!1}return t.test(e)}},354:(e,t,n)=>{const r=n(218);e.exports=(e,t)=>e.sort(((e,n)=>r(e,n,t)))},512:(e,t,n)=>{const r=n(497);e.exports=(e,t)=>{const n=r(e,t);return n?n.version:null}},770:(e,t,n)=>{const 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:e=>{const 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:e=>{const t="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=t},630:e=>{const t=/^[0-9]+$/,n=(e,n)=>{const 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:(e,t)=>n(t,e)}},887:(e,t,n)=>{const{MAX_SAFE_COMPONENT_LENGTH:r}=n(202),o=n(843),i=(t=e.exports={}).re=[],s=t.src=[],a=t.t={};let c=0;const u=(e,t,n)=>{const r=c++;o(r,t),a[e]=r,s[r]=t,i[r]=new RegExp(t,n?"g":void 0)};u("NUMERICIDENTIFIER","0|[1-9]\\d*"),u("NUMERICIDENTIFIERLOOSE","[0-9]+"),u("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),u("MAINVERSION",`(${s[a.NUMERICIDENTIFIER]})\\.(${s[a.NUMERICIDENTIFIER]})\\.(${s[a.NUMERICIDENTIFIER]})`),u("MAINVERSIONLOOSE",`(${s[a.NUMERICIDENTIFIERLOOSE]})\\.(${s[a.NUMERICIDENTIFIERLOOSE]})\\.(${s[a.NUMERICIDENTIFIERLOOSE]})`),u("PRERELEASEIDENTIFIER",`(?:${s[a.NUMERICIDENTIFIER]}|${s[a.NONNUMERICIDENTIFIER]})`),u("PRERELEASEIDENTIFIERLOOSE",`(?:${s[a.NUMERICIDENTIFIERLOOSE]}|${s[a.NONNUMERICIDENTIFIER]})`),u("PRERELEASE",`(?:-(${s[a.PRERELEASEIDENTIFIER]}(?:\\.${s[a.PRERELEASEIDENTIFIER]})*))`),u("PRERELEASELOOSE",`(?:-?(${s[a.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${s[a.PRERELEASEIDENTIFIERLOOSE]})*))`),u("BUILDIDENTIFIER","[0-9A-Za-z-]+"),u("BUILD",`(?:\\+(${s[a.BUILDIDENTIFIER]}(?:\\.${s[a.BUILDIDENTIFIER]})*))`),u("FULLPLAIN",`v?${s[a.MAINVERSION]}${s[a.PRERELEASE]}?${s[a.BUILD]}?`),u("FULL",`^${s[a.FULLPLAIN]}$`),u("LOOSEPLAIN",`[v=\\s]*${s[a.MAINVERSIONLOOSE]}${s[a.PRERELEASELOOSE]}?${s[a.BUILD]}?`),u("LOOSE",`^${s[a.LOOSEPLAIN]}$`),u("GTLT","((?:<|>)?=?)"),u("XRANGEIDENTIFIERLOOSE",`${s[a.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),u("XRANGEIDENTIFIER",`${s[a.NUMERICIDENTIFIER]}|x|X|\\*`),u("XRANGEPLAIN",`[v=\\s]*(${s[a.XRANGEIDENTIFIER]})(?:\\.(${s[a.XRANGEIDENTIFIER]})(?:\\.(${s[a.XRANGEIDENTIFIER]})(?:${s[a.PRERELEASE]})?${s[a.BUILD]}?)?)?`),u("XRANGEPLAINLOOSE",`[v=\\s]*(${s[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[a.XRANGEIDENTIFIERLOOSE]})(?:${s[a.PRERELEASELOOSE]})?${s[a.BUILD]}?)?)?`),u("XRANGE",`^${s[a.GTLT]}\\s*${s[a.XRANGEPLAIN]}$`),u("XRANGELOOSE",`^${s[a.GTLT]}\\s*${s[a.XRANGEPLAINLOOSE]}$`),u("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),u("COERCERTL",s[a.COERCE],!0),u("LONETILDE","(?:~>?)"),u("TILDETRIM",`(\\s*)${s[a.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",u("TILDE",`^${s[a.LONETILDE]}${s[a.XRANGEPLAIN]}$`),u("TILDELOOSE",`^${s[a.LONETILDE]}${s[a.XRANGEPLAINLOOSE]}$`),u("LONECARET","(?:\\^)"),u("CARETTRIM",`(\\s*)${s[a.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",u("CARET",`^${s[a.LONECARET]}${s[a.XRANGEPLAIN]}$`),u("CARETLOOSE",`^${s[a.LONECARET]}${s[a.XRANGEPLAINLOOSE]}$`),u("COMPARATORLOOSE",`^${s[a.GTLT]}\\s*(${s[a.LOOSEPLAIN]})$|^$`),u("COMPARATOR",`^${s[a.GTLT]}\\s*(${s[a.FULLPLAIN]})$|^$`),u("COMPARATORTRIM",`(\\s*)${s[a.GTLT]}\\s*(${s[a.LOOSEPLAIN]}|${s[a.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",u("HYPHENRANGE",`^\\s*(${s[a.XRANGEPLAIN]})\\s+-\\s+(${s[a.XRANGEPLAIN]})\\s*$`),u("HYPHENRANGELOOSE",`^\\s*(${s[a.XRANGEPLAINLOOSE]})\\s+-\\s+(${s[a.XRANGEPLAINLOOSE]})\\s*$`),u("STAR","(<|>)?=?\\s*\\*"),u("GTE0","^\\s*>=\\s*0.0.0\\s*$"),u("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")},715:(e,t,n)=>{const r=n(260);e.exports=(e,t,n)=>r(e,t,">",n)},560:(e,t,n)=>{const r=n(355);e.exports=(e,t,n)=>(e=new r(e,n),t=new r(t,n),e.intersects(t))},6:(e,t,n)=>{const r=n(260);e.exports=(e,t,n)=>r(e,t,"<",n)},931:(e,t,n)=>{const r=n(405),o=n(355);e.exports=(e,t,n)=>{let i=null,s=null,a=null;try{a=new o(t,n)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(i&&-1!==s.compare(e)||(i=e,s=new r(i,n)))})),i}},891:(e,t,n)=>{const r=n(405),o=n(355);e.exports=(e,t,n)=>{let i=null,s=null,a=null;try{a=new o(t,n)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(i&&1!==s.compare(e)||(i=e,s=new r(i,n)))})),i}},925:(e,t,n)=>{const r=n(405),o=n(355),i=n(261);e.exports=(e,t)=>{e=new o(e,t);let 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(let t=0;t<e.set.length;++t)e.set[t].forEach((e=>{const 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: ${e.operator}`)}}));return n&&e.test(n)?n:null}},260:(e,t,n)=>{const r=n(405),o=n(74),{ANY:i}=o,s=n(355),a=n(312),c=n(261),u=n(433),l=n(622),f=n(647);e.exports=(e,t,n,p)=>{let d,h,y,g,m;switch(e=new r(e,p),t=new s(t,p),n){case">":d=c,h=l,y=u,g=">",m=">=";break;case"<":d=u,h=f,y=c,g="<",m="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,p))return!1;for(let n=0;n<t.set.length;++n){const r=t.set[n];let s=null,a=null;if(r.forEach((e=>{e.semver===i&&(e=new o(">=0.0.0")),s=s||e,a=a||e,d(e.semver,s.semver,p)?s=e:y(e.semver,a.semver,p)&&(a=e)})),s.operator===g||s.operator===m)return!1;if((!a.operator||a.operator===g)&&h(e,a.semver))return!1;if(a.operator===m&&y(e,a.semver))return!1}return!0}},795:(e,t,n)=>{const r=n(312),o=n(308);e.exports=(e,t,n)=>{const i=[];let s=null,a=null;const c=e.sort(((e,t)=>o(e,t,n)));for(const e of c)r(e,t,n)?(a=e,s||(s=e)):(a&&i.push([s,a]),a=null,s=null);s&&i.push([s,null]);const u=[];for(const[e,t]of i)e===t?u.push(e):t||e!==c[0]?t?e===c[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");const l=u.join(" || "),f="string"==typeof t.raw?t.raw:String(t);return l.length<f.length?l:t}},732:(e,t,n)=>{const r=n(355),{ANY:o}=n(74),i=n(312),s=n(308),a=(e,t,n)=>{if(1===e.length&&e[0].semver===o)return 1===t.length&&t[0].semver===o;const r=new Set;let a,l,f,p,d,h,y;for(const t of e)">"===t.operator||">="===t.operator?a=c(a,t,n):"<"===t.operator||"<="===t.operator?l=u(l,t,n):r.add(t.semver);if(r.size>1)return null;if(a&&l){if(f=s(a.semver,l.semver,n),f>0)return null;if(0===f&&(">="!==a.operator||"<="!==l.operator))return null}for(const e of r){if(a&&!i(e,String(a),n))return null;if(l&&!i(e,String(l),n))return null;for(const r of t)if(!i(e,String(r),n))return!1;return!0}for(const e of t){if(y=y||">"===e.operator||">="===e.operator,h=h||"<"===e.operator||"<="===e.operator,a)if(">"===e.operator||">="===e.operator){if(p=c(a,e,n),p===e)return!1}else if(">="===a.operator&&!i(a.semver,String(e),n))return!1;if(l)if("<"===e.operator||"<="===e.operator){if(d=u(l,e,n),d===e)return!1}else if("<="===l.operator&&!i(l.semver,String(e),n))return!1;if(!e.operator&&(l||a)&&0!==f)return!1}return!(a&&h&&!l&&0!==f||l&&y&&!a&&0!==f)},c=(e,t,n)=>{if(!e)return t;const r=s(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},u=(e,t,n)=>{if(!e)return t;const r=s(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,n)=>{e=new r(e,n),t=new r(t,n);let o=!1;e:for(const r of e.set){for(const e of t.set){const t=a(r,e,n);if(o=o||null!==t,t)continue e}if(o)return!1}return!0}},663:(e,t,n)=>{const r=n(355);e.exports=(e,t)=>new r(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},965:(e,t,n)=>{const r=n(355);e.exports=(e,t)=>{try{return new r(e,t).range||"*"}catch(e){return null}}},688:e=>{"use strict";e.exports=n},64:e=>{"use strict";e.exports=r}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,o),i.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(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=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";function e(e){return(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())-Date.UTC(e.getUTCFullYear(),0,0))/24/60/60/1e3}function t(e,t){const n=e.toISOString(),r=t.toISOString();return n.slice(0,n.indexOf("T"))===r.slice(0,r.indexOf("T"))}function n(n){const r=new Date,o=new Date(n),i=r.getUTCMonth()-o.getUTCMonth(),s=r.getUTCDate()-o.getUTCDate();let a=r.getUTCFullYear()-o.getUTCFullYear();(i<0||0===i&&s<0)&&a--;let c=i>=0?i:i+12;s<0&&c--;const u=c>0?`${c} mo`:"";let l=e(r)-e(o);l<0&&(l+=365);const f=Math.floor(l/7),p=l-7*f;return 0===a?t(r,o)?"Today":f<4||0===f?`${l} day`:p>0?`${f} wk ${p} d`:`${f} week`:a<2?`${u} ${a} yr`.trim():a<18?`${a} yr ${u}`.trim():`${a} years`}o.r(i),o.d(i,{age:()=>n,daysIntoYear:()=>e,formatDate:()=>E,formatDatetime:()=>j,formatTime:()=>_,isOmrsDateStrict:()=>d,isOmrsDateToday:()=>h,isSameDay:()=>t,isVersionSatisfied:()=>D,parseDate:()=>S,retry:()=>N,toDateObjectStrict:()=>y,toOmrsDateFormat:()=>O,toOmrsDayDateFormat:()=>v,toOmrsIsoString:()=>g,toOmrsTimeString:()=>b,toOmrsTimeString24:()=>m,toOmrsYearlessDateFormat:()=>w,translateFrom:()=>C});var r=o(688),s=o(14),a=o.n(s),c=o(332),u=o.n(c);function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f(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){l(e,t,n[t])}))}return e}r.default.extend(a()),r.default.extend(u());const p="YYYY-MM-DDTHH:mm:ss.SSSZZ";function d(e){return null!=e&&28===e.trim().length&&"T"===(e=e.trim())[10]&&":"===e[13]&&":"===e[16]&&"."===e[19]&&"+"===e[23]&&":"!==e[26]&&(0,r.default)(e,p).isValid()}function h(e){return(0,r.default)(e).isToday()}function y(e){return d(e)?(0,r.default)(e,p).toDate():null}function g(e,t=!1){let n=(0,r.default)(e);return t&&(n=n.utc()),n.format(p)}function m(e){return(0,r.default)(e).format("HH:mm")}function b(e){return r.default.utc(e).format("HH:mm A")}function v(e){return O(e,"DD - MMM - YYYY")}function w(e){return O(e,"DD-MMM")}function O(e,t="YYYY-MMM-DD"){return(0,r.default)(e).format(t)}function S(e){return(0,r.default)(e).toDate()}const x={mode:"standard",time:"for today",day:!0,year:!0};function E(e,t){const{mode:n,time:o,day:i,year:s}=f({},x,t),a={year:s?"numeric":void 0,month:"short",day:i?"2-digit":void 0};let c,u=k();const l=(0,r.default)(e).isToday();if(l)c=new Intl.RelativeTimeFormat(u,{numeric:"auto"}).format(0,"day"),c=c[0].toLocaleUpperCase(u)+c.slice(1);else if("en"==u&&(u="en-GB"),c=e.toLocaleDateString(u,a),"en-GB"==u&&"standard"==n&&s&&i&&(c=c.replace(/ /g,"-")),"wide"==n&&(c=c.replace(/ /g," — "),/ru.*/.test(u))){const e=c.length;c=c.slice(0,e-5)+c.slice(e-5).replace(" — "," ")}return(!0===o||l&&"for today"===o)&&(c+=`, ${_(e)}`),c}function _(e){return e.toLocaleTimeString(k(),{hour:"2-digit",minute:"2-digit"})}function j(e,t){return E(e,(n=f({},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}function k(){let e=window.i18next.language;return e=e.replace("_","-"),"ht"===e&&(e="fr-HT"),e}var P=o(64);function $(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,n,r){return(P.default.default||P.default).t(t,function(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){$(e,t,n[t])}))}return e}({ns:e,defaultValue:n},r))}var A=o(770);function T(e){const[t,n,r]=e.split(".");return`${t}.${n}.${r}`}function D(e,t){const n=function(e){const t=e.indexOf("-");return t>=0?`${T(e.slice(0,t))}-${e.slice(t+1)}`:T(e)}(t);return A.satisfies(n,e,{includePrerelease:!0})}function I(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function R(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){I(i,r,o,s,a,"next",e)}function a(e){I(i,r,o,s,a,"throw",e)}s(void 0)}))}}function N(e){return M.apply(this,arguments)}function M(){return(M=R((function*(e,t={}){let{shouldRetry:n,getDelay:r,onError:o}=t;n=null!=n?n:e=>function(e,t){return e<=5}(e),r=null!=r?r:e=>function(e,t,n=!1){const r=n?e+1:e;return 1e3*Math.pow(2,r)}(e);let i,s=0;do{try{return yield L(r(s)),yield e()}catch(e){null==o||o(e,s),i=e}}while(n(s++));throw i}))).apply(this,arguments)}function L(e){return B.apply(this,arguments)}function B(){return(B=R((function*(e){if(!(e<=0))return new Promise((t=>setTimeout(t,e)))}))).apply(this,arguments)}})(),i})())}}}))},841:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var s=o.apply(null,n);s&&e.push(s)}}else if("object"===i){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var a in n)r.call(n,a)&&n[a]&&e.push(a)}}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},7909:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(9233),o=n.n(r),i=n(361),s=n.n(i)()(o());s.push([e.id,':root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.FZ33ihINl\\+8YUVozv7ZwXw\\=\\={font-size:var(--cds-heading-compact-02-font-size, 1rem);font-weight:var(--cds-heading-compact-02-font-weight, 600);line-height:var(--cds-heading-compact-02-line-height, 1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing, 0);margin-top:2.25rem;margin-bottom:.5rem}.jx2T8vrDO9pVp2FeSg6R\\+w\\=\\={margin-bottom:.5rem;font-size:var(--cds-body-01-font-size, 0.875rem);font-weight:var(--cds-body-01-font-weight, 400);line-height:var(--cds-body-01-line-height, 1.42857);letter-spacing:var(--cds-body-01-letter-spacing, 0.16px);color:#525252}.cwU9zKw\\+qDdXGFxN1tD4Xg\\=\\= h4{font-size:var(--cds-heading-compact-02-font-size, 1rem);font-weight:var(--cds-heading-compact-02-font-weight, 600);line-height:var(--cds-heading-compact-02-line-height, 1.375);letter-spacing:var(--cds-heading-compact-02-letter-spacing, 0);color:#525252}.gOCpwZibZuK7xHHy\\+IDIHQ\\=\\= h4{font-size:var(--cds-heading-03-font-size, 1.25rem);font-weight:var(--cds-heading-03-font-weight, 400);line-height:var(--cds-heading-03-line-height, 1.4);letter-spacing:var(--cds-heading-03-letter-spacing, 0);color:#525252}.cwU9zKw\\+qDdXGFxN1tD4Xg\\=\\=,.gOCpwZibZuK7xHHy\\+IDIHQ\\=\\={text-align:left;text-transform:capitalize;margin-bottom:1rem}.cwU9zKw\\+qDdXGFxN1tD4Xg\\=\\= h4:after,.gOCpwZibZuK7xHHy\\+IDIHQ\\=\\= h4:after{content:"";display:block;width:2rem;padding-top:.188rem;border-bottom:.375rem solid var(--brand-03)}.ztmVxMaymtPTKnWjzbgENg\\=\\={text-align:center;border:1px solid #e0e0e0}',"",{version:3,sources:["webpack://./../esm-styleguide/src/_vars.scss","webpack://./../esm-styleguide/src/error-state/error-state.module.scss","webpack://./../../../node_modules/@carbon/type/scss/_styles.scss","webpack://./../../../node_modules/@carbon/layout/scss/generated/_spacing.scss"],names:[],mappings:"AAoDA,MACE,mBAAA,CACA,mBAAA,CACA,mBAAA,CCnDF,6BCq0BI,uDAAA,CAAA,0DAAA,CAAA,4DAAA,CAAA,8DAAA,CDl0BF,kBAAA,CACA,mBEaW,CFVb,6BACE,mBESW,CDozBT,gDAAA,CAAA,+CAAA,CAAA,mDAAA,CAAA,wDAAA,CD3zBF,aDTQ,CCaR,gCCuzBE,uDAAA,CAAA,0DAAA,CAAA,4DAAA,CAAA,8DAAA,CDrzBA,aDfM,CCoBR,gCCgzBE,kDAAA,CAAA,kDAAA,CAAA,kDAAA,CAAA,sDAAA,CD9yBA,aDtBM,CC0BV,0DAEE,eAAA,CACA,yBAAA,CACA,kBEJW,CFMX,4EACE,UAAA,CACA,aAAA,CACA,UAAA,CACA,mBAAA,CACA,2CAAA,CAIJ,4BACE,iBAAA,CACA,wBAAA",sourcesContent:["$ui-01: #f4f4f4;\n$ui-02: #ffffff;\n$ui-03: #e0e0e0;\n$ui-04: #8d8d8d;\n$ui-05: #161616;\n$text-02: #525252;\n$text-03: #a8a8a8;\n$ui-background: #ffffff;\n$color-gray-30: #c6c6c6;\n$color-gray-70: #525252;\n$color-gray-100: #161616;\n$color-blue-60-2: #0f62fe;\n$color-blue-10: #edf5ff;\n$color-yellow-50: #feecae;\n$carbon--red-50: #fa4d56;\n$inverse-link: #78a9ff;\n$support-02: #24a148;\n$inverse-support-03: #f1c21b;\n$warning-background: #fff8e1;\n$openmrs-background-grey: #f4f4f4;\n$danger: #da1e28;\n$interactive-01: #0f62fe;\n$field-01: #f4f4f4;\n$grey-2: #e0e0e0;\n$labeldropdown: #c6c6c6;\n\n$brand-primary-10: #d9fbfb;\n$brand-primary-20: #9ef0f0;\n$brand-primary-30: #3ddbd9;\n$brand-primary-40: #08bdba;\n$brand-primary-50: #009d9a;\n\n/* 60,70 and 80 are already declared as brand-01, 02 and 03 respectively */\n\n$brand-primary-90: #022b30;\n$brand-primary-100: #081a1c;\n\n@mixin brand-01($property) {\n #{$property}: #005d5d;\n #{$property}: var(--brand-01);\n}\n\n@mixin brand-02($property) {\n #{$property}: #004144;\n #{$property}: var(--brand-02);\n}\n\n@mixin brand-03($property) {\n #{$property}: #007d79;\n #{$property}: var(--brand-03);\n}\n\n:root {\n --brand-01: #005d5d;\n --brand-02: #004144;\n --brand-03: #007d79;\n}\n\n$breakpoint-phone-min: 0px;\n$breakpoint-phone-max: 600px;\n$breakpoint-tablet-min: 601px;\n$breakpoint-tablet-max: 1023px;\n$breakpoint-small-desktop-min: 1024px;\n$breakpoint-small-desktop-max: 1439px;\n$breakpoint-large-desktop-min: 1440px;\n$breakpoint-large-desktop-max: 99999999px;\n\n/* These color variables will be removed in a future release */\n$brand-teal-01: #007d79;\n$brand-01: #005d5d;\n$brand-02: #004144;\n",'@use "@carbon/styles/scss/spacing";\n@use "@carbon/styles/scss/type";\n@import "~@openmrs/esm-styleguide/src/vars";\n\n.errorMessage {\n @include type.type-style("heading-compact-02");\n\n margin-top: 2.25rem;\n margin-bottom: spacing.$spacing-03;\n}\n\n.errorCopy {\n margin-bottom: spacing.$spacing-03;\n @include type.type-style("body-01");\n color: $text-02;\n}\n\n.desktopHeading {\n h4 {\n @include type.type-style("heading-compact-02");\n color: $text-02;\n }\n}\n\n.tabletHeading {\n h4 {\n @include type.type-style("heading-03");\n color: $text-02;\n }\n}\n\n.desktopHeading,\n.tabletHeading {\n text-align: left;\n text-transform: capitalize;\n margin-bottom: spacing.$spacing-05;\n\n h4:after {\n content: "";\n display: block;\n width: 2rem;\n padding-top: 0.188rem;\n border-bottom: 0.375rem solid var(--brand-03);\n }\n}\n\n.tile {\n text-align: center;\n border: 1px solid $ui-03;\n}\n',"//\n// Copyright IBM Corp. 2018, 2018\n//\n// This source code is licensed under the Apache-2.0 license found in the\n// LICENSE file in the root directory of this source tree.\n//\n\n// stylelint-disable number-max-precision\n\n@use 'sass:map';\n@use 'sass:math';\n@use '@carbon/grid/scss/config' as gridconfig;\n@use '@carbon/grid/scss/breakpoint' as grid;\n@use 'prefix' as *;\n@use 'font-family';\n@use 'scale';\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$label-01: (\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$label-02: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$legal-01: (\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$legal-02: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @deprecated\n/// @group @carbon/type\n$helper-text-01: (\n font-size: scale.type-scale(1),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @deprecated\n/// @group @carbon/type\n$helper-text-02: (\n font-size: carbon--type-scale(2),\n font-weight: carbon--font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-short-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-compact-01: $body-short-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-long-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.42857,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-01: $body-long-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-short-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.375,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-compact-02: $body-short-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-long-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.5,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-02: $body-long-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$code-01: (\n font-family: font-family.font-family('mono'),\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$code-02: (\n font-family: font-family.font-family('mono'),\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.42857,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.42857,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-compact-01: $productive-heading-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.5,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.375,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-compact-02: $productive-heading-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-03: (\n font-size: scale.type-scale(5),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.4,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-03: $productive-heading-03 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-04: (\n font-size: scale.type-scale(7),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-04: $productive-heading-04 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-05: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('light'),\n line-height: 1.25,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-05: $productive-heading-05 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-06: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n // Extra digit needed for precision in Chrome\n line-height: 1.199,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-06: $productive-heading-06 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-07: (\n font-size: scale.type-scale(12),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-07: $productive-heading-07 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-01: $heading-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-02: $heading-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-03: (\n font-size: scale.type-scale(5),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.4,\n letter-spacing: 0,\n breakpoints: (\n xlg: (\n font-size: scale.type-scale(5),\n line-height: 1.25,\n ),\n max: (\n font-size: scale.type-scale(6),\n line-height: 1.334,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-03: $expressive-heading-03 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-04: (\n font-size: scale.type-scale(7),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0,\n breakpoints: (\n xlg: (\n font-size: scale.type-scale(8),\n line-height: 1.25,\n font-weight: font-family.font-weight('light'),\n ),\n max: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('light'),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-04: $expressive-heading-04 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-05: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('light'),\n line-height: 1.25,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(9),\n line-height: 1.22,\n ),\n lg: (\n font-size: scale.type-scale(10),\n line-height: 1.19,\n ),\n xlg: (\n font-size: scale.type-scale(11),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(13),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-05: $expressive-heading-05 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-06: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.25,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(9),\n line-height: 1.22,\n ),\n lg: (\n font-size: scale.type-scale(10),\n line-height: 1.19,\n ),\n xlg: (\n font-size: scale.type-scale(11),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(13),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-06: $expressive-heading-06 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-paragraph-01: (\n font-size: scale.type-scale(6),\n font-weight: font-family.font-weight('light'),\n line-height: 1.334,\n letter-spacing: 0,\n breakpoints: (\n lg: (\n font-size: scale.type-scale(7),\n line-height: 1.28572,\n ),\n max: (\n font-size: scale.type-scale(8),\n line-height: 1.25,\n ),\n ),\n);\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-paragraph-01: $expressive-paragraph-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$quotation-01: (\n font-family: font-family.font-family('serif'),\n font-size: scale.type-scale(5),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.3,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(5),\n ),\n lg: (\n font-size: scale.type-scale(6),\n line-height: 1.334,\n ),\n xlg: (\n font-size: scale.type-scale(7),\n line-height: 1.28572,\n ),\n max: (\n font-size: scale.type-scale(8),\n line-height: 1.25,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-quotation-01: $quotation-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$quotation-02: (\n font-family: font-family.font-family('serif'),\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('light'),\n line-height: 1.25,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(9),\n line-height: 1.22,\n ),\n lg: (\n font-size: scale.type-scale(10),\n line-height: 1.19,\n ),\n xlg: (\n font-size: scale.type-scale(11),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(13),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-quotation-02: $quotation-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-01: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(10),\n ),\n lg: (\n font-size: scale.type-scale(12),\n ),\n xlg: (\n font-size: scale.type-scale(13),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(15),\n line-height: 1.13,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-01: $display-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-02: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(10),\n ),\n lg: (\n font-size: scale.type-scale(12),\n ),\n xlg: (\n font-size: scale.type-scale(13),\n line-height: 1.16,\n ),\n max: (\n font-size: scale.type-scale(15),\n line-height: 1.13,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-02: $display-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-03: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(12),\n line-height: 1.18,\n ),\n lg: (\n font-size: scale.type-scale(13),\n line-height: 1.16,\n letter-spacing: -0.64px,\n ),\n xlg: (\n font-size: scale.type-scale(15),\n line-height: 1.13,\n letter-spacing: -0.64px,\n ),\n max: (\n font-size: scale.type-scale(16),\n line-height: 1.11,\n letter-spacing: -0.96px,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-03: $display-03 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-04: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(14),\n line-height: 1.15,\n ),\n lg: (\n font-size: scale.type-scale(17),\n line-height: 1.11,\n letter-spacing: -0.64px,\n ),\n xlg: (\n font-size: scale.type-scale(20),\n line-height: 1.07,\n letter-spacing: -0.64px,\n ),\n max: (\n font-size: scale.type-scale(23),\n line-height: 1.05,\n letter-spacing: -0.96px,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-04: $display-04 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$tokens: (\n label-01: $label-01,\n label-02: $label-02,\n helper-text-01: $helper-text-01,\n helper-text-02: $helper-text-02,\n body-short-01: $body-short-01,\n body-short-02: $body-short-02,\n body-long-01: $body-long-01,\n body-long-02: $body-long-02,\n code-01: $code-01,\n code-02: $code-02,\n heading-01: $heading-01,\n heading-02: $heading-02,\n productive-heading-01: $productive-heading-01,\n productive-heading-02: $productive-heading-02,\n productive-heading-03: $productive-heading-03,\n productive-heading-04: $productive-heading-04,\n productive-heading-05: $productive-heading-05,\n productive-heading-06: $productive-heading-06,\n productive-heading-07: $productive-heading-07,\n expressive-paragraph-01: $expressive-paragraph-01,\n expressive-heading-01: $expressive-heading-01,\n expressive-heading-02: $expressive-heading-02,\n expressive-heading-03: $expressive-heading-03,\n expressive-heading-04: $expressive-heading-04,\n expressive-heading-05: $expressive-heading-05,\n expressive-heading-06: $expressive-heading-06,\n quotation-01: $quotation-01,\n quotation-02: $quotation-02,\n display-01: $display-01,\n display-02: $display-02,\n display-03: $display-03,\n display-04: $display-04,\n // V11 Tokens\n legal-01: $legal-01,\n legal-02: $legal-02,\n body-compact-01: $body-compact-01,\n body-compact-02: $body-compact-02,\n heading-compact-01: $heading-compact-01,\n heading-compact-02: $heading-compact-02,\n body-01: $body-01,\n body-02: $body-02,\n heading-03: $heading-03,\n heading-04: $heading-04,\n heading-05: $heading-05,\n heading-06: $heading-06,\n heading-07: $heading-07,\n fluid-heading-03: $fluid-heading-03,\n fluid-heading-04: $fluid-heading-04,\n fluid-heading-05: $fluid-heading-05,\n fluid-heading-06: $fluid-heading-06,\n fluid-paragraph-01: $fluid-paragraph-01,\n fluid-quotation-01: $fluid-quotation-01,\n fluid-quotation-02: $fluid-quotation-02,\n fluid-display-01: $fluid-display-01,\n fluid-display-02: $fluid-display-02,\n fluid-display-03: $fluid-display-03,\n fluid-display-04: $fluid-display-04,\n);\n\n/// @param {Map} $map\n/// @access public\n/// @group @carbon/type\n@mixin properties($map) {\n @each $name, $value in $map {\n #{$name}: $value;\n }\n}\n\n/// @param {Number} $value - Number with units\n/// @return {Number} Without units\n/// @access public\n/// @group @carbon/type\n@function strip-unit($value) {\n @return math.div($value, $value * 0 + 1);\n}\n\n/// This helper includes fluid type styles for the given token value. Fluid type\n/// means that the `font-size` is computed using `calc()` in order to be\n/// determined by the screen size instead of a breakpoint. As a result, fluid\n/// styles should be used with caution in fixed width contexts.\n///\n/// In addition, we make use of %-based line-heights so that the line-height of\n/// each type style is computed correctly due to the dynamic nature of the\n/// `font-size`.\n///\n/// Most of the logic for this work comes from CSS Tricks:\n/// https://css-tricks.com/snippets/css/fluid-typography/\n///\n/// @param {Map} $type-styles - The value of a given type token\n/// @param {Map} $breakpoints [$grid-breakpoints] - Custom breakpoints to use\n/// @access public\n/// @group @carbon/type\n@mixin fluid-type($type-styles, $breakpoints: gridconfig.$grid-breakpoints) {\n // Include the initial styles for the given token by default without any\n // media query guard. This includes `font-size` as a fallback in the case\n // that a browser does not support `calc()`\n @include properties(map.remove($type-styles, breakpoints));\n // We also need to include the `sm` styles by default since they don't\n // appear in the fluid styles for tokens\n @include fluid-type-size($type-styles, sm, $breakpoints);\n\n // Finally, we need to go through all the breakpoints defined in the type\n // token and apply the properties and fluid type size for that given\n // breakpoint\n @each $name, $values in map.get($type-styles, breakpoints) {\n @include grid.breakpoint($name) {\n @include properties($values);\n @include fluid-type-size($type-styles, $name, $breakpoints);\n }\n }\n}\n\n/// Computes the fluid `font-size` for a given type style and breakpoint\n/// @param {Map} $type-styles - The styles for a given token\n/// @param {String} $name - The name of the breakpoint to which we apply the fluid\n/// @param {Map} $breakpoints [$grid-breakpoints] - The breakpoints for the grid system\n/// @access public\n/// @group @carbon/type\n@mixin fluid-type-size(\n $type-styles,\n $name,\n $breakpoints: gridconfig.$grid-breakpoints\n) {\n // Get the information about the breakpoint we're currently working in. Useful\n // for getting initial width information\n $breakpoint: map.get($breakpoints, $name);\n\n // Our fluid styles are captured under the 'breakpoints' property in our type\n // styles map. These define what values to treat as `max-` variables below\n $fluid-sizes: map.get($type-styles, breakpoints);\n $fluid-breakpoint: ();\n // Special case for `sm` because the styles for small are on the type style\n // directly\n @if $name == sm {\n $fluid-breakpoint: map.remove($type-styles, breakpoints);\n } @else {\n $fluid-breakpoint: map.get($fluid-sizes, $name);\n }\n\n // Initialize our font-sizes to the default size for the type style\n $max-font-size: map.get($type-styles, font-size);\n $min-font-size: map.get($type-styles, font-size);\n @if map.has-key($fluid-breakpoint, font-size) {\n $min-font-size: map.get($fluid-breakpoint, font-size);\n }\n\n // Initialize our min and max width to the width of the current breakpoint\n $max-vw: map.get($breakpoint, width);\n $min-vw: map.get($breakpoint, width);\n\n // We can use `breakpoint-next` to see if there is another breakpoint we can\n // use to update `max-font-size` and `max-vw` with larger values\n $next-breakpoint-available: grid.breakpoint-next($name, $breakpoints);\n $next-fluid-breakpoint-name: null;\n\n // We need to figure out what the next available fluid breakpoint is for our\n // given $type-styles. In this loop we try and iterate through breakpoints\n // until we either manually set $next-breakpoint-available to null or\n // `breakpoint-next` returns null.\n @while $next-breakpoint-available {\n @if map.has-key($fluid-sizes, $next-breakpoint-available) {\n $next-fluid-breakpoint-name: $next-breakpoint-available;\n $next-breakpoint-available: null;\n } @else {\n $next-breakpoint-available: grid.breakpoint-next(\n $next-breakpoint-available,\n $breakpoints\n );\n }\n }\n\n // If we have found the next available fluid breakpoint name, then we know\n // that we have values that we can use to set max-font-size and max-vw as both\n // values derive from the next breakpoint\n @if $next-fluid-breakpoint-name {\n $next-fluid-breakpoint: map.get($breakpoints, $next-fluid-breakpoint-name);\n $max-font-size: map.get(\n map.get($fluid-sizes, $next-fluid-breakpoint-name),\n font-size\n );\n $max-vw: map.get($next-fluid-breakpoint, width);\n\n // prettier-ignore\n font-size: calc(#{$min-font-size} +\n #{strip-unit($max-font-size - $min-font-size)} *\n ((100vw - #{$min-vw}) / #{strip-unit($max-vw - $min-vw)})\n );\n } @else {\n // Otherwise, just default to setting the font size found from the type\n // style or the given fluid breakpoint in the type style\n font-size: $min-font-size;\n }\n}\n\n// TODO move following variable and `custom-property` mixin into shared file for\n// both `@carbon/type` and `@carbon/themes`\n\n/// @access private\n/// @group @carbon/type\n@mixin custom-properties($name, $value) {\n @each $property, $value in $value {\n #{$property}: var(\n --#{$custom-property-prefix}-#{$name}-#{$property},\n #{$value}\n );\n }\n}\n\n/// Helper mixin to include the styles for a given token in any selector in your\n/// project. Also includes an optional fluid option that will enable fluid\n/// styles for the token if they are defined. Fluid styles will cause the\n/// token's font-size to be computed based on the viewport size. As a result, use\n/// with caution in fixed contexts.\n/// @param {String} $name - The name of the token to get the styles for\n/// @param {Boolean} $fluid [false] - Specify whether to include fluid styles for the\n/// @param {Map} $breakpoints [$grid-breakpoints] - Provide a custom breakpoint map to use\n/// @access public\n/// @group @carbon/type\n@mixin type-style(\n $name,\n $fluid: false,\n $breakpoints: gridconfig.$grid-breakpoints\n) {\n @if not map.has-key($tokens, $name) {\n @error 'Unable to find a token with the name: `#{$name}`';\n }\n\n $token: map.get($tokens, $name);\n\n // If $fluid is set to true and the token has breakpoints defined for fluid\n // styles, delegate to the fluid-type helper for the given token\n @if $fluid == true and map.has-key($token, 'breakpoints') {\n @include fluid-type($token, $breakpoints);\n } @else {\n @include custom-properties($name, $token);\n }\n}\n","// Code generated by @carbon/layout. DO NOT EDIT.\n//\n// Copyright IBM Corp. 2018, 2021\n//\n// This source code is licensed under the Apache-2.0 license found in the\n// LICENSE file in the root directory of this source tree.\n//\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-01: 0.125rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-02: 0.25rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-03: 0.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-04: 0.75rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-05: 1rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-06: 1.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-07: 2rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-08: 2.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-09: 3rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-10: 4rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-11: 5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-12: 6rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-13: 10rem !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/layout\n$spacing: (\n spacing-01: $spacing-01,\n spacing-02: $spacing-02,\n spacing-03: $spacing-03,\n spacing-04: $spacing-04,\n spacing-05: $spacing-05,\n spacing-06: $spacing-06,\n spacing-07: $spacing-07,\n spacing-08: $spacing-08,\n spacing-09: $spacing-09,\n spacing-10: $spacing-10,\n spacing-11: $spacing-11,\n spacing-12: $spacing-12,\n spacing-13: $spacing-13,\n);\n"],sourceRoot:""}]),s.locals={errorMessage:"FZ33ihINl+8YUVozv7ZwXw==",errorCopy:"jx2T8vrDO9pVp2FeSg6R+w==",desktopHeading:"cwU9zKw+qDdXGFxN1tD4Xg==",tabletHeading:"gOCpwZibZuK7xHHy+IDIHQ==",tile:"ztmVxMaymtPTKnWjzbgENg=="};const a=s},6618:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(9233),o=n.n(r),i=n(361),s=n.n(i)()(o());s.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79}.Y3Q\\+kOxLLWMt9RIQX8EZ2w\\=\\={border-right:1px solid #e0e0e0;padding-top:1rem}.Y3Q\\+kOxLLWMt9RIQX8EZ2w\\=\\= .cds--side-nav__link{color:#525252;font-size:var(--cds-heading-compact-01-font-size, 0.875rem);font-weight:var(--cds-heading-compact-01-font-weight, 600);line-height:var(--cds-heading-compact-01-line-height, 1.28572);letter-spacing:var(--cds-heading-compact-01-letter-spacing, 0.16px)}.Y3Q\\+kOxLLWMt9RIQX8EZ2w\\=\\= .cds--side-nav__link:focus,.Y3Q\\+kOxLLWMt9RIQX8EZ2w\\=\\= .cds--side-nav__link:hover{background-color:#f4f4f4}.Y3Q\\+kOxLLWMt9RIQX8EZ2w\\=\\= .cds--side-nav__link.active-left-nav-link{color:#161616;border-left:.25rem solid var(--brand-01);background-color:#e0e0e0;outline:none;padding:0 .75rem}.omrs-breakpoint-gt-tablet .cds--side-nav__link{height:2rem}.omrs-breakpoint-lt-desktop .cds--side-nav__link{height:3rem}","",{version:3,sources:["webpack://./../esm-styleguide/src/_vars.scss","webpack://./../esm-styleguide/src/left-nav/left-nav.module.scss","webpack://./../../../node_modules/@carbon/type/scss/_styles.scss"],names:[],mappings:"AAoDA,MACE,mBAAA,CACA,mBAAA,CACA,mBAAA,CCpDF,6BACE,8BAAA,CACA,gBAAA,CAGA,kDACE,aDJM,CEo0BN,2DAAA,CAAA,0DAAA,CAAA,8DAAA,CAAA,mEAAA,CD7zBA,gHAEE,wBDdE,CCkBJ,uEACE,aDfE,CCgBF,wCAAA,CACA,wBDnBE,CCoBF,YAAA,CACA,gBAAA,CAOJ,gDACE,WAAA,CAMF,iDACE,WAAA",sourcesContent:["$ui-01: #f4f4f4;\n$ui-02: #ffffff;\n$ui-03: #e0e0e0;\n$ui-04: #8d8d8d;\n$ui-05: #161616;\n$text-02: #525252;\n$text-03: #a8a8a8;\n$ui-background: #ffffff;\n$color-gray-30: #c6c6c6;\n$color-gray-70: #525252;\n$color-gray-100: #161616;\n$color-blue-60-2: #0f62fe;\n$color-blue-10: #edf5ff;\n$color-yellow-50: #feecae;\n$carbon--red-50: #fa4d56;\n$inverse-link: #78a9ff;\n$support-02: #24a148;\n$inverse-support-03: #f1c21b;\n$warning-background: #fff8e1;\n$openmrs-background-grey: #f4f4f4;\n$danger: #da1e28;\n$interactive-01: #0f62fe;\n$field-01: #f4f4f4;\n$grey-2: #e0e0e0;\n$labeldropdown: #c6c6c6;\n\n$brand-primary-10: #d9fbfb;\n$brand-primary-20: #9ef0f0;\n$brand-primary-30: #3ddbd9;\n$brand-primary-40: #08bdba;\n$brand-primary-50: #009d9a;\n\n/* 60,70 and 80 are already declared as brand-01, 02 and 03 respectively */\n\n$brand-primary-90: #022b30;\n$brand-primary-100: #081a1c;\n\n@mixin brand-01($property) {\n #{$property}: #005d5d;\n #{$property}: var(--brand-01);\n}\n\n@mixin brand-02($property) {\n #{$property}: #004144;\n #{$property}: var(--brand-02);\n}\n\n@mixin brand-03($property) {\n #{$property}: #007d79;\n #{$property}: var(--brand-03);\n}\n\n:root {\n --brand-01: #005d5d;\n --brand-02: #004144;\n --brand-03: #007d79;\n}\n\n$breakpoint-phone-min: 0px;\n$breakpoint-phone-max: 600px;\n$breakpoint-tablet-min: 601px;\n$breakpoint-tablet-max: 1023px;\n$breakpoint-small-desktop-min: 1024px;\n$breakpoint-small-desktop-max: 1439px;\n$breakpoint-large-desktop-min: 1440px;\n$breakpoint-large-desktop-max: 99999999px;\n\n/* These color variables will be removed in a future release */\n$brand-teal-01: #007d79;\n$brand-01: #005d5d;\n$brand-02: #004144;\n",'@use "@carbon/styles/scss/type";\n@import "../vars";\n\n.leftNav {\n border-right: 1px solid $ui-03;\n padding-top: 1rem;\n\n // Left nav menu item\n :global(.cds--side-nav__link) {\n color: $text-02;\n @include type.type-style("heading-compact-01");\n\n &:focus,\n &:hover {\n background-color: $ui-01;\n }\n\n // Active menu item\n &:global(.active-left-nav-link) {\n color: $ui-05;\n border-left: 0.25rem solid var(--brand-01);\n background-color: $ui-03;\n outline: none;\n padding: 0 0.75rem;\n }\n }\n}\n\n/* Desktop */\n:global(.omrs-breakpoint-gt-tablet) {\n :global(.cds--side-nav__link) {\n height: 2rem;\n }\n}\n\n/* Tablet */\n:global(.omrs-breakpoint-lt-desktop) {\n :global(.cds--side-nav__link) {\n height: 3rem;\n }\n}\n',"//\n// Copyright IBM Corp. 2018, 2018\n//\n// This source code is licensed under the Apache-2.0 license found in the\n// LICENSE file in the root directory of this source tree.\n//\n\n// stylelint-disable number-max-precision\n\n@use 'sass:map';\n@use 'sass:math';\n@use '@carbon/grid/scss/config' as gridconfig;\n@use '@carbon/grid/scss/breakpoint' as grid;\n@use 'prefix' as *;\n@use 'font-family';\n@use 'scale';\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$label-01: (\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$label-02: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$legal-01: (\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$legal-02: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @deprecated\n/// @group @carbon/type\n$helper-text-01: (\n font-size: scale.type-scale(1),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @deprecated\n/// @group @carbon/type\n$helper-text-02: (\n font-size: carbon--type-scale(2),\n font-weight: carbon--font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-short-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-compact-01: $body-short-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-long-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.42857,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-01: $body-long-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-short-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.375,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-compact-02: $body-short-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-long-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.5,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-02: $body-long-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$code-01: (\n font-family: font-family.font-family('mono'),\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$code-02: (\n font-family: font-family.font-family('mono'),\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.42857,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.42857,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-compact-01: $productive-heading-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.5,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.375,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-compact-02: $productive-heading-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-03: (\n font-size: scale.type-scale(5),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.4,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-03: $productive-heading-03 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-04: (\n font-size: scale.type-scale(7),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-04: $productive-heading-04 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-05: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('light'),\n line-height: 1.25,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-05: $productive-heading-05 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-06: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n // Extra digit needed for precision in Chrome\n line-height: 1.199,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-06: $productive-heading-06 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-07: (\n font-size: scale.type-scale(12),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-07: $productive-heading-07 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-01: $heading-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-02: $heading-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-03: (\n font-size: scale.type-scale(5),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.4,\n letter-spacing: 0,\n breakpoints: (\n xlg: (\n font-size: scale.type-scale(5),\n line-height: 1.25,\n ),\n max: (\n font-size: scale.type-scale(6),\n line-height: 1.334,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-03: $expressive-heading-03 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-04: (\n font-size: scale.type-scale(7),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0,\n breakpoints: (\n xlg: (\n font-size: scale.type-scale(8),\n line-height: 1.25,\n font-weight: font-family.font-weight('light'),\n ),\n max: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('light'),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-04: $expressive-heading-04 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-05: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('light'),\n line-height: 1.25,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(9),\n line-height: 1.22,\n ),\n lg: (\n font-size: scale.type-scale(10),\n line-height: 1.19,\n ),\n xlg: (\n font-size: scale.type-scale(11),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(13),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-05: $expressive-heading-05 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-06: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.25,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(9),\n line-height: 1.22,\n ),\n lg: (\n font-size: scale.type-scale(10),\n line-height: 1.19,\n ),\n xlg: (\n font-size: scale.type-scale(11),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(13),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-06: $expressive-heading-06 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-paragraph-01: (\n font-size: scale.type-scale(6),\n font-weight: font-family.font-weight('light'),\n line-height: 1.334,\n letter-spacing: 0,\n breakpoints: (\n lg: (\n font-size: scale.type-scale(7),\n line-height: 1.28572,\n ),\n max: (\n font-size: scale.type-scale(8),\n line-height: 1.25,\n ),\n ),\n);\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-paragraph-01: $expressive-paragraph-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$quotation-01: (\n font-family: font-family.font-family('serif'),\n font-size: scale.type-scale(5),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.3,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(5),\n ),\n lg: (\n font-size: scale.type-scale(6),\n line-height: 1.334,\n ),\n xlg: (\n font-size: scale.type-scale(7),\n line-height: 1.28572,\n ),\n max: (\n font-size: scale.type-scale(8),\n line-height: 1.25,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-quotation-01: $quotation-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$quotation-02: (\n font-family: font-family.font-family('serif'),\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('light'),\n line-height: 1.25,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(9),\n line-height: 1.22,\n ),\n lg: (\n font-size: scale.type-scale(10),\n line-height: 1.19,\n ),\n xlg: (\n font-size: scale.type-scale(11),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(13),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-quotation-02: $quotation-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-01: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(10),\n ),\n lg: (\n font-size: scale.type-scale(12),\n ),\n xlg: (\n font-size: scale.type-scale(13),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(15),\n line-height: 1.13,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-01: $display-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-02: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(10),\n ),\n lg: (\n font-size: scale.type-scale(12),\n ),\n xlg: (\n font-size: scale.type-scale(13),\n line-height: 1.16,\n ),\n max: (\n font-size: scale.type-scale(15),\n line-height: 1.13,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-02: $display-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-03: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(12),\n line-height: 1.18,\n ),\n lg: (\n font-size: scale.type-scale(13),\n line-height: 1.16,\n letter-spacing: -0.64px,\n ),\n xlg: (\n font-size: scale.type-scale(15),\n line-height: 1.13,\n letter-spacing: -0.64px,\n ),\n max: (\n font-size: scale.type-scale(16),\n line-height: 1.11,\n letter-spacing: -0.96px,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-03: $display-03 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-04: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(14),\n line-height: 1.15,\n ),\n lg: (\n font-size: scale.type-scale(17),\n line-height: 1.11,\n letter-spacing: -0.64px,\n ),\n xlg: (\n font-size: scale.type-scale(20),\n line-height: 1.07,\n letter-spacing: -0.64px,\n ),\n max: (\n font-size: scale.type-scale(23),\n line-height: 1.05,\n letter-spacing: -0.96px,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-04: $display-04 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$tokens: (\n label-01: $label-01,\n label-02: $label-02,\n helper-text-01: $helper-text-01,\n helper-text-02: $helper-text-02,\n body-short-01: $body-short-01,\n body-short-02: $body-short-02,\n body-long-01: $body-long-01,\n body-long-02: $body-long-02,\n code-01: $code-01,\n code-02: $code-02,\n heading-01: $heading-01,\n heading-02: $heading-02,\n productive-heading-01: $productive-heading-01,\n productive-heading-02: $productive-heading-02,\n productive-heading-03: $productive-heading-03,\n productive-heading-04: $productive-heading-04,\n productive-heading-05: $productive-heading-05,\n productive-heading-06: $productive-heading-06,\n productive-heading-07: $productive-heading-07,\n expressive-paragraph-01: $expressive-paragraph-01,\n expressive-heading-01: $expressive-heading-01,\n expressive-heading-02: $expressive-heading-02,\n expressive-heading-03: $expressive-heading-03,\n expressive-heading-04: $expressive-heading-04,\n expressive-heading-05: $expressive-heading-05,\n expressive-heading-06: $expressive-heading-06,\n quotation-01: $quotation-01,\n quotation-02: $quotation-02,\n display-01: $display-01,\n display-02: $display-02,\n display-03: $display-03,\n display-04: $display-04,\n // V11 Tokens\n legal-01: $legal-01,\n legal-02: $legal-02,\n body-compact-01: $body-compact-01,\n body-compact-02: $body-compact-02,\n heading-compact-01: $heading-compact-01,\n heading-compact-02: $heading-compact-02,\n body-01: $body-01,\n body-02: $body-02,\n heading-03: $heading-03,\n heading-04: $heading-04,\n heading-05: $heading-05,\n heading-06: $heading-06,\n heading-07: $heading-07,\n fluid-heading-03: $fluid-heading-03,\n fluid-heading-04: $fluid-heading-04,\n fluid-heading-05: $fluid-heading-05,\n fluid-heading-06: $fluid-heading-06,\n fluid-paragraph-01: $fluid-paragraph-01,\n fluid-quotation-01: $fluid-quotation-01,\n fluid-quotation-02: $fluid-quotation-02,\n fluid-display-01: $fluid-display-01,\n fluid-display-02: $fluid-display-02,\n fluid-display-03: $fluid-display-03,\n fluid-display-04: $fluid-display-04,\n);\n\n/// @param {Map} $map\n/// @access public\n/// @group @carbon/type\n@mixin properties($map) {\n @each $name, $value in $map {\n #{$name}: $value;\n }\n}\n\n/// @param {Number} $value - Number with units\n/// @return {Number} Without units\n/// @access public\n/// @group @carbon/type\n@function strip-unit($value) {\n @return math.div($value, $value * 0 + 1);\n}\n\n/// This helper includes fluid type styles for the given token value. Fluid type\n/// means that the `font-size` is computed using `calc()` in order to be\n/// determined by the screen size instead of a breakpoint. As a result, fluid\n/// styles should be used with caution in fixed width contexts.\n///\n/// In addition, we make use of %-based line-heights so that the line-height of\n/// each type style is computed correctly due to the dynamic nature of the\n/// `font-size`.\n///\n/// Most of the logic for this work comes from CSS Tricks:\n/// https://css-tricks.com/snippets/css/fluid-typography/\n///\n/// @param {Map} $type-styles - The value of a given type token\n/// @param {Map} $breakpoints [$grid-breakpoints] - Custom breakpoints to use\n/// @access public\n/// @group @carbon/type\n@mixin fluid-type($type-styles, $breakpoints: gridconfig.$grid-breakpoints) {\n // Include the initial styles for the given token by default without any\n // media query guard. This includes `font-size` as a fallback in the case\n // that a browser does not support `calc()`\n @include properties(map.remove($type-styles, breakpoints));\n // We also need to include the `sm` styles by default since they don't\n // appear in the fluid styles for tokens\n @include fluid-type-size($type-styles, sm, $breakpoints);\n\n // Finally, we need to go through all the breakpoints defined in the type\n // token and apply the properties and fluid type size for that given\n // breakpoint\n @each $name, $values in map.get($type-styles, breakpoints) {\n @include grid.breakpoint($name) {\n @include properties($values);\n @include fluid-type-size($type-styles, $name, $breakpoints);\n }\n }\n}\n\n/// Computes the fluid `font-size` for a given type style and breakpoint\n/// @param {Map} $type-styles - The styles for a given token\n/// @param {String} $name - The name of the breakpoint to which we apply the fluid\n/// @param {Map} $breakpoints [$grid-breakpoints] - The breakpoints for the grid system\n/// @access public\n/// @group @carbon/type\n@mixin fluid-type-size(\n $type-styles,\n $name,\n $breakpoints: gridconfig.$grid-breakpoints\n) {\n // Get the information about the breakpoint we're currently working in. Useful\n // for getting initial width information\n $breakpoint: map.get($breakpoints, $name);\n\n // Our fluid styles are captured under the 'breakpoints' property in our type\n // styles map. These define what values to treat as `max-` variables below\n $fluid-sizes: map.get($type-styles, breakpoints);\n $fluid-breakpoint: ();\n // Special case for `sm` because the styles for small are on the type style\n // directly\n @if $name == sm {\n $fluid-breakpoint: map.remove($type-styles, breakpoints);\n } @else {\n $fluid-breakpoint: map.get($fluid-sizes, $name);\n }\n\n // Initialize our font-sizes to the default size for the type style\n $max-font-size: map.get($type-styles, font-size);\n $min-font-size: map.get($type-styles, font-size);\n @if map.has-key($fluid-breakpoint, font-size) {\n $min-font-size: map.get($fluid-breakpoint, font-size);\n }\n\n // Initialize our min and max width to the width of the current breakpoint\n $max-vw: map.get($breakpoint, width);\n $min-vw: map.get($breakpoint, width);\n\n // We can use `breakpoint-next` to see if there is another breakpoint we can\n // use to update `max-font-size` and `max-vw` with larger values\n $next-breakpoint-available: grid.breakpoint-next($name, $breakpoints);\n $next-fluid-breakpoint-name: null;\n\n // We need to figure out what the next available fluid breakpoint is for our\n // given $type-styles. In this loop we try and iterate through breakpoints\n // until we either manually set $next-breakpoint-available to null or\n // `breakpoint-next` returns null.\n @while $next-breakpoint-available {\n @if map.has-key($fluid-sizes, $next-breakpoint-available) {\n $next-fluid-breakpoint-name: $next-breakpoint-available;\n $next-breakpoint-available: null;\n } @else {\n $next-breakpoint-available: grid.breakpoint-next(\n $next-breakpoint-available,\n $breakpoints\n );\n }\n }\n\n // If we have found the next available fluid breakpoint name, then we know\n // that we have values that we can use to set max-font-size and max-vw as both\n // values derive from the next breakpoint\n @if $next-fluid-breakpoint-name {\n $next-fluid-breakpoint: map.get($breakpoints, $next-fluid-breakpoint-name);\n $max-font-size: map.get(\n map.get($fluid-sizes, $next-fluid-breakpoint-name),\n font-size\n );\n $max-vw: map.get($next-fluid-breakpoint, width);\n\n // prettier-ignore\n font-size: calc(#{$min-font-size} +\n #{strip-unit($max-font-size - $min-font-size)} *\n ((100vw - #{$min-vw}) / #{strip-unit($max-vw - $min-vw)})\n );\n } @else {\n // Otherwise, just default to setting the font size found from the type\n // style or the given fluid breakpoint in the type style\n font-size: $min-font-size;\n }\n}\n\n// TODO move following variable and `custom-property` mixin into shared file for\n// both `@carbon/type` and `@carbon/themes`\n\n/// @access private\n/// @group @carbon/type\n@mixin custom-properties($name, $value) {\n @each $property, $value in $value {\n #{$property}: var(\n --#{$custom-property-prefix}-#{$name}-#{$property},\n #{$value}\n );\n }\n}\n\n/// Helper mixin to include the styles for a given token in any selector in your\n/// project. Also includes an optional fluid option that will enable fluid\n/// styles for the token if they are defined. Fluid styles will cause the\n/// token's font-size to be computed based on the viewport size. As a result, use\n/// with caution in fixed contexts.\n/// @param {String} $name - The name of the token to get the styles for\n/// @param {Boolean} $fluid [false] - Specify whether to include fluid styles for the\n/// @param {Map} $breakpoints [$grid-breakpoints] - Provide a custom breakpoint map to use\n/// @access public\n/// @group @carbon/type\n@mixin type-style(\n $name,\n $fluid: false,\n $breakpoints: gridconfig.$grid-breakpoints\n) {\n @if not map.has-key($tokens, $name) {\n @error 'Unable to find a token with the name: `#{$name}`';\n }\n\n $token: map.get($tokens, $name);\n\n // If $fluid is set to true and the token has breakpoints defined for fluid\n // styles, delegate to the fluid-type helper for the given token\n @if $fluid == true and map.has-key($token, 'breakpoints') {\n @include fluid-type($token, $breakpoints);\n } @else {\n @include custom-properties($name, $token);\n }\n}\n"],sourceRoot:""}]),s.locals={leftNav:"Y3Q+kOxLLWMt9RIQX8EZ2w=="};const a=s},361:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var i=0;i<this.length;i++){var s=this[i][0];null!=s&&(o[s]=!0)}for(var a=0;a<e.length;a++){var c=[].concat(e[a]);r&&o[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),t.push(c))}},t}},9233:e=>{"use strict";function t(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.exports=function(e){var n,r,o=(r=4,function(e){if(Array.isArray(e))return e}(n=e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=n){var r,o,i=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);s=!0);}catch(e){a=!0,o=e}finally{try{s||null==n.return||n.return()}finally{if(a)throw o}}return i}}(n,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}}(n,r)||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=o[1],s=o[3];if(!s)return i;if("function"==typeof btoa){var a=btoa(unescape(encodeURIComponent(JSON.stringify(s)))),c="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(a),u="/*# ".concat(c," */"),l=s.sources.map((function(e){return"/*# sourceURL=".concat(s.sourceRoot||"").concat(e," */")}));return[i].concat(l).concat([u]).join("\n")}return[i].join("\n")}},4332: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)}}}()},459:(e,t,n)=>{"use strict";var r=n(5704);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,s){if(s!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},216:(e,t,n)=>{e.exports=n(459)()},5704:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4645:(e,t,n)=>{"use strict";var r=n(6551);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},6196:(e,t,n)=>{"use strict";n.d(t,{y:()=>l});var r=n(6022),o=n(7811),i=n(9714),s=n(2412),a=n(4002),c=n(6295),u=n(5769),l=function(){function e(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 r=this.operator,a=function(e,t,n){if(e){if(e instanceof o.L)return e;if(e[i.b])return e[i.b]()}return e||t||n?new o.L(e,t,n):new o.L(s.c)}(e,t,n);if(r?a.add(r.call(a,this.source)):a.add(this.source||u.v.useDeprecatedSynchronousErrorHandling&&!a.syncErrorThrowable?this._subscribe(a):this._trySubscribe(a)),u.v.useDeprecatedSynchronousErrorHandling&&a.syncErrorThrowable&&(a.syncErrorThrowable=!1,a.syncErrorThrown))throw a.syncErrorValue;return a},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){u.v.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),(0,r._)(e)?e.error(t):console.warn(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=f(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[a.L]=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,c.U)(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=f(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}();function f(e){if(e||(e=u.v.Promise||Promise),!e)throw new Error("no Promise impl found");return e}},2412:(e,t,n)=>{"use strict";n.d(t,{c:()=>i});var r=n(5769),o=n(1450),i={closed:!0,next:function(e){},error:function(e){if(r.v.useDeprecatedSynchronousErrorHandling)throw e;(0,o.z)(e)},complete:function(){}}},7811:(e,t,n)=>{"use strict";n.d(t,{L:()=>l});var r=n(7080),o=n(9147),i=n(2412),s=n(1736),a=n(9714),c=n(5769),u=n(1450),l=function(e){function t(n,r,o){var s=e.call(this)||this;switch(s.syncErrorValue=null,s.syncErrorThrown=!1,s.syncErrorThrowable=!1,s.isStopped=!1,arguments.length){case 0:s.destination=i.c;break;case 1:if(!n){s.destination=i.c;break}if("object"==typeof n){n instanceof t?(s.syncErrorThrowable=n.syncErrorThrowable,s.destination=n,n.add(s)):(s.syncErrorThrowable=!0,s.destination=new f(s,n));break}default:s.syncErrorThrowable=!0,s.destination=new f(s,n,r,o)}return s}return r.ZT(t,e),t.prototype[a.b]=function(){return this},t.create=function(e,n,r){var o=new t(e,n,r);return o.syncErrorThrowable=!1,o},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},t}(s.w),f=function(e){function t(t,n,r,s){var a,c=e.call(this)||this;c._parentSubscriber=t;var u=c;return(0,o.m)(n)?a=n:n&&(a=n.next,r=n.error,s=n.complete,n!==i.c&&(u=Object.create(n),(0,o.m)(u.unsubscribe)&&c.add(u.unsubscribe.bind(u)),u.unsubscribe=c.unsubscribe.bind(c))),c._context=u,c._next=a,c._error=r,c._complete=s,c}return r.ZT(t,e),t.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;c.v.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},t.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,n=c.v.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):(0,u.z)(e),this.unsubscribe();else{if(this.unsubscribe(),n)throw e;(0,u.z)(e)}}},t.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)};c.v.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),c.v.useDeprecatedSynchronousErrorHandling)throw e;(0,u.z)(e)}},t.prototype.__tryOrSetError=function(e,t,n){if(!c.v.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,n)}catch(t){return c.v.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=t,e.syncErrorThrown=!0,!0):((0,u.z)(t),!0)}return!1},t.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},t}(l)},1736:(e,t,n)=>{"use strict";n.d(t,{w:()=>a});var r=n(4724),o=n(1167),i=n(9147),s=n(8961),a=function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}var t;return e.prototype.unsubscribe=function(){var t;if(!this.closed){var n=this,a=n._parentOrParents,u=n._ctorUnsubscribe,l=n._unsubscribe,f=n._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,a instanceof e)a.remove(this);else if(null!==a)for(var p=0;p<a.length;++p)a[p].remove(this);if((0,i.m)(l)){u&&(this._unsubscribe=void 0);try{l.call(this)}catch(e){t=e instanceof s.B?c(e.errors):[e]}}if((0,r.k)(f)){p=-1;for(var d=f.length;++p<d;){var h=f[p];if((0,o.K)(h))try{h.unsubscribe()}catch(e){t=t||[],e instanceof s.B?t=t.concat(c(e.errors)):t.push(e)}}}if(t)throw new s.B(t)}},e.prototype.add=function(t){var n=t;if(!t)return e.EMPTY;switch(typeof 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(!(n instanceof e)){var r=n;(n=new e)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}var o=n._parentOrParents;if(null===o)n._parentOrParents=this;else if(o instanceof e){if(o===this)return n;n._parentOrParents=[o,this]}else{if(-1!==o.indexOf(this))return n;o.push(this)}var i=this._subscriptions;return null===i?this._subscriptions=[n]:i.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=((t=new e).closed=!0,t),e}();function c(e){return e.reduce((function(e,t){return e.concat(t instanceof s.B?t.errors:t)}),[])}},5769:(e,t,n)=>{"use strict";n.d(t,{v:()=>o});var r=!1,o={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){e&&(new Error).stack,r=e},get useDeprecatedSynchronousErrorHandling(){return r}}},70:(e,t,n)=>{"use strict";n.d(t,{E:()=>o,c:()=>i});var r=n(6196),o=new r.y((function(e){return e.complete()}));function i(e){return e?function(e){return new r.y((function(t){return e.schedule((function(){return t.complete()}))}))}(e):o}},5725:(e,t,n)=>{"use strict";n.d(t,{U:()=>i});var r=n(7080),o=n(7811);function i(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 s(e,t))}}var s=function(){function e(e,t){this.project=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new a(e,this.project,this.thisArg))},e}(),a=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.project=n,o.count=0,o.thisArg=r||o,o}return r.ZT(t,e),t.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)},t}(o.L)},4002:(e,t,n)=>{"use strict";n.d(t,{L:()=>r});var r=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}()},9714:(e,t,n)=>{"use strict";n.d(t,{b:()=>r});var r=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}()},1760:(e,t,n)=>{"use strict";n.d(t,{W:()=>r});var r=function(){function e(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return e.prototype=Object.create(Error.prototype),e}()},8961:(e,t,n)=>{"use strict";n.d(t,{B:()=>r});var r=function(){function e(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}()},6022:(e,t,n)=>{"use strict";n.d(t,{_:()=>o});var r=n(7811);function o(e){for(;e;){var t=e,n=t.closed,o=t.destination,i=t.isStopped;if(n||i)return!1;e=o&&o instanceof r.L?o:null}return!0}},1450:(e,t,n)=>{"use strict";function r(e){setTimeout((function(){throw e}),0)}n.d(t,{z:()=>r})},7430:(e,t,n)=>{"use strict";function r(e){return e}n.d(t,{y:()=>r})},4724:(e,t,n)=>{"use strict";n.d(t,{k:()=>r});var r=function(){return Array.isArray||function(e){return e&&"number"==typeof e.length}}()},9147:(e,t,n)=>{"use strict";function r(e){return"function"==typeof e}n.d(t,{m:()=>r})},1167:(e,t,n)=>{"use strict";function r(e){return null!==e&&"object"==typeof e}n.d(t,{K:()=>r})},6295:(e,t,n)=>{"use strict";n.d(t,{U:()=>i,z:()=>o});var r=n(7430);function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i(e)}function i(e){return 0===e.length?r.y:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}},7080:(e,t,n)=>{"use strict";n.d(t,{ZT:()=>o});var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},r(e,t)};function o(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}},487:e=>{"use strict";var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var i={},s=[],a=0;a<e.length;a++){var c=e[a],u=r.base?c[0]+r.base:c[0],l=i[u]||0,f="".concat(u," ").concat(l);i[u]=l+1;var p=n(f),d={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==p)t[p].references++,t[p].updater(d);else{var h=o(d,r);r.byIndex=a,t.splice(a,0,{identifier:f,updater:h,references:1})}s.push(f)}return s}function o(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,o){var i=r(e=e||[],o=o||{});return function(e){e=e||[];for(var s=0;s<i.length;s++){var a=n(i[s]);t[a].references--}for(var c=r(e,o),u=0;u<i.length;u++){var l=n(i[u]);0===t[l].references&&(t[l].updater(),t.splice(l,1))}i=c}}},2052:e=>{"use strict";var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},1469:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},4010:(e,t,n)=>{"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},631:e=>{"use strict";e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var o=void 0!==n.layer;o&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,o&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var i=n.sourceMap;i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},9329:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},2173:(e,t,n)=>{"use strict";var r=n(5776),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,s=r.useEffect,a=r.useLayoutEffect,c=r.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,l=r[1];return a((function(){o.value=n,o.getSnapshot=t,u(o)&&l({inst:o})}),[e,n,t]),s((function(){return u(o)&&l({inst:o}),e((function(){u(o)&&l({inst:o})}))}),[e]),c(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:l},1374:(e,t,n)=>{"use strict";e.exports=n(2173)},6763:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(682),o=n(658);const i=(0,r.Z)(o.Z,"Map")},7851:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=n(658).Z.Symbol},963:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(7851),o=Object.prototype,i=o.hasOwnProperty,s=o.toString,a=r.Z?r.Z.toStringTag:void 0;var c=Object.prototype.toString;var u=r.Z?r.Z.toStringTag:void 0;const l=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":u&&u in Object(e)?function(e){var t=i.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch(e){}var o=s.call(e);return r&&(t?e[a]=n:delete e[a]),o}(e):function(e){return c.call(e)}(e)}},9295:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(9494);const o=(0,n(6899).Z)(Object.keys,Object);var i=Object.prototype.hasOwnProperty;const s=function(e){if(!(0,r.Z)(e))return o(e);var t=[];for(var n in Object(e))i.call(e,n)&&"constructor"!=n&&t.push(n);return t}},5852:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r="object"==typeof global&&global&&global.Object===Object&&global},682:(e,t,n)=>{"use strict";n.d(t,{Z:()=>g});var r=n(3200);const o=n(658).Z["__core-js_shared__"];var i,s=(i=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+i:"";var a=n(7275),c=n(9441),u=/^\[object .+?Constructor\]$/,l=Function.prototype,f=Object.prototype,p=l.toString,d=f.hasOwnProperty,h=RegExp("^"+p.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const y=function(e){return!(!(0,a.Z)(e)||(t=e,s&&s in t))&&((0,r.Z)(e)?h:u).test((0,c.Z)(e));var t},g=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return y(n)?n:void 0}},606:(e,t,n)=>{"use strict";n.d(t,{Z:()=>x});var r=n(682),o=n(658);const i=(0,r.Z)(o.Z,"DataView");var s=n(6763);const a=(0,r.Z)(o.Z,"Promise"),c=(0,r.Z)(o.Z,"Set"),u=(0,r.Z)(o.Z,"WeakMap");var l=n(963),f=n(9441),p="[object Map]",d="[object Promise]",h="[object Set]",y="[object WeakMap]",g="[object DataView]",m=(0,f.Z)(i),b=(0,f.Z)(s.Z),v=(0,f.Z)(a),w=(0,f.Z)(c),O=(0,f.Z)(u),S=l.Z;(i&&S(new i(new ArrayBuffer(1)))!=g||s.Z&&S(new s.Z)!=p||a&&S(a.resolve())!=d||c&&S(new c)!=h||u&&S(new u)!=y)&&(S=function(e){var t=(0,l.Z)(e),n="[object Object]"==t?e.constructor:void 0,r=n?(0,f.Z)(n):"";if(r)switch(r){case m:return g;case b:return p;case v:return d;case w:return h;case O:return y}return t});const x=S},9494:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=Object.prototype;const o=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||r)}},6899:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=function(e,t){return function(n){return e(t(n))}}},658:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(5852),o="object"==typeof self&&self&&self.Object===Object&&self;const i=r.Z||o||Function("return this")()},9441:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=Function.prototype.toString;const o=function(e){if(null!=e){try{return r.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},175:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(963),o=n(4897);const i=function(e){return(0,o.Z)(e)&&"[object Arguments]"==(0,r.Z)(e)};var s=Object.prototype,a=s.hasOwnProperty,c=s.propertyIsEnumerable,u=i(function(){return arguments}())?i:function(e){return(0,o.Z)(e)&&a.call(e,"callee")&&!c.call(e,"callee")};const l=u},6575:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=Array.isArray},6905:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(3200),o=n(3492);const i=function(e){return null!=e&&(0,o.Z)(e.length)&&!(0,r.Z)(e)}},595:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n(658);var o="object"==typeof exports&&exports&&!exports.nodeType&&exports,i=o&&"object"==typeof module&&module&&!module.nodeType&&module,s=i&&i.exports===o?r.Z.Buffer:void 0;const a=(s?s.isBuffer:void 0)||function(){return!1}},3202:(e,t,n)=>{"use strict";n.d(t,{Z:()=>J});const r=function(e,t){return e===t||e!=e&&t!=t},o=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1};var i=Array.prototype.splice;function s(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.prototype.clear=function(){this.__data__=[],this.size=0},s.prototype.delete=function(e){var t=this.__data__,n=o(t,e);return!(n<0||(n==t.length-1?t.pop():i.call(t,n,1),--this.size,0))},s.prototype.get=function(e){var t=this.__data__,n=o(t,e);return n<0?void 0:t[n][1]},s.prototype.has=function(e){return o(this.__data__,e)>-1},s.prototype.set=function(e,t){var n=this.__data__,r=o(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};const a=s;var c=n(6763);const u=(0,n(682).Z)(Object,"create");var l=Object.prototype.hasOwnProperty;var f=Object.prototype.hasOwnProperty;function p(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])}}p.prototype.clear=function(){this.__data__=u?u(null):{},this.size=0},p.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},p.prototype.get=function(e){var t=this.__data__;if(u){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return l.call(t,e)?t[e]:void 0},p.prototype.has=function(e){var t=this.__data__;return u?void 0!==t[e]:f.call(t,e)},p.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=u&&void 0===t?"__lodash_hash_undefined__":t,this};const d=p,h=function(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map};function y(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])}}y.prototype.clear=function(){this.size=0,this.__data__={hash:new d,map:new(c.Z||a),string:new d}},y.prototype.delete=function(e){var t=h(this,e).delete(e);return this.size-=t?1:0,t},y.prototype.get=function(e){return h(this,e).get(e)},y.prototype.has=function(e){return h(this,e).has(e)},y.prototype.set=function(e,t){var n=h(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};const g=y;function m(e){var t=this.__data__=new a(e);this.size=t.size}m.prototype.clear=function(){this.__data__=new a,this.size=0},m.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},m.prototype.get=function(e){return this.__data__.get(e)},m.prototype.has=function(e){return this.__data__.has(e)},m.prototype.set=function(e,t){var n=this.__data__;if(n instanceof a){var r=n.__data__;if(!c.Z||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new g(r)}return n.set(e,t),this.size=n.size,this};const b=m;function v(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new g;++t<n;)this.add(e[t])}v.prototype.add=v.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},v.prototype.has=function(e){return this.__data__.has(e)};const w=v,O=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},S=function(e,t,n,r,o,i){var s=1&n,a=e.length,c=t.length;if(a!=c&&!(s&&c>a))return!1;var u=i.get(e),l=i.get(t);if(u&&l)return u==t&&l==e;var f=-1,p=!0,d=2&n?new w:void 0;for(i.set(e,t),i.set(t,e);++f<a;){var h=e[f],y=t[f];if(r)var g=s?r(y,h,f,t,e,i):r(h,y,f,e,t,i);if(void 0!==g){if(g)continue;p=!1;break}if(d){if(!O(t,(function(e,t){if(s=t,!d.has(s)&&(h===e||o(h,e,n,r,i)))return d.push(t);var s}))){p=!1;break}}else if(h!==y&&!o(h,y,n,r,i)){p=!1;break}}return i.delete(e),i.delete(t),p};var x=n(7851);const E=n(658).Z.Uint8Array,_=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n},j=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n};var k=x.Z?x.Z.prototype:void 0,P=k?k.valueOf:void 0;var $=n(6575);var C=Object.prototype.propertyIsEnumerable,A=Object.getOwnPropertySymbols;const T=A?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 s=e[n];t(s,n,e)&&(i[o++]=s)}return i}(A(e),(function(t){return C.call(e,t)})))}:function(){return[]};var D=n(175),I=n(595),R=/^(?:0|[1-9]\d*)$/;const N=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&R.test(e))&&e>-1&&e%1==0&&e<t};var M=n(8396),L=Object.prototype.hasOwnProperty;const B=function(e,t){var n=(0,$.Z)(e),r=!n&&(0,D.Z)(e),o=!n&&!r&&(0,I.Z)(e),i=!n&&!r&&!o&&(0,M.Z)(e),s=n||r||o||i,a=s?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=a.length;for(var u in e)!t&&!L.call(e,u)||s&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||N(u,c))||a.push(u);return a};var U=n(9295),z=n(6905);const F=function(e){return(0,z.Z)(e)?B(e):(0,U.Z)(e)},K=function(e){return function(e,t,n){var r=t(e);return(0,$.Z)(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,F,T)};var V=Object.prototype.hasOwnProperty;var q=n(606),H="[object Arguments]",W="[object Array]",G="[object Object]",Z=Object.prototype.hasOwnProperty;const Y=function(e,t,n,o,i,s){var a=(0,$.Z)(e),c=(0,$.Z)(t),u=a?W:(0,q.Z)(e),l=c?W:(0,q.Z)(t),f=(u=u==H?G:u)==G,p=(l=l==H?G:l)==G,d=u==l;if(d&&(0,I.Z)(e)){if(!(0,I.Z)(t))return!1;a=!0,f=!1}if(d&&!f)return s||(s=new b),a||(0,M.Z)(e)?S(e,t,n,o,i,s):function(e,t,n,o,i,s,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||!s(new E(e),new E(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return r(+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 c=_;case"[object Set]":var u=1&o;if(c||(c=j),e.size!=t.size&&!u)return!1;var l=a.get(e);if(l)return l==t;o|=2,a.set(e,t);var f=S(c(e),c(t),o,i,s,a);return a.delete(e),f;case"[object Symbol]":if(P)return P.call(e)==P.call(t)}return!1}(e,t,u,n,o,i,s);if(!(1&n)){var h=f&&Z.call(e,"__wrapped__"),y=p&&Z.call(t,"__wrapped__");if(h||y){var g=h?e.value():e,m=y?t.value():t;return s||(s=new b),i(g,m,n,o,s)}}return!!d&&(s||(s=new b),function(e,t,n,r,o,i){var s=1&n,a=K(e),c=a.length;if(c!=K(t).length&&!s)return!1;for(var u=c;u--;){var l=a[u];if(!(s?l in t:V.call(t,l)))return!1}var f=i.get(e),p=i.get(t);if(f&&p)return f==t&&p==e;var d=!0;i.set(e,t),i.set(t,e);for(var h=s;++u<c;){var y=e[l=a[u]],g=t[l];if(r)var m=s?r(g,y,l,t,e,i):r(y,g,l,e,t,i);if(!(void 0===m?y===g||o(y,g,n,r,i):m)){d=!1;break}h||(h="constructor"==l)}if(d&&!h){var b=e.constructor,v=t.constructor;b==v||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof v&&v instanceof v||(d=!1)}return i.delete(e),i.delete(t),d}(e,t,n,o,i,s))};var X=n(4897);const Q=function e(t,n,r,o,i){return t===n||(null==t||null==n||!(0,X.Z)(t)&&!(0,X.Z)(n)?t!=t&&n!=n:Y(t,n,r,o,e,i))},J=function(e,t){return Q(e,t)}},3200:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(963),o=n(7275);const i=function(e){if(!(0,o.Z)(e))return!1;var t=(0,r.Z)(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},3492:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},7275:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},4897:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=function(e){return null!=e&&"object"==typeof e}},8396:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(963),o=n(3492),i=n(4897),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1;var a=n(5852),c="object"==typeof exports&&exports&&!exports.nodeType&&exports,u=c&&"object"==typeof module&&module&&!module.nodeType&&module,l=u&&u.exports===c&&a.Z.process,f=function(){try{return u&&u.require&&u.require("util").types||l&&l.binding&&l.binding("util")}catch(e){}}(),p=f&&f.isTypedArray;const d=p?(h=p,function(e){return h(e)}):function(e){return(0,i.Z)(e)&&(0,o.Z)(e.length)&&!!s[(0,r.Z)(e)]};var h},9789:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=function(e){return void 0===e}}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={id:e,loaded:!1,exports:{}};return n[e].call(i.exports,i,i.exports,o),i.loaded=!0,i.exports}return o.m=n,o.c=r,o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(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.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,n)=>(o.f[n](e,t),t)),[])),o.u=e=>e+".openmrs-esm-framework.js",o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="@openmrs/esm-framework:",o.l=(n,r,i,s)=>{if(e[n])e[n].push(r);else{var a,c;if(void 0!==i)for(var u=document.getElementsByTagName("script"),l=0;l<u.length;l++){var f=u[l];if(f.getAttribute("src")==n||f.getAttribute("data-webpack")==t+i){a=f;break}}a||(c=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,o.nc&&a.setAttribute("nonce",o.nc),a.setAttribute("data-webpack",t+i),a.src=n),e[n]=[r];var p=(t,r)=>{a.onerror=a.onload=null,clearTimeout(d);var o=e[n];if(delete e[n],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach((e=>e(r))),t)return t(r)},d=setTimeout(p.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),c&&document.head.appendChild(a)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{o.S={};var e={},t={};o.I=(n,r)=>{r||(r=[]);var i=t[n];if(i||(i=t[n]={}),!(r.indexOf(i)>=0)){if(r.push(i),e[n])return e[n];o.o(o.S,n)||(o.S[n]={});var s=o.S[n],a="@openmrs/esm-framework",c=(e,t,n,r)=>{var o=s[e]=s[e]||{},i=o[t];(!i||!i.loaded&&(!r!=!i.eager?r:a>i.from))&&(o[t]={get:n,from:a,eager:!!r})},u=[];return"default"===n&&(c("dayjs","1.11.5",(()=>o.e(530).then((()=>()=>o(7530))))),c("i18next","19.9.2",(()=>o.e(585).then((()=>()=>o(3585))))),c("react-dom","18.2.0",(()=>o.e(788).then((()=>()=>o(2788))))),c("react-i18next","11.18.6",(()=>o.e(71).then((()=>()=>o(71))))),c("react","18.2.0",(()=>o.e(735).then((()=>()=>o(2735))))),c("rxjs","6.6.7",(()=>o.e(645).then((()=>()=>o(1645))))),c("single-spa","5.9.4",(()=>o.e(710).then((()=>()=>o(3710)))))),e[n]=u.length?Promise.all(u).then((()=>e[n]=1)):1}}})(),(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&!e;)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),(()=>{var e=e=>{var t=e=>e.split(".").map((e=>+e==e?+e:e)),n=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),r=n[1]?t(n[1]):[];return n[2]&&(r.length++,r.push.apply(r,t(n[2]))),n[3]&&(r.push([]),r.push.apply(r,t(n[3]))),r},t=e=>{var n=e[0],r="";if(1===e.length)return"*";if(n+.5){r+=0==n?">=":-1==n?"<":1==n?"^":2==n?"~":n>0?"=":"!=";for(var o=1,i=1;i<e.length;i++)o--,r+="u"==(typeof(a=e[i]))[0]?"-":(o>0?".":"")+(o=2,a);return r}var s=[];for(i=1;i<e.length;i++){var a=e[i];s.push(0===a?"not("+c()+")":1===a?"("+c()+" || "+c()+")":2===a?s.pop()+" "+s.pop():t(a))}return c();function c(){return s.pop().replace(/^\((.+)\)$/,"$1")}},n=(t,r)=>{if(0 in t){r=e(r);var o=t[0],i=o<0;i&&(o=-o-1);for(var s=0,a=1,c=!0;;a++,s++){var u,l,f=a<t.length?(typeof t[a])[0]:"";if(s>=r.length||"o"==(l=(typeof(u=r[s]))[0]))return!c||("u"==f?a>o&&!i:""==f!=i);if("u"==l){if(!c||"u"!=f)return!1}else if(c)if(f==l)if(a<=o){if(u!=t[a])return!1}else{if(i?u>t[a]:u<t[a])return!1;u!=t[a]&&(c=!1)}else if("s"!=f&&"n"!=f){if(i||a<=o)return!1;c=!1,a--}else{if(a<=o||l<f!=i)return!1;c=!1}else"s"!=f&&"n"!=f&&(c=!1,a--)}}var p=[],d=p.pop.bind(p);for(s=1;s<t.length;s++){var h=t[s];p.push(1==h?d()|d():2==h?d()&d():h?n(h,r):!d())}return!!d()},r=(t,n)=>{var r=t[n];return Object.keys(r).reduce(((t,n)=>!t||!r[t].loaded&&((t,n)=>{t=e(t),n=e(n);for(var r=0;;){if(r>=t.length)return r<n.length&&"u"!=(typeof n[r])[0];var o=t[r],i=(typeof o)[0];if(r>=n.length)return"u"==i;var s=n[r],a=(typeof s)[0];if(i!=a)return"o"==i&&"n"==a||"s"==a||"u"==i;if("o"!=i&&"u"!=i&&o!=s)return o<s;r++}})(t,n)?n:t),0)},i=(e,o,i,c)=>{var u=r(e,i);return n(c,u)||s(((e,n,r,o)=>"Unsatisfied version "+r+" from "+(r&&e[n][r].from)+" of shared singleton module "+n+" (required "+t(o)+")")(e,i,u,c)),a(e[i][u])},s=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},a=e=>(e.loaded=1,e.get()),c=(e=>function(t,n,r,i){var s=o.I(t);return s&&s.then?s.then(e.bind(e,t,o.S[t],n,r,i)):e(t,o.S[t],n,r,i)})(((e,t,n,r,s)=>t&&o.o(t,n)?i(t,0,n,r):s())),u={},l={4666:()=>c("default","rxjs",[1,6],(()=>o.e(645).then((()=>()=>o(1645))))),5875:()=>c("default","single-spa",[1,5],(()=>o.e(710).then((()=>()=>o(3710))))),5776:()=>c("default","react",[1,18],(()=>o.e(735).then((()=>()=>o(2735))))),6551:()=>c("default","react-dom",[1,18],(()=>o.e(788).then((()=>()=>o(2788))))),7319:()=>c("default","i18next",[1,19],(()=>o.e(585).then((()=>()=>o(3585))))),2680:()=>c("default","react-i18next",[1,11],(()=>o.e(71).then((()=>()=>o(71))))),9442:()=>c("default","dayjs",[1,1],(()=>o.e(530).then((()=>()=>o(7530)))))};[4666,5875,5776,6551,7319,2680,9442].forEach((e=>{o.m[e]=t=>{u[e]=0,delete o.c[e];var n=l[e]();if("function"!=typeof n)throw new Error("Shared module is not available for eager consumption: "+e);t.exports=n()}}));var f={};o.f.consumes=(e,t)=>{o.o(f,e)&&f[e].forEach((e=>{if(o.o(u,e))return t.push(u[e]);var n=t=>{u[e]=0,o.m[e]=n=>{delete o.c[e],n.exports=t()}},r=t=>{delete u[e],o.m[e]=n=>{throw delete o.c[e],t}};try{var i=l[e]();i.then?t.push(u[e]=i.then(n).catch(r)):n(i)}catch(e){r(e)}}))}})(),(()=>{var e={179:0};o.f.j=(t,n)=>{var r=o.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var i=new Promise(((n,o)=>r=e[t]=[n,o]));n.push(r[2]=i);var s=o.p+o.u(t),a=new Error;o.l(s,(n=>{if(o.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var i=n&&("load"===n.type?"missing":n.type),s=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+i+": "+s+")",a.name="ChunkLoadError",a.type=i,a.request=s,r[1](a)}}),"chunk-"+t,t)}};var t=(t,n)=>{var r,i,[s,a,c]=n,u=0;if(s.some((t=>0!==e[t]))){for(r in a)o.o(a,r)&&(o.m[r]=a[r]);c&&c(o)}for(t&&t(n);u<s.length;u++)i=s[u],o.o(e,i)&&e[i]&&e[i][0](),e[i]=0},n=globalThis.webpackChunk_openmrs_esm_framework=globalThis.webpackChunk_openmrs_esm_framework||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),o.nc=void 0,o(7025)})())}}}));
3
3
  //# sourceMappingURL=openmrs-esm-framework.js.map