@openmrs/esm-patient-notes-app 12.1.1-pre.11368 → 12.1.1-pre.11376

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/2544.js CHANGED
@@ -23,5 +23,5 @@ If you're the maintainer: all config elements must have a default. Received ${JS
23
23
  If you're the maintainer: the 'elements' key only works with '_type' equal to 'Array' or 'Object'. Received ${JSON.stringify(l)}`)}}function H(e,t){return K(t.map(({[e]:t})=>t).filter(e=>!!e))}function K(e){return e.reduce((e,t)=>M(e,t),{})}function Z(e,t,n=""){for(let o of Object.keys(t)){let a=t[o],r=n+"."+o,i=e[o];if(!e.hasOwnProperty(o)){("extensionSlots"!==o||""===n)&&eo(r,`Unknown config key '${r}' provided. Ignoring.`);continue}(function e(t,n,o){J(o,t._type,n),et(n)?t._type===p.Object?function(t,n,o){if(t._elements)for(let a of Object.keys(n)){let r=n[a];e(t._elements,r,`${o}.${a}`)}}(t,n,o):t.hasOwnProperty("_default")||t.hasOwnProperty("_type")||Z(t,n,o):t._type===p.Array&&function(t,n,o){if(J(o,p.Array,n)){if(ee(t._elements))for(let a=0;a<n.length;a++)e(t._elements,n[a],`${o}[${a}]`);for(let e=0;e<n.length;e++)J(`${o}[${e}]`,t._elements?._type,n[e])}}(t,n,o)})(i,a,r)}}B();function Y(e,t,n=""){if(e){if(t!==e._default&&X(n,e._validators,t),et(t))for(let o of Object.keys(t)){let a=t[o],r=n+"."+o,i=e[o];e._type===p.Object&&e._elements?Y(e._elements,a,r):Y(i,a,r)}else if(Array.isArray(t)&&e._elements)for(let o=0;o<t.length;o++)Y(e._elements,t[o],`${n}[${o}]`)}}function J(e,t,n){return!t||X(e,[{Array:d,Boolean:u,ConceptUuid:g,Number:f,Object:m,String:h,UUID:g,PersonAttributeTypeUuid:g,PatientIdentifierTypeUuid:g}[t]],n)}function X(e,t,n){let o=!0;if(t)try{for(let a of t){let t=a(n);if("string"==typeof t){let a="object"==typeof n?`Invalid configuration for ${e}: ${t}`:`Invalid configuration value ${n} for ${e}: ${t}`;eo(e,a),o=!1}}}catch(t){console.error(`Skipping invalid validator at "${e}". Encountered error
24
24
  ${t}`)}return o}let Q=(e,t)=>{let n=structuredClone(t);if(!e)return n;for(let t of Object.keys(e)){let o=n[t],a=e[t];if(a&&(a.hasOwnProperty("_type")||a.hasOwnProperty("_default"))){n.hasOwnProperty(t)||(n[t]=a._default);let e=a._elements;if(o&&ee(e)){if(a._type===p.Array&&Array.isArray(o)){let a=o.map(t=>Q(e,t));n[t]=a}else if(a._type===p.Object)for(let t of Object.keys(o))o[t]=Q(e,o[t])}}else if(et(a)){let e=o??{};et(e)&&(n[t]=Q(a,e))}}return n};function ee(e){return!!e&&Object.keys(e).filter(e=>!["_default","_validators"].includes(e)).length>0}function et(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}let en=new Set;function eo(e,t){let n=`${e}:::${t}`;en||(en=new Set),en.has(n)||(console.error(t),en.add(n))}function ea(e){e?en.forEach(t=>{t.startsWith(e)&&en.delete(t)}):en.clear()}function er(){N.forEach(e=>e()),N.length=0,B()}let ei={"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:p.Object,_default:{},_validators:[c(e=>Object.keys(e).every(e=>/^[a-z]{2,3}(-[A-Z]{2,3})?$/.test(e)),e=>{let t=Object.keys(e).filter(e=>!/^[a-z]{2,3}(-[A-Z]{2,3})?$/.test(e));return`The 'Translation overrides' object should have language codes for keys. Language codes must be in the form of a two-to-three letter language code optionally followed by a hyphen and a two-to-three letter country code. The following keys do not conform: ${t.join(", ")}.`})]}},es={"Display conditions":{privileges:{_description:"The privilege(s) the user must have to use this extension",_type:p.Array,_default:[]},expression:{_description:"The expression that determines whether the extension is displayed",_type:p.String,_default:void 0}},...ei},el=(e,t)=>c(n=>e<=n&&n<=t,`must be between ${e} and ${t}`),ep=e=>{let t=e.concat(["openmrsBase","openmrsSpaBase"]);return c(e=>{if(!e||"string"!=typeof e)return!1;let n=/\${(.*?)}/g,o=n.exec(e);for(;o;){if(!t.includes(o[1]))return!1;o=n.exec(e)}return!0},"Should be a URL or path. The allowed template parameters are "+t.map(e=>"${"+e+"}").join(", "))},ec=ep([]),ed=e=>c(t=>e.includes(t),`Must be one of the following: '${e.join("', '")}'.`),eu={inRange:el,isUrl:ec,isUrlWithTemplateParameters:ep,oneOf:ed}},85419(e,t,n){"use strict";n.d(t,{Ln:()=>p,Yv:()=>i,rL:()=>s,zC:()=>l});var o=n(4230),a=n(60319),r=n(46184);function i(e){return e.replace(/[\/\-@]/g,"_")}async function s(e,t="./start",o){var a;let r,p=!o?.maxLoadingTime||o.maxLoadingTime<=0?6e5:o.maxLoadingTime;await Promise.race([l(e,o?.importMap),new Promise((t,n)=>{r=setTimeout(()=>{var t;n(Error(`Could not resolve requested script, ${e}, within ${(t=p)<1e3?`${t} milliseconds`:t<6e4?`${Math.floor(t/1e3)} seconds`:t<36e5?`${Math.floor(t/6e4)} minutes`:t<864e5?`${Math.floor(t/36e5)} hours`:`${Math.floor(t/864e5)} days`}.`))},p)})]),r&&clearTimeout(r);let c=i(e),d=window[c];if(!("object"==typeof(a=d)&&null!==a&&"init"in a&&"function"==typeof a.init&&"get"in a&&"function"==typeof a.get)){let e=`The global variable ${c} does not refer to a federated module`;throw console.error(e),Error(e)}d.init(n.S.default);let u=(await d.get(t))();if("object"!=typeof u||null===u){let t=`Container for ${e} did not return an ESM module as expected`;throw console.error(t),Error(t)}return u}async function l(e,t){if("string"!=typeof e||0===e.trim().length){let e="Attempted to call importDynamic() without supplying a package to load";throw console.error(e),Error(e)}let n=i(e);if(!window[n]){let n=t??await p();if(!n.imports.hasOwnProperty(e)){let t=`Could not find the package ${e} defined in the current importmap`;throw console.error(t),Error(t)}let i=n.imports[e];i.startsWith("./")&&(i=window.spaBase+i.substring(1));let s=e in(0,r.uT)().imports;try{return await new Promise((e,t)=>{!function(e,t,n){let o=document.head.querySelector(`script[src="${e}"]`),a=window[c];if(a||(a=window[c]=new Set([])),o)if(a.has(e)){let e,a,r;r=()=>{e&&o.removeEventListener("load",e),a&&o.removeEventListener("error",a)},e=()=>{r(),t(null)},a=e=>{r(),n(e.message)},o.addEventListener("load",e),o.addEventListener("error",a)}else console.warn(`Script at ${e} already loaded. Not loading it again.`),t(null);else{let o,r,i;a.add(e);let s=document.createElement("script");s.src=e,s.type="text/javascript",s.async=!0;let l=setTimeout(()=>{console.error(`The script at ${e} did not load within 5 seconds. This may indicate an issue with the imports in the script's entry-point file or with the script's bundler configuration.`)},5e3);i=()=>{clearTimeout(l),a.delete(e),o&&s.removeEventListener("load",o),r&&s.removeEventListener("error",r)},o=()=>{i(),t(null)},r=t=>{i();let o=`Failed to load script from ${e}`;console.error(o,t),n(t.message??o)},s.addEventListener("load",o),s.addEventListener("error",r),document.head.appendChild(s)}}(i,e,t)})}catch(e){return s&&(0,o.Vt)({kind:"error",title:(0,a.V)("scriptLoadingFailed","Error: Script failed to load"),description:(0,a.V)("scriptLoadingError","Failed to load overridden script from {{- url}}. Please check that the bundled script is available at the expected URL. Click the button below to reset all import map overrides.",{url:i}),actionButtonLabel:(0,a.V)("resetOverrides","Reset overrides"),onActionButtonClick(){(0,r.w_)(),window.location.reload()}}),Promise.reject(e)}}return Promise.resolve()}async function p(){return(0,r.F$)()}let c=Symbol("__openmrs_script_loading")},46184(e,t,n){"use strict";n.d(t,{BX:()=>$,E:()=>b,F$:()=>d,SM:()=>k,fd:()=>y,o5:()=>f,q1:()=>g,tK:()=>u,uT:()=>h,w_:()=>v,xI:()=>m});let o="import-map-override:",a="import-map-overrides-disabled",r="import-map-overrides:change",i=!1,s=null;async function l(){let e=document.querySelectorAll('script[type="systemjs-importmap"]'),t=[];for(let n=0;n<e.length;n++){let o=e[n];try{if(o.src){let e=await fetch(o.src);t.push(await e.json())}else o.textContent&&t.push(JSON.parse(o.textContent))}catch(e){console.warn(`[import-maps] Failed to parse import map from script tag at index ${n}`,e)}}return p(t)}function p(e){let t={imports:{}};for(let n of e)n?.imports&&Object.assign(t.imports,n.imports);return t}function c(){let e={};try{let t=m();for(let n=0;n<localStorage.length;n++){let a=localStorage.key(n);if(a?.startsWith(o)){let n=a.slice(o.length);if(!t.includes(n)){let t=localStorage.getItem(a);t&&(e[n]=t)}}}}catch(e){console.warn("[import-maps] Failed to read import-map overrides from localStorage",e)}return{imports:e}}async function d(){let e=await l();return i?p([e,s??c()]):e}async function u(){return l()}async function f(){return i?p([await l(),c()]):l()}function h(e){if(!i)return{imports:{}};if(e){let e={};for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);if(n?.startsWith(o)){let t=localStorage.getItem(n);t&&(e[n.slice(o.length)]=t)}}return{imports:e}}return c()}function m(){if(!i)return[];try{let e=localStorage.getItem(a);if(e){let t=JSON.parse(e);if(Array.isArray(t))return t}}catch{}return[]}function g(e){return!!i&&m().includes(e)}function y(e,t){if(!i)return void console.warn("[Security] Import map overrides are disabled in production mode.");try{localStorage.setItem(o+e,t),window.dispatchEvent(new CustomEvent(r))}catch(e){console.warn("[import-maps] Failed to write import-map override to localStorage",e)}}function b(e){if(!i)return void console.warn("[Security] Import map overrides are disabled in production mode.");try{localStorage.removeItem(o+e);let t=m().filter(t=>t!==e);t.length>0?localStorage.setItem(a,JSON.stringify(t)):localStorage.removeItem(a),window.dispatchEvent(new CustomEvent(r))}catch(e){console.warn("[import-maps] Failed to update import-map overrides in localStorage",e)}}function v(){if(!i)return void console.warn("[Security] Import map overrides are disabled in production mode.");try{let e=[];for(let t=0;t<localStorage.length;t++){let n=localStorage.key(t);n?.startsWith(o)&&e.push(n)}e.forEach(e=>localStorage.removeItem(e)),localStorage.removeItem(a),window.dispatchEvent(new CustomEvent(r))}catch(e){console.warn("[import-maps] Failed to clear import-map overrides from localStorage",e)}}function $(e){if(!i)return void console.warn("[Security] Import map overrides are disabled in production mode.");try{let t=m().filter(t=>t!==e);t.length>0?localStorage.setItem(a,JSON.stringify(t)):localStorage.removeItem(a),window.dispatchEvent(new CustomEvent(r))}catch(e){console.warn("[import-maps] Failed to update import-map overrides in localStorage",e)}}let A=!1;function k(){!A&&(A=!0,(i="development"===window.spaEnv)&&(s=c()))}},36289(e,t,n){"use strict";n.d(t,{hG:()=>u,dx:()=>x,X1:()=>h,Bv:()=>l,Pu:()=>$,Vs:()=>b,cD:()=>p,KU:()=>s,BX:()=>S,Ds:()=>D,DK:()=>N,BR:()=>M,$y:()=>m,xL:()=>P,E$:()=>y,Rb:()=>C,SY:()=>c,NH:()=>z,Cj:()=>w,Qx:()=>v,Zu:()=>i});var o,a,r=n(30325);let i=`${r.Jj}/attachment`;function s(e,t){return(0,r.lo)(`${i}/${e}`,{signal:t.signal})}function l(e,t,n){return(0,r.lo)(`${i}?patient=${e}&includeEncounterless=${t}`,{signal:n.signal})}async function p(e,t){let n=new FormData;return n.append("fileCaption",t.fileDescription),n.append("patient",e),t.file?n.append("file",t.file,t.fileName):(n.append("file",new File([""],t.fileName),t.fileName),n.append("base64Content",t.base64Content)),(0,r.lo)(`${i}`,{method:"POST",body:n})}function c(e,t){return(0,r.lo)(`${i}/${e}`,{method:"DELETE",signal:t.signal})}var d=n(33704);async function u(e,t,n=!0){if(e){let o=null,[a,i]=await Promise.all([(0,r.lo)(`${r.IU}/Patient/${e}`,t).catch(e=>o=e),n?f(e):Promise.resolve(null)]);if(a.ok)return a.data;if(i)return i;if(o)throw o}return null}async function f(e){let t=(await (0,d.pb)("patient-registration")).find(t=>t.fhirPatient.id===e);return t?.fhirPatient??null}function h(e,t){let n=new CustomEvent(`openmrs:${e}`,{detail:t??void 0,cancelable:!0,bubbles:!0});return window.dispatchEvent(n)}function m(e,t){let n=e=>{t("detail"in e&&null!==e.detail?e.detail:void 0)};return window.addEventListener(`openmrs:${e}`,n),()=>{window.removeEventListener(`openmrs:${e}`,n)}}var g=n(99549);function y(e){return{uuid:e.uuid,display:e.display}}function b(e=null,t=null){let n=new URLSearchParams;e&&n.set("tag",e),t&&n.set("q",t);let o=n.toString(),a=`${r.Jj}/location${o?"?"+o:""}`;return(0,r.ut)(a).pipe((0,g.map)(e=>e.data.results.map(y))).pipe((0,g.take)(1))}function v(e){return{uuid:e.uuid,display:e.display,name:e.name}}function $(){return(0,r.ut)(`${r.Jj}/visittype`).pipe((0,g.map)(e=>e.data.results.map(v))).pipe((0,g.take)(1))}var A=n(21013),k=n(24354),x=((o={}).NEWVISIT="startVisit",o.EDITVISIT="editVisit",o.LOADING="loadingVisit",o),w=((a={}).NOTSTARTED="notStarted",a.ONGOING="ongoing",a);let C="custom:(uuid,display,voided,indication,startDatetime,stopDatetime,encounters:(uuid,display,encounterDatetime,form:(uuid,name),location:ref,encounterType:ref,encounterProviders:(uuid,display,provider:(uuid,display))),patient:(uuid,display),visitType:(uuid,name,display),attributes:(uuid,display,attributeType:(name,datatypeClassname,uuid),value),location:(uuid,name,display))",E=function(){try{return JSON.parse(sessionStorage.getItem("openmrs:visitStoreState")||"null")}catch(e){return null}}()||{patientUuid:null,manuallySetVisitUuid:null,mutateVisitCallbacks:{}};function S(){return(0,A.jf)("visit",E)}function z(e,t){S().setState({patientUuid:e,manuallySetVisitUuid:t})}function D(e,t){return(0,r.lo)(`${r.Jj}/visit`,{signal:t.signal,method:"POST",headers:{"Content-type":"application/json"},body:e})}function P(e,t,n){return(0,r.lo)(`${r.Jj}/visit/${e}`,{signal:n.signal,method:"POST",headers:{"Content-type":"application/json"},body:t})}function M(e,t,n){return(0,r.lo)(`${r.Jj}/visit?patient=${e}&v=${n??C}`,{signal:t.signal,method:"GET",headers:{"Content-type":"application/json"}})}S().subscribe(e=>{var t;t=e,sessionStorage.setItem("openmrs:visitStoreState",JSON.stringify(t))});let N=new k.BehaviorSubject(null)},64227(e,t,n){"use strict";n.d(t,{J:()=>r,N:()=>a});var o=n(4230);function a(e){let t=i(e);setTimeout(()=>{throw t})}function r(){let e=Error();return t=>{let n=i(t);n.stack+=`
25
25
  Async stacktrace:
26
- ${e.stack}`,a(t)}}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)}if(void 0===e)return Error("'undefined' was thrown as an error");return Error(e.toString())}window.onerror=function(e){return console.error("Unexpected error: ",e),(0,o.Vt)({description:e??"Oops! An unexpected error occurred.",kind:"error",title:"Error"}),!1},window.onunhandledrejection=function(e){console.error("Unhandled rejection: ",e.reason),(0,o.Vt)({description:e.reason??"Oops! An unhandled promise rejection occurred.",kind:"error",title:"Error"})}},79424(e,t,n){"use strict";n.d(t,{dX:()=>c,wE:()=>h,_3:()=>i,uN:()=>f,$F:()=>d,Gz:()=>p,eb:()=>l,Sj:()=>u,mv:()=>s,PQ:()=>o.A});var o=n(19758);let a="ArrowFunctionExpression";var r=n(99053);function i(e,t={}){return u(e,t,m)}async function s(e,t={}){return f(e,t,m)}function l(e,t={}){return u(e,t,g)}function p(e,t={}){return f(e,t,g)}function c(e,t={}){return u(e,t,y)}function d(e,t={}){return f(e,t,y)}function u(e,t={},n){if("string"!=typeof e&&("object"!=typeof e||!e||!("type"in e)))throw`Unknown expression type ${e}. Expressions must either be a string or pre-compiled string.`;if("string"==typeof e&&0===e.trim().length)throw{type:"Empty expression",message:"Expression cannot be an empty string"};null==t&&(t={});let a=$(t,r.z),i=b("string"==typeof e?(0,o.A)(e):e,a);if(n(i))return i;throw{type:"Invalid result",message:"string"==typeof e?`The expression ${e} did not produce a valid result`:"The expression did not produce a valid result"}}async function f(e,t={},n){if("string"!=typeof e&&("object"!=typeof e||!e||!("type"in e)))return Promise.reject(`Unknown expression type ${e}. Expressions must either be a string or pre-compiled string.`);if("string"==typeof e&&0===e.trim().length)throw{type:"Empty expression",message:"Expression cannot be an empty string"};null==t&&(t={});let a=$(t,r.f);return Promise.resolve(b("string"==typeof e?(0,o.A)(e):e,a)).then(t=>{if(n(t))return t;throw{type:"Invalid result",message:"string"==typeof e?`The expression ${e} did not produce a valid result`:"The expression did not produce a valid result"}})}function h(e){return(0,o.A)(e)}function m(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e||e instanceof Date}function g(e){return"boolean"==typeof e}function y(e){return"number"==typeof e}function b(e,t){switch(e.type){case"UnaryExpression":var n,o,a,r,i,s,l,p,c,d,u,f,h=e,m=t;let g=b(h.argument,m);switch(h.operator){case"+":return+g;case"-":return-g;case"~":return~g;case"!":return!g;default:throw`Expression evaluator does not support operator '${h.operator}''`}case"BinaryExpression":var y=e,$=t;let w=b(y.left,$),C=b(y.right,$);switch(y.operator){case"+":return w+C;case"-":return w-C;case"*":return w*C;case"/":return w/C;case"%":return w%C;case"**":return w**C;case"==":return w==C;case"===":return w===C;case"!=":return w!=C;case"!==":return w!==C;case">":return w>C;case">=":return w>=C;case"<":return w<C;case"<=":return w<=C;case"in":return w in C;case"&&":return w&&C;case"||":return w||C;case"??":return w??C;default:throw`Expression evaluator does not support operator '${y.operator}' operator`}case"ConditionalExpression":return n=e,o=t,b(n.test,o)?b(n.consequent,o):b(n.alternate,o);case"CallExpression":var E=e,S=t;let z=E.arguments?.map(A(S)),D=b(E.callee,S);if(D){if("function"!=typeof D)throw`${x(E.callee)} is not a function`}else throw`No function named ${x(E.callee)} is defined in this context`;return D(...z);case"ArrowFunctionExpression":let P;return a=e,r=t,P=a.params?.map(e=>{if("Identifier"===e.type)return e.name;throw`Cannot handle parameter of type ${e.type}`})??[],(function(...e){if(e.length<P.length)throw`Required argument(s) ${P.slice(e.length,-1).join(", ")} were not provided`;let t=Object.fromEntries(P.reduce((t,n,o)=>{let a=e[o];return function e(t){if("string"==typeof t||"number"==typeof t||"boolean"==typeof t||"function"==typeof t||null===t||t instanceof RegExp)return!0;if("object"==typeof t){for(let n of Object.keys(t))if(!e(t[n]))return!1;return!0}if(Array.isArray(t)){for(let n of t)if(!e(n))break}return!1}(a)&&t.push([n,a]),t},[]));return b(a.body,r.addVariables(t))}).bind(r.thisObj??null);case"MemberExpression":return function(e,t){let n,o=b(e.object,t);if(void 0===o)switch(e.object.type){case"Identifier":{let n=v(e.object,t);throw ReferenceError(`ReferenceError: ${n} is not defined`)}case"MemberExpression":{let n=v(e.property,t);throw TypeError(`TypeError: cannot read properties of undefined (reading '${n}')`)}default:throw`VisitMemberExpression does not support operator '${e.object.type}' type`}let a=o;if("string"==typeof o)a=String.prototype;else if("number"==typeof o)a=Number.prototype;else if("function"==typeof o);else if("object"!=typeof o)throw`VisitMemberExpression does not support member access on type ${typeof o}`;switch(t.thisObj=a,e.property.type){case"Identifier":case"MemberExpression":n=b(e.property,t);break;default:{let a=b(e.property,t);if(void 0===a)throw{type:"Illegal property access",message:"No property was supplied to the property access"};k(a),n=o[a]}}return"function"==typeof n?n.bind(o):n}(e,t);case"ArrayExpression":return i=e,s=t,i.elements?.map(A(s));case"SequenceExpression":let M;return l=e,p=t,(M=l.expressions.map(A(p)))[M.length-1];case"NewExpression":var N=e,T=t;if(N.callee&&"Identifier"===N.callee.type){let e=N.arguments?.map(A(T));switch(N.callee.name){case"Date":return new Date(...e);case"RegExp":return new RegExp(...e);default:throw`Cannot instantiate object of type ${N.callee.name}`}}if(N.callee)throw"new must be called with either Date or RegExp";throw'Could not handle "new" without a specified class';case"Literal":return k((c=e).value),c.value;case"Identifier":var B=e,O=t;k(B.name);let I=O.thisObj;if(I&&("object"==typeof I||"function"==typeof I)&&B.name in I){let e=I[B.name];return k(e),e}if(O.variables&&B.name in O.variables){let e=O.variables[B.name];return k(e),e}return B.name in O.globals?O.globals[B.name]:void 0;case"TemplateLiteral":let j,R;return d=e,u=t,j=d.expressions?.map(A(u))??[],(R=d.quasis?.map(A(u))??[]).filter(e=>!e.tail).map(e=>e.value).join("")+j.join("")+R.filter(e=>e.tail).map(e=>e.value).join("");case"TemplateElement":return{value:(f=e).cooked,tail:f.tail};default:throw`Expression evaluator does not support expression of type '${e.type}'`}}function v(e,t){switch(e.type){case"Literal":return e.value;case"Identifier":return e.name;case"MemberExpression":return v(e.property,t);default:throw`VisitExpressionName does not support expression of type '${e.type}'`}}function $(e,t){let n={thisObj:void 0,variables:{...e},globals:{...t},addVariables(e){return this.variables={...this.variables,...e},this}};return n.addVariables.bind(n),n}function A(e){return function(t){return null===t?null:b(t,e)}}function k(e){if("__proto__"===e||"prototype"===e||"constructor"===e)throw{type:"Illegal property access",message:`Cannot access the ${e} property of objects`}}function x(e){return e?"MemberExpression"===e.type?e.property?.name:e.name:null}o.A.plugins.register({name:"arrow",init(e){e.addBinaryOp("=>",.1,!0),e.hooks.add("gobble-expression",function(t){if(this.gobbleSpaces(),this.code===e.OPAREN_CODE){let n=this.index;if(this.index++,this.gobbleSpaces(),this.code===e.CPAREN_CODE){this.index++;let e=this.gobbleBinaryOp();if("=>"===e){let n=this.gobbleBinaryExpression();n||this.throwError("Expected expression after "+e),t.node={type:a,params:null,body:n};return}}this.index=n}}),e.hooks.add("after-expression",function(t){!function t(n){n&&(Object.values(n).forEach(e=>{e&&"object"==typeof e&&t(e)}),"=>"===n.operator&&(n.type=a,n.params=n.left?[n.left]:null,n.body=n.right,n.params&&n.params[0].type===e.SEQUENCE_EXP&&(n.params=n.params[0].expressions),delete n.left,delete n.right,delete n.operator))}(t.node)})}}),o.A.plugins.register({name:"new",init(e){e.addUnaryOp("new"),e.hooks.add("after-token",function(t){let n=t.node;if(n&&"new"===n.operator){n.argument&&[e.CALL_EXP,e.MEMBER_EXP].includes(n.argument.type)||this.throwError("Expected new function()"),t.node=n.argument;let o=t.node;for(;o.type===e.MEMBER_EXP||o.type===e.CALL_EXP&&o.callee.type===e.MEMBER_EXP;)o=o.type===e.MEMBER_EXP?o.object:o.callee.object;o.type="NewExpression"}})}}),o.A.plugins.register({name:"numbers",init(e){function t(e){return"x"===e||"X"===e?(this.index+=2,[[48,57],[65,70],[97,102]]):"b"===e||"B"===e?(this.index+=2,[[48,49]]):"o"===e||"O"===e||e>="0"&&e<="7"?(this.index+=e<="7"?1:2,[[48,55]]):null}function n(t){let n=this.index,o="",a=()=>{for(;e.isDecimalDigit(this.code)||95===this.code;)95===this.code?this.index++:o+=this.expr.charAt(this.index++)};a(),this.code===e.PERIOD_CODE&&(o+=this.expr.charAt(this.index++),a());let r=this.char;("e"===r||"E"===r)&&(o+=this.expr.charAt(this.index++),("+"===(r=this.char)||"-"===r)&&(o+=this.expr.charAt(this.index++)),a(),e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+o+this.char+")"));let i=this.code;if(e.isIdentifierStart(i))this.throwError("Variable names cannot start with a number ("+o+this.char+")");else if(i===e.PERIOD_CODE){o.length>1&&this.throwError(`Unexpected period ${JSON.stringify({chCode:i,number:o},null,2)}`),this.index=n;return}t.node={type:e.LITERAL,value:parseFloat(o),raw:this.expr.substring(n,this.index)}}e.hooks.add("gobble-token",function(o){if(48===this.code){var a,r,i;let s=this.index,l=this.expr.charAt(this.index+1),p=t.call(this,l);if(!p)return;let c="";for(;a=this.code,r=p,95===a||r.some(([e,t])=>a>=e&&a<=t);)95===this.code?this.index++:c+=this.expr.charAt(this.index++);if(e.isIdentifierPart(this.code)){if(e.isDecimalDigit(this.code)&&e.isDecimalDigit(l.charCodeAt(0))){this.index=s+1,n.call(this,o);return}this.throwError("unexpected char within number")}o.node={type:e.LITERAL,value:parseInt(c,"x"===(i=l)||"X"===i?16:"b"===i||"B"===i?2:8),raw:this.expr.substring(s,this.index)}}else(e.isDecimalDigit(this.code)||this.code===e.PERIOD_CODE)&&n.call(this,o)})}}),o.A.plugins.register({name:"regex",init(e){e.hooks.add("gobble-token",function(t){if(47===this.code){let n=++this.index,o=!1;for(;this.index<this.expr.length;){if(47===this.code&&!o){let o,a=this.expr.slice(n,this.index),r="";for(;++this.index<this.expr.length;){let e=this.code;if(e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57)r+=this.char;else break}try{o=new RegExp(a,r)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:o,raw:this.expr.slice(n-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===e.OBRACK_CODE?o=!0:o&&this.code===e.CBRACK_CODE&&(o=!1),this.index+=92===this.code?2:1}this.throwError("Unclosed Regex")}})}}),o.A.plugins.register({name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;let n=t.node,o=this.gobbleExpression();if(o||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let a=this.gobbleExpression();if(a||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:n,consequent:o,alternate:a},n.operator&&e.binary_ops[n.operator]<=.9){let o=n;for(;o.right.operator&&e.binary_ops[o.right.operator]<=.9;)o=o.right;t.node.test=o.right,o.right=t.node,t.node=n}}else this.throwError("Expected :")}})}}),o.A.plugins.register({name:"jsepTemplateLiteral",init(e){function t(e,n=!0){if(96===this.code){let t={type:"TemplateLiteral",quasis:[],expressions:[]},o="",a="",r=!1,i=this.expr.length,s=()=>t.quasis.push({type:"TemplateElement",value:{raw:a,cooked:o},tail:r});for(;this.index<i;){let i=this.expr.charAt(++this.index);if("`"===i)return this.index+=1,r=!0,s(),e.node=t,n&&(e.node=this.gobbleTokenProperty(e.node)),e.node;if("$"===i&&"{"===this.expr.charAt(this.index+1))this.index+=2,s(),a="",o="",t.expressions.push(...this.gobbleExpressions(125)),125!==this.code&&this.throwError("unclosed ${");else if("\\"===i)switch(a+=i,i=this.expr.charAt(++this.index),a+=i,i){case"n":o+="\n";break;case"r":o+="\r";break;case"t":o+=" ";break;case"b":o+="\b";break;case"f":o+="\f";break;case"v":o+="\v";break;default:o+=i}else o+=i,a+=i}this.throwError("Unclosed `")}}e.hooks.add("gobble-token",t),e.hooks.add("after-token",function(n){if((n.node.type===e.IDENTIFIER||n.node.type===e.MEMBER_EXP)&&96===this.code)return n.node={type:"TaggedTemplateExpression",tag:n.node,quasi:t.bind(this)(n,!1)},n.node=this.gobbleTokenProperty(n.node),n.node})}}),o.A.addBinaryOp("in",7),o.A.addBinaryOp("??",1)},99053(e,t,n){"use strict";n.d(t,{f:()=>a,z:()=>o});let o={Array,Boolean,Symbol,Infinity,NaN,Math,Number,BigInt,String,RegExp,JSON,isFinite,isNaN,parseFloat,parseInt,decodeURI,encodeURI,encodeURIComponent,Object:{__proto__:void 0,assign:Object.assign.bind(null),fromEntries:Object.fromEntries.bind(null),hasOwn:Object.hasOwn.bind(null),keys:Object.keys.bind(null),is:Object.is.bind(null),values:Object.values.bind(null)}},a={...o,Promise}},26223(e,t,n){"use strict";n.d(t,{J_:()=>et,zx:()=>I,ES:()=>S,FY:()=>j,zF:()=>b,Uh:()=>es,io:()=>J,Ef:()=>f,wG:()=>ec,Qb:()=>ei,dO:()=>u,o1:()=>eo,rD:()=>er,Vx:()=>W,sr:()=>V,YX:()=>ea,Tj:()=>D,Gp:()=>L,K0:()=>M,Q_:()=>ee,a9:()=>g,xg:()=>z,DQ:()=>y,Ml:()=>en,Xb:()=>Q,Fg:()=>q,VK:()=>P,pm:()=>Y,Ju:()=>U,cL:()=>F,ap:()=>R,Yo:()=>N,No:()=>T});var o=n(30325),a=n(33869),r=n(79424),i=n(25767),s=n(4230),l=n(6564),p=n(42853),c=n(20405),d=(0,n(11888).A)(function(e,t,n){(0,c.A)(e,t,n)});function u(e=!0,t=!1){return f((0,l.s)(),e,t)}function f(e,t=!0,n=!1){return!!(e?t:n)}var h=n(21013);let m=(0,h.Zd)("extensionsInternal",{slots:{},extensions:{}}),g=()=>(0,h.jf)("extensionsInternal",{slots:{},extensions:{}});function y(e){let t=m.getState(),n=e(t);n!==t&&m.setState(n)}let b=()=>(0,h.jf)("extensions",{slots:{}});function v(e){let 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,p.A)(a.hs.getState().mountedExtensions,t)||a.hs.setState({mountedExtensions:t})}v(m.getState()),m.subscribe(v);let $=g(),A=b(),k=(0,a.YP)(),x=(0,a.GI)();function w(e,t,n,o,r){let i={},s=(0,l.s)(),c=Object.entries(o.flags).filter(([,{enabled:e}])=>e).map(([e])=>e);for(let[o,l]of Object.entries(e.slots)){let{config:p}=(0,a.vu)(t,l.name),d=O(o,e,p,n,c,s,r.session);i[o]={moduleName:l.moduleName,assignedExtensions:d}}(0,p.A)(A.getState().slots,i)||A.setState({slots:i})}function C(){w($.getState(),k.getState(),x.getState(),i.jX.getState(),o.eA.getState())}function E(e,t,n){return{moduleName:t,name:e,attachedIds:[],config:null,state:n}}function S(e){let[t]=e.split("#");return t}function z(e,t){let n=S(t);return e.extensions[n]}function D(e){return z($.getState(),e)}$.subscribe(e=>{w(e,k.getState(),x.getState(),i.jX.getState(),o.eA.getState())}),k.subscribe(e=>{w($.getState(),e,x.getState(),i.jX.getState(),o.eA.getState())}),x.subscribe(e=>{w($.getState(),k.getState(),e,i.jX.getState(),o.eA.getState())}),i.jX.subscribe(e=>{w($.getState(),k.getState(),x.getState(),e,o.eA.getState())}),o.eA.subscribe(e=>{w($.getState(),k.getState(),x.getState(),i.jX.getState(),e)}),C(),(0,s.gj)(C);let P=e=>$.setState(t=>(t.extensions[e.name]={...e,instances:[]},t));function M(e,t){y(n=>{let o=n.slots[e];return o?{...n,slots:{...n.slots,[e]:{...o,attachedIds:[...o.attachedIds,t]}}}:{...n,slots:{...n.slots,[e]:{...E(e),attachedIds:[t]}}}})}function N(e,t){y(n=>{let o=n.slots[e];return o&&o.attachedIds.includes(t)?{...n,slots:{...n.slots,[e]:{...o,attachedIds:o.attachedIds.filter(e=>e!==t)}}}:n})}function T(e){y(t=>{let n=t.slots[e];return n?{...t,slots:{...t.slots,[e]:{...n,attachedIds:[]}}}:t})}function B(e,t,n,o){let a=t.indexOf(e);if(-1!==a)return a;{if(void 0!==n)return 1e3+n;let t=o.indexOf(e);return -1!==t?2e3+t:-1}}function O(e,t,n,i,s,l,p){let c=function(e,t){let n=e.add||[],o=e.remove||[],a=e.order||[],{extensions:r}=$.getState();return[...t,...n].filter(e=>!o.includes(e)).sort((e,n)=>{let o=B(e,a,r[S(e)]?.order,t),i=B(n,a,r[S(n)]?.order,t);return -1===i?-1:-1===o?1:o-i})}(n,t.slots[e].attachedIds),u=[],h=t.slots[e]?.state,m=h&&"object"==typeof h?{session:p,...h}:{session:p};for(let h of c){let{config:c}=(0,a.P0)(i,e,h),g=d(c,(0,a.g$)(n,e,h)),y=S(h),b=t.extensions[y];if(b){let t=g?.["Display conditions"]?.privileges??b.privileges??[];if(t&&("string"==typeof t||Array.isArray(t)&&t.length>0)&&(!p?.user||!(0,o.st)(t,p.user)))continue;let n=g?.["Display conditions"]?.expression||b.displayExpression;if(void 0!==n&&"string"==typeof n&&n.trim().length>0)try{if(!(0,r.eb)(n,m))continue}catch(t){console.error(`Error while evaluating expression '${n}' for extension ${y} in slot ${e}`,t);continue}if(b.featureFlag&&!s.includes(b.featureFlag)||window.offlineEnabled&&!f(l,b.online,b.offline))continue;u.push({id:h,name:y,moduleName:b.moduleName,config:g,featureFlag:b.featureFlag,meta:b.meta,online:g?.["Display conditions"]?.online??b.online??!0,offline:g?.["Display conditions"]?.offline??b.offline??!1})}}return u}function I(e){let t=$.getState(),{config:n}=(0,a.G9)(e),r=x.getState(),s=i.jX.getState(),p=o.eA.getState(),c=(0,l.s)();return O(e,t,n,r,Object.entries(s.flags).filter(([,{enabled:e}])=>e).map(([e])=>e),c,p.session)}let j=(e,t,n)=>$.setState(o=>{let a=o.slots[t]?.moduleName;if(a&&a!=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 ${a}.`),o;if(a&&a==e)return o;if(o.slots[t])return{...o,slots:{...o.slots,[t]:{...o.slots[t],moduleName:e,state:n}}};let r=E(t,e,n);return{...o,slots:{...o.slots,[t]:{...r}}}});function R(e,t,n=!1){$.setState(o=>{let a=n?d(o.slots[e].state,t):t;return{...o,slots:{...o.slots,[e]:{...o.slots[e],state:a}}}})}let F=()=>A.setState(()=>({slots:{},extensions:{}})),L=(0,h.Zd)("left-nav",{slotName:null,basePath:window.spaBase,mode:"normal"});function W({name:e,basePath:t,mode:n,componentContext:o,state:a}){L.setState({slotName:e,basePath:t,mode:n??"normal",componentContext:o,state:a})}function V(e){L.getState().slotName===e&&L.setState(L.getInitialState(),!0)}let G=(0,h.Zd)("modalRegistry",{modals:{}});function U(e){G.setState(t=>(t.modals[e.name]=e,t))}function q(e){let t=G.getState().modals[e];if(!t){let n=D(e);n&&(t={name:e,load:n.load,moduleName:n.moduleName},console.warn(`Modal ${e} was registered as an extension. This is deprecated and will be removed in the future. Please register it in the "modals" section of routes.json instead of the "extensions" section.`),U(t))}return t}var H=n(60319);let K=(0,h.Zd)("workspaceRegistrations",{workspaces:{}}),Z=(0,h.Zd)("workspaceGroups",{workspaceGroups:{}});function Y(e){K.setState(t=>({workspaces:{...t.workspaces,[e.name]:{...e,load:e.load,preferredWindowSize:e.preferredWindowSize??"normal",type:e.type??"form",canHide:e.canHide??!1,canMaximize:e.canMaximize??!1,width:e.width??"narrow",groups:e.groups??[]}}}))}function J(e){Z.setState(t=>{let n=t.workspaceGroups[e.name];return n?{workspaceGroups:{...t.workspaceGroups,[e.name]:{...n,members:Array.from(new Set([...n.members,...e.members]))}}}:{workspaceGroups:{...t.workspaceGroups,[e.name]:{name:e.name,members:e.members}}}})}let X=new Set;function Q(e){let t=K.getState().workspaces;if(t[e])return t[e];{let t=D(e);if(t){var n;let o;return X.has(e)||(console.warn(`The workspace '${e}' is registered as an extension. This is deprecated. Please register it in the "workspaces" section of the routes.json file.`),X.add(e)),{name:t.name,title:(n=t,"string"==typeof(o=n?.meta?.title)?o:o&&"object"==typeof o?(0,H.t)(n.moduleName,o.key,o.default):n.name),moduleName:t.moduleName,preferredWindowSize:t.meta?.screenSize??"normal",load:t.load,type:t.meta?.type??"form",canHide:t.meta?.canHide??!1,canMaximize:t.meta?.canMaximize??!1,width:t.meta?.width??"narrow",groups:t.meta?.groups??[]}}throw Error(`No workspace named '${e}' has been registered.`)}}function ee(e){let t=Z.getState().workspaceGroups;if(t[e])return t[e];throw Error(`No workspace group named '${e}' has been registered.`)}let et=(0,h.Zd)("workspace2",{registeredGroupsByName:{},registeredWindowsByName:{},registeredWorkspacesByName:{},openedGroup:null,openedWindows:[],workspaceTitleByWorkspaceName:{},isMostRecentlyOpenedWindowHidden:!1});function en(e){let{registeredWorkspacesByName:t,registeredWindowsByName:n}=et.getState(),o=t[e];if(o){let t=n[o.window];if(t)return t;throw Error(`No workspace window found with name: ${o.window} for workspace: ${e}`)}throw Error(`No workspace found with name: ${e}`)}function eo(e){let{registeredGroupsByName:t,registeredWindowsByName:n}=et.getState(),o=n[e];if(o){let n=t[o.group];if(n)return n;throw Error(`No workspace group found with name: ${o.group} for window: ${e}`)}throw Error(`No workspace window found with name: ${e}`)}function ea(e){let{openedWindows:t}=et.getState();return t.findIndex(t=>t.openedWorkspaces.find(t=>t.workspaceName===e))}function er(e,t){if(0==t.length)return;let{registeredGroupsByName:n}=et.getState(),o={...n};for(let n of t){if(o[n.name])throw Error(`Cannot register workspace group ${n.name} more than once`);o[n.name]={...n,moduleName:e}}et.setState({registeredGroupsByName:o})}function ei(e,t){if(0==t.length)return;let{registeredWindowsByName:n}=et.getState(),o={...n};for(let n of t){if(o[n.name])throw Error(`Cannot register workspace window ${n.name} more than once`);let t={...n,moduleName:e};o[n.name]=t}et.setState({registeredWindowsByName:o})}function es(e,t){if(0==t.length)return;let{registeredWorkspacesByName:n}=et.getState(),o={...n};for(let n of t){if(o[n.name])throw Error(`Cannot register workspace ${n.name} more than once`);let t={...n,moduleName:e};o[n.name]=t}et.setState({registeredWorkspacesByName:o})}var el=n(22244);let ep=0;async function ec(e,t,n,o,a=e=>e,r={}){let i=S(o),s=D(o),l=null;if(e){if(!s)throw Error(`Couldn't find extension '${i}' to attach to '${t}'`);let{meta:p,moduleName:c,online:d,offline:f,load:h}=s;if(u(d,f)){y(a=>({...a,extensions:{...a.extensions,[i]:{...a.extensions[i],instances:[...a.extensions[i].instances,{domElement:e,id:o,slotName:t,slotModuleName:n}]}}}));let s=await h(),d=ep++;l=(0,el.xL)(a({...s,name:`${t}/${i}-${d}`}),{...r,_meta:p,_extensionContext:{extensionId:o,extensionSlotName:t,extensionSlotModuleName:n,extensionModuleName:c},domElement:e})}}else console.warn(`Tried to render ${o} into ${t} but no DOM element was available.`);return l}},4230(e,t,n){"use strict";n.d(t,{$3:()=>g,FI:()=>h,LQ:()=>m,Vt:()=>y,Yt:()=>a,bJ:()=>b,bK:()=>v,dX:()=>$,ff:()=>p,gj:()=>r,ls:()=>A,pc:()=>l,sT:()=>i});let o="openmrs:connectivity-changed";function a(e){window.dispatchEvent(new CustomEvent(o,{detail:{online:e}}))}function r(e){if(!window.offlineEnabled)return()=>{};let t=t=>e(t.detail);return window.addEventListener(o,t),()=>window.removeEventListener(o,t)}function i(e){return e({online:!window.offlineEnabled||navigator.onLine}),r(e)}let s="openmrs:precache-static-dependencies";function l(e={}){window.dispatchEvent(new CustomEvent(s,{detail:e}))}function p(e){let t=t=>e(t.detail);return window.addEventListener(s,t),()=>window.removeEventListener(s,t)}let c="openmrs:notification-shown",d="openmrs:actionable-notification-shown",u="openmrs:toast-shown",f="openmrs:snack-bar-shown";function h(e){window.dispatchEvent(new CustomEvent(c,{detail:e}))}function m(e){window.dispatchEvent(new CustomEvent(d,{detail:e}))}function g(e){window.dispatchEvent(new CustomEvent(f,{detail:e}))}function y(e){window.dispatchEvent(new CustomEvent(u,{detail:e}))}function b(e){let t=t=>e(t.detail);return window.addEventListener(c,t),()=>window.removeEventListener(c,t)}function v(e){let t=t=>e(t.detail);return window.addEventListener(d,t),()=>window.removeEventListener(d,t)}function $(e){let t=t=>e(t.detail);return window.addEventListener(u,t),()=>window.removeEventListener(u,t)}function A(e){let t=t=>e(t.detail);return window.addEventListener(f,t),()=>window.removeEventListener(f,t)}},86236(e,t,n){"use strict";n.d(t,{tA:()=>v,JK:()=>b,g4:()=>$,vf:()=>r,MY:()=>i,Wh:()=>y,qh:()=>c,lz:()=>s,D_:()=>p,JG:()=>u,oo:()=>h,zl:()=>f});var o=n(82034);let a=(0,n(21013).Zd)("breadcrumbs",[]);function r(e){return i([e])}function i(e){let t=[...s(),...e.map(e=>({matcher:e.matcher instanceof RegExp?e.matcher:"string"==typeof e.matcher?(0,o.pathToRegexp)(e.matcher).regexp:(0,o.pathToRegexp)(e.path).regexp,settings:e}))];a.setState(t,!0)}function s(){return a.getState()}function l(e,t){if(t)return function(e,t){let[n]=e.filter(e=>e.matcher.test(t));return n}(e,t)||function(e,t){let n=t.split("/");for(;n.length>1;){n.pop();let t=l(e,n.join("/"));if(t)return t}}(e,t)}function p(e,t){if(e.length>0){let n=l(e,t);if(n){let t=[n],o=l(e,n.settings.parent);for(;void 0!==o;)t.push(o),o=l(e,o.settings.parent);return t.reverse()}}return[]}function c(e){return p(s(),e)}var d=n(22244);function u(e,t){let n=window.getOpenmrsSpaBase().replace(/\/$/,"");return f(e,{openmrsBase:window.openmrsBase,openmrsSpaBase:n,...t}).replace(/^\/\//,"/")}function f(e,t){return Object.keys(t).reduce((e,n)=>e.split("${"+n+"}").join(t[n]),e)}function h({to:e,templateParams:t}){let n=window.getOpenmrsSpaBase().replace(/\/$/,""),o=u(e,t).replace(window.location.origin,"");o.startsWith(n)?(0,d.EH)(o):window.location.assign(o)}let m="openmrs:history";function g(e){let t=JSON.parse(sessionStorage.getItem(m)??"[]")||[];t.push(e),t.length>50&&(t=t.slice(-50)),sessionStorage.setItem(m,JSON.stringify(t))}function y(){0===JSON.parse(sessionStorage.getItem(m)??"[]").length&&document.referrer&&g(document.referrer),window.addEventListener("single-spa:routing-event",e=>{let t=b();e.detail.originalEvent?.singleSpaTrigger=="replaceState"?(t[t.length-1]=window.location.href,sessionStorage.setItem(m,JSON.stringify(t))):!e.detail.originalEvent?.singleSpa&&t.includes(window.location.href)?v({toUrl:window.location.href}):t[t.length-1]!==window.location.href&&g(window.location.href)})}function b(){return JSON.parse(sessionStorage.getItem(m)??"[]")}function v({toUrl:e}){let t=b(),n=t.lastIndexOf(e);if(-1!=n){let e=t.slice(0,n+1);h({to:t[n]}),sessionStorage.setItem(m,JSON.stringify(e))}else throw Error(`URL ${e} not found in history; cannot go back to it.`)}function $(){sessionStorage.removeItem(m)}},33704(e,t,n){"use strict";let o,a,r;n.d(t,{nr:()=>M,xN:()=>n7,u1:()=>ob,KG:()=>ok,FO:()=>n9,FE:()=>ou,LM:()=>nJ,sA:()=>os,Rs:()=>b,ff:()=>om,wn:()=>og,sK:()=>ox,lY:()=>oe,ms:()=>k,Zr:()=>n2,WK:()=>oA,WA:()=>of,UH:()=>v,cy:()=>ot,Gp:()=>n8,jU:()=>oi,Og:()=>P,iD:()=>od,C$:()=>n6,qb:()=>oc,Iq:()=>n1,NU:()=>o_,sZ:()=>y,yD:()=>oh,Io:()=>n3,wJ:()=>D,JC:()=>A,e:()=>nH,xc:()=>n5,pb:()=>n4,bO:()=>ol,AO:()=>nX,Td:()=>oy,Gj:()=>$});try{self["workbox:window:6.5.4"]&&_()}catch(e){}function i(e,t){return new Promise(function(n){var o=new MessageChannel;o.port1.onmessage=function(e){n(e.data)},e.postMessage(t,[o.port2])})}function s(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}try{self["workbox:core:6.5.4"]&&_()}catch(e){}var p=function(){var e=this;this.promise=new Promise(function(t,n){e.resolve=t,e.reject=n})};function c(e,t){var n=location.href;return new URL(e,n).href===new URL(t,n).href}var d=function(e,t){this.type=e,Object.assign(this,t)};function u(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function f(){}var h={type:"SKIP_WAITING"};function m(e,t){if(!t)return e&&e.then?e.then(f):Promise.resolve()}var g=function(e){function t(t,n){var o,a;return void 0===n&&(n={}),(o=e.call(this)||this).nn={},o.tn=0,o.rn=new p,o.en=new p,o.on=new p,o.un=0,o.an=new Set,o.cn=function(){var e=o.fn,t=e.installing;o.tn>0||!c(t.scriptURL,o.sn.toString())||performance.now()>o.un+6e4?(o.vn=t,e.removeEventListener("updatefound",o.cn)):(o.hn=t,o.an.add(t),o.rn.resolve(t)),++o.tn,t.addEventListener("statechange",o.ln)},o.ln=function(e){var t=o.fn,n=e.target,a=n.state,r=n===o.vn,i={sw:n,isExternal:r,originalEvent:e};!r&&o.mn&&(i.isUpdate=!0),o.dispatchEvent(new d(a,i)),"installed"===a?o.wn=self.setTimeout(function(){"installed"===a&&t.waiting===n&&o.dispatchEvent(new d("waiting",i))},200):"activating"===a&&(clearTimeout(o.wn),r||o.en.resolve(n))},o.dn=function(e){var t=o.hn,n=t!==navigator.serviceWorker.controller;o.dispatchEvent(new d("controlling",{isExternal:n,originalEvent:e,sw:t,isUpdate:o.mn})),n||o.on.resolve(t)},a=function(e){var t=e.data,n=e.ports,a=e.source;return u(o.getSW(),function(){o.an.has(a)&&o.dispatchEvent(new d("message",{data:t,originalEvent:e,ports:n,sw:a}))})},o.gn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(a.apply(this,e))}catch(e){return Promise.reject(e)}},o.sn=t,o.nn=n,navigator.serviceWorker.addEventListener("message",o.gn),o}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e;var n,o,a=t.prototype;return a.register=function(e){var t=(void 0===e?{}:e).immediate,n=void 0!==t&&t;try{var o,a,r,i=this;return o=function(){if(!n&&"complete"!==document.readyState)return m(new Promise(function(e){return window.addEventListener("load",e)}))},a=function(){return i.mn=!!navigator.serviceWorker.controller,i.yn=i.pn(),u(i.bn(),function(e){i.fn=e,i.yn&&(i.hn=i.yn,i.en.resolve(i.yn),i.on.resolve(i.yn),i.yn.addEventListener("statechange",i.ln,{once:!0}));var t=i.fn.waiting;return t&&c(t.scriptURL,i.sn.toString())&&(i.hn=t,Promise.resolve().then(function(){i.dispatchEvent(new d("waiting",{sw:t,wasWaitingBeforeRegister:!0}))}).then(function(){})),i.hn&&(i.rn.resolve(i.hn),i.an.add(i.hn)),i.fn.addEventListener("updatefound",i.cn),navigator.serviceWorker.addEventListener("controllerchange",i.dn),i.fn})},(r=o())&&r.then?r.then(a):a(r)}catch(e){return Promise.reject(e)}},a.update=function(){try{return this.fn?m(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(e){try{return u(this.getSW(),function(t){return i(t,e)})}catch(e){return Promise.reject(e)}},a.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&i(this.fn.waiting,h)},a.pn=function(){var e=navigator.serviceWorker.controller;return e&&c(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 u(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)}},n=[{key:"active",get:function(){return this.en.promise}},{key:"controlling",get:function(){return this.on.promise}}],s(t.prototype,n),o&&s(t,o),t}(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){var t;if("u"<typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(t=function(e){if(e){if("string"==typeof e)return l(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?l(e,void 0):void 0}}(e))){t&&(e=t);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(t=e[Symbol.iterator]()).next.bind(t)}(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}());function y(e,t){if(void 0!==r)return console.warn(`The application's Service Worker has already been registered. The new service worker at ${e} will not be registered.`),r;if(!("serviceWorker"in navigator))throw Error("Registering the Service Worker is not possible due to missing browser capabilities.");let n=new g(e,t);return r=n.register().then(()=>n.controlling.then(()=>n))}function b(){return r??Promise.resolve(void 0)}let v="x-omrs-offline-response-body",$="x-omrs-offline-response-status",A="x-omrs-offline-caching-strategy";async function k(e){let t=await b();return t?await 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."}}async function x(){let 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}async function w(){return!window.indexedDB}async function C(){return new Promise(e=>{let t=indexedDB.open("test");t.onerror=()=>e(!0),t.onsuccess=()=>e(!1)})}async function E(){return await C()||await w()||await x()}let S="openmrs3:offline-mode",z="unavailable";function D(){return{current:z,notAvailable:"unavailable"===z,active:"on"===z}}function P(e){"unavailable"!==z&&"unavailable"!==e&&(localStorage.setItem(S,"on"===e?"active":"disabled"),z=e)}async function M(){await E()||(z="active"===localStorage.getItem(S)?"on":"off"),navigator.onLine}let N="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,T=Object.keys,B=Array.isArray;function O(e,t){return"object"!=typeof t||T(t).forEach(function(n){e[n]=t[n]}),e}"u"<typeof Promise||N.Promise||(N.Promise=Promise);let I=Object.getPrototypeOf,j={}.hasOwnProperty;function R(e,t){return j.call(e,t)}function F(e,t){"function"==typeof t&&(t=t(I(e))),("u"<typeof Reflect?T:Reflect.ownKeys)(t).forEach(n=>{W(e,n,t[n])})}let L=Object.defineProperty;function W(e,t,n,o){L(e,t,O(n&&R(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},o))}function V(e){return{from:function(t){return e.prototype=Object.create(t.prototype),W(e.prototype,"constructor",e),{extend:F.bind(null,e.prototype)}}}}let G=Object.getOwnPropertyDescriptor;function U(e,t){let n;return G(e,t)||(n=I(e))&&U(n,t)}let q=[].slice;function H(e,t,n){return q.call(e,t,n)}function K(e,t){return t(e)}function Z(e){if(!e)throw Error("Assertion Failed")}function Y(e){N.setImmediate?setImmediate(e):setTimeout(e,0)}function J(e,t){return e.reduce((e,n,o)=>{var a=t(n,o);return a&&(e[a[0]]=a[1]),e},{})}function X(e,t){if(R(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var n=[],o=0,a=t.length;o<a;++o){var r=X(e,t[o]);n.push(r)}return n}var i=t.indexOf(".");if(-1!==i){var s=e[t.substr(0,i)];return void 0===s?void 0:X(s,t.substr(i+1))}}function Q(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){Z("string"!=typeof n&&"length"in n);for(var o=0,a=t.length;o<a;++o)Q(e,t[o],n[o])}else{var r=t.indexOf(".");if(-1!==r){var i=t.substr(0,r),s=t.substr(r+1);if(""===s)void 0===n?B(e)&&!isNaN(parseInt(i))?e.splice(i,1):delete e[i]:e[i]=n;else{var l=e[i];l&&R(e,i)||(l=e[i]={}),Q(l,s,n)}}else void 0===n?B(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function ee(e){var t={};for(var n in e)R(e,n)&&(t[n]=e[n]);return t}let et=[].concat;function en(e){return et.apply([],e)}let eo="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(en([8,16,32,64].map(e=>["Int","Uint","Float"].map(t=>t+e+"Array")))).filter(e=>N[e]),ea=eo.map(e=>N[e]);J(eo,e=>[e,!0]);let er=null;function ei(e){er="u">typeof WeakMap&&new WeakMap;let t=function e(t){if(!t||"object"!=typeof t)return t;let n=er&&er.get(t);if(n)return n;if(B(t)){n=[],er&&er.set(t,n);for(var o=0,a=t.length;o<a;++o)n.push(e(t[o]))}else if(ea.indexOf(t.constructor)>=0)n=t;else{let o=I(t);for(var r in n=o===Object.prototype?{}:Object.create(o),er&&er.set(t,n),t)R(t,r)&&(n[r]=e(t[r]))}return n}(e);return er=null,t}let{toString:es}={};function el(e){return es.call(e).slice(8,-1)}let ep="u">typeof Symbol?Symbol.iterator:"@@iterator",ec="symbol"==typeof ep?function(e){var t;return null!=e&&(t=e[ep])&&t.apply(e)}:function(){return null},ed={};function eu(e){var t,n,o,a;if(1==arguments.length){if(B(e))return e.slice();if(this===ed&&"string"==typeof e)return[e];if(a=ec(e)){for(n=[];!(o=a.next()).done;)n.push(o.value);return n}if(null==e)return[e];if("number"==typeof(t=e.length)){for(n=Array(t);t--;)n[t]=e[t];return n}return[e]}for(t=arguments.length,n=Array(t);t--;)n[t]=arguments[t];return n}let ef="u">typeof Symbol?e=>"AsyncFunction"===e[Symbol.toStringTag]:()=>!1;var eh="u">typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href),em=()=>!0;let e_=!Error("").stack;function eg(){if(e_)try{throw eg.arguments,Error()}catch(e){return e}return Error()}function ey(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(em).map(e=>"\n"+e).join("")):""}var eb=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],ev=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(eb),e$={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 eA(e,t){this._e=eg(),this.name=e,this.message=t}function ek(e,t){return e+". Errors: "+Object.keys(t).map(e=>t[e].toString()).filter((e,t,n)=>n.indexOf(e)===t).join("\n")}function ex(e,t,n,o){this._e=eg(),this.failures=t,this.failedKeys=o,this.successCount=n,this.message=ek(e,t)}function ew(e,t){this._e=eg(),this.name="BulkError",this.failures=Object.keys(t).map(e=>t[e]),this.failuresByPos=t,this.message=ek(e,t)}V(eA).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+ey(this._e,2))}},toString:function(){return this.name+": "+this.message}}),V(ex).from(eA),V(ew).from(eA);var eC=ev.reduce((e,t)=>(e[t]=t+"Error",e),{}),eE=ev.reduce((e,t)=>{var n=t+"Error";function o(e,o){this._e=eg(),this.name=n,e?"string"==typeof e?(this.message=`${e}${o?"\n "+o:""}`,this.inner=o||null):"object"==typeof e&&(this.message=`${e.name} ${e.message}`,this.inner=e):(this.message=e$[t]||n,this.inner=null)}return V(o).from(eA),e[t]=o,e},{});eE.Syntax=SyntaxError,eE.Type=TypeError,eE.Range=RangeError;var eS=eb.reduce((e,t)=>(e[t+"Error"]=eE[t],e),{}),ez=ev.reduce((e,t)=>(-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=eE[t]),e),{});function eD(){}function eP(e){return e}function eM(e,t){return null==e||e===eP?t:function(n){return t(e(n))}}function eN(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function eT(e,t){return e===eD?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var o=this.onsuccess,a=this.onerror;this.onsuccess=null,this.onerror=null;var r=t.apply(this,arguments);return o&&(this.onsuccess=this.onsuccess?eN(o,this.onsuccess):o),a&&(this.onerror=this.onerror?eN(a,this.onerror):a),void 0!==r?r:n}}function eB(e,t){return e===eD?t:function(){e.apply(this,arguments);var n=this.onsuccess,o=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?eN(n,this.onsuccess):n),o&&(this.onerror=this.onerror?eN(o,this.onerror):o)}}function eO(e,t){return e===eD?t:function(n){var o=e.apply(this,arguments);O(n,o);var a=this.onsuccess,r=this.onerror;this.onsuccess=null,this.onerror=null;var i=t.apply(this,arguments);return a&&(this.onsuccess=this.onsuccess?eN(a,this.onsuccess):a),r&&(this.onerror=this.onerror?eN(r,this.onerror):r),void 0===o?void 0===i?void 0:i:O(o,i)}}function eI(e,t){return e===eD?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function ej(e,t){return e===eD?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var o=this,a=arguments.length,r=Array(a);a--;)r[a]=arguments[a];return n.then(function(){return t.apply(o,r)})}return t.apply(this,arguments)}}ez.ModifyError=ex,ez.DexieError=eA,ez.BulkError=ew;var eR={};let[eF,eL,eW]="u"<typeof Promise?[]:(()=>{let e=Promise.resolve();if("u"<typeof crypto||!crypto.subtle)return[e,I(e),e];let t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,I(t),e]})(),eV=eL&&eL.then,eG=eF&&eF.constructor,eU=!!eW;var eq=!1,eH=eW?()=>{eW.then(ta)}:N.setImmediate?setImmediate.bind(null,ta):N.MutationObserver?()=>{var e=document.createElement("div");new MutationObserver(()=>{ta(),e=null}).observe(e,{attributes:!0}),e.setAttribute("i","1")}:()=>{setTimeout(ta,0)},eK=function(e,t){e3.push([e,t]),eY&&(eH(),eY=!1)},eZ=!0,eY=!0,eJ=[],eX=[],eQ=null,e0=eP,e1={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:tE,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach(e=>{try{tE(e[0],e[1])}catch(e){}})}},e2=e1,e3=[],e5=0,e4=[];function e6(e){if("object"!=typeof this)throw TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=eD,this._lib=!1;var t=this._PSD=e2;if(eh&&(this._stackHolder=eg(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==eR)throw TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&e9(this,this._value))}this._state=null,this._value=null,++t.ref,function e(t,n){try{n(n=>{if(null===t._state){if(n===t)throw TypeError("A promise cannot be resolved with itself.");var o=t._lib&&tr();n&&"function"==typeof n.then?e(t,(e,t)=>{n instanceof e6?n._then(e,t):n.then(e,t)}):(t._state=!0,t._value=n,te(t)),o&&ti()}},e9.bind(null,t))}catch(e){e9(t,e)}}(this,e)}let e8={get:function(){var e=e2,t=th;function n(n,o){var a=!e.global&&(e!==e2||t!==th);let r=a&&!ty();var i=new e6((t,i)=>{tt(this,new e7(tw(n,e,a,r),tw(o,e,a,r),t,i,e))});return eh&&to(i,this),i}return n.prototype=eR,n},set:function(e){W(this,"then",e&&e.prototype===eR?e8:{get:function(){return e},set:e8.set})}};function e7(e,t,n,o,a){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=o,this.psd=a}function e9(e,t){if(eX.push(t),null===e._state){var n=e._lib&&tr();t=e0(t),e._state=!1,e._value=t,eh&&null!==t&&"object"==typeof t&&!t._promise&&function(e){try{e.apply(null,void 0)}catch(e){}}(()=>{var n=U(t,"stack");t._promise=e,W(t,"stack",{get:()=>eq?n&&(n.get?n.get.apply(t):n.value):e.stack})}),eJ.some(t=>t._value===e._value)||eJ.push(e),te(e),n&&ti()}}function te(e){var t=e._listeners;e._listeners=[];for(var n=0,o=t.length;n<o;++n)tt(e,t[n]);var a=e._PSD;--a.ref||a.finalize(),0===e5&&(++e5,eK(()=>{0==--e5&&ts()},[]))}function tt(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,++e5,eK(tn,[n,e,t])}else e._listeners.push(t)}function tn(e,t,n){try{eQ=t;var o,a=t._value;t._state?o=e(a):(eX.length&&(eX=[]),o=e(a),-1===eX.indexOf(a)&&function(e){for(var t=eJ.length;t;)if(eJ[--t]._value===e._value)return void eJ.splice(t,1)}(t)),n.resolve(o)}catch(e){n.reject(e)}finally{eQ=null,0==--e5&&ts(),--n.psd.ref||n.psd.finalize()}}function to(e,t){var n=t?t._numPrev+1:0;n<100&&(e._prev=t,e._numPrev=n)}function ta(){tr()&&ti()}function tr(){var e=eZ;return eZ=!1,eY=!1,e}function ti(){var e,t,n;do for(;e3.length>0;)for(e=e3,e3=[],n=e.length,t=0;t<n;++t){var o=e[t];o[0].apply(null,o[1])}while(e3.length>0);eZ=!0,eY=!0}function ts(){var e=eJ;eJ=[],e.forEach(e=>{e._PSD.onunhandled.call(null,e._value,e)});for(var t=e4.slice(0),n=t.length;n;)t[--n]()}function tl(e){return new e6(eR,!1,e)}function tp(e,t){var n=e2;return function(){var o=tr(),a=e2;try{return tA(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{tA(a,!1),o&&ti()}}}F(e6.prototype,{then:e8,_then:function(e,t){tt(this,new e7(null,null,e,t,e2))},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):tl(e)):this.then(null,e=>e&&e.name===t?n(e):tl(e))},finally:function(e){return this.then(t=>(e(),t),t=>(e(),tl(t)))},stack:{get:function(){if(this._stack)return this._stack;try{eq=!0;var e=(function e(t,n,o){if(n.length===o)return n;var a="";if(!1===t._state){var r,i,s=t._value;null!=s?(r=s.name||"Error",i=s.message||s,a=ey(s,0)):(r=s,i=""),n.push(r+(i?": "+i:"")+a)}return eh&&((a=ey(t._stackHolder,2))&&-1===n.indexOf(a)&&n.push(a),t._prev&&e(t._prev,n,o)),n})(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{eq=!1}}},timeout:function(e,t){return e<1/0?new e6((n,o)=>{var a=setTimeout(()=>o(new eE.Timeout(t)),e);this.then(n,o).finally(clearTimeout.bind(null,a))}):this}}),"u">typeof Symbol&&Symbol.toStringTag&&W(e6.prototype,Symbol.toStringTag,"Dexie.Promise"),e1.env=tk(),F(e6,{all:function(){var e=eu.apply(null,arguments).map(tb);return new e6(function(t,n){0===e.length&&t([]);var o=e.length;e.forEach((a,r)=>e6.resolve(a).then(n=>{e[r]=n,--o||t(e)},n))})},resolve:e=>{if(e instanceof e6)return e;if(e&&"function"==typeof e.then)return new e6((t,n)=>{e.then(t,n)});var t=new e6(eR,!0,e);return to(t,eQ),t},reject:tl,race:function(){var e=eu.apply(null,arguments).map(tb);return new e6((t,n)=>{e.map(e=>e6.resolve(e).then(t,n))})},PSD:{get:()=>e2,set:e=>e2=e},totalEchoes:{get:()=>th},newPSD:t_,usePSD:tx,scheduler:{get:()=>eK,set:e=>{eK=e}},rejectionMapper:{get:()=>e0,set:e=>{e0=e}},follow:(e,t)=>new e6((n,o)=>t_((t,n)=>{var o=e2;o.unhandleds=[],o.onunhandled=n,o.finalize=eN(function(){var e;e=()=>{0===this.unhandleds.length?t():n(this.unhandleds[0])},e4.push(function t(){e(),e4.splice(e4.indexOf(t),1)}),++e5,eK(()=>{0==--e5&&ts()},[])},o.finalize),e()},t,n,o))}),eG&&(eG.allSettled&&W(e6,"allSettled",function(){let e=eu.apply(null,arguments).map(tb);return new e6(t=>{0===e.length&&t([]);let n=e.length,o=Array(n);e.forEach((e,a)=>e6.resolve(e).then(e=>o[a]={status:"fulfilled",value:e},e=>o[a]={status:"rejected",reason:e}).then(()=>--n||t(o)))})}),eG.any&&"u">typeof AggregateError&&W(e6,"any",function(){let e=eu.apply(null,arguments).map(tb);return new e6((t,n)=>{0===e.length&&n(AggregateError([]));let o=e.length,a=Array(o);e.forEach((e,r)=>e6.resolve(e).then(e=>t(e),e=>{a[r]=e,--o||n(AggregateError(a))}))})}));let tc={awaits:0,echoes:0,id:0};var td=0,tu=[],tf=0,th=0,tm=0;function t_(e,t,n,o){var a=e2,r=Object.create(a);r.parent=a,r.ref=0,r.global=!1,r.id=++tm;var i=e1.env;r.env=eU?{Promise:e6,PromiseProp:{value:e6,configurable:!0,writable:!0},all:e6.all,race:e6.race,allSettled:e6.allSettled,any:e6.any,resolve:e6.resolve,reject:e6.reject,nthen:tC(i.nthen,r),gthen:tC(i.gthen,r)}:{},t&&O(r,t),++a.ref,r.finalize=function(){--this.parent.ref||this.parent.finalize()};var s=tx(r,e,n,o);return 0===r.ref&&r.finalize(),s}function tg(){return tc.id||(tc.id=++td),++tc.awaits,tc.echoes+=100,tc.id}function ty(){return!!tc.awaits&&(0==--tc.awaits&&(tc.id=0),tc.echoes=100*tc.awaits,!0)}function tb(e){return tc.echoes&&e&&e.constructor===eG?(tg(),e.then(e=>(ty(),e),e=>(ty(),tS(e)))):e}function tv(e){++th,tc.echoes&&0!=--tc.echoes||(tc.echoes=tc.id=0),tu.push(e2),tA(e,!0)}function t$(){var e=tu[tu.length-1];tu.pop(),tA(e,!1)}function tA(e,t){var n,o=e2;if((t?!tc.echoes||tf++&&e===e2:!tf||--tf&&e===e2)||(n=t?tv.bind(null,e):t$,eV.call(eF,n)),e!==e2&&(e2=e,o===e1&&(e1.env=tk()),eU)){var a=e1.env.Promise,r=e.env;eL.then=r.nthen,a.prototype.then=r.gthen,(o.global||e.global)&&(Object.defineProperty(N,"Promise",r.PromiseProp),a.all=r.all,a.race=r.race,a.resolve=r.resolve,a.reject=r.reject,r.allSettled&&(a.allSettled=r.allSettled),r.any&&(a.any=r.any))}}function tk(){var e=N.Promise;return eU?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(N,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:eL.then,gthen:e.prototype.then}:{}}function tx(e,t,n,o,a){var r=e2;try{return tA(e,!0),t(n,o,a)}finally{tA(r,!1)}}function tw(e,t,n,o){return"function"!=typeof e?e:function(){var a,r=e2;n&&tg(),tA(t,!0);try{return e.apply(this,arguments)}finally{tA(r,!1),o&&(a=ty,eV.call(eF,a))}}}function tC(e,t){return function(n,o){return e.call(this,tw(n,t),tw(o,t))}}function tE(e,t){var n;try{n=t.onuncatched(e)}catch(e){}if(!1!==n)try{var o,a={promise:t,reason:e};if(N.document&&document.createEvent?((o=document.createEvent("Event")).initEvent("unhandledrejection",!0,!0),O(o,a)):N.CustomEvent&&O(o=new CustomEvent("unhandledrejection",{detail:a}),a),o&&N.dispatchEvent&&(dispatchEvent(o),!N.PromiseRejectionEvent&&N.onunhandledrejection))try{N.onunhandledrejection(o)}catch(e){}eh&&o&&!o.defaultPrevented&&console.warn(`Unhandled rejection: ${e.stack||e}`)}catch(e){}}-1===(""+eV).indexOf("[native code]")&&(tg=ty=eD);var tS=e6.reject;let tz=String.fromCharCode(65535),tD="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",tP=[],tM="u">typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),tN=e=>!/(dexie\.js|dexie\.min\.js)/.test(e);function tT(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}let tB={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function tO(e){return"string"!=typeof e||/\./.test(e)?e=>e:t=>(void 0===t[e]&&e in t&&delete(t=ei(t))[e],t)}class tI{_trans(e,t,n){let o=this._tx||e2.trans,a=this.name;function r(e,n,o){if(!o.schema[a])throw new eE.NotFound("Table "+a+" not part of transaction");return t(o.idbtrans,o)}let i=tr();try{return o&&o.db===this.db?o===e2.trans?o._promise(e,r,n):t_(()=>o._promise(e,r,n),{trans:o,transless:e2.transless||e2}):function e(t,n,o,a){if(t.idbdb&&(t._state.openComplete||e2.letThrough||t._vip)){var r=t._createTransaction(n,o,t._dbSchema);try{r.create(),t._state.PR1398_maxLoop=3}catch(r){return r.name===eC.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then(()=>e(t,n,o,a))):tS(r)}return r._promise(n,(e,t)=>t_(()=>(e2.trans=r,a(e,t,r)))).then(e=>r._completion.then(()=>e))}if(t._state.openComplete)return tS(new eE.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._options.autoOpen)return tS(new eE.DatabaseClosed);t.open().catch(eD)}return t._state.dbReadyPromise.then(()=>e(t,n,o,a))}(this.db,e,[this.name],r)}finally{i&&ti()}}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(B(e))return new this.db.WhereClause(this,`[${e.join("+")}]`);let t=T(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);let 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!==tz)return this.where(n.name).equals(n.keyPath.map(t=>e[t]));!n&&eh&&console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit of a compound index [${t.join("+")}]`);let{idxByName:o}=this.schema,a=this.db._deps.indexedDB;function r(e,t){try{return 0===a.cmp(e,t)}catch(e){return!1}}let[i,s]=t.reduce(([t,n],a)=>{let i=o[a],s=e[a];return[t||i,t||!i?tT(n,i&&i.multi?e=>{let t=X(e,a);return B(t)&&t.some(e=>r(s,e))}:e=>r(s,X(e,a))):n]},[null,null]);return i?this.where(i.name).equals(e[i.keyPath]).filter(s):n?this.filter(s):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,B(e)?`[${e.join("+")}]`:e))}reverse(){return this.toCollection().reverse()}mapToClass(e){this.schema.mappedClass=e;let t=t=>{if(!t)return t;let n=Object.create(e.prototype);for(var o in t)if(R(t,o))try{n[o]=t[o]}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){O(this,e)})}add(e,t){let{auto:n,keyPath:o}=this.schema.primKey,a=e;return o&&n&&(a=tO(o)(e)),this._trans("readwrite",e=>this.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[a]})).then(e=>e.numFailures?e6.reject(e.failures[0]):e.lastResult).then(t=>{if(o)try{Q(e,o,t)}catch(e){}return t})}update(e,t){if("object"!=typeof e||B(e))return this.where(":id").equals(e).modify(t);{let n=X(e,this.schema.primKey.keyPath);if(void 0===n)return tS(new eE.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?T(t).forEach(n=>{Q(e,n,t[n])}):t(e,{value:e,primKey:n})}catch(e){}return this.where(":id").equals(n).modify(t)}}put(e,t){let{auto:n,keyPath:o}=this.schema.primKey,a=e;return o&&n&&(a=tO(o)(e)),this._trans("readwrite",e=>this.core.mutate({trans:e,type:"put",values:[a],keys:null!=t?[t]:null})).then(e=>e.numFailures?e6.reject(e.failures[0]):e.lastResult).then(t=>{if(o)try{Q(e,o,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?e6.reject(e.failures[0]):void 0)}clear(){return this._trans("readwrite",e=>this.core.mutate({trans:e,type:"deleteRange",range:tB})).then(e=>e.numFailures?e6.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){let o=Array.isArray(t)?t:void 0,a=(n=n||(o?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",t=>{let{auto:n,keyPath:r}=this.schema.primKey;if(r&&o)throw new eE.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new eE.InvalidArgument("Arguments objects and keys must have the same length");let i=e.length,s=r&&n?e.map(tO(r)):e;return this.core.mutate({trans:t,type:"add",keys:o,values:s,wantResults:a}).then(({numFailures:e,results:t,lastResult:n,failures:o})=>{if(0===e)return a?t:n;throw new ew(`${this.name}.bulkAdd(): ${e} of ${i} operations failed`,o)})})}bulkPut(e,t,n){let o=Array.isArray(t)?t:void 0,a=(n=n||(o?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",t=>{let{auto:n,keyPath:r}=this.schema.primKey;if(r&&o)throw new eE.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new eE.InvalidArgument("Arguments objects and keys must have the same length");let i=e.length,s=r&&n?e.map(tO(r)):e;return this.core.mutate({trans:t,type:"put",keys:o,values:s,wantResults:a}).then(({numFailures:e,results:t,lastResult:n,failures:o})=>{if(0===e)return a?t:n;throw new ew(`${this.name}.bulkPut(): ${e} of ${i} operations failed`,o)})})}bulkDelete(e){let t=e.length;return this._trans("readwrite",t=>this.core.mutate({trans:t,type:"delete",keys:e})).then(({numFailures:e,lastResult:n,failures:o})=>{if(0===e)return n;throw new ew(`${this.name}.bulkDelete(): ${e} of ${t} operations failed`,o)})}}function tj(e){var t={},n=function(n,o){if(o){for(var a=arguments.length,r=Array(a-1);--a;)r[a-1]=arguments[a];return t[n].subscribe.apply(null,r),e}if("string"==typeof n)return t[n]};n.addEventType=r;for(var o=1,a=arguments.length;o<a;++o)r(arguments[o]);return n;function r(e,o,a){if("object"==typeof e){var i;return void T(i=e).forEach(function(e){var t=i[e];if(B(t))r(e,i[e][0],i[e][1]);else{if("asap"!==t)throw new eE.InvalidArgument("Invalid event config");var n=r(e,eP,function(){for(var e=arguments.length,t=Array(e);e--;)t[e]=arguments[e];n.subscribers.forEach(function(e){Y(function(){e.apply(null,t)})})})}})}o||(o=eI),a||(a=eD);var s={subscribers:[],fire:a,subscribe:function(e){-1===s.subscribers.indexOf(e)&&(s.subscribers.push(e),s.fire=o(s.fire,e))},unsubscribe:function(e){s.subscribers=s.subscribers.filter(function(t){return t!==e}),s.fire=s.subscribers.reduce(o,a)}};return t[e]=n[e]=s,s}}function tR(e,t){return V(t).from({prototype:e}),t}function tF(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function tL(e,t){e.filter=tT(e.filter,t)}function tW(e,t,n){var o=e.replayFilter;e.replayFilter=o?()=>tT(o(),t()):t,e.justLimit=n&&!o}function tV(e,t){if(e.isPrimKey)return t.primaryKey;let n=t.getIndexByKeyPath(e.index);if(!n)throw new eE.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function tG(e,t,n){let o=tV(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:o,range:e.range}})}function tU(e,t,n,o){let a=e.replayFilter?tT(e.filter,e.replayFilter()):e.filter;if(e.or){let r={},i=(e,n,o)=>{if(!a||a(n,o,e=>n.stop(e),e=>n.fail(e))){var i=n.primaryKey,s=""+i;"[object ArrayBuffer]"===s&&(s=""+new Uint8Array(i)),R(r,s)||(r[s]=!0,t(e,n,o))}};return Promise.all([e.or._iterate(i,n),tq(tG(e,o,n),e.algorithm,i,!e.keysOnly&&e.valueMapper)])}return tq(tG(e,o,n),tT(e.algorithm,a),t,!e.keysOnly&&e.valueMapper)}function tq(e,t,n,o){var a=tp(o?(e,t,a)=>n(o(e),t,a):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=eD},t=>{e.fail(t),n=eD})||a(e.value,e,e=>n=e),n()})})}function tH(e,t){try{let n=tK(e),o=tK(t);if(n!==o)return"Array"===n?1:"Array"===o?-1:"binary"===n?1:"binary"===o?-1:"string"===n?1:"string"===o?-1:"Date"===n?1:"Date"!==o?NaN:-1;switch(n){case"number":case"Date":case"string":return e>t?1:e<t?-1:0;case"binary":return function(e,t){let n=e.length,o=t.length,a=n<o?n:o;for(let n=0;n<a;++n)if(e[n]!==t[n])return e[n]<t[n]?-1:1;return n===o?0:n<o?-1:1}(tZ(e),tZ(t));case"Array":return function(e,t){let n=e.length,o=t.length,a=n<o?n:o;for(let n=0;n<a;++n){let o=tH(e[n],t[n]);if(0!==o)return o}return n===o?0:n<o?-1:1}(e,t)}}catch(e){}return NaN}function tK(e){let t=typeof e;if("object"!==t)return t;if(ArrayBuffer.isView(e))return"binary";let n=el(e);return"ArrayBuffer"===n?"binary":n}function tZ(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}class tY{_read(e,t){var n=this._ctx;return n.error?n.table._trans(null,tS.bind(null,n.error)):n.table._trans("readonly",e).then(t)}_write(e){var t=this._ctx;return t.error?t.table._trans(null,tS.bind(null,t.error)):t.table._trans("readwrite",e,"locked")}_addAlgorithm(e){var t=this._ctx;t.algorithm=tT(t.algorithm,e)}_iterate(e,t){return tU(this._ctx,e,t,this._ctx.table.core)}clone(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&O(n,e),t._ctx=n,t}raw(){return this._ctx.valueMapper=null,this}each(e){var t=this._ctx;return this._read(n=>tU(t,e,n,t.table.core))}count(e){return this._read(e=>{let t=this._ctx,n=t.table.core;if(tF(t,!0))return n.count({trans:e,query:{index:tV(t,n.schema),range:t.range}}).then(e=>Math.min(e,t.limit));var o=0;return tU(t,()=>(++o,!1),e,n).then(()=>o)}).then(e)}sortBy(e,t){let n=e.split(".").reverse(),o=n[0],a=n.length-1;function r(e,t){return t?r(e[n[t]],t-1):e[o]}var i="next"===this._ctx.dir?1:-1;function s(e,t){var n=r(e,a),o=r(t,a);return n<o?-i:n>o?i:0}return this.toArray(function(e){return e.sort(s)}).then(t)}toArray(e){return this._read(e=>{var t=this._ctx;if("next"===t.dir&&tF(t,!0)&&t.limit>0){let{valueMapper:n}=t,o=tV(t,t.table.core.schema);return t.table.core.query({trans:e,limit:t.limit,values:!0,query:{index:o,range:t.range}}).then(({result:e})=>n?e.map(n):e)}{let n=[];return tU(t,e=>n.push(e),e,t.table.core).then(()=>n)}},e)}offset(e){var t=this._ctx;return e<=0||(t.offset+=e,tF(t)?tW(t,()=>{var t=e;return(e,n)=>0===t||(1===t?--t:n(()=>{e.advance(t),t=0}),!1)}):tW(t,()=>{var t=e;return()=>--t<0})),this}limit(e){return this._ctx.limit=Math.min(this._ctx.limit,e),tW(this._ctx,()=>{var t=e;return function(e,n,o){return--t<=0&&n(o),t>=0}},!0),this}until(e,t){return tL(this._ctx,function(n,o,a){return!e(n.value)||(o(a),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;return tL(this._ctx,function(t){return e(t.value)}),(t=this._ctx).isMatch=tT(t.isMatch,e),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&&tF(t,!0)&&t.limit>0)return this._read(e=>{var n=tV(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 tL(this._ctx,function(e){var t=e.primaryKey.toString(),o=R(n,t);return n[t]=!0,!o}),this}modify(e){var t=this._ctx;return this._write(n=>{var o;if("function"==typeof e)o=e;else{var a=T(e),r=a.length;o=function(t){for(var n=!1,o=0;o<r;++o){var i=a[o],s=e[i];X(t,i)!==s&&(Q(t,i,s),n=!0)}return n}}let i=t.table.core,{outbound:s,extractKey:l}=i.schema.primaryKey,p=this.db._options.modifyChunkSize||200,c=[],d=0,u=[],f=(e,t)=>{let{failures:n,numFailures:o}=t;for(let t of(d+=e-o,T(n)))c.push(n[t])};return this.clone().primaryKeys().then(a=>{let r=c=>{let d=Math.min(p,a.length-c);return i.getMany({trans:n,keys:a.slice(c,c+d),cache:"immutable"}).then(u=>{let h=[],m=[],g=s?[]:null,y=[];for(let e=0;e<d;++e){let t=u[e],n={value:ei(t),primKey:a[c+e]};!1!==o.call(n,n.value,n)&&(null==n.value?y.push(a[c+e]):s||0===tH(l(t),l(n.value))?(m.push(n.value),s&&g.push(a[c+e])):(y.push(a[c+e]),h.push(n.value)))}let b=tF(t)&&t.limit===1/0&&("function"!=typeof e||e===tJ)&&{index:t.index,range:t.range};return Promise.resolve(h.length>0&&i.mutate({trans:n,type:"add",values:h}).then(e=>{for(let t in e.failures)y.splice(parseInt(t),1);f(h.length,e)})).then(()=>(m.length>0||b&&"object"==typeof e)&&i.mutate({trans:n,type:"put",keys:g,values:m,criteria:b,changeSpec:"function"!=typeof e&&e}).then(e=>f(m.length,e))).then(()=>(y.length>0||b&&e===tJ)&&i.mutate({trans:n,type:"delete",keys:y,criteria:b}).then(e=>f(y.length,e))).then(()=>a.length>c+d&&r(c+p))})};return r(0).then(()=>{if(c.length>0)throw new ex("Error modifying one or more objects",c,d,u);return a.length})})})}delete(){var e=this._ctx,t=e.range;return tF(e)&&(e.isPrimKey&&!tM||3===t.type)?this._write(n=>{let{primaryKey:o}=e.table.core.schema;return e.table.core.count({trans:n,query:{index:o,range:t}}).then(o=>e.table.core.mutate({trans:n,type:"deleteRange",range:t}).then(({failures:e,lastResult:t,results:n,numFailures:a})=>{if(a)throw new ex("Could not delete some values",Object.keys(e).map(t=>e[t]),o-a);return o-a}))}):this.modify(tJ)}}let tJ=(e,t)=>t.value=null;function tX(e,t){return e<t?-1:+(e!==t)}function tQ(e,t){return e>t?-1:+(e!==t)}function t0(e,t,n){var o=e instanceof t4?new e.Collection(e):e;return o._ctx.error=n?new n(t):TypeError(t),o}function t1(e){return new e.Collection(e,()=>t5("")).limit(0)}function t2(e,t,n,o){var a,r,i,s,l,p,c,d=n.length;if(!n.every(e=>"string"==typeof e))return t0(e,"String expected.");function u(e){a="next"===e?e=>e.toUpperCase():e=>e.toLowerCase(),r="next"===e?e=>e.toLowerCase():e=>e.toUpperCase(),i="next"===e?tX:tQ;var t=n.map(function(e){return{lower:r(e),upper:a(e)}}).sort(function(e,t){return i(e.lower,t.lower)});s=t.map(function(e){return e.upper}),l=t.map(function(e){return e.lower}),p=e,c="next"===e?"":o}u("next");var f=new e.Collection(e,()=>t3(s[0],l[d-1]+o));f._ondirectionchange=function(e){u(e)};var h=0;return f._addAlgorithm(function(e,n,o){var a=e.key;if("string"!=typeof a)return!1;var u=r(a);if(t(u,l,h))return!0;for(var f=null,m=h;m<d;++m){var g=function(e,t,n,o,a,r){for(var i=Math.min(e.length,o.length),s=-1,l=0;l<i;++l){var p=t[l];if(p!==o[l])return 0>a(e[l],n[l])?e.substr(0,l)+n[l]+n.substr(l+1):0>a(e[l],o[l])?e.substr(0,l)+o[l]+n.substr(l+1):s>=0?e.substr(0,s)+t[s]+n.substr(s+1):null;0>a(e[l],p)&&(s=l)}return i<o.length&&"next"===r?e+n.substr(e.length):i<e.length&&"prev"===r?e.substr(0,n.length):s<0?null:e.substr(0,s)+o[s]+n.substr(s+1)}(a,u,s[m],l[m],i,p);null===g&&null===f?h=m+1:(null===f||i(f,g)>0)&&(f=g)}return n(null!==f?function(){e.continue(f+c)}:o),!1}),f}function t3(e,t,n,o){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:o}}function t5(e){return{type:1,lower:e,upper:e}}class t4{get Collection(){return this._ctx.table.db.Collection}between(e,t,n,o){n=!1!==n,o=!0===o;try{return this._cmp(e,t)>0||0===this._cmp(e,t)&&(n||o)&&(!n||!o)?t1(this):new this.Collection(this,()=>t3(e,t,!n,!o))}catch(e){return t0(this,tD)}}equals(e){return null==e?t0(this,tD):new this.Collection(this,()=>t5(e))}above(e){return null==e?t0(this,tD):new this.Collection(this,()=>t3(e,void 0,!0))}aboveOrEqual(e){return null==e?t0(this,tD):new this.Collection(this,()=>t3(e,void 0,!1))}below(e){return null==e?t0(this,tD):new this.Collection(this,()=>t3(void 0,e,!1,!0))}belowOrEqual(e){return null==e?t0(this,tD):new this.Collection(this,()=>t3(void 0,e))}startsWith(e){return"string"!=typeof e?t0(this,"String expected."):this.between(e,e+tz,!0,!0)}startsWithIgnoreCase(e){return""===e?this.startsWith(e):t2(this,(e,t)=>0===e.indexOf(t[0]),[e],tz)}equalsIgnoreCase(e){return t2(this,(e,t)=>e===t[0],[e],"")}anyOfIgnoreCase(){var e=eu.apply(ed,arguments);return 0===e.length?t1(this):t2(this,(e,t)=>-1!==t.indexOf(e),e,"")}startsWithAnyOfIgnoreCase(){var e=eu.apply(ed,arguments);return 0===e.length?t1(this):t2(this,(e,t)=>t.some(t=>0===e.indexOf(t)),e,tz)}anyOf(){let e=eu.apply(ed,arguments),t=this._cmp;try{e.sort(t)}catch(e){return t0(this,tD)}if(0===e.length)return t1(this);let n=new this.Collection(this,()=>t3(e[0],e[e.length-1]));n._ondirectionchange=n=>{t="next"===n?this._ascending:this._descending,e.sort(t)};let o=0;return n._addAlgorithm((n,a,r)=>{let i=n.key;for(;t(i,e[o])>0;)if(++o===e.length)return a(r),!1;return 0===t(i,e[o])||(a(()=>{n.continue(e[o])}),!1)}),n}notEqual(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){let e=eu.apply(ed,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return t0(this,tD)}let 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){let n=this._cmp,o=this._ascending,a=this._descending,r=this._min,i=this._max;if(0===e.length)return t1(this);if(!e.every(e=>void 0!==e[0]&&void 0!==e[1]&&0>=o(e[0],e[1])))return t0(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",eE.InvalidArgument);let s=!t||!1!==t.includeLowers,l=t&&!0===t.includeUppers,p,c=o;function d(e,t){return c(e[0],t[0])}try{(p=e.reduce(function(e,t){let o=0,a=e.length;for(;o<a;++o){let a=e[o];if(0>n(t[0],a[1])&&n(t[1],a[0])>0){a[0]=r(a[0],t[0]),a[1]=i(a[1],t[1]);break}}return o===a&&e.push(t),e},[])).sort(d)}catch(e){return t0(this,tD)}let u=0,f=l?e=>o(e,p[u][1])>0:e=>o(e,p[u][1])>=0,h=s?e=>a(e,p[u][0])>0:e=>a(e,p[u][0])>=0,m=f,g=new this.Collection(this,()=>t3(p[0][0],p[p.length-1][1],!s,!l));return g._ondirectionchange=e=>{"next"===e?(m=f,c=o):(m=h,c=a),p.sort(d)},g._addAlgorithm((e,t,n)=>{for(var a=e.key;m(a);)if(++u===p.length)return t(n),!1;return!!(!f(a)&&!h(a))||(0===this._cmp(a,p[u][1])||0===this._cmp(a,p[u][0])||t(()=>{c===o?e.continue(p[u][0]):e.continue(p[u][1])}),!1)}),g}startsWithAnyOf(){let e=eu.apply(ed,arguments);return e.every(e=>"string"==typeof e)?0===e.length?t1(this):this.inAnyRange(e.map(e=>[e,e+tz])):t0(this,"startsWithAnyOf() only works with strings")}}function t6(e){return tp(function(t){return t8(t),e(t.target.error),!1})}function t8(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}let t7=tj(null,"storagemutated");class t9{_lock(){return Z(!e2.global),++this._reculock,1!==this._reculock||e2.global||(e2.lockOwnerFor=this),this}_unlock(){if(Z(!e2.global),0==--this._reculock)for(e2.global||(e2.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{tx(e[1],e[0])}catch(e){}}return this}_locked(){return this._reculock&&e2.lockOwnerFor!==this}create(e){if(!this.mode)return this;let t=this.db.idbdb,n=this.db._state.dbOpenError;if(Z(!this.idbtrans),!e&&!t)switch(n&&n.name){case"DatabaseClosedError":throw new eE.DatabaseClosed(n);case"MissingAPIError":throw new eE.MissingAPI(n.message,n);default:throw new eE.OpenFailed(n)}if(!this.active)throw new eE.TransactionInactive;return Z(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=tp(t=>{t8(t),this._reject(e.error)}),e.onabort=tp(t=>{t8(t),this.active&&this._reject(new eE.Abort(e.error)),this.active=!1,this.on("abort").fire(t)}),e.oncomplete=tp(()=>{this.active=!1,this._resolve(),"mutatedParts"in e&&t7.storagemutated.fire(e.mutatedParts)}),this}_promise(e,t,n){if("readwrite"===e&&"readwrite"!==this.mode)return tS(new eE.ReadOnly("Transaction is readonly"));if(!this.active)return tS(new eE.TransactionInactive);if(this._locked())return new e6((o,a)=>{this._blockedFuncs.push([()=>{this._promise(e,t,n).then(o,a)},e2])});if(n)return t_(()=>{var e=new e6((e,n)=>{this._lock();let o=t(e,n,this);o&&o.then&&o.then(e,n)});return e.finally(()=>this._unlock()),e._lib=!0,e});var o=new e6((e,n)=>{var o=t(e,n,this);o&&o.then&&o.then(e,n)});return o._lib=!0,o}_root(){return this.parent?this.parent._root():this}waitFor(e){var t=this._root();let n=e6.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then(()=>n);else{t._waitingFor=n,t._waitingQueue=[];var o=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(o.get(-1/0).onsuccess=e)}()}var a=t._waitingFor;return new e6((e,o)=>{n.then(n=>t._waitingQueue.push(tp(e.bind(null,n))),e=>t._waitingQueue.push(tp(o.bind(null,e)))).finally(()=>{t._waitingFor===a&&(t._waitingFor=null)})})}abort(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new eE.Abort))}table(e){let t=this._memoizedTables||(this._memoizedTables={});if(R(t,e))return t[e];let n=this.schema[e];if(!n)throw new eE.NotFound("Table "+e+" not part of transaction");let o=new this.db.Table(e,n,this);return o.core=this.db.core.table(e),t[e]=o,o}}function ne(e,t,n,o,a,r,i){return{name:e,keyPath:t,unique:n,multi:o,auto:a,compound:r,src:(n&&!i?"&":"")+(o?"*":"")+(a?"++":"")+nt(t)}}function nt(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function nn(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:J(n,e=>[e.name,e])}}let no=e=>{try{return e.only([[]]),no=()=>[[]],[[]]}catch(e){return no=()=>tz,tz}};function na(e){return null==e?()=>{}:"string"==typeof e?1===e.split(".").length?t=>t[e]:t=>X(t,e):t=>X(t,e)}function nr(e){return[].slice.call(e)}let ni=0;function ns(e){return null==e?":id":"string"==typeof e?e:`[${e.join("+")}]`}function nl({_novip:e},t){let n=t.db,o=function(e,t,{IDBKeyRange:n,indexedDB:o},a){var r;return{dbcore:(r=function(e,t,n){let o;function a(e){if(3===e.type)return null;if(4===e.type)throw Error("Cannot convert never type to IDBKeyRange");let{lower:n,upper:o,lowerOpen:a,upperOpen:r}=e;return void 0===n?void 0===o?null:t.upperBound(o,!!r):void 0===o?t.lowerBound(n,!!a):t.bound(n,o,!!a,!!r)}let{schema:r,hasGetAll:i}=(o=nr(e.objectStoreNames),{schema:{name:e.name,tables:o.map(e=>n.objectStore(e)).map(e=>{let{keyPath:t,autoIncrement:n}=e,o=B(t),a=null==t,r={},i={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:a,compound:o,keyPath:t,autoIncrement:n,unique:!0,extractKey:na(t)},indexes:nr(e.indexNames).map(t=>e.index(t)).map(e=>{let{name:t,unique:n,multiEntry:o,keyPath:a}=e,i={name:t,compound:B(a),keyPath:a,unique:n,multiEntry:o,extractKey:na(a)};return r[ns(a)]=i,i}),getIndexByKeyPath:e=>r[ns(e)]};return r[":id"]=i.primaryKey,null!=t&&(r[ns(t)]=i.primaryKey),i})},hasGetAll:o.length>0&&"getAll"in n.objectStore(o[0])&&!("u">typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),s=r.tables.map(e=>{let t;return{name:t=e.name,schema:e,mutate:function({trans:e,type:n,keys:o,values:r,range:i}){return new Promise((s,l)=>{let p;s=tp(s);let c=e.objectStore(t),d=null==c.keyPath,u="put"===n||"add"===n;if(!u&&"delete"!==n&&"deleteRange"!==n)throw Error("Invalid operation type: "+n);let{length:f}=o||r||{length:1};if(o&&r&&o.length!==r.length)throw Error("Given keys array must have same length as given values array.");if(0===f)return s({numFailures:0,failures:{},results:[],lastResult:void 0});let h=[],m=[],g=0,y=e=>{++g,t8(e)};if("deleteRange"===n){if(4===i.type)return s({numFailures:g,failures:m,results:[],lastResult:void 0});3===i.type?h.push(p=c.clear()):h.push(p=c.delete(a(i)))}else{let[e,t]=u?d?[r,o]:[r,null]:[o,null];if(u)for(let o=0;o<f;++o)h.push(p=t&&void 0!==t[o]?c[n](e[o],t[o]):c[n](e[o])),p.onerror=y;else for(let t=0;t<f;++t)h.push(p=c[n](e[t])),p.onerror=y}let b=e=>{let t=e.target.result;h.forEach((e,t)=>null!=e.error&&(m[t]=e.error)),s({numFailures:g,failures:m,results:"delete"===n?o:h.map(e=>e.result),lastResult:t})};p.onerror=e=>{y(e),b(e)},p.onsuccess=b})},getMany:({trans:e,keys:n})=>new Promise((o,a)=>{o=tp(o);let r=e.objectStore(t),i=n.length,s=Array(i),l,p=0,c=0,d=e=>{let t=e.target;s[t._pos]=t.result,++c===p&&o(s)},u=t6(a);for(let e=0;e<i;++e)null!=n[e]&&((l=r.get(n[e]))._pos=e,l.onsuccess=d,l.onerror=u,++p);0===p&&o(s)}),get:({trans:e,key:n})=>new Promise((o,a)=>{o=tp(o);let r=e.objectStore(t).get(n);r.onsuccess=e=>o(e.target.result),r.onerror=t6(a)}),query:e=>new Promise((n,o)=>{n=tp(n);let{trans:r,values:s,limit:l,query:p}=e,c=l===1/0?void 0:l,{index:d,range:u}=p,f=r.objectStore(t),h=d.isPrimaryKey?f:f.index(d.name),m=a(u);if(0===l)return n({result:[]});if(i){let e=s?h.getAll(m,c):h.getAllKeys(m,c);e.onsuccess=e=>n({result:e.target.result}),e.onerror=t6(o)}else{let e=0,t=!s&&"openKeyCursor"in h?h.openKeyCursor(m):h.openCursor(m),a=[];t.onsuccess=o=>{let r=t.result;return r?(a.push(s?r.value:r.primaryKey),++e===l?n({result:a}):void r.continue()):n({result:a})},t.onerror=t6(o)}}),openCursor:function({trans:e,values:n,query:o,reverse:r,unique:i}){return new Promise((s,l)=>{s=tp(s);let{index:p,range:c}=o,d=e.objectStore(t),u=p.isPrimaryKey?d:d.index(p.name),f=r?i?"prevunique":"prev":i?"nextunique":"next",h=!n&&"openKeyCursor"in u?u.openKeyCursor(a(c),f):u.openCursor(a(c),f);h.onerror=t6(l),h.onsuccess=tp(t=>{let n=h.result;if(!n)return void s(null);n.___id=++ni,n.done=!1;let o=n.continue.bind(n),a=n.continuePrimaryKey;a&&(a=a.bind(n));let r=n.advance.bind(n),i=()=>{throw Error("Cursor not stopped")};n.trans=e,n.stop=n.continue=n.continuePrimaryKey=n.advance=()=>{throw Error("Cursor not started")},n.fail=tp(l),n.next=function(){let e=1;return this.start(()=>e--?this.continue():this.stop()).then(()=>this)},n.start=e=>{let t=new Promise((e,t)=>{e=tp(e),h.onerror=t6(t),n.fail=t,n.stop=t=>{n.stop=n.continue=n.continuePrimaryKey=n.advance=i,e(t)}}),s=()=>{if(h.result)try{e()}catch(e){n.fail(e)}else n.done=!0,n.start=()=>{throw Error("Cursor behind last entry")},n.stop()};return h.onsuccess=tp(e=>{h.onsuccess=s,s()}),n.continue=o,n.continuePrimaryKey=a,n.advance=r,s(),t},s(n)},l)})},count({query:e,trans:n}){let{index:o,range:r}=e;return new Promise((e,i)=>{let s=n.objectStore(t),l=o.isPrimaryKey?s:s.index(o.name),p=a(r),c=p?l.count(p):l.count();c.onsuccess=tp(t=>e(t.target.result)),c.onerror=t6(i)})}}}),l={};return s.forEach(e=>l[e.name]=e),{stack:"dbcore",transaction:e.transaction.bind(e),table(e){if(!l[e])throw Error(`Table '${e}' not found`);return l[e]},MIN_KEY:-1/0,MAX_KEY:no(t),schema:r}}(t,n,a),e.dbcore.reduce((e,{create:t})=>({...e,...t(e)}),r))}}(e._middlewares,n,e._deps,t);e.core=o.dbcore,e.tables.forEach(t=>{let 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 np({_novip:e},t,n,o){n.forEach(n=>{let a=o[n];t.forEach(t=>{let o=U(t,n);(!o||"value"in o&&void 0===o.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?W(t,n,{get(){return this.table(n)},set(e){L(this,n,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[n]=new e.Table(n,a))})})}function nc({_novip:e},t){t.forEach(t=>{for(let n in t)t[n]instanceof e.Table&&delete t[n]})}function nd(e,t){return e._cfg.version-t._cfg.version}function nu(e,t){let n,o={del:[],add:[],change:[]};for(n in e)t[n]||o.del.push(n);for(n in t){let a=e[n],r=t[n];if(a){let e={name:n,def:r,recreate:!1,del:[],add:[],change:[]};if(""+(a.primKey.keyPath||"")==""+(r.primKey.keyPath||"")&&(a.primKey.auto===r.primKey.auto||tM)){let t,n=a.idxByName,i=r.idxByName;for(t in n)i[t]||e.del.push(t);for(t in i){let o=n[t],a=i[t];o?o.src!==a.src&&e.change.push(a):e.add.push(a)}(e.del.length>0||e.add.length>0||e.change.length>0)&&o.change.push(e)}else e.recreate=!0,o.change.push(e)}else o.add.push([n,r])}return o}function nf(e,t,n,o){let a=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return o.forEach(e=>nh(a,e)),a}function nh(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function nm(e,t,n){let o={};return H(t.objectStoreNames,0).forEach(e=>{let t=n.objectStore(e),a=t.keyPath,r=ne(nt(a),a||"",!1,!1,!!t.autoIncrement,a&&"string"!=typeof a,!0),i=[];for(let e=0;e<t.indexNames.length;++e){let n=t.index(t.indexNames[e]);a=n.keyPath;var s=ne(n.name,a,!!n.unique,!!n.multiEntry,!1,a&&"string"!=typeof a,!1);i.push(s)}o[e]=nn(e,r,i)}),o}function n_({_novip:e},t,n){let o=n.db.objectStoreNames;for(let a=0;a<o.length;++a){let r=o[a],i=n.objectStore(r);e._hasGetAll="getAll"in i;for(let e=0;e<i.indexNames.length;++e){let n=i.indexNames[e],o=i.index(n).keyPath,a="string"==typeof o?o:"["+H(o).join("+")+"]";if(t[r]){let e=t[r].idxByName[a];e&&(e.name=n,delete t[r].idxByName[a],t[r].idxByName[n]=e)}}}"u">typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&N.WorkerGlobalScope&&N instanceof N.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}class ng{_parseStoresSpec(e,t){T(e).forEach(n=>{if(null!==e[n]){var o=e[n].split(",").map((e,t)=>{let n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),o=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return ne(n,o||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),B(o),0===t)}),a=o.shift();if(a.multi)throw new eE.Schema("Primary key cannot be multi-valued");o.forEach(e=>{if(e.auto)throw new eE.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new eE.Schema("Index must have a name and cannot be an empty string")}),t[n]=nn(n,a,o)}})}stores(e){let t=this.db;this._cfg.storesSource=this._cfg.storesSource?O(this._cfg.storesSource,e):e;let n=t._versions,o={},a={};return n.forEach(e=>{O(o,e._cfg.storesSource),a=e._cfg.dbschema={},e._parseStoresSpec(o,a)}),t._dbSchema=a,nc(t,[t._allTables,t,t.Transaction.prototype]),np(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],T(a),a),t._storeNames=T(a),this}upgrade(e){return this._cfg.contentUpgrade=ej(this._cfg.contentUpgrade||eD,e),this}}function ny(e,t){let n=e._dbNamesDB;return n||(n=e._dbNamesDB=new nI("__dbnames",{addons:[],indexedDB:e,IDBKeyRange:t})).version(1).stores({dbnames:"name"}),n.table("dbnames")}function nb(e){return e&&"function"==typeof e.databases}function nv(e){return t_(function(){return e2.letThrough=!0,e()})}function n$(e){var t=t=>e.next(t),n=a(t),o=a(t=>e.throw(t));function a(e){return t=>{var a=e(t),r=a.value;return a.done?r:r&&"function"==typeof r.then?r.then(n,o):B(r)?Promise.all(r).then(n,o):n(r)}}return a(t)()}function nA(e,t,n){var o=arguments.length;if(o<2)throw new eE.InvalidArgument("Too few arguments");for(var a=Array(o-1);--o;)a[o-1]=arguments[o];return n=a.pop(),[e,en(a),n]}function nk(e,t,n){let o=B(e)?e.slice():[e];for(let e=0;e<n;++e)o.push(t);return o}let nx={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return{...e,table(t){let n=e.table(t),{schema:o}=n,a={},r=[];function i(e,t,n){let o=ns(e),s=a[o]=a[o]||[],l=null==e?0:"string"==typeof e?1:e.length,p=t>0,c={...n,isVirtual:p,keyTail:t,keyLength:l,extractKey:na(e),unique:!p&&n.unique};return s.push(c),c.isPrimaryKey||r.push(c),l>1&&i(2===l?e[0]:e.slice(0,l-1),t+1,n),s.sort((e,t)=>e.keyTail-t.keyTail),c}let s=i(o.primaryKey.keyPath,0,o.primaryKey);for(let e of(a[":id"]=[s],o.indexes))i(e.keyPath,0,e);function l(t){var n,o;let a=t.query.index;return a.isVirtual?{...t,query:{index:a,range:(n=t.query.range,o=a.keyTail,{type:1===n.type?2:n.type,lower:nk(n.lower,n.lowerOpen?e.MAX_KEY:e.MIN_KEY,o),lowerOpen:!0,upper:nk(n.upper,n.upperOpen?e.MIN_KEY:e.MAX_KEY,o),upperOpen:!0})}}:t}return{...n,schema:{...o,primaryKey:s,indexes:r,getIndexByKeyPath:function(e){let t=a[ns(e)];return t&&t[0]}},count:e=>n.count(l(e)),query:e=>n.query(l(e)),openCursor(t){let{keyTail:o,isVirtual:a,keyLength:r}=t.query.index;return a?n.openCursor(l(t)).then(n=>n&&Object.create(n,{continue:{value:function(a){null!=a?n.continue(nk(a,t.reverse?e.MAX_KEY:e.MIN_KEY,o)):t.unique?n.continue(n.key.slice(0,r).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,o)):n.continue()}},continuePrimaryKey:{value(t,a){n.continuePrimaryKey(nk(t,e.MAX_KEY,o),a)}},primaryKey:{get:()=>n.primaryKey},key:{get(){let e=n.key;return 1===r?e[0]:e.slice(0,r)}},value:{get:()=>n.value}})):n.openCursor(t)}}}}}};function nw(e,t,n,o){return n=n||{},o=o||"",T(e).forEach(a=>{if(R(t,a)){var r=e[a],i=t[a];if("object"==typeof r&&"object"==typeof i&&r&&i){let e=el(r);e!==el(i)?n[o+a]=t[a]:"Object"===e?nw(r,i,n,o+a+"."):r!==i&&(n[o+a]=t[a])}else r!==i&&(n[o+a]=t[a])}else n[o+a]=void 0}),T(t).forEach(a=>{R(e,a)||(n[o+a]=t[a])}),n}let nC={stack:"dbcore",name:"HooksMiddleware",level:2,create:e=>({...e,table(t){let n=e.table(t),{primaryKey:o}=n.schema;return{...n,mutate(e){let a=e2.trans,{deleting:r,creating:i,updating:s}=a.table(t).hook;switch(e.type){case"add":if(i.fire===eD)break;return a._promise("readwrite",()=>l(e),!0);case"put":if(i.fire===eD&&s.fire===eD)break;return a._promise("readwrite",()=>l(e),!0);case"delete":if(r.fire===eD)break;return a._promise("readwrite",()=>l(e),!0);case"deleteRange":if(r.fire===eD)break;return a._promise("readwrite",()=>(function e(t,a,r){return n.query({trans:t,values:!1,query:{index:o,range:a},limit:r}).then(({result:n})=>l({type:"delete",keys:n,trans:t}).then(o=>o.numFailures>0?Promise.reject(o.failures[0]):n.length<r?{failures:[],numFailures:0,lastResult:void 0}:e(t,{...a,lower:n[n.length-1],lowerOpen:!0},r)))})(e.trans,e.range,1e4),!0)}return n.mutate(e);function l(e){var t,a;let l=e2.trans,p=e.keys||("delete"===(t=e).type?t.keys:t.keys||t.values.map(o.extractKey));if(!p)throw Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?{...e,keys:p}:{...e}).type&&(e.values=[...e.values]),e.keys&&(e.keys=[...e.keys]),("add"===(a=e).type?Promise.resolve([]):n.getMany({trans:a.trans,keys:p,cache:"immutable"})).then(t=>{let a=p.map((n,a)=>{let p=t[a],c={onerror:null,onsuccess:null};if("delete"===e.type)r.fire.call(c,n,p,l);else if("add"===e.type||void 0===p){let t=i.fire.call(c,n,e.values[a],l);null==n&&null!=t&&(n=t,e.keys[a]=n,o.outbound||Q(e.values[a],o.keyPath,n))}else{let t=nw(p,e.values[a]),o=s.fire.call(c,t,n,p,l);if(o){let t=e.values[a];Object.keys(o).forEach(e=>{R(t,e)?t[e]=o[e]:Q(t,e,o[e])})}}return c});return n.mutate(e).then(({failures:n,results:o,numFailures:r,lastResult:i})=>{for(let r=0;r<p.length;++r){let i=o?o[r]:p[r],s=a[r];null==i?s.onerror&&s.onerror(n[r]):s.onsuccess&&s.onsuccess("put"===e.type&&t[r]?e.values[r]:i)}return{failures:n,results:o,numFailures:r,lastResult:i}}).catch(e=>(a.forEach(t=>t.onerror&&t.onerror(e)),Promise.reject(e)))})}}}}})};function nE(e,t,n){try{if(!t||t.keys.length<e.length)return null;let o=[];for(let a=0,r=0;a<t.keys.length&&r<e.length;++a)0===tH(t.keys[a],e[r])&&(o.push(n?ei(t.values[a]):t.values[a]),++r);return o.length===e.length?o:null}catch(e){return null}}let nS={stack:"dbcore",level:-1,create:e=>({table:t=>{let n=e.table(t);return{...n,getMany:e=>{if(!e.cache)return n.getMany(e);let t=nE(e.keys,e.trans._cache,"clone"===e.cache);return t?e6.resolve(t):n.getMany(e).then(t=>(e.trans._cache={keys:e.keys,values:"clone"===e.cache?ei(t):t},t))},mutate:e=>("add"!==e.type&&(e.trans._cache=null),n.mutate(e))}}})};function nz(e){return!("from"in e)}let nD=function(e,t){if(!this){let t=new nD;return e&&"d"in e&&O(t,e),t}O(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function nP(e,t,n){let o=tH(t,n);if(isNaN(o))return;if(o>0)throw RangeError();if(nz(e))return O(e,{from:t,to:n,d:1});let a=e.l,r=e.r;if(0>tH(n,e.from))return a?nP(a,t,n):e.l={from:t,to:n,d:1,l:null,r:null},nT(e);if(tH(t,e.to)>0)return r?nP(r,t,n):e.r={from:t,to:n,d:1,l:null,r:null},nT(e);0>tH(t,e.from)&&(e.from=t,e.l=null,e.d=r?r.d+1:1),tH(n,e.to)>0&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1);let i=!e.r;a&&!e.l&&nM(e,a),r&&i&&nM(e,r)}function nM(e,t){nz(t)||function e(t,{from:n,to:o,l:a,r:r}){nP(t,n,o),a&&e(t,a),r&&e(t,r)}(e,t)}function nN(e){let t=nz(e)?null:{s:0,n:e};return{next(e){let n=arguments.length>0;for(;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&0>tH(e,t.n.from);)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||0>=tH(e,t.n.to))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 nT(e){var t,n;let o=((null==(t=e.r)?void 0:t.d)||0)-((null==(n=e.l)?void 0:n.d)||0),a=o>1?"r":o<-1?"l":"";if(a){let t="r"===a?"l":"r",n={...e},o=e[a];e.from=o.from,e.to=o.to,e[a]=o[a],n[a]=o[t],e[t]=n,n.d=nB(n)}e.d=nB(e)}function nB({r:e,l:t}){return(e?t?Math.max(e.d,t.d):e.d:t?t.d:0)+1}F(nD.prototype,{add(e){return nM(this,e),this},addKey(e){return nP(this,e,e),this},addKeys(e){return e.forEach(e=>nP(this,e,e)),this},[ep](){return nN(this)}});let nO={stack:"dbcore",level:0,create:e=>{let t=e.schema.name,n=new nD(e.MIN_KEY,e.MAX_KEY);return{...e,table:o=>{let a=e.table(o),{schema:r}=a,{primaryKey:i}=r,{extractKey:s,outbound:l}=i,p={...a,mutate:e=>{let i=e.trans,s=i.mutatedParts||(i.mutatedParts={}),l=e=>{let n=`idb://${t}/${o}/${e}`;return s[n]||(s[n]=new nD)},p=l(""),c=l(":dels"),{type:d}=e,[u,f]="deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[],h=e.trans._cache;return a.mutate(e).then(e=>{if(B(u)){"delete"!==d&&(u=e.results),p.addKeys(u);let t=nE(u,h);t||"add"===d||c.addKeys(u),(t||f)&&r.indexes.forEach(function(e){let n=l(e.name||"");function o(t){return null!=t?e.extractKey(t):null}let a=t=>e.multiEntry&&B(t)?t.forEach(e=>n.addKey(e)):n.addKey(t);(t||f).forEach((e,n)=>{let r=t&&o(t[n]),i=f&&o(f[n]);0!==tH(r,i)&&(null!=r&&a(r),null!=i&&a(i))})})}else if(u){let e={from:u.lower,to:u.upper};c.add(e),p.add(e)}else p.add(n),c.add(n),r.indexes.forEach(e=>l(e.name).add(n));return e})}},c=({query:{index:t,range:n}})=>{var o,a;return[t,new nD(null!=(o=n.lower)?o:e.MIN_KEY,null!=(a=n.upper)?a:e.MAX_KEY)]},d={get:e=>[i,new nD(e.key)],getMany:e=>[i,(new nD).addKeys(e.keys)],count:c,query:c,openCursor:c};return T(d).forEach(e=>{p[e]=function(r){let{subscr:i}=e2;if(i){let p=e=>{let n=`idb://${t}/${o}/${e}`;return i[n]||(i[n]=new nD)},c=p(""),u=p(":dels"),[f,h]=d[e](r);if(p(f.name||"").add(h),!f.isPrimaryKey){if("count"!==e){let t="query"===e&&l&&r.values&&a.query({...r,values:!1});return a[e].apply(this,arguments).then(n=>{if("query"===e){if(l&&r.values)return t.then(({result:e})=>(c.addKeys(e),n));let e=r.values?n.result.map(s):n.result;r.values?c.addKeys(e):u.addKeys(e)}else if("openCursor"===e){let e=r.values;return n&&Object.create(n,{key:{get:()=>(u.addKey(n.primaryKey),n.key)},primaryKey:{get(){let e=n.primaryKey;return u.addKey(e),e}},value:{get:()=>(e&&c.addKey(n.primaryKey),n.value)}})}return n})}u.add(n)}}return a[e].apply(this,arguments)}}),p}}}};class nI{constructor(e,t){var n;this._middlewares={},this.verno=0;const o=nI.dependencies;this._options=t={addons:nI.addons,autoOpen:!0,indexedDB:o.indexedDB,IDBKeyRange:o.IDBKeyRange,...t},this._deps={indexedDB:t.indexedDB,IDBKeyRange:t.IDBKeyRange};const{addons:a}=t;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;const r={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:eD,dbReadyPromise:null,cancelOpen:eD,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};r.dbReadyPromise=new e6(e=>{r.dbReadyResolve=e}),r.openCanceller=new e6((e,t)=>{r.cancelOpen=t}),this._state=r,this.name=e,this.on=tj(this,"populate","blocked","versionchange","close",{ready:[ej,eD]}),this.on.ready.subscribe=K(this.on.ready.subscribe,e=>(t,n)=>{nI.vip(()=>{let o=this._state;if(o.openComplete)o.dbOpenError||e6.resolve().then(t),n&&e(t);else if(o.onReadyBeingFired)o.onReadyBeingFired.push(t),n&&e(t);else{e(t);let o=this;n||e(function e(){o.on.ready.unsubscribe(t),o.on.ready.unsubscribe(e)})}})}),this.Collection=(n=this,tR(tY.prototype,function(e,t){this.db=n;let o=tB,a=null;if(t)try{o=t()}catch(e){a=e}let r=e._ctx,i=r.table,s=i.hook.reading.fire;this._ctx={table:i,index:r.index,isPrimKey:!r.index||i.schema.primKey.keyPath&&r.index===i.schema.primKey.name,range:o,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:a,or:r.or,valueMapper:s!==eP?s:null}})),this.Table=function(e){return tR(tI.prototype,function(t,n,o){this.db=e,this._tx=o,this.name=t,this.schema=n,this.hook=e._allTables[t]?e._allTables[t].hook:tj(null,{creating:[eT,eD],reading:[eM,eP],updating:[eO,eD],deleting:[eB,eD]})})}(this),this.Transaction=function(e){return tR(t9.prototype,function(t,n,o,a,r){this.db=e,this.mode=t,this.storeNames=n,this.schema=o,this.chromeTransactionDurability=a,this.idbtrans=null,this.on=tj(this,"complete","error","abort"),this.parent=r||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 e6((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(),tS(e)})})}(this),this.Version=function(e){return tR(ng.prototype,function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})}(this),this.WhereClause=function(e){return tR(t4.prototype,function(t,n,o){this.db=e,this._ctx={table:t,index:":id"===n?null:n,or:o};let a=e._deps.indexedDB;if(!a)throw new eE.MissingAPI;this._cmp=this._ascending=a.cmp.bind(a),this._descending=(e,t)=>a.cmp(t,e),this._max=(e,t)=>a.cmp(e,t)>0?e:t,this._min=(e,t)=>0>a.cmp(e,t)?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=no(t.IDBKeyRange),this._createTransaction=(e,t,n,o)=>new this.Transaction(e,t,n,this._options.chromeTransactionDurability,o),this._fireOnBlocked=e=>{this.on("blocked").fire(e),tP.filter(e=>e.name===this.name&&e!==this&&!e._state.vcFired).map(t=>t.on("versionchange").fire(e))},this.use(nx),this.use(nC),this.use(nO),this.use(nS),this.vip=Object.create(this,{_vip:{value:!0}}),a.forEach(e=>e(this))}version(e){if(isNaN(e)||e<.1)throw new eE.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new eE.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);let 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(nd),n.stores({}),this._state.autoSchema=!1,n)}_whenReady(e){return this.idbdb&&(this._state.openComplete||e2.letThrough||this._vip)?e():new e6((e,t)=>{if(this._state.openComplete)return t(new eE.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void t(new eE.DatabaseClosed);this.open().catch(eD)}this._state.dbReadyPromise.then(e,t)}).then(e)}use({stack:e,create:t,level:n,name:o}){o&&this.unuse({stack:e,name:o});let a=this._middlewares[e]||(this._middlewares[e]=[]);return a.push({stack:e,create:t,level:null==n?10:n,name:o}),a.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){var t;let n=e._state,{indexedDB:o}=e._deps;if(n.isBeingOpened||e.idbdb)return n.dbReadyPromise.then(()=>n.dbOpenError?tS(n.dbOpenError):e);eh&&(n.openCanceller._stackHolder=eg()),n.isBeingOpened=!0,n.dbOpenError=null,n.openComplete=!1;let a=n.openCanceller;function r(){if(n.openCanceller!==a)throw new eE.DatabaseClosed("db.open() was cancelled")}let i=n.dbReadyResolve,s=null,l=!1;return e6.race([a,("u"<typeof navigator?e6.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(e){var n=function(){return indexedDB.databases().finally(e)};t=setInterval(n,100),n()}).finally(function(){return clearInterval(t)}):Promise.resolve()).then(()=>new e6((t,a)=>{if(r(),!o)throw new eE.MissingAPI;let i=e.name,p=n.autoSchema?o.open(i):o.open(i,Math.round(10*e.verno));if(!p)throw new eE.MissingAPI;p.onerror=t6(a),p.onblocked=tp(e._fireOnBlocked),p.onupgradeneeded=tp(t=>{if(s=p.transaction,n.autoSchema&&!e._options.allowEmptyDB){p.onerror=t8,s.abort(),p.result.close();let e=o.deleteDatabase(i);e.onsuccess=e.onerror=tp(()=>{a(new eE.NoSuchDatabase(`Database ${i} doesnt exist`))})}else{let n,o,i,u;s.onerror=t6(a);var r,c,d=t.oldVersion>0x4000000000000000?0:t.oldVersion;l=d<1,e._novip.idbdb=p.result,r=d/10,c=s,n=e._dbSchema,(o=e._createTransaction("readwrite",e._storeNames,n)).create(c),o._completion.catch(a),i=o._reject.bind(o),u=e2.transless||e2,t_(()=>{e2.trans=o,e2.transless=u,0===r?(T(n).forEach(e=>{nf(c,e,n[e].primKey,n[e].indexes)}),nl(e,c),e6.follow(()=>e.on.populate.fire(o)).catch(i)):(function({_novip:e},t,n,o){let a=[],r=e._versions,i=e._dbSchema=nm(e,e.idbdb,o),s=!1;return r.filter(e=>e._cfg.version>=t).forEach(r=>{a.push(()=>{let a=i,l=r._cfg.dbschema;n_(e,a,o),n_(e,l,o),i=e._dbSchema=l;let p=nu(a,l);p.add.forEach(e=>{nf(o,e[0],e[1].primKey,e[1].indexes)}),p.change.forEach(e=>{if(e.recreate)throw new eE.Upgrade("Not yet support for changing primary key");{let t=o.objectStore(e.name);e.add.forEach(e=>nh(t,e)),e.change.forEach(e=>{t.deleteIndex(e.name),nh(t,e)}),e.del.forEach(e=>t.deleteIndex(e))}});let c=r._cfg.contentUpgrade;if(c&&r._cfg.version>t){let t;nl(e,o),n._memoizedTables={},s=!0;let r=ee(l);p.del.forEach(e=>{r[e]=a[e]}),nc(e,[e.Transaction.prototype]),np(e,[e.Transaction.prototype],T(r),r),n.schema=r;let i=ef(c);i&&tg();let d=e6.follow(()=>{if((t=c(n))&&i){var e=ty.bind(null,null);t.then(e,e)}});return t&&"function"==typeof t.then?e6.resolve(t):d.then(()=>t)}}),a.push(t=>{var o;s&&tM||(o=r._cfg.dbschema,[].slice.call(t.db.objectStoreNames).forEach(e=>null==o[e]&&t.db.deleteObjectStore(e))),nc(e,[e.Transaction.prototype]),np(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),n.schema=e._dbSchema})}),(function e(){return a.length?e6.resolve(a.shift()(n.idbtrans)).then(e):e6.resolve()})().then(()=>{var e;T(e=i).forEach(t=>{o.db.objectStoreNames.contains(t)||nf(o,t,e[t].primKey,e[t].indexes)})})})(e,r,o,c).catch(i)})}},a),p.onsuccess=tp(()=>{s=null;let o=e._novip.idbdb=p.result,a=H(o.objectStoreNames);if(a.length>0)try{let t,r=o.transaction(1===a.length?a[0]:a,"readonly");n.autoSchema?function({_novip:e},t,n){e.verno=t.version/10;let o=e._dbSchema=nm(0,t,n);e._storeNames=H(t.objectStoreNames,0),np(e,[e._allTables],T(o),o)}(e,o,r):(n_(e,e._dbSchema,r),((t=nu(nm(0,e.idbdb,r),e._dbSchema)).add.length||t.change.some(e=>e.add.length||e.change.length))&&console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),nl(e,r)}catch(e){}tP.push(e),o.onversionchange=tp(t=>{n.vcFired=!0,e.on("versionchange").fire(t)}),o.onclose=tp(t=>{e.on("close").fire(t)}),l&&function({indexedDB:e,IDBKeyRange:t},n){nb(e)||"__dbnames"===n||ny(e,t).put({name:n}).catch(eD)}(e._deps,i),t()},a)}))]).then(()=>(r(),n.onReadyBeingFired=[],e6.resolve(nv(()=>e.on.ready.fire(e.vip))).then(function t(){if(n.onReadyBeingFired.length>0){let o=n.onReadyBeingFired.reduce(ej,eD);return n.onReadyBeingFired=[],e6.resolve(nv(()=>o(e.vip))).then(t)}}))).finally(()=>{n.onReadyBeingFired=null,n.isBeingOpened=!1}).then(()=>e).catch(t=>{n.dbOpenError=t;try{s&&s.abort()}catch(e){}return a===n.openCanceller&&e._close(),tS(t)}).finally(()=>{n.openComplete=!0,i()})}(this)}_close(){let e=this._state,t=tP.indexOf(this);if(t>=0&&tP.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new e6(t=>{e.dbReadyResolve=t}),e.openCanceller=new e6((t,n)=>{e.cancelOpen=n})}close(){this._close();let e=this._state;this._options.autoOpen=!1,e.dbOpenError=new eE.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)}delete(){let e=arguments.length>0,t=this._state;return new e6((n,o)=>{let a=()=>{this.close();var e=this._deps.indexedDB.deleteDatabase(this.name);e.onsuccess=tp(()=>{!function({indexedDB:e,IDBKeyRange:t},n){nb(e)||"__dbnames"===n||ny(e,t).delete(n).catch(eD)}(this._deps,this.name),n()}),e.onerror=t6(o),e.onblocked=this._fireOnBlocked};if(e)throw new eE.InvalidArgument("Arguments not allowed in db.delete()");t.isBeingOpened?t.dbReadyPromise.then(a):a()})}backendDB(){return this.idbdb}isOpen(){return null!==this.idbdb}hasBeenClosed(){let e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name}hasFailed(){return null!==this._state.dbOpenError}dynamicallyOpened(){return this._state.autoSchema}get tables(){return T(this._allTables).map(e=>this._allTables[e])}transaction(){let e=nA.apply(this,arguments);return this._transaction.apply(this,e)}_transaction(e,t,n){let o,a,r=e2.trans;r&&r.db===this&&-1===e.indexOf("!")||(r=null);let i=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(a=t.map(e=>{var t=e instanceof this.Table?e.name:e;if("string"!=typeof t)throw TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t}),"r"==e||"readonly"===e)o="readonly";else{if("rw"!=e&&"readwrite"!=e)throw new eE.InvalidArgument("Invalid transaction mode: "+e);o="readwrite"}if(r){if("readonly"===r.mode&&"readwrite"===o){if(!i)throw new eE.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");r=null}r&&a.forEach(e=>{if(r&&-1===r.storeNames.indexOf(e)){if(!i)throw new eE.SubTransaction("Table "+e+" not included in parent transaction.");r=null}}),i&&r&&!r.active&&(r=null)}}catch(e){return r?r._promise(null,(t,n)=>{n(e)}):tS(e)}let s=(function e(t,n,o,a,r){return e6.resolve().then(()=>{let i,s=e2.transless||e2,l=t._createTransaction(n,o,t._dbSchema,a);if(a)l.idbtrans=a.idbtrans;else try{l.create(),t._state.PR1398_maxLoop=3}catch(a){return a.name===eC.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then(()=>e(t,n,o,null,r))):tS(a)}let p=ef(r);p&&tg();let c=e6.follow(()=>{if(i=r.call(l,l))if(p){var e=ty.bind(null,null);i.then(e,e)}else"function"==typeof i.next&&"function"==typeof i.throw&&(i=n$(i))},{trans:l,transless:s});return(i&&"function"==typeof i.then?e6.resolve(i).then(e=>l.active?e:tS(new eE.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))):c.then(()=>i)).then(e=>(a&&l._resolve(),l._completion.then(()=>e))).catch(e=>(l._reject(e),tS(e)))})}).bind(null,this,o,a,r,n);return r?r._promise(o,s,"lock"):e2.trans?tx(e2.transless,()=>this._whenReady(s)):this._whenReady(s)}table(e){if(!R(this._allTables,e))throw new eE.InvalidTable(`Table ${e} does not exist`);return this._allTables[e]}}let nj="u">typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";class nR{constructor(e){this._subscribe=e}subscribe(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})}[nj](){return this}}function nF(e,t){return T(t).forEach(n=>{nM(e[n]||(e[n]=new nD),t[n])}),e}try{o={indexedDB:N.indexedDB||N.mozIndexedDB||N.webkitIndexedDB||N.msIndexedDB,IDBKeyRange:N.IDBKeyRange||N.webkitIDBKeyRange}}catch(e){o={indexedDB:null,IDBKeyRange:null}}function nL(e){let t=nW;try{nW=!0,t7.storagemutated.fire(e)}finally{nW=t}}F(nI,{...ez,delete:e=>new nI(e,{addons:[]}).delete(),exists:e=>new nI(e,{addons:[]}).open().then(e=>(e.close(),!0)).catch("NoSuchDatabaseError",()=>!1),getDatabaseNames(e){try{return(function({indexedDB:e,IDBKeyRange:t}){return nb(e)?Promise.resolve(e.databases()).then(e=>e.map(e=>e.name).filter(e=>"__dbnames"!==e)):ny(e,t).toCollection().primaryKeys()})(nI.dependencies).then(e)}catch(e){return tS(new eE.MissingAPI)}},defineClass:()=>function(e){O(this,e)},ignoreTransaction:e=>e2.trans?tx(e2.transless,e):e(),vip:nv,async:function(e){return function(){try{var t=n$(e.apply(this,arguments));return t&&"function"==typeof t.then?t:e6.resolve(t)}catch(e){return tS(e)}}},spawn:function(e,t,n){try{var o=n$(e.apply(n,t||[]));return o&&"function"==typeof o.then?o:e6.resolve(o)}catch(e){return tS(e)}},currentTransaction:{get:()=>e2.trans||null},waitFor:function(e,t){let n=e6.resolve("function"==typeof e?nI.ignoreTransaction(e):e).timeout(t||6e4);return e2.trans?e2.trans.waitFor(n):n},Promise:e6,debug:{get:()=>eh,set:e=>{eh=e,em="dexie"===e?()=>!0:tN}},derive:V,extend:O,props:F,override:K,Events:tj,on:t7,liveQuery:function(e){return new nR(t=>{let n=ef(e),o=!1,a={},r={},i={get closed(){return o},unsubscribe:()=>{o=!0,t7.storagemutated.unsubscribe(c)}};t.start&&t.start(i);let s=!1,l=!1;function p(){return T(r).some(e=>a[e]&&function(e,t){let n=nN(t),o=n.next();if(o.done)return!1;let a=o.value,r=nN(e),i=r.next(a.from),s=i.value;for(;!o.done&&!i.done;){if(0>=tH(s.from,a.to)&&tH(s.to,a.from)>=0)return!0;0>tH(a.from,s.from)?a=(o=n.next(s.from)).value:s=(i=r.next(a.from)).value}return!1}(a[e],r[e]))}let c=e=>{nF(a,e),p()&&d()},d=()=>{let u,f;if(s||o)return;a={};let h={},m=(n&&tg(),u=()=>t_(e,{subscr:h,trans:null}),f=e2.trans?tx(e2.transless,u):u(),n&&f.then(ty,ty),f);l||(t7("storagemutated",c),l=!0),s=!0,Promise.resolve(m).then(e=>{s=!1,o||(p()?d():(a={},r=h,t.next&&t.next(e)))},e=>{s=!1,t.error&&t.error(e),i.unsubscribe()})};return d(),i})},extendObservabilitySet:nF,getByKeyPath:X,setByKeyPath:Q,delByKeyPath:function(e,t){"string"==typeof t?Q(e,t,void 0):"length"in t&&[].map.call(t,function(t){Q(e,t,void 0)})},shallowClone:ee,deepClone:ei,getObjectDiff:nw,cmp:tH,asap:Y,minKey:-1/0,addons:[],connections:tP,errnames:eC,dependencies:o,semVer:"3.2.2",version:"3.2.2".split(".").map(e=>parseInt(e)).reduce((e,t,n)=>e+t/Math.pow(10,2*n))}),nI.maxKey=no(nI.dependencies.IDBKeyRange),"u">typeof dispatchEvent&&"u">typeof addEventListener&&(t7("storagemutated",e=>{if(!nW){let t;tM?(t=document.createEvent("CustomEvent")).initCustomEvent("x-storagemutated-1",!0,!0,e):t=new CustomEvent("x-storagemutated-1",{detail:e}),nW=!0,dispatchEvent(t),nW=!1}}),addEventListener("x-storagemutated-1",({detail:e})=>{nW||nL(e)}));let nW=!1;if("u">typeof BroadcastChannel){let e=new BroadcastChannel("x-storagemutated-1");t7("storagemutated",t=>{nW||e.postMessage(t)}),e.onmessage=e=>{e.data&&nL(e.data)}}else if("u">typeof self&&"u">typeof navigator){t7("storagemutated",e=>{try{nW||("u">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){}}),"u">typeof addEventListener&&addEventListener("storage",e=>{if("x-storagemutated-1"===e.key){let t=JSON.parse(e.newValue);t&&nL(t.changedParts)}});let e=self.document&&navigator.serviceWorker;e&&e.addEventListener("message",function({data:e}){e&&"x-storagemutated-1"===e.type&&nL(e.changedParts)})}e6.rejectionMapper=function(e,t){if(!e||e instanceof eA||e instanceof TypeError||e instanceof SyntaxError||!e.name||!eS[e.name])return e;var n=new eS[e.name](t||e.message,e);return"stack"in e&&W(n,"stack",{get:function(){return this.inner.stack}}),n},em=tN;var nV=n(30325),nG=n(21013);function nU(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class nq extends nI{constructor(){super("EsmOffline"),nU(this,"syncQueue",void 0),nU(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 nH(){return new nq}let nK=new nq,nZ={},nY=(0,nG.Zd)("offline-synchronization",{});function nJ(){return nY}async function nX(){if(nY.getState().synchronization)return;let e=await nK.syncQueue.count(),t={},n=Object.entries(nZ),o=n.length,a={},r=new AbortController,i=()=>{let e=nY.getState().synchronization;nY.setState({synchronization:{...e,pendingCount:e.pendingCount-1}})};try{nY.setState({synchronization:{totalCount:e,pendingCount:e,abortController:r}});for(let e=0;e<o&&n.length>0;e++)for(let e=n.length;e--;){let[o,s]=n[e],l=s.dependsOn.map(e=>t[e]);l.every(Boolean)&&(a[o]={},await Promise.all(l),t[o]=nQ(s,a,r,i),n.splice(e,1))}await Promise.allSettled(Object.values(t))}finally{nY.setState({synchronization:void 0})}}async function nQ({type:e,dependsOn:t,process:n},o,a,r){let i=[],s=[],l=await n0();await nK.syncQueue.where({type:e,userId:l}).each((e,t)=>{i.push([t.primaryKey,e.content,e.descriptor]),s.push(e.content)});for(let p=0;p<i.length;p++){let[c,d,{id:u,dependencies:f=[]}]=i[p];try{let r=await n(d,{abort:a,index:p,items:s,userId:l,dependencies:f.map(({id:e,type:n})=>t.includes(n)?o[n][e]:void 0)});void 0!==u&&(o[e][u]=r),await nK.syncQueue.delete(c)}catch(e){await nK.syncQueue.update(c,{lastError:{name:e?.name,message:e?.message??e?.toString()}})}finally{r()}}}async function n0(){let e=await (0,nV.xC)();return e?.uuid||"*"}async function n1(e,t,n,o){let a=o&&o.id;return void 0!==a&&await nK.syncQueue.where({type:t,userId:e}).filter(e=>e?.descriptor.id===a).delete().catch(nI.errnames.DatabaseClosed),await nK.syncQueue.add({type:t,content:n,userId:e,descriptor:o||{},createdOn:new Date}).catch(nI.errnames.DatabaseClosed,()=>-1)}async function n2(e,t,n){let o=await n0();return await n1(o,e,t,n)}async function n3(e,t){return(await n5(e,t)).map(e=>e.content)}async function n5(e,t){return await nK.syncQueue.where(t?{type:t,userId:e}:{userId:e}).toArray().catch(nI.errnames.DatabaseClosed,()=>[])}async function n4(e){let t=await n0();return await n3(t,e)}async function n6(e){let t=await n0();return await n5(t,e)}async function n8(e){return await nK.syncQueue.get(e).catch(nI.errnames.DatabaseClosed,()=>void 0)}function n7(e){return!!nZ[e]?.options.onBeginEditSyncItem}async function n9(e){let t=await n8(e);if(!t)throw Error(`No sync item with the ID ${e} exists.`);let n=nZ[t.type]?.options.onBeginEditSyncItem;if(!n)throw 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 "${t.type}" supports editing items.`);n(t)}async function oe(e){await nK.syncQueue.delete(e).catch(nI.errnames.DatabaseClosed)}function ot(e,t,n,o={}){nZ[e]={type:e,dependsOn:t,process:n,options:o}}let on="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),oo=new Uint8Array(16),oa=[];for(let e=0;e<256;++e)oa.push((e+256).toString(16).slice(1));let or=function(e,t,n){if(on&&!t&&!e)return on();let o=(e=e||{}).random||(e.rng||function(){if(!a&&!(a="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return a(oo)})();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=o[e];return t}return function(e,t=0){return oa[e[t+0]]+oa[e[t+1]]+oa[e[t+2]]+oa[e[t+3]]+"-"+oa[e[t+4]]+oa[e[t+5]]+"-"+oa[e[t+6]]+oa[e[t+7]]+"-"+oa[e[t+8]]+oa[e[t+9]]+"-"+oa[e[t+10]]+oa[e[t+11]]+oa[e[t+12]]+oa[e[t+13]]+oa[e[t+14]]+oa[e[t+15]]}(o)},oi="OFFLINE+";function os(){return oi+or()}function ol(e){return e.startsWith(oi)}let op={};function oc(){return Object.values(op)}function od(e){op[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.`),op[e.id]=e}async function ou(e){let t=await ov();return await of(t,e)}async function of(e,t){let n=new nq;return await n.dynamicOfflineData.where(t?{type:t,users:e}:{users:e}).toArray().catch(nI.errnames.DatabaseClosed,()=>[])}async function oh(e,t){let n=await ov();return await om(n,e,t)}async function om(e,t,n){let o=new nq,a=await o.dynamicOfflineData.get({type:t,identifier:n}).catch(nI.errnames.DatabaseClosed,()=>void 0);a?a.users.includes(e)||await o.dynamicOfflineData.update(a.id,{users:[...a.users,e]}).catch(nI.errnames.DatabaseClosed):await o.dynamicOfflineData.add({users:[e],type:t,identifier:n}).catch(nI.errnames.DatabaseClosed)}async function o_(e,t){let n=await ov();return await og(n,e,t)}async function og(e,t,n){let o=new nq,a=await o.dynamicOfflineData.get({type:t,identifier:n,users:e}).catch(nI.errnames.DatabaseClosed,()=>void 0);a&&(a.users.length>1?await o.dynamicOfflineData.update(a.id,{users:a.users.filter(t=>t!==e)}).catch(nI.errnames.DatabaseClosed):await o.dynamicOfflineData.delete(a.id).catch(nI.errnames.DatabaseClosed))}async function oy(e,t){let n=await ou(e);await Promise.all(n.map(async e=>ob(e.type,e.identifier,t)))}async function ob(e,t,n){await oh(e,t);let o=new nq,a=await ov(),r=await o.dynamicOfflineData.get({type:e,identifier:t}).catch(nI.errnames.DatabaseClosed,()=>void 0),i=oc().filter(t=>t.type===e);if(!r)return;let s=await Promise.all(i.map(async e=>{try{return e.sync(t,n),{id:e.id,error:void 0}}catch(n){let t=n.message?.toString()??n.toString();return{id:e.id,error:t}}})),l=s.filter(e=>!e.error).map(e=>e.id),p=s.filter(e=>e.error).map(e=>e.id),c=s.filter(e=>e.error).map(e=>({handlerId:e.id,message:e.error})),d={syncedOn:new Date,syncedBy:a,succeededHandlers:l,erroredHandlers:p,errors:c};r.id&&await o.dynamicOfflineData.update(r.id,{syncState:d}).catch(nI.errnames.DatabaseClosed)}async function ov(){let e=(await (0,nV.xC)()).uuid;if(!e)throw Error("Using the dynamic offline data API requires a logged in user.");return e}let o$=(0,nG.Zd)("offline-patients",{offlinePatientDataSyncState:{},handlers:{}});function oA(){return ow(),o$}function ok(e,t){ow(),od({type:"patient",displayName:t.displayName,id:e,isSynced:()=>Promise.resolve(!0),sync:(e,n)=>t.onOfflinePatientAdded({patientUuid:e,signal:n??new AbortController().signal})})}async function ox(e){ow(),await ob("patient",e)}function ow(){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.")}},91643(e,t,n){"use strict";let o;n.d(t,{fq:()=>e1,JK:()=>P,if:()=>eO,tQ:()=>eU,YY:()=>c,E4:()=>ef,zD:()=>er,g9:()=>N,uL:()=>g,kH:()=>ej,WK:()=>eV,br:()=>b,Gz:()=>e_,M3:()=>eL,qw:()=>eZ,Wq:()=>em,rr:()=>m,oU:()=>eH,wV:()=>eK,d7:()=>ep,Jm:()=>eF,xH:()=>e0,W3:()=>$,zq:()=>i,Ie:()=>H,CH:()=>eb,ns:()=>M,vL:()=>eM,xl:()=>eB,Us:()=>K,UK:()=>ea,fS:()=>q,yJ:()=>ee,u:()=>ey,to:()=>ek,iy:()=>eE,_9:()=>Q,Bf:()=>ez,Tt:()=>J,CX:()=>y,Ed:()=>ev,p6:()=>U,Wr:()=>eR,TA:()=>eI,F7:()=>D,qv:()=>eT,sc:()=>T,WQ:()=>eW,Pj:()=>f,i_:()=>l,$B:()=>eh,oq:()=>eP,wJ:()=>eq,mQ:()=>h,wr:()=>e2,mw:()=>ex,jn:()=>G,Fx:()=>el});var a=n(35399),r=n.n(a);let i=(0,a.createContext)({moduleName:"",featureName:""});var s=n(86236);function l({to:e,templateParams:t,onBeforeNavigate:n,children:o,...i}){return(0,a.useEffect)(()=>{i.href&&console.warn(`ConfigurableLink does not support the href prop. Use the 'to' prop instead. The provided href value is '${i.href}'`),i.onClick&&console.warn(`ConfigurableLink does not support the onClick prop. Use the 'onBeforeNavigate' prop instead. The 'to' prop of the offending link is ${e}`)},[]),r().createElement("a",{onClick:o=>{0===o.button&&!o.ctrlKey&&!o.shiftKey&&!o.altKey&&!o.metaKey&&(o.preventDefault(),n?.(o),(0,s.oo)({to:e,templateParams:t})),0===o.button&&(o.ctrlKey||o.metaKey)&&n?.(o),0===o.button&&o.shiftKey&&n?.(o),1===o.button&&n?.(o)},href:(0,s.JG)(e,t),...i},o)}var p=n(26223);let c=({state:e,children:t,...n})=>{let{extension:o}=(0,a.useContext)(i),s=(0,a.useRef)(null),l=(0,a.useRef)(Promise.resolve()),c=(0,a.useCallback)(t=>{o?.extensionSlotName&&o.extensionSlotModuleName&&o.extensionSlotModuleName&&!s.current&&(0,p.wG)(t,o.extensionSlotName,o.extensionSlotModuleName,o.extensionId,void 0,e).then(e=>{s.current=e})},[]);return(0,a.useEffect)(()=>()=>{if(s&&s.current)switch(s.current.getStatus()){case"MOUNTING":s.current.mountPromise.then(()=>{s.current?.getStatus()==="MOUNTED"&&s.current.unmount()});break;case"MOUNTED":s.current.unmount();break;case"UPDATING":l.current&&l.current.then(()=>{s.current?.getStatus()==="MOUNTED"&&s.current.unmount()})}},[]),(0,a.useEffect)(()=>{s.current&&s.current.update&&"UNMOUNTING"!==s.current.getStatus()&&Promise.all([s.current.mountPromise,l.current]).then(()=>{s?.current?.getStatus()==="MOUNTED"&&s.current.update&&(l.current=s.current.update({...e}).catch(e=>{if(!(e instanceof Error)||!e.message.includes("minified message #32")||s.current?.getStatus()==="MOUNTED")throw e}))})},[e]),o?r().createElement("div",{ref:c,"data-extension-id":o?.extensionId,style:{position:"relative"},...n}):null};function d(e,t){"function"==typeof t&&(t=t(e));let n={};for(let[o,a]of Object.entries(t)){let t=function(...t){e.setState(e=>a(e,...t))};n[o]=t}return n}let u=()=>e=>e;function f(e,t=u(),n){let o=(0,a.useCallback)(t=>e.subscribe(t),[e]),r=(0,a.useCallback)(()=>t(e.getState()),[e,t]),i=(0,a.useSyncExternalStore)(o,r,r),s=(0,a.useMemo)(()=>n?d(e,n):{},[e,n]);return{...i,...s}}function h(e,t){return f(e,u(),t)}function m(e){return function(t){let n=(0,a.useCallback)(t=>e.subscribe(t),[]),o=(0,a.useCallback)(()=>e.getState(),[]),r=(0,a.useSyncExternalStore)(n,o,o),i=(0,a.useMemo)(()=>t?d(e,t):{},[t]);return{...r,...i}}}let g=e=>f((0,p.zF)(),t=>t.slots?.[e]);function y(e){let t=g(e);return t?.assignedExtensions??[]}function b(e,t){let{moduleName:n}=(0,a.useContext)(i),o=(0,a.useRef)(!0);if(!n)throw Error("ComponentContext has not been provided. This should come from @openmrs/esm-react-utils.");return(0,a.useEffect)(()=>{(0,p.FY)(n,e,t),o.current=!1},[]),(0,a.useEffect)(()=>{o.current||(0,p.ap)(e,t)},[e,t]),{extensions:y(e),extensionSlotName:e,extensionSlotModuleName:n}}function v(e){return e}function $({name:e,extensionSlotName:t,select:n=v,children:o,state:s,style:l,...p}){if(o&&s)throw Error("Both children and state have been provided. If children are provided, the state must be passed as a prop to the `Extension` component.");let d=e??t,u=(0,a.useRef)(null),{extensions:f,extensionSlotModuleName:h}=b(d,s),m=(0,a.useMemo)(()=>n(f),[n,f]),g=(0,a.useMemo)(()=>{if("function"==typeof o&&!r().isValidElement(o))return m.map(e=>o(e,s))},[o,m]);return r().createElement("div",{ref:u,"data-extension-slot-name":d,"data-extension-slot-module-name":h,style:{...l,position:"relative"},...p},d&&m?.map((e,t)=>r().createElement(i.Provider,{key:e.id,value:{moduleName:h,featureName:"",extension:{extensionId:e.id,extensionSlotName:d,extensionSlotModuleName:h}}},g?.[t]??("function"!=typeof o?o:null)??r().createElement(c,{state:s}))))}var A=n(25873),k=n(61469),x=n(27807),w=n(71123),C=n(30325);let E={strictMode:!0,throwErrorsToConsole:!0,disableTranslations:!1},S=new Map,z={errorRetryCount:3,fetcher:C.lo,focusThrottleInterval:18e5,revalidateIfStale:!0,revalidateOnFocus:!1,revalidateOnReconnect:!1,refreshInterval:0,shouldRetryOnError:e=>{if(e instanceof C.$f){let t=e.response.status;return!!(t>=500)||401===t||403===t||429===t}return!0},provider:()=>S};function D(e){if("object"!=typeof e||"string"!=typeof e.featureName||"string"!=typeof e.moduleName)throw Error("Invalid options");let t=Object.assign({},E,e),n={...z,...t.swrConfig};return function(e){var o,s,l,p,c;return l=s=class extends(o=r().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().createElement("div",null,"An error has occurred. Please try reloading the page.");{let o=r().createElement(a.Suspense,{fallback:null},r().createElement(w.BE,{value:n},r().createElement(i.Provider,{value:this.state.config},t.disableTranslations?r().createElement(e,this.props):r().createElement(x.I18nextProvider,{i18n:window.i18next,defaultNS:this.state.config.extension?`${this.state.config.moduleName}___${this.state.config.extension.extensionSlotName}___${this.state.config.extension.extensionId}`:this.state.config.moduleName},r().createElement(e,this.props)))));return t.strictMode&&r().StrictMode?r().createElement(r().StrictMode,null,o):o}}constructor(e){super(e),this.state={caughtError:null,caughtErrorInfo:null,config:{moduleName:t.moduleName,featureName:t.featureName,extension:e._extensionContext}}}},p="displayName",c=`OpenmrsReactComponent(${t.featureName})`,p in l?Object.defineProperty(l,p,{value:c,enumerable:!0,configurable:!0,writable:!0}):l[p]=c,s}}function P(e,t){return(0,k.A)({React:r(),ReactDOMClient:A,rootComponent:D(t)(e)})}function M(e,t){return()=>e().then(({default:e})=>P(e,t))}function N(e,t){return()=>Promise.resolve(P(e,t))}let T=M;var B=n(43132),O=n(21013);let I=(0,B.y)()(()=>({}));(0,O.CE)("openmrs-app-context",I);let j={};function R(e,t=e=>e){let n=I.getState();return e in n?Object.freeze(Object.assign({},t?t(n[e]):n[e])):null}function F(e,t){I.setState(n=>(e in n||(n[e]={}),n[e]=t(n[e]),Object.assign({},n)))}function L(e){return null===e?null:Object.freeze(Object.assign({},e))}var W=n(43254);let V=new Map;function G(e,t){let n=(0,a.useRef)(t??{}),o=(0,a.useRef)(t=>F(e,t)),r=(0,a.useRef)(Symbol());return(0,a.useEffect)(()=>{let n=t??{},o=r.current;return null===R(e)?!function(e,t=j){I.setState(n=>{if(e in n)throw Error(`Attempted to re-register namespace ${e} in the app context. Each namespace must be unregistered before the name can be registered again.`);return Object.assign({},n,{[e]:t===j?{}:t})})}(e,n):(console.warn(`Namespace ${e} is already registered in the app context. This is likely a race condition during navigation, but may indicate two components are trying to own the same namespace. Updating the existing context.`),F(e,()=>n)),V.set(e,o),()=>{V.get(e)===o&&(I.setState(t=>(e in t&&delete t[e],t)),V.delete(e))}},[e]),(0,a.useEffect)(()=>{let o=t??{};(0,W.b)(n.current,o)||(F(e,()=>o),n.current=o)},[t]),o.current}function U({namespace:e,value:t}){return G(e,t),null}let q=({children:e,value:t,fallback:n})=>t?r().createElement(r().Fragment,null,e):n?r().createElement(r().Fragment,null,n):null;function H(){let e=(0,a.useRef)();return(!e.current||e.current.signal.aborted)&&(e.current=new AbortController),(0,a.useEffect)(()=>{let t=e.current;return()=>t?.abort()},[]),e.current}function K(e,t=e=>e??{}){let[n,o]=(0,a.useState)(()=>{if(Z(e))return;let n=R(e);if(null!==n)return t?t(n):n});return(0,a.useEffect)(()=>{if(Z(e))throw Error(`The namespace supplied to useAppContext must be a non-empty string, but was "${e}".`)},[e]),(0,a.useEffect)(()=>{var n;let a;return(n=e=>{if(null==e)return void o(void 0);let n=t?t(e):e;o(e=>(0,W.b)(e,n)?e:n)})(L(a=R(e))),I.subscribe(t=>{let o=e in t?t[e]:null;o!==a&&(a=o,n(L(o)))})},[e,t]),n}function Z(e){return"string"!=typeof e||0===e.trim().length}var Y=n(42853);function J(e){let[t,n]=(0,a.useState)([]);return(0,a.useEffect)(()=>(0,p.zF)().subscribe(o=>{let a=o.slots[e]?.assignedExtensions.map(e=>e.id)??[];(0,Y.A)(a,t)||n(a)}),[]),t}var X=n(36289);function Q(e,t){let{data:n,error:o,mutate:r,isLoading:i,isValidating:s}=(0,w.Ay)(`${X.Zu}?patient=${e}&includeEncounterless=${t}`,C.lo);return(0,a.useMemo)(()=>({isLoading:i,data:n?.data.results??[],error:o,mutate:r,isValidating:s}),[n,o,i,s,r])}function ee(e){(0,a.useEffect)(()=>{if(e){let e=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}},[e])}var et=n(33869);let en={},eo=`No ComponentContext has been provided. This should come from "openmrsComponentDecorator".
27
- Usually this is already applied when using "getAsyncLifecycle" or "getSyncLifecycle".`;function ea(e){let{moduleName:t,extension:n}=(0,a.useContext)(i),o=e?.externalModuleName??t;if(!o&&!n)throw Error(eo);let r=function(e){let t=(0,a.useMemo)(()=>(0,et.IS)(e),[e]),n=function(e){let[t,n]=(0,a.useState)(()=>{let t=e.getState();return t.loaded&&t.config?t.config:null});return(0,a.useEffect)(()=>e?.subscribe(e=>{e.loaded&&e.config&&n(e.config)}),[e]),t}(t);if(!n)throw en[e]||(en[e]=new Promise(e=>{let n=t.subscribe(t=>{t.loaded&&t.config&&(e(t.config),n())})})),en[e];return n}(o),s=function(e){let t=(0,a.useMemo)(et.GI,[]),n=function(e,t){let[n,o]=(0,a.useState)(t?()=>{let n=e.getState(),o=(0,et.P0)(n,t.extensionSlotName,t.extensionId);if(o.loaded&&o.config)return o.config}:null);return(0,a.useEffect)(()=>{if(t)return e.subscribe(e=>{let a=(0,et.P0)(e,t.extensionSlotName,t.extensionId);a.loaded&&a.config&&!(0,Y.A)(a.config,n)&&o(a.config)})},[e,t,n]),n}(t,e);if(!n&&e){let n=`${e.extensionSlotName}-${e.extensionId}`;throw!en[n]&&t&&(en[n]=new Promise(n=>{let o=t.subscribe(t=>{let a=(0,et.P0)(t,e.extensionSlotName,e.extensionId);a.loaded&&a.config&&(n(a.config),o())})})),en[n]}return n||{}}(n);return(0,a.useMemo)(()=>e?.externalModuleName&&o===e.externalModuleName?{...r}:{...r,...s},[o,e?.externalModuleName,r,s])}let er=y;var ei=n(4230),es=n(6564);function el(){let[e,t]=(0,a.useState)((0,es.s)());return(0,a.useEffect)(()=>(0,ei.gj)(({online:e})=>t(e)),[]),e}function ep(e,t=300){let[n,o]=(0,a.useState)(e);return(0,a.useEffect)(()=>{let n=setTimeout(()=>{o(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}var ec=n(13660),ed=n.n(ec);let eu=`custom:${[["admissionDecisionConcept","ref"],["admissionEncounterType","ref"],["admissionForm","ref"],["atFacilityVisitType","ref"],["bedAssignmentEncounterType","ref"],["cancelADTRequestEncounterType","ref"],["checkInClerkEncounterRole","ref"],["checkInEncounterType","ref"],["clinicianEncounterRole","ref"],["conceptSourcesForDiagnosisSearch","ref"],["consultEncounterType","ref"],["consultFreeTextCommentsConcept","ref"],["denyAdmissionConcept","ref"],["diagnosisMetadata","ref"],["diagnosisSets","ref"],["dischargeForm","ref"],["dispositionDescriptor","ref"],["dispositions","ref"],["emrApiConceptSource","ref"],["exitFromInpatientEncounterType","ref"],["extraPatientIdentifierTypes","ref"],["fullPrivilegeLevel","ref"],["highPrivilegeLevel","ref"],["identifierTypesToSearch","ref"],["inpatientNoteEncounterType","ref"],["lastViewedPatientSizeLimit","ref"],["metadataSourceName","ref"],["motherChildRelationshipType","ref"],["narrowerThanConceptMapType","ref"],["nonDiagnosisConceptSets","ref"],["orderingProviderEncounterRole","ref"],["patientDiedConcept","ref"],["personImageDirectory","ref"],["primaryIdentifierType","ref"],["sameAsConceptMapType","ref"],["suppressedDiagnosisConcepts","ref"],["supportsAdmissionLocationTag","(uuid,display,name,links)"],["supportsLoginLocationTag","(uuid,display,name,links)"],["supportsTransferLocationTag","(uuid,display,name,links)"],["supportsVisitsLocationTag","(uuid,display,name,links)"],["telephoneAttributeType","ref"],["testPatientPersonAttributeType","ref"],["transferForm","ref"],["transferRequestEncounterType","ref"],["transferWithinHospitalEncounterType","ref"],["unknownCauseOfDeathConcept","ref"],["unknownLocation","ref"],["unknownPatientPersonAttributeType","ref"],["unknownProvider","ref"],["visitAssignmentHandlerAdjustEncounterTimeOfDayIfNecessary","ref"],["visitExpireHours","ref"],["visitNoteEncounterType","ref"]].map(([e,t])=>`${e}:${t}`).join(",")}`;function ef(){let e=`${C.Jj}/emrapi/configuration?v=${eu}`,t=ed()(e,C.lo);return(0,a.useMemo)(()=>({emrConfiguration:t.data?.data,isLoadingEmrConfiguration:t.isLoading,mutateEmrConfiguration:t.mutate,errorFetchingEmrConfiguration:t.error}),[t])}let eh=m((0,p.a9)());function em(e){let t=y(e);return(0,a.useMemo)(()=>Object.fromEntries(t.map(e=>[e.name,e.meta])),[t])}let e_=m((0,p.zF)());var eg=n(25767);function ey(e){let{flags:t}=f(eg.jX);return t[e]?.enabled??!1}function eb(){let[,e]=(0,a.useState)(0);return(0,a.useCallback)(()=>{e(e=>e+1)},[])}function ev(e,t,n={}){return eA(e,t,e$,n)}let e$={getPaginatedUrl:(e,t,n)=>{if(!e)return null;{let o=new URL((0,C.Gm)(e.toString()),window.location.toString());return o.searchParams.set("limit",""+t),o.searchParams.set("startIndex",""+n),o.searchParams.set("totalCount","true"),o.toString()}},getNextUrl:e=>{let t=e?.links?.find(e=>"next"==e.rel)?.uri;if(!t)return null;{let e=new URL(t);return e.host=window.location.host,e.protocol=window.location.protocol,e.toString()}},getTotalCount:e=>e?.totalCount??NaN,getCurrentPageSize:e=>e?.results?.length??NaN,getData:e=>e?.results};function eA(e,t,n,o={}){let{getPaginatedUrl:r,getTotalCount:i,getCurrentPageSize:s,getData:l}=n,{immutable:p,swrConfig:c}=o,d=o.fetcher??C.lo,[u,f]=(0,a.useState)(1),h=(0,a.useRef)(NaN),m=(0,a.useRef)(NaN),g=(u-1)*t,y=(0,a.useMemo)(()=>r(e,t,g),[e,t,g]),{data:b,...v}=(p?ed():w.Ay)(y,d,c);b?.data&&(h.current=i(b?.data),m.current=s(b?.data));let $=Math.ceil(h.current/t),A=(0,a.useCallback)(e=>{0<e&&e<=$?f(e):console.warn("Invalid attempt to go to out of bounds page: "+e)},[e,u,$]),k=(0,a.useCallback)(()=>{A(u+1)},[e,u,$]),x=(0,a.useCallback)(()=>{A(u-1)},[e,u,$]);return{data:l(b?.data),totalPages:$,totalCount:h.current,currentPage:u,currentPageSize:m,paginated:$>1,showNextButton:u<$,showPreviousButton:u>1,goTo:A,goToNext:k,goToPrevious:x,...v}}function ek(e,t,n={}){return eA(e,t,ex(),n)}function ex(){return{getPaginatedUrl:(e,t,n)=>{if(!e)return null;{let o=new URL((0,C.Gm)(e.toString()),window.location.toString());return o.searchParams.set("_count",""+t),o.searchParams.set("_getpagesoffset",""+n),o.toString()}},getNextUrl:e=>{let t=e?.link?.find(e=>"next"==e.relation)?.url;if(!t)return null;{let e=new URL(t);return e.host=window.location.host,e.protocol=window.location.protocol,e.toString()}},getTotalCount:e=>e?.total??NaN,getCurrentPageSize:e=>e?.entry?.length??NaN,getData:e=>e?.entry?.map(e=>e.resource)}}var ew=n(30682),eC=n.n(ew);function eE(e,t={}){return eS(e,e$,t)}function eS(e,t,n={}){let{swrInfiniteConfig:o,immutable:r}=n,{getNextUrl:i,getTotalCount:s,getData:l}=t,p=n.fetcher??C.lo,c=(0,a.useCallback)((n,o)=>0==n?e?.toString()??null:t.getNextUrl(o.data),[e]),{data:d,size:u,setSize:f,...h}=eC()(c,p,{...o,...r?{revalidateIfStale:!1,revalidateOnFocus:!1,revalidateOnReconnect:!1}:{}}),m=i(d?.[d.length-1].data),g=s(d?.[0]?.data);return{data:d?.flatMap(e=>l(e.data)),totalCount:g,hasMore:null!=m,loadMore:()=>{f((d?.length??0)+1)},nextUri:m,...h}}function ez(e,t={}){return eD(e,e$,t)}function eD(e,t,n={}){let o=eS(e,t,n),{hasMore:r,error:i,data:s,loadMore:l,isLoading:p,nextUri:c}=o;return((0,a.useEffect)(()=>{r&&!i&&l()},[r,c]),n.partialData)?o:{...o,data:r||i?void 0:s,isLoading:p||r}}function eP(e,t={}){return eD(e,ex(),t)}function eM(e,t={}){return eS(e,ex(),t)}function eN(){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 eT(){let[e,t]=(0,a.useState)(eN);return(0,a.useEffect)(()=>{let e=()=>{t(eN())};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}let eB=e=>"small-desktop"===e||"large-desktop"===e;function eO(e){let t=(0,a.useContext)(i);(0,a.useEffect)(()=>(t&&t.moduleName&&(e.componentContext=t),(0,p.Vx)(e),()=>{(0,p.sr)(e.name)}),[t,e])}function eI(){return f(p.Gp)}function ej(e=null,t=null){let[n,o]=(0,a.useState)([]);return(0,a.useEffect)(()=>{let n=(0,X.Vs)(e,t).subscribe(e=>{o(e)},e=>{console.error(e)});return()=>n.unsubscribe()},[e,t]),n}function eR(e,t=!0){let n=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let o=o=>{t&&n.current&&o.target&&o.target instanceof Node&&(n.current.contains(o.target)||e(o))};return window.addEventListener("mousedown",o),window.addEventListener("touchstart",o),()=>{window.removeEventListener("mousedown",o),window.removeEventListener("touchstart",o)}},[e,t]),n}function eF(e){let t=(0,a.useRef)();return(0,a.useEffect)(()=>{let n=new IntersectionObserver(t=>{for(let n of t)if(n.isIntersecting)return void e()},{threshold:1});return t.current&&n.observe(t.current),()=>{t.current&&n.unobserve(t.current)}},[t.current,e]),t}function eL(e,t={}){let{abortController:n,fetchInit:o,url:r,swrConfig:i}=t,s=H(),l=(0,a.useMemo)(()=>o?.signal??n?.signal??s.signal,[n?.signal,o?.signal,s.signal]),p=(0,a.useCallback)(e=>{let t=function(e,t){if(t)return"function"==typeof t?t(e):t;if("string"==typeof e)return e;throw Error(`When using useOpenmrsSWR with a key that is not a string, you must provide a url() function that converts the key to a valid url. The key for this hook is ${e}.`)}(e,r);return(0,C.lo)(t,{...o,signal:l})},[l,o,r]);return(0,w.Ay)(e,p,i)}function eW(e=[],t=10){let[n,o]=(0,a.useState)(1),r=(0,a.useMemo)(()=>"number"==typeof t&&t>0?Math.max(1,Math.ceil(e.length/t)):1,[e.length,t]),i=(0,a.useMemo)(()=>{let o=(n-1)*t,a=(n+0)*t;return e.slice(o,a)},[e,n,t]),s=(0,a.useCallback)(e=>{o(Math.max(1,Math.min(r,e)))},[o,r]),l=(0,a.useCallback)(()=>{n<r&&o(n+1)},[n,r,o]),p=(0,a.useCallback)(()=>{n>1&&o(n-1)},[n,o]);return(0,a.useMemo)(()=>({results:i,totalPages:r,currentPage:n,paginated:e.length>t,showNextButton:n<r,showPreviousButton:n>1,goTo:s,goToNext:l,goToPrevious:p}),[i,r,e.length,t,n,s,l,p])}function eV(e,t,n,o){return{pageSizes:(0,a.useMemo)(()=>{let n=Math.ceil(t/e);return isNaN(n)&&(n=0),[...Array(n).keys()].map(t=>(t+1)*e)},[e,t]),pageItemsCount:(0,a.useMemo)(()=>e>t?t:e*n>t?e*(n-1)+o:e*n,[e,t,n,o])}}function eG(){let e=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return e&&e[1]}function eU(e){let[t,n]=(0,a.useState)(e??eG()),{data:o,error:r,isValidating:i}=(0,w.Ay)(t?["patient",t]:null,()=>(0,X.hG)(t,{}));return(0,a.useEffect)(()=>{let e=()=>{let e=eG();e!==t&&n(e)};return window.addEventListener("single-spa:routing-event",e),()=>window.removeEventListener("single-spa:routing-event",e)},[t]),(0,a.useMemo)(()=>({isLoading:i&&!r&&!o,patient:o,patientUuid:t,error:r}),[i,r,o,t])}function eq(){let e=`${C.Jj}/metadatamapping/termmapping?v=custom:(metadataUuid)&code=emr.primaryIdentifierType`,{data:t,error:n,isLoading:o}=(0,w.Ay)(e,C.lo);return(0,a.useMemo)(()=>({primaryIdentifierCode:t?.data?.results[0]?.metadataUuid,isLoading:o,error:n}),[t,n,o])}function eH(e){let{extensions:t,extensionSlotModuleName:n}=b(e);return e?t.map(t=>({state:o})=>r().createElement(i.Provider,{value:{moduleName:n,featureName:"",extension:{extensionId:t.id,extensionSlotName:e,extensionSlotModuleName:n}}},r().createElement(c,{state:o}))):[]}function eK(){let e=(0,a.useRef)(),[t,n]=(0,a.useState)(null),r=null;if(!t){if(o){let e=(0,C.EW)().getState();e.loaded&&(r=e.session)}else o=new Promise(t=>{let n=({loaded:n,session:o})=>{n&&(t(o),r=o,e.current&&(e.current(),e.current=void 0))};n((0,C.EW)().getState()),r||(e.current=(0,C.EW)().subscribe(n))});if(r)n(r);else throw o}(0,a.useEffect)(()=>(e.current||(e.current=(0,C.EW)().subscribe(({loaded:e,session:t})=>{e&&(r=t,n(t))})),()=>{e.current&&(e.current(),e.current=void 0)}),[]);let i=t||r;if(!i)if(o)throw console.warn("useSession is in an unexpected state. Attempting to recover."),o;else throw Error("useSession is in an invalid state.");return i}let eZ=({privilege:e,fallback:t,children:n})=>{let[o,i]=(0,a.useState)(null);return((0,a.useEffect)(()=>{let e=(0,C.HW)({includeAuthStatus:!1}).subscribe(i);return()=>e.unsubscribe()},[]),o&&(0,C.st)(e,o))?r().createElement(r().Fragment,null,n):t?r().createElement(r().Fragment,null,t):null};var eY=n(80222),eJ=n.n(eY),eX=n(85602);let eQ={setVisitContext:(e,t)=>null==t?{manuallySetVisitUuid:null}:{manuallySetVisitUuid:t.uuid,patientUuid:t.patient?.uuid},mutateVisit(e){for(let t of Object.values(e.mutateVisitCallbacks??{}))t();return{}}};function e0(e){let t=(0,a.useId)();return(0,a.useEffect)(()=>{let n=(0,X.BX)();return e&&n.setState({mutateVisitCallbacks:{...n.getState().mutateVisitCallbacks,[t]:e}}),()=>{if(e){let e={...n.getState().mutateVisitCallbacks};delete e[t],n.setState({mutateVisitCallbacks:e})}}},[t,e]),h((0,X.BX)(),eQ)}function e1(e,t=X.Rb){let{patientUuid:n,manuallySetVisitUuid:o,setVisitContext:r}=e0(),i=e&&n==e?o:null,s=`?patient=${e}&v=${t}&includeInactive=false`,l=`/${i}?v=${t}`,{data:p,error:c,mutate:d,isValidating:u}=(0,w.Ay)(e?`${C.Jj}/visit${s}`:null,C.lo),{data:f,error:h,mutate:m,isValidating:g}=(0,w.Ay)(e&&i?`${C.Jj}/visit${l}`:null,C.lo),y=(0,a.useMemo)(()=>p?.data.results.find(e=>null===e.stopDatetime)??null,[p]),b=(0,a.useMemo)(()=>i&&f?f.data:null,[f,i]),v=(0,a.useRef)(null);(0,a.useEffect)(()=>{!u&&y&&n===e&&null===o&&r(y),g||(v.current&&b&&v.current.uuid===b.uuid&&!v.current.stopDatetime&&b.stopDatetime&&r(null),v.current=b)},[b,o,y,u,g,n]);let $=(0,a.useCallback)(()=>{d(),m()},[d,m]);e0($);let A=!!(!p||i&&!f),k=!!(i?h:c);return{error:c||h,mutate:$,isValidating:u||g,activeVisit:y,currentVisit:b,currentVisitIsRetrospective:!!i,isLoading:A&&!k}}function e2(){let[e,t]=(0,a.useState)([]);return(0,a.useEffect)(()=>{let e=(0,X.Pu)().subscribe(e=>{t(e)},e=>console.error(e));return()=>e.unsubscribe()},[]),e}eJ().extend(eX)},21100(e,t,n){"use strict";n.d(t,{o:()=>i});var o=n(85419),a=n(33869);let r=new Map;async function i(e,t){let n=t.indexOf("#"),a=n>=0,r=a?t.substring(0,n):e,i=a?t.substring(n+1):t,p=await (0,o.rL)(r);return p&&Object.hasOwn(p,i)&&"function"==typeof p[i]?l(r,p).then(()=>p[i]()):(p?p&&Object.hasOwn(p,i)?console.warn(`The export ${t}, defined in ${e}'s routes.json, is not a function`):console.warn(`${r} does not define a component called "${i}", referenced in ${e}'s routes.json. This cannot be loaded.`):console.warn(`Unknown app ${r} for ${t} defined in ${e}'s routes.json`),s)}let s={bootstrap:()=>Promise.resolve(),mount:()=>Promise.resolve(),unmount:()=>Promise.resolve()};async function l(e,t){if(e in r)await r[e];else{let n=t??await (0,o.rL)(e);await (r[e]=new Promise((t,o)=>{if(Object.hasOwn(n,"startupApp")){let r=n.startupApp;if("function"==typeof r)return Promise.resolve(r()).then(()=>{(0,a.kl)(e),t(null)}).catch(o)}(0,a.kl)(e),t(null)}))}}},21013(e,t,n){"use strict";n.d(t,{i7:()=>u,jf:()=>d,CE:()=>c,Zd:()=>p});var o=n(43254);function a(e,t){let n;try{n=e()}catch(e){return}return{getItem:e=>{var o;let a=e=>null===e?null:JSON.parse(e,null==t?void 0:t.reviver),r=null!=(o=n.getItem(e))?o:null;return r instanceof Promise?r.then(a):a(r)},setItem:(e,o)=>n.setItem(e,JSON.stringify(o,null==t?void 0:t.replacer)),removeItem:e=>n.removeItem(e)}}let r=e=>t=>{try{let n=e(t);if(n instanceof Promise)return n;return{then:e=>r(e)(n),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>r(t)(e)}}};var i=n(43132);function s(){try{return"u">typeof process&&("true"===process.env.VITEST||void 0!==process.env.JEST_WORKER_ID)||"u">typeof globalThis&&("__vitest_worker__"in globalThis||"__jest__"in globalThis)}catch{return!1}}let l={};function p(e,t,n="none"){let o=l[e];if(o)return o.active?s()||console.error(`Attempted to override the existing store ${e}. Make sure that stores are only created once.`):o.value.setState(t,!0),o.active=!0,o.value;{let o=f(e,t,n);return l[e]={value:o,active:!0},o}}function c(e,t){let n=l[e];return n?(n.active?s()||console.error(`Attempted to override the existing store ${e}. Make sure that stores are only created once.`):n.value=t,n.active=!0,n.value):(l[e]={value:t,active:!0},t)}function d(e,t,n="none"){let o=l[e];if(!o){let o=f(e,t??{},n);return l[e]={value:o,active:!1},o}return o.value}function u(...e){let[t,n,a]=e,r=void 0===a?n:a,i=void 0===a?e=>e:n,s=i(t.getState());return r(s),t.subscribe(e=>{let t=i(e);(0,o.b)(s,t)||(s=t,r(t))})}function f(e,t,n){return"sessionStorage"===n?(0,i.y)()(((e,t)=>{if("getStorage"in t||"serialize"in t||"deserialize"in t)return console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),(n,o,a)=>{let i,s,l={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},p=!1,c=new Set,d=new Set;try{i=l.getStorage()}catch(e){}if(!i)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${l.name}', the given storage is currently unavailable.`),n(...e)},o,a);let u=r(l.serialize),f=()=>{let e,t=u({state:l.partialize({...o()}),version:l.version}).then(e=>i.setItem(l.name,e)).catch(t=>{e=t});if(e)throw e;return t},h=a.setState;a.setState=(e,t)=>{h(e,t),f()};let m=e((...e)=>{n(...e),f()},o,a),g=()=>{var e;if(!i)return;p=!1,c.forEach(e=>e(o()));let t=(null==(e=l.onRehydrateStorage)?void 0:e.call(l,o()))||void 0;return r(i.getItem.bind(i))(l.name).then(e=>{if(e)return l.deserialize(e)}).then(e=>{if(e)if("number"!=typeof e.version||e.version===l.version)return e.state;else{if(l.migrate)return l.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}}).then(e=>{var t;return n(s=l.merge(e,null!=(t=o())?t:m),!0),f()}).then(()=>{null==t||t(s,void 0),p=!0,d.forEach(e=>e(s))}).catch(e=>{null==t||t(void 0,e)})};return a.persist={setOptions:e=>{l={...l,...e},e.getStorage&&(i=e.getStorage())},clearStorage:()=>{null==i||i.removeItem(l.name)},getOptions:()=>l,rehydrate:()=>g(),hasHydrated:()=>p,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(d.add(e),()=>{d.delete(e)})},g(),s||m};return(n,o,i)=>{let s,l={storage:a(()=>localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},p=!1,c=new Set,d=new Set,u=l.storage;if(!u)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${l.name}', the given storage is currently unavailable.`),n(...e)},o,i);let f=()=>{let e=l.partialize({...o()});return u.setItem(l.name,{state:e,version:l.version})},h=i.setState;i.setState=(e,t)=>{h(e,t),f()};let m=e((...e)=>{n(...e),f()},o,i);i.getInitialState=()=>m;let g=()=>{var e,t;if(!u)return;p=!1,c.forEach(e=>{var t;return e(null!=(t=o())?t:m)});let a=(null==(t=l.onRehydrateStorage)?void 0:t.call(l,null!=(e=o())?e:m))||void 0;return r(u.getItem.bind(u))(l.name).then(e=>{if(e)if("number"!=typeof e.version||e.version===l.version)return[!1,e.state];else{if(l.migrate)return[!0,l.migrate(e.state,e.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]}).then(e=>{var t;let[a,r]=e;if(n(s=l.merge(r,null!=(t=o())?t:m),!0),a)return f()}).then(()=>{null==a||a(s,void 0),s=o(),p=!0,d.forEach(e=>e(s))}).catch(e=>{null==a||a(void 0,e)})};return i.persist={setOptions:e=>{l={...l,...e},e.storage&&(u=e.storage)},clearStorage:()=>{null==u||u.removeItem(l.name)},getOptions:()=>l,rehydrate:()=>g(),hasHydrated:()=>p,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(d.add(e),()=>{d.delete(e)})},l.skipHydration||g(),s||m}})(()=>t,{name:e,storage:a(()=>sessionStorage)})):(0,i.y)()(()=>t)}globalThis.setTimeout?.(()=>{"u">typeof window&&"development"===window.spaEnv&&(window.stores=l)},1e3)},60319(e,t,n){"use strict";n.d(t,{V:()=>Z,t:()=>K});let o={address1:"Address line 1",address2:"Address line 2",address3:"Address line 3",address4:"Address line 4",address5:"Address line 5",address6:"Address line 6",city:"City",cityVillage:"City",country:"Country",countyDistrict:"District",district:"District",postalCode:"Postal code",state:"State",stateProvince:"State",closeAllOpenedWorkspaces:"Discard changes in {{count}} workspaces",closingAllWorkspacesPromptBody:"There may be unsaved changes in the following workspaces. Do you want to discard changes in the following workspaces? {{workspaceNames}}",closingAllWorkspacesPromptTitle:"You have unsaved changes",discard:"Discard",hide:"Hide",maximize:"Maximize",minimize:"Minimize",openAnyway:"Open anyway",unsavedChangesInOpenedWorkspace:"You may have unsaved changes in the opened workspace. Do you want to discard these changes?",unsavedChangesInWorkspace:'There may be unsaved changes in "{{workspaceName}}". Please save them before opening another workspace.',unsavedChangesTitleText:"Unsaved changes",workspaceHeader:"Workspace header",closeWorkspaces2PromptTitle:"Close workspace(s)",closeWorkspaces2PromptBody:"You are about to close the following workspace(s), which might have unsaved changes:",abnormalValue:"Abnormal value",actions:"Actions",actionableNotification:"Actionable notification",address:"Address",age:"Age",batchActionItemSelected:"{{totalSelected}} item selected",batchActionsItemsSelected:"{{totalSelected}} items selected",cancel:"Cancel",change:"Change",Clinic:"Clinic",close:"Close",closesActionableNotification:"Close actionable notification",closeSnackbar:"Close snackbar",confirm:"Confirm",contactAdministratorIfIssuePersists:"Contact your system administrator if the problem persists.",contactDetails:"Contact details",delete:"Delete",discardChanges:"Discard changes",edit:"Edit",emptyStateText:"There are no {{displayText}} to display",error:"Error",errorCopy:"Sorry, there was a problem displaying this information. You can try to reload this page, or contact the site administrator and quote the error code above.",errorLoadingLoginLocations:"Unable to load login locations. Please try again or contact support if the problem persists.",female:"Female",leftNavigation:"Left navigation",loading:"Loading",male:"Male",noResultsToDisplay:"No results to display",notAvailable:"Not available",other:"Other",paginationItemsCount:"{{pageItemsCount}} / {{totalItems}} items",paginationOfPages:"of {{count}} pages",patientAvatarAlt:"Avatar for {{patientName}}",patientIdentifierSticker:"Patient identifier sticker",patientLists:"Patient lists",patientPhotoAlt:"Profile photo of {{patientName}}",patientPhotoPlaceholder:"Photo placeholder for {{patientName}}",print:"Print",printError:"Print error",printErrorExplainer:"An error occurred in {{errorLocation}}",printIdentifierSticker:"Print identifier sticker",printing:"Printing",recordNewEntry:"Record {{displayText}}",relationships:"Relationships",resetOverrides:"Reset overrides",save:"Save",scriptLoadingFailed:"Error: Script failed to load",scriptLoadingError:"Failed to load overridden script from {{url}}. Please check that the bundled script is available at the expected URL. Click the button below to reset all import map overrides.",searchForLocation:"Search for a location",seeAll:"See all",seeMoreLists:"See {{count}} more lists",selectAll:"Select all",sex:"Sex",showLess:"Show less",showMore:"Show more",snackbarNotification:"Snackbar notification",toggleDevTools:"Toggle dev tools",unknown:"Unknown",yearAbbreviation:"yr",yearsAbbreviation:"yrs"},a=e=>"string"==typeof e,r=()=>{let e,t,n=new Promise((n,o)=>{e=n,t=o});return n.resolve=e,n.reject=t,n},i=e=>null==e?"":""+e,s=/###/g,l=e=>e&&e.indexOf("###")>-1?e.replace(s,"."):e,p=e=>!e||a(e),c=(e,t,n)=>{let o=a(t)?t.split("."):t,r=0;for(;r<o.length-1;){if(p(e))return{};let t=l(o[r]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++r}return p(e)?{}:{obj:e,k:l(o[r])}},d=(e,t,n)=>{let{obj:o,k:a}=c(e,t,Object);if(void 0!==o||1===t.length){o[a]=n;return}let r=t[t.length-1],i=t.slice(0,t.length-1),s=c(e,i,Object);for(;void 0===s.obj&&i.length;)r=`${i[i.length-1]}.${r}`,s=c(e,i=i.slice(0,i.length-1),Object),s?.obj&&void 0!==s.obj[`${s.k}.${r}`]&&(s.obj=void 0);s.obj[`${s.k}.${r}`]=n},u=(e,t)=>{let{obj:n,k:o}=c(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,o))return n[o]},f=(e,t,n)=>{for(let o in t)"__proto__"!==o&&"constructor"!==o&&(o in e?a(e[o])||e[o]instanceof String||a(t[o])||t[o]instanceof String?n&&(e[o]=t[o]):f(e[o],t[o],n):e[o]=t[o]);return e};var h={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};let m=e=>a(e)?e.replace(/[&<>"'\/]/g,e=>h[e]):e,g=[" ",",","?","!",";"],y=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(void 0!==t)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),b=(e,t,n=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}let o=t.split(n),a=e;for(let e=0;e<o.length;){let t;if(!a||"object"!=typeof a)return;let r="";for(let i=e;i<o.length;++i)if(i!==e&&(r+=n),r+=o[i],void 0!==(t=a[r])){if(["string","number","boolean"].indexOf(typeof t)>-1&&i<o.length-1)continue;e+=i-e+1;break}a=t}return a},v=e=>e?.replace("_","-"),$={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class A{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||$,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,o){return o&&!this.debug?null:(a(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new A(this.logger,{...{prefix:`${this.prefix}:${e}:`},...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new A(this.logger,e)}}var k=new A;class x{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t)return void delete this.observers[e];this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let o=0;o<n;o++)e(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([n,o])=>{for(let a=0;a<o;a++)n.apply(n,[e,...t])})}}class w extends x{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,o={}){let r,i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,s=void 0!==o.ignoreJSONStructure?o.ignoreJSONStructure:this.options.ignoreJSONStructure;e.indexOf(".")>-1?r=e.split("."):(r=[e,t],n&&(Array.isArray(n)?r.push(...n):a(n)&&i?r.push(...n.split(i)):r.push(n)));let l=u(this.data,r);return(!l&&!t&&!n&&e.indexOf(".")>-1&&(e=r[0],t=r[1],n=r.slice(2).join(".")),!l&&s&&a(n))?b(this.data?.[e]?.[t],n,i):l}addResource(e,t,n,o,a={silent:!1}){let r=void 0!==a.keySeparator?a.keySeparator:this.options.keySeparator,i=[e,t];n&&(i=i.concat(r?n.split(r):n)),e.indexOf(".")>-1&&(i=e.split("."),o=t,t=i[1]),this.addNamespaces(t),d(this.data,i,o),a.silent||this.emit("added",e,t,n,o)}addResources(e,t,n,o={silent:!1}){for(let o in n)(a(n[o])||Array.isArray(n[o]))&&this.addResource(e,t,o,n[o],{silent:!0});o.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,o,a,r={silent:!1,skipCopy:!1}){let i=[e,t];e.indexOf(".")>-1&&(i=e.split("."),o=n,n=t,t=i[1]),this.addNamespaces(t);let s=u(this.data,i)||{};r.skipCopy||(n=JSON.parse(JSON.stringify(n))),o?f(s,n,a):s={...s,...n},d(this.data,i,s),r.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var C={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,o,a){return e.forEach(e=>{t=this.processors[e]?.process(t,n,o,a)??t}),t}};let E=Symbol("i18next/PATH_KEY");function S(e,t){let n,o,a,{[E]:r}=e((o=[],(a=Object.create(null)).get=(e,t)=>(n?.revoke?.(),t===E)?o:(o.push(t),(n=Proxy.revocable(e,a)).proxy),Proxy.revocable(Object.create(null),a).proxy));return r.join(t?.keySeparator??".")}let z={},D=e=>!a(e)&&"boolean"!=typeof e&&"number"!=typeof e;class P extends x{constructor(e,t={}){super(),((e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=k.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(null==e)return!1;let o=this.resolve(e,n);if(o?.res===void 0)return!1;let a=D(o.res);return!1!==n.returnObjects||!a}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");let o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,r=t.ns||this.options.defaultNS||[],i=n&&e.indexOf(n)>-1,s=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!((e,t,n)=>{t=t||"",n=n||"";let o=g.filter(e=>0>t.indexOf(e)&&0>n.indexOf(e));if(0===o.length)return!0;let a=y.getRegExp(`(${o.map(e=>"?"===e?"\\?":e).join("|")})`),r=!a.test(e);if(!r){let t=e.indexOf(n);t>0&&!a.test(e.substring(0,t))&&(r=!0)}return r})(e,n,o);if(i&&!s){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:a(r)?[r]:r};let i=e.split(n);(n!==o||n===o&&this.options.ns.indexOf(i[0])>-1)&&(r=i.shift()),e=i.join(o)}return{key:e,namespaces:a(r)?[r]:r}}translate(e,t,n){let o="object"==typeof t?{...t}:t;if("object"!=typeof o&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof o&&(o={...o}),o||(o={}),null==e)return"";"function"==typeof e&&(e=S(e,{...this.options,...o})),Array.isArray(e)||(e=[String(e)]);let r=void 0!==o.returnDetails?o.returnDetails:this.options.returnDetails,i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,{key:s,namespaces:l}=this.extractFromKey(e[e.length-1],o),p=l[l.length-1],c=void 0!==o.nsSeparator?o.nsSeparator:this.options.nsSeparator;void 0===c&&(c=":");let d=o.lng||this.language,u=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()==="cimode")return u?r?{res:`${p}${c}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:p,usedParams:this.getUsedParamsDetails(o)}:`${p}${c}${s}`:r?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:p,usedParams:this.getUsedParamsDetails(o)}:s;let f=this.resolve(e,o),h=f?.res,m=f?.usedKey||s,g=f?.exactUsedKey||s,y=void 0!==o.joinArrays?o.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,v=void 0!==o.count&&!a(o.count),$=P.hasDefaultValue(o),A=v?this.pluralResolver.getSuffix(d,o.count,o):"",k=o.ordinal&&v?this.pluralResolver.getSuffix(d,o.count,{ordinal:!1}):"",x=v&&!o.ordinal&&0===o.count,w=x&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${A}`]||o[`defaultValue${k}`]||o.defaultValue,C=h;b&&!h&&$&&(C=w);let E=D(C),z=Object.prototype.toString.apply(C);if(b&&C&&E&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(z)&&!(a(y)&&Array.isArray(C))){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,C,{...o,ns:l}):`key '${s} (${this.language})' returned an object instead of string.`;return r?(f.res=e,f.usedParams=this.getUsedParamsDetails(o),f):e}if(i){let e=Array.isArray(C),t=e?[]:{},n=e?g:m;for(let e in C)if(Object.prototype.hasOwnProperty.call(C,e)){let a=`${n}${i}${e}`;$&&!h?t[e]=this.translate(a,{...o,defaultValue:D(w)?w[e]:void 0,...{joinArrays:!1,ns:l}}):t[e]=this.translate(a,{...o,joinArrays:!1,ns:l}),t[e]===a&&(t[e]=C[e])}h=t}}else if(b&&a(y)&&Array.isArray(h))(h=h.join(y))&&(h=this.extendTranslation(h,e,o,n));else{let t=!1,a=!1;!this.isValidLookup(h)&&$&&(t=!0,h=w),this.isValidLookup(h)||(a=!0,h=s);let r=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&a?void 0:h,l=$&&w!==h&&this.options.updateMissing;if(a||t||l){if(this.logger.log(l?"updateKey":"missingKey",d,p,s,l?w:h),i){let e=this.resolve(s,{...o,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(o.lng||this.language):e.push(o.lng||this.language);let n=(e,t,n)=>{let a=$&&n!==h?n:r;this.options.missingKeyHandler?this.options.missingKeyHandler(e,p,t,a,l,o):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,p,t,a,l,o),this.emit("missingKey",e,p,t,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&v?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,o);x&&o[`defaultValue${this.options.pluralSeparator}zero`]&&0>t.indexOf(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,o[`defaultValue${t}`]||w)})}):n(e,s,w))}h=this.extendTranslation(h,e,o,f,n),a&&h===s&&this.options.appendNamespaceToMissingKey&&(h=`${p}${c}${s}`),(a||t)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${p}${c}${s}`:s,t?h:void 0,o))}return r?(f.res=h,f.usedParams=this.getUsedParamsDetails(o),f):h}extendTranslation(e,t,n,o,r){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!n.skipInterpolation){let i;n.interpolation&&this.interpolator.init({...n,...{interpolation:{...this.options.interpolation,...n.interpolation}}});let s=a(e)&&(n?.interpolation?.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(s){let t=e.match(this.interpolator.nestingRegexp);i=t&&t.length}let l=n.replace&&!a(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),e=this.interpolator.interpolate(e,l,n.lng||this.language||o.usedLng,n),s){let t=e.match(this.interpolator.nestingRegexp);i<(t&&t.length)&&(n.nest=!1)}!n.lng&&o&&o.res&&(n.lng=this.language||o.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(...e)=>r?.[0]!==e[0]||n.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),n)),n.interpolation&&this.interpolator.reset()}let i=n.postProcess||this.options.postProcess,s=a(i)?[i]:i;return null!=e&&s?.length&&!1!==n.applyPostProcessor&&(e=C.handle(s,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,o,r,i,s;return a(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(n))return;let l=this.extractFromKey(e,t),p=l.key;o=p;let c=l.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));let d=void 0!==t.count&&!a(t.count),u=d&&!t.ordinal&&0===t.count,f=void 0!==t.context&&(a(t.context)||"number"==typeof t.context)&&""!==t.context,h=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach(e=>{this.isValidLookup(n)||(s=e,!z[`${h[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(s)&&(z[`${h[0]}-${e}`]=!0,this.logger.warn(`key "${o}" for languages "${h.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),h.forEach(o=>{let a;if(this.isValidLookup(n))return;i=o;let s=[p];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(s,p,o,e,t);else{let e;d&&(e=this.pluralResolver.getSuffix(o,t.count,t));let n=`${this.options.pluralSeparator}zero`,a=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(t.ordinal&&0===e.indexOf(a)&&s.push(p+e.replace(a,this.options.pluralSeparator)),s.push(p+e),u&&s.push(p+n)),f){let o=`${p}${this.options.contextSeparator||"_"}${t.context}`;s.push(o),d&&(t.ordinal&&0===e.indexOf(a)&&s.push(o+e.replace(a,this.options.pluralSeparator)),s.push(o+e),u&&s.push(o+n))}}for(;a=s.pop();)this.isValidLookup(n)||(r=a,n=this.getResource(o,e,a,t))}))})}),{res:n,usedKey:o,exactUsedKey:r,usedLng:i,usedNS:s}}isValidLookup(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}getResource(e,t,n,o={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,o):this.resourceStore.getResource(e,t,n,o)}getUsedParamsDetails(e={}){let t=e.replace&&!a(e.replace),n=t?e.replace:e;if(t&&void 0!==e.count&&(n.count=e.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!t)for(let e of(n={...n},["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"]))delete n[e];return n}static hasDefaultValue(e){let t="defaultValue";for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}class M{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=k.create("languageUtils")}getScriptPartFromCode(e){if(!(e=v(e))||0>e.indexOf("-"))return null;let t=e.split("-");return 2===t.length||(t.pop(),"x"===t[t.length-1].toLowerCase())?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(!(e=v(e))||0>e.indexOf("-"))return e;let t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(a(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return(t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t)?t:this.options.lowerCaseLng?e.toLowerCase():e}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){let t;return e?(e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let o=this.getLanguagePartFromCode(e);if(this.isSupportedCode(o))return t=o;t=this.options.supportedLngs.find(e=>{if(e===o||!(0>e.indexOf("-")&&0>o.indexOf("-"))&&(e.indexOf("-")>0&&0>o.indexOf("-")&&e.substring(0,e.indexOf("-"))===o||0===e.indexOf(o)&&o.length>1))return e})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),a(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),o=[],r=e=>{e&&(this.isSupportedCode(e)?o.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return a(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&r(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&r(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&r(this.getLanguagePartFromCode(e))):a(e)&&r(this.formatLanguageCode(e)),n.forEach(e=>{0>o.indexOf(e)&&r(this.formatLanguageCode(e))}),o}}let N={zero:0,one:1,two:2,few:3,many:4,other:5},T={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class B{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=k.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n,o=v("dev"===e?"en":e),a=t.ordinal?"ordinal":"cardinal",r=JSON.stringify({cleanedCode:o,type:a});if(r in this.pluralRulesCache)return this.pluralRulesCache[r];try{n=new Intl.PluralRules(o,{type:a})}catch(a){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),T;if(!e.match(/-|_/))return T;let o=this.languageUtils.getLanguagePartFromCode(e);n=this.getRule(o,t)}return this.pluralRulesCache[r]=n,n}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return(n||(n=this.getRule("dev",t)),n)?n.resolvedOptions().pluralCategories.sort((e,t)=>N[e]-N[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,n={}){let o=this.getRule(e,n);return o?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}let O=(e,t,n,o=".",r=!0)=>{let i,s=void 0!==(i=u(e,n))?i:u(t,n);return!s&&r&&a(n)&&void 0===(s=b(e,n,o))&&(s=b(t,n,o)),s};class I{constructor(e={}){this.logger=k.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});let{escape:t,escapeValue:n,useRawValueToEscape:o,prefix:a,prefixEscaped:r,suffix:i,suffixEscaped:s,formatSeparator:l,unescapeSuffix:p,unescapePrefix:c,nestingPrefix:d,nestingPrefixEscaped:u,nestingSuffix:f,nestingSuffixEscaped:h,nestingOptionsSeparator:g,maxReplaces:y,alwaysFormat:b}=e.interpolation;this.escape=void 0!==t?t:m,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==o&&o,this.prefix=a?a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):r||"{{",this.suffix=i?i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):s||"}}",this.formatSeparator=l||",",this.unescapePrefix=p?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":p||"",this.nestingPrefix=d?d.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):u||"$t(".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingSuffix=f?f.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):h||")".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingOptionsSeparator=g||",",this.maxReplaces=y||1e3,this.alwaysFormat=void 0!==b&&b,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,o){let r,s,l,p=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(0>e.indexOf(this.formatSeparator)){let a=O(t,p,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(a,void 0,n,{...o,...t,interpolationkey:e}):a}let a=e.split(this.formatSeparator),r=a.shift().trim(),i=a.join(this.formatSeparator).trim();return this.format(O(t,p,r,this.options.keySeparator,this.options.ignoreJSONStructure),i,n,{...o,...t,interpolationkey:r})};this.resetRegExp();let d=o?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=o?.interpolation?.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>e.replace(/\$/g,"$$$$")},{regex:this.regexp,safeValue:e=>this.escapeValue?this.escape(e).replace(/\$/g,"$$$$"):e.replace(/\$/g,"$$$$")}].forEach(t=>{for(l=0;r=t.regex.exec(e);){let n=r[1].trim();if(void 0===(s=c(n)))if("function"==typeof d){let t=d(e,r,o);s=a(t)?t:""}else if(o&&Object.prototype.hasOwnProperty.call(o,n))s="";else if(u){s=r[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),s="";else a(s)||this.useRawValueToEscape||(s=i(s));let p=t.safeValue(s);if(e=e.replace(r[0],p),u?(t.regex.lastIndex+=s.length,t.regex.lastIndex-=r[0].length):t.regex.lastIndex=0,++l>=this.maxReplaces)break}}),e}nest(e,t,n={}){let o,r,s,l=(e,t)=>{let n=this.nestingOptionsSeparator;if(0>e.indexOf(n))return e;let o=e.split(RegExp(`${n}[ ]*{`)),a=`{${o[1]}`;e=o[0];let r=(a=this.interpolate(a,s)).match(/'/g),i=a.match(/"/g);((r?.length??0)%2!=0||i)&&i.length%2==0||(a=a.replace(/'/g,'"'));try{s=JSON.parse(a),t&&(s={...t,...s})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${a}`}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,e};for(;o=this.nestingRegexp.exec(e);){let p=[];(s=(s={...n}).replace&&!a(s.replace)?s.replace:s).applyPostProcessor=!1,delete s.defaultValue;let c=/{.*}/.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(-1!==c&&(p=o[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),o[1]=o[1].slice(0,c)),(r=t(l.call(this,o[1].trim(),s),s))&&o[0]===e&&!a(r))return r;a(r)||(r=i(r)),r||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${e}`),r=""),p.length&&(r=p.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:o[1].trim()}),r.trim())),e=e.replace(o[0],r),this.regexp.lastIndex=0}return e}}let j=e=>{let t={};return(n,o,a)=>{let r=a;a&&a.interpolationkey&&a.formatParams&&a.formatParams[a.interpolationkey]&&a[a.interpolationkey]&&(r={...r,[a.interpolationkey]:void 0});let i=o+JSON.stringify(r),s=t[i];return s||(s=e(v(o),a),t[i]=s),s(n)}},R=e=>(t,n,o)=>e(v(n),o)(t);class F{constructor(e={}){this.logger=k.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";let n=t.cacheInBuiltFormats?j:R;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=j(t)}format(e,t,n,o={}){let a=t.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&0>a[0].indexOf(")")&&a.find(e=>e.indexOf(")")>-1)){let e=a.findIndex(e=>e.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,e)].join(this.formatSeparator)}return a.reduce((e,t)=>{let{formatName:a,formatOptions:r}=(e=>{let t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){let o=e.split("(");t=o[0].toLowerCase().trim();let a=o[1].substring(0,o[1].length-1);"currency"===t&&0>a.indexOf(":")?n.currency||(n.currency=a.trim()):"relativetime"===t&&0>a.indexOf(":")?n.range||(n.range=a.trim()):a.split(";").forEach(e=>{if(e){let[t,...o]=e.split(":"),a=o.join(":").trim().replace(/^'+|'+$/g,""),r=t.trim();n[r]||(n[r]=a),"false"===a&&(n[r]=!1),"true"===a&&(n[r]=!0),isNaN(a)||(n[r]=parseInt(a,10))}})}return{formatName:t,formatOptions:n}})(t);if(this.formats[a]){let t=e;try{let i=o?.formatParams?.[o.interpolationkey]||{},s=i.locale||i.lng||o.locale||o.lng||n;t=this.formats[a](e,s,{...r,...o,...i})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${a}`),e},e)}}class L extends x{constructor(e,t,n,o={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=o,this.logger=k.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,o.backend,o)}queueLoad(e,t,n,o){let a={},r={},i={},s={};return e.forEach(e=>{let o=!0;t.forEach(t=>{let i=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[i]=2:this.state[i]<0||(1===this.state[i]?void 0===r[i]&&(r[i]=!0):(this.state[i]=1,o=!1,void 0===r[i]&&(r[i]=!0),void 0===a[i]&&(a[i]=!0),void 0===s[t]&&(s[t]=!0)))}),o||(i[e]=!0)}),(Object.keys(a).length||Object.keys(r).length)&&this.queue.push({pending:r,pendingCount:Object.keys(r).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(a),pending:Object.keys(r),toLoadLanguages:Object.keys(i),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let o=e.split("|"),a=o[0],r=o[1];t&&this.emit("failedLoading",a,r,t),!t&&n&&this.store.addResourceBundle(a,r,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let i={};this.queue.forEach(n=>{((e,t,n,o)=>{let{obj:a,k:r}=c(e,t,Object);a[r]=a[r]||[],a[r].push(n)})(n.loaded,[a],r),void 0!==n.pending[e]&&(delete n.pending[e],n.pendingCount--),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{i[e]||(i[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{void 0===i[e][t]&&(i[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",i),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,o=0,a=this.retryTimeout,r){if(!e.length)return r(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:o,wait:a,callback:r});this.readingCalls++;let i=(i,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}i&&s&&o<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,n,o+1,2*a,r)},a):r(i,s)},s=this.backend[n].bind(this.backend);if(2===s.length){try{let n=s(e,t);n&&"function"==typeof n.then?n.then(e=>i(null,e)).catch(i):i(null,n)}catch(e){i(e)}return}return s(e,t,i)}prepareLoading(e,t,n={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();a(e)&&(e=this.languageUtils.toResolveHierarchy(e)),a(t)&&(t=[t]);let r=this.queueLoad(e,t,n,o);if(!r.toLoad.length)return r.pending.length||o(),null;r.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){let n=e.split("|"),o=n[0],a=n[1];this.read(o,a,"read",void 0,void 0,(n,r)=>{n&&this.logger.warn(`${t}loading namespace ${a} for language ${o} failed`,n),!n&&r&&this.logger.log(`${t}loaded namespace ${a} for language ${o}`,r),this.loaded(e,n,r)})}saveMissing(e,t,n,o,a,r={},i=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t))return void this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");if(null!=n&&""!==n){if(this.backend?.create){let s={...r,isUpdate:a},l=this.backend.create.bind(this.backend);if(l.length<6)try{let a;(a=5===l.length?l(e,t,n,o,s):l(e,t,n,o))&&"function"==typeof a.then?a.then(e=>i(null,e)).catch(i):i(null,a)}catch(e){i(e)}else l(e,t,n,o,i,s)}e&&e[0]&&this.store.addResource(e[0],t,n,o)}}}let W=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),a(e[1])&&(t.defaultValue=e[1]),a(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),V=e=>(a(e.ns)&&(e.ns=[e.ns]),a(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),a(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),G=()=>{};class U extends x{constructor(e={},t){if(super(),this.options=V(e),this.services={},this.logger=k,this.modules={external:[]},(e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{"function"==typeof e[t]&&(e[t]=e[t].bind(e))})})(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(a(e.ns)?e.defaultNS=e.ns:0>e.ns.indexOf("translation")&&(e.defaultNS=e.ns[0]));let n=W();this.options={...n,...this.options,...V(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator);let o=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?k.init(o(this.modules.logger),this.options):k.init(null,this.options),e=this.modules.formatter?this.modules.formatter:F;let t=new M(this.options);this.store=new w(this.options.resources,this.options);let a=this.services;a.logger=k,a.resourceStore=this.store,a.languageUtils=t,a.pluralResolver=new B(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),e&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(a.formatter=o(e),a.formatter.init&&a.formatter.init(a,this.options),this.options.interpolation.format=a.formatter.format.bind(a.formatter)),a.interpolator=new I(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new L(o(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(a.languageDetector=o(this.modules.languageDetector),a.languageDetector.init&&a.languageDetector.init(a,this.options.detection,this.options)),this.modules.i18nFormat&&(a.i18nFormat=o(this.modules.i18nFormat),a.i18nFormat.init&&a.i18nFormat.init(this)),this.translator=new P(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=G),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let i=r(),s=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),i.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?s():setTimeout(s,0),i}loadResources(e,t=G){let n=t,o=a(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(o?.toLowerCase()==="cimode"&&(!this.options.preload||0===this.options.preload.length))return n();let e=[],t=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&0>e.indexOf(t)&&e.push(t)})};o?t(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let o=r();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=G),this.services.backendConnector.reload(e,t,e=>{o.resolve(),n(e)}),o}use(e){if(!e)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&C.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&0>this.languages.indexOf(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=r();this.emit("languageChanging",e);let o=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(a,r)=>{r?this.isLanguageChangingTo===e&&(o(r),this.translator.changeLanguage(r),this.isLanguageChangingTo=void 0,this.emit("languageChanged",r),this.logger.log("languageChanged",r)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(a,(...e)=>this.t(...e))},s=t=>{e||t||!this.services.languageDetector||(t=[]);let n=a(t)?t:t&&t[0],r=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(a(t)?[t]:t);r&&(this.language||o(r),this.translator.language||this.translator.changeLanguage(r),this.services.languageDetector?.cacheUserLanguage?.(r)),this.loadResources(r,e=>{i(e,r)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(e):s(this.services.languageDetector.detect()),n}getFixedT(e,t,n){let o=(e,t,...a)=>{let r,i;(r="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(a)):{...t}).lng=r.lng||o.lng,r.lngs=r.lngs||o.lngs,r.ns=r.ns||o.ns,""!==r.keyPrefix&&(r.keyPrefix=r.keyPrefix||n||o.keyPrefix);let s=this.options.keySeparator||".";return r.keyPrefix&&Array.isArray(e)?i=e.map(e=>("function"==typeof e&&(e=S(e,{...this.options,...t})),`${r.keyPrefix}${s}${e}`)):("function"==typeof e&&(e=S(e,{...this.options,...t})),i=r.keyPrefix?`${r.keyPrefix}${s}${e}`:e),this.t(i,r)};return a(e)?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=n,o}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],o=!!this.options&&this.options.fallbackLng,a=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;let r=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return -1===n||0===n||2===n};if(t.precheck){let e=t.precheck(this,r);if(void 0!==e)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||r(n,e)&&(!o||r(a,e)))}loadNamespaces(e,t){let n=r();return this.options.ns?(a(e)&&(e=[e]),e.forEach(e=>{0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=r();a(e)&&(e=[e]);let o=this.options.preload||[],i=e.filter(e=>0>o.indexOf(e)&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=o.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}let t=this.services?.languageUtils||new M(W());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new U(e,t)}cloneInstance(e={},t=G){let n=e.forkResourceStore;n&&delete e.forkResourceStore;let o={...this.options,...e,isClone:!0},a=new U(o);return(void 0!==e.debug||void 0!==e.prefix)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n&&(a.store=new w(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,o)=>(n[o]={...e[t][o]},n),e[t]),e),{}),o),a.services.resourceStore=a.store),a.translator=new P(a.services,o),a.translator.on("*",(e,...t)=>{a.emit(e,...t)}),a.init(o,t),a.translator.options=o,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}let q=U.createInstance();q.createInstance=U.createInstance,q.createInstance,q.dir,q.init,q.loadResources,q.reloadResources,q.use,q.changeLanguage,q.getFixedT,q.t,q.exists,q.setDefaultNamespace,q.hasLoadedNamespace,q.loadNamespaces,q.loadLanguages;let H=q.default||q;function K(e,t,n,o){return H.t(t,{ns:e,defaultValue:n,...o})}function Z(e,t,n){return o[e]?K("core",e,t??o[e],n):(console.error(`O3 Core Translations does not provide key '${e}'. The key itself is being rendered as text.`),e)}H.on("initialized",function(){window.i18next.loadNamespaces(["core"])})},75415(e,t,n){"use strict";n.d(t,{C:()=>i,K:()=>s});var o=n(80222),a=n.n(o),r=n(85740);function i(e,t=a()()){let n=a()(t),o=(0,r.qE)(e,n);if(null==o)return null;let s=n.diff(o,"hours"),l=n.diff(o,"days"),p=n.diff(o,"weeks"),c=n.diff(o,"months"),d=n.diff(o,"years"),u={};if(s<2)u.minutes=n.diff(o,"minutes");else if(l<2)u.hours=s;else if(p<4)u.days=l;else if(d<1){let e=n.subtract(p,"weeks").diff(o,"days");u.weeks=p,u.days=e}else if(d<2){let e=n.subtract(c,"months").diff(o,"days");u.months=c,u.days=e}else if(d<18){let e=n.subtract(d,"year").diff(o,"months");u.years=d,u.months=e}else u.years=d;return u}function s(e,t=a()()){let n=i(e,t);if(null==n)return null;let o={style:"short",localeMatcher:"lookup"};return"minutes"in n&&0===n.minutes&&(o.minutesDisplay="always"),(0,r.a3)(n,o)}},85740(e,t,n){"use strict";n.d(t,{g2:()=>ef,vU:()=>U,XE:()=>J,a3:()=>ei,LW:()=>ee,a7:()=>X,Yq:()=>et,hl:()=>G,fU:()=>eo,_U:()=>K,d4:()=>er,l0:()=>H,p0:()=>ed,kQ:()=>q,qE:()=>es,Rt:()=>ea});var o,a=n(13174),r=n(19647);if("u">typeof navigator){let e=navigator;o=Array.isArray(e.languages)?e.languages[0]:e.language}else if("u">typeof process){let e=process.env;o=e.LC_ALL||e.LC_MESSAGES||e.LANG||e.LANGUAGE}var i=function(e){e=(e=e.replace(/_/g,"-")).replace(/[.:][\w-]*$/,"");try{return new Intl.Locale(e).baseName}catch{return"en-US"}}(o||"en-US"),s=class extends Date{invalid=null;isValid(){return!Number.isNaN(this.valueOf())}},l={};for(let e=1;e<100;e++)l[(e<=9?"0":"")+e]=e+(e>51?1900:2e3);var p={arab:1632,arabext:1776,bali:6992,beng:2534,deva:2406,fullwide:65296,gujr:2790,khmr:6112,knda:3302,laoo:3792,limb:6470,mlym:3430,mong:6160,mymr:4160,orya:2918,tamldec:3046,telu:3174,thai:3664,tibt:3872},c="[1234567890一二三四五六七八九〇\\d]",d={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,"0":0,"1":1,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9,〇:0,一:1,二:2,三:3,四:4,五:5,六:6,七:7,八:8,九:9},u={},f={"Eastern Daylight Time":-240,"Eastern Standard Time":-300,"Central Daylight Time":-300,"Central Standard Time":-360,"Mountain Daylight Time":-360,"Mountain Standard Time":-420,"Pacific Daylight Time":-420,"Pacific Standard Time":-480,"Coordinated Universal Time":0,ACDT:630,ACST:570,ACT:480,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,AMST:-180,AMT:-240,ART:-180,AST:180,AWDT:540,AWST:480,AZOST:-60,AZT:240,BDT:360,BIOT:360,BIT:-720,BOT:-240,BRST:-120,BRT:-180,BTT:360,CAT:120,CCT:390,CDT:-300,CEDT:120,CEST:120,CET:60,CHADT:825,CHAST:765,CHOT:480,ChST:600,CHUT:600,CIST:-480,CIT:480,CKT:-600,CLST:-180,CLT:-240,COST:-240,COT:-300,CST:-360,CT:480,CVT:-60,CXT:420,DAVT:420,DDUT:600,DFT:60,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEDT:180,EEST:180,EET:120,EGST:0,EGT:-60,EIT:540,EST:-300,FET:180,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GIT:-540,GMT:0,GST:-120,GYT:-240,HADT:-540,HAEC:120,HAST:-600,HKT:480,HMT:300,HOVT:420,HST:-600,IBST:0,ICT:420,IDT:180,IOT:180,IRDT:270,IRKT:480,IRST:210,IST:120,JST:540,KGT:360,KOST:660,KRAT:420,KST:540,LHST:630,LINT:840,MAGT:720,MART:-510,MAWT:300,MDT:-360,MET:60,MEST:120,MHT:720,MIST:660,MIT:-510,MMT:390,MSK:180,MST:-420,MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:660,NPT:345,NST:-150,NT:-150,NUT:-660,NZDT:780,NZST:720,OMST:360,ORAT:300,PDT:-420,PET:-300,PETT:720,PGT:600,PHOT:780,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PYST:-180,PYT:-240,RET:240,ROTT:-180,SAKT:660,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SLST:330,SRET:660,SRT:-180,SST:480,SYOT:180,TAHT:-600,THA:420,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TOT:780,TVT:720,UCT:0,ULAT:480,USZ1:120,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-240,VLAT:600,VOLT:240,VOST:360,VUT:660,WAKT:720,WAST:120,WAT:60,WEDT:60,WEST:60,WET:0,WIT:420,WST:480,YAKT:540,YEKT:300},h={zone:f,year:l,meridiem:{am:0,pm:12,"a.m.":0,"p.m.":12},month:{january:1,jan:1,february:2,feb:2,march:3,mar:3,april:4,apr:4,may:5,june:6,jun:6,july:7,jul:7,august:8,aug:8,september:9,sep:9,october:10,oct:10,november:11,nov:11,december:12,dec:12},dayname:{sunday:0,sun:0,monday:1,mon:1,tuesday:2,tue:2,wednesday:3,wed:3,thursday:4,thu:4,friday:5,fri:5,saturday:6,sat:6},digit:{}},m={MONTHNAME:"january|february|march|april|may|june|july|august|september|october|november|december|jan\\.?|feb\\.?|mar\\.?|apr\\.?|may\\.?|jun\\.?|jul\\.?|aug\\.?|sep\\.?|oct\\.?|nov\\.?|dec\\.?",DAYNAME:"sunday|monday|tuesday|wednesday|thursday|friday|saturday|sun\\.?|mon\\.?|tue\\.?|wed\\.?|thu\\.?|fri\\.?|sat\\.?",ZONE:"\\(?(?:"+Object.keys(f).join("|")+")\\)?",MERIDIEM:"am|pm|a.m.|p.m.",ORDINAL:"st|nd|rd|th|\\.",YEAR:"\\d{4}|\\d{2}",YEAR2:"\\d{2}",YEAR4:"\\d{4}",YEAR6:"-\\d{6}|\\+?\\d{5,6}",MONTH:"1[0-2]|0?[1-9]",MONTH2:"1[0-2]|0[1-9]",DAY:"3[01]|[12]\\d|0?[1-9]",DAY2:"3[01]|[12]\\d|0[1-9]",OFFSET:"(?:GMT)?[\xb1−+-](?:[01]\\d[0-5]\\d|[01]\\d:[0-5]\\d|[01]?\\d)",H24:"[01]\\d|2[0-3]",H12:"0?[1-9]|1[012]",MIN:"[0-5]\\d",SEC:"[0-5]\\d|60",MS:"\\d{9}|\\d{6}|\\d{1,3}",GAP:"[\\s/.,-]{1,}"},g={...m,YEAR:"*{4}|*{2}",YEAR4:"*{4}",YEAR6:"-*{6}|\\+?*{5,6}",MONTH:"*{1,2}",MONTH2:"*{2}",DAY:"*{1,2}",DAY2:"*{2}",OFFSET:"(?:GMT)?[\xb1−+-](?:*{4}|*{2}:*{2}|*{1,2})",H24:"*{2}",H12:"*{1,2}",MIN:"*{2}",SEC:"*{2}",MS:"*{9}|*{6}|*{3}"},y={},b=class e{locale;lookups;vars;numberingSystem;baseName;dateOptions;static factory(t=i){return y[t.toLowerCase()]||(y[t.toLowerCase()]=new e(t)),y[t.toLowerCase()]}constructor(e=i){this.locale=e,this.lookups={...h},this.vars={...m};let t=new Intl.NumberFormat(this.locale);this.numberingSystem=t.resolvedOptions().numberingSystem,this.dateOptions=new Intl.DateTimeFormat(this.locale).resolvedOptions(),this.baseName=new Intl.Locale(this.locale).baseName,this.build()}toInt(e){if("number"==typeof e)return e;if("string"!=typeof e)return;if("latn"===this.numberingSystem&&!this.baseName.startsWith("zh")){let t=parseInt(e,10);if(!isNaN(t))return t}let t="";for(let n=0;n<e.length;n++)t+=String(this.lookups.digit[e[n]]);return parseInt(t,10)}millisecondToInt(e){if("number"==typeof e)return e;if("string"!=typeof e)return;let t=e.slice(0,3);return 1===t.length?100*this.toInt(t):2===t.length?10*this.toInt(t):this.toInt(t)}monthNameToInt(e){if("string"!=typeof e)return;let t=e.toLocaleLowerCase(this.locale).replace(/\.$/,"");return this.lookups.month[t]||12}h12ToInt(e,t){if("string"!=typeof e)return;let n=this.lookups.meridiem[t?.toLowerCase()]||0,o=this.toInt(e);return o<12&&12===n&&(o+=12),12===o&&0===n&&(o=0),o}zoneToOffset(e){if("string"==typeof e)return e=e.replace(/[^a-z\s]/gi,""),this.lookups.zone[e]}offsetToMinutes(e){if("string"!=typeof e)return;let t=e.match(/^(?:GMT)?([±−+-])(..?):?(..)?$/);if(t){let[,e,n,o]=t;return("-"===e||"−"===e?-1:1)*(60*this.toInt(n)+this.toInt(o||0))}return 0}build(){"latn"===this.dateOptions.numberingSystem?this.lookups.digit=d:this.buildNumbers(),/^en/i.test(this.locale)||(this.buildMonthNames(),this.buildDaynames(),/zh/i.test(this.locale)||this.buildMeridiems())}buildNumbers(){let{group:e,lookup:t}=function(e){if(u[e])return u[e];if("fullwide"===e||"hanidec"===e)return{group:c,lookup:{...d}};let t=p[e];if(!t)return{group:"\\d",lookup:{...d}};let n=String.fromCharCode(t),o=String.fromCharCode(t+9),a={};for(let e=0;e<10;e++)a[String.fromCharCode(t+e)]=e;return u[e]={group:`[${n}-${o}]`,lookup:a},u[e]}(this.numberingSystem);for(let n in this.lookups.digit=t,g)g.hasOwnProperty(n)&&(this.vars[n]=g[n].replace(/\*/g,e))}buildMonthNames(){let e={},t={};if(/^fi/i.test(this.locale))"tammi|helmi|maalis|huhti|touko|kes\xe4|hein\xe4|elo|syys|loka|marras|joulu".split("|").forEach((n,o)=>{["","k","kuu","kuuta"].forEach((a,r)=>{e[n+a+(r<2?"\\.?":"")]=!0,t[n+a]=o+1})});else{let n=[],o=e=>"month"===e.type;for(let e=0;e<12;e++)n.push(new Date(2017,e,1));for(let a of["full","long","medium"]){let r=Intl.DateTimeFormat(this.locale,{dateStyle:a});for(let i=0;i<12;i++){let s=r.formatToParts(n[i]).find(o).value.toLocaleLowerCase(this.locale);/^\d+$/.test(s)||(/^ko/i.test(this.locale)&&(s+="월"),"medium"===a?(s=s.replace(/\.$/,""),e[`${s}\\.?`]=!0):e[s]=!0,t[s]=i+1)}}let a=Intl.DateTimeFormat(this.locale,{month:"short"});for(let r=0;r<12;r++){let i=a.formatToParts(n[r]).find(o).value.toLocaleLowerCase(this.locale);i=i.replace(/\.$/,""),e[`${i}\\.?`]=!0,t[i]=r+1}}this.vars.MONTHNAME=Object.keys(e).join("|"),this.lookups.month=t}buildDaynames(){let e=[],t=e=>"weekday"===e.type;for(let t=0;t<7;t++)e.push(new Date(2017,0,t+1));let n=[],o={};for(let a of["long","short"]){let r=Intl.DateTimeFormat(this.locale,{weekday:a});for(let i=0;i<7;i++){let s=r.formatToParts(e[i]).find(t).value.toLocaleLowerCase(this.locale);"short"===a?(s=s.replace(/\.$/,""),n.push(`${s}\\.?`)):n.push(s),o[s]=i}}this.vars.DAYNAME=n.join("|"),this.lookups.dayname=o}buildMeridiems(){let e=[new Date(2017,0,1),new Date(2017,0,1,23,0,0)],t=e=>"dayPeriod"===e.type,n=[],o={},a=Intl.DateTimeFormat(this.locale,{timeStyle:"long"});for(let r=0;r<2;r++){let i=a.formatToParts(e[r]).find(t);if(!i)return;let s=i.value.toLocaleLowerCase(this.locale);n.push(s),o[s]=12*r}this.vars.MERIDIEM=n.join("|"),this.lookups.meridiem=o}compile(e){return RegExp(e.replace(/_([A-Z0-9]+)_/g,(e,t)=>{if(!this.vars[t])throw Error(`Template string contains invalid variable _${t}_`);return this.vars[t]}),"i")}},v=["ee-TG","en-AS","en-CA","en-FM","en-GH","en-GU","en-KE","en-KY","en-MH","en-MP","en-US","en-VI","en-WS","jp-JP","sm-AS","sm-SM"],$={y:"year",M:"month",d:"day",w:"week",h:"hour",m:"minute",s:"second",ms:"millisecond"},A=()=>new Date;function k(e){return function(t){let n={};for(let o=0,a=e.length;o<a;o++){let a=e[o];a&&(n[a]=t[o])}return n}}var x=class{doneChecker;fallback;patterns;formatter;constructor({doneChecker:e,fallback:t,patterns:n,formatter:o}){this.doneChecker=e,this.fallback=t,this.patterns=n,this.formatter=o}attempt(e){if("string"!=typeof e)return this.fallback(e);let t=e.trim(),n={},o=!1;for(let e of this.patterns){let a=t.match(e.regex);if(!a)continue;o=!0;let r=e.handler(a);if(r){for(let[e,t]of Object.entries(r))e in n||void 0===t||(n[e]=t);if(t=(t=t.slice(0,a.index)+t.slice(a.index+a[0].length+1)).trim(),this.doneChecker(n,t))break}}return o?this.formatter(n):this.fallback(e)}},w=["year","month","day","hour","minute","second","millisecond","offset"],C={};function E(e,t){return""===t||/^\s+$/.test(t)||"year"in e&&("month"in e||"monthname"in e)&&"day"in e&&"hour"in e&&"minute"in e&&"second"in e&&"millisecond"in e&&("zone"in e||"offset"in e)}var S=[[/([^\d.]+)(\d{1,2})\.(\d{2})\.(\d{2})(\D|$)/,"$1$2:$3:$4$5"],[/([^\d.]+)(\d{1,2})\.(\d{2})(\D|$)/,"$1$2:$3$4"]],z={ar:[[/ /g," "]],bn:[[/,/g,""]],zh:[[/早上\s*([\d:]+)/,"$1am"],[/凌晨\s*([\d:]+)/,"$1am"],[/上午\s*([\d:]+)/,"$1am"],[/下午\s*([\d:]+)/,"$1pm"],[/晚上\s*([\d:]+)/,"$1pm"]],he:[[/ב/gi,""]],de:[[/ um /g," "]],pt:[[/\sde /gi," "]],es:[[/\sde /gi," "]],da:[[/\sden /gi," "],...S],ru:[[/ г\./g,""]],th:[[/\s*นาฬิกา\s*/i,":"],[/\s*นาที\s*/i,":"],[/\s*วินาที\s*/i," "]],ko:[[/\s*시\s*/,":"],[/\s*분\s*/,":"],[/\s*초\s*/,""],[/(오전|오후)\s*([\d:]+)/,"$2$1"],[/(\d{4})\. (\d{1,2})\. (\d{1,2})\./,"$1-$2-$3"]],fi:S,id:S,fr:[[/(\d{2}) h /,"$1:"],[/(\d{2}) min /,"$1:"],[/(\d{2}) s /,"$1"]]};function D(e,t=i){let n=function(e){if(!C[e]){var t,n;let o,a,r=b.factory(e);C[e]=new x({doneChecker:E,fallback:(t=e,function(e){let n=String(e).slice(0,50);return""===n&&(n="(empty string)"),{invalid:`Unable to parse "${n}" with locale "${t}"`}}),patterns:(o=[{name:"timestampWithOffset",regex:r.compile("^(_YEAR4_)-(_MONTH_)-(_DAY_)[T ](_H24_):(_MIN_):(_SEC_)(?:.(_MS_))? ?(_OFFSET_|Z)?$"),handler:k(["","year","month","day","hour","minute","second","millisecond","offset"])},{name:"timestampWithZone",regex:r.compile("^(_YEAR4_)-(_MONTH_)-(_DAY_)[T ](_H24_):(_MIN_):(_SEC_)(?:.(_MS_))?\\s*(_ZONE_)$"),handler:k(["","year","month","day","hour","minute","second","millisecond","zone"])},{name:"timestampWithOffsetAndZone",regex:r.compile("^(_YEAR4_)-(_MONTH_)-(_DAY_)[T ](_H24_):(_MIN_):(_SEC_)(?:.(_MS_))? (_OFFSET_|Z)\\s*(_ZONE_)$"),handler:k(["","year","month","day","hour","minute","second","millisecond","offset"])},{name:"chinese",regex:r.compile(`^(${c}{2,4})\\s*\u5E74\\s*(${c}{1,2})\\s*\u6708\\s*(${c}{1,2})\\s*\u65E5$`),handler:k(["","year","month","day"])},{name:"korean",regex:r.compile("^(_YEAR_)년\\s*(_MONTH_)월\\s*(_DAY_)일$"),handler:k(["","year","month","day"])},{name:"twitter",regex:/^(?:sun|mon|tue|wed|thu|fri|sat) (jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec) (\d{2}) (\d{2}):(\d{2}):(\d{2}) ([+-]\d{4}) (\d{4})$/i,handler:k(["","monthname","day","hour","minute","second","offset","year"])},{name:"today",regex:/^(now|today|tomorrow|yesterday)$/i,handler:function(e){let t=A(),n=e[1].toLowerCase();switch(n){case"tomorrow":t.setUTCDate(t.getUTCDate()+1);break;case"yesterday":t.setUTCDate(t.getUTCDate()-1)}let o={year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate()};return"now"===n&&(o.hour=t.getUTCHours(),o.minute=t.getUTCMinutes(),o.second=t.getUTCSeconds(),o.millisecond=t.getUTCMilliseconds()),console.log("today=>",n,o),o}},{name:"ago",regex:/^(\+|-|in|) ?([\d.]+) ?(years?|months?|weeks?|days?|hours?|minutes?|seconds?|milliseconds?|ms|s|m|h|w|d|M|y)( ago)?$/i,handler:function([,e,t,n,o]){t=parseFloat(t),"week"===(n=n.length<=2?$[n]:(n=n.replace(/s$/,"")).toLowerCase())&&(n="day",t*=7),("-"===e||o)&&(t*=-1);let a=A();return"millisecond"===n?a.setUTCMilliseconds(a.getUTCMilliseconds()+t):"second"===n?a.setUTCSeconds(a.getUTCSeconds()+t):"minute"===n?a.setUTCMinutes(a.getUTCMinutes()+t):"hour"===n?a.setUTCHours(a.getUTCHours()+t):"day"===n?a.setUTCDate(a.getUTCDate()+t):"month"===n?a.setUTCMonth(a.getUTCMonth()+t):"year"===n&&a.setUTCFullYear(a.getUTCFullYear()+t),{year:a.getUTCFullYear(),month:a.getUTCMonth()+1,day:a.getUTCDate(),hour:a.getUTCHours(),minute:a.getUTCMinutes(),second:a.getUTCSeconds(),millisecond:a.getUTCMilliseconds()}}},{name:"atSeconds",regex:/^@(\d+)$/,handler:function(e){let t=new Date(1e3*parseInt(e[1],10));return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds()}}},{name:"microsoftJson",regex:/^\/Date\((\d+)([+-]\d{4})?\)\/$/,handler:function(e){let t=new Date(parseInt(e[1],10));return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds(),offset:e[2]}}},{name:"full24",regex:r.compile("(?:^|[\\sT])(_H24_):(_MIN_):(_SEC_)(?:\\.(_MS_))?(Z)?$"),handler:k(["","hour","minute","second","millisecond","zone"])},{name:"zone24",regex:r.compile("(_H24_):(_MIN_):(_SEC_)(?:\\.(_MS_))?[\\s\\[(]*(_ZONE_)?[\\s\\])]*$"),handler:k(["","hour","minute","second","millisecond","zone"])},{name:"hms12",regex:r.compile("(_H12_):(_MIN_):(_SEC_)\\s*(_MERIDIEM_)"),handler:k(["","hour","minute","second","meridiem"])},{name:"hms24",regex:r.compile("(_H24_):(_MIN_):(_SEC_)(?:\\.(_MS_))?"),handler:k(["","hour","minute","second","millisecond"])},{name:"hm12",regex:r.compile("(_H12_):(_MIN_)\\s*(_MERIDIEM_)"),handler:k(["","hour","minute","meridiem"])},{name:"hm24",regex:r.compile("(_H24_):(_MIN_)"),handler:k(["","hour","minute"])},{name:"h12",regex:r.compile("(_H12_)\\s*(_MERIDIEM_)"),handler:k(["","hour","meridiem"])},{name:"8digit",regex:/^((?:19|20)\d{2})(\d{2})(\d{2})$/,handler:k(["","year","month","day"])},{name:"yearMonthnameDay",regex:r.compile("(_YEAR4_)[\\s.-]+(_MONTHNAME_)[\\s,.-]+(_DAY_)(_ORDINAL_)?"),handler:k(["","year","monthname","day"])},{name:"dayMonthnameYear",regex:r.compile("(_DAY_)(_ORDINAL_)?[\\s.-]*(_MONTHNAME_)[\\s,.-]+(_YEAR_)"),handler:k(["","day","","monthname","year"])},{name:"monthnameDayYear",regex:r.compile("(_MONTHNAME_)[\\s.-]*(_DAY_)(_ORDINAL_)?[\\s,.-]+(_YEAR_)"),handler:k(["","monthname","day","","year"])},{name:"dayMonthname",regex:r.compile("\\b(_DAY_)(_ORDINAL_)?[\\s.-]*(_MONTHNAME_)\\b"),handler:k(["","day","","monthname"])},{name:"monthnameDay",regex:r.compile("\\b(_MONTHNAME_)[\\s.-]*(_DAY_)(_ORDINAL_)?\\b"),handler:k(["","monthname","day"])},{name:"hmsNoMeridiem",regex:r.compile("\\b(_H12_|_H24_):(_MIN_):(_SEC_)\\b"),handler:k(["","hour","minute","second"])},{name:"hmNoMeridiem",regex:r.compile("\\b(_H12_|_H24_):(_MIN_)\\b"),handler:k(["","hour","minute"])},{name:"ymd",regex:r.compile("(_YEAR4_)([.-])(_MONTH_)\\2+(_DAY_)"),handler:k(["","year","","month","day"])},{name:"mdy",regex:r.compile("(_MONTH_)([/-])(_DAY_)\\2(_YEAR_)"),handler:k(["","month","","day","year"])},{name:"dmy",regex:r.compile("(_DAY_)(?:_ORDINAL_)?[./\\s-]+(_MONTH_)[./\\s-]+(_YEAR_)"),handler:k(["","day","month","year"])},{name:"yearLoose",regex:r.compile("_YEAR4_"),handler:k(["year"])},{name:"dayMonthnameLoose",regex:r.compile("(_DAY_)[\\s.]*(_MONTHNAME_)"),handler:k(["","day","monthname"])},{name:"monthnameDayLoose",regex:r.compile("(_MONTHNAME_)[\\s.]*(_DAY_)"),handler:k(["","monthname","day"])},{name:"monthname",regex:r.compile("_MONTHNAME_"),handler:k(["monthname"])},{name:"year4",regex:r.compile("_YEAR4_"),handler:k(["year"])},{name:"md",regex:r.compile("(_MONTH_)[/-](_DAY_)"),handler:k(["","month","day"])},{name:"dm",regex:r.compile("(_DAY_)(?:_ORDINAL_)?[./\\s-]+(_MONTH_)"),handler:k(["","day","month"])},{name:"day",regex:r.compile("_DAY_"),handler:k(["day"])},{name:"year2",regex:r.compile("_YEAR2_"),handler:k(["year"])},{name:"onlyZone",regex:r.compile("_ZONE_"),handler:k(["zone"])}],a=r.baseName.slice(0,5),v.includes(a)?o:o.filter(e=>!["mdy","md"].includes(e.name))),formatter:(n=r,function(e){let t={};for(let[o,a]of Object.entries(e))if("monthname"===o){if(a){let e=n.monthNameToInt(a);void 0!==e&&(t.month=e)}}else if("hour"===o&&e.meridiem){let o=n.h12ToInt(a,e.meridiem);void 0!==o&&(t.hour=o)}else if("zone"===o){if(a){let e=n.zoneToOffset(a);void 0!==e&&(t.offset=e)}}else if("offset"===o){let e=n.offsetToMinutes(a);void 0!==e&&(t.offset=e)}else if("millisecond"===o){let e=n.millisecondToInt(a);"number"==typeof e&&(t.millisecond=e)}else if(w.includes(o)){let e=n.toInt(a);"number"==typeof e&&(t[o]=e)}return t.year<100&&(t.year=l[t.year]),t.year&&"buddhist"===n.dateOptions.calendar&&(t.year-=543),t})})}return C[e]}(t),o=function(e,t){let n=z[t.slice(0,2).toLowerCase()];if(!n)return e;for(let[t,o]of n)e=e.replace(t,o);return e}(e,t);return n.attempt(o)}function P(e){e.month&&e.day&&void 0===e.year&&(e.year=new Date().getFullYear()),60===e.second&&(e.second=59);let t=new s(e.year,e.month-1,e.day,e.hour||0,e.minute||0,e.second||0,e.millisecond||0);return"number"==typeof e.offset?new s(t.valueOf()-60*e.offset*1e3):t}function M(e,t=i){let n=D(e,t),o=n.invalid?new s(NaN):P(n);return o.isValid()||(o.invalid=`Unable to parse date "${e}"`),o}function N(e,t=i){return e instanceof Date?new s(e.valueOf()):"number"==typeof e?new s(e):M(e,t)}Date.fromString=s.fromString=M,Date.fromAny=s.fromAny=N,"u">typeof window&&(window.anyDateParser={fromString:M,fromAny:N,fromObject:P,attempt:D});var T=n(80222),B=n.n(T),O=n(85602),I=n(44397),j=n(57657);let R=function(e){return null==e};var F=n(59571),L=n(65763);function W(e,t){var n=function(e,t){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return t.get(e)}(e,t);return n.get?n.get.call(e):n.value}B().extend(O),B().extend(j),B().extend(I);let V="YYYY-MM-DDTHH:mm:ss.SSSZZ";function G(e){return null!=e&&28===e.trim().length&&"T"===(e=e.trim())[10]&&":"===e[13]&&":"===e[16]&&"."===e[19]&&("+"===e[23]||"-"===e[23])&&B()(e,V).isValid()}function U(e){return B()(e).isToday()}function q(e){return G(e)?B()(e,V).toDate():null}function H(e,t=!1){let n=B()(e);return t&&(n=n.utc()),n.format(V)}function K(e){return B()(e).toDate()}var Z=new WeakMap;let Y=new class{register(e,t){W(this,Z).set(e,t)}getCalendar(e){if(!e)return;if(e.calendar)return e.calendar;if(e.region){let t=`${e.language}-${e.region}`;if(W(this,Z).has(t))return W(this,Z).get(t)}if(e.language&&W(this,Z).has(e.language))return W(this,Z).get(e.language);let t=new Intl.DateTimeFormat(e.toString()).resolvedOptions().calendar;return W(this,Z).set(`${e.language}${e.region?`-${e.region}`:""}`,t),t}constructor(){!function(e,t,n){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object");t.set(e,n)}(this,Z,{writable:!0,value:new Map})}};function J(e,t){Y.register(e,t)}function X(e){let t=e??(0,L.J)();return Y.getCalendar(t instanceof Intl.Locale?t:new Intl.Locale(t))}let Q={mode:"standard",time:"for today",day:!0,month:!0,year:!0,noToday:!1};function ee(e,t={}){let n=D(e,(0,L.J)());if(n.invalid)return console.warn(`Could not parse invalid date '${e}'`),null;!R(n.day)&&R(n.month)&&(n=Object.assign({},(0,F.A)(n,"day"),{month:n.day})),n.month&&(n.month-=1),n.day&&(n=Object.assign({},(0,F.A)(n,"day"),{date:n.day}));let o=B()().set(n).toDate();return R(n.year)&&(t.year=!1),R(n.month)&&(t.month=!1),R(n.date)&&(t.day=!1),et(o,t)}function et(e,t){let n,o=t?.locale??(0,L.J)(),a=new Intl.Locale(o),{calendar:r,mode:i,time:s,day:l,month:p,year:c,noToday:d,numberingSystem:u}={...Q,...{noToday:"am"===a.language},...t},f={calendar:r??X(a),year:c?"numeric":void 0,month:p?"short":void 0,day:l?"2-digit":void 0,numberingSystem:u},h=B()(e).isToday();if(h&&!d)n=(n=new Intl.RelativeTimeFormat(o,{numeric:"auto"}).format(0,"day"))[0].toLocaleUpperCase(o)+n.slice(1);else{"en"===a.language&&(o="en-GB");let t=new Intl.DateTimeFormat(o,f).formatToParts(e);("en"===a.language||"am"===a.language)&&"standard"==i&&c&&l&&(t=t.map(en("-"))),"wide"==i&&(t=t.map(en(" — "))),"ethiopic"===f.calendar&&(t=t.filter((e,t,n)=>"era"!==e.type&&("literal"!==e.type||!(t<n.length-1)||"era"!==n[t+1].type))),n=t.map(e=>e.value).join("")}return(!0===s||h&&"for today"===s)&&(n+=`, ${eo(e)}`),n}let en=e=>(t,n,o)=>"literal"!==t.type||" "!==t.value||n<o.length-1&&"era"===o[n+1].type?t:{type:"literal",value:e};function eo(e){return e.toLocaleTimeString((0,L.J)(),{hour:"2-digit",minute:"2-digit"})}function ea(e,t){return et(e,{...t,time:!0})}function er(e,t){let n=X("string"==typeof t?new Intl.Locale(t):t);return n?(0,a.yP)(e,(0,r.d)(n)):e}function ei(e,t){return new Intl.DurationFormat((0,L.J)(),t).format(e)}function es(e,t){if(null==e)return null;if("string"==typeof e){let n=D(e,(0,L.J)());return n.invalid?(console.warn(`Could not interpret '${e}' as a date`),null):(n.day&&!n.month&&(n={...(0,F.A)(n,"day"),...{month:n.day}}),n.month&&(n.month-=1),n.day&&(n={...(0,F.A)(n,"day"),...{date:n.day}}),B()(t).set(n))}return B()(e)}let el=["years","months","days","hours","minutes","seconds"],ep={second:"seconds",minute:"minutes",hour:"hours",day:"days",month:"months",year:"years"},ec={seconds:45,minutes:45,hours:22,days:26,months:11,years:1/0};function ed(e,t=B()(),n){let o,a=B()(t),r=es(e,a);if(null==r)return null;if("string"==typeof n){let e=ep[n]??n;return{[e]:a.diff(r,e)}}let{thresholds:i,largestUnit:s,smallestUnit:l}=n??{};if(void 0!==s||void 0!==l){let e,t=l?ep[l]??l:void 0;return e="auto"===s||void 0===s?function(e,t,n){let o=el.indexOf(n);for(let a=0;a<el.length;a++){let r=el[a];if(t.diff(e,r)>0)return a<=o?r:n}return n}(r,a,t??"seconds"):ep[s]??s,function(e,t,n,o){let a=el.indexOf(n),r=el.indexOf(o),i=el.slice(a,r+1),s={},l=e;for(let e of i){let n=t.diff(l,e);s[e]=n,l=l.add(n,e)}return s}(r,a,e,t??e)}let p=(o=function(e){let t={...ec};if(e)for(let[n,o]of Object.entries(e))void 0!==o&&(t[ep[n]??n]=o);return t}(i),a.diff(r,"seconds")<o.seconds?"seconds":a.diff(r,"minutes")<o.minutes?"minutes":a.diff(r,"hours")<o.hours?"hours":a.diff(r,"days")<o.days?"days":a.diff(r,"months")<o.months?"months":"years");return{[p]:a.diff(r,p)}}let eu={style:"short",localeMatcher:"lookup"};function ef(e,t=B()(),n){let o=ed(e,t,n);return null==o?null:ei(o,"object"==typeof n&&n.formatOptions?{...eu,...n.formatOptions}:eu)}},65763(e,t,n){"use strict";function o(){let e=window.i18next.language;return"ht"===(e=e.replaceAll("_","-"))&&(e="fr-HT"),e}n.d(t,{J:()=>o})},6564(e,t,n){"use strict";function o(e){return!window.offlineEnabled||(e??navigator.onLine)}n.d(t,{s:()=>o})},877(e,t,n){"use strict";function o(e){return r(s(e,"usual","official"))}function a(e){return o(e)}function r(e){var t;let n;return e?e.text??(n=(t=e).given??[],(t.family?n.concat(t.family):n).join(" ")):""}function i(e){return r(e)}function s(e,...t){for(let n of(0==t.length&&(t=["usual"]),t)){let t=e.name?.find(e=>{var t,o;return t=e,o=n,t.use?t.use===o:"usual"===o});if(t)return t}}n.d(t,{QC:()=>a,Qr:()=>r,VO:()=>s,Vp:()=>o,qK:()=>i})},43254(e,t,n){"use strict";function o(e,t){if(e===t||Object.is(e,t))return!0;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}if(Array.isArray(t)||"object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;let n=Object.getOwnPropertyNames(e),o=Object.getOwnPropertyNames(t);return n.length===o.length&&n.every(n=>e[n]===t[n])}n.d(t,{b:()=>o})},19758(e,t,n){"use strict";n.d(t,{A:()=>a});class o{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+o.version}static addUnaryOp(e){return o.max_unop_len=Math.max(e.length,o.max_unop_len),o.unary_ops[e]=1,o}static addBinaryOp(e,t,n){return o.max_binop_len=Math.max(e.length,o.max_binop_len),o.binary_ops[e]=t,n?o.right_associative.add(e):o.right_associative.delete(e),o}static addIdentifierChar(e){return o.additional_identifier_chars.add(e),o}static addLiteral(e,t){return o.literals[e]=t,o}static removeUnaryOp(e){return delete o.unary_ops[e],e.length===o.max_unop_len&&(o.max_unop_len=o.getMaxKeyLen(o.unary_ops)),o}static removeAllUnaryOps(){return o.unary_ops={},o.max_unop_len=0,o}static removeIdentifierChar(e){return o.additional_identifier_chars.delete(e),o}static removeBinaryOp(e){return delete o.binary_ops[e],e.length===o.max_binop_len&&(o.max_binop_len=o.getMaxKeyLen(o.binary_ops)),o.right_associative.delete(e),o}static removeAllBinaryOps(){return o.binary_ops={},o.max_binop_len=0,o}static removeLiteral(e){return delete o.literals[e],o}static removeAllLiterals(){return o.literals={},o}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(e){this.expr=e,this.index=0}static parse(e){return new o(e).parse()}static getMaxKeyLen(e){return Math.max(0,...Object.keys(e).map(e=>e.length))}static isDecimalDigit(e){return e>=48&&e<=57}static binaryPrecedence(e){return o.binary_ops[e]||0}static isIdentifierStart(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!o.binary_ops[String.fromCharCode(e)]||o.additional_identifier_chars.has(String.fromCharCode(e))}static isIdentifierPart(e){return o.isIdentifierStart(e)||o.isDecimalDigit(e)}throwError(e){let t=Error(e+" at character "+this.index);throw t.index=this.index,t.description=e,t}runHook(e,t){if(o.hooks[e]){let n={context:this,node:t};return o.hooks.run(e,n),n.node}return t}searchHook(e){if(o.hooks[e]){let t={context:this};return o.hooks[e].find(function(e){return e.call(t.context,t),t.node}),t.node}}gobbleSpaces(){let e=this.code;for(;e===o.SPACE_CODE||e===o.TAB_CODE||e===o.LF_CODE||e===o.CR_CODE;)e=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let e=this.gobbleExpressions(),t=1===e.length?e[0]:{type:o.COMPOUND,body:e};return this.runHook("after-all",t)}gobbleExpressions(e){let t=[],n,a;for(;this.index<this.expr.length;)if((n=this.code)===o.SEMCOL_CODE||n===o.COMMA_CODE)this.index++;else if(a=this.gobbleExpression())t.push(a);else if(this.index<this.expr.length){if(n===e)break;this.throwError('Unexpected "'+this.char+'"')}return t}gobbleExpression(){let e=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",e)}gobbleBinaryOp(){this.gobbleSpaces();let e=this.expr.substr(this.index,o.max_binop_len),t=e.length;for(;t>0;){if(o.binary_ops.hasOwnProperty(e)&&(!o.isIdentifierStart(this.code)||this.index+e.length<this.expr.length&&!o.isIdentifierPart(this.expr.charCodeAt(this.index+e.length))))return this.index+=t,e;e=e.substr(0,--t)}return!1}gobbleBinaryExpression(){let e,t,n,a,r,i,s,l,p;if(!(i=this.gobbleToken())||!(t=this.gobbleBinaryOp()))return i;for(r={value:t,prec:o.binaryPrecedence(t),right_a:o.right_associative.has(t)},(s=this.gobbleToken())||this.throwError("Expected expression after "+t),a=[i,r,s];t=this.gobbleBinaryOp();){if(0===(n=o.binaryPrecedence(t))){this.index-=t.length;break}r={value:t,prec:n,right_a:o.right_associative.has(t)},p=t;let l=e=>r.right_a&&e.right_a?n>e.prec:n<=e.prec;for(;a.length>2&&l(a[a.length-2]);)s=a.pop(),t=a.pop().value,i=a.pop(),e={type:o.BINARY_EXP,operator:t,left:i,right:s},a.push(e);(e=this.gobbleToken())||this.throwError("Expected expression after "+p),a.push(r,e)}for(l=a.length-1,e=a[l];l>1;)e={type:o.BINARY_EXP,operator:a[l-1].value,left:a[l-2],right:e},l-=2;return e}gobbleToken(){let e,t,n,a;if(this.gobbleSpaces(),a=this.searchHook("gobble-token"))return this.runHook("after-token",a);if(e=this.code,o.isDecimalDigit(e)||e===o.PERIOD_CODE)return this.gobbleNumericLiteral();if(e===o.SQUOTE_CODE||e===o.DQUOTE_CODE)a=this.gobbleStringLiteral();else if(e===o.OBRACK_CODE)a=this.gobbleArray();else{for(n=(t=this.expr.substr(this.index,o.max_unop_len)).length;n>0;){if(o.unary_ops.hasOwnProperty(t)&&(!o.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!o.isIdentifierPart(this.expr.charCodeAt(this.index+t.length)))){this.index+=n;let e=this.gobbleToken();return e||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:o.UNARY_EXP,operator:t,argument:e,prefix:!0})}t=t.substr(0,--n)}o.isIdentifierStart(e)?(a=this.gobbleIdentifier(),o.literals.hasOwnProperty(a.name)?a={type:o.LITERAL,value:o.literals[a.name],raw:a.name}:a.name===o.this_str&&(a={type:o.THIS_EXP})):e===o.OPAREN_CODE&&(a=this.gobbleGroup())}return a?(a=this.gobbleTokenProperty(a),this.runHook("after-token",a)):this.runHook("after-token",!1)}gobbleTokenProperty(e){this.gobbleSpaces();let t=this.code;for(;t===o.PERIOD_CODE||t===o.OBRACK_CODE||t===o.OPAREN_CODE||t===o.QUMARK_CODE;){let n;if(t===o.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==o.PERIOD_CODE)break;n=!0,this.index+=2,this.gobbleSpaces(),t=this.code}this.index++,t===o.OBRACK_CODE?((e={type:o.MEMBER_EXP,computed:!0,object:e,property:this.gobbleExpression()}).property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),(t=this.code)!==o.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):t===o.OPAREN_CODE?e={type:o.CALL_EXP,arguments:this.gobbleArguments(o.CPAREN_CODE),callee:e}:(t===o.PERIOD_CODE||n)&&(n&&this.index--,this.gobbleSpaces(),e={type:o.MEMBER_EXP,computed:!1,object:e,property:this.gobbleIdentifier()}),n&&(e.optional=!0),this.gobbleSpaces(),t=this.code}return e}gobbleNumericLiteral(){let e="",t,n;for(;o.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);if(this.code===o.PERIOD_CODE)for(e+=this.expr.charAt(this.index++);o.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);if("e"===(t=this.char)||"E"===t){for(e+=this.expr.charAt(this.index++),("+"===(t=this.char)||"-"===t)&&(e+=this.expr.charAt(this.index++));o.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);o.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+e+this.char+")")}return n=this.code,o.isIdentifierStart(n)?this.throwError("Variable names cannot start with a number ("+e+this.char+")"):(n===o.PERIOD_CODE||1===e.length&&e.charCodeAt(0)===o.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:o.LITERAL,value:parseFloat(e),raw:e}}gobbleStringLiteral(){let e="",t=this.index,n=this.expr.charAt(this.index++),a=!1;for(;this.index<this.expr.length;){let t=this.expr.charAt(this.index++);if(t===n){a=!0;break}if("\\"===t)switch(t=this.expr.charAt(this.index++)){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:e+=t}else e+=t}return a||this.throwError('Unclosed quote after "'+e+'"'),{type:o.LITERAL,value:e,raw:this.expr.substring(t,this.index)}}gobbleIdentifier(){let e=this.code,t=this.index;for(o.isIdentifierStart(e)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length;)if(e=this.code,o.isIdentifierPart(e))this.index++;else break;return{type:o.IDENTIFIER,name:this.expr.slice(t,this.index)}}gobbleArguments(e){let t=[],n=!1,a=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let r=this.code;if(r===e){n=!0,this.index++,e===o.CPAREN_CODE&&a&&a>=t.length&&this.throwError("Unexpected token "+String.fromCharCode(e));break}if(r===o.COMMA_CODE){if(this.index++,++a!==t.length){if(e===o.CPAREN_CODE)this.throwError("Unexpected token ,");else if(e===o.CBRACK_CODE)for(let e=t.length;e<a;e++)t.push(null)}}else if(t.length!==a&&0!==a)this.throwError("Expected comma");else{let e=this.gobbleExpression();e&&e.type!==o.COMPOUND||this.throwError("Expected comma"),t.push(e)}}return n||this.throwError("Expected "+String.fromCharCode(e)),t}gobbleGroup(){this.index++;let e=this.gobbleExpressions(o.CPAREN_CODE);if(this.code===o.CPAREN_CODE)return(this.index++,1===e.length)?e[0]:!!e.length&&{type:o.SEQUENCE_EXP,expressions:e};this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:o.ARRAY_EXP,elements:this.gobbleArguments(o.CBRACK_CODE)}}}Object.assign(o,{hooks:new class{add(e,t,n){if("string"!=typeof arguments[0])for(let e in arguments[0])this.add(e,arguments[0][e],arguments[1]);else(Array.isArray(e)?e:[e]).forEach(function(e){this[e]=this[e]||[],t&&this[e][n?"unshift":"push"](t)},this)}run(e,t){this[e]=this[e]||[],this[e].forEach(function(e){e.call(t&&t.context?t.context:t,t)})}},plugins:new class{constructor(e){this.jsep=e,this.registered={}}register(...e){e.forEach(e=>{if("object"!=typeof e||!e.name||!e.init)throw Error("Invalid JSEP plugin format");this.registered[e.name]||(e.init(this.jsep),this.registered[e.name]=e)})}}(o),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),o.max_unop_len=o.getMaxKeyLen(o.unary_ops),o.max_binop_len=o.getMaxKeyLen(o.binary_ops);let a=e=>new o(e).parse(),r=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(o).filter(e=>!r.includes(e)&&void 0===a[e]).forEach(e=>{a[e]=o[e]}),a.Jsep=o,a.plugins.register({name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;let n=t.node,o=this.gobbleExpression();if(o||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let a=this.gobbleExpression();if(a||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:n,consequent:o,alternate:a},n.operator&&e.binary_ops[n.operator]<=.9){let o=n;for(;o.right.operator&&e.binary_ops[o.right.operator]<=.9;)o=o.right;t.node.test=o.right,o.right=t.node,t.node=n}}else this.throwError("Expected :")}})}})},76124(e,t,n){"use strict";n.d(t,{A:()=>i});var o=n(99271),a=n(26979),r=Object.prototype.hasOwnProperty;let i=function(e,t,n){var i=e[t];r.call(e,t)&&(0,a.A)(i,n)&&(void 0!==n||t in e)||(0,o.A)(e,t,n)}},99271(e,t,n){"use strict";n.d(t,{A:()=>a});var o=n(61758);let a=function(e,t,n){"__proto__"==t&&o.A?(0,o.A)(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},41736(e,t,n){"use strict";n.d(t,{A:()=>V});var o=n(21050);let a=function(e,t){for(var n=-1,o=null==e?0:e.length;++n<o&&!1!==t(e[n],n,e););return e};var r=n(76124),i=n(28078),s=n(7817),l=n(25894),p=n(521),c=n(80084),d=n(26157),u=n(36430),f=n(2475),h=n(7096),m=n(90616),g=Object.prototype.hasOwnProperty;let y=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&g.call(e,"index")&&(n.index=e.index,n.input=e.input),n};var b=n(88724);let v=function(e,t){var n=t?(0,b.A)(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)};var $=/\w*$/;let A=function(e){var t=new e.constructor(e.source,$.exec(e));return t.lastIndex=e.lastIndex,t};var k=n(83516),x=k.A?k.A.prototype:void 0,w=x?x.valueOf:void 0,C=n(65246);let E=function(e,t,n){var o=e.constructor;switch(t){case"[object ArrayBuffer]":return(0,b.A)(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return v(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return(0,C.A)(e,n);case"[object Map]":case"[object Set]":return new o;case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return A(e);case"[object Symbol]":return w?Object(w.call(e)):{}}};var S=n(12458),z=n(96956),D=n(11917),P=n(47313),M=n(58126),N=n(10248),T=N.A&&N.A.isMap,B=T?(0,M.A)(T):function(e){return(0,P.A)(e)&&"[object Map]"==(0,m.A)(e)},O=n(97942),I=N.A&&N.A.isSet,j=I?(0,M.A)(I):function(e){return(0,P.A)(e)&&"[object Set]"==(0,m.A)(e)},R="[object Arguments]",F="[object Function]",L="[object Object]",W={};W[R]=W["[object Array]"]=W["[object ArrayBuffer]"]=W["[object DataView]"]=W["[object Boolean]"]=W["[object Date]"]=W["[object Float32Array]"]=W["[object Float64Array]"]=W["[object Int8Array]"]=W["[object Int16Array]"]=W["[object Int32Array]"]=W["[object Map]"]=W["[object Number]"]=W[L]=W["[object RegExp]"]=W["[object Set]"]=W["[object String]"]=W["[object Symbol]"]=W["[object Uint8Array]"]=W["[object Uint8ClampedArray]"]=W["[object Uint16Array]"]=W["[object Uint32Array]"]=!0,W["[object Error]"]=W[F]=W["[object WeakMap]"]=!1;let V=function e(t,n,g,b,v,$){var A,k=1&n,x=2&n,w=4&n;if(g&&(A=v?g(t,b,v,$):g(t)),void 0!==A)return A;if(!(0,O.A)(t))return t;var C=(0,z.A)(t);if(C){if(A=y(t),!k)return(0,c.A)(t,A)}else{var P,M,N,T,I=(0,m.A)(t),V=I==F||"[object GeneratorFunction]"==I;if((0,D.A)(t))return(0,p.A)(t,k);if(I==L||I==R||V&&!v){if(A=x||V?{}:(0,S.A)(t),!k)return x?(M=(P=A)&&(0,i.A)(t,(0,l.A)(t),P),(0,i.A)(t,(0,u.A)(t),M)):(T=(N=A)&&(0,i.A)(t,(0,s.A)(t),N),(0,i.A)(t,(0,d.A)(t),T))}else{if(!W[I])return v?t:{};A=E(t,I,k)}}$||($=new o.A);var G=$.get(t);if(G)return G;$.set(t,A),j(t)?t.forEach(function(o){A.add(e(o,n,g,o,t,$))}):B(t)&&t.forEach(function(o,a){A.set(a,e(o,n,g,a,t,$))});var U=w?x?h.A:f.A:x?l.A:s.A,q=C?void 0:U(t);return a(q||t,function(o,a){q&&(o=t[a=o]),(0,r.A)(A,a,e(o,n,g,a,t,$))}),A}},20405(e,t,n){"use strict";n.d(t,{A:()=>C});var o=n(21050),a=n(99271),r=n(26979);let i=function(e,t,n){(void 0===n||(0,r.A)(e[t],n))&&(void 0!==n||t in e)||(0,a.A)(e,t,n)};var s=n(80670),l=n(521),p=n(65246),c=n(80084),d=n(12458),u=n(86770),f=n(96956),h=n(31475),m=n(47313),g=n(11917),y=n(50405),b=n(97942),v=n(78938),$=n(60480);let A=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};var k=n(28078),x=n(25894);let w=function(e,t,n,o,a,r,s){var w=A(e,n),C=A(t,n),E=s.get(C);if(E)return void i(e,n,E);var S=r?r(w,C,n+"",e,t,s):void 0,z=void 0===S;if(z){var D=(0,f.A)(C),P=!D&&(0,g.A)(C),M=!D&&!P&&(0,$.A)(C);(S=C,D||P||M)?(0,f.A)(w)?S=w:(0,m.A)(w)&&(0,h.A)(w)?S=(0,c.A)(w):P?(z=!1,S=(0,l.A)(C,!0)):M?(z=!1,S=(0,p.A)(C,!0)):S=[]:(0,v.A)(C)||(0,u.A)(C)?(S=w,(0,u.A)(w))?S=(0,k.A)(w,(0,x.A)(w)):(!(0,b.A)(w)||(0,y.A)(w))&&(S=(0,d.A)(C)):z=!1}z&&(s.set(C,S),a(S,C,o,r,s),s.delete(C)),i(e,n,S)},C=function e(t,n,a,r,l){t!==n&&(0,s.A)(n,function(s,p){if(l||(l=new o.A),(0,b.A)(s))w(t,n,p,a,e,r,l);else{var c=r?r(A(t,p),s,p+"",t,n,l):void 0;void 0===c&&(c=s),i(t,p,c)}},x.A)}},88724(e,t,n){"use strict";n.d(t,{A:()=>a});var o=n(97913);let a=function(e){var t=new e.constructor(e.byteLength);return new o.A(t).set(new o.A(e)),t}},521(e,t,n){"use strict";n.d(t,{A:()=>l});var o=n(39600),a="object"==typeof exports&&exports&&!exports.nodeType&&exports,r=a&&"object"==typeof module&&module&&!module.nodeType&&module,i=r&&r.exports===a?o.A.Buffer:void 0,s=i?i.allocUnsafe:void 0;let l=function(e,t){if(t)return e.slice();var n=e.length,o=s?s(n):new e.constructor(n);return e.copy(o),o}},65246(e,t,n){"use strict";n.d(t,{A:()=>a});var o=n(88724);let a=function(e,t){var n=t?(0,o.A)(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},80084(e,t,n){"use strict";n.d(t,{A:()=>o});let o=function(e,t){var n=-1,o=e.length;for(t||(t=Array(o));++n<o;)t[n]=e[n];return t}},28078(e,t,n){"use strict";n.d(t,{A:()=>r});var o=n(76124),a=n(99271);let r=function(e,t,n,r){var i=!n;n||(n={});for(var s=-1,l=t.length;++s<l;){var p=t[s],c=r?r(n[p],e[p],p,n,e):void 0;void 0===c&&(c=e[p]),i?(0,a.A)(n,p,c):(0,o.A)(n,p,c)}return n}},11888(e,t,n){"use strict";n.d(t,{A:()=>d});var o=n(14151),a=n(28127),r=n(30088),i=n(26979),s=n(31475),l=n(85378),p=n(97942);let c=function(e,t,n){if(!(0,p.A)(n))return!1;var o=typeof t;return("number"==o?!!((0,s.A)(n)&&(0,l.A)(t,n.length)):"string"==o&&t in n)&&(0,i.A)(n[t],e)},d=function(e){var t;return t=function(t,n){var o=-1,a=n.length,r=a>1?n[a-1]:void 0,i=a>2?n[2]:void 0;for(r=e.length>3&&"function"==typeof r?(a--,r):void 0,i&&c(n[0],n[1],i)&&(r=a<3?void 0:r,a=1),t=Object(t);++o<a;){var s=n[o];s&&e(t,s,o,r)}return t},(0,r.A)((0,a.A)(t,void 0,o.A),t+"")}},61758(e,t,n){"use strict";n.d(t,{A:()=>a});var o=n(61982);let a=function(){try{var e=(0,o.A)(Object,"defineProperty");return e({},"",{}),e}catch(e){}}()},7096(e,t,n){"use strict";n.d(t,{A:()=>i});var o=n(64494),a=n(36430),r=n(25894);let i=function(e){return(0,o.A)(e,r.A,a.A)}},34878(e,t,n){"use strict";n.d(t,{A:()=>o});let o=(0,n(67244).A)(Object.getPrototypeOf,Object)},36430(e,t,n){"use strict";n.d(t,{A:()=>s});var o=n(53271),a=n(34878),r=n(26157),i=n(11276);let s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)(0,o.A)(t,(0,r.A)(e)),e=(0,a.A)(e);return t}:i.A},12458(e,t,n){"use strict";n.d(t,{A:()=>l});var o=n(97942),a=Object.create,r=function(){function e(){}return function(t){if(!(0,o.A)(t))return{};if(a)return a(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),i=n(34878),s=n(71140);let l=function(e){return"function"!=typeof e.constructor||(0,s.A)(e)?{}:r((0,i.A)(e))}},28127(e,t,n){"use strict";n.d(t,{A:()=>r});let o=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)};var a=Math.max;let r=function(e,t,n){return t=a(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=a(r.length-t,0),l=Array(s);++i<s;)l[i]=r[t+i];i=-1;for(var p=Array(t+1);++i<t;)p[i]=r[i];return p[t]=n(l),o(e,this,p)}}},30088(e,t,n){"use strict";n.d(t,{A:()=>p});var o,a,r=n(61758),i=n(14151),s=r.A?function(e,t){return(0,r.A)(e,"toString",{configurable:!0,enumerable:!1,value:function(){return t},writable:!0})}:i.A,l=Date.now;let p=(o=0,a=0,function(){var e=l(),t=16-(e-a);if(a=e,t>0){if(++o>=800)return arguments[0]}else o=0;return s.apply(void 0,arguments)})},42853(e,t,n){"use strict";n.d(t,{A:()=>a});var o=n(22214);let a=function(e,t){return(0,o.A)(e,t)}},78938(e,t,n){"use strict";n.d(t,{A:()=>c});var o=n(77361),a=n(34878),r=n(47313),i=Object.prototype,s=Function.prototype.toString,l=i.hasOwnProperty,p=s.call(Object);let c=function(e){if(!(0,r.A)(e)||"[object Object]"!=(0,o.A)(e))return!1;var t=(0,a.A)(e);if(null===t)return!0;var n=l.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&s.call(n)==p}},25894(e,t,n){"use strict";n.d(t,{A:()=>c});var o=n(95403),a=n(97942),r=n(71140);let i=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t};var s=Object.prototype.hasOwnProperty;let l=function(e){if(!(0,a.A)(e))return i(e);var t=(0,r.A)(e),n=[];for(var o in e)"constructor"==o&&(t||!s.call(e,o))||n.push(o);return n};var p=n(31475);let c=function(e){return(0,p.A)(e)?(0,o.A)(e,!0):l(e)}},59571(e,t,n){"use strict";n.d(t,{A:()=>E});var o,a=n(65133),r=n(41736),i=n(77390);let s=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};var l=n(55841);let p=function(e,t,n){var o=-1,a=e.length;t<0&&(t=-t>a?0:a+t),(n=n>a?a:n)<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var r=Array(a);++o<a;)r[o]=e[o+t];return r};var c=n(9322),d=Object.prototype.hasOwnProperty;let u=function(e,t){t=(0,i.A)(t,e);var n,o=-1,a=t.length;if(!a)return!0;for(;++o<a;){var r=(0,c.A)(t[o]);if("__proto__"===r&&!d.call(e,"__proto__")||("constructor"===r||"prototype"===r)&&o<a-1)return!1}var u=(n=t).length<2?e:(0,l.A)(e,p(n,0,-1));return null==u||delete u[(0,c.A)(s(t))]};var f=n(28078),h=n(78938);let m=function(e){return(0,h.A)(e)?void 0:e};var g=n(53271),y=n(83516),b=n(86770),v=n(96956),$=y.A?y.A.isConcatSpreadable:void 0;let A=function(e){return(0,v.A)(e)||(0,b.A)(e)||!!($&&e&&e[$])},k=function e(t,n,o,a,r){var i=-1,s=t.length;for(o||(o=A),r||(r=[]);++i<s;){var l=t[i];n>0&&o(l)?n>1?e(l,n-1,o,a,r):(0,g.A)(r,l):a||(r[r.length]=l)}return r};var x=n(28127),w=n(30088),C=n(7096);let E=(o=function(e,t){var n={};if(null==e)return n;var o=!1;t=(0,a.A)(t,function(t){return t=(0,i.A)(t,e),o||(o=t.length>1),t}),(0,f.A)(e,(0,C.A)(e),n),o&&(n=(0,r.A)(n,7,m));for(var s=t.length;s--;)u(n,t[s]);return n},(0,w.A)((0,x.A)(o,void 0,function(e){return(null==e?0:e.length)?k(e,1):[]}),o+""))},61469(e,t,n){"use strict";function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach(function(t){var o,a,r;o=e,a=t,r=n[t],a in o?Object.defineProperty(o,a,{value:r,enumerable:!0,configurable:!0,writable:!0}):o[a]=r}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function r(e){return(r="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 i(e){return(i="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 s(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(i(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(i(e)));return e}}n.d(t,{A:()=>c,i:()=>l});var l=null;try{l=require("react").createContext()}catch(e){}var p={React:null,ReactDOM:null,ReactDOMClient:null,rootComponent:null,loadRootComponent:null,errorBoundary:null,errorBoundaryClass:null,domElementGetter:null,parcelCanUpdate:!0,suppressComponentDidCatchWarning:!1,domElements:{},renderResults:{},updateResolves:{},unmountResolves:{}};function c(e){if("object"!==r(e))throw Error("single-spa-react requires a configuration object");var t,n=a(a({},p),e);if(!n.React)throw Error("single-spa-react must be passed opts.React");if(!n.ReactDOM&&!n.ReactDOMClient)throw Error("single-spa-react must be passed opts.ReactDOM or opts.ReactDOMClient");if(n.renderType||(null!=(t=n.ReactDOMClient)&&t.createRoot?n.renderType="createRoot":n.renderType="render"),!n.rootComponent&&!n.loadRootComponent)throw Error("single-spa-react must be passed opts.rootComponent or opts.loadRootComponent");if(n.errorBoundary&&"function"!=typeof n.errorBoundary)throw Error("The errorBoundary opt for single-spa-react must either be omitted or be a function that returns React elements");!l&&n.React.createContext&&(l=n.React.createContext()),n.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}(n);var o={bootstrap:d.bind(null,n),mount:u.bind(null,n),unmount:f.bind(null,n)};return n.parcelCanUpdate&&(o.update=h.bind(null,n)),o}function d(e,t){return e.rootComponent?Promise.resolve():e.loadRootComponent(t).then(function(t){e.rootComponent=t})}function u(e,t){return new Promise(function(n,o){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 a,r=g(e,t,function(){n(this)}),i=s(e,t)(),l=function(e){var t=e.reactDom,n=e.renderType,o=e.elementToRender,a=e.domElement,r=t[n];if("function"!=typeof r)throw Error('renderType "'.concat(n,'" did not return a function.'));switch(n){case"createRoot":case"unstable_createRoot":case"createBlockingRoot":case"unstable_createBlockingRoot":var i=r(a);return i.render(o),i;case"hydrateRoot":return r(a,o);default:return r(o,a),null}}({elementToRender:r,domElement:i,reactDom:m(e),renderType:"function"==typeof(a=e).renderType?a.renderType():a.renderType});e.domElements[t.name]=i,e.renderResults[t.name]=l})}function f(e,t){return new Promise(function(n){e.unmountResolves[t.name]=n;var o=e.renderResults[t.name];o&&o.unmount?o.unmount():m(e).unmountComponentAtNode(e.domElements[t.name]),delete e.domElements[t.name],delete e.renderResults[t.name]})}function h(e,t){return new Promise(function(n){e.updateResolves[t.name]||(e.updateResolves[t.name]=[]),e.updateResolves[t.name].push(n);var o=g(e,t,null),a=e.renderResults[t.name];if(a&&a.render)a.render(o);else{var r=s(e,t)();m(e).render(o,r)}})}function m(e){return e.ReactDOMClient||e.ReactDOM}function g(e,t,n){var o=e.React.createElement(e.rootComponent,t),r=l?e.React.createElement(l.Provider,{value:t},o):o;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),r=e.React.createElement(e.errorBoundaryClass,t,r)),r=e.React.createElement(e.SingleSpaRoot,a(a({},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])}}),r)}},22244(e,t,n){"use strict";let o;n.d(t,{AG:()=>ew,EH:()=>er,fz:()=>eP,xL:()=>G});var a=Object.freeze({__proto__:null,get start(){return eR},get ensureJQuerySupport(){return eh},get setBootstrapMaxTime(){return Z},get setMountMaxTime(){return Y},get setUnmountMaxTime(){return J},get setUnloadMaxTime(){return X},get registerApplication(){return ew},get unregisterApplication(){return eE},get getMountedApps(){return e$},get getAppStatus(){return ek},get unloadApplication(){return eS},get checkActivityFunctions(){return eC},get getAppNames(){return eA},get pathToActiveWhen(){return eP},get navigateToUrl(){return er},get patchHistoryApi(){return ed},get triggerAppChange(){return eB},get addErrorHandler(){return p},get removeErrorHandler(){return c},get mountRootParcel(){return G},get NOT_LOADED(){return f},get LOADING_SOURCE_CODE(){return h},get NOT_BOOTSTRAPPED(){return m},get BOOTSTRAPPING(){return g},get NOT_MOUNTED(){return y},get MOUNTING(){return b},get UPDATING(){return $},get LOAD_ERROR(){return x},get MOUNTED(){return v},get UNLOADING(){return k},get UNMOUNTING(){return A},get SKIP_BECAUSE_BROKEN(){return w}}),r=("u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof global?global:"u">typeof self?self:{}).CustomEvent,i=!function(){try{var e=new r("cat",{detail:{foo:"bar"}});return"cat"===e.type&&"bar"===e.detail.foo}catch(e){}return!1}()?"u">typeof document&&"function"==typeof document.createEvent?function(e,t){var n=document.createEvent("CustomEvent");return t?n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):n.initCustomEvent(e,!1,!1,void 0),n}:function(e,t){var n=document.createEventObject();return n.type=e,t?(n.bubbles=!!t.bubbles,n.cancelable=!!t.cancelable,n.detail=t.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n}:r;let s=[];function l(e,t,n){let o=u(e,t,n);s.length?s.forEach(e=>e(o)):setTimeout(()=>{throw o})}function p(e){if("function"!=typeof e)throw Error(d(28,!1));s.push(e)}function c(e){if("function"!=typeof e)throw Error(d(29,!1));let t=!1;return s=s.filter(n=>{let o=n===e;return t=t||o,!o}),t}function d(e,t,...n){return`single-spa minified message #${e}: ${t?t+" ":""}See https://single-spa.js.org/error/?code=${e}${n.length?`&arg=${n.join("&arg=")}`:""}`}function u(e,t,n){let o,a=`${D(t)} '${S(t)}' died in status ${t.status}: `;if(e instanceof Error){try{e.message=a+e.message}catch(e){}o=e}else{console.warn(d(30,!1,t.status,S(t)));try{o=Error(a+JSON.stringify(e))}catch(t){o=e}}return o.appOrParcelName=S(t),t.status=n,o}let f="NOT_LOADED",h="LOADING_SOURCE_CODE",m="NOT_BOOTSTRAPPED",g="BOOTSTRAPPING",y="NOT_MOUNTED",b="MOUNTING",v="MOUNTED",$="UPDATING",A="UNMOUNTING",k="UNLOADING",x="LOAD_ERROR",w="SKIP_BECAUSE_BROKEN";function C(e){return e.status===v}function E(e){try{return e.activeWhen(window.location)}catch(t){return l(t,e,w),!1}}function S(e){return e.name}function z(e){return!!e.unmountThisParcel}function D(e){return z(e)?"parcel":"application"}function P(){for(let e=arguments.length-1;e>0;e--)for(let t in arguments[e])"__proto__"!==t&&(arguments[e-1][t]=arguments[e][t]);return arguments[0]}function M(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return e[n];return null}function N(e){return e&&("function"==typeof e||Array.isArray(e)&&!M(e,e=>"function"!=typeof e))}function T(e,t){let n=e[t]||[];0===(n=Array.isArray(n)?n:[n]).length&&(n=[()=>Promise.resolve()]);let o=D(e),a=S(e);return function(e){return n.reduce((n,r,i)=>n.then(()=>{let n=r(e);return B(n)?n:Promise.reject(d(15,!1,o,a,t,i))}),Promise.resolve())}}function B(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch}let O=[];function I(e,t){return Promise.resolve().then(()=>e.status!==m?e:(e.status=g,e.bootstrap?Q(e,"bootstrap").then(n).catch(n=>{if(t)throw u(n,e,w);return l(n,e,w),e}):Promise.resolve().then(n)));function n(){return e.status=y,e}}function j(e,t){return Promise.resolve().then(()=>{if(e.status!==v)return e;return e.status=A,Promise.all(Object.keys(e.parcels).map(t=>e.parcels[t].unmountThisParcel())).then(n,o=>n().then(()=>{let n=Error(o.message);if(t)throw u(n,e,w);l(n,e,w)})).then(()=>e);function n(){return Q(e,"unmount").then(()=>{e.status=y},n=>{if(t)throw u(n,e,w);l(n,e,w)})}})}let R=!1,F=!1;function L(e,t){return Promise.resolve().then(()=>e.status!==y?e:(R||(window.dispatchEvent(new i("single-spa:before-first-mount")),R=!0),e.status=b,Q(e,"mount").then(()=>(e.status=v,F||(window.dispatchEvent(new i("single-spa:first-mount")),F=!0),e)).catch(n=>{return e.status=v,j(e,!0).then(o,o);function o(){if(t)throw u(n,e,w);return l(n,e,w),e}})))}let W=0,V={parcels:{}};function G(){return U.apply(V,arguments)}function U(e,t){let n,o,a,r=this;if(!e||"object"!=typeof e&&"function"!=typeof e)throw Error(d(2,!1));if(e.name&&"string"!=typeof e.name)throw Error(d(3,!1,typeof e.name));let i=W++,s=e.name||`parcel-${i}`;if("object"!=typeof t)throw Error(d(4,!1,s,typeof t));if(!t.domElement)throw Error(d(5,!1,s));let l="function"==typeof e,p=l?e:()=>Promise.resolve(e),c={id:i,parcels:{},status:l?h:m,customProps:t,parentName:S(r),unmountThisParcel:()=>b.then(()=>{if(c.status!==v)throw Error(d(6,!1,s,c.status));return j(c,!0)}).then(e=>(c.parentName&&delete r.parcels[c.id],e)).then(e=>(o(e),e)).catch(e=>{throw c.status=w,a(e),e})};r.parcels[i]=c;let f=p();if(!f||"function"!=typeof f.then)throw Error(d(7,!1));let g=(f=f.then(e=>{if(!e)throw Error(d(8,!1));if(s=e.name||`parcel-${i}`,Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!N(e.bootstrap))throw Error(d(9,!1,s));if(!N(e.mount))throw Error(d(10,!1,s));if(!N(e.unmount))throw Error(d(11,!1,s));if(e.update&&!N(e.update))throw Error(d(12,!1,s));let t=T(e,"bootstrap"),o=T(e,"mount"),a=T(e,"unmount");c.status=m,c.name=s,c.bootstrap=t,c.mount=o,c.unmount=a,c.timeouts=ee(e.timeouts),e.update&&(c.update=T(e,"update"),n.update=function(e){return c.customProps=e,q(Promise.resolve().then(()=>{if(c.status!==v)throw Error(d(32,!1,S(c)));return c.status=$,Q(c,"update").then(()=>(c.status=v,c)).catch(e=>{throw u(e,c,w)})}))})})).then(()=>I(c,!0)),b=g.then(()=>L(c,!0)),A=new Promise((e,t)=>{o=e,a=t});return n={mount:()=>q(Promise.resolve().then(()=>{if(c.status!==y)throw Error(d(13,!1,s,c.status));return r.parcels[i]=c,L(c)})),unmount:()=>q(c.unmountThisParcel()),getStatus:()=>c.status,loadPromise:q(f),bootstrapPromise:q(g),mountPromise:q(b),unmountPromise:q(A)}}function q(e){return e.then(()=>null)}function H(e){let t=S(e),n="function"==typeof e.customProps?e.customProps(t,window.location):e.customProps;("object"!=typeof n||null===n||Array.isArray(n))&&(n={},console.warn(d(40,!1),t,n));let o=P({},n,{name:t,mountParcel:U.bind(e),singleSpa:a});return z(e)&&(o.unmountSelf=e.unmountThisParcel),o}let K={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}};function Z(e,t,n){if("number"!=typeof e||e<=0)throw Error(d(16,!1));K.bootstrap={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function Y(e,t,n){if("number"!=typeof e||e<=0)throw Error(d(17,!1));K.mount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function J(e,t,n){if("number"!=typeof e||e<=0)throw Error(d(18,!1));K.unmount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function X(e,t,n){if("number"!=typeof e||e<=0)throw Error(d(19,!1));K.unload={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function Q(e,t){let n=e.timeouts[t],o=n.warningMillis,a=D(e);return new Promise((r,i)=>{let s=!1,l=!1;e[t](H(e)).then(e=>{s=!0,r(e)}).catch(e=>{s=!0,i(e)}),setTimeout(()=>c(1),o),setTimeout(()=>c(!0),n.millis);let p=d(31,!1,t,a,S(e),n.millis);function c(e){s||(!0===e?(l=!0,n.dieOnTimeout?i(Error(p)):console.error(p)):!l&&(console.warn(p),e*o+o<n.millis&&setTimeout(()=>c(e+1),o)))}})}function ee(e){let t={};for(let n in K)t[n]=P({},K[n],e&&e[n]||{});return t}function et(e){return Promise.resolve().then(()=>{let t,n;return e.loadPromise?e.loadPromise:e.status!==f&&e.status!==x?e:(e.status=h,e.loadPromise=Promise.resolve().then(()=>{let o=e.loadApp(H(e));if(!B(o))throw n=!0,Error(d(33,!1,S(e)));return o.then(n=>{let o;e.loadErrorTime=null,"object"!=typeof(t=n)&&(o=34),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!N(t.bootstrap)&&(o=35),N(t.mount)||(o=36),N(t.unmount)||(o=37);let a=D(t);if(o){let n;try{n=JSON.stringify(t)}catch(e){}return console.error(d(o,!1,a,S(e),n),t),l(void 0,e,w),e}return t.devtools&&t.devtools.overlays&&(e.devtools.overlays=P({},e.devtools.overlays,t.devtools.overlays)),e.status=m,e.bootstrap=T(t,"bootstrap"),e.mount=T(t,"mount"),e.unmount=T(t,"unmount"),e.unload=T(t,"unload"),e.timeouts=ee(t.timeouts),delete e.loadPromise,e})}).catch(t=>{let o;return delete e.loadPromise,n?o=w:(o=x,e.loadErrorTime=(new Date).getTime()),l(t,e,o),e}))})}let en="u">typeof window,eo={hashchange:[],popstate:[]},ea=["hashchange","popstate"];function er(e){let t;if("string"==typeof e)t=e;else if(this&&this.href)t=this.href;else{if(!(e&&e.currentTarget&&e.currentTarget.href&&e.preventDefault))throw Error(d(14,!1));t=e.currentTarget.href,e.preventDefault()}let n=eu(window.location.href),o=eu(t);0===t.indexOf("#")?window.location.hash=o.hash:n.host!==o.host&&o.host?window.location.href=t:o.pathname===n.pathname&&o.search===n.search?window.location.hash=o.hash:window.history.pushState(null,null,t)}function ei(e){if(e){let t=e[0].type;ea.indexOf(t)>=0&&eo[t].forEach(t=>{try{t.apply(this,e)}catch(e){setTimeout(()=>{throw e})}})}}function es(){eO([],arguments)}function el(e,t){return function(){let n=window.location.href,a=e.apply(this,arguments),r=window.location.href;return o&&n===r||window.dispatchEvent(function(e,t){let n;try{n=new PopStateEvent("popstate",{state:e})}catch(t){(n=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,e)}return n.singleSpa=!0,n.singleSpaTrigger=t,n}(window.history.state,t)),a}}let ep=null,ec=!1;function ed(e){if(ec)throw Error(d(43,!1));o=!e||!e.hasOwnProperty("urlRerouteOnly")||e.urlRerouteOnly,ec=!0,ep=window.history.replaceState,window.addEventListener("hashchange",es),window.addEventListener("popstate",es);let t=window.addEventListener,n=window.removeEventListener;window.addEventListener=function(e,n){if(!("function"==typeof n&&ea.indexOf(e)>=0)||M(eo[e],e=>e===n))return t.apply(this,arguments);eo[e].push(n)},window.removeEventListener=function(e,t){return"function"==typeof t&&ea.indexOf(e)>=0&&(eo[e]=eo[e].filter(e=>e!==t)),n.apply(this,arguments)},window.history.pushState=el(window.history.pushState,"pushState"),window.history.replaceState=el(ep,"replaceState")}function eu(e){let t=document.createElement("a");return t.href=e,t}en&&(window.singleSpaNavigate?console.warn(d(41,!1)):window.singleSpaNavigate=er);let ef=!1;function eh(e=window.jQuery){if(e||window.$&&window.$.fn&&window.$.fn.jquery&&(e=window.$),e&&!ef){let t=e.fn.on,n=e.fn.off;e.fn.on=function(e,n){return em.call(this,t,window.addEventListener,e,n,arguments)},e.fn.off=function(e,t){return em.call(this,n,window.removeEventListener,e,t,arguments)},ef=!0}}function em(e,t,n,o,a){return"string"!=typeof n?e.apply(this,a):(n.split(/\s+/).forEach(e=>{ea.indexOf(e)>=0&&(t(e,o),n=n.replace(e,""))}),""===n.trim()?this:e.apply(this,a))}let e_={};function eg(e){return Promise.resolve().then(()=>{let t=e_[S(e)];if(!t)return e;if(e.status===f)return ey(e,t),e;if(e.status===k)return t.promise.then(()=>e);if(e.status!==y&&e.status!==x)return e;let n=e.status===x?Promise.resolve():Q(e,"unload");return e.status=k,n.then(()=>(ey(e,t),e)).catch(n=>(delete e_[S(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,l(n,e,w),t.reject(n),e))})}function ey(e,t){delete e_[S(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,e.status=f,t.resolve()}function eb(e,t,n,o){e_[S(e)]={app:e,resolve:n,reject:o},Object.defineProperty(e_[S(e)],"promise",{get:t})}let ev=[];function e$(){return ev.filter(C).map(S)}function eA(){return ev.map(S)}function ek(e){let t=M(ev,t=>S(t)===e);return t?t.status:null}let ex=!1;function ew(e,t,n,o){var a,r;let i,s,l=(i={name:null,loadApp:null,activeWhen:null,customProps:null},"object"==typeof e?(function(e){if(Array.isArray(e)||null===e)throw Error(d(39,!1));let t=["name","app","activeWhen","customProps"],n=Object.keys(e).reduce((e,n)=>t.indexOf(n)>=0?e:e.concat(n),[]);if(0!==n.length)throw Error(d(38,!1,t.join(", "),n.join(", ")));if("string"!=typeof e.name||0===e.name.length||"object"!=typeof e.app&&"function"!=typeof e.app)throw Error(d(20,!1));let o=e=>"string"==typeof e||"function"==typeof e;if(!(o(e.activeWhen)||Array.isArray(e.activeWhen)&&e.activeWhen.every(o)))throw Error(d(24,!1));if(!eD(e.customProps))throw Error(d(22,!1))}(e),i.name=e.name,i.loadApp=e.app,i.activeWhen=e.activeWhen,i.customProps=e.customProps):(function(e,t,n,o){if("string"!=typeof e||0===e.length)throw Error(d(20,!1));if(!t)throw Error(d(23,!1));if("function"!=typeof n)throw Error(d(24,!1));if(!eD(o))throw Error(d(22,!1))}(e,t,n,o),i.name=e,i.loadApp=t,i.activeWhen=n,i.customProps=o),i.loadApp="function"!=typeof(a=i.loadApp)?()=>Promise.resolve(a):a,i.customProps=i.customProps||{},s=(s=Array.isArray(r=i.activeWhen)?r:[r]).map(e=>"function"==typeof e?e:eP(e)),i.activeWhen=e=>s.some(t=>t(e)),i);if(ej||ex||(ex=!0,setTimeout(()=>{ej||console.warn(d(1,!1))},5e3)),-1!==eA().indexOf(l.name))throw Error(d(21,!1,l.name));ev.push(P({loadErrorTime:null,status:f,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},l)),en&&(eh(),eO())}function eC(e=window.location){return ev.filter(t=>t.activeWhen(e)).map(S)}function eE(e){if(0===ev.filter(t=>S(t)===e).length)throw Error(d(25,!1,e));return(en?eS(e,{waitForUnmount:!1}):Promise.resolve()).then(()=>{let t=ev.map(S).indexOf(e);ev.splice(t,1)})}function eS(e,t={waitForUnmount:!1}){if("string"!=typeof e)throw Error(d(26,!1));let n=M(ev,t=>S(t)===e);if(!n)throw Error(d(27,!1,e));let o=e_[S(n)];if(t&&t.waitForUnmount){if(o)return o.promise;{let e=new Promise((t,o)=>{eb(n,()=>e,t,o)});return e}}{let e;return o?(e=o.promise,ez(n,o.resolve,o.reject)):e=new Promise((t,o)=>{eb(n,()=>e,t,o),ez(n,t,o)}),e}}function ez(e,t,n){Promise.resolve().then(()=>{if(M(eC(),t=>t===S(e)))return eB()}).then(()=>j(e).then(eg).then(()=>{t(),setTimeout(()=>{eO()})})).catch(n)}function eD(e){return!e||"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)}function eP(e,t){let n=function(e,t){let n=0,o=!1,a="^";"/"!==e[0]&&(e="/"+e);for(let t=0;t<e.length;t++){let n=e[t],a=o&&"/"===n;(!o&&":"===n||a)&&r(t)}return r(e.length),RegExp(a,"i");function r(r){let i=e.slice(n,r).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(a+=o?"[^/]+/?":i,r===e.length)if(o)t&&(a+="$");else{let e=t?"":".*";a="/"===a.charAt(a.length-1)?`${a}${e}$`:`${a}(/${e})?(#.*)?$`}o=!o,n=r}}(e,t);return e=>{let t=e.origin;t||(t=`${e.protocol}//${e.host}`);let o=e.href.replace(t,"").replace(e.search,"").split("?")[0];return n.test(o)}}let eM=!1,eN=[],eT=en&&window.location.href;function eB(){return eO()}function eO(e=[],t,n=!1){let o,a,r,s,l;if(eM)return new Promise((e,n)=>{eN.push({resolve:e,reject:n,eventArguments:t})});let{appsToUnload:p,appsToUnmount:c,appsToLoad:u,appsToMount:g}=(o=[],a=[],r=[],s=[],l=(new Date).getTime(),ev.forEach(e=>{let t=e.status!==w&&E(e);switch(e.status){case x:t&&l-e.loadErrorTime>=200&&r.push(e);break;case f:case h:t&&r.push(e);break;case m:case y:!t&&e_[S(e)]?o.push(e):t&&s.push(e);break;case v:t||a.push(e)}}),{appsToUnload:o,appsToUnmount:a,appsToLoad:r,appsToMount:s}),b,$=[],A=eT,k=eT=window.location.href;return ej?(eM=!0,b=p.concat(u,c,g),Promise.resolve().then(()=>(N(0===b.length?"before-no-app-change":"before-app-change",M(!0)),N("before-routing-event",M(!0,{cancelNavigation:C})),Promise.all($).then(n=>{if(n.some(e=>e))return ep.call(window.history,history.state,"",A.substring(location.origin.length)),eT=location.href,eM=!1,eO(e,t,!0);let o=p.map(eg),a=Promise.all(c.map(j).map(e=>e.then(eg)).concat(o));a.then(()=>{N("before-mount-routing-event",M(!0))},e=>{throw e});let r=u.map(e=>et(e).then(e=>eI(e,a))),i=g.filter(e=>0>u.indexOf(e)).map(e=>eI(e,a));return a.catch(e=>{throw D(),e}).then(()=>(D(),Promise.all(r.concat(i)).catch(t=>{throw e.forEach(e=>e.reject(t)),t}).then(z).then(()=>{},e=>{throw e})))})))):(b=u,Promise.resolve().then(()=>Promise.all(u.map(et)).then(D).then(()=>[]).catch(e=>{throw D(),e}).finally(()=>{})));function C(e=!0){let t="function"==typeof(null==e?void 0:e.then)?e:Promise.resolve(e);$.push(t.catch(e=>(console.warn(Error(d(42,!1))),console.warn(e),!1)))}function z(){let t=e$();e.forEach(e=>e.resolve(t));try{N(0===b.length?"no-app-change":"app-change",M()),N("routing-event",M())}catch(e){setTimeout(()=>{throw e})}if(eM=!1,eN.length>0){let e=eN;eN=[],eO(e)}return t}function D(){n||(e.forEach(e=>{ei(e.eventArguments)}),ei(t))}function M(e=!1,n){let o={},a={[v]:[],[y]:[],[f]:[],[w]:[]};e?(u.concat(g).forEach((e,t)=>{i(e,v)}),p.forEach(e=>{i(e,f)}),c.forEach(e=>{i(e,y)})):b.forEach(e=>{i(e)});let r={detail:{newAppStatuses:o,appsByNewStatus:a,totalAppChanges:b.length,originalEvent:null==t?void 0:t[0],oldUrl:A,newUrl:k}};return n&&P(r.detail,n),r;function i(e,t){let n=S(e);t=t||ek(n),o[n]=t,(a[t]=a[t]||[]).push(n)}}function N(e,t){n||window.dispatchEvent(new i(`single-spa:${e}`,t))}}function eI(e,t){return E(e)?I(e).then(e=>t.then(()=>E(e)?L(e):e)):t.then(()=>e)}let ej=!1;function eR(e){ej=!0,en&&(ed(e),eO())}en&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods={getRawAppData:function(){return[...ev]},reroute:eO,NOT_LOADED:f,toLoadPromise:et,toBootstrapPromise:I,unregisterApplication:eE,getProfilerData:function(){return O}})},43132(e,t,n){"use strict";n.d(t,{y:()=>a});let o=e=>{let t,n=new Set,o=(e,o)=>{let a="function"==typeof e?e(t):e;if(!Object.is(a,t)){let e=t;t=(null!=o?o:"object"!=typeof a||null===a)?a:Object.assign({},t,a),n.forEach(n=>n(t,e))}},a=()=>t,r={setState:o,getState:a,getInitialState:()=>i,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()}},i=t=e(o,a,r);return r},a=e=>e?o(e):o}}]);
26
+ ${e.stack}`,a(t)}}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)}if(void 0===e)return Error("'undefined' was thrown as an error");return Error(e.toString())}window.onerror=function(e){return console.error("Unexpected error: ",e),(0,o.Vt)({description:e??"Oops! An unexpected error occurred.",kind:"error",title:"Error"}),!1},window.onunhandledrejection=function(e){console.error("Unhandled rejection: ",e.reason),(0,o.Vt)({description:e.reason??"Oops! An unhandled promise rejection occurred.",kind:"error",title:"Error"})}},79424(e,t,n){"use strict";n.d(t,{dX:()=>c,wE:()=>h,_3:()=>i,uN:()=>f,$F:()=>d,Gz:()=>p,eb:()=>l,Sj:()=>u,mv:()=>s,PQ:()=>o.A});var o=n(19758);let a="ArrowFunctionExpression";var r=n(99053);function i(e,t={}){return u(e,t,m)}async function s(e,t={}){return f(e,t,m)}function l(e,t={}){return u(e,t,g)}function p(e,t={}){return f(e,t,g)}function c(e,t={}){return u(e,t,y)}function d(e,t={}){return f(e,t,y)}function u(e,t={},n){if("string"!=typeof e&&("object"!=typeof e||!e||!("type"in e)))throw`Unknown expression type ${e}. Expressions must either be a string or pre-compiled string.`;if("string"==typeof e&&0===e.trim().length)throw{type:"Empty expression",message:"Expression cannot be an empty string"};null==t&&(t={});let a=$(t,r.z),i=b("string"==typeof e?(0,o.A)(e):e,a);if(n(i))return i;throw{type:"Invalid result",message:"string"==typeof e?`The expression ${e} did not produce a valid result`:"The expression did not produce a valid result"}}async function f(e,t={},n){if("string"!=typeof e&&("object"!=typeof e||!e||!("type"in e)))return Promise.reject(`Unknown expression type ${e}. Expressions must either be a string or pre-compiled string.`);if("string"==typeof e&&0===e.trim().length)throw{type:"Empty expression",message:"Expression cannot be an empty string"};null==t&&(t={});let a=$(t,r.f);return Promise.resolve(b("string"==typeof e?(0,o.A)(e):e,a)).then(t=>{if(n(t))return t;throw{type:"Invalid result",message:"string"==typeof e?`The expression ${e} did not produce a valid result`:"The expression did not produce a valid result"}})}function h(e){return(0,o.A)(e)}function m(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e||e instanceof Date}function g(e){return"boolean"==typeof e}function y(e){return"number"==typeof e}function b(e,t){switch(e.type){case"UnaryExpression":var n,o,a,r,i,s,l,p,c,d,u,f,h=e,m=t;let g=b(h.argument,m);switch(h.operator){case"+":return+g;case"-":return-g;case"~":return~g;case"!":return!g;default:throw`Expression evaluator does not support operator '${h.operator}''`}case"BinaryExpression":var y=e,$=t;let w=b(y.left,$),C=b(y.right,$);switch(y.operator){case"+":return w+C;case"-":return w-C;case"*":return w*C;case"/":return w/C;case"%":return w%C;case"**":return w**C;case"==":return w==C;case"===":return w===C;case"!=":return w!=C;case"!==":return w!==C;case">":return w>C;case">=":return w>=C;case"<":return w<C;case"<=":return w<=C;case"in":return w in C;case"&&":return w&&C;case"||":return w||C;case"??":return w??C;default:throw`Expression evaluator does not support operator '${y.operator}' operator`}case"ConditionalExpression":return n=e,o=t,b(n.test,o)?b(n.consequent,o):b(n.alternate,o);case"CallExpression":var E=e,S=t;let z=E.arguments?.map(A(S)),D=b(E.callee,S);if(D){if("function"!=typeof D)throw`${x(E.callee)} is not a function`}else throw`No function named ${x(E.callee)} is defined in this context`;return D(...z);case"ArrowFunctionExpression":let P;return a=e,r=t,P=a.params?.map(e=>{if("Identifier"===e.type)return e.name;throw`Cannot handle parameter of type ${e.type}`})??[],(function(...e){if(e.length<P.length)throw`Required argument(s) ${P.slice(e.length,-1).join(", ")} were not provided`;let t=Object.fromEntries(P.reduce((t,n,o)=>{let a=e[o];return function e(t){if("string"==typeof t||"number"==typeof t||"boolean"==typeof t||"function"==typeof t||null===t||t instanceof RegExp)return!0;if("object"==typeof t){for(let n of Object.keys(t))if(!e(t[n]))return!1;return!0}if(Array.isArray(t)){for(let n of t)if(!e(n))break}return!1}(a)&&t.push([n,a]),t},[]));return b(a.body,r.addVariables(t))}).bind(r.thisObj??null);case"MemberExpression":return function(e,t){let n,o=b(e.object,t);if(void 0===o)switch(e.object.type){case"Identifier":{let n=v(e.object,t);throw ReferenceError(`ReferenceError: ${n} is not defined`)}case"MemberExpression":{let n=v(e.property,t);throw TypeError(`TypeError: cannot read properties of undefined (reading '${n}')`)}default:throw`VisitMemberExpression does not support operator '${e.object.type}' type`}let a=o;if("string"==typeof o)a=String.prototype;else if("number"==typeof o)a=Number.prototype;else if("function"==typeof o);else if("object"!=typeof o)throw`VisitMemberExpression does not support member access on type ${typeof o}`;switch(t.thisObj=a,e.property.type){case"Identifier":case"MemberExpression":n=b(e.property,t);break;default:{let a=b(e.property,t);if(void 0===a)throw{type:"Illegal property access",message:"No property was supplied to the property access"};k(a),n=o[a]}}return"function"==typeof n?n.bind(o):n}(e,t);case"ArrayExpression":return i=e,s=t,i.elements?.map(A(s));case"SequenceExpression":let M;return l=e,p=t,(M=l.expressions.map(A(p)))[M.length-1];case"NewExpression":var N=e,T=t;if(N.callee&&"Identifier"===N.callee.type){let e=N.arguments?.map(A(T));switch(N.callee.name){case"Date":return new Date(...e);case"RegExp":return new RegExp(...e);default:throw`Cannot instantiate object of type ${N.callee.name}`}}if(N.callee)throw"new must be called with either Date or RegExp";throw'Could not handle "new" without a specified class';case"Literal":return k((c=e).value),c.value;case"Identifier":var B=e,O=t;k(B.name);let I=O.thisObj;if(I&&("object"==typeof I||"function"==typeof I)&&B.name in I){let e=I[B.name];return k(e),e}if(O.variables&&B.name in O.variables){let e=O.variables[B.name];return k(e),e}return B.name in O.globals?O.globals[B.name]:void 0;case"TemplateLiteral":let j,R;return d=e,u=t,j=d.expressions?.map(A(u))??[],(R=d.quasis?.map(A(u))??[]).filter(e=>!e.tail).map(e=>e.value).join("")+j.join("")+R.filter(e=>e.tail).map(e=>e.value).join("");case"TemplateElement":return{value:(f=e).cooked,tail:f.tail};default:throw`Expression evaluator does not support expression of type '${e.type}'`}}function v(e,t){switch(e.type){case"Literal":return e.value;case"Identifier":return e.name;case"MemberExpression":return v(e.property,t);default:throw`VisitExpressionName does not support expression of type '${e.type}'`}}function $(e,t){let n={thisObj:void 0,variables:{...e},globals:{...t},addVariables(e){return this.variables={...this.variables,...e},this}};return n.addVariables.bind(n),n}function A(e){return function(t){return null===t?null:b(t,e)}}function k(e){if("__proto__"===e||"prototype"===e||"constructor"===e)throw{type:"Illegal property access",message:`Cannot access the ${e} property of objects`}}function x(e){return e?"MemberExpression"===e.type?e.property?.name:e.name:null}o.A.plugins.register({name:"arrow",init(e){e.addBinaryOp("=>",.1,!0),e.hooks.add("gobble-expression",function(t){if(this.gobbleSpaces(),this.code===e.OPAREN_CODE){let n=this.index;if(this.index++,this.gobbleSpaces(),this.code===e.CPAREN_CODE){this.index++;let e=this.gobbleBinaryOp();if("=>"===e){let n=this.gobbleBinaryExpression();n||this.throwError("Expected expression after "+e),t.node={type:a,params:null,body:n};return}}this.index=n}}),e.hooks.add("after-expression",function(t){!function t(n){n&&(Object.values(n).forEach(e=>{e&&"object"==typeof e&&t(e)}),"=>"===n.operator&&(n.type=a,n.params=n.left?[n.left]:null,n.body=n.right,n.params&&n.params[0].type===e.SEQUENCE_EXP&&(n.params=n.params[0].expressions),delete n.left,delete n.right,delete n.operator))}(t.node)})}}),o.A.plugins.register({name:"new",init(e){e.addUnaryOp("new"),e.hooks.add("after-token",function(t){let n=t.node;if(n&&"new"===n.operator){n.argument&&[e.CALL_EXP,e.MEMBER_EXP].includes(n.argument.type)||this.throwError("Expected new function()"),t.node=n.argument;let o=t.node;for(;o.type===e.MEMBER_EXP||o.type===e.CALL_EXP&&o.callee.type===e.MEMBER_EXP;)o=o.type===e.MEMBER_EXP?o.object:o.callee.object;o.type="NewExpression"}})}}),o.A.plugins.register({name:"numbers",init(e){function t(e){return"x"===e||"X"===e?(this.index+=2,[[48,57],[65,70],[97,102]]):"b"===e||"B"===e?(this.index+=2,[[48,49]]):"o"===e||"O"===e||e>="0"&&e<="7"?(this.index+=e<="7"?1:2,[[48,55]]):null}function n(t){let n=this.index,o="",a=()=>{for(;e.isDecimalDigit(this.code)||95===this.code;)95===this.code?this.index++:o+=this.expr.charAt(this.index++)};a(),this.code===e.PERIOD_CODE&&(o+=this.expr.charAt(this.index++),a());let r=this.char;("e"===r||"E"===r)&&(o+=this.expr.charAt(this.index++),("+"===(r=this.char)||"-"===r)&&(o+=this.expr.charAt(this.index++)),a(),e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+o+this.char+")"));let i=this.code;if(e.isIdentifierStart(i))this.throwError("Variable names cannot start with a number ("+o+this.char+")");else if(i===e.PERIOD_CODE){o.length>1&&this.throwError(`Unexpected period ${JSON.stringify({chCode:i,number:o},null,2)}`),this.index=n;return}t.node={type:e.LITERAL,value:parseFloat(o),raw:this.expr.substring(n,this.index)}}e.hooks.add("gobble-token",function(o){if(48===this.code){var a,r,i;let s=this.index,l=this.expr.charAt(this.index+1),p=t.call(this,l);if(!p)return;let c="";for(;a=this.code,r=p,95===a||r.some(([e,t])=>a>=e&&a<=t);)95===this.code?this.index++:c+=this.expr.charAt(this.index++);if(e.isIdentifierPart(this.code)){if(e.isDecimalDigit(this.code)&&e.isDecimalDigit(l.charCodeAt(0))){this.index=s+1,n.call(this,o);return}this.throwError("unexpected char within number")}o.node={type:e.LITERAL,value:parseInt(c,"x"===(i=l)||"X"===i?16:"b"===i||"B"===i?2:8),raw:this.expr.substring(s,this.index)}}else(e.isDecimalDigit(this.code)||this.code===e.PERIOD_CODE)&&n.call(this,o)})}}),o.A.plugins.register({name:"regex",init(e){e.hooks.add("gobble-token",function(t){if(47===this.code){let n=++this.index,o=!1;for(;this.index<this.expr.length;){if(47===this.code&&!o){let o,a=this.expr.slice(n,this.index),r="";for(;++this.index<this.expr.length;){let e=this.code;if(e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57)r+=this.char;else break}try{o=new RegExp(a,r)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:o,raw:this.expr.slice(n-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===e.OBRACK_CODE?o=!0:o&&this.code===e.CBRACK_CODE&&(o=!1),this.index+=92===this.code?2:1}this.throwError("Unclosed Regex")}})}}),o.A.plugins.register({name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;let n=t.node,o=this.gobbleExpression();if(o||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let a=this.gobbleExpression();if(a||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:n,consequent:o,alternate:a},n.operator&&e.binary_ops[n.operator]<=.9){let o=n;for(;o.right.operator&&e.binary_ops[o.right.operator]<=.9;)o=o.right;t.node.test=o.right,o.right=t.node,t.node=n}}else this.throwError("Expected :")}})}}),o.A.plugins.register({name:"jsepTemplateLiteral",init(e){function t(e,n=!0){if(96===this.code){let t={type:"TemplateLiteral",quasis:[],expressions:[]},o="",a="",r=!1,i=this.expr.length,s=()=>t.quasis.push({type:"TemplateElement",value:{raw:a,cooked:o},tail:r});for(;this.index<i;){let i=this.expr.charAt(++this.index);if("`"===i)return this.index+=1,r=!0,s(),e.node=t,n&&(e.node=this.gobbleTokenProperty(e.node)),e.node;if("$"===i&&"{"===this.expr.charAt(this.index+1))this.index+=2,s(),a="",o="",t.expressions.push(...this.gobbleExpressions(125)),125!==this.code&&this.throwError("unclosed ${");else if("\\"===i)switch(a+=i,i=this.expr.charAt(++this.index),a+=i,i){case"n":o+="\n";break;case"r":o+="\r";break;case"t":o+=" ";break;case"b":o+="\b";break;case"f":o+="\f";break;case"v":o+="\v";break;default:o+=i}else o+=i,a+=i}this.throwError("Unclosed `")}}e.hooks.add("gobble-token",t),e.hooks.add("after-token",function(n){if((n.node.type===e.IDENTIFIER||n.node.type===e.MEMBER_EXP)&&96===this.code)return n.node={type:"TaggedTemplateExpression",tag:n.node,quasi:t.bind(this)(n,!1)},n.node=this.gobbleTokenProperty(n.node),n.node})}}),o.A.addBinaryOp("in",7),o.A.addBinaryOp("??",1)},99053(e,t,n){"use strict";n.d(t,{f:()=>a,z:()=>o});let o={Array,Boolean,Symbol,Infinity,NaN,Math,Number,BigInt,String,RegExp,JSON,isFinite,isNaN,parseFloat,parseInt,decodeURI,encodeURI,encodeURIComponent,Object:{__proto__:void 0,assign:Object.assign.bind(null),fromEntries:Object.fromEntries.bind(null),hasOwn:Object.hasOwn.bind(null),keys:Object.keys.bind(null),is:Object.is.bind(null),values:Object.values.bind(null)}},a={...o,Promise}},26223(e,t,n){"use strict";n.d(t,{J_:()=>et,zx:()=>I,ES:()=>S,FY:()=>j,zF:()=>b,Uh:()=>es,io:()=>J,Ef:()=>f,wG:()=>ec,Qb:()=>ei,dO:()=>u,o1:()=>eo,rD:()=>er,Vx:()=>W,sr:()=>V,YX:()=>ea,Tj:()=>D,Gp:()=>L,K0:()=>M,Q_:()=>ee,a9:()=>g,xg:()=>z,DQ:()=>y,Ml:()=>en,Xb:()=>Q,Fg:()=>q,VK:()=>P,pm:()=>Y,Ju:()=>U,cL:()=>F,ap:()=>R,Yo:()=>N,No:()=>T});var o=n(30325),a=n(33869),r=n(79424),i=n(25767),s=n(4230),l=n(6564),p=n(42853),c=n(20405),d=(0,n(11888).A)(function(e,t,n){(0,c.A)(e,t,n)});function u(e=!0,t=!1){return f((0,l.s)(),e,t)}function f(e,t=!0,n=!1){return!!(e?t:n)}var h=n(21013);let m=(0,h.Zd)("extensionsInternal",{slots:{},extensions:{}}),g=()=>(0,h.jf)("extensionsInternal",{slots:{},extensions:{}});function y(e){let t=m.getState(),n=e(t);n!==t&&m.setState(n)}let b=()=>(0,h.jf)("extensions",{slots:{}});function v(e){let 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,p.A)(a.hs.getState().mountedExtensions,t)||a.hs.setState({mountedExtensions:t})}v(m.getState()),m.subscribe(v);let $=g(),A=b(),k=(0,a.YP)(),x=(0,a.GI)();function w(e,t,n,o,r){let i={},s=(0,l.s)(),c=Object.entries(o.flags).filter(([,{enabled:e}])=>e).map(([e])=>e);for(let[o,l]of Object.entries(e.slots)){let{config:p}=(0,a.vu)(t,l.name),d=O(o,e,p,n,c,s,r.session);i[o]={moduleName:l.moduleName,assignedExtensions:d}}(0,p.A)(A.getState().slots,i)||A.setState({slots:i})}function C(){w($.getState(),k.getState(),x.getState(),i.jX.getState(),o.eA.getState())}function E(e,t,n){return{moduleName:t,name:e,attachedIds:[],config:null,state:n}}function S(e){let[t]=e.split("#");return t}function z(e,t){let n=S(t);return e.extensions[n]}function D(e){return z($.getState(),e)}$.subscribe(e=>{w(e,k.getState(),x.getState(),i.jX.getState(),o.eA.getState())}),k.subscribe(e=>{w($.getState(),e,x.getState(),i.jX.getState(),o.eA.getState())}),x.subscribe(e=>{w($.getState(),k.getState(),e,i.jX.getState(),o.eA.getState())}),i.jX.subscribe(e=>{w($.getState(),k.getState(),x.getState(),e,o.eA.getState())}),o.eA.subscribe(e=>{w($.getState(),k.getState(),x.getState(),i.jX.getState(),e)}),C(),(0,s.gj)(C);let P=e=>$.setState(t=>(t.extensions[e.name]={...e,instances:[]},t));function M(e,t){y(n=>{let o=n.slots[e];return o?{...n,slots:{...n.slots,[e]:{...o,attachedIds:[...o.attachedIds,t]}}}:{...n,slots:{...n.slots,[e]:{...E(e),attachedIds:[t]}}}})}function N(e,t){y(n=>{let o=n.slots[e];return o&&o.attachedIds.includes(t)?{...n,slots:{...n.slots,[e]:{...o,attachedIds:o.attachedIds.filter(e=>e!==t)}}}:n})}function T(e){y(t=>{let n=t.slots[e];return n?{...t,slots:{...t.slots,[e]:{...n,attachedIds:[]}}}:t})}function B(e,t,n,o){let a=t.indexOf(e);if(-1!==a)return a;{if(void 0!==n)return 1e3+n;let t=o.indexOf(e);return -1!==t?2e3+t:-1}}function O(e,t,n,i,s,l,p){let c=function(e,t){let n=e.add||[],o=e.remove||[],a=e.order||[],{extensions:r}=$.getState();return[...t,...n].filter(e=>!o.includes(e)).sort((e,n)=>{let o=B(e,a,r[S(e)]?.order,t),i=B(n,a,r[S(n)]?.order,t);return -1===i?-1:-1===o?1:o-i})}(n,t.slots[e].attachedIds),u=[],h=t.slots[e]?.state,m=h&&"object"==typeof h?{session:p,...h}:{session:p};for(let h of c){let{config:c}=(0,a.P0)(i,e,h),g=d(c,(0,a.g$)(n,e,h)),y=S(h),b=t.extensions[y];if(b){let t=g?.["Display conditions"]?.privileges??b.privileges??[];if(t&&("string"==typeof t||Array.isArray(t)&&t.length>0)&&(!p?.user||!(0,o.st)(t,p.user)))continue;let n=g?.["Display conditions"]?.expression||b.displayExpression;if(void 0!==n&&"string"==typeof n&&n.trim().length>0)try{if(!(0,r.eb)(n,m))continue}catch(t){console.error(`Error while evaluating expression '${n}' for extension ${y} in slot ${e}`,t);continue}if(b.featureFlag&&!s.includes(b.featureFlag)||window.offlineEnabled&&!f(l,b.online,b.offline))continue;u.push({id:h,name:y,moduleName:b.moduleName,config:g,featureFlag:b.featureFlag,meta:b.meta,online:g?.["Display conditions"]?.online??b.online??!0,offline:g?.["Display conditions"]?.offline??b.offline??!1})}}return u}function I(e){let t=$.getState(),{config:n}=(0,a.G9)(e),r=x.getState(),s=i.jX.getState(),p=o.eA.getState(),c=(0,l.s)();return O(e,t,n,r,Object.entries(s.flags).filter(([,{enabled:e}])=>e).map(([e])=>e),c,p.session)}let j=(e,t,n)=>$.setState(o=>{let a=o.slots[t]?.moduleName;if(a&&a!=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 ${a}.`),o;if(a&&a==e)return o;if(o.slots[t])return{...o,slots:{...o.slots,[t]:{...o.slots[t],moduleName:e,state:n}}};let r=E(t,e,n);return{...o,slots:{...o.slots,[t]:{...r}}}});function R(e,t,n=!1){$.setState(o=>{let a=n?d(o.slots[e].state,t):t;return{...o,slots:{...o.slots,[e]:{...o.slots[e],state:a}}}})}let F=()=>A.setState(()=>({slots:{},extensions:{}})),L=(0,h.Zd)("left-nav",{slotName:null,basePath:window.spaBase,mode:"normal"});function W({name:e,basePath:t,mode:n,componentContext:o,state:a}){L.setState({slotName:e,basePath:t,mode:n??"normal",componentContext:o,state:a})}function V(e){L.getState().slotName===e&&L.setState(L.getInitialState(),!0)}let G=(0,h.Zd)("modalRegistry",{modals:{}});function U(e){G.setState(t=>(t.modals[e.name]=e,t))}function q(e){let t=G.getState().modals[e];if(!t){let n=D(e);n&&(t={name:e,load:n.load,moduleName:n.moduleName},console.warn(`Modal ${e} was registered as an extension. This is deprecated and will be removed in the future. Please register it in the "modals" section of routes.json instead of the "extensions" section.`),U(t))}return t}var H=n(60319);let K=(0,h.Zd)("workspaceRegistrations",{workspaces:{}}),Z=(0,h.Zd)("workspaceGroups",{workspaceGroups:{}});function Y(e){K.setState(t=>({workspaces:{...t.workspaces,[e.name]:{...e,load:e.load,preferredWindowSize:e.preferredWindowSize??"normal",type:e.type??"form",canHide:e.canHide??!1,canMaximize:e.canMaximize??!1,width:e.width??"narrow",groups:e.groups??[]}}}))}function J(e){Z.setState(t=>{let n=t.workspaceGroups[e.name];return n?{workspaceGroups:{...t.workspaceGroups,[e.name]:{...n,members:Array.from(new Set([...n.members,...e.members]))}}}:{workspaceGroups:{...t.workspaceGroups,[e.name]:{name:e.name,members:e.members}}}})}let X=new Set;function Q(e){let t=K.getState().workspaces;if(t[e])return t[e];{let t=D(e);if(t){var n;let o;return X.has(e)||(console.warn(`The workspace '${e}' is registered as an extension. This is deprecated. Please register it in the "workspaces" section of the routes.json file.`),X.add(e)),{name:t.name,title:(n=t,"string"==typeof(o=n?.meta?.title)?o:o&&"object"==typeof o?(0,H.t)(n.moduleName,o.key,o.default):n.name),moduleName:t.moduleName,preferredWindowSize:t.meta?.screenSize??"normal",load:t.load,type:t.meta?.type??"form",canHide:t.meta?.canHide??!1,canMaximize:t.meta?.canMaximize??!1,width:t.meta?.width??"narrow",groups:t.meta?.groups??[]}}throw Error(`No workspace named '${e}' has been registered.`)}}function ee(e){let t=Z.getState().workspaceGroups;if(t[e])return t[e];throw Error(`No workspace group named '${e}' has been registered.`)}let et=(0,h.Zd)("workspace2",{registeredGroupsByName:{},registeredWindowsByName:{},registeredWorkspacesByName:{},openedGroup:null,openedWindows:[],workspaceTitleByWorkspaceName:{},isMostRecentlyOpenedWindowHidden:!1});function en(e){let{registeredWorkspacesByName:t,registeredWindowsByName:n}=et.getState(),o=t[e];if(o){let t=n[o.window];if(t)return t;throw Error(`No workspace window found with name: ${o.window} for workspace: ${e}`)}throw Error(`No workspace found with name: ${e}`)}function eo(e){let{registeredGroupsByName:t,registeredWindowsByName:n}=et.getState(),o=n[e];if(o){let n=t[o.group];if(n)return n;throw Error(`No workspace group found with name: ${o.group} for window: ${e}`)}throw Error(`No workspace window found with name: ${e}`)}function ea(e){let{openedWindows:t}=et.getState();return t.findIndex(t=>t.openedWorkspaces.find(t=>t.workspaceName===e))}function er(e,t){if(0==t.length)return;let{registeredGroupsByName:n}=et.getState(),o={...n};for(let n of t){if(o[n.name])throw Error(`Cannot register workspace group ${n.name} more than once`);o[n.name]={...n,moduleName:e}}et.setState({registeredGroupsByName:o})}function ei(e,t){if(0==t.length)return;let{registeredWindowsByName:n}=et.getState(),o={...n};for(let n of t){if(o[n.name])throw Error(`Cannot register workspace window ${n.name} more than once`);let t={...n,moduleName:e};o[n.name]=t}et.setState({registeredWindowsByName:o})}function es(e,t){if(0==t.length)return;let{registeredWorkspacesByName:n}=et.getState(),o={...n};for(let n of t){if(o[n.name])throw Error(`Cannot register workspace ${n.name} more than once`);let t={...n,moduleName:e};o[n.name]=t}et.setState({registeredWorkspacesByName:o})}var el=n(22244);let ep=0;async function ec(e,t,n,o,a=e=>e,r={}){let i=S(o),s=D(o),l=null;if(e){if(!s)throw Error(`Couldn't find extension '${i}' to attach to '${t}'`);let{meta:p,moduleName:c,online:d,offline:f,load:h}=s;if(u(d,f)){y(a=>({...a,extensions:{...a.extensions,[i]:{...a.extensions[i],instances:[...a.extensions[i].instances,{domElement:e,id:o,slotName:t,slotModuleName:n}]}}}));let s=await h(),d=ep++;l=(0,el.xL)(a({...s,name:`${t}/${i}-${d}`}),{...r,_meta:p,_extensionContext:{extensionId:o,extensionSlotName:t,extensionSlotModuleName:n,extensionModuleName:c},domElement:e})}}else console.warn(`Tried to render ${o} into ${t} but no DOM element was available.`);return l}},4230(e,t,n){"use strict";n.d(t,{$3:()=>g,FI:()=>h,LQ:()=>m,Vt:()=>y,Yt:()=>a,bJ:()=>b,bK:()=>v,dX:()=>$,ff:()=>p,gj:()=>r,ls:()=>A,pc:()=>l,sT:()=>i});let o="openmrs:connectivity-changed";function a(e){window.dispatchEvent(new CustomEvent(o,{detail:{online:e}}))}function r(e){if(!window.offlineEnabled)return()=>{};let t=t=>e(t.detail);return window.addEventListener(o,t),()=>window.removeEventListener(o,t)}function i(e){return e({online:!window.offlineEnabled||navigator.onLine}),r(e)}let s="openmrs:precache-static-dependencies";function l(e={}){window.dispatchEvent(new CustomEvent(s,{detail:e}))}function p(e){let t=t=>e(t.detail);return window.addEventListener(s,t),()=>window.removeEventListener(s,t)}let c="openmrs:notification-shown",d="openmrs:actionable-notification-shown",u="openmrs:toast-shown",f="openmrs:snack-bar-shown";function h(e){window.dispatchEvent(new CustomEvent(c,{detail:e}))}function m(e){window.dispatchEvent(new CustomEvent(d,{detail:e}))}function g(e){window.dispatchEvent(new CustomEvent(f,{detail:e}))}function y(e){window.dispatchEvent(new CustomEvent(u,{detail:e}))}function b(e){let t=t=>e(t.detail);return window.addEventListener(c,t),()=>window.removeEventListener(c,t)}function v(e){let t=t=>e(t.detail);return window.addEventListener(d,t),()=>window.removeEventListener(d,t)}function $(e){let t=t=>e(t.detail);return window.addEventListener(u,t),()=>window.removeEventListener(u,t)}function A(e){let t=t=>e(t.detail);return window.addEventListener(f,t),()=>window.removeEventListener(f,t)}},86236(e,t,n){"use strict";n.d(t,{tA:()=>v,JK:()=>b,g4:()=>$,vf:()=>r,MY:()=>i,Wh:()=>y,qh:()=>c,lz:()=>s,D_:()=>p,JG:()=>u,oo:()=>h,zl:()=>f});var o=n(82034);let a=(0,n(21013).Zd)("breadcrumbs",[]);function r(e){return i([e])}function i(e){let t=[...s(),...e.map(e=>({matcher:e.matcher instanceof RegExp?e.matcher:"string"==typeof e.matcher?(0,o.pathToRegexp)(e.matcher).regexp:(0,o.pathToRegexp)(e.path).regexp,settings:e}))];a.setState(t,!0)}function s(){return a.getState()}function l(e,t){if(t)return function(e,t){let[n]=e.filter(e=>e.matcher.test(t));return n}(e,t)||function(e,t){let n=t.split("/");for(;n.length>1;){n.pop();let t=l(e,n.join("/"));if(t)return t}}(e,t)}function p(e,t){if(e.length>0){let n=l(e,t);if(n){let t=[n],o=l(e,n.settings.parent);for(;void 0!==o;)t.push(o),o=l(e,o.settings.parent);return t.reverse()}}return[]}function c(e){return p(s(),e)}var d=n(22244);function u(e,t){let n=window.getOpenmrsSpaBase().replace(/\/$/,"");return f(e,{openmrsBase:window.openmrsBase,openmrsSpaBase:n,...t}).replace(/^\/\//,"/")}function f(e,t){return Object.keys(t).reduce((e,n)=>e.split("${"+n+"}").join(t[n]),e)}function h({to:e,templateParams:t}){let n=window.getOpenmrsSpaBase().replace(/\/$/,""),o=u(e,t).replace(window.location.origin,"");o.startsWith(n)?(0,d.EH)(o):window.location.assign(o)}let m="openmrs:history";function g(e){let t=JSON.parse(sessionStorage.getItem(m)??"[]")||[];t.push(e),t.length>50&&(t=t.slice(-50)),sessionStorage.setItem(m,JSON.stringify(t))}function y(){0===JSON.parse(sessionStorage.getItem(m)??"[]").length&&document.referrer&&g(document.referrer),window.addEventListener("single-spa:routing-event",e=>{let t=b();e.detail.originalEvent?.singleSpaTrigger=="replaceState"?(t[t.length-1]=window.location.href,sessionStorage.setItem(m,JSON.stringify(t))):!e.detail.originalEvent?.singleSpa&&t.includes(window.location.href)?v({toUrl:window.location.href}):t[t.length-1]!==window.location.href&&g(window.location.href)})}function b(){return JSON.parse(sessionStorage.getItem(m)??"[]")}function v({toUrl:e}){let t=b(),n=t.lastIndexOf(e);if(-1!=n){let e=t.slice(0,n+1);h({to:t[n]}),sessionStorage.setItem(m,JSON.stringify(e))}else throw Error(`URL ${e} not found in history; cannot go back to it.`)}function $(){sessionStorage.removeItem(m)}},33704(e,t,n){"use strict";let o,a,r;n.d(t,{nr:()=>M,xN:()=>n7,u1:()=>ob,KG:()=>ok,FO:()=>n9,FE:()=>ou,LM:()=>nJ,sA:()=>os,Rs:()=>b,ff:()=>om,wn:()=>og,sK:()=>ox,lY:()=>oe,ms:()=>k,Zr:()=>n2,WK:()=>oA,WA:()=>of,UH:()=>v,cy:()=>ot,Gp:()=>n8,jU:()=>oi,Og:()=>P,iD:()=>od,C$:()=>n6,qb:()=>oc,Iq:()=>n1,NU:()=>o_,sZ:()=>y,yD:()=>oh,Io:()=>n3,wJ:()=>D,JC:()=>A,e:()=>nH,xc:()=>n5,pb:()=>n4,bO:()=>ol,AO:()=>nX,Td:()=>oy,Gj:()=>$});try{self["workbox:window:6.5.4"]&&_()}catch(e){}function i(e,t){return new Promise(function(n){var o=new MessageChannel;o.port1.onmessage=function(e){n(e.data)},e.postMessage(t,[o.port2])})}function s(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}try{self["workbox:core:6.5.4"]&&_()}catch(e){}var p=function(){var e=this;this.promise=new Promise(function(t,n){e.resolve=t,e.reject=n})};function c(e,t){var n=location.href;return new URL(e,n).href===new URL(t,n).href}var d=function(e,t){this.type=e,Object.assign(this,t)};function u(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function f(){}var h={type:"SKIP_WAITING"};function m(e,t){if(!t)return e&&e.then?e.then(f):Promise.resolve()}var g=function(e){function t(t,n){var o,a;return void 0===n&&(n={}),(o=e.call(this)||this).nn={},o.tn=0,o.rn=new p,o.en=new p,o.on=new p,o.un=0,o.an=new Set,o.cn=function(){var e=o.fn,t=e.installing;o.tn>0||!c(t.scriptURL,o.sn.toString())||performance.now()>o.un+6e4?(o.vn=t,e.removeEventListener("updatefound",o.cn)):(o.hn=t,o.an.add(t),o.rn.resolve(t)),++o.tn,t.addEventListener("statechange",o.ln)},o.ln=function(e){var t=o.fn,n=e.target,a=n.state,r=n===o.vn,i={sw:n,isExternal:r,originalEvent:e};!r&&o.mn&&(i.isUpdate=!0),o.dispatchEvent(new d(a,i)),"installed"===a?o.wn=self.setTimeout(function(){"installed"===a&&t.waiting===n&&o.dispatchEvent(new d("waiting",i))},200):"activating"===a&&(clearTimeout(o.wn),r||o.en.resolve(n))},o.dn=function(e){var t=o.hn,n=t!==navigator.serviceWorker.controller;o.dispatchEvent(new d("controlling",{isExternal:n,originalEvent:e,sw:t,isUpdate:o.mn})),n||o.on.resolve(t)},a=function(e){var t=e.data,n=e.ports,a=e.source;return u(o.getSW(),function(){o.an.has(a)&&o.dispatchEvent(new d("message",{data:t,originalEvent:e,ports:n,sw:a}))})},o.gn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(a.apply(this,e))}catch(e){return Promise.reject(e)}},o.sn=t,o.nn=n,navigator.serviceWorker.addEventListener("message",o.gn),o}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e;var n,o,a=t.prototype;return a.register=function(e){var t=(void 0===e?{}:e).immediate,n=void 0!==t&&t;try{var o,a,r,i=this;return o=function(){if(!n&&"complete"!==document.readyState)return m(new Promise(function(e){return window.addEventListener("load",e)}))},a=function(){return i.mn=!!navigator.serviceWorker.controller,i.yn=i.pn(),u(i.bn(),function(e){i.fn=e,i.yn&&(i.hn=i.yn,i.en.resolve(i.yn),i.on.resolve(i.yn),i.yn.addEventListener("statechange",i.ln,{once:!0}));var t=i.fn.waiting;return t&&c(t.scriptURL,i.sn.toString())&&(i.hn=t,Promise.resolve().then(function(){i.dispatchEvent(new d("waiting",{sw:t,wasWaitingBeforeRegister:!0}))}).then(function(){})),i.hn&&(i.rn.resolve(i.hn),i.an.add(i.hn)),i.fn.addEventListener("updatefound",i.cn),navigator.serviceWorker.addEventListener("controllerchange",i.dn),i.fn})},(r=o())&&r.then?r.then(a):a(r)}catch(e){return Promise.reject(e)}},a.update=function(){try{return this.fn?m(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(e){try{return u(this.getSW(),function(t){return i(t,e)})}catch(e){return Promise.reject(e)}},a.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&i(this.fn.waiting,h)},a.pn=function(){var e=navigator.serviceWorker.controller;return e&&c(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 u(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)}},n=[{key:"active",get:function(){return this.en.promise}},{key:"controlling",get:function(){return this.on.promise}}],s(t.prototype,n),o&&s(t,o),t}(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){var t;if("u"<typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(t=function(e){if(e){if("string"==typeof e)return l(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?l(e,void 0):void 0}}(e))){t&&(e=t);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(t=e[Symbol.iterator]()).next.bind(t)}(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}());function y(e,t){if(void 0!==r)return console.warn(`The application's Service Worker has already been registered. The new service worker at ${e} will not be registered.`),r;if(!("serviceWorker"in navigator))throw Error("Registering the Service Worker is not possible due to missing browser capabilities.");let n=new g(e,t);return r=n.register().then(()=>n.controlling.then(()=>n))}function b(){return r??Promise.resolve(void 0)}let v="x-omrs-offline-response-body",$="x-omrs-offline-response-status",A="x-omrs-offline-caching-strategy";async function k(e){let t=await b();return t?await 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."}}async function x(){let 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}async function w(){return!window.indexedDB}async function C(){return new Promise(e=>{let t=indexedDB.open("test");t.onerror=()=>e(!0),t.onsuccess=()=>e(!1)})}async function E(){return await C()||await w()||await x()}let S="openmrs3:offline-mode",z="unavailable";function D(){return{current:z,notAvailable:"unavailable"===z,active:"on"===z}}function P(e){"unavailable"!==z&&"unavailable"!==e&&(localStorage.setItem(S,"on"===e?"active":"disabled"),z=e)}async function M(){await E()||(z="active"===localStorage.getItem(S)?"on":"off"),navigator.onLine}let N="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,T=Object.keys,B=Array.isArray;function O(e,t){return"object"!=typeof t||T(t).forEach(function(n){e[n]=t[n]}),e}"u"<typeof Promise||N.Promise||(N.Promise=Promise);let I=Object.getPrototypeOf,j={}.hasOwnProperty;function R(e,t){return j.call(e,t)}function F(e,t){"function"==typeof t&&(t=t(I(e))),("u"<typeof Reflect?T:Reflect.ownKeys)(t).forEach(n=>{W(e,n,t[n])})}let L=Object.defineProperty;function W(e,t,n,o){L(e,t,O(n&&R(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},o))}function V(e){return{from:function(t){return e.prototype=Object.create(t.prototype),W(e.prototype,"constructor",e),{extend:F.bind(null,e.prototype)}}}}let G=Object.getOwnPropertyDescriptor;function U(e,t){let n;return G(e,t)||(n=I(e))&&U(n,t)}let q=[].slice;function H(e,t,n){return q.call(e,t,n)}function K(e,t){return t(e)}function Z(e){if(!e)throw Error("Assertion Failed")}function Y(e){N.setImmediate?setImmediate(e):setTimeout(e,0)}function J(e,t){return e.reduce((e,n,o)=>{var a=t(n,o);return a&&(e[a[0]]=a[1]),e},{})}function X(e,t){if(R(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var n=[],o=0,a=t.length;o<a;++o){var r=X(e,t[o]);n.push(r)}return n}var i=t.indexOf(".");if(-1!==i){var s=e[t.substr(0,i)];return void 0===s?void 0:X(s,t.substr(i+1))}}function Q(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){Z("string"!=typeof n&&"length"in n);for(var o=0,a=t.length;o<a;++o)Q(e,t[o],n[o])}else{var r=t.indexOf(".");if(-1!==r){var i=t.substr(0,r),s=t.substr(r+1);if(""===s)void 0===n?B(e)&&!isNaN(parseInt(i))?e.splice(i,1):delete e[i]:e[i]=n;else{var l=e[i];l&&R(e,i)||(l=e[i]={}),Q(l,s,n)}}else void 0===n?B(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function ee(e){var t={};for(var n in e)R(e,n)&&(t[n]=e[n]);return t}let et=[].concat;function en(e){return et.apply([],e)}let eo="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(en([8,16,32,64].map(e=>["Int","Uint","Float"].map(t=>t+e+"Array")))).filter(e=>N[e]),ea=eo.map(e=>N[e]);J(eo,e=>[e,!0]);let er=null;function ei(e){er="u">typeof WeakMap&&new WeakMap;let t=function e(t){if(!t||"object"!=typeof t)return t;let n=er&&er.get(t);if(n)return n;if(B(t)){n=[],er&&er.set(t,n);for(var o=0,a=t.length;o<a;++o)n.push(e(t[o]))}else if(ea.indexOf(t.constructor)>=0)n=t;else{let o=I(t);for(var r in n=o===Object.prototype?{}:Object.create(o),er&&er.set(t,n),t)R(t,r)&&(n[r]=e(t[r]))}return n}(e);return er=null,t}let{toString:es}={};function el(e){return es.call(e).slice(8,-1)}let ep="u">typeof Symbol?Symbol.iterator:"@@iterator",ec="symbol"==typeof ep?function(e){var t;return null!=e&&(t=e[ep])&&t.apply(e)}:function(){return null},ed={};function eu(e){var t,n,o,a;if(1==arguments.length){if(B(e))return e.slice();if(this===ed&&"string"==typeof e)return[e];if(a=ec(e)){for(n=[];!(o=a.next()).done;)n.push(o.value);return n}if(null==e)return[e];if("number"==typeof(t=e.length)){for(n=Array(t);t--;)n[t]=e[t];return n}return[e]}for(t=arguments.length,n=Array(t);t--;)n[t]=arguments[t];return n}let ef="u">typeof Symbol?e=>"AsyncFunction"===e[Symbol.toStringTag]:()=>!1;var eh="u">typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href),em=()=>!0;let e_=!Error("").stack;function eg(){if(e_)try{throw eg.arguments,Error()}catch(e){return e}return Error()}function ey(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(em).map(e=>"\n"+e).join("")):""}var eb=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],ev=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(eb),e$={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 eA(e,t){this._e=eg(),this.name=e,this.message=t}function ek(e,t){return e+". Errors: "+Object.keys(t).map(e=>t[e].toString()).filter((e,t,n)=>n.indexOf(e)===t).join("\n")}function ex(e,t,n,o){this._e=eg(),this.failures=t,this.failedKeys=o,this.successCount=n,this.message=ek(e,t)}function ew(e,t){this._e=eg(),this.name="BulkError",this.failures=Object.keys(t).map(e=>t[e]),this.failuresByPos=t,this.message=ek(e,t)}V(eA).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+ey(this._e,2))}},toString:function(){return this.name+": "+this.message}}),V(ex).from(eA),V(ew).from(eA);var eC=ev.reduce((e,t)=>(e[t]=t+"Error",e),{}),eE=ev.reduce((e,t)=>{var n=t+"Error";function o(e,o){this._e=eg(),this.name=n,e?"string"==typeof e?(this.message=`${e}${o?"\n "+o:""}`,this.inner=o||null):"object"==typeof e&&(this.message=`${e.name} ${e.message}`,this.inner=e):(this.message=e$[t]||n,this.inner=null)}return V(o).from(eA),e[t]=o,e},{});eE.Syntax=SyntaxError,eE.Type=TypeError,eE.Range=RangeError;var eS=eb.reduce((e,t)=>(e[t+"Error"]=eE[t],e),{}),ez=ev.reduce((e,t)=>(-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=eE[t]),e),{});function eD(){}function eP(e){return e}function eM(e,t){return null==e||e===eP?t:function(n){return t(e(n))}}function eN(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function eT(e,t){return e===eD?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var o=this.onsuccess,a=this.onerror;this.onsuccess=null,this.onerror=null;var r=t.apply(this,arguments);return o&&(this.onsuccess=this.onsuccess?eN(o,this.onsuccess):o),a&&(this.onerror=this.onerror?eN(a,this.onerror):a),void 0!==r?r:n}}function eB(e,t){return e===eD?t:function(){e.apply(this,arguments);var n=this.onsuccess,o=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?eN(n,this.onsuccess):n),o&&(this.onerror=this.onerror?eN(o,this.onerror):o)}}function eO(e,t){return e===eD?t:function(n){var o=e.apply(this,arguments);O(n,o);var a=this.onsuccess,r=this.onerror;this.onsuccess=null,this.onerror=null;var i=t.apply(this,arguments);return a&&(this.onsuccess=this.onsuccess?eN(a,this.onsuccess):a),r&&(this.onerror=this.onerror?eN(r,this.onerror):r),void 0===o?void 0===i?void 0:i:O(o,i)}}function eI(e,t){return e===eD?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function ej(e,t){return e===eD?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var o=this,a=arguments.length,r=Array(a);a--;)r[a]=arguments[a];return n.then(function(){return t.apply(o,r)})}return t.apply(this,arguments)}}ez.ModifyError=ex,ez.DexieError=eA,ez.BulkError=ew;var eR={};let[eF,eL,eW]="u"<typeof Promise?[]:(()=>{let e=Promise.resolve();if("u"<typeof crypto||!crypto.subtle)return[e,I(e),e];let t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,I(t),e]})(),eV=eL&&eL.then,eG=eF&&eF.constructor,eU=!!eW;var eq=!1,eH=eW?()=>{eW.then(ta)}:N.setImmediate?setImmediate.bind(null,ta):N.MutationObserver?()=>{var e=document.createElement("div");new MutationObserver(()=>{ta(),e=null}).observe(e,{attributes:!0}),e.setAttribute("i","1")}:()=>{setTimeout(ta,0)},eK=function(e,t){e3.push([e,t]),eY&&(eH(),eY=!1)},eZ=!0,eY=!0,eJ=[],eX=[],eQ=null,e0=eP,e1={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:tE,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach(e=>{try{tE(e[0],e[1])}catch(e){}})}},e2=e1,e3=[],e5=0,e4=[];function e6(e){if("object"!=typeof this)throw TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=eD,this._lib=!1;var t=this._PSD=e2;if(eh&&(this._stackHolder=eg(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==eR)throw TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&e9(this,this._value))}this._state=null,this._value=null,++t.ref,function e(t,n){try{n(n=>{if(null===t._state){if(n===t)throw TypeError("A promise cannot be resolved with itself.");var o=t._lib&&tr();n&&"function"==typeof n.then?e(t,(e,t)=>{n instanceof e6?n._then(e,t):n.then(e,t)}):(t._state=!0,t._value=n,te(t)),o&&ti()}},e9.bind(null,t))}catch(e){e9(t,e)}}(this,e)}let e8={get:function(){var e=e2,t=th;function n(n,o){var a=!e.global&&(e!==e2||t!==th);let r=a&&!ty();var i=new e6((t,i)=>{tt(this,new e7(tw(n,e,a,r),tw(o,e,a,r),t,i,e))});return eh&&to(i,this),i}return n.prototype=eR,n},set:function(e){W(this,"then",e&&e.prototype===eR?e8:{get:function(){return e},set:e8.set})}};function e7(e,t,n,o,a){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=o,this.psd=a}function e9(e,t){if(eX.push(t),null===e._state){var n=e._lib&&tr();t=e0(t),e._state=!1,e._value=t,eh&&null!==t&&"object"==typeof t&&!t._promise&&function(e){try{e.apply(null,void 0)}catch(e){}}(()=>{var n=U(t,"stack");t._promise=e,W(t,"stack",{get:()=>eq?n&&(n.get?n.get.apply(t):n.value):e.stack})}),eJ.some(t=>t._value===e._value)||eJ.push(e),te(e),n&&ti()}}function te(e){var t=e._listeners;e._listeners=[];for(var n=0,o=t.length;n<o;++n)tt(e,t[n]);var a=e._PSD;--a.ref||a.finalize(),0===e5&&(++e5,eK(()=>{0==--e5&&ts()},[]))}function tt(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,++e5,eK(tn,[n,e,t])}else e._listeners.push(t)}function tn(e,t,n){try{eQ=t;var o,a=t._value;t._state?o=e(a):(eX.length&&(eX=[]),o=e(a),-1===eX.indexOf(a)&&function(e){for(var t=eJ.length;t;)if(eJ[--t]._value===e._value)return void eJ.splice(t,1)}(t)),n.resolve(o)}catch(e){n.reject(e)}finally{eQ=null,0==--e5&&ts(),--n.psd.ref||n.psd.finalize()}}function to(e,t){var n=t?t._numPrev+1:0;n<100&&(e._prev=t,e._numPrev=n)}function ta(){tr()&&ti()}function tr(){var e=eZ;return eZ=!1,eY=!1,e}function ti(){var e,t,n;do for(;e3.length>0;)for(e=e3,e3=[],n=e.length,t=0;t<n;++t){var o=e[t];o[0].apply(null,o[1])}while(e3.length>0);eZ=!0,eY=!0}function ts(){var e=eJ;eJ=[],e.forEach(e=>{e._PSD.onunhandled.call(null,e._value,e)});for(var t=e4.slice(0),n=t.length;n;)t[--n]()}function tl(e){return new e6(eR,!1,e)}function tp(e,t){var n=e2;return function(){var o=tr(),a=e2;try{return tA(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{tA(a,!1),o&&ti()}}}F(e6.prototype,{then:e8,_then:function(e,t){tt(this,new e7(null,null,e,t,e2))},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):tl(e)):this.then(null,e=>e&&e.name===t?n(e):tl(e))},finally:function(e){return this.then(t=>(e(),t),t=>(e(),tl(t)))},stack:{get:function(){if(this._stack)return this._stack;try{eq=!0;var e=(function e(t,n,o){if(n.length===o)return n;var a="";if(!1===t._state){var r,i,s=t._value;null!=s?(r=s.name||"Error",i=s.message||s,a=ey(s,0)):(r=s,i=""),n.push(r+(i?": "+i:"")+a)}return eh&&((a=ey(t._stackHolder,2))&&-1===n.indexOf(a)&&n.push(a),t._prev&&e(t._prev,n,o)),n})(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{eq=!1}}},timeout:function(e,t){return e<1/0?new e6((n,o)=>{var a=setTimeout(()=>o(new eE.Timeout(t)),e);this.then(n,o).finally(clearTimeout.bind(null,a))}):this}}),"u">typeof Symbol&&Symbol.toStringTag&&W(e6.prototype,Symbol.toStringTag,"Dexie.Promise"),e1.env=tk(),F(e6,{all:function(){var e=eu.apply(null,arguments).map(tb);return new e6(function(t,n){0===e.length&&t([]);var o=e.length;e.forEach((a,r)=>e6.resolve(a).then(n=>{e[r]=n,--o||t(e)},n))})},resolve:e=>{if(e instanceof e6)return e;if(e&&"function"==typeof e.then)return new e6((t,n)=>{e.then(t,n)});var t=new e6(eR,!0,e);return to(t,eQ),t},reject:tl,race:function(){var e=eu.apply(null,arguments).map(tb);return new e6((t,n)=>{e.map(e=>e6.resolve(e).then(t,n))})},PSD:{get:()=>e2,set:e=>e2=e},totalEchoes:{get:()=>th},newPSD:t_,usePSD:tx,scheduler:{get:()=>eK,set:e=>{eK=e}},rejectionMapper:{get:()=>e0,set:e=>{e0=e}},follow:(e,t)=>new e6((n,o)=>t_((t,n)=>{var o=e2;o.unhandleds=[],o.onunhandled=n,o.finalize=eN(function(){var e;e=()=>{0===this.unhandleds.length?t():n(this.unhandleds[0])},e4.push(function t(){e(),e4.splice(e4.indexOf(t),1)}),++e5,eK(()=>{0==--e5&&ts()},[])},o.finalize),e()},t,n,o))}),eG&&(eG.allSettled&&W(e6,"allSettled",function(){let e=eu.apply(null,arguments).map(tb);return new e6(t=>{0===e.length&&t([]);let n=e.length,o=Array(n);e.forEach((e,a)=>e6.resolve(e).then(e=>o[a]={status:"fulfilled",value:e},e=>o[a]={status:"rejected",reason:e}).then(()=>--n||t(o)))})}),eG.any&&"u">typeof AggregateError&&W(e6,"any",function(){let e=eu.apply(null,arguments).map(tb);return new e6((t,n)=>{0===e.length&&n(AggregateError([]));let o=e.length,a=Array(o);e.forEach((e,r)=>e6.resolve(e).then(e=>t(e),e=>{a[r]=e,--o||n(AggregateError(a))}))})}));let tc={awaits:0,echoes:0,id:0};var td=0,tu=[],tf=0,th=0,tm=0;function t_(e,t,n,o){var a=e2,r=Object.create(a);r.parent=a,r.ref=0,r.global=!1,r.id=++tm;var i=e1.env;r.env=eU?{Promise:e6,PromiseProp:{value:e6,configurable:!0,writable:!0},all:e6.all,race:e6.race,allSettled:e6.allSettled,any:e6.any,resolve:e6.resolve,reject:e6.reject,nthen:tC(i.nthen,r),gthen:tC(i.gthen,r)}:{},t&&O(r,t),++a.ref,r.finalize=function(){--this.parent.ref||this.parent.finalize()};var s=tx(r,e,n,o);return 0===r.ref&&r.finalize(),s}function tg(){return tc.id||(tc.id=++td),++tc.awaits,tc.echoes+=100,tc.id}function ty(){return!!tc.awaits&&(0==--tc.awaits&&(tc.id=0),tc.echoes=100*tc.awaits,!0)}function tb(e){return tc.echoes&&e&&e.constructor===eG?(tg(),e.then(e=>(ty(),e),e=>(ty(),tS(e)))):e}function tv(e){++th,tc.echoes&&0!=--tc.echoes||(tc.echoes=tc.id=0),tu.push(e2),tA(e,!0)}function t$(){var e=tu[tu.length-1];tu.pop(),tA(e,!1)}function tA(e,t){var n,o=e2;if((t?!tc.echoes||tf++&&e===e2:!tf||--tf&&e===e2)||(n=t?tv.bind(null,e):t$,eV.call(eF,n)),e!==e2&&(e2=e,o===e1&&(e1.env=tk()),eU)){var a=e1.env.Promise,r=e.env;eL.then=r.nthen,a.prototype.then=r.gthen,(o.global||e.global)&&(Object.defineProperty(N,"Promise",r.PromiseProp),a.all=r.all,a.race=r.race,a.resolve=r.resolve,a.reject=r.reject,r.allSettled&&(a.allSettled=r.allSettled),r.any&&(a.any=r.any))}}function tk(){var e=N.Promise;return eU?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(N,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:eL.then,gthen:e.prototype.then}:{}}function tx(e,t,n,o,a){var r=e2;try{return tA(e,!0),t(n,o,a)}finally{tA(r,!1)}}function tw(e,t,n,o){return"function"!=typeof e?e:function(){var a,r=e2;n&&tg(),tA(t,!0);try{return e.apply(this,arguments)}finally{tA(r,!1),o&&(a=ty,eV.call(eF,a))}}}function tC(e,t){return function(n,o){return e.call(this,tw(n,t),tw(o,t))}}function tE(e,t){var n;try{n=t.onuncatched(e)}catch(e){}if(!1!==n)try{var o,a={promise:t,reason:e};if(N.document&&document.createEvent?((o=document.createEvent("Event")).initEvent("unhandledrejection",!0,!0),O(o,a)):N.CustomEvent&&O(o=new CustomEvent("unhandledrejection",{detail:a}),a),o&&N.dispatchEvent&&(dispatchEvent(o),!N.PromiseRejectionEvent&&N.onunhandledrejection))try{N.onunhandledrejection(o)}catch(e){}eh&&o&&!o.defaultPrevented&&console.warn(`Unhandled rejection: ${e.stack||e}`)}catch(e){}}-1===(""+eV).indexOf("[native code]")&&(tg=ty=eD);var tS=e6.reject;let tz=String.fromCharCode(65535),tD="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",tP=[],tM="u">typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),tN=e=>!/(dexie\.js|dexie\.min\.js)/.test(e);function tT(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}let tB={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function tO(e){return"string"!=typeof e||/\./.test(e)?e=>e:t=>(void 0===t[e]&&e in t&&delete(t=ei(t))[e],t)}class tI{_trans(e,t,n){let o=this._tx||e2.trans,a=this.name;function r(e,n,o){if(!o.schema[a])throw new eE.NotFound("Table "+a+" not part of transaction");return t(o.idbtrans,o)}let i=tr();try{return o&&o.db===this.db?o===e2.trans?o._promise(e,r,n):t_(()=>o._promise(e,r,n),{trans:o,transless:e2.transless||e2}):function e(t,n,o,a){if(t.idbdb&&(t._state.openComplete||e2.letThrough||t._vip)){var r=t._createTransaction(n,o,t._dbSchema);try{r.create(),t._state.PR1398_maxLoop=3}catch(r){return r.name===eC.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then(()=>e(t,n,o,a))):tS(r)}return r._promise(n,(e,t)=>t_(()=>(e2.trans=r,a(e,t,r)))).then(e=>r._completion.then(()=>e))}if(t._state.openComplete)return tS(new eE.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._options.autoOpen)return tS(new eE.DatabaseClosed);t.open().catch(eD)}return t._state.dbReadyPromise.then(()=>e(t,n,o,a))}(this.db,e,[this.name],r)}finally{i&&ti()}}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(B(e))return new this.db.WhereClause(this,`[${e.join("+")}]`);let t=T(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);let 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!==tz)return this.where(n.name).equals(n.keyPath.map(t=>e[t]));!n&&eh&&console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit of a compound index [${t.join("+")}]`);let{idxByName:o}=this.schema,a=this.db._deps.indexedDB;function r(e,t){try{return 0===a.cmp(e,t)}catch(e){return!1}}let[i,s]=t.reduce(([t,n],a)=>{let i=o[a],s=e[a];return[t||i,t||!i?tT(n,i&&i.multi?e=>{let t=X(e,a);return B(t)&&t.some(e=>r(s,e))}:e=>r(s,X(e,a))):n]},[null,null]);return i?this.where(i.name).equals(e[i.keyPath]).filter(s):n?this.filter(s):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,B(e)?`[${e.join("+")}]`:e))}reverse(){return this.toCollection().reverse()}mapToClass(e){this.schema.mappedClass=e;let t=t=>{if(!t)return t;let n=Object.create(e.prototype);for(var o in t)if(R(t,o))try{n[o]=t[o]}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){O(this,e)})}add(e,t){let{auto:n,keyPath:o}=this.schema.primKey,a=e;return o&&n&&(a=tO(o)(e)),this._trans("readwrite",e=>this.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[a]})).then(e=>e.numFailures?e6.reject(e.failures[0]):e.lastResult).then(t=>{if(o)try{Q(e,o,t)}catch(e){}return t})}update(e,t){if("object"!=typeof e||B(e))return this.where(":id").equals(e).modify(t);{let n=X(e,this.schema.primKey.keyPath);if(void 0===n)return tS(new eE.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?T(t).forEach(n=>{Q(e,n,t[n])}):t(e,{value:e,primKey:n})}catch(e){}return this.where(":id").equals(n).modify(t)}}put(e,t){let{auto:n,keyPath:o}=this.schema.primKey,a=e;return o&&n&&(a=tO(o)(e)),this._trans("readwrite",e=>this.core.mutate({trans:e,type:"put",values:[a],keys:null!=t?[t]:null})).then(e=>e.numFailures?e6.reject(e.failures[0]):e.lastResult).then(t=>{if(o)try{Q(e,o,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?e6.reject(e.failures[0]):void 0)}clear(){return this._trans("readwrite",e=>this.core.mutate({trans:e,type:"deleteRange",range:tB})).then(e=>e.numFailures?e6.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){let o=Array.isArray(t)?t:void 0,a=(n=n||(o?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",t=>{let{auto:n,keyPath:r}=this.schema.primKey;if(r&&o)throw new eE.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new eE.InvalidArgument("Arguments objects and keys must have the same length");let i=e.length,s=r&&n?e.map(tO(r)):e;return this.core.mutate({trans:t,type:"add",keys:o,values:s,wantResults:a}).then(({numFailures:e,results:t,lastResult:n,failures:o})=>{if(0===e)return a?t:n;throw new ew(`${this.name}.bulkAdd(): ${e} of ${i} operations failed`,o)})})}bulkPut(e,t,n){let o=Array.isArray(t)?t:void 0,a=(n=n||(o?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",t=>{let{auto:n,keyPath:r}=this.schema.primKey;if(r&&o)throw new eE.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new eE.InvalidArgument("Arguments objects and keys must have the same length");let i=e.length,s=r&&n?e.map(tO(r)):e;return this.core.mutate({trans:t,type:"put",keys:o,values:s,wantResults:a}).then(({numFailures:e,results:t,lastResult:n,failures:o})=>{if(0===e)return a?t:n;throw new ew(`${this.name}.bulkPut(): ${e} of ${i} operations failed`,o)})})}bulkDelete(e){let t=e.length;return this._trans("readwrite",t=>this.core.mutate({trans:t,type:"delete",keys:e})).then(({numFailures:e,lastResult:n,failures:o})=>{if(0===e)return n;throw new ew(`${this.name}.bulkDelete(): ${e} of ${t} operations failed`,o)})}}function tj(e){var t={},n=function(n,o){if(o){for(var a=arguments.length,r=Array(a-1);--a;)r[a-1]=arguments[a];return t[n].subscribe.apply(null,r),e}if("string"==typeof n)return t[n]};n.addEventType=r;for(var o=1,a=arguments.length;o<a;++o)r(arguments[o]);return n;function r(e,o,a){if("object"==typeof e){var i;return void T(i=e).forEach(function(e){var t=i[e];if(B(t))r(e,i[e][0],i[e][1]);else{if("asap"!==t)throw new eE.InvalidArgument("Invalid event config");var n=r(e,eP,function(){for(var e=arguments.length,t=Array(e);e--;)t[e]=arguments[e];n.subscribers.forEach(function(e){Y(function(){e.apply(null,t)})})})}})}o||(o=eI),a||(a=eD);var s={subscribers:[],fire:a,subscribe:function(e){-1===s.subscribers.indexOf(e)&&(s.subscribers.push(e),s.fire=o(s.fire,e))},unsubscribe:function(e){s.subscribers=s.subscribers.filter(function(t){return t!==e}),s.fire=s.subscribers.reduce(o,a)}};return t[e]=n[e]=s,s}}function tR(e,t){return V(t).from({prototype:e}),t}function tF(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function tL(e,t){e.filter=tT(e.filter,t)}function tW(e,t,n){var o=e.replayFilter;e.replayFilter=o?()=>tT(o(),t()):t,e.justLimit=n&&!o}function tV(e,t){if(e.isPrimKey)return t.primaryKey;let n=t.getIndexByKeyPath(e.index);if(!n)throw new eE.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function tG(e,t,n){let o=tV(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:o,range:e.range}})}function tU(e,t,n,o){let a=e.replayFilter?tT(e.filter,e.replayFilter()):e.filter;if(e.or){let r={},i=(e,n,o)=>{if(!a||a(n,o,e=>n.stop(e),e=>n.fail(e))){var i=n.primaryKey,s=""+i;"[object ArrayBuffer]"===s&&(s=""+new Uint8Array(i)),R(r,s)||(r[s]=!0,t(e,n,o))}};return Promise.all([e.or._iterate(i,n),tq(tG(e,o,n),e.algorithm,i,!e.keysOnly&&e.valueMapper)])}return tq(tG(e,o,n),tT(e.algorithm,a),t,!e.keysOnly&&e.valueMapper)}function tq(e,t,n,o){var a=tp(o?(e,t,a)=>n(o(e),t,a):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=eD},t=>{e.fail(t),n=eD})||a(e.value,e,e=>n=e),n()})})}function tH(e,t){try{let n=tK(e),o=tK(t);if(n!==o)return"Array"===n?1:"Array"===o?-1:"binary"===n?1:"binary"===o?-1:"string"===n?1:"string"===o?-1:"Date"===n?1:"Date"!==o?NaN:-1;switch(n){case"number":case"Date":case"string":return e>t?1:e<t?-1:0;case"binary":return function(e,t){let n=e.length,o=t.length,a=n<o?n:o;for(let n=0;n<a;++n)if(e[n]!==t[n])return e[n]<t[n]?-1:1;return n===o?0:n<o?-1:1}(tZ(e),tZ(t));case"Array":return function(e,t){let n=e.length,o=t.length,a=n<o?n:o;for(let n=0;n<a;++n){let o=tH(e[n],t[n]);if(0!==o)return o}return n===o?0:n<o?-1:1}(e,t)}}catch(e){}return NaN}function tK(e){let t=typeof e;if("object"!==t)return t;if(ArrayBuffer.isView(e))return"binary";let n=el(e);return"ArrayBuffer"===n?"binary":n}function tZ(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}class tY{_read(e,t){var n=this._ctx;return n.error?n.table._trans(null,tS.bind(null,n.error)):n.table._trans("readonly",e).then(t)}_write(e){var t=this._ctx;return t.error?t.table._trans(null,tS.bind(null,t.error)):t.table._trans("readwrite",e,"locked")}_addAlgorithm(e){var t=this._ctx;t.algorithm=tT(t.algorithm,e)}_iterate(e,t){return tU(this._ctx,e,t,this._ctx.table.core)}clone(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&O(n,e),t._ctx=n,t}raw(){return this._ctx.valueMapper=null,this}each(e){var t=this._ctx;return this._read(n=>tU(t,e,n,t.table.core))}count(e){return this._read(e=>{let t=this._ctx,n=t.table.core;if(tF(t,!0))return n.count({trans:e,query:{index:tV(t,n.schema),range:t.range}}).then(e=>Math.min(e,t.limit));var o=0;return tU(t,()=>(++o,!1),e,n).then(()=>o)}).then(e)}sortBy(e,t){let n=e.split(".").reverse(),o=n[0],a=n.length-1;function r(e,t){return t?r(e[n[t]],t-1):e[o]}var i="next"===this._ctx.dir?1:-1;function s(e,t){var n=r(e,a),o=r(t,a);return n<o?-i:n>o?i:0}return this.toArray(function(e){return e.sort(s)}).then(t)}toArray(e){return this._read(e=>{var t=this._ctx;if("next"===t.dir&&tF(t,!0)&&t.limit>0){let{valueMapper:n}=t,o=tV(t,t.table.core.schema);return t.table.core.query({trans:e,limit:t.limit,values:!0,query:{index:o,range:t.range}}).then(({result:e})=>n?e.map(n):e)}{let n=[];return tU(t,e=>n.push(e),e,t.table.core).then(()=>n)}},e)}offset(e){var t=this._ctx;return e<=0||(t.offset+=e,tF(t)?tW(t,()=>{var t=e;return(e,n)=>0===t||(1===t?--t:n(()=>{e.advance(t),t=0}),!1)}):tW(t,()=>{var t=e;return()=>--t<0})),this}limit(e){return this._ctx.limit=Math.min(this._ctx.limit,e),tW(this._ctx,()=>{var t=e;return function(e,n,o){return--t<=0&&n(o),t>=0}},!0),this}until(e,t){return tL(this._ctx,function(n,o,a){return!e(n.value)||(o(a),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;return tL(this._ctx,function(t){return e(t.value)}),(t=this._ctx).isMatch=tT(t.isMatch,e),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&&tF(t,!0)&&t.limit>0)return this._read(e=>{var n=tV(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 tL(this._ctx,function(e){var t=e.primaryKey.toString(),o=R(n,t);return n[t]=!0,!o}),this}modify(e){var t=this._ctx;return this._write(n=>{var o;if("function"==typeof e)o=e;else{var a=T(e),r=a.length;o=function(t){for(var n=!1,o=0;o<r;++o){var i=a[o],s=e[i];X(t,i)!==s&&(Q(t,i,s),n=!0)}return n}}let i=t.table.core,{outbound:s,extractKey:l}=i.schema.primaryKey,p=this.db._options.modifyChunkSize||200,c=[],d=0,u=[],f=(e,t)=>{let{failures:n,numFailures:o}=t;for(let t of(d+=e-o,T(n)))c.push(n[t])};return this.clone().primaryKeys().then(a=>{let r=c=>{let d=Math.min(p,a.length-c);return i.getMany({trans:n,keys:a.slice(c,c+d),cache:"immutable"}).then(u=>{let h=[],m=[],g=s?[]:null,y=[];for(let e=0;e<d;++e){let t=u[e],n={value:ei(t),primKey:a[c+e]};!1!==o.call(n,n.value,n)&&(null==n.value?y.push(a[c+e]):s||0===tH(l(t),l(n.value))?(m.push(n.value),s&&g.push(a[c+e])):(y.push(a[c+e]),h.push(n.value)))}let b=tF(t)&&t.limit===1/0&&("function"!=typeof e||e===tJ)&&{index:t.index,range:t.range};return Promise.resolve(h.length>0&&i.mutate({trans:n,type:"add",values:h}).then(e=>{for(let t in e.failures)y.splice(parseInt(t),1);f(h.length,e)})).then(()=>(m.length>0||b&&"object"==typeof e)&&i.mutate({trans:n,type:"put",keys:g,values:m,criteria:b,changeSpec:"function"!=typeof e&&e}).then(e=>f(m.length,e))).then(()=>(y.length>0||b&&e===tJ)&&i.mutate({trans:n,type:"delete",keys:y,criteria:b}).then(e=>f(y.length,e))).then(()=>a.length>c+d&&r(c+p))})};return r(0).then(()=>{if(c.length>0)throw new ex("Error modifying one or more objects",c,d,u);return a.length})})})}delete(){var e=this._ctx,t=e.range;return tF(e)&&(e.isPrimKey&&!tM||3===t.type)?this._write(n=>{let{primaryKey:o}=e.table.core.schema;return e.table.core.count({trans:n,query:{index:o,range:t}}).then(o=>e.table.core.mutate({trans:n,type:"deleteRange",range:t}).then(({failures:e,lastResult:t,results:n,numFailures:a})=>{if(a)throw new ex("Could not delete some values",Object.keys(e).map(t=>e[t]),o-a);return o-a}))}):this.modify(tJ)}}let tJ=(e,t)=>t.value=null;function tX(e,t){return e<t?-1:+(e!==t)}function tQ(e,t){return e>t?-1:+(e!==t)}function t0(e,t,n){var o=e instanceof t4?new e.Collection(e):e;return o._ctx.error=n?new n(t):TypeError(t),o}function t1(e){return new e.Collection(e,()=>t5("")).limit(0)}function t2(e,t,n,o){var a,r,i,s,l,p,c,d=n.length;if(!n.every(e=>"string"==typeof e))return t0(e,"String expected.");function u(e){a="next"===e?e=>e.toUpperCase():e=>e.toLowerCase(),r="next"===e?e=>e.toLowerCase():e=>e.toUpperCase(),i="next"===e?tX:tQ;var t=n.map(function(e){return{lower:r(e),upper:a(e)}}).sort(function(e,t){return i(e.lower,t.lower)});s=t.map(function(e){return e.upper}),l=t.map(function(e){return e.lower}),p=e,c="next"===e?"":o}u("next");var f=new e.Collection(e,()=>t3(s[0],l[d-1]+o));f._ondirectionchange=function(e){u(e)};var h=0;return f._addAlgorithm(function(e,n,o){var a=e.key;if("string"!=typeof a)return!1;var u=r(a);if(t(u,l,h))return!0;for(var f=null,m=h;m<d;++m){var g=function(e,t,n,o,a,r){for(var i=Math.min(e.length,o.length),s=-1,l=0;l<i;++l){var p=t[l];if(p!==o[l])return 0>a(e[l],n[l])?e.substr(0,l)+n[l]+n.substr(l+1):0>a(e[l],o[l])?e.substr(0,l)+o[l]+n.substr(l+1):s>=0?e.substr(0,s)+t[s]+n.substr(s+1):null;0>a(e[l],p)&&(s=l)}return i<o.length&&"next"===r?e+n.substr(e.length):i<e.length&&"prev"===r?e.substr(0,n.length):s<0?null:e.substr(0,s)+o[s]+n.substr(s+1)}(a,u,s[m],l[m],i,p);null===g&&null===f?h=m+1:(null===f||i(f,g)>0)&&(f=g)}return n(null!==f?function(){e.continue(f+c)}:o),!1}),f}function t3(e,t,n,o){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:o}}function t5(e){return{type:1,lower:e,upper:e}}class t4{get Collection(){return this._ctx.table.db.Collection}between(e,t,n,o){n=!1!==n,o=!0===o;try{return this._cmp(e,t)>0||0===this._cmp(e,t)&&(n||o)&&(!n||!o)?t1(this):new this.Collection(this,()=>t3(e,t,!n,!o))}catch(e){return t0(this,tD)}}equals(e){return null==e?t0(this,tD):new this.Collection(this,()=>t5(e))}above(e){return null==e?t0(this,tD):new this.Collection(this,()=>t3(e,void 0,!0))}aboveOrEqual(e){return null==e?t0(this,tD):new this.Collection(this,()=>t3(e,void 0,!1))}below(e){return null==e?t0(this,tD):new this.Collection(this,()=>t3(void 0,e,!1,!0))}belowOrEqual(e){return null==e?t0(this,tD):new this.Collection(this,()=>t3(void 0,e))}startsWith(e){return"string"!=typeof e?t0(this,"String expected."):this.between(e,e+tz,!0,!0)}startsWithIgnoreCase(e){return""===e?this.startsWith(e):t2(this,(e,t)=>0===e.indexOf(t[0]),[e],tz)}equalsIgnoreCase(e){return t2(this,(e,t)=>e===t[0],[e],"")}anyOfIgnoreCase(){var e=eu.apply(ed,arguments);return 0===e.length?t1(this):t2(this,(e,t)=>-1!==t.indexOf(e),e,"")}startsWithAnyOfIgnoreCase(){var e=eu.apply(ed,arguments);return 0===e.length?t1(this):t2(this,(e,t)=>t.some(t=>0===e.indexOf(t)),e,tz)}anyOf(){let e=eu.apply(ed,arguments),t=this._cmp;try{e.sort(t)}catch(e){return t0(this,tD)}if(0===e.length)return t1(this);let n=new this.Collection(this,()=>t3(e[0],e[e.length-1]));n._ondirectionchange=n=>{t="next"===n?this._ascending:this._descending,e.sort(t)};let o=0;return n._addAlgorithm((n,a,r)=>{let i=n.key;for(;t(i,e[o])>0;)if(++o===e.length)return a(r),!1;return 0===t(i,e[o])||(a(()=>{n.continue(e[o])}),!1)}),n}notEqual(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){let e=eu.apply(ed,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return t0(this,tD)}let 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){let n=this._cmp,o=this._ascending,a=this._descending,r=this._min,i=this._max;if(0===e.length)return t1(this);if(!e.every(e=>void 0!==e[0]&&void 0!==e[1]&&0>=o(e[0],e[1])))return t0(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",eE.InvalidArgument);let s=!t||!1!==t.includeLowers,l=t&&!0===t.includeUppers,p,c=o;function d(e,t){return c(e[0],t[0])}try{(p=e.reduce(function(e,t){let o=0,a=e.length;for(;o<a;++o){let a=e[o];if(0>n(t[0],a[1])&&n(t[1],a[0])>0){a[0]=r(a[0],t[0]),a[1]=i(a[1],t[1]);break}}return o===a&&e.push(t),e},[])).sort(d)}catch(e){return t0(this,tD)}let u=0,f=l?e=>o(e,p[u][1])>0:e=>o(e,p[u][1])>=0,h=s?e=>a(e,p[u][0])>0:e=>a(e,p[u][0])>=0,m=f,g=new this.Collection(this,()=>t3(p[0][0],p[p.length-1][1],!s,!l));return g._ondirectionchange=e=>{"next"===e?(m=f,c=o):(m=h,c=a),p.sort(d)},g._addAlgorithm((e,t,n)=>{for(var a=e.key;m(a);)if(++u===p.length)return t(n),!1;return!!(!f(a)&&!h(a))||(0===this._cmp(a,p[u][1])||0===this._cmp(a,p[u][0])||t(()=>{c===o?e.continue(p[u][0]):e.continue(p[u][1])}),!1)}),g}startsWithAnyOf(){let e=eu.apply(ed,arguments);return e.every(e=>"string"==typeof e)?0===e.length?t1(this):this.inAnyRange(e.map(e=>[e,e+tz])):t0(this,"startsWithAnyOf() only works with strings")}}function t6(e){return tp(function(t){return t8(t),e(t.target.error),!1})}function t8(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}let t7=tj(null,"storagemutated");class t9{_lock(){return Z(!e2.global),++this._reculock,1!==this._reculock||e2.global||(e2.lockOwnerFor=this),this}_unlock(){if(Z(!e2.global),0==--this._reculock)for(e2.global||(e2.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{tx(e[1],e[0])}catch(e){}}return this}_locked(){return this._reculock&&e2.lockOwnerFor!==this}create(e){if(!this.mode)return this;let t=this.db.idbdb,n=this.db._state.dbOpenError;if(Z(!this.idbtrans),!e&&!t)switch(n&&n.name){case"DatabaseClosedError":throw new eE.DatabaseClosed(n);case"MissingAPIError":throw new eE.MissingAPI(n.message,n);default:throw new eE.OpenFailed(n)}if(!this.active)throw new eE.TransactionInactive;return Z(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=tp(t=>{t8(t),this._reject(e.error)}),e.onabort=tp(t=>{t8(t),this.active&&this._reject(new eE.Abort(e.error)),this.active=!1,this.on("abort").fire(t)}),e.oncomplete=tp(()=>{this.active=!1,this._resolve(),"mutatedParts"in e&&t7.storagemutated.fire(e.mutatedParts)}),this}_promise(e,t,n){if("readwrite"===e&&"readwrite"!==this.mode)return tS(new eE.ReadOnly("Transaction is readonly"));if(!this.active)return tS(new eE.TransactionInactive);if(this._locked())return new e6((o,a)=>{this._blockedFuncs.push([()=>{this._promise(e,t,n).then(o,a)},e2])});if(n)return t_(()=>{var e=new e6((e,n)=>{this._lock();let o=t(e,n,this);o&&o.then&&o.then(e,n)});return e.finally(()=>this._unlock()),e._lib=!0,e});var o=new e6((e,n)=>{var o=t(e,n,this);o&&o.then&&o.then(e,n)});return o._lib=!0,o}_root(){return this.parent?this.parent._root():this}waitFor(e){var t=this._root();let n=e6.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then(()=>n);else{t._waitingFor=n,t._waitingQueue=[];var o=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(o.get(-1/0).onsuccess=e)}()}var a=t._waitingFor;return new e6((e,o)=>{n.then(n=>t._waitingQueue.push(tp(e.bind(null,n))),e=>t._waitingQueue.push(tp(o.bind(null,e)))).finally(()=>{t._waitingFor===a&&(t._waitingFor=null)})})}abort(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new eE.Abort))}table(e){let t=this._memoizedTables||(this._memoizedTables={});if(R(t,e))return t[e];let n=this.schema[e];if(!n)throw new eE.NotFound("Table "+e+" not part of transaction");let o=new this.db.Table(e,n,this);return o.core=this.db.core.table(e),t[e]=o,o}}function ne(e,t,n,o,a,r,i){return{name:e,keyPath:t,unique:n,multi:o,auto:a,compound:r,src:(n&&!i?"&":"")+(o?"*":"")+(a?"++":"")+nt(t)}}function nt(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function nn(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:J(n,e=>[e.name,e])}}let no=e=>{try{return e.only([[]]),no=()=>[[]],[[]]}catch(e){return no=()=>tz,tz}};function na(e){return null==e?()=>{}:"string"==typeof e?1===e.split(".").length?t=>t[e]:t=>X(t,e):t=>X(t,e)}function nr(e){return[].slice.call(e)}let ni=0;function ns(e){return null==e?":id":"string"==typeof e?e:`[${e.join("+")}]`}function nl({_novip:e},t){let n=t.db,o=function(e,t,{IDBKeyRange:n,indexedDB:o},a){var r;return{dbcore:(r=function(e,t,n){let o;function a(e){if(3===e.type)return null;if(4===e.type)throw Error("Cannot convert never type to IDBKeyRange");let{lower:n,upper:o,lowerOpen:a,upperOpen:r}=e;return void 0===n?void 0===o?null:t.upperBound(o,!!r):void 0===o?t.lowerBound(n,!!a):t.bound(n,o,!!a,!!r)}let{schema:r,hasGetAll:i}=(o=nr(e.objectStoreNames),{schema:{name:e.name,tables:o.map(e=>n.objectStore(e)).map(e=>{let{keyPath:t,autoIncrement:n}=e,o=B(t),a=null==t,r={},i={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:a,compound:o,keyPath:t,autoIncrement:n,unique:!0,extractKey:na(t)},indexes:nr(e.indexNames).map(t=>e.index(t)).map(e=>{let{name:t,unique:n,multiEntry:o,keyPath:a}=e,i={name:t,compound:B(a),keyPath:a,unique:n,multiEntry:o,extractKey:na(a)};return r[ns(a)]=i,i}),getIndexByKeyPath:e=>r[ns(e)]};return r[":id"]=i.primaryKey,null!=t&&(r[ns(t)]=i.primaryKey),i})},hasGetAll:o.length>0&&"getAll"in n.objectStore(o[0])&&!("u">typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),s=r.tables.map(e=>{let t;return{name:t=e.name,schema:e,mutate:function({trans:e,type:n,keys:o,values:r,range:i}){return new Promise((s,l)=>{let p;s=tp(s);let c=e.objectStore(t),d=null==c.keyPath,u="put"===n||"add"===n;if(!u&&"delete"!==n&&"deleteRange"!==n)throw Error("Invalid operation type: "+n);let{length:f}=o||r||{length:1};if(o&&r&&o.length!==r.length)throw Error("Given keys array must have same length as given values array.");if(0===f)return s({numFailures:0,failures:{},results:[],lastResult:void 0});let h=[],m=[],g=0,y=e=>{++g,t8(e)};if("deleteRange"===n){if(4===i.type)return s({numFailures:g,failures:m,results:[],lastResult:void 0});3===i.type?h.push(p=c.clear()):h.push(p=c.delete(a(i)))}else{let[e,t]=u?d?[r,o]:[r,null]:[o,null];if(u)for(let o=0;o<f;++o)h.push(p=t&&void 0!==t[o]?c[n](e[o],t[o]):c[n](e[o])),p.onerror=y;else for(let t=0;t<f;++t)h.push(p=c[n](e[t])),p.onerror=y}let b=e=>{let t=e.target.result;h.forEach((e,t)=>null!=e.error&&(m[t]=e.error)),s({numFailures:g,failures:m,results:"delete"===n?o:h.map(e=>e.result),lastResult:t})};p.onerror=e=>{y(e),b(e)},p.onsuccess=b})},getMany:({trans:e,keys:n})=>new Promise((o,a)=>{o=tp(o);let r=e.objectStore(t),i=n.length,s=Array(i),l,p=0,c=0,d=e=>{let t=e.target;s[t._pos]=t.result,++c===p&&o(s)},u=t6(a);for(let e=0;e<i;++e)null!=n[e]&&((l=r.get(n[e]))._pos=e,l.onsuccess=d,l.onerror=u,++p);0===p&&o(s)}),get:({trans:e,key:n})=>new Promise((o,a)=>{o=tp(o);let r=e.objectStore(t).get(n);r.onsuccess=e=>o(e.target.result),r.onerror=t6(a)}),query:e=>new Promise((n,o)=>{n=tp(n);let{trans:r,values:s,limit:l,query:p}=e,c=l===1/0?void 0:l,{index:d,range:u}=p,f=r.objectStore(t),h=d.isPrimaryKey?f:f.index(d.name),m=a(u);if(0===l)return n({result:[]});if(i){let e=s?h.getAll(m,c):h.getAllKeys(m,c);e.onsuccess=e=>n({result:e.target.result}),e.onerror=t6(o)}else{let e=0,t=!s&&"openKeyCursor"in h?h.openKeyCursor(m):h.openCursor(m),a=[];t.onsuccess=o=>{let r=t.result;return r?(a.push(s?r.value:r.primaryKey),++e===l?n({result:a}):void r.continue()):n({result:a})},t.onerror=t6(o)}}),openCursor:function({trans:e,values:n,query:o,reverse:r,unique:i}){return new Promise((s,l)=>{s=tp(s);let{index:p,range:c}=o,d=e.objectStore(t),u=p.isPrimaryKey?d:d.index(p.name),f=r?i?"prevunique":"prev":i?"nextunique":"next",h=!n&&"openKeyCursor"in u?u.openKeyCursor(a(c),f):u.openCursor(a(c),f);h.onerror=t6(l),h.onsuccess=tp(t=>{let n=h.result;if(!n)return void s(null);n.___id=++ni,n.done=!1;let o=n.continue.bind(n),a=n.continuePrimaryKey;a&&(a=a.bind(n));let r=n.advance.bind(n),i=()=>{throw Error("Cursor not stopped")};n.trans=e,n.stop=n.continue=n.continuePrimaryKey=n.advance=()=>{throw Error("Cursor not started")},n.fail=tp(l),n.next=function(){let e=1;return this.start(()=>e--?this.continue():this.stop()).then(()=>this)},n.start=e=>{let t=new Promise((e,t)=>{e=tp(e),h.onerror=t6(t),n.fail=t,n.stop=t=>{n.stop=n.continue=n.continuePrimaryKey=n.advance=i,e(t)}}),s=()=>{if(h.result)try{e()}catch(e){n.fail(e)}else n.done=!0,n.start=()=>{throw Error("Cursor behind last entry")},n.stop()};return h.onsuccess=tp(e=>{h.onsuccess=s,s()}),n.continue=o,n.continuePrimaryKey=a,n.advance=r,s(),t},s(n)},l)})},count({query:e,trans:n}){let{index:o,range:r}=e;return new Promise((e,i)=>{let s=n.objectStore(t),l=o.isPrimaryKey?s:s.index(o.name),p=a(r),c=p?l.count(p):l.count();c.onsuccess=tp(t=>e(t.target.result)),c.onerror=t6(i)})}}}),l={};return s.forEach(e=>l[e.name]=e),{stack:"dbcore",transaction:e.transaction.bind(e),table(e){if(!l[e])throw Error(`Table '${e}' not found`);return l[e]},MIN_KEY:-1/0,MAX_KEY:no(t),schema:r}}(t,n,a),e.dbcore.reduce((e,{create:t})=>({...e,...t(e)}),r))}}(e._middlewares,n,e._deps,t);e.core=o.dbcore,e.tables.forEach(t=>{let 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 np({_novip:e},t,n,o){n.forEach(n=>{let a=o[n];t.forEach(t=>{let o=U(t,n);(!o||"value"in o&&void 0===o.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?W(t,n,{get(){return this.table(n)},set(e){L(this,n,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[n]=new e.Table(n,a))})})}function nc({_novip:e},t){t.forEach(t=>{for(let n in t)t[n]instanceof e.Table&&delete t[n]})}function nd(e,t){return e._cfg.version-t._cfg.version}function nu(e,t){let n,o={del:[],add:[],change:[]};for(n in e)t[n]||o.del.push(n);for(n in t){let a=e[n],r=t[n];if(a){let e={name:n,def:r,recreate:!1,del:[],add:[],change:[]};if(""+(a.primKey.keyPath||"")==""+(r.primKey.keyPath||"")&&(a.primKey.auto===r.primKey.auto||tM)){let t,n=a.idxByName,i=r.idxByName;for(t in n)i[t]||e.del.push(t);for(t in i){let o=n[t],a=i[t];o?o.src!==a.src&&e.change.push(a):e.add.push(a)}(e.del.length>0||e.add.length>0||e.change.length>0)&&o.change.push(e)}else e.recreate=!0,o.change.push(e)}else o.add.push([n,r])}return o}function nf(e,t,n,o){let a=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return o.forEach(e=>nh(a,e)),a}function nh(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function nm(e,t,n){let o={};return H(t.objectStoreNames,0).forEach(e=>{let t=n.objectStore(e),a=t.keyPath,r=ne(nt(a),a||"",!1,!1,!!t.autoIncrement,a&&"string"!=typeof a,!0),i=[];for(let e=0;e<t.indexNames.length;++e){let n=t.index(t.indexNames[e]);a=n.keyPath;var s=ne(n.name,a,!!n.unique,!!n.multiEntry,!1,a&&"string"!=typeof a,!1);i.push(s)}o[e]=nn(e,r,i)}),o}function n_({_novip:e},t,n){let o=n.db.objectStoreNames;for(let a=0;a<o.length;++a){let r=o[a],i=n.objectStore(r);e._hasGetAll="getAll"in i;for(let e=0;e<i.indexNames.length;++e){let n=i.indexNames[e],o=i.index(n).keyPath,a="string"==typeof o?o:"["+H(o).join("+")+"]";if(t[r]){let e=t[r].idxByName[a];e&&(e.name=n,delete t[r].idxByName[a],t[r].idxByName[n]=e)}}}"u">typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&N.WorkerGlobalScope&&N instanceof N.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}class ng{_parseStoresSpec(e,t){T(e).forEach(n=>{if(null!==e[n]){var o=e[n].split(",").map((e,t)=>{let n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),o=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return ne(n,o||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),B(o),0===t)}),a=o.shift();if(a.multi)throw new eE.Schema("Primary key cannot be multi-valued");o.forEach(e=>{if(e.auto)throw new eE.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new eE.Schema("Index must have a name and cannot be an empty string")}),t[n]=nn(n,a,o)}})}stores(e){let t=this.db;this._cfg.storesSource=this._cfg.storesSource?O(this._cfg.storesSource,e):e;let n=t._versions,o={},a={};return n.forEach(e=>{O(o,e._cfg.storesSource),a=e._cfg.dbschema={},e._parseStoresSpec(o,a)}),t._dbSchema=a,nc(t,[t._allTables,t,t.Transaction.prototype]),np(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],T(a),a),t._storeNames=T(a),this}upgrade(e){return this._cfg.contentUpgrade=ej(this._cfg.contentUpgrade||eD,e),this}}function ny(e,t){let n=e._dbNamesDB;return n||(n=e._dbNamesDB=new nI("__dbnames",{addons:[],indexedDB:e,IDBKeyRange:t})).version(1).stores({dbnames:"name"}),n.table("dbnames")}function nb(e){return e&&"function"==typeof e.databases}function nv(e){return t_(function(){return e2.letThrough=!0,e()})}function n$(e){var t=t=>e.next(t),n=a(t),o=a(t=>e.throw(t));function a(e){return t=>{var a=e(t),r=a.value;return a.done?r:r&&"function"==typeof r.then?r.then(n,o):B(r)?Promise.all(r).then(n,o):n(r)}}return a(t)()}function nA(e,t,n){var o=arguments.length;if(o<2)throw new eE.InvalidArgument("Too few arguments");for(var a=Array(o-1);--o;)a[o-1]=arguments[o];return n=a.pop(),[e,en(a),n]}function nk(e,t,n){let o=B(e)?e.slice():[e];for(let e=0;e<n;++e)o.push(t);return o}let nx={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return{...e,table(t){let n=e.table(t),{schema:o}=n,a={},r=[];function i(e,t,n){let o=ns(e),s=a[o]=a[o]||[],l=null==e?0:"string"==typeof e?1:e.length,p=t>0,c={...n,isVirtual:p,keyTail:t,keyLength:l,extractKey:na(e),unique:!p&&n.unique};return s.push(c),c.isPrimaryKey||r.push(c),l>1&&i(2===l?e[0]:e.slice(0,l-1),t+1,n),s.sort((e,t)=>e.keyTail-t.keyTail),c}let s=i(o.primaryKey.keyPath,0,o.primaryKey);for(let e of(a[":id"]=[s],o.indexes))i(e.keyPath,0,e);function l(t){var n,o;let a=t.query.index;return a.isVirtual?{...t,query:{index:a,range:(n=t.query.range,o=a.keyTail,{type:1===n.type?2:n.type,lower:nk(n.lower,n.lowerOpen?e.MAX_KEY:e.MIN_KEY,o),lowerOpen:!0,upper:nk(n.upper,n.upperOpen?e.MIN_KEY:e.MAX_KEY,o),upperOpen:!0})}}:t}return{...n,schema:{...o,primaryKey:s,indexes:r,getIndexByKeyPath:function(e){let t=a[ns(e)];return t&&t[0]}},count:e=>n.count(l(e)),query:e=>n.query(l(e)),openCursor(t){let{keyTail:o,isVirtual:a,keyLength:r}=t.query.index;return a?n.openCursor(l(t)).then(n=>n&&Object.create(n,{continue:{value:function(a){null!=a?n.continue(nk(a,t.reverse?e.MAX_KEY:e.MIN_KEY,o)):t.unique?n.continue(n.key.slice(0,r).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,o)):n.continue()}},continuePrimaryKey:{value(t,a){n.continuePrimaryKey(nk(t,e.MAX_KEY,o),a)}},primaryKey:{get:()=>n.primaryKey},key:{get(){let e=n.key;return 1===r?e[0]:e.slice(0,r)}},value:{get:()=>n.value}})):n.openCursor(t)}}}}}};function nw(e,t,n,o){return n=n||{},o=o||"",T(e).forEach(a=>{if(R(t,a)){var r=e[a],i=t[a];if("object"==typeof r&&"object"==typeof i&&r&&i){let e=el(r);e!==el(i)?n[o+a]=t[a]:"Object"===e?nw(r,i,n,o+a+"."):r!==i&&(n[o+a]=t[a])}else r!==i&&(n[o+a]=t[a])}else n[o+a]=void 0}),T(t).forEach(a=>{R(e,a)||(n[o+a]=t[a])}),n}let nC={stack:"dbcore",name:"HooksMiddleware",level:2,create:e=>({...e,table(t){let n=e.table(t),{primaryKey:o}=n.schema;return{...n,mutate(e){let a=e2.trans,{deleting:r,creating:i,updating:s}=a.table(t).hook;switch(e.type){case"add":if(i.fire===eD)break;return a._promise("readwrite",()=>l(e),!0);case"put":if(i.fire===eD&&s.fire===eD)break;return a._promise("readwrite",()=>l(e),!0);case"delete":if(r.fire===eD)break;return a._promise("readwrite",()=>l(e),!0);case"deleteRange":if(r.fire===eD)break;return a._promise("readwrite",()=>(function e(t,a,r){return n.query({trans:t,values:!1,query:{index:o,range:a},limit:r}).then(({result:n})=>l({type:"delete",keys:n,trans:t}).then(o=>o.numFailures>0?Promise.reject(o.failures[0]):n.length<r?{failures:[],numFailures:0,lastResult:void 0}:e(t,{...a,lower:n[n.length-1],lowerOpen:!0},r)))})(e.trans,e.range,1e4),!0)}return n.mutate(e);function l(e){var t,a;let l=e2.trans,p=e.keys||("delete"===(t=e).type?t.keys:t.keys||t.values.map(o.extractKey));if(!p)throw Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?{...e,keys:p}:{...e}).type&&(e.values=[...e.values]),e.keys&&(e.keys=[...e.keys]),("add"===(a=e).type?Promise.resolve([]):n.getMany({trans:a.trans,keys:p,cache:"immutable"})).then(t=>{let a=p.map((n,a)=>{let p=t[a],c={onerror:null,onsuccess:null};if("delete"===e.type)r.fire.call(c,n,p,l);else if("add"===e.type||void 0===p){let t=i.fire.call(c,n,e.values[a],l);null==n&&null!=t&&(n=t,e.keys[a]=n,o.outbound||Q(e.values[a],o.keyPath,n))}else{let t=nw(p,e.values[a]),o=s.fire.call(c,t,n,p,l);if(o){let t=e.values[a];Object.keys(o).forEach(e=>{R(t,e)?t[e]=o[e]:Q(t,e,o[e])})}}return c});return n.mutate(e).then(({failures:n,results:o,numFailures:r,lastResult:i})=>{for(let r=0;r<p.length;++r){let i=o?o[r]:p[r],s=a[r];null==i?s.onerror&&s.onerror(n[r]):s.onsuccess&&s.onsuccess("put"===e.type&&t[r]?e.values[r]:i)}return{failures:n,results:o,numFailures:r,lastResult:i}}).catch(e=>(a.forEach(t=>t.onerror&&t.onerror(e)),Promise.reject(e)))})}}}}})};function nE(e,t,n){try{if(!t||t.keys.length<e.length)return null;let o=[];for(let a=0,r=0;a<t.keys.length&&r<e.length;++a)0===tH(t.keys[a],e[r])&&(o.push(n?ei(t.values[a]):t.values[a]),++r);return o.length===e.length?o:null}catch(e){return null}}let nS={stack:"dbcore",level:-1,create:e=>({table:t=>{let n=e.table(t);return{...n,getMany:e=>{if(!e.cache)return n.getMany(e);let t=nE(e.keys,e.trans._cache,"clone"===e.cache);return t?e6.resolve(t):n.getMany(e).then(t=>(e.trans._cache={keys:e.keys,values:"clone"===e.cache?ei(t):t},t))},mutate:e=>("add"!==e.type&&(e.trans._cache=null),n.mutate(e))}}})};function nz(e){return!("from"in e)}let nD=function(e,t){if(!this){let t=new nD;return e&&"d"in e&&O(t,e),t}O(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function nP(e,t,n){let o=tH(t,n);if(isNaN(o))return;if(o>0)throw RangeError();if(nz(e))return O(e,{from:t,to:n,d:1});let a=e.l,r=e.r;if(0>tH(n,e.from))return a?nP(a,t,n):e.l={from:t,to:n,d:1,l:null,r:null},nT(e);if(tH(t,e.to)>0)return r?nP(r,t,n):e.r={from:t,to:n,d:1,l:null,r:null},nT(e);0>tH(t,e.from)&&(e.from=t,e.l=null,e.d=r?r.d+1:1),tH(n,e.to)>0&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1);let i=!e.r;a&&!e.l&&nM(e,a),r&&i&&nM(e,r)}function nM(e,t){nz(t)||function e(t,{from:n,to:o,l:a,r:r}){nP(t,n,o),a&&e(t,a),r&&e(t,r)}(e,t)}function nN(e){let t=nz(e)?null:{s:0,n:e};return{next(e){let n=arguments.length>0;for(;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&0>tH(e,t.n.from);)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||0>=tH(e,t.n.to))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 nT(e){var t,n;let o=((null==(t=e.r)?void 0:t.d)||0)-((null==(n=e.l)?void 0:n.d)||0),a=o>1?"r":o<-1?"l":"";if(a){let t="r"===a?"l":"r",n={...e},o=e[a];e.from=o.from,e.to=o.to,e[a]=o[a],n[a]=o[t],e[t]=n,n.d=nB(n)}e.d=nB(e)}function nB({r:e,l:t}){return(e?t?Math.max(e.d,t.d):e.d:t?t.d:0)+1}F(nD.prototype,{add(e){return nM(this,e),this},addKey(e){return nP(this,e,e),this},addKeys(e){return e.forEach(e=>nP(this,e,e)),this},[ep](){return nN(this)}});let nO={stack:"dbcore",level:0,create:e=>{let t=e.schema.name,n=new nD(e.MIN_KEY,e.MAX_KEY);return{...e,table:o=>{let a=e.table(o),{schema:r}=a,{primaryKey:i}=r,{extractKey:s,outbound:l}=i,p={...a,mutate:e=>{let i=e.trans,s=i.mutatedParts||(i.mutatedParts={}),l=e=>{let n=`idb://${t}/${o}/${e}`;return s[n]||(s[n]=new nD)},p=l(""),c=l(":dels"),{type:d}=e,[u,f]="deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[],h=e.trans._cache;return a.mutate(e).then(e=>{if(B(u)){"delete"!==d&&(u=e.results),p.addKeys(u);let t=nE(u,h);t||"add"===d||c.addKeys(u),(t||f)&&r.indexes.forEach(function(e){let n=l(e.name||"");function o(t){return null!=t?e.extractKey(t):null}let a=t=>e.multiEntry&&B(t)?t.forEach(e=>n.addKey(e)):n.addKey(t);(t||f).forEach((e,n)=>{let r=t&&o(t[n]),i=f&&o(f[n]);0!==tH(r,i)&&(null!=r&&a(r),null!=i&&a(i))})})}else if(u){let e={from:u.lower,to:u.upper};c.add(e),p.add(e)}else p.add(n),c.add(n),r.indexes.forEach(e=>l(e.name).add(n));return e})}},c=({query:{index:t,range:n}})=>{var o,a;return[t,new nD(null!=(o=n.lower)?o:e.MIN_KEY,null!=(a=n.upper)?a:e.MAX_KEY)]},d={get:e=>[i,new nD(e.key)],getMany:e=>[i,(new nD).addKeys(e.keys)],count:c,query:c,openCursor:c};return T(d).forEach(e=>{p[e]=function(r){let{subscr:i}=e2;if(i){let p=e=>{let n=`idb://${t}/${o}/${e}`;return i[n]||(i[n]=new nD)},c=p(""),u=p(":dels"),[f,h]=d[e](r);if(p(f.name||"").add(h),!f.isPrimaryKey){if("count"!==e){let t="query"===e&&l&&r.values&&a.query({...r,values:!1});return a[e].apply(this,arguments).then(n=>{if("query"===e){if(l&&r.values)return t.then(({result:e})=>(c.addKeys(e),n));let e=r.values?n.result.map(s):n.result;r.values?c.addKeys(e):u.addKeys(e)}else if("openCursor"===e){let e=r.values;return n&&Object.create(n,{key:{get:()=>(u.addKey(n.primaryKey),n.key)},primaryKey:{get(){let e=n.primaryKey;return u.addKey(e),e}},value:{get:()=>(e&&c.addKey(n.primaryKey),n.value)}})}return n})}u.add(n)}}return a[e].apply(this,arguments)}}),p}}}};class nI{constructor(e,t){var n;this._middlewares={},this.verno=0;const o=nI.dependencies;this._options=t={addons:nI.addons,autoOpen:!0,indexedDB:o.indexedDB,IDBKeyRange:o.IDBKeyRange,...t},this._deps={indexedDB:t.indexedDB,IDBKeyRange:t.IDBKeyRange};const{addons:a}=t;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;const r={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:eD,dbReadyPromise:null,cancelOpen:eD,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};r.dbReadyPromise=new e6(e=>{r.dbReadyResolve=e}),r.openCanceller=new e6((e,t)=>{r.cancelOpen=t}),this._state=r,this.name=e,this.on=tj(this,"populate","blocked","versionchange","close",{ready:[ej,eD]}),this.on.ready.subscribe=K(this.on.ready.subscribe,e=>(t,n)=>{nI.vip(()=>{let o=this._state;if(o.openComplete)o.dbOpenError||e6.resolve().then(t),n&&e(t);else if(o.onReadyBeingFired)o.onReadyBeingFired.push(t),n&&e(t);else{e(t);let o=this;n||e(function e(){o.on.ready.unsubscribe(t),o.on.ready.unsubscribe(e)})}})}),this.Collection=(n=this,tR(tY.prototype,function(e,t){this.db=n;let o=tB,a=null;if(t)try{o=t()}catch(e){a=e}let r=e._ctx,i=r.table,s=i.hook.reading.fire;this._ctx={table:i,index:r.index,isPrimKey:!r.index||i.schema.primKey.keyPath&&r.index===i.schema.primKey.name,range:o,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:a,or:r.or,valueMapper:s!==eP?s:null}})),this.Table=function(e){return tR(tI.prototype,function(t,n,o){this.db=e,this._tx=o,this.name=t,this.schema=n,this.hook=e._allTables[t]?e._allTables[t].hook:tj(null,{creating:[eT,eD],reading:[eM,eP],updating:[eO,eD],deleting:[eB,eD]})})}(this),this.Transaction=function(e){return tR(t9.prototype,function(t,n,o,a,r){this.db=e,this.mode=t,this.storeNames=n,this.schema=o,this.chromeTransactionDurability=a,this.idbtrans=null,this.on=tj(this,"complete","error","abort"),this.parent=r||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 e6((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(),tS(e)})})}(this),this.Version=function(e){return tR(ng.prototype,function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})}(this),this.WhereClause=function(e){return tR(t4.prototype,function(t,n,o){this.db=e,this._ctx={table:t,index:":id"===n?null:n,or:o};let a=e._deps.indexedDB;if(!a)throw new eE.MissingAPI;this._cmp=this._ascending=a.cmp.bind(a),this._descending=(e,t)=>a.cmp(t,e),this._max=(e,t)=>a.cmp(e,t)>0?e:t,this._min=(e,t)=>0>a.cmp(e,t)?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=no(t.IDBKeyRange),this._createTransaction=(e,t,n,o)=>new this.Transaction(e,t,n,this._options.chromeTransactionDurability,o),this._fireOnBlocked=e=>{this.on("blocked").fire(e),tP.filter(e=>e.name===this.name&&e!==this&&!e._state.vcFired).map(t=>t.on("versionchange").fire(e))},this.use(nx),this.use(nC),this.use(nO),this.use(nS),this.vip=Object.create(this,{_vip:{value:!0}}),a.forEach(e=>e(this))}version(e){if(isNaN(e)||e<.1)throw new eE.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new eE.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);let 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(nd),n.stores({}),this._state.autoSchema=!1,n)}_whenReady(e){return this.idbdb&&(this._state.openComplete||e2.letThrough||this._vip)?e():new e6((e,t)=>{if(this._state.openComplete)return t(new eE.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void t(new eE.DatabaseClosed);this.open().catch(eD)}this._state.dbReadyPromise.then(e,t)}).then(e)}use({stack:e,create:t,level:n,name:o}){o&&this.unuse({stack:e,name:o});let a=this._middlewares[e]||(this._middlewares[e]=[]);return a.push({stack:e,create:t,level:null==n?10:n,name:o}),a.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){var t;let n=e._state,{indexedDB:o}=e._deps;if(n.isBeingOpened||e.idbdb)return n.dbReadyPromise.then(()=>n.dbOpenError?tS(n.dbOpenError):e);eh&&(n.openCanceller._stackHolder=eg()),n.isBeingOpened=!0,n.dbOpenError=null,n.openComplete=!1;let a=n.openCanceller;function r(){if(n.openCanceller!==a)throw new eE.DatabaseClosed("db.open() was cancelled")}let i=n.dbReadyResolve,s=null,l=!1;return e6.race([a,("u"<typeof navigator?e6.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(e){var n=function(){return indexedDB.databases().finally(e)};t=setInterval(n,100),n()}).finally(function(){return clearInterval(t)}):Promise.resolve()).then(()=>new e6((t,a)=>{if(r(),!o)throw new eE.MissingAPI;let i=e.name,p=n.autoSchema?o.open(i):o.open(i,Math.round(10*e.verno));if(!p)throw new eE.MissingAPI;p.onerror=t6(a),p.onblocked=tp(e._fireOnBlocked),p.onupgradeneeded=tp(t=>{if(s=p.transaction,n.autoSchema&&!e._options.allowEmptyDB){p.onerror=t8,s.abort(),p.result.close();let e=o.deleteDatabase(i);e.onsuccess=e.onerror=tp(()=>{a(new eE.NoSuchDatabase(`Database ${i} doesnt exist`))})}else{let n,o,i,u;s.onerror=t6(a);var r,c,d=t.oldVersion>0x4000000000000000?0:t.oldVersion;l=d<1,e._novip.idbdb=p.result,r=d/10,c=s,n=e._dbSchema,(o=e._createTransaction("readwrite",e._storeNames,n)).create(c),o._completion.catch(a),i=o._reject.bind(o),u=e2.transless||e2,t_(()=>{e2.trans=o,e2.transless=u,0===r?(T(n).forEach(e=>{nf(c,e,n[e].primKey,n[e].indexes)}),nl(e,c),e6.follow(()=>e.on.populate.fire(o)).catch(i)):(function({_novip:e},t,n,o){let a=[],r=e._versions,i=e._dbSchema=nm(e,e.idbdb,o),s=!1;return r.filter(e=>e._cfg.version>=t).forEach(r=>{a.push(()=>{let a=i,l=r._cfg.dbschema;n_(e,a,o),n_(e,l,o),i=e._dbSchema=l;let p=nu(a,l);p.add.forEach(e=>{nf(o,e[0],e[1].primKey,e[1].indexes)}),p.change.forEach(e=>{if(e.recreate)throw new eE.Upgrade("Not yet support for changing primary key");{let t=o.objectStore(e.name);e.add.forEach(e=>nh(t,e)),e.change.forEach(e=>{t.deleteIndex(e.name),nh(t,e)}),e.del.forEach(e=>t.deleteIndex(e))}});let c=r._cfg.contentUpgrade;if(c&&r._cfg.version>t){let t;nl(e,o),n._memoizedTables={},s=!0;let r=ee(l);p.del.forEach(e=>{r[e]=a[e]}),nc(e,[e.Transaction.prototype]),np(e,[e.Transaction.prototype],T(r),r),n.schema=r;let i=ef(c);i&&tg();let d=e6.follow(()=>{if((t=c(n))&&i){var e=ty.bind(null,null);t.then(e,e)}});return t&&"function"==typeof t.then?e6.resolve(t):d.then(()=>t)}}),a.push(t=>{var o;s&&tM||(o=r._cfg.dbschema,[].slice.call(t.db.objectStoreNames).forEach(e=>null==o[e]&&t.db.deleteObjectStore(e))),nc(e,[e.Transaction.prototype]),np(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),n.schema=e._dbSchema})}),(function e(){return a.length?e6.resolve(a.shift()(n.idbtrans)).then(e):e6.resolve()})().then(()=>{var e;T(e=i).forEach(t=>{o.db.objectStoreNames.contains(t)||nf(o,t,e[t].primKey,e[t].indexes)})})})(e,r,o,c).catch(i)})}},a),p.onsuccess=tp(()=>{s=null;let o=e._novip.idbdb=p.result,a=H(o.objectStoreNames);if(a.length>0)try{let t,r=o.transaction(1===a.length?a[0]:a,"readonly");n.autoSchema?function({_novip:e},t,n){e.verno=t.version/10;let o=e._dbSchema=nm(0,t,n);e._storeNames=H(t.objectStoreNames,0),np(e,[e._allTables],T(o),o)}(e,o,r):(n_(e,e._dbSchema,r),((t=nu(nm(0,e.idbdb,r),e._dbSchema)).add.length||t.change.some(e=>e.add.length||e.change.length))&&console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),nl(e,r)}catch(e){}tP.push(e),o.onversionchange=tp(t=>{n.vcFired=!0,e.on("versionchange").fire(t)}),o.onclose=tp(t=>{e.on("close").fire(t)}),l&&function({indexedDB:e,IDBKeyRange:t},n){nb(e)||"__dbnames"===n||ny(e,t).put({name:n}).catch(eD)}(e._deps,i),t()},a)}))]).then(()=>(r(),n.onReadyBeingFired=[],e6.resolve(nv(()=>e.on.ready.fire(e.vip))).then(function t(){if(n.onReadyBeingFired.length>0){let o=n.onReadyBeingFired.reduce(ej,eD);return n.onReadyBeingFired=[],e6.resolve(nv(()=>o(e.vip))).then(t)}}))).finally(()=>{n.onReadyBeingFired=null,n.isBeingOpened=!1}).then(()=>e).catch(t=>{n.dbOpenError=t;try{s&&s.abort()}catch(e){}return a===n.openCanceller&&e._close(),tS(t)}).finally(()=>{n.openComplete=!0,i()})}(this)}_close(){let e=this._state,t=tP.indexOf(this);if(t>=0&&tP.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new e6(t=>{e.dbReadyResolve=t}),e.openCanceller=new e6((t,n)=>{e.cancelOpen=n})}close(){this._close();let e=this._state;this._options.autoOpen=!1,e.dbOpenError=new eE.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)}delete(){let e=arguments.length>0,t=this._state;return new e6((n,o)=>{let a=()=>{this.close();var e=this._deps.indexedDB.deleteDatabase(this.name);e.onsuccess=tp(()=>{!function({indexedDB:e,IDBKeyRange:t},n){nb(e)||"__dbnames"===n||ny(e,t).delete(n).catch(eD)}(this._deps,this.name),n()}),e.onerror=t6(o),e.onblocked=this._fireOnBlocked};if(e)throw new eE.InvalidArgument("Arguments not allowed in db.delete()");t.isBeingOpened?t.dbReadyPromise.then(a):a()})}backendDB(){return this.idbdb}isOpen(){return null!==this.idbdb}hasBeenClosed(){let e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name}hasFailed(){return null!==this._state.dbOpenError}dynamicallyOpened(){return this._state.autoSchema}get tables(){return T(this._allTables).map(e=>this._allTables[e])}transaction(){let e=nA.apply(this,arguments);return this._transaction.apply(this,e)}_transaction(e,t,n){let o,a,r=e2.trans;r&&r.db===this&&-1===e.indexOf("!")||(r=null);let i=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(a=t.map(e=>{var t=e instanceof this.Table?e.name:e;if("string"!=typeof t)throw TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t}),"r"==e||"readonly"===e)o="readonly";else{if("rw"!=e&&"readwrite"!=e)throw new eE.InvalidArgument("Invalid transaction mode: "+e);o="readwrite"}if(r){if("readonly"===r.mode&&"readwrite"===o){if(!i)throw new eE.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");r=null}r&&a.forEach(e=>{if(r&&-1===r.storeNames.indexOf(e)){if(!i)throw new eE.SubTransaction("Table "+e+" not included in parent transaction.");r=null}}),i&&r&&!r.active&&(r=null)}}catch(e){return r?r._promise(null,(t,n)=>{n(e)}):tS(e)}let s=(function e(t,n,o,a,r){return e6.resolve().then(()=>{let i,s=e2.transless||e2,l=t._createTransaction(n,o,t._dbSchema,a);if(a)l.idbtrans=a.idbtrans;else try{l.create(),t._state.PR1398_maxLoop=3}catch(a){return a.name===eC.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then(()=>e(t,n,o,null,r))):tS(a)}let p=ef(r);p&&tg();let c=e6.follow(()=>{if(i=r.call(l,l))if(p){var e=ty.bind(null,null);i.then(e,e)}else"function"==typeof i.next&&"function"==typeof i.throw&&(i=n$(i))},{trans:l,transless:s});return(i&&"function"==typeof i.then?e6.resolve(i).then(e=>l.active?e:tS(new eE.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))):c.then(()=>i)).then(e=>(a&&l._resolve(),l._completion.then(()=>e))).catch(e=>(l._reject(e),tS(e)))})}).bind(null,this,o,a,r,n);return r?r._promise(o,s,"lock"):e2.trans?tx(e2.transless,()=>this._whenReady(s)):this._whenReady(s)}table(e){if(!R(this._allTables,e))throw new eE.InvalidTable(`Table ${e} does not exist`);return this._allTables[e]}}let nj="u">typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";class nR{constructor(e){this._subscribe=e}subscribe(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})}[nj](){return this}}function nF(e,t){return T(t).forEach(n=>{nM(e[n]||(e[n]=new nD),t[n])}),e}try{o={indexedDB:N.indexedDB||N.mozIndexedDB||N.webkitIndexedDB||N.msIndexedDB,IDBKeyRange:N.IDBKeyRange||N.webkitIDBKeyRange}}catch(e){o={indexedDB:null,IDBKeyRange:null}}function nL(e){let t=nW;try{nW=!0,t7.storagemutated.fire(e)}finally{nW=t}}F(nI,{...ez,delete:e=>new nI(e,{addons:[]}).delete(),exists:e=>new nI(e,{addons:[]}).open().then(e=>(e.close(),!0)).catch("NoSuchDatabaseError",()=>!1),getDatabaseNames(e){try{return(function({indexedDB:e,IDBKeyRange:t}){return nb(e)?Promise.resolve(e.databases()).then(e=>e.map(e=>e.name).filter(e=>"__dbnames"!==e)):ny(e,t).toCollection().primaryKeys()})(nI.dependencies).then(e)}catch(e){return tS(new eE.MissingAPI)}},defineClass:()=>function(e){O(this,e)},ignoreTransaction:e=>e2.trans?tx(e2.transless,e):e(),vip:nv,async:function(e){return function(){try{var t=n$(e.apply(this,arguments));return t&&"function"==typeof t.then?t:e6.resolve(t)}catch(e){return tS(e)}}},spawn:function(e,t,n){try{var o=n$(e.apply(n,t||[]));return o&&"function"==typeof o.then?o:e6.resolve(o)}catch(e){return tS(e)}},currentTransaction:{get:()=>e2.trans||null},waitFor:function(e,t){let n=e6.resolve("function"==typeof e?nI.ignoreTransaction(e):e).timeout(t||6e4);return e2.trans?e2.trans.waitFor(n):n},Promise:e6,debug:{get:()=>eh,set:e=>{eh=e,em="dexie"===e?()=>!0:tN}},derive:V,extend:O,props:F,override:K,Events:tj,on:t7,liveQuery:function(e){return new nR(t=>{let n=ef(e),o=!1,a={},r={},i={get closed(){return o},unsubscribe:()=>{o=!0,t7.storagemutated.unsubscribe(c)}};t.start&&t.start(i);let s=!1,l=!1;function p(){return T(r).some(e=>a[e]&&function(e,t){let n=nN(t),o=n.next();if(o.done)return!1;let a=o.value,r=nN(e),i=r.next(a.from),s=i.value;for(;!o.done&&!i.done;){if(0>=tH(s.from,a.to)&&tH(s.to,a.from)>=0)return!0;0>tH(a.from,s.from)?a=(o=n.next(s.from)).value:s=(i=r.next(a.from)).value}return!1}(a[e],r[e]))}let c=e=>{nF(a,e),p()&&d()},d=()=>{let u,f;if(s||o)return;a={};let h={},m=(n&&tg(),u=()=>t_(e,{subscr:h,trans:null}),f=e2.trans?tx(e2.transless,u):u(),n&&f.then(ty,ty),f);l||(t7("storagemutated",c),l=!0),s=!0,Promise.resolve(m).then(e=>{s=!1,o||(p()?d():(a={},r=h,t.next&&t.next(e)))},e=>{s=!1,t.error&&t.error(e),i.unsubscribe()})};return d(),i})},extendObservabilitySet:nF,getByKeyPath:X,setByKeyPath:Q,delByKeyPath:function(e,t){"string"==typeof t?Q(e,t,void 0):"length"in t&&[].map.call(t,function(t){Q(e,t,void 0)})},shallowClone:ee,deepClone:ei,getObjectDiff:nw,cmp:tH,asap:Y,minKey:-1/0,addons:[],connections:tP,errnames:eC,dependencies:o,semVer:"3.2.2",version:"3.2.2".split(".").map(e=>parseInt(e)).reduce((e,t,n)=>e+t/Math.pow(10,2*n))}),nI.maxKey=no(nI.dependencies.IDBKeyRange),"u">typeof dispatchEvent&&"u">typeof addEventListener&&(t7("storagemutated",e=>{if(!nW){let t;tM?(t=document.createEvent("CustomEvent")).initCustomEvent("x-storagemutated-1",!0,!0,e):t=new CustomEvent("x-storagemutated-1",{detail:e}),nW=!0,dispatchEvent(t),nW=!1}}),addEventListener("x-storagemutated-1",({detail:e})=>{nW||nL(e)}));let nW=!1;if("u">typeof BroadcastChannel){let e=new BroadcastChannel("x-storagemutated-1");t7("storagemutated",t=>{nW||e.postMessage(t)}),e.onmessage=e=>{e.data&&nL(e.data)}}else if("u">typeof self&&"u">typeof navigator){t7("storagemutated",e=>{try{nW||("u">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){}}),"u">typeof addEventListener&&addEventListener("storage",e=>{if("x-storagemutated-1"===e.key){let t=JSON.parse(e.newValue);t&&nL(t.changedParts)}});let e=self.document&&navigator.serviceWorker;e&&e.addEventListener("message",function({data:e}){e&&"x-storagemutated-1"===e.type&&nL(e.changedParts)})}e6.rejectionMapper=function(e,t){if(!e||e instanceof eA||e instanceof TypeError||e instanceof SyntaxError||!e.name||!eS[e.name])return e;var n=new eS[e.name](t||e.message,e);return"stack"in e&&W(n,"stack",{get:function(){return this.inner.stack}}),n},em=tN;var nV=n(30325),nG=n(21013);function nU(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class nq extends nI{constructor(){super("EsmOffline"),nU(this,"syncQueue",void 0),nU(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 nH(){return new nq}let nK=new nq,nZ={},nY=(0,nG.Zd)("offline-synchronization",{});function nJ(){return nY}async function nX(){if(nY.getState().synchronization)return;let e=await nK.syncQueue.count(),t={},n=Object.entries(nZ),o=n.length,a={},r=new AbortController,i=()=>{let e=nY.getState().synchronization;nY.setState({synchronization:{...e,pendingCount:e.pendingCount-1}})};try{nY.setState({synchronization:{totalCount:e,pendingCount:e,abortController:r}});for(let e=0;e<o&&n.length>0;e++)for(let e=n.length;e--;){let[o,s]=n[e],l=s.dependsOn.map(e=>t[e]);l.every(Boolean)&&(a[o]={},await Promise.all(l),t[o]=nQ(s,a,r,i),n.splice(e,1))}await Promise.allSettled(Object.values(t))}finally{nY.setState({synchronization:void 0})}}async function nQ({type:e,dependsOn:t,process:n},o,a,r){let i=[],s=[],l=await n0();await nK.syncQueue.where({type:e,userId:l}).each((e,t)=>{i.push([t.primaryKey,e.content,e.descriptor]),s.push(e.content)});for(let p=0;p<i.length;p++){let[c,d,{id:u,dependencies:f=[]}]=i[p];try{let r=await n(d,{abort:a,index:p,items:s,userId:l,dependencies:f.map(({id:e,type:n})=>t.includes(n)?o[n][e]:void 0)});void 0!==u&&(o[e][u]=r),await nK.syncQueue.delete(c)}catch(e){await nK.syncQueue.update(c,{lastError:{name:e?.name,message:e?.message??e?.toString()}})}finally{r()}}}async function n0(){let e=await (0,nV.xC)();return e?.uuid||"*"}async function n1(e,t,n,o){let a=o&&o.id;return void 0!==a&&await nK.syncQueue.where({type:t,userId:e}).filter(e=>e?.descriptor.id===a).delete().catch(nI.errnames.DatabaseClosed),await nK.syncQueue.add({type:t,content:n,userId:e,descriptor:o||{},createdOn:new Date}).catch(nI.errnames.DatabaseClosed,()=>-1)}async function n2(e,t,n){let o=await n0();return await n1(o,e,t,n)}async function n3(e,t){return(await n5(e,t)).map(e=>e.content)}async function n5(e,t){return await nK.syncQueue.where(t?{type:t,userId:e}:{userId:e}).toArray().catch(nI.errnames.DatabaseClosed,()=>[])}async function n4(e){let t=await n0();return await n3(t,e)}async function n6(e){let t=await n0();return await n5(t,e)}async function n8(e){return await nK.syncQueue.get(e).catch(nI.errnames.DatabaseClosed,()=>void 0)}function n7(e){return!!nZ[e]?.options.onBeginEditSyncItem}async function n9(e){let t=await n8(e);if(!t)throw Error(`No sync item with the ID ${e} exists.`);let n=nZ[t.type]?.options.onBeginEditSyncItem;if(!n)throw 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 "${t.type}" supports editing items.`);n(t)}async function oe(e){await nK.syncQueue.delete(e).catch(nI.errnames.DatabaseClosed)}function ot(e,t,n,o={}){nZ[e]={type:e,dependsOn:t,process:n,options:o}}let on="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),oo=new Uint8Array(16),oa=[];for(let e=0;e<256;++e)oa.push((e+256).toString(16).slice(1));let or=function(e,t,n){if(on&&!t&&!e)return on();let o=(e=e||{}).random||(e.rng||function(){if(!a&&!(a="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return a(oo)})();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=o[e];return t}return function(e,t=0){return oa[e[t+0]]+oa[e[t+1]]+oa[e[t+2]]+oa[e[t+3]]+"-"+oa[e[t+4]]+oa[e[t+5]]+"-"+oa[e[t+6]]+oa[e[t+7]]+"-"+oa[e[t+8]]+oa[e[t+9]]+"-"+oa[e[t+10]]+oa[e[t+11]]+oa[e[t+12]]+oa[e[t+13]]+oa[e[t+14]]+oa[e[t+15]]}(o)},oi="OFFLINE+";function os(){return oi+or()}function ol(e){return e.startsWith(oi)}let op={};function oc(){return Object.values(op)}function od(e){op[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.`),op[e.id]=e}async function ou(e){let t=await ov();return await of(t,e)}async function of(e,t){let n=new nq;return await n.dynamicOfflineData.where(t?{type:t,users:e}:{users:e}).toArray().catch(nI.errnames.DatabaseClosed,()=>[])}async function oh(e,t){let n=await ov();return await om(n,e,t)}async function om(e,t,n){let o=new nq,a=await o.dynamicOfflineData.get({type:t,identifier:n}).catch(nI.errnames.DatabaseClosed,()=>void 0);a?a.users.includes(e)||await o.dynamicOfflineData.update(a.id,{users:[...a.users,e]}).catch(nI.errnames.DatabaseClosed):await o.dynamicOfflineData.add({users:[e],type:t,identifier:n}).catch(nI.errnames.DatabaseClosed)}async function o_(e,t){let n=await ov();return await og(n,e,t)}async function og(e,t,n){let o=new nq,a=await o.dynamicOfflineData.get({type:t,identifier:n,users:e}).catch(nI.errnames.DatabaseClosed,()=>void 0);a&&(a.users.length>1?await o.dynamicOfflineData.update(a.id,{users:a.users.filter(t=>t!==e)}).catch(nI.errnames.DatabaseClosed):await o.dynamicOfflineData.delete(a.id).catch(nI.errnames.DatabaseClosed))}async function oy(e,t){let n=await ou(e);await Promise.all(n.map(async e=>ob(e.type,e.identifier,t)))}async function ob(e,t,n){await oh(e,t);let o=new nq,a=await ov(),r=await o.dynamicOfflineData.get({type:e,identifier:t}).catch(nI.errnames.DatabaseClosed,()=>void 0),i=oc().filter(t=>t.type===e);if(!r)return;let s=await Promise.all(i.map(async e=>{try{return e.sync(t,n),{id:e.id,error:void 0}}catch(n){let t=n.message?.toString()??n.toString();return{id:e.id,error:t}}})),l=s.filter(e=>!e.error).map(e=>e.id),p=s.filter(e=>e.error).map(e=>e.id),c=s.filter(e=>e.error).map(e=>({handlerId:e.id,message:e.error})),d={syncedOn:new Date,syncedBy:a,succeededHandlers:l,erroredHandlers:p,errors:c};r.id&&await o.dynamicOfflineData.update(r.id,{syncState:d}).catch(nI.errnames.DatabaseClosed)}async function ov(){let e=(await (0,nV.xC)()).uuid;if(!e)throw Error("Using the dynamic offline data API requires a logged in user.");return e}let o$=(0,nG.Zd)("offline-patients",{offlinePatientDataSyncState:{},handlers:{}});function oA(){return ow(),o$}function ok(e,t){ow(),od({type:"patient",displayName:t.displayName,id:e,isSynced:()=>Promise.resolve(!0),sync:(e,n)=>t.onOfflinePatientAdded({patientUuid:e,signal:n??new AbortController().signal})})}async function ox(e){ow(),await ob("patient",e)}function ow(){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.")}},91643(e,t,n){"use strict";let o;n.d(t,{fq:()=>e2,JK:()=>M,if:()=>eI,tQ:()=>eq,YY:()=>c,E4:()=>eh,zD:()=>ei,g9:()=>T,uL:()=>g,kH:()=>eR,WK:()=>eG,br:()=>b,Gz:()=>eg,M3:()=>eW,qw:()=>eY,Wq:()=>e_,rr:()=>m,oU:()=>eK,wV:()=>eZ,d7:()=>ec,Jm:()=>eL,xH:()=>e1,W3:()=>$,zq:()=>i,Ie:()=>K,CH:()=>ev,ns:()=>N,vL:()=>eN,xl:()=>eO,Us:()=>Z,UK:()=>er,fS:()=>H,yJ:()=>et,u:()=>eb,to:()=>ex,iy:()=>eS,_9:()=>ee,Bf:()=>eD,Tt:()=>X,CX:()=>y,Ed:()=>e$,p6:()=>q,Wr:()=>eF,TA:()=>ej,F7:()=>P,qv:()=>eB,sc:()=>B,WQ:()=>eV,Pj:()=>f,i_:()=>l,$B:()=>em,oq:()=>eM,wJ:()=>eH,mQ:()=>h,wr:()=>e3,mw:()=>ew,jn:()=>U,Fx:()=>ep});var a=n(35399),r=n.n(a);let i=(0,a.createContext)({moduleName:"",featureName:""});var s=n(86236);function l({to:e,templateParams:t,onBeforeNavigate:n,children:o,...i}){return(0,a.useEffect)(()=>{i.href&&console.warn(`ConfigurableLink does not support the href prop. Use the 'to' prop instead. The provided href value is '${i.href}'`),i.onClick&&console.warn(`ConfigurableLink does not support the onClick prop. Use the 'onBeforeNavigate' prop instead. The 'to' prop of the offending link is ${e}`)},[]),r().createElement("a",{onClick:o=>{0===o.button&&!o.ctrlKey&&!o.shiftKey&&!o.altKey&&!o.metaKey&&(o.preventDefault(),n?.(o),(0,s.oo)({to:e,templateParams:t})),0===o.button&&(o.ctrlKey||o.metaKey)&&n?.(o),0===o.button&&o.shiftKey&&n?.(o),1===o.button&&n?.(o)},href:(0,s.JG)(e,t),...i},o)}var p=n(26223);let c=({state:e,children:t,...n})=>{let{extension:o}=(0,a.useContext)(i),s=(0,a.useRef)(null),l=(0,a.useRef)(Promise.resolve()),c=(0,a.useCallback)(t=>{o?.extensionSlotName&&o.extensionSlotModuleName&&o.extensionSlotModuleName&&!s.current&&(0,p.wG)(t,o.extensionSlotName,o.extensionSlotModuleName,o.extensionId,void 0,e).then(e=>{s.current=e})},[]);return(0,a.useEffect)(()=>()=>{if(s&&s.current)switch(s.current.getStatus()){case"MOUNTING":s.current.mountPromise.then(()=>{s.current?.getStatus()==="MOUNTED"&&s.current.unmount()});break;case"MOUNTED":s.current.unmount();break;case"UPDATING":l.current&&l.current.then(()=>{s.current?.getStatus()==="MOUNTED"&&s.current.unmount()})}},[]),(0,a.useEffect)(()=>{s.current&&s.current.update&&"UNMOUNTING"!==s.current.getStatus()&&Promise.all([s.current.mountPromise,l.current]).then(()=>{s?.current?.getStatus()==="MOUNTED"&&s.current.update&&(l.current=s.current.update({...e}).catch(e=>{if(!(e instanceof Error)||!e.message.includes("minified message #32")||s.current?.getStatus()==="MOUNTED")throw e}))})},[e]),o?r().createElement("div",{ref:c,"data-extension-id":o?.extensionId,style:{position:"relative"},...n}):null};function d(e,t){"function"==typeof t&&(t=t(e));let n={};for(let[o,a]of Object.entries(t)){let t=function(...t){e.setState(e=>a(e,...t))};n[o]=t}return n}let u=()=>e=>e;function f(e,t=u(),n){let o=(0,a.useCallback)(t=>e.subscribe(t),[e]),r=(0,a.useCallback)(()=>t(e.getState()),[e,t]),i=(0,a.useSyncExternalStore)(o,r,r),s=(0,a.useMemo)(()=>n?d(e,n):{},[e,n]);return{...i,...s}}function h(e,t){return f(e,u(),t)}function m(e){return function(t){let n=(0,a.useCallback)(t=>e.subscribe(t),[]),o=(0,a.useCallback)(()=>e.getState(),[]),r=(0,a.useSyncExternalStore)(n,o,o),i=(0,a.useMemo)(()=>t?d(e,t):{},[t]);return{...r,...i}}}let g=e=>f((0,p.zF)(),t=>t.slots?.[e]);function y(e){let t=g(e);return t?.assignedExtensions??[]}function b(e,t){let{moduleName:n}=(0,a.useContext)(i),o=(0,a.useRef)(!0);if(!n)throw Error("ComponentContext has not been provided. This should come from @openmrs/esm-react-utils.");return(0,a.useEffect)(()=>{(0,p.FY)(n,e,t),o.current=!1},[]),(0,a.useEffect)(()=>{o.current||(0,p.ap)(e,t)},[e,t]),{extensions:y(e),extensionSlotName:e,extensionSlotModuleName:n}}function v(e){return e}function $({name:e,extensionSlotName:t,select:n=v,children:o,state:s,style:l,...p}){if(o&&s)throw Error("Both children and state have been provided. If children are provided, the state must be passed as a prop to the `Extension` component.");let d=e??t,u=(0,a.useRef)(null),{extensions:f,extensionSlotModuleName:h}=b(d,s),m=(0,a.useMemo)(()=>n(f),[n,f]),g=(0,a.useMemo)(()=>{if("function"==typeof o&&!r().isValidElement(o))return m.map(e=>o(e,s))},[o,m]);return r().createElement("div",{ref:u,"data-extension-slot-name":d,"data-extension-slot-module-name":h,style:{...l,position:"relative"},...p},d&&m?.map((e,t)=>r().createElement(i.Provider,{key:e.id,value:{moduleName:h,featureName:"",extension:{extensionId:e.id,extensionSlotName:d,extensionSlotModuleName:h}}},g?.[t]??("function"!=typeof o?o:null)??r().createElement(c,{state:s}))))}var A=n(25873),k=n(61469),x=n(27807),w=n(71123),C=n(43432),E=n(30325);let S={strictMode:!0,throwErrorsToConsole:!0,disableTranslations:!1},z=new Map;(0,C.initCache)(z);let D={errorRetryCount:3,fetcher:E.lo,focusThrottleInterval:18e5,revalidateIfStale:!0,revalidateOnFocus:!1,revalidateOnReconnect:!1,refreshInterval:0,shouldRetryOnError:e=>{if(e instanceof E.$f){let t=e.response.status;return!!(t>=500)||401===t||403===t||429===t}return!0},provider:()=>z};function P(e){if("object"!=typeof e||"string"!=typeof e.featureName||"string"!=typeof e.moduleName)throw Error("Invalid options");let t=Object.assign({},S,e),n={...D,...t.swrConfig};return function(e){var o,s,l,p,c;return l=s=class extends(o=r().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().createElement("div",null,"An error has occurred. Please try reloading the page.");{let o=r().createElement(a.Suspense,{fallback:null},r().createElement(w.BE,{value:n},r().createElement(i.Provider,{value:this.state.config},t.disableTranslations?r().createElement(e,this.props):r().createElement(x.I18nextProvider,{i18n:window.i18next,defaultNS:this.state.config.extension?`${this.state.config.moduleName}___${this.state.config.extension.extensionSlotName}___${this.state.config.extension.extensionId}`:this.state.config.moduleName},r().createElement(e,this.props)))));return t.strictMode&&r().StrictMode?r().createElement(r().StrictMode,null,o):o}}constructor(e){super(e),this.state={caughtError:null,caughtErrorInfo:null,config:{moduleName:t.moduleName,featureName:t.featureName,extension:e._extensionContext}}}},p="displayName",c=`OpenmrsReactComponent(${t.featureName})`,p in l?Object.defineProperty(l,p,{value:c,enumerable:!0,configurable:!0,writable:!0}):l[p]=c,s}}function M(e,t){return(0,k.A)({React:r(),ReactDOMClient:A,rootComponent:P(t)(e)})}function N(e,t){return()=>e().then(({default:e})=>M(e,t))}function T(e,t){return()=>Promise.resolve(M(e,t))}let B=N;var O=n(43132),I=n(21013);let j=(0,O.y)()(()=>({}));(0,I.CE)("openmrs-app-context",j);let R={};function F(e,t=e=>e){let n=j.getState();return e in n?Object.freeze(Object.assign({},t?t(n[e]):n[e])):null}function L(e,t){j.setState(n=>(e in n||(n[e]={}),n[e]=t(n[e]),Object.assign({},n)))}function W(e){return null===e?null:Object.freeze(Object.assign({},e))}var V=n(43254);let G=new Map;function U(e,t){let n=(0,a.useRef)(t??{}),o=(0,a.useRef)(t=>L(e,t)),r=(0,a.useRef)(Symbol());return(0,a.useEffect)(()=>{let n=t??{},o=r.current;return null===F(e)?!function(e,t=R){j.setState(n=>{if(e in n)throw Error(`Attempted to re-register namespace ${e} in the app context. Each namespace must be unregistered before the name can be registered again.`);return Object.assign({},n,{[e]:t===R?{}:t})})}(e,n):(console.warn(`Namespace ${e} is already registered in the app context. This is likely a race condition during navigation, but may indicate two components are trying to own the same namespace. Updating the existing context.`),L(e,()=>n)),G.set(e,o),()=>{G.get(e)===o&&(j.setState(t=>(e in t&&delete t[e],t)),G.delete(e))}},[e]),(0,a.useEffect)(()=>{let o=t??{};(0,V.b)(n.current,o)||(L(e,()=>o),n.current=o)},[t]),o.current}function q({namespace:e,value:t}){return U(e,t),null}let H=({children:e,value:t,fallback:n})=>t?r().createElement(r().Fragment,null,e):n?r().createElement(r().Fragment,null,n):null;function K(){let e=(0,a.useRef)();return(!e.current||e.current.signal.aborted)&&(e.current=new AbortController),(0,a.useEffect)(()=>{let t=e.current;return()=>t?.abort()},[]),e.current}function Z(e,t=e=>e??{}){let[n,o]=(0,a.useState)(()=>{if(Y(e))return;let n=F(e);if(null!==n)return t?t(n):n});return(0,a.useEffect)(()=>{if(Y(e))throw Error(`The namespace supplied to useAppContext must be a non-empty string, but was "${e}".`)},[e]),(0,a.useEffect)(()=>{var n;let a;return(n=e=>{if(null==e)return void o(void 0);let n=t?t(e):e;o(e=>(0,V.b)(e,n)?e:n)})(W(a=F(e))),j.subscribe(t=>{let o=e in t?t[e]:null;o!==a&&(a=o,n(W(o)))})},[e,t]),n}function Y(e){return"string"!=typeof e||0===e.trim().length}var J=n(42853);function X(e){let[t,n]=(0,a.useState)([]);return(0,a.useEffect)(()=>(0,p.zF)().subscribe(o=>{let a=o.slots[e]?.assignedExtensions.map(e=>e.id)??[];(0,J.A)(a,t)||n(a)}),[]),t}var Q=n(36289);function ee(e,t){let{data:n,error:o,mutate:r,isLoading:i,isValidating:s}=(0,w.Ay)(`${Q.Zu}?patient=${e}&includeEncounterless=${t}`,E.lo);return(0,a.useMemo)(()=>({isLoading:i,data:n?.data.results??[],error:o,mutate:r,isValidating:s}),[n,o,i,s,r])}function et(e){(0,a.useEffect)(()=>{if(e){let e=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}},[e])}var en=n(33869);let eo={},ea=`No ComponentContext has been provided. This should come from "openmrsComponentDecorator".
27
+ Usually this is already applied when using "getAsyncLifecycle" or "getSyncLifecycle".`;function er(e){let{moduleName:t,extension:n}=(0,a.useContext)(i),o=e?.externalModuleName??t;if(!o&&!n)throw Error(ea);let r=function(e){let t=(0,a.useMemo)(()=>(0,en.IS)(e),[e]),n=function(e){let[t,n]=(0,a.useState)(()=>{let t=e.getState();return t.loaded&&t.config?t.config:null});return(0,a.useEffect)(()=>e?.subscribe(e=>{e.loaded&&e.config&&n(e.config)}),[e]),t}(t);if(!n)throw eo[e]||(eo[e]=new Promise(e=>{let n=t.subscribe(t=>{t.loaded&&t.config&&(e(t.config),n())})})),eo[e];return n}(o),s=function(e){let t=(0,a.useMemo)(en.GI,[]),n=function(e,t){let[n,o]=(0,a.useState)(t?()=>{let n=e.getState(),o=(0,en.P0)(n,t.extensionSlotName,t.extensionId);if(o.loaded&&o.config)return o.config}:null);return(0,a.useEffect)(()=>{if(t)return e.subscribe(e=>{let a=(0,en.P0)(e,t.extensionSlotName,t.extensionId);a.loaded&&a.config&&!(0,J.A)(a.config,n)&&o(a.config)})},[e,t,n]),n}(t,e);if(!n&&e){let n=`${e.extensionSlotName}-${e.extensionId}`;throw!eo[n]&&t&&(eo[n]=new Promise(n=>{let o=t.subscribe(t=>{let a=(0,en.P0)(t,e.extensionSlotName,e.extensionId);a.loaded&&a.config&&(n(a.config),o())})})),eo[n]}return n||{}}(n);return(0,a.useMemo)(()=>e?.externalModuleName&&o===e.externalModuleName?{...r}:{...r,...s},[o,e?.externalModuleName,r,s])}let ei=y;var es=n(4230),el=n(6564);function ep(){let[e,t]=(0,a.useState)((0,el.s)());return(0,a.useEffect)(()=>(0,es.gj)(({online:e})=>t(e)),[]),e}function ec(e,t=300){let[n,o]=(0,a.useState)(e);return(0,a.useEffect)(()=>{let n=setTimeout(()=>{o(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}var ed=n(13660),eu=n.n(ed);let ef=`custom:${[["admissionDecisionConcept","ref"],["admissionEncounterType","ref"],["admissionForm","ref"],["atFacilityVisitType","ref"],["bedAssignmentEncounterType","ref"],["cancelADTRequestEncounterType","ref"],["checkInClerkEncounterRole","ref"],["checkInEncounterType","ref"],["clinicianEncounterRole","ref"],["conceptSourcesForDiagnosisSearch","ref"],["consultEncounterType","ref"],["consultFreeTextCommentsConcept","ref"],["denyAdmissionConcept","ref"],["diagnosisMetadata","ref"],["diagnosisSets","ref"],["dischargeForm","ref"],["dispositionDescriptor","ref"],["dispositions","ref"],["emrApiConceptSource","ref"],["exitFromInpatientEncounterType","ref"],["extraPatientIdentifierTypes","ref"],["fullPrivilegeLevel","ref"],["highPrivilegeLevel","ref"],["identifierTypesToSearch","ref"],["inpatientNoteEncounterType","ref"],["lastViewedPatientSizeLimit","ref"],["metadataSourceName","ref"],["motherChildRelationshipType","ref"],["narrowerThanConceptMapType","ref"],["nonDiagnosisConceptSets","ref"],["orderingProviderEncounterRole","ref"],["patientDiedConcept","ref"],["personImageDirectory","ref"],["primaryIdentifierType","ref"],["sameAsConceptMapType","ref"],["suppressedDiagnosisConcepts","ref"],["supportsAdmissionLocationTag","(uuid,display,name,links)"],["supportsLoginLocationTag","(uuid,display,name,links)"],["supportsTransferLocationTag","(uuid,display,name,links)"],["supportsVisitsLocationTag","(uuid,display,name,links)"],["telephoneAttributeType","ref"],["testPatientPersonAttributeType","ref"],["transferForm","ref"],["transferRequestEncounterType","ref"],["transferWithinHospitalEncounterType","ref"],["unknownCauseOfDeathConcept","ref"],["unknownLocation","ref"],["unknownPatientPersonAttributeType","ref"],["unknownProvider","ref"],["visitAssignmentHandlerAdjustEncounterTimeOfDayIfNecessary","ref"],["visitExpireHours","ref"],["visitNoteEncounterType","ref"]].map(([e,t])=>`${e}:${t}`).join(",")}`;function eh(){let e=`${E.Jj}/emrapi/configuration?v=${ef}`,t=eu()(e,E.lo);return(0,a.useMemo)(()=>({emrConfiguration:t.data?.data,isLoadingEmrConfiguration:t.isLoading,mutateEmrConfiguration:t.mutate,errorFetchingEmrConfiguration:t.error}),[t])}let em=m((0,p.a9)());function e_(e){let t=y(e);return(0,a.useMemo)(()=>Object.fromEntries(t.map(e=>[e.name,e.meta])),[t])}let eg=m((0,p.zF)());var ey=n(25767);function eb(e){let{flags:t}=f(ey.jX);return t[e]?.enabled??!1}function ev(){let[,e]=(0,a.useState)(0);return(0,a.useCallback)(()=>{e(e=>e+1)},[])}function e$(e,t,n={}){return ek(e,t,eA,n)}let eA={getPaginatedUrl:(e,t,n)=>{if(!e)return null;{let o=new URL((0,E.Gm)(e.toString()),window.location.toString());return o.searchParams.set("limit",""+t),o.searchParams.set("startIndex",""+n),o.searchParams.set("totalCount","true"),o.toString()}},getNextUrl:e=>{let t=e?.links?.find(e=>"next"==e.rel)?.uri;if(!t)return null;{let e=new URL(t);return e.host=window.location.host,e.protocol=window.location.protocol,e.toString()}},getTotalCount:e=>e?.totalCount??NaN,getCurrentPageSize:e=>e?.results?.length??NaN,getData:e=>e?.results};function ek(e,t,n,o={}){let{getPaginatedUrl:r,getTotalCount:i,getCurrentPageSize:s,getData:l}=n,{immutable:p,swrConfig:c}=o,d=o.fetcher??E.lo,[u,f]=(0,a.useState)(1),h=(0,a.useRef)(NaN),m=(0,a.useRef)(NaN),g=(u-1)*t,y=(0,a.useMemo)(()=>r(e,t,g),[e,t,g]),{data:b,...v}=(p?eu():w.Ay)(y,d,c);b?.data&&(h.current=i(b?.data),m.current=s(b?.data));let $=Math.ceil(h.current/t),A=(0,a.useCallback)(e=>{0<e&&e<=$?f(e):console.warn("Invalid attempt to go to out of bounds page: "+e)},[e,u,$]),k=(0,a.useCallback)(()=>{A(u+1)},[e,u,$]),x=(0,a.useCallback)(()=>{A(u-1)},[e,u,$]);return{data:l(b?.data),totalPages:$,totalCount:h.current,currentPage:u,currentPageSize:m,paginated:$>1,showNextButton:u<$,showPreviousButton:u>1,goTo:A,goToNext:k,goToPrevious:x,...v}}function ex(e,t,n={}){return ek(e,t,ew(),n)}function ew(){return{getPaginatedUrl:(e,t,n)=>{if(!e)return null;{let o=new URL((0,E.Gm)(e.toString()),window.location.toString());return o.searchParams.set("_count",""+t),o.searchParams.set("_getpagesoffset",""+n),o.toString()}},getNextUrl:e=>{let t=e?.link?.find(e=>"next"==e.relation)?.url;if(!t)return null;{let e=new URL(t);return e.host=window.location.host,e.protocol=window.location.protocol,e.toString()}},getTotalCount:e=>e?.total??NaN,getCurrentPageSize:e=>e?.entry?.length??NaN,getData:e=>e?.entry?.map(e=>e.resource)}}var eC=n(30682),eE=n.n(eC);function eS(e,t={}){return ez(e,eA,t)}function ez(e,t,n={}){let{swrInfiniteConfig:o,immutable:r}=n,{getNextUrl:i,getTotalCount:s,getData:l}=t,p=n.fetcher??E.lo,c=(0,a.useCallback)((n,o)=>0==n?e?.toString()??null:t.getNextUrl(o.data),[e]),{data:d,size:u,setSize:f,...h}=eE()(c,p,{...o,...r?{revalidateIfStale:!1,revalidateOnFocus:!1,revalidateOnReconnect:!1}:{}}),m=i(d?.[d.length-1].data),g=s(d?.[0]?.data);return{data:d?.flatMap(e=>l(e.data)),totalCount:g,hasMore:null!=m,loadMore:()=>{f((d?.length??0)+1)},nextUri:m,...h}}function eD(e,t={}){return eP(e,eA,t)}function eP(e,t,n={}){let o=ez(e,t,n),{hasMore:r,error:i,data:s,loadMore:l,isLoading:p,nextUri:c}=o;return((0,a.useEffect)(()=>{r&&!i&&l()},[r,c]),n.partialData)?o:{...o,data:r||i?void 0:s,isLoading:p||r}}function eM(e,t={}){return eP(e,ew(),t)}function eN(e,t={}){return ez(e,ew(),t)}function eT(){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 eB(){let[e,t]=(0,a.useState)(eT);return(0,a.useEffect)(()=>{let e=()=>{t(eT())};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}let eO=e=>"small-desktop"===e||"large-desktop"===e;function eI(e){let t=(0,a.useContext)(i);(0,a.useEffect)(()=>(t&&t.moduleName&&(e.componentContext=t),(0,p.Vx)(e),()=>{(0,p.sr)(e.name)}),[t,e])}function ej(){return f(p.Gp)}function eR(e=null,t=null){let[n,o]=(0,a.useState)([]);return(0,a.useEffect)(()=>{let n=(0,Q.Vs)(e,t).subscribe(e=>{o(e)},e=>{console.error(e)});return()=>n.unsubscribe()},[e,t]),n}function eF(e,t=!0){let n=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let o=o=>{t&&n.current&&o.target&&o.target instanceof Node&&(n.current.contains(o.target)||e(o))};return window.addEventListener("mousedown",o),window.addEventListener("touchstart",o),()=>{window.removeEventListener("mousedown",o),window.removeEventListener("touchstart",o)}},[e,t]),n}function eL(e){let t=(0,a.useRef)();return(0,a.useEffect)(()=>{let n=new IntersectionObserver(t=>{for(let n of t)if(n.isIntersecting)return void e()},{threshold:1});return t.current&&n.observe(t.current),()=>{t.current&&n.unobserve(t.current)}},[t.current,e]),t}function eW(e,t={}){let{abortController:n,fetchInit:o,url:r,swrConfig:i}=t,s=K(),l=(0,a.useMemo)(()=>o?.signal??n?.signal??s.signal,[n?.signal,o?.signal,s.signal]),p=(0,a.useCallback)(e=>{let t=function(e,t){if(t)return"function"==typeof t?t(e):t;if("string"==typeof e)return e;throw Error(`When using useOpenmrsSWR with a key that is not a string, you must provide a url() function that converts the key to a valid url. The key for this hook is ${e}.`)}(e,r);return(0,E.lo)(t,{...o,signal:l})},[l,o,r]);return(0,w.Ay)(e,p,i)}function eV(e=[],t=10){let[n,o]=(0,a.useState)(1),r=(0,a.useMemo)(()=>"number"==typeof t&&t>0?Math.max(1,Math.ceil(e.length/t)):1,[e.length,t]),i=(0,a.useMemo)(()=>{let o=(n-1)*t,a=(n+0)*t;return e.slice(o,a)},[e,n,t]),s=(0,a.useCallback)(e=>{o(Math.max(1,Math.min(r,e)))},[o,r]),l=(0,a.useCallback)(()=>{n<r&&o(n+1)},[n,r,o]),p=(0,a.useCallback)(()=>{n>1&&o(n-1)},[n,o]);return(0,a.useMemo)(()=>({results:i,totalPages:r,currentPage:n,paginated:e.length>t,showNextButton:n<r,showPreviousButton:n>1,goTo:s,goToNext:l,goToPrevious:p}),[i,r,e.length,t,n,s,l,p])}function eG(e,t,n,o){return{pageSizes:(0,a.useMemo)(()=>{let n=Math.ceil(t/e);return isNaN(n)&&(n=0),[...Array(n).keys()].map(t=>(t+1)*e)},[e,t]),pageItemsCount:(0,a.useMemo)(()=>e>t?t:e*n>t?e*(n-1)+o:e*n,[e,t,n,o])}}function eU(){let e=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return e&&e[1]}function eq(e){let[t,n]=(0,a.useState)(e??eU()),{data:o,error:r,isValidating:i}=(0,w.Ay)(t?["patient",t]:null,()=>(0,Q.hG)(t,{}));return(0,a.useEffect)(()=>{let e=()=>{let e=eU();e!==t&&n(e)};return window.addEventListener("single-spa:routing-event",e),()=>window.removeEventListener("single-spa:routing-event",e)},[t]),(0,a.useMemo)(()=>({isLoading:i&&!r&&!o,patient:o,patientUuid:t,error:r}),[i,r,o,t])}function eH(){let e=`${E.Jj}/metadatamapping/termmapping?v=custom:(metadataUuid)&code=emr.primaryIdentifierType`,{data:t,error:n,isLoading:o}=(0,w.Ay)(e,E.lo);return(0,a.useMemo)(()=>({primaryIdentifierCode:t?.data?.results[0]?.metadataUuid,isLoading:o,error:n}),[t,n,o])}function eK(e){let{extensions:t,extensionSlotModuleName:n}=b(e);return e?t.map(t=>({state:o})=>r().createElement(i.Provider,{value:{moduleName:n,featureName:"",extension:{extensionId:t.id,extensionSlotName:e,extensionSlotModuleName:n}}},r().createElement(c,{state:o}))):[]}function eZ(){let e=(0,a.useRef)(),[t,n]=(0,a.useState)(null),r=null;if(!t){if(o){let e=(0,E.EW)().getState();e.loaded&&(r=e.session)}else o=new Promise(t=>{let n=({loaded:n,session:o})=>{n&&(t(o),r=o,e.current&&(e.current(),e.current=void 0))};n((0,E.EW)().getState()),r||(e.current=(0,E.EW)().subscribe(n))});if(r)n(r);else throw o}(0,a.useEffect)(()=>(e.current||(e.current=(0,E.EW)().subscribe(({loaded:e,session:t})=>{e&&(r=t,n(t))})),()=>{e.current&&(e.current(),e.current=void 0)}),[]);let i=t||r;if(!i)if(o)throw console.warn("useSession is in an unexpected state. Attempting to recover."),o;else throw Error("useSession is in an invalid state.");return i}let eY=({privilege:e,fallback:t,children:n})=>{let[o,i]=(0,a.useState)(null);return((0,a.useEffect)(()=>{let e=(0,E.HW)({includeAuthStatus:!1}).subscribe(i);return()=>e.unsubscribe()},[]),o&&(0,E.st)(e,o))?r().createElement(r().Fragment,null,n):t?r().createElement(r().Fragment,null,t):null};var eJ=n(80222),eX=n.n(eJ),eQ=n(85602);let e0={setVisitContext:(e,t)=>null==t?{manuallySetVisitUuid:null}:{manuallySetVisitUuid:t.uuid,patientUuid:t.patient?.uuid},mutateVisit(e){for(let t of Object.values(e.mutateVisitCallbacks??{}))t();return{}}};function e1(e){let t=(0,a.useId)();return(0,a.useEffect)(()=>{let n=(0,Q.BX)();return e&&n.setState({mutateVisitCallbacks:{...n.getState().mutateVisitCallbacks,[t]:e}}),()=>{if(e){let e={...n.getState().mutateVisitCallbacks};delete e[t],n.setState({mutateVisitCallbacks:e})}}},[t,e]),h((0,Q.BX)(),e0)}function e2(e,t=Q.Rb){let{patientUuid:n,manuallySetVisitUuid:o,setVisitContext:r}=e1(),i=e&&n==e?o:null,s=`?patient=${e}&v=${t}&includeInactive=false`,l=`/${i}?v=${t}`,{data:p,error:c,mutate:d,isValidating:u}=(0,w.Ay)(e?`${E.Jj}/visit${s}`:null,E.lo),{data:f,error:h,mutate:m,isValidating:g}=(0,w.Ay)(e&&i?`${E.Jj}/visit${l}`:null,E.lo),y=(0,a.useMemo)(()=>p?.data.results.find(e=>null===e.stopDatetime)??null,[p]),b=(0,a.useMemo)(()=>i&&f?f.data:null,[f,i]),v=(0,a.useRef)(null);(0,a.useEffect)(()=>{!u&&y&&n===e&&null===o&&r(y),g||(v.current&&b&&v.current.uuid===b.uuid&&!v.current.stopDatetime&&b.stopDatetime&&r(null),v.current=b)},[b,o,y,u,g,n]);let $=(0,a.useCallback)(()=>{d(),m()},[d,m]);e1($);let A=!!(!p||i&&!f),k=!!(i?h:c);return{error:c||h,mutate:$,isValidating:u||g,activeVisit:y,currentVisit:b,currentVisitIsRetrospective:!!i,isLoading:A&&!k}}function e3(){let[e,t]=(0,a.useState)([]);return(0,a.useEffect)(()=>{let e=(0,Q.Pu)().subscribe(e=>{t(e)},e=>console.error(e));return()=>e.unsubscribe()},[]),e}eX().extend(eQ)},21100(e,t,n){"use strict";n.d(t,{o:()=>i});var o=n(85419),a=n(33869);let r=new Map;async function i(e,t){let n=t.indexOf("#"),a=n>=0,r=a?t.substring(0,n):e,i=a?t.substring(n+1):t,p=await (0,o.rL)(r);return p&&Object.hasOwn(p,i)&&"function"==typeof p[i]?l(r,p).then(()=>p[i]()):(p?p&&Object.hasOwn(p,i)?console.warn(`The export ${t}, defined in ${e}'s routes.json, is not a function`):console.warn(`${r} does not define a component called "${i}", referenced in ${e}'s routes.json. This cannot be loaded.`):console.warn(`Unknown app ${r} for ${t} defined in ${e}'s routes.json`),s)}let s={bootstrap:()=>Promise.resolve(),mount:()=>Promise.resolve(),unmount:()=>Promise.resolve()};async function l(e,t){if(e in r)await r[e];else{let n=t??await (0,o.rL)(e);await (r[e]=new Promise((t,o)=>{if(Object.hasOwn(n,"startupApp")){let r=n.startupApp;if("function"==typeof r)return Promise.resolve(r()).then(()=>{(0,a.kl)(e),t(null)}).catch(o)}(0,a.kl)(e),t(null)}))}}},21013(e,t,n){"use strict";n.d(t,{i7:()=>u,jf:()=>d,CE:()=>c,Zd:()=>p});var o=n(43254);function a(e,t){let n;try{n=e()}catch(e){return}return{getItem:e=>{var o;let a=e=>null===e?null:JSON.parse(e,null==t?void 0:t.reviver),r=null!=(o=n.getItem(e))?o:null;return r instanceof Promise?r.then(a):a(r)},setItem:(e,o)=>n.setItem(e,JSON.stringify(o,null==t?void 0:t.replacer)),removeItem:e=>n.removeItem(e)}}let r=e=>t=>{try{let n=e(t);if(n instanceof Promise)return n;return{then:e=>r(e)(n),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>r(t)(e)}}};var i=n(43132);function s(){try{return"u">typeof process&&("true"===process.env.VITEST||void 0!==process.env.JEST_WORKER_ID)||"u">typeof globalThis&&("__vitest_worker__"in globalThis||"__jest__"in globalThis)}catch{return!1}}let l={};function p(e,t,n="none"){let o=l[e];if(o)return o.active?s()||console.error(`Attempted to override the existing store ${e}. Make sure that stores are only created once.`):o.value.setState(t,!0),o.active=!0,o.value;{let o=f(e,t,n);return l[e]={value:o,active:!0},o}}function c(e,t){let n=l[e];return n?(n.active?s()||console.error(`Attempted to override the existing store ${e}. Make sure that stores are only created once.`):n.value=t,n.active=!0,n.value):(l[e]={value:t,active:!0},t)}function d(e,t,n="none"){let o=l[e];if(!o){let o=f(e,t??{},n);return l[e]={value:o,active:!1},o}return o.value}function u(...e){let[t,n,a]=e,r=void 0===a?n:a,i=void 0===a?e=>e:n,s=i(t.getState());return r(s),t.subscribe(e=>{let t=i(e);(0,o.b)(s,t)||(s=t,r(t))})}function f(e,t,n){return"sessionStorage"===n?(0,i.y)()(((e,t)=>{if("getStorage"in t||"serialize"in t||"deserialize"in t)return console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),(n,o,a)=>{let i,s,l={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},p=!1,c=new Set,d=new Set;try{i=l.getStorage()}catch(e){}if(!i)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${l.name}', the given storage is currently unavailable.`),n(...e)},o,a);let u=r(l.serialize),f=()=>{let e,t=u({state:l.partialize({...o()}),version:l.version}).then(e=>i.setItem(l.name,e)).catch(t=>{e=t});if(e)throw e;return t},h=a.setState;a.setState=(e,t)=>{h(e,t),f()};let m=e((...e)=>{n(...e),f()},o,a),g=()=>{var e;if(!i)return;p=!1,c.forEach(e=>e(o()));let t=(null==(e=l.onRehydrateStorage)?void 0:e.call(l,o()))||void 0;return r(i.getItem.bind(i))(l.name).then(e=>{if(e)return l.deserialize(e)}).then(e=>{if(e)if("number"!=typeof e.version||e.version===l.version)return e.state;else{if(l.migrate)return l.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}}).then(e=>{var t;return n(s=l.merge(e,null!=(t=o())?t:m),!0),f()}).then(()=>{null==t||t(s,void 0),p=!0,d.forEach(e=>e(s))}).catch(e=>{null==t||t(void 0,e)})};return a.persist={setOptions:e=>{l={...l,...e},e.getStorage&&(i=e.getStorage())},clearStorage:()=>{null==i||i.removeItem(l.name)},getOptions:()=>l,rehydrate:()=>g(),hasHydrated:()=>p,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(d.add(e),()=>{d.delete(e)})},g(),s||m};return(n,o,i)=>{let s,l={storage:a(()=>localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},p=!1,c=new Set,d=new Set,u=l.storage;if(!u)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${l.name}', the given storage is currently unavailable.`),n(...e)},o,i);let f=()=>{let e=l.partialize({...o()});return u.setItem(l.name,{state:e,version:l.version})},h=i.setState;i.setState=(e,t)=>{h(e,t),f()};let m=e((...e)=>{n(...e),f()},o,i);i.getInitialState=()=>m;let g=()=>{var e,t;if(!u)return;p=!1,c.forEach(e=>{var t;return e(null!=(t=o())?t:m)});let a=(null==(t=l.onRehydrateStorage)?void 0:t.call(l,null!=(e=o())?e:m))||void 0;return r(u.getItem.bind(u))(l.name).then(e=>{if(e)if("number"!=typeof e.version||e.version===l.version)return[!1,e.state];else{if(l.migrate)return[!0,l.migrate(e.state,e.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]}).then(e=>{var t;let[a,r]=e;if(n(s=l.merge(r,null!=(t=o())?t:m),!0),a)return f()}).then(()=>{null==a||a(s,void 0),s=o(),p=!0,d.forEach(e=>e(s))}).catch(e=>{null==a||a(void 0,e)})};return i.persist={setOptions:e=>{l={...l,...e},e.storage&&(u=e.storage)},clearStorage:()=>{null==u||u.removeItem(l.name)},getOptions:()=>l,rehydrate:()=>g(),hasHydrated:()=>p,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(d.add(e),()=>{d.delete(e)})},l.skipHydration||g(),s||m}})(()=>t,{name:e,storage:a(()=>sessionStorage)})):(0,i.y)()(()=>t)}globalThis.setTimeout?.(()=>{"u">typeof window&&"development"===window.spaEnv&&(window.stores=l)},1e3)},60319(e,t,n){"use strict";n.d(t,{V:()=>Z,t:()=>K});let o={address1:"Address line 1",address2:"Address line 2",address3:"Address line 3",address4:"Address line 4",address5:"Address line 5",address6:"Address line 6",city:"City",cityVillage:"City",country:"Country",countyDistrict:"District",district:"District",postalCode:"Postal code",state:"State",stateProvince:"State",closeAllOpenedWorkspaces:"Discard changes in {{count}} workspaces",closingAllWorkspacesPromptBody:"There may be unsaved changes in the following workspaces. Do you want to discard changes in the following workspaces? {{workspaceNames}}",closingAllWorkspacesPromptTitle:"You have unsaved changes",discard:"Discard",hide:"Hide",maximize:"Maximize",minimize:"Minimize",openAnyway:"Open anyway",unsavedChangesInOpenedWorkspace:"You may have unsaved changes in the opened workspace. Do you want to discard these changes?",unsavedChangesInWorkspace:'There may be unsaved changes in "{{workspaceName}}". Please save them before opening another workspace.',unsavedChangesTitleText:"Unsaved changes",workspaceHeader:"Workspace header",closeWorkspaces2PromptTitle:"Close workspace(s)",closeWorkspaces2PromptBody:"You are about to close the following workspace(s), which might have unsaved changes:",abnormalValue:"Abnormal value",actions:"Actions",actionableNotification:"Actionable notification",address:"Address",age:"Age",batchActionItemSelected:"{{totalSelected}} item selected",batchActionsItemsSelected:"{{totalSelected}} items selected",cancel:"Cancel",change:"Change",Clinic:"Clinic",close:"Close",closesActionableNotification:"Close actionable notification",closeSnackbar:"Close snackbar",confirm:"Confirm",contactAdministratorIfIssuePersists:"Contact your system administrator if the problem persists.",contactDetails:"Contact details",delete:"Delete",discardChanges:"Discard changes",edit:"Edit",emptyStateText:"There are no {{displayText}} to display",error:"Error",errorCopy:"Sorry, there was a problem displaying this information. You can try to reload this page, or contact the site administrator and quote the error code above.",errorLoadingLoginLocations:"Unable to load login locations. Please try again or contact support if the problem persists.",female:"Female",leftNavigation:"Left navigation",loading:"Loading",male:"Male",noResultsToDisplay:"No results to display",notAvailable:"Not available",other:"Other",paginationItemsCount:"{{pageItemsCount}} / {{totalItems}} items",paginationOfPages:"of {{count}} pages",patientAvatarAlt:"Avatar for {{patientName}}",patientIdentifierSticker:"Patient identifier sticker",patientLists:"Patient lists",patientPhotoAlt:"Profile photo of {{patientName}}",patientPhotoPlaceholder:"Photo placeholder for {{patientName}}",print:"Print",printError:"Print error",printErrorExplainer:"An error occurred in {{errorLocation}}",printIdentifierSticker:"Print identifier sticker",printing:"Printing",recordNewEntry:"Record {{displayText}}",relationships:"Relationships",resetOverrides:"Reset overrides",save:"Save",scriptLoadingFailed:"Error: Script failed to load",scriptLoadingError:"Failed to load overridden script from {{url}}. Please check that the bundled script is available at the expected URL. Click the button below to reset all import map overrides.",searchForLocation:"Search for a location",seeAll:"See all",seeMoreLists:"See {{count}} more lists",selectAll:"Select all",sex:"Sex",showLess:"Show less",showMore:"Show more",snackbarNotification:"Snackbar notification",toggleDevTools:"Toggle dev tools",unknown:"Unknown",yearAbbreviation:"yr",yearsAbbreviation:"yrs"},a=e=>"string"==typeof e,r=()=>{let e,t,n=new Promise((n,o)=>{e=n,t=o});return n.resolve=e,n.reject=t,n},i=e=>null==e?"":""+e,s=/###/g,l=e=>e&&e.indexOf("###")>-1?e.replace(s,"."):e,p=e=>!e||a(e),c=(e,t,n)=>{let o=a(t)?t.split("."):t,r=0;for(;r<o.length-1;){if(p(e))return{};let t=l(o[r]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++r}return p(e)?{}:{obj:e,k:l(o[r])}},d=(e,t,n)=>{let{obj:o,k:a}=c(e,t,Object);if(void 0!==o||1===t.length){o[a]=n;return}let r=t[t.length-1],i=t.slice(0,t.length-1),s=c(e,i,Object);for(;void 0===s.obj&&i.length;)r=`${i[i.length-1]}.${r}`,s=c(e,i=i.slice(0,i.length-1),Object),s?.obj&&void 0!==s.obj[`${s.k}.${r}`]&&(s.obj=void 0);s.obj[`${s.k}.${r}`]=n},u=(e,t)=>{let{obj:n,k:o}=c(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,o))return n[o]},f=(e,t,n)=>{for(let o in t)"__proto__"!==o&&"constructor"!==o&&(o in e?a(e[o])||e[o]instanceof String||a(t[o])||t[o]instanceof String?n&&(e[o]=t[o]):f(e[o],t[o],n):e[o]=t[o]);return e};var h={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};let m=e=>a(e)?e.replace(/[&<>"'\/]/g,e=>h[e]):e,g=[" ",",","?","!",";"],y=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(void 0!==t)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),b=(e,t,n=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}let o=t.split(n),a=e;for(let e=0;e<o.length;){let t;if(!a||"object"!=typeof a)return;let r="";for(let i=e;i<o.length;++i)if(i!==e&&(r+=n),r+=o[i],void 0!==(t=a[r])){if(["string","number","boolean"].indexOf(typeof t)>-1&&i<o.length-1)continue;e+=i-e+1;break}a=t}return a},v=e=>e?.replace("_","-"),$={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class A{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||$,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,o){return o&&!this.debug?null:(a(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new A(this.logger,{...{prefix:`${this.prefix}:${e}:`},...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new A(this.logger,e)}}var k=new A;class x{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t)return void delete this.observers[e];this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let o=0;o<n;o++)e(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([n,o])=>{for(let a=0;a<o;a++)n.apply(n,[e,...t])})}}class w extends x{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,o={}){let r,i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,s=void 0!==o.ignoreJSONStructure?o.ignoreJSONStructure:this.options.ignoreJSONStructure;e.indexOf(".")>-1?r=e.split("."):(r=[e,t],n&&(Array.isArray(n)?r.push(...n):a(n)&&i?r.push(...n.split(i)):r.push(n)));let l=u(this.data,r);return(!l&&!t&&!n&&e.indexOf(".")>-1&&(e=r[0],t=r[1],n=r.slice(2).join(".")),!l&&s&&a(n))?b(this.data?.[e]?.[t],n,i):l}addResource(e,t,n,o,a={silent:!1}){let r=void 0!==a.keySeparator?a.keySeparator:this.options.keySeparator,i=[e,t];n&&(i=i.concat(r?n.split(r):n)),e.indexOf(".")>-1&&(i=e.split("."),o=t,t=i[1]),this.addNamespaces(t),d(this.data,i,o),a.silent||this.emit("added",e,t,n,o)}addResources(e,t,n,o={silent:!1}){for(let o in n)(a(n[o])||Array.isArray(n[o]))&&this.addResource(e,t,o,n[o],{silent:!0});o.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,o,a,r={silent:!1,skipCopy:!1}){let i=[e,t];e.indexOf(".")>-1&&(i=e.split("."),o=n,n=t,t=i[1]),this.addNamespaces(t);let s=u(this.data,i)||{};r.skipCopy||(n=JSON.parse(JSON.stringify(n))),o?f(s,n,a):s={...s,...n},d(this.data,i,s),r.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var C={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,o,a){return e.forEach(e=>{t=this.processors[e]?.process(t,n,o,a)??t}),t}};let E=Symbol("i18next/PATH_KEY");function S(e,t){let n,o,a,{[E]:r}=e((o=[],(a=Object.create(null)).get=(e,t)=>(n?.revoke?.(),t===E)?o:(o.push(t),(n=Proxy.revocable(e,a)).proxy),Proxy.revocable(Object.create(null),a).proxy));return r.join(t?.keySeparator??".")}let z={},D=e=>!a(e)&&"boolean"!=typeof e&&"number"!=typeof e;class P extends x{constructor(e,t={}){super(),((e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})})(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=k.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(null==e)return!1;let o=this.resolve(e,n);if(o?.res===void 0)return!1;let a=D(o.res);return!1!==n.returnObjects||!a}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");let o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,r=t.ns||this.options.defaultNS||[],i=n&&e.indexOf(n)>-1,s=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!((e,t,n)=>{t=t||"",n=n||"";let o=g.filter(e=>0>t.indexOf(e)&&0>n.indexOf(e));if(0===o.length)return!0;let a=y.getRegExp(`(${o.map(e=>"?"===e?"\\?":e).join("|")})`),r=!a.test(e);if(!r){let t=e.indexOf(n);t>0&&!a.test(e.substring(0,t))&&(r=!0)}return r})(e,n,o);if(i&&!s){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:a(r)?[r]:r};let i=e.split(n);(n!==o||n===o&&this.options.ns.indexOf(i[0])>-1)&&(r=i.shift()),e=i.join(o)}return{key:e,namespaces:a(r)?[r]:r}}translate(e,t,n){let o="object"==typeof t?{...t}:t;if("object"!=typeof o&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof o&&(o={...o}),o||(o={}),null==e)return"";"function"==typeof e&&(e=S(e,{...this.options,...o})),Array.isArray(e)||(e=[String(e)]);let r=void 0!==o.returnDetails?o.returnDetails:this.options.returnDetails,i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator,{key:s,namespaces:l}=this.extractFromKey(e[e.length-1],o),p=l[l.length-1],c=void 0!==o.nsSeparator?o.nsSeparator:this.options.nsSeparator;void 0===c&&(c=":");let d=o.lng||this.language,u=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()==="cimode")return u?r?{res:`${p}${c}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:p,usedParams:this.getUsedParamsDetails(o)}:`${p}${c}${s}`:r?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:p,usedParams:this.getUsedParamsDetails(o)}:s;let f=this.resolve(e,o),h=f?.res,m=f?.usedKey||s,g=f?.exactUsedKey||s,y=void 0!==o.joinArrays?o.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,v=void 0!==o.count&&!a(o.count),$=P.hasDefaultValue(o),A=v?this.pluralResolver.getSuffix(d,o.count,o):"",k=o.ordinal&&v?this.pluralResolver.getSuffix(d,o.count,{ordinal:!1}):"",x=v&&!o.ordinal&&0===o.count,w=x&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${A}`]||o[`defaultValue${k}`]||o.defaultValue,C=h;b&&!h&&$&&(C=w);let E=D(C),z=Object.prototype.toString.apply(C);if(b&&C&&E&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(z)&&!(a(y)&&Array.isArray(C))){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,C,{...o,ns:l}):`key '${s} (${this.language})' returned an object instead of string.`;return r?(f.res=e,f.usedParams=this.getUsedParamsDetails(o),f):e}if(i){let e=Array.isArray(C),t=e?[]:{},n=e?g:m;for(let e in C)if(Object.prototype.hasOwnProperty.call(C,e)){let a=`${n}${i}${e}`;$&&!h?t[e]=this.translate(a,{...o,defaultValue:D(w)?w[e]:void 0,...{joinArrays:!1,ns:l}}):t[e]=this.translate(a,{...o,joinArrays:!1,ns:l}),t[e]===a&&(t[e]=C[e])}h=t}}else if(b&&a(y)&&Array.isArray(h))(h=h.join(y))&&(h=this.extendTranslation(h,e,o,n));else{let t=!1,a=!1;!this.isValidLookup(h)&&$&&(t=!0,h=w),this.isValidLookup(h)||(a=!0,h=s);let r=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&a?void 0:h,l=$&&w!==h&&this.options.updateMissing;if(a||t||l){if(this.logger.log(l?"updateKey":"missingKey",d,p,s,l?w:h),i){let e=this.resolve(s,{...o,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(o.lng||this.language):e.push(o.lng||this.language);let n=(e,t,n)=>{let a=$&&n!==h?n:r;this.options.missingKeyHandler?this.options.missingKeyHandler(e,p,t,a,l,o):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,p,t,a,l,o),this.emit("missingKey",e,p,t,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&v?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,o);x&&o[`defaultValue${this.options.pluralSeparator}zero`]&&0>t.indexOf(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,o[`defaultValue${t}`]||w)})}):n(e,s,w))}h=this.extendTranslation(h,e,o,f,n),a&&h===s&&this.options.appendNamespaceToMissingKey&&(h=`${p}${c}${s}`),(a||t)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${p}${c}${s}`:s,t?h:void 0,o))}return r?(f.res=h,f.usedParams=this.getUsedParamsDetails(o),f):h}extendTranslation(e,t,n,o,r){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!n.skipInterpolation){let i;n.interpolation&&this.interpolator.init({...n,...{interpolation:{...this.options.interpolation,...n.interpolation}}});let s=a(e)&&(n?.interpolation?.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(s){let t=e.match(this.interpolator.nestingRegexp);i=t&&t.length}let l=n.replace&&!a(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),e=this.interpolator.interpolate(e,l,n.lng||this.language||o.usedLng,n),s){let t=e.match(this.interpolator.nestingRegexp);i<(t&&t.length)&&(n.nest=!1)}!n.lng&&o&&o.res&&(n.lng=this.language||o.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(...e)=>r?.[0]!==e[0]||n.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),n)),n.interpolation&&this.interpolator.reset()}let i=n.postProcess||this.options.postProcess,s=a(i)?[i]:i;return null!=e&&s?.length&&!1!==n.applyPostProcessor&&(e=C.handle(s,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,o,r,i,s;return a(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(n))return;let l=this.extractFromKey(e,t),p=l.key;o=p;let c=l.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));let d=void 0!==t.count&&!a(t.count),u=d&&!t.ordinal&&0===t.count,f=void 0!==t.context&&(a(t.context)||"number"==typeof t.context)&&""!==t.context,h=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach(e=>{this.isValidLookup(n)||(s=e,!z[`${h[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(s)&&(z[`${h[0]}-${e}`]=!0,this.logger.warn(`key "${o}" for languages "${h.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),h.forEach(o=>{let a;if(this.isValidLookup(n))return;i=o;let s=[p];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(s,p,o,e,t);else{let e;d&&(e=this.pluralResolver.getSuffix(o,t.count,t));let n=`${this.options.pluralSeparator}zero`,a=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(t.ordinal&&0===e.indexOf(a)&&s.push(p+e.replace(a,this.options.pluralSeparator)),s.push(p+e),u&&s.push(p+n)),f){let o=`${p}${this.options.contextSeparator||"_"}${t.context}`;s.push(o),d&&(t.ordinal&&0===e.indexOf(a)&&s.push(o+e.replace(a,this.options.pluralSeparator)),s.push(o+e),u&&s.push(o+n))}}for(;a=s.pop();)this.isValidLookup(n)||(r=a,n=this.getResource(o,e,a,t))}))})}),{res:n,usedKey:o,exactUsedKey:r,usedLng:i,usedNS:s}}isValidLookup(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}getResource(e,t,n,o={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,o):this.resourceStore.getResource(e,t,n,o)}getUsedParamsDetails(e={}){let t=e.replace&&!a(e.replace),n=t?e.replace:e;if(t&&void 0!==e.count&&(n.count=e.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!t)for(let e of(n={...n},["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"]))delete n[e];return n}static hasDefaultValue(e){let t="defaultValue";for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}class M{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=k.create("languageUtils")}getScriptPartFromCode(e){if(!(e=v(e))||0>e.indexOf("-"))return null;let t=e.split("-");return 2===t.length||(t.pop(),"x"===t[t.length-1].toLowerCase())?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(!(e=v(e))||0>e.indexOf("-"))return e;let t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(a(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return(t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t)?t:this.options.lowerCaseLng?e.toLowerCase():e}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){let t;return e?(e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let o=this.getLanguagePartFromCode(e);if(this.isSupportedCode(o))return t=o;t=this.options.supportedLngs.find(e=>{if(e===o||!(0>e.indexOf("-")&&0>o.indexOf("-"))&&(e.indexOf("-")>0&&0>o.indexOf("-")&&e.substring(0,e.indexOf("-"))===o||0===e.indexOf(o)&&o.length>1))return e})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),a(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),o=[],r=e=>{e&&(this.isSupportedCode(e)?o.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return a(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&r(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&r(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&r(this.getLanguagePartFromCode(e))):a(e)&&r(this.formatLanguageCode(e)),n.forEach(e=>{0>o.indexOf(e)&&r(this.formatLanguageCode(e))}),o}}let N={zero:0,one:1,two:2,few:3,many:4,other:5},T={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class B{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=k.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n,o=v("dev"===e?"en":e),a=t.ordinal?"ordinal":"cardinal",r=JSON.stringify({cleanedCode:o,type:a});if(r in this.pluralRulesCache)return this.pluralRulesCache[r];try{n=new Intl.PluralRules(o,{type:a})}catch(a){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),T;if(!e.match(/-|_/))return T;let o=this.languageUtils.getLanguagePartFromCode(e);n=this.getRule(o,t)}return this.pluralRulesCache[r]=n,n}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return(n||(n=this.getRule("dev",t)),n)?n.resolvedOptions().pluralCategories.sort((e,t)=>N[e]-N[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,n={}){let o=this.getRule(e,n);return o?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}let O=(e,t,n,o=".",r=!0)=>{let i,s=void 0!==(i=u(e,n))?i:u(t,n);return!s&&r&&a(n)&&void 0===(s=b(e,n,o))&&(s=b(t,n,o)),s};class I{constructor(e={}){this.logger=k.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});let{escape:t,escapeValue:n,useRawValueToEscape:o,prefix:a,prefixEscaped:r,suffix:i,suffixEscaped:s,formatSeparator:l,unescapeSuffix:p,unescapePrefix:c,nestingPrefix:d,nestingPrefixEscaped:u,nestingSuffix:f,nestingSuffixEscaped:h,nestingOptionsSeparator:g,maxReplaces:y,alwaysFormat:b}=e.interpolation;this.escape=void 0!==t?t:m,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==o&&o,this.prefix=a?a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):r||"{{",this.suffix=i?i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):s||"}}",this.formatSeparator=l||",",this.unescapePrefix=p?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":p||"",this.nestingPrefix=d?d.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):u||"$t(".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingSuffix=f?f.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):h||")".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingOptionsSeparator=g||",",this.maxReplaces=y||1e3,this.alwaysFormat=void 0!==b&&b,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,o){let r,s,l,p=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(0>e.indexOf(this.formatSeparator)){let a=O(t,p,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(a,void 0,n,{...o,...t,interpolationkey:e}):a}let a=e.split(this.formatSeparator),r=a.shift().trim(),i=a.join(this.formatSeparator).trim();return this.format(O(t,p,r,this.options.keySeparator,this.options.ignoreJSONStructure),i,n,{...o,...t,interpolationkey:r})};this.resetRegExp();let d=o?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=o?.interpolation?.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>e.replace(/\$/g,"$$$$")},{regex:this.regexp,safeValue:e=>this.escapeValue?this.escape(e).replace(/\$/g,"$$$$"):e.replace(/\$/g,"$$$$")}].forEach(t=>{for(l=0;r=t.regex.exec(e);){let n=r[1].trim();if(void 0===(s=c(n)))if("function"==typeof d){let t=d(e,r,o);s=a(t)?t:""}else if(o&&Object.prototype.hasOwnProperty.call(o,n))s="";else if(u){s=r[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),s="";else a(s)||this.useRawValueToEscape||(s=i(s));let p=t.safeValue(s);if(e=e.replace(r[0],p),u?(t.regex.lastIndex+=s.length,t.regex.lastIndex-=r[0].length):t.regex.lastIndex=0,++l>=this.maxReplaces)break}}),e}nest(e,t,n={}){let o,r,s,l=(e,t)=>{let n=this.nestingOptionsSeparator;if(0>e.indexOf(n))return e;let o=e.split(RegExp(`${n}[ ]*{`)),a=`{${o[1]}`;e=o[0];let r=(a=this.interpolate(a,s)).match(/'/g),i=a.match(/"/g);((r?.length??0)%2!=0||i)&&i.length%2==0||(a=a.replace(/'/g,'"'));try{s=JSON.parse(a),t&&(s={...t,...s})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${a}`}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,e};for(;o=this.nestingRegexp.exec(e);){let p=[];(s=(s={...n}).replace&&!a(s.replace)?s.replace:s).applyPostProcessor=!1,delete s.defaultValue;let c=/{.*}/.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(-1!==c&&(p=o[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),o[1]=o[1].slice(0,c)),(r=t(l.call(this,o[1].trim(),s),s))&&o[0]===e&&!a(r))return r;a(r)||(r=i(r)),r||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${e}`),r=""),p.length&&(r=p.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:o[1].trim()}),r.trim())),e=e.replace(o[0],r),this.regexp.lastIndex=0}return e}}let j=e=>{let t={};return(n,o,a)=>{let r=a;a&&a.interpolationkey&&a.formatParams&&a.formatParams[a.interpolationkey]&&a[a.interpolationkey]&&(r={...r,[a.interpolationkey]:void 0});let i=o+JSON.stringify(r),s=t[i];return s||(s=e(v(o),a),t[i]=s),s(n)}},R=e=>(t,n,o)=>e(v(n),o)(t);class F{constructor(e={}){this.logger=k.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";let n=t.cacheInBuiltFormats?j:R;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=j(t)}format(e,t,n,o={}){let a=t.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&0>a[0].indexOf(")")&&a.find(e=>e.indexOf(")")>-1)){let e=a.findIndex(e=>e.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,e)].join(this.formatSeparator)}return a.reduce((e,t)=>{let{formatName:a,formatOptions:r}=(e=>{let t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){let o=e.split("(");t=o[0].toLowerCase().trim();let a=o[1].substring(0,o[1].length-1);"currency"===t&&0>a.indexOf(":")?n.currency||(n.currency=a.trim()):"relativetime"===t&&0>a.indexOf(":")?n.range||(n.range=a.trim()):a.split(";").forEach(e=>{if(e){let[t,...o]=e.split(":"),a=o.join(":").trim().replace(/^'+|'+$/g,""),r=t.trim();n[r]||(n[r]=a),"false"===a&&(n[r]=!1),"true"===a&&(n[r]=!0),isNaN(a)||(n[r]=parseInt(a,10))}})}return{formatName:t,formatOptions:n}})(t);if(this.formats[a]){let t=e;try{let i=o?.formatParams?.[o.interpolationkey]||{},s=i.locale||i.lng||o.locale||o.lng||n;t=this.formats[a](e,s,{...r,...o,...i})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${a}`),e},e)}}class L extends x{constructor(e,t,n,o={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=o,this.logger=k.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,o.backend,o)}queueLoad(e,t,n,o){let a={},r={},i={},s={};return e.forEach(e=>{let o=!0;t.forEach(t=>{let i=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[i]=2:this.state[i]<0||(1===this.state[i]?void 0===r[i]&&(r[i]=!0):(this.state[i]=1,o=!1,void 0===r[i]&&(r[i]=!0),void 0===a[i]&&(a[i]=!0),void 0===s[t]&&(s[t]=!0)))}),o||(i[e]=!0)}),(Object.keys(a).length||Object.keys(r).length)&&this.queue.push({pending:r,pendingCount:Object.keys(r).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(a),pending:Object.keys(r),toLoadLanguages:Object.keys(i),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let o=e.split("|"),a=o[0],r=o[1];t&&this.emit("failedLoading",a,r,t),!t&&n&&this.store.addResourceBundle(a,r,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let i={};this.queue.forEach(n=>{((e,t,n,o)=>{let{obj:a,k:r}=c(e,t,Object);a[r]=a[r]||[],a[r].push(n)})(n.loaded,[a],r),void 0!==n.pending[e]&&(delete n.pending[e],n.pendingCount--),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{i[e]||(i[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{void 0===i[e][t]&&(i[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",i),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,o=0,a=this.retryTimeout,r){if(!e.length)return r(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:o,wait:a,callback:r});this.readingCalls++;let i=(i,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}i&&s&&o<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,n,o+1,2*a,r)},a):r(i,s)},s=this.backend[n].bind(this.backend);if(2===s.length){try{let n=s(e,t);n&&"function"==typeof n.then?n.then(e=>i(null,e)).catch(i):i(null,n)}catch(e){i(e)}return}return s(e,t,i)}prepareLoading(e,t,n={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();a(e)&&(e=this.languageUtils.toResolveHierarchy(e)),a(t)&&(t=[t]);let r=this.queueLoad(e,t,n,o);if(!r.toLoad.length)return r.pending.length||o(),null;r.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){let n=e.split("|"),o=n[0],a=n[1];this.read(o,a,"read",void 0,void 0,(n,r)=>{n&&this.logger.warn(`${t}loading namespace ${a} for language ${o} failed`,n),!n&&r&&this.logger.log(`${t}loaded namespace ${a} for language ${o}`,r),this.loaded(e,n,r)})}saveMissing(e,t,n,o,a,r={},i=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t))return void this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");if(null!=n&&""!==n){if(this.backend?.create){let s={...r,isUpdate:a},l=this.backend.create.bind(this.backend);if(l.length<6)try{let a;(a=5===l.length?l(e,t,n,o,s):l(e,t,n,o))&&"function"==typeof a.then?a.then(e=>i(null,e)).catch(i):i(null,a)}catch(e){i(e)}else l(e,t,n,o,i,s)}e&&e[0]&&this.store.addResource(e[0],t,n,o)}}}let W=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),a(e[1])&&(t.defaultValue=e[1]),a(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),V=e=>(a(e.ns)&&(e.ns=[e.ns]),a(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),a(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),G=()=>{};class U extends x{constructor(e={},t){if(super(),this.options=V(e),this.services={},this.logger=k,this.modules={external:[]},(e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{"function"==typeof e[t]&&(e[t]=e[t].bind(e))})})(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(a(e.ns)?e.defaultNS=e.ns:0>e.ns.indexOf("translation")&&(e.defaultNS=e.ns[0]));let n=W();this.options={...n,...this.options,...V(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator);let o=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?k.init(o(this.modules.logger),this.options):k.init(null,this.options),e=this.modules.formatter?this.modules.formatter:F;let t=new M(this.options);this.store=new w(this.options.resources,this.options);let a=this.services;a.logger=k,a.resourceStore=this.store,a.languageUtils=t,a.pluralResolver=new B(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),e&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(a.formatter=o(e),a.formatter.init&&a.formatter.init(a,this.options),this.options.interpolation.format=a.formatter.format.bind(a.formatter)),a.interpolator=new I(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new L(o(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(a.languageDetector=o(this.modules.languageDetector),a.languageDetector.init&&a.languageDetector.init(a,this.options.detection,this.options)),this.modules.i18nFormat&&(a.i18nFormat=o(this.modules.i18nFormat),a.i18nFormat.init&&a.i18nFormat.init(this)),this.translator=new P(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=G),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let i=r(),s=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),i.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?s():setTimeout(s,0),i}loadResources(e,t=G){let n=t,o=a(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(o?.toLowerCase()==="cimode"&&(!this.options.preload||0===this.options.preload.length))return n();let e=[],t=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&0>e.indexOf(t)&&e.push(t)})};o?t(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let o=r();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=G),this.services.backendConnector.reload(e,t,e=>{o.resolve(),n(e)}),o}use(e){if(!e)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&C.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&0>this.languages.indexOf(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;let n=r();this.emit("languageChanging",e);let o=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(a,r)=>{r?this.isLanguageChangingTo===e&&(o(r),this.translator.changeLanguage(r),this.isLanguageChangingTo=void 0,this.emit("languageChanged",r),this.logger.log("languageChanged",r)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(a,(...e)=>this.t(...e))},s=t=>{e||t||!this.services.languageDetector||(t=[]);let n=a(t)?t:t&&t[0],r=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(a(t)?[t]:t);r&&(this.language||o(r),this.translator.language||this.translator.changeLanguage(r),this.services.languageDetector?.cacheUserLanguage?.(r)),this.loadResources(r,e=>{i(e,r)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(e):s(this.services.languageDetector.detect()),n}getFixedT(e,t,n){let o=(e,t,...a)=>{let r,i;(r="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(a)):{...t}).lng=r.lng||o.lng,r.lngs=r.lngs||o.lngs,r.ns=r.ns||o.ns,""!==r.keyPrefix&&(r.keyPrefix=r.keyPrefix||n||o.keyPrefix);let s=this.options.keySeparator||".";return r.keyPrefix&&Array.isArray(e)?i=e.map(e=>("function"==typeof e&&(e=S(e,{...this.options,...t})),`${r.keyPrefix}${s}${e}`)):("function"==typeof e&&(e=S(e,{...this.options,...t})),i=r.keyPrefix?`${r.keyPrefix}${s}${e}`:e),this.t(i,r)};return a(e)?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=n,o}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],o=!!this.options&&this.options.fallbackLng,a=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;let r=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return -1===n||0===n||2===n};if(t.precheck){let e=t.precheck(this,r);if(void 0!==e)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||r(n,e)&&(!o||r(a,e)))}loadNamespaces(e,t){let n=r();return this.options.ns?(a(e)&&(e=[e]),e.forEach(e=>{0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=r();a(e)&&(e=[e]);let o=this.options.preload||[],i=e.filter(e=>0>o.indexOf(e)&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=o.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}let t=this.services?.languageUtils||new M(W());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new U(e,t)}cloneInstance(e={},t=G){let n=e.forkResourceStore;n&&delete e.forkResourceStore;let o={...this.options,...e,isClone:!0},a=new U(o);return(void 0!==e.debug||void 0!==e.prefix)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n&&(a.store=new w(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,o)=>(n[o]={...e[t][o]},n),e[t]),e),{}),o),a.services.resourceStore=a.store),a.translator=new P(a.services,o),a.translator.on("*",(e,...t)=>{a.emit(e,...t)}),a.init(o,t),a.translator.options=o,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}let q=U.createInstance();q.createInstance=U.createInstance,q.createInstance,q.dir,q.init,q.loadResources,q.reloadResources,q.use,q.changeLanguage,q.getFixedT,q.t,q.exists,q.setDefaultNamespace,q.hasLoadedNamespace,q.loadNamespaces,q.loadLanguages;let H=q.default||q;function K(e,t,n,o){return H.t(t,{ns:e,defaultValue:n,...o})}function Z(e,t,n){return o[e]?K("core",e,t??o[e],n):(console.error(`O3 Core Translations does not provide key '${e}'. The key itself is being rendered as text.`),e)}H.on("initialized",function(){window.i18next.loadNamespaces(["core"])})},75415(e,t,n){"use strict";n.d(t,{C:()=>i,K:()=>s});var o=n(80222),a=n.n(o),r=n(85740);function i(e,t=a()()){let n=a()(t),o=(0,r.qE)(e,n);if(null==o)return null;let s=n.diff(o,"hours"),l=n.diff(o,"days"),p=n.diff(o,"weeks"),c=n.diff(o,"months"),d=n.diff(o,"years"),u={};if(s<2)u.minutes=n.diff(o,"minutes");else if(l<2)u.hours=s;else if(p<4)u.days=l;else if(d<1){let e=n.subtract(p,"weeks").diff(o,"days");u.weeks=p,u.days=e}else if(d<2){let e=n.subtract(c,"months").diff(o,"days");u.months=c,u.days=e}else if(d<18){let e=n.subtract(d,"year").diff(o,"months");u.years=d,u.months=e}else u.years=d;return u}function s(e,t=a()()){let n=i(e,t);if(null==n)return null;let o={style:"short",localeMatcher:"lookup"};return"minutes"in n&&0===n.minutes&&(o.minutesDisplay="always"),(0,r.a3)(n,o)}},85740(e,t,n){"use strict";n.d(t,{g2:()=>ef,vU:()=>U,XE:()=>J,a3:()=>ei,LW:()=>ee,a7:()=>X,Yq:()=>et,hl:()=>G,fU:()=>eo,_U:()=>K,d4:()=>er,l0:()=>H,p0:()=>ed,kQ:()=>q,qE:()=>es,Rt:()=>ea});var o,a=n(13174),r=n(19647);if("u">typeof navigator){let e=navigator;o=Array.isArray(e.languages)?e.languages[0]:e.language}else if("u">typeof process){let e=process.env;o=e.LC_ALL||e.LC_MESSAGES||e.LANG||e.LANGUAGE}var i=function(e){e=(e=e.replace(/_/g,"-")).replace(/[.:][\w-]*$/,"");try{return new Intl.Locale(e).baseName}catch{return"en-US"}}(o||"en-US"),s=class extends Date{invalid=null;isValid(){return!Number.isNaN(this.valueOf())}},l={};for(let e=1;e<100;e++)l[(e<=9?"0":"")+e]=e+(e>51?1900:2e3);var p={arab:1632,arabext:1776,bali:6992,beng:2534,deva:2406,fullwide:65296,gujr:2790,khmr:6112,knda:3302,laoo:3792,limb:6470,mlym:3430,mong:6160,mymr:4160,orya:2918,tamldec:3046,telu:3174,thai:3664,tibt:3872},c="[1234567890一二三四五六七八九〇\\d]",d={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,"0":0,"1":1,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9,〇:0,一:1,二:2,三:3,四:4,五:5,六:6,七:7,八:8,九:9},u={},f={"Eastern Daylight Time":-240,"Eastern Standard Time":-300,"Central Daylight Time":-300,"Central Standard Time":-360,"Mountain Daylight Time":-360,"Mountain Standard Time":-420,"Pacific Daylight Time":-420,"Pacific Standard Time":-480,"Coordinated Universal Time":0,ACDT:630,ACST:570,ACT:480,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,AMST:-180,AMT:-240,ART:-180,AST:180,AWDT:540,AWST:480,AZOST:-60,AZT:240,BDT:360,BIOT:360,BIT:-720,BOT:-240,BRST:-120,BRT:-180,BTT:360,CAT:120,CCT:390,CDT:-300,CEDT:120,CEST:120,CET:60,CHADT:825,CHAST:765,CHOT:480,ChST:600,CHUT:600,CIST:-480,CIT:480,CKT:-600,CLST:-180,CLT:-240,COST:-240,COT:-300,CST:-360,CT:480,CVT:-60,CXT:420,DAVT:420,DDUT:600,DFT:60,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEDT:180,EEST:180,EET:120,EGST:0,EGT:-60,EIT:540,EST:-300,FET:180,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GIT:-540,GMT:0,GST:-120,GYT:-240,HADT:-540,HAEC:120,HAST:-600,HKT:480,HMT:300,HOVT:420,HST:-600,IBST:0,ICT:420,IDT:180,IOT:180,IRDT:270,IRKT:480,IRST:210,IST:120,JST:540,KGT:360,KOST:660,KRAT:420,KST:540,LHST:630,LINT:840,MAGT:720,MART:-510,MAWT:300,MDT:-360,MET:60,MEST:120,MHT:720,MIST:660,MIT:-510,MMT:390,MSK:180,MST:-420,MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:660,NPT:345,NST:-150,NT:-150,NUT:-660,NZDT:780,NZST:720,OMST:360,ORAT:300,PDT:-420,PET:-300,PETT:720,PGT:600,PHOT:780,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PYST:-180,PYT:-240,RET:240,ROTT:-180,SAKT:660,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SLST:330,SRET:660,SRT:-180,SST:480,SYOT:180,TAHT:-600,THA:420,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TOT:780,TVT:720,UCT:0,ULAT:480,USZ1:120,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-240,VLAT:600,VOLT:240,VOST:360,VUT:660,WAKT:720,WAST:120,WAT:60,WEDT:60,WEST:60,WET:0,WIT:420,WST:480,YAKT:540,YEKT:300},h={zone:f,year:l,meridiem:{am:0,pm:12,"a.m.":0,"p.m.":12},month:{january:1,jan:1,february:2,feb:2,march:3,mar:3,april:4,apr:4,may:5,june:6,jun:6,july:7,jul:7,august:8,aug:8,september:9,sep:9,october:10,oct:10,november:11,nov:11,december:12,dec:12},dayname:{sunday:0,sun:0,monday:1,mon:1,tuesday:2,tue:2,wednesday:3,wed:3,thursday:4,thu:4,friday:5,fri:5,saturday:6,sat:6},digit:{}},m={MONTHNAME:"january|february|march|april|may|june|july|august|september|october|november|december|jan\\.?|feb\\.?|mar\\.?|apr\\.?|may\\.?|jun\\.?|jul\\.?|aug\\.?|sep\\.?|oct\\.?|nov\\.?|dec\\.?",DAYNAME:"sunday|monday|tuesday|wednesday|thursday|friday|saturday|sun\\.?|mon\\.?|tue\\.?|wed\\.?|thu\\.?|fri\\.?|sat\\.?",ZONE:"\\(?(?:"+Object.keys(f).join("|")+")\\)?",MERIDIEM:"am|pm|a.m.|p.m.",ORDINAL:"st|nd|rd|th|\\.",YEAR:"\\d{4}|\\d{2}",YEAR2:"\\d{2}",YEAR4:"\\d{4}",YEAR6:"-\\d{6}|\\+?\\d{5,6}",MONTH:"1[0-2]|0?[1-9]",MONTH2:"1[0-2]|0[1-9]",DAY:"3[01]|[12]\\d|0?[1-9]",DAY2:"3[01]|[12]\\d|0[1-9]",OFFSET:"(?:GMT)?[\xb1−+-](?:[01]\\d[0-5]\\d|[01]\\d:[0-5]\\d|[01]?\\d)",H24:"[01]\\d|2[0-3]",H12:"0?[1-9]|1[012]",MIN:"[0-5]\\d",SEC:"[0-5]\\d|60",MS:"\\d{9}|\\d{6}|\\d{1,3}",GAP:"[\\s/.,-]{1,}"},g={...m,YEAR:"*{4}|*{2}",YEAR4:"*{4}",YEAR6:"-*{6}|\\+?*{5,6}",MONTH:"*{1,2}",MONTH2:"*{2}",DAY:"*{1,2}",DAY2:"*{2}",OFFSET:"(?:GMT)?[\xb1−+-](?:*{4}|*{2}:*{2}|*{1,2})",H24:"*{2}",H12:"*{1,2}",MIN:"*{2}",SEC:"*{2}",MS:"*{9}|*{6}|*{3}"},y={},b=class e{locale;lookups;vars;numberingSystem;baseName;dateOptions;static factory(t=i){return y[t.toLowerCase()]||(y[t.toLowerCase()]=new e(t)),y[t.toLowerCase()]}constructor(e=i){this.locale=e,this.lookups={...h},this.vars={...m};let t=new Intl.NumberFormat(this.locale);this.numberingSystem=t.resolvedOptions().numberingSystem,this.dateOptions=new Intl.DateTimeFormat(this.locale).resolvedOptions(),this.baseName=new Intl.Locale(this.locale).baseName,this.build()}toInt(e){if("number"==typeof e)return e;if("string"!=typeof e)return;if("latn"===this.numberingSystem&&!this.baseName.startsWith("zh")){let t=parseInt(e,10);if(!isNaN(t))return t}let t="";for(let n=0;n<e.length;n++)t+=String(this.lookups.digit[e[n]]);return parseInt(t,10)}millisecondToInt(e){if("number"==typeof e)return e;if("string"!=typeof e)return;let t=e.slice(0,3);return 1===t.length?100*this.toInt(t):2===t.length?10*this.toInt(t):this.toInt(t)}monthNameToInt(e){if("string"!=typeof e)return;let t=e.toLocaleLowerCase(this.locale).replace(/\.$/,"");return this.lookups.month[t]||12}h12ToInt(e,t){if("string"!=typeof e)return;let n=this.lookups.meridiem[t?.toLowerCase()]||0,o=this.toInt(e);return o<12&&12===n&&(o+=12),12===o&&0===n&&(o=0),o}zoneToOffset(e){if("string"==typeof e)return e=e.replace(/[^a-z\s]/gi,""),this.lookups.zone[e]}offsetToMinutes(e){if("string"!=typeof e)return;let t=e.match(/^(?:GMT)?([±−+-])(..?):?(..)?$/);if(t){let[,e,n,o]=t;return("-"===e||"−"===e?-1:1)*(60*this.toInt(n)+this.toInt(o||0))}return 0}build(){"latn"===this.dateOptions.numberingSystem?this.lookups.digit=d:this.buildNumbers(),/^en/i.test(this.locale)||(this.buildMonthNames(),this.buildDaynames(),/zh/i.test(this.locale)||this.buildMeridiems())}buildNumbers(){let{group:e,lookup:t}=function(e){if(u[e])return u[e];if("fullwide"===e||"hanidec"===e)return{group:c,lookup:{...d}};let t=p[e];if(!t)return{group:"\\d",lookup:{...d}};let n=String.fromCharCode(t),o=String.fromCharCode(t+9),a={};for(let e=0;e<10;e++)a[String.fromCharCode(t+e)]=e;return u[e]={group:`[${n}-${o}]`,lookup:a},u[e]}(this.numberingSystem);for(let n in this.lookups.digit=t,g)g.hasOwnProperty(n)&&(this.vars[n]=g[n].replace(/\*/g,e))}buildMonthNames(){let e={},t={};if(/^fi/i.test(this.locale))"tammi|helmi|maalis|huhti|touko|kes\xe4|hein\xe4|elo|syys|loka|marras|joulu".split("|").forEach((n,o)=>{["","k","kuu","kuuta"].forEach((a,r)=>{e[n+a+(r<2?"\\.?":"")]=!0,t[n+a]=o+1})});else{let n=[],o=e=>"month"===e.type;for(let e=0;e<12;e++)n.push(new Date(2017,e,1));for(let a of["full","long","medium"]){let r=Intl.DateTimeFormat(this.locale,{dateStyle:a});for(let i=0;i<12;i++){let s=r.formatToParts(n[i]).find(o).value.toLocaleLowerCase(this.locale);/^\d+$/.test(s)||(/^ko/i.test(this.locale)&&(s+="월"),"medium"===a?(s=s.replace(/\.$/,""),e[`${s}\\.?`]=!0):e[s]=!0,t[s]=i+1)}}let a=Intl.DateTimeFormat(this.locale,{month:"short"});for(let r=0;r<12;r++){let i=a.formatToParts(n[r]).find(o).value.toLocaleLowerCase(this.locale);i=i.replace(/\.$/,""),e[`${i}\\.?`]=!0,t[i]=r+1}}this.vars.MONTHNAME=Object.keys(e).join("|"),this.lookups.month=t}buildDaynames(){let e=[],t=e=>"weekday"===e.type;for(let t=0;t<7;t++)e.push(new Date(2017,0,t+1));let n=[],o={};for(let a of["long","short"]){let r=Intl.DateTimeFormat(this.locale,{weekday:a});for(let i=0;i<7;i++){let s=r.formatToParts(e[i]).find(t).value.toLocaleLowerCase(this.locale);"short"===a?(s=s.replace(/\.$/,""),n.push(`${s}\\.?`)):n.push(s),o[s]=i}}this.vars.DAYNAME=n.join("|"),this.lookups.dayname=o}buildMeridiems(){let e=[new Date(2017,0,1),new Date(2017,0,1,23,0,0)],t=e=>"dayPeriod"===e.type,n=[],o={},a=Intl.DateTimeFormat(this.locale,{timeStyle:"long"});for(let r=0;r<2;r++){let i=a.formatToParts(e[r]).find(t);if(!i)return;let s=i.value.toLocaleLowerCase(this.locale);n.push(s),o[s]=12*r}this.vars.MERIDIEM=n.join("|"),this.lookups.meridiem=o}compile(e){return RegExp(e.replace(/_([A-Z0-9]+)_/g,(e,t)=>{if(!this.vars[t])throw Error(`Template string contains invalid variable _${t}_`);return this.vars[t]}),"i")}},v=["ee-TG","en-AS","en-CA","en-FM","en-GH","en-GU","en-KE","en-KY","en-MH","en-MP","en-US","en-VI","en-WS","jp-JP","sm-AS","sm-SM"],$={y:"year",M:"month",d:"day",w:"week",h:"hour",m:"minute",s:"second",ms:"millisecond"},A=()=>new Date;function k(e){return function(t){let n={};for(let o=0,a=e.length;o<a;o++){let a=e[o];a&&(n[a]=t[o])}return n}}var x=class{doneChecker;fallback;patterns;formatter;constructor({doneChecker:e,fallback:t,patterns:n,formatter:o}){this.doneChecker=e,this.fallback=t,this.patterns=n,this.formatter=o}attempt(e){if("string"!=typeof e)return this.fallback(e);let t=e.trim(),n={},o=!1;for(let e of this.patterns){let a=t.match(e.regex);if(!a)continue;o=!0;let r=e.handler(a);if(r){for(let[e,t]of Object.entries(r))e in n||void 0===t||(n[e]=t);if(t=(t=t.slice(0,a.index)+t.slice(a.index+a[0].length+1)).trim(),this.doneChecker(n,t))break}}return o?this.formatter(n):this.fallback(e)}},w=["year","month","day","hour","minute","second","millisecond","offset"],C={};function E(e,t){return""===t||/^\s+$/.test(t)||"year"in e&&("month"in e||"monthname"in e)&&"day"in e&&"hour"in e&&"minute"in e&&"second"in e&&"millisecond"in e&&("zone"in e||"offset"in e)}var S=[[/([^\d.]+)(\d{1,2})\.(\d{2})\.(\d{2})(\D|$)/,"$1$2:$3:$4$5"],[/([^\d.]+)(\d{1,2})\.(\d{2})(\D|$)/,"$1$2:$3$4"]],z={ar:[[/ /g," "]],bn:[[/,/g,""]],zh:[[/早上\s*([\d:]+)/,"$1am"],[/凌晨\s*([\d:]+)/,"$1am"],[/上午\s*([\d:]+)/,"$1am"],[/下午\s*([\d:]+)/,"$1pm"],[/晚上\s*([\d:]+)/,"$1pm"]],he:[[/ב/gi,""]],de:[[/ um /g," "]],pt:[[/\sde /gi," "]],es:[[/\sde /gi," "]],da:[[/\sden /gi," "],...S],ru:[[/ г\./g,""]],th:[[/\s*นาฬิกา\s*/i,":"],[/\s*นาที\s*/i,":"],[/\s*วินาที\s*/i," "]],ko:[[/\s*시\s*/,":"],[/\s*분\s*/,":"],[/\s*초\s*/,""],[/(오전|오후)\s*([\d:]+)/,"$2$1"],[/(\d{4})\. (\d{1,2})\. (\d{1,2})\./,"$1-$2-$3"]],fi:S,id:S,fr:[[/(\d{2}) h /,"$1:"],[/(\d{2}) min /,"$1:"],[/(\d{2}) s /,"$1"]]};function D(e,t=i){let n=function(e){if(!C[e]){var t,n;let o,a,r=b.factory(e);C[e]=new x({doneChecker:E,fallback:(t=e,function(e){let n=String(e).slice(0,50);return""===n&&(n="(empty string)"),{invalid:`Unable to parse "${n}" with locale "${t}"`}}),patterns:(o=[{name:"timestampWithOffset",regex:r.compile("^(_YEAR4_)-(_MONTH_)-(_DAY_)[T ](_H24_):(_MIN_):(_SEC_)(?:.(_MS_))? ?(_OFFSET_|Z)?$"),handler:k(["","year","month","day","hour","minute","second","millisecond","offset"])},{name:"timestampWithZone",regex:r.compile("^(_YEAR4_)-(_MONTH_)-(_DAY_)[T ](_H24_):(_MIN_):(_SEC_)(?:.(_MS_))?\\s*(_ZONE_)$"),handler:k(["","year","month","day","hour","minute","second","millisecond","zone"])},{name:"timestampWithOffsetAndZone",regex:r.compile("^(_YEAR4_)-(_MONTH_)-(_DAY_)[T ](_H24_):(_MIN_):(_SEC_)(?:.(_MS_))? (_OFFSET_|Z)\\s*(_ZONE_)$"),handler:k(["","year","month","day","hour","minute","second","millisecond","offset"])},{name:"chinese",regex:r.compile(`^(${c}{2,4})\\s*\u5E74\\s*(${c}{1,2})\\s*\u6708\\s*(${c}{1,2})\\s*\u65E5$`),handler:k(["","year","month","day"])},{name:"korean",regex:r.compile("^(_YEAR_)년\\s*(_MONTH_)월\\s*(_DAY_)일$"),handler:k(["","year","month","day"])},{name:"twitter",regex:/^(?:sun|mon|tue|wed|thu|fri|sat) (jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec) (\d{2}) (\d{2}):(\d{2}):(\d{2}) ([+-]\d{4}) (\d{4})$/i,handler:k(["","monthname","day","hour","minute","second","offset","year"])},{name:"today",regex:/^(now|today|tomorrow|yesterday)$/i,handler:function(e){let t=A(),n=e[1].toLowerCase();switch(n){case"tomorrow":t.setUTCDate(t.getUTCDate()+1);break;case"yesterday":t.setUTCDate(t.getUTCDate()-1)}let o={year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate()};return"now"===n&&(o.hour=t.getUTCHours(),o.minute=t.getUTCMinutes(),o.second=t.getUTCSeconds(),o.millisecond=t.getUTCMilliseconds()),console.log("today=>",n,o),o}},{name:"ago",regex:/^(\+|-|in|) ?([\d.]+) ?(years?|months?|weeks?|days?|hours?|minutes?|seconds?|milliseconds?|ms|s|m|h|w|d|M|y)( ago)?$/i,handler:function([,e,t,n,o]){t=parseFloat(t),"week"===(n=n.length<=2?$[n]:(n=n.replace(/s$/,"")).toLowerCase())&&(n="day",t*=7),("-"===e||o)&&(t*=-1);let a=A();return"millisecond"===n?a.setUTCMilliseconds(a.getUTCMilliseconds()+t):"second"===n?a.setUTCSeconds(a.getUTCSeconds()+t):"minute"===n?a.setUTCMinutes(a.getUTCMinutes()+t):"hour"===n?a.setUTCHours(a.getUTCHours()+t):"day"===n?a.setUTCDate(a.getUTCDate()+t):"month"===n?a.setUTCMonth(a.getUTCMonth()+t):"year"===n&&a.setUTCFullYear(a.getUTCFullYear()+t),{year:a.getUTCFullYear(),month:a.getUTCMonth()+1,day:a.getUTCDate(),hour:a.getUTCHours(),minute:a.getUTCMinutes(),second:a.getUTCSeconds(),millisecond:a.getUTCMilliseconds()}}},{name:"atSeconds",regex:/^@(\d+)$/,handler:function(e){let t=new Date(1e3*parseInt(e[1],10));return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds()}}},{name:"microsoftJson",regex:/^\/Date\((\d+)([+-]\d{4})?\)\/$/,handler:function(e){let t=new Date(parseInt(e[1],10));return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds(),offset:e[2]}}},{name:"full24",regex:r.compile("(?:^|[\\sT])(_H24_):(_MIN_):(_SEC_)(?:\\.(_MS_))?(Z)?$"),handler:k(["","hour","minute","second","millisecond","zone"])},{name:"zone24",regex:r.compile("(_H24_):(_MIN_):(_SEC_)(?:\\.(_MS_))?[\\s\\[(]*(_ZONE_)?[\\s\\])]*$"),handler:k(["","hour","minute","second","millisecond","zone"])},{name:"hms12",regex:r.compile("(_H12_):(_MIN_):(_SEC_)\\s*(_MERIDIEM_)"),handler:k(["","hour","minute","second","meridiem"])},{name:"hms24",regex:r.compile("(_H24_):(_MIN_):(_SEC_)(?:\\.(_MS_))?"),handler:k(["","hour","minute","second","millisecond"])},{name:"hm12",regex:r.compile("(_H12_):(_MIN_)\\s*(_MERIDIEM_)"),handler:k(["","hour","minute","meridiem"])},{name:"hm24",regex:r.compile("(_H24_):(_MIN_)"),handler:k(["","hour","minute"])},{name:"h12",regex:r.compile("(_H12_)\\s*(_MERIDIEM_)"),handler:k(["","hour","meridiem"])},{name:"8digit",regex:/^((?:19|20)\d{2})(\d{2})(\d{2})$/,handler:k(["","year","month","day"])},{name:"yearMonthnameDay",regex:r.compile("(_YEAR4_)[\\s.-]+(_MONTHNAME_)[\\s,.-]+(_DAY_)(_ORDINAL_)?"),handler:k(["","year","monthname","day"])},{name:"dayMonthnameYear",regex:r.compile("(_DAY_)(_ORDINAL_)?[\\s.-]*(_MONTHNAME_)[\\s,.-]+(_YEAR_)"),handler:k(["","day","","monthname","year"])},{name:"monthnameDayYear",regex:r.compile("(_MONTHNAME_)[\\s.-]*(_DAY_)(_ORDINAL_)?[\\s,.-]+(_YEAR_)"),handler:k(["","monthname","day","","year"])},{name:"dayMonthname",regex:r.compile("\\b(_DAY_)(_ORDINAL_)?[\\s.-]*(_MONTHNAME_)\\b"),handler:k(["","day","","monthname"])},{name:"monthnameDay",regex:r.compile("\\b(_MONTHNAME_)[\\s.-]*(_DAY_)(_ORDINAL_)?\\b"),handler:k(["","monthname","day"])},{name:"hmsNoMeridiem",regex:r.compile("\\b(_H12_|_H24_):(_MIN_):(_SEC_)\\b"),handler:k(["","hour","minute","second"])},{name:"hmNoMeridiem",regex:r.compile("\\b(_H12_|_H24_):(_MIN_)\\b"),handler:k(["","hour","minute"])},{name:"ymd",regex:r.compile("(_YEAR4_)([.-])(_MONTH_)\\2+(_DAY_)"),handler:k(["","year","","month","day"])},{name:"mdy",regex:r.compile("(_MONTH_)([/-])(_DAY_)\\2(_YEAR_)"),handler:k(["","month","","day","year"])},{name:"dmy",regex:r.compile("(_DAY_)(?:_ORDINAL_)?[./\\s-]+(_MONTH_)[./\\s-]+(_YEAR_)"),handler:k(["","day","month","year"])},{name:"yearLoose",regex:r.compile("_YEAR4_"),handler:k(["year"])},{name:"dayMonthnameLoose",regex:r.compile("(_DAY_)[\\s.]*(_MONTHNAME_)"),handler:k(["","day","monthname"])},{name:"monthnameDayLoose",regex:r.compile("(_MONTHNAME_)[\\s.]*(_DAY_)"),handler:k(["","monthname","day"])},{name:"monthname",regex:r.compile("_MONTHNAME_"),handler:k(["monthname"])},{name:"year4",regex:r.compile("_YEAR4_"),handler:k(["year"])},{name:"md",regex:r.compile("(_MONTH_)[/-](_DAY_)"),handler:k(["","month","day"])},{name:"dm",regex:r.compile("(_DAY_)(?:_ORDINAL_)?[./\\s-]+(_MONTH_)"),handler:k(["","day","month"])},{name:"day",regex:r.compile("_DAY_"),handler:k(["day"])},{name:"year2",regex:r.compile("_YEAR2_"),handler:k(["year"])},{name:"onlyZone",regex:r.compile("_ZONE_"),handler:k(["zone"])}],a=r.baseName.slice(0,5),v.includes(a)?o:o.filter(e=>!["mdy","md"].includes(e.name))),formatter:(n=r,function(e){let t={};for(let[o,a]of Object.entries(e))if("monthname"===o){if(a){let e=n.monthNameToInt(a);void 0!==e&&(t.month=e)}}else if("hour"===o&&e.meridiem){let o=n.h12ToInt(a,e.meridiem);void 0!==o&&(t.hour=o)}else if("zone"===o){if(a){let e=n.zoneToOffset(a);void 0!==e&&(t.offset=e)}}else if("offset"===o){let e=n.offsetToMinutes(a);void 0!==e&&(t.offset=e)}else if("millisecond"===o){let e=n.millisecondToInt(a);"number"==typeof e&&(t.millisecond=e)}else if(w.includes(o)){let e=n.toInt(a);"number"==typeof e&&(t[o]=e)}return t.year<100&&(t.year=l[t.year]),t.year&&"buddhist"===n.dateOptions.calendar&&(t.year-=543),t})})}return C[e]}(t),o=function(e,t){let n=z[t.slice(0,2).toLowerCase()];if(!n)return e;for(let[t,o]of n)e=e.replace(t,o);return e}(e,t);return n.attempt(o)}function P(e){e.month&&e.day&&void 0===e.year&&(e.year=new Date().getFullYear()),60===e.second&&(e.second=59);let t=new s(e.year,e.month-1,e.day,e.hour||0,e.minute||0,e.second||0,e.millisecond||0);return"number"==typeof e.offset?new s(t.valueOf()-60*e.offset*1e3):t}function M(e,t=i){let n=D(e,t),o=n.invalid?new s(NaN):P(n);return o.isValid()||(o.invalid=`Unable to parse date "${e}"`),o}function N(e,t=i){return e instanceof Date?new s(e.valueOf()):"number"==typeof e?new s(e):M(e,t)}Date.fromString=s.fromString=M,Date.fromAny=s.fromAny=N,"u">typeof window&&(window.anyDateParser={fromString:M,fromAny:N,fromObject:P,attempt:D});var T=n(80222),B=n.n(T),O=n(85602),I=n(44397),j=n(57657);let R=function(e){return null==e};var F=n(59571),L=n(65763);function W(e,t){var n=function(e,t){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return t.get(e)}(e,t);return n.get?n.get.call(e):n.value}B().extend(O),B().extend(j),B().extend(I);let V="YYYY-MM-DDTHH:mm:ss.SSSZZ";function G(e){return null!=e&&28===e.trim().length&&"T"===(e=e.trim())[10]&&":"===e[13]&&":"===e[16]&&"."===e[19]&&("+"===e[23]||"-"===e[23])&&B()(e,V).isValid()}function U(e){return B()(e).isToday()}function q(e){return G(e)?B()(e,V).toDate():null}function H(e,t=!1){let n=B()(e);return t&&(n=n.utc()),n.format(V)}function K(e){return B()(e).toDate()}var Z=new WeakMap;let Y=new class{register(e,t){W(this,Z).set(e,t)}getCalendar(e){if(!e)return;if(e.calendar)return e.calendar;if(e.region){let t=`${e.language}-${e.region}`;if(W(this,Z).has(t))return W(this,Z).get(t)}if(e.language&&W(this,Z).has(e.language))return W(this,Z).get(e.language);let t=new Intl.DateTimeFormat(e.toString()).resolvedOptions().calendar;return W(this,Z).set(`${e.language}${e.region?`-${e.region}`:""}`,t),t}constructor(){!function(e,t,n){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object");t.set(e,n)}(this,Z,{writable:!0,value:new Map})}};function J(e,t){Y.register(e,t)}function X(e){let t=e??(0,L.J)();return Y.getCalendar(t instanceof Intl.Locale?t:new Intl.Locale(t))}let Q={mode:"standard",time:"for today",day:!0,month:!0,year:!0,noToday:!1};function ee(e,t={}){let n=D(e,(0,L.J)());if(n.invalid)return console.warn(`Could not parse invalid date '${e}'`),null;!R(n.day)&&R(n.month)&&(n=Object.assign({},(0,F.A)(n,"day"),{month:n.day})),n.month&&(n.month-=1),n.day&&(n=Object.assign({},(0,F.A)(n,"day"),{date:n.day}));let o=B()().set(n).toDate();return R(n.year)&&(t.year=!1),R(n.month)&&(t.month=!1),R(n.date)&&(t.day=!1),et(o,t)}function et(e,t){let n,o=t?.locale??(0,L.J)(),a=new Intl.Locale(o),{calendar:r,mode:i,time:s,day:l,month:p,year:c,noToday:d,numberingSystem:u}={...Q,...{noToday:"am"===a.language},...t},f={calendar:r??X(a),year:c?"numeric":void 0,month:p?"short":void 0,day:l?"2-digit":void 0,numberingSystem:u},h=B()(e).isToday();if(h&&!d)n=(n=new Intl.RelativeTimeFormat(o,{numeric:"auto"}).format(0,"day"))[0].toLocaleUpperCase(o)+n.slice(1);else{"en"===a.language&&(o="en-GB");let t=new Intl.DateTimeFormat(o,f).formatToParts(e);("en"===a.language||"am"===a.language)&&"standard"==i&&c&&l&&(t=t.map(en("-"))),"wide"==i&&(t=t.map(en(" — "))),"ethiopic"===f.calendar&&(t=t.filter((e,t,n)=>"era"!==e.type&&("literal"!==e.type||!(t<n.length-1)||"era"!==n[t+1].type))),n=t.map(e=>e.value).join("")}return(!0===s||h&&"for today"===s)&&(n+=`, ${eo(e)}`),n}let en=e=>(t,n,o)=>"literal"!==t.type||" "!==t.value||n<o.length-1&&"era"===o[n+1].type?t:{type:"literal",value:e};function eo(e){return e.toLocaleTimeString((0,L.J)(),{hour:"2-digit",minute:"2-digit"})}function ea(e,t){return et(e,{...t,time:!0})}function er(e,t){let n=X("string"==typeof t?new Intl.Locale(t):t);return n?(0,a.yP)(e,(0,r.d)(n)):e}function ei(e,t){return new Intl.DurationFormat((0,L.J)(),t).format(e)}function es(e,t){if(null==e)return null;if("string"==typeof e){let n=D(e,(0,L.J)());return n.invalid?(console.warn(`Could not interpret '${e}' as a date`),null):(n.day&&!n.month&&(n={...(0,F.A)(n,"day"),...{month:n.day}}),n.month&&(n.month-=1),n.day&&(n={...(0,F.A)(n,"day"),...{date:n.day}}),B()(t).set(n))}return B()(e)}let el=["years","months","days","hours","minutes","seconds"],ep={second:"seconds",minute:"minutes",hour:"hours",day:"days",month:"months",year:"years"},ec={seconds:45,minutes:45,hours:22,days:26,months:11,years:1/0};function ed(e,t=B()(),n){let o,a=B()(t),r=es(e,a);if(null==r)return null;if("string"==typeof n){let e=ep[n]??n;return{[e]:a.diff(r,e)}}let{thresholds:i,largestUnit:s,smallestUnit:l}=n??{};if(void 0!==s||void 0!==l){let e,t=l?ep[l]??l:void 0;return e="auto"===s||void 0===s?function(e,t,n){let o=el.indexOf(n);for(let a=0;a<el.length;a++){let r=el[a];if(t.diff(e,r)>0)return a<=o?r:n}return n}(r,a,t??"seconds"):ep[s]??s,function(e,t,n,o){let a=el.indexOf(n),r=el.indexOf(o),i=el.slice(a,r+1),s={},l=e;for(let e of i){let n=t.diff(l,e);s[e]=n,l=l.add(n,e)}return s}(r,a,e,t??e)}let p=(o=function(e){let t={...ec};if(e)for(let[n,o]of Object.entries(e))void 0!==o&&(t[ep[n]??n]=o);return t}(i),a.diff(r,"seconds")<o.seconds?"seconds":a.diff(r,"minutes")<o.minutes?"minutes":a.diff(r,"hours")<o.hours?"hours":a.diff(r,"days")<o.days?"days":a.diff(r,"months")<o.months?"months":"years");return{[p]:a.diff(r,p)}}let eu={style:"short",localeMatcher:"lookup"};function ef(e,t=B()(),n){let o=ed(e,t,n);return null==o?null:ei(o,"object"==typeof n&&n.formatOptions?{...eu,...n.formatOptions}:eu)}},65763(e,t,n){"use strict";function o(){let e=window.i18next.language;return"ht"===(e=e.replaceAll("_","-"))&&(e="fr-HT"),e}n.d(t,{J:()=>o})},6564(e,t,n){"use strict";function o(e){return!window.offlineEnabled||(e??navigator.onLine)}n.d(t,{s:()=>o})},877(e,t,n){"use strict";function o(e){return r(s(e,"usual","official"))}function a(e){return o(e)}function r(e){var t;let n;return e?e.text??(n=(t=e).given??[],(t.family?n.concat(t.family):n).join(" ")):""}function i(e){return r(e)}function s(e,...t){for(let n of(0==t.length&&(t=["usual"]),t)){let t=e.name?.find(e=>{var t,o;return t=e,o=n,t.use?t.use===o:"usual"===o});if(t)return t}}n.d(t,{QC:()=>a,Qr:()=>r,VO:()=>s,Vp:()=>o,qK:()=>i})},43254(e,t,n){"use strict";function o(e,t){if(e===t||Object.is(e,t))return!0;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}if(Array.isArray(t)||"object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;let n=Object.getOwnPropertyNames(e),o=Object.getOwnPropertyNames(t);return n.length===o.length&&n.every(n=>e[n]===t[n])}n.d(t,{b:()=>o})},19758(e,t,n){"use strict";n.d(t,{A:()=>a});class o{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+o.version}static addUnaryOp(e){return o.max_unop_len=Math.max(e.length,o.max_unop_len),o.unary_ops[e]=1,o}static addBinaryOp(e,t,n){return o.max_binop_len=Math.max(e.length,o.max_binop_len),o.binary_ops[e]=t,n?o.right_associative.add(e):o.right_associative.delete(e),o}static addIdentifierChar(e){return o.additional_identifier_chars.add(e),o}static addLiteral(e,t){return o.literals[e]=t,o}static removeUnaryOp(e){return delete o.unary_ops[e],e.length===o.max_unop_len&&(o.max_unop_len=o.getMaxKeyLen(o.unary_ops)),o}static removeAllUnaryOps(){return o.unary_ops={},o.max_unop_len=0,o}static removeIdentifierChar(e){return o.additional_identifier_chars.delete(e),o}static removeBinaryOp(e){return delete o.binary_ops[e],e.length===o.max_binop_len&&(o.max_binop_len=o.getMaxKeyLen(o.binary_ops)),o.right_associative.delete(e),o}static removeAllBinaryOps(){return o.binary_ops={},o.max_binop_len=0,o}static removeLiteral(e){return delete o.literals[e],o}static removeAllLiterals(){return o.literals={},o}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(e){this.expr=e,this.index=0}static parse(e){return new o(e).parse()}static getMaxKeyLen(e){return Math.max(0,...Object.keys(e).map(e=>e.length))}static isDecimalDigit(e){return e>=48&&e<=57}static binaryPrecedence(e){return o.binary_ops[e]||0}static isIdentifierStart(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!o.binary_ops[String.fromCharCode(e)]||o.additional_identifier_chars.has(String.fromCharCode(e))}static isIdentifierPart(e){return o.isIdentifierStart(e)||o.isDecimalDigit(e)}throwError(e){let t=Error(e+" at character "+this.index);throw t.index=this.index,t.description=e,t}runHook(e,t){if(o.hooks[e]){let n={context:this,node:t};return o.hooks.run(e,n),n.node}return t}searchHook(e){if(o.hooks[e]){let t={context:this};return o.hooks[e].find(function(e){return e.call(t.context,t),t.node}),t.node}}gobbleSpaces(){let e=this.code;for(;e===o.SPACE_CODE||e===o.TAB_CODE||e===o.LF_CODE||e===o.CR_CODE;)e=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let e=this.gobbleExpressions(),t=1===e.length?e[0]:{type:o.COMPOUND,body:e};return this.runHook("after-all",t)}gobbleExpressions(e){let t=[],n,a;for(;this.index<this.expr.length;)if((n=this.code)===o.SEMCOL_CODE||n===o.COMMA_CODE)this.index++;else if(a=this.gobbleExpression())t.push(a);else if(this.index<this.expr.length){if(n===e)break;this.throwError('Unexpected "'+this.char+'"')}return t}gobbleExpression(){let e=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",e)}gobbleBinaryOp(){this.gobbleSpaces();let e=this.expr.substr(this.index,o.max_binop_len),t=e.length;for(;t>0;){if(o.binary_ops.hasOwnProperty(e)&&(!o.isIdentifierStart(this.code)||this.index+e.length<this.expr.length&&!o.isIdentifierPart(this.expr.charCodeAt(this.index+e.length))))return this.index+=t,e;e=e.substr(0,--t)}return!1}gobbleBinaryExpression(){let e,t,n,a,r,i,s,l,p;if(!(i=this.gobbleToken())||!(t=this.gobbleBinaryOp()))return i;for(r={value:t,prec:o.binaryPrecedence(t),right_a:o.right_associative.has(t)},(s=this.gobbleToken())||this.throwError("Expected expression after "+t),a=[i,r,s];t=this.gobbleBinaryOp();){if(0===(n=o.binaryPrecedence(t))){this.index-=t.length;break}r={value:t,prec:n,right_a:o.right_associative.has(t)},p=t;let l=e=>r.right_a&&e.right_a?n>e.prec:n<=e.prec;for(;a.length>2&&l(a[a.length-2]);)s=a.pop(),t=a.pop().value,i=a.pop(),e={type:o.BINARY_EXP,operator:t,left:i,right:s},a.push(e);(e=this.gobbleToken())||this.throwError("Expected expression after "+p),a.push(r,e)}for(l=a.length-1,e=a[l];l>1;)e={type:o.BINARY_EXP,operator:a[l-1].value,left:a[l-2],right:e},l-=2;return e}gobbleToken(){let e,t,n,a;if(this.gobbleSpaces(),a=this.searchHook("gobble-token"))return this.runHook("after-token",a);if(e=this.code,o.isDecimalDigit(e)||e===o.PERIOD_CODE)return this.gobbleNumericLiteral();if(e===o.SQUOTE_CODE||e===o.DQUOTE_CODE)a=this.gobbleStringLiteral();else if(e===o.OBRACK_CODE)a=this.gobbleArray();else{for(n=(t=this.expr.substr(this.index,o.max_unop_len)).length;n>0;){if(o.unary_ops.hasOwnProperty(t)&&(!o.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!o.isIdentifierPart(this.expr.charCodeAt(this.index+t.length)))){this.index+=n;let e=this.gobbleToken();return e||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:o.UNARY_EXP,operator:t,argument:e,prefix:!0})}t=t.substr(0,--n)}o.isIdentifierStart(e)?(a=this.gobbleIdentifier(),o.literals.hasOwnProperty(a.name)?a={type:o.LITERAL,value:o.literals[a.name],raw:a.name}:a.name===o.this_str&&(a={type:o.THIS_EXP})):e===o.OPAREN_CODE&&(a=this.gobbleGroup())}return a?(a=this.gobbleTokenProperty(a),this.runHook("after-token",a)):this.runHook("after-token",!1)}gobbleTokenProperty(e){this.gobbleSpaces();let t=this.code;for(;t===o.PERIOD_CODE||t===o.OBRACK_CODE||t===o.OPAREN_CODE||t===o.QUMARK_CODE;){let n;if(t===o.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==o.PERIOD_CODE)break;n=!0,this.index+=2,this.gobbleSpaces(),t=this.code}this.index++,t===o.OBRACK_CODE?((e={type:o.MEMBER_EXP,computed:!0,object:e,property:this.gobbleExpression()}).property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),(t=this.code)!==o.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):t===o.OPAREN_CODE?e={type:o.CALL_EXP,arguments:this.gobbleArguments(o.CPAREN_CODE),callee:e}:(t===o.PERIOD_CODE||n)&&(n&&this.index--,this.gobbleSpaces(),e={type:o.MEMBER_EXP,computed:!1,object:e,property:this.gobbleIdentifier()}),n&&(e.optional=!0),this.gobbleSpaces(),t=this.code}return e}gobbleNumericLiteral(){let e="",t,n;for(;o.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);if(this.code===o.PERIOD_CODE)for(e+=this.expr.charAt(this.index++);o.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);if("e"===(t=this.char)||"E"===t){for(e+=this.expr.charAt(this.index++),("+"===(t=this.char)||"-"===t)&&(e+=this.expr.charAt(this.index++));o.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);o.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+e+this.char+")")}return n=this.code,o.isIdentifierStart(n)?this.throwError("Variable names cannot start with a number ("+e+this.char+")"):(n===o.PERIOD_CODE||1===e.length&&e.charCodeAt(0)===o.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:o.LITERAL,value:parseFloat(e),raw:e}}gobbleStringLiteral(){let e="",t=this.index,n=this.expr.charAt(this.index++),a=!1;for(;this.index<this.expr.length;){let t=this.expr.charAt(this.index++);if(t===n){a=!0;break}if("\\"===t)switch(t=this.expr.charAt(this.index++)){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:e+=t}else e+=t}return a||this.throwError('Unclosed quote after "'+e+'"'),{type:o.LITERAL,value:e,raw:this.expr.substring(t,this.index)}}gobbleIdentifier(){let e=this.code,t=this.index;for(o.isIdentifierStart(e)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length;)if(e=this.code,o.isIdentifierPart(e))this.index++;else break;return{type:o.IDENTIFIER,name:this.expr.slice(t,this.index)}}gobbleArguments(e){let t=[],n=!1,a=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let r=this.code;if(r===e){n=!0,this.index++,e===o.CPAREN_CODE&&a&&a>=t.length&&this.throwError("Unexpected token "+String.fromCharCode(e));break}if(r===o.COMMA_CODE){if(this.index++,++a!==t.length){if(e===o.CPAREN_CODE)this.throwError("Unexpected token ,");else if(e===o.CBRACK_CODE)for(let e=t.length;e<a;e++)t.push(null)}}else if(t.length!==a&&0!==a)this.throwError("Expected comma");else{let e=this.gobbleExpression();e&&e.type!==o.COMPOUND||this.throwError("Expected comma"),t.push(e)}}return n||this.throwError("Expected "+String.fromCharCode(e)),t}gobbleGroup(){this.index++;let e=this.gobbleExpressions(o.CPAREN_CODE);if(this.code===o.CPAREN_CODE)return(this.index++,1===e.length)?e[0]:!!e.length&&{type:o.SEQUENCE_EXP,expressions:e};this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:o.ARRAY_EXP,elements:this.gobbleArguments(o.CBRACK_CODE)}}}Object.assign(o,{hooks:new class{add(e,t,n){if("string"!=typeof arguments[0])for(let e in arguments[0])this.add(e,arguments[0][e],arguments[1]);else(Array.isArray(e)?e:[e]).forEach(function(e){this[e]=this[e]||[],t&&this[e][n?"unshift":"push"](t)},this)}run(e,t){this[e]=this[e]||[],this[e].forEach(function(e){e.call(t&&t.context?t.context:t,t)})}},plugins:new class{constructor(e){this.jsep=e,this.registered={}}register(...e){e.forEach(e=>{if("object"!=typeof e||!e.name||!e.init)throw Error("Invalid JSEP plugin format");this.registered[e.name]||(e.init(this.jsep),this.registered[e.name]=e)})}}(o),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),o.max_unop_len=o.getMaxKeyLen(o.unary_ops),o.max_binop_len=o.getMaxKeyLen(o.binary_ops);let a=e=>new o(e).parse(),r=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(o).filter(e=>!r.includes(e)&&void 0===a[e]).forEach(e=>{a[e]=o[e]}),a.Jsep=o,a.plugins.register({name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;let n=t.node,o=this.gobbleExpression();if(o||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let a=this.gobbleExpression();if(a||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:n,consequent:o,alternate:a},n.operator&&e.binary_ops[n.operator]<=.9){let o=n;for(;o.right.operator&&e.binary_ops[o.right.operator]<=.9;)o=o.right;t.node.test=o.right,o.right=t.node,t.node=n}}else this.throwError("Expected :")}})}})},76124(e,t,n){"use strict";n.d(t,{A:()=>i});var o=n(99271),a=n(26979),r=Object.prototype.hasOwnProperty;let i=function(e,t,n){var i=e[t];r.call(e,t)&&(0,a.A)(i,n)&&(void 0!==n||t in e)||(0,o.A)(e,t,n)}},99271(e,t,n){"use strict";n.d(t,{A:()=>a});var o=n(61758);let a=function(e,t,n){"__proto__"==t&&o.A?(0,o.A)(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},41736(e,t,n){"use strict";n.d(t,{A:()=>V});var o=n(21050);let a=function(e,t){for(var n=-1,o=null==e?0:e.length;++n<o&&!1!==t(e[n],n,e););return e};var r=n(76124),i=n(28078),s=n(7817),l=n(25894),p=n(521),c=n(80084),d=n(26157),u=n(36430),f=n(2475),h=n(7096),m=n(90616),g=Object.prototype.hasOwnProperty;let y=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&g.call(e,"index")&&(n.index=e.index,n.input=e.input),n};var b=n(88724);let v=function(e,t){var n=t?(0,b.A)(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)};var $=/\w*$/;let A=function(e){var t=new e.constructor(e.source,$.exec(e));return t.lastIndex=e.lastIndex,t};var k=n(83516),x=k.A?k.A.prototype:void 0,w=x?x.valueOf:void 0,C=n(65246);let E=function(e,t,n){var o=e.constructor;switch(t){case"[object ArrayBuffer]":return(0,b.A)(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return v(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return(0,C.A)(e,n);case"[object Map]":case"[object Set]":return new o;case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return A(e);case"[object Symbol]":return w?Object(w.call(e)):{}}};var S=n(12458),z=n(96956),D=n(11917),P=n(47313),M=n(58126),N=n(10248),T=N.A&&N.A.isMap,B=T?(0,M.A)(T):function(e){return(0,P.A)(e)&&"[object Map]"==(0,m.A)(e)},O=n(97942),I=N.A&&N.A.isSet,j=I?(0,M.A)(I):function(e){return(0,P.A)(e)&&"[object Set]"==(0,m.A)(e)},R="[object Arguments]",F="[object Function]",L="[object Object]",W={};W[R]=W["[object Array]"]=W["[object ArrayBuffer]"]=W["[object DataView]"]=W["[object Boolean]"]=W["[object Date]"]=W["[object Float32Array]"]=W["[object Float64Array]"]=W["[object Int8Array]"]=W["[object Int16Array]"]=W["[object Int32Array]"]=W["[object Map]"]=W["[object Number]"]=W[L]=W["[object RegExp]"]=W["[object Set]"]=W["[object String]"]=W["[object Symbol]"]=W["[object Uint8Array]"]=W["[object Uint8ClampedArray]"]=W["[object Uint16Array]"]=W["[object Uint32Array]"]=!0,W["[object Error]"]=W[F]=W["[object WeakMap]"]=!1;let V=function e(t,n,g,b,v,$){var A,k=1&n,x=2&n,w=4&n;if(g&&(A=v?g(t,b,v,$):g(t)),void 0!==A)return A;if(!(0,O.A)(t))return t;var C=(0,z.A)(t);if(C){if(A=y(t),!k)return(0,c.A)(t,A)}else{var P,M,N,T,I=(0,m.A)(t),V=I==F||"[object GeneratorFunction]"==I;if((0,D.A)(t))return(0,p.A)(t,k);if(I==L||I==R||V&&!v){if(A=x||V?{}:(0,S.A)(t),!k)return x?(M=(P=A)&&(0,i.A)(t,(0,l.A)(t),P),(0,i.A)(t,(0,u.A)(t),M)):(T=(N=A)&&(0,i.A)(t,(0,s.A)(t),N),(0,i.A)(t,(0,d.A)(t),T))}else{if(!W[I])return v?t:{};A=E(t,I,k)}}$||($=new o.A);var G=$.get(t);if(G)return G;$.set(t,A),j(t)?t.forEach(function(o){A.add(e(o,n,g,o,t,$))}):B(t)&&t.forEach(function(o,a){A.set(a,e(o,n,g,a,t,$))});var U=w?x?h.A:f.A:x?l.A:s.A,q=C?void 0:U(t);return a(q||t,function(o,a){q&&(o=t[a=o]),(0,r.A)(A,a,e(o,n,g,a,t,$))}),A}},20405(e,t,n){"use strict";n.d(t,{A:()=>C});var o=n(21050),a=n(99271),r=n(26979);let i=function(e,t,n){(void 0===n||(0,r.A)(e[t],n))&&(void 0!==n||t in e)||(0,a.A)(e,t,n)};var s=n(80670),l=n(521),p=n(65246),c=n(80084),d=n(12458),u=n(86770),f=n(96956),h=n(31475),m=n(47313),g=n(11917),y=n(50405),b=n(97942),v=n(78938),$=n(60480);let A=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};var k=n(28078),x=n(25894);let w=function(e,t,n,o,a,r,s){var w=A(e,n),C=A(t,n),E=s.get(C);if(E)return void i(e,n,E);var S=r?r(w,C,n+"",e,t,s):void 0,z=void 0===S;if(z){var D=(0,f.A)(C),P=!D&&(0,g.A)(C),M=!D&&!P&&(0,$.A)(C);(S=C,D||P||M)?(0,f.A)(w)?S=w:(0,m.A)(w)&&(0,h.A)(w)?S=(0,c.A)(w):P?(z=!1,S=(0,l.A)(C,!0)):M?(z=!1,S=(0,p.A)(C,!0)):S=[]:(0,v.A)(C)||(0,u.A)(C)?(S=w,(0,u.A)(w))?S=(0,k.A)(w,(0,x.A)(w)):(!(0,b.A)(w)||(0,y.A)(w))&&(S=(0,d.A)(C)):z=!1}z&&(s.set(C,S),a(S,C,o,r,s),s.delete(C)),i(e,n,S)},C=function e(t,n,a,r,l){t!==n&&(0,s.A)(n,function(s,p){if(l||(l=new o.A),(0,b.A)(s))w(t,n,p,a,e,r,l);else{var c=r?r(A(t,p),s,p+"",t,n,l):void 0;void 0===c&&(c=s),i(t,p,c)}},x.A)}},88724(e,t,n){"use strict";n.d(t,{A:()=>a});var o=n(97913);let a=function(e){var t=new e.constructor(e.byteLength);return new o.A(t).set(new o.A(e)),t}},521(e,t,n){"use strict";n.d(t,{A:()=>l});var o=n(39600),a="object"==typeof exports&&exports&&!exports.nodeType&&exports,r=a&&"object"==typeof module&&module&&!module.nodeType&&module,i=r&&r.exports===a?o.A.Buffer:void 0,s=i?i.allocUnsafe:void 0;let l=function(e,t){if(t)return e.slice();var n=e.length,o=s?s(n):new e.constructor(n);return e.copy(o),o}},65246(e,t,n){"use strict";n.d(t,{A:()=>a});var o=n(88724);let a=function(e,t){var n=t?(0,o.A)(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},80084(e,t,n){"use strict";n.d(t,{A:()=>o});let o=function(e,t){var n=-1,o=e.length;for(t||(t=Array(o));++n<o;)t[n]=e[n];return t}},28078(e,t,n){"use strict";n.d(t,{A:()=>r});var o=n(76124),a=n(99271);let r=function(e,t,n,r){var i=!n;n||(n={});for(var s=-1,l=t.length;++s<l;){var p=t[s],c=r?r(n[p],e[p],p,n,e):void 0;void 0===c&&(c=e[p]),i?(0,a.A)(n,p,c):(0,o.A)(n,p,c)}return n}},11888(e,t,n){"use strict";n.d(t,{A:()=>d});var o=n(14151),a=n(28127),r=n(30088),i=n(26979),s=n(31475),l=n(85378),p=n(97942);let c=function(e,t,n){if(!(0,p.A)(n))return!1;var o=typeof t;return("number"==o?!!((0,s.A)(n)&&(0,l.A)(t,n.length)):"string"==o&&t in n)&&(0,i.A)(n[t],e)},d=function(e){var t;return t=function(t,n){var o=-1,a=n.length,r=a>1?n[a-1]:void 0,i=a>2?n[2]:void 0;for(r=e.length>3&&"function"==typeof r?(a--,r):void 0,i&&c(n[0],n[1],i)&&(r=a<3?void 0:r,a=1),t=Object(t);++o<a;){var s=n[o];s&&e(t,s,o,r)}return t},(0,r.A)((0,a.A)(t,void 0,o.A),t+"")}},61758(e,t,n){"use strict";n.d(t,{A:()=>a});var o=n(61982);let a=function(){try{var e=(0,o.A)(Object,"defineProperty");return e({},"",{}),e}catch(e){}}()},7096(e,t,n){"use strict";n.d(t,{A:()=>i});var o=n(64494),a=n(36430),r=n(25894);let i=function(e){return(0,o.A)(e,r.A,a.A)}},34878(e,t,n){"use strict";n.d(t,{A:()=>o});let o=(0,n(67244).A)(Object.getPrototypeOf,Object)},36430(e,t,n){"use strict";n.d(t,{A:()=>s});var o=n(53271),a=n(34878),r=n(26157),i=n(11276);let s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)(0,o.A)(t,(0,r.A)(e)),e=(0,a.A)(e);return t}:i.A},12458(e,t,n){"use strict";n.d(t,{A:()=>l});var o=n(97942),a=Object.create,r=function(){function e(){}return function(t){if(!(0,o.A)(t))return{};if(a)return a(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),i=n(34878),s=n(71140);let l=function(e){return"function"!=typeof e.constructor||(0,s.A)(e)?{}:r((0,i.A)(e))}},28127(e,t,n){"use strict";n.d(t,{A:()=>r});let o=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)};var a=Math.max;let r=function(e,t,n){return t=a(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=a(r.length-t,0),l=Array(s);++i<s;)l[i]=r[t+i];i=-1;for(var p=Array(t+1);++i<t;)p[i]=r[i];return p[t]=n(l),o(e,this,p)}}},30088(e,t,n){"use strict";n.d(t,{A:()=>p});var o,a,r=n(61758),i=n(14151),s=r.A?function(e,t){return(0,r.A)(e,"toString",{configurable:!0,enumerable:!1,value:function(){return t},writable:!0})}:i.A,l=Date.now;let p=(o=0,a=0,function(){var e=l(),t=16-(e-a);if(a=e,t>0){if(++o>=800)return arguments[0]}else o=0;return s.apply(void 0,arguments)})},42853(e,t,n){"use strict";n.d(t,{A:()=>a});var o=n(22214);let a=function(e,t){return(0,o.A)(e,t)}},78938(e,t,n){"use strict";n.d(t,{A:()=>c});var o=n(77361),a=n(34878),r=n(47313),i=Object.prototype,s=Function.prototype.toString,l=i.hasOwnProperty,p=s.call(Object);let c=function(e){if(!(0,r.A)(e)||"[object Object]"!=(0,o.A)(e))return!1;var t=(0,a.A)(e);if(null===t)return!0;var n=l.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&s.call(n)==p}},25894(e,t,n){"use strict";n.d(t,{A:()=>c});var o=n(95403),a=n(97942),r=n(71140);let i=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t};var s=Object.prototype.hasOwnProperty;let l=function(e){if(!(0,a.A)(e))return i(e);var t=(0,r.A)(e),n=[];for(var o in e)"constructor"==o&&(t||!s.call(e,o))||n.push(o);return n};var p=n(31475);let c=function(e){return(0,p.A)(e)?(0,o.A)(e,!0):l(e)}},59571(e,t,n){"use strict";n.d(t,{A:()=>E});var o,a=n(65133),r=n(41736),i=n(77390);let s=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};var l=n(55841);let p=function(e,t,n){var o=-1,a=e.length;t<0&&(t=-t>a?0:a+t),(n=n>a?a:n)<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var r=Array(a);++o<a;)r[o]=e[o+t];return r};var c=n(9322),d=Object.prototype.hasOwnProperty;let u=function(e,t){t=(0,i.A)(t,e);var n,o=-1,a=t.length;if(!a)return!0;for(;++o<a;){var r=(0,c.A)(t[o]);if("__proto__"===r&&!d.call(e,"__proto__")||("constructor"===r||"prototype"===r)&&o<a-1)return!1}var u=(n=t).length<2?e:(0,l.A)(e,p(n,0,-1));return null==u||delete u[(0,c.A)(s(t))]};var f=n(28078),h=n(78938);let m=function(e){return(0,h.A)(e)?void 0:e};var g=n(53271),y=n(83516),b=n(86770),v=n(96956),$=y.A?y.A.isConcatSpreadable:void 0;let A=function(e){return(0,v.A)(e)||(0,b.A)(e)||!!($&&e&&e[$])},k=function e(t,n,o,a,r){var i=-1,s=t.length;for(o||(o=A),r||(r=[]);++i<s;){var l=t[i];n>0&&o(l)?n>1?e(l,n-1,o,a,r):(0,g.A)(r,l):a||(r[r.length]=l)}return r};var x=n(28127),w=n(30088),C=n(7096);let E=(o=function(e,t){var n={};if(null==e)return n;var o=!1;t=(0,a.A)(t,function(t){return t=(0,i.A)(t,e),o||(o=t.length>1),t}),(0,f.A)(e,(0,C.A)(e),n),o&&(n=(0,r.A)(n,7,m));for(var s=t.length;s--;)u(n,t[s]);return n},(0,w.A)((0,x.A)(o,void 0,function(e){return(null==e?0:e.length)?k(e,1):[]}),o+""))},61469(e,t,n){"use strict";function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach(function(t){var o,a,r;o=e,a=t,r=n[t],a in o?Object.defineProperty(o,a,{value:r,enumerable:!0,configurable:!0,writable:!0}):o[a]=r}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function r(e){return(r="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 i(e){return(i="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 s(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(i(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(i(e)));return e}}n.d(t,{A:()=>c,i:()=>l});var l=null;try{l=require("react").createContext()}catch(e){}var p={React:null,ReactDOM:null,ReactDOMClient:null,rootComponent:null,loadRootComponent:null,errorBoundary:null,errorBoundaryClass:null,domElementGetter:null,parcelCanUpdate:!0,suppressComponentDidCatchWarning:!1,domElements:{},renderResults:{},updateResolves:{},unmountResolves:{}};function c(e){if("object"!==r(e))throw Error("single-spa-react requires a configuration object");var t,n=a(a({},p),e);if(!n.React)throw Error("single-spa-react must be passed opts.React");if(!n.ReactDOM&&!n.ReactDOMClient)throw Error("single-spa-react must be passed opts.ReactDOM or opts.ReactDOMClient");if(n.renderType||(null!=(t=n.ReactDOMClient)&&t.createRoot?n.renderType="createRoot":n.renderType="render"),!n.rootComponent&&!n.loadRootComponent)throw Error("single-spa-react must be passed opts.rootComponent or opts.loadRootComponent");if(n.errorBoundary&&"function"!=typeof n.errorBoundary)throw Error("The errorBoundary opt for single-spa-react must either be omitted or be a function that returns React elements");!l&&n.React.createContext&&(l=n.React.createContext()),n.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}(n);var o={bootstrap:d.bind(null,n),mount:u.bind(null,n),unmount:f.bind(null,n)};return n.parcelCanUpdate&&(o.update=h.bind(null,n)),o}function d(e,t){return e.rootComponent?Promise.resolve():e.loadRootComponent(t).then(function(t){e.rootComponent=t})}function u(e,t){return new Promise(function(n,o){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 a,r=g(e,t,function(){n(this)}),i=s(e,t)(),l=function(e){var t=e.reactDom,n=e.renderType,o=e.elementToRender,a=e.domElement,r=t[n];if("function"!=typeof r)throw Error('renderType "'.concat(n,'" did not return a function.'));switch(n){case"createRoot":case"unstable_createRoot":case"createBlockingRoot":case"unstable_createBlockingRoot":var i=r(a);return i.render(o),i;case"hydrateRoot":return r(a,o);default:return r(o,a),null}}({elementToRender:r,domElement:i,reactDom:m(e),renderType:"function"==typeof(a=e).renderType?a.renderType():a.renderType});e.domElements[t.name]=i,e.renderResults[t.name]=l})}function f(e,t){return new Promise(function(n){e.unmountResolves[t.name]=n;var o=e.renderResults[t.name];o&&o.unmount?o.unmount():m(e).unmountComponentAtNode(e.domElements[t.name]),delete e.domElements[t.name],delete e.renderResults[t.name]})}function h(e,t){return new Promise(function(n){e.updateResolves[t.name]||(e.updateResolves[t.name]=[]),e.updateResolves[t.name].push(n);var o=g(e,t,null),a=e.renderResults[t.name];if(a&&a.render)a.render(o);else{var r=s(e,t)();m(e).render(o,r)}})}function m(e){return e.ReactDOMClient||e.ReactDOM}function g(e,t,n){var o=e.React.createElement(e.rootComponent,t),r=l?e.React.createElement(l.Provider,{value:t},o):o;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),r=e.React.createElement(e.errorBoundaryClass,t,r)),r=e.React.createElement(e.SingleSpaRoot,a(a({},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])}}),r)}},22244(e,t,n){"use strict";let o;n.d(t,{AG:()=>ew,EH:()=>er,fz:()=>eP,xL:()=>G});var a=Object.freeze({__proto__:null,get start(){return eR},get ensureJQuerySupport(){return eh},get setBootstrapMaxTime(){return Z},get setMountMaxTime(){return Y},get setUnmountMaxTime(){return J},get setUnloadMaxTime(){return X},get registerApplication(){return ew},get unregisterApplication(){return eE},get getMountedApps(){return e$},get getAppStatus(){return ek},get unloadApplication(){return eS},get checkActivityFunctions(){return eC},get getAppNames(){return eA},get pathToActiveWhen(){return eP},get navigateToUrl(){return er},get patchHistoryApi(){return ed},get triggerAppChange(){return eB},get addErrorHandler(){return p},get removeErrorHandler(){return c},get mountRootParcel(){return G},get NOT_LOADED(){return f},get LOADING_SOURCE_CODE(){return h},get NOT_BOOTSTRAPPED(){return m},get BOOTSTRAPPING(){return g},get NOT_MOUNTED(){return y},get MOUNTING(){return b},get UPDATING(){return $},get LOAD_ERROR(){return x},get MOUNTED(){return v},get UNLOADING(){return k},get UNMOUNTING(){return A},get SKIP_BECAUSE_BROKEN(){return w}}),r=("u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof global?global:"u">typeof self?self:{}).CustomEvent,i=!function(){try{var e=new r("cat",{detail:{foo:"bar"}});return"cat"===e.type&&"bar"===e.detail.foo}catch(e){}return!1}()?"u">typeof document&&"function"==typeof document.createEvent?function(e,t){var n=document.createEvent("CustomEvent");return t?n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):n.initCustomEvent(e,!1,!1,void 0),n}:function(e,t){var n=document.createEventObject();return n.type=e,t?(n.bubbles=!!t.bubbles,n.cancelable=!!t.cancelable,n.detail=t.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n}:r;let s=[];function l(e,t,n){let o=u(e,t,n);s.length?s.forEach(e=>e(o)):setTimeout(()=>{throw o})}function p(e){if("function"!=typeof e)throw Error(d(28,!1));s.push(e)}function c(e){if("function"!=typeof e)throw Error(d(29,!1));let t=!1;return s=s.filter(n=>{let o=n===e;return t=t||o,!o}),t}function d(e,t,...n){return`single-spa minified message #${e}: ${t?t+" ":""}See https://single-spa.js.org/error/?code=${e}${n.length?`&arg=${n.join("&arg=")}`:""}`}function u(e,t,n){let o,a=`${D(t)} '${S(t)}' died in status ${t.status}: `;if(e instanceof Error){try{e.message=a+e.message}catch(e){}o=e}else{console.warn(d(30,!1,t.status,S(t)));try{o=Error(a+JSON.stringify(e))}catch(t){o=e}}return o.appOrParcelName=S(t),t.status=n,o}let f="NOT_LOADED",h="LOADING_SOURCE_CODE",m="NOT_BOOTSTRAPPED",g="BOOTSTRAPPING",y="NOT_MOUNTED",b="MOUNTING",v="MOUNTED",$="UPDATING",A="UNMOUNTING",k="UNLOADING",x="LOAD_ERROR",w="SKIP_BECAUSE_BROKEN";function C(e){return e.status===v}function E(e){try{return e.activeWhen(window.location)}catch(t){return l(t,e,w),!1}}function S(e){return e.name}function z(e){return!!e.unmountThisParcel}function D(e){return z(e)?"parcel":"application"}function P(){for(let e=arguments.length-1;e>0;e--)for(let t in arguments[e])"__proto__"!==t&&(arguments[e-1][t]=arguments[e][t]);return arguments[0]}function M(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return e[n];return null}function N(e){return e&&("function"==typeof e||Array.isArray(e)&&!M(e,e=>"function"!=typeof e))}function T(e,t){let n=e[t]||[];0===(n=Array.isArray(n)?n:[n]).length&&(n=[()=>Promise.resolve()]);let o=D(e),a=S(e);return function(e){return n.reduce((n,r,i)=>n.then(()=>{let n=r(e);return B(n)?n:Promise.reject(d(15,!1,o,a,t,i))}),Promise.resolve())}}function B(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch}let O=[];function I(e,t){return Promise.resolve().then(()=>e.status!==m?e:(e.status=g,e.bootstrap?Q(e,"bootstrap").then(n).catch(n=>{if(t)throw u(n,e,w);return l(n,e,w),e}):Promise.resolve().then(n)));function n(){return e.status=y,e}}function j(e,t){return Promise.resolve().then(()=>{if(e.status!==v)return e;return e.status=A,Promise.all(Object.keys(e.parcels).map(t=>e.parcels[t].unmountThisParcel())).then(n,o=>n().then(()=>{let n=Error(o.message);if(t)throw u(n,e,w);l(n,e,w)})).then(()=>e);function n(){return Q(e,"unmount").then(()=>{e.status=y},n=>{if(t)throw u(n,e,w);l(n,e,w)})}})}let R=!1,F=!1;function L(e,t){return Promise.resolve().then(()=>e.status!==y?e:(R||(window.dispatchEvent(new i("single-spa:before-first-mount")),R=!0),e.status=b,Q(e,"mount").then(()=>(e.status=v,F||(window.dispatchEvent(new i("single-spa:first-mount")),F=!0),e)).catch(n=>{return e.status=v,j(e,!0).then(o,o);function o(){if(t)throw u(n,e,w);return l(n,e,w),e}})))}let W=0,V={parcels:{}};function G(){return U.apply(V,arguments)}function U(e,t){let n,o,a,r=this;if(!e||"object"!=typeof e&&"function"!=typeof e)throw Error(d(2,!1));if(e.name&&"string"!=typeof e.name)throw Error(d(3,!1,typeof e.name));let i=W++,s=e.name||`parcel-${i}`;if("object"!=typeof t)throw Error(d(4,!1,s,typeof t));if(!t.domElement)throw Error(d(5,!1,s));let l="function"==typeof e,p=l?e:()=>Promise.resolve(e),c={id:i,parcels:{},status:l?h:m,customProps:t,parentName:S(r),unmountThisParcel:()=>b.then(()=>{if(c.status!==v)throw Error(d(6,!1,s,c.status));return j(c,!0)}).then(e=>(c.parentName&&delete r.parcels[c.id],e)).then(e=>(o(e),e)).catch(e=>{throw c.status=w,a(e),e})};r.parcels[i]=c;let f=p();if(!f||"function"!=typeof f.then)throw Error(d(7,!1));let g=(f=f.then(e=>{if(!e)throw Error(d(8,!1));if(s=e.name||`parcel-${i}`,Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!N(e.bootstrap))throw Error(d(9,!1,s));if(!N(e.mount))throw Error(d(10,!1,s));if(!N(e.unmount))throw Error(d(11,!1,s));if(e.update&&!N(e.update))throw Error(d(12,!1,s));let t=T(e,"bootstrap"),o=T(e,"mount"),a=T(e,"unmount");c.status=m,c.name=s,c.bootstrap=t,c.mount=o,c.unmount=a,c.timeouts=ee(e.timeouts),e.update&&(c.update=T(e,"update"),n.update=function(e){return c.customProps=e,q(Promise.resolve().then(()=>{if(c.status!==v)throw Error(d(32,!1,S(c)));return c.status=$,Q(c,"update").then(()=>(c.status=v,c)).catch(e=>{throw u(e,c,w)})}))})})).then(()=>I(c,!0)),b=g.then(()=>L(c,!0)),A=new Promise((e,t)=>{o=e,a=t});return n={mount:()=>q(Promise.resolve().then(()=>{if(c.status!==y)throw Error(d(13,!1,s,c.status));return r.parcels[i]=c,L(c)})),unmount:()=>q(c.unmountThisParcel()),getStatus:()=>c.status,loadPromise:q(f),bootstrapPromise:q(g),mountPromise:q(b),unmountPromise:q(A)}}function q(e){return e.then(()=>null)}function H(e){let t=S(e),n="function"==typeof e.customProps?e.customProps(t,window.location):e.customProps;("object"!=typeof n||null===n||Array.isArray(n))&&(n={},console.warn(d(40,!1),t,n));let o=P({},n,{name:t,mountParcel:U.bind(e),singleSpa:a});return z(e)&&(o.unmountSelf=e.unmountThisParcel),o}let K={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}};function Z(e,t,n){if("number"!=typeof e||e<=0)throw Error(d(16,!1));K.bootstrap={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function Y(e,t,n){if("number"!=typeof e||e<=0)throw Error(d(17,!1));K.mount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function J(e,t,n){if("number"!=typeof e||e<=0)throw Error(d(18,!1));K.unmount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function X(e,t,n){if("number"!=typeof e||e<=0)throw Error(d(19,!1));K.unload={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function Q(e,t){let n=e.timeouts[t],o=n.warningMillis,a=D(e);return new Promise((r,i)=>{let s=!1,l=!1;e[t](H(e)).then(e=>{s=!0,r(e)}).catch(e=>{s=!0,i(e)}),setTimeout(()=>c(1),o),setTimeout(()=>c(!0),n.millis);let p=d(31,!1,t,a,S(e),n.millis);function c(e){s||(!0===e?(l=!0,n.dieOnTimeout?i(Error(p)):console.error(p)):!l&&(console.warn(p),e*o+o<n.millis&&setTimeout(()=>c(e+1),o)))}})}function ee(e){let t={};for(let n in K)t[n]=P({},K[n],e&&e[n]||{});return t}function et(e){return Promise.resolve().then(()=>{let t,n;return e.loadPromise?e.loadPromise:e.status!==f&&e.status!==x?e:(e.status=h,e.loadPromise=Promise.resolve().then(()=>{let o=e.loadApp(H(e));if(!B(o))throw n=!0,Error(d(33,!1,S(e)));return o.then(n=>{let o;e.loadErrorTime=null,"object"!=typeof(t=n)&&(o=34),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!N(t.bootstrap)&&(o=35),N(t.mount)||(o=36),N(t.unmount)||(o=37);let a=D(t);if(o){let n;try{n=JSON.stringify(t)}catch(e){}return console.error(d(o,!1,a,S(e),n),t),l(void 0,e,w),e}return t.devtools&&t.devtools.overlays&&(e.devtools.overlays=P({},e.devtools.overlays,t.devtools.overlays)),e.status=m,e.bootstrap=T(t,"bootstrap"),e.mount=T(t,"mount"),e.unmount=T(t,"unmount"),e.unload=T(t,"unload"),e.timeouts=ee(t.timeouts),delete e.loadPromise,e})}).catch(t=>{let o;return delete e.loadPromise,n?o=w:(o=x,e.loadErrorTime=(new Date).getTime()),l(t,e,o),e}))})}let en="u">typeof window,eo={hashchange:[],popstate:[]},ea=["hashchange","popstate"];function er(e){let t;if("string"==typeof e)t=e;else if(this&&this.href)t=this.href;else{if(!(e&&e.currentTarget&&e.currentTarget.href&&e.preventDefault))throw Error(d(14,!1));t=e.currentTarget.href,e.preventDefault()}let n=eu(window.location.href),o=eu(t);0===t.indexOf("#")?window.location.hash=o.hash:n.host!==o.host&&o.host?window.location.href=t:o.pathname===n.pathname&&o.search===n.search?window.location.hash=o.hash:window.history.pushState(null,null,t)}function ei(e){if(e){let t=e[0].type;ea.indexOf(t)>=0&&eo[t].forEach(t=>{try{t.apply(this,e)}catch(e){setTimeout(()=>{throw e})}})}}function es(){eO([],arguments)}function el(e,t){return function(){let n=window.location.href,a=e.apply(this,arguments),r=window.location.href;return o&&n===r||window.dispatchEvent(function(e,t){let n;try{n=new PopStateEvent("popstate",{state:e})}catch(t){(n=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,e)}return n.singleSpa=!0,n.singleSpaTrigger=t,n}(window.history.state,t)),a}}let ep=null,ec=!1;function ed(e){if(ec)throw Error(d(43,!1));o=!e||!e.hasOwnProperty("urlRerouteOnly")||e.urlRerouteOnly,ec=!0,ep=window.history.replaceState,window.addEventListener("hashchange",es),window.addEventListener("popstate",es);let t=window.addEventListener,n=window.removeEventListener;window.addEventListener=function(e,n){if(!("function"==typeof n&&ea.indexOf(e)>=0)||M(eo[e],e=>e===n))return t.apply(this,arguments);eo[e].push(n)},window.removeEventListener=function(e,t){return"function"==typeof t&&ea.indexOf(e)>=0&&(eo[e]=eo[e].filter(e=>e!==t)),n.apply(this,arguments)},window.history.pushState=el(window.history.pushState,"pushState"),window.history.replaceState=el(ep,"replaceState")}function eu(e){let t=document.createElement("a");return t.href=e,t}en&&(window.singleSpaNavigate?console.warn(d(41,!1)):window.singleSpaNavigate=er);let ef=!1;function eh(e=window.jQuery){if(e||window.$&&window.$.fn&&window.$.fn.jquery&&(e=window.$),e&&!ef){let t=e.fn.on,n=e.fn.off;e.fn.on=function(e,n){return em.call(this,t,window.addEventListener,e,n,arguments)},e.fn.off=function(e,t){return em.call(this,n,window.removeEventListener,e,t,arguments)},ef=!0}}function em(e,t,n,o,a){return"string"!=typeof n?e.apply(this,a):(n.split(/\s+/).forEach(e=>{ea.indexOf(e)>=0&&(t(e,o),n=n.replace(e,""))}),""===n.trim()?this:e.apply(this,a))}let e_={};function eg(e){return Promise.resolve().then(()=>{let t=e_[S(e)];if(!t)return e;if(e.status===f)return ey(e,t),e;if(e.status===k)return t.promise.then(()=>e);if(e.status!==y&&e.status!==x)return e;let n=e.status===x?Promise.resolve():Q(e,"unload");return e.status=k,n.then(()=>(ey(e,t),e)).catch(n=>(delete e_[S(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,l(n,e,w),t.reject(n),e))})}function ey(e,t){delete e_[S(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,e.status=f,t.resolve()}function eb(e,t,n,o){e_[S(e)]={app:e,resolve:n,reject:o},Object.defineProperty(e_[S(e)],"promise",{get:t})}let ev=[];function e$(){return ev.filter(C).map(S)}function eA(){return ev.map(S)}function ek(e){let t=M(ev,t=>S(t)===e);return t?t.status:null}let ex=!1;function ew(e,t,n,o){var a,r;let i,s,l=(i={name:null,loadApp:null,activeWhen:null,customProps:null},"object"==typeof e?(function(e){if(Array.isArray(e)||null===e)throw Error(d(39,!1));let t=["name","app","activeWhen","customProps"],n=Object.keys(e).reduce((e,n)=>t.indexOf(n)>=0?e:e.concat(n),[]);if(0!==n.length)throw Error(d(38,!1,t.join(", "),n.join(", ")));if("string"!=typeof e.name||0===e.name.length||"object"!=typeof e.app&&"function"!=typeof e.app)throw Error(d(20,!1));let o=e=>"string"==typeof e||"function"==typeof e;if(!(o(e.activeWhen)||Array.isArray(e.activeWhen)&&e.activeWhen.every(o)))throw Error(d(24,!1));if(!eD(e.customProps))throw Error(d(22,!1))}(e),i.name=e.name,i.loadApp=e.app,i.activeWhen=e.activeWhen,i.customProps=e.customProps):(function(e,t,n,o){if("string"!=typeof e||0===e.length)throw Error(d(20,!1));if(!t)throw Error(d(23,!1));if("function"!=typeof n)throw Error(d(24,!1));if(!eD(o))throw Error(d(22,!1))}(e,t,n,o),i.name=e,i.loadApp=t,i.activeWhen=n,i.customProps=o),i.loadApp="function"!=typeof(a=i.loadApp)?()=>Promise.resolve(a):a,i.customProps=i.customProps||{},s=(s=Array.isArray(r=i.activeWhen)?r:[r]).map(e=>"function"==typeof e?e:eP(e)),i.activeWhen=e=>s.some(t=>t(e)),i);if(ej||ex||(ex=!0,setTimeout(()=>{ej||console.warn(d(1,!1))},5e3)),-1!==eA().indexOf(l.name))throw Error(d(21,!1,l.name));ev.push(P({loadErrorTime:null,status:f,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},l)),en&&(eh(),eO())}function eC(e=window.location){return ev.filter(t=>t.activeWhen(e)).map(S)}function eE(e){if(0===ev.filter(t=>S(t)===e).length)throw Error(d(25,!1,e));return(en?eS(e,{waitForUnmount:!1}):Promise.resolve()).then(()=>{let t=ev.map(S).indexOf(e);ev.splice(t,1)})}function eS(e,t={waitForUnmount:!1}){if("string"!=typeof e)throw Error(d(26,!1));let n=M(ev,t=>S(t)===e);if(!n)throw Error(d(27,!1,e));let o=e_[S(n)];if(t&&t.waitForUnmount){if(o)return o.promise;{let e=new Promise((t,o)=>{eb(n,()=>e,t,o)});return e}}{let e;return o?(e=o.promise,ez(n,o.resolve,o.reject)):e=new Promise((t,o)=>{eb(n,()=>e,t,o),ez(n,t,o)}),e}}function ez(e,t,n){Promise.resolve().then(()=>{if(M(eC(),t=>t===S(e)))return eB()}).then(()=>j(e).then(eg).then(()=>{t(),setTimeout(()=>{eO()})})).catch(n)}function eD(e){return!e||"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)}function eP(e,t){let n=function(e,t){let n=0,o=!1,a="^";"/"!==e[0]&&(e="/"+e);for(let t=0;t<e.length;t++){let n=e[t],a=o&&"/"===n;(!o&&":"===n||a)&&r(t)}return r(e.length),RegExp(a,"i");function r(r){let i=e.slice(n,r).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(a+=o?"[^/]+/?":i,r===e.length)if(o)t&&(a+="$");else{let e=t?"":".*";a="/"===a.charAt(a.length-1)?`${a}${e}$`:`${a}(/${e})?(#.*)?$`}o=!o,n=r}}(e,t);return e=>{let t=e.origin;t||(t=`${e.protocol}//${e.host}`);let o=e.href.replace(t,"").replace(e.search,"").split("?")[0];return n.test(o)}}let eM=!1,eN=[],eT=en&&window.location.href;function eB(){return eO()}function eO(e=[],t,n=!1){let o,a,r,s,l;if(eM)return new Promise((e,n)=>{eN.push({resolve:e,reject:n,eventArguments:t})});let{appsToUnload:p,appsToUnmount:c,appsToLoad:u,appsToMount:g}=(o=[],a=[],r=[],s=[],l=(new Date).getTime(),ev.forEach(e=>{let t=e.status!==w&&E(e);switch(e.status){case x:t&&l-e.loadErrorTime>=200&&r.push(e);break;case f:case h:t&&r.push(e);break;case m:case y:!t&&e_[S(e)]?o.push(e):t&&s.push(e);break;case v:t||a.push(e)}}),{appsToUnload:o,appsToUnmount:a,appsToLoad:r,appsToMount:s}),b,$=[],A=eT,k=eT=window.location.href;return ej?(eM=!0,b=p.concat(u,c,g),Promise.resolve().then(()=>(N(0===b.length?"before-no-app-change":"before-app-change",M(!0)),N("before-routing-event",M(!0,{cancelNavigation:C})),Promise.all($).then(n=>{if(n.some(e=>e))return ep.call(window.history,history.state,"",A.substring(location.origin.length)),eT=location.href,eM=!1,eO(e,t,!0);let o=p.map(eg),a=Promise.all(c.map(j).map(e=>e.then(eg)).concat(o));a.then(()=>{N("before-mount-routing-event",M(!0))},e=>{throw e});let r=u.map(e=>et(e).then(e=>eI(e,a))),i=g.filter(e=>0>u.indexOf(e)).map(e=>eI(e,a));return a.catch(e=>{throw D(),e}).then(()=>(D(),Promise.all(r.concat(i)).catch(t=>{throw e.forEach(e=>e.reject(t)),t}).then(z).then(()=>{},e=>{throw e})))})))):(b=u,Promise.resolve().then(()=>Promise.all(u.map(et)).then(D).then(()=>[]).catch(e=>{throw D(),e}).finally(()=>{})));function C(e=!0){let t="function"==typeof(null==e?void 0:e.then)?e:Promise.resolve(e);$.push(t.catch(e=>(console.warn(Error(d(42,!1))),console.warn(e),!1)))}function z(){let t=e$();e.forEach(e=>e.resolve(t));try{N(0===b.length?"no-app-change":"app-change",M()),N("routing-event",M())}catch(e){setTimeout(()=>{throw e})}if(eM=!1,eN.length>0){let e=eN;eN=[],eO(e)}return t}function D(){n||(e.forEach(e=>{ei(e.eventArguments)}),ei(t))}function M(e=!1,n){let o={},a={[v]:[],[y]:[],[f]:[],[w]:[]};e?(u.concat(g).forEach((e,t)=>{i(e,v)}),p.forEach(e=>{i(e,f)}),c.forEach(e=>{i(e,y)})):b.forEach(e=>{i(e)});let r={detail:{newAppStatuses:o,appsByNewStatus:a,totalAppChanges:b.length,originalEvent:null==t?void 0:t[0],oldUrl:A,newUrl:k}};return n&&P(r.detail,n),r;function i(e,t){let n=S(e);t=t||ek(n),o[n]=t,(a[t]=a[t]||[]).push(n)}}function N(e,t){n||window.dispatchEvent(new i(`single-spa:${e}`,t))}}function eI(e,t){return E(e)?I(e).then(e=>t.then(()=>E(e)?L(e):e)):t.then(()=>e)}let ej=!1;function eR(e){ej=!0,en&&(ed(e),eO())}en&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods={getRawAppData:function(){return[...ev]},reroute:eO,NOT_LOADED:f,toLoadPromise:et,toBootstrapPromise:I,unregisterApplication:eE,getProfilerData:function(){return O}})},43132(e,t,n){"use strict";n.d(t,{y:()=>a});let o=e=>{let t,n=new Set,o=(e,o)=>{let a="function"==typeof e?e(t):e;if(!Object.is(a,t)){let e=t;t=(null!=o?o:"object"!=typeof a||null===a)?a:Object.assign({},t,a),n.forEach(n=>n(t,e))}},a=()=>t,r={setState:o,getState:a,getInitialState:()=>i,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()}},i=t=e(o,a,r);return r},a=e=>e?o(e):o}}]);