@openmrs/esm-billing-app 1.3.2-pre.2052 → 1.3.2-pre.2056

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/3525.js CHANGED
@@ -1,4 +1,4 @@
1
- (globalThis.webpackChunk_openmrs_esm_billing_app=globalThis.webpackChunk_openmrs_esm_billing_app||[]).push([["3525"],{7581(e){e.exports=function(e,t,r){t.prototype.isToday=function(){var e="YYYY-MM-DD",t=r();return this.format(e)===t.format(e)}}},5238(e){e.exports=function(e,t,r){var n=t.prototype,i=function(e){var t=e.date,i=e.utc,o={};if(!(null===t||t instanceof Date||t instanceof Array||n.$utils().u(t)||"Object"!==t.constructor.name)){if(!Object.keys(t).length)return new Date;var a=i?r.utc():r();Object.keys(t).forEach(function(e){var r;o["date"===(r=n.$utils().p(e))?"day":r]=t[e]});var s=o.day||(o.year||o.month>=0?1:a.date()),l=o.year||a.year(),u=o.month>=0?o.month:o.year||o.day?0:a.month(),c=o.hour||0,d=o.minute||0,p=o.second||0,f=o.millisecond||0;return i?new Date(Date.UTC(l,u,s,c,d,p,f)):new Date(l,u,s,c,d,p,f)}return t},o=n.parse;n.parse=function(e){e.date=i.bind(this)(e),o.bind(this)(e)};var a=n.set,s=n.add,l=n.subtract,u=function(e,t,r,n){void 0===n&&(n=1);var i=Object.keys(t),o=this;return i.forEach(function(r){o=e.bind(o)(t[r]*n,r)}),o};n.set=function(e,t){return t=void 0===t?e:t,"Object"===e.constructor.name?u.bind(this)(function(e,t){return a.bind(this)(t,e)},t,e):a.bind(this)(e,t)},n.add=function(e,t){return"Object"===e.constructor.name?u.bind(this)(s,e,t):s.bind(this)(e,t)},n.subtract=function(e,t){return"Object"===e.constructor.name?u.bind(this)(s,e,t,-1):l.bind(this)(e,t)}}},3826(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,i,o){var a=i.prototype;o.utc=function(e){var t={date:e,utc:!0,args:arguments};return new i(t)},a.utc=function(t){var r=o(this.toDate(),{locale:this.$L,utc:!0});return t?r.add(this.utcOffset(),e):r},a.local=function(){return o(this.toDate(),{locale:this.$L,utc:!1})};var s=a.parse;a.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var l=a.init;a.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else l.call(this)};var u=a.utcOffset;a.utcOffset=function(n,i){var o=this.$utils().u;if(o(n))return this.$u?0:o(this.$offset)?u.call(this):this.$offset;if("string"==typeof n&&null===(n=function(e){void 0===e&&(e="");var n=e.match(t);if(!n)return null;var i=(""+n[0]).match(r)||["-",0,0],o=i[0],a=60*i[1]+ +i[2];return 0===a?0:"+"===o?a:-a}(n)))return this;var a=16>=Math.abs(n)?60*n:n,s=this;if(i)return s.$offset=a,s.$u=0===n,s;if(0!==n){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(s=this.local().add(a+l,e)).$offset=a,s.$x.$localOffset=l}else s=this.utc();return s};var c=a.format;a.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return c.call(this,t)},a.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var d=a.toDate;a.toDate=function(e){return"s"===e&&this.$offset?o(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var p=a.diff;a.diff=function(e,t,r){if(e&&this.$u===e.$u)return p.call(this,e,t,r);var n=this.local(),i=o(e).local();return p.call(n,i,t,r)}}}()},2849(e){var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString;function n(e){if(!e||"[object Object]"!==r.call(e)||e.nodeType||e.setInterval)return!1;var n,i=t.call(e,"constructor"),o=t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(n in e);return void 0===n||t.call(e,n)}e.exports=function e(){var t,r,i,o,a,s,l=arguments[0]||{},u=1,c=arguments.length,d=!1;for("boolean"==typeof l&&(d=l,l=arguments[1]||{},u=2),"object"!=typeof l&&"function"!=typeof l&&(l={});u<c;u++)if(null!=(t=arguments[u]))for(r in t)i=l[r],l!==(o=t[r])&&(d&&o&&(n(o)||(a=Array.isArray(o)))?(a?(a=!1,s=i&&Array.isArray(i)?i:[]):s=i&&n(i)?i:{},l[r]=e(d,s,o)):void 0!==o&&(l[r]=o));return l}},6767(e,t,r){!function(t){"use strict";var n=r(6974);function i(e){return function(t,r){return"object"==typeof t&&(r=t,t=null),null==t&&(t=new Date().toString()),r||(r={}),e.call(this,t,r)}}var o=e.exports={generate:i(function(e,t){return new n(e,t)})};t&&(t.fn.geopattern=i(function(e,r){return this.each(function(){var n=t(this).attr("data-title-sha");n&&(r=t.extend({hash:n},r));var i=o.generate(e,r);t(this).css("background-image",i.toDataUrl())})}))}("u">typeof jQuery?jQuery:null)},2467(e){"use strict";e.exports={hex2rgb:function(e){e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(e,t,r,n){return t+t+r+r+n+n});var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null},rgb2hex:function(e){return"#"+["r","g","b"].map(function(t){return("0"+e[t].toString(16)).slice(-2)}).join("")},rgb2hsl:function(e){var t,r,n=e.r,i=e.g,o=e.b,a=Math.max(n/=255,i/=255,o/=255),s=Math.min(n,i,o),l=(a+s)/2;if(a===s)t=r=0;else{var u=a-s;switch(r=l>.5?u/(2-a-s):u/(a+s),a){case n:t=(i-o)/u+6*(i<o);break;case i:t=(o-n)/u+2;break;case o:t=(n-i)/u+4}t/=6}return{h:t,s:r,l:l}},hsl2rgb:function(e){function t(e,t,r){return(r<0&&(r+=1),r>1&&(r-=1),r<1/6)?e+(t-e)*6*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}var r,n,i,o=e.h,a=e.s,s=e.l;if(0===a)r=n=i=s;else{var l=s<.5?s*(1+a):s+a-s*a,u=2*s-l;r=t(u,l,o+1/3),n=t(u,l,o),i=t(u,l,o-1/3)}return{r:Math.round(255*r),g:Math.round(255*n),b:Math.round(255*i)}},rgb2rgbString:function(e){return"rgb("+[e.r,e.g,e.b].join(",")+")"}}},6974(e,t,r){"use strict";var n=r(2849),i=r(2467),o=r(6743),a=r(8502),s={baseColor:"#933c3c"},l=["octogons","overlappingCircles","plusSigns","xes","sineWaves","hexagons","overlappingRings","plaid","triangles","squares","concentricCircles","diamonds","tessellation","nestedSquares","mosaicSquares","chevrons"],u="#000";function c(e,t,r){return parseInt(e.substr(t,r||1),16)}function d(e,t,r,n,i){return(parseFloat(e)-t)*(i-n)/(r-t)+n}function p(e){return e%2==0?"#ddd":"#222"}function f(e){return d(e,0,15,.02,.15)}var h=e.exports=function(e,t){return this.opts=n({},s,t),this.hash=t.hash||o(e),this.svg=new a,this.generateBackground(),this.generatePattern(),this};function m(e){return[[e,0,e,3*e],[0,e,3*e,e]]}function y(e){return[0,0,e,e,0,e,0,0].join(",")}function g(e,t,r,n,i){var o=y(n),a=f(i[0]),s=p(i[0]),l={stroke:u,"stroke-opacity":.02,"fill-opacity":a,fill:s};e.polyline(o,l).transform({translate:[t+n,r],scale:[-1,1]}),e.polyline(o,l).transform({translate:[t+n,r+2*n],scale:[1,-1]}),l={stroke:u,"stroke-opacity":.02,"fill-opacity":a=f(i[1]),fill:s=p(i[1])},e.polyline(o,l).transform({translate:[t+n,r+2*n],scale:[-1,-1]}),e.polyline(o,l).transform({translate:[t+n,r],scale:[1,1]})}function b(e,t,r,n,i){var o=f(i),a=p(i),s=y(n),l={stroke:u,"stroke-opacity":.02,"fill-opacity":o,fill:a};e.polyline(s,l).transform({translate:[t,r+n],scale:[1,-1]}),e.polyline(s,l).transform({translate:[t+2*n,r+n],scale:[-1,-1]}),e.polyline(s,l).transform({translate:[t,r+n],scale:[1,1]}),e.polyline(s,l).transform({translate:[t+2*n,r+n],scale:[-1,1]})}h.prototype.toSvg=function(){return this.svg.toString()},h.prototype.toString=function(){return this.toSvg()},h.prototype.toBase64=function(){var e=this.toSvg();return"u">typeof window&&"function"==typeof window.btoa?window.btoa(e):new Buffer(e).toString("base64")},h.prototype.toDataUri=function(){return"data:image/svg+xml;base64,"+this.toBase64()},h.prototype.toDataUrl=function(){return'url("'+this.toDataUri()+'")'},h.prototype.generateBackground=function(){var e,t,r,n;this.opts.color?r=i.hex2rgb(this.opts.color):(t=d(c(this.hash,14,3),0,4095,0,359),n=c(this.hash,17),(e=i.rgb2hsl(i.hex2rgb(this.opts.baseColor))).h=(360*e.h-t+360)%360/360,n%2==0?e.s=Math.min(1,(100*e.s+n)/100):e.s=Math.max(0,(100*e.s-n)/100),r=i.hsl2rgb(e)),this.color=i.rgb2hex(r),this.svg.rect(0,0,"100%","100%",{fill:i.rgb2rgbString(r)})},h.prototype.generatePattern=function(){var e=this.opts.generator;if(e){if(0>l.indexOf(e))throw Error("The generator "+e+" does not exist.")}else e=l[c(this.hash,20)];return this["geo"+e.slice(0,1).toUpperCase()+e.slice(1)]()},h.prototype.geoHexagons=function(){var e,t,r,n,i,o,a,s,l,h=d(c(this.hash,0),0,15,8,60),m=h*Math.sqrt(3),y=2*h,g=(s=h/2,[0,l=Math.sin(60*Math.PI/180)*h,s,0,s+h,0,2*h,l,s+h,2*l,s,2*l,0,l].join(","));for(this.svg.setWidth(3*y+3*h),this.svg.setHeight(6*m),t=0,a=0;a<6;a++)for(o=0;o<6;o++)i=c(this.hash,t),e=o%2==0?a*m:a*m+m/2,r=f(i),n={fill:p(i),"fill-opacity":r,stroke:u,"stroke-opacity":.02},this.svg.polyline(g,n).transform({translate:[o*h*1.5-y/2,e-m/2]}),0===o&&this.svg.polyline(g,n).transform({translate:[6*h*1.5-y/2,e-m/2]}),0===a&&(e=o%2==0?6*m:6*m+m/2,this.svg.polyline(g,n).transform({translate:[o*h*1.5-y/2,e-m/2]})),0===o&&0===a&&this.svg.polyline(g,n).transform({translate:[6*h*1.5-y/2,5*m+m/2]}),t++},h.prototype.geoSineWaves=function(){var e,t,r,n,i,o,a,s=Math.floor(d(c(this.hash,0),0,15,100,400)),l=Math.floor(d(c(this.hash,1),0,15,30,100)),u=Math.floor(d(c(this.hash,2),0,15,3,30));for(this.svg.setWidth(s),this.svg.setHeight(36*u),t=0;t<36;t++)r=f(o=c(this.hash,t)),e=p(o),a=s/4*.7,i={fill:"none",stroke:e,opacity:r,"stroke-width":""+u+"px"},n="M0 "+l+" C "+a+" 0, "+(s/2-a)+" 0, "+s/2+" "+l+" S "+(s-a)+" "+2*l+", "+s+" "+l+" S "+(1.5*s-a)+" 0, "+1.5*s+", "+l,this.svg.path(n,i).transform({translate:[-s/4,u*t-1.5*l]}),this.svg.path(n,i).transform({translate:[-s/4,u*t-1.5*l+36*u]})},h.prototype.geoChevrons=function(){var e,t,r,n,i,o,a,s=d(c(this.hash,0),0,15,30,80),l=d(c(this.hash,0),0,15,30,80),h=(e=.66*l,[[0,0,s/2,l-e,s/2,l,0,e,0,0],[s/2,l-e,s,0,s,e,s/2,l,s/2,l-e]].map(function(e){return e.join(",")}));for(this.svg.setWidth(6*s),this.svg.setHeight(6*l*.66),t=0,a=0;a<6;a++)for(o=0;o<6;o++)r=f(i=c(this.hash,t)),n={stroke:u,"stroke-opacity":.02,fill:p(i),"fill-opacity":r,"stroke-width":1},this.svg.group(n).transform({translate:[o*s,a*l*.66-l/2]}).polyline(h).end(),0===a&&this.svg.group(n).transform({translate:[o*s,6*l*.66-l/2]}).polyline(h).end(),t+=1},h.prototype.geoPlusSigns=function(){var e,t,r,n,i,o,a,s,l=d(c(this.hash,0),0,15,10,25),h=3*l,y=m(l);for(this.svg.setWidth(12*l),this.svg.setHeight(12*l),r=0,s=0;s<6;s++)for(a=0;a<6;a++)n=f(o=c(this.hash,r)),t=p(o),e=+(s%2!=0),i={fill:t,stroke:u,"stroke-opacity":.02,"fill-opacity":n},this.svg.group(i).transform({translate:[a*h-a*l+e*l-l,s*h-s*l-h/2]}).rect(y).end(),0===a&&this.svg.group(i).transform({translate:[4*h-a*l+e*l-l,s*h-s*l-h/2]}).rect(y).end(),0===s&&this.svg.group(i).transform({translate:[a*h-a*l+e*l-l,4*h-s*l-h/2]}).rect(y).end(),0===a&&0===s&&this.svg.group(i).transform({translate:[4*h-a*l+e*l-l,4*h-s*l-h/2]}).rect(y).end(),r++},h.prototype.geoXes=function(){var e,t,r,n,i,o,a,s=d(c(this.hash,0),0,15,10,25),l=m(s),u=3*s*.943;for(this.svg.setWidth(3*u),this.svg.setHeight(3*u),t=0,a=0;a<6;a++)for(o=0;o<6;o++)r=f(i=c(this.hash,t)),e=o%2==0?a*u-.5*u:a*u-.5*u+u/4,n={fill:p(i),opacity:r},this.svg.group(n).transform({translate:[o*u/2-u/2,e-a*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),0===o&&this.svg.group(n).transform({translate:[6*u/2-u/2,e-a*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),0===a&&(e=o%2==0?6*u-u/2:6*u-u/2+u/4,this.svg.group(n).transform({translate:[o*u/2-u/2,e-6*u/2],rotate:[45,u/2,u/2]}).rect(l).end()),5===a&&this.svg.group(n).transform({translate:[o*u/2-u/2,e-11*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),0===o&&0===a&&this.svg.group(n).transform({translate:[6*u/2-u/2,e-6*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),t++},h.prototype.geoOverlappingCircles=function(){var e,t,r,n,i,o,a=d(c(this.hash,0),0,15,25,200)/2;for(this.svg.setWidth(6*a),this.svg.setHeight(6*a),e=0,o=0;o<6;o++)for(i=0;i<6;i++)t=f(n=c(this.hash,e)),r={fill:p(n),opacity:t},this.svg.circle(i*a,o*a,a,r),0===i&&this.svg.circle(6*a,o*a,a,r),0===o&&this.svg.circle(i*a,6*a,a,r),0===i&&0===o&&this.svg.circle(6*a,6*a,a,r),e++},h.prototype.geoOctogons=function(){var e,t,r,n,i,o,a,s=d(c(this.hash,0),0,15,10,60),l=[e=.33*s,0,s-e,0,s,e,s,s-e,s-e,s,e,s,0,s-e,0,e,e,0].join(",");for(this.svg.setWidth(6*s),this.svg.setHeight(6*s),r=0,a=0;a<6;a++)for(o=0;o<6;o++)n=f(i=c(this.hash,r)),t=p(i),this.svg.polyline(l,{fill:t,"fill-opacity":n,stroke:u,"stroke-opacity":.02}).transform({translate:[o*s,a*s]}),r+=1},h.prototype.geoSquares=function(){var e,t,r,n,i,o,a=d(c(this.hash,0),0,15,10,60);for(this.svg.setWidth(6*a),this.svg.setHeight(6*a),t=0,o=0;o<6;o++)for(i=0;i<6;i++)r=f(n=c(this.hash,t)),e=p(n),this.svg.rect(i*a,o*a,a,a,{fill:e,"fill-opacity":r,stroke:u,"stroke-opacity":.02}),t+=1},h.prototype.geoConcentricCircles=function(){var e,t,r,n,i,o,a=d(c(this.hash,0),0,15,10,60),s=a/5;for(this.svg.setWidth((a+s)*6),this.svg.setHeight((a+s)*6),t=0,o=0;o<6;o++)for(i=0;i<6;i++)r=f(n=c(this.hash,t)),e=p(n),this.svg.circle(i*a+i*s+(a+s)/2,o*a+o*s+(a+s)/2,a/2,{fill:"none",stroke:e,opacity:r,"stroke-width":s+"px"}),r=f(n=c(this.hash,39-t)),e=p(n),this.svg.circle(i*a+i*s+(a+s)/2,o*a+o*s+(a+s)/2,a/4,{fill:e,"fill-opacity":r}),t+=1},h.prototype.geoOverlappingRings=function(){var e,t,r,n,i,o,a=d(c(this.hash,0),0,15,10,60),s=a/4;for(this.svg.setWidth(6*a),this.svg.setHeight(6*a),e=0,o=0;o<6;o++)for(i=0;i<6;i++)t=f(n=c(this.hash,e)),r={fill:"none",stroke:p(n),opacity:t,"stroke-width":s+"px"},this.svg.circle(i*a,o*a,a-s/2,r),0===i&&this.svg.circle(6*a,o*a,a-s/2,r),0===o&&this.svg.circle(i*a,6*a,a-s/2,r),0===i&&0===o&&this.svg.circle(6*a,6*a,a-s/2,r),e+=1},h.prototype.geoTriangles=function(){var e,t,r,n,i,o,a,s,l=d(c(this.hash,0),0,15,15,80),h=l/2*Math.sqrt(3),m=[s=l/2,0,l,h,0,h,s,0].join(",");for(this.svg.setWidth(3*l),this.svg.setHeight(6*h),e=0,a=0;a<6;a++)for(o=0;o<6;o++)t=f(i=c(this.hash,e)),n={fill:p(i),"fill-opacity":t,stroke:u,"stroke-opacity":.02},r=a%2==0?180*(o%2==0):180*(o%2!=0),this.svg.polyline(m,n).transform({translate:[o*l*.5-l/2,h*a],rotate:[r,l/2,h/2]}),0===o&&this.svg.polyline(m,n).transform({translate:[6*l*.5-l/2,h*a],rotate:[r,l/2,h/2]}),e+=1},h.prototype.geoDiamonds=function(){var e,t,r,n,i,o,a,s=d(c(this.hash,0),0,15,10,50),l=d(c(this.hash,1),0,15,10,50),h=[s/2,0,s,l/2,s/2,l,0,l/2].join(",");for(this.svg.setWidth(6*s),this.svg.setHeight(3*l),t=0,a=0;a<6;a++)for(o=0;o<6;o++)r=f(i=c(this.hash,t)),n={fill:p(i),"fill-opacity":r,stroke:u,"stroke-opacity":.02},e=a%2==0?0:s/2,this.svg.polyline(h,n).transform({translate:[o*s-s/2+e,l/2*a-l/2]}),0===o&&this.svg.polyline(h,n).transform({translate:[6*s-s/2+e,l/2*a-l/2]}),0===a&&this.svg.polyline(h,n).transform({translate:[o*s-s/2+e,l/2*6-l/2]}),0===o&&0===a&&this.svg.polyline(h,n).transform({translate:[6*s-s/2+e,l/2*6-l/2]}),t+=1},h.prototype.geoNestedSquares=function(){var e,t,r,n,i,o,a=d(c(this.hash,0),0,15,4,12),s=7*a;for(this.svg.setWidth((s+a)*6+6*a),this.svg.setHeight((s+a)*6+6*a),e=0,o=0;o<6;o++)for(i=0;i<6;i++)t=f(n=c(this.hash,e)),r={fill:"none",stroke:p(n),opacity:t,"stroke-width":a+"px"},this.svg.rect(i*s+i*a*2+a/2,o*s+o*a*2+a/2,s,s,r),t=f(n=c(this.hash,39-e)),r={fill:"none",stroke:p(n),opacity:t,"stroke-width":a+"px"},this.svg.rect(i*s+i*a*2+a/2+2*a,o*s+o*a*2+a/2+2*a,3*a,3*a,r),e+=1},h.prototype.geoMosaicSquares=function(){var e,t,r,n=d(c(this.hash,0),0,15,15,50);for(this.svg.setWidth(8*n),this.svg.setHeight(8*n),e=0,r=0;r<4;r++)for(t=0;t<4;t++)t%2==0?r%2==0?b(this.svg,t*n*2,r*n*2,n,c(this.hash,e)):g(this.svg,t*n*2,r*n*2,n,[c(this.hash,e),c(this.hash,e+1)]):r%2==0?g(this.svg,t*n*2,r*n*2,n,[c(this.hash,e),c(this.hash,e+1)]):b(this.svg,t*n*2,r*n*2,n,c(this.hash,e)),e+=1},h.prototype.geoPlaid=function(){var e,t,r,n,i,o,a=0,s=0;for(t=0;t<36;)a+=c(this.hash,t)+5,r=f(o=c(this.hash,t+1)),e=p(o),n=o+5,this.svg.rect(0,a,"100%",n,{opacity:r,fill:e}),a+=n,t+=2;for(t=0;t<36;)s+=c(this.hash,t)+5,r=f(o=c(this.hash,t+1)),e=p(o),i=o+5,this.svg.rect(s,0,i,"100%",{opacity:r,fill:e}),s+=i,t+=2;this.svg.setWidth(s),this.svg.setHeight(a)},h.prototype.geoTessellation=function(){var e,t,r,n,i=d(c(this.hash,0),0,15,5,40),o=i*Math.sqrt(3),a=2*i,s=i/2*Math.sqrt(3),l=[0,0,s,i/2,0,i,0,0].join(","),h=3*i+2*s,m=2*o+2*i;for(this.svg.setWidth(h),this.svg.setHeight(m),e=0;e<20;e++)switch(t=f(n=c(this.hash,e)),r={stroke:u,"stroke-opacity":.02,fill:p(n),"fill-opacity":t,"stroke-width":1},e){case 0:this.svg.rect(-i/2,-i/2,i,i,r),this.svg.rect(h-i/2,-i/2,i,i,r),this.svg.rect(-i/2,m-i/2,i,i,r),this.svg.rect(h-i/2,m-i/2,i,i,r);break;case 1:this.svg.rect(a/2+s,o/2,i,i,r);break;case 2:this.svg.rect(-i/2,m/2-i/2,i,i,r),this.svg.rect(h-i/2,m/2-i/2,i,i,r);break;case 3:this.svg.rect(a/2+s,1.5*o+i,i,i,r);break;case 4:this.svg.polyline(l,r).transform({translate:[i/2,-i/2],rotate:[0,i/2,s/2]}),this.svg.polyline(l,r).transform({translate:[i/2,m- -i/2],rotate:[0,i/2,s/2],scale:[1,-1]});break;case 5:this.svg.polyline(l,r).transform({translate:[h-i/2,-i/2],rotate:[0,i/2,s/2],scale:[-1,1]}),this.svg.polyline(l,r).transform({translate:[h-i/2,m+i/2],rotate:[0,i/2,s/2],scale:[-1,-1]});break;case 6:this.svg.polyline(l,r).transform({translate:[h/2+i/2,o/2]});break;case 7:this.svg.polyline(l,r).transform({translate:[h-h/2-i/2,o/2],scale:[-1,1]});break;case 8:this.svg.polyline(l,r).transform({translate:[h/2+i/2,m-o/2],scale:[1,-1]});break;case 9:this.svg.polyline(l,r).transform({translate:[h-h/2-i/2,m-o/2],scale:[-1,-1]});break;case 10:this.svg.polyline(l,r).transform({translate:[i/2,m/2-i/2]});break;case 11:this.svg.polyline(l,r).transform({translate:[h-i/2,m/2-i/2],scale:[-1,1]});break;case 12:this.svg.rect(0,0,i,i,r).transform({translate:[i/2,i/2],rotate:[-30,0,0]});break;case 13:this.svg.rect(0,0,i,i,r).transform({scale:[-1,1],translate:[-h+i/2,i/2],rotate:[-30,0,0]});break;case 14:this.svg.rect(0,0,i,i,r).transform({translate:[i/2,m/2-i/2-i],rotate:[30,0,i]});break;case 15:this.svg.rect(0,0,i,i,r).transform({scale:[-1,1],translate:[-h+i/2,m/2-i/2-i],rotate:[30,0,i]});break;case 16:this.svg.rect(0,0,i,i,r).transform({scale:[1,-1],translate:[i/2,-m+m/2-i/2-i],rotate:[30,0,i]});break;case 17:this.svg.rect(0,0,i,i,r).transform({scale:[-1,-1],translate:[-h+i/2,-m+m/2-i/2-i],rotate:[30,0,i]});break;case 18:this.svg.rect(0,0,i,i,r).transform({scale:[1,-1],translate:[i/2,-m+i/2],rotate:[-30,0,0]});break;case 19:this.svg.rect(0,0,i,i,r).transform({scale:[-1,-1],translate:[-h+i/2,-m+i/2],rotate:[-30,0,0]})}}},6743(e){"use strict";function t(){var e=0x67452301,t=0xefcdab89,r=0x98badcfe,n=0x10325476,i=0xc3d2e1f0,o=new Uint32Array(80),a=0,s=24,l=0;function u(){for(var s,l,u=16;u<80;u++){var c=o[u-3]^o[u-8]^o[u-14]^o[u-16];o[u]=c<<1|c>>>31}var d=e,p=t,f=r,h=n,m=i;for(u=0;u<80;u++){u<20?(s=h^p&(f^h),l=0x5a827999):u<40?(s=p^f^h,l=0x6ed9eba1):u<60?(s=p&f|h&(p|f),l=0x8f1bbcdc):(s=p^f^h,l=0xca62c1d6);var y=(d<<5|d>>>27)+s+m+l+(0|o[u]);m=h,h=f,f=p<<30|p>>>2,p=d,d=y}for(u=0,e=e+d|0,t=t+p|0,r=r+f|0,n=n+h|0,i=i+m|0,a=0;u<16;u++)o[u]=0}function c(e){o[a]|=(255&e)<<s,s?s-=8:(a++,s=24),16===a&&u()}function d(e){for(var t="",r=28;r>=0;r-=4)t+=(e>>r&15).toString(16);return t}return{update:function(e){if("string"==typeof e){var t=e.length;l+=8*t;for(var r=0;r<t;r++)c(e.charCodeAt(r));return}var n=e.length;l+=8*n;for(var i=0;i<n;i++)c(e[i])},digest:function(){c(128),(a>14||14===a&&s<24)&&u(),a=14,s=24,c(0),c(0),c(l>0xffffffffff?l/0x10000000000:0),c(l>0xffffffff?l/0x100000000:0);for(var o=24;o>=0;o-=8)c(l>>o);return d(e)+d(t)+d(r)+d(n)+d(i)}}}e.exports=function(e){if(void 0===e)return t();var r=t();return r.update(e),r.digest()}},8502(e,t,r){"use strict";var n=r(2849),i=r(6541);function o(){return this.width=100,this.height=100,this.svg=i("svg"),this.context=[],this.setAttributes(this.svg,{xmlns:"http://www.w3.org/2000/svg",width:this.width,height:this.height}),this}e.exports=o,o.prototype.currentContext=function(){return this.context[this.context.length-1]||this.svg},o.prototype.end=function(){return this.context.pop(),this},o.prototype.currentNode=function(){var e=this.currentContext();return e.lastChild||e},o.prototype.transform=function(e){return this.currentNode().setAttribute("transform",Object.keys(e).map(function(t){return t+"("+e[t].join(",")+")"}).join(" ")),this},o.prototype.setAttributes=function(e,t){Object.keys(t).forEach(function(r){e.setAttribute(r,t[r])})},o.prototype.setWidth=function(e){this.svg.setAttribute("width",Math.floor(e))},o.prototype.setHeight=function(e){this.svg.setAttribute("height",Math.floor(e))},o.prototype.toString=function(){return this.svg.toString()},o.prototype.rect=function(e,t,r,o,a){var s=this;if(Array.isArray(e))return e.forEach(function(e){s.rect.apply(s,e.concat(a))}),this;var l=i("rect");return this.currentContext().appendChild(l),this.setAttributes(l,n({x:e,y:t,width:r,height:o},a)),this},o.prototype.circle=function(e,t,r,o){var a=i("circle");return this.currentContext().appendChild(a),this.setAttributes(a,n({cx:e,cy:t,r:r},o)),this},o.prototype.path=function(e,t){var r=i("path");return this.currentContext().appendChild(r),this.setAttributes(r,n({d:e},t)),this},o.prototype.polyline=function(e,t){var r=this;if(Array.isArray(e))return e.forEach(function(e){r.polyline(e,t)}),this;var o=i("polyline");return this.currentContext().appendChild(o),this.setAttributes(o,n({points:e},t)),this},o.prototype.group=function(e){var t=i("g");return this.currentContext().appendChild(t),this.context.push(t),this.setAttributes(t,n({},e)),this}},6541(e){"use strict";var t=e.exports=function(e){return this instanceof t?(this.tagName=e,this.attributes=Object.create(null),this.children=[],this.lastChild=null,this):new t(e)};t.prototype.appendChild=function(e){return this.children.push(e),this.lastChild=e,this},t.prototype.setAttribute=function(e,t){return this.attributes[e]=t,this},t.prototype.toString=function(){var e=this;return["<",e.tagName,Object.keys(e.attributes).map(function(t){return[" ",t,'="',e.attributes[t],'"'].join("")}).join(""),">",e.children.map(function(e){return e.toString()}).join(""),"</",e.tagName,">"].join("")}},8067(e,t){"use strict";t.pathToRegexp=function(e,t={}){let{delimiter:u="/",end:c=!0,sensitive:d=!1,trailing:p=!0}=t,f=[],h=[];for(let c of function e(t,r){if(Array.isArray(t))for(let n of t)e(n,r);else r.push(t);return r}(e,[])){let e="object"==typeof c?c:function(e,t={}){let{encodePath:a=r}=t,u=[...e],c=[],d=0,p=0;function f(){let t="";if(n.test(u[d]))do t+=u[d++];while(i.test(u[d]));else if('"'===u[d]){let r=d;for(;d++<u.length;){if('"'===u[d]){d++,r=0;break}"\\"===u[d]&&d++,t+=u[d]}if(r)throw new l(`Unterminated quote at index ${r}`,e)}if(!t)throw new l(`Missing parameter name at index ${d}`,e);return t}for(;d<u.length;){let e=u[d],t=o[e];t?c.push({type:t,index:d++,value:e}):"\\"===e?c.push({type:"escape",index:d++,value:u[d++]}):":"===e?c.push({type:"param",index:d++,value:f()}):"*"===e?c.push({type:"wildcard",index:d++,value:f()}):c.push({type:"char",index:d++,value:e})}return c.push({type:"end",index:d,value:""}),new s(function t(r){let n=[];for(;;){let i=c[p++];if(i.type===r)break;if("char"===i.type||"escape"===i.type){let e=i.value,t=c[p];for(;"char"===t.type||"escape"===t.type;)e+=t.value,t=c[++p];n.push({type:"text",value:a(e)});continue}if("param"===i.type||"wildcard"===i.type){n.push({type:i.type,name:i.value});continue}if("{"===i.type){n.push({type:"group",tokens:t("}")});continue}throw new l(`Unexpected ${i.type} at index ${i.index}, expected ${r}`,e)}return n}("end"),e)}(c,t);for(let t of function* e(t,r,n){if(r===t.length)return yield n;let i=t[r];if("group"===i.type)for(let o of e(i.tokens,0,n.slice()))yield*e(t,r+1,o);else n.push(i);yield*e(t,r+1,n)}(e.tokens,0,[]))h.push(function(e,t,r,n){let i="",o="",s=!0;for(let d of e){if("text"===d.type){i+=a(d.value),o+=d.value,s||(s=d.value.includes(t));continue}if("param"===d.type||"wildcard"===d.type){var u,c;if(!s&&!o)throw new l(`Missing text before "${d.name}" ${d.type}`,n);"param"===d.type?i+=`(${u=t,(c=s?"":o).length<2?u.length<2?`[^${a(u+c)}]`:`(?:(?!${a(u)})[^${a(c)}])`:u.length<2?`(?:(?!${a(c)})[^${a(u)}])`:`(?:(?!${a(c)}|${a(u)})[\\s\\S])`}+)`:i+="([\\s\\S]+)",r.push(d),o="",s=!1;continue}}return i}(t,u,f,e.originalPath))}let m=`^(?:${h.join("|")})`;return p&&(m+=`(?:${a(u)}$)?`),{regexp:new RegExp(m+=c?"$":`(?=${a(u)}|$)`,d?"":"i"),keys:f}};let r=e=>e,n=/^[$_\p{ID_Start}]$/u,i=/^[$\u200c\u200d\p{ID_Continue}]$/u,o={"{":"{","}":"}","(":"(",")":")","[":"[","]":"]","+":"+","?":"?","!":"!"};function a(e){return e.replace(/[.+*?^${}()[\]|/\\]/g,"\\$&")}class s{constructor(e,t){this.tokens=e,this.originalPath=t}}class l extends TypeError{constructor(e,t){let r=e;t&&(r+=`: ${t}`),super(r+="; visit https://git.new/pathToRegexpError for info"),this.originalPath=t}}},5338(e,t,r){"use strict";var n=r(7643);t.createRoot=n.createRoot,t.hydrateRoot=n.hydrateRoot},9850(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(2888),a=r(3207);t.AsyncSubject=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.value=null,t.hasNext=!1,t.hasCompleted=!1,t}return i(t,e),t.prototype._subscribe=function(t){return this.hasError?(t.error(this.thrownError),a.Subscription.EMPTY):this.hasCompleted&&this.hasNext?(t.next(this.value),t.complete(),a.Subscription.EMPTY):e.prototype._subscribe.call(this,t)},t.prototype.next=function(e){this.hasCompleted||(this.value=e,this.hasNext=!0)},t.prototype.error=function(t){this.hasCompleted||e.prototype.error.call(this,t)},t.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&e.prototype.next.call(this,this.value),e.prototype.complete.call(this)},t}(o.Subject)},466(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(2888),a=r(6967);t.BehaviorSubject=function(e){function t(t){var r=e.call(this)||this;return r._value=t,r}return i(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),t.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return r&&!r.closed&&t.next(this._value),r},t.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(!this.closed)return this._value;throw new a.ObjectUnsubscribedError},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(o.Subject)},4470(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.InnerSubscriber=function(e){function t(t,r,n){var i=e.call(this)||this;return i.parent=t,i.outerValue=r,i.outerIndex=n,i.index=0,i}return i(t,e),t.prototype._next=function(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)},t.prototype._error=function(e){this.parent.notifyError(e,this),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(r(1396).Subscriber)},6765(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(453),o=r(7795),a=r(1576);(n=t.NotificationKind||(t.NotificationKind={})).NEXT="N",n.ERROR="E",n.COMPLETE="C",t.Notification=function(){function e(e,t,r){this.kind=e,this.value=t,this.error=r,this.hasValue="N"===e}return e.prototype.observe=function(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}},e.prototype.do=function(e,t,r){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return r&&r()}},e.prototype.accept=function(e,t,r){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,r)},e.prototype.toObservable=function(){switch(this.kind){case"N":return o.of(this.value);case"E":return a.throwError(this.error);case"C":return i.empty()}throw Error("unexpected notification kind value")},e.createNext=function(t){return void 0!==t?new e("N",t):e.undefinedValueNotification},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e.undefinedValueNotification=new e("N",void 0),e}()},2515(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4487),i=r(5158),o=r(6676),a=r(8173),s=r(3344);function l(e){if(e||(e=s.config.Promise||Promise),!e)throw Error("no Promise impl found");return e}t.Observable=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var n=this.operator,o=i.toSubscriber(e,t,r);if(n?o.add(n.call(o,this.source)):o.add(this.source||s.config.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),s.config.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){s.config.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),n.canReportError(e)?e.error(t):console.warn(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=l(t))(function(t,n){var i;i=r.subscribe(function(t){try{e(t)}catch(e){n(e),i&&i.unsubscribe()}},n,t)})},e.prototype._subscribe=function(e){var t=this.source;return t&&t.subscribe(e)},e.prototype[o.observable]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?this:a.pipeFromArray(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=l(e))(function(e,r){var n;t.subscribe(function(e){return n=e},function(e){return r(e)},function(){return e(n)})})},e.create=function(t){return new e(t)},e}()},2544(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3344),i=r(4163);t.empty={closed:!0,next:function(e){},error:function(e){if(n.config.useDeprecatedSynchronousErrorHandling)throw e;i.hostReportError(e)},complete:function(){}}},5905(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.OuterSubscriber=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.notifyNext=function(e,t,r,n,i){this.destination.next(t)},t.prototype.notifyError=function(e,t){this.destination.error(e)},t.prototype.notifyComplete=function(e){this.destination.complete()},t}(r(1396).Subscriber)},2173(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(2888),a=r(5677),s=r(3207),l=r(5495),u=r(6967),c=r(3601);t.ReplaySubject=function(e){function t(t,r,n){void 0===t&&(t=1/0),void 0===r&&(r=1/0);var i=e.call(this)||this;return i.scheduler=n,i._events=[],i._infiniteTimeWindow=!1,i._bufferSize=t<1?1:t,i._windowTime=r<1?1:r,r===1/0?(i._infiniteTimeWindow=!0,i.next=i.nextInfiniteTimeWindow):i.next=i.nextTimeWindow,i}return i(t,e),t.prototype.nextInfiniteTimeWindow=function(t){if(!this.isStopped){var r=this._events;r.push(t),r.length>this._bufferSize&&r.shift()}e.prototype.next.call(this,t)},t.prototype.nextTimeWindow=function(t){this.isStopped||(this._events.push(new d(this._getNow(),t)),this._trimBufferThenGetEvents()),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){var t,r=this._infiniteTimeWindow,n=r?this._events:this._trimBufferThenGetEvents(),i=this.scheduler,o=n.length;if(this.closed)throw new u.ObjectUnsubscribedError;if(this.isStopped||this.hasError?t=s.Subscription.EMPTY:(this.observers.push(e),t=new c.SubjectSubscription(this,e)),i&&e.add(e=new l.ObserveOnSubscriber(e,i)),r)for(var a=0;a<o&&!e.closed;a++)e.next(n[a]);else for(var a=0;a<o&&!e.closed;a++)e.next(n[a].value);return this.hasError?e.error(this.thrownError):this.isStopped&&e.complete(),t},t.prototype._getNow=function(){return(this.scheduler||a.queue).now()},t.prototype._trimBufferThenGetEvents=function(){for(var e=this._getNow(),t=this._bufferSize,r=this._windowTime,n=this._events,i=n.length,o=0;o<i&&!(e-n[o].time<r);)o++;return i>t&&(o=Math.max(o,i-t)),o>0&&n.splice(0,o),n},t}(o.Subject);var d=function(e,t){this.time=e,this.value=t}},3849(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Scheduler=function(){function e(t,r){void 0===r&&(r=e.now),this.SchedulerAction=t,this.now=r}return e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.SchedulerAction(this,e).schedule(r,t)},e.now=function(){return Date.now()},e}()},2888(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(2515),a=r(1396),s=r(3207),l=r(6967),u=r(3601),c=r(4421),d=function(e){function t(t){var r=e.call(this,t)||this;return r.destination=t,r}return i(t,e),t}(a.Subscriber);t.SubjectSubscriber=d;var p=function(e){function t(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return i(t,e),t.prototype[c.rxSubscriber]=function(){return new d(this)},t.prototype.lift=function(e){var t=new f(this,this);return t.operator=e,t},t.prototype.next=function(e){if(this.closed)throw new l.ObjectUnsubscribedError;if(!this.isStopped)for(var t=this.observers,r=t.length,n=t.slice(),i=0;i<r;i++)n[i].next(e)},t.prototype.error=function(e){if(this.closed)throw new l.ObjectUnsubscribedError;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,r=t.length,n=t.slice(),i=0;i<r;i++)n[i].error(e);this.observers.length=0},t.prototype.complete=function(){if(this.closed)throw new l.ObjectUnsubscribedError;this.isStopped=!0;for(var e=this.observers,t=e.length,r=e.slice(),n=0;n<t;n++)r[n].complete();this.observers.length=0},t.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},t.prototype._trySubscribe=function(t){if(!this.closed)return e.prototype._trySubscribe.call(this,t);throw new l.ObjectUnsubscribedError},t.prototype._subscribe=function(e){if(this.closed)throw new l.ObjectUnsubscribedError;return this.hasError?(e.error(this.thrownError),s.Subscription.EMPTY):this.isStopped?(e.complete(),s.Subscription.EMPTY):(this.observers.push(e),new u.SubjectSubscription(this,e))},t.prototype.asObservable=function(){var e=new o.Observable;return e.source=this,e},t.create=function(e,t){return new f(e,t)},t}(o.Observable);t.Subject=p;var f=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return i(t,e),t.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},t.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},t.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},t.prototype._subscribe=function(e){return this.source?this.source.subscribe(e):s.Subscription.EMPTY},t}(p);t.AnonymousSubject=f},3601(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.SubjectSubscription=function(e){function t(t,r){var n=e.call(this)||this;return n.subject=t,n.subscriber=r,n.closed=!1,n}return i(t,e),t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var r=t.indexOf(this.subscriber);-1!==r&&t.splice(r,1)}}},t}(r(3207).Subscription)},1396(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(3385),a=r(2544),s=r(3207),l=r(4421),u=r(3344),c=r(4163),d=function(e){function t(r,n,i){var o=e.call(this)||this;switch(o.syncErrorValue=null,o.syncErrorThrown=!1,o.syncErrorThrowable=!1,o.isStopped=!1,arguments.length){case 0:o.destination=a.empty;break;case 1:if(!r){o.destination=a.empty;break}if("object"==typeof r){r instanceof t?(o.syncErrorThrowable=r.syncErrorThrowable,o.destination=r,r.add(o)):(o.syncErrorThrowable=!0,o.destination=new p(o,r));break}default:o.syncErrorThrowable=!0,o.destination=new p(o,r,n,i)}return o}return i(t,e),t.prototype[l.rxSubscriber]=function(){return this},t.create=function(e,r,n){var i=new t(e,r,n);return i.syncErrorThrowable=!1,i},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},t}(s.Subscription);t.Subscriber=d;var p=function(e){function t(t,r,n,i){var s,l=e.call(this)||this;l._parentSubscriber=t;var u=l;return o.isFunction(r)?s=r:r&&(s=r.next,n=r.error,i=r.complete,r!==a.empty&&(u=Object.create(r),o.isFunction(u.unsubscribe)&&l.add(u.unsubscribe.bind(u)),u.unsubscribe=l.unsubscribe.bind(l))),l._context=u,l._next=s,l._error=n,l._complete=i,l}return i(t,e),t.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;u.config.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},t.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,r=u.config.useDeprecatedSynchronousErrorHandling;if(this._error)r&&t.syncErrorThrowable?this.__tryOrSetError(t,this._error,e):this.__tryOrUnsub(this._error,e),this.unsubscribe();else if(t.syncErrorThrowable)r?(t.syncErrorValue=e,t.syncErrorThrown=!0):c.hostReportError(e),this.unsubscribe();else{if(this.unsubscribe(),r)throw e;c.hostReportError(e)}}},t.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var r=function(){return e._complete.call(e._context)};u.config.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,r):this.__tryOrUnsub(r),this.unsubscribe()}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),u.config.useDeprecatedSynchronousErrorHandling)throw e;c.hostReportError(e)}},t.prototype.__tryOrSetError=function(e,t,r){if(!u.config.useDeprecatedSynchronousErrorHandling)throw Error("bad call");try{t.call(this._context,r)}catch(t){if(u.config.useDeprecatedSynchronousErrorHandling)return e.syncErrorValue=t,e.syncErrorThrown=!0,!0;return c.hostReportError(t),!0}return!1},t.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},t}(d);t.SafeSubscriber=p},3207(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4728),i=r(194),o=r(3385),a=r(1245);function s(e){return e.reduce(function(e,t){return e.concat(t instanceof a.UnsubscriptionError?t.errors:t)},[])}t.Subscription=function(){var e;function t(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return t.prototype.unsubscribe=function(){if(!this.closed){var e,r=this._parentOrParents,l=this._ctorUnsubscribe,u=this._unsubscribe,c=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,r instanceof t)r.remove(this);else if(null!==r)for(var d=0;d<r.length;++d)r[d].remove(this);if(o.isFunction(u)){l&&(this._unsubscribe=void 0);try{u.call(this)}catch(t){e=t instanceof a.UnsubscriptionError?s(t.errors):[t]}}if(n.isArray(c))for(var d=-1,p=c.length;++d<p;){var f=c[d];if(i.isObject(f))try{f.unsubscribe()}catch(t){e=e||[],t instanceof a.UnsubscriptionError?e=e.concat(s(t.errors)):e.push(t)}}if(e)throw new a.UnsubscriptionError(e)}},t.prototype.add=function(e){var r=e;if(!e)return t.EMPTY;switch(typeof e){case"function":r=new t(e);case"object":if(r===this||r.closed||"function"!=typeof r.unsubscribe)return r;if(this.closed)return r.unsubscribe(),r;if(!(r instanceof t)){var n=r;(r=new t)._subscriptions=[n]}break;default:throw Error("unrecognized teardown "+e+" added to Subscription.")}var i=r._parentOrParents;if(null===i)r._parentOrParents=this;else if(i instanceof t){if(i===this)return r;r._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return r;i.push(this)}var o=this._subscriptions;return null===o?this._subscriptions=[r]:o.push(r),r},t.prototype.remove=function(e){var t=this._subscriptions;if(t){var r=t.indexOf(e);-1!==r&&t.splice(r,1)}},(e=new t).closed=!0,t.EMPTY=e,t}()},3344(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=!1;t.config={Promise:void 0,set useDeprecatedSynchronousErrorHandling(value){value?console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+Error().stack):r&&console.log("RxJS: Back to a better error behavior. Thank you. <3"),r=value},get useDeprecatedSynchronousErrorHandling(){return r}}},4398(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(2515),s=r(7092);t.SimpleInnerSubscriber=function(e){function t(t){var r=e.call(this)||this;return r.parent=t,r}return i(t,e),t.prototype._next=function(e){this.parent.notifyNext(e)},t.prototype._error=function(e){this.parent.notifyError(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},t}(o.Subscriber),t.ComplexInnerSubscriber=function(e){function t(t,r,n){var i=e.call(this)||this;return i.parent=t,i.outerValue=r,i.outerIndex=n,i}return i(t,e),t.prototype._next=function(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this)},t.prototype._error=function(e){this.parent.notifyError(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(o.Subscriber),t.SimpleOuterSubscriber=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(){this.destination.complete()},t}(o.Subscriber),t.ComplexOuterSubscriber=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.notifyNext=function(e,t,r,n){this.destination.next(t)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(e){this.destination.complete()},t}(o.Subscriber),t.innerSubscribe=function(e,t){var r;if(!t.closed){if(e instanceof a.Observable)return e.subscribe(t);try{r=s.subscribeTo(e)(t)}catch(e){t.error(e)}return r}}},2871(e,t,r){"use strict";var n,i,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var a=r(2888),s=r(2515),l=r(1396),u=r(3207),c=r(6888),d=function(e){function t(t,r){var n=e.call(this)||this;return n.source=t,n.subjectFactory=r,n._refCount=0,n._isComplete=!1,n}return o(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject},t.prototype.connect=function(){var e=this._connection;return!e&&(this._isComplete=!1,(e=this._connection=new u.Subscription).add(this.source.subscribe(new p(this.getSubject(),this))),e.closed&&(this._connection=null,e=u.Subscription.EMPTY)),e},t.prototype.refCount=function(){return c.refCount()(this)},t}(s.Observable);t.ConnectableObservable=d,t.connectableObservableDescriptor={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:(i=d.prototype)._subscribe},_isComplete:{value:i._isComplete,writable:!0},getSubject:{value:i.getSubject},connect:{value:i.connect},refCount:{value:i.refCount}};var p=function(e){function t(t,r){var n=e.call(this,t)||this;return n.connectable=r,n}return o(t,e),t.prototype._error=function(t){this._unsubscribe(),e.prototype._error.call(this,t)},t.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}},t}(a.SubjectSubscriber);(function(e){this.connectable=e}).prototype.call=function(e,t){var r=this.connectable;r._refCount++;var n=new f(e,r),i=t.subscribe(n);return n.closed||(n.connection=r.connect()),i};var f=function(e){function t(t,r){var n=e.call(this,t)||this;return n.connectable=r,n}return o(t,e),t.prototype._unsubscribe=function(){var e=this.connectable;if(!e){this.connection=null;return}this.connectable=null;var t=e._refCount;if(t<=0||(e._refCount=t-1,t>1)){this.connection=null;return}var r=this.connection,n=e._connection;this.connection=null,n&&(!r||n===r)&&n.unsubscribe()},t}(l.Subscriber)},8072(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(2515),a=r(2745),s=r(5390);t.SubscribeOnObservable=function(e){function t(t,r,n){void 0===r&&(r=0),void 0===n&&(n=a.asap);var i=e.call(this)||this;return i.source=t,i.delayTime=r,i.scheduler=n,(!s.isNumeric(r)||r<0)&&(i.delayTime=0),n&&"function"==typeof n.schedule||(i.scheduler=a.asap),i}return i(t,e),t.create=function(e,r,n){return void 0===r&&(r=0),void 0===n&&(n=a.asap),new t(e,r,n)},t.dispatch=function(e){var t=e.source,r=e.subscriber;return this.add(t.subscribe(r))},t.prototype._subscribe=function(e){var r=this.delayTime,n=this.source;return this.scheduler.schedule(t.dispatch,r,{source:n,subscriber:e})},t}(o.Observable)},278(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(8244),a=r(4728),s=r(5905),l=r(7849),u=r(5853),c={};t.combineLatest=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=void 0,n=void 0;return o.isScheduler(e[e.length-1])&&(n=e.pop()),"function"==typeof e[e.length-1]&&(r=e.pop()),1===e.length&&a.isArray(e[0])&&(e=e[0]),u.fromArray(e,n).lift(new d(r))};var d=function(){function e(e){this.resultSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new p(e,this.resultSelector))},e}();t.CombineLatestOperator=d;var p=function(e){function t(t,r){var n=e.call(this,t)||this;return n.resultSelector=r,n.active=0,n.values=[],n.observables=[],n}return i(t,e),t.prototype._next=function(e){this.values.push(c),this.observables.push(e)},t.prototype._complete=function(){var e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(var r=0;r<t;r++){var n=e[r];this.add(l.subscribeToResult(this,n,void 0,r))}}},t.prototype.notifyComplete=function(e){0==(this.active-=1)&&this.destination.complete()},t.prototype.notifyNext=function(e,t,r){var n=this.values,i=n[r],o=this.toRespond?i===c?--this.toRespond:this.toRespond:0;n[r]=t,0===o&&(this.resultSelector?this._tryResultSelector(n):this.destination.next(n.slice()))},t.prototype._tryResultSelector=function(e){var t;try{t=this.resultSelector.apply(this,e)}catch(e){this.destination.error(e);return}this.destination.next(t)},t}(s.OuterSubscriber);t.CombineLatestSubscriber=p},5434(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7795),i=r(6345);t.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i.concatAll()(n.of.apply(void 0,e))}},3180(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2515),i=r(4098),o=r(453);t.defer=function(e){return new n.Observable(function(t){var r;try{r=e()}catch(e){t.error(e);return}return(r?i.from(r):o.empty()).subscribe(t)})}},453(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2515);t.EMPTY=new n.Observable(function(e){return e.complete()}),t.empty=function(e){var r;return e?(r=e,new n.Observable(function(e){return r.schedule(function(){return e.complete()})})):t.EMPTY}},4098(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2515),i=r(7092),o=r(7315);t.from=function(e,t){return t?o.scheduled(e,t):e instanceof n.Observable?e:new n.Observable(i.subscribeTo(e))}},5853(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2515),i=r(499),o=r(8822);t.fromArray=function(e,t){return t?o.scheduleArray(e,t):new n.Observable(i.subscribeToArray(e))}},5776(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2515),i=r(8244),o=r(9287),a=r(5853);t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=1/0,s=null,l=e[e.length-1];return(i.isScheduler(l)?(s=e.pop(),e.length>1&&"number"==typeof e[e.length-1]&&(r=e.pop())):"number"==typeof l&&(r=e.pop()),null===s&&1===e.length&&e[0]instanceof n.Observable)?e[0]:o.mergeAll(r)(a.fromArray(e,s))}},7795(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(8244),i=r(5853),o=r(8822);t.of=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[e.length-1];return n.isScheduler(r)?(e.pop(),o.scheduleArray(e,r)):i.fromArray(e)}},3827(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(4728),a=r(5853),s=r(5905),l=r(7849);t.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(1===e.length)if(!o.isArray(e[0]))return e[0];else e=e[0];return a.fromArray(e,void 0).lift(new u)};var u=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new c(e))},e}();t.RaceOperator=u;var c=function(e){function t(t){var r=e.call(this,t)||this;return r.hasFirst=!1,r.observables=[],r.subscriptions=[],r}return i(t,e),t.prototype._next=function(e){this.observables.push(e)},t.prototype._complete=function(){var e=this.observables,t=e.length;if(0===t)this.destination.complete();else{for(var r=0;r<t&&!this.hasFirst;r++){var n=e[r],i=l.subscribeToResult(this,n,void 0,r);this.subscriptions&&this.subscriptions.push(i),this.add(i)}this.observables=null}},t.prototype.notifyNext=function(e,t,r){if(!this.hasFirst){this.hasFirst=!0;for(var n=0;n<this.subscriptions.length;n++)if(n!==r){var i=this.subscriptions[n];i.unsubscribe(),this.remove(i)}this.subscriptions=null}this.destination.next(t)},t}(s.OuterSubscriber);t.RaceSubscriber=c},1576(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2515);function i(e){var t=e.error;e.subscriber.error(t)}t.throwError=function(e,t){return new n.Observable(t?function(r){return t.schedule(i,0,{error:e,subscriber:r})}:function(t){return t.error(e)})}},4529(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2515),i=r(5190),o=r(5390),a=r(8244);function s(e){var t=e.index,r=e.period,n=e.subscriber;if(n.next(t),!n.closed){if(-1===r)return n.complete();e.index=t+1,this.schedule(e,r)}}t.timer=function(e,t,r){void 0===e&&(e=0);var l=-1;return o.isNumeric(t)?l=1>Number(t)&&1||Number(t):a.isScheduler(t)&&(r=t),a.isScheduler(r)||(r=i.async),new n.Observable(function(t){var n=o.isNumeric(e)?e:e-r.now();return r.schedule(s,n,{index:0,period:l,subscriber:t})})}},887(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(5853),a=r(4728),s=r(1396),l=r(7211),u=r(4398);t.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[e.length-1];return"function"==typeof r&&e.pop(),o.fromArray(e,void 0).lift(new c(r))};var c=function(){function e(e){this.resultSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new d(e,this.resultSelector))},e}();t.ZipOperator=c;var d=function(e){function t(t,r,n){void 0===n&&(n=Object.create(null));var i=e.call(this,t)||this;return i.resultSelector=r,i.iterators=[],i.active=0,i.resultSelector="function"==typeof r?r:void 0,i}return i(t,e),t.prototype._next=function(e){var t=this.iterators;a.isArray(e)?t.push(new f(e)):"function"==typeof e[l.iterator]?t.push(new p(e[l.iterator]())):t.push(new h(this.destination,this,e))},t.prototype._complete=function(){var e=this.iterators,t=e.length;if(this.unsubscribe(),0===t)return void this.destination.complete();this.active=t;for(var r=0;r<t;r++){var n=e[r];n.stillUnsubscribed?this.destination.add(n.subscribe()):this.active--}},t.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},t.prototype.checkIterators=function(){for(var e=this.iterators,t=e.length,r=this.destination,n=0;n<t;n++){var i=e[n];if("function"==typeof i.hasValue&&!i.hasValue())return}for(var o=!1,a=[],n=0;n<t;n++){var i=e[n],s=i.next();if(i.hasCompleted()&&(o=!0),s.done)return void r.complete();a.push(s.value)}this.resultSelector?this._tryresultSelector(a):r.next(a),o&&r.complete()},t.prototype._tryresultSelector=function(e){var t;try{t=this.resultSelector.apply(this,e)}catch(e){this.destination.error(e);return}this.destination.next(t)},t}(s.Subscriber);t.ZipSubscriber=d;var p=function(){function e(e){this.iterator=e,this.nextResult=e.next()}return e.prototype.hasValue=function(){return!0},e.prototype.next=function(){var e=this.nextResult;return this.nextResult=this.iterator.next(),e},e.prototype.hasCompleted=function(){var e=this.nextResult;return!!(e&&e.done)},e}(),f=function(){function e(e){this.array=e,this.index=0,this.length=0,this.length=e.length}return e.prototype[l.iterator]=function(){return this},e.prototype.next=function(e){var t=this.index++,r=this.array;return t<this.length?{value:r[t],done:!1}:{value:null,done:!0}},e.prototype.hasValue=function(){return this.array.length>this.index},e.prototype.hasCompleted=function(){return this.array.length===this.index},e}(),h=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.parent=r,i.observable=n,i.stillUnsubscribed=!0,i.buffer=[],i.isComplete=!1,i}return i(t,e),t.prototype[l.iterator]=function(){return this},t.prototype.next=function(){var e=this.buffer;return 0===e.length&&this.isComplete?{value:null,done:!0}:{value:e.shift(),done:!1}},t.prototype.hasValue=function(){return this.buffer.length>0},t.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},t.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},t.prototype.notifyNext=function(e){this.buffer.push(e),this.parent.checkIterators()},t.prototype.subscribe=function(){return u.innerSubscribe(this.observable,new u.SimpleInnerSubscriber(this))},t}(u.SimpleOuterSubscriber)},8461(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(4398);t.audit=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.durationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.durationSelector))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.durationSelector=r,n.hasValue=!1,n}return i(t,e),t.prototype._next=function(e){if(this.value=e,this.hasValue=!0,!this.throttled){var t=void 0;try{t=(0,this.durationSelector)(e)}catch(e){return this.destination.error(e)}var r=o.innerSubscribe(t,new o.SimpleInnerSubscriber(this));!r||r.closed?this.clearThrottle():this.add(this.throttled=r)}},t.prototype.clearThrottle=function(){var e=this.value,t=this.hasValue,r=this.throttled;r&&(this.remove(r),this.throttled=void 0,r.unsubscribe()),t&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))},t.prototype.notifyNext=function(){this.clearThrottle()},t.prototype.notifyComplete=function(){this.clearThrottle()},t}(o.SimpleOuterSubscriber)},2392(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5190),i=r(8461),o=r(4529);t.auditTime=function(e,t){return void 0===t&&(t=n.async),i.audit(function(){return o.timer(e,t)})}},7954(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(4398);t.buffer=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.closingNotifier=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.closingNotifier))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.buffer=[],n.add(o.innerSubscribe(r,new o.SimpleInnerSubscriber(n))),n}return i(t,e),t.prototype._next=function(e){this.buffer.push(e)},t.prototype.notifyNext=function(){var e=this.buffer;this.buffer=[],this.destination.next(e)},t}(o.SimpleOuterSubscriber)},647(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.bufferCount=function(e,t){return void 0===t&&(t=null),function(r){return r.lift(new a(e,t))}};var a=function(){function e(e,t){this.bufferSize=e,this.startBufferEvery=t,t&&e!==t?this.subscriberClass=l:this.subscriberClass=s}return e.prototype.call=function(e,t){return t.subscribe(new this.subscriberClass(e,this.bufferSize,this.startBufferEvery))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.bufferSize=r,n.buffer=[],n}return i(t,e),t.prototype._next=function(e){var t=this.buffer;t.push(e),t.length==this.bufferSize&&(this.destination.next(t),this.buffer=[])},t.prototype._complete=function(){var t=this.buffer;t.length>0&&this.destination.next(t),e.prototype._complete.call(this)},t}(o.Subscriber),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.bufferSize=r,i.startBufferEvery=n,i.buffers=[],i.count=0,i}return i(t,e),t.prototype._next=function(e){var t=this.bufferSize,r=this.startBufferEvery,n=this.buffers,i=this.count;this.count++,i%r==0&&n.push([]);for(var o=n.length;o--;){var a=n[o];a.push(e),a.length===t&&(n.splice(o,1),this.destination.next(a))}},t.prototype._complete=function(){for(var t=this.buffers,r=this.destination;t.length>0;){var n=t.shift();n.length>0&&r.next(n)}e.prototype._complete.call(this)},t}(o.Subscriber)},6327(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(5190),a=r(1396),s=r(8244);t.bufferTime=function(e){var t=arguments.length,r=o.async;s.isScheduler(arguments[arguments.length-1])&&(r=arguments[arguments.length-1],t--);var n=null;t>=2&&(n=arguments[1]);var i=1/0;return t>=3&&(i=arguments[2]),function(t){return t.lift(new l(e,n,i,r))}};var l=function(){function e(e,t,r,n){this.bufferTimeSpan=e,this.bufferCreationInterval=t,this.maxBufferSize=r,this.scheduler=n}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},e}(),u=function(){this.buffer=[]},c=function(e){function t(t,r,n,i,o){var a=e.call(this,t)||this;a.bufferTimeSpan=r,a.bufferCreationInterval=n,a.maxBufferSize=i,a.scheduler=o,a.contexts=[];var s=a.openContext();return a.timespanOnly=null==n||n<0,a.timespanOnly?a.add(s.closeAction=o.schedule(d,r,{subscriber:a,context:s,bufferTimeSpan:r})):(a.add(s.closeAction=o.schedule(f,r,{subscriber:a,context:s})),a.add(o.schedule(p,n,{bufferTimeSpan:r,bufferCreationInterval:n,subscriber:a,scheduler:o}))),a}return i(t,e),t.prototype._next=function(e){for(var t,r=this.contexts,n=r.length,i=0;i<n;i++){var o=r[i],a=o.buffer;a.push(e),a.length==this.maxBufferSize&&(t=o)}t&&this.onBufferFull(t)},t.prototype._error=function(t){this.contexts.length=0,e.prototype._error.call(this,t)},t.prototype._complete=function(){for(var t=this.contexts,r=this.destination;t.length>0;){var n=t.shift();r.next(n.buffer)}e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.contexts=null},t.prototype.onBufferFull=function(e){this.closeContext(e);var t=e.closeAction;if(t.unsubscribe(),this.remove(t),!this.closed&&this.timespanOnly){e=this.openContext();var r=this.bufferTimeSpan,n={subscriber:this,context:e,bufferTimeSpan:r};this.add(e.closeAction=this.scheduler.schedule(d,r,n))}},t.prototype.openContext=function(){var e=new u;return this.contexts.push(e),e},t.prototype.closeContext=function(e){this.destination.next(e.buffer);var t=this.contexts;(t?t.indexOf(e):-1)>=0&&t.splice(t.indexOf(e),1)},t}(a.Subscriber);function d(e){var t=e.subscriber,r=e.context;r&&t.closeContext(r),t.closed||(e.context=t.openContext(),e.context.closeAction=this.schedule(e,e.bufferTimeSpan))}function p(e){var t=e.bufferCreationInterval,r=e.bufferTimeSpan,n=e.subscriber,i=e.scheduler,o=n.openContext();n.closed||(n.add(o.closeAction=i.schedule(f,r,{subscriber:n,context:o})),this.schedule(e,t))}function f(e){var t=e.subscriber,r=e.context;t.closeContext(r)}},6786(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(3207),a=r(7849),s=r(5905);t.bufferToggle=function(e,t){return function(r){return r.lift(new l(e,t))}};var l=function(){function e(e,t){this.openings=e,this.closingSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.openings,this.closingSelector))},e}(),u=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.closingSelector=n,i.contexts=[],i.add(a.subscribeToResult(i,r)),i}return i(t,e),t.prototype._next=function(e){for(var t=this.contexts,r=t.length,n=0;n<r;n++)t[n].buffer.push(e)},t.prototype._error=function(t){for(var r=this.contexts;r.length>0;){var n=r.shift();n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,e.prototype._error.call(this,t)},t.prototype._complete=function(){for(var t=this.contexts;t.length>0;){var r=t.shift();this.destination.next(r.buffer),r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}this.contexts=null,e.prototype._complete.call(this)},t.prototype.notifyNext=function(e,t){e?this.closeBuffer(e):this.openBuffer(t)},t.prototype.notifyComplete=function(e){this.closeBuffer(e.context)},t.prototype.openBuffer=function(e){try{var t=this.closingSelector.call(this,e);t&&this.trySubscribe(t)}catch(e){this._error(e)}},t.prototype.closeBuffer=function(e){var t=this.contexts;if(t&&e){var r=e.buffer,n=e.subscription;this.destination.next(r),t.splice(t.indexOf(e),1),this.remove(n),n.unsubscribe()}},t.prototype.trySubscribe=function(e){var t=this.contexts,r=new o.Subscription,n={buffer:[],subscription:r};t.push(n);var i=a.subscribeToResult(this,e,n);!i||i.closed?this.closeBuffer(n):(i.context=n,this.add(i),r.add(i))},t}(s.OuterSubscriber)},1662(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(3207),a=r(4398);t.bufferWhen=function(e){return function(t){return t.lift(new s(e))}};var s=function(){function e(e){this.closingSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.closingSelector))},e}(),l=function(e){function t(t,r){var n=e.call(this,t)||this;return n.closingSelector=r,n.subscribing=!1,n.openBuffer(),n}return i(t,e),t.prototype._next=function(e){this.buffer.push(e)},t.prototype._complete=function(){var t=this.buffer;t&&this.destination.next(t),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},t.prototype.notifyNext=function(){this.openBuffer()},t.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},t.prototype.openBuffer=function(){var e,t=this.closingSubscription;t&&(this.remove(t),t.unsubscribe());var r=this.buffer;this.buffer&&this.destination.next(r),this.buffer=[];try{e=(0,this.closingSelector)()}catch(e){return this.error(e)}t=new o.Subscription,this.closingSubscription=t,this.add(t),this.subscribing=!0,t.add(a.innerSubscribe(e,new a.SimpleInnerSubscriber(this))),this.subscribing=!1},t}(a.SimpleOuterSubscriber)},5503(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(4398);t.catchError=function(e){return function(t){var r=new a(e),n=t.lift(r);return r.caught=n}};var a=function(){function e(e){this.selector=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.selector,this.caught))},e}(),s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.selector=r,i.caught=n,i}return i(t,e),t.prototype.error=function(t){if(!this.isStopped){var r=void 0;try{r=this.selector(t,this.caught)}catch(t){e.prototype.error.call(this,t);return}this._unsubscribeAndRecycle();var n=new o.SimpleInnerSubscriber(this);this.add(n);var i=o.innerSubscribe(r,n);i!==n&&this.add(i)}},t}(o.SimpleOuterSubscriber)},4908(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(278);t.combineAll=function(e){return function(t){return t.lift(new n.CombineLatestOperator(e))}}},9060(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4728),i=r(278),o=r(4098);t.combineLatest=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=null;return"function"==typeof e[e.length-1]&&(r=e.pop()),1===e.length&&n.isArray(e[0])&&(e=e[0].slice()),function(t){return t.lift.call(o.from([t].concat(e)),new i.CombineLatestOperator(r))}}},6600(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5434);t.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(n.concat.apply(void 0,[t].concat(e)))}}},6345(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9287);t.concatAll=function(){return n.mergeAll(1)}},2248(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5206);t.concatMap=function(e,t){return n.mergeMap(e,t,1)}},3577(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2248);t.concatMapTo=function(e,t){return n.concatMap(function(){return e},t)}},8765(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.count=function(e){return function(t){return t.lift(new a(e,t))}};var a=function(){function e(e,t){this.predicate=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.source))},e}(),s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.predicate=r,i.source=n,i.count=0,i.index=0,i}return i(t,e),t.prototype._next=function(e){this.predicate?this._tryPredicate(e):this.count++},t.prototype._tryPredicate=function(e){var t;try{t=this.predicate(e,this.index++,this.source)}catch(e){this.destination.error(e);return}t&&this.count++},t.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},t}(o.Subscriber)},3287(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(4398);t.debounce=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.durationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.durationSelector))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.durationSelector=r,n.hasValue=!1,n}return i(t,e),t.prototype._next=function(e){try{var t=this.durationSelector.call(this,e);t&&this._tryNext(e,t)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){this.emitValue(),this.destination.complete()},t.prototype._tryNext=function(e,t){var r=this.durationSubscription;this.value=e,this.hasValue=!0,r&&(r.unsubscribe(),this.remove(r)),(r=o.innerSubscribe(t,new o.SimpleInnerSubscriber(this)))&&!r.closed&&this.add(this.durationSubscription=r)},t.prototype.notifyNext=function(){this.emitValue()},t.prototype.notifyComplete=function(){this.emitValue()},t.prototype.emitValue=function(){if(this.hasValue){var t=this.value,r=this.durationSubscription;r&&(this.durationSubscription=void 0,r.unsubscribe(),this.remove(r)),this.value=void 0,this.hasValue=!1,e.prototype._next.call(this,t)}},t}(o.SimpleOuterSubscriber)},5685(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(5190);t.debounceTime=function(e,t){return void 0===t&&(t=a.async),function(r){return r.lift(new s(e,t))}};var s=function(){function e(e,t){this.dueTime=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.dueTime,this.scheduler))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.dueTime=r,i.scheduler=n,i.debouncedSubscription=null,i.lastValue=null,i.hasValue=!1,i}return i(t,e),t.prototype._next=function(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(u,this.dueTime,this))},t.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},t.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var e=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(e)}},t.prototype.clearDebounce=function(){var e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)},t}(o.Subscriber);function u(e){e.debouncedNext()}},2767(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.defaultIfEmpty=function(e){return void 0===e&&(e=null),function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.defaultValue=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.defaultValue))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.defaultValue=r,n.isEmpty=!0,n}return i(t,e),t.prototype._next=function(e){this.isEmpty=!1,this.destination.next(e)},t.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},t}(o.Subscriber)},6965(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(5190),a=r(4465),s=r(1396),l=r(6765);t.delay=function(e,t){void 0===t&&(t=o.async);var r=a.isDate(e)?e-t.now():Math.abs(e);return function(e){return e.lift(new u(r,t))}};var u=function(){function e(e,t){this.delay=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.delay,this.scheduler))},e}(),c=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.delay=r,i.scheduler=n,i.queue=[],i.active=!1,i.errored=!1,i}return i(t,e),t.dispatch=function(e){for(var t=e.source,r=t.queue,n=e.scheduler,i=e.destination;r.length>0&&r[0].time-n.now()<=0;)r.shift().notification.observe(i);if(r.length>0){var o=Math.max(0,r[0].time-n.now());this.schedule(e,o)}else this.unsubscribe(),t.active=!1},t.prototype._schedule=function(e){this.active=!0,this.destination.add(e.schedule(t.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))},t.prototype.scheduleNotification=function(e){if(!0!==this.errored){var t=this.scheduler,r=new d(t.now()+this.delay,e);this.queue.push(r),!1===this.active&&this._schedule(t)}},t.prototype._next=function(e){this.scheduleNotification(l.Notification.createNext(e))},t.prototype._error=function(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.scheduleNotification(l.Notification.createComplete()),this.unsubscribe()},t}(s.Subscriber),d=function(e,t){this.time=e,this.notification=t}},9861(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(2515),s=r(5905),l=r(7849);t.delayWhen=function(e,t){return t?function(r){return new d(r,t).lift(new u(e))}:function(t){return t.lift(new u(e))}};var u=function(){function e(e){this.delayDurationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.delayDurationSelector))},e}(),c=function(e){function t(t,r){var n=e.call(this,t)||this;return n.delayDurationSelector=r,n.completed=!1,n.delayNotifierSubscriptions=[],n.index=0,n}return i(t,e),t.prototype.notifyNext=function(e,t,r,n,i){this.destination.next(e),this.removeSubscription(i),this.tryComplete()},t.prototype.notifyError=function(e,t){this._error(e)},t.prototype.notifyComplete=function(e){var t=this.removeSubscription(e);t&&this.destination.next(t),this.tryComplete()},t.prototype._next=function(e){var t=this.index++;try{var r=this.delayDurationSelector(e,t);r&&this.tryDelay(r,e)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},t.prototype.removeSubscription=function(e){e.unsubscribe();var t=this.delayNotifierSubscriptions.indexOf(e);return -1!==t&&this.delayNotifierSubscriptions.splice(t,1),e.outerValue},t.prototype.tryDelay=function(e,t){var r=l.subscribeToResult(this,e,t);r&&!r.closed&&(this.destination.add(r),this.delayNotifierSubscriptions.push(r))},t.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},t}(s.OuterSubscriber),d=function(e){function t(t,r){var n=e.call(this)||this;return n.source=t,n.subscriptionDelay=r,n}return i(t,e),t.prototype._subscribe=function(e){this.subscriptionDelay.subscribe(new p(e,this.source))},t}(a.Observable),p=function(e){function t(t,r){var n=e.call(this)||this;return n.parent=t,n.source=r,n.sourceSubscribed=!1,n}return i(t,e),t.prototype._next=function(e){this.subscribeToSource()},t.prototype._error=function(e){this.unsubscribe(),this.parent.error(e)},t.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},t.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},t}(o.Subscriber)},7642(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.dematerialize=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t.prototype._next=function(e){e.observe(this.destination)},t}(o.Subscriber)},8820(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(4398);t.distinct=function(e,t){return function(r){return r.lift(new a(e,t))}};var a=function(){function e(e,t){this.keySelector=e,this.flushes=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.keySelector,this.flushes))},e}(),s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.keySelector=r,i.values=new Set,n&&i.add(o.innerSubscribe(n,new o.SimpleInnerSubscriber(i))),i}return i(t,e),t.prototype.notifyNext=function(){this.values.clear()},t.prototype.notifyError=function(e){this._error(e)},t.prototype._next=function(e){this.keySelector?this._useKeySelector(e):this._finalizeNext(e,e)},t.prototype._useKeySelector=function(e){var t,r=this.destination;try{t=this.keySelector(e)}catch(e){r.error(e);return}this._finalizeNext(t,e)},t.prototype._finalizeNext=function(e,t){var r=this.values;r.has(e)||(r.add(e),this.destination.next(t))},t}(o.SimpleOuterSubscriber);t.DistinctSubscriber=s},9391(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.distinctUntilChanged=function(e,t){return function(r){return r.lift(new a(e,t))}};var a=function(){function e(e,t){this.compare=e,this.keySelector=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.compare,this.keySelector))},e}(),s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.keySelector=n,i.hasKey=!1,"function"==typeof r&&(i.compare=r),i}return i(t,e),t.prototype.compare=function(e,t){return e===t},t.prototype._next=function(e){try{var t,r=this.keySelector;t=r?r(e):e}catch(e){return this.destination.error(e)}var n=!1;if(this.hasKey)try{n=(0,this.compare)(this.key,t)}catch(e){return this.destination.error(e)}else this.hasKey=!0;n||(this.key=t,this.destination.next(e))},t}(o.Subscriber)},5075(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9391);t.distinctUntilKeyChanged=function(e,t){return n.distinctUntilChanged(function(r,n){return t?t(r[e],n[e]):r[e]===n[e]})}},2399(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7568),i=r(2670),o=r(2056),a=r(2767),s=r(1231);t.elementAt=function(e,t){if(e<0)throw new n.ArgumentOutOfRangeError;var r=arguments.length>=2;return function(l){return l.pipe(i.filter(function(t,r){return r===e}),s.take(1),r?a.defaultIfEmpty(t):o.throwIfEmpty(function(){return new n.ArgumentOutOfRangeError}))}}},2631(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5434),i=r(7795);t.endWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return n.concat(t,i.of.apply(void 0,e))}}},7233(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.every=function(e,t){return function(r){return r.lift(new a(e,t,r))}};var a=function(){function e(e,t,r){this.predicate=e,this.thisArg=t,this.source=r}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.thisArg,this.source))},e}(),s=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return o.predicate=r,o.thisArg=n,o.source=i,o.index=0,o.thisArg=n||o,o}return i(t,e),t.prototype.notifyComplete=function(e){this.destination.next(e),this.destination.complete()},t.prototype._next=function(e){var t=!1;try{t=this.predicate.call(this.thisArg,e,this.index++,this.source)}catch(e){this.destination.error(e);return}t||this.notifyComplete(!1)},t.prototype._complete=function(){this.notifyComplete(!0)},t}(o.Subscriber)},2408(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(4398);t.exhaust=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(t){var r=e.call(this,t)||this;return r.hasCompleted=!1,r.hasSubscription=!1,r}return i(t,e),t.prototype._next=function(e){this.hasSubscription||(this.hasSubscription=!0,this.add(o.innerSubscribe(e,new o.SimpleInnerSubscriber(this))))},t.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},t.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},t}(o.SimpleOuterSubscriber)},1112(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(6808),a=r(4098),s=r(4398);t.exhaustMap=function e(t,r){return r?function(n){return n.pipe(e(function(e,n){return a.from(t(e,n)).pipe(o.map(function(t,i){return r(e,t,n,i)}))}))}:function(e){return e.lift(new l(t))}};var l=function(){function e(e){this.project=e}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.project))},e}(),u=function(e){function t(t,r){var n=e.call(this,t)||this;return n.project=r,n.hasSubscription=!1,n.hasCompleted=!1,n.index=0,n}return i(t,e),t.prototype._next=function(e){this.hasSubscription||this.tryNext(e)},t.prototype.tryNext=function(e){var t,r=this.index++;try{t=this.project(e,r)}catch(e){this.destination.error(e);return}this.hasSubscription=!0,this._innerSub(t)},t.prototype._innerSub=function(e){var t=new s.SimpleInnerSubscriber(this),r=this.destination;r.add(t);var n=s.innerSubscribe(e,t);n!==t&&r.add(n)},t.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},t}(s.SimpleOuterSubscriber)},7736(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(4398);t.expand=function(e,t,r){return void 0===t&&(t=1/0),t=1>(t||0)?1/0:t,function(n){return n.lift(new a(e,t,r))}};var a=function(){function e(e,t,r){this.project=e,this.concurrent=t,this.scheduler=r}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.project,this.concurrent,this.scheduler))},e}();t.ExpandOperator=a;var s=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return o.project=r,o.concurrent=n,o.scheduler=i,o.index=0,o.active=0,o.hasCompleted=!1,n<1/0&&(o.buffer=[]),o}return i(t,e),t.dispatch=function(e){var t=e.subscriber,r=e.result,n=e.value,i=e.index;t.subscribeToProjection(r,n,i)},t.prototype._next=function(e){var r=this.destination;if(r.closed)return void this._complete();var n=this.index++;if(this.active<this.concurrent){r.next(e);try{var i=(0,this.project)(e,n);this.scheduler?this.destination.add(this.scheduler.schedule(t.dispatch,0,{subscriber:this,result:i,value:e,index:n})):this.subscribeToProjection(i,e,n)}catch(e){r.error(e)}}else this.buffer.push(e)},t.prototype.subscribeToProjection=function(e,t,r){this.active++,this.destination.add(o.innerSubscribe(e,new o.SimpleInnerSubscriber(this)))},t.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&0===this.active&&this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this._next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e&&e.length>0&&this._next(e.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},t}(o.SimpleOuterSubscriber);t.ExpandSubscriber=s},2670(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.filter=function(e,t){return function(r){return r.lift(new a(e,t))}};var a=function(){function e(e,t){this.predicate=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.thisArg))},e}(),s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.predicate=r,i.thisArg=n,i.count=0,i}return i(t,e),t.prototype._next=function(e){var t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(e){this.destination.error(e);return}t&&this.destination.next(e)},t}(o.Subscriber)},1258(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(3207);t.finalize=function(e){return function(t){return t.lift(new s(e))}};var s=function(){function e(e){this.callback=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.callback))},e}(),l=function(e){function t(t,r){var n=e.call(this,t)||this;return n.add(new a.Subscription(r)),n}return i(t,e),t}(o.Subscriber)},5063(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.find=function(e,t){if("function"!=typeof e)throw TypeError("predicate is not a function");return function(r){return r.lift(new a(e,r,!1,t))}};var a=function(){function e(e,t,r,n){this.predicate=e,this.source=t,this.yieldIndex=r,this.thisArg=n}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.source,this.yieldIndex,this.thisArg))},e}();t.FindValueOperator=a;var s=function(e){function t(t,r,n,i,o){var a=e.call(this,t)||this;return a.predicate=r,a.source=n,a.yieldIndex=i,a.thisArg=o,a.index=0,a}return i(t,e),t.prototype.notifyComplete=function(e){var t=this.destination;t.next(e),t.complete(),this.unsubscribe()},t.prototype._next=function(e){var t=this.predicate,r=this.thisArg,n=this.index++;try{t.call(r||this,e,n,this.source)&&this.notifyComplete(this.yieldIndex?n:e)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},t}(o.Subscriber);t.FindValueSubscriber=s},2939(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5063);t.findIndex=function(e,t){return function(r){return r.lift(new n.FindValueOperator(e,r,!0,t))}}},9948(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1136),i=r(2670),o=r(1231),a=r(2767),s=r(2056),l=r(4579);t.first=function(e,t){var r=arguments.length>=2;return function(u){return u.pipe(e?i.filter(function(t,r){return e(t,r,u)}):l.identity,o.take(1),r?a.defaultIfEmpty(t):s.throwIfEmpty(function(){return new n.EmptyError}))}}},7784(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(3207),s=r(2515),l=r(2888);t.groupBy=function(e,t,r,n){return function(i){return i.lift(new u(e,t,r,n))}};var u=function(){function e(e,t,r,n){this.keySelector=e,this.elementSelector=t,this.durationSelector=r,this.subjectSelector=n}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},e}(),c=function(e){function t(t,r,n,i,o){var a=e.call(this,t)||this;return a.keySelector=r,a.elementSelector=n,a.durationSelector=i,a.subjectSelector=o,a.groups=null,a.attemptedToUnsubscribe=!1,a.count=0,a}return i(t,e),t.prototype._next=function(e){var t;try{t=this.keySelector(e)}catch(e){this.error(e);return}this._group(e,t)},t.prototype._group=function(e,t){var r,n=this.groups;n||(n=this.groups=new Map);var i=n.get(t);if(this.elementSelector)try{r=this.elementSelector(e)}catch(e){this.error(e)}else r=e;if(!i){i=this.subjectSelector?this.subjectSelector():new l.Subject,n.set(t,i);var o=new p(t,i,this);if(this.destination.next(o),this.durationSelector){var a=void 0;try{a=this.durationSelector(new p(t,i))}catch(e){this.error(e);return}this.add(a.subscribe(new d(t,i,this)))}}i.closed||i.next(r)},t.prototype._error=function(e){var t=this.groups;t&&(t.forEach(function(t,r){t.error(e)}),t.clear()),this.destination.error(e)},t.prototype._complete=function(){var e=this.groups;e&&(e.forEach(function(e,t){e.complete()}),e.clear()),this.destination.complete()},t.prototype.removeGroup=function(e){this.groups.delete(e)},t.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&e.prototype.unsubscribe.call(this))},t}(o.Subscriber),d=function(e){function t(t,r,n){var i=e.call(this,r)||this;return i.key=t,i.group=r,i.parent=n,i}return i(t,e),t.prototype._next=function(e){this.complete()},t.prototype._unsubscribe=function(){var e=this.parent,t=this.key;this.key=this.parent=null,e&&e.removeGroup(t)},t}(o.Subscriber),p=function(e){function t(t,r,n){var i=e.call(this)||this;return i.key=t,i.groupSubject=r,i.refCountSubscription=n,i}return i(t,e),t.prototype._subscribe=function(e){var t=new a.Subscription,r=this.refCountSubscription,n=this.groupSubject;return r&&!r.closed&&t.add(new f(r)),t.add(n.subscribe(e)),t},t}(s.Observable);t.GroupedObservable=p;var f=function(e){function t(t){var r=e.call(this)||this;return r.parent=t,t.count++,r}return i(t,e),t.prototype.unsubscribe=function(){var t=this.parent;t.closed||this.closed||(e.prototype.unsubscribe.call(this),t.count-=1,0===t.count&&t.attemptedToUnsubscribe&&t.unsubscribe())},t}(a.Subscription)},6863(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.ignoreElements=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype._next=function(e){},t}(o.Subscriber)},3371(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.isEmpty=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t.prototype.notifyComplete=function(e){var t=this.destination;t.next(e),t.complete()},t.prototype._next=function(e){this.notifyComplete(!1)},t.prototype._complete=function(){this.notifyComplete(!0)},t}(o.Subscriber)},7064(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1136),i=r(2670),o=r(3439),a=r(2056),s=r(2767),l=r(4579);t.last=function(e,t){var r=arguments.length>=2;return function(u){return u.pipe(e?i.filter(function(t,r){return e(t,r,u)}):l.identity,o.takeLast(1),r?s.defaultIfEmpty(t):a.throwIfEmpty(function(){return new n.EmptyError}))}}},6808(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.map=function(e,t){return function(r){if("function"!=typeof e)throw TypeError("argument is not a function. Are you looking for `mapTo()`?");return r.lift(new a(e,t))}};var a=function(){function e(e,t){this.project=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.project,this.thisArg))},e}();t.MapOperator=a;var s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.project=r,i.count=0,i.thisArg=n||i,i}return i(t,e),t.prototype._next=function(e){var t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(e){this.destination.error(e);return}this.destination.next(t)},t}(o.Subscriber)},3353(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.mapTo=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.value=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.value))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.value=r,n}return i(t,e),t.prototype._next=function(e){this.destination.next(this.value)},t}(o.Subscriber)},2539(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(6765);t.materialize=function(){return function(e){return e.lift(new s)}};var s=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new l(e))},e}(),l=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t.prototype._next=function(e){this.destination.next(a.Notification.createNext(e))},t.prototype._error=function(e){var t=this.destination;t.next(a.Notification.createError(e)),t.complete()},t.prototype._complete=function(){var e=this.destination;e.next(a.Notification.createComplete()),e.complete()},t}(o.Subscriber)},6416(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2518);t.max=function(e){return n.reduce("function"==typeof e?function(t,r){return e(t,r)>0?t:r}:function(e,t){return e>t?e:t})}},1570(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5776);t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(n.merge.apply(void 0,[t].concat(e)))}}},9287(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5206),i=r(4579);t.mergeAll=function(e){return void 0===e&&(e=1/0),n.mergeMap(i.identity,e)}},5206(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(6808),a=r(4098),s=r(4398);function l(e,t,r){return(void 0===r&&(r=1/0),"function"==typeof t)?function(n){return n.pipe(l(function(r,n){return a.from(e(r,n)).pipe(o.map(function(e,i){return t(r,e,n,i)}))},r))}:("number"==typeof t&&(r=t),function(t){return t.lift(new u(e,r))})}t.mergeMap=l;var u=function(){function e(e,t){void 0===t&&(t=1/0),this.project=e,this.concurrent=t}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.project,this.concurrent))},e}();t.MergeMapOperator=u;var c=function(e){function t(t,r,n){void 0===n&&(n=1/0);var i=e.call(this,t)||this;return i.project=r,i.concurrent=n,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return i(t,e),t.prototype._next=function(e){this.active<this.concurrent?this._tryNext(e):this.buffer.push(e)},t.prototype._tryNext=function(e){var t,r=this.index++;try{t=this.project(e,r)}catch(e){this.destination.error(e);return}this.active++,this._innerSub(t)},t.prototype._innerSub=function(e){var t=new s.SimpleInnerSubscriber(this),r=this.destination;r.add(t);var n=s.innerSubscribe(e,t);n!==t&&r.add(n)},t.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(s.SimpleOuterSubscriber);t.MergeMapSubscriber=c,t.flatMap=l},9019(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5206);t.mergeMapTo=function(e,t,r){return(void 0===r&&(r=1/0),"function"==typeof t)?n.mergeMap(function(){return e},t,r):("number"==typeof t&&(r=t),n.mergeMap(function(){return e},r))}},2307(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(4398);t.mergeScan=function(e,t,r){return void 0===r&&(r=1/0),function(n){return n.lift(new a(e,t,r))}};var a=function(){function e(e,t,r){this.accumulator=e,this.seed=t,this.concurrent=r}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.accumulator,this.seed,this.concurrent))},e}();t.MergeScanOperator=a;var s=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return o.accumulator=r,o.acc=n,o.concurrent=i,o.hasValue=!1,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return i(t,e),t.prototype._next=function(e){if(this.active<this.concurrent){var t=this.index++,r=this.destination,n=void 0;try{n=(0,this.accumulator)(this.acc,e,t)}catch(e){return r.error(e)}this.active++,this._innerSub(n)}else this.buffer.push(e)},t.prototype._innerSub=function(e){var t=new o.SimpleInnerSubscriber(this),r=this.destination;r.add(t);var n=o.innerSubscribe(e,t);n!==t&&r.add(n)},t.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete()),this.unsubscribe()},t.prototype.notifyNext=function(e){var t=this.destination;this.acc=e,this.hasValue=!0,t.next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},t}(o.SimpleOuterSubscriber);t.MergeScanSubscriber=s},7198(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2518);t.min=function(e){return n.reduce("function"==typeof e?function(t,r){return 0>e(t,r)?t:r}:function(e,t){return e<t?e:t})}},4864(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2871);t.multicast=function(e,t){return function(r){if(o="function"==typeof e?e:function(){return e},"function"==typeof t)return r.lift(new i(o,t));var o,a=Object.create(r,n.connectableObservableDescriptor);return a.source=r,a.subjectFactory=o,a}};var i=function(){function e(e,t){this.subjectFactory=e,this.selector=t}return e.prototype.call=function(e,t){var r=this.selector,n=this.subjectFactory(),i=r(n).subscribe(e);return i.add(t.subscribe(n)),i},e}();t.MulticastOperator=i},5495(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(6765);t.observeOn=function(e,t){return void 0===t&&(t=0),function(r){return r.lift(new s(e,t))}};var s=function(){function e(e,t){void 0===t&&(t=0),this.scheduler=e,this.delay=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.scheduler,this.delay))},e}();t.ObserveOnOperator=s;var l=function(e){function t(t,r,n){void 0===n&&(n=0);var i=e.call(this,t)||this;return i.scheduler=r,i.delay=n,i}return i(t,e),t.dispatch=function(e){var t=e.notification,r=e.destination;t.observe(r),this.unsubscribe()},t.prototype.scheduleMessage=function(e){this.destination.add(this.scheduler.schedule(t.dispatch,this.delay,new u(e,this.destination)))},t.prototype._next=function(e){this.scheduleMessage(a.Notification.createNext(e))},t.prototype._error=function(e){this.scheduleMessage(a.Notification.createError(e)),this.unsubscribe()},t.prototype._complete=function(){this.scheduleMessage(a.Notification.createComplete()),this.unsubscribe()},t}(o.Subscriber);t.ObserveOnSubscriber=l;var u=function(e,t){this.notification=e,this.destination=t};t.ObserveOnMessage=u},5029(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(4098),a=r(4728),s=r(4398);t.onErrorResumeNext=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===e.length&&a.isArray(e[0])&&(e=e[0]),function(t){return t.lift(new l(e))}},t.onErrorResumeNextStatic=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=void 0;return 1===e.length&&a.isArray(e[0])&&(e=e[0]),r=e.shift(),o.from(r).lift(new l(e))};var l=function(){function e(e){this.nextSources=e}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.nextSources))},e}(),u=function(e){function t(t,r){var n=e.call(this,t)||this;return n.destination=t,n.nextSources=r,n}return i(t,e),t.prototype.notifyError=function(){this.subscribeToNextSource()},t.prototype.notifyComplete=function(){this.subscribeToNextSource()},t.prototype._error=function(e){this.subscribeToNextSource(),this.unsubscribe()},t.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},t.prototype.subscribeToNextSource=function(){var e=this.nextSources.shift();if(e){var t=new s.SimpleInnerSubscriber(this),r=this.destination;r.add(t);var n=s.innerSubscribe(e,t);n!==t&&r.add(n)}else this.destination.complete()},t}(s.SimpleOuterSubscriber)},7304(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.pairwise=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(t){var r=e.call(this,t)||this;return r.hasPrev=!1,r}return i(t,e),t.prototype._next=function(e){var t;this.hasPrev?t=[this.prev,e]:this.hasPrev=!0,this.prev=e,t&&this.destination.next(t)},t}(o.Subscriber)},4236(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5352),i=r(2670);t.partition=function(e,t){return function(r){return[i.filter(e,t)(r),i.filter(n.not(e,t))(r)]}}},1075(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(6808);t.pluck=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.length;if(0===r)throw Error("list of properties cannot be empty.");return function(t){var i,o;return n.map((i=e,o=r,function(e){for(var t=e,r=0;r<o;r++){var n=null!=t?t[i[r]]:void 0;if(void 0===n)return;t=n}return t}))(t)}}},5485(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2888),i=r(4864);t.publish=function(e){return e?i.multicast(function(){return new n.Subject},e):i.multicast(new n.Subject)}},91(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(466),i=r(4864);t.publishBehavior=function(e){return function(t){return i.multicast(new n.BehaviorSubject(e))(t)}}},3433(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9850),i=r(4864);t.publishLast=function(){return function(e){return i.multicast(new n.AsyncSubject)(e)}}},9622(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2173),i=r(4864);t.publishReplay=function(e,t,r,o){r&&"function"!=typeof r&&(o=r);var a="function"==typeof r?r:void 0,s=new n.ReplaySubject(e,t,o);return function(e){return i.multicast(function(){return s},a)(e)}}},6721(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4728),i=r(3827);t.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return 1===e.length&&n.isArray(e[0])&&(e=e[0]),t.lift.call(i.race.apply(void 0,[t].concat(e)))}}},2518(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(253),i=r(3439),o=r(2767),a=r(8173);t.reduce=function(e,t){return arguments.length>=2?function(r){return a.pipe(n.scan(e,t),i.takeLast(1),o.defaultIfEmpty(t))(r)}:function(t){return a.pipe(n.scan(function(t,r,n){return e(t,r,n+1)}),i.takeLast(1))(t)}}},6888(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.refCount=function(){return function(e){return e.lift(new a(e))}};var a=function(){function e(e){this.connectable=e}return e.prototype.call=function(e,t){var r=this.connectable;r._refCount++;var n=new s(e,r),i=t.subscribe(n);return n.closed||(n.connection=r.connect()),i},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.connectable=r,n}return i(t,e),t.prototype._unsubscribe=function(){var e=this.connectable;if(!e){this.connection=null;return}this.connectable=null;var t=e._refCount;if(t<=0||(e._refCount=t-1,t>1)){this.connection=null;return}var r=this.connection,n=e._connection;this.connection=null,n&&(!r||n===r)&&n.unsubscribe()},t}(o.Subscriber)},6483(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(453);t.repeat=function(e){return void 0===e&&(e=-1),function(t){return 0===e?a.empty():e<0?t.lift(new s(-1,t)):t.lift(new s(e-1,t))}};var s=function(){function e(e,t){this.count=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.count,this.source))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.count=r,i.source=n,i}return i(t,e),t.prototype.complete=function(){if(!this.isStopped){var t=this.source,r=this.count;if(0===r)return e.prototype.complete.call(this);r>-1&&(this.count=r-1),t.subscribe(this._unsubscribeAndRecycle())}},t}(o.Subscriber)},283(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(2888),a=r(4398);t.repeatWhen=function(e){return function(t){return t.lift(new s(e))}};var s=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.notifier,t))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.notifier=r,i.source=n,i.sourceIsBeingSubscribedTo=!0,i}return i(t,e),t.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},t.prototype.notifyComplete=function(){if(!1===this.sourceIsBeingSubscribedTo)return e.prototype.complete.call(this)},t.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return e.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},t.prototype._unsubscribe=function(){var e=this.notifications,t=this.retriesSubscription;e&&(e.unsubscribe(),this.notifications=void 0),t&&(t.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},t.prototype._unsubscribeAndRecycle=function(){var t=this._unsubscribe;return this._unsubscribe=null,e.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=t,this},t.prototype.subscribeToRetries=function(){this.notifications=new o.Subject;try{var t;t=(0,this.notifier)(this.notifications)}catch(t){return e.prototype.complete.call(this)}this.retries=t,this.retriesSubscription=a.innerSubscribe(t,new a.SimpleInnerSubscriber(this))},t}(a.SimpleOuterSubscriber)},3160(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.retry=function(e){return void 0===e&&(e=-1),function(t){return t.lift(new a(e,t))}};var a=function(){function e(e,t){this.count=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.count,this.source))},e}(),s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.count=r,i.source=n,i}return i(t,e),t.prototype.error=function(t){if(!this.isStopped){var r=this.source,n=this.count;if(0===n)return e.prototype.error.call(this,t);n>-1&&(this.count=n-1),r.subscribe(this._unsubscribeAndRecycle())}},t}(o.Subscriber)},5508(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(2888),a=r(4398);t.retryWhen=function(e){return function(t){return t.lift(new s(e,t))}};var s=function(){function e(e,t){this.notifier=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.notifier,this.source))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.notifier=r,i.source=n,i}return i(t,e),t.prototype.error=function(t){if(!this.isStopped){var r=this.errors,n=this.retries,i=this.retriesSubscription;if(n)this.errors=void 0,this.retriesSubscription=void 0;else{r=new o.Subject;try{n=(0,this.notifier)(r)}catch(t){return e.prototype.error.call(this,t)}i=a.innerSubscribe(n,new a.SimpleInnerSubscriber(this))}this._unsubscribeAndRecycle(),this.errors=r,this.retries=n,this.retriesSubscription=i,r.next(t)}},t.prototype._unsubscribe=function(){var e=this.errors,t=this.retriesSubscription;e&&(e.unsubscribe(),this.errors=void 0),t&&(t.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},t.prototype.notifyNext=function(){var e=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=e,this.source.subscribe(this)},t}(a.SimpleOuterSubscriber)},1754(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(4398);t.sample=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){var r=new s(e),n=t.subscribe(r);return n.add(o.innerSubscribe(this.notifier,new o.SimpleInnerSubscriber(r))),n},e}(),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.hasValue=!1,t}return i(t,e),t.prototype._next=function(e){this.value=e,this.hasValue=!0},t.prototype.notifyNext=function(){this.emitValue()},t.prototype.notifyComplete=function(){this.emitValue()},t.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},t}(o.SimpleOuterSubscriber)},1183(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(5190);t.sampleTime=function(e,t){return void 0===t&&(t=a.async),function(r){return r.lift(new s(e,t))}};var s=function(){function e(e,t){this.period=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.period,this.scheduler))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.period=r,i.scheduler=n,i.hasValue=!1,i.add(n.schedule(u,r,{subscriber:i,period:r})),i}return i(t,e),t.prototype._next=function(e){this.lastValue=e,this.hasValue=!0},t.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},t}(o.Subscriber);function u(e){var t=e.subscriber,r=e.period;t.notifyNext(),this.schedule(e,r)}},253(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.scan=function(e,t){var r=!1;return arguments.length>=2&&(r=!0),function(n){return n.lift(new a(e,t,r))}};var a=function(){function e(e,t,r){void 0===r&&(r=!1),this.accumulator=e,this.seed=t,this.hasSeed=r}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.accumulator,this.seed,this.hasSeed))},e}(),s=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return o.accumulator=r,o._seed=n,o.hasSeed=i,o.index=0,o}return i(t,e),Object.defineProperty(t.prototype,"seed",{get:function(){return this._seed},set:function(e){this.hasSeed=!0,this._seed=e},enumerable:!0,configurable:!0}),t.prototype._next=function(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)},t.prototype._tryNext=function(e){var t,r=this.index++;try{t=this.accumulator(this.seed,e,r)}catch(e){this.destination.error(e)}this.seed=t,this.destination.next(t)},t}(o.Subscriber)},5017(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.sequenceEqual=function(e,t){return function(r){return r.lift(new a(e,t))}};var a=function(){function e(e,t){this.compareTo=e,this.comparator=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.compareTo,this.comparator))},e}();t.SequenceEqualOperator=a;var s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.compareTo=r,i.comparator=n,i._a=[],i._b=[],i._oneComplete=!1,i.destination.add(r.subscribe(new l(t,i))),i}return i(t,e),t.prototype._next=function(e){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(e),this.checkValues())},t.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0,this.unsubscribe()},t.prototype.checkValues=function(){for(var e=this._a,t=this._b,r=this.comparator;e.length>0&&t.length>0;){var n=e.shift(),i=t.shift(),o=!1;try{o=r?r(n,i):n===i}catch(e){this.destination.error(e)}o||this.emit(!1)}},t.prototype.emit=function(e){var t=this.destination;t.next(e),t.complete()},t.prototype.nextB=function(e){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(e),this.checkValues())},t.prototype.completeB=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},t}(o.Subscriber);t.SequenceEqualSubscriber=s;var l=function(e){function t(t,r){var n=e.call(this,t)||this;return n.parent=r,n}return i(t,e),t.prototype._next=function(e){this.parent.nextB(e)},t.prototype._error=function(e){this.parent.error(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},t}(o.Subscriber)},3213(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4864),i=r(6888),o=r(2888);function a(){return new o.Subject}t.share=function(){return function(e){return i.refCount()(n.multicast(a)(e))}}},8614(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2173);t.shareReplay=function(e,t,r){var i;return i=e&&"object"==typeof e?e:{bufferSize:e,windowTime:t,refCount:!1,scheduler:r},function(e){var t,r,o,a,s,l,u,c,d,p,f,h;return e.lift((s=void 0===(a=(t=i).bufferSize)?1/0:a,u=void 0===(l=t.windowTime)?1/0:l,c=t.refCount,d=t.scheduler,p=0,f=!1,h=!1,function(e){var t;p++,!r||f?(f=!1,t=(r=new n.ReplaySubject(s,u,d)).subscribe(this),o=e.subscribe({next:function(e){r.next(e)},error:function(e){f=!0,r.error(e)},complete:function(){h=!0,o=void 0,r.complete()}}),h&&(o=void 0)):t=r.subscribe(this),this.add(function(){p--,t.unsubscribe(),t=void 0,o&&!h&&c&&0===p&&(o.unsubscribe(),o=void 0,r=void 0)})}))}}},8480(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(1136);t.single=function(e){return function(t){return t.lift(new s(e,t))}};var s=function(){function e(e,t){this.predicate=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.predicate,this.source))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.predicate=r,i.source=n,i.seenValue=!1,i.index=0,i}return i(t,e),t.prototype.applySingleValue=function(e){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=e)},t.prototype._next=function(e){var t=this.index++;this.predicate?this.tryNext(e,t):this.applySingleValue(e)},t.prototype.tryNext=function(e,t){try{this.predicate(e,t,this.source)&&this.applySingleValue(e)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){var e=this.destination;this.index>0?(e.next(this.seenValue?this.singleValue:void 0),e.complete()):e.error(new a.EmptyError)},t}(o.Subscriber)},4775(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.skip=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.total=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.total))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.total=r,n.count=0,n}return i(t,e),t.prototype._next=function(e){++this.count>this.total&&this.destination.next(e)},t}(o.Subscriber)},2807(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(7568);t.skipLast=function(e){return function(t){return t.lift(new s(e))}};var s=function(){function e(e){if(this._skipCount=e,this._skipCount<0)throw new a.ArgumentOutOfRangeError}return e.prototype.call=function(e,t){return 0===this._skipCount?t.subscribe(new o.Subscriber(e)):t.subscribe(new l(e,this._skipCount))},e}(),l=function(e){function t(t,r){var n=e.call(this,t)||this;return n._skipCount=r,n._count=0,n._ring=Array(r),n}return i(t,e),t.prototype._next=function(e){var t=this._skipCount,r=this._count++;if(r<t)this._ring[r]=e;else{var n=r%t,i=this._ring,o=i[n];i[n]=e,this.destination.next(o)}},t}(o.Subscriber)},2519(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(4398);t.skipUntil=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.notifier))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;n.hasValue=!1;var i=new o.SimpleInnerSubscriber(n);n.add(i),n.innerSubscription=i;var a=o.innerSubscribe(r,i);return a!==i&&(n.add(a),n.innerSubscription=a),n}return i(t,e),t.prototype._next=function(t){this.hasValue&&e.prototype._next.call(this,t)},t.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},t.prototype.notifyComplete=function(){},t}(o.SimpleOuterSubscriber)},4846(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.skipWhile=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.predicate=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.predicate=r,n.skipping=!0,n.index=0,n}return i(t,e),t.prototype._next=function(e){var t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)},t.prototype.tryCallPredicate=function(e){try{var t=this.predicate(e,this.index++);this.skipping=!!t}catch(e){this.destination.error(e)}},t}(o.Subscriber)},4558(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5434),i=r(8244);t.startWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[e.length-1];return i.isScheduler(r)?(e.pop(),function(t){return n.concat(e,t,r)}):function(t){return n.concat(e,t)}}},15(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(8072);t.subscribeOn=function(e,t){return void 0===t&&(t=0),function(r){return r.lift(new i(e,t))}};var i=function(){function e(e,t){this.scheduler=e,this.delay=t}return e.prototype.call=function(e,t){return new n.SubscribeOnObservable(t,this.delay,this.scheduler).subscribe(e)},e}()},5433(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7912),i=r(4579);t.switchAll=function(){return n.switchMap(i.identity)}},7912(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(6808),a=r(4098),s=r(4398);t.switchMap=function e(t,r){return"function"==typeof r?function(n){return n.pipe(e(function(e,n){return a.from(t(e,n)).pipe(o.map(function(t,i){return r(e,t,n,i)}))}))}:function(e){return e.lift(new l(t))}};var l=function(){function e(e){this.project=e}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.project))},e}(),u=function(e){function t(t,r){var n=e.call(this,t)||this;return n.project=r,n.index=0,n}return i(t,e),t.prototype._next=function(e){var t,r=this.index++;try{t=this.project(e,r)}catch(e){this.destination.error(e);return}this._innerSub(t)},t.prototype._innerSub=function(e){var t=this.innerSubscription;t&&t.unsubscribe();var r=new s.SimpleInnerSubscriber(this),n=this.destination;n.add(r),this.innerSubscription=s.innerSubscribe(e,r),this.innerSubscription!==r&&n.add(this.innerSubscription)},t.prototype._complete=function(){var t=this.innerSubscription;(!t||t.closed)&&e.prototype._complete.call(this),this.unsubscribe()},t.prototype._unsubscribe=function(){this.innerSubscription=void 0},t.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&e.prototype._complete.call(this)},t.prototype.notifyNext=function(e){this.destination.next(e)},t}(s.SimpleOuterSubscriber)},7865(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7912);t.switchMapTo=function(e,t){return t?n.switchMap(function(){return e},t):n.switchMap(function(){return e})}},1231(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(7568),s=r(453);t.take=function(e){return function(t){return 0===e?s.empty():t.lift(new l(e))}};var l=function(){function e(e){if(this.total=e,this.total<0)throw new a.ArgumentOutOfRangeError}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.total))},e}(),u=function(e){function t(t,r){var n=e.call(this,t)||this;return n.total=r,n.count=0,n}return i(t,e),t.prototype._next=function(e){var t=this.total,r=++this.count;r<=t&&(this.destination.next(e),r===t&&(this.destination.complete(),this.unsubscribe()))},t}(o.Subscriber)},3439(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(7568),s=r(453);t.takeLast=function(e){return function(t){return 0===e?s.empty():t.lift(new l(e))}};var l=function(){function e(e){if(this.total=e,this.total<0)throw new a.ArgumentOutOfRangeError}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.total))},e}(),u=function(e){function t(t,r){var n=e.call(this,t)||this;return n.total=r,n.ring=[],n.count=0,n}return i(t,e),t.prototype._next=function(e){var t=this.ring,r=this.total,n=this.count++;t.length<r?t.push(e):t[n%r]=e},t.prototype._complete=function(){var e=this.destination,t=this.count;if(t>0)for(var r=this.count>=this.total?this.total:this.count,n=this.ring,i=0;i<r;i++){var o=t++%r;e.next(n[o])}e.complete()},t}(o.Subscriber)},1279(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(4398);t.takeUntil=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){var r=new s(e),n=o.innerSubscribe(this.notifier,new o.SimpleInnerSubscriber(r));return n&&!r.seenValue?(r.add(n),t.subscribe(r)):r},e}(),s=function(e){function t(t){var r=e.call(this,t)||this;return r.seenValue=!1,r}return i(t,e),t.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},t.prototype.notifyComplete=function(){},t}(o.SimpleOuterSubscriber)},6518(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.takeWhile=function(e,t){return void 0===t&&(t=!1),function(r){return r.lift(new a(e,t))}};var a=function(){function e(e,t){this.predicate=e,this.inclusive=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.inclusive))},e}(),s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.predicate=r,i.inclusive=n,i.index=0,i}return i(t,e),t.prototype._next=function(e){var t,r=this.destination;try{t=this.predicate(e,this.index++)}catch(e){r.error(e);return}this.nextOrComplete(e,t)},t.prototype.nextOrComplete=function(e,t){var r=this.destination;t?r.next(e):(this.inclusive&&r.next(e),r.complete())},t}(o.Subscriber)},1451(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(7653),s=r(3385);t.tap=function(e,t,r){return function(n){return n.lift(new l(e,t,r))}};var l=function(){function e(e,t,r){this.nextOrObserver=e,this.error=t,this.complete=r}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.nextOrObserver,this.error,this.complete))},e}(),u=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return o._tapNext=a.noop,o._tapError=a.noop,o._tapComplete=a.noop,o._tapError=n||a.noop,o._tapComplete=i||a.noop,s.isFunction(r)?(o._context=o,o._tapNext=r):r&&(o._context=r,o._tapNext=r.next||a.noop,o._tapError=r.error||a.noop,o._tapComplete=r.complete||a.noop),o}return i(t,e),t.prototype._next=function(e){try{this._tapNext.call(this._context,e)}catch(e){this.destination.error(e);return}this.destination.next(e)},t.prototype._error=function(e){try{this._tapError.call(this._context,e)}catch(e){this.destination.error(e);return}this.destination.error(e)},t.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(e){this.destination.error(e);return}return this.destination.complete()},t}(o.Subscriber)},464(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(4398);t.defaultThrottleConfig={leading:!0,trailing:!1},t.throttle=function(e,r){return void 0===r&&(r=t.defaultThrottleConfig),function(t){return t.lift(new a(e,!!r.leading,!!r.trailing))}};var a=function(){function e(e,t,r){this.durationSelector=e,this.leading=t,this.trailing=r}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.durationSelector,this.leading,this.trailing))},e}(),s=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return o.destination=t,o.durationSelector=r,o._leading=n,o._trailing=i,o._hasValue=!1,o}return i(t,e),t.prototype._next=function(e){this._hasValue=!0,this._sendValue=e,this._throttled||(this._leading?this.send():this.throttle(e))},t.prototype.send=function(){var e=this._hasValue,t=this._sendValue;e&&(this.destination.next(t),this.throttle(t)),this._hasValue=!1,this._sendValue=void 0},t.prototype.throttle=function(e){var t=this.tryDurationSelector(e);t&&this.add(this._throttled=o.innerSubscribe(t,new o.SimpleInnerSubscriber(this)))},t.prototype.tryDurationSelector=function(e){try{return this.durationSelector(e)}catch(e){return this.destination.error(e),null}},t.prototype.throttlingDone=function(){var e=this._throttled,t=this._trailing;e&&e.unsubscribe(),this._throttled=void 0,t&&this.send()},t.prototype.notifyNext=function(){this.throttlingDone()},t.prototype.notifyComplete=function(){this.throttlingDone()},t}(o.SimpleOuterSubscriber)},42(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(5190),s=r(464);t.throttleTime=function(e,t,r){return void 0===t&&(t=a.async),void 0===r&&(r=s.defaultThrottleConfig),function(n){return n.lift(new l(e,t,r.leading,r.trailing))}};var l=function(){function e(e,t,r,n){this.duration=e,this.scheduler=t,this.leading=r,this.trailing=n}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.duration,this.scheduler,this.leading,this.trailing))},e}(),u=function(e){function t(t,r,n,i,o){var a=e.call(this,t)||this;return a.duration=r,a.scheduler=n,a.leading=i,a.trailing=o,a._hasTrailingValue=!1,a._trailingValue=null,a}return i(t,e),t.prototype._next=function(e){this.throttled?this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(c,this.duration,{subscriber:this})),this.leading?this.destination.next(e):this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0))},t.prototype._complete=function(){this._hasTrailingValue&&this.destination.next(this._trailingValue),this.destination.complete()},t.prototype.clearThrottle=function(){var e=this.throttled;e&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),e.unsubscribe(),this.remove(e),this.throttled=null)},t}(o.Subscriber);function c(e){e.subscriber.clearThrottle()}},2056(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1136),a=r(1396);t.throwIfEmpty=function(e){return void 0===e&&(e=u),function(t){return t.lift(new s(e))}};var s=function(){function e(e){this.errorFactory=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.errorFactory))},e}(),l=function(e){function t(t,r){var n=e.call(this,t)||this;return n.errorFactory=r,n.hasValue=!1,n}return i(t,e),t.prototype._next=function(e){this.hasValue=!0,this.destination.next(e)},t.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var e=void 0;try{e=this.errorFactory()}catch(t){e=t}this.destination.error(e)},t}(a.Subscriber);function u(){return new o.EmptyError}},5276(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5190),i=r(253),o=r(3180),a=r(6808);t.timeInterval=function(e){return void 0===e&&(e=n.async),function(t){return o.defer(function(){return t.pipe(i.scan(function(t,r){var n=t.current;return{value:r,current:e.now(),last:n}},{current:e.now(),value:void 0,last:void 0}),a.map(function(e){var t=e.current,r=e.last;return new s(e.value,t-r)}))})}};var s=function(e,t){this.value=e,this.interval=t};t.TimeInterval=s},8673(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5190),i=r(3734),o=r(4053),a=r(1576);t.timeout=function(e,t){return void 0===t&&(t=n.async),o.timeoutWith(e,a.throwError(new i.TimeoutError),t)}},4053(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(5190),a=r(4465),s=r(4398);t.timeoutWith=function(e,t,r){return void 0===r&&(r=o.async),function(n){var i=a.isDate(e),o=i?e-r.now():Math.abs(e);return n.lift(new l(o,i,t,r))}};var l=function(){function e(e,t,r,n){this.waitFor=e,this.absoluteTimeout=t,this.withObservable=r,this.scheduler=n}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},e}(),u=function(e){function t(t,r,n,i,o){var a=e.call(this,t)||this;return a.absoluteTimeout=r,a.waitFor=n,a.withObservable=i,a.scheduler=o,a.scheduleTimeout(),a}return i(t,e),t.dispatchTimeout=function(e){var t=e.withObservable;e._unsubscribeAndRecycle(),e.add(s.innerSubscribe(t,new s.SimpleInnerSubscriber(e)))},t.prototype.scheduleTimeout=function(){var e=this.action;e?this.action=e.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(t.dispatchTimeout,this.waitFor,this))},t.prototype._next=function(t){this.absoluteTimeout||this.scheduleTimeout(),e.prototype._next.call(this,t)},t.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},t}(s.SimpleOuterSubscriber)},8858(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5190),i=r(6808);t.timestamp=function(e){return void 0===e&&(e=n.async),i.map(function(t){return new o(t,e.now())})};var o=function(e,t){this.value=e,this.timestamp=t};t.Timestamp=o},2284(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2518);function i(e,t,r){return 0===r?[t]:(e.push(t),e)}t.toArray=function(){return n.reduce(i,[])}},7544(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(2888),a=r(4398);t.window=function(e){return function(t){return t.lift(new s(e))}};var s=function(){function e(e){this.windowBoundaries=e}return e.prototype.call=function(e,t){var r=new l(e),n=t.subscribe(r);return n.closed||r.add(a.innerSubscribe(this.windowBoundaries,new a.SimpleInnerSubscriber(r))),n},e}(),l=function(e){function t(t){var r=e.call(this,t)||this;return r.window=new o.Subject,t.next(r.window),r}return i(t,e),t.prototype.notifyNext=function(){this.openWindow()},t.prototype.notifyError=function(e){this._error(e)},t.prototype.notifyComplete=function(){this._complete()},t.prototype._next=function(e){this.window.next(e)},t.prototype._error=function(e){this.window.error(e),this.destination.error(e)},t.prototype._complete=function(){this.window.complete(),this.destination.complete()},t.prototype._unsubscribe=function(){this.window=null},t.prototype.openWindow=function(){var e=this.window;e&&e.complete();var t=this.destination,r=this.window=new o.Subject;t.next(r)},t}(a.SimpleOuterSubscriber)},1565(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(2888);t.windowCount=function(e,t){return void 0===t&&(t=0),function(r){return r.lift(new s(e,t))}};var s=function(){function e(e,t){this.windowSize=e,this.startWindowEvery=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.windowSize,this.startWindowEvery))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.destination=t,i.windowSize=r,i.startWindowEvery=n,i.windows=[new a.Subject],i.count=0,t.next(i.windows[0]),i}return i(t,e),t.prototype._next=function(e){for(var t=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,r=this.destination,n=this.windowSize,i=this.windows,o=i.length,s=0;s<o&&!this.closed;s++)i[s].next(e);var l=this.count-n+1;if(l>=0&&l%t==0&&!this.closed&&i.shift().complete(),++this.count%t==0&&!this.closed){var u=new a.Subject;i.push(u),r.next(u)}},t.prototype._error=function(e){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().error(e);this.destination.error(e)},t.prototype._complete=function(){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().complete();this.destination.complete()},t.prototype._unsubscribe=function(){this.count=0,this.windows=null},t}(o.Subscriber)},3877(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(2888),a=r(5190),s=r(1396),l=r(5390),u=r(8244);t.windowTime=function(e){var t=a.async,r=null,n=1/0;return u.isScheduler(arguments[3])&&(t=arguments[3]),u.isScheduler(arguments[2])?t=arguments[2]:l.isNumeric(arguments[2])&&(n=Number(arguments[2])),u.isScheduler(arguments[1])?t=arguments[1]:l.isNumeric(arguments[1])&&(r=Number(arguments[1])),function(i){return i.lift(new c(e,r,n,t))}};var c=function(){function e(e,t,r,n){this.windowTimeSpan=e,this.windowCreationInterval=t,this.maxWindowSize=r,this.scheduler=n}return e.prototype.call=function(e,t){return t.subscribe(new p(e,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},e}(),d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._numberOfNextedValues=0,t}return i(t,e),t.prototype.next=function(t){this._numberOfNextedValues++,e.prototype.next.call(this,t)},Object.defineProperty(t.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),t}(o.Subject),p=function(e){function t(t,r,n,i,o){var a=e.call(this,t)||this;a.destination=t,a.windowTimeSpan=r,a.windowCreationInterval=n,a.maxWindowSize=i,a.scheduler=o,a.windows=[];var s=a.openWindow();return null!==n&&n>=0?(a.add(o.schedule(m,r,{subscriber:a,window:s,context:null})),a.add(o.schedule(h,n,{windowTimeSpan:r,windowCreationInterval:n,subscriber:a,scheduler:o}))):a.add(o.schedule(f,r,{subscriber:a,window:s,windowTimeSpan:r})),a}return i(t,e),t.prototype._next=function(e){for(var t=this.windows,r=t.length,n=0;n<r;n++){var i=t[n];!i.closed&&(i.next(e),i.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(i))}},t.prototype._error=function(e){for(var t=this.windows;t.length>0;)t.shift().error(e);this.destination.error(e)},t.prototype._complete=function(){for(var e=this.windows;e.length>0;){var t=e.shift();t.closed||t.complete()}this.destination.complete()},t.prototype.openWindow=function(){var e=new d;return this.windows.push(e),this.destination.next(e),e},t.prototype.closeWindow=function(e){e.complete();var t=this.windows;t.splice(t.indexOf(e),1)},t}(s.Subscriber);function f(e){var t=e.subscriber,r=e.windowTimeSpan,n=e.window;n&&t.closeWindow(n),e.window=t.openWindow(),this.schedule(e,r)}function h(e){var t=e.windowTimeSpan,r=e.subscriber,n=e.scheduler,i=e.windowCreationInterval,o=r.openWindow(),a={action:this,subscription:null};a.subscription=n.schedule(m,t,{subscriber:r,window:o,context:a}),this.add(a.subscription),this.schedule(e,i)}function m(e){var t=e.subscriber,r=e.window,n=e.context;n&&n.action&&n.subscription&&n.action.remove(n.subscription),t.closeWindow(r)}},5428(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(2888),a=r(3207),s=r(5905),l=r(7849);t.windowToggle=function(e,t){return function(r){return r.lift(new u(e,t))}};var u=function(){function e(e,t){this.openings=e,this.closingSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.openings,this.closingSelector))},e}(),c=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.openings=r,i.closingSelector=n,i.contexts=[],i.add(i.openSubscription=l.subscribeToResult(i,r,r)),i}return i(t,e),t.prototype._next=function(e){var t=this.contexts;if(t)for(var r=t.length,n=0;n<r;n++)t[n].window.next(e)},t.prototype._error=function(t){var r=this.contexts;if(this.contexts=null,r)for(var n=r.length,i=-1;++i<n;){var o=r[i];o.window.error(t),o.subscription.unsubscribe()}e.prototype._error.call(this,t)},t.prototype._complete=function(){var t=this.contexts;if(this.contexts=null,t)for(var r=t.length,n=-1;++n<r;){var i=t[n];i.window.complete(),i.subscription.unsubscribe()}e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){var e=this.contexts;if(this.contexts=null,e)for(var t=e.length,r=-1;++r<t;){var n=e[r];n.window.unsubscribe(),n.subscription.unsubscribe()}},t.prototype.notifyNext=function(e,t,r,n,i){if(e===this.openings){var s=void 0;try{s=(0,this.closingSelector)(t)}catch(e){return this.error(e)}var u=new o.Subject,c=new a.Subscription,d={window:u,subscription:c};this.contexts.push(d);var p=l.subscribeToResult(this,s,d);p.closed?this.closeWindow(this.contexts.length-1):(p.context=d,c.add(p)),this.destination.next(u)}else this.closeWindow(this.contexts.indexOf(e))},t.prototype.notifyError=function(e){this.error(e)},t.prototype.notifyComplete=function(e){e!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(e.context))},t.prototype.closeWindow=function(e){if(-1!==e){var t=this.contexts,r=t[e],n=r.window,i=r.subscription;t.splice(e,1),n.complete(),i.unsubscribe()}},t}(s.OuterSubscriber)},9284(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(2888),a=r(5905),s=r(7849);t.windowWhen=function(e){return function(t){return t.lift(new l(e))}};var l=function(){function e(e){this.closingSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.closingSelector))},e}(),u=function(e){function t(t,r){var n=e.call(this,t)||this;return n.destination=t,n.closingSelector=r,n.openWindow(),n}return i(t,e),t.prototype.notifyNext=function(e,t,r,n,i){this.openWindow(i)},t.prototype.notifyError=function(e){this._error(e)},t.prototype.notifyComplete=function(e){this.openWindow(e)},t.prototype._next=function(e){this.window.next(e)},t.prototype._error=function(e){this.window.error(e),this.destination.error(e),this.unsubscribeClosingNotification()},t.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},t.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},t.prototype.openWindow=function(e){void 0===e&&(e=null),e&&(this.remove(e),e.unsubscribe());var t,r=this.window;r&&r.complete();var n=this.window=new o.Subject;this.destination.next(n);try{t=(0,this.closingSelector)()}catch(e){this.destination.error(e),this.window.error(e);return}this.add(this.closingNotification=s.subscribeToResult(this,t))},t}(a.OuterSubscriber)},3564(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(5905),a=r(7849);t.withLatestFrom=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){var r;return"function"==typeof e[e.length-1]&&(r=e.pop()),t.lift(new s(e,r))}};var s=function(){function e(e,t){this.observables=e,this.project=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.observables,this.project))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;i.observables=r,i.project=n,i.toRespond=[];var o=r.length;i.values=Array(o);for(var s=0;s<o;s++)i.toRespond.push(s);for(var s=0;s<o;s++){var l=r[s];i.add(a.subscribeToResult(i,l,void 0,s))}return i}return i(t,e),t.prototype.notifyNext=function(e,t,r){this.values[r]=t;var n=this.toRespond;if(n.length>0){var i=n.indexOf(r);-1!==i&&n.splice(i,1)}},t.prototype.notifyComplete=function(){},t.prototype._next=function(e){if(0===this.toRespond.length){var t=[e].concat(this.values);this.project?this._tryProject(t):this.destination.next(t)}},t.prototype._tryProject=function(e){var t;try{t=this.project.apply(this,e)}catch(e){this.destination.error(e);return}this.destination.next(t)},t}(o.OuterSubscriber)},909(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(887);t.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(n.zip.apply(void 0,[t].concat(e)))}}},3282(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(887);t.zipAll=function(e){return function(t){return t.lift(new n.ZipOperator(e))}}},8822(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2515),i=r(3207);t.scheduleArray=function(e,t){return new n.Observable(function(r){var n=new i.Subscription,o=0;return n.add(t.schedule(function(){o===e.length?r.complete():(r.next(e[o++]),r.closed||n.add(this.schedule()))})),n})}},229(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2515),i=r(3207),o=r(7211);t.scheduleIterable=function(e,t){if(!e)throw Error("Iterable cannot be null");return new n.Observable(function(r){var n,a=new i.Subscription;return a.add(function(){n&&"function"==typeof n.return&&n.return()}),a.add(t.schedule(function(){n=e[o.iterator](),a.add(t.schedule(function(){if(!r.closed){try{var e,t,i=n.next();e=i.value,t=i.done}catch(e){r.error(e);return}t?r.complete():(r.next(e),this.schedule())}}))})),a})}},2(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2515),i=r(3207),o=r(6676);t.scheduleObservable=function(e,t){return new n.Observable(function(r){var n=new i.Subscription;return n.add(t.schedule(function(){var i=e[o.observable]();n.add(i.subscribe({next:function(e){n.add(t.schedule(function(){return r.next(e)}))},error:function(e){n.add(t.schedule(function(){return r.error(e)}))},complete:function(){n.add(t.schedule(function(){return r.complete()}))}}))})),n})}},1138(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2515),i=r(3207);t.schedulePromise=function(e,t){return new n.Observable(function(r){var n=new i.Subscription;return n.add(t.schedule(function(){return e.then(function(e){n.add(t.schedule(function(){r.next(e),n.add(t.schedule(function(){return r.complete()}))}))},function(e){n.add(t.schedule(function(){return r.error(e)}))})})),n})}},7315(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2),i=r(1138),o=r(8822),a=r(229),s=r(6565),l=r(7328),u=r(1087),c=r(2555);t.scheduled=function(e,t){if(null!=e){if(s.isInteropObservable(e))return n.scheduleObservable(e,t);else if(l.isPromise(e))return i.schedulePromise(e,t);else if(u.isArrayLike(e))return o.scheduleArray(e,t);else if(c.isIterable(e)||"string"==typeof e)return a.scheduleIterable(e,t)}throw TypeError((null!==e&&typeof e||e)+" is not observable")}},5666(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.Action=function(e){function t(t,r){return e.call(this)||this}return i(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(r(3207).Subscription)},2883(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(772);t.AsapAction=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.requestAsyncId=function(t,r,n){return(void 0===n&&(n=0),null!==n&&n>0)?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t.scheduled||(t.scheduled=o.Immediate.setImmediate(t.flush.bind(t,null))))},t.prototype.recycleAsyncId=function(t,r,n){if(void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);0===t.actions.length&&(o.Immediate.clearImmediate(r),t.scheduled=void 0)},t}(r(1076).AsyncAction)},3728(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsapScheduler=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.flush=function(e){this.active=!0,this.scheduled=void 0;var t,r=this.actions,n=-1,i=r.length;e=e||r.shift();do if(t=e.execute(e.state,e.delay))break;while(++n<i&&(e=r.shift()));if(this.active=!1,t){for(;++n<i&&(e=r.shift());)e.unsubscribe();throw t}},t}(r(4333).AsyncScheduler)},1076(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncAction=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n.pending=!1,n}return i(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r=this.id,n=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(n,r,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(n,this.id,t),this},t.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),setInterval(e.flush.bind(e,this),r)},t.prototype.recycleAsyncId=function(e,t,r){if(void 0===r&&(r=0),null!==r&&this.delay===r&&!1===this.pending)return t;clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,t);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var r=!1,n=void 0;try{this.work(e)}catch(e){r=!0,n=!!e&&e||Error(e)}if(r)return this.unsubscribe(),n},t.prototype._unsubscribe=function(){var e=this.id,t=this.scheduler,r=t.actions,n=r.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==n&&r.splice(n,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null},t}(r(5666).Action)},4333(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(3849);t.AsyncScheduler=function(e){function t(r,n){void 0===n&&(n=o.Scheduler.now);var i=e.call(this,r,function(){return t.delegate&&t.delegate!==i?t.delegate.now():n()})||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return i(t,e),t.prototype.schedule=function(r,n,i){return(void 0===n&&(n=0),t.delegate&&t.delegate!==this)?t.delegate.schedule(r,n,i):e.prototype.schedule.call(this,r,n,i)},t.prototype.flush=function(e){var t,r=this.actions;if(this.active)return void r.push(e);this.active=!0;do if(t=e.execute(e.state,e.delay))break;while(e=r.shift());if(this.active=!1,t){for(;e=r.shift();)e.unsubscribe();throw t}},t}(o.Scheduler)},6847(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.QueueAction=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.schedule=function(t,r){return(void 0===r&&(r=0),r>0)?e.prototype.schedule.call(this,t,r):(this.delay=r,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,r){return r>0||this.closed?e.prototype.execute.call(this,t,r):this._execute(t,r)},t.prototype.requestAsyncId=function(t,r,n){return(void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0)?e.prototype.requestAsyncId.call(this,t,r,n):t.flush(this)},t}(r(1076).AsyncAction)},5044(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.QueueScheduler=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(r(4333).AsyncScheduler)},2745(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2883);t.asapScheduler=new(r(3728)).AsapScheduler(n.AsapAction),t.asap=t.asapScheduler},5190(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1076);t.asyncScheduler=new(r(4333)).AsyncScheduler(n.AsyncAction),t.async=t.asyncScheduler},5677(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(6847);t.queueScheduler=new(r(5044)).QueueScheduler(n.QueueAction),t.queue=t.queueScheduler},7211(e,t){"use strict";function r(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}Object.defineProperty(t,"__esModule",{value:!0}),t.getSymbolIterator=r,t.iterator=r(),t.$$iterator=t.iterator},6676(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observable="function"==typeof Symbol&&Symbol.observable||"@@observable"},4421(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rxSubscriber="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random(),t.$$rxSubscriber=t.rxSubscriber},7568(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArgumentOutOfRangeError=function(){function e(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return e.prototype=Object.create(Error.prototype),e}()},1136(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyError=function(){function e(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return e.prototype=Object.create(Error.prototype),e}()},772(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=1,n=Promise.resolve(),i={};function o(e){return e in i&&(delete i[e],!0)}t.Immediate={setImmediate:function(e){var t=r++;return i[t]=!0,n.then(function(){return o(t)&&e()}),t},clearImmediate:function(e){o(e)}},t.TestTools={pending:function(){return Object.keys(i).length}}},6967(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectUnsubscribedError=function(){function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e}()},3734(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TimeoutError=function(){function e(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return e.prototype=Object.create(Error.prototype),e}()},1245(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnsubscriptionError=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map(function(e,t){return t+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}()},4487(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1396);t.canReportError=function(e){for(;e;){var t=e,r=t.closed,i=t.destination,o=t.isStopped;if(r||o)return!1;e=i&&i instanceof n.Subscriber?i:null}return!0}},4163(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hostReportError=function(e){setTimeout(function(){throw e},0)}},4579(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.identity=function(e){return e}},4728(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isArray=Array.isArray||function(e){return e&&"number"==typeof e.length}},1087(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isArrayLike=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},4465(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDate=function(e){return e instanceof Date&&!isNaN(+e)}},3385(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isFunction=function(e){return"function"==typeof e}},6565(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(6676);t.isInteropObservable=function(e){return e&&"function"==typeof e[n.observable]}},2555(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7211);t.isIterable=function(e){return e&&"function"==typeof e[n.iterator]}},5390(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4728);t.isNumeric=function(e){return!n.isArray(e)&&e-parseFloat(e)+1>=0}},194(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=function(e){return null!==e&&"object"==typeof e}},7328(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPromise=function(e){return!!e&&"function"!=typeof e.subscribe&&"function"==typeof e.then}},8244(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isScheduler=function(e){return e&&"function"==typeof e.schedule}},7653(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.noop=function(){}},5352(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.not=function(e,t){function r(){return!r.pred.apply(r.thisArg,arguments)}return r.pred=e,r.thisArg=t,r}},8173(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4579);function i(e){return 0===e.length?n.identity:1===e.length?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}t.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i(e)},t.pipeFromArray=i},7092(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(499),i=r(5259),o=r(8190),a=r(1021),s=r(1087),l=r(7328),u=r(194),c=r(7211),d=r(6676);t.subscribeTo=function(e){if(e&&"function"==typeof e[d.observable])return a.subscribeToObservable(e);if(s.isArrayLike(e))return n.subscribeToArray(e);if(l.isPromise(e))return i.subscribeToPromise(e);if(e&&"function"==typeof e[c.iterator])return o.subscribeToIterable(e);throw TypeError("You provided "+(u.isObject(e)?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")}},499(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeToArray=function(e){return function(t){for(var r=0,n=e.length;r<n&&!t.closed;r++)t.next(e[r]);t.complete()}}},8190(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7211);t.subscribeToIterable=function(e){return function(t){for(var r=e[n.iterator]();;){var i=void 0;try{i=r.next()}catch(e){return t.error(e),t}if(i.done){t.complete();break}if(t.next(i.value),t.closed)break}return"function"==typeof r.return&&t.add(function(){r.return&&r.return()}),t}}},1021(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(6676);t.subscribeToObservable=function(e){return function(t){var r=e[n.observable]();if("function"==typeof r.subscribe)return r.subscribe(t);throw TypeError("Provided object does not correctly implement Symbol.observable")}}},5259(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4163);t.subscribeToPromise=function(e){return function(t){return e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,n.hostReportError),t}}},7849(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4470),i=r(7092),o=r(2515);t.subscribeToResult=function(e,t,r,a,s){if(void 0===s&&(s=new n.InnerSubscriber(e,r,a)),!s.closed)return t instanceof o.Observable?t.subscribe(s):i.subscribeTo(t)(s)}},5158(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1396),i=r(4421),o=r(2544);t.toSubscriber=function(e,t,r){if(e){if(e instanceof n.Subscriber)return e;if(e[i.rxSubscriber])return e[i.rxSubscriber]()}return e||t||r?new n.Subscriber(e,t,r):new n.Subscriber(o.empty)}},6170(e,t,r){"use strict";r(8461).audit,r(2392).auditTime,r(7954).buffer,r(647).bufferCount,r(6327).bufferTime,r(6786).bufferToggle,r(1662).bufferWhen,r(5503).catchError,r(4908).combineAll,r(9060).combineLatest,r(6600).concat,r(6345).concatAll,r(2248).concatMap,r(3577).concatMapTo,r(8765).count,r(3287).debounce,r(5685).debounceTime,r(2767).defaultIfEmpty,r(6965).delay,r(9861).delayWhen,r(7642).dematerialize,r(8820).distinct,r(9391).distinctUntilChanged,r(5075).distinctUntilKeyChanged,r(2399).elementAt,r(2631).endWith,r(7233).every,r(2408).exhaust,r(1112).exhaustMap,r(7736).expand,r(2670).filter,r(1258).finalize,r(5063).find,r(2939).findIndex,r(9948).first,r(7784).groupBy,r(6863).ignoreElements,r(3371).isEmpty,r(7064).last,t.map=r(6808).map,r(3353).mapTo,r(2539).materialize,r(6416).max,r(1570).merge,r(9287).mergeAll;var n=r(5206);n.mergeMap,n.flatMap,r(9019).mergeMapTo,r(2307).mergeScan,r(7198).min,r(4864).multicast,r(5495).observeOn,r(5029).onErrorResumeNext,r(7304).pairwise,r(4236).partition,r(1075).pluck,r(5485).publish,r(91).publishBehavior,r(3433).publishLast,r(9622).publishReplay,r(6721).race,r(2518).reduce,r(6483).repeat,r(283).repeatWhen,r(3160).retry,r(5508).retryWhen,r(6888).refCount,r(1754).sample,r(1183).sampleTime,r(253).scan,r(5017).sequenceEqual,r(3213).share,r(8614).shareReplay,r(8480).single,r(4775).skip,r(2807).skipLast,r(2519).skipUntil,r(4846).skipWhile,r(4558).startWith,r(15).subscribeOn,r(5433).switchAll,r(7912).switchMap,r(7865).switchMapTo,t.take=r(1231).take,r(3439).takeLast,r(1279).takeUntil,r(6518).takeWhile,r(1451).tap,r(464).throttle,r(42).throttleTime,r(2056).throwIfEmpty,r(5276).timeInterval,r(8673).timeout,r(4053).timeoutWith,r(8858).timestamp,r(2284).toArray,r(7544).window,r(1565).windowCount,r(3877).windowTime,r(5428).windowToggle,r(9284).windowWhen,r(3564).withLatestFrom,r(909).zip,r(3282).zipAll},3904(e,t,r){"use strict";let n=Symbol("SemVer ANY");class i{static get ANY(){return n}constructor(e,t){if(t=o(t),e instanceof i)if(!!t.loose===e.loose)return e;else e=e.value;u("comparator",e=e.trim().split(/\s+/).join(" "),t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===n?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){let t=this.options.loose?a[s.COMPARATORLOOSE]:a[s.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new c(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===n||e===n)return!0;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw TypeError("a Comparator is required");return""===this.operator?""===this.value||new d(e.value,t).test(this.value):""===e.operator?""===e.value||new d(this.value,t).test(e.semver):!((t=o(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))}}e.exports=i;let o=r(8587),{safeRe:a,t:s}=r(9718),l=r(2111),u=r(7272),c=r(3908),d=r(8311)},8311(e,t,r){"use strict";let n=/\s+/g;class i{constructor(e,t){if(t=a(t),e instanceof i)if(!!t.loose===e.loose&&!!t.includePrerelease===e.includePrerelease)return e;else return new i(e.raw,t);if(e instanceof s)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(n," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!g(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1){for(const e of this.set)if(1===e.length&&b(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=((this.options.includePrerelease&&m)|(this.options.loose&&y))+":"+e,r=o.get(t);if(r)return r;let n=this.options.loose,i=n?c[d.HYPHENRANGELOOSE]:c[d.HYPHENRANGE];l("hyphen replace",e=e.replace(i,T(this.options.includePrerelease))),l("comparator trim",e=e.replace(c[d.COMPARATORTRIM],p)),l("tilde trim",e=e.replace(c[d.TILDETRIM],f)),l("caret trim",e=e.replace(c[d.CARETTRIM],h));let a=e.split(" ").map(e=>w(e,this.options)).join(" ").split(/\s+/).map(e=>j(e,this.options));n&&(a=a.filter(e=>(l("loose invalid filter",e,this.options),!!e.match(c[d.COMPARATORLOOSE])))),l("range list",a);let u=new Map;for(let e of a.map(e=>new s(e,this.options))){if(g(e))return[e];u.set(e.value,e)}u.size>1&&u.has("")&&u.delete("");let b=[...u.values()];return o.set(t,b),b}intersects(e,t){if(!(e instanceof i))throw TypeError("a Range is required");return this.set.some(r=>v(r,t)&&e.set.some(e=>v(e,t)&&r.every(r=>e.every(e=>r.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(R(this.set[t],e,this.options))return!0;return!1}}e.exports=i;let o=new(r(8794)),a=r(8587),s=r(3904),l=r(7272),u=r(3908),{safeRe:c,t:d,comparatorTrimReplace:p,tildeTrimReplace:f,caretTrimReplace:h}=r(9718),{FLAG_INCLUDE_PRERELEASE:m,FLAG_LOOSE:y}=r(6874),g=e=>"<0.0.0-0"===e.value,b=e=>""===e.value,v=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();for(;r&&n.length;)r=n.every(e=>i.intersects(e,t)),i=n.pop();return r},w=(e,t)=>(l("comp",e=e.replace(c[d.BUILD],""),t),l("caret",e=D(e,t)),l("tildes",e=E(e,t)),l("xrange",e=P(e,t)),l("stars",e=k(e,t)),e),x=e=>!e||"x"===e.toLowerCase()||"*"===e,E=(e,t)=>e.trim().split(/\s+/).map(e=>S(e,t)).join(" "),S=(e,t)=>{let r=t.loose?c[d.TILDELOOSE]:c[d.TILDE];return e.replace(r,(t,r,n,i,o)=>{let a;return l("tilde",e,t,r,n,i,o),x(r)?a="":x(n)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:x(i)?a=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:o?(l("replaceTilde pr",o),a=`>=${r}.${n}.${i}-${o} <${r}.${+n+1}.0-0`):a=`>=${r}.${n}.${i} <${r}.${+n+1}.0-0`,l("tilde return",a),a})},D=(e,t)=>e.trim().split(/\s+/).map(e=>O(e,t)).join(" "),O=(e,t)=>{l("caret",e,t);let r=t.loose?c[d.CARETLOOSE]:c[d.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(t,r,i,o,a)=>{let s;return l("caret",e,t,r,i,o,a),x(r)?s="":x(i)?s=`>=${r}.0.0${n} <${+r+1}.0.0-0`:x(o)?s="0"===r?`>=${r}.${i}.0${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${n} <${+r+1}.0.0-0`:a?(l("replaceCaret pr",a),s="0"===r?"0"===i?`>=${r}.${i}.${o}-${a} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}-${a} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o}-${a} <${+r+1}.0.0-0`):(l("no pr"),s="0"===r?"0"===i?`>=${r}.${i}.${o}${n} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o} <${+r+1}.0.0-0`),l("caret return",s),s})},P=(e,t)=>(l("replaceXRanges",e,t),e.split(/\s+/).map(e=>C(e,t)).join(" ")),C=(e,t)=>{e=e.trim();let r=t.loose?c[d.XRANGELOOSE]:c[d.XRANGE];return e.replace(r,(r,n,i,o,a,s)=>{l("xRange",e,r,n,i,o,a,s);let u=x(i),c=u||x(o),d=c||x(a);return"="===n&&d&&(n=""),s=t.includePrerelease?"-0":"",u?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&d?(c&&(o=0),a=0,">"===n?(n=">=",c?(i=+i+1,o=0):o=+o+1,a=0):"<="===n&&(n="<",c?i=+i+1:o=+o+1),"<"===n&&(s="-0"),r=`${n+i}.${o}.${a}${s}`):c?r=`>=${i}.0.0${s} <${+i+1}.0.0-0`:d&&(r=`>=${i}.${o}.0${s} <${i}.${+o+1}.0-0`),l("xRange return",r),r})},k=(e,t)=>(l("replaceStars",e,t),e.trim().replace(c[d.STAR],"")),j=(e,t)=>(l("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?d.GTE0PRE:d.GTE0],"")),T=e=>(t,r,n,i,o,a,s,l,u,c,d,p)=>(r=x(n)?"":x(i)?`>=${n}.0.0${e?"-0":""}`:x(o)?`>=${n}.${i}.0${e?"-0":""}`:a?`>=${r}`:`>=${r}${e?"-0":""}`,l=x(u)?"":x(c)?`<${+u+1}.0.0-0`:x(d)?`<${u}.${+c+1}.0-0`:p?`<=${u}.${c}.${d}-${p}`:e?`<${u}.${c}.${+d+1}-0`:`<=${l}`,`${r} ${l}`.trim()),R=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(l(e[r].semver),e[r].semver!==s.ANY&&e[r].semver.prerelease.length>0){let n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}},3908(e,t,r){"use strict";let n=r(7272),{MAX_LENGTH:i,MAX_SAFE_INTEGER:o}=r(6874),{safeRe:a,t:s}=r(9718),l=r(8587),{compareIdentifiers:u}=r(1123);class c{constructor(e,t){if(t=l(t),e instanceof c)if(!!t.loose===e.loose&&!!t.includePrerelease===e.includePrerelease)return e;else e=e.version;else if("string"!=typeof e)throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>i)throw TypeError(`version is longer than ${i} characters`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?a[s.LOOSE]:a[s.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>o||this.major<0)throw TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<o)return t}return e}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(n("SemVer.compare",this.version,this.options,e),!(e instanceof c)){if("string"==typeof e&&e===this.version)return 0;e=new c(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return(e instanceof c||(e=new c(e,this.options)),this.major<e.major)?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:+(this.patch>e.patch)}comparePre(e){if(e instanceof c||(e=new c(e,this.options)),this.prerelease.length&&!e.prerelease.length)return -1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],i=e.prerelease[t];if(n("prerelease compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return -1;else if(r===i)continue;else return u(r,i)}while(++t)}compareBuild(e){e instanceof c||(e=new c(e,this.options));let t=0;do{let r=this.build[t],i=e.build[t];if(n("build compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return -1;else if(r===i)continue;else return u(r,i)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&!1===r)throw Error("invalid increment argument: identifier is empty");if(t){let e=`-${t}`.match(this.options.loose?a[s.PRERELEASELOOSE]:a[s.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(0===this.prerelease.length)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(0!==this.minor||0!==this.patch||0===this.prerelease.length)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(0!==this.patch||0===this.prerelease.length)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{let e=+!!Number(r);if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===u(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=c},7414(e,t,r){"use strict";let n=r(144);e.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},2111(e,t,r){"use strict";let n=r(4641),i=r(3999),o=r(3199),a=r(4089),s=r(7059),l=r(5200);e.exports=(e,t,r,u)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return n(e,r,u);case"!=":return i(e,r,u);case">":return o(e,r,u);case">=":return a(e,r,u);case"<":return s(e,r,u);case"<=":return l(e,r,u);default:throw TypeError(`Invalid operator: ${t}`)}}},3789(e,t,r){"use strict";let n=r(3908),i=r(144),{safeRe:o,t:a}=r(9718);e.exports=(e,t)=>{if(e instanceof n)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let n,i=t.includePrerelease?o[a.COERCERTLFULL]:o[a.COERCERTL];for(;(n=i.exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&n.index+n[0].length===r.index+r[0].length||(r=n),i.lastIndex=n.index+n[1].length+n[2].length;i.lastIndex=-1}else r=e.match(t.includePrerelease?o[a.COERCEFULL]:o[a.COERCE]);if(null===r)return null;let s=r[2],l=r[3]||"0",u=r[4]||"0",c=t.includePrerelease&&r[5]?`-${r[5]}`:"",d=t.includePrerelease&&r[6]?`+${r[6]}`:"";return i(`${s}.${l}.${u}${c}${d}`,t)}},3290(e,t,r){"use strict";let n=r(3908);e.exports=(e,t,r)=>{let i=new n(e,r),o=new n(t,r);return i.compare(o)||i.compareBuild(o)}},1763(e,t,r){"use strict";let n=r(560);e.exports=(e,t)=>n(e,t,!0)},560(e,t,r){"use strict";let n=r(3908);e.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))},1832(e,t,r){"use strict";let n=r(144);e.exports=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),o=r.compare(i);if(0===o)return null;let a=o>0,s=a?r:i,l=a?i:r,u=!!s.prerelease.length;if(l.prerelease.length&&!u){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(s))return l.minor&&!l.patch?"minor":"patch"}let c=u?"pre":"";return r.major!==i.major?c+"major":r.minor!==i.minor?c+"minor":r.patch!==i.patch?c+"patch":"prerelease"}},4641(e,t,r){"use strict";let n=r(560);e.exports=(e,t,r)=>0===n(e,t,r)},3199(e,t,r){"use strict";let n=r(560);e.exports=(e,t,r)=>n(e,t,r)>0},4089(e,t,r){"use strict";let n=r(560);e.exports=(e,t,r)=>n(e,t,r)>=0},3007(e,t,r){"use strict";let n=r(3908);e.exports=(e,t,r,i,o)=>{"string"==typeof r&&(o=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,o).version}catch(e){return null}}},7059(e,t,r){"use strict";let n=r(560);e.exports=(e,t,r)=>0>n(e,t,r)},5200(e,t,r){"use strict";let n=r(560);e.exports=(e,t,r)=>0>=n(e,t,r)},2938(e,t,r){"use strict";let n=r(3908);e.exports=(e,t)=>new n(e,t).major},6254(e,t,r){"use strict";let n=r(3908);e.exports=(e,t)=>new n(e,t).minor},3999(e,t,r){"use strict";let n=r(560);e.exports=(e,t,r)=>0!==n(e,t,r)},144(e,t,r){"use strict";let n=r(3908);e.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}},4493(e,t,r){"use strict";let n=r(3908);e.exports=(e,t)=>new n(e,t).patch},1729(e,t,r){"use strict";let n=r(144);e.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}},9970(e,t,r){"use strict";let n=r(560);e.exports=(e,t,r)=>n(t,e,r)},4277(e,t,r){"use strict";let n=r(3290);e.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))},7638(e,t,r){"use strict";let n=r(8311);e.exports=(e,t,r)=>{try{t=new n(t,r)}catch(e){return!1}return t.test(e)}},3927(e,t,r){"use strict";let n=r(3290);e.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))},6953(e,t,r){"use strict";let n=r(144);e.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}},9589(e,t,r){"use strict";let n=r(9718),i=r(6874),o=r(3908),a=r(1123),s=r(144),l=r(6953),u=r(7414),c=r(3007),d=r(1832),p=r(2938),f=r(6254),h=r(4493),m=r(1729),y=r(560),g=r(9970),b=r(1763),v=r(3290),w=r(3927),x=r(4277),E=r(3199),S=r(7059),D=r(4641),O=r(3999),P=r(4089),C=r(5200),k=r(2111),j=r(3789),T=r(3904),R=r(8311),A=r(7638),N=r(7631),M=r(9628),I=r(270),$=r(1261),L=r(3874),F=r(7075),B=r(5571),V=r(5342),U=r(6780);e.exports={parse:s,valid:l,clean:u,inc:c,diff:d,major:p,minor:f,patch:h,prerelease:m,compare:y,rcompare:g,compareLoose:b,compareBuild:v,sort:w,rsort:x,gt:E,lt:S,eq:D,neq:O,gte:P,lte:C,cmp:k,coerce:j,Comparator:T,Range:R,satisfies:A,toComparators:N,maxSatisfying:M,minSatisfying:I,minVersion:$,validRange:L,outside:F,gtr:B,ltr:V,intersects:U,simplifyRange:r(2525),subset:r(5032),SemVer:o,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:a.compareIdentifiers,rcompareIdentifiers:a.rcompareIdentifiers}},6874(e){"use strict";e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||0x1fffffffffffff,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},7272(e){"use strict";e.exports="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{}},1123(e){"use strict";let t=/^[0-9]+$/,r=(e,r)=>{if("number"==typeof e&&"number"==typeof r)return e===r?0:e<r?-1:1;let n=t.test(e),i=t.test(r);return n&&i&&(e*=1,r*=1),e===r?0:n&&!i?-1:i&&!n?1:e<r?-1:1};e.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}},8794(e){"use strict";e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(void 0!==t)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},8587(e){"use strict";let t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},9718(e,t,r){"use strict";let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:o}=r(6874),a=r(7272),s=(t=e.exports={}).re=[],l=t.safeRe=[],u=t.src=[],c=t.safeSrc=[],d=t.t={},p=0,f="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",o],[f,i]],m=(e,t,r)=>{let n=(e=>{for(let[t,r]of h)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),i=p++;a(e,i,t),d[e]=i,u[i]=t,c[i]=n,s[i]=new RegExp(t,r?"g":void 0),l[i]=new RegExp(n,r?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),m("MAINVERSION",`(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${u[d.NONNUMERICIDENTIFIER]}|${u[d.NUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${u[d.NONNUMERICIDENTIFIER]}|${u[d.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASE",`(?:-(${u[d.PRERELEASEIDENTIFIER]}(?:\\.${u[d.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${u[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[d.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${f}+`),m("BUILD",`(?:\\+(${u[d.BUILDIDENTIFIER]}(?:\\.${u[d.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${u[d.MAINVERSION]}${u[d.PRERELEASE]}?${u[d.BUILD]}?`),m("FULL",`^${u[d.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${u[d.MAINVERSIONLOOSE]}${u[d.PRERELEASELOOSE]}?${u[d.BUILD]}?`),m("LOOSE",`^${u[d.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${u[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${u[d.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:${u[d.PRERELEASE]})?${u[d.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:${u[d.PRERELEASELOOSE]})?${u[d.BUILD]}?)?)?`),m("XRANGE",`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAINLOOSE]}$`),m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),m("COERCE",`${u[d.COERCEPLAIN]}(?:$|[^\\d])`),m("COERCEFULL",u[d.COERCEPLAIN]+`(?:${u[d.PRERELEASE]})?`+`(?:${u[d.BUILD]})?`+"(?:$|[^\\d])"),m("COERCERTL",u[d.COERCE],!0),m("COERCERTLFULL",u[d.COERCEFULL],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${u[d.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",m("TILDE",`^${u[d.LONETILDE]}${u[d.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${u[d.LONETILDE]}${u[d.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${u[d.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",m("CARET",`^${u[d.LONECARET]}${u[d.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${u[d.LONECARET]}${u[d.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${u[d.GTLT]}\\s*(${u[d.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]}|${u[d.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${u[d.XRANGEPLAIN]})\\s+-\\s+(${u[d.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${u[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[d.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},5571(e,t,r){"use strict";let n=r(7075);e.exports=(e,t,r)=>n(e,t,">",r)},6780(e,t,r){"use strict";let n=r(8311);e.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))},5342(e,t,r){"use strict";let n=r(7075);e.exports=(e,t,r)=>n(e,t,"<",r)},9628(e,t,r){"use strict";let n=r(3908),i=r(8311);e.exports=(e,t,r)=>{let o=null,a=null,s=null;try{s=new i(t,r)}catch(e){return null}return e.forEach(e=>{s.test(e)&&(!o||-1===a.compare(e))&&(a=new n(o=e,r))}),o}},270(e,t,r){"use strict";let n=r(3908),i=r(8311);e.exports=(e,t,r)=>{let o=null,a=null,s=null;try{s=new i(t,r)}catch(e){return null}return e.forEach(e=>{s.test(e)&&(!o||1===a.compare(e))&&(a=new n(o=e,r))}),o}},1261(e,t,r){"use strict";let n=r(3908),i=r(8311),o=r(3199);e.exports=(e,t)=>{e=new i(e,t);let r=new n("0.0.0");if(e.test(r)||(r=new n("0.0.0-0"),e.test(r)))return r;r=null;for(let t=0;t<e.set.length;++t){let i=e.set[t],a=null;i.forEach(e=>{let t=new n(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":(!a||o(t,a))&&(a=t);break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),a&&(!r||o(r,a))&&(r=a)}return r&&e.test(r)?r:null}},7075(e,t,r){"use strict";let n=r(3908),i=r(3904),{ANY:o}=i,a=r(8311),s=r(7638),l=r(3199),u=r(7059),c=r(5200),d=r(4089);e.exports=(e,t,r,p)=>{let f,h,m,y,g;switch(e=new n(e,p),t=new a(t,p),r){case">":f=l,h=c,m=u,y=">",g=">=";break;case"<":f=u,h=d,m=l,y="<",g="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(s(e,t,p))return!1;for(let r=0;r<t.set.length;++r){let n=t.set[r],a=null,s=null;if(n.forEach(e=>{e.semver===o&&(e=new i(">=0.0.0")),a=a||e,s=s||e,f(e.semver,a.semver,p)?a=e:m(e.semver,s.semver,p)&&(s=e)}),a.operator===y||a.operator===g||(!s.operator||s.operator===y)&&h(e,s.semver)||s.operator===g&&m(e,s.semver))return!1}return!0}},2525(e,t,r){"use strict";let n=r(7638),i=r(560);e.exports=(e,t,r)=>{let o=[],a=null,s=null,l=e.sort((e,t)=>i(e,t,r));for(let e of l)n(e,t,r)?(s=e,a||(a=e)):(s&&o.push([a,s]),s=null,a=null);a&&o.push([a,null]);let u=[];for(let[e,t]of o)e===t?u.push(e):t||e!==l[0]?t?e===l[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");let c=u.join(" || "),d="string"==typeof t.raw?t.raw:String(t);return c.length<d.length?c:t}},5032(e,t,r){"use strict";let n=r(8311),i=r(3904),{ANY:o}=i,a=r(7638),s=r(560),l=[new i(">=0.0.0-0")],u=[new i(">=0.0.0")],c=(e,t,r)=>{let n,i,c,f,h,m,y;if(e===t)return!0;if(1===e.length&&e[0].semver===o)if(1===t.length&&t[0].semver===o)return!0;else e=r.includePrerelease?l:u;if(1===t.length&&t[0].semver===o)if(r.includePrerelease)return!0;else t=u;let g=new Set;for(let t of e)">"===t.operator||">="===t.operator?n=d(n,t,r):"<"===t.operator||"<="===t.operator?i=p(i,t,r):g.add(t.semver);if(g.size>1)return null;if(n&&i&&((c=s(n.semver,i.semver,r))>0||0===c&&(">="!==n.operator||"<="!==i.operator)))return null;for(let e of g){if(n&&!a(e,String(n),r)||i&&!a(e,String(i),r))return null;for(let n of t)if(!a(e,String(n),r))return!1;return!0}let b=!!i&&!r.includePrerelease&&!!i.semver.prerelease.length&&i.semver,v=!!n&&!r.includePrerelease&&!!n.semver.prerelease.length&&n.semver;for(let e of(b&&1===b.prerelease.length&&"<"===i.operator&&0===b.prerelease[0]&&(b=!1),t)){if(y=y||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,n){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),">"===e.operator||">="===e.operator){if((f=d(n,e,r))===e&&f!==n)return!1}else if(">="===n.operator&&!a(n.semver,String(e),r))return!1}if(i){if(b&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===b.major&&e.semver.minor===b.minor&&e.semver.patch===b.patch&&(b=!1),"<"===e.operator||"<="===e.operator){if((h=p(i,e,r))===e&&h!==i)return!1}else if("<="===i.operator&&!a(i.semver,String(e),r))return!1}if(!e.operator&&(i||n)&&0!==c)return!1}return(!n||!m||!!i||0===c)&&(!i||!y||!!n||0===c)&&!v&&!b&&!0},d=(e,t,r)=>{if(!e)return t;let n=s(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},p=(e,t,r)=>{if(!e)return t;let n=s(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;e:for(let n of e.set){for(let e of t.set){let t=c(n,e,r);if(i=i||null!==t,t)continue e}if(i)return!1}return!0}},7631(e,t,r){"use strict";let n=r(8311);e.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "))},3874(e,t,r){"use strict";let n=r(8311);e.exports=(e,t)=>{try{return new n(e,t).range||"*"}catch(e){return null}}},8420(e,t,r){"use strict";let n,i,o,a,s,l,u,c,d,p,f,h,m;r.r(t),r.d(t,{GenderUnknownIcon:()=>mB,evaluateAsNumber:()=>dn,getImportMapOverrideMap:()=>oz,StockManagementPictogram:()=>O2,ChemistryIcon:()=>mx,BabyIcon:()=>md,DashboardExtension:()=>yB,openmrsComponentDecorator:()=>fS,tryRegisterExtension:()=>hB,pictogramIds:()=>OR,ActivityIcon:()=>mo,compile:()=>dl,removeRouteMapOverride:()=>ap,checkStatus:()=>dI,TableBatchActions:()=>h4,getAsyncLifecycle:()=>fO,subscribeOpenmrsEvent:()=>cV,dispatchConnectivityChanged:()=>g,PasswordIcon:()=>ye,Assessment2Pictogram:()=>OI,CloseIcon:()=>mP,setupRouteMapOverrides:()=>am,getWorkspaceGroupRegistration:()=>pR,registerWorkspace:()=>pC,useFeatureFlag:()=>f6,reset:()=>pv,LabOrderIcon:()=>mZ,VisitMode:()=>cG,offlineUuidPrefix:()=>cb,useLocations:()=>hm,getLifecycle:()=>fD,formatDatetime:()=>Sq,getVisitsForPatient:()=>c1,subscribeConnectivity:()=>v,formatPartialDate:()=>SK,CustomOverflowMenu:()=>me,LocationIcon:()=>mX,GroupIcon:()=>mU,canBeginEditSynchronizationItemsOfType:()=>cc,VisitStatus:()=>cq,createUseStore:()=>p2,getCurrentImportMap:()=>o2,getSessionLocation:()=>iK,usePatient:()=>hx,useRenderableExtensions:()=>hS,getOpenedWindowIndexByWorkspace:()=>pI,checkStatusFor:()=>d$,clearHistory:()=>iS,clearConfigErrors:()=>rI,formatTime:()=>SG,isDevEnabled:()=>iq,setLeftNav:()=>p_,syncOfflinePatientData:()=>cI,closeWorkspaceGroup2:()=>P7,getCurrentRouteMap:()=>as,ConfigurableLink:()=>pJ,sessionStore:()=>iM,subscribeSnackbarShown:()=>M,getDynamicOfflineDataEntriesFor:()=>cD,getLoggedInUser:()=>iW,GenderMaleIcon:()=>mL,getExtensionSlotConfigFromStore:()=>tX,evaluateAsNumberAsync:()=>di,putDynamicOfflineDataFor:()=>cP,getImportMapDefaultMap:()=>oK,unregisterExtensionRendering:()=>dq,implementerToolsConfigStore:()=>rr,Type:()=>tL,InPatientPictogram:()=>Oz,cleanupObsoleteFeatureFlags:()=>dj,getAttachmentsUrl:()=>av,showSnackbar:()=>Pl,PatientBannerActionsMenu:()=>OD,PatientSearchPictogram:()=>OJ,DocumentAttachmentIcon:()=>mT,Snackbar:()=>Pn,CardiologyPictogram:()=>OL,ImageMedicalIcon:()=>mH,ActionableNotificationComponent:()=>DX,DiagnosisTags:()=>Dk,iconIds:()=>mi,PatientsPictogram:()=>OX,interpolateUrl:()=>iy,setupHistory:()=>i_,subscribeToastShown:()=>N,detachAll:()=>ph,convertToLocaleCalendar:()=>SY,DocumentIcon:()=>mj,configInternalStore:()=>tz,ActionMenuButton2:()=>Cm,setupDynamicOfflineDataHandler:()=>cE,makeUrl:()=>iT,oneOf:()=>rW,selectPreferredName:()=>Of,launchWorkspaceGroup:()=>function e(t,r){let n=pR(t),{state:i,onWorkspaceGroupLaunch:o,workspaceGroupCleanup:a,workspaceToLaunch:s}=r,l=function(){return PC}();if(l.getState().openWorkspaces.length){let n=l.getState().workspaceGroup;n?Py(n?.name,()=>{e(t,r)}):PR(()=>{e(t,r)})}else l.setState(e=>({...e,workspaceGroup:{name:t,members:n.members,cleanup:a}})),P$(t,i),o?.(),s&&Pb(s.name,s.additionalProps??{})},syncDynamicOfflineData:()=>cT,MobileCheckIcon:()=>m2,createErrorHandler:()=>$,openmrsObservableFetch:()=>iA,parseDate:()=>SL,getAttachmentByUuid:()=>ag,LeftNavMenu:()=>DM,getExtensionRegistration:()=>pc,ShoppingCartAddItemIcon:()=>y$,ReferralOrderIcon:()=>ya,ReportIcon:()=>yl,dispatchToastShown:()=>T,getImportMapNextPageMap:()=>oH,registerExtension:()=>pd,setupOfflineSync:()=>cf,DownloadIcon:()=>mR,useConnectivity:()=>fY,provide:()=>rm,getSynchronizationItemsFor:()=>co,ShoppingCartArrowDownIcon:()=>ym,featureFlagsStore:()=>dC,promptBeforeClosing:()=>P_,removeDynamicOfflineDataFor:()=>ck,jsep:()=>c2,GeriatricsPictogram:()=>OK,SearchIcon:()=>yd,reportError:()=>I,slugify:()=>o1,isOmrsDateToday:()=>SM,getExtensionStore:()=>dY,BloodBankPictogram:()=>O$,TriagePictogram:()=>O5,Workspace2:()=>Cu,refetchCurrentUser:()=>iB,CheckmarkOutlineIcon:()=>m_,registerExtensionSlot:()=>pb,AllergiesIcon:()=>yA,ArrowDownIcon:()=>ms,useOpenmrsInfinite:()=>hi,getExtensionConfigFromExtensionSlotStore:()=>t3,OpenmrsDatePicker:()=>DP,getExtensionConfigFromStore:()=>t1,getDynamicOfflineDataEntries:()=>cS,getLocaleDisplayName:()=>Se,messageOmrsServiceWorker:()=>aL,navigate:()=>ib,launchWorkspace2:()=>Ce,getGroupByWindowName:()=>pM,CustomOverflowMenuItem:()=>mt,isUrl:()=>rU,CaretDownIcon:()=>mh,ArrowLeftIcon:()=>ml,FacilityPictogram:()=>OW,ViewOffIcon:()=>yj,setCurrentOfflineMode:()=>az,updateInternalExtensionStore:()=>dU,dispatchActionableNotificationShown:()=>k,resetRouteMapOverrides:()=>af,formatDurationBetween:()=>S4,defaultVisitCustomRepresentation:()=>cY,getBreadcrumbsFor:()=>rX,useOpenmrsPagination:()=>f8,Pagination:()=>Ol,CheckmarkFilledIcon:()=>mw,clearCurrentUser:()=>iV,showModal:()=>DY,ChevronUpIcon:()=>mO,saveVisit:()=>cQ,useAttachments:()=>fW,Pictogram:()=>Pt,useExtensionSlot:()=>fe,ChevronDownIcon:()=>mE,OpenmrsDateRangePicker:()=>DC,deleteAttachmentPermanently:()=>a_,getVisitTypes:()=>cz,OverflowMenuHorizontalIcon:()=>m9,EventScheduleIcon:()=>mM,getSessionStore:()=>iL,ActionMenu:()=>P6,ProcedureOrderIcon:()=>yi,preloadImport:()=>o4,registerWorkspaceWindows2:()=>pL,useOnVisible:()=>hg,setSessionLocation:()=>iH,userHasAccess:()=>iU,ChartAverageIcon:()=>mb,getFeatureFlag:()=>dT,UserAvatarIcon:()=>yO,renderExtension:()=>pG,useFhirInfinite:()=>hu,toVisitTypeObject:()=>cH,useSession:()=>hD,EmergencyDepartmentPictogram:()=>OU,Notification:()=>DZ,dispatchSnackbarShown:()=>j,getSynchronizationItem:()=>cu,navigateAndLaunchWorkspace:()=>Pv,omrsOfflineCachingStrategyHttpHeaderName:()=>a$,formatDate:()=>SH,workspace2StoreActions:()=>Cn,SwitcherIcon:()=>yf,esmStyleGuideSchema:()=>h0,getImportMapDisabledOverrides:()=>oG,useAssignedExtensionIds:()=>fV,CaretRightIcon:()=>my,evaluateAsType:()=>da,PageHeader:()=>Oa,TranslateIcon:()=>yx,setUserProperties:()=>iz,MovementIcon:()=>m8,renderInlineNotifications:()=>D8,subscribePrecacheStaticDependencies:()=>E,PaymentsDeskPictogram:()=>OQ,usePrimaryIdentifierCode:()=>hE,dispatchPrecacheStaticDependencies:()=>x,getCurrentUser:()=>i$,useLayoutType:()=>hd,XrayPictogram:()=>O8,CaretUpIcon:()=>mg,renderActionableNotifications:()=>D7,OpenmrsAppContext:()=>fI,setupModals:()=>Dq,omrsOfflineResponseBodyHttpHeaderName:()=>aM,getDefaultsFromConfigSchema:()=>function e(t){let r={};for(let n of Object.keys(t))if(CA(t[n])&&t[n].hasOwnProperty("_default"))r[n]=t[n]._default;else{if(n.startsWith("_"))continue;CA(t[n])?r[n]=e(t[n]):r[n]=t[n]}return r},subscribeTo:()=>X,recordConfigDerivationError:()=>re,useAbortController:()=>fL,Extension:()=>pX,getFhirServerPaginationHandlers:()=>ht,useConnectedExtensions:()=>fq,registerApp:()=>hU,queueSynchronizationItemFor:()=>cn,HospitalBedIcon:()=>mK,useExtensionInternalStore:()=>f3,configExtensionStore:()=>tq,getSynchronizationItems:()=>cs,getExtensionSlotsConfigStore:()=>tZ,registerExtensionRendering:()=>dG,RenderIfValueIsTruthy:()=>f$,registerFeatureFlag:()=>dk,useFhirFetchAll:()=>hl,restBaseUrl:()=>iC,CalendarHeatMapIcon:()=>mp,getWorkspaceRegistration:()=>pT,isImportMapOverrideDisabled:()=>oq,resetConfigSystem:()=>r$,getFullSynchronizationItems:()=>cl,getExtensionInternalStore:()=>dB,registerGlobalStore:()=>Z,runSynchronization:()=>ce,evaluateAsBoolean:()=>dt,PatientBannerPatientInfo:()=>OE,addRouteMapOverride:()=>ad,getDefaultCalendar:()=>SU,SettingsIcon:()=>yp,DrugOrderIcon:()=>mA,isOnline:()=>dN,ProgramsIcon:()=>yo,useAssignedExtensions:()=>p7,CloseFilledIcon:()=>mC,canAccessStorage:()=>CR,registerDefaultCalendar:()=>SV,TreeViewAltIcon:()=>yS,OverflowMenuVerticalIcon:()=>m7,clearConfigDerivationError:()=>rt,getConfigStore:()=>tY,registerWorkspaceGroup:()=>pk,InformationSquareIcon:()=>mq,EmptyCard:()=>DR,ChevronLeftIcon:()=>mS,RadiologyIcon:()=>yI,useCandidateExtensions:()=>fU,renderToasts:()=>Pf,isDesktop:()=>hp,integrateBreakpoints:()=>hG,RegistrationPictogram:()=>O3,CardHeader:()=>hJ,getExtensionRegistrationFrom:()=>pu,InformationIcon:()=>mz,TrashCanIcon:()=>yE,useShallowStableValue:()=>pQ,useOpenmrsSWR:()=>hb,Assessment1Pictogram:()=>OM,finishRegisteringAllApps:()=>hW,importDynamic:()=>o3,useFhirPagination:()=>he,useVisitContextStore:()=>hA,ArrowUpIcon:()=>mc,showActionableNotification:()=>Oe,getDynamicOfflineDataHandlers:()=>cx,useForceUpdate:()=>f5,updateWorkspaceWindowState:()=>Pj,useVisit:()=>hN,PatientBannerPatientIdentifiers:()=>Ov,WorkspaceNotification:()=>PY,TransferPictogram:()=>O6,usePagination:()=>hv,Breakpoint:()=>hK,PatientBannerToggleContactDetailsButton:()=>Cy,CloseOutlineIcon:()=>mk,ObstetricsPictogram:()=>OZ,parseDateInput:()=>SJ,getConfig:()=>rg,attach:()=>pp,getLocale:()=>St,ActionMenuButton:()=>PU,isUrlWithTemplateParameters:()=>rV,useEmrConfiguration:()=>f0,useLeftNav:()=>hf,ToolsIcon:()=>y_,ErrorState:()=>DA,detach:()=>pf,setCurrentVisit:()=>cX,registerOmrsServiceWorker:()=>aA,ConditionsIcon:()=>yM,SaveIcon:()=>yc,activateOfflineCapability:()=>aG,useWorkspaces:()=>PA,resetWorkspaceStore:()=>PI,useConfig:()=>fG,validator:()=>tF,CalendarIcon:()=>mf,getHistory:()=>ix,StickyNoteAddIcon:()=>yy,useWorkspace2Store:()=>Ci,getPatientName:()=>Ou,getVisitStore:()=>cJ,getCoreTranslation:()=>oR,registerModuleWithConfigSystem:()=>rd,isOfflineUuid:()=>cw,registerModuleLoad:()=>rp,getBreadcrumbs:()=>rY,extractVariableNames:()=>dD,getOfflineSynchronizationStore:()=>u7,translateFrom:()=>oT,EditIcon:()=>mN,useStoreWithActions:()=>p4,getCandidateExtensions:()=>pg,putDynamicOfflineData:()=>cO,shallowEqual:()=>F,subscribeNotificationShown:()=>R,MaximizeIcon:()=>m0,promptForClosingWorkspaces:()=>Cr,WarningIcon:()=>yR,closeAllWorkspaces:()=>PR,fhirBaseUrl:()=>ik,matchLocale:()=>CT,registerBreadcrumb:()=>rG,usePatientPhoto:()=>OC,EventsIcon:()=>mI,createGlobalStore:()=>Y,workspaceStore:()=>PC,getCurrentOfflineMode:()=>aH,subscribeToFeatureFlag:()=>dR,useExtensionStore:()=>f2,closeWorkspace:()=>PD,createAttachment:()=>aw,useLeftNavStore:()=>hh,TableIcon:()=>yv,Icon:()=>yF,InformationFilledIcon:()=>mG,getCurrentPageMap:()=>oW,LaboratoryPictogram:()=>OG,temporaryConfigStore:()=>tG,getPromptBeforeClosingFcn:()=>Px,toDateObjectStrict:()=>SI,defineConfigSchema:()=>rc,filterBreadcrumbs:()=>rJ,invalidateImplementerToolsConfig:()=>t9,PatientBannerContactDetails:()=>Cx,getAssignedExtensions:()=>py,PatientPhoto:()=>OT,MaterialOrderIcon:()=>mQ,MicroscopeIcon:()=>m4,scheduleRecomputation:()=>d0,PharmacyPictogram:()=>O0,AttachmentIcon:()=>yN,MoneyIcon:()=>m6,getAttachments:()=>ab,getFullSynchronizationItemsFor:()=>ca,PageHeaderContent:()=>Os,MedicationIcon:()=>m1,PrinterIcon:()=>yn,getWorkspaceGroupStore:()=>P$,PatientListsPictogram:()=>O7,useAppContext:()=>fF,isOpenmrsRoutes:()=>o8,AppointmentsAltPictogram:()=>ON,GenericOrderTypeIcon:()=>mV,batchExtensionUpdates:()=>dX,useExtensionSlotStore:()=>p8,ViewIcon:()=>yT,formattedName:()=>Op,sessionEndpoint:()=>ij,duration:()=>S1,resetImportMapOverrides:()=>oJ,TableOfContentsIcon:()=>yb,CaretLeftIcon:()=>mm,getTranslationOverrides:()=>rb,isVersionSatisfied:()=>CI,EmptyCardIllustration:()=>DT,PenIcon:()=>yr,getWorkspaceStore:()=>Pk,registerOfflinePatientHandler:()=>cM,setupImportMapOverrides:()=>o0,showToast:()=>Ph,useDefineAppContext:()=>fM,validators:()=>rK,getGlobalStore:()=>J,useOnClickOutside:()=>hy,getWindowByWorkspaceName:()=>pN,ArrowRightIcon:()=>mu,loadLifeCycles:()=>h$,registerBreadcrumbs:()=>rq,MotherIcon:()=>m5,fetchCurrentPatient:()=>cL,Toast:()=>Pu,MessageQueueIcon:()=>m3,TwoFactorAuthenticationIcon:()=>yD,Pharmacy2Pictogram:()=>O1,goBackInHistory:()=>iE,GroupAccessIcon:()=>mW,getExtensionRenderingsStore:()=>dV,setImplementerToolsConfigRecomputer:()=>t8,getAsyncExtensionLifecycle:()=>fC,setupApiModule:()=>iZ,renderLoadingSpinner:()=>CE,WorkspaceContainer:()=>P5,showNotification:()=>D9,queueSynchronizationItem:()=>ci,getModalRegistration:()=>pD,ListCheckedIcon:()=>mJ,ResponsiveWrapper:()=>Pr,GynaecologyPictogram:()=>OH,ShoppingCartIcon:()=>yh,getRouteMapNextPageMap:()=>au,MetadataExportPictogram:()=>OY,updateVisit:()=>c0,backendDependencies:()=>iY,MaybePictogram:()=>Pe,beginEditSynchronizationItem:()=>cd,createParcelMounter:()=>pH,getStartedVisit:()=>c3,omrsOfflineResponseStatusHttpHeaderName:()=>aI,isOpenmrsAppRoutes:()=>o5,openmrsFetch:()=>iR,HomePictogram:()=>O9,DentistryPictogram:()=>OB,ServiceQueuesPictogram:()=>O4,toLanguageTag:()=>E7,launchWorkspace:()=>Pb,setFeatureFlag:()=>dA,useStore:()=>p3,DigitalTrustPictogram:()=>OV,NumericObservation:()=>Oi,attachmentUrl:()=>ay,interpolateString:()=>ig,inRange:()=>rB,useExtensionSlotMeta:()=>f4,AppointmentsPictogram:()=>OA,renderSnackbars:()=>Ps,getRegisteredWorkspace2Names:()=>Ca,toLocationObject:()=>cW,ChartLineIcon:()=>mv,UserHasAccess:()=>hO,evaluateAsBooleanAsync:()=>dr,changeWorkspaceContext:()=>PO,createDashboard:()=>yV,getLocations:()=>cK,getOfflineDb:()=>u6,useExtensionContext:()=>f1,canCloseWorkspaceWithoutPrompting:()=>Pm,getExtensionsConfigStore:()=>tQ,getRouteMapDefaultMap:()=>al,age:()=>Om,syncAllDynamicOfflineData:()=>cj,isOmrsDateStrict:()=>SN,registerWorkspaceGroups2:()=>p$,usePaginationInfo:()=>hw,evaluateAsync:()=>de,useOpenmrsFetchAll:()=>ha,removeImportMapOverride:()=>oZ,showWorkspacePrompts:()=>PN,useVisitTypes:()=>hM,ageAsDuration:()=>Oh,removeDynamicOfflineData:()=>cC,getExtensionNameFromId:()=>pl,deleteSynchronizationItem:()=>cp,renderParcel:()=>pK,useWorkspace2Context:()=>Co,ResetIcon:()=>yu,RenewIcon:()=>ys,subscribeActionableNotificationShown:()=>A,ErrorCard:()=>DN,GenderFemaleIcon:()=>m$,enableImportMapOverride:()=>oX,getOfflinePatientDataStore:()=>cN,retry:()=>C$,ComponentContext:()=>pZ,ExtensionSlot:()=>fr,getOmrsServiceWorker:()=>aN,addImportMapOverride:()=>oY,subscribeConnectivityChanged:()=>b,unsetLeftNav:()=>px,MaybeIcon:()=>yL,useCustomOverflowMenu:()=>h7,PedestrianFamilyIcon:()=>yt,generateOfflineUuid:()=>cv,cancelPrompt:()=>PE,CtScanPictogram:()=>OF,dispatchNotificationShown:()=>C,leftNavStore:()=>pw,OpenmrsFetchError:()=>iN,UserFollowIcon:()=>yP,launchWorkspaceGroup2:()=>P9,ChevronRightIcon:()=>mD,UserXrayIcon:()=>yC,GenderOtherIcon:()=>mF,formatDuration:()=>SZ,toOmrsIsoString:()=>S$,Labs2Pictogram:()=>Oq,workspace2Store:()=>pA,setUserLanguage:()=>iF,useBodyScrollLock:()=>fK,getExtensionConfig:()=>t0,SyringeIcon:()=>yg,LocationPicker:()=>DI,useDebounce:()=>fZ,TimeIcon:()=>yw,getExtensionSlotConfig:()=>tJ,AddIcon:()=>ma,getRouteMapOverrideMap:()=>ac,processConfig:()=>rv,InventoryManagementIcon:()=>mY,registerWorkspaces2:()=>pF,UserIcon:()=>yk,formatPatientName:()=>Od,fireOpenmrsEvent:()=>cB,registerModal:()=>pS,registerTranslationNamespace:()=>rf,displayName:()=>Oc,evaluate:()=>c7,defineExtensionConfigSchema:()=>rh,renderWorkspaceWindowsAndMenu:()=>Ck,getSyncLifecycle:()=>fP,evaluateAsTypeAsync:()=>ds});let y="openmrs:connectivity-changed";function g(e){window.dispatchEvent(new CustomEvent(y,{detail:{online:e}}))}function b(e){if(!window.offlineEnabled)return()=>{};let t=t=>e(t.detail);return window.addEventListener(y,t),()=>window.removeEventListener(y,t)}function v(e){return e({online:!window.offlineEnabled||navigator.onLine}),b(e)}let w="openmrs:precache-static-dependencies";function x(e={}){window.dispatchEvent(new CustomEvent(w,{detail:e}))}function E(e){let t=t=>e(t.detail);return window.addEventListener(w,t),()=>window.removeEventListener(w,t)}let S="openmrs:notification-shown",D="openmrs:actionable-notification-shown",O="openmrs:toast-shown",P="openmrs:snack-bar-shown";function C(e){window.dispatchEvent(new CustomEvent(S,{detail:e}))}function k(e){window.dispatchEvent(new CustomEvent(D,{detail:e}))}function j(e){window.dispatchEvent(new CustomEvent(P,{detail:e}))}function T(e){window.dispatchEvent(new CustomEvent(O,{detail:e}))}function R(e){let t=t=>e(t.detail);return window.addEventListener(S,t),()=>window.removeEventListener(S,t)}function A(e){let t=t=>e(t.detail);return window.addEventListener(D,t),()=>window.removeEventListener(D,t)}function N(e){let t=t=>e(t.detail);return window.addEventListener(O,t),()=>window.removeEventListener(O,t)}function M(e){let t=t=>e(t.detail);return window.addEventListener(P,t),()=>window.removeEventListener(P,t)}function I(e){let t=L(e);setTimeout(()=>{throw t})}function $(){let e=Error();return t=>{let r=L(t);r.stack+=`
1
+ (globalThis.webpackChunk_openmrs_esm_billing_app=globalThis.webpackChunk_openmrs_esm_billing_app||[]).push([["3525"],{7581(e){e.exports=function(e,t,r){t.prototype.isToday=function(){var e="YYYY-MM-DD",t=r();return this.format(e)===t.format(e)}}},5238(e){e.exports=function(e,t,r){var n=t.prototype,i=function(e){var t=e.date,i=e.utc,o={};if(!(null===t||t instanceof Date||t instanceof Array||n.$utils().u(t)||"Object"!==t.constructor.name)){if(!Object.keys(t).length)return new Date;var a=i?r.utc():r();Object.keys(t).forEach(function(e){var r;o["date"===(r=n.$utils().p(e))?"day":r]=t[e]});var s=o.day||(o.year||o.month>=0?1:a.date()),l=o.year||a.year(),u=o.month>=0?o.month:o.year||o.day?0:a.month(),c=o.hour||0,d=o.minute||0,p=o.second||0,f=o.millisecond||0;return i?new Date(Date.UTC(l,u,s,c,d,p,f)):new Date(l,u,s,c,d,p,f)}return t},o=n.parse;n.parse=function(e){e.date=i.bind(this)(e),o.bind(this)(e)};var a=n.set,s=n.add,l=n.subtract,u=function(e,t,r,n){void 0===n&&(n=1);var i=Object.keys(t),o=this;return i.forEach(function(r){o=e.bind(o)(t[r]*n,r)}),o};n.set=function(e,t){return t=void 0===t?e:t,"Object"===e.constructor.name?u.bind(this)(function(e,t){return a.bind(this)(t,e)},t,e):a.bind(this)(e,t)},n.add=function(e,t){return"Object"===e.constructor.name?u.bind(this)(s,e,t):s.bind(this)(e,t)},n.subtract=function(e,t){return"Object"===e.constructor.name?u.bind(this)(s,e,t,-1):l.bind(this)(e,t)}}},3826(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,r=/([+-]|\d\d)/g;return function(n,i,o){var a=i.prototype;o.utc=function(e){var t={date:e,utc:!0,args:arguments};return new i(t)},a.utc=function(t){var r=o(this.toDate(),{locale:this.$L,utc:!0});return t?r.add(this.utcOffset(),e):r},a.local=function(){return o(this.toDate(),{locale:this.$L,utc:!1})};var s=a.parse;a.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var l=a.init;a.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else l.call(this)};var u=a.utcOffset;a.utcOffset=function(n,i){var o=this.$utils().u;if(o(n))return this.$u?0:o(this.$offset)?u.call(this):this.$offset;if("string"==typeof n&&null===(n=function(e){void 0===e&&(e="");var n=e.match(t);if(!n)return null;var i=(""+n[0]).match(r)||["-",0,0],o=i[0],a=60*i[1]+ +i[2];return 0===a?0:"+"===o?a:-a}(n)))return this;var a=16>=Math.abs(n)?60*n:n,s=this;if(i)return s.$offset=a,s.$u=0===n,s;if(0!==n){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(s=this.local().add(a+l,e)).$offset=a,s.$x.$localOffset=l}else s=this.utc();return s};var c=a.format;a.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return c.call(this,t)},a.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var d=a.toDate;a.toDate=function(e){return"s"===e&&this.$offset?o(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():d.call(this)};var p=a.diff;a.diff=function(e,t,r){if(e&&this.$u===e.$u)return p.call(this,e,t,r);var n=this.local(),i=o(e).local();return p.call(n,i,t,r)}}}()},2849(e){var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString;function n(e){if(!e||"[object Object]"!==r.call(e)||e.nodeType||e.setInterval)return!1;var n,i=t.call(e,"constructor"),o=t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(n in e);return void 0===n||t.call(e,n)}e.exports=function e(){var t,r,i,o,a,s,l=arguments[0]||{},u=1,c=arguments.length,d=!1;for("boolean"==typeof l&&(d=l,l=arguments[1]||{},u=2),"object"!=typeof l&&"function"!=typeof l&&(l={});u<c;u++)if(null!=(t=arguments[u]))for(r in t)i=l[r],l!==(o=t[r])&&(d&&o&&(n(o)||(a=Array.isArray(o)))?(a?(a=!1,s=i&&Array.isArray(i)?i:[]):s=i&&n(i)?i:{},l[r]=e(d,s,o)):void 0!==o&&(l[r]=o));return l}},6767(e,t,r){!function(t){"use strict";var n=r(6974);function i(e){return function(t,r){return"object"==typeof t&&(r=t,t=null),null==t&&(t=new Date().toString()),r||(r={}),e.call(this,t,r)}}var o=e.exports={generate:i(function(e,t){return new n(e,t)})};t&&(t.fn.geopattern=i(function(e,r){return this.each(function(){var n=t(this).attr("data-title-sha");n&&(r=t.extend({hash:n},r));var i=o.generate(e,r);t(this).css("background-image",i.toDataUrl())})}))}("u">typeof jQuery?jQuery:null)},2467(e){"use strict";e.exports={hex2rgb:function(e){e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(e,t,r,n){return t+t+r+r+n+n});var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null},rgb2hex:function(e){return"#"+["r","g","b"].map(function(t){return("0"+e[t].toString(16)).slice(-2)}).join("")},rgb2hsl:function(e){var t,r,n=e.r,i=e.g,o=e.b,a=Math.max(n/=255,i/=255,o/=255),s=Math.min(n,i,o),l=(a+s)/2;if(a===s)t=r=0;else{var u=a-s;switch(r=l>.5?u/(2-a-s):u/(a+s),a){case n:t=(i-o)/u+6*(i<o);break;case i:t=(o-n)/u+2;break;case o:t=(n-i)/u+4}t/=6}return{h:t,s:r,l:l}},hsl2rgb:function(e){function t(e,t,r){return(r<0&&(r+=1),r>1&&(r-=1),r<1/6)?e+(t-e)*6*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}var r,n,i,o=e.h,a=e.s,s=e.l;if(0===a)r=n=i=s;else{var l=s<.5?s*(1+a):s+a-s*a,u=2*s-l;r=t(u,l,o+1/3),n=t(u,l,o),i=t(u,l,o-1/3)}return{r:Math.round(255*r),g:Math.round(255*n),b:Math.round(255*i)}},rgb2rgbString:function(e){return"rgb("+[e.r,e.g,e.b].join(",")+")"}}},6974(e,t,r){"use strict";var n=r(2849),i=r(2467),o=r(6743),a=r(8502),s={baseColor:"#933c3c"},l=["octogons","overlappingCircles","plusSigns","xes","sineWaves","hexagons","overlappingRings","plaid","triangles","squares","concentricCircles","diamonds","tessellation","nestedSquares","mosaicSquares","chevrons"],u="#000";function c(e,t,r){return parseInt(e.substr(t,r||1),16)}function d(e,t,r,n,i){return(parseFloat(e)-t)*(i-n)/(r-t)+n}function p(e){return e%2==0?"#ddd":"#222"}function f(e){return d(e,0,15,.02,.15)}var h=e.exports=function(e,t){return this.opts=n({},s,t),this.hash=t.hash||o(e),this.svg=new a,this.generateBackground(),this.generatePattern(),this};function m(e){return[[e,0,e,3*e],[0,e,3*e,e]]}function y(e){return[0,0,e,e,0,e,0,0].join(",")}function g(e,t,r,n,i){var o=y(n),a=f(i[0]),s=p(i[0]),l={stroke:u,"stroke-opacity":.02,"fill-opacity":a,fill:s};e.polyline(o,l).transform({translate:[t+n,r],scale:[-1,1]}),e.polyline(o,l).transform({translate:[t+n,r+2*n],scale:[1,-1]}),l={stroke:u,"stroke-opacity":.02,"fill-opacity":a=f(i[1]),fill:s=p(i[1])},e.polyline(o,l).transform({translate:[t+n,r+2*n],scale:[-1,-1]}),e.polyline(o,l).transform({translate:[t+n,r],scale:[1,1]})}function b(e,t,r,n,i){var o=f(i),a=p(i),s=y(n),l={stroke:u,"stroke-opacity":.02,"fill-opacity":o,fill:a};e.polyline(s,l).transform({translate:[t,r+n],scale:[1,-1]}),e.polyline(s,l).transform({translate:[t+2*n,r+n],scale:[-1,-1]}),e.polyline(s,l).transform({translate:[t,r+n],scale:[1,1]}),e.polyline(s,l).transform({translate:[t+2*n,r+n],scale:[-1,1]})}h.prototype.toSvg=function(){return this.svg.toString()},h.prototype.toString=function(){return this.toSvg()},h.prototype.toBase64=function(){var e=this.toSvg();return"u">typeof window&&"function"==typeof window.btoa?window.btoa(e):new Buffer(e).toString("base64")},h.prototype.toDataUri=function(){return"data:image/svg+xml;base64,"+this.toBase64()},h.prototype.toDataUrl=function(){return'url("'+this.toDataUri()+'")'},h.prototype.generateBackground=function(){var e,t,r,n;this.opts.color?r=i.hex2rgb(this.opts.color):(t=d(c(this.hash,14,3),0,4095,0,359),n=c(this.hash,17),(e=i.rgb2hsl(i.hex2rgb(this.opts.baseColor))).h=(360*e.h-t+360)%360/360,n%2==0?e.s=Math.min(1,(100*e.s+n)/100):e.s=Math.max(0,(100*e.s-n)/100),r=i.hsl2rgb(e)),this.color=i.rgb2hex(r),this.svg.rect(0,0,"100%","100%",{fill:i.rgb2rgbString(r)})},h.prototype.generatePattern=function(){var e=this.opts.generator;if(e){if(0>l.indexOf(e))throw Error("The generator "+e+" does not exist.")}else e=l[c(this.hash,20)];return this["geo"+e.slice(0,1).toUpperCase()+e.slice(1)]()},h.prototype.geoHexagons=function(){var e,t,r,n,i,o,a,s,l,h=d(c(this.hash,0),0,15,8,60),m=h*Math.sqrt(3),y=2*h,g=(s=h/2,[0,l=Math.sin(60*Math.PI/180)*h,s,0,s+h,0,2*h,l,s+h,2*l,s,2*l,0,l].join(","));for(this.svg.setWidth(3*y+3*h),this.svg.setHeight(6*m),t=0,a=0;a<6;a++)for(o=0;o<6;o++)i=c(this.hash,t),e=o%2==0?a*m:a*m+m/2,r=f(i),n={fill:p(i),"fill-opacity":r,stroke:u,"stroke-opacity":.02},this.svg.polyline(g,n).transform({translate:[o*h*1.5-y/2,e-m/2]}),0===o&&this.svg.polyline(g,n).transform({translate:[6*h*1.5-y/2,e-m/2]}),0===a&&(e=o%2==0?6*m:6*m+m/2,this.svg.polyline(g,n).transform({translate:[o*h*1.5-y/2,e-m/2]})),0===o&&0===a&&this.svg.polyline(g,n).transform({translate:[6*h*1.5-y/2,5*m+m/2]}),t++},h.prototype.geoSineWaves=function(){var e,t,r,n,i,o,a,s=Math.floor(d(c(this.hash,0),0,15,100,400)),l=Math.floor(d(c(this.hash,1),0,15,30,100)),u=Math.floor(d(c(this.hash,2),0,15,3,30));for(this.svg.setWidth(s),this.svg.setHeight(36*u),t=0;t<36;t++)r=f(o=c(this.hash,t)),e=p(o),a=s/4*.7,i={fill:"none",stroke:e,opacity:r,"stroke-width":""+u+"px"},n="M0 "+l+" C "+a+" 0, "+(s/2-a)+" 0, "+s/2+" "+l+" S "+(s-a)+" "+2*l+", "+s+" "+l+" S "+(1.5*s-a)+" 0, "+1.5*s+", "+l,this.svg.path(n,i).transform({translate:[-s/4,u*t-1.5*l]}),this.svg.path(n,i).transform({translate:[-s/4,u*t-1.5*l+36*u]})},h.prototype.geoChevrons=function(){var e,t,r,n,i,o,a,s=d(c(this.hash,0),0,15,30,80),l=d(c(this.hash,0),0,15,30,80),h=(e=.66*l,[[0,0,s/2,l-e,s/2,l,0,e,0,0],[s/2,l-e,s,0,s,e,s/2,l,s/2,l-e]].map(function(e){return e.join(",")}));for(this.svg.setWidth(6*s),this.svg.setHeight(6*l*.66),t=0,a=0;a<6;a++)for(o=0;o<6;o++)r=f(i=c(this.hash,t)),n={stroke:u,"stroke-opacity":.02,fill:p(i),"fill-opacity":r,"stroke-width":1},this.svg.group(n).transform({translate:[o*s,a*l*.66-l/2]}).polyline(h).end(),0===a&&this.svg.group(n).transform({translate:[o*s,6*l*.66-l/2]}).polyline(h).end(),t+=1},h.prototype.geoPlusSigns=function(){var e,t,r,n,i,o,a,s,l=d(c(this.hash,0),0,15,10,25),h=3*l,y=m(l);for(this.svg.setWidth(12*l),this.svg.setHeight(12*l),r=0,s=0;s<6;s++)for(a=0;a<6;a++)n=f(o=c(this.hash,r)),t=p(o),e=+(s%2!=0),i={fill:t,stroke:u,"stroke-opacity":.02,"fill-opacity":n},this.svg.group(i).transform({translate:[a*h-a*l+e*l-l,s*h-s*l-h/2]}).rect(y).end(),0===a&&this.svg.group(i).transform({translate:[4*h-a*l+e*l-l,s*h-s*l-h/2]}).rect(y).end(),0===s&&this.svg.group(i).transform({translate:[a*h-a*l+e*l-l,4*h-s*l-h/2]}).rect(y).end(),0===a&&0===s&&this.svg.group(i).transform({translate:[4*h-a*l+e*l-l,4*h-s*l-h/2]}).rect(y).end(),r++},h.prototype.geoXes=function(){var e,t,r,n,i,o,a,s=d(c(this.hash,0),0,15,10,25),l=m(s),u=3*s*.943;for(this.svg.setWidth(3*u),this.svg.setHeight(3*u),t=0,a=0;a<6;a++)for(o=0;o<6;o++)r=f(i=c(this.hash,t)),e=o%2==0?a*u-.5*u:a*u-.5*u+u/4,n={fill:p(i),opacity:r},this.svg.group(n).transform({translate:[o*u/2-u/2,e-a*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),0===o&&this.svg.group(n).transform({translate:[6*u/2-u/2,e-a*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),0===a&&(e=o%2==0?6*u-u/2:6*u-u/2+u/4,this.svg.group(n).transform({translate:[o*u/2-u/2,e-6*u/2],rotate:[45,u/2,u/2]}).rect(l).end()),5===a&&this.svg.group(n).transform({translate:[o*u/2-u/2,e-11*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),0===o&&0===a&&this.svg.group(n).transform({translate:[6*u/2-u/2,e-6*u/2],rotate:[45,u/2,u/2]}).rect(l).end(),t++},h.prototype.geoOverlappingCircles=function(){var e,t,r,n,i,o,a=d(c(this.hash,0),0,15,25,200)/2;for(this.svg.setWidth(6*a),this.svg.setHeight(6*a),e=0,o=0;o<6;o++)for(i=0;i<6;i++)t=f(n=c(this.hash,e)),r={fill:p(n),opacity:t},this.svg.circle(i*a,o*a,a,r),0===i&&this.svg.circle(6*a,o*a,a,r),0===o&&this.svg.circle(i*a,6*a,a,r),0===i&&0===o&&this.svg.circle(6*a,6*a,a,r),e++},h.prototype.geoOctogons=function(){var e,t,r,n,i,o,a,s=d(c(this.hash,0),0,15,10,60),l=[e=.33*s,0,s-e,0,s,e,s,s-e,s-e,s,e,s,0,s-e,0,e,e,0].join(",");for(this.svg.setWidth(6*s),this.svg.setHeight(6*s),r=0,a=0;a<6;a++)for(o=0;o<6;o++)n=f(i=c(this.hash,r)),t=p(i),this.svg.polyline(l,{fill:t,"fill-opacity":n,stroke:u,"stroke-opacity":.02}).transform({translate:[o*s,a*s]}),r+=1},h.prototype.geoSquares=function(){var e,t,r,n,i,o,a=d(c(this.hash,0),0,15,10,60);for(this.svg.setWidth(6*a),this.svg.setHeight(6*a),t=0,o=0;o<6;o++)for(i=0;i<6;i++)r=f(n=c(this.hash,t)),e=p(n),this.svg.rect(i*a,o*a,a,a,{fill:e,"fill-opacity":r,stroke:u,"stroke-opacity":.02}),t+=1},h.prototype.geoConcentricCircles=function(){var e,t,r,n,i,o,a=d(c(this.hash,0),0,15,10,60),s=a/5;for(this.svg.setWidth((a+s)*6),this.svg.setHeight((a+s)*6),t=0,o=0;o<6;o++)for(i=0;i<6;i++)r=f(n=c(this.hash,t)),e=p(n),this.svg.circle(i*a+i*s+(a+s)/2,o*a+o*s+(a+s)/2,a/2,{fill:"none",stroke:e,opacity:r,"stroke-width":s+"px"}),r=f(n=c(this.hash,39-t)),e=p(n),this.svg.circle(i*a+i*s+(a+s)/2,o*a+o*s+(a+s)/2,a/4,{fill:e,"fill-opacity":r}),t+=1},h.prototype.geoOverlappingRings=function(){var e,t,r,n,i,o,a=d(c(this.hash,0),0,15,10,60),s=a/4;for(this.svg.setWidth(6*a),this.svg.setHeight(6*a),e=0,o=0;o<6;o++)for(i=0;i<6;i++)t=f(n=c(this.hash,e)),r={fill:"none",stroke:p(n),opacity:t,"stroke-width":s+"px"},this.svg.circle(i*a,o*a,a-s/2,r),0===i&&this.svg.circle(6*a,o*a,a-s/2,r),0===o&&this.svg.circle(i*a,6*a,a-s/2,r),0===i&&0===o&&this.svg.circle(6*a,6*a,a-s/2,r),e+=1},h.prototype.geoTriangles=function(){var e,t,r,n,i,o,a,s,l=d(c(this.hash,0),0,15,15,80),h=l/2*Math.sqrt(3),m=[s=l/2,0,l,h,0,h,s,0].join(",");for(this.svg.setWidth(3*l),this.svg.setHeight(6*h),e=0,a=0;a<6;a++)for(o=0;o<6;o++)t=f(i=c(this.hash,e)),n={fill:p(i),"fill-opacity":t,stroke:u,"stroke-opacity":.02},r=a%2==0?180*(o%2==0):180*(o%2!=0),this.svg.polyline(m,n).transform({translate:[o*l*.5-l/2,h*a],rotate:[r,l/2,h/2]}),0===o&&this.svg.polyline(m,n).transform({translate:[6*l*.5-l/2,h*a],rotate:[r,l/2,h/2]}),e+=1},h.prototype.geoDiamonds=function(){var e,t,r,n,i,o,a,s=d(c(this.hash,0),0,15,10,50),l=d(c(this.hash,1),0,15,10,50),h=[s/2,0,s,l/2,s/2,l,0,l/2].join(",");for(this.svg.setWidth(6*s),this.svg.setHeight(3*l),t=0,a=0;a<6;a++)for(o=0;o<6;o++)r=f(i=c(this.hash,t)),n={fill:p(i),"fill-opacity":r,stroke:u,"stroke-opacity":.02},e=a%2==0?0:s/2,this.svg.polyline(h,n).transform({translate:[o*s-s/2+e,l/2*a-l/2]}),0===o&&this.svg.polyline(h,n).transform({translate:[6*s-s/2+e,l/2*a-l/2]}),0===a&&this.svg.polyline(h,n).transform({translate:[o*s-s/2+e,l/2*6-l/2]}),0===o&&0===a&&this.svg.polyline(h,n).transform({translate:[6*s-s/2+e,l/2*6-l/2]}),t+=1},h.prototype.geoNestedSquares=function(){var e,t,r,n,i,o,a=d(c(this.hash,0),0,15,4,12),s=7*a;for(this.svg.setWidth((s+a)*6+6*a),this.svg.setHeight((s+a)*6+6*a),e=0,o=0;o<6;o++)for(i=0;i<6;i++)t=f(n=c(this.hash,e)),r={fill:"none",stroke:p(n),opacity:t,"stroke-width":a+"px"},this.svg.rect(i*s+i*a*2+a/2,o*s+o*a*2+a/2,s,s,r),t=f(n=c(this.hash,39-e)),r={fill:"none",stroke:p(n),opacity:t,"stroke-width":a+"px"},this.svg.rect(i*s+i*a*2+a/2+2*a,o*s+o*a*2+a/2+2*a,3*a,3*a,r),e+=1},h.prototype.geoMosaicSquares=function(){var e,t,r,n=d(c(this.hash,0),0,15,15,50);for(this.svg.setWidth(8*n),this.svg.setHeight(8*n),e=0,r=0;r<4;r++)for(t=0;t<4;t++)t%2==0?r%2==0?b(this.svg,t*n*2,r*n*2,n,c(this.hash,e)):g(this.svg,t*n*2,r*n*2,n,[c(this.hash,e),c(this.hash,e+1)]):r%2==0?g(this.svg,t*n*2,r*n*2,n,[c(this.hash,e),c(this.hash,e+1)]):b(this.svg,t*n*2,r*n*2,n,c(this.hash,e)),e+=1},h.prototype.geoPlaid=function(){var e,t,r,n,i,o,a=0,s=0;for(t=0;t<36;)a+=c(this.hash,t)+5,r=f(o=c(this.hash,t+1)),e=p(o),n=o+5,this.svg.rect(0,a,"100%",n,{opacity:r,fill:e}),a+=n,t+=2;for(t=0;t<36;)s+=c(this.hash,t)+5,r=f(o=c(this.hash,t+1)),e=p(o),i=o+5,this.svg.rect(s,0,i,"100%",{opacity:r,fill:e}),s+=i,t+=2;this.svg.setWidth(s),this.svg.setHeight(a)},h.prototype.geoTessellation=function(){var e,t,r,n,i=d(c(this.hash,0),0,15,5,40),o=i*Math.sqrt(3),a=2*i,s=i/2*Math.sqrt(3),l=[0,0,s,i/2,0,i,0,0].join(","),h=3*i+2*s,m=2*o+2*i;for(this.svg.setWidth(h),this.svg.setHeight(m),e=0;e<20;e++)switch(t=f(n=c(this.hash,e)),r={stroke:u,"stroke-opacity":.02,fill:p(n),"fill-opacity":t,"stroke-width":1},e){case 0:this.svg.rect(-i/2,-i/2,i,i,r),this.svg.rect(h-i/2,-i/2,i,i,r),this.svg.rect(-i/2,m-i/2,i,i,r),this.svg.rect(h-i/2,m-i/2,i,i,r);break;case 1:this.svg.rect(a/2+s,o/2,i,i,r);break;case 2:this.svg.rect(-i/2,m/2-i/2,i,i,r),this.svg.rect(h-i/2,m/2-i/2,i,i,r);break;case 3:this.svg.rect(a/2+s,1.5*o+i,i,i,r);break;case 4:this.svg.polyline(l,r).transform({translate:[i/2,-i/2],rotate:[0,i/2,s/2]}),this.svg.polyline(l,r).transform({translate:[i/2,m- -i/2],rotate:[0,i/2,s/2],scale:[1,-1]});break;case 5:this.svg.polyline(l,r).transform({translate:[h-i/2,-i/2],rotate:[0,i/2,s/2],scale:[-1,1]}),this.svg.polyline(l,r).transform({translate:[h-i/2,m+i/2],rotate:[0,i/2,s/2],scale:[-1,-1]});break;case 6:this.svg.polyline(l,r).transform({translate:[h/2+i/2,o/2]});break;case 7:this.svg.polyline(l,r).transform({translate:[h-h/2-i/2,o/2],scale:[-1,1]});break;case 8:this.svg.polyline(l,r).transform({translate:[h/2+i/2,m-o/2],scale:[1,-1]});break;case 9:this.svg.polyline(l,r).transform({translate:[h-h/2-i/2,m-o/2],scale:[-1,-1]});break;case 10:this.svg.polyline(l,r).transform({translate:[i/2,m/2-i/2]});break;case 11:this.svg.polyline(l,r).transform({translate:[h-i/2,m/2-i/2],scale:[-1,1]});break;case 12:this.svg.rect(0,0,i,i,r).transform({translate:[i/2,i/2],rotate:[-30,0,0]});break;case 13:this.svg.rect(0,0,i,i,r).transform({scale:[-1,1],translate:[-h+i/2,i/2],rotate:[-30,0,0]});break;case 14:this.svg.rect(0,0,i,i,r).transform({translate:[i/2,m/2-i/2-i],rotate:[30,0,i]});break;case 15:this.svg.rect(0,0,i,i,r).transform({scale:[-1,1],translate:[-h+i/2,m/2-i/2-i],rotate:[30,0,i]});break;case 16:this.svg.rect(0,0,i,i,r).transform({scale:[1,-1],translate:[i/2,-m+m/2-i/2-i],rotate:[30,0,i]});break;case 17:this.svg.rect(0,0,i,i,r).transform({scale:[-1,-1],translate:[-h+i/2,-m+m/2-i/2-i],rotate:[30,0,i]});break;case 18:this.svg.rect(0,0,i,i,r).transform({scale:[1,-1],translate:[i/2,-m+i/2],rotate:[-30,0,0]});break;case 19:this.svg.rect(0,0,i,i,r).transform({scale:[-1,-1],translate:[-h+i/2,-m+i/2],rotate:[-30,0,0]})}}},6743(e){"use strict";function t(){var e=0x67452301,t=0xefcdab89,r=0x98badcfe,n=0x10325476,i=0xc3d2e1f0,o=new Uint32Array(80),a=0,s=24,l=0;function u(){for(var s,l,u=16;u<80;u++){var c=o[u-3]^o[u-8]^o[u-14]^o[u-16];o[u]=c<<1|c>>>31}var d=e,p=t,f=r,h=n,m=i;for(u=0;u<80;u++){u<20?(s=h^p&(f^h),l=0x5a827999):u<40?(s=p^f^h,l=0x6ed9eba1):u<60?(s=p&f|h&(p|f),l=0x8f1bbcdc):(s=p^f^h,l=0xca62c1d6);var y=(d<<5|d>>>27)+s+m+l+(0|o[u]);m=h,h=f,f=p<<30|p>>>2,p=d,d=y}for(u=0,e=e+d|0,t=t+p|0,r=r+f|0,n=n+h|0,i=i+m|0,a=0;u<16;u++)o[u]=0}function c(e){o[a]|=(255&e)<<s,s?s-=8:(a++,s=24),16===a&&u()}function d(e){for(var t="",r=28;r>=0;r-=4)t+=(e>>r&15).toString(16);return t}return{update:function(e){if("string"==typeof e){var t=e.length;l+=8*t;for(var r=0;r<t;r++)c(e.charCodeAt(r));return}var n=e.length;l+=8*n;for(var i=0;i<n;i++)c(e[i])},digest:function(){c(128),(a>14||14===a&&s<24)&&u(),a=14,s=24,c(0),c(0),c(l>0xffffffffff?l/0x10000000000:0),c(l>0xffffffff?l/0x100000000:0);for(var o=24;o>=0;o-=8)c(l>>o);return d(e)+d(t)+d(r)+d(n)+d(i)}}}e.exports=function(e){if(void 0===e)return t();var r=t();return r.update(e),r.digest()}},8502(e,t,r){"use strict";var n=r(2849),i=r(6541);function o(){return this.width=100,this.height=100,this.svg=i("svg"),this.context=[],this.setAttributes(this.svg,{xmlns:"http://www.w3.org/2000/svg",width:this.width,height:this.height}),this}e.exports=o,o.prototype.currentContext=function(){return this.context[this.context.length-1]||this.svg},o.prototype.end=function(){return this.context.pop(),this},o.prototype.currentNode=function(){var e=this.currentContext();return e.lastChild||e},o.prototype.transform=function(e){return this.currentNode().setAttribute("transform",Object.keys(e).map(function(t){return t+"("+e[t].join(",")+")"}).join(" ")),this},o.prototype.setAttributes=function(e,t){Object.keys(t).forEach(function(r){e.setAttribute(r,t[r])})},o.prototype.setWidth=function(e){this.svg.setAttribute("width",Math.floor(e))},o.prototype.setHeight=function(e){this.svg.setAttribute("height",Math.floor(e))},o.prototype.toString=function(){return this.svg.toString()},o.prototype.rect=function(e,t,r,o,a){var s=this;if(Array.isArray(e))return e.forEach(function(e){s.rect.apply(s,e.concat(a))}),this;var l=i("rect");return this.currentContext().appendChild(l),this.setAttributes(l,n({x:e,y:t,width:r,height:o},a)),this},o.prototype.circle=function(e,t,r,o){var a=i("circle");return this.currentContext().appendChild(a),this.setAttributes(a,n({cx:e,cy:t,r:r},o)),this},o.prototype.path=function(e,t){var r=i("path");return this.currentContext().appendChild(r),this.setAttributes(r,n({d:e},t)),this},o.prototype.polyline=function(e,t){var r=this;if(Array.isArray(e))return e.forEach(function(e){r.polyline(e,t)}),this;var o=i("polyline");return this.currentContext().appendChild(o),this.setAttributes(o,n({points:e},t)),this},o.prototype.group=function(e){var t=i("g");return this.currentContext().appendChild(t),this.context.push(t),this.setAttributes(t,n({},e)),this}},6541(e){"use strict";var t=e.exports=function(e){return this instanceof t?(this.tagName=e,this.attributes=Object.create(null),this.children=[],this.lastChild=null,this):new t(e)};t.prototype.appendChild=function(e){return this.children.push(e),this.lastChild=e,this},t.prototype.setAttribute=function(e,t){return this.attributes[e]=t,this},t.prototype.toString=function(){var e=this;return["<",e.tagName,Object.keys(e.attributes).map(function(t){return[" ",t,'="',e.attributes[t],'"'].join("")}).join(""),">",e.children.map(function(e){return e.toString()}).join(""),"</",e.tagName,">"].join("")}},8067(e,t){"use strict";t.pathToRegexp=function(e,t={}){let{delimiter:u="/",end:c=!0,sensitive:d=!1,trailing:p=!0}=t,f=[],h=[];for(let c of function e(t,r){if(Array.isArray(t))for(let n of t)e(n,r);else r.push(t);return r}(e,[])){let e="object"==typeof c?c:function(e,t={}){let{encodePath:a=r}=t,u=[...e],c=[],d=0,p=0;function f(){let t="";if(n.test(u[d]))do t+=u[d++];while(i.test(u[d]));else if('"'===u[d]){let r=d;for(;d++<u.length;){if('"'===u[d]){d++,r=0;break}"\\"===u[d]&&d++,t+=u[d]}if(r)throw new l(`Unterminated quote at index ${r}`,e)}if(!t)throw new l(`Missing parameter name at index ${d}`,e);return t}for(;d<u.length;){let e=u[d],t=o[e];t?c.push({type:t,index:d++,value:e}):"\\"===e?c.push({type:"escape",index:d++,value:u[d++]}):":"===e?c.push({type:"param",index:d++,value:f()}):"*"===e?c.push({type:"wildcard",index:d++,value:f()}):c.push({type:"char",index:d++,value:e})}return c.push({type:"end",index:d,value:""}),new s(function t(r){let n=[];for(;;){let i=c[p++];if(i.type===r)break;if("char"===i.type||"escape"===i.type){let e=i.value,t=c[p];for(;"char"===t.type||"escape"===t.type;)e+=t.value,t=c[++p];n.push({type:"text",value:a(e)});continue}if("param"===i.type||"wildcard"===i.type){n.push({type:i.type,name:i.value});continue}if("{"===i.type){n.push({type:"group",tokens:t("}")});continue}throw new l(`Unexpected ${i.type} at index ${i.index}, expected ${r}`,e)}return n}("end"),e)}(c,t);for(let t of function* e(t,r,n){if(r===t.length)return yield n;let i=t[r];if("group"===i.type)for(let o of e(i.tokens,0,n.slice()))yield*e(t,r+1,o);else n.push(i);yield*e(t,r+1,n)}(e.tokens,0,[]))h.push(function(e,t,r,n){let i="",o="",s=!0;for(let d of e){if("text"===d.type){i+=a(d.value),o+=d.value,s||(s=d.value.includes(t));continue}if("param"===d.type||"wildcard"===d.type){var u,c;if(!s&&!o)throw new l(`Missing text before "${d.name}" ${d.type}`,n);"param"===d.type?i+=`(${u=t,(c=s?"":o).length<2?u.length<2?`[^${a(u+c)}]`:`(?:(?!${a(u)})[^${a(c)}])`:u.length<2?`(?:(?!${a(c)})[^${a(u)}])`:`(?:(?!${a(c)}|${a(u)})[\\s\\S])`}+)`:i+="([\\s\\S]+)",r.push(d),o="",s=!1;continue}}return i}(t,u,f,e.originalPath))}let m=`^(?:${h.join("|")})`;return p&&(m+=`(?:${a(u)}$)?`),{regexp:new RegExp(m+=c?"$":`(?=${a(u)}|$)`,d?"":"i"),keys:f}};let r=e=>e,n=/^[$_\p{ID_Start}]$/u,i=/^[$\u200c\u200d\p{ID_Continue}]$/u,o={"{":"{","}":"}","(":"(",")":")","[":"[","]":"]","+":"+","?":"?","!":"!"};function a(e){return e.replace(/[.+*?^${}()[\]|/\\]/g,"\\$&")}class s{constructor(e,t){this.tokens=e,this.originalPath=t}}class l extends TypeError{constructor(e,t){let r=e;t&&(r+=`: ${t}`),super(r+="; visit https://git.new/pathToRegexpError for info"),this.originalPath=t}}},5338(e,t,r){"use strict";var n=r(7643);t.createRoot=n.createRoot,t.hydrateRoot=n.hydrateRoot},9850(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(2888),a=r(3207);t.AsyncSubject=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.value=null,t.hasNext=!1,t.hasCompleted=!1,t}return i(t,e),t.prototype._subscribe=function(t){return this.hasError?(t.error(this.thrownError),a.Subscription.EMPTY):this.hasCompleted&&this.hasNext?(t.next(this.value),t.complete(),a.Subscription.EMPTY):e.prototype._subscribe.call(this,t)},t.prototype.next=function(e){this.hasCompleted||(this.value=e,this.hasNext=!0)},t.prototype.error=function(t){this.hasCompleted||e.prototype.error.call(this,t)},t.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&e.prototype.next.call(this,this.value),e.prototype.complete.call(this)},t}(o.Subject)},466(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(2888),a=r(6967);t.BehaviorSubject=function(e){function t(t){var r=e.call(this)||this;return r._value=t,r}return i(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),t.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return r&&!r.closed&&t.next(this._value),r},t.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(!this.closed)return this._value;throw new a.ObjectUnsubscribedError},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(o.Subject)},4470(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.InnerSubscriber=function(e){function t(t,r,n){var i=e.call(this)||this;return i.parent=t,i.outerValue=r,i.outerIndex=n,i.index=0,i}return i(t,e),t.prototype._next=function(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)},t.prototype._error=function(e){this.parent.notifyError(e,this),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(r(1396).Subscriber)},6765(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(453),o=r(7795),a=r(1576);(n=t.NotificationKind||(t.NotificationKind={})).NEXT="N",n.ERROR="E",n.COMPLETE="C",t.Notification=function(){function e(e,t,r){this.kind=e,this.value=t,this.error=r,this.hasValue="N"===e}return e.prototype.observe=function(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}},e.prototype.do=function(e,t,r){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return r&&r()}},e.prototype.accept=function(e,t,r){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,r)},e.prototype.toObservable=function(){switch(this.kind){case"N":return o.of(this.value);case"E":return a.throwError(this.error);case"C":return i.empty()}throw Error("unexpected notification kind value")},e.createNext=function(t){return void 0!==t?new e("N",t):e.undefinedValueNotification},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e.undefinedValueNotification=new e("N",void 0),e}()},2515(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4487),i=r(5158),o=r(6676),a=r(8173),s=r(3344);function l(e){if(e||(e=s.config.Promise||Promise),!e)throw Error("no Promise impl found");return e}t.Observable=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var n=this.operator,o=i.toSubscriber(e,t,r);if(n?o.add(n.call(o,this.source)):o.add(this.source||s.config.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),s.config.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){s.config.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),n.canReportError(e)?e.error(t):console.warn(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=l(t))(function(t,n){var i;i=r.subscribe(function(t){try{e(t)}catch(e){n(e),i&&i.unsubscribe()}},n,t)})},e.prototype._subscribe=function(e){var t=this.source;return t&&t.subscribe(e)},e.prototype[o.observable]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?this:a.pipeFromArray(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=l(e))(function(e,r){var n;t.subscribe(function(e){return n=e},function(e){return r(e)},function(){return e(n)})})},e.create=function(t){return new e(t)},e}()},2544(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3344),i=r(4163);t.empty={closed:!0,next:function(e){},error:function(e){if(n.config.useDeprecatedSynchronousErrorHandling)throw e;i.hostReportError(e)},complete:function(){}}},5905(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.OuterSubscriber=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.notifyNext=function(e,t,r,n,i){this.destination.next(t)},t.prototype.notifyError=function(e,t){this.destination.error(e)},t.prototype.notifyComplete=function(e){this.destination.complete()},t}(r(1396).Subscriber)},2173(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(2888),a=r(5677),s=r(3207),l=r(5495),u=r(6967),c=r(3601);t.ReplaySubject=function(e){function t(t,r,n){void 0===t&&(t=1/0),void 0===r&&(r=1/0);var i=e.call(this)||this;return i.scheduler=n,i._events=[],i._infiniteTimeWindow=!1,i._bufferSize=t<1?1:t,i._windowTime=r<1?1:r,r===1/0?(i._infiniteTimeWindow=!0,i.next=i.nextInfiniteTimeWindow):i.next=i.nextTimeWindow,i}return i(t,e),t.prototype.nextInfiniteTimeWindow=function(t){if(!this.isStopped){var r=this._events;r.push(t),r.length>this._bufferSize&&r.shift()}e.prototype.next.call(this,t)},t.prototype.nextTimeWindow=function(t){this.isStopped||(this._events.push(new d(this._getNow(),t)),this._trimBufferThenGetEvents()),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){var t,r=this._infiniteTimeWindow,n=r?this._events:this._trimBufferThenGetEvents(),i=this.scheduler,o=n.length;if(this.closed)throw new u.ObjectUnsubscribedError;if(this.isStopped||this.hasError?t=s.Subscription.EMPTY:(this.observers.push(e),t=new c.SubjectSubscription(this,e)),i&&e.add(e=new l.ObserveOnSubscriber(e,i)),r)for(var a=0;a<o&&!e.closed;a++)e.next(n[a]);else for(var a=0;a<o&&!e.closed;a++)e.next(n[a].value);return this.hasError?e.error(this.thrownError):this.isStopped&&e.complete(),t},t.prototype._getNow=function(){return(this.scheduler||a.queue).now()},t.prototype._trimBufferThenGetEvents=function(){for(var e=this._getNow(),t=this._bufferSize,r=this._windowTime,n=this._events,i=n.length,o=0;o<i&&!(e-n[o].time<r);)o++;return i>t&&(o=Math.max(o,i-t)),o>0&&n.splice(0,o),n},t}(o.Subject);var d=function(e,t){this.time=e,this.value=t}},3849(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Scheduler=function(){function e(t,r){void 0===r&&(r=e.now),this.SchedulerAction=t,this.now=r}return e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.SchedulerAction(this,e).schedule(r,t)},e.now=function(){return Date.now()},e}()},2888(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(2515),a=r(1396),s=r(3207),l=r(6967),u=r(3601),c=r(4421),d=function(e){function t(t){var r=e.call(this,t)||this;return r.destination=t,r}return i(t,e),t}(a.Subscriber);t.SubjectSubscriber=d;var p=function(e){function t(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return i(t,e),t.prototype[c.rxSubscriber]=function(){return new d(this)},t.prototype.lift=function(e){var t=new f(this,this);return t.operator=e,t},t.prototype.next=function(e){if(this.closed)throw new l.ObjectUnsubscribedError;if(!this.isStopped)for(var t=this.observers,r=t.length,n=t.slice(),i=0;i<r;i++)n[i].next(e)},t.prototype.error=function(e){if(this.closed)throw new l.ObjectUnsubscribedError;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,r=t.length,n=t.slice(),i=0;i<r;i++)n[i].error(e);this.observers.length=0},t.prototype.complete=function(){if(this.closed)throw new l.ObjectUnsubscribedError;this.isStopped=!0;for(var e=this.observers,t=e.length,r=e.slice(),n=0;n<t;n++)r[n].complete();this.observers.length=0},t.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},t.prototype._trySubscribe=function(t){if(!this.closed)return e.prototype._trySubscribe.call(this,t);throw new l.ObjectUnsubscribedError},t.prototype._subscribe=function(e){if(this.closed)throw new l.ObjectUnsubscribedError;return this.hasError?(e.error(this.thrownError),s.Subscription.EMPTY):this.isStopped?(e.complete(),s.Subscription.EMPTY):(this.observers.push(e),new u.SubjectSubscription(this,e))},t.prototype.asObservable=function(){var e=new o.Observable;return e.source=this,e},t.create=function(e,t){return new f(e,t)},t}(o.Observable);t.Subject=p;var f=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return i(t,e),t.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},t.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},t.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},t.prototype._subscribe=function(e){return this.source?this.source.subscribe(e):s.Subscription.EMPTY},t}(p);t.AnonymousSubject=f},3601(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.SubjectSubscription=function(e){function t(t,r){var n=e.call(this)||this;return n.subject=t,n.subscriber=r,n.closed=!1,n}return i(t,e),t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var r=t.indexOf(this.subscriber);-1!==r&&t.splice(r,1)}}},t}(r(3207).Subscription)},1396(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(3385),a=r(2544),s=r(3207),l=r(4421),u=r(3344),c=r(4163),d=function(e){function t(r,n,i){var o=e.call(this)||this;switch(o.syncErrorValue=null,o.syncErrorThrown=!1,o.syncErrorThrowable=!1,o.isStopped=!1,arguments.length){case 0:o.destination=a.empty;break;case 1:if(!r){o.destination=a.empty;break}if("object"==typeof r){r instanceof t?(o.syncErrorThrowable=r.syncErrorThrowable,o.destination=r,r.add(o)):(o.syncErrorThrowable=!0,o.destination=new p(o,r));break}default:o.syncErrorThrowable=!0,o.destination=new p(o,r,n,i)}return o}return i(t,e),t.prototype[l.rxSubscriber]=function(){return this},t.create=function(e,r,n){var i=new t(e,r,n);return i.syncErrorThrowable=!1,i},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},t}(s.Subscription);t.Subscriber=d;var p=function(e){function t(t,r,n,i){var s,l=e.call(this)||this;l._parentSubscriber=t;var u=l;return o.isFunction(r)?s=r:r&&(s=r.next,n=r.error,i=r.complete,r!==a.empty&&(u=Object.create(r),o.isFunction(u.unsubscribe)&&l.add(u.unsubscribe.bind(u)),u.unsubscribe=l.unsubscribe.bind(l))),l._context=u,l._next=s,l._error=n,l._complete=i,l}return i(t,e),t.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;u.config.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},t.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,r=u.config.useDeprecatedSynchronousErrorHandling;if(this._error)r&&t.syncErrorThrowable?this.__tryOrSetError(t,this._error,e):this.__tryOrUnsub(this._error,e),this.unsubscribe();else if(t.syncErrorThrowable)r?(t.syncErrorValue=e,t.syncErrorThrown=!0):c.hostReportError(e),this.unsubscribe();else{if(this.unsubscribe(),r)throw e;c.hostReportError(e)}}},t.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var r=function(){return e._complete.call(e._context)};u.config.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,r):this.__tryOrUnsub(r),this.unsubscribe()}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),u.config.useDeprecatedSynchronousErrorHandling)throw e;c.hostReportError(e)}},t.prototype.__tryOrSetError=function(e,t,r){if(!u.config.useDeprecatedSynchronousErrorHandling)throw Error("bad call");try{t.call(this._context,r)}catch(t){if(u.config.useDeprecatedSynchronousErrorHandling)return e.syncErrorValue=t,e.syncErrorThrown=!0,!0;return c.hostReportError(t),!0}return!1},t.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},t}(d);t.SafeSubscriber=p},3207(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4728),i=r(194),o=r(3385),a=r(1245);function s(e){return e.reduce(function(e,t){return e.concat(t instanceof a.UnsubscriptionError?t.errors:t)},[])}t.Subscription=function(){var e;function t(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return t.prototype.unsubscribe=function(){if(!this.closed){var e,r=this._parentOrParents,l=this._ctorUnsubscribe,u=this._unsubscribe,c=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,r instanceof t)r.remove(this);else if(null!==r)for(var d=0;d<r.length;++d)r[d].remove(this);if(o.isFunction(u)){l&&(this._unsubscribe=void 0);try{u.call(this)}catch(t){e=t instanceof a.UnsubscriptionError?s(t.errors):[t]}}if(n.isArray(c))for(var d=-1,p=c.length;++d<p;){var f=c[d];if(i.isObject(f))try{f.unsubscribe()}catch(t){e=e||[],t instanceof a.UnsubscriptionError?e=e.concat(s(t.errors)):e.push(t)}}if(e)throw new a.UnsubscriptionError(e)}},t.prototype.add=function(e){var r=e;if(!e)return t.EMPTY;switch(typeof e){case"function":r=new t(e);case"object":if(r===this||r.closed||"function"!=typeof r.unsubscribe)return r;if(this.closed)return r.unsubscribe(),r;if(!(r instanceof t)){var n=r;(r=new t)._subscriptions=[n]}break;default:throw Error("unrecognized teardown "+e+" added to Subscription.")}var i=r._parentOrParents;if(null===i)r._parentOrParents=this;else if(i instanceof t){if(i===this)return r;r._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return r;i.push(this)}var o=this._subscriptions;return null===o?this._subscriptions=[r]:o.push(r),r},t.prototype.remove=function(e){var t=this._subscriptions;if(t){var r=t.indexOf(e);-1!==r&&t.splice(r,1)}},(e=new t).closed=!0,t.EMPTY=e,t}()},3344(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=!1;t.config={Promise:void 0,set useDeprecatedSynchronousErrorHandling(value){value?console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+Error().stack):r&&console.log("RxJS: Back to a better error behavior. Thank you. <3"),r=value},get useDeprecatedSynchronousErrorHandling(){return r}}},4398(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(2515),s=r(7092);t.SimpleInnerSubscriber=function(e){function t(t){var r=e.call(this)||this;return r.parent=t,r}return i(t,e),t.prototype._next=function(e){this.parent.notifyNext(e)},t.prototype._error=function(e){this.parent.notifyError(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},t}(o.Subscriber),t.ComplexInnerSubscriber=function(e){function t(t,r,n){var i=e.call(this)||this;return i.parent=t,i.outerValue=r,i.outerIndex=n,i}return i(t,e),t.prototype._next=function(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this)},t.prototype._error=function(e){this.parent.notifyError(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(o.Subscriber),t.SimpleOuterSubscriber=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(){this.destination.complete()},t}(o.Subscriber),t.ComplexOuterSubscriber=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.notifyNext=function(e,t,r,n){this.destination.next(t)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(e){this.destination.complete()},t}(o.Subscriber),t.innerSubscribe=function(e,t){var r;if(!t.closed){if(e instanceof a.Observable)return e.subscribe(t);try{r=s.subscribeTo(e)(t)}catch(e){t.error(e)}return r}}},2871(e,t,r){"use strict";var n,i,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var a=r(2888),s=r(2515),l=r(1396),u=r(3207),c=r(6888),d=function(e){function t(t,r){var n=e.call(this)||this;return n.source=t,n.subjectFactory=r,n._refCount=0,n._isComplete=!1,n}return o(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject},t.prototype.connect=function(){var e=this._connection;return!e&&(this._isComplete=!1,(e=this._connection=new u.Subscription).add(this.source.subscribe(new p(this.getSubject(),this))),e.closed&&(this._connection=null,e=u.Subscription.EMPTY)),e},t.prototype.refCount=function(){return c.refCount()(this)},t}(s.Observable);t.ConnectableObservable=d,t.connectableObservableDescriptor={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:(i=d.prototype)._subscribe},_isComplete:{value:i._isComplete,writable:!0},getSubject:{value:i.getSubject},connect:{value:i.connect},refCount:{value:i.refCount}};var p=function(e){function t(t,r){var n=e.call(this,t)||this;return n.connectable=r,n}return o(t,e),t.prototype._error=function(t){this._unsubscribe(),e.prototype._error.call(this,t)},t.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}},t}(a.SubjectSubscriber);(function(e){this.connectable=e}).prototype.call=function(e,t){var r=this.connectable;r._refCount++;var n=new f(e,r),i=t.subscribe(n);return n.closed||(n.connection=r.connect()),i};var f=function(e){function t(t,r){var n=e.call(this,t)||this;return n.connectable=r,n}return o(t,e),t.prototype._unsubscribe=function(){var e=this.connectable;if(!e){this.connection=null;return}this.connectable=null;var t=e._refCount;if(t<=0||(e._refCount=t-1,t>1)){this.connection=null;return}var r=this.connection,n=e._connection;this.connection=null,n&&(!r||n===r)&&n.unsubscribe()},t}(l.Subscriber)},8072(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(2515),a=r(2745),s=r(5390);t.SubscribeOnObservable=function(e){function t(t,r,n){void 0===r&&(r=0),void 0===n&&(n=a.asap);var i=e.call(this)||this;return i.source=t,i.delayTime=r,i.scheduler=n,(!s.isNumeric(r)||r<0)&&(i.delayTime=0),n&&"function"==typeof n.schedule||(i.scheduler=a.asap),i}return i(t,e),t.create=function(e,r,n){return void 0===r&&(r=0),void 0===n&&(n=a.asap),new t(e,r,n)},t.dispatch=function(e){var t=e.source,r=e.subscriber;return this.add(t.subscribe(r))},t.prototype._subscribe=function(e){var r=this.delayTime,n=this.source;return this.scheduler.schedule(t.dispatch,r,{source:n,subscriber:e})},t}(o.Observable)},278(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(8244),a=r(4728),s=r(5905),l=r(7849),u=r(5853),c={};t.combineLatest=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=void 0,n=void 0;return o.isScheduler(e[e.length-1])&&(n=e.pop()),"function"==typeof e[e.length-1]&&(r=e.pop()),1===e.length&&a.isArray(e[0])&&(e=e[0]),u.fromArray(e,n).lift(new d(r))};var d=function(){function e(e){this.resultSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new p(e,this.resultSelector))},e}();t.CombineLatestOperator=d;var p=function(e){function t(t,r){var n=e.call(this,t)||this;return n.resultSelector=r,n.active=0,n.values=[],n.observables=[],n}return i(t,e),t.prototype._next=function(e){this.values.push(c),this.observables.push(e)},t.prototype._complete=function(){var e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(var r=0;r<t;r++){var n=e[r];this.add(l.subscribeToResult(this,n,void 0,r))}}},t.prototype.notifyComplete=function(e){0==(this.active-=1)&&this.destination.complete()},t.prototype.notifyNext=function(e,t,r){var n=this.values,i=n[r],o=this.toRespond?i===c?--this.toRespond:this.toRespond:0;n[r]=t,0===o&&(this.resultSelector?this._tryResultSelector(n):this.destination.next(n.slice()))},t.prototype._tryResultSelector=function(e){var t;try{t=this.resultSelector.apply(this,e)}catch(e){this.destination.error(e);return}this.destination.next(t)},t}(s.OuterSubscriber);t.CombineLatestSubscriber=p},5434(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7795),i=r(6345);t.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i.concatAll()(n.of.apply(void 0,e))}},3180(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2515),i=r(4098),o=r(453);t.defer=function(e){return new n.Observable(function(t){var r;try{r=e()}catch(e){t.error(e);return}return(r?i.from(r):o.empty()).subscribe(t)})}},453(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2515);t.EMPTY=new n.Observable(function(e){return e.complete()}),t.empty=function(e){var r;return e?(r=e,new n.Observable(function(e){return r.schedule(function(){return e.complete()})})):t.EMPTY}},4098(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2515),i=r(7092),o=r(7315);t.from=function(e,t){return t?o.scheduled(e,t):e instanceof n.Observable?e:new n.Observable(i.subscribeTo(e))}},5853(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2515),i=r(499),o=r(8822);t.fromArray=function(e,t){return t?o.scheduleArray(e,t):new n.Observable(i.subscribeToArray(e))}},5776(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2515),i=r(8244),o=r(9287),a=r(5853);t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=1/0,s=null,l=e[e.length-1];return(i.isScheduler(l)?(s=e.pop(),e.length>1&&"number"==typeof e[e.length-1]&&(r=e.pop())):"number"==typeof l&&(r=e.pop()),null===s&&1===e.length&&e[0]instanceof n.Observable)?e[0]:o.mergeAll(r)(a.fromArray(e,s))}},7795(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(8244),i=r(5853),o=r(8822);t.of=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[e.length-1];return n.isScheduler(r)?(e.pop(),o.scheduleArray(e,r)):i.fromArray(e)}},3827(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(4728),a=r(5853),s=r(5905),l=r(7849);t.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(1===e.length)if(!o.isArray(e[0]))return e[0];else e=e[0];return a.fromArray(e,void 0).lift(new u)};var u=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new c(e))},e}();t.RaceOperator=u;var c=function(e){function t(t){var r=e.call(this,t)||this;return r.hasFirst=!1,r.observables=[],r.subscriptions=[],r}return i(t,e),t.prototype._next=function(e){this.observables.push(e)},t.prototype._complete=function(){var e=this.observables,t=e.length;if(0===t)this.destination.complete();else{for(var r=0;r<t&&!this.hasFirst;r++){var n=e[r],i=l.subscribeToResult(this,n,void 0,r);this.subscriptions&&this.subscriptions.push(i),this.add(i)}this.observables=null}},t.prototype.notifyNext=function(e,t,r){if(!this.hasFirst){this.hasFirst=!0;for(var n=0;n<this.subscriptions.length;n++)if(n!==r){var i=this.subscriptions[n];i.unsubscribe(),this.remove(i)}this.subscriptions=null}this.destination.next(t)},t}(s.OuterSubscriber);t.RaceSubscriber=c},1576(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2515);function i(e){var t=e.error;e.subscriber.error(t)}t.throwError=function(e,t){return new n.Observable(t?function(r){return t.schedule(i,0,{error:e,subscriber:r})}:function(t){return t.error(e)})}},4529(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2515),i=r(5190),o=r(5390),a=r(8244);function s(e){var t=e.index,r=e.period,n=e.subscriber;if(n.next(t),!n.closed){if(-1===r)return n.complete();e.index=t+1,this.schedule(e,r)}}t.timer=function(e,t,r){void 0===e&&(e=0);var l=-1;return o.isNumeric(t)?l=1>Number(t)&&1||Number(t):a.isScheduler(t)&&(r=t),a.isScheduler(r)||(r=i.async),new n.Observable(function(t){var n=o.isNumeric(e)?e:e-r.now();return r.schedule(s,n,{index:0,period:l,subscriber:t})})}},887(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(5853),a=r(4728),s=r(1396),l=r(7211),u=r(4398);t.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[e.length-1];return"function"==typeof r&&e.pop(),o.fromArray(e,void 0).lift(new c(r))};var c=function(){function e(e){this.resultSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new d(e,this.resultSelector))},e}();t.ZipOperator=c;var d=function(e){function t(t,r,n){void 0===n&&(n=Object.create(null));var i=e.call(this,t)||this;return i.resultSelector=r,i.iterators=[],i.active=0,i.resultSelector="function"==typeof r?r:void 0,i}return i(t,e),t.prototype._next=function(e){var t=this.iterators;a.isArray(e)?t.push(new f(e)):"function"==typeof e[l.iterator]?t.push(new p(e[l.iterator]())):t.push(new h(this.destination,this,e))},t.prototype._complete=function(){var e=this.iterators,t=e.length;if(this.unsubscribe(),0===t)return void this.destination.complete();this.active=t;for(var r=0;r<t;r++){var n=e[r];n.stillUnsubscribed?this.destination.add(n.subscribe()):this.active--}},t.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},t.prototype.checkIterators=function(){for(var e=this.iterators,t=e.length,r=this.destination,n=0;n<t;n++){var i=e[n];if("function"==typeof i.hasValue&&!i.hasValue())return}for(var o=!1,a=[],n=0;n<t;n++){var i=e[n],s=i.next();if(i.hasCompleted()&&(o=!0),s.done)return void r.complete();a.push(s.value)}this.resultSelector?this._tryresultSelector(a):r.next(a),o&&r.complete()},t.prototype._tryresultSelector=function(e){var t;try{t=this.resultSelector.apply(this,e)}catch(e){this.destination.error(e);return}this.destination.next(t)},t}(s.Subscriber);t.ZipSubscriber=d;var p=function(){function e(e){this.iterator=e,this.nextResult=e.next()}return e.prototype.hasValue=function(){return!0},e.prototype.next=function(){var e=this.nextResult;return this.nextResult=this.iterator.next(),e},e.prototype.hasCompleted=function(){var e=this.nextResult;return!!(e&&e.done)},e}(),f=function(){function e(e){this.array=e,this.index=0,this.length=0,this.length=e.length}return e.prototype[l.iterator]=function(){return this},e.prototype.next=function(e){var t=this.index++,r=this.array;return t<this.length?{value:r[t],done:!1}:{value:null,done:!0}},e.prototype.hasValue=function(){return this.array.length>this.index},e.prototype.hasCompleted=function(){return this.array.length===this.index},e}(),h=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.parent=r,i.observable=n,i.stillUnsubscribed=!0,i.buffer=[],i.isComplete=!1,i}return i(t,e),t.prototype[l.iterator]=function(){return this},t.prototype.next=function(){var e=this.buffer;return 0===e.length&&this.isComplete?{value:null,done:!0}:{value:e.shift(),done:!1}},t.prototype.hasValue=function(){return this.buffer.length>0},t.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},t.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},t.prototype.notifyNext=function(e){this.buffer.push(e),this.parent.checkIterators()},t.prototype.subscribe=function(){return u.innerSubscribe(this.observable,new u.SimpleInnerSubscriber(this))},t}(u.SimpleOuterSubscriber)},8461(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(4398);t.audit=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.durationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.durationSelector))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.durationSelector=r,n.hasValue=!1,n}return i(t,e),t.prototype._next=function(e){if(this.value=e,this.hasValue=!0,!this.throttled){var t=void 0;try{t=(0,this.durationSelector)(e)}catch(e){return this.destination.error(e)}var r=o.innerSubscribe(t,new o.SimpleInnerSubscriber(this));!r||r.closed?this.clearThrottle():this.add(this.throttled=r)}},t.prototype.clearThrottle=function(){var e=this.value,t=this.hasValue,r=this.throttled;r&&(this.remove(r),this.throttled=void 0,r.unsubscribe()),t&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))},t.prototype.notifyNext=function(){this.clearThrottle()},t.prototype.notifyComplete=function(){this.clearThrottle()},t}(o.SimpleOuterSubscriber)},2392(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5190),i=r(8461),o=r(4529);t.auditTime=function(e,t){return void 0===t&&(t=n.async),i.audit(function(){return o.timer(e,t)})}},7954(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(4398);t.buffer=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.closingNotifier=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.closingNotifier))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.buffer=[],n.add(o.innerSubscribe(r,new o.SimpleInnerSubscriber(n))),n}return i(t,e),t.prototype._next=function(e){this.buffer.push(e)},t.prototype.notifyNext=function(){var e=this.buffer;this.buffer=[],this.destination.next(e)},t}(o.SimpleOuterSubscriber)},647(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.bufferCount=function(e,t){return void 0===t&&(t=null),function(r){return r.lift(new a(e,t))}};var a=function(){function e(e,t){this.bufferSize=e,this.startBufferEvery=t,t&&e!==t?this.subscriberClass=l:this.subscriberClass=s}return e.prototype.call=function(e,t){return t.subscribe(new this.subscriberClass(e,this.bufferSize,this.startBufferEvery))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.bufferSize=r,n.buffer=[],n}return i(t,e),t.prototype._next=function(e){var t=this.buffer;t.push(e),t.length==this.bufferSize&&(this.destination.next(t),this.buffer=[])},t.prototype._complete=function(){var t=this.buffer;t.length>0&&this.destination.next(t),e.prototype._complete.call(this)},t}(o.Subscriber),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.bufferSize=r,i.startBufferEvery=n,i.buffers=[],i.count=0,i}return i(t,e),t.prototype._next=function(e){var t=this.bufferSize,r=this.startBufferEvery,n=this.buffers,i=this.count;this.count++,i%r==0&&n.push([]);for(var o=n.length;o--;){var a=n[o];a.push(e),a.length===t&&(n.splice(o,1),this.destination.next(a))}},t.prototype._complete=function(){for(var t=this.buffers,r=this.destination;t.length>0;){var n=t.shift();n.length>0&&r.next(n)}e.prototype._complete.call(this)},t}(o.Subscriber)},6327(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(5190),a=r(1396),s=r(8244);t.bufferTime=function(e){var t=arguments.length,r=o.async;s.isScheduler(arguments[arguments.length-1])&&(r=arguments[arguments.length-1],t--);var n=null;t>=2&&(n=arguments[1]);var i=1/0;return t>=3&&(i=arguments[2]),function(t){return t.lift(new l(e,n,i,r))}};var l=function(){function e(e,t,r,n){this.bufferTimeSpan=e,this.bufferCreationInterval=t,this.maxBufferSize=r,this.scheduler=n}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},e}(),u=function(){this.buffer=[]},c=function(e){function t(t,r,n,i,o){var a=e.call(this,t)||this;a.bufferTimeSpan=r,a.bufferCreationInterval=n,a.maxBufferSize=i,a.scheduler=o,a.contexts=[];var s=a.openContext();return a.timespanOnly=null==n||n<0,a.timespanOnly?a.add(s.closeAction=o.schedule(d,r,{subscriber:a,context:s,bufferTimeSpan:r})):(a.add(s.closeAction=o.schedule(f,r,{subscriber:a,context:s})),a.add(o.schedule(p,n,{bufferTimeSpan:r,bufferCreationInterval:n,subscriber:a,scheduler:o}))),a}return i(t,e),t.prototype._next=function(e){for(var t,r=this.contexts,n=r.length,i=0;i<n;i++){var o=r[i],a=o.buffer;a.push(e),a.length==this.maxBufferSize&&(t=o)}t&&this.onBufferFull(t)},t.prototype._error=function(t){this.contexts.length=0,e.prototype._error.call(this,t)},t.prototype._complete=function(){for(var t=this.contexts,r=this.destination;t.length>0;){var n=t.shift();r.next(n.buffer)}e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.contexts=null},t.prototype.onBufferFull=function(e){this.closeContext(e);var t=e.closeAction;if(t.unsubscribe(),this.remove(t),!this.closed&&this.timespanOnly){e=this.openContext();var r=this.bufferTimeSpan,n={subscriber:this,context:e,bufferTimeSpan:r};this.add(e.closeAction=this.scheduler.schedule(d,r,n))}},t.prototype.openContext=function(){var e=new u;return this.contexts.push(e),e},t.prototype.closeContext=function(e){this.destination.next(e.buffer);var t=this.contexts;(t?t.indexOf(e):-1)>=0&&t.splice(t.indexOf(e),1)},t}(a.Subscriber);function d(e){var t=e.subscriber,r=e.context;r&&t.closeContext(r),t.closed||(e.context=t.openContext(),e.context.closeAction=this.schedule(e,e.bufferTimeSpan))}function p(e){var t=e.bufferCreationInterval,r=e.bufferTimeSpan,n=e.subscriber,i=e.scheduler,o=n.openContext();n.closed||(n.add(o.closeAction=i.schedule(f,r,{subscriber:n,context:o})),this.schedule(e,t))}function f(e){var t=e.subscriber,r=e.context;t.closeContext(r)}},6786(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(3207),a=r(7849),s=r(5905);t.bufferToggle=function(e,t){return function(r){return r.lift(new l(e,t))}};var l=function(){function e(e,t){this.openings=e,this.closingSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.openings,this.closingSelector))},e}(),u=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.closingSelector=n,i.contexts=[],i.add(a.subscribeToResult(i,r)),i}return i(t,e),t.prototype._next=function(e){for(var t=this.contexts,r=t.length,n=0;n<r;n++)t[n].buffer.push(e)},t.prototype._error=function(t){for(var r=this.contexts;r.length>0;){var n=r.shift();n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,e.prototype._error.call(this,t)},t.prototype._complete=function(){for(var t=this.contexts;t.length>0;){var r=t.shift();this.destination.next(r.buffer),r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}this.contexts=null,e.prototype._complete.call(this)},t.prototype.notifyNext=function(e,t){e?this.closeBuffer(e):this.openBuffer(t)},t.prototype.notifyComplete=function(e){this.closeBuffer(e.context)},t.prototype.openBuffer=function(e){try{var t=this.closingSelector.call(this,e);t&&this.trySubscribe(t)}catch(e){this._error(e)}},t.prototype.closeBuffer=function(e){var t=this.contexts;if(t&&e){var r=e.buffer,n=e.subscription;this.destination.next(r),t.splice(t.indexOf(e),1),this.remove(n),n.unsubscribe()}},t.prototype.trySubscribe=function(e){var t=this.contexts,r=new o.Subscription,n={buffer:[],subscription:r};t.push(n);var i=a.subscribeToResult(this,e,n);!i||i.closed?this.closeBuffer(n):(i.context=n,this.add(i),r.add(i))},t}(s.OuterSubscriber)},1662(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(3207),a=r(4398);t.bufferWhen=function(e){return function(t){return t.lift(new s(e))}};var s=function(){function e(e){this.closingSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.closingSelector))},e}(),l=function(e){function t(t,r){var n=e.call(this,t)||this;return n.closingSelector=r,n.subscribing=!1,n.openBuffer(),n}return i(t,e),t.prototype._next=function(e){this.buffer.push(e)},t.prototype._complete=function(){var t=this.buffer;t&&this.destination.next(t),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},t.prototype.notifyNext=function(){this.openBuffer()},t.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},t.prototype.openBuffer=function(){var e,t=this.closingSubscription;t&&(this.remove(t),t.unsubscribe());var r=this.buffer;this.buffer&&this.destination.next(r),this.buffer=[];try{e=(0,this.closingSelector)()}catch(e){return this.error(e)}t=new o.Subscription,this.closingSubscription=t,this.add(t),this.subscribing=!0,t.add(a.innerSubscribe(e,new a.SimpleInnerSubscriber(this))),this.subscribing=!1},t}(a.SimpleOuterSubscriber)},5503(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(4398);t.catchError=function(e){return function(t){var r=new a(e),n=t.lift(r);return r.caught=n}};var a=function(){function e(e){this.selector=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.selector,this.caught))},e}(),s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.selector=r,i.caught=n,i}return i(t,e),t.prototype.error=function(t){if(!this.isStopped){var r=void 0;try{r=this.selector(t,this.caught)}catch(t){e.prototype.error.call(this,t);return}this._unsubscribeAndRecycle();var n=new o.SimpleInnerSubscriber(this);this.add(n);var i=o.innerSubscribe(r,n);i!==n&&this.add(i)}},t}(o.SimpleOuterSubscriber)},4908(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(278);t.combineAll=function(e){return function(t){return t.lift(new n.CombineLatestOperator(e))}}},9060(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4728),i=r(278),o=r(4098);t.combineLatest=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=null;return"function"==typeof e[e.length-1]&&(r=e.pop()),1===e.length&&n.isArray(e[0])&&(e=e[0].slice()),function(t){return t.lift.call(o.from([t].concat(e)),new i.CombineLatestOperator(r))}}},6600(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5434);t.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(n.concat.apply(void 0,[t].concat(e)))}}},6345(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9287);t.concatAll=function(){return n.mergeAll(1)}},2248(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5206);t.concatMap=function(e,t){return n.mergeMap(e,t,1)}},3577(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2248);t.concatMapTo=function(e,t){return n.concatMap(function(){return e},t)}},8765(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.count=function(e){return function(t){return t.lift(new a(e,t))}};var a=function(){function e(e,t){this.predicate=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.source))},e}(),s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.predicate=r,i.source=n,i.count=0,i.index=0,i}return i(t,e),t.prototype._next=function(e){this.predicate?this._tryPredicate(e):this.count++},t.prototype._tryPredicate=function(e){var t;try{t=this.predicate(e,this.index++,this.source)}catch(e){this.destination.error(e);return}t&&this.count++},t.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},t}(o.Subscriber)},3287(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(4398);t.debounce=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.durationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.durationSelector))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.durationSelector=r,n.hasValue=!1,n}return i(t,e),t.prototype._next=function(e){try{var t=this.durationSelector.call(this,e);t&&this._tryNext(e,t)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){this.emitValue(),this.destination.complete()},t.prototype._tryNext=function(e,t){var r=this.durationSubscription;this.value=e,this.hasValue=!0,r&&(r.unsubscribe(),this.remove(r)),(r=o.innerSubscribe(t,new o.SimpleInnerSubscriber(this)))&&!r.closed&&this.add(this.durationSubscription=r)},t.prototype.notifyNext=function(){this.emitValue()},t.prototype.notifyComplete=function(){this.emitValue()},t.prototype.emitValue=function(){if(this.hasValue){var t=this.value,r=this.durationSubscription;r&&(this.durationSubscription=void 0,r.unsubscribe(),this.remove(r)),this.value=void 0,this.hasValue=!1,e.prototype._next.call(this,t)}},t}(o.SimpleOuterSubscriber)},5685(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(5190);t.debounceTime=function(e,t){return void 0===t&&(t=a.async),function(r){return r.lift(new s(e,t))}};var s=function(){function e(e,t){this.dueTime=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.dueTime,this.scheduler))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.dueTime=r,i.scheduler=n,i.debouncedSubscription=null,i.lastValue=null,i.hasValue=!1,i}return i(t,e),t.prototype._next=function(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(u,this.dueTime,this))},t.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},t.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var e=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(e)}},t.prototype.clearDebounce=function(){var e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)},t}(o.Subscriber);function u(e){e.debouncedNext()}},2767(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.defaultIfEmpty=function(e){return void 0===e&&(e=null),function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.defaultValue=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.defaultValue))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.defaultValue=r,n.isEmpty=!0,n}return i(t,e),t.prototype._next=function(e){this.isEmpty=!1,this.destination.next(e)},t.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},t}(o.Subscriber)},6965(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(5190),a=r(4465),s=r(1396),l=r(6765);t.delay=function(e,t){void 0===t&&(t=o.async);var r=a.isDate(e)?e-t.now():Math.abs(e);return function(e){return e.lift(new u(r,t))}};var u=function(){function e(e,t){this.delay=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.delay,this.scheduler))},e}(),c=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.delay=r,i.scheduler=n,i.queue=[],i.active=!1,i.errored=!1,i}return i(t,e),t.dispatch=function(e){for(var t=e.source,r=t.queue,n=e.scheduler,i=e.destination;r.length>0&&r[0].time-n.now()<=0;)r.shift().notification.observe(i);if(r.length>0){var o=Math.max(0,r[0].time-n.now());this.schedule(e,o)}else this.unsubscribe(),t.active=!1},t.prototype._schedule=function(e){this.active=!0,this.destination.add(e.schedule(t.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))},t.prototype.scheduleNotification=function(e){if(!0!==this.errored){var t=this.scheduler,r=new d(t.now()+this.delay,e);this.queue.push(r),!1===this.active&&this._schedule(t)}},t.prototype._next=function(e){this.scheduleNotification(l.Notification.createNext(e))},t.prototype._error=function(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.scheduleNotification(l.Notification.createComplete()),this.unsubscribe()},t}(s.Subscriber),d=function(e,t){this.time=e,this.notification=t}},9861(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(2515),s=r(5905),l=r(7849);t.delayWhen=function(e,t){return t?function(r){return new d(r,t).lift(new u(e))}:function(t){return t.lift(new u(e))}};var u=function(){function e(e){this.delayDurationSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.delayDurationSelector))},e}(),c=function(e){function t(t,r){var n=e.call(this,t)||this;return n.delayDurationSelector=r,n.completed=!1,n.delayNotifierSubscriptions=[],n.index=0,n}return i(t,e),t.prototype.notifyNext=function(e,t,r,n,i){this.destination.next(e),this.removeSubscription(i),this.tryComplete()},t.prototype.notifyError=function(e,t){this._error(e)},t.prototype.notifyComplete=function(e){var t=this.removeSubscription(e);t&&this.destination.next(t),this.tryComplete()},t.prototype._next=function(e){var t=this.index++;try{var r=this.delayDurationSelector(e,t);r&&this.tryDelay(r,e)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},t.prototype.removeSubscription=function(e){e.unsubscribe();var t=this.delayNotifierSubscriptions.indexOf(e);return -1!==t&&this.delayNotifierSubscriptions.splice(t,1),e.outerValue},t.prototype.tryDelay=function(e,t){var r=l.subscribeToResult(this,e,t);r&&!r.closed&&(this.destination.add(r),this.delayNotifierSubscriptions.push(r))},t.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},t}(s.OuterSubscriber),d=function(e){function t(t,r){var n=e.call(this)||this;return n.source=t,n.subscriptionDelay=r,n}return i(t,e),t.prototype._subscribe=function(e){this.subscriptionDelay.subscribe(new p(e,this.source))},t}(a.Observable),p=function(e){function t(t,r){var n=e.call(this)||this;return n.parent=t,n.source=r,n.sourceSubscribed=!1,n}return i(t,e),t.prototype._next=function(e){this.subscribeToSource()},t.prototype._error=function(e){this.unsubscribe(),this.parent.error(e)},t.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},t.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},t}(o.Subscriber)},7642(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.dematerialize=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t.prototype._next=function(e){e.observe(this.destination)},t}(o.Subscriber)},8820(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(4398);t.distinct=function(e,t){return function(r){return r.lift(new a(e,t))}};var a=function(){function e(e,t){this.keySelector=e,this.flushes=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.keySelector,this.flushes))},e}(),s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.keySelector=r,i.values=new Set,n&&i.add(o.innerSubscribe(n,new o.SimpleInnerSubscriber(i))),i}return i(t,e),t.prototype.notifyNext=function(){this.values.clear()},t.prototype.notifyError=function(e){this._error(e)},t.prototype._next=function(e){this.keySelector?this._useKeySelector(e):this._finalizeNext(e,e)},t.prototype._useKeySelector=function(e){var t,r=this.destination;try{t=this.keySelector(e)}catch(e){r.error(e);return}this._finalizeNext(t,e)},t.prototype._finalizeNext=function(e,t){var r=this.values;r.has(e)||(r.add(e),this.destination.next(t))},t}(o.SimpleOuterSubscriber);t.DistinctSubscriber=s},9391(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.distinctUntilChanged=function(e,t){return function(r){return r.lift(new a(e,t))}};var a=function(){function e(e,t){this.compare=e,this.keySelector=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.compare,this.keySelector))},e}(),s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.keySelector=n,i.hasKey=!1,"function"==typeof r&&(i.compare=r),i}return i(t,e),t.prototype.compare=function(e,t){return e===t},t.prototype._next=function(e){try{var t,r=this.keySelector;t=r?r(e):e}catch(e){return this.destination.error(e)}var n=!1;if(this.hasKey)try{n=(0,this.compare)(this.key,t)}catch(e){return this.destination.error(e)}else this.hasKey=!0;n||(this.key=t,this.destination.next(e))},t}(o.Subscriber)},5075(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9391);t.distinctUntilKeyChanged=function(e,t){return n.distinctUntilChanged(function(r,n){return t?t(r[e],n[e]):r[e]===n[e]})}},2399(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7568),i=r(2670),o=r(2056),a=r(2767),s=r(1231);t.elementAt=function(e,t){if(e<0)throw new n.ArgumentOutOfRangeError;var r=arguments.length>=2;return function(l){return l.pipe(i.filter(function(t,r){return r===e}),s.take(1),r?a.defaultIfEmpty(t):o.throwIfEmpty(function(){return new n.ArgumentOutOfRangeError}))}}},2631(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5434),i=r(7795);t.endWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return n.concat(t,i.of.apply(void 0,e))}}},7233(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.every=function(e,t){return function(r){return r.lift(new a(e,t,r))}};var a=function(){function e(e,t,r){this.predicate=e,this.thisArg=t,this.source=r}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.thisArg,this.source))},e}(),s=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return o.predicate=r,o.thisArg=n,o.source=i,o.index=0,o.thisArg=n||o,o}return i(t,e),t.prototype.notifyComplete=function(e){this.destination.next(e),this.destination.complete()},t.prototype._next=function(e){var t=!1;try{t=this.predicate.call(this.thisArg,e,this.index++,this.source)}catch(e){this.destination.error(e);return}t||this.notifyComplete(!1)},t.prototype._complete=function(){this.notifyComplete(!0)},t}(o.Subscriber)},2408(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(4398);t.exhaust=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(t){var r=e.call(this,t)||this;return r.hasCompleted=!1,r.hasSubscription=!1,r}return i(t,e),t.prototype._next=function(e){this.hasSubscription||(this.hasSubscription=!0,this.add(o.innerSubscribe(e,new o.SimpleInnerSubscriber(this))))},t.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},t.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},t}(o.SimpleOuterSubscriber)},1112(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(6808),a=r(4098),s=r(4398);t.exhaustMap=function e(t,r){return r?function(n){return n.pipe(e(function(e,n){return a.from(t(e,n)).pipe(o.map(function(t,i){return r(e,t,n,i)}))}))}:function(e){return e.lift(new l(t))}};var l=function(){function e(e){this.project=e}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.project))},e}(),u=function(e){function t(t,r){var n=e.call(this,t)||this;return n.project=r,n.hasSubscription=!1,n.hasCompleted=!1,n.index=0,n}return i(t,e),t.prototype._next=function(e){this.hasSubscription||this.tryNext(e)},t.prototype.tryNext=function(e){var t,r=this.index++;try{t=this.project(e,r)}catch(e){this.destination.error(e);return}this.hasSubscription=!0,this._innerSub(t)},t.prototype._innerSub=function(e){var t=new s.SimpleInnerSubscriber(this),r=this.destination;r.add(t);var n=s.innerSubscribe(e,t);n!==t&&r.add(n)},t.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},t}(s.SimpleOuterSubscriber)},7736(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(4398);t.expand=function(e,t,r){return void 0===t&&(t=1/0),t=1>(t||0)?1/0:t,function(n){return n.lift(new a(e,t,r))}};var a=function(){function e(e,t,r){this.project=e,this.concurrent=t,this.scheduler=r}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.project,this.concurrent,this.scheduler))},e}();t.ExpandOperator=a;var s=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return o.project=r,o.concurrent=n,o.scheduler=i,o.index=0,o.active=0,o.hasCompleted=!1,n<1/0&&(o.buffer=[]),o}return i(t,e),t.dispatch=function(e){var t=e.subscriber,r=e.result,n=e.value,i=e.index;t.subscribeToProjection(r,n,i)},t.prototype._next=function(e){var r=this.destination;if(r.closed)return void this._complete();var n=this.index++;if(this.active<this.concurrent){r.next(e);try{var i=(0,this.project)(e,n);this.scheduler?this.destination.add(this.scheduler.schedule(t.dispatch,0,{subscriber:this,result:i,value:e,index:n})):this.subscribeToProjection(i,e,n)}catch(e){r.error(e)}}else this.buffer.push(e)},t.prototype.subscribeToProjection=function(e,t,r){this.active++,this.destination.add(o.innerSubscribe(e,new o.SimpleInnerSubscriber(this)))},t.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&0===this.active&&this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this._next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e&&e.length>0&&this._next(e.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},t}(o.SimpleOuterSubscriber);t.ExpandSubscriber=s},2670(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.filter=function(e,t){return function(r){return r.lift(new a(e,t))}};var a=function(){function e(e,t){this.predicate=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.thisArg))},e}(),s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.predicate=r,i.thisArg=n,i.count=0,i}return i(t,e),t.prototype._next=function(e){var t;try{t=this.predicate.call(this.thisArg,e,this.count++)}catch(e){this.destination.error(e);return}t&&this.destination.next(e)},t}(o.Subscriber)},1258(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(3207);t.finalize=function(e){return function(t){return t.lift(new s(e))}};var s=function(){function e(e){this.callback=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.callback))},e}(),l=function(e){function t(t,r){var n=e.call(this,t)||this;return n.add(new a.Subscription(r)),n}return i(t,e),t}(o.Subscriber)},5063(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.find=function(e,t){if("function"!=typeof e)throw TypeError("predicate is not a function");return function(r){return r.lift(new a(e,r,!1,t))}};var a=function(){function e(e,t,r,n){this.predicate=e,this.source=t,this.yieldIndex=r,this.thisArg=n}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.source,this.yieldIndex,this.thisArg))},e}();t.FindValueOperator=a;var s=function(e){function t(t,r,n,i,o){var a=e.call(this,t)||this;return a.predicate=r,a.source=n,a.yieldIndex=i,a.thisArg=o,a.index=0,a}return i(t,e),t.prototype.notifyComplete=function(e){var t=this.destination;t.next(e),t.complete(),this.unsubscribe()},t.prototype._next=function(e){var t=this.predicate,r=this.thisArg,n=this.index++;try{t.call(r||this,e,n,this.source)&&this.notifyComplete(this.yieldIndex?n:e)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},t}(o.Subscriber);t.FindValueSubscriber=s},2939(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5063);t.findIndex=function(e,t){return function(r){return r.lift(new n.FindValueOperator(e,r,!0,t))}}},9948(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1136),i=r(2670),o=r(1231),a=r(2767),s=r(2056),l=r(4579);t.first=function(e,t){var r=arguments.length>=2;return function(u){return u.pipe(e?i.filter(function(t,r){return e(t,r,u)}):l.identity,o.take(1),r?a.defaultIfEmpty(t):s.throwIfEmpty(function(){return new n.EmptyError}))}}},7784(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(3207),s=r(2515),l=r(2888);t.groupBy=function(e,t,r,n){return function(i){return i.lift(new u(e,t,r,n))}};var u=function(){function e(e,t,r,n){this.keySelector=e,this.elementSelector=t,this.durationSelector=r,this.subjectSelector=n}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},e}(),c=function(e){function t(t,r,n,i,o){var a=e.call(this,t)||this;return a.keySelector=r,a.elementSelector=n,a.durationSelector=i,a.subjectSelector=o,a.groups=null,a.attemptedToUnsubscribe=!1,a.count=0,a}return i(t,e),t.prototype._next=function(e){var t;try{t=this.keySelector(e)}catch(e){this.error(e);return}this._group(e,t)},t.prototype._group=function(e,t){var r,n=this.groups;n||(n=this.groups=new Map);var i=n.get(t);if(this.elementSelector)try{r=this.elementSelector(e)}catch(e){this.error(e)}else r=e;if(!i){i=this.subjectSelector?this.subjectSelector():new l.Subject,n.set(t,i);var o=new p(t,i,this);if(this.destination.next(o),this.durationSelector){var a=void 0;try{a=this.durationSelector(new p(t,i))}catch(e){this.error(e);return}this.add(a.subscribe(new d(t,i,this)))}}i.closed||i.next(r)},t.prototype._error=function(e){var t=this.groups;t&&(t.forEach(function(t,r){t.error(e)}),t.clear()),this.destination.error(e)},t.prototype._complete=function(){var e=this.groups;e&&(e.forEach(function(e,t){e.complete()}),e.clear()),this.destination.complete()},t.prototype.removeGroup=function(e){this.groups.delete(e)},t.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&e.prototype.unsubscribe.call(this))},t}(o.Subscriber),d=function(e){function t(t,r,n){var i=e.call(this,r)||this;return i.key=t,i.group=r,i.parent=n,i}return i(t,e),t.prototype._next=function(e){this.complete()},t.prototype._unsubscribe=function(){var e=this.parent,t=this.key;this.key=this.parent=null,e&&e.removeGroup(t)},t}(o.Subscriber),p=function(e){function t(t,r,n){var i=e.call(this)||this;return i.key=t,i.groupSubject=r,i.refCountSubscription=n,i}return i(t,e),t.prototype._subscribe=function(e){var t=new a.Subscription,r=this.refCountSubscription,n=this.groupSubject;return r&&!r.closed&&t.add(new f(r)),t.add(n.subscribe(e)),t},t}(s.Observable);t.GroupedObservable=p;var f=function(e){function t(t){var r=e.call(this)||this;return r.parent=t,t.count++,r}return i(t,e),t.prototype.unsubscribe=function(){var t=this.parent;t.closed||this.closed||(e.prototype.unsubscribe.call(this),t.count-=1,0===t.count&&t.attemptedToUnsubscribe&&t.unsubscribe())},t}(a.Subscription)},6863(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.ignoreElements=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype._next=function(e){},t}(o.Subscriber)},3371(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.isEmpty=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t.prototype.notifyComplete=function(e){var t=this.destination;t.next(e),t.complete()},t.prototype._next=function(e){this.notifyComplete(!1)},t.prototype._complete=function(){this.notifyComplete(!0)},t}(o.Subscriber)},7064(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1136),i=r(2670),o=r(3439),a=r(2056),s=r(2767),l=r(4579);t.last=function(e,t){var r=arguments.length>=2;return function(u){return u.pipe(e?i.filter(function(t,r){return e(t,r,u)}):l.identity,o.takeLast(1),r?s.defaultIfEmpty(t):a.throwIfEmpty(function(){return new n.EmptyError}))}}},6808(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.map=function(e,t){return function(r){if("function"!=typeof e)throw TypeError("argument is not a function. Are you looking for `mapTo()`?");return r.lift(new a(e,t))}};var a=function(){function e(e,t){this.project=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.project,this.thisArg))},e}();t.MapOperator=a;var s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.project=r,i.count=0,i.thisArg=n||i,i}return i(t,e),t.prototype._next=function(e){var t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(e){this.destination.error(e);return}this.destination.next(t)},t}(o.Subscriber)},3353(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.mapTo=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.value=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.value))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.value=r,n}return i(t,e),t.prototype._next=function(e){this.destination.next(this.value)},t}(o.Subscriber)},2539(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(6765);t.materialize=function(){return function(e){return e.lift(new s)}};var s=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new l(e))},e}(),l=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t.prototype._next=function(e){this.destination.next(a.Notification.createNext(e))},t.prototype._error=function(e){var t=this.destination;t.next(a.Notification.createError(e)),t.complete()},t.prototype._complete=function(){var e=this.destination;e.next(a.Notification.createComplete()),e.complete()},t}(o.Subscriber)},6416(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2518);t.max=function(e){return n.reduce("function"==typeof e?function(t,r){return e(t,r)>0?t:r}:function(e,t){return e>t?e:t})}},1570(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5776);t.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(n.merge.apply(void 0,[t].concat(e)))}}},9287(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5206),i=r(4579);t.mergeAll=function(e){return void 0===e&&(e=1/0),n.mergeMap(i.identity,e)}},5206(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(6808),a=r(4098),s=r(4398);function l(e,t,r){return(void 0===r&&(r=1/0),"function"==typeof t)?function(n){return n.pipe(l(function(r,n){return a.from(e(r,n)).pipe(o.map(function(e,i){return t(r,e,n,i)}))},r))}:("number"==typeof t&&(r=t),function(t){return t.lift(new u(e,r))})}t.mergeMap=l;var u=function(){function e(e,t){void 0===t&&(t=1/0),this.project=e,this.concurrent=t}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.project,this.concurrent))},e}();t.MergeMapOperator=u;var c=function(e){function t(t,r,n){void 0===n&&(n=1/0);var i=e.call(this,t)||this;return i.project=r,i.concurrent=n,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return i(t,e),t.prototype._next=function(e){this.active<this.concurrent?this._tryNext(e):this.buffer.push(e)},t.prototype._tryNext=function(e){var t,r=this.index++;try{t=this.project(e,r)}catch(e){this.destination.error(e);return}this.active++,this._innerSub(t)},t.prototype._innerSub=function(e){var t=new s.SimpleInnerSubscriber(this),r=this.destination;r.add(t);var n=s.innerSubscribe(e,t);n!==t&&r.add(n)},t.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(s.SimpleOuterSubscriber);t.MergeMapSubscriber=c,t.flatMap=l},9019(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5206);t.mergeMapTo=function(e,t,r){return(void 0===r&&(r=1/0),"function"==typeof t)?n.mergeMap(function(){return e},t,r):("number"==typeof t&&(r=t),n.mergeMap(function(){return e},r))}},2307(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(4398);t.mergeScan=function(e,t,r){return void 0===r&&(r=1/0),function(n){return n.lift(new a(e,t,r))}};var a=function(){function e(e,t,r){this.accumulator=e,this.seed=t,this.concurrent=r}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.accumulator,this.seed,this.concurrent))},e}();t.MergeScanOperator=a;var s=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return o.accumulator=r,o.acc=n,o.concurrent=i,o.hasValue=!1,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return i(t,e),t.prototype._next=function(e){if(this.active<this.concurrent){var t=this.index++,r=this.destination,n=void 0;try{n=(0,this.accumulator)(this.acc,e,t)}catch(e){return r.error(e)}this.active++,this._innerSub(n)}else this.buffer.push(e)},t.prototype._innerSub=function(e){var t=new o.SimpleInnerSubscriber(this),r=this.destination;r.add(t);var n=o.innerSubscribe(e,t);n!==t&&r.add(n)},t.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete()),this.unsubscribe()},t.prototype.notifyNext=function(e){var t=this.destination;this.acc=e,this.hasValue=!0,t.next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},t}(o.SimpleOuterSubscriber);t.MergeScanSubscriber=s},7198(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2518);t.min=function(e){return n.reduce("function"==typeof e?function(t,r){return 0>e(t,r)?t:r}:function(e,t){return e<t?e:t})}},4864(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2871);t.multicast=function(e,t){return function(r){if(o="function"==typeof e?e:function(){return e},"function"==typeof t)return r.lift(new i(o,t));var o,a=Object.create(r,n.connectableObservableDescriptor);return a.source=r,a.subjectFactory=o,a}};var i=function(){function e(e,t){this.subjectFactory=e,this.selector=t}return e.prototype.call=function(e,t){var r=this.selector,n=this.subjectFactory(),i=r(n).subscribe(e);return i.add(t.subscribe(n)),i},e}();t.MulticastOperator=i},5495(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(6765);t.observeOn=function(e,t){return void 0===t&&(t=0),function(r){return r.lift(new s(e,t))}};var s=function(){function e(e,t){void 0===t&&(t=0),this.scheduler=e,this.delay=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.scheduler,this.delay))},e}();t.ObserveOnOperator=s;var l=function(e){function t(t,r,n){void 0===n&&(n=0);var i=e.call(this,t)||this;return i.scheduler=r,i.delay=n,i}return i(t,e),t.dispatch=function(e){var t=e.notification,r=e.destination;t.observe(r),this.unsubscribe()},t.prototype.scheduleMessage=function(e){this.destination.add(this.scheduler.schedule(t.dispatch,this.delay,new u(e,this.destination)))},t.prototype._next=function(e){this.scheduleMessage(a.Notification.createNext(e))},t.prototype._error=function(e){this.scheduleMessage(a.Notification.createError(e)),this.unsubscribe()},t.prototype._complete=function(){this.scheduleMessage(a.Notification.createComplete()),this.unsubscribe()},t}(o.Subscriber);t.ObserveOnSubscriber=l;var u=function(e,t){this.notification=e,this.destination=t};t.ObserveOnMessage=u},5029(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(4098),a=r(4728),s=r(4398);t.onErrorResumeNext=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 1===e.length&&a.isArray(e[0])&&(e=e[0]),function(t){return t.lift(new l(e))}},t.onErrorResumeNextStatic=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=void 0;return 1===e.length&&a.isArray(e[0])&&(e=e[0]),r=e.shift(),o.from(r).lift(new l(e))};var l=function(){function e(e){this.nextSources=e}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.nextSources))},e}(),u=function(e){function t(t,r){var n=e.call(this,t)||this;return n.destination=t,n.nextSources=r,n}return i(t,e),t.prototype.notifyError=function(){this.subscribeToNextSource()},t.prototype.notifyComplete=function(){this.subscribeToNextSource()},t.prototype._error=function(e){this.subscribeToNextSource(),this.unsubscribe()},t.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},t.prototype.subscribeToNextSource=function(){var e=this.nextSources.shift();if(e){var t=new s.SimpleInnerSubscriber(this),r=this.destination;r.add(t);var n=s.innerSubscribe(e,t);n!==t&&r.add(n)}else this.destination.complete()},t}(s.SimpleOuterSubscriber)},7304(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.pairwise=function(){return function(e){return e.lift(new a)}};var a=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new s(e))},e}(),s=function(e){function t(t){var r=e.call(this,t)||this;return r.hasPrev=!1,r}return i(t,e),t.prototype._next=function(e){var t;this.hasPrev?t=[this.prev,e]:this.hasPrev=!0,this.prev=e,t&&this.destination.next(t)},t}(o.Subscriber)},4236(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5352),i=r(2670);t.partition=function(e,t){return function(r){return[i.filter(e,t)(r),i.filter(n.not(e,t))(r)]}}},1075(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(6808);t.pluck=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.length;if(0===r)throw Error("list of properties cannot be empty.");return function(t){var i,o;return n.map((i=e,o=r,function(e){for(var t=e,r=0;r<o;r++){var n=null!=t?t[i[r]]:void 0;if(void 0===n)return;t=n}return t}))(t)}}},5485(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2888),i=r(4864);t.publish=function(e){return e?i.multicast(function(){return new n.Subject},e):i.multicast(new n.Subject)}},91(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(466),i=r(4864);t.publishBehavior=function(e){return function(t){return i.multicast(new n.BehaviorSubject(e))(t)}}},3433(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9850),i=r(4864);t.publishLast=function(){return function(e){return i.multicast(new n.AsyncSubject)(e)}}},9622(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2173),i=r(4864);t.publishReplay=function(e,t,r,o){r&&"function"!=typeof r&&(o=r);var a="function"==typeof r?r:void 0,s=new n.ReplaySubject(e,t,o);return function(e){return i.multicast(function(){return s},a)(e)}}},6721(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4728),i=r(3827);t.race=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return 1===e.length&&n.isArray(e[0])&&(e=e[0]),t.lift.call(i.race.apply(void 0,[t].concat(e)))}}},2518(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(253),i=r(3439),o=r(2767),a=r(8173);t.reduce=function(e,t){return arguments.length>=2?function(r){return a.pipe(n.scan(e,t),i.takeLast(1),o.defaultIfEmpty(t))(r)}:function(t){return a.pipe(n.scan(function(t,r,n){return e(t,r,n+1)}),i.takeLast(1))(t)}}},6888(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.refCount=function(){return function(e){return e.lift(new a(e))}};var a=function(){function e(e){this.connectable=e}return e.prototype.call=function(e,t){var r=this.connectable;r._refCount++;var n=new s(e,r),i=t.subscribe(n);return n.closed||(n.connection=r.connect()),i},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.connectable=r,n}return i(t,e),t.prototype._unsubscribe=function(){var e=this.connectable;if(!e){this.connection=null;return}this.connectable=null;var t=e._refCount;if(t<=0||(e._refCount=t-1,t>1)){this.connection=null;return}var r=this.connection,n=e._connection;this.connection=null,n&&(!r||n===r)&&n.unsubscribe()},t}(o.Subscriber)},6483(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(453);t.repeat=function(e){return void 0===e&&(e=-1),function(t){return 0===e?a.empty():e<0?t.lift(new s(-1,t)):t.lift(new s(e-1,t))}};var s=function(){function e(e,t){this.count=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.count,this.source))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.count=r,i.source=n,i}return i(t,e),t.prototype.complete=function(){if(!this.isStopped){var t=this.source,r=this.count;if(0===r)return e.prototype.complete.call(this);r>-1&&(this.count=r-1),t.subscribe(this._unsubscribeAndRecycle())}},t}(o.Subscriber)},283(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(2888),a=r(4398);t.repeatWhen=function(e){return function(t){return t.lift(new s(e))}};var s=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.notifier,t))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.notifier=r,i.source=n,i.sourceIsBeingSubscribedTo=!0,i}return i(t,e),t.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},t.prototype.notifyComplete=function(){if(!1===this.sourceIsBeingSubscribedTo)return e.prototype.complete.call(this)},t.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return e.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},t.prototype._unsubscribe=function(){var e=this.notifications,t=this.retriesSubscription;e&&(e.unsubscribe(),this.notifications=void 0),t&&(t.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},t.prototype._unsubscribeAndRecycle=function(){var t=this._unsubscribe;return this._unsubscribe=null,e.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=t,this},t.prototype.subscribeToRetries=function(){this.notifications=new o.Subject;try{var t;t=(0,this.notifier)(this.notifications)}catch(t){return e.prototype.complete.call(this)}this.retries=t,this.retriesSubscription=a.innerSubscribe(t,new a.SimpleInnerSubscriber(this))},t}(a.SimpleOuterSubscriber)},3160(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.retry=function(e){return void 0===e&&(e=-1),function(t){return t.lift(new a(e,t))}};var a=function(){function e(e,t){this.count=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.count,this.source))},e}(),s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.count=r,i.source=n,i}return i(t,e),t.prototype.error=function(t){if(!this.isStopped){var r=this.source,n=this.count;if(0===n)return e.prototype.error.call(this,t);n>-1&&(this.count=n-1),r.subscribe(this._unsubscribeAndRecycle())}},t}(o.Subscriber)},5508(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(2888),a=r(4398);t.retryWhen=function(e){return function(t){return t.lift(new s(e,t))}};var s=function(){function e(e,t){this.notifier=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.notifier,this.source))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.notifier=r,i.source=n,i}return i(t,e),t.prototype.error=function(t){if(!this.isStopped){var r=this.errors,n=this.retries,i=this.retriesSubscription;if(n)this.errors=void 0,this.retriesSubscription=void 0;else{r=new o.Subject;try{n=(0,this.notifier)(r)}catch(t){return e.prototype.error.call(this,t)}i=a.innerSubscribe(n,new a.SimpleInnerSubscriber(this))}this._unsubscribeAndRecycle(),this.errors=r,this.retries=n,this.retriesSubscription=i,r.next(t)}},t.prototype._unsubscribe=function(){var e=this.errors,t=this.retriesSubscription;e&&(e.unsubscribe(),this.errors=void 0),t&&(t.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},t.prototype.notifyNext=function(){var e=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=e,this.source.subscribe(this)},t}(a.SimpleOuterSubscriber)},1754(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(4398);t.sample=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){var r=new s(e),n=t.subscribe(r);return n.add(o.innerSubscribe(this.notifier,new o.SimpleInnerSubscriber(r))),n},e}(),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.hasValue=!1,t}return i(t,e),t.prototype._next=function(e){this.value=e,this.hasValue=!0},t.prototype.notifyNext=function(){this.emitValue()},t.prototype.notifyComplete=function(){this.emitValue()},t.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},t}(o.SimpleOuterSubscriber)},1183(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(5190);t.sampleTime=function(e,t){return void 0===t&&(t=a.async),function(r){return r.lift(new s(e,t))}};var s=function(){function e(e,t){this.period=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.period,this.scheduler))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.period=r,i.scheduler=n,i.hasValue=!1,i.add(n.schedule(u,r,{subscriber:i,period:r})),i}return i(t,e),t.prototype._next=function(e){this.lastValue=e,this.hasValue=!0},t.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},t}(o.Subscriber);function u(e){var t=e.subscriber,r=e.period;t.notifyNext(),this.schedule(e,r)}},253(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.scan=function(e,t){var r=!1;return arguments.length>=2&&(r=!0),function(n){return n.lift(new a(e,t,r))}};var a=function(){function e(e,t,r){void 0===r&&(r=!1),this.accumulator=e,this.seed=t,this.hasSeed=r}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.accumulator,this.seed,this.hasSeed))},e}(),s=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return o.accumulator=r,o._seed=n,o.hasSeed=i,o.index=0,o}return i(t,e),Object.defineProperty(t.prototype,"seed",{get:function(){return this._seed},set:function(e){this.hasSeed=!0,this._seed=e},enumerable:!0,configurable:!0}),t.prototype._next=function(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)},t.prototype._tryNext=function(e){var t,r=this.index++;try{t=this.accumulator(this.seed,e,r)}catch(e){this.destination.error(e)}this.seed=t,this.destination.next(t)},t}(o.Subscriber)},5017(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.sequenceEqual=function(e,t){return function(r){return r.lift(new a(e,t))}};var a=function(){function e(e,t){this.compareTo=e,this.comparator=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.compareTo,this.comparator))},e}();t.SequenceEqualOperator=a;var s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.compareTo=r,i.comparator=n,i._a=[],i._b=[],i._oneComplete=!1,i.destination.add(r.subscribe(new l(t,i))),i}return i(t,e),t.prototype._next=function(e){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(e),this.checkValues())},t.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0,this.unsubscribe()},t.prototype.checkValues=function(){for(var e=this._a,t=this._b,r=this.comparator;e.length>0&&t.length>0;){var n=e.shift(),i=t.shift(),o=!1;try{o=r?r(n,i):n===i}catch(e){this.destination.error(e)}o||this.emit(!1)}},t.prototype.emit=function(e){var t=this.destination;t.next(e),t.complete()},t.prototype.nextB=function(e){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(e),this.checkValues())},t.prototype.completeB=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},t}(o.Subscriber);t.SequenceEqualSubscriber=s;var l=function(e){function t(t,r){var n=e.call(this,t)||this;return n.parent=r,n}return i(t,e),t.prototype._next=function(e){this.parent.nextB(e)},t.prototype._error=function(e){this.parent.error(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},t}(o.Subscriber)},3213(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4864),i=r(6888),o=r(2888);function a(){return new o.Subject}t.share=function(){return function(e){return i.refCount()(n.multicast(a)(e))}}},8614(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2173);t.shareReplay=function(e,t,r){var i;return i=e&&"object"==typeof e?e:{bufferSize:e,windowTime:t,refCount:!1,scheduler:r},function(e){var t,r,o,a,s,l,u,c,d,p,f,h;return e.lift((s=void 0===(a=(t=i).bufferSize)?1/0:a,u=void 0===(l=t.windowTime)?1/0:l,c=t.refCount,d=t.scheduler,p=0,f=!1,h=!1,function(e){var t;p++,!r||f?(f=!1,t=(r=new n.ReplaySubject(s,u,d)).subscribe(this),o=e.subscribe({next:function(e){r.next(e)},error:function(e){f=!0,r.error(e)},complete:function(){h=!0,o=void 0,r.complete()}}),h&&(o=void 0)):t=r.subscribe(this),this.add(function(){p--,t.unsubscribe(),t=void 0,o&&!h&&c&&0===p&&(o.unsubscribe(),o=void 0,r=void 0)})}))}}},8480(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(1136);t.single=function(e){return function(t){return t.lift(new s(e,t))}};var s=function(){function e(e,t){this.predicate=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.predicate,this.source))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.predicate=r,i.source=n,i.seenValue=!1,i.index=0,i}return i(t,e),t.prototype.applySingleValue=function(e){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=e)},t.prototype._next=function(e){var t=this.index++;this.predicate?this.tryNext(e,t):this.applySingleValue(e)},t.prototype.tryNext=function(e,t){try{this.predicate(e,t,this.source)&&this.applySingleValue(e)}catch(e){this.destination.error(e)}},t.prototype._complete=function(){var e=this.destination;this.index>0?(e.next(this.seenValue?this.singleValue:void 0),e.complete()):e.error(new a.EmptyError)},t}(o.Subscriber)},4775(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.skip=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.total=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.total))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.total=r,n.count=0,n}return i(t,e),t.prototype._next=function(e){++this.count>this.total&&this.destination.next(e)},t}(o.Subscriber)},2807(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(7568);t.skipLast=function(e){return function(t){return t.lift(new s(e))}};var s=function(){function e(e){if(this._skipCount=e,this._skipCount<0)throw new a.ArgumentOutOfRangeError}return e.prototype.call=function(e,t){return 0===this._skipCount?t.subscribe(new o.Subscriber(e)):t.subscribe(new l(e,this._skipCount))},e}(),l=function(e){function t(t,r){var n=e.call(this,t)||this;return n._skipCount=r,n._count=0,n._ring=Array(r),n}return i(t,e),t.prototype._next=function(e){var t=this._skipCount,r=this._count++;if(r<t)this._ring[r]=e;else{var n=r%t,i=this._ring,o=i[n];i[n]=e,this.destination.next(o)}},t}(o.Subscriber)},2519(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(4398);t.skipUntil=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.notifier))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;n.hasValue=!1;var i=new o.SimpleInnerSubscriber(n);n.add(i),n.innerSubscription=i;var a=o.innerSubscribe(r,i);return a!==i&&(n.add(a),n.innerSubscription=a),n}return i(t,e),t.prototype._next=function(t){this.hasValue&&e.prototype._next.call(this,t)},t.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},t.prototype.notifyComplete=function(){},t}(o.SimpleOuterSubscriber)},4846(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.skipWhile=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.predicate=e}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate))},e}(),s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.predicate=r,n.skipping=!0,n.index=0,n}return i(t,e),t.prototype._next=function(e){var t=this.destination;this.skipping&&this.tryCallPredicate(e),this.skipping||t.next(e)},t.prototype.tryCallPredicate=function(e){try{var t=this.predicate(e,this.index++);this.skipping=!!t}catch(e){this.destination.error(e)}},t}(o.Subscriber)},4558(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5434),i=r(8244);t.startWith=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[e.length-1];return i.isScheduler(r)?(e.pop(),function(t){return n.concat(e,t,r)}):function(t){return n.concat(e,t)}}},15(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(8072);t.subscribeOn=function(e,t){return void 0===t&&(t=0),function(r){return r.lift(new i(e,t))}};var i=function(){function e(e,t){this.scheduler=e,this.delay=t}return e.prototype.call=function(e,t){return new n.SubscribeOnObservable(t,this.delay,this.scheduler).subscribe(e)},e}()},5433(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7912),i=r(4579);t.switchAll=function(){return n.switchMap(i.identity)}},7912(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(6808),a=r(4098),s=r(4398);t.switchMap=function e(t,r){return"function"==typeof r?function(n){return n.pipe(e(function(e,n){return a.from(t(e,n)).pipe(o.map(function(t,i){return r(e,t,n,i)}))}))}:function(e){return e.lift(new l(t))}};var l=function(){function e(e){this.project=e}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.project))},e}(),u=function(e){function t(t,r){var n=e.call(this,t)||this;return n.project=r,n.index=0,n}return i(t,e),t.prototype._next=function(e){var t,r=this.index++;try{t=this.project(e,r)}catch(e){this.destination.error(e);return}this._innerSub(t)},t.prototype._innerSub=function(e){var t=this.innerSubscription;t&&t.unsubscribe();var r=new s.SimpleInnerSubscriber(this),n=this.destination;n.add(r),this.innerSubscription=s.innerSubscribe(e,r),this.innerSubscription!==r&&n.add(this.innerSubscription)},t.prototype._complete=function(){var t=this.innerSubscription;(!t||t.closed)&&e.prototype._complete.call(this),this.unsubscribe()},t.prototype._unsubscribe=function(){this.innerSubscription=void 0},t.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&e.prototype._complete.call(this)},t.prototype.notifyNext=function(e){this.destination.next(e)},t}(s.SimpleOuterSubscriber)},7865(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7912);t.switchMapTo=function(e,t){return t?n.switchMap(function(){return e},t):n.switchMap(function(){return e})}},1231(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(7568),s=r(453);t.take=function(e){return function(t){return 0===e?s.empty():t.lift(new l(e))}};var l=function(){function e(e){if(this.total=e,this.total<0)throw new a.ArgumentOutOfRangeError}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.total))},e}(),u=function(e){function t(t,r){var n=e.call(this,t)||this;return n.total=r,n.count=0,n}return i(t,e),t.prototype._next=function(e){var t=this.total,r=++this.count;r<=t&&(this.destination.next(e),r===t&&(this.destination.complete(),this.unsubscribe()))},t}(o.Subscriber)},3439(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(7568),s=r(453);t.takeLast=function(e){return function(t){return 0===e?s.empty():t.lift(new l(e))}};var l=function(){function e(e){if(this.total=e,this.total<0)throw new a.ArgumentOutOfRangeError}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.total))},e}(),u=function(e){function t(t,r){var n=e.call(this,t)||this;return n.total=r,n.ring=[],n.count=0,n}return i(t,e),t.prototype._next=function(e){var t=this.ring,r=this.total,n=this.count++;t.length<r?t.push(e):t[n%r]=e},t.prototype._complete=function(){var e=this.destination,t=this.count;if(t>0)for(var r=this.count>=this.total?this.total:this.count,n=this.ring,i=0;i<r;i++){var o=t++%r;e.next(n[o])}e.complete()},t}(o.Subscriber)},1279(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(4398);t.takeUntil=function(e){return function(t){return t.lift(new a(e))}};var a=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){var r=new s(e),n=o.innerSubscribe(this.notifier,new o.SimpleInnerSubscriber(r));return n&&!r.seenValue?(r.add(n),t.subscribe(r)):r},e}(),s=function(e){function t(t){var r=e.call(this,t)||this;return r.seenValue=!1,r}return i(t,e),t.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},t.prototype.notifyComplete=function(){},t}(o.SimpleOuterSubscriber)},6518(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396);t.takeWhile=function(e,t){return void 0===t&&(t=!1),function(r){return r.lift(new a(e,t))}};var a=function(){function e(e,t){this.predicate=e,this.inclusive=t}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.predicate,this.inclusive))},e}(),s=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.predicate=r,i.inclusive=n,i.index=0,i}return i(t,e),t.prototype._next=function(e){var t,r=this.destination;try{t=this.predicate(e,this.index++)}catch(e){r.error(e);return}this.nextOrComplete(e,t)},t.prototype.nextOrComplete=function(e,t){var r=this.destination;t?r.next(e):(this.inclusive&&r.next(e),r.complete())},t}(o.Subscriber)},1451(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(7653),s=r(3385);t.tap=function(e,t,r){return function(n){return n.lift(new l(e,t,r))}};var l=function(){function e(e,t,r){this.nextOrObserver=e,this.error=t,this.complete=r}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.nextOrObserver,this.error,this.complete))},e}(),u=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return o._tapNext=a.noop,o._tapError=a.noop,o._tapComplete=a.noop,o._tapError=n||a.noop,o._tapComplete=i||a.noop,s.isFunction(r)?(o._context=o,o._tapNext=r):r&&(o._context=r,o._tapNext=r.next||a.noop,o._tapError=r.error||a.noop,o._tapComplete=r.complete||a.noop),o}return i(t,e),t.prototype._next=function(e){try{this._tapNext.call(this._context,e)}catch(e){this.destination.error(e);return}this.destination.next(e)},t.prototype._error=function(e){try{this._tapError.call(this._context,e)}catch(e){this.destination.error(e);return}this.destination.error(e)},t.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(e){this.destination.error(e);return}return this.destination.complete()},t}(o.Subscriber)},464(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(4398);t.defaultThrottleConfig={leading:!0,trailing:!1},t.throttle=function(e,r){return void 0===r&&(r=t.defaultThrottleConfig),function(t){return t.lift(new a(e,!!r.leading,!!r.trailing))}};var a=function(){function e(e,t,r){this.durationSelector=e,this.leading=t,this.trailing=r}return e.prototype.call=function(e,t){return t.subscribe(new s(e,this.durationSelector,this.leading,this.trailing))},e}(),s=function(e){function t(t,r,n,i){var o=e.call(this,t)||this;return o.destination=t,o.durationSelector=r,o._leading=n,o._trailing=i,o._hasValue=!1,o}return i(t,e),t.prototype._next=function(e){this._hasValue=!0,this._sendValue=e,this._throttled||(this._leading?this.send():this.throttle(e))},t.prototype.send=function(){var e=this._hasValue,t=this._sendValue;e&&(this.destination.next(t),this.throttle(t)),this._hasValue=!1,this._sendValue=void 0},t.prototype.throttle=function(e){var t=this.tryDurationSelector(e);t&&this.add(this._throttled=o.innerSubscribe(t,new o.SimpleInnerSubscriber(this)))},t.prototype.tryDurationSelector=function(e){try{return this.durationSelector(e)}catch(e){return this.destination.error(e),null}},t.prototype.throttlingDone=function(){var e=this._throttled,t=this._trailing;e&&e.unsubscribe(),this._throttled=void 0,t&&this.send()},t.prototype.notifyNext=function(){this.throttlingDone()},t.prototype.notifyComplete=function(){this.throttlingDone()},t}(o.SimpleOuterSubscriber)},42(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(5190),s=r(464);t.throttleTime=function(e,t,r){return void 0===t&&(t=a.async),void 0===r&&(r=s.defaultThrottleConfig),function(n){return n.lift(new l(e,t,r.leading,r.trailing))}};var l=function(){function e(e,t,r,n){this.duration=e,this.scheduler=t,this.leading=r,this.trailing=n}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.duration,this.scheduler,this.leading,this.trailing))},e}(),u=function(e){function t(t,r,n,i,o){var a=e.call(this,t)||this;return a.duration=r,a.scheduler=n,a.leading=i,a.trailing=o,a._hasTrailingValue=!1,a._trailingValue=null,a}return i(t,e),t.prototype._next=function(e){this.throttled?this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(c,this.duration,{subscriber:this})),this.leading?this.destination.next(e):this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0))},t.prototype._complete=function(){this._hasTrailingValue&&this.destination.next(this._trailingValue),this.destination.complete()},t.prototype.clearThrottle=function(){var e=this.throttled;e&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),e.unsubscribe(),this.remove(e),this.throttled=null)},t}(o.Subscriber);function c(e){e.subscriber.clearThrottle()}},2056(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1136),a=r(1396);t.throwIfEmpty=function(e){return void 0===e&&(e=u),function(t){return t.lift(new s(e))}};var s=function(){function e(e){this.errorFactory=e}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.errorFactory))},e}(),l=function(e){function t(t,r){var n=e.call(this,t)||this;return n.errorFactory=r,n.hasValue=!1,n}return i(t,e),t.prototype._next=function(e){this.hasValue=!0,this.destination.next(e)},t.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var e=void 0;try{e=this.errorFactory()}catch(t){e=t}this.destination.error(e)},t}(a.Subscriber);function u(){return new o.EmptyError}},5276(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5190),i=r(253),o=r(3180),a=r(6808);t.timeInterval=function(e){return void 0===e&&(e=n.async),function(t){return o.defer(function(){return t.pipe(i.scan(function(t,r){var n=t.current;return{value:r,current:e.now(),last:n}},{current:e.now(),value:void 0,last:void 0}),a.map(function(e){var t=e.current,r=e.last;return new s(e.value,t-r)}))})}};var s=function(e,t){this.value=e,this.interval=t};t.TimeInterval=s},8673(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5190),i=r(3734),o=r(4053),a=r(1576);t.timeout=function(e,t){return void 0===t&&(t=n.async),o.timeoutWith(e,a.throwError(new i.TimeoutError),t)}},4053(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(5190),a=r(4465),s=r(4398);t.timeoutWith=function(e,t,r){return void 0===r&&(r=o.async),function(n){var i=a.isDate(e),o=i?e-r.now():Math.abs(e);return n.lift(new l(o,i,t,r))}};var l=function(){function e(e,t,r,n){this.waitFor=e,this.absoluteTimeout=t,this.withObservable=r,this.scheduler=n}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},e}(),u=function(e){function t(t,r,n,i,o){var a=e.call(this,t)||this;return a.absoluteTimeout=r,a.waitFor=n,a.withObservable=i,a.scheduler=o,a.scheduleTimeout(),a}return i(t,e),t.dispatchTimeout=function(e){var t=e.withObservable;e._unsubscribeAndRecycle(),e.add(s.innerSubscribe(t,new s.SimpleInnerSubscriber(e)))},t.prototype.scheduleTimeout=function(){var e=this.action;e?this.action=e.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(t.dispatchTimeout,this.waitFor,this))},t.prototype._next=function(t){this.absoluteTimeout||this.scheduleTimeout(),e.prototype._next.call(this,t)},t.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},t}(s.SimpleOuterSubscriber)},8858(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5190),i=r(6808);t.timestamp=function(e){return void 0===e&&(e=n.async),i.map(function(t){return new o(t,e.now())})};var o=function(e,t){this.value=e,this.timestamp=t};t.Timestamp=o},2284(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2518);function i(e,t,r){return 0===r?[t]:(e.push(t),e)}t.toArray=function(){return n.reduce(i,[])}},7544(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(2888),a=r(4398);t.window=function(e){return function(t){return t.lift(new s(e))}};var s=function(){function e(e){this.windowBoundaries=e}return e.prototype.call=function(e,t){var r=new l(e),n=t.subscribe(r);return n.closed||r.add(a.innerSubscribe(this.windowBoundaries,new a.SimpleInnerSubscriber(r))),n},e}(),l=function(e){function t(t){var r=e.call(this,t)||this;return r.window=new o.Subject,t.next(r.window),r}return i(t,e),t.prototype.notifyNext=function(){this.openWindow()},t.prototype.notifyError=function(e){this._error(e)},t.prototype.notifyComplete=function(){this._complete()},t.prototype._next=function(e){this.window.next(e)},t.prototype._error=function(e){this.window.error(e),this.destination.error(e)},t.prototype._complete=function(){this.window.complete(),this.destination.complete()},t.prototype._unsubscribe=function(){this.window=null},t.prototype.openWindow=function(){var e=this.window;e&&e.complete();var t=this.destination,r=this.window=new o.Subject;t.next(r)},t}(a.SimpleOuterSubscriber)},1565(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(1396),a=r(2888);t.windowCount=function(e,t){return void 0===t&&(t=0),function(r){return r.lift(new s(e,t))}};var s=function(){function e(e,t){this.windowSize=e,this.startWindowEvery=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.windowSize,this.startWindowEvery))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.destination=t,i.windowSize=r,i.startWindowEvery=n,i.windows=[new a.Subject],i.count=0,t.next(i.windows[0]),i}return i(t,e),t.prototype._next=function(e){for(var t=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,r=this.destination,n=this.windowSize,i=this.windows,o=i.length,s=0;s<o&&!this.closed;s++)i[s].next(e);var l=this.count-n+1;if(l>=0&&l%t==0&&!this.closed&&i.shift().complete(),++this.count%t==0&&!this.closed){var u=new a.Subject;i.push(u),r.next(u)}},t.prototype._error=function(e){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().error(e);this.destination.error(e)},t.prototype._complete=function(){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().complete();this.destination.complete()},t.prototype._unsubscribe=function(){this.count=0,this.windows=null},t}(o.Subscriber)},3877(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(2888),a=r(5190),s=r(1396),l=r(5390),u=r(8244);t.windowTime=function(e){var t=a.async,r=null,n=1/0;return u.isScheduler(arguments[3])&&(t=arguments[3]),u.isScheduler(arguments[2])?t=arguments[2]:l.isNumeric(arguments[2])&&(n=Number(arguments[2])),u.isScheduler(arguments[1])?t=arguments[1]:l.isNumeric(arguments[1])&&(r=Number(arguments[1])),function(i){return i.lift(new c(e,r,n,t))}};var c=function(){function e(e,t,r,n){this.windowTimeSpan=e,this.windowCreationInterval=t,this.maxWindowSize=r,this.scheduler=n}return e.prototype.call=function(e,t){return t.subscribe(new p(e,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},e}(),d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._numberOfNextedValues=0,t}return i(t,e),t.prototype.next=function(t){this._numberOfNextedValues++,e.prototype.next.call(this,t)},Object.defineProperty(t.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),t}(o.Subject),p=function(e){function t(t,r,n,i,o){var a=e.call(this,t)||this;a.destination=t,a.windowTimeSpan=r,a.windowCreationInterval=n,a.maxWindowSize=i,a.scheduler=o,a.windows=[];var s=a.openWindow();return null!==n&&n>=0?(a.add(o.schedule(m,r,{subscriber:a,window:s,context:null})),a.add(o.schedule(h,n,{windowTimeSpan:r,windowCreationInterval:n,subscriber:a,scheduler:o}))):a.add(o.schedule(f,r,{subscriber:a,window:s,windowTimeSpan:r})),a}return i(t,e),t.prototype._next=function(e){for(var t=this.windows,r=t.length,n=0;n<r;n++){var i=t[n];!i.closed&&(i.next(e),i.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(i))}},t.prototype._error=function(e){for(var t=this.windows;t.length>0;)t.shift().error(e);this.destination.error(e)},t.prototype._complete=function(){for(var e=this.windows;e.length>0;){var t=e.shift();t.closed||t.complete()}this.destination.complete()},t.prototype.openWindow=function(){var e=new d;return this.windows.push(e),this.destination.next(e),e},t.prototype.closeWindow=function(e){e.complete();var t=this.windows;t.splice(t.indexOf(e),1)},t}(s.Subscriber);function f(e){var t=e.subscriber,r=e.windowTimeSpan,n=e.window;n&&t.closeWindow(n),e.window=t.openWindow(),this.schedule(e,r)}function h(e){var t=e.windowTimeSpan,r=e.subscriber,n=e.scheduler,i=e.windowCreationInterval,o=r.openWindow(),a={action:this,subscription:null};a.subscription=n.schedule(m,t,{subscriber:r,window:o,context:a}),this.add(a.subscription),this.schedule(e,i)}function m(e){var t=e.subscriber,r=e.window,n=e.context;n&&n.action&&n.subscription&&n.action.remove(n.subscription),t.closeWindow(r)}},5428(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(2888),a=r(3207),s=r(5905),l=r(7849);t.windowToggle=function(e,t){return function(r){return r.lift(new u(e,t))}};var u=function(){function e(e,t){this.openings=e,this.closingSelector=t}return e.prototype.call=function(e,t){return t.subscribe(new c(e,this.openings,this.closingSelector))},e}(),c=function(e){function t(t,r,n){var i=e.call(this,t)||this;return i.openings=r,i.closingSelector=n,i.contexts=[],i.add(i.openSubscription=l.subscribeToResult(i,r,r)),i}return i(t,e),t.prototype._next=function(e){var t=this.contexts;if(t)for(var r=t.length,n=0;n<r;n++)t[n].window.next(e)},t.prototype._error=function(t){var r=this.contexts;if(this.contexts=null,r)for(var n=r.length,i=-1;++i<n;){var o=r[i];o.window.error(t),o.subscription.unsubscribe()}e.prototype._error.call(this,t)},t.prototype._complete=function(){var t=this.contexts;if(this.contexts=null,t)for(var r=t.length,n=-1;++n<r;){var i=t[n];i.window.complete(),i.subscription.unsubscribe()}e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){var e=this.contexts;if(this.contexts=null,e)for(var t=e.length,r=-1;++r<t;){var n=e[r];n.window.unsubscribe(),n.subscription.unsubscribe()}},t.prototype.notifyNext=function(e,t,r,n,i){if(e===this.openings){var s=void 0;try{s=(0,this.closingSelector)(t)}catch(e){return this.error(e)}var u=new o.Subject,c=new a.Subscription,d={window:u,subscription:c};this.contexts.push(d);var p=l.subscribeToResult(this,s,d);p.closed?this.closeWindow(this.contexts.length-1):(p.context=d,c.add(p)),this.destination.next(u)}else this.closeWindow(this.contexts.indexOf(e))},t.prototype.notifyError=function(e){this.error(e)},t.prototype.notifyComplete=function(e){e!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(e.context))},t.prototype.closeWindow=function(e){if(-1!==e){var t=this.contexts,r=t[e],n=r.window,i=r.subscription;t.splice(e,1),n.complete(),i.unsubscribe()}},t}(s.OuterSubscriber)},9284(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(2888),a=r(5905),s=r(7849);t.windowWhen=function(e){return function(t){return t.lift(new l(e))}};var l=function(){function e(e){this.closingSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new u(e,this.closingSelector))},e}(),u=function(e){function t(t,r){var n=e.call(this,t)||this;return n.destination=t,n.closingSelector=r,n.openWindow(),n}return i(t,e),t.prototype.notifyNext=function(e,t,r,n,i){this.openWindow(i)},t.prototype.notifyError=function(e){this._error(e)},t.prototype.notifyComplete=function(e){this.openWindow(e)},t.prototype._next=function(e){this.window.next(e)},t.prototype._error=function(e){this.window.error(e),this.destination.error(e),this.unsubscribeClosingNotification()},t.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},t.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},t.prototype.openWindow=function(e){void 0===e&&(e=null),e&&(this.remove(e),e.unsubscribe());var t,r=this.window;r&&r.complete();var n=this.window=new o.Subject;this.destination.next(n);try{t=(0,this.closingSelector)()}catch(e){this.destination.error(e),this.window.error(e);return}this.add(this.closingNotification=s.subscribeToResult(this,t))},t}(a.OuterSubscriber)},3564(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(5905),a=r(7849);t.withLatestFrom=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){var r;return"function"==typeof e[e.length-1]&&(r=e.pop()),t.lift(new s(e,r))}};var s=function(){function e(e,t){this.observables=e,this.project=t}return e.prototype.call=function(e,t){return t.subscribe(new l(e,this.observables,this.project))},e}(),l=function(e){function t(t,r,n){var i=e.call(this,t)||this;i.observables=r,i.project=n,i.toRespond=[];var o=r.length;i.values=Array(o);for(var s=0;s<o;s++)i.toRespond.push(s);for(var s=0;s<o;s++){var l=r[s];i.add(a.subscribeToResult(i,l,void 0,s))}return i}return i(t,e),t.prototype.notifyNext=function(e,t,r){this.values[r]=t;var n=this.toRespond;if(n.length>0){var i=n.indexOf(r);-1!==i&&n.splice(i,1)}},t.prototype.notifyComplete=function(){},t.prototype._next=function(e){if(0===this.toRespond.length){var t=[e].concat(this.values);this.project?this._tryProject(t):this.destination.next(t)}},t.prototype._tryProject=function(e){var t;try{t=this.project.apply(this,e)}catch(e){this.destination.error(e);return}this.destination.next(t)},t}(o.OuterSubscriber)},909(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(887);t.zip=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return t.lift.call(n.zip.apply(void 0,[t].concat(e)))}}},3282(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(887);t.zipAll=function(e){return function(t){return t.lift(new n.ZipOperator(e))}}},8822(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2515),i=r(3207);t.scheduleArray=function(e,t){return new n.Observable(function(r){var n=new i.Subscription,o=0;return n.add(t.schedule(function(){o===e.length?r.complete():(r.next(e[o++]),r.closed||n.add(this.schedule()))})),n})}},229(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2515),i=r(3207),o=r(7211);t.scheduleIterable=function(e,t){if(!e)throw Error("Iterable cannot be null");return new n.Observable(function(r){var n,a=new i.Subscription;return a.add(function(){n&&"function"==typeof n.return&&n.return()}),a.add(t.schedule(function(){n=e[o.iterator](),a.add(t.schedule(function(){if(!r.closed){try{var e,t,i=n.next();e=i.value,t=i.done}catch(e){r.error(e);return}t?r.complete():(r.next(e),this.schedule())}}))})),a})}},2(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2515),i=r(3207),o=r(6676);t.scheduleObservable=function(e,t){return new n.Observable(function(r){var n=new i.Subscription;return n.add(t.schedule(function(){var i=e[o.observable]();n.add(i.subscribe({next:function(e){n.add(t.schedule(function(){return r.next(e)}))},error:function(e){n.add(t.schedule(function(){return r.error(e)}))},complete:function(){n.add(t.schedule(function(){return r.complete()}))}}))})),n})}},1138(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2515),i=r(3207);t.schedulePromise=function(e,t){return new n.Observable(function(r){var n=new i.Subscription;return n.add(t.schedule(function(){return e.then(function(e){n.add(t.schedule(function(){r.next(e),n.add(t.schedule(function(){return r.complete()}))}))},function(e){n.add(t.schedule(function(){return r.error(e)}))})})),n})}},7315(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2),i=r(1138),o=r(8822),a=r(229),s=r(6565),l=r(7328),u=r(1087),c=r(2555);t.scheduled=function(e,t){if(null!=e){if(s.isInteropObservable(e))return n.scheduleObservable(e,t);else if(l.isPromise(e))return i.schedulePromise(e,t);else if(u.isArrayLike(e))return o.scheduleArray(e,t);else if(c.isIterable(e)||"string"==typeof e)return a.scheduleIterable(e,t)}throw TypeError((null!==e&&typeof e||e)+" is not observable")}},5666(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.Action=function(e){function t(t,r){return e.call(this)||this}return i(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(r(3207).Subscription)},2883(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(772);t.AsapAction=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.requestAsyncId=function(t,r,n){return(void 0===n&&(n=0),null!==n&&n>0)?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t.scheduled||(t.scheduled=o.Immediate.setImmediate(t.flush.bind(t,null))))},t.prototype.recycleAsyncId=function(t,r,n){if(void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);0===t.actions.length&&(o.Immediate.clearImmediate(r),t.scheduled=void 0)},t}(r(1076).AsyncAction)},3728(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsapScheduler=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.flush=function(e){this.active=!0,this.scheduled=void 0;var t,r=this.actions,n=-1,i=r.length;e=e||r.shift();do if(t=e.execute(e.state,e.delay))break;while(++n<i&&(e=r.shift()));if(this.active=!1,t){for(;++n<i&&(e=r.shift());)e.unsubscribe();throw t}},t}(r(4333).AsyncScheduler)},1076(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncAction=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n.pending=!1,n}return i(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r=this.id,n=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(n,r,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(n,this.id,t),this},t.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),setInterval(e.flush.bind(e,this),r)},t.prototype.recycleAsyncId=function(e,t,r){if(void 0===r&&(r=0),null!==r&&this.delay===r&&!1===this.pending)return t;clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,t);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var r=!1,n=void 0;try{this.work(e)}catch(e){r=!0,n=!!e&&e||Error(e)}if(r)return this.unsubscribe(),n},t.prototype._unsubscribe=function(){var e=this.id,t=this.scheduler,r=t.actions,n=r.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==n&&r.splice(n,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null},t}(r(5666).Action)},4333(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(3849);t.AsyncScheduler=function(e){function t(r,n){void 0===n&&(n=o.Scheduler.now);var i=e.call(this,r,function(){return t.delegate&&t.delegate!==i?t.delegate.now():n()})||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return i(t,e),t.prototype.schedule=function(r,n,i){return(void 0===n&&(n=0),t.delegate&&t.delegate!==this)?t.delegate.schedule(r,n,i):e.prototype.schedule.call(this,r,n,i)},t.prototype.flush=function(e){var t,r=this.actions;if(this.active)return void r.push(e);this.active=!0;do if(t=e.execute(e.state,e.delay))break;while(e=r.shift());if(this.active=!1,t){for(;e=r.shift();)e.unsubscribe();throw t}},t}(o.Scheduler)},6847(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.QueueAction=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return i(t,e),t.prototype.schedule=function(t,r){return(void 0===r&&(r=0),r>0)?e.prototype.schedule.call(this,t,r):(this.delay=r,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,r){return r>0||this.closed?e.prototype.execute.call(this,t,r):this._execute(t,r)},t.prototype.requestAsyncId=function(t,r,n){return(void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0)?e.prototype.requestAsyncId.call(this,t,r,n):t.flush(this)},t}(r(1076).AsyncAction)},5044(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.QueueScheduler=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(r(4333).AsyncScheduler)},2745(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2883);t.asapScheduler=new(r(3728)).AsapScheduler(n.AsapAction),t.asap=t.asapScheduler},5190(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1076);t.asyncScheduler=new(r(4333)).AsyncScheduler(n.AsyncAction),t.async=t.asyncScheduler},5677(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(6847);t.queueScheduler=new(r(5044)).QueueScheduler(n.QueueAction),t.queue=t.queueScheduler},7211(e,t){"use strict";function r(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}Object.defineProperty(t,"__esModule",{value:!0}),t.getSymbolIterator=r,t.iterator=r(),t.$$iterator=t.iterator},6676(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.observable="function"==typeof Symbol&&Symbol.observable||"@@observable"},4421(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rxSubscriber="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random(),t.$$rxSubscriber=t.rxSubscriber},7568(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ArgumentOutOfRangeError=function(){function e(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return e.prototype=Object.create(Error.prototype),e}()},1136(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyError=function(){function e(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return e.prototype=Object.create(Error.prototype),e}()},772(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=1,n=Promise.resolve(),i={};function o(e){return e in i&&(delete i[e],!0)}t.Immediate={setImmediate:function(e){var t=r++;return i[t]=!0,n.then(function(){return o(t)&&e()}),t},clearImmediate:function(e){o(e)}},t.TestTools={pending:function(){return Object.keys(i).length}}},6967(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObjectUnsubscribedError=function(){function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e}()},3734(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TimeoutError=function(){function e(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return e.prototype=Object.create(Error.prototype),e}()},1245(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnsubscriptionError=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map(function(e,t){return t+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}()},4487(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1396);t.canReportError=function(e){for(;e;){var t=e,r=t.closed,i=t.destination,o=t.isStopped;if(r||o)return!1;e=i&&i instanceof n.Subscriber?i:null}return!0}},4163(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hostReportError=function(e){setTimeout(function(){throw e},0)}},4579(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.identity=function(e){return e}},4728(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isArray=Array.isArray||function(e){return e&&"number"==typeof e.length}},1087(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isArrayLike=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}},4465(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDate=function(e){return e instanceof Date&&!isNaN(+e)}},3385(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isFunction=function(e){return"function"==typeof e}},6565(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(6676);t.isInteropObservable=function(e){return e&&"function"==typeof e[n.observable]}},2555(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7211);t.isIterable=function(e){return e&&"function"==typeof e[n.iterator]}},5390(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4728);t.isNumeric=function(e){return!n.isArray(e)&&e-parseFloat(e)+1>=0}},194(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=function(e){return null!==e&&"object"==typeof e}},7328(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPromise=function(e){return!!e&&"function"!=typeof e.subscribe&&"function"==typeof e.then}},8244(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isScheduler=function(e){return e&&"function"==typeof e.schedule}},7653(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.noop=function(){}},5352(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.not=function(e,t){function r(){return!r.pred.apply(r.thisArg,arguments)}return r.pred=e,r.thisArg=t,r}},8173(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4579);function i(e){return 0===e.length?n.identity:1===e.length?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}t.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return i(e)},t.pipeFromArray=i},7092(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(499),i=r(5259),o=r(8190),a=r(1021),s=r(1087),l=r(7328),u=r(194),c=r(7211),d=r(6676);t.subscribeTo=function(e){if(e&&"function"==typeof e[d.observable])return a.subscribeToObservable(e);if(s.isArrayLike(e))return n.subscribeToArray(e);if(l.isPromise(e))return i.subscribeToPromise(e);if(e&&"function"==typeof e[c.iterator])return o.subscribeToIterable(e);throw TypeError("You provided "+(u.isObject(e)?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")}},499(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.subscribeToArray=function(e){return function(t){for(var r=0,n=e.length;r<n&&!t.closed;r++)t.next(e[r]);t.complete()}}},8190(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7211);t.subscribeToIterable=function(e){return function(t){for(var r=e[n.iterator]();;){var i=void 0;try{i=r.next()}catch(e){return t.error(e),t}if(i.done){t.complete();break}if(t.next(i.value),t.closed)break}return"function"==typeof r.return&&t.add(function(){r.return&&r.return()}),t}}},1021(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(6676);t.subscribeToObservable=function(e){return function(t){var r=e[n.observable]();if("function"==typeof r.subscribe)return r.subscribe(t);throw TypeError("Provided object does not correctly implement Symbol.observable")}}},5259(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4163);t.subscribeToPromise=function(e){return function(t){return e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,n.hostReportError),t}}},7849(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4470),i=r(7092),o=r(2515);t.subscribeToResult=function(e,t,r,a,s){if(void 0===s&&(s=new n.InnerSubscriber(e,r,a)),!s.closed)return t instanceof o.Observable?t.subscribe(s):i.subscribeTo(t)(s)}},5158(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1396),i=r(4421),o=r(2544);t.toSubscriber=function(e,t,r){if(e){if(e instanceof n.Subscriber)return e;if(e[i.rxSubscriber])return e[i.rxSubscriber]()}return e||t||r?new n.Subscriber(e,t,r):new n.Subscriber(o.empty)}},6170(e,t,r){"use strict";r(8461).audit,r(2392).auditTime,r(7954).buffer,r(647).bufferCount,r(6327).bufferTime,r(6786).bufferToggle,r(1662).bufferWhen,r(5503).catchError,r(4908).combineAll,r(9060).combineLatest,r(6600).concat,r(6345).concatAll,r(2248).concatMap,r(3577).concatMapTo,r(8765).count,r(3287).debounce,r(5685).debounceTime,r(2767).defaultIfEmpty,r(6965).delay,r(9861).delayWhen,r(7642).dematerialize,r(8820).distinct,r(9391).distinctUntilChanged,r(5075).distinctUntilKeyChanged,r(2399).elementAt,r(2631).endWith,r(7233).every,r(2408).exhaust,r(1112).exhaustMap,r(7736).expand,r(2670).filter,r(1258).finalize,r(5063).find,r(2939).findIndex,r(9948).first,r(7784).groupBy,r(6863).ignoreElements,r(3371).isEmpty,r(7064).last,t.map=r(6808).map,r(3353).mapTo,r(2539).materialize,r(6416).max,r(1570).merge,r(9287).mergeAll;var n=r(5206);n.mergeMap,n.flatMap,r(9019).mergeMapTo,r(2307).mergeScan,r(7198).min,r(4864).multicast,r(5495).observeOn,r(5029).onErrorResumeNext,r(7304).pairwise,r(4236).partition,r(1075).pluck,r(5485).publish,r(91).publishBehavior,r(3433).publishLast,r(9622).publishReplay,r(6721).race,r(2518).reduce,r(6483).repeat,r(283).repeatWhen,r(3160).retry,r(5508).retryWhen,r(6888).refCount,r(1754).sample,r(1183).sampleTime,r(253).scan,r(5017).sequenceEqual,r(3213).share,r(8614).shareReplay,r(8480).single,r(4775).skip,r(2807).skipLast,r(2519).skipUntil,r(4846).skipWhile,r(4558).startWith,r(15).subscribeOn,r(5433).switchAll,r(7912).switchMap,r(7865).switchMapTo,t.take=r(1231).take,r(3439).takeLast,r(1279).takeUntil,r(6518).takeWhile,r(1451).tap,r(464).throttle,r(42).throttleTime,r(2056).throwIfEmpty,r(5276).timeInterval,r(8673).timeout,r(4053).timeoutWith,r(8858).timestamp,r(2284).toArray,r(7544).window,r(1565).windowCount,r(3877).windowTime,r(5428).windowToggle,r(9284).windowWhen,r(3564).withLatestFrom,r(909).zip,r(3282).zipAll},3904(e,t,r){"use strict";let n=Symbol("SemVer ANY");class i{static get ANY(){return n}constructor(e,t){if(t=o(t),e instanceof i)if(!!t.loose===e.loose)return e;else e=e.value;u("comparator",e=e.trim().split(/\s+/).join(" "),t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===n?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){let t=this.options.loose?a[s.COMPARATORLOOSE]:a[s.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new c(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===n||e===n)return!0;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw TypeError("a Comparator is required");return""===this.operator?""===this.value||new d(e.value,t).test(this.value):""===e.operator?""===e.value||new d(this.value,t).test(e.semver):!((t=o(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))}}e.exports=i;let o=r(8587),{safeRe:a,t:s}=r(9718),l=r(2111),u=r(7272),c=r(3908),d=r(8311)},8311(e,t,r){"use strict";let n=/\s+/g;class i{constructor(e,t){if(t=a(t),e instanceof i)if(!!t.loose===e.loose&&!!t.includePrerelease===e.includePrerelease)return e;else return new i(e.raw,t);if(e instanceof s)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(n," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!g(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1){for(const e of this.set)if(1===e.length&&b(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=((this.options.includePrerelease&&m)|(this.options.loose&&y))+":"+e,r=o.get(t);if(r)return r;let n=this.options.loose,i=n?c[d.HYPHENRANGELOOSE]:c[d.HYPHENRANGE];l("hyphen replace",e=e.replace(i,T(this.options.includePrerelease))),l("comparator trim",e=e.replace(c[d.COMPARATORTRIM],p)),l("tilde trim",e=e.replace(c[d.TILDETRIM],f)),l("caret trim",e=e.replace(c[d.CARETTRIM],h));let a=e.split(" ").map(e=>w(e,this.options)).join(" ").split(/\s+/).map(e=>j(e,this.options));n&&(a=a.filter(e=>(l("loose invalid filter",e,this.options),!!e.match(c[d.COMPARATORLOOSE])))),l("range list",a);let u=new Map;for(let e of a.map(e=>new s(e,this.options))){if(g(e))return[e];u.set(e.value,e)}u.size>1&&u.has("")&&u.delete("");let b=[...u.values()];return o.set(t,b),b}intersects(e,t){if(!(e instanceof i))throw TypeError("a Range is required");return this.set.some(r=>v(r,t)&&e.set.some(e=>v(e,t)&&r.every(r=>e.every(e=>r.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(R(this.set[t],e,this.options))return!0;return!1}}e.exports=i;let o=new(r(8794)),a=r(8587),s=r(3904),l=r(7272),u=r(3908),{safeRe:c,t:d,comparatorTrimReplace:p,tildeTrimReplace:f,caretTrimReplace:h}=r(9718),{FLAG_INCLUDE_PRERELEASE:m,FLAG_LOOSE:y}=r(6874),g=e=>"<0.0.0-0"===e.value,b=e=>""===e.value,v=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();for(;r&&n.length;)r=n.every(e=>i.intersects(e,t)),i=n.pop();return r},w=(e,t)=>(l("comp",e=e.replace(c[d.BUILD],""),t),l("caret",e=D(e,t)),l("tildes",e=E(e,t)),l("xrange",e=P(e,t)),l("stars",e=k(e,t)),e),x=e=>!e||"x"===e.toLowerCase()||"*"===e,E=(e,t)=>e.trim().split(/\s+/).map(e=>S(e,t)).join(" "),S=(e,t)=>{let r=t.loose?c[d.TILDELOOSE]:c[d.TILDE];return e.replace(r,(t,r,n,i,o)=>{let a;return l("tilde",e,t,r,n,i,o),x(r)?a="":x(n)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:x(i)?a=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:o?(l("replaceTilde pr",o),a=`>=${r}.${n}.${i}-${o} <${r}.${+n+1}.0-0`):a=`>=${r}.${n}.${i} <${r}.${+n+1}.0-0`,l("tilde return",a),a})},D=(e,t)=>e.trim().split(/\s+/).map(e=>O(e,t)).join(" "),O=(e,t)=>{l("caret",e,t);let r=t.loose?c[d.CARETLOOSE]:c[d.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(t,r,i,o,a)=>{let s;return l("caret",e,t,r,i,o,a),x(r)?s="":x(i)?s=`>=${r}.0.0${n} <${+r+1}.0.0-0`:x(o)?s="0"===r?`>=${r}.${i}.0${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${n} <${+r+1}.0.0-0`:a?(l("replaceCaret pr",a),s="0"===r?"0"===i?`>=${r}.${i}.${o}-${a} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}-${a} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o}-${a} <${+r+1}.0.0-0`):(l("no pr"),s="0"===r?"0"===i?`>=${r}.${i}.${o}${n} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o} <${+r+1}.0.0-0`),l("caret return",s),s})},P=(e,t)=>(l("replaceXRanges",e,t),e.split(/\s+/).map(e=>C(e,t)).join(" ")),C=(e,t)=>{e=e.trim();let r=t.loose?c[d.XRANGELOOSE]:c[d.XRANGE];return e.replace(r,(r,n,i,o,a,s)=>{l("xRange",e,r,n,i,o,a,s);let u=x(i),c=u||x(o),d=c||x(a);return"="===n&&d&&(n=""),s=t.includePrerelease?"-0":"",u?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&d?(c&&(o=0),a=0,">"===n?(n=">=",c?(i=+i+1,o=0):o=+o+1,a=0):"<="===n&&(n="<",c?i=+i+1:o=+o+1),"<"===n&&(s="-0"),r=`${n+i}.${o}.${a}${s}`):c?r=`>=${i}.0.0${s} <${+i+1}.0.0-0`:d&&(r=`>=${i}.${o}.0${s} <${i}.${+o+1}.0-0`),l("xRange return",r),r})},k=(e,t)=>(l("replaceStars",e,t),e.trim().replace(c[d.STAR],"")),j=(e,t)=>(l("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?d.GTE0PRE:d.GTE0],"")),T=e=>(t,r,n,i,o,a,s,l,u,c,d,p)=>(r=x(n)?"":x(i)?`>=${n}.0.0${e?"-0":""}`:x(o)?`>=${n}.${i}.0${e?"-0":""}`:a?`>=${r}`:`>=${r}${e?"-0":""}`,l=x(u)?"":x(c)?`<${+u+1}.0.0-0`:x(d)?`<${u}.${+c+1}.0-0`:p?`<=${u}.${c}.${d}-${p}`:e?`<${u}.${c}.${+d+1}-0`:`<=${l}`,`${r} ${l}`.trim()),R=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(l(e[r].semver),e[r].semver!==s.ANY&&e[r].semver.prerelease.length>0){let n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}},3908(e,t,r){"use strict";let n=r(7272),{MAX_LENGTH:i,MAX_SAFE_INTEGER:o}=r(6874),{safeRe:a,t:s}=r(9718),l=r(8587),{compareIdentifiers:u}=r(1123);class c{constructor(e,t){if(t=l(t),e instanceof c)if(!!t.loose===e.loose&&!!t.includePrerelease===e.includePrerelease)return e;else e=e.version;else if("string"!=typeof e)throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>i)throw TypeError(`version is longer than ${i} characters`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?a[s.LOOSE]:a[s.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>o||this.major<0)throw TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<o)return t}return e}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(n("SemVer.compare",this.version,this.options,e),!(e instanceof c)){if("string"==typeof e&&e===this.version)return 0;e=new c(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return(e instanceof c||(e=new c(e,this.options)),this.major<e.major)?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:+(this.patch>e.patch)}comparePre(e){if(e instanceof c||(e=new c(e,this.options)),this.prerelease.length&&!e.prerelease.length)return -1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],i=e.prerelease[t];if(n("prerelease compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return -1;else if(r===i)continue;else return u(r,i)}while(++t)}compareBuild(e){e instanceof c||(e=new c(e,this.options));let t=0;do{let r=this.build[t],i=e.build[t];if(n("build compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return -1;else if(r===i)continue;else return u(r,i)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&!1===r)throw Error("invalid increment argument: identifier is empty");if(t){let e=`-${t}`.match(this.options.loose?a[s.PRERELEASELOOSE]:a[s.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(0===this.prerelease.length)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(0!==this.minor||0!==this.patch||0===this.prerelease.length)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(0!==this.patch||0===this.prerelease.length)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{let e=+!!Number(r);if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===u(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=c},7414(e,t,r){"use strict";let n=r(144);e.exports=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},2111(e,t,r){"use strict";let n=r(4641),i=r(3999),o=r(3199),a=r(4089),s=r(7059),l=r(5200);e.exports=(e,t,r,u)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return n(e,r,u);case"!=":return i(e,r,u);case">":return o(e,r,u);case">=":return a(e,r,u);case"<":return s(e,r,u);case"<=":return l(e,r,u);default:throw TypeError(`Invalid operator: ${t}`)}}},3789(e,t,r){"use strict";let n=r(3908),i=r(144),{safeRe:o,t:a}=r(9718);e.exports=(e,t)=>{if(e instanceof n)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let n,i=t.includePrerelease?o[a.COERCERTLFULL]:o[a.COERCERTL];for(;(n=i.exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&n.index+n[0].length===r.index+r[0].length||(r=n),i.lastIndex=n.index+n[1].length+n[2].length;i.lastIndex=-1}else r=e.match(t.includePrerelease?o[a.COERCEFULL]:o[a.COERCE]);if(null===r)return null;let s=r[2],l=r[3]||"0",u=r[4]||"0",c=t.includePrerelease&&r[5]?`-${r[5]}`:"",d=t.includePrerelease&&r[6]?`+${r[6]}`:"";return i(`${s}.${l}.${u}${c}${d}`,t)}},3290(e,t,r){"use strict";let n=r(3908);e.exports=(e,t,r)=>{let i=new n(e,r),o=new n(t,r);return i.compare(o)||i.compareBuild(o)}},1763(e,t,r){"use strict";let n=r(560);e.exports=(e,t)=>n(e,t,!0)},560(e,t,r){"use strict";let n=r(3908);e.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))},1832(e,t,r){"use strict";let n=r(144);e.exports=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),o=r.compare(i);if(0===o)return null;let a=o>0,s=a?r:i,l=a?i:r,u=!!s.prerelease.length;if(l.prerelease.length&&!u){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(s))return l.minor&&!l.patch?"minor":"patch"}let c=u?"pre":"";return r.major!==i.major?c+"major":r.minor!==i.minor?c+"minor":r.patch!==i.patch?c+"patch":"prerelease"}},4641(e,t,r){"use strict";let n=r(560);e.exports=(e,t,r)=>0===n(e,t,r)},3199(e,t,r){"use strict";let n=r(560);e.exports=(e,t,r)=>n(e,t,r)>0},4089(e,t,r){"use strict";let n=r(560);e.exports=(e,t,r)=>n(e,t,r)>=0},3007(e,t,r){"use strict";let n=r(3908);e.exports=(e,t,r,i,o)=>{"string"==typeof r&&(o=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,o).version}catch(e){return null}}},7059(e,t,r){"use strict";let n=r(560);e.exports=(e,t,r)=>0>n(e,t,r)},5200(e,t,r){"use strict";let n=r(560);e.exports=(e,t,r)=>0>=n(e,t,r)},2938(e,t,r){"use strict";let n=r(3908);e.exports=(e,t)=>new n(e,t).major},6254(e,t,r){"use strict";let n=r(3908);e.exports=(e,t)=>new n(e,t).minor},3999(e,t,r){"use strict";let n=r(560);e.exports=(e,t,r)=>0!==n(e,t,r)},144(e,t,r){"use strict";let n=r(3908);e.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}},4493(e,t,r){"use strict";let n=r(3908);e.exports=(e,t)=>new n(e,t).patch},1729(e,t,r){"use strict";let n=r(144);e.exports=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}},9970(e,t,r){"use strict";let n=r(560);e.exports=(e,t,r)=>n(t,e,r)},4277(e,t,r){"use strict";let n=r(3290);e.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))},7638(e,t,r){"use strict";let n=r(8311);e.exports=(e,t,r)=>{try{t=new n(t,r)}catch(e){return!1}return t.test(e)}},3927(e,t,r){"use strict";let n=r(3290);e.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))},6953(e,t,r){"use strict";let n=r(144);e.exports=(e,t)=>{let r=n(e,t);return r?r.version:null}},9589(e,t,r){"use strict";let n=r(9718),i=r(6874),o=r(3908),a=r(1123),s=r(144),l=r(6953),u=r(7414),c=r(3007),d=r(1832),p=r(2938),f=r(6254),h=r(4493),m=r(1729),y=r(560),g=r(9970),b=r(1763),v=r(3290),w=r(3927),x=r(4277),E=r(3199),S=r(7059),D=r(4641),O=r(3999),P=r(4089),C=r(5200),k=r(2111),j=r(3789),T=r(3904),R=r(8311),A=r(7638),N=r(7631),M=r(9628),I=r(270),$=r(1261),L=r(3874),F=r(7075),B=r(5571),V=r(5342),U=r(6780);e.exports={parse:s,valid:l,clean:u,inc:c,diff:d,major:p,minor:f,patch:h,prerelease:m,compare:y,rcompare:g,compareLoose:b,compareBuild:v,sort:w,rsort:x,gt:E,lt:S,eq:D,neq:O,gte:P,lte:C,cmp:k,coerce:j,Comparator:T,Range:R,satisfies:A,toComparators:N,maxSatisfying:M,minSatisfying:I,minVersion:$,validRange:L,outside:F,gtr:B,ltr:V,intersects:U,simplifyRange:r(2525),subset:r(5032),SemVer:o,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:a.compareIdentifiers,rcompareIdentifiers:a.rcompareIdentifiers}},6874(e){"use strict";e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||0x1fffffffffffff,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},7272(e){"use strict";e.exports="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{}},1123(e){"use strict";let t=/^[0-9]+$/,r=(e,r)=>{if("number"==typeof e&&"number"==typeof r)return e===r?0:e<r?-1:1;let n=t.test(e),i=t.test(r);return n&&i&&(e*=1,r*=1),e===r?0:n&&!i?-1:i&&!n?1:e<r?-1:1};e.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}},8794(e){"use strict";e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(void 0!==t)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},8587(e){"use strict";let t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},9718(e,t,r){"use strict";let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:o}=r(6874),a=r(7272),s=(t=e.exports={}).re=[],l=t.safeRe=[],u=t.src=[],c=t.safeSrc=[],d=t.t={},p=0,f="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",o],[f,i]],m=(e,t,r)=>{let n=(e=>{for(let[t,r]of h)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),i=p++;a(e,i,t),d[e]=i,u[i]=t,c[i]=n,s[i]=new RegExp(t,r?"g":void 0),l[i]=new RegExp(n,r?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),m("MAINVERSION",`(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${u[d.NONNUMERICIDENTIFIER]}|${u[d.NUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${u[d.NONNUMERICIDENTIFIER]}|${u[d.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASE",`(?:-(${u[d.PRERELEASEIDENTIFIER]}(?:\\.${u[d.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${u[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[d.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${f}+`),m("BUILD",`(?:\\+(${u[d.BUILDIDENTIFIER]}(?:\\.${u[d.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${u[d.MAINVERSION]}${u[d.PRERELEASE]}?${u[d.BUILD]}?`),m("FULL",`^${u[d.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${u[d.MAINVERSIONLOOSE]}${u[d.PRERELEASELOOSE]}?${u[d.BUILD]}?`),m("LOOSE",`^${u[d.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${u[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${u[d.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:${u[d.PRERELEASE]})?${u[d.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:${u[d.PRERELEASELOOSE]})?${u[d.BUILD]}?)?)?`),m("XRANGE",`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAINLOOSE]}$`),m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),m("COERCE",`${u[d.COERCEPLAIN]}(?:$|[^\\d])`),m("COERCEFULL",u[d.COERCEPLAIN]+`(?:${u[d.PRERELEASE]})?`+`(?:${u[d.BUILD]})?`+"(?:$|[^\\d])"),m("COERCERTL",u[d.COERCE],!0),m("COERCERTLFULL",u[d.COERCEFULL],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${u[d.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",m("TILDE",`^${u[d.LONETILDE]}${u[d.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${u[d.LONETILDE]}${u[d.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${u[d.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",m("CARET",`^${u[d.LONECARET]}${u[d.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${u[d.LONECARET]}${u[d.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${u[d.GTLT]}\\s*(${u[d.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]}|${u[d.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${u[d.XRANGEPLAIN]})\\s+-\\s+(${u[d.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${u[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[d.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},5571(e,t,r){"use strict";let n=r(7075);e.exports=(e,t,r)=>n(e,t,">",r)},6780(e,t,r){"use strict";let n=r(8311);e.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))},5342(e,t,r){"use strict";let n=r(7075);e.exports=(e,t,r)=>n(e,t,"<",r)},9628(e,t,r){"use strict";let n=r(3908),i=r(8311);e.exports=(e,t,r)=>{let o=null,a=null,s=null;try{s=new i(t,r)}catch(e){return null}return e.forEach(e=>{s.test(e)&&(!o||-1===a.compare(e))&&(a=new n(o=e,r))}),o}},270(e,t,r){"use strict";let n=r(3908),i=r(8311);e.exports=(e,t,r)=>{let o=null,a=null,s=null;try{s=new i(t,r)}catch(e){return null}return e.forEach(e=>{s.test(e)&&(!o||1===a.compare(e))&&(a=new n(o=e,r))}),o}},1261(e,t,r){"use strict";let n=r(3908),i=r(8311),o=r(3199);e.exports=(e,t)=>{e=new i(e,t);let r=new n("0.0.0");if(e.test(r)||(r=new n("0.0.0-0"),e.test(r)))return r;r=null;for(let t=0;t<e.set.length;++t){let i=e.set[t],a=null;i.forEach(e=>{let t=new n(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":(!a||o(t,a))&&(a=t);break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),a&&(!r||o(r,a))&&(r=a)}return r&&e.test(r)?r:null}},7075(e,t,r){"use strict";let n=r(3908),i=r(3904),{ANY:o}=i,a=r(8311),s=r(7638),l=r(3199),u=r(7059),c=r(5200),d=r(4089);e.exports=(e,t,r,p)=>{let f,h,m,y,g;switch(e=new n(e,p),t=new a(t,p),r){case">":f=l,h=c,m=u,y=">",g=">=";break;case"<":f=u,h=d,m=l,y="<",g="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(s(e,t,p))return!1;for(let r=0;r<t.set.length;++r){let n=t.set[r],a=null,s=null;if(n.forEach(e=>{e.semver===o&&(e=new i(">=0.0.0")),a=a||e,s=s||e,f(e.semver,a.semver,p)?a=e:m(e.semver,s.semver,p)&&(s=e)}),a.operator===y||a.operator===g||(!s.operator||s.operator===y)&&h(e,s.semver)||s.operator===g&&m(e,s.semver))return!1}return!0}},2525(e,t,r){"use strict";let n=r(7638),i=r(560);e.exports=(e,t,r)=>{let o=[],a=null,s=null,l=e.sort((e,t)=>i(e,t,r));for(let e of l)n(e,t,r)?(s=e,a||(a=e)):(s&&o.push([a,s]),s=null,a=null);a&&o.push([a,null]);let u=[];for(let[e,t]of o)e===t?u.push(e):t||e!==l[0]?t?e===l[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");let c=u.join(" || "),d="string"==typeof t.raw?t.raw:String(t);return c.length<d.length?c:t}},5032(e,t,r){"use strict";let n=r(8311),i=r(3904),{ANY:o}=i,a=r(7638),s=r(560),l=[new i(">=0.0.0-0")],u=[new i(">=0.0.0")],c=(e,t,r)=>{let n,i,c,f,h,m,y;if(e===t)return!0;if(1===e.length&&e[0].semver===o)if(1===t.length&&t[0].semver===o)return!0;else e=r.includePrerelease?l:u;if(1===t.length&&t[0].semver===o)if(r.includePrerelease)return!0;else t=u;let g=new Set;for(let t of e)">"===t.operator||">="===t.operator?n=d(n,t,r):"<"===t.operator||"<="===t.operator?i=p(i,t,r):g.add(t.semver);if(g.size>1)return null;if(n&&i&&((c=s(n.semver,i.semver,r))>0||0===c&&(">="!==n.operator||"<="!==i.operator)))return null;for(let e of g){if(n&&!a(e,String(n),r)||i&&!a(e,String(i),r))return null;for(let n of t)if(!a(e,String(n),r))return!1;return!0}let b=!!i&&!r.includePrerelease&&!!i.semver.prerelease.length&&i.semver,v=!!n&&!r.includePrerelease&&!!n.semver.prerelease.length&&n.semver;for(let e of(b&&1===b.prerelease.length&&"<"===i.operator&&0===b.prerelease[0]&&(b=!1),t)){if(y=y||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,n){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),">"===e.operator||">="===e.operator){if((f=d(n,e,r))===e&&f!==n)return!1}else if(">="===n.operator&&!a(n.semver,String(e),r))return!1}if(i){if(b&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===b.major&&e.semver.minor===b.minor&&e.semver.patch===b.patch&&(b=!1),"<"===e.operator||"<="===e.operator){if((h=p(i,e,r))===e&&h!==i)return!1}else if("<="===i.operator&&!a(i.semver,String(e),r))return!1}if(!e.operator&&(i||n)&&0!==c)return!1}return(!n||!m||!!i||0===c)&&(!i||!y||!!n||0===c)&&!v&&!b&&!0},d=(e,t,r)=>{if(!e)return t;let n=s(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},p=(e,t,r)=>{if(!e)return t;let n=s(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;e:for(let n of e.set){for(let e of t.set){let t=c(n,e,r);if(i=i||null!==t,t)continue e}if(i)return!1}return!0}},7631(e,t,r){"use strict";let n=r(8311);e.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "))},3874(e,t,r){"use strict";let n=r(8311);e.exports=(e,t)=>{try{return new n(e,t).range||"*"}catch(e){return null}}},8420(e,t,r){"use strict";let n,i,o,a,s,l,u,c,d,p,f,h,m;r.r(t),r.d(t,{GenderUnknownIcon:()=>mB,evaluateAsNumber:()=>dn,getImportMapOverrideMap:()=>oz,StockManagementPictogram:()=>O2,ChemistryIcon:()=>mx,BabyIcon:()=>md,DashboardExtension:()=>yB,openmrsComponentDecorator:()=>fS,tryRegisterExtension:()=>hB,pictogramIds:()=>OR,ActivityIcon:()=>mo,compile:()=>dl,removeRouteMapOverride:()=>ap,checkStatus:()=>dI,TableBatchActions:()=>h4,getAsyncLifecycle:()=>fO,subscribeOpenmrsEvent:()=>cV,dispatchConnectivityChanged:()=>g,PasswordIcon:()=>ye,Assessment2Pictogram:()=>OI,CloseIcon:()=>mP,setupRouteMapOverrides:()=>am,getWorkspaceGroupRegistration:()=>pR,registerWorkspace:()=>pC,useFeatureFlag:()=>f6,reset:()=>pv,LabOrderIcon:()=>mZ,VisitMode:()=>cG,offlineUuidPrefix:()=>cb,useLocations:()=>hm,getLifecycle:()=>fD,formatDatetime:()=>Sq,getVisitsForPatient:()=>c1,subscribeConnectivity:()=>v,formatPartialDate:()=>SK,CustomOverflowMenu:()=>me,LocationIcon:()=>mX,GroupIcon:()=>mU,canBeginEditSynchronizationItemsOfType:()=>cc,VisitStatus:()=>cq,createUseStore:()=>p2,getCurrentImportMap:()=>o2,getSessionLocation:()=>oO,usePatient:()=>hx,useRenderableExtensions:()=>hS,getOpenedWindowIndexByWorkspace:()=>pI,checkStatusFor:()=>d$,clearHistory:()=>oa,clearConfigErrors:()=>rI,formatTime:()=>SG,isDevEnabled:()=>oj,setLeftNav:()=>p_,syncOfflinePatientData:()=>cI,closeWorkspaceGroup2:()=>P7,getCurrentRouteMap:()=>as,ConfigurableLink:()=>pJ,sessionStore:()=>og,subscribeSnackbarShown:()=>M,getDynamicOfflineDataEntriesFor:()=>cD,getLoggedInUser:()=>oD,GenderMaleIcon:()=>mL,getExtensionSlotConfigFromStore:()=>tX,evaluateAsNumberAsync:()=>di,putDynamicOfflineDataFor:()=>cP,getImportMapDefaultMap:()=>oK,unregisterExtensionRendering:()=>dq,implementerToolsConfigStore:()=>rr,Type:()=>tL,InPatientPictogram:()=>Oz,cleanupObsoleteFeatureFlags:()=>dj,getAttachmentsUrl:()=>av,showSnackbar:()=>Pl,PatientBannerActionsMenu:()=>OD,PatientSearchPictogram:()=>OJ,DocumentAttachmentIcon:()=>mT,Snackbar:()=>Pn,CardiologyPictogram:()=>OL,ImageMedicalIcon:()=>mH,ActionableNotificationComponent:()=>DX,DiagnosisTags:()=>Dk,iconIds:()=>mi,PatientsPictogram:()=>OX,interpolateUrl:()=>i9,setupHistory:()=>on,subscribeToastShown:()=>N,detachAll:()=>ph,convertToLocaleCalendar:()=>SY,DocumentIcon:()=>mj,configInternalStore:()=>tz,ActionMenuButton2:()=>Cm,setupDynamicOfflineDataHandler:()=>cE,makeUrl:()=>of,oneOf:()=>rW,selectPreferredName:()=>Of,launchWorkspaceGroup:()=>function e(t,r){let n=pR(t),{state:i,onWorkspaceGroupLaunch:o,workspaceGroupCleanup:a,workspaceToLaunch:s}=r,l=function(){return PC}();if(l.getState().openWorkspaces.length){let n=l.getState().workspaceGroup;n?Py(n?.name,()=>{e(t,r)}):PR(()=>{e(t,r)})}else l.setState(e=>({...e,workspaceGroup:{name:t,members:n.members,cleanup:a}})),P$(t,i),o?.(),s&&Pb(s.name,s.additionalProps??{})},syncDynamicOfflineData:()=>cT,MobileCheckIcon:()=>m2,createErrorHandler:()=>$,openmrsObservableFetch:()=>om,parseDate:()=>SL,getAttachmentByUuid:()=>ag,LeftNavMenu:()=>DM,getExtensionRegistration:()=>pc,ShoppingCartAddItemIcon:()=>y$,ReferralOrderIcon:()=>ya,ReportIcon:()=>yl,dispatchToastShown:()=>T,getImportMapNextPageMap:()=>oH,registerExtension:()=>pd,setupOfflineSync:()=>cf,DownloadIcon:()=>mR,useConnectivity:()=>fY,provide:()=>rm,getSynchronizationItemsFor:()=>co,ShoppingCartArrowDownIcon:()=>ym,featureFlagsStore:()=>dC,promptBeforeClosing:()=>P_,removeDynamicOfflineDataFor:()=>ck,jsep:()=>c2,GeriatricsPictogram:()=>OK,SearchIcon:()=>yd,reportError:()=>I,slugify:()=>o1,isOmrsDateToday:()=>SM,getExtensionStore:()=>dY,BloodBankPictogram:()=>O$,TriagePictogram:()=>O5,Workspace2:()=>Cu,refetchCurrentUser:()=>ox,CheckmarkOutlineIcon:()=>m_,registerExtensionSlot:()=>pb,AllergiesIcon:()=>yA,ArrowDownIcon:()=>ms,useOpenmrsInfinite:()=>hi,getExtensionConfigFromExtensionSlotStore:()=>t3,OpenmrsDatePicker:()=>DP,getExtensionConfigFromStore:()=>t1,getDynamicOfflineDataEntries:()=>cS,getLocaleDisplayName:()=>Se,messageOmrsServiceWorker:()=>aL,navigate:()=>oe,launchWorkspace2:()=>Ce,getGroupByWindowName:()=>pM,CustomOverflowMenuItem:()=>mt,isUrl:()=>rU,CaretDownIcon:()=>mh,ArrowLeftIcon:()=>ml,FacilityPictogram:()=>OW,ViewOffIcon:()=>yj,setCurrentOfflineMode:()=>az,updateInternalExtensionStore:()=>dU,dispatchActionableNotificationShown:()=>k,resetRouteMapOverrides:()=>af,formatDurationBetween:()=>S4,defaultVisitCustomRepresentation:()=>cY,getBreadcrumbsFor:()=>rX,useOpenmrsPagination:()=>f8,Pagination:()=>Ol,CheckmarkFilledIcon:()=>mw,clearCurrentUser:()=>oE,showModal:()=>DY,ChevronUpIcon:()=>mO,saveVisit:()=>cQ,useAttachments:()=>fW,Pictogram:()=>Pt,useExtensionSlot:()=>fe,ChevronDownIcon:()=>mE,OpenmrsDateRangePicker:()=>DC,deleteAttachmentPermanently:()=>a_,getVisitTypes:()=>cz,OverflowMenuHorizontalIcon:()=>m9,EventScheduleIcon:()=>mM,getSessionStore:()=>ow,ActionMenu:()=>P6,ProcedureOrderIcon:()=>yi,preloadImport:()=>o4,registerWorkspaceWindows2:()=>pL,useOnVisible:()=>hg,setSessionLocation:()=>oP,userHasAccess:()=>oS,ChartAverageIcon:()=>mb,getFeatureFlag:()=>dT,UserAvatarIcon:()=>yO,renderExtension:()=>pG,useFhirInfinite:()=>hu,toVisitTypeObject:()=>cH,useSession:()=>hD,EmergencyDepartmentPictogram:()=>OU,Notification:()=>DZ,dispatchSnackbarShown:()=>j,getSynchronizationItem:()=>cu,navigateAndLaunchWorkspace:()=>Pv,omrsOfflineCachingStrategyHttpHeaderName:()=>a$,formatDate:()=>SH,workspace2StoreActions:()=>Cn,SwitcherIcon:()=>yf,esmStyleGuideSchema:()=>h0,getImportMapDisabledOverrides:()=>oG,useAssignedExtensionIds:()=>fV,CaretRightIcon:()=>my,evaluateAsType:()=>da,PageHeader:()=>Oa,TranslateIcon:()=>yx,setUserProperties:()=>oC,MovementIcon:()=>m8,renderInlineNotifications:()=>D8,subscribePrecacheStaticDependencies:()=>E,PaymentsDeskPictogram:()=>OQ,usePrimaryIdentifierCode:()=>hE,dispatchPrecacheStaticDependencies:()=>x,getCurrentUser:()=>ov,useLayoutType:()=>hd,XrayPictogram:()=>O8,CaretUpIcon:()=>mg,renderActionableNotifications:()=>D7,OpenmrsAppContext:()=>fI,setupModals:()=>Dq,omrsOfflineResponseBodyHttpHeaderName:()=>aM,getDefaultsFromConfigSchema:()=>function e(t){let r={};for(let n of Object.keys(t))if(CA(t[n])&&t[n].hasOwnProperty("_default"))r[n]=t[n]._default;else{if(n.startsWith("_"))continue;CA(t[n])?r[n]=e(t[n]):r[n]=t[n]}return r},subscribeTo:()=>X,recordConfigDerivationError:()=>re,useAbortController:()=>fL,Extension:()=>pX,getFhirServerPaginationHandlers:()=>ht,useConnectedExtensions:()=>fq,registerApp:()=>hU,queueSynchronizationItemFor:()=>cn,HospitalBedIcon:()=>mK,useExtensionInternalStore:()=>f3,configExtensionStore:()=>tq,getSynchronizationItems:()=>cs,getExtensionSlotsConfigStore:()=>tZ,registerExtensionRendering:()=>dG,RenderIfValueIsTruthy:()=>f$,registerFeatureFlag:()=>dk,useFhirFetchAll:()=>hl,restBaseUrl:()=>oc,CalendarHeatMapIcon:()=>mp,getWorkspaceRegistration:()=>pT,isImportMapOverrideDisabled:()=>oq,resetConfigSystem:()=>r$,getFullSynchronizationItems:()=>cl,getExtensionInternalStore:()=>dB,registerGlobalStore:()=>Z,runSynchronization:()=>ce,evaluateAsBoolean:()=>dt,PatientBannerPatientInfo:()=>OE,addRouteMapOverride:()=>ad,getDefaultCalendar:()=>SU,SettingsIcon:()=>yp,DrugOrderIcon:()=>mA,isOnline:()=>dN,ProgramsIcon:()=>yo,useAssignedExtensions:()=>p7,CloseFilledIcon:()=>mC,canAccessStorage:()=>CR,registerDefaultCalendar:()=>SV,TreeViewAltIcon:()=>yS,OverflowMenuVerticalIcon:()=>m7,clearConfigDerivationError:()=>rt,getConfigStore:()=>tY,registerWorkspaceGroup:()=>pk,InformationSquareIcon:()=>mq,EmptyCard:()=>DR,ChevronLeftIcon:()=>mS,RadiologyIcon:()=>yI,useCandidateExtensions:()=>fU,renderToasts:()=>Pf,isDesktop:()=>hp,integrateBreakpoints:()=>hG,RegistrationPictogram:()=>O3,CardHeader:()=>hJ,getExtensionRegistrationFrom:()=>pu,InformationIcon:()=>mz,TrashCanIcon:()=>yE,useShallowStableValue:()=>pQ,useOpenmrsSWR:()=>hb,Assessment1Pictogram:()=>OM,finishRegisteringAllApps:()=>hW,importDynamic:()=>o3,useFhirPagination:()=>he,useVisitContextStore:()=>hA,ArrowUpIcon:()=>mc,showActionableNotification:()=>Oe,getDynamicOfflineDataHandlers:()=>cx,useForceUpdate:()=>f5,updateWorkspaceWindowState:()=>Pj,useVisit:()=>hN,PatientBannerPatientIdentifiers:()=>Ov,WorkspaceNotification:()=>PY,TransferPictogram:()=>O6,usePagination:()=>hv,Breakpoint:()=>hK,PatientBannerToggleContactDetailsButton:()=>Cy,CloseOutlineIcon:()=>mk,ObstetricsPictogram:()=>OZ,parseDateInput:()=>SJ,getConfig:()=>rg,attach:()=>pp,getLocale:()=>St,ActionMenuButton:()=>PU,isUrlWithTemplateParameters:()=>rV,useEmrConfiguration:()=>f0,useLeftNav:()=>hf,ToolsIcon:()=>y_,ErrorState:()=>DA,detach:()=>pf,setCurrentVisit:()=>cX,registerOmrsServiceWorker:()=>aA,ConditionsIcon:()=>yM,SaveIcon:()=>yc,activateOfflineCapability:()=>aG,useWorkspaces:()=>PA,resetWorkspaceStore:()=>PI,useConfig:()=>fG,validator:()=>tF,CalendarIcon:()=>mf,getHistory:()=>oi,StickyNoteAddIcon:()=>yy,useWorkspace2Store:()=>Ci,getPatientName:()=>Ou,getVisitStore:()=>cJ,getCoreTranslation:()=>i8,registerModuleWithConfigSystem:()=>rd,isOfflineUuid:()=>cw,registerModuleLoad:()=>rp,getBreadcrumbs:()=>rY,extractVariableNames:()=>dD,getOfflineSynchronizationStore:()=>u7,translateFrom:()=>i5,EditIcon:()=>mN,useStoreWithActions:()=>p4,getCandidateExtensions:()=>pg,putDynamicOfflineData:()=>cO,shallowEqual:()=>F,subscribeNotificationShown:()=>R,MaximizeIcon:()=>m0,promptForClosingWorkspaces:()=>Cr,WarningIcon:()=>yR,closeAllWorkspaces:()=>PR,fhirBaseUrl:()=>od,matchLocale:()=>CT,registerBreadcrumb:()=>rG,usePatientPhoto:()=>OC,EventsIcon:()=>mI,createGlobalStore:()=>Y,workspaceStore:()=>PC,getCurrentOfflineMode:()=>aH,subscribeToFeatureFlag:()=>dR,useExtensionStore:()=>f2,closeWorkspace:()=>PD,createAttachment:()=>aw,useLeftNavStore:()=>hh,TableIcon:()=>yv,Icon:()=>yF,InformationFilledIcon:()=>mG,getCurrentPageMap:()=>oW,LaboratoryPictogram:()=>OG,temporaryConfigStore:()=>tG,getPromptBeforeClosingFcn:()=>Px,toDateObjectStrict:()=>SI,defineConfigSchema:()=>rc,filterBreadcrumbs:()=>rJ,invalidateImplementerToolsConfig:()=>t9,PatientBannerContactDetails:()=>Cx,getAssignedExtensions:()=>py,PatientPhoto:()=>OT,MaterialOrderIcon:()=>mQ,MicroscopeIcon:()=>m4,scheduleRecomputation:()=>d0,PharmacyPictogram:()=>O0,AttachmentIcon:()=>yN,MoneyIcon:()=>m6,getAttachments:()=>ab,getFullSynchronizationItemsFor:()=>ca,PageHeaderContent:()=>Os,MedicationIcon:()=>m1,PrinterIcon:()=>yn,getWorkspaceGroupStore:()=>P$,PatientListsPictogram:()=>O7,useAppContext:()=>fF,isOpenmrsRoutes:()=>o8,AppointmentsAltPictogram:()=>ON,GenericOrderTypeIcon:()=>mV,batchExtensionUpdates:()=>dX,useExtensionSlotStore:()=>p8,ViewIcon:()=>yT,formattedName:()=>Op,sessionEndpoint:()=>op,duration:()=>S1,resetImportMapOverrides:()=>oJ,TableOfContentsIcon:()=>yb,CaretLeftIcon:()=>mm,getTranslationOverrides:()=>rb,isVersionSatisfied:()=>CI,EmptyCardIllustration:()=>DT,PenIcon:()=>yr,getWorkspaceStore:()=>Pk,registerOfflinePatientHandler:()=>cM,setupImportMapOverrides:()=>o0,showToast:()=>Ph,useDefineAppContext:()=>fM,validators:()=>rK,getGlobalStore:()=>J,useOnClickOutside:()=>hy,getWindowByWorkspaceName:()=>pN,ArrowRightIcon:()=>mu,loadLifeCycles:()=>h$,registerBreadcrumbs:()=>rq,MotherIcon:()=>m5,fetchCurrentPatient:()=>cL,Toast:()=>Pu,MessageQueueIcon:()=>m3,TwoFactorAuthenticationIcon:()=>yD,Pharmacy2Pictogram:()=>O1,goBackInHistory:()=>oo,GroupAccessIcon:()=>mW,getExtensionRenderingsStore:()=>dV,setImplementerToolsConfigRecomputer:()=>t8,getAsyncExtensionLifecycle:()=>fC,setupApiModule:()=>oR,renderLoadingSpinner:()=>CE,WorkspaceContainer:()=>P5,showNotification:()=>D9,queueSynchronizationItem:()=>ci,getModalRegistration:()=>pD,ListCheckedIcon:()=>mJ,ResponsiveWrapper:()=>Pr,GynaecologyPictogram:()=>OH,ShoppingCartIcon:()=>yh,getRouteMapNextPageMap:()=>au,MetadataExportPictogram:()=>OY,updateVisit:()=>c0,backendDependencies:()=>oT,MaybePictogram:()=>Pe,beginEditSynchronizationItem:()=>cd,createParcelMounter:()=>pH,getStartedVisit:()=>c3,omrsOfflineResponseStatusHttpHeaderName:()=>aI,isOpenmrsAppRoutes:()=>o5,openmrsFetch:()=>oh,HomePictogram:()=>O9,DentistryPictogram:()=>OB,ServiceQueuesPictogram:()=>O4,toLanguageTag:()=>E7,launchWorkspace:()=>Pb,setFeatureFlag:()=>dA,useStore:()=>p3,DigitalTrustPictogram:()=>OV,NumericObservation:()=>Oi,attachmentUrl:()=>ay,interpolateString:()=>i7,inRange:()=>rB,useExtensionSlotMeta:()=>f4,AppointmentsPictogram:()=>OA,renderSnackbars:()=>Ps,getRegisteredWorkspace2Names:()=>Ca,toLocationObject:()=>cW,ChartLineIcon:()=>mv,UserHasAccess:()=>hO,evaluateAsBooleanAsync:()=>dr,changeWorkspaceContext:()=>PO,createDashboard:()=>yV,getLocations:()=>cK,getOfflineDb:()=>u6,useExtensionContext:()=>f1,canCloseWorkspaceWithoutPrompting:()=>Pm,getExtensionsConfigStore:()=>tQ,getRouteMapDefaultMap:()=>al,age:()=>Om,syncAllDynamicOfflineData:()=>cj,isOmrsDateStrict:()=>SN,registerWorkspaceGroups2:()=>p$,usePaginationInfo:()=>hw,evaluateAsync:()=>de,useOpenmrsFetchAll:()=>ha,removeImportMapOverride:()=>oZ,showWorkspacePrompts:()=>PN,useVisitTypes:()=>hM,ageAsDuration:()=>Oh,removeDynamicOfflineData:()=>cC,getExtensionNameFromId:()=>pl,deleteSynchronizationItem:()=>cp,renderParcel:()=>pK,useWorkspace2Context:()=>Co,ResetIcon:()=>yu,RenewIcon:()=>ys,subscribeActionableNotificationShown:()=>A,ErrorCard:()=>DN,GenderFemaleIcon:()=>m$,enableImportMapOverride:()=>oX,getOfflinePatientDataStore:()=>cN,retry:()=>C$,ComponentContext:()=>pZ,ExtensionSlot:()=>fr,getOmrsServiceWorker:()=>aN,addImportMapOverride:()=>oY,subscribeConnectivityChanged:()=>b,unsetLeftNav:()=>px,MaybeIcon:()=>yL,useCustomOverflowMenu:()=>h7,PedestrianFamilyIcon:()=>yt,generateOfflineUuid:()=>cv,cancelPrompt:()=>PE,CtScanPictogram:()=>OF,dispatchNotificationShown:()=>C,leftNavStore:()=>pw,OpenmrsFetchError:()=>oy,UserFollowIcon:()=>yP,launchWorkspaceGroup2:()=>P9,ChevronRightIcon:()=>mD,UserXrayIcon:()=>yC,GenderOtherIcon:()=>mF,formatDuration:()=>SZ,toOmrsIsoString:()=>S$,Labs2Pictogram:()=>Oq,workspace2Store:()=>pA,setUserLanguage:()=>o_,useBodyScrollLock:()=>fK,getExtensionConfig:()=>t0,SyringeIcon:()=>yg,LocationPicker:()=>DI,useDebounce:()=>fZ,TimeIcon:()=>yw,getExtensionSlotConfig:()=>tJ,AddIcon:()=>ma,getRouteMapOverrideMap:()=>ac,processConfig:()=>rv,InventoryManagementIcon:()=>mY,registerWorkspaces2:()=>pF,UserIcon:()=>yk,formatPatientName:()=>Od,fireOpenmrsEvent:()=>cB,registerModal:()=>pS,registerTranslationNamespace:()=>rf,displayName:()=>Oc,evaluate:()=>c7,defineExtensionConfigSchema:()=>rh,renderWorkspaceWindowsAndMenu:()=>Ck,getSyncLifecycle:()=>fP,evaluateAsTypeAsync:()=>ds});let y="openmrs:connectivity-changed";function g(e){window.dispatchEvent(new CustomEvent(y,{detail:{online:e}}))}function b(e){if(!window.offlineEnabled)return()=>{};let t=t=>e(t.detail);return window.addEventListener(y,t),()=>window.removeEventListener(y,t)}function v(e){return e({online:!window.offlineEnabled||navigator.onLine}),b(e)}let w="openmrs:precache-static-dependencies";function x(e={}){window.dispatchEvent(new CustomEvent(w,{detail:e}))}function E(e){let t=t=>e(t.detail);return window.addEventListener(w,t),()=>window.removeEventListener(w,t)}let S="openmrs:notification-shown",D="openmrs:actionable-notification-shown",O="openmrs:toast-shown",P="openmrs:snack-bar-shown";function C(e){window.dispatchEvent(new CustomEvent(S,{detail:e}))}function k(e){window.dispatchEvent(new CustomEvent(D,{detail:e}))}function j(e){window.dispatchEvent(new CustomEvent(P,{detail:e}))}function T(e){window.dispatchEvent(new CustomEvent(O,{detail:e}))}function R(e){let t=t=>e(t.detail);return window.addEventListener(S,t),()=>window.removeEventListener(S,t)}function A(e){let t=t=>e(t.detail);return window.addEventListener(D,t),()=>window.removeEventListener(D,t)}function N(e){let t=t=>e(t.detail);return window.addEventListener(O,t),()=>window.removeEventListener(O,t)}function M(e){let t=t=>e(t.detail);return window.addEventListener(P,t),()=>window.removeEventListener(P,t)}function I(e){let t=L(e);setTimeout(()=>{throw t})}function $(){let e=Error();return t=>{let r=L(t);r.stack+=`
2
2
  Async stacktrace:
3
3
  ${e.stack}`,I(t)}}function L(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(r){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())}function F(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 r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}if(Array.isArray(t)||"object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;let r=Object.getOwnPropertyNames(e),n=Object.getOwnPropertyNames(t);return r.length===n.length&&r.every(r=>e[r]===t[r])}function B(e,t){let r;try{r=e()}catch(e){return}return{getItem:e=>{var n;let i=e=>null===e?null:JSON.parse(e,null==t?void 0:t.reviver),o=null!=(n=r.getItem(e))?n:null;return o instanceof Promise?o.then(i):i(o)},setItem:(e,n)=>r.setItem(e,JSON.stringify(n,null==t?void 0:t.replacer)),removeItem:e=>r.removeItem(e)}}window.onerror=function(e){return console.error("Unexpected error: ",e),T({description:e??"Oops! An unexpected error occurred.",kind:"error",title:"Error"}),!1},window.onunhandledrejection=function(e){console.error("Unhandled rejection: ",e.reason),T({description:e.reason??"Oops! An unhandled promise rejection occurred.",kind:"error",title:"Error"})};let V=e=>t=>{try{let r=e(t);if(r instanceof Promise)return r;return{then:e=>V(e)(r),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>V(t)(e)}}},U=e=>{let t,r=new Set,n=(e,n)=>{let i="function"==typeof e?e(t):e;if(!Object.is(i,t)){let e=t;t=(null!=n?n:"object"!=typeof i||null===i)?i:Object.assign({},t,i),r.forEach(r=>r(t,e))}},i=()=>t,o={setState:n,getState:i,getInitialState:()=>a,subscribe:e=>(r.add(e),()=>r.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."),r.clear()}},a=t=e(n,i,o);return o},W=e=>e?U(e):U;function K(){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 H={},z=Symbol.for("openmrs.esm-state.instanceCount"),G=globalThis,q=(G[z]??0)+1;function Y(e,t,r="none"){let n=H[e];if(n)return n.active?K()||console.error(`Attempted to override the existing store ${e}. Make sure that stores are only created once.`):n.value.setState(t,!0),n.active=!0,n.value;{let n=Q(e,t,r);return H[e]={value:n,active:!0},n}}function Z(e,t){let r=H[e];return r?(r.active?K()||console.error(`Attempted to override the existing store ${e}. Make sure that stores are only created once.`):r.value=t,r.active=!0,r.value):(H[e]={value:t,active:!0},t)}function J(e,t,r="none"){let n=H[e];if(!n){let n=Q(e,t??{},r);return H[e]={value:n,active:!1},n}return n.value}function X(...e){let[t,r,n]=e,i=void 0===n?r:n,o=void 0===n?e=>e:r,a=o(t.getState());return i(a),t.subscribe(e=>{let t=o(e);F(a,t)||(a=t,i(t))})}function Q(e,t,r){return"sessionStorage"===r?W()(((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."),(r,n,i)=>{let o,a,s={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},l=!1,u=new Set,c=new Set;try{o=s.getStorage()}catch(e){}if(!o)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),r(...e)},n,i);let d=V(s.serialize),p=()=>{let e,t=d({state:s.partialize({...n()}),version:s.version}).then(e=>o.setItem(s.name,e)).catch(t=>{e=t});if(e)throw e;return t},f=i.setState;i.setState=(e,t)=>{f(e,t),p()};let h=e((...e)=>{r(...e),p()},n,i),m=()=>{var e;if(!o)return;l=!1,u.forEach(e=>e(n()));let t=(null==(e=s.onRehydrateStorage)?void 0:e.call(s,n()))||void 0;return V(o.getItem.bind(o))(s.name).then(e=>{if(e)return s.deserialize(e)}).then(e=>{if(e)if("number"!=typeof e.version||e.version===s.version)return e.state;else{if(s.migrate)return s.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 r(a=s.merge(e,null!=(t=n())?t:h),!0),p()}).then(()=>{null==t||t(a,void 0),l=!0,c.forEach(e=>e(a))}).catch(e=>{null==t||t(void 0,e)})};return i.persist={setOptions:e=>{s={...s,...e},e.getStorage&&(o=e.getStorage())},clearStorage:()=>{null==o||o.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>m(),hasHydrated:()=>l,onHydrate:e=>(u.add(e),()=>{u.delete(e)}),onFinishHydration:e=>(c.add(e),()=>{c.delete(e)})},m(),a||h};return(r,n,i)=>{let o,a={storage:B(()=>localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},s=!1,l=new Set,u=new Set,c=a.storage;if(!c)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),r(...e)},n,i);let d=()=>{let e=a.partialize({...n()});return c.setItem(a.name,{state:e,version:a.version})},p=i.setState;i.setState=(e,t)=>{p(e,t),d()};let f=e((...e)=>{r(...e),d()},n,i);i.getInitialState=()=>f;let h=()=>{var e,t;if(!c)return;s=!1,l.forEach(e=>{var t;return e(null!=(t=n())?t:f)});let i=(null==(t=a.onRehydrateStorage)?void 0:t.call(a,null!=(e=n())?e:f))||void 0;return V(c.getItem.bind(c))(a.name).then(e=>{if(e)if("number"!=typeof e.version||e.version===a.version)return[!1,e.state];else{if(a.migrate)return[!0,a.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[i,s]=e;if(r(o=a.merge(s,null!=(t=n())?t:f),!0),i)return d()}).then(()=>{null==i||i(o,void 0),o=n(),s=!0,u.forEach(e=>e(o))}).catch(e=>{null==i||i(void 0,e)})};return i.persist={setOptions:e=>{a={...a,...e},e.storage&&(c=e.storage)},clearStorage:()=>{null==c||c.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>h(),hasHydrated:()=>s,onHydrate:e=>(l.add(e),()=>{l.delete(e)}),onFinishHydration:e=>(u.add(e),()=>{u.delete(e)})},a.skipHydration||h(),o||f}})(()=>t,{name:e,storage:B(()=>sessionStorage)})):W()(()=>t)}G[z]=q,q>1&&!K()&&console.error(`Detected ${q} copies of @openmrs/esm-framework running on this page. Each copy keeps its own store registry, so stores, configuration and extension state are not shared between them. This usually means a frontend module loaded its own bundled framework instead of the one the app shell provides.`),globalThis.setTimeout?.(()=>{"u">typeof window&&"development"===window.spaEnv&&(window.stores=H)},1e3);let ee=function(e){return void 0===e};var et,er,en,ei,eo,ea,es=r(54),el=r(8348),eu=(0,r(367).A)(Object.getPrototypeOf,Object),ec=r(3098),ed=Object.prototype,ep=Function.prototype.toString,ef=ed.hasOwnProperty,eh=ep.call(Object);let em=function(e){if(!(0,ec.A)(e)||"[object Object]"!=(0,el.A)(e))return!1;var t=eu(e);if(null===t)return!0;var r=ef.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&ep.call(r)==eh};var ey=r(13),eg=r(4171);let eb=function(e,t,r){"__proto__"==t&&eg.A?(0,eg.A)(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r};var ev=r(6984);let ew=function(e,t,r){(void 0===r||(0,ev.A)(e[t],r))&&(void 0!==r||t in e)||eb(e,t,r)};var e_=r(3816),ex=r(1917),eE="object"==typeof exports&&exports&&!exports.nodeType&&exports,eS=eE&&"object"==typeof module&&module&&!module.nodeType&&module,eD=eS&&eS.exports===eE?ex.A.Buffer:void 0,eO=eD?eD.allocUnsafe:void 0;let eP=function(e,t){if(t)return e.slice();var r=e.length,n=eO?eO(r):new e.constructor(r);return e.copy(n),n};var eC=r(3988);let ek=function(e){var t=new e.constructor(e.byteLength);return new eC.A(t).set(new eC.A(e)),t},ej=function(e,t){var r=t?ek(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)},eT=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t};var eR=r(3149),eA=Object.create,eN=function(){function e(){}return function(t){if(!(0,eR.A)(t))return{};if(eA)return eA(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),eM=r(7271);let eI=function(e){return"function"!=typeof e.constructor||(0,eM.A)(e)?{}:eN(eu(e))};var e$=r(18),eL=r(2049),eF=r(8446),eB=r(5254),eV=r(9610),eU=r(9415);let eW=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};var eK=Object.prototype.hasOwnProperty;let eH=function(e,t,r){var n=e[t];eK.call(e,t)&&(0,ev.A)(n,r)&&(void 0!==r||t in e)||eb(e,t,r)},ez=function(e,t,r,n){var i=!r;r||(r={});for(var o=-1,a=t.length;++o<a;){var s=t[o],l=n?n(r[s],e[s],s,r,e):void 0;void 0===l&&(l=e[s]),i?eb(r,s,l):eH(r,s,l)}return r};var eG=r(1463);let eq=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t};var eY=Object.prototype.hasOwnProperty;let eZ=function(e){if(!(0,eR.A)(e))return eq(e);var t=(0,eM.A)(e),r=[];for(var n in e)"constructor"==n&&(t||!eY.call(e,n))||r.push(n);return r},eJ=function(e){return(0,eF.A)(e)?(0,eG.A)(e,!0):eZ(e)},eX=function(e,t,r,n,i,o,a){var s=eW(e,r),l=eW(t,r),u=a.get(l);if(u)return void ew(e,r,u);var c=o?o(s,l,r+"",e,t,a):void 0,d=void 0===c;if(d){var p=(0,eL.A)(l),f=!p&&(0,eB.A)(l),h=!p&&!f&&(0,eU.A)(l);(c=l,p||f||h)?(0,eL.A)(s)?c=s:(0,ec.A)(s)&&(0,eF.A)(s)?c=eT(s):f?(d=!1,c=eP(l,!0)):h?(d=!1,c=ej(l,!0)):c=[]:em(l)||(0,e$.A)(l)?(c=s,(0,e$.A)(s))?c=ez(s,eJ(s)):(!(0,eR.A)(s)||(0,eV.A)(s))&&(c=eI(l)):d=!1}d&&(a.set(l,c),i(c,l,n,o,a),a.delete(l)),ew(e,r,c)},eQ=function e(t,r,n,i,o){t!==r&&(0,e_.A)(r,function(a,s){if(o||(o=new ey.A),(0,eR.A)(a))eX(t,r,s,n,e,i,o);else{var l=i?i(eW(t,s),a,s+"",t,r,o):void 0;void 0===l&&(l=a),ew(t,s,l)}},eJ)};var e0=r(4326),e1=r(6832);let e3=function(e){return(0,e0.A)(function(t,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&(0,e1.A)(r[0],r[1],a)&&(o=i<3?void 0:o,i=1),t=Object(t);++n<i;){var s=r[n];s&&e(t,s,n,o)}return t})};var e4=e3(function(e,t,r,n){eQ(e,t,r,n)}),e2=r(2085);let e6=function(e,t){return(0,e2.A)(e,t)};var e5=r(5572);let e8=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e};var e9=r(7422),e7=r(4247),te=r(6912),tt=r(3153),tr=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)(0,te.A)(t,(0,e7.A)(e)),e=eu(e);return t}:tt.A,tn=r(9042),ti=r(3831);let to=function(e){return(0,ti.A)(e,eJ,tr)};var ta=r(7672),ts=Object.prototype.hasOwnProperty;let tl=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&ts.call(e,"index")&&(r.index=e.index,r.input=e.input),r},tu=function(e,t){var r=t?ek(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)};var tc=/\w*$/;let td=function(e){var t=new e.constructor(e.source,tc.exec(e));return t.lastIndex=e.lastIndex,t};var tp=r(241),tf=tp.A?tp.A.prototype:void 0,th=tf?tf.valueOf:void 0;let tm=function(e,t,r){var n=e.constructor;switch(t){case"[object ArrayBuffer]":return ek(e);case"[object Boolean]":case"[object Date]":return new n(+e);case"[object DataView]":return tu(e,r);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 ej(e,r);case"[object Map]":case"[object Set]":return new n;case"[object Number]":case"[object String]":return new n(e);case"[object RegExp]":return td(e);case"[object Symbol]":return th?Object(th.call(e)):{}}};var ty=r(2789),tg=r(4841),tb=tg.A&&tg.A.isMap,tv=tb?(0,ty.A)(tb):function(e){return(0,ec.A)(e)&&"[object Map]"==(0,ta.A)(e)},tw=tg.A&&tg.A.isSet,t_=tw?(0,ty.A)(tw):function(e){return(0,ec.A)(e)&&"[object Set]"==(0,ta.A)(e)},tx="[object Arguments]",tE="[object Function]",tS="[object Object]",tD={};tD[tx]=tD["[object Array]"]=tD["[object ArrayBuffer]"]=tD["[object DataView]"]=tD["[object Boolean]"]=tD["[object Date]"]=tD["[object Float32Array]"]=tD["[object Float64Array]"]=tD["[object Int8Array]"]=tD["[object Int16Array]"]=tD["[object Int32Array]"]=tD["[object Map]"]=tD["[object Number]"]=tD[tS]=tD["[object RegExp]"]=tD["[object Set]"]=tD["[object String]"]=tD["[object Symbol]"]=tD["[object Uint8Array]"]=tD["[object Uint8ClampedArray]"]=tD["[object Uint16Array]"]=tD["[object Uint32Array]"]=!0,tD["[object Error]"]=tD[tE]=tD["[object WeakMap]"]=!1;let tO=function e(t,r,n,i,o,a){var s,l=1&r,u=2&r,c=4&r;if(n&&(s=o?n(t,i,o,a):n(t)),void 0!==s)return s;if(!(0,eR.A)(t))return t;var d=(0,eL.A)(t);if(d){if(s=tl(t),!l)return eT(t,s)}else{var p,f,h,m,y=(0,ta.A)(t),g=y==tE||"[object GeneratorFunction]"==y;if((0,eB.A)(t))return eP(t,l);if(y==tS||y==tx||g&&!o){if(s=u||g?{}:eI(t),!l)return u?(f=(p=s)&&ez(t,eJ(t),p),ez(t,tr(t),f)):(m=(h=s)&&ez(t,(0,e9.A)(t),h),ez(t,(0,e7.A)(t),m))}else{if(!tD[y])return o?t:{};s=tm(t,y,l)}}a||(a=new ey.A);var b=a.get(t);if(b)return b;a.set(t,s),t_(t)?t.forEach(function(i){s.add(e(i,r,n,i,t,a))}):tv(t)&&t.forEach(function(i,o){s.set(o,e(i,r,n,o,t,a))});var v=c?u?to:tn.A:u?eJ:e9.A,w=d?void 0:v(t);return e8(w||t,function(i,o){w&&(i=t[o=i]),eH(s,o,e(i,r,n,o,t,a))}),s};var tP=r(4548);let tC=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0};var tk=r(6318);let tj=function(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(i);++n<i;)o[n]=e[n+t];return o};var tT=r(901);let tR=function(e,t){var r,n;return t=(0,tP.A)(t,e),r=e,null==(e=(n=t).length<2?r:(0,tk.A)(r,tj(n,0,-1)))||delete e[(0,tT.A)(tC(t))]},tA=function(e){return em(e)?void 0:e};var tN=r(8716),tM=r(3310),tI=r(9546),t$=(et=function(e,t){var r={};if(null==e)return r;var n=!1;t=(0,e5.A)(t,function(t){return t=(0,tP.A)(t,e),n||(n=t.length>1),t}),ez(e,to(e),r),n&&(r=tO(r,7,tA));for(var i=t.length;i--;)tR(r,t[i]);return r},(0,tI.A)((0,tM.A)(et,void 0,function(e){return(null==e?0:e.length)?(0,tN.A)(e,1):[]}),et+"")),tL=((er={}).Array="Array",er.Boolean="Boolean",er.ConceptUuid="ConceptUuid",er.Number="Number",er.Object="Object",er.String="String",er.UUID="UUID",er.PersonAttributeTypeUuid="PersonAttributeTypeUuid",er.PatientIdentifierTypeUuid="PatientIdentifierTypeUuid",er);function tF(e,t){return r=>{if(!e(r))if("function"==typeof t)return t(r);else return t}}let tB=tF(e=>Array.isArray(e),"must be an array"),tV=tF(e=>"boolean"==typeof e,"must be a boolean"),tU=tF(e=>"number"==typeof e,"must be a number"),tW=tF(e=>"string"==typeof e,"must be a string"),tK=tF(e=>"object"==typeof e&&!Array.isArray(e)&&null!==e,"must be an object (not an array or null)"),tH=tF(e=>/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)||/^[0-9a-f]{36}$/i.test(e),"must be a valid UUID or a 36-character hexadecimal string"),tz=Y("config-internal",{providedConfigs:[],schemas:{},moduleLoaded:{}}),tG=Y("temporary-config",{config:function(){try{return JSON.parse(localStorage.getItem("openmrs:temporaryConfig")||"{}")}catch(e){return{}}}()});tG.subscribe(e=>{var t=e.config;try{localStorage.setItem("openmrs:temporaryConfig",JSON.stringify(t))}catch(e){}});let tq=Y("config-store-of-extension-state",{mountedExtensions:[]});function tY(e){return J(`config-module-${e}`,{config:null,loaded:!1,translationOverridesLoaded:!1})}function tZ(){return J("config-extension-slots",{slots:{}})}function tJ(e){return tX(tZ().getState(),e)}function tX(e,t){return e.slots[t]??{loaded:!1,config:{}}}function tQ(){return J("config-extensions",{configs:{}})}function t0(e,t){if("string"!=typeof e||"string"!=typeof t||"__proto__"===e||"__proto__"===t||"constructor"===e||"constructor"===t||"prototype"===e||"prototype"===t)throw Error("Attempted to call `getExtensionConfig()` with invalid argument");let r=tQ(),n=r=>r.configs[e]?.[t];return{getInitialState:()=>n(r.getInitialState()),getState:()=>n(r.getState())??{loaded:!1,config:null},subscribe:e=>r.subscribe((t,r)=>{let i=n(t),o=n(r);F(i,o)||e(i,o)})}}function t1(e,t,r){return e.configs[t]?.[r]??{loaded:!1,config:null}}function t3(e,t,r){return e.configure?.[r]??null}let t4=W()(()=>({config:{}})),t2=0,t6=!0,t5=!1;function t8(e){n=e}function t9(){t6=!0,t2>0&&t7()}function t7(){if(t6&&n&&!t5){t5=!0,t6=!1;try{n()}catch(e){t6=!0,re(e),console.error("Failed to derive the implementer tools config",e)}finally{t5=!1}}}function re(e){t4.setState({derivationError:e instanceof Error?e.message:String(e)})}function rt(){t4.getState().derivationError&&t4.setState({derivationError:void 0})}let rr=Z("config-implementer-tools",{...t4,getState:()=>(0===t2&&t7(),t4.getState()),setState:(...e)=>(t6=!1,t4.setState(...e)),subscribe(e){t2++,t7();let t=t4.subscribe(e),r=!1;return()=>{!r&&(r=!0,t2--),t()}}});function rn(e,t){if(Array.isArray(t))return t}function ri(e,t){return e4({},e,t,rn)}let ro=[];function ra(){let e=tz.getState(),t=tG.getState(),r=tq.getState();!function(e,t){for(let r of Object.keys(e.schemas)){let n,i=tY(r),o=e.schemas[r],a=!!e.moduleLoaded[r],s=ru.get(r);if(s&&s.schema===o&&s.moduleLoaded===a&&s.providedConfigs===e.providedConfigs&&s.temporaryConfig===t.config)n=s.state;else{let i=a?function(e,t,r){let n=t.schemas[e],i=rD(e,rE(t,r));rP(n,i,e);let o=rT(n,i);return rC(n,o,e),delete o.extensionSlots,o}(r,e,t):function(e,t,r){let n=rT(rF,rD(e,rE(t,r)));return rC(rF,n,e),delete n.extensionSlots,n}(r,e,t);n={translationOverridesLoaded:!0,loaded:a,config:i},ru.set(r,{schema:o,moduleLoaded:a,providedConfigs:e.providedConfigs,temporaryConfig:t.config,state:n})}let l=i.getState();l.loaded===n.loaded&&l.translationOverridesLoaded===n.translationOverridesLoaded&&e6(l.config,n.config)||i.setState(n)}}(e,t);let n=function(e,t){let r=rO(rE(e,t)),n=Object.keys(r).reduce((e,t)=>(r[t]?.extensionSlots&&(e[t]=r[t]?.extensionSlots),e),{});var i=n;for(let[e,t]of Object.entries(i))for(let[r,n]of Object.entries(t))!function(e,t,r){let n=`${t}.extensionSlots.${r}`,i=`Extension slot config '${n}'`,o=Object.keys(e).filter(e=>!["add","remove","order","configure"].includes(e));o.length&&rM(n,i+`' contains invalid keys '${o.join("', '")}'`),!e.add||Array.isArray(e.add)&&e.add.every(e=>"string"==typeof e)||rM(n,i+".add' is invalid. Must be an array of strings (extension IDs)"),!e.remove||Array.isArray(e.remove)&&e.remove.every(e=>"string"==typeof e)||rM(n,i+".remove' is invalid. Must be an array of strings (extension IDs)"),!e.order||Array.isArray(e.order)&&e.order.every(e=>"string"==typeof e)||rM(n,i+".order' is invalid. Must be an array of strings (extension IDs)"),e.configure&&!rA(e.configure)&&rM(n,i+".configure' is invalid. Must be an object with extension IDs for keys")}(n,e,r);let o={},a={};for(let e of Object.values(n))for(let[t,r]of Object.entries(e))o[t]=r,r.configure&&(a[t]??(a[t]=[])).push(r.configure);for(let[e,t]of Object.entries(a)){let r=1===t.length?t[0]:rO(t);o[e].configure!==r&&(o[e]={...o[e],configure:r})}return o}(e,t);(function(e){let t=tZ(),r=t.getState().slots,n={},i=!1;for(let[t,o]of Object.entries(e)){let e=r[t];e?.loaded&&e6(e.config,o)?n[t]=e:(n[t]={loaded:!0,config:o},i=!0)}(i||Object.keys(r).length!==Object.keys(n).length)&&t.setState({slots:n})})(n),function(e,t,r,n){let i=tQ(),o=i.getState().configs,a={},s=!1,l=0;for(let i of t.mountedExtensions){let t=function(e,t,r,n,i,o,a){let s=function(e){let[t]=e.split("#");return t}(n),l=i.schemas[s],u=JSON.stringify([r,n,e,t]),c=rw.get(u);if(c&&c.extensionSchema===l&&c.extensionModuleSchema===i.schemas[t]&&c.providedConfigs===i.providedConfigs&&c.temporaryConfig===o.config)return c.config;let d=l?s:t,p=rE(i,o),f=a?.configure?.[n]??{},h=rD(e,p),m=h?.extensionSlots?.[r]?.configure?.[n]??{},y=rO([rD(d,p),f,m]),g=l??i.schemas[t];rP(g,y,d);let b=rT(g,y);return rC(g,b,d),delete b.extensionSlots,rw.set(u,{extensionSchema:l,extensionModuleSchema:i.schemas[t],providedConfigs:i.providedConfigs,temporaryConfig:o.config,config:b}),b}(i.slotModuleName,i.extensionModuleName,i.slotName,i.extensionId,e,r,n[i.slotName]),u=o[i.slotName]?.[i.extensionId],c=u?.loaded&&e6(u.config,t)?u:{config:t,loaded:!0};c!==u&&(s=!0),a[i.slotName]||(a[i.slotName]={}),a[i.slotName][i.extensionId]=c,l++}for(let[e,t]of Object.entries(a)){let r=o[e];r&&Object.keys(r).length===Object.keys(t).length&&Object.entries(t).every(([e,t])=>r[e]===t)&&(a[e]=r)}s||(s=Object.keys(o).length!==Object.keys(a).length||Object.values(o).reduce((e,t)=>e+Object.keys(t).length,0)!==l),s&&i.setState({configs:a})}(e,r,t,n),t9()}function rs(){n=()=>{var e,t;let r,n;return e=tz.getState(),t=tG.getState(),r=rr.getState(),n={config:function(e,t){let r=function(e){let t={};for(let[r,n]of Object.entries(e)){let e=rx.get(r);if(e&&e.schema===n)t[r]=e.annotated;else{let e=function e(t){return t.hasOwnProperty("_default")?{...t,_value:t._default,_source:"default"}:rA(t)?Object.keys(t).reduce((r,n)=>(r[n]=e(t[n]),r),{}):{}}(tO(n,5));rx.set(r,{schema:n,annotated:e}),t[r]=e}}return t}(e.schemas),n=[...e.providedConfigs.map(e=>[e.config,e.source]),[t.config,"temporary config"]],i=new Set(Object.keys(r));for(let[e]of n)for(let t of Object.keys(e))i.add(t);let o={};for(let e of i){let t=r[e],i=n.map(([t])=>t[e]),a=n.map(([,e])=>e),s=r_.get(e);if(s&&s.annotatedSchema===t&&s.configSlices.length===i.length&&s.configSlices.every((e,t)=>e===i[t])&&s.sources.every((e,t)=>e===a[t])){o[e]=s.result;continue}let l=t??{};n.forEach(([,e],t)=>{let r=i[t];void 0!==r&&(l=ri(l,function e(t,r){return rA(t)?Object.keys(t).reduce((n,i)=>(n[i]=e(t[i],r),n),{}):{_value:t,_source:r}}(r,e)))}),r_.set(e,{annotatedSchema:t,configSlices:i,sources:a,result:l}),o[e]=l}return o}(e,t)},void(e6(r.config,n.config)||rr.setState(n))},ra(),ro.push(tz.subscribe(rl),tG.subscribe(rl),tq.subscribe(rl))}function rl(){rt();try{ra()}catch(e){re(e),console.error("Failed to recompute the configuration",e)}}rs();let ru=new Map;function rc(e,t){rS(e,t);let r=ri(t,rF);tz.setState(t=>({...t,schemas:{...t.schemas,[e]:r},moduleLoaded:{...t.moduleLoaded,[e]:!0}}))}function rd(e){tz.setState(t=>({...t,schemas:{...t.schemas,[e]:rF}}))}function rp(e){tz.setState(t=>({...t,moduleLoaded:{...t.moduleLoaded,[e]:!0}}))}function rf(e){tz.setState(t=>({...t,schemas:{...t.schemas,[e]:rL}}))}function rh(e,t){rS(e,t);let r=ri(t,rF);tz.getState().schemas[e]&&console.error(`Config schema for extension ${e} already exists. If there are multiple extensions with this same name, one will probably crash.`),tz.setState(t=>({...t,schemas:{...t.schemas,[e]:r}}))}function rm(e,t="provided"){tz.setState(r=>({...r,providedConfigs:[...r.providedConfigs,{source:t,config:e}]}))}function ry(e,t,r){return new Promise(n=>{let i,o=!1;function a(e){!o&&t(e)&&(o=!0,n(r(e)),i?.())}a(e.getState()),o||(i=e.subscribe(a))})}function rg(e){return ry(tY(e),e=>!!(e.loaded&&e.config),e=>t$(e.config,["Display conditions","Translation overrides"]))}function rb(e,t,r){let n=[ry(tY(e),e=>!!(e.translationOverridesLoaded&&e.config),e=>e.config["Translation overrides"]??{})];return t&&r&&n.push(ry(t0(t,r),e=>!!(e.loaded&&e.config),e=>e.config["Translation overrides"]??{})),Promise.all(n)}function rv(e,t,r){rP(e,t,r);let n=rT(e,t);return rC(e,n,r),n}let rw=new Map,r_=new Map,rx=new Map;function rE(e,t){return[...e.providedConfigs.map(e=>e.config),t.config]}function rS(e,t,r=""){let n="Please verify that you are running the latest version and, if so, alert the maintainer.";for(let i of Object.keys(t).filter(e=>!e.startsWith("_"))){let o=r+(r&&".")+i,a=t[i];if("Display conditions"===o&&console.error(`${e} declares a configuration option called "Display conditions"; the "Display conditions" option is a reserved name. ${n}`),"Translation overrides"===o&&console.error(`${e} declares a configuration option called "Translation overrides"; the "Translation overrides" option is a reserved name. ${n}`),!rA(a)){console.error(`${e} has bad config schema definition for key '${o}'. ${n}`);continue}a.hasOwnProperty("_default")||rS(e,a,o);let s=a._elements;if(rR(s)&&rS(e,s,o+"._elements"),a._validators)for(let t of a._validators)"function"!=typeof t&&console.error(`${e} has invalid validator for key '${o}' ${n}.
4
4
 
@@ -9,11 +9,11 @@ If you're the maintainer: the allowed types are ${Object.values(tL).join(", ")}.
9
9
  If you're the maintainer: all config elements must have a default. Received ${JSON.stringify(a)}`),s&&l&&![tL.Array,tL.Object].includes(l)&&console.error(`${e} has bad config schema definition for key '${o}'. ${n}.
10
10
 
11
11
  If you're the maintainer: the 'elements' key only works with '_type' equal to 'Array' or 'Object'. Received ${JSON.stringify(l)}`)}}function rD(e,t){return rO(t.map(({[e]:t})=>t).filter(e=>!!e))}function rO(e){return e.reduce((e,t)=>e4(e,t,rn),{})}function rP(e,t,r=""){for(let n of Object.keys(t)){let i=t[n],o=r+"."+n,a=e[n];if(!e.hasOwnProperty(n)){("extensionSlots"!==n||""===r)&&rM(o,`Unknown config key '${o}' provided. Ignoring.`);continue}(function e(t,r,n){rk(n,t._type,r),rA(r)?t._type===tL.Object?function(t,r,n){if(t._elements)for(let i of Object.keys(r)){let o=r[i];e(t._elements,o,`${n}.${i}`)}}(t,r,n):t.hasOwnProperty("_default")||t.hasOwnProperty("_type")||rP(t,r,n):t._type===tL.Array&&function(t,r,n){if(rk(n,tL.Array,r)){if(rR(t._elements))for(let i=0;i<r.length;i++)e(t._elements,r[i],`${n}[${i}]`);for(let e=0;e<r.length;e++)rk(`${n}[${e}]`,t._elements?._type,r[e])}}(t,r,n)})(a,i,o)}}function rC(e,t,r=""){if(e){if(t!==e._default&&rj(r,e._validators,t),rA(t))for(let n of Object.keys(t)){let i=t[n],o=r+"."+n,a=e[n];e._type===tL.Object&&e._elements?rC(e._elements,i,o):rC(a,i,o)}else if(Array.isArray(t)&&e._elements)for(let n=0;n<t.length;n++)rC(e._elements,t[n],`${r}[${n}]`)}}function rk(e,t,r){return!t||rj(e,[{Array:tB,Boolean:tV,ConceptUuid:tH,Number:tU,Object:tK,String:tW,UUID:tH,PersonAttributeTypeUuid:tH,PatientIdentifierTypeUuid:tH}[t]],r)}function rj(e,t,r){let n=!0;if(t)try{for(let i of t){let t=i(r);if("string"==typeof t){let i="object"==typeof r?`Invalid configuration for ${e}: ${t}`:`Invalid configuration value ${r} for ${e}: ${t}`;rM(e,i),n=!1}}}catch(t){console.error(`Skipping invalid validator at "${e}". Encountered error
12
- ${t}`)}return n}let rT=(e,t)=>{let r=structuredClone(t);if(!e)return r;for(let t of Object.keys(e)){let n=r[t],i=e[t];if(i&&(i.hasOwnProperty("_type")||i.hasOwnProperty("_default"))){r.hasOwnProperty(t)||(r[t]=i._default);let e=i._elements;if(n&&rR(e)){if(i._type===tL.Array&&Array.isArray(n)){let i=n.map(t=>rT(e,t));r[t]=i}else if(i._type===tL.Object)for(let t of Object.keys(n))n[t]=rT(e,n[t])}}else if(rA(i)){let e=n??{};rA(e)&&(r[t]=rT(i,e))}}return r};function rR(e){return!!e&&Object.keys(e).filter(e=>!["_default","_validators"].includes(e)).length>0}function rA(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}let rN=new Set;function rM(e,t){let r=`${e}:::${t}`;rN||(rN=new Set),rN.has(r)||(console.error(t),rN.add(r))}function rI(e){e?rN.forEach(t=>{t.startsWith(e)&&rN.delete(t)}):rN.clear()}function r$(){ro.forEach(e=>e()),ro.length=0,ru.clear(),rw.clear(),rx.clear(),r_.clear(),rs()}let rL={"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:tL.Object,_default:{},_validators:[tF(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(", ")}.`})]}},rF={"Display conditions":{privileges:{_description:"The privilege(s) the user must have to use this extension",_type:tL.Array,_default:[]},expression:{_description:"The expression that determines whether the extension is displayed",_type:tL.String,_default:void 0}},...rL},rB=(e,t)=>tF(r=>e<=r&&r<=t,`must be between ${e} and ${t}`),rV=e=>{let t=e.concat(["openmrsBase","openmrsSpaBase"]);return tF(e=>{if(!e||"string"!=typeof e)return!1;let r=/\${(.*?)}/g,n=r.exec(e);for(;n;){if(!t.includes(n[1]))return!1;n=r.exec(e)}return!0},"Should be a URL or path. The allowed template parameters are "+t.map(e=>"${"+e+"}").join(", "))},rU=rV([]),rW=e=>tF(t=>e.includes(t),`Must be one of the following: '${e.join("', '")}'.`),rK={inRange:rB,isUrl:rU,isUrlWithTemplateParameters:rV,oneOf:rW};var rH=r(8067);let rz=Y("breadcrumbs",[]);function rG(e){return rq([e])}function rq(e){let t=[...rY(),...e.map(e=>({matcher:e.matcher instanceof RegExp?e.matcher:"string"==typeof e.matcher?(0,rH.pathToRegexp)(e.matcher).regexp:(0,rH.pathToRegexp)(e.path).regexp,settings:e}))];rz.setState(t,!0)}function rY(){return rz.getState()}function rZ(e,t){if(t)return function(e,t){let[r]=e.filter(e=>e.matcher.test(t));return r}(e,t)||function(e,t){let r=t.split("/");for(;r.length>1;){r.pop();let t=rZ(e,r.join("/"));if(t)return t}}(e,t)}function rJ(e,t){if(e.length>0){let r=rZ(e,t);if(r){let t=[r],n=rZ(e,r.settings.parent);for(;void 0!==n;)t.push(n),n=rZ(e,n.settings.parent);return t.reverse()}}return[]}function rX(e){return rJ(rY(),e)}var rQ=Object.freeze({__proto__:null,get start(){return im},get ensureJQuerySupport(){return nX},get setBootstrapMaxTime(){return nA},get setMountMaxTime(){return nN},get setUnmountMaxTime(){return nM},get setUnloadMaxTime(){return nI},get registerApplication(){return n7},get unregisterApplication(){return it},get getMountedApps(){return n6},get getAppStatus(){return n8},get unloadApplication(){return ir},get checkActivityFunctions(){return ie},get getAppNames(){return n5},get pathToActiveWhen(){return ia},get navigateToUrl(){return nW},get patchHistoryApi(){return nY},get triggerAppChange(){return ic},get addErrorHandler(){return r2},get removeErrorHandler(){return r6},get mountRootParcel(){return nC},get NOT_LOADED(){return r9},get LOADING_SOURCE_CODE(){return r7},get NOT_BOOTSTRAPPED(){return ne},get BOOTSTRAPPING(){return nt},get NOT_MOUNTED(){return nr},get MOUNTING(){return nn},get UPDATING(){return no},get LOAD_ERROR(){return nl},get MOUNTED(){return ni},get UNLOADING(){return ns},get UNMOUNTING(){return na},get SKIP_BECAUSE_BROKEN(){return nu}}),r0=("u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof global?global:"u">typeof self?self:{}).CustomEvent,r1=!function(){try{var e=new r0("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 r=document.createEvent("CustomEvent");return t?r.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):r.initCustomEvent(e,!1,!1,void 0),r}:function(e,t){var r=document.createEventObject();return r.type=e,t?(r.bubbles=!!t.bubbles,r.cancelable=!!t.cancelable,r.detail=t.detail):(r.bubbles=!1,r.cancelable=!1,r.detail=void 0),r}:r0;let r3=[];function r4(e,t,r){let n=r8(e,t,r);r3.length?r3.forEach(e=>e(n)):setTimeout(()=>{throw n})}function r2(e){if("function"!=typeof e)throw Error(r5(28,!1));r3.push(e)}function r6(e){if("function"!=typeof e)throw Error(r5(29,!1));let t=!1;return r3=r3.filter(r=>{let n=r===e;return t=t||n,!n}),t}function r5(e,t,...r){return`single-spa minified message #${e}: ${t?t+" ":""}See https://single-spa.js.org/error/?code=${e}${r.length?`&arg=${r.join("&arg=")}`:""}`}function r8(e,t,r){let n,i=`${nh(t)} '${np(t)}' died in status ${t.status}: `;if(e instanceof Error){try{e.message=i+e.message}catch(e){}n=e}else{console.warn(r5(30,!1,t.status,np(t)));try{n=Error(i+JSON.stringify(e))}catch(t){n=e}}return n.appOrParcelName=np(t),t.status=r,n}let r9="NOT_LOADED",r7="LOADING_SOURCE_CODE",ne="NOT_BOOTSTRAPPED",nt="BOOTSTRAPPING",nr="NOT_MOUNTED",nn="MOUNTING",ni="MOUNTED",no="UPDATING",na="UNMOUNTING",ns="UNLOADING",nl="LOAD_ERROR",nu="SKIP_BECAUSE_BROKEN";function nc(e){return e.status===ni}function nd(e){try{return e.activeWhen(window.location)}catch(t){return r4(t,e,nu),!1}}function np(e){return e.name}function nf(e){return!!e.unmountThisParcel}function nh(e){return nf(e)?"parcel":"application"}function nm(){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 ny(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return e[r];return null}function ng(e){return e&&("function"==typeof e||Array.isArray(e)&&!ny(e,e=>"function"!=typeof e))}function nb(e,t){let r=e[t]||[];0===(r=Array.isArray(r)?r:[r]).length&&(r=[()=>Promise.resolve()]);let n=nh(e),i=np(e);return function(e){return r.reduce((r,o,a)=>r.then(()=>{let r=o(e);return nv(r)?r:Promise.reject(r5(15,!1,n,i,t,a))}),Promise.resolve())}}function nv(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch}let nw=[];function n_(e,t){return Promise.resolve().then(()=>e.status!==ne?e:(e.status=nt,e.bootstrap?n$(e,"bootstrap").then(r).catch(r=>{if(t)throw r8(r,e,nu);return r4(r,e,nu),e}):Promise.resolve().then(r)));function r(){return e.status=nr,e}}function nx(e,t){return Promise.resolve().then(()=>{if(e.status!==ni)return e;return e.status=na,Promise.all(Object.keys(e.parcels).map(t=>e.parcels[t].unmountThisParcel())).then(r,n=>r().then(()=>{let r=Error(n.message);if(t)throw r8(r,e,nu);r4(r,e,nu)})).then(()=>e);function r(){return n$(e,"unmount").then(()=>{e.status=nr},r=>{if(t)throw r8(r,e,nu);r4(r,e,nu)})}})}let nE=!1,nS=!1;function nD(e,t){return Promise.resolve().then(()=>e.status!==nr?e:(nE||(window.dispatchEvent(new r1("single-spa:before-first-mount")),nE=!0),e.status=nn,n$(e,"mount").then(()=>(e.status=ni,nS||(window.dispatchEvent(new r1("single-spa:first-mount")),nS=!0),e)).catch(r=>{return e.status=ni,nx(e,!0).then(n,n);function n(){if(t)throw r8(r,e,nu);return r4(r,e,nu),e}})))}let nO=0,nP={parcels:{}};function nC(){return nk.apply(nP,arguments)}function nk(e,t){let r,n,i,o=this;if(!e||"object"!=typeof e&&"function"!=typeof e)throw Error(r5(2,!1));if(e.name&&"string"!=typeof e.name)throw Error(r5(3,!1,typeof e.name));let a=nO++,s=e.name||`parcel-${a}`;if("object"!=typeof t)throw Error(r5(4,!1,s,typeof t));if(!t.domElement)throw Error(r5(5,!1,s));let l="function"==typeof e,u=l?e:()=>Promise.resolve(e),c={id:a,parcels:{},status:l?r7:ne,customProps:t,parentName:np(o),unmountThisParcel:()=>f.then(()=>{if(c.status!==ni)throw Error(r5(6,!1,s,c.status));return nx(c,!0)}).then(e=>(c.parentName&&delete o.parcels[c.id],e)).then(e=>(n(e),e)).catch(e=>{throw c.status=nu,i(e),e})};o.parcels[a]=c;let d=u();if(!d||"function"!=typeof d.then)throw Error(r5(7,!1));let p=(d=d.then(e=>{if(!e)throw Error(r5(8,!1));if(s=e.name||`parcel-${a}`,Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!ng(e.bootstrap))throw Error(r5(9,!1,s));if(!ng(e.mount))throw Error(r5(10,!1,s));if(!ng(e.unmount))throw Error(r5(11,!1,s));if(e.update&&!ng(e.update))throw Error(r5(12,!1,s));let t=nb(e,"bootstrap"),n=nb(e,"mount"),i=nb(e,"unmount");c.status=ne,c.name=s,c.bootstrap=t,c.mount=n,c.unmount=i,c.timeouts=nL(e.timeouts),e.update&&(c.update=nb(e,"update"),r.update=function(e){return c.customProps=e,nj(Promise.resolve().then(()=>{if(c.status!==ni)throw Error(r5(32,!1,np(c)));return c.status=no,n$(c,"update").then(()=>(c.status=ni,c)).catch(e=>{throw r8(e,c,nu)})}))})})).then(()=>n_(c,!0)),f=p.then(()=>nD(c,!0)),h=new Promise((e,t)=>{n=e,i=t});return r={mount:()=>nj(Promise.resolve().then(()=>{if(c.status!==nr)throw Error(r5(13,!1,s,c.status));return o.parcels[a]=c,nD(c)})),unmount:()=>nj(c.unmountThisParcel()),getStatus:()=>c.status,loadPromise:nj(d),bootstrapPromise:nj(p),mountPromise:nj(f),unmountPromise:nj(h)}}function nj(e){return e.then(()=>null)}function nT(e){let t=np(e),r="function"==typeof e.customProps?e.customProps(t,window.location):e.customProps;("object"!=typeof r||null===r||Array.isArray(r))&&(r={},console.warn(r5(40,!1),t,r));let n=nm({},r,{name:t,mountParcel:nk.bind(e),singleSpa:rQ});return nf(e)&&(n.unmountSelf=e.unmountThisParcel),n}let nR={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 nA(e,t,r){if("number"!=typeof e||e<=0)throw Error(r5(16,!1));nR.bootstrap={millis:e,dieOnTimeout:t,warningMillis:r||1e3}}function nN(e,t,r){if("number"!=typeof e||e<=0)throw Error(r5(17,!1));nR.mount={millis:e,dieOnTimeout:t,warningMillis:r||1e3}}function nM(e,t,r){if("number"!=typeof e||e<=0)throw Error(r5(18,!1));nR.unmount={millis:e,dieOnTimeout:t,warningMillis:r||1e3}}function nI(e,t,r){if("number"!=typeof e||e<=0)throw Error(r5(19,!1));nR.unload={millis:e,dieOnTimeout:t,warningMillis:r||1e3}}function n$(e,t){let r=e.timeouts[t],n=r.warningMillis,i=nh(e);return new Promise((o,a)=>{let s=!1,l=!1;e[t](nT(e)).then(e=>{s=!0,o(e)}).catch(e=>{s=!0,a(e)}),setTimeout(()=>c(1),n),setTimeout(()=>c(!0),r.millis);let u=r5(31,!1,t,i,np(e),r.millis);function c(e){s||(!0===e?(l=!0,r.dieOnTimeout?a(Error(u)):console.error(u)):!l&&(console.warn(u),e*n+n<r.millis&&setTimeout(()=>c(e+1),n)))}})}function nL(e){let t={};for(let r in nR)t[r]=nm({},nR[r],e&&e[r]||{});return t}function nF(e){return Promise.resolve().then(()=>{let t,r;return e.loadPromise?e.loadPromise:e.status!==r9&&e.status!==nl?e:(e.status=r7,e.loadPromise=Promise.resolve().then(()=>{let n=e.loadApp(nT(e));if(!nv(n))throw r=!0,Error(r5(33,!1,np(e)));return n.then(r=>{let n;e.loadErrorTime=null,"object"!=typeof(t=r)&&(n=34),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!ng(t.bootstrap)&&(n=35),ng(t.mount)||(n=36),ng(t.unmount)||(n=37);let i=nh(t);if(n){let r;try{r=JSON.stringify(t)}catch(e){}return console.error(r5(n,!1,i,np(e),r),t),r4(void 0,e,nu),e}return t.devtools&&t.devtools.overlays&&(e.devtools.overlays=nm({},e.devtools.overlays,t.devtools.overlays)),e.status=ne,e.bootstrap=nb(t,"bootstrap"),e.mount=nb(t,"mount"),e.unmount=nb(t,"unmount"),e.unload=nb(t,"unload"),e.timeouts=nL(t.timeouts),delete e.loadPromise,e})}).catch(t=>{let n;return delete e.loadPromise,r?n=nu:(n=nl,e.loadErrorTime=(new Date).getTime()),r4(t,e,n),e}))})}let nB="u">typeof window,nV={hashchange:[],popstate:[]},nU=["hashchange","popstate"];function nW(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(r5(14,!1));t=e.currentTarget.href,e.preventDefault()}let r=nZ(window.location.href),n=nZ(t);0===t.indexOf("#")?window.location.hash=n.hash:r.host!==n.host&&n.host?window.location.href=t:n.pathname===r.pathname&&n.search===r.search?window.location.hash=n.hash:window.history.pushState(null,null,t)}function nK(e){if(e){let t=e[0].type;nU.indexOf(t)>=0&&nV[t].forEach(t=>{try{t.apply(this,e)}catch(e){setTimeout(()=>{throw e})}})}}function nH(){id([],arguments)}function nz(e,t){return function(){let r=window.location.href,n=e.apply(this,arguments),o=window.location.href;return i&&r===o||window.dispatchEvent(function(e,t){let r;try{r=new PopStateEvent("popstate",{state:e})}catch(t){(r=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,e)}return r.singleSpa=!0,r.singleSpaTrigger=t,r}(window.history.state,t)),n}}let nG=null,nq=!1;function nY(e){if(nq)throw Error(r5(43,!1));i=!e||!e.hasOwnProperty("urlRerouteOnly")||e.urlRerouteOnly,nq=!0,nG=window.history.replaceState,window.addEventListener("hashchange",nH),window.addEventListener("popstate",nH);let t=window.addEventListener,r=window.removeEventListener;window.addEventListener=function(e,r){if(!("function"==typeof r&&nU.indexOf(e)>=0)||ny(nV[e],e=>e===r))return t.apply(this,arguments);nV[e].push(r)},window.removeEventListener=function(e,t){return"function"==typeof t&&nU.indexOf(e)>=0&&(nV[e]=nV[e].filter(e=>e!==t)),r.apply(this,arguments)},window.history.pushState=nz(window.history.pushState,"pushState"),window.history.replaceState=nz(nG,"replaceState")}function nZ(e){let t=document.createElement("a");return t.href=e,t}nB&&(window.singleSpaNavigate?console.warn(r5(41,!1)):window.singleSpaNavigate=nW);let nJ=!1;function nX(e=window.jQuery){if(e||window.$&&window.$.fn&&window.$.fn.jquery&&(e=window.$),e&&!nJ){let t=e.fn.on,r=e.fn.off;e.fn.on=function(e,r){return nQ.call(this,t,window.addEventListener,e,r,arguments)},e.fn.off=function(e,t){return nQ.call(this,r,window.removeEventListener,e,t,arguments)},nJ=!0}}function nQ(e,t,r,n,i){return"string"!=typeof r?e.apply(this,i):(r.split(/\s+/).forEach(e=>{nU.indexOf(e)>=0&&(t(e,n),r=r.replace(e,""))}),""===r.trim()?this:e.apply(this,i))}let n0={};function n1(e){return Promise.resolve().then(()=>{let t=n0[np(e)];if(!t)return e;if(e.status===r9)return n3(e,t),e;if(e.status===ns)return t.promise.then(()=>e);if(e.status!==nr&&e.status!==nl)return e;let r=e.status===nl?Promise.resolve():n$(e,"unload");return e.status=ns,r.then(()=>(n3(e,t),e)).catch(r=>(delete n0[np(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,r4(r,e,nu),t.reject(r),e))})}function n3(e,t){delete n0[np(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,e.status=r9,t.resolve()}function n4(e,t,r,n){n0[np(e)]={app:e,resolve:r,reject:n},Object.defineProperty(n0[np(e)],"promise",{get:t})}let n2=[];function n6(){return n2.filter(nc).map(np)}function n5(){return n2.map(np)}function n8(e){let t=ny(n2,t=>np(t)===e);return t?t.status:null}let n9=!1;function n7(e,t,r,n){var i,o;let a,s,l=(a={name:null,loadApp:null,activeWhen:null,customProps:null},"object"==typeof e?(function(e){if(Array.isArray(e)||null===e)throw Error(r5(39,!1));let t=["name","app","activeWhen","customProps"],r=Object.keys(e).reduce((e,r)=>t.indexOf(r)>=0?e:e.concat(r),[]);if(0!==r.length)throw Error(r5(38,!1,t.join(", "),r.join(", ")));if("string"!=typeof e.name||0===e.name.length||"object"!=typeof e.app&&"function"!=typeof e.app)throw Error(r5(20,!1));let n=e=>"string"==typeof e||"function"==typeof e;if(!(n(e.activeWhen)||Array.isArray(e.activeWhen)&&e.activeWhen.every(n)))throw Error(r5(24,!1));if(!io(e.customProps))throw Error(r5(22,!1))}(e),a.name=e.name,a.loadApp=e.app,a.activeWhen=e.activeWhen,a.customProps=e.customProps):(function(e,t,r,n){if("string"!=typeof e||0===e.length)throw Error(r5(20,!1));if(!t)throw Error(r5(23,!1));if("function"!=typeof r)throw Error(r5(24,!1));if(!io(n))throw Error(r5(22,!1))}(e,t,r,n),a.name=e,a.loadApp=t,a.activeWhen=r,a.customProps=n),a.loadApp="function"!=typeof(i=a.loadApp)?()=>Promise.resolve(i):i,a.customProps=a.customProps||{},s=(s=Array.isArray(o=a.activeWhen)?o:[o]).map(e=>"function"==typeof e?e:ia(e)),a.activeWhen=e=>s.some(t=>t(e)),a);if(ih||n9||(n9=!0,setTimeout(()=>{ih||console.warn(r5(1,!1))},5e3)),-1!==n5().indexOf(l.name))throw Error(r5(21,!1,l.name));n2.push(nm({loadErrorTime:null,status:r9,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},l)),nB&&(nX(),id())}function ie(e=window.location){return n2.filter(t=>t.activeWhen(e)).map(np)}function it(e){if(0===n2.filter(t=>np(t)===e).length)throw Error(r5(25,!1,e));return(nB?ir(e,{waitForUnmount:!1}):Promise.resolve()).then(()=>{let t=n2.map(np).indexOf(e);n2.splice(t,1)})}function ir(e,t={waitForUnmount:!1}){if("string"!=typeof e)throw Error(r5(26,!1));let r=ny(n2,t=>np(t)===e);if(!r)throw Error(r5(27,!1,e));let n=n0[np(r)];if(t&&t.waitForUnmount){if(n)return n.promise;{let e=new Promise((t,n)=>{n4(r,()=>e,t,n)});return e}}{let e;return n?(e=n.promise,ii(r,n.resolve,n.reject)):e=new Promise((t,n)=>{n4(r,()=>e,t,n),ii(r,t,n)}),e}}function ii(e,t,r){Promise.resolve().then(()=>{if(ny(ie(),t=>t===np(e)))return ic()}).then(()=>nx(e).then(n1).then(()=>{t(),setTimeout(()=>{id()})})).catch(r)}function io(e){return!e||"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)}function ia(e,t){let r=function(e,t){let r=0,n=!1,i="^";"/"!==e[0]&&(e="/"+e);for(let t=0;t<e.length;t++){let r=e[t],i=n&&"/"===r;(!n&&":"===r||i)&&o(t)}return o(e.length),RegExp(i,"i");function o(o){let a=e.slice(r,o).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(i+=n?"[^/]+/?":a,o===e.length)if(n)t&&(i+="$");else{let e=t?"":".*";i="/"===i.charAt(i.length-1)?`${i}${e}$`:`${i}(/${e})?(#.*)?$`}n=!n,r=o}}(e,t);return e=>{let t=e.origin;t||(t=`${e.protocol}//${e.host}`);let n=e.href.replace(t,"").replace(e.search,"").split("?")[0];return r.test(n)}}let is=!1,il=[],iu=nB&&window.location.href;function ic(){return id()}function id(e=[],t,r=!1){let n,i,o,a,s;if(is)return new Promise((e,r)=>{il.push({resolve:e,reject:r,eventArguments:t})});let{appsToUnload:l,appsToUnmount:u,appsToLoad:c,appsToMount:d}=(n=[],i=[],o=[],a=[],s=(new Date).getTime(),n2.forEach(e=>{let t=e.status!==nu&&nd(e);switch(e.status){case nl:t&&s-e.loadErrorTime>=200&&o.push(e);break;case r9:case r7:t&&o.push(e);break;case ne:case nr:!t&&n0[np(e)]?n.push(e):t&&a.push(e);break;case ni:t||i.push(e)}}),{appsToUnload:n,appsToUnmount:i,appsToLoad:o,appsToMount:a}),p,f=[],h=iu,m=iu=window.location.href;return ih?(is=!0,p=l.concat(c,u,d),Promise.resolve().then(()=>(w(0===p.length?"before-no-app-change":"before-app-change",v(!0)),w("before-routing-event",v(!0,{cancelNavigation:y})),Promise.all(f).then(r=>{if(r.some(e=>e))return nG.call(window.history,history.state,"",h.substring(location.origin.length)),iu=location.href,is=!1,id(e,t,!0);let n=l.map(n1),i=Promise.all(u.map(nx).map(e=>e.then(n1)).concat(n));i.then(()=>{w("before-mount-routing-event",v(!0))},e=>{throw e});let o=c.map(e=>nF(e).then(e=>ip(e,i))),a=d.filter(e=>0>c.indexOf(e)).map(e=>ip(e,i));return i.catch(e=>{throw b(),e}).then(()=>(b(),Promise.all(o.concat(a)).catch(t=>{throw e.forEach(e=>e.reject(t)),t}).then(g).then(()=>{},e=>{throw e})))})))):(p=c,Promise.resolve().then(()=>Promise.all(c.map(nF)).then(b).then(()=>[]).catch(e=>{throw b(),e}).finally(()=>{})));function y(e=!0){let t="function"==typeof(null==e?void 0:e.then)?e:Promise.resolve(e);f.push(t.catch(e=>(console.warn(Error(r5(42,!1))),console.warn(e),!1)))}function g(){let t=n6();e.forEach(e=>e.resolve(t));try{w(0===p.length?"no-app-change":"app-change",v()),w("routing-event",v())}catch(e){setTimeout(()=>{throw e})}if(is=!1,il.length>0){let e=il;il=[],id(e)}return t}function b(){r||(e.forEach(e=>{nK(e.eventArguments)}),nK(t))}function v(e=!1,r){let n={},i={[ni]:[],[nr]:[],[r9]:[],[nu]:[]};e?(c.concat(d).forEach((e,t)=>{a(e,ni)}),l.forEach(e=>{a(e,r9)}),u.forEach(e=>{a(e,nr)})):p.forEach(e=>{a(e)});let o={detail:{newAppStatuses:n,appsByNewStatus:i,totalAppChanges:p.length,originalEvent:null==t?void 0:t[0],oldUrl:h,newUrl:m}};return r&&nm(o.detail,r),o;function a(e,t){let r=np(e);t=t||n8(r),n[r]=t,(i[t]=i[t]||[]).push(r)}}function w(e,t){r||window.dispatchEvent(new r1(`single-spa:${e}`,t))}}function ip(e,t){return nd(e)?n_(e).then(e=>t.then(()=>nd(e)?nD(e):e)):t.then(()=>e)}let ih=!1;function im(e){ih=!0,nB&&(nY(e),id())}function iy(e,t){let r=window.getOpenmrsSpaBase().replace(/\/$/,"");return ig(e,{openmrsBase:window.openmrsBase,openmrsSpaBase:r,...t}).replace(/^\/\//,"/")}function ig(e,t){return Object.keys(t).reduce((e,r)=>e.split("${"+r+"}").join(t[r]),e)}function ib({to:e,templateParams:t}){let r=window.getOpenmrsSpaBase().replace(/\/$/,""),n=iy(e,t).replace(window.location.origin,"");n.startsWith(r)?nW(n):window.location.assign(n)}nB&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods={getRawAppData:function(){return[...n2]},reroute:id,NOT_LOADED:r9,toLoadPromise:nF,toBootstrapPromise:n_,unregisterApplication:it,getProfilerData:function(){return nw}});let iv="openmrs:history";function iw(e){let t=JSON.parse(sessionStorage.getItem(iv)??"[]")||[];t.push(e),t.length>50&&(t=t.slice(-50)),sessionStorage.setItem(iv,JSON.stringify(t))}function i_(){0===JSON.parse(sessionStorage.getItem(iv)??"[]").length&&document.referrer&&iw(document.referrer),window.addEventListener("single-spa:routing-event",e=>{let t=ix();e.detail.originalEvent?.singleSpaTrigger=="replaceState"?(t[t.length-1]=window.location.href,sessionStorage.setItem(iv,JSON.stringify(t))):!e.detail.originalEvent?.singleSpa&&t.includes(window.location.href)?iE({toUrl:window.location.href}):t[t.length-1]!==window.location.href&&iw(window.location.href)})}function ix(){return JSON.parse(sessionStorage.getItem(iv)??"[]")}function iE({toUrl:e}){let t=ix(),r=t.lastIndexOf(e);if(-1!=r){let e=t.slice(0,r+1);ib({to:t[r]}),sessionStorage.setItem(iv,JSON.stringify(e))}else throw Error(`URL ${e} not found in history; cannot go back to it.`)}function iS(){sessionStorage.removeItem(iv)}let iD="${openmrsSpaBase}/login",iO={redirectAuthFailure:{enabled:{_type:tL.Boolean,_default:!0,_description:"Whether to redirect logged-out users to `redirectAuthFailure.url`"},url:{_type:tL.String,_default:iD,_validators:[rK.isUrl],_description:"The url to which users will be redirected when they are logged out. If set to blank, the `location` header from the response will be used."},errors:{_type:tL.Array,_default:[401],_elements:{_type:tL.Number,_validators:[rK.inRange(100,600)]},_description:"The HTTP error codes for which users will be redirected"},resolvePromise:{_type:tL.Boolean,_default:!1,_description:"Changes how requests that fail authentication are handled. Try messing with this if redirects to the login page aren't working correctly."}},followRedirects:{_type:tL.Boolean,_default:!0,_description:"Whether openmrsFetch should support redirects returned from the backend"}};function iP(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let iC="/ws/rest/v1",ik="/ws/fhir2/R4",ij=`${iC}/session`;function iT(e){return e&&e.startsWith("http")?e:("/"!==e[0]&&(e="/"+e),window.openmrsBase+e)}function iR(e,t={}){if("string"!=typeof e)throw Error("The first argument to @openmrs/api's openmrsFetch function must be a url string");if("object"!=typeof t)throw Error("The second argument to @openmrs/api's openmrsFetch function must be a plain object.");if(!window.openmrsBase)throw Error("@openmrs/api is running in a browser that doesn't have window.openmrsBase, which is provided by openmrs-module-spa's HTML file.");let r=iT(e);if(t.headers||(t.headers={}),em(t.body)&&(t.body=JSON.stringify(t.body)),void 0===t.headers.Accept&&(t.headers.Accept="application/json"),null===t.headers.Accept&&delete t.headers.Accept,e.startsWith(iC)&&void 0===t.headers["Disable-WWW-Authenticate"]&&(t.headers["Disable-WWW-Authenticate"]="true"),e.startsWith(ik)){let e=new URL(r,window.location.toString());e.searchParams.has("_summary")||(e.searchParams.set("_summary","data"),r=e.toString())}let n=Error();return window.fetch(r,t).then(async e=>{let{redirectAuthFailure:t,followRedirects:i}=await rg("@openmrs/esm-api");if(e.ok){let t=e.headers.get("location");return(i&&t&&(r===iT(ij)||204===e.status)&&ib({to:t}),204===e.status)?(e.data=null,e):e.clone().text().then(t=>{try{t&&(e.data=JSON.parse(t))}catch(e){}return e})}return r===iT(ij)&&403===e.status||t.enabled&&t.errors.includes(e.status)?(iS(),ib({to:t.url||e.headers.get("location")||iD}),t.resolvePromise?Promise.resolve():new Promise(()=>{})):e.clone().text().then(t=>{let i=t;try{i=JSON.parse(t)}catch(e){}throw new iN(r,e,i,n)},t=>{throw new iN(r,e,null,n)})})}function iA(e,t={}){if("object"!=typeof t)throw Error("The second argument to openmrsObservableFetch must be either omitted or an object");let r=new AbortController;return t.signal=r.signal,new es.Observable(n=>{let i=!1;return iR(e,t).then(e=>{i=!0,n.next(e),n.complete()},e=>{i=!0,n.error(e)}),()=>{i||r.abort()}})}class iN extends Error{constructor(e,t,r,n){super(),iP(this,"response",void 0),iP(this,"responseBody",void 0),this.message=`Server responded with ${t.status} (${t.statusText}) for url ${e}. Check err.responseBody or network tab in dev tools for more info`,n.message=this.message,this.responseBody=r,this.response=t,this.stack=`Stacktrace for outgoing request:
12
+ ${t}`)}return n}let rT=(e,t)=>{let r=structuredClone(t);if(!e)return r;for(let t of Object.keys(e)){let n=r[t],i=e[t];if(i&&(i.hasOwnProperty("_type")||i.hasOwnProperty("_default"))){r.hasOwnProperty(t)||(r[t]=i._default);let e=i._elements;if(n&&rR(e)){if(i._type===tL.Array&&Array.isArray(n)){let i=n.map(t=>rT(e,t));r[t]=i}else if(i._type===tL.Object)for(let t of Object.keys(n))n[t]=rT(e,n[t])}}else if(rA(i)){let e=n??{};rA(e)&&(r[t]=rT(i,e))}}return r};function rR(e){return!!e&&Object.keys(e).filter(e=>!["_default","_validators"].includes(e)).length>0}function rA(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}let rN=new Set;function rM(e,t){let r=`${e}:::${t}`;rN||(rN=new Set),rN.has(r)||(console.error(t),rN.add(r))}function rI(e){e?rN.forEach(t=>{t.startsWith(e)&&rN.delete(t)}):rN.clear()}function r$(){ro.forEach(e=>e()),ro.length=0,ru.clear(),rw.clear(),rx.clear(),r_.clear(),rs()}let rL={"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:tL.Object,_default:{},_validators:[tF(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(", ")}.`})]}},rF={"Display conditions":{privileges:{_description:"The privilege(s) the user must have to use this extension",_type:tL.Array,_default:[]},expression:{_description:"The expression that determines whether the extension is displayed",_type:tL.String,_default:void 0}},...rL},rB=(e,t)=>tF(r=>e<=r&&r<=t,`must be between ${e} and ${t}`),rV=e=>{let t=e.concat(["openmrsBase","openmrsSpaBase"]);return tF(e=>{if(!e||"string"!=typeof e)return!1;let r=/\${(.*?)}/g,n=r.exec(e);for(;n;){if(!t.includes(n[1]))return!1;n=r.exec(e)}return!0},"Should be a URL or path. The allowed template parameters are "+t.map(e=>"${"+e+"}").join(", "))},rU=rV([]),rW=e=>tF(t=>e.includes(t),`Must be one of the following: '${e.join("', '")}'.`),rK={inRange:rB,isUrl:rU,isUrlWithTemplateParameters:rV,oneOf:rW};var rH=r(8067);let rz=Y("breadcrumbs",[]);function rG(e){return rq([e])}function rq(e){let t=[...rY(),...e.map(e=>({matcher:e.matcher instanceof RegExp?e.matcher:"string"==typeof e.matcher?(0,rH.pathToRegexp)(e.matcher).regexp:(0,rH.pathToRegexp)(e.path).regexp,settings:e}))];rz.setState(t,!0)}function rY(){return rz.getState()}function rZ(e,t){if(t)return function(e,t){let[r]=e.filter(e=>e.matcher.test(t));return r}(e,t)||function(e,t){let r=t.split("/");for(;r.length>1;){r.pop();let t=rZ(e,r.join("/"));if(t)return t}}(e,t)}function rJ(e,t){if(e.length>0){let r=rZ(e,t);if(r){let t=[r],n=rZ(e,r.settings.parent);for(;void 0!==n;)t.push(n),n=rZ(e,n.settings.parent);return t.reverse()}}return[]}function rX(e){return rJ(rY(),e)}var rQ=Object.freeze({__proto__:null,get start(){return im},get ensureJQuerySupport(){return nX},get setBootstrapMaxTime(){return nA},get setMountMaxTime(){return nN},get setUnmountMaxTime(){return nM},get setUnloadMaxTime(){return nI},get registerApplication(){return n7},get unregisterApplication(){return it},get getMountedApps(){return n6},get getAppStatus(){return n8},get unloadApplication(){return ir},get checkActivityFunctions(){return ie},get getAppNames(){return n5},get pathToActiveWhen(){return ia},get navigateToUrl(){return nW},get patchHistoryApi(){return nY},get triggerAppChange(){return ic},get addErrorHandler(){return r2},get removeErrorHandler(){return r6},get mountRootParcel(){return nC},get NOT_LOADED(){return r9},get LOADING_SOURCE_CODE(){return r7},get NOT_BOOTSTRAPPED(){return ne},get BOOTSTRAPPING(){return nt},get NOT_MOUNTED(){return nr},get MOUNTING(){return nn},get UPDATING(){return no},get LOAD_ERROR(){return nl},get MOUNTED(){return ni},get UNLOADING(){return ns},get UNMOUNTING(){return na},get SKIP_BECAUSE_BROKEN(){return nu}}),r0=("u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof global?global:"u">typeof self?self:{}).CustomEvent,r1=!function(){try{var e=new r0("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 r=document.createEvent("CustomEvent");return t?r.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):r.initCustomEvent(e,!1,!1,void 0),r}:function(e,t){var r=document.createEventObject();return r.type=e,t?(r.bubbles=!!t.bubbles,r.cancelable=!!t.cancelable,r.detail=t.detail):(r.bubbles=!1,r.cancelable=!1,r.detail=void 0),r}:r0;let r3=[];function r4(e,t,r){let n=r8(e,t,r);r3.length?r3.forEach(e=>e(n)):setTimeout(()=>{throw n})}function r2(e){if("function"!=typeof e)throw Error(r5(28,!1));r3.push(e)}function r6(e){if("function"!=typeof e)throw Error(r5(29,!1));let t=!1;return r3=r3.filter(r=>{let n=r===e;return t=t||n,!n}),t}function r5(e,t,...r){return`single-spa minified message #${e}: ${t?t+" ":""}See https://single-spa.js.org/error/?code=${e}${r.length?`&arg=${r.join("&arg=")}`:""}`}function r8(e,t,r){let n,i=`${nh(t)} '${np(t)}' died in status ${t.status}: `;if(e instanceof Error){try{e.message=i+e.message}catch(e){}n=e}else{console.warn(r5(30,!1,t.status,np(t)));try{n=Error(i+JSON.stringify(e))}catch(t){n=e}}return n.appOrParcelName=np(t),t.status=r,n}let r9="NOT_LOADED",r7="LOADING_SOURCE_CODE",ne="NOT_BOOTSTRAPPED",nt="BOOTSTRAPPING",nr="NOT_MOUNTED",nn="MOUNTING",ni="MOUNTED",no="UPDATING",na="UNMOUNTING",ns="UNLOADING",nl="LOAD_ERROR",nu="SKIP_BECAUSE_BROKEN";function nc(e){return e.status===ni}function nd(e){try{return e.activeWhen(window.location)}catch(t){return r4(t,e,nu),!1}}function np(e){return e.name}function nf(e){return!!e.unmountThisParcel}function nh(e){return nf(e)?"parcel":"application"}function nm(){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 ny(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return e[r];return null}function ng(e){return e&&("function"==typeof e||Array.isArray(e)&&!ny(e,e=>"function"!=typeof e))}function nb(e,t){let r=e[t]||[];0===(r=Array.isArray(r)?r:[r]).length&&(r=[()=>Promise.resolve()]);let n=nh(e),i=np(e);return function(e){return r.reduce((r,o,a)=>r.then(()=>{let r=o(e);return nv(r)?r:Promise.reject(r5(15,!1,n,i,t,a))}),Promise.resolve())}}function nv(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch}let nw=[];function n_(e,t){return Promise.resolve().then(()=>e.status!==ne?e:(e.status=nt,e.bootstrap?n$(e,"bootstrap").then(r).catch(r=>{if(t)throw r8(r,e,nu);return r4(r,e,nu),e}):Promise.resolve().then(r)));function r(){return e.status=nr,e}}function nx(e,t){return Promise.resolve().then(()=>{if(e.status!==ni)return e;return e.status=na,Promise.all(Object.keys(e.parcels).map(t=>e.parcels[t].unmountThisParcel())).then(r,n=>r().then(()=>{let r=Error(n.message);if(t)throw r8(r,e,nu);r4(r,e,nu)})).then(()=>e);function r(){return n$(e,"unmount").then(()=>{e.status=nr},r=>{if(t)throw r8(r,e,nu);r4(r,e,nu)})}})}let nE=!1,nS=!1;function nD(e,t){return Promise.resolve().then(()=>e.status!==nr?e:(nE||(window.dispatchEvent(new r1("single-spa:before-first-mount")),nE=!0),e.status=nn,n$(e,"mount").then(()=>(e.status=ni,nS||(window.dispatchEvent(new r1("single-spa:first-mount")),nS=!0),e)).catch(r=>{return e.status=ni,nx(e,!0).then(n,n);function n(){if(t)throw r8(r,e,nu);return r4(r,e,nu),e}})))}let nO=0,nP={parcels:{}};function nC(){return nk.apply(nP,arguments)}function nk(e,t){let r,n,i,o=this;if(!e||"object"!=typeof e&&"function"!=typeof e)throw Error(r5(2,!1));if(e.name&&"string"!=typeof e.name)throw Error(r5(3,!1,typeof e.name));let a=nO++,s=e.name||`parcel-${a}`;if("object"!=typeof t)throw Error(r5(4,!1,s,typeof t));if(!t.domElement)throw Error(r5(5,!1,s));let l="function"==typeof e,u=l?e:()=>Promise.resolve(e),c={id:a,parcels:{},status:l?r7:ne,customProps:t,parentName:np(o),unmountThisParcel:()=>f.then(()=>{if(c.status!==ni)throw Error(r5(6,!1,s,c.status));return nx(c,!0)}).then(e=>(c.parentName&&delete o.parcels[c.id],e)).then(e=>(n(e),e)).catch(e=>{throw c.status=nu,i(e),e})};o.parcels[a]=c;let d=u();if(!d||"function"!=typeof d.then)throw Error(r5(7,!1));let p=(d=d.then(e=>{if(!e)throw Error(r5(8,!1));if(s=e.name||`parcel-${a}`,Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!ng(e.bootstrap))throw Error(r5(9,!1,s));if(!ng(e.mount))throw Error(r5(10,!1,s));if(!ng(e.unmount))throw Error(r5(11,!1,s));if(e.update&&!ng(e.update))throw Error(r5(12,!1,s));let t=nb(e,"bootstrap"),n=nb(e,"mount"),i=nb(e,"unmount");c.status=ne,c.name=s,c.bootstrap=t,c.mount=n,c.unmount=i,c.timeouts=nL(e.timeouts),e.update&&(c.update=nb(e,"update"),r.update=function(e){return c.customProps=e,nj(Promise.resolve().then(()=>{if(c.status!==ni)throw Error(r5(32,!1,np(c)));return c.status=no,n$(c,"update").then(()=>(c.status=ni,c)).catch(e=>{throw r8(e,c,nu)})}))})})).then(()=>n_(c,!0)),f=p.then(()=>nD(c,!0)),h=new Promise((e,t)=>{n=e,i=t});return r={mount:()=>nj(Promise.resolve().then(()=>{if(c.status!==nr)throw Error(r5(13,!1,s,c.status));return o.parcels[a]=c,nD(c)})),unmount:()=>nj(c.unmountThisParcel()),getStatus:()=>c.status,loadPromise:nj(d),bootstrapPromise:nj(p),mountPromise:nj(f),unmountPromise:nj(h)}}function nj(e){return e.then(()=>null)}function nT(e){let t=np(e),r="function"==typeof e.customProps?e.customProps(t,window.location):e.customProps;("object"!=typeof r||null===r||Array.isArray(r))&&(r={},console.warn(r5(40,!1),t,r));let n=nm({},r,{name:t,mountParcel:nk.bind(e),singleSpa:rQ});return nf(e)&&(n.unmountSelf=e.unmountThisParcel),n}let nR={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 nA(e,t,r){if("number"!=typeof e||e<=0)throw Error(r5(16,!1));nR.bootstrap={millis:e,dieOnTimeout:t,warningMillis:r||1e3}}function nN(e,t,r){if("number"!=typeof e||e<=0)throw Error(r5(17,!1));nR.mount={millis:e,dieOnTimeout:t,warningMillis:r||1e3}}function nM(e,t,r){if("number"!=typeof e||e<=0)throw Error(r5(18,!1));nR.unmount={millis:e,dieOnTimeout:t,warningMillis:r||1e3}}function nI(e,t,r){if("number"!=typeof e||e<=0)throw Error(r5(19,!1));nR.unload={millis:e,dieOnTimeout:t,warningMillis:r||1e3}}function n$(e,t){let r=e.timeouts[t],n=r.warningMillis,i=nh(e);return new Promise((o,a)=>{let s=!1,l=!1;e[t](nT(e)).then(e=>{s=!0,o(e)}).catch(e=>{s=!0,a(e)}),setTimeout(()=>c(1),n),setTimeout(()=>c(!0),r.millis);let u=r5(31,!1,t,i,np(e),r.millis);function c(e){s||(!0===e?(l=!0,r.dieOnTimeout?a(Error(u)):console.error(u)):!l&&(console.warn(u),e*n+n<r.millis&&setTimeout(()=>c(e+1),n)))}})}function nL(e){let t={};for(let r in nR)t[r]=nm({},nR[r],e&&e[r]||{});return t}function nF(e){return Promise.resolve().then(()=>{let t,r;return e.loadPromise?e.loadPromise:e.status!==r9&&e.status!==nl?e:(e.status=r7,e.loadPromise=Promise.resolve().then(()=>{let n=e.loadApp(nT(e));if(!nv(n))throw r=!0,Error(r5(33,!1,np(e)));return n.then(r=>{let n;e.loadErrorTime=null,"object"!=typeof(t=r)&&(n=34),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!ng(t.bootstrap)&&(n=35),ng(t.mount)||(n=36),ng(t.unmount)||(n=37);let i=nh(t);if(n){let r;try{r=JSON.stringify(t)}catch(e){}return console.error(r5(n,!1,i,np(e),r),t),r4(void 0,e,nu),e}return t.devtools&&t.devtools.overlays&&(e.devtools.overlays=nm({},e.devtools.overlays,t.devtools.overlays)),e.status=ne,e.bootstrap=nb(t,"bootstrap"),e.mount=nb(t,"mount"),e.unmount=nb(t,"unmount"),e.unload=nb(t,"unload"),e.timeouts=nL(t.timeouts),delete e.loadPromise,e})}).catch(t=>{let n;return delete e.loadPromise,r?n=nu:(n=nl,e.loadErrorTime=(new Date).getTime()),r4(t,e,n),e}))})}let nB="u">typeof window,nV={hashchange:[],popstate:[]},nU=["hashchange","popstate"];function nW(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(r5(14,!1));t=e.currentTarget.href,e.preventDefault()}let r=nZ(window.location.href),n=nZ(t);0===t.indexOf("#")?window.location.hash=n.hash:r.host!==n.host&&n.host?window.location.href=t:n.pathname===r.pathname&&n.search===r.search?window.location.hash=n.hash:window.history.pushState(null,null,t)}function nK(e){if(e){let t=e[0].type;nU.indexOf(t)>=0&&nV[t].forEach(t=>{try{t.apply(this,e)}catch(e){setTimeout(()=>{throw e})}})}}function nH(){id([],arguments)}function nz(e,t){return function(){let r=window.location.href,n=e.apply(this,arguments),o=window.location.href;return i&&r===o||window.dispatchEvent(function(e,t){let r;try{r=new PopStateEvent("popstate",{state:e})}catch(t){(r=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,e)}return r.singleSpa=!0,r.singleSpaTrigger=t,r}(window.history.state,t)),n}}let nG=null,nq=!1;function nY(e){if(nq)throw Error(r5(43,!1));i=!e||!e.hasOwnProperty("urlRerouteOnly")||e.urlRerouteOnly,nq=!0,nG=window.history.replaceState,window.addEventListener("hashchange",nH),window.addEventListener("popstate",nH);let t=window.addEventListener,r=window.removeEventListener;window.addEventListener=function(e,r){if(!("function"==typeof r&&nU.indexOf(e)>=0)||ny(nV[e],e=>e===r))return t.apply(this,arguments);nV[e].push(r)},window.removeEventListener=function(e,t){return"function"==typeof t&&nU.indexOf(e)>=0&&(nV[e]=nV[e].filter(e=>e!==t)),r.apply(this,arguments)},window.history.pushState=nz(window.history.pushState,"pushState"),window.history.replaceState=nz(nG,"replaceState")}function nZ(e){let t=document.createElement("a");return t.href=e,t}nB&&(window.singleSpaNavigate?console.warn(r5(41,!1)):window.singleSpaNavigate=nW);let nJ=!1;function nX(e=window.jQuery){if(e||window.$&&window.$.fn&&window.$.fn.jquery&&(e=window.$),e&&!nJ){let t=e.fn.on,r=e.fn.off;e.fn.on=function(e,r){return nQ.call(this,t,window.addEventListener,e,r,arguments)},e.fn.off=function(e,t){return nQ.call(this,r,window.removeEventListener,e,t,arguments)},nJ=!0}}function nQ(e,t,r,n,i){return"string"!=typeof r?e.apply(this,i):(r.split(/\s+/).forEach(e=>{nU.indexOf(e)>=0&&(t(e,n),r=r.replace(e,""))}),""===r.trim()?this:e.apply(this,i))}let n0={};function n1(e){return Promise.resolve().then(()=>{let t=n0[np(e)];if(!t)return e;if(e.status===r9)return n3(e,t),e;if(e.status===ns)return t.promise.then(()=>e);if(e.status!==nr&&e.status!==nl)return e;let r=e.status===nl?Promise.resolve():n$(e,"unload");return e.status=ns,r.then(()=>(n3(e,t),e)).catch(r=>(delete n0[np(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,r4(r,e,nu),t.reject(r),e))})}function n3(e,t){delete n0[np(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,e.status=r9,t.resolve()}function n4(e,t,r,n){n0[np(e)]={app:e,resolve:r,reject:n},Object.defineProperty(n0[np(e)],"promise",{get:t})}let n2=[];function n6(){return n2.filter(nc).map(np)}function n5(){return n2.map(np)}function n8(e){let t=ny(n2,t=>np(t)===e);return t?t.status:null}let n9=!1;function n7(e,t,r,n){var i,o;let a,s,l=(a={name:null,loadApp:null,activeWhen:null,customProps:null},"object"==typeof e?(function(e){if(Array.isArray(e)||null===e)throw Error(r5(39,!1));let t=["name","app","activeWhen","customProps"],r=Object.keys(e).reduce((e,r)=>t.indexOf(r)>=0?e:e.concat(r),[]);if(0!==r.length)throw Error(r5(38,!1,t.join(", "),r.join(", ")));if("string"!=typeof e.name||0===e.name.length||"object"!=typeof e.app&&"function"!=typeof e.app)throw Error(r5(20,!1));let n=e=>"string"==typeof e||"function"==typeof e;if(!(n(e.activeWhen)||Array.isArray(e.activeWhen)&&e.activeWhen.every(n)))throw Error(r5(24,!1));if(!io(e.customProps))throw Error(r5(22,!1))}(e),a.name=e.name,a.loadApp=e.app,a.activeWhen=e.activeWhen,a.customProps=e.customProps):(function(e,t,r,n){if("string"!=typeof e||0===e.length)throw Error(r5(20,!1));if(!t)throw Error(r5(23,!1));if("function"!=typeof r)throw Error(r5(24,!1));if(!io(n))throw Error(r5(22,!1))}(e,t,r,n),a.name=e,a.loadApp=t,a.activeWhen=r,a.customProps=n),a.loadApp="function"!=typeof(i=a.loadApp)?()=>Promise.resolve(i):i,a.customProps=a.customProps||{},s=(s=Array.isArray(o=a.activeWhen)?o:[o]).map(e=>"function"==typeof e?e:ia(e)),a.activeWhen=e=>s.some(t=>t(e)),a);if(ih||n9||(n9=!0,setTimeout(()=>{ih||console.warn(r5(1,!1))},5e3)),-1!==n5().indexOf(l.name))throw Error(r5(21,!1,l.name));n2.push(nm({loadErrorTime:null,status:r9,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},l)),nB&&(nX(),id())}function ie(e=window.location){return n2.filter(t=>t.activeWhen(e)).map(np)}function it(e){if(0===n2.filter(t=>np(t)===e).length)throw Error(r5(25,!1,e));return(nB?ir(e,{waitForUnmount:!1}):Promise.resolve()).then(()=>{let t=n2.map(np).indexOf(e);n2.splice(t,1)})}function ir(e,t={waitForUnmount:!1}){if("string"!=typeof e)throw Error(r5(26,!1));let r=ny(n2,t=>np(t)===e);if(!r)throw Error(r5(27,!1,e));let n=n0[np(r)];if(t&&t.waitForUnmount){if(n)return n.promise;{let e=new Promise((t,n)=>{n4(r,()=>e,t,n)});return e}}{let e;return n?(e=n.promise,ii(r,n.resolve,n.reject)):e=new Promise((t,n)=>{n4(r,()=>e,t,n),ii(r,t,n)}),e}}function ii(e,t,r){Promise.resolve().then(()=>{if(ny(ie(),t=>t===np(e)))return ic()}).then(()=>nx(e).then(n1).then(()=>{t(),setTimeout(()=>{id()})})).catch(r)}function io(e){return!e||"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)}function ia(e,t){let r=function(e,t){let r=0,n=!1,i="^";"/"!==e[0]&&(e="/"+e);for(let t=0;t<e.length;t++){let r=e[t],i=n&&"/"===r;(!n&&":"===r||i)&&o(t)}return o(e.length),RegExp(i,"i");function o(o){let a=e.slice(r,o).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(i+=n?"[^/]+/?":a,o===e.length)if(n)t&&(i+="$");else{let e=t?"":".*";i="/"===i.charAt(i.length-1)?`${i}${e}$`:`${i}(/${e})?(#.*)?$`}n=!n,r=o}}(e,t);return e=>{let t=e.origin;t||(t=`${e.protocol}//${e.host}`);let n=e.href.replace(t,"").replace(e.search,"").split("?")[0];return r.test(n)}}let is=!1,il=[],iu=nB&&window.location.href;function ic(){return id()}function id(e=[],t,r=!1){let n,i,o,a,s;if(is)return new Promise((e,r)=>{il.push({resolve:e,reject:r,eventArguments:t})});let{appsToUnload:l,appsToUnmount:u,appsToLoad:c,appsToMount:d}=(n=[],i=[],o=[],a=[],s=(new Date).getTime(),n2.forEach(e=>{let t=e.status!==nu&&nd(e);switch(e.status){case nl:t&&s-e.loadErrorTime>=200&&o.push(e);break;case r9:case r7:t&&o.push(e);break;case ne:case nr:!t&&n0[np(e)]?n.push(e):t&&a.push(e);break;case ni:t||i.push(e)}}),{appsToUnload:n,appsToUnmount:i,appsToLoad:o,appsToMount:a}),p,f=[],h=iu,m=iu=window.location.href;return ih?(is=!0,p=l.concat(c,u,d),Promise.resolve().then(()=>(w(0===p.length?"before-no-app-change":"before-app-change",v(!0)),w("before-routing-event",v(!0,{cancelNavigation:y})),Promise.all(f).then(r=>{if(r.some(e=>e))return nG.call(window.history,history.state,"",h.substring(location.origin.length)),iu=location.href,is=!1,id(e,t,!0);let n=l.map(n1),i=Promise.all(u.map(nx).map(e=>e.then(n1)).concat(n));i.then(()=>{w("before-mount-routing-event",v(!0))},e=>{throw e});let o=c.map(e=>nF(e).then(e=>ip(e,i))),a=d.filter(e=>0>c.indexOf(e)).map(e=>ip(e,i));return i.catch(e=>{throw b(),e}).then(()=>(b(),Promise.all(o.concat(a)).catch(t=>{throw e.forEach(e=>e.reject(t)),t}).then(g).then(()=>{},e=>{throw e})))})))):(p=c,Promise.resolve().then(()=>Promise.all(c.map(nF)).then(b).then(()=>[]).catch(e=>{throw b(),e}).finally(()=>{})));function y(e=!0){let t="function"==typeof(null==e?void 0:e.then)?e:Promise.resolve(e);f.push(t.catch(e=>(console.warn(Error(r5(42,!1))),console.warn(e),!1)))}function g(){let t=n6();e.forEach(e=>e.resolve(t));try{w(0===p.length?"no-app-change":"app-change",v()),w("routing-event",v())}catch(e){setTimeout(()=>{throw e})}if(is=!1,il.length>0){let e=il;il=[],id(e)}return t}function b(){r||(e.forEach(e=>{nK(e.eventArguments)}),nK(t))}function v(e=!1,r){let n={},i={[ni]:[],[nr]:[],[r9]:[],[nu]:[]};e?(c.concat(d).forEach((e,t)=>{a(e,ni)}),l.forEach(e=>{a(e,r9)}),u.forEach(e=>{a(e,nr)})):p.forEach(e=>{a(e)});let o={detail:{newAppStatuses:n,appsByNewStatus:i,totalAppChanges:p.length,originalEvent:null==t?void 0:t[0],oldUrl:h,newUrl:m}};return r&&nm(o.detail,r),o;function a(e,t){let r=np(e);t=t||n8(r),n[r]=t,(i[t]=i[t]||[]).push(r)}}function w(e,t){r||window.dispatchEvent(new r1(`single-spa:${e}`,t))}}function ip(e,t){return nd(e)?n_(e).then(e=>t.then(()=>nd(e)?nD(e):e)):t.then(()=>e)}let ih=!1;function im(e){ih=!0,nB&&(nY(e),id())}nB&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods={getRawAppData:function(){return[...n2]},reroute:id,NOT_LOADED:r9,toLoadPromise:nF,toBootstrapPromise:n_,unregisterApplication:it,getProfilerData:function(){return nw}});let iy={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",discardUnsavedChangesPromptBodyMultiple:"{{count}} workspaces have unsaved changes. Closing them will discard the changes:",discardUnsavedChangesPromptBodySingle:"<strong>{{workspaceTitle}}</strong> has unsaved changes. Closing it will discard them.",discardUnsavedChangesPromptTitle:"Discard unsaved changes?",keepEditing:"Keep editing",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",localVersion:"Local Build",male:"Male",navigateNonHttp:"Could not navigate to the requested page as it is not a safe URL",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}}",prereleaseVersion:"Prerelease",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"},ig=e=>"string"==typeof e,ib=()=>{let e,t,r=new Promise((r,n)=>{e=r,t=n});return r.resolve=e,r.reject=t,r},iv=e=>null==e?"":""+e,iw=/###/g,i_=e=>e&&e.indexOf("###")>-1?e.replace(iw,"."):e,ix=e=>!e||ig(e),iE=(e,t,r)=>{let n=ig(t)?t.split("."):t,i=0;for(;i<n.length-1;){if(ix(e))return{};let t=i_(n[i]);!e[t]&&r&&(e[t]=new r),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return ix(e)?{}:{obj:e,k:i_(n[i])}},iS=(e,t,r)=>{let{obj:n,k:i}=iE(e,t,Object);if(void 0!==n||1===t.length){n[i]=r;return}let o=t[t.length-1],a=t.slice(0,t.length-1),s=iE(e,a,Object);for(;void 0===s.obj&&a.length;)o=`${a[a.length-1]}.${o}`,s=iE(e,a=a.slice(0,a.length-1),Object),s?.obj&&void 0!==s.obj[`${s.k}.${o}`]&&(s.obj=void 0);s.obj[`${s.k}.${o}`]=r},iD=(e,t)=>{let{obj:r,k:n}=iE(e,t);if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},iO=(e,t,r)=>{for(let n in t)"__proto__"!==n&&"constructor"!==n&&(n in e?ig(e[n])||e[n]instanceof String||ig(t[n])||t[n]instanceof String?r&&(e[n]=t[n]):iO(e[n],t[n],r):e[n]=t[n]);return e};var iP={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};let iC=e=>ig(e)?e.replace(/[&<>"'\/]/g,e=>iP[e]):e,ik=[" ",",","?","!",";"],ij=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 r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}(20),iT=(e,t,r=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}let n=t.split(r),i=e;for(let e=0;e<n.length;){let t;if(!i||"object"!=typeof i)return;let o="";for(let a=e;a<n.length;++a)if(a!==e&&(o+=r),o+=n[a],void 0!==(t=i[o])){if(["string","number","boolean"].indexOf(typeof t)>-1&&a<n.length-1)continue;e+=a-e+1;break}i=t}return i},iR=e=>e?.replace("_","-"),iA={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 iN{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||iA,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,r,n){return n&&!this.debug?null:(ig(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new iN(this.logger,{...{prefix:`${this.prefix}:${e}:`},...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new iN(this.logger,e)}}var iM=new iN;class iI{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let r=this.observers[e].get(t)||0;this.observers[e].set(t,r+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,r])=>{for(let n=0;n<r;n++)e(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([r,n])=>{for(let i=0;i<n;i++)r.apply(r,[e,...t])})}}class i$ extends iI{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,r,n={}){let i,o=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,a=void 0!==n.ignoreJSONStructure?n.ignoreJSONStructure:this.options.ignoreJSONStructure;e.indexOf(".")>-1?i=e.split("."):(i=[e,t],r&&(Array.isArray(r)?i.push(...r):ig(r)&&o?i.push(...r.split(o)):i.push(r)));let s=iD(this.data,i);return(!s&&!t&&!r&&e.indexOf(".")>-1&&(e=i[0],t=i[1],r=i.slice(2).join(".")),!s&&a&&ig(r))?iT(this.data?.[e]?.[t],r,o):s}addResource(e,t,r,n,i={silent:!1}){let o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,a=[e,t];r&&(a=a.concat(o?r.split(o):r)),e.indexOf(".")>-1&&(a=e.split("."),n=t,t=a[1]),this.addNamespaces(t),iS(this.data,a,n),i.silent||this.emit("added",e,t,r,n)}addResources(e,t,r,n={silent:!1}){for(let n in r)(ig(r[n])||Array.isArray(r[n]))&&this.addResource(e,t,n,r[n],{silent:!0});n.silent||this.emit("added",e,t,r)}addResourceBundle(e,t,r,n,i,o={silent:!1,skipCopy:!1}){let a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),n=r,r=t,t=a[1]),this.addNamespaces(t);let s=iD(this.data,a)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),n?iO(s,r,i):s={...s,...r},iS(this.data,a,s),o.silent||this.emit("added",e,t,r)}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 iL={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,r,n,i){return e.forEach(e=>{t=this.processors[e]?.process(t,r,n,i)??t}),t}};let iF=Symbol("i18next/PATH_KEY");function iB(e,t){let r,n,i,{[iF]:o}=e((n=[],(i=Object.create(null)).get=(e,t)=>(r?.revoke?.(),t===iF)?n:(n.push(t),(r=Proxy.revocable(e,i)).proxy),Proxy.revocable(Object.create(null),i).proxy));return o.join(t?.keySeparator??".")}let iV={},iU=e=>!ig(e)&&"boolean"!=typeof e&&"number"!=typeof e;class iW extends iI{constructor(e,t={}){super(),((e,t,r)=>{e.forEach(e=>{t[e]&&(r[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=iM.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let r={...t};if(null==e)return!1;let n=this.resolve(e,r);if(n?.res===void 0)return!1;let i=iU(n.res);return!1!==r.returnObjects||!i}extractFromKey(e,t){let r=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===r&&(r=":");let n=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS||[],o=r&&e.indexOf(r)>-1,a=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!((e,t,r)=>{t=t||"",r=r||"";let n=ik.filter(e=>0>t.indexOf(e)&&0>r.indexOf(e));if(0===n.length)return!0;let i=ij.getRegExp(`(${n.map(e=>"?"===e?"\\?":e).join("|")})`),o=!i.test(e);if(!o){let t=e.indexOf(r);t>0&&!i.test(e.substring(0,t))&&(o=!0)}return o})(e,r,n);if(o&&!a){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:ig(i)?[i]:i};let o=e.split(r);(r!==n||r===n&&this.options.ns.indexOf(o[0])>-1)&&(i=o.shift()),e=o.join(n)}return{key:e,namespaces:ig(i)?[i]:i}}translate(e,t,r){let n="object"==typeof t?{...t}:t;if("object"!=typeof n&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof n&&(n={...n}),n||(n={}),null==e)return"";"function"==typeof e&&(e=iB(e,{...this.options,...n})),Array.isArray(e)||(e=[String(e)]);let i=void 0!==n.returnDetails?n.returnDetails:this.options.returnDetails,o=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(e[e.length-1],n),l=s[s.length-1],u=void 0!==n.nsSeparator?n.nsSeparator:this.options.nsSeparator;void 0===u&&(u=":");let c=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c?.toLowerCase()==="cimode")return d?i?{res:`${l}${u}${a}`,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${u}${a}`:i?{res:a,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:a;let p=this.resolve(e,n),f=p?.res,h=p?.usedKey||a,m=p?.exactUsedKey||a,y=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,g=!this.i18nFormat||this.i18nFormat.handleAsObject,b=void 0!==n.count&&!ig(n.count),v=iW.hasDefaultValue(n),w=b?this.pluralResolver.getSuffix(c,n.count,n):"",x=n.ordinal&&b?this.pluralResolver.getSuffix(c,n.count,{ordinal:!1}):"",E=b&&!n.ordinal&&0===n.count,S=E&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${w}`]||n[`defaultValue${x}`]||n.defaultValue,D=f;g&&!f&&v&&(D=S);let O=iU(D),P=Object.prototype.toString.apply(D);if(g&&D&&O&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(P)&&!(ig(y)&&Array.isArray(D))){if(!n.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(h,D,{...n,ns:s}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(p.res=e,p.usedParams=this.getUsedParamsDetails(n),p):e}if(o){let e=Array.isArray(D),t=e?[]:{},r=e?m:h;for(let e in D)if(Object.prototype.hasOwnProperty.call(D,e)){let i=`${r}${o}${e}`;v&&!f?t[e]=this.translate(i,{...n,defaultValue:iU(S)?S[e]:void 0,...{joinArrays:!1,ns:s}}):t[e]=this.translate(i,{...n,joinArrays:!1,ns:s}),t[e]===i&&(t[e]=D[e])}f=t}}else if(g&&ig(y)&&Array.isArray(f))(f=f.join(y))&&(f=this.extendTranslation(f,e,n,r));else{let t=!1,i=!1;!this.isValidLookup(f)&&v&&(t=!0,f=S),this.isValidLookup(f)||(i=!0,f=a);let s=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&i?void 0:f,d=v&&S!==f&&this.options.updateMissing;if(i||t||d){if(this.logger.log(d?"updateKey":"missingKey",c,l,a,d?S:f),o){let e=this.resolve(a,{...n,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,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let r=0;r<t.length;r++)e.push(t[r]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(n.lng||this.language):e.push(n.lng||this.language);let r=(e,t,r)=>{let i=v&&r!==f?r:s;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,i,d,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,i,d,n),this.emit("missingKey",e,l,t,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,n);E&&n[`defaultValue${this.options.pluralSeparator}zero`]&&0>t.indexOf(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{r([e],a+t,n[`defaultValue${t}`]||S)})}):r(e,a,S))}f=this.extendTranslation(f,e,n,p,r),i&&f===a&&this.options.appendNamespaceToMissingKey&&(f=`${l}${u}${a}`),(i||t)&&this.options.parseMissingKeyHandler&&(f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${a}`:a,t?f:void 0,n))}return i?(p.res=f,p.usedParams=this.getUsedParamsDetails(n),p):f}extendTranslation(e,t,r,n,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!r.skipInterpolation){let o;r.interpolation&&this.interpolator.init({...r,...{interpolation:{...this.options.interpolation,...r.interpolation}}});let a=ig(e)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=r.replace&&!ig(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,r.lng||this.language||n.usedLng,r),a){let t=e.match(this.interpolator.nestingRegexp);o<(t&&t.length)&&(r.nest=!1)}!r.lng&&n&&n.res&&(r.lng=this.language||n.usedLng),!1!==r.nest&&(e=this.interpolator.nest(e,(...e)=>i?.[0]!==e[0]||r.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),r)),r.interpolation&&this.interpolator.reset()}let o=r.postProcess||this.options.postProcess,a=ig(o)?[o]:o;return null!=e&&a?.length&&!1!==r.applyPostProcessor&&(e=iL.handle(a,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e,t={}){let r,n,i,o,a;return ig(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(r))return;let s=this.extractFromKey(e,t),l=s.key;n=l;let u=s.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));let c=void 0!==t.count&&!ig(t.count),d=c&&!t.ordinal&&0===t.count,p=void 0!==t.context&&(ig(t.context)||"number"==typeof t.context)&&""!==t.context,f=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);u.forEach(e=>{this.isValidLookup(r)||(a=e,!iV[`${f[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(a)&&(iV[`${f[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${f.join(", ")}" won't get resolved as namespace "${a}" 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!!!")),f.forEach(n=>{let a;if(this.isValidLookup(r))return;o=n;let s=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(s,l,n,e,t);else{let e;c&&(e=this.pluralResolver.getSuffix(n,t.count,t));let r=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(t.ordinal&&0===e.indexOf(i)&&s.push(l+e.replace(i,this.options.pluralSeparator)),s.push(l+e),d&&s.push(l+r)),p){let n=`${l}${this.options.contextSeparator||"_"}${t.context}`;s.push(n),c&&(t.ordinal&&0===e.indexOf(i)&&s.push(n+e.replace(i,this.options.pluralSeparator)),s.push(n+e),d&&s.push(n+r))}}for(;a=s.pop();)this.isValidLookup(r)||(i=a,r=this.getResource(n,e,a,t))}))})}),{res:r,usedKey:n,exactUsedKey:i,usedLng:o,usedNS:a}}isValidLookup(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}getResource(e,t,r,n={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,r,n):this.resourceStore.getResource(e,t,r,n)}getUsedParamsDetails(e={}){let t=e.replace&&!ig(e.replace),r=t?e.replace:e;if(t&&void 0!==e.count&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!t)for(let e of(r={...r},["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"]))delete r[e];return r}static hasDefaultValue(e){let t="defaultValue";for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t===r.substring(0,t.length)&&void 0!==e[r])return!0;return!1}}class iK{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=iM.create("languageUtils")}getScriptPartFromCode(e){if(!(e=iR(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=iR(e))||0>e.indexOf("-"))return e;let t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(ig(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 r=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(r))&&(t=r)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let r=this.getScriptPartFromCode(e);if(this.isSupportedCode(r))return t=r;let n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find(e=>{if(e===n||!(0>e.indexOf("-")&&0>n.indexOf("-"))&&(e.indexOf("-")>0&&0>n.indexOf("-")&&e.substring(0,e.indexOf("-"))===n||0===e.indexOf(n)&&n.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)),ig(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let r=e[t];return r||(r=e[this.getScriptPartFromCode(t)]),r||(r=e[this.formatLanguageCode(t)]),r||(r=e[this.getLanguagePartFromCode(t)]),r||(r=e.default),r||[]}toResolveHierarchy(e,t){let r=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),n=[],i=e=>{e&&(this.isSupportedCode(e)?n.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return ig(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):ig(e)&&i(this.formatLanguageCode(e)),r.forEach(e=>{0>n.indexOf(e)&&i(this.formatLanguageCode(e))}),n}}let iH={zero:0,one:1,two:2,few:3,many:4,other:5},iz={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class iG{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=iM.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let r,n=iR("dev"===e?"en":e),i=t.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:n,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];try{r=new Intl.PluralRules(n,{type:i})}catch(i){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),iz;if(!e.match(/-|_/))return iz;let n=this.languageUtils.getLanguagePartFromCode(e);r=this.getRule(n,t)}return this.pluralRulesCache[o]=r,r}needsPlural(e,t={}){let r=this.getRule(e,t);return r||(r=this.getRule("dev",t)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,r={}){return this.getSuffixes(e,r).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let r=this.getRule(e,t);return(r||(r=this.getRule("dev",t)),r)?r.resolvedOptions().pluralCategories.sort((e,t)=>iH[e]-iH[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,r={}){let n=this.getRule(e,r);return n?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${n.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,r))}}let iq=(e,t,r,n=".",i=!0)=>{let o,a=void 0!==(o=iD(e,r))?o:iD(t,r);return!a&&i&&ig(r)&&void 0===(a=iT(e,r,n))&&(a=iT(t,r,n)),a};class iY{constructor(e={}){this.logger=iM.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:r,useRawValueToEscape:n,prefix:i,prefixEscaped:o,suffix:a,suffixEscaped:s,formatSeparator:l,unescapeSuffix:u,unescapePrefix:c,nestingPrefix:d,nestingPrefixEscaped:p,nestingSuffix:f,nestingSuffixEscaped:h,nestingOptionsSeparator:m,maxReplaces:y,alwaysFormat:g}=e.interpolation;this.escape=void 0!==t?t:iC,this.escapeValue=void 0===r||r,this.useRawValueToEscape=void 0!==n&&n,this.prefix=i?i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):o||"{{",this.suffix=a?a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):s||"}}",this.formatSeparator=l||",",this.unescapePrefix=u?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=d?d.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):p||"$t(".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingSuffix=f?f.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):h||")".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingOptionsSeparator=m||",",this.maxReplaces=y||1e3,this.alwaysFormat=void 0!==g&&g,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,r,n){let i,o,a,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(0>e.indexOf(this.formatSeparator)){let i=iq(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,r,{...n,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),o=i.shift().trim(),a=i.join(this.formatSeparator).trim();return this.format(iq(t,s,o,this.options.keySeparator,this.options.ignoreJSONStructure),a,r,{...n,...t,interpolationkey:o})};this.resetRegExp();let u=n?.missingInterpolationHandler||this.options.missingInterpolationHandler,c=n?.interpolation?.skipOnVariables!==void 0?n.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(a=0;i=t.regex.exec(e);){let r=i[1].trim();if(void 0===(o=l(r)))if("function"==typeof u){let t=u(e,i,n);o=ig(t)?t:""}else if(n&&Object.prototype.hasOwnProperty.call(n,r))o="";else if(c){o=i[0];continue}else this.logger.warn(`missed to pass in variable ${r} for interpolating ${e}`),o="";else ig(o)||this.useRawValueToEscape||(o=iv(o));let s=t.safeValue(o);if(e=e.replace(i[0],s),c?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,++a>=this.maxReplaces)break}}),e}nest(e,t,r={}){let n,i,o,a=(e,t)=>{let r=this.nestingOptionsSeparator;if(0>e.indexOf(r))return e;let n=e.split(RegExp(`${r}[ ]*{`)),i=`{${n[1]}`;e=n[0];let a=(i=this.interpolate(i,o)).match(/'/g),s=i.match(/"/g);((a?.length??0)%2!=0||s)&&s.length%2==0||(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),t&&(o={...t,...o})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${r}${i}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,e};for(;n=this.nestingRegexp.exec(e);){let s=[];(o=(o={...r}).replace&&!ig(o.replace)?o.replace:o).applyPostProcessor=!1,delete o.defaultValue;let l=/{.*}/.test(n[1])?n[1].lastIndexOf("}")+1:n[1].indexOf(this.formatSeparator);if(-1!==l&&(s=n[1].slice(l).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),n[1]=n[1].slice(0,l)),(i=t(a.call(this,n[1].trim(),o),o))&&n[0]===e&&!ig(i))return i;ig(i)||(i=iv(i)),i||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),i=""),s.length&&(i=s.reduce((e,t)=>this.format(e,t,r.lng,{...r,interpolationkey:n[1].trim()}),i.trim())),e=e.replace(n[0],i),this.regexp.lastIndex=0}return e}}let iZ=e=>{let t={};return(r,n,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});let a=n+JSON.stringify(o),s=t[a];return s||(s=e(iR(n),i),t[a]=s),s(r)}},iJ=e=>(t,r,n)=>e(iR(r),n)(t);class iX{constructor(e={}){this.logger=iM.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";let r=t.cacheInBuiltFormats?iZ:iJ;this.formats={number:r((e,t)=>{let r=new Intl.NumberFormat(e,{...t});return e=>r.format(e)}),currency:r((e,t)=>{let r=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>r.format(e)}),datetime:r((e,t)=>{let r=new Intl.DateTimeFormat(e,{...t});return e=>r.format(e)}),relativetime:r((e,t)=>{let r=new Intl.RelativeTimeFormat(e,{...t});return e=>r.format(e,t.range||"day")}),list:r((e,t)=>{let r=new Intl.ListFormat(e,{...t});return e=>r.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=iZ(t)}format(e,t,r,n={}){let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&0>i[0].indexOf(")")&&i.find(e=>e.indexOf(")")>-1)){let e=i.findIndex(e=>e.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:o}=(e=>{let t=e.toLowerCase().trim(),r={};if(e.indexOf("(")>-1){let n=e.split("(");t=n[0].toLowerCase().trim();let i=n[1].substring(0,n[1].length-1);"currency"===t&&0>i.indexOf(":")?r.currency||(r.currency=i.trim()):"relativetime"===t&&0>i.indexOf(":")?r.range||(r.range=i.trim()):i.split(";").forEach(e=>{if(e){let[t,...n]=e.split(":"),i=n.join(":").trim().replace(/^'+|'+$/g,""),o=t.trim();r[o]||(r[o]=i),"false"===i&&(r[o]=!1),"true"===i&&(r[o]=!0),isNaN(i)||(r[o]=parseInt(i,10))}})}return{formatName:t,formatOptions:r}})(t);if(this.formats[i]){let t=e;try{let a=n?.formatParams?.[n.interpolationkey]||{},s=a.locale||a.lng||n.locale||n.lng||r;t=this.formats[i](e,s,{...o,...n,...a})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e},e)}}class iQ extends iI{constructor(e,t,r,n={}){super(),this.backend=e,this.store=t,this.services=r,this.languageUtils=r.languageUtils,this.options=n,this.logger=iM.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,n.backend,n)}queueLoad(e,t,r,n){let i={},o={},a={},s={};return e.forEach(e=>{let n=!0;t.forEach(t=>{let a=`${e}|${t}`;!r.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===o[a]&&(o[a]=!0):(this.state[a]=1,n=!1,void 0===o[a]&&(o[a]=!0),void 0===i[a]&&(i[a]=!0),void 0===s[t]&&(s[t]=!0)))}),n||(a[e]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(s)}}loaded(e,t,r){let n=e.split("|"),i=n[0],o=n[1];t&&this.emit("failedLoading",i,o,t),!t&&r&&this.store.addResourceBundle(i,o,r,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&r&&(this.state[e]=0);let a={};this.queue.forEach(r=>{((e,t,r,n)=>{let{obj:i,k:o}=iE(e,t,Object);i[o]=i[o]||[],i[o].push(r)})(r.loaded,[i],o),void 0!==r.pending[e]&&(delete r.pending[e],r.pendingCount--),t&&r.errors.push(t),0!==r.pendingCount||r.done||(Object.keys(r.loaded).forEach(e=>{a[e]||(a[e]={});let t=r.loaded[e];t.length&&t.forEach(t=>{void 0===a[e][t]&&(a[e][t]=!0)})}),r.done=!0,r.errors.length?r.callback(r.errors):r.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(e=>!e.done)}read(e,t,r,n=0,i=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:r,tried:n,wait:i,callback:o});this.readingCalls++;let a=(a,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)}a&&s&&n<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,r,n+1,2*i,o)},i):o(a,s)},s=this.backend[r].bind(this.backend);if(2===s.length){try{let r=s(e,t);r&&"function"==typeof r.then?r.then(e=>a(null,e)).catch(a):a(null,r)}catch(e){a(e)}return}return s(e,t,a)}prepareLoading(e,t,r={},n){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();ig(e)&&(e=this.languageUtils.toResolveHierarchy(e)),ig(t)&&(t=[t]);let i=this.queueLoad(e,t,r,n);if(!i.toLoad.length)return i.pending.length||n(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,r){this.prepareLoading(e,t,{},r)}reload(e,t,r){this.prepareLoading(e,t,{reload:!0},r)}loadOne(e,t=""){let r=e.split("|"),n=r[0],i=r[1];this.read(n,i,"read",void 0,void 0,(r,o)=>{r&&this.logger.warn(`${t}loading namespace ${i} for language ${n} failed`,r),!r&&o&&this.logger.log(`${t}loaded namespace ${i} for language ${n}`,o),this.loaded(e,r,o)})}saveMissing(e,t,r,n,i,o={},a=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t))return void this.logger.warn(`did not save key "${r}" 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!=r&&""!==r){if(this.backend?.create){let s={...o,isUpdate:i},l=this.backend.create.bind(this.backend);if(l.length<6)try{let i;(i=5===l.length?l(e,t,r,n,s):l(e,t,r,n))&&"function"==typeof i.then?i.then(e=>a(null,e)).catch(a):a(null,i)}catch(e){a(e)}else l(e,t,r,n,a,s)}e&&e[0]&&this.store.addResource(e[0],t,r,n)}}}let i0=()=>({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]),ig(e[1])&&(t.defaultValue=e[1]),ig(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){let r=e[3]||e[2];Object.keys(r).forEach(e=>{t[e]=r[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),i1=e=>(ig(e.ns)&&(e.ns=[e.ns]),ig(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),ig(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),i3=()=>{};class i4 extends iI{constructor(e={},t){if(super(),this.options=i1(e),this.services={},this.logger=iM,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&&(ig(e.ns)?e.defaultNS=e.ns:0>e.ns.indexOf("translation")&&(e.defaultNS=e.ns[0]));let r=i0();this.options={...r,...this.options,...i1(e)},this.options.interpolation={...r.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator);let n=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?iM.init(n(this.modules.logger),this.options):iM.init(null,this.options),e=this.modules.formatter?this.modules.formatter:iX;let t=new iK(this.options);this.store=new i$(this.options.resources,this.options);let i=this.services;i.logger=iM,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new iG(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.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===r.interpolation.format)&&(i.formatter=n(e),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new iY(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new iQ(n(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(i.languageDetector=n(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=n(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new iW(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=i3),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=ib(),o=()=>{let e=(e,r)=>{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(r),t(e,r)};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?o():setTimeout(o,0),i}loadResources(e,t=i3){let r=t,n=ig(e)?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(n?.toLowerCase()==="cimode"&&(!this.options.preload||0===this.options.preload.length))return r();let e=[],t=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&0>e.indexOf(t)&&e.push(t)})};n?t(n):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),r(e)})}else r(null)}reloadResources(e,t,r){let n=ib();return"function"==typeof e&&(r=e,e=void 0),"function"==typeof t&&(r=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),r||(r=i3),this.services.backendConnector.reload(e,t,e=>{n.resolve(),r(e)}),n}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&&iL.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 r=ib();this.emit("languageChanging",e);let n=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,o)=>{o?this.isLanguageChangingTo===e&&(n(o),this.translator.changeLanguage(o),this.isLanguageChangingTo=void 0,this.emit("languageChanged",o),this.logger.log("languageChanged",o)):this.isLanguageChangingTo=void 0,r.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},o=t=>{e||t||!this.services.languageDetector||(t=[]);let r=ig(t)?t:t&&t[0],o=this.store.hasLanguageSomeTranslations(r)?r:this.services.languageUtils.getBestMatchFromCodes(ig(t)?[t]:t);o&&(this.language||n(o),this.translator.language||this.translator.changeLanguage(o),this.services.languageDetector?.cacheUserLanguage?.(o)),this.loadResources(o,e=>{i(e,o)})};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(o):this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),r}getFixedT(e,t,r){let n=(e,t,...i)=>{let o,a;(o="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(i)):{...t}).lng=o.lng||n.lng,o.lngs=o.lngs||n.lngs,o.ns=o.ns||n.ns,""!==o.keyPrefix&&(o.keyPrefix=o.keyPrefix||r||n.keyPrefix);let s=this.options.keySeparator||".";return o.keyPrefix&&Array.isArray(e)?a=e.map(e=>("function"==typeof e&&(e=iB(e,{...this.options,...t})),`${o.keyPrefix}${s}${e}`)):("function"==typeof e&&(e=iB(e,{...this.options,...t})),a=o.keyPrefix?`${o.keyPrefix}${s}${e}`:e),this.t(a,o)};return ig(e)?n.lng=e:n.lngs=e,n.ns=t,n.keyPrefix=r,n}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 r=t.lng||this.resolvedLanguage||this.languages[0],n=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;let o=(e,t)=>{let r=this.services.backendConnector.state[`${e}|${t}`];return -1===r||0===r||2===r};if(t.precheck){let e=t.precheck(this,o);if(void 0!==e)return e}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,e)&&(!n||o(i,e)))}loadNamespaces(e,t){let r=ib();return this.options.ns?(ig(e)&&(e=[e]),e.forEach(e=>{0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}),this.loadResources(e=>{r.resolve(),t&&t(e)}),r):(t&&t(),Promise.resolve())}loadLanguages(e,t){let r=ib();ig(e)&&(e=[e]);let n=this.options.preload||[],i=e.filter(e=>0>n.indexOf(e)&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=n.concat(i),this.loadResources(e=>{r.resolve(),t&&t(e)}),r):(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 iK(i0());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 i4(e,t)}cloneInstance(e={},t=i3){let r=e.forkResourceStore;r&&delete e.forkResourceStore;let n={...this.options,...e,isClone:!0},i=new i4(n);return(void 0!==e.debug||void 0!==e.prefix)&&(i.logger=i.logger.clone(e)),["store","services","language"].forEach(e=>{i[e]=this[e]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r&&(i.store=new i$(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((r,n)=>(r[n]={...e[t][n]},r),e[t]),e),{}),n),i.services.resourceStore=i.store),i.translator=new iW(i.services,n),i.translator.on("*",(e,...t)=>{i.emit(e,...t)}),i.init(n,t),i.translator.options=n,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}let i2=i4.createInstance();i2.createInstance=i4.createInstance,i2.createInstance,i2.dir,i2.init,i2.loadResources,i2.reloadResources,i2.use,i2.changeLanguage,i2.getFixedT,i2.t,i2.exists,i2.setDefaultNamespace,i2.hasLoadedNamespace,i2.loadNamespaces,i2.loadLanguages;let i6=i2.default||i2;function i5(e,t,r,n){return i6.t(t,{ns:e,defaultValue:r,...n})}function i8(e,t,r){return iy[e]?i5("core",e,t??iy[e],r):(console.error(`O3 Core Translations does not provide key '${e}'. The key itself is being rendered as text.`),e)}function i9(e,t){let r=window.getOpenmrsSpaBase().replace(/\/$/,""),n=i7(e,{openmrsBase:window.openmrsBase,openmrsSpaBase:r,...t});return e.startsWith("//")?n:n.replace(/^\/\//,"/")}function i7(e,t){return Object.keys(t).reduce((e,r)=>e.split("${"+r+"}").join(t[r]),e)}function oe({to:e,templateParams:t}){let r=window.getOpenmrsSpaBase().replace(/\/$/,""),n=i9(e,t).replace(window.location.origin,""),i=new URL(n,window.location.origin);if("http:"!=i.protocol&&"https:"!=i.protocol)throw console.error(`Received request to navigate to non-http URL: ${i.toString()}`),Error(i8("navigateNonHttp"));n.startsWith(r)?nW(n):window.location.assign(n)}i6.on("initialized",function(){window.i18next.loadNamespaces(["core"])});let ot="openmrs:history";function or(e){let t=JSON.parse(sessionStorage.getItem(ot)??"[]")||[];t.push(e),t.length>50&&(t=t.slice(-50)),sessionStorage.setItem(ot,JSON.stringify(t))}function on(){0===JSON.parse(sessionStorage.getItem(ot)??"[]").length&&document.referrer&&or(document.referrer),window.addEventListener("single-spa:routing-event",e=>{let t=oi();e.detail.originalEvent?.singleSpaTrigger=="replaceState"?(t[t.length-1]=window.location.href,sessionStorage.setItem(ot,JSON.stringify(t))):!e.detail.originalEvent?.singleSpa&&t.includes(window.location.href)?oo({toUrl:window.location.href}):t[t.length-1]!==window.location.href&&or(window.location.href)})}function oi(){return JSON.parse(sessionStorage.getItem(ot)??"[]")}function oo({toUrl:e}){let t=oi(),r=t.lastIndexOf(e);if(-1!=r){let e=t.slice(0,r+1);oe({to:t[r]}),sessionStorage.setItem(ot,JSON.stringify(e))}else throw Error(`URL ${e} not found in history; cannot go back to it.`)}function oa(){sessionStorage.removeItem(ot)}let os="${openmrsSpaBase}/login",ol={redirectAuthFailure:{enabled:{_type:tL.Boolean,_default:!0,_description:"Whether to redirect logged-out users to `redirectAuthFailure.url`"},url:{_type:tL.String,_default:os,_validators:[rK.isUrl],_description:"The url to which users will be redirected when they are logged out. If set to blank, the `location` header from the response will be used."},errors:{_type:tL.Array,_default:[401],_elements:{_type:tL.Number,_validators:[rK.inRange(100,600)]},_description:"The HTTP error codes for which users will be redirected"},resolvePromise:{_type:tL.Boolean,_default:!1,_description:"Changes how requests that fail authentication are handled. Try messing with this if redirects to the login page aren't working correctly."}},followRedirects:{_type:tL.Boolean,_default:!0,_description:"Whether openmrsFetch should support redirects returned from the backend"}};function ou(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let oc="/ws/rest/v1",od="/ws/fhir2/R4",op=`${oc}/session`;function of(e){return e&&e.startsWith("http")?e:("/"!==e[0]&&(e="/"+e),window.openmrsBase+e)}function oh(e,t={}){if("string"!=typeof e)throw Error("The first argument to @openmrs/api's openmrsFetch function must be a url string");if("object"!=typeof t)throw Error("The second argument to @openmrs/api's openmrsFetch function must be a plain object.");if(!window.openmrsBase)throw Error("@openmrs/api is running in a browser that doesn't have window.openmrsBase, which is provided by openmrs-module-spa's HTML file.");let r=of(e);if(t.headers||(t.headers={}),em(t.body)&&(t.body=JSON.stringify(t.body)),void 0===t.headers.Accept&&(t.headers.Accept="application/json"),null===t.headers.Accept&&delete t.headers.Accept,e.startsWith(oc)&&void 0===t.headers["Disable-WWW-Authenticate"]&&(t.headers["Disable-WWW-Authenticate"]="true"),e.startsWith(od)){let e=new URL(r,window.location.toString());e.searchParams.has("_summary")||(e.searchParams.set("_summary","data"),r=e.toString())}let n=Error();return window.fetch(r,t).then(async e=>{let{redirectAuthFailure:t,followRedirects:i}=await rg("@openmrs/esm-api");if(e.ok){let t=e.headers.get("location");return(i&&t&&(r===of(op)||204===e.status)&&oe({to:t}),204===e.status)?(e.data=null,e):e.clone().text().then(t=>{try{t&&(e.data=JSON.parse(t))}catch(e){}return e})}return r===of(op)&&403===e.status||t.enabled&&t.errors.includes(e.status)?(oa(),oe({to:t.url||e.headers.get("location")||os}),t.resolvePromise?Promise.resolve():new Promise(()=>{})):e.clone().text().then(t=>{let i=t;try{i=JSON.parse(t)}catch(e){}throw new oy(r,e,i,n)},t=>{throw new oy(r,e,null,n)})})}function om(e,t={}){if("object"!=typeof t)throw Error("The second argument to openmrsObservableFetch must be either omitted or an object");let r=new AbortController;return t.signal=r.signal,new es.Observable(n=>{let i=!1;return oh(e,t).then(e=>{i=!0,n.next(e),n.complete()},e=>{i=!0,n.error(e)}),()=>{i||r.abort()}})}class oy extends Error{constructor(e,t,r,n){super(),ou(this,"response",void 0),ou(this,"responseBody",void 0),this.message=`Server responded with ${t.status} (${t.statusText}) for url ${e}. Check err.responseBody or network tab in dev tools for more info`,n.message=this.message,this.responseBody=r,this.response=t,this.stack=`Stacktrace for outgoing request:
13
13
  ${n.stack}
14
14
  Stacktrace for incoming response:
15
- ${this.stack}`}}let iM=Y("session",{loaded:!1,session:null}),iI=0;function i$(e={includeAuthStatus:!0}){return(iI<Date.now()-6e4||!iM.getState().loaded)&&iB(),new es.Observable(t=>{let r=r=>{r.loaded&&(e.includeAuthStatus?t.next(r.session):t.next(r.session?.user))};return r(iM.getState()),iM.subscribe(r)})}function iL(){return(iI<Date.now()-6e4||!iM.getState().loaded)&&iB(),iM}function iF(e){let t=e.locale??e.user?.userProperties?.defaultLocale;t&&t.includes("_")&&(t=t.replaceAll("_","-")),function(e){if(void 0===e||"string"!=typeof e)return!1;try{new Intl.Locale(e)}catch(e){return!1}return!0}(t)&&t!==document.documentElement.getAttribute("lang")&&document.documentElement.setAttribute("lang",t)}function iB(e,t){iI=Date.now();let r={};return e&&t&&(r.Authorization=`Basic ${window.btoa(`${e}:${t}`)}`),iG(iR(ij,{headers:r}))}function iV(){iM.setState({loaded:!0,session:{authenticated:!1,sessionId:""}})}function iU(e,t){var r,n;if(void 0===t)return!e;if(!e)return!0;return r=e,n=t,("string"==typeof r?!ee(n.privileges.find(e=>r===e.display)):Array.isArray(r)?r.every(e=>!ee(n.privileges.find(t=>e===t.display))):(ee(r)||console.error(`Could not understand privileges "${r}"`),!0))||!ee(t.roles.find(e=>"System Developer"===e.display))}function iW(){let e,t;return new Promise(r=>{let n=n=>{n.loaded&&n.session.user&&(e=n.session.user,r(n.session.user),t&&t())};n(iM.getState()),e||(t=iM.subscribe(n))})}function iK(){return new Promise((e,t)=>{i$().subscribe(t=>{e(t.sessionLocation)},t).unsubscribe()})}async function iH(e,t){return iG(iR(ij,{method:"POST",body:{sessionLocation:e},headers:{"Content-Type":"application/json"},signal:t.signal}))}async function iz(e,t,r){return r||(r=new AbortController),await iR(`${iC}/user/${e}`,{method:"POST",body:{userProperties:t},headers:{"Content-Type":"application/json"},signal:r.signal}),iB()}function iG(e){return new Promise((t,r)=>{e.then(e=>{let n;"object"==typeof e?.data?(n={loaded:!0,session:e.data},iM.setState(n),t(n)):(n={loaded:!1,session:null},iM.setState(n),r(n))}).catch(e=>{I(`Failed to fetch new session information: ${e}`);let t={loaded:!1,session:null};iM.setState(t),r(t)})})}function iq(){return"development"===window.spaEnv||"true"===localStorage.getItem("openmrs:devtools")}iM.subscribe(e=>{e.loaded&&e.session&&iF(e.session)});let iY={"webservices.rest":"2.24.0",fhir2:"1.0.0-SNAPSHOT"};function iZ(){rc("@openmrs/esm-api",iO),iB()}let iJ={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",discardUnsavedChangesPromptBodyMultiple:"{{count}} workspaces have unsaved changes. Closing them will discard the changes:",discardUnsavedChangesPromptBodySingle:"<strong>{{workspaceTitle}}</strong> has unsaved changes. Closing it will discard them.",discardUnsavedChangesPromptTitle:"Discard unsaved changes?",keepEditing:"Keep editing",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",localVersion:"Local Build",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}}",prereleaseVersion:"Prerelease",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"},iX=e=>"string"==typeof e,iQ=()=>{let e,t,r=new Promise((r,n)=>{e=r,t=n});return r.resolve=e,r.reject=t,r},i0=e=>null==e?"":""+e,i1=/###/g,i3=e=>e&&e.indexOf("###")>-1?e.replace(i1,"."):e,i4=e=>!e||iX(e),i2=(e,t,r)=>{let n=iX(t)?t.split("."):t,i=0;for(;i<n.length-1;){if(i4(e))return{};let t=i3(n[i]);!e[t]&&r&&(e[t]=new r),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return i4(e)?{}:{obj:e,k:i3(n[i])}},i6=(e,t,r)=>{let{obj:n,k:i}=i2(e,t,Object);if(void 0!==n||1===t.length){n[i]=r;return}let o=t[t.length-1],a=t.slice(0,t.length-1),s=i2(e,a,Object);for(;void 0===s.obj&&a.length;)o=`${a[a.length-1]}.${o}`,s=i2(e,a=a.slice(0,a.length-1),Object),s?.obj&&void 0!==s.obj[`${s.k}.${o}`]&&(s.obj=void 0);s.obj[`${s.k}.${o}`]=r},i5=(e,t)=>{let{obj:r,k:n}=i2(e,t);if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},i8=(e,t,r)=>{for(let n in t)"__proto__"!==n&&"constructor"!==n&&(n in e?iX(e[n])||e[n]instanceof String||iX(t[n])||t[n]instanceof String?r&&(e[n]=t[n]):i8(e[n],t[n],r):e[n]=t[n]);return e};var i9={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};let i7=e=>iX(e)?e.replace(/[&<>"'\/]/g,e=>i9[e]):e,oe=[" ",",","?","!",";"],ot=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 r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}(20),or=(e,t,r=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}let n=t.split(r),i=e;for(let e=0;e<n.length;){let t;if(!i||"object"!=typeof i)return;let o="";for(let a=e;a<n.length;++a)if(a!==e&&(o+=r),o+=n[a],void 0!==(t=i[o])){if(["string","number","boolean"].indexOf(typeof t)>-1&&a<n.length-1)continue;e+=a-e+1;break}i=t}return i},on=e=>e?.replace("_","-"),oi={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 oo{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||oi,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,r,n){return n&&!this.debug?null:(iX(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new oo(this.logger,{...{prefix:`${this.prefix}:${e}:`},...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new oo(this.logger,e)}}var oa=new oo;class os{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let r=this.observers[e].get(t)||0;this.observers[e].set(t,r+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,r])=>{for(let n=0;n<r;n++)e(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([r,n])=>{for(let i=0;i<n;i++)r.apply(r,[e,...t])})}}class ol extends os{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,r,n={}){let i,o=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,a=void 0!==n.ignoreJSONStructure?n.ignoreJSONStructure:this.options.ignoreJSONStructure;e.indexOf(".")>-1?i=e.split("."):(i=[e,t],r&&(Array.isArray(r)?i.push(...r):iX(r)&&o?i.push(...r.split(o)):i.push(r)));let s=i5(this.data,i);return(!s&&!t&&!r&&e.indexOf(".")>-1&&(e=i[0],t=i[1],r=i.slice(2).join(".")),!s&&a&&iX(r))?or(this.data?.[e]?.[t],r,o):s}addResource(e,t,r,n,i={silent:!1}){let o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,a=[e,t];r&&(a=a.concat(o?r.split(o):r)),e.indexOf(".")>-1&&(a=e.split("."),n=t,t=a[1]),this.addNamespaces(t),i6(this.data,a,n),i.silent||this.emit("added",e,t,r,n)}addResources(e,t,r,n={silent:!1}){for(let n in r)(iX(r[n])||Array.isArray(r[n]))&&this.addResource(e,t,n,r[n],{silent:!0});n.silent||this.emit("added",e,t,r)}addResourceBundle(e,t,r,n,i,o={silent:!1,skipCopy:!1}){let a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),n=r,r=t,t=a[1]),this.addNamespaces(t);let s=i5(this.data,a)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),n?i8(s,r,i):s={...s,...r},i6(this.data,a,s),o.silent||this.emit("added",e,t,r)}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 ou={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,r,n,i){return e.forEach(e=>{t=this.processors[e]?.process(t,r,n,i)??t}),t}};let oc=Symbol("i18next/PATH_KEY");function od(e,t){let r,n,i,{[oc]:o}=e((n=[],(i=Object.create(null)).get=(e,t)=>(r?.revoke?.(),t===oc)?n:(n.push(t),(r=Proxy.revocable(e,i)).proxy),Proxy.revocable(Object.create(null),i).proxy));return o.join(t?.keySeparator??".")}let op={},of=e=>!iX(e)&&"boolean"!=typeof e&&"number"!=typeof e;class oh extends os{constructor(e,t={}){super(),((e,t,r)=>{e.forEach(e=>{t[e]&&(r[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=oa.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let r={...t};if(null==e)return!1;let n=this.resolve(e,r);if(n?.res===void 0)return!1;let i=of(n.res);return!1!==r.returnObjects||!i}extractFromKey(e,t){let r=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===r&&(r=":");let n=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS||[],o=r&&e.indexOf(r)>-1,a=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!((e,t,r)=>{t=t||"",r=r||"";let n=oe.filter(e=>0>t.indexOf(e)&&0>r.indexOf(e));if(0===n.length)return!0;let i=ot.getRegExp(`(${n.map(e=>"?"===e?"\\?":e).join("|")})`),o=!i.test(e);if(!o){let t=e.indexOf(r);t>0&&!i.test(e.substring(0,t))&&(o=!0)}return o})(e,r,n);if(o&&!a){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:iX(i)?[i]:i};let o=e.split(r);(r!==n||r===n&&this.options.ns.indexOf(o[0])>-1)&&(i=o.shift()),e=o.join(n)}return{key:e,namespaces:iX(i)?[i]:i}}translate(e,t,r){let n="object"==typeof t?{...t}:t;if("object"!=typeof n&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof n&&(n={...n}),n||(n={}),null==e)return"";"function"==typeof e&&(e=od(e,{...this.options,...n})),Array.isArray(e)||(e=[String(e)]);let i=void 0!==n.returnDetails?n.returnDetails:this.options.returnDetails,o=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(e[e.length-1],n),l=s[s.length-1],u=void 0!==n.nsSeparator?n.nsSeparator:this.options.nsSeparator;void 0===u&&(u=":");let c=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c?.toLowerCase()==="cimode")return d?i?{res:`${l}${u}${a}`,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${u}${a}`:i?{res:a,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:a;let p=this.resolve(e,n),f=p?.res,h=p?.usedKey||a,m=p?.exactUsedKey||a,y=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,g=!this.i18nFormat||this.i18nFormat.handleAsObject,b=void 0!==n.count&&!iX(n.count),v=oh.hasDefaultValue(n),w=b?this.pluralResolver.getSuffix(c,n.count,n):"",x=n.ordinal&&b?this.pluralResolver.getSuffix(c,n.count,{ordinal:!1}):"",E=b&&!n.ordinal&&0===n.count,S=E&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${w}`]||n[`defaultValue${x}`]||n.defaultValue,D=f;g&&!f&&v&&(D=S);let O=of(D),P=Object.prototype.toString.apply(D);if(g&&D&&O&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(P)&&!(iX(y)&&Array.isArray(D))){if(!n.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(h,D,{...n,ns:s}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(p.res=e,p.usedParams=this.getUsedParamsDetails(n),p):e}if(o){let e=Array.isArray(D),t=e?[]:{},r=e?m:h;for(let e in D)if(Object.prototype.hasOwnProperty.call(D,e)){let i=`${r}${o}${e}`;v&&!f?t[e]=this.translate(i,{...n,defaultValue:of(S)?S[e]:void 0,...{joinArrays:!1,ns:s}}):t[e]=this.translate(i,{...n,joinArrays:!1,ns:s}),t[e]===i&&(t[e]=D[e])}f=t}}else if(g&&iX(y)&&Array.isArray(f))(f=f.join(y))&&(f=this.extendTranslation(f,e,n,r));else{let t=!1,i=!1;!this.isValidLookup(f)&&v&&(t=!0,f=S),this.isValidLookup(f)||(i=!0,f=a);let s=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&i?void 0:f,d=v&&S!==f&&this.options.updateMissing;if(i||t||d){if(this.logger.log(d?"updateKey":"missingKey",c,l,a,d?S:f),o){let e=this.resolve(a,{...n,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,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let r=0;r<t.length;r++)e.push(t[r]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(n.lng||this.language):e.push(n.lng||this.language);let r=(e,t,r)=>{let i=v&&r!==f?r:s;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,i,d,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,i,d,n),this.emit("missingKey",e,l,t,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,n);E&&n[`defaultValue${this.options.pluralSeparator}zero`]&&0>t.indexOf(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{r([e],a+t,n[`defaultValue${t}`]||S)})}):r(e,a,S))}f=this.extendTranslation(f,e,n,p,r),i&&f===a&&this.options.appendNamespaceToMissingKey&&(f=`${l}${u}${a}`),(i||t)&&this.options.parseMissingKeyHandler&&(f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${a}`:a,t?f:void 0,n))}return i?(p.res=f,p.usedParams=this.getUsedParamsDetails(n),p):f}extendTranslation(e,t,r,n,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!r.skipInterpolation){let o;r.interpolation&&this.interpolator.init({...r,...{interpolation:{...this.options.interpolation,...r.interpolation}}});let a=iX(e)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=r.replace&&!iX(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,r.lng||this.language||n.usedLng,r),a){let t=e.match(this.interpolator.nestingRegexp);o<(t&&t.length)&&(r.nest=!1)}!r.lng&&n&&n.res&&(r.lng=this.language||n.usedLng),!1!==r.nest&&(e=this.interpolator.nest(e,(...e)=>i?.[0]!==e[0]||r.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),r)),r.interpolation&&this.interpolator.reset()}let o=r.postProcess||this.options.postProcess,a=iX(o)?[o]:o;return null!=e&&a?.length&&!1!==r.applyPostProcessor&&(e=ou.handle(a,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e,t={}){let r,n,i,o,a;return iX(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(r))return;let s=this.extractFromKey(e,t),l=s.key;n=l;let u=s.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));let c=void 0!==t.count&&!iX(t.count),d=c&&!t.ordinal&&0===t.count,p=void 0!==t.context&&(iX(t.context)||"number"==typeof t.context)&&""!==t.context,f=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);u.forEach(e=>{this.isValidLookup(r)||(a=e,!op[`${f[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(a)&&(op[`${f[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${f.join(", ")}" won't get resolved as namespace "${a}" 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!!!")),f.forEach(n=>{let a;if(this.isValidLookup(r))return;o=n;let s=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(s,l,n,e,t);else{let e;c&&(e=this.pluralResolver.getSuffix(n,t.count,t));let r=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(t.ordinal&&0===e.indexOf(i)&&s.push(l+e.replace(i,this.options.pluralSeparator)),s.push(l+e),d&&s.push(l+r)),p){let n=`${l}${this.options.contextSeparator||"_"}${t.context}`;s.push(n),c&&(t.ordinal&&0===e.indexOf(i)&&s.push(n+e.replace(i,this.options.pluralSeparator)),s.push(n+e),d&&s.push(n+r))}}for(;a=s.pop();)this.isValidLookup(r)||(i=a,r=this.getResource(n,e,a,t))}))})}),{res:r,usedKey:n,exactUsedKey:i,usedLng:o,usedNS:a}}isValidLookup(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}getResource(e,t,r,n={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,r,n):this.resourceStore.getResource(e,t,r,n)}getUsedParamsDetails(e={}){let t=e.replace&&!iX(e.replace),r=t?e.replace:e;if(t&&void 0!==e.count&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!t)for(let e of(r={...r},["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"]))delete r[e];return r}static hasDefaultValue(e){let t="defaultValue";for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t===r.substring(0,t.length)&&void 0!==e[r])return!0;return!1}}class om{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=oa.create("languageUtils")}getScriptPartFromCode(e){if(!(e=on(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=on(e))||0>e.indexOf("-"))return e;let t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(iX(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 r=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(r))&&(t=r)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let r=this.getScriptPartFromCode(e);if(this.isSupportedCode(r))return t=r;let n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find(e=>{if(e===n||!(0>e.indexOf("-")&&0>n.indexOf("-"))&&(e.indexOf("-")>0&&0>n.indexOf("-")&&e.substring(0,e.indexOf("-"))===n||0===e.indexOf(n)&&n.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)),iX(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let r=e[t];return r||(r=e[this.getScriptPartFromCode(t)]),r||(r=e[this.formatLanguageCode(t)]),r||(r=e[this.getLanguagePartFromCode(t)]),r||(r=e.default),r||[]}toResolveHierarchy(e,t){let r=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),n=[],i=e=>{e&&(this.isSupportedCode(e)?n.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return iX(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):iX(e)&&i(this.formatLanguageCode(e)),r.forEach(e=>{0>n.indexOf(e)&&i(this.formatLanguageCode(e))}),n}}let oy={zero:0,one:1,two:2,few:3,many:4,other:5},og={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class ob{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=oa.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let r,n=on("dev"===e?"en":e),i=t.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:n,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];try{r=new Intl.PluralRules(n,{type:i})}catch(i){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),og;if(!e.match(/-|_/))return og;let n=this.languageUtils.getLanguagePartFromCode(e);r=this.getRule(n,t)}return this.pluralRulesCache[o]=r,r}needsPlural(e,t={}){let r=this.getRule(e,t);return r||(r=this.getRule("dev",t)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,r={}){return this.getSuffixes(e,r).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let r=this.getRule(e,t);return(r||(r=this.getRule("dev",t)),r)?r.resolvedOptions().pluralCategories.sort((e,t)=>oy[e]-oy[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,r={}){let n=this.getRule(e,r);return n?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${n.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,r))}}let ov=(e,t,r,n=".",i=!0)=>{let o,a=void 0!==(o=i5(e,r))?o:i5(t,r);return!a&&i&&iX(r)&&void 0===(a=or(e,r,n))&&(a=or(t,r,n)),a};class ow{constructor(e={}){this.logger=oa.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:r,useRawValueToEscape:n,prefix:i,prefixEscaped:o,suffix:a,suffixEscaped:s,formatSeparator:l,unescapeSuffix:u,unescapePrefix:c,nestingPrefix:d,nestingPrefixEscaped:p,nestingSuffix:f,nestingSuffixEscaped:h,nestingOptionsSeparator:m,maxReplaces:y,alwaysFormat:g}=e.interpolation;this.escape=void 0!==t?t:i7,this.escapeValue=void 0===r||r,this.useRawValueToEscape=void 0!==n&&n,this.prefix=i?i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):o||"{{",this.suffix=a?a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):s||"}}",this.formatSeparator=l||",",this.unescapePrefix=u?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=d?d.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):p||"$t(".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingSuffix=f?f.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"):h||")".replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),this.nestingOptionsSeparator=m||",",this.maxReplaces=y||1e3,this.alwaysFormat=void 0!==g&&g,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,r,n){let i,o,a,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(0>e.indexOf(this.formatSeparator)){let i=ov(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,r,{...n,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),o=i.shift().trim(),a=i.join(this.formatSeparator).trim();return this.format(ov(t,s,o,this.options.keySeparator,this.options.ignoreJSONStructure),a,r,{...n,...t,interpolationkey:o})};this.resetRegExp();let u=n?.missingInterpolationHandler||this.options.missingInterpolationHandler,c=n?.interpolation?.skipOnVariables!==void 0?n.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(a=0;i=t.regex.exec(e);){let r=i[1].trim();if(void 0===(o=l(r)))if("function"==typeof u){let t=u(e,i,n);o=iX(t)?t:""}else if(n&&Object.prototype.hasOwnProperty.call(n,r))o="";else if(c){o=i[0];continue}else this.logger.warn(`missed to pass in variable ${r} for interpolating ${e}`),o="";else iX(o)||this.useRawValueToEscape||(o=i0(o));let s=t.safeValue(o);if(e=e.replace(i[0],s),c?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,++a>=this.maxReplaces)break}}),e}nest(e,t,r={}){let n,i,o,a=(e,t)=>{let r=this.nestingOptionsSeparator;if(0>e.indexOf(r))return e;let n=e.split(RegExp(`${r}[ ]*{`)),i=`{${n[1]}`;e=n[0];let a=(i=this.interpolate(i,o)).match(/'/g),s=i.match(/"/g);((a?.length??0)%2!=0||s)&&s.length%2==0||(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),t&&(o={...t,...o})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${r}${i}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,e};for(;n=this.nestingRegexp.exec(e);){let s=[];(o=(o={...r}).replace&&!iX(o.replace)?o.replace:o).applyPostProcessor=!1,delete o.defaultValue;let l=/{.*}/.test(n[1])?n[1].lastIndexOf("}")+1:n[1].indexOf(this.formatSeparator);if(-1!==l&&(s=n[1].slice(l).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),n[1]=n[1].slice(0,l)),(i=t(a.call(this,n[1].trim(),o),o))&&n[0]===e&&!iX(i))return i;iX(i)||(i=i0(i)),i||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),i=""),s.length&&(i=s.reduce((e,t)=>this.format(e,t,r.lng,{...r,interpolationkey:n[1].trim()}),i.trim())),e=e.replace(n[0],i),this.regexp.lastIndex=0}return e}}let o_=e=>{let t={};return(r,n,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});let a=n+JSON.stringify(o),s=t[a];return s||(s=e(on(n),i),t[a]=s),s(r)}},ox=e=>(t,r,n)=>e(on(r),n)(t);class oE{constructor(e={}){this.logger=oa.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";let r=t.cacheInBuiltFormats?o_:ox;this.formats={number:r((e,t)=>{let r=new Intl.NumberFormat(e,{...t});return e=>r.format(e)}),currency:r((e,t)=>{let r=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>r.format(e)}),datetime:r((e,t)=>{let r=new Intl.DateTimeFormat(e,{...t});return e=>r.format(e)}),relativetime:r((e,t)=>{let r=new Intl.RelativeTimeFormat(e,{...t});return e=>r.format(e,t.range||"day")}),list:r((e,t)=>{let r=new Intl.ListFormat(e,{...t});return e=>r.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=o_(t)}format(e,t,r,n={}){let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&0>i[0].indexOf(")")&&i.find(e=>e.indexOf(")")>-1)){let e=i.findIndex(e=>e.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:o}=(e=>{let t=e.toLowerCase().trim(),r={};if(e.indexOf("(")>-1){let n=e.split("(");t=n[0].toLowerCase().trim();let i=n[1].substring(0,n[1].length-1);"currency"===t&&0>i.indexOf(":")?r.currency||(r.currency=i.trim()):"relativetime"===t&&0>i.indexOf(":")?r.range||(r.range=i.trim()):i.split(";").forEach(e=>{if(e){let[t,...n]=e.split(":"),i=n.join(":").trim().replace(/^'+|'+$/g,""),o=t.trim();r[o]||(r[o]=i),"false"===i&&(r[o]=!1),"true"===i&&(r[o]=!0),isNaN(i)||(r[o]=parseInt(i,10))}})}return{formatName:t,formatOptions:r}})(t);if(this.formats[i]){let t=e;try{let a=n?.formatParams?.[n.interpolationkey]||{},s=a.locale||a.lng||n.locale||n.lng||r;t=this.formats[i](e,s,{...o,...n,...a})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e},e)}}class oS extends os{constructor(e,t,r,n={}){super(),this.backend=e,this.store=t,this.services=r,this.languageUtils=r.languageUtils,this.options=n,this.logger=oa.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,n.backend,n)}queueLoad(e,t,r,n){let i={},o={},a={},s={};return e.forEach(e=>{let n=!0;t.forEach(t=>{let a=`${e}|${t}`;!r.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===o[a]&&(o[a]=!0):(this.state[a]=1,n=!1,void 0===o[a]&&(o[a]=!0),void 0===i[a]&&(i[a]=!0),void 0===s[t]&&(s[t]=!0)))}),n||(a[e]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(s)}}loaded(e,t,r){let n=e.split("|"),i=n[0],o=n[1];t&&this.emit("failedLoading",i,o,t),!t&&r&&this.store.addResourceBundle(i,o,r,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&r&&(this.state[e]=0);let a={};this.queue.forEach(r=>{((e,t,r,n)=>{let{obj:i,k:o}=i2(e,t,Object);i[o]=i[o]||[],i[o].push(r)})(r.loaded,[i],o),void 0!==r.pending[e]&&(delete r.pending[e],r.pendingCount--),t&&r.errors.push(t),0!==r.pendingCount||r.done||(Object.keys(r.loaded).forEach(e=>{a[e]||(a[e]={});let t=r.loaded[e];t.length&&t.forEach(t=>{void 0===a[e][t]&&(a[e][t]=!0)})}),r.done=!0,r.errors.length?r.callback(r.errors):r.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(e=>!e.done)}read(e,t,r,n=0,i=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:r,tried:n,wait:i,callback:o});this.readingCalls++;let a=(a,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)}a&&s&&n<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,r,n+1,2*i,o)},i):o(a,s)},s=this.backend[r].bind(this.backend);if(2===s.length){try{let r=s(e,t);r&&"function"==typeof r.then?r.then(e=>a(null,e)).catch(a):a(null,r)}catch(e){a(e)}return}return s(e,t,a)}prepareLoading(e,t,r={},n){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();iX(e)&&(e=this.languageUtils.toResolveHierarchy(e)),iX(t)&&(t=[t]);let i=this.queueLoad(e,t,r,n);if(!i.toLoad.length)return i.pending.length||n(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,r){this.prepareLoading(e,t,{},r)}reload(e,t,r){this.prepareLoading(e,t,{reload:!0},r)}loadOne(e,t=""){let r=e.split("|"),n=r[0],i=r[1];this.read(n,i,"read",void 0,void 0,(r,o)=>{r&&this.logger.warn(`${t}loading namespace ${i} for language ${n} failed`,r),!r&&o&&this.logger.log(`${t}loaded namespace ${i} for language ${n}`,o),this.loaded(e,r,o)})}saveMissing(e,t,r,n,i,o={},a=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t))return void this.logger.warn(`did not save key "${r}" 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!=r&&""!==r){if(this.backend?.create){let s={...o,isUpdate:i},l=this.backend.create.bind(this.backend);if(l.length<6)try{let i;(i=5===l.length?l(e,t,r,n,s):l(e,t,r,n))&&"function"==typeof i.then?i.then(e=>a(null,e)).catch(a):a(null,i)}catch(e){a(e)}else l(e,t,r,n,a,s)}e&&e[0]&&this.store.addResource(e[0],t,r,n)}}}let oD=()=>({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]),iX(e[1])&&(t.defaultValue=e[1]),iX(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){let r=e[3]||e[2];Object.keys(r).forEach(e=>{t[e]=r[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),oO=e=>(iX(e.ns)&&(e.ns=[e.ns]),iX(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),iX(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),oP=()=>{};class oC extends os{constructor(e={},t){if(super(),this.options=oO(e),this.services={},this.logger=oa,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&&(iX(e.ns)?e.defaultNS=e.ns:0>e.ns.indexOf("translation")&&(e.defaultNS=e.ns[0]));let r=oD();this.options={...r,...this.options,...oO(e)},this.options.interpolation={...r.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator);let n=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?oa.init(n(this.modules.logger),this.options):oa.init(null,this.options),e=this.modules.formatter?this.modules.formatter:oE;let t=new om(this.options);this.store=new ol(this.options.resources,this.options);let i=this.services;i.logger=oa,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new ob(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.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===r.interpolation.format)&&(i.formatter=n(e),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new ow(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new oS(n(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(i.languageDetector=n(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=n(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new oh(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=oP),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=iQ(),o=()=>{let e=(e,r)=>{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(r),t(e,r)};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?o():setTimeout(o,0),i}loadResources(e,t=oP){let r=t,n=iX(e)?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(n?.toLowerCase()==="cimode"&&(!this.options.preload||0===this.options.preload.length))return r();let e=[],t=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&0>e.indexOf(t)&&e.push(t)})};n?t(n):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),r(e)})}else r(null)}reloadResources(e,t,r){let n=iQ();return"function"==typeof e&&(r=e,e=void 0),"function"==typeof t&&(r=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),r||(r=oP),this.services.backendConnector.reload(e,t,e=>{n.resolve(),r(e)}),n}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&&ou.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 r=iQ();this.emit("languageChanging",e);let n=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,o)=>{o?this.isLanguageChangingTo===e&&(n(o),this.translator.changeLanguage(o),this.isLanguageChangingTo=void 0,this.emit("languageChanged",o),this.logger.log("languageChanged",o)):this.isLanguageChangingTo=void 0,r.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},o=t=>{e||t||!this.services.languageDetector||(t=[]);let r=iX(t)?t:t&&t[0],o=this.store.hasLanguageSomeTranslations(r)?r:this.services.languageUtils.getBestMatchFromCodes(iX(t)?[t]:t);o&&(this.language||n(o),this.translator.language||this.translator.changeLanguage(o),this.services.languageDetector?.cacheUserLanguage?.(o)),this.loadResources(o,e=>{i(e,o)})};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(o):this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),r}getFixedT(e,t,r){let n=(e,t,...i)=>{let o,a;(o="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(i)):{...t}).lng=o.lng||n.lng,o.lngs=o.lngs||n.lngs,o.ns=o.ns||n.ns,""!==o.keyPrefix&&(o.keyPrefix=o.keyPrefix||r||n.keyPrefix);let s=this.options.keySeparator||".";return o.keyPrefix&&Array.isArray(e)?a=e.map(e=>("function"==typeof e&&(e=od(e,{...this.options,...t})),`${o.keyPrefix}${s}${e}`)):("function"==typeof e&&(e=od(e,{...this.options,...t})),a=o.keyPrefix?`${o.keyPrefix}${s}${e}`:e),this.t(a,o)};return iX(e)?n.lng=e:n.lngs=e,n.ns=t,n.keyPrefix=r,n}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 r=t.lng||this.resolvedLanguage||this.languages[0],n=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;let o=(e,t)=>{let r=this.services.backendConnector.state[`${e}|${t}`];return -1===r||0===r||2===r};if(t.precheck){let e=t.precheck(this,o);if(void 0!==e)return e}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,e)&&(!n||o(i,e)))}loadNamespaces(e,t){let r=iQ();return this.options.ns?(iX(e)&&(e=[e]),e.forEach(e=>{0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}),this.loadResources(e=>{r.resolve(),t&&t(e)}),r):(t&&t(),Promise.resolve())}loadLanguages(e,t){let r=iQ();iX(e)&&(e=[e]);let n=this.options.preload||[],i=e.filter(e=>0>n.indexOf(e)&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=n.concat(i),this.loadResources(e=>{r.resolve(),t&&t(e)}),r):(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 om(oD());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 oC(e,t)}cloneInstance(e={},t=oP){let r=e.forkResourceStore;r&&delete e.forkResourceStore;let n={...this.options,...e,isClone:!0},i=new oC(n);return(void 0!==e.debug||void 0!==e.prefix)&&(i.logger=i.logger.clone(e)),["store","services","language"].forEach(e=>{i[e]=this[e]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r&&(i.store=new ol(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((r,n)=>(r[n]={...e[t][n]},r),e[t]),e),{}),n),i.services.resourceStore=i.store),i.translator=new oh(i.services,n),i.translator.on("*",(e,...t)=>{i.emit(e,...t)}),i.init(n,t),i.translator.options=n,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}let ok=oC.createInstance();ok.createInstance=oC.createInstance,ok.createInstance,ok.dir,ok.init,ok.loadResources,ok.reloadResources,ok.use,ok.changeLanguage,ok.getFixedT,ok.t,ok.exists,ok.setDefaultNamespace,ok.hasLoadedNamespace,ok.loadNamespaces,ok.loadLanguages;let oj=ok.default||ok;function oT(e,t,r,n){return oj.t(t,{ns:e,defaultValue:r,...n})}function oR(e,t,r){return iJ[e]?oT("core",e,t??iJ[e],r):(console.error(`O3 Core Translations does not provide key '${e}'. The key itself is being rendered as text.`),e)}oj.on("initialized",function(){window.i18next.loadNamespaces(["core"])});let oA="import-map-override:",oN="import-map-overrides-disabled",oM="import-map-overrides:change",oI=!1,o$=null,oL=null;async function oF(){return oL??(oL=oB().then(({map:e,complete:t})=>(t||(oL=null),e))),oL}async function oB(){let e=document.querySelectorAll('script[type="systemjs-importmap"]'),t=[],r=!0;for(let n=0;n<e.length;n++){let i=e[n];try{if(i.src){let e=await fetch(i.src);if(!e.ok)throw Error(`Request for ${i.src} returned ${e.status} ${e.statusText}`);t.push(await e.json())}else i.textContent&&t.push(JSON.parse(i.textContent))}catch(e){r=!1,console.warn(`[import-maps] Failed to parse import map from script tag at index ${n}`,e)}}return{map:oV(t),complete:r}}function oV(e){let t={imports:{}};for(let r of e)r?.imports&&Object.assign(t.imports,r.imports);return t}function oU(){let e={};try{let t=oG();for(let r=0;r<localStorage.length;r++){let n=localStorage.key(r);if(n?.startsWith(oA)){let r=n.slice(oA.length);if(!t.includes(r)){let t=localStorage.getItem(n);t&&(e[r]=t)}}}}catch(e){console.warn("[import-maps] Failed to read import-map overrides from localStorage",e)}return{imports:e}}async function oW(){let e=await oF();return oI?oV([e,o$??oU()]):e}async function oK(){return oF()}async function oH(){return oI?oV([await oF(),oU()]):oF()}function oz(e){if(!oI)return{imports:{}};if(e){let e={};for(let t=0;t<localStorage.length;t++){let r=localStorage.key(t);if(r?.startsWith(oA)){let t=localStorage.getItem(r);t&&(e[r.slice(oA.length)]=t)}}return{imports:e}}return oU()}function oG(){if(!oI)return[];try{let e=localStorage.getItem(oN);if(e){let t=JSON.parse(e);if(Array.isArray(t))return t}}catch{}return[]}function oq(e){return!!oI&&oG().includes(e)}function oY(e,t){if(!oI)return void console.warn("[Security] Import map overrides are disabled in production mode.");try{localStorage.setItem(oA+e,t),window.dispatchEvent(new CustomEvent(oM))}catch(e){console.warn("[import-maps] Failed to write import-map override to localStorage",e)}}function oZ(e){if(!oI)return void console.warn("[Security] Import map overrides are disabled in production mode.");try{localStorage.removeItem(oA+e);let t=oG().filter(t=>t!==e);t.length>0?localStorage.setItem(oN,JSON.stringify(t)):localStorage.removeItem(oN),window.dispatchEvent(new CustomEvent(oM))}catch(e){console.warn("[import-maps] Failed to update import-map overrides in localStorage",e)}}function oJ(){if(!oI)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 r=localStorage.key(t);r?.startsWith(oA)&&e.push(r)}e.forEach(e=>localStorage.removeItem(e)),localStorage.removeItem(oN),window.dispatchEvent(new CustomEvent(oM))}catch(e){console.warn("[import-maps] Failed to clear import-map overrides from localStorage",e)}}function oX(e){if(!oI)return void console.warn("[Security] Import map overrides are disabled in production mode.");try{let t=oG().filter(t=>t!==e);t.length>0?localStorage.setItem(oN,JSON.stringify(t)):localStorage.removeItem(oN),window.dispatchEvent(new CustomEvent(oM))}catch(e){console.warn("[import-maps] Failed to update import-map overrides in localStorage",e)}}let oQ=!1;function o0(){!oQ&&(oQ=!0,(oI="development"===window.spaEnv)&&(o$=oU()))}function o1(e){return e.replace(/[\/\-@]/g,"_")}async function o3(e,t="./start",n){var i;let o,a=!n?.maxLoadingTime||n.maxLoadingTime<=0?6e5:n.maxLoadingTime;await Promise.race([o4(e,n?.importMap),new Promise((t,r)=>{o=setTimeout(()=>{var t;r(Error(`Could not resolve requested script, ${e}, within ${(t=a)<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`}.`))},a)})]),o&&clearTimeout(o);let s=o1(e),l=window[s];if(!("object"==typeof(i=l)&&null!==i&&"init"in i&&"function"==typeof i.init&&"get"in i&&"function"==typeof i.get)){let e=`The global variable ${s} does not refer to a federated module`;throw console.error(e),Error(e)}l.init(r.S.default);let u=(await l.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 o4(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 r=o1(e);if(!window[r]){let r=t??await o2();if(!r.imports.hasOwnProperty(e)){let t=`Could not find the package ${e} defined in the current importmap`;throw console.error(t),Error(t)}let n=r.imports[e];n.startsWith("./")&&(n=window.spaBase+n.substring(1));let i=e in oz().imports;try{return await function(e){var t;let r=(t=window)[o6]??(t[o6]=new Map),n=r.get(e);if(n)return n;if(document.head.querySelector(`script[src="${e}"]`))return console.warn(`Script at ${e} already loaded. Not loading it again.`),Promise.resolve();let i=document.createElement("script");i.src=e,i.type="text/javascript",i.async=!0;let o=new Promise((t,n)=>{let o=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);function a(){clearTimeout(o),i.removeEventListener("load",s),i.removeEventListener("error",l)}function s(){a(),t()}function l(t){a(),r.delete(e),i.remove();let o=`Failed to load script from ${e}`;console.error(o,t),n(t.message??o)}i.addEventListener("load",s),i.addEventListener("error",l),document.head.appendChild(i)});return r.set(e,o),o}(n)}catch(e){return i&&T({kind:"error",title:oR("scriptLoadingFailed","Error: Script failed to load"),description:oR("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:n}),actionButtonLabel:oR("resetOverrides","Reset overrides"),onActionButtonClick(){oJ(),window.location.reload()}}),Promise.reject(e)}}return Promise.resolve()}async function o2(){return oW()}let o6=Symbol.for("__openmrs_script_loading");function o5(e){return!!e&&"object"==typeof e&&!(Object.hasOwn(e,"pages")&&(!e.pages||!Array.isArray(e.pages))||Object.hasOwn(e,"extensions")&&(!e.extensions||!Array.isArray(e.extensions))||Object.hasOwn(e,"workspaces")&&(!e.workspaces||!Array.isArray(e.workspaces))||Object.hasOwn(e,"modals")&&(!e.modals||!Array.isArray(e.modals)))}function o8(e){return!!e&&"object"==typeof e&&"routes"in e&&!!e.routes&&"object"==typeof e.routes&&Object.entries(e.routes).every(([e,t])=>"string"==typeof e&&o5(t))}let o9="openmrs-routes:",o7="openmrs-routes:change",ae=!1,at=null,ar=null;async function an(){return ar??(ar=ai().then(({map:e,complete:t})=>(t||(ar=null),e))),ar}async function ai(){let e=document.querySelectorAll("script[type='openmrs-routes']"),t=[],r=!0;for(let n=0;n<e.length;n++){let i=e[n];try{let e;if(i.src){let t=await fetch(i.src);if(!t.ok)throw Error(`Request for ${i.src} returned ${t.status} ${t.statusText}`);e=await t.json()}else i.textContent&&(e=JSON.parse(i.textContent));e&&o8(e)&&t.push(e)}catch(e){r=!1,console.warn(`[route-maps] Failed to parse routes from script tag at index ${n}`,e)}}return{map:ao(t),complete:r}}function ao(e){let t={routes:{}};for(let r of e)r&&"object"==typeof r&&!Array.isArray(r)&&(Object.assign(t.routes,r.routes),void 0===t.version&&void 0!==r.version&&(t.version=r.version));return t}async function aa(){let e={version:void 0,routes:{}};try{let t=[];for(let e=0;e<localStorage.length;e++){let r=localStorage.key(e);if(r?.startsWith(o9)){let e=localStorage.getItem(r);e&&t.push({moduleName:r.slice(o9.length),raw:e})}}for(let r of(await Promise.allSettled(t.map(async({moduleName:e,raw:t})=>{let r=JSON.parse(t);if(o5(r))return{moduleName:e,routes:r};if("string"==typeof r&&r.startsWith("http")){let t=await fetch(r),n=await t.json();if(o5(n))return{moduleName:e,routes:n};throw Error(`${r} did not resolve to a valid OpenmrsAppRoutes object`)}throw Error(`Override for ${e} is neither a valid routes object nor a URL`)}))))"fulfilled"===r.status?e.routes[r.value.moduleName]=r.value.routes:console.warn("[route-maps] Failed to load route override",r.reason)}catch(e){console.warn("[route-maps] Failed to read route overrides from localStorage",e)}return e}async function as(){let e=await an();return ae?ao([e,at??await aa()]):e}async function al(){return an()}async function au(){return ae?ao([await an(),await aa()]):an()}function ac(){if(!ae)return{};let e={};try{for(let t=0;t<localStorage.length;t++){let r=localStorage.key(t);if(r?.startsWith(o9)){let t=localStorage.getItem(r);t&&(e[r.slice(o9.length)]=t)}}}catch(e){console.warn("[route-maps] Failed to read route overrides from localStorage",e)}return e}function ad(e,t){if(!ae)return void console.warn("[Security] Route overrides are disabled outside development mode.");try{if("string"==typeof t)if(t.startsWith("http"))localStorage.setItem(o9+e,JSON.stringify(t));else{let r=JSON.parse(t);if(!o5(r))return void console.error(`The supplied routes for ${e} is not a valid OpenmrsAppRoutes object`,t);localStorage.setItem(o9+e,JSON.stringify(r))}else if(t instanceof URL)localStorage.setItem(o9+e,JSON.stringify(t.toString()));else{if(!o5(t))return void console.error(`Override for ${e} is not in a valid format. Expected either a Javascript Object, a JSON string of a Javascript object, or a URL`,t);localStorage.setItem(o9+e,JSON.stringify(t))}window.dispatchEvent(new CustomEvent(o7))}catch(e){console.warn("[route-maps] Failed to write route override to localStorage",e)}}function ap(e){if(!ae)return void console.warn("[Security] Route overrides are disabled outside development mode.");try{localStorage.removeItem(o9+e),window.dispatchEvent(new CustomEvent(o7))}catch(e){console.warn("[route-maps] Failed to remove route override from localStorage",e)}}function af(){if(!ae)return void console.warn("[Security] Route overrides are disabled outside development mode.");try{let e=[];for(let t=0;t<localStorage.length;t++){let r=localStorage.key(t);r?.startsWith(o9)&&e.push(r)}e.forEach(e=>localStorage.removeItem(e)),window.dispatchEvent(new CustomEvent(o7))}catch(e){console.warn("[route-maps] Failed to clear route overrides from localStorage",e)}}let ah=null;function am(){return ah||(ah=(ae="development"===window.spaEnv)?aa().then(e=>{at=e}):Promise.resolve())}let ay=`${iC}/attachment`;function ag(e,t){return iR(`${ay}/${e}`,{signal:t.signal})}function ab(e,t,r,n){return iR(av(e,t,n),{signal:r.signal})}function av(e,t,r){return r?`${ay}?patient=${e}&encounter=${r}`:`${ay}?patient=${e}&includeEncounterless=${t}`}async function aw(e,t,r){let n=new FormData;return n.append("fileCaption",t.fileDescription),n.append("patient",e),r&&n.append("encounter",r),t.file?n.append("file",t.file,t.fileName):(n.append("file",new File([""],t.fileName),t.fileName),n.append("base64Content",t.base64Content)),iR(`${ay}`,{method:"POST",body:n})}function a_(e,t){return iR(`${ay}/${e}`,{method:"DELETE",signal:t.signal})}try{self["workbox:window:6.5.4"]&&_()}catch(e){}function ax(e,t){return new Promise(function(r){var n=new MessageChannel;n.port1.onmessage=function(e){r(e.data)},e.postMessage(t,[n.port2])})}function aE(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function aS(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}try{self["workbox:core:6.5.4"]&&_()}catch(e){}var aD=function(){var e=this;this.promise=new Promise(function(t,r){e.resolve=t,e.reject=r})};function aO(e,t){var r=location.href;return new URL(e,r).href===new URL(t,r).href}var aP=function(e,t){this.type=e,Object.assign(this,t)};function aC(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function ak(){}var aj={type:"SKIP_WAITING"};function aT(e,t){if(!t)return e&&e.then?e.then(ak):Promise.resolve()}var aR=function(e){function t(t,r){var n,i;return void 0===r&&(r={}),(n=e.call(this)||this).nn={},n.tn=0,n.rn=new aD,n.en=new aD,n.on=new aD,n.un=0,n.an=new Set,n.cn=function(){var e=n.fn,t=e.installing;n.tn>0||!aO(t.scriptURL,n.sn.toString())||performance.now()>n.un+6e4?(n.vn=t,e.removeEventListener("updatefound",n.cn)):(n.hn=t,n.an.add(t),n.rn.resolve(t)),++n.tn,t.addEventListener("statechange",n.ln)},n.ln=function(e){var t=n.fn,r=e.target,i=r.state,o=r===n.vn,a={sw:r,isExternal:o,originalEvent:e};!o&&n.mn&&(a.isUpdate=!0),n.dispatchEvent(new aP(i,a)),"installed"===i?n.wn=self.setTimeout(function(){"installed"===i&&t.waiting===r&&n.dispatchEvent(new aP("waiting",a))},200):"activating"===i&&(clearTimeout(n.wn),o||n.en.resolve(r))},n.dn=function(e){var t=n.hn,r=t!==navigator.serviceWorker.controller;n.dispatchEvent(new aP("controlling",{isExternal:r,originalEvent:e,sw:t,isUpdate:n.mn})),r||n.on.resolve(t)},i=function(e){var t=e.data,r=e.ports,i=e.source;return aC(n.getSW(),function(){n.an.has(i)&&n.dispatchEvent(new aP("message",{data:t,originalEvent:e,ports:r,sw:i}))})},n.gn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(i.apply(this,e))}catch(e){return Promise.reject(e)}},n.sn=t,n.nn=r,navigator.serviceWorker.addEventListener("message",n.gn),n}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e;var r,n,i=t.prototype;return i.register=function(e){var t=(void 0===e?{}:e).immediate,r=void 0!==t&&t;try{var n,i,o,a=this;return n=function(){if(!r&&"complete"!==document.readyState)return aT(new Promise(function(e){return window.addEventListener("load",e)}))},i=function(){return a.mn=!!navigator.serviceWorker.controller,a.yn=a.pn(),aC(a.bn(),function(e){a.fn=e,a.yn&&(a.hn=a.yn,a.en.resolve(a.yn),a.on.resolve(a.yn),a.yn.addEventListener("statechange",a.ln,{once:!0}));var t=a.fn.waiting;return t&&aO(t.scriptURL,a.sn.toString())&&(a.hn=t,Promise.resolve().then(function(){a.dispatchEvent(new aP("waiting",{sw:t,wasWaitingBeforeRegister:!0}))}).then(function(){})),a.hn&&(a.rn.resolve(a.hn),a.an.add(a.hn)),a.fn.addEventListener("updatefound",a.cn),navigator.serviceWorker.addEventListener("controllerchange",a.dn),a.fn})},(o=n())&&o.then?o.then(i):i(o)}catch(e){return Promise.reject(e)}},i.update=function(){try{return this.fn?aT(this.fn.update()):void 0}catch(e){return Promise.reject(e)}},i.getSW=function(){return void 0!==this.hn?Promise.resolve(this.hn):this.rn.promise},i.messageSW=function(e){try{return aC(this.getSW(),function(t){return ax(t,e)})}catch(e){return Promise.reject(e)}},i.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&ax(this.fn.waiting,aj)},i.pn=function(){var e=navigator.serviceWorker.controller;return e&&aO(e.scriptURL,this.sn.toString())?e:void 0},i.bn=function(){try{var e=this;return function(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}(function(){return aC(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)}},r=[{key:"active",get:function(){return this.en.promise}},{key:"controlling",get:function(){return this.on.promise}}],aE(t.prototype,r),n&&aE(t,n),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,r=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 aS(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)?aS(e,void 0):void 0}}(e))){t&&(e=t);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}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=r()).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 aA(e,t){if(void 0!==p)return console.warn(`The application's Service Worker has already been registered. The new service worker at ${e} will not be registered.`),p;if(!("serviceWorker"in navigator))throw Error("Registering the Service Worker is not possible due to missing browser capabilities.");let r=new aR(e,t);return p=r.register().then(()=>r.controlling.then(()=>r))}function aN(){return p??Promise.resolve(void 0)}let aM="x-omrs-offline-response-body",aI="x-omrs-offline-response-status",a$="x-omrs-offline-caching-strategy";async function aL(e){let t=await aN();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 aF(){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 aB(){return!window.indexedDB}async function aV(){return new Promise(e=>{let t=indexedDB.open("test");t.onerror=()=>e(!0),t.onsuccess=()=>e(!1)})}async function aU(){return await aV()||await aB()||await aF()}let aW="openmrs3:offline-mode",aK="unavailable";function aH(){return{current:aK,notAvailable:"unavailable"===aK,active:"on"===aK}}function az(e){"unavailable"!==aK&&"unavailable"!==e&&(localStorage.setItem(aW,"on"===e?"active":"disabled"),aK=e)}async function aG(){await aU()||(aK="active"===localStorage.getItem(aW)?"on":"off"),navigator.onLine}let aq="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,aY=Object.keys,aZ=Array.isArray;function aJ(e,t){return"object"!=typeof t||aY(t).forEach(function(r){e[r]=t[r]}),e}"u"<typeof Promise||aq.Promise||(aq.Promise=Promise);let aX=Object.getPrototypeOf,aQ={}.hasOwnProperty;function a0(e,t){return aQ.call(e,t)}function a1(e,t){"function"==typeof t&&(t=t(aX(e))),("u"<typeof Reflect?aY:Reflect.ownKeys)(t).forEach(r=>{a4(e,r,t[r])})}let a3=Object.defineProperty;function a4(e,t,r,n){a3(e,t,aJ(r&&a0(r,"get")&&"function"==typeof r.get?{get:r.get,set:r.set,configurable:!0}:{value:r,configurable:!0,writable:!0},n))}function a2(e){return{from:function(t){return e.prototype=Object.create(t.prototype),a4(e.prototype,"constructor",e),{extend:a1.bind(null,e.prototype)}}}}let a6=Object.getOwnPropertyDescriptor;function a5(e,t){let r;return a6(e,t)||(r=aX(e))&&a5(r,t)}let a8=[].slice;function a9(e,t,r){return a8.call(e,t,r)}function a7(e,t){return t(e)}function se(e){if(!e)throw Error("Assertion Failed")}function st(e){aq.setImmediate?setImmediate(e):setTimeout(e,0)}function sr(e,t){return e.reduce((e,r,n)=>{var i=t(r,n);return i&&(e[i[0]]=i[1]),e},{})}function sn(e,t){if(a0(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var r=[],n=0,i=t.length;n<i;++n){var o=sn(e,t[n]);r.push(o)}return r}var a=t.indexOf(".");if(-1!==a){var s=e[t.substr(0,a)];return void 0===s?void 0:sn(s,t.substr(a+1))}}function si(e,t,r){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){se("string"!=typeof r&&"length"in r);for(var n=0,i=t.length;n<i;++n)si(e,t[n],r[n])}else{var o=t.indexOf(".");if(-1!==o){var a=t.substr(0,o),s=t.substr(o+1);if(""===s)void 0===r?aZ(e)&&!isNaN(parseInt(a))?e.splice(a,1):delete e[a]:e[a]=r;else{var l=e[a];l&&a0(e,a)||(l=e[a]={}),si(l,s,r)}}else void 0===r?aZ(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=r}}function so(e){var t={};for(var r in e)a0(e,r)&&(t[r]=e[r]);return t}let sa=[].concat;function ss(e){return sa.apply([],e)}let sl="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(ss([8,16,32,64].map(e=>["Int","Uint","Float"].map(t=>t+e+"Array")))).filter(e=>aq[e]),su=sl.map(e=>aq[e]);sr(sl,e=>[e,!0]);let sc=null;function sd(e){sc="u">typeof WeakMap&&new WeakMap;let t=function e(t){if(!t||"object"!=typeof t)return t;let r=sc&&sc.get(t);if(r)return r;if(aZ(t)){r=[],sc&&sc.set(t,r);for(var n=0,i=t.length;n<i;++n)r.push(e(t[n]))}else if(su.indexOf(t.constructor)>=0)r=t;else{let n=aX(t);for(var o in r=n===Object.prototype?{}:Object.create(n),sc&&sc.set(t,r),t)a0(t,o)&&(r[o]=e(t[o]))}return r}(e);return sc=null,t}let{toString:sp}={};function sf(e){return sp.call(e).slice(8,-1)}let sh="u">typeof Symbol?Symbol.iterator:"@@iterator",sm="symbol"==typeof sh?function(e){var t;return null!=e&&(t=e[sh])&&t.apply(e)}:function(){return null},sy={};function sg(e){var t,r,n,i;if(1==arguments.length){if(aZ(e))return e.slice();if(this===sy&&"string"==typeof e)return[e];if(i=sm(e)){for(r=[];!(n=i.next()).done;)r.push(n.value);return r}if(null==e)return[e];if("number"==typeof(t=e.length)){for(r=Array(t);t--;)r[t]=e[t];return r}return[e]}for(t=arguments.length,r=Array(t);t--;)r[t]=arguments[t];return r}let sb="u">typeof Symbol?e=>"AsyncFunction"===e[Symbol.toStringTag]:()=>!1;var sv="u">typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href),sw=()=>!0;let s_=!Error("").stack;function sx(){if(s_)try{throw sx.arguments,Error()}catch(e){return e}return Error()}function sE(e,t){var r=e.stack;return r?(t=t||0,0===r.indexOf(e.name)&&(t+=(e.name+e.message).split("\n").length),r.split("\n").slice(t).filter(sw).map(e=>"\n"+e).join("")):""}var sS=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],sD=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(sS),sO={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 sP(e,t){this._e=sx(),this.name=e,this.message=t}function sC(e,t){return e+". Errors: "+Object.keys(t).map(e=>t[e].toString()).filter((e,t,r)=>r.indexOf(e)===t).join("\n")}function sk(e,t,r,n){this._e=sx(),this.failures=t,this.failedKeys=n,this.successCount=r,this.message=sC(e,t)}function sj(e,t){this._e=sx(),this.name="BulkError",this.failures=Object.keys(t).map(e=>t[e]),this.failuresByPos=t,this.message=sC(e,t)}a2(sP).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+sE(this._e,2))}},toString:function(){return this.name+": "+this.message}}),a2(sk).from(sP),a2(sj).from(sP);var sT=sD.reduce((e,t)=>(e[t]=t+"Error",e),{}),sR=sD.reduce((e,t)=>{var r=t+"Error";function n(e,n){this._e=sx(),this.name=r,e?"string"==typeof e?(this.message=`${e}${n?"\n "+n:""}`,this.inner=n||null):"object"==typeof e&&(this.message=`${e.name} ${e.message}`,this.inner=e):(this.message=sO[t]||r,this.inner=null)}return a2(n).from(sP),e[t]=n,e},{});sR.Syntax=SyntaxError,sR.Type=TypeError,sR.Range=RangeError;var sA=sS.reduce((e,t)=>(e[t+"Error"]=sR[t],e),{}),sN=sD.reduce((e,t)=>(-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=sR[t]),e),{});function sM(){}function sI(e){return e}function s$(e,t){return null==e||e===sI?t:function(r){return t(e(r))}}function sL(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function sF(e,t){return e===sM?t:function(){var r=e.apply(this,arguments);void 0!==r&&(arguments[0]=r);var n=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return n&&(this.onsuccess=this.onsuccess?sL(n,this.onsuccess):n),i&&(this.onerror=this.onerror?sL(i,this.onerror):i),void 0!==o?o:r}}function sB(e,t){return e===sM?t:function(){e.apply(this,arguments);var r=this.onsuccess,n=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),r&&(this.onsuccess=this.onsuccess?sL(r,this.onsuccess):r),n&&(this.onerror=this.onerror?sL(n,this.onerror):n)}}function sV(e,t){return e===sM?t:function(r){var n=e.apply(this,arguments);aJ(r,n);var i=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return i&&(this.onsuccess=this.onsuccess?sL(i,this.onsuccess):i),o&&(this.onerror=this.onerror?sL(o,this.onerror):o),void 0===n?void 0===a?void 0:a:aJ(n,a)}}function sU(e,t){return e===sM?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function sW(e,t){return e===sM?t:function(){var r=e.apply(this,arguments);if(r&&"function"==typeof r.then){for(var n=this,i=arguments.length,o=Array(i);i--;)o[i]=arguments[i];return r.then(function(){return t.apply(n,o)})}return t.apply(this,arguments)}}sN.ModifyError=sk,sN.DexieError=sP,sN.BulkError=sj;var sK={};let[sH,sz,sG]="u"<typeof Promise?[]:(()=>{let e=Promise.resolve();if("u"<typeof crypto||!crypto.subtle)return[e,aX(e),e];let t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,aX(t),e]})(),sq=sz&&sz.then,sY=sH&&sH.constructor,sZ=!!sG;var sJ=!1,sX=sG?()=>{sG.then(lu)}:aq.setImmediate?setImmediate.bind(null,lu):aq.MutationObserver?()=>{var e=document.createElement("div");new MutationObserver(()=>{lu(),e=null}).observe(e,{attributes:!0}),e.setAttribute("i","1")}:()=>{setTimeout(lu,0)},sQ=function(e,t){s9.push([e,t]),s1&&(sX(),s1=!1)},s0=!0,s1=!0,s3=[],s4=[],s2=null,s6=sI,s5={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:lA,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach(e=>{try{lA(e[0],e[1])}catch(e){}})}},s8=s5,s9=[],s7=0,le=[];function lt(e){if("object"!=typeof this)throw TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=sM,this._lib=!1;var t=this._PSD=s8;if(sv&&(this._stackHolder=sx(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==sK)throw TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&li(this,this._value))}this._state=null,this._value=null,++t.ref,function e(t,r){try{r(r=>{if(null===t._state){if(r===t)throw TypeError("A promise cannot be resolved with itself.");var n=t._lib&&lc();r&&"function"==typeof r.then?e(t,(e,t)=>{r instanceof lt?r._then(e,t):r.then(e,t)}):(t._state=!0,t._value=r,lo(t)),n&&ld()}},li.bind(null,t))}catch(e){li(t,e)}}(this,e)}let lr={get:function(){var e=s8,t=lv;function r(r,n){var i=!e.global&&(e!==s8||t!==lv);let o=i&&!lE();var a=new lt((t,a)=>{la(this,new ln(lj(r,e,i,o),lj(n,e,i,o),t,a,e))});return sv&&ll(a,this),a}return r.prototype=sK,r},set:function(e){a4(this,"then",e&&e.prototype===sK?lr:{get:function(){return e},set:lr.set})}};function ln(e,t,r,n,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=r,this.reject=n,this.psd=i}function li(e,t){if(s4.push(t),null===e._state){var r=e._lib&&lc();t=s6(t),e._state=!1,e._value=t,sv&&null!==t&&"object"==typeof t&&!t._promise&&function(e){try{e.apply(null,void 0)}catch(e){}}(()=>{var r=a5(t,"stack");t._promise=e,a4(t,"stack",{get:()=>sJ?r&&(r.get?r.get.apply(t):r.value):e.stack})}),s3.some(t=>t._value===e._value)||s3.push(e),lo(e),r&&ld()}}function lo(e){var t=e._listeners;e._listeners=[];for(var r=0,n=t.length;r<n;++r)la(e,t[r]);var i=e._PSD;--i.ref||i.finalize(),0===s7&&(++s7,sQ(()=>{0==--s7&&lp()},[]))}function la(e,t){if(null!==e._state){var r=e._state?t.onFulfilled:t.onRejected;if(null===r)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++s7,sQ(ls,[r,e,t])}else e._listeners.push(t)}function ls(e,t,r){try{s2=t;var n,i=t._value;t._state?n=e(i):(s4.length&&(s4=[]),n=e(i),-1===s4.indexOf(i)&&function(e){for(var t=s3.length;t;)if(s3[--t]._value===e._value)return void s3.splice(t,1)}(t)),r.resolve(n)}catch(e){r.reject(e)}finally{s2=null,0==--s7&&lp(),--r.psd.ref||r.psd.finalize()}}function ll(e,t){var r=t?t._numPrev+1:0;r<100&&(e._prev=t,e._numPrev=r)}function lu(){lc()&&ld()}function lc(){var e=s0;return s0=!1,s1=!1,e}function ld(){var e,t,r;do for(;s9.length>0;)for(e=s9,s9=[],r=e.length,t=0;t<r;++t){var n=e[t];n[0].apply(null,n[1])}while(s9.length>0);s0=!0,s1=!0}function lp(){var e=s3;s3=[],e.forEach(e=>{e._PSD.onunhandled.call(null,e._value,e)});for(var t=le.slice(0),r=t.length;r;)t[--r]()}function lf(e){return new lt(sK,!1,e)}function lh(e,t){var r=s8;return function(){var n=lc(),i=s8;try{return lP(r,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{lP(i,!1),n&&ld()}}}a1(lt.prototype,{then:lr,_then:function(e,t){la(this,new ln(null,null,e,t,s8))},catch:function(e){if(1==arguments.length)return this.then(null,e);var t=arguments[0],r=arguments[1];return"function"==typeof t?this.then(null,e=>e instanceof t?r(e):lf(e)):this.then(null,e=>e&&e.name===t?r(e):lf(e))},finally:function(e){return this.then(t=>(e(),t),t=>(e(),lf(t)))},stack:{get:function(){if(this._stack)return this._stack;try{sJ=!0;var e=(function e(t,r,n){if(r.length===n)return r;var i="";if(!1===t._state){var o,a,s=t._value;null!=s?(o=s.name||"Error",a=s.message||s,i=sE(s,0)):(o=s,a=""),r.push(o+(a?": "+a:"")+i)}return sv&&((i=sE(t._stackHolder,2))&&-1===r.indexOf(i)&&r.push(i),t._prev&&e(t._prev,r,n)),r})(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{sJ=!1}}},timeout:function(e,t){return e<1/0?new lt((r,n)=>{var i=setTimeout(()=>n(new sR.Timeout(t)),e);this.then(r,n).finally(clearTimeout.bind(null,i))}):this}}),"u">typeof Symbol&&Symbol.toStringTag&&a4(lt.prototype,Symbol.toStringTag,"Dexie.Promise"),s5.env=lC(),a1(lt,{all:function(){var e=sg.apply(null,arguments).map(lS);return new lt(function(t,r){0===e.length&&t([]);var n=e.length;e.forEach((i,o)=>lt.resolve(i).then(r=>{e[o]=r,--n||t(e)},r))})},resolve:e=>{if(e instanceof lt)return e;if(e&&"function"==typeof e.then)return new lt((t,r)=>{e.then(t,r)});var t=new lt(sK,!0,e);return ll(t,s2),t},reject:lf,race:function(){var e=sg.apply(null,arguments).map(lS);return new lt((t,r)=>{e.map(e=>lt.resolve(e).then(t,r))})},PSD:{get:()=>s8,set:e=>s8=e},totalEchoes:{get:()=>lv},newPSD:l_,usePSD:lk,scheduler:{get:()=>sQ,set:e=>{sQ=e}},rejectionMapper:{get:()=>s6,set:e=>{s6=e}},follow:(e,t)=>new lt((r,n)=>l_((t,r)=>{var n=s8;n.unhandleds=[],n.onunhandled=r,n.finalize=sL(function(){var e;e=()=>{0===this.unhandleds.length?t():r(this.unhandleds[0])},le.push(function t(){e(),le.splice(le.indexOf(t),1)}),++s7,sQ(()=>{0==--s7&&lp()},[])},n.finalize),e()},t,r,n))}),sY&&(sY.allSettled&&a4(lt,"allSettled",function(){let e=sg.apply(null,arguments).map(lS);return new lt(t=>{0===e.length&&t([]);let r=e.length,n=Array(r);e.forEach((e,i)=>lt.resolve(e).then(e=>n[i]={status:"fulfilled",value:e},e=>n[i]={status:"rejected",reason:e}).then(()=>--r||t(n)))})}),sY.any&&"u">typeof AggregateError&&a4(lt,"any",function(){let e=sg.apply(null,arguments).map(lS);return new lt((t,r)=>{0===e.length&&r(AggregateError([]));let n=e.length,i=Array(n);e.forEach((e,o)=>lt.resolve(e).then(e=>t(e),e=>{i[o]=e,--n||r(AggregateError(i))}))})}));let lm={awaits:0,echoes:0,id:0};var ly=0,lg=[],lb=0,lv=0,lw=0;function l_(e,t,r,n){var i=s8,o=Object.create(i);o.parent=i,o.ref=0,o.global=!1,o.id=++lw;var a=s5.env;o.env=sZ?{Promise:lt,PromiseProp:{value:lt,configurable:!0,writable:!0},all:lt.all,race:lt.race,allSettled:lt.allSettled,any:lt.any,resolve:lt.resolve,reject:lt.reject,nthen:lT(a.nthen,o),gthen:lT(a.gthen,o)}:{},t&&aJ(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()};var s=lk(o,e,r,n);return 0===o.ref&&o.finalize(),s}function lx(){return lm.id||(lm.id=++ly),++lm.awaits,lm.echoes+=100,lm.id}function lE(){return!!lm.awaits&&(0==--lm.awaits&&(lm.id=0),lm.echoes=100*lm.awaits,!0)}function lS(e){return lm.echoes&&e&&e.constructor===sY?(lx(),e.then(e=>(lE(),e),e=>(lE(),lN(e)))):e}function lD(e){++lv,lm.echoes&&0!=--lm.echoes||(lm.echoes=lm.id=0),lg.push(s8),lP(e,!0)}function lO(){var e=lg[lg.length-1];lg.pop(),lP(e,!1)}function lP(e,t){var r,n=s8;if((t?!lm.echoes||lb++&&e===s8:!lb||--lb&&e===s8)||(r=t?lD.bind(null,e):lO,sq.call(sH,r)),e!==s8&&(s8=e,n===s5&&(s5.env=lC()),sZ)){var i=s5.env.Promise,o=e.env;sz.then=o.nthen,i.prototype.then=o.gthen,(n.global||e.global)&&(Object.defineProperty(aq,"Promise",o.PromiseProp),i.all=o.all,i.race=o.race,i.resolve=o.resolve,i.reject=o.reject,o.allSettled&&(i.allSettled=o.allSettled),o.any&&(i.any=o.any))}}function lC(){var e=aq.Promise;return sZ?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(aq,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:sz.then,gthen:e.prototype.then}:{}}function lk(e,t,r,n,i){var o=s8;try{return lP(e,!0),t(r,n,i)}finally{lP(o,!1)}}function lj(e,t,r,n){return"function"!=typeof e?e:function(){var i,o=s8;r&&lx(),lP(t,!0);try{return e.apply(this,arguments)}finally{lP(o,!1),n&&(i=lE,sq.call(sH,i))}}}function lT(e,t){return function(r,n){return e.call(this,lj(r,t),lj(n,t))}}-1===(""+sq).indexOf("[native code]")&&(lx=lE=sM);let lR="unhandledrejection";function lA(e,t){var r;try{r=t.onuncatched(e)}catch(e){}if(!1!==r)try{var n,i={promise:t,reason:e};if(aq.document&&document.createEvent?((n=document.createEvent("Event")).initEvent(lR,!0,!0),aJ(n,i)):aq.CustomEvent&&aJ(n=new CustomEvent(lR,{detail:i}),i),n&&aq.dispatchEvent&&(dispatchEvent(n),!aq.PromiseRejectionEvent&&aq.onunhandledrejection))try{aq.onunhandledrejection(n)}catch(e){}sv&&n&&!n.defaultPrevented&&console.warn(`Unhandled rejection: ${e.stack||e}`)}catch(e){}}var lN=lt.reject;let lM="3.2.4",lI=String.fromCharCode(65535),l$=-1/0,lL="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",lF="String expected.",lB=[],lV="u">typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),lU=e=>!/(dexie\.js|dexie\.min\.js)/.test(e),lW="__dbnames",lK="readonly",lH="readwrite";function lz(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}let lG={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function lq(e){return"string"!=typeof e||/\./.test(e)?e=>e:t=>(void 0===t[e]&&e in t&&delete(t=sd(t))[e],t)}class lY{_trans(e,t,r){let n=this._tx||s8.trans,i=this.name;function o(e,r,n){if(!n.schema[i])throw new sR.NotFound("Table "+i+" not part of transaction");return t(n.idbtrans,n)}let a=lc();try{return n&&n.db===this.db?n===s8.trans?n._promise(e,o,r):l_(()=>n._promise(e,o,r),{trans:n,transless:s8.transless||s8}):function e(t,r,n,i){if(t.idbdb&&(t._state.openComplete||s8.letThrough||t._vip)){var o=t._createTransaction(r,n,t._dbSchema);try{o.create(),t._state.PR1398_maxLoop=3}catch(o){return o.name===sT.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then(()=>e(t,r,n,i))):lN(o)}return o._promise(r,(e,t)=>l_(()=>(s8.trans=o,i(e,t,o)))).then(e=>o._completion.then(()=>e))}if(t._state.openComplete)return lN(new sR.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._options.autoOpen)return lN(new sR.DatabaseClosed);t.open().catch(sM)}return t._state.dbReadyPromise.then(()=>e(t,r,n,i))}(this.db,e,[this.name],o)}finally{a&&ld()}}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(aZ(e))return new this.db.WhereClause(this,`[${e.join("+")}]`);let t=aY(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);let r=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(r&&this.db._maxKey!==lI)return this.where(r.name).equals(r.keyPath.map(t=>e[t]));!r&&sv&&console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit of a compound index [${t.join("+")}]`);let{idxByName:n}=this.schema,i=this.db._deps.indexedDB;function o(e,t){try{return 0===i.cmp(e,t)}catch(e){return!1}}let[a,s]=t.reduce(([t,r],i)=>{let a=n[i],s=e[i];return[t||a,t||!a?lz(r,a&&a.multi?e=>{let t=sn(e,i);return aZ(t)&&t.some(e=>o(s,e))}:e=>o(s,sn(e,i))):r]},[null,null]);return a?this.where(a.name).equals(e[a.keyPath]).filter(s):r?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,aZ(e)?`[${e.join("+")}]`:e))}reverse(){return this.toCollection().reverse()}mapToClass(e){this.schema.mappedClass=e;let t=t=>{if(!t)return t;let r=Object.create(e.prototype);for(var n in t)if(a0(t,n))try{r[n]=t[n]}catch(e){}return r};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){aJ(this,e)})}add(e,t){let{auto:r,keyPath:n}=this.schema.primKey,i=e;return n&&r&&(i=lq(n)(e)),this._trans("readwrite",e=>this.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[i]})).then(e=>e.numFailures?lt.reject(e.failures[0]):e.lastResult).then(t=>{if(n)try{si(e,n,t)}catch(e){}return t})}update(e,t){if("object"!=typeof e||aZ(e))return this.where(":id").equals(e).modify(t);{let r=sn(e,this.schema.primKey.keyPath);if(void 0===r)return lN(new sR.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?aY(t).forEach(r=>{si(e,r,t[r])}):t(e,{value:e,primKey:r})}catch(e){}return this.where(":id").equals(r).modify(t)}}put(e,t){let{auto:r,keyPath:n}=this.schema.primKey,i=e;return n&&r&&(i=lq(n)(e)),this._trans("readwrite",e=>this.core.mutate({trans:e,type:"put",values:[i],keys:null!=t?[t]:null})).then(e=>e.numFailures?lt.reject(e.failures[0]):e.lastResult).then(t=>{if(n)try{si(e,n,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?lt.reject(e.failures[0]):void 0)}clear(){return this._trans("readwrite",e=>this.core.mutate({trans:e,type:"deleteRange",range:lG})).then(e=>e.numFailures?lt.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,r){let n=Array.isArray(t)?t:void 0,i=(r=r||(n?void 0:t))?r.allKeys:void 0;return this._trans("readwrite",t=>{let{auto:r,keyPath:o}=this.schema.primKey;if(o&&n)throw new sR.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(n&&n.length!==e.length)throw new sR.InvalidArgument("Arguments objects and keys must have the same length");let a=e.length,s=o&&r?e.map(lq(o)):e;return this.core.mutate({trans:t,type:"add",keys:n,values:s,wantResults:i}).then(({numFailures:e,results:t,lastResult:r,failures:n})=>{if(0===e)return i?t:r;throw new sj(`${this.name}.bulkAdd(): ${e} of ${a} operations failed`,n)})})}bulkPut(e,t,r){let n=Array.isArray(t)?t:void 0,i=(r=r||(n?void 0:t))?r.allKeys:void 0;return this._trans("readwrite",t=>{let{auto:r,keyPath:o}=this.schema.primKey;if(o&&n)throw new sR.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(n&&n.length!==e.length)throw new sR.InvalidArgument("Arguments objects and keys must have the same length");let a=e.length,s=o&&r?e.map(lq(o)):e;return this.core.mutate({trans:t,type:"put",keys:n,values:s,wantResults:i}).then(({numFailures:e,results:t,lastResult:r,failures:n})=>{if(0===e)return i?t:r;throw new sj(`${this.name}.bulkPut(): ${e} of ${a} operations failed`,n)})})}bulkDelete(e){let t=e.length;return this._trans("readwrite",t=>this.core.mutate({trans:t,type:"delete",keys:e})).then(({numFailures:e,lastResult:r,failures:n})=>{if(0===e)return r;throw new sj(`${this.name}.bulkDelete(): ${e} of ${t} operations failed`,n)})}}function lZ(e){var t={},r=function(r,n){if(n){for(var i=arguments.length,o=Array(i-1);--i;)o[i-1]=arguments[i];return t[r].subscribe.apply(null,o),e}if("string"==typeof r)return t[r]};r.addEventType=o;for(var n=1,i=arguments.length;n<i;++n)o(arguments[n]);return r;function o(e,n,i){if("object"!=typeof e){n||(n=sU),i||(i=sM);var a={subscribers:[],fire:i,subscribe:function(e){-1===a.subscribers.indexOf(e)&&(a.subscribers.push(e),a.fire=n(a.fire,e))},unsubscribe:function(e){a.subscribers=a.subscribers.filter(function(t){return t!==e}),a.fire=a.subscribers.reduce(n,i)}};return t[e]=r[e]=a,a}aY(e).forEach(function(t){var r=e[t];if(aZ(r))o(t,e[t][0],e[t][1]);else{if("asap"!==r)throw new sR.InvalidArgument("Invalid event config");var n=o(t,sI,function(){for(var e=arguments.length,t=Array(e);e--;)t[e]=arguments[e];n.subscribers.forEach(function(e){st(function(){e.apply(null,t)})})})}})}}function lJ(e,t){return a2(t).from({prototype:e}),t}function lX(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function lQ(e,t){e.filter=lz(e.filter,t)}function l0(e,t,r){var n=e.replayFilter;e.replayFilter=n?()=>lz(n(),t()):t,e.justLimit=r&&!n}function l1(e,t){if(e.isPrimKey)return t.primaryKey;let r=t.getIndexByKeyPath(e.index);if(!r)throw new sR.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return r}function l3(e,t,r){let n=l1(e,t.schema);return t.openCursor({trans:r,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:n,range:e.range}})}function l4(e,t,r,n){let i=e.replayFilter?lz(e.filter,e.replayFilter()):e.filter;if(e.or){let o={},a=(e,r,n)=>{if(!i||i(r,n,e=>r.stop(e),e=>r.fail(e))){var a=r.primaryKey,s=""+a;"[object ArrayBuffer]"===s&&(s=""+new Uint8Array(a)),a0(o,s)||(o[s]=!0,t(e,r,n))}};return Promise.all([e.or._iterate(a,r),l2(l3(e,n,r),e.algorithm,a,!e.keysOnly&&e.valueMapper)])}return l2(l3(e,n,r),lz(e.algorithm,i),t,!e.keysOnly&&e.valueMapper)}function l2(e,t,r,n){var i=lh(n?(e,t,i)=>r(n(e),t,i):r);return e.then(e=>{if(e)return e.start(()=>{var r=()=>e.continue();t&&!t(e,e=>r=e,t=>{e.stop(t),r=sM},t=>{e.fail(t),r=sM})||i(e.value,e,e=>r=e),r()})})}function l6(e,t){try{let r=l5(e),n=l5(t);if(r!==n)return"Array"===r?1:"Array"===n?-1:"binary"===r?1:"binary"===n?-1:"string"===r?1:"string"===n?-1:"Date"===r?1:"Date"!==n?NaN:-1;switch(r){case"number":case"Date":case"string":return e>t?1:e<t?-1:0;case"binary":return function(e,t){let r=e.length,n=t.length,i=r<n?r:n;for(let r=0;r<i;++r)if(e[r]!==t[r])return e[r]<t[r]?-1:1;return r===n?0:r<n?-1:1}(l8(e),l8(t));case"Array":return function(e,t){let r=e.length,n=t.length,i=r<n?r:n;for(let r=0;r<i;++r){let n=l6(e[r],t[r]);if(0!==n)return n}return r===n?0:r<n?-1:1}(e,t)}}catch(e){}return NaN}function l5(e){let t=typeof e;if("object"!==t)return t;if(ArrayBuffer.isView(e))return"binary";let r=sf(e);return"ArrayBuffer"===r?"binary":r}function l8(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}class l9{_read(e,t){var r=this._ctx;return r.error?r.table._trans(null,lN.bind(null,r.error)):r.table._trans("readonly",e).then(t)}_write(e){var t=this._ctx;return t.error?t.table._trans(null,lN.bind(null,t.error)):t.table._trans("readwrite",e,"locked")}_addAlgorithm(e){var t=this._ctx;t.algorithm=lz(t.algorithm,e)}_iterate(e,t){return l4(this._ctx,e,t,this._ctx.table.core)}clone(e){var t=Object.create(this.constructor.prototype),r=Object.create(this._ctx);return e&&aJ(r,e),t._ctx=r,t}raw(){return this._ctx.valueMapper=null,this}each(e){var t=this._ctx;return this._read(r=>l4(t,e,r,t.table.core))}count(e){return this._read(e=>{let t=this._ctx,r=t.table.core;if(lX(t,!0))return r.count({trans:e,query:{index:l1(t,r.schema),range:t.range}}).then(e=>Math.min(e,t.limit));var n=0;return l4(t,()=>(++n,!1),e,r).then(()=>n)}).then(e)}sortBy(e,t){let r=e.split(".").reverse(),n=r[0],i=r.length-1;function o(e,t){return t?o(e[r[t]],t-1):e[n]}var a="next"===this._ctx.dir?1:-1;function s(e,t){var r=o(e,i),n=o(t,i);return r<n?-a:r>n?a: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&&lX(t,!0)&&t.limit>0){let{valueMapper:r}=t,n=l1(t,t.table.core.schema);return t.table.core.query({trans:e,limit:t.limit,values:!0,query:{index:n,range:t.range}}).then(({result:e})=>r?e.map(r):e)}{let r=[];return l4(t,e=>r.push(e),e,t.table.core).then(()=>r)}},e)}offset(e){var t=this._ctx;return e<=0||(t.offset+=e,lX(t)?l0(t,()=>{var t=e;return(e,r)=>0===t||(1===t?--t:r(()=>{e.advance(t),t=0}),!1)}):l0(t,()=>{var t=e;return()=>--t<0})),this}limit(e){return this._ctx.limit=Math.min(this._ctx.limit,e),l0(this._ctx,()=>{var t=e;return function(e,r,n){return--t<=0&&r(n),t>=0}},!0),this}until(e,t){return lQ(this._ctx,function(r,n,i){return!e(r.value)||(n(i),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 lQ(this._ctx,function(t){return e(t.value)}),(t=this._ctx).isMatch=lz(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,r){e(r.key,r)})}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,r){e(r.primaryKey,r)})}keys(e){var t=this._ctx;t.keysOnly=!t.isMatch;var r=[];return this.each(function(e,t){r.push(t.key)}).then(function(){return r}).then(e)}primaryKeys(e){var t=this._ctx;if("next"===t.dir&&lX(t,!0)&&t.limit>0)return this._read(e=>{var r=l1(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:r,range:t.range}})}).then(({result:e})=>e).then(e);t.keysOnly=!t.isMatch;var r=[];return this.each(function(e,t){r.push(t.primaryKey)}).then(function(){return r}).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 r={};return lQ(this._ctx,function(e){var t=e.primaryKey.toString(),n=a0(r,t);return r[t]=!0,!n}),this}modify(e){var t=this._ctx;return this._write(r=>{var n;if("function"==typeof e)n=e;else{var i=aY(e),o=i.length;n=function(t){for(var r=!1,n=0;n<o;++n){var a=i[n],s=e[a];sn(t,a)!==s&&(si(t,a,s),r=!0)}return r}}let a=t.table.core,{outbound:s,extractKey:l}=a.schema.primaryKey,u=this.db._options.modifyChunkSize||200,c=[],d=0,p=[],f=(e,t)=>{let{failures:r,numFailures:n}=t;for(let t of(d+=e-n,aY(r)))c.push(r[t])};return this.clone().primaryKeys().then(i=>{let o=c=>{let d=Math.min(u,i.length-c);return a.getMany({trans:r,keys:i.slice(c,c+d),cache:"immutable"}).then(p=>{let h=[],m=[],y=s?[]:null,g=[];for(let e=0;e<d;++e){let t=p[e],r={value:sd(t),primKey:i[c+e]};!1!==n.call(r,r.value,r)&&(null==r.value?g.push(i[c+e]):s||0===l6(l(t),l(r.value))?(m.push(r.value),s&&y.push(i[c+e])):(g.push(i[c+e]),h.push(r.value)))}let b=lX(t)&&t.limit===1/0&&("function"!=typeof e||e===l7)&&{index:t.index,range:t.range};return Promise.resolve(h.length>0&&a.mutate({trans:r,type:"add",values:h}).then(e=>{for(let t in e.failures)g.splice(parseInt(t),1);f(h.length,e)})).then(()=>(m.length>0||b&&"object"==typeof e)&&a.mutate({trans:r,type:"put",keys:y,values:m,criteria:b,changeSpec:"function"!=typeof e&&e}).then(e=>f(m.length,e))).then(()=>(g.length>0||b&&e===l7)&&a.mutate({trans:r,type:"delete",keys:g,criteria:b}).then(e=>f(g.length,e))).then(()=>i.length>c+d&&o(c+u))})};return o(0).then(()=>{if(c.length>0)throw new sk("Error modifying one or more objects",c,d,p);return i.length})})})}delete(){var e=this._ctx,t=e.range;return lX(e)&&(e.isPrimKey&&!lV||3===t.type)?this._write(r=>{let{primaryKey:n}=e.table.core.schema;return e.table.core.count({trans:r,query:{index:n,range:t}}).then(n=>e.table.core.mutate({trans:r,type:"deleteRange",range:t}).then(({failures:e,lastResult:t,results:r,numFailures:i})=>{if(i)throw new sk("Could not delete some values",Object.keys(e).map(t=>e[t]),n-i);return n-i}))}):this.modify(l7)}}let l7=(e,t)=>t.value=null;function ue(e,t){return e<t?-1:+(e!==t)}function ut(e,t){return e>t?-1:+(e!==t)}function ur(e,t,r){var n=e instanceof us?new e.Collection(e):e;return n._ctx.error=r?new r(t):TypeError(t),n}function un(e){return new e.Collection(e,()=>ua("")).limit(0)}function ui(e,t,r,n){var i,o,a,s,l,u,c,d=r.length;if(!r.every(e=>"string"==typeof e))return ur(e,lF);function p(e){i="next"===e?e=>e.toUpperCase():e=>e.toLowerCase(),o="next"===e?e=>e.toLowerCase():e=>e.toUpperCase(),a="next"===e?ue:ut;var t=r.map(function(e){return{lower:o(e),upper:i(e)}}).sort(function(e,t){return a(e.lower,t.lower)});s=t.map(function(e){return e.upper}),l=t.map(function(e){return e.lower}),u=e,c="next"===e?"":n}p("next");var f=new e.Collection(e,()=>uo(s[0],l[d-1]+n));f._ondirectionchange=function(e){p(e)};var h=0;return f._addAlgorithm(function(e,r,n){var i=e.key;if("string"!=typeof i)return!1;var p=o(i);if(t(p,l,h))return!0;for(var f=null,m=h;m<d;++m){var y=function(e,t,r,n,i,o){for(var a=Math.min(e.length,n.length),s=-1,l=0;l<a;++l){var u=t[l];if(u!==n[l])return 0>i(e[l],r[l])?e.substr(0,l)+r[l]+r.substr(l+1):0>i(e[l],n[l])?e.substr(0,l)+n[l]+r.substr(l+1):s>=0?e.substr(0,s)+t[s]+r.substr(s+1):null;0>i(e[l],u)&&(s=l)}return a<n.length&&"next"===o?e+r.substr(e.length):a<e.length&&"prev"===o?e.substr(0,r.length):s<0?null:e.substr(0,s)+n[s]+r.substr(s+1)}(i,p,s[m],l[m],a,u);null===y&&null===f?h=m+1:(null===f||a(f,y)>0)&&(f=y)}return r(null!==f?function(){e.continue(f+c)}:n),!1}),f}function uo(e,t,r,n){return{type:2,lower:e,upper:t,lowerOpen:r,upperOpen:n}}function ua(e){return{type:1,lower:e,upper:e}}class us{get Collection(){return this._ctx.table.db.Collection}between(e,t,r,n){r=!1!==r,n=!0===n;try{return this._cmp(e,t)>0||0===this._cmp(e,t)&&(r||n)&&(!r||!n)?un(this):new this.Collection(this,()=>uo(e,t,!r,!n))}catch(e){return ur(this,lL)}}equals(e){return null==e?ur(this,lL):new this.Collection(this,()=>ua(e))}above(e){return null==e?ur(this,lL):new this.Collection(this,()=>uo(e,void 0,!0))}aboveOrEqual(e){return null==e?ur(this,lL):new this.Collection(this,()=>uo(e,void 0,!1))}below(e){return null==e?ur(this,lL):new this.Collection(this,()=>uo(void 0,e,!1,!0))}belowOrEqual(e){return null==e?ur(this,lL):new this.Collection(this,()=>uo(void 0,e))}startsWith(e){return"string"!=typeof e?ur(this,lF):this.between(e,e+lI,!0,!0)}startsWithIgnoreCase(e){return""===e?this.startsWith(e):ui(this,(e,t)=>0===e.indexOf(t[0]),[e],lI)}equalsIgnoreCase(e){return ui(this,(e,t)=>e===t[0],[e],"")}anyOfIgnoreCase(){var e=sg.apply(sy,arguments);return 0===e.length?un(this):ui(this,(e,t)=>-1!==t.indexOf(e),e,"")}startsWithAnyOfIgnoreCase(){var e=sg.apply(sy,arguments);return 0===e.length?un(this):ui(this,(e,t)=>t.some(t=>0===e.indexOf(t)),e,lI)}anyOf(){let e=sg.apply(sy,arguments),t=this._cmp;try{e.sort(t)}catch(e){return ur(this,lL)}if(0===e.length)return un(this);let r=new this.Collection(this,()=>uo(e[0],e[e.length-1]));r._ondirectionchange=r=>{t="next"===r?this._ascending:this._descending,e.sort(t)};let n=0;return r._addAlgorithm((r,i,o)=>{let a=r.key;for(;t(a,e[n])>0;)if(++n===e.length)return i(o),!1;return 0===t(a,e[n])||(i(()=>{r.continue(e[n])}),!1)}),r}notEqual(e){return this.inAnyRange([[l$,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){let e=sg.apply(sy,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return ur(this,lL)}let t=e.reduce((e,t)=>e?e.concat([[e[e.length-1][1],t]]):[[l$,t]],null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})}inAnyRange(e,t){let r=this._cmp,n=this._ascending,i=this._descending,o=this._min,a=this._max;if(0===e.length)return un(this);if(!e.every(e=>void 0!==e[0]&&void 0!==e[1]&&0>=n(e[0],e[1])))return ur(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",sR.InvalidArgument);let s=!t||!1!==t.includeLowers,l=t&&!0===t.includeUppers,u,c=n;function d(e,t){return c(e[0],t[0])}try{(u=e.reduce(function(e,t){let n=0,i=e.length;for(;n<i;++n){let i=e[n];if(0>r(t[0],i[1])&&r(t[1],i[0])>0){i[0]=o(i[0],t[0]),i[1]=a(i[1],t[1]);break}}return n===i&&e.push(t),e},[])).sort(d)}catch(e){return ur(this,lL)}let p=0,f=l?e=>n(e,u[p][1])>0:e=>n(e,u[p][1])>=0,h=s?e=>i(e,u[p][0])>0:e=>i(e,u[p][0])>=0,m=f,y=new this.Collection(this,()=>uo(u[0][0],u[u.length-1][1],!s,!l));return y._ondirectionchange=e=>{"next"===e?(m=f,c=n):(m=h,c=i),u.sort(d)},y._addAlgorithm((e,t,r)=>{for(var i=e.key;m(i);)if(++p===u.length)return t(r),!1;return!!(!f(i)&&!h(i))||(0===this._cmp(i,u[p][1])||0===this._cmp(i,u[p][0])||t(()=>{c===n?e.continue(u[p][0]):e.continue(u[p][1])}),!1)}),y}startsWithAnyOf(){let e=sg.apply(sy,arguments);return e.every(e=>"string"==typeof e)?0===e.length?un(this):this.inAnyRange(e.map(e=>[e,e+lI])):ur(this,"startsWithAnyOf() only works with strings")}}function ul(e){return lh(function(t){return uu(t),e(t.target.error),!1})}function uu(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}let uc="storagemutated",ud="x-storagemutated-1",up=lZ(null,uc);class uf{_lock(){return se(!s8.global),++this._reculock,1!==this._reculock||s8.global||(s8.lockOwnerFor=this),this}_unlock(){if(se(!s8.global),0==--this._reculock)for(s8.global||(s8.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{lk(e[1],e[0])}catch(e){}}return this}_locked(){return this._reculock&&s8.lockOwnerFor!==this}create(e){if(!this.mode)return this;let t=this.db.idbdb,r=this.db._state.dbOpenError;if(se(!this.idbtrans),!e&&!t)switch(r&&r.name){case"DatabaseClosedError":throw new sR.DatabaseClosed(r);case"MissingAPIError":throw new sR.MissingAPI(r.message,r);default:throw new sR.OpenFailed(r)}if(!this.active)throw new sR.TransactionInactive;return se(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=lh(t=>{uu(t),this._reject(e.error)}),e.onabort=lh(t=>{uu(t),this.active&&this._reject(new sR.Abort(e.error)),this.active=!1,this.on("abort").fire(t)}),e.oncomplete=lh(()=>{this.active=!1,this._resolve(),"mutatedParts"in e&&up.storagemutated.fire(e.mutatedParts)}),this}_promise(e,t,r){if("readwrite"===e&&"readwrite"!==this.mode)return lN(new sR.ReadOnly("Transaction is readonly"));if(!this.active)return lN(new sR.TransactionInactive);if(this._locked())return new lt((n,i)=>{this._blockedFuncs.push([()=>{this._promise(e,t,r).then(n,i)},s8])});if(r)return l_(()=>{var e=new lt((e,r)=>{this._lock();let n=t(e,r,this);n&&n.then&&n.then(e,r)});return e.finally(()=>this._unlock()),e._lib=!0,e});var n=new lt((e,r)=>{var n=t(e,r,this);n&&n.then&&n.then(e,r)});return n._lib=!0,n}_root(){return this.parent?this.parent._root():this}waitFor(e){var t=this._root();let r=lt.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then(()=>r);else{t._waitingFor=r,t._waitingQueue=[];var n=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(n.get(-1/0).onsuccess=e)}()}var i=t._waitingFor;return new lt((e,n)=>{r.then(r=>t._waitingQueue.push(lh(e.bind(null,r))),e=>t._waitingQueue.push(lh(n.bind(null,e)))).finally(()=>{t._waitingFor===i&&(t._waitingFor=null)})})}abort(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new sR.Abort))}table(e){let t=this._memoizedTables||(this._memoizedTables={});if(a0(t,e))return t[e];let r=this.schema[e];if(!r)throw new sR.NotFound("Table "+e+" not part of transaction");let n=new this.db.Table(e,r,this);return n.core=this.db.core.table(e),t[e]=n,n}}function uh(e,t,r,n,i,o,a){return{name:e,keyPath:t,unique:r,multi:n,auto:i,compound:o,src:(r&&!a?"&":"")+(n?"*":"")+(i?"++":"")+um(t)}}function um(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function uy(e,t,r){return{name:e,primKey:t,indexes:r,mappedClass:null,idxByName:sr(r,e=>[e.name,e])}}let ug=e=>{try{return e.only([[]]),ug=()=>[[]],[[]]}catch(e){return ug=()=>lI,lI}};function ub(e){return null==e?()=>{}:"string"==typeof e?1===e.split(".").length?t=>t[e]:t=>sn(t,e):t=>sn(t,e)}function uv(e){return[].slice.call(e)}let uw=0;function u_(e){return null==e?":id":"string"==typeof e?e:`[${e.join("+")}]`}function ux({_novip:e},t){let r=t.db,n=function(e,t,{IDBKeyRange:r,indexedDB:n},i){var o;return{dbcore:(o=function(e,t,r){let n;function i(e){if(3===e.type)return null;if(4===e.type)throw Error("Cannot convert never type to IDBKeyRange");let{lower:r,upper:n,lowerOpen:i,upperOpen:o}=e;return void 0===r?void 0===n?null:t.upperBound(n,!!o):void 0===n?t.lowerBound(r,!!i):t.bound(r,n,!!i,!!o)}let{schema:o,hasGetAll:a}=(n=uv(e.objectStoreNames),{schema:{name:e.name,tables:n.map(e=>r.objectStore(e)).map(e=>{let{keyPath:t,autoIncrement:r}=e,n=aZ(t),i=null==t,o={},a={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:i,compound:n,keyPath:t,autoIncrement:r,unique:!0,extractKey:ub(t)},indexes:uv(e.indexNames).map(t=>e.index(t)).map(e=>{let{name:t,unique:r,multiEntry:n,keyPath:i}=e,a={name:t,compound:aZ(i),keyPath:i,unique:r,multiEntry:n,extractKey:ub(i)};return o[u_(i)]=a,a}),getIndexByKeyPath:e=>o[u_(e)]};return o[":id"]=a.primaryKey,null!=t&&(o[u_(t)]=a.primaryKey),a})},hasGetAll:n.length>0&&"getAll"in r.objectStore(n[0])&&!("u">typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),s=o.tables.map(e=>{let t;return{name:t=e.name,schema:e,mutate:function({trans:e,type:r,keys:n,values:o,range:a}){return new Promise((s,l)=>{let u;s=lh(s);let c=e.objectStore(t),d=null==c.keyPath,p="put"===r||"add"===r;if(!p&&"delete"!==r&&"deleteRange"!==r)throw Error("Invalid operation type: "+r);let{length:f}=n||o||{length:1};if(n&&o&&n.length!==o.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=[],y=0,g=e=>{++y,uu(e)};if("deleteRange"===r){if(4===a.type)return s({numFailures:y,failures:m,results:[],lastResult:void 0});3===a.type?h.push(u=c.clear()):h.push(u=c.delete(i(a)))}else{let[e,t]=p?d?[o,n]:[o,null]:[n,null];if(p)for(let n=0;n<f;++n)h.push(u=t&&void 0!==t[n]?c[r](e[n],t[n]):c[r](e[n])),u.onerror=g;else for(let t=0;t<f;++t)h.push(u=c[r](e[t])),u.onerror=g}let b=e=>{let t=e.target.result;h.forEach((e,t)=>null!=e.error&&(m[t]=e.error)),s({numFailures:y,failures:m,results:"delete"===r?n:h.map(e=>e.result),lastResult:t})};u.onerror=e=>{g(e),b(e)},u.onsuccess=b})},getMany:({trans:e,keys:r})=>new Promise((n,i)=>{n=lh(n);let o=e.objectStore(t),a=r.length,s=Array(a),l,u=0,c=0,d=e=>{let t=e.target;s[t._pos]=t.result,++c===u&&n(s)},p=ul(i);for(let e=0;e<a;++e)null!=r[e]&&((l=o.get(r[e]))._pos=e,l.onsuccess=d,l.onerror=p,++u);0===u&&n(s)}),get:({trans:e,key:r})=>new Promise((n,i)=>{n=lh(n);let o=e.objectStore(t).get(r);o.onsuccess=e=>n(e.target.result),o.onerror=ul(i)}),query:e=>new Promise((r,n)=>{r=lh(r);let{trans:o,values:s,limit:l,query:u}=e,c=l===1/0?void 0:l,{index:d,range:p}=u,f=o.objectStore(t),h=d.isPrimaryKey?f:f.index(d.name),m=i(p);if(0===l)return r({result:[]});if(a){let e=s?h.getAll(m,c):h.getAllKeys(m,c);e.onsuccess=e=>r({result:e.target.result}),e.onerror=ul(n)}else{let e=0,t=!s&&"openKeyCursor"in h?h.openKeyCursor(m):h.openCursor(m),i=[];t.onsuccess=n=>{let o=t.result;return o?(i.push(s?o.value:o.primaryKey),++e===l?r({result:i}):void o.continue()):r({result:i})},t.onerror=ul(n)}}),openCursor:function({trans:e,values:r,query:n,reverse:o,unique:a}){return new Promise((s,l)=>{s=lh(s);let{index:u,range:c}=n,d=e.objectStore(t),p=u.isPrimaryKey?d:d.index(u.name),f=o?a?"prevunique":"prev":a?"nextunique":"next",h=!r&&"openKeyCursor"in p?p.openKeyCursor(i(c),f):p.openCursor(i(c),f);h.onerror=ul(l),h.onsuccess=lh(t=>{let r=h.result;if(!r)return void s(null);r.___id=++uw,r.done=!1;let n=r.continue.bind(r),i=r.continuePrimaryKey;i&&(i=i.bind(r));let o=r.advance.bind(r),a=()=>{throw Error("Cursor not stopped")};r.trans=e,r.stop=r.continue=r.continuePrimaryKey=r.advance=()=>{throw Error("Cursor not started")},r.fail=lh(l),r.next=function(){let e=1;return this.start(()=>e--?this.continue():this.stop()).then(()=>this)},r.start=e=>{let t=new Promise((e,t)=>{e=lh(e),h.onerror=ul(t),r.fail=t,r.stop=t=>{r.stop=r.continue=r.continuePrimaryKey=r.advance=a,e(t)}}),s=()=>{if(h.result)try{e()}catch(e){r.fail(e)}else r.done=!0,r.start=()=>{throw Error("Cursor behind last entry")},r.stop()};return h.onsuccess=lh(e=>{h.onsuccess=s,s()}),r.continue=n,r.continuePrimaryKey=i,r.advance=o,s(),t},s(r)},l)})},count({query:e,trans:r}){let{index:n,range:o}=e;return new Promise((e,a)=>{let s=r.objectStore(t),l=n.isPrimaryKey?s:s.index(n.name),u=i(o),c=u?l.count(u):l.count();c.onsuccess=lh(t=>e(t.target.result)),c.onerror=ul(a)})}}}),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:ug(t),schema:o}}(t,r,i),e.dbcore.reduce((e,{create:t})=>({...e,...t(e)}),o))}}(e._middlewares,r,e._deps,t);e.core=n.dbcore,e.tables.forEach(t=>{let r=t.name;e.core.schema.tables.some(e=>e.name===r)&&(t.core=e.core.table(r),e[r]instanceof e.Table&&(e[r].core=t.core))})}function uE({_novip:e},t,r,n){r.forEach(r=>{let i=n[r];t.forEach(t=>{let n=a5(t,r);(!n||"value"in n&&void 0===n.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?a4(t,r,{get(){return this.table(r)},set(e){a3(this,r,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[r]=new e.Table(r,i))})})}function uS({_novip:e},t){t.forEach(t=>{for(let r in t)t[r]instanceof e.Table&&delete t[r]})}function uD(e,t){return e._cfg.version-t._cfg.version}function uO(e,t){let r,n={del:[],add:[],change:[]};for(r in e)t[r]||n.del.push(r);for(r in t){let i=e[r],o=t[r];if(i){let e={name:r,def:o,recreate:!1,del:[],add:[],change:[]};if(""+(i.primKey.keyPath||"")==""+(o.primKey.keyPath||"")&&(i.primKey.auto===o.primKey.auto||lV)){let t,r=i.idxByName,a=o.idxByName;for(t in r)a[t]||e.del.push(t);for(t in a){let n=r[t],i=a[t];n?n.src!==i.src&&e.change.push(i):e.add.push(i)}(e.del.length>0||e.add.length>0||e.change.length>0)&&n.change.push(e)}else e.recreate=!0,n.change.push(e)}else n.add.push([r,o])}return n}function uP(e,t,r,n){let i=e.db.createObjectStore(t,r.keyPath?{keyPath:r.keyPath,autoIncrement:r.auto}:{autoIncrement:r.auto});return n.forEach(e=>uC(i,e)),i}function uC(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function uk(e,t,r){let n={};return a9(t.objectStoreNames,0).forEach(e=>{let t=r.objectStore(e),i=t.keyPath,o=uh(um(i),i||"",!1,!1,!!t.autoIncrement,i&&"string"!=typeof i,!0),a=[];for(let e=0;e<t.indexNames.length;++e){let r=t.index(t.indexNames[e]);i=r.keyPath;var s=uh(r.name,i,!!r.unique,!!r.multiEntry,!1,i&&"string"!=typeof i,!1);a.push(s)}n[e]=uy(e,o,a)}),n}function uj({_novip:e},t,r){let n=r.db.objectStoreNames;for(let i=0;i<n.length;++i){let o=n[i],a=r.objectStore(o);e._hasGetAll="getAll"in a;for(let e=0;e<a.indexNames.length;++e){let r=a.indexNames[e],n=a.index(r).keyPath,i="string"==typeof n?n:"["+a9(n).join("+")+"]";if(t[o]){let e=t[o].idxByName[i];e&&(e.name=r,delete t[o].idxByName[i],t[o].idxByName[r]=e)}}}"u">typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&aq.WorkerGlobalScope&&aq instanceof aq.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}class uT{_parseStoresSpec(e,t){aY(e).forEach(r=>{if(null!==e[r]){var n=e[r].split(",").map((e,t)=>{let r=(e=e.trim()).replace(/([&*]|\+\+)/g,""),n=/^\[/.test(r)?r.match(/^\[(.*)\]$/)[1].split("+"):r;return uh(r,n||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),aZ(n),0===t)}),i=n.shift();if(i.multi)throw new sR.Schema("Primary key cannot be multi-valued");n.forEach(e=>{if(e.auto)throw new sR.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new sR.Schema("Index must have a name and cannot be an empty string")}),t[r]=uy(r,i,n)}})}stores(e){let t=this.db;this._cfg.storesSource=this._cfg.storesSource?aJ(this._cfg.storesSource,e):e;let r=t._versions,n={},i={};return r.forEach(e=>{aJ(n,e._cfg.storesSource),i=e._cfg.dbschema={},e._parseStoresSpec(n,i)}),t._dbSchema=i,uS(t,[t._allTables,t,t.Transaction.prototype]),uE(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],aY(i),i),t._storeNames=aY(i),this}upgrade(e){return this._cfg.contentUpgrade=sW(this._cfg.contentUpgrade||sM,e),this}}function uR(e,t){let r=e._dbNamesDB;return r||(r=e._dbNamesDB=new uJ(lW,{addons:[],indexedDB:e,IDBKeyRange:t})).version(1).stores({dbnames:"name"}),r.table("dbnames")}function uA(e){return e&&"function"==typeof e.databases}function uN(e){return l_(function(){return s8.letThrough=!0,e()})}function uM(e){var t=t=>e.next(t),r=i(t),n=i(t=>e.throw(t));function i(e){return t=>{var i=e(t),o=i.value;return i.done?o:o&&"function"==typeof o.then?o.then(r,n):aZ(o)?Promise.all(o).then(r,n):r(o)}}return i(t)()}function uI(e,t,r){var n=arguments.length;if(n<2)throw new sR.InvalidArgument("Too few arguments");for(var i=Array(n-1);--n;)i[n-1]=arguments[n];return r=i.pop(),[e,ss(i),r]}function u$(e,t,r){let n=aZ(e)?e.slice():[e];for(let e=0;e<r;++e)n.push(t);return n}let uL={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return{...e,table(t){let r=e.table(t),{schema:n}=r,i={},o=[];function a(e,t,r){let n=u_(e),s=i[n]=i[n]||[],l=null==e?0:"string"==typeof e?1:e.length,u=t>0,c={...r,isVirtual:u,keyTail:t,keyLength:l,extractKey:ub(e),unique:!u&&r.unique};return s.push(c),c.isPrimaryKey||o.push(c),l>1&&a(2===l?e[0]:e.slice(0,l-1),t+1,r),s.sort((e,t)=>e.keyTail-t.keyTail),c}let s=a(n.primaryKey.keyPath,0,n.primaryKey);for(let e of(i[":id"]=[s],n.indexes))a(e.keyPath,0,e);function l(t){var r,n;let i=t.query.index;return i.isVirtual?{...t,query:{index:i,range:(r=t.query.range,n=i.keyTail,{type:1===r.type?2:r.type,lower:u$(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,n),lowerOpen:!0,upper:u$(r.upper,r.upperOpen?e.MIN_KEY:e.MAX_KEY,n),upperOpen:!0})}}:t}return{...r,schema:{...n,primaryKey:s,indexes:o,getIndexByKeyPath:function(e){let t=i[u_(e)];return t&&t[0]}},count:e=>r.count(l(e)),query:e=>r.query(l(e)),openCursor(t){let{keyTail:n,isVirtual:i,keyLength:o}=t.query.index;return i?r.openCursor(l(t)).then(r=>r&&Object.create(r,{continue:{value:function(i){null!=i?r.continue(u$(i,t.reverse?e.MAX_KEY:e.MIN_KEY,n)):t.unique?r.continue(r.key.slice(0,o).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,n)):r.continue()}},continuePrimaryKey:{value(t,i){r.continuePrimaryKey(u$(t,e.MAX_KEY,n),i)}},primaryKey:{get:()=>r.primaryKey},key:{get(){let e=r.key;return 1===o?e[0]:e.slice(0,o)}},value:{get:()=>r.value}})):r.openCursor(t)}}}}}};function uF(e,t,r,n){return r=r||{},n=n||"",aY(e).forEach(i=>{if(a0(t,i)){var o=e[i],a=t[i];if("object"==typeof o&&"object"==typeof a&&o&&a){let e=sf(o);e!==sf(a)?r[n+i]=t[i]:"Object"===e?uF(o,a,r,n+i+"."):o!==a&&(r[n+i]=t[i])}else o!==a&&(r[n+i]=t[i])}else r[n+i]=void 0}),aY(t).forEach(i=>{a0(e,i)||(r[n+i]=t[i])}),r}let uB={stack:"dbcore",name:"HooksMiddleware",level:2,create:e=>({...e,table(t){let r=e.table(t),{primaryKey:n}=r.schema;return{...r,mutate(e){let i=s8.trans,{deleting:o,creating:a,updating:s}=i.table(t).hook;switch(e.type){case"add":if(a.fire===sM)break;return i._promise("readwrite",()=>l(e),!0);case"put":if(a.fire===sM&&s.fire===sM)break;return i._promise("readwrite",()=>l(e),!0);case"delete":if(o.fire===sM)break;return i._promise("readwrite",()=>l(e),!0);case"deleteRange":if(o.fire===sM)break;return i._promise("readwrite",()=>(function e(t,i,o){return r.query({trans:t,values:!1,query:{index:n,range:i},limit:o}).then(({result:r})=>l({type:"delete",keys:r,trans:t}).then(n=>n.numFailures>0?Promise.reject(n.failures[0]):r.length<o?{failures:[],numFailures:0,lastResult:void 0}:e(t,{...i,lower:r[r.length-1],lowerOpen:!0},o)))})(e.trans,e.range,1e4),!0)}return r.mutate(e);function l(e){var t,i;let l=s8.trans,u=e.keys||("delete"===(t=e).type?t.keys:t.keys||t.values.map(n.extractKey));if(!u)throw Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?{...e,keys:u}:{...e}).type&&(e.values=[...e.values]),e.keys&&(e.keys=[...e.keys]),("add"===(i=e).type?Promise.resolve([]):r.getMany({trans:i.trans,keys:u,cache:"immutable"})).then(t=>{let i=u.map((r,i)=>{let u=t[i],c={onerror:null,onsuccess:null};if("delete"===e.type)o.fire.call(c,r,u,l);else if("add"===e.type||void 0===u){let t=a.fire.call(c,r,e.values[i],l);null==r&&null!=t&&(r=t,e.keys[i]=r,n.outbound||si(e.values[i],n.keyPath,r))}else{let t=uF(u,e.values[i]),n=s.fire.call(c,t,r,u,l);if(n){let t=e.values[i];Object.keys(n).forEach(e=>{a0(t,e)?t[e]=n[e]:si(t,e,n[e])})}}return c});return r.mutate(e).then(({failures:r,results:n,numFailures:o,lastResult:a})=>{for(let o=0;o<u.length;++o){let a=n?n[o]:u[o],s=i[o];null==a?s.onerror&&s.onerror(r[o]):s.onsuccess&&s.onsuccess("put"===e.type&&t[o]?e.values[o]:a)}return{failures:r,results:n,numFailures:o,lastResult:a}}).catch(e=>(i.forEach(t=>t.onerror&&t.onerror(e)),Promise.reject(e)))})}}}}})};function uV(e,t,r){try{if(!t||t.keys.length<e.length)return null;let n=[];for(let i=0,o=0;i<t.keys.length&&o<e.length;++i)0===l6(t.keys[i],e[o])&&(n.push(r?sd(t.values[i]):t.values[i]),++o);return n.length===e.length?n:null}catch(e){return null}}let uU={stack:"dbcore",level:-1,create:e=>({table:t=>{let r=e.table(t);return{...r,getMany:e=>{if(!e.cache)return r.getMany(e);let t=uV(e.keys,e.trans._cache,"clone"===e.cache);return t?lt.resolve(t):r.getMany(e).then(t=>(e.trans._cache={keys:e.keys,values:"clone"===e.cache?sd(t):t},t))},mutate:e=>("add"!==e.type&&(e.trans._cache=null),r.mutate(e))}}})};function uW(e){return!("from"in e)}let uK=function(e,t){if(!this){let t=new uK;return e&&"d"in e&&aJ(t,e),t}aJ(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function uH(e,t,r){let n=l6(t,r);if(isNaN(n))return;if(n>0)throw RangeError();if(uW(e))return aJ(e,{from:t,to:r,d:1});let i=e.l,o=e.r;if(0>l6(r,e.from))return i?uH(i,t,r):e.l={from:t,to:r,d:1,l:null,r:null},uq(e);if(l6(t,e.to)>0)return o?uH(o,t,r):e.r={from:t,to:r,d:1,l:null,r:null},uq(e);0>l6(t,e.from)&&(e.from=t,e.l=null,e.d=o?o.d+1:1),l6(r,e.to)>0&&(e.to=r,e.r=null,e.d=e.l?e.l.d+1:1);let a=!e.r;i&&!e.l&&uz(e,i),o&&a&&uz(e,o)}function uz(e,t){uW(t)||function e(t,{from:r,to:n,l:i,r:o}){uH(t,r,n),i&&e(t,i),o&&e(t,o)}(e,t)}function uG(e){let t=uW(e)?null:{s:0,n:e};return{next(e){let r=arguments.length>0;for(;t;)switch(t.s){case 0:if(t.s=1,r)for(;t.n.l&&0>l6(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,!r||0>=l6(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 uq(e){var t,r;let n=((null==(t=e.r)?void 0:t.d)||0)-((null==(r=e.l)?void 0:r.d)||0),i=n>1?"r":n<-1?"l":"";if(i){let t="r"===i?"l":"r",r={...e},n=e[i];e.from=n.from,e.to=n.to,e[i]=n[i],r[i]=n[t],e[t]=r,r.d=uY(r)}e.d=uY(e)}function uY({r:e,l:t}){return(e?t?Math.max(e.d,t.d):e.d:t?t.d:0)+1}a1(uK.prototype,{add(e){return uz(this,e),this},addKey(e){return uH(this,e,e),this},addKeys(e){return e.forEach(e=>uH(this,e,e)),this},[sh](){return uG(this)}});let uZ={stack:"dbcore",level:0,create:e=>{let t=e.schema.name,r=new uK(e.MIN_KEY,e.MAX_KEY);return{...e,table:n=>{let i=e.table(n),{schema:o}=i,{primaryKey:a}=o,{extractKey:s,outbound:l}=a,u={...i,mutate:e=>{let a=e.trans,s=a.mutatedParts||(a.mutatedParts={}),l=e=>{let r=`idb://${t}/${n}/${e}`;return s[r]||(s[r]=new uK)},u=l(""),c=l(":dels"),{type:d}=e,[p,f]="deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[],h=e.trans._cache;return i.mutate(e).then(e=>{if(aZ(p)){"delete"!==d&&(p=e.results),u.addKeys(p);let t=uV(p,h);t||"add"===d||c.addKeys(p),(t||f)&&o.indexes.forEach(function(e){let r=l(e.name||"");function n(t){return null!=t?e.extractKey(t):null}let i=t=>e.multiEntry&&aZ(t)?t.forEach(e=>r.addKey(e)):r.addKey(t);(t||f).forEach((e,r)=>{let o=t&&n(t[r]),a=f&&n(f[r]);0!==l6(o,a)&&(null!=o&&i(o),null!=a&&i(a))})})}else if(p){let e={from:p.lower,to:p.upper};c.add(e),u.add(e)}else u.add(r),c.add(r),o.indexes.forEach(e=>l(e.name).add(r));return e})}},c=({query:{index:t,range:r}})=>{var n,i;return[t,new uK(null!=(n=r.lower)?n:e.MIN_KEY,null!=(i=r.upper)?i:e.MAX_KEY)]},d={get:e=>[a,new uK(e.key)],getMany:e=>[a,(new uK).addKeys(e.keys)],count:c,query:c,openCursor:c};return aY(d).forEach(e=>{u[e]=function(o){let{subscr:a}=s8;if(a){let u=e=>{let r=`idb://${t}/${n}/${e}`;return a[r]||(a[r]=new uK)},c=u(""),p=u(":dels"),[f,h]=d[e](o);if(u(f.name||"").add(h),!f.isPrimaryKey){if("count"!==e){let t="query"===e&&l&&o.values&&i.query({...o,values:!1});return i[e].apply(this,arguments).then(r=>{if("query"===e){if(l&&o.values)return t.then(({result:e})=>(c.addKeys(e),r));let e=o.values?r.result.map(s):r.result;o.values?c.addKeys(e):p.addKeys(e)}else if("openCursor"===e){let e=o.values;return r&&Object.create(r,{key:{get:()=>(p.addKey(r.primaryKey),r.key)},primaryKey:{get(){let e=r.primaryKey;return p.addKey(e),e}},value:{get:()=>(e&&c.addKey(r.primaryKey),r.value)}})}return r})}p.add(r)}}return i[e].apply(this,arguments)}}),u}}}};class uJ{constructor(e,t){var r;this._middlewares={},this.verno=0;const n=uJ.dependencies;this._options=t={addons:uJ.addons,autoOpen:!0,indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange,...t},this._deps={indexedDB:t.indexedDB,IDBKeyRange:t.IDBKeyRange};const{addons:i}=t;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;const o={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:sM,dbReadyPromise:null,cancelOpen:sM,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};o.dbReadyPromise=new lt(e=>{o.dbReadyResolve=e}),o.openCanceller=new lt((e,t)=>{o.cancelOpen=t}),this._state=o,this.name=e,this.on=lZ(this,"populate","blocked","versionchange","close",{ready:[sW,sM]}),this.on.ready.subscribe=a7(this.on.ready.subscribe,e=>(t,r)=>{uJ.vip(()=>{let n=this._state;if(n.openComplete)n.dbOpenError||lt.resolve().then(t),r&&e(t);else if(n.onReadyBeingFired)n.onReadyBeingFired.push(t),r&&e(t);else{e(t);let n=this;r||e(function e(){n.on.ready.unsubscribe(t),n.on.ready.unsubscribe(e)})}})}),this.Collection=(r=this,lJ(l9.prototype,function(e,t){this.db=r;let n=lG,i=null;if(t)try{n=t()}catch(e){i=e}let o=e._ctx,a=o.table,s=a.hook.reading.fire;this._ctx={table:a,index:o.index,isPrimKey:!o.index||a.schema.primKey.keyPath&&o.index===a.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:i,or:o.or,valueMapper:s!==sI?s:null}})),this.Table=function(e){return lJ(lY.prototype,function(t,r,n){this.db=e,this._tx=n,this.name=t,this.schema=r,this.hook=e._allTables[t]?e._allTables[t].hook:lZ(null,{creating:[sF,sM],reading:[s$,sI],updating:[sV,sM],deleting:[sB,sM]})})}(this),this.Transaction=function(e){return lJ(uf.prototype,function(t,r,n,i,o){this.db=e,this.mode=t,this.storeNames=r,this.schema=n,this.chromeTransactionDurability=i,this.idbtrans=null,this.on=lZ(this,"complete","error","abort"),this.parent=o||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new lt((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(),lN(e)})})}(this),this.Version=function(e){return lJ(uT.prototype,function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})}(this),this.WhereClause=function(e){return lJ(us.prototype,function(t,r,n){this.db=e,this._ctx={table:t,index:":id"===r?null:r,or:n};let i=e._deps.indexedDB;if(!i)throw new sR.MissingAPI;this._cmp=this._ascending=i.cmp.bind(i),this._descending=(e,t)=>i.cmp(t,e),this._max=(e,t)=>i.cmp(e,t)>0?e:t,this._min=(e,t)=>0>i.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=ug(t.IDBKeyRange),this._createTransaction=(e,t,r,n)=>new this.Transaction(e,t,r,this._options.chromeTransactionDurability,n),this._fireOnBlocked=e=>{this.on("blocked").fire(e),lB.filter(e=>e.name===this.name&&e!==this&&!e._state.vcFired).map(t=>t.on("versionchange").fire(e))},this.use(uL),this.use(uB),this.use(uZ),this.use(uU),this.vip=Object.create(this,{_vip:{value:!0}}),i.forEach(e=>e(this))}version(e){if(isNaN(e)||e<.1)throw new sR.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new sR.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);let t=this._versions;var r=t.filter(t=>t._cfg.version===e)[0];return r||(r=new this.Version(e),t.push(r),t.sort(uD),r.stores({}),this._state.autoSchema=!1,r)}_whenReady(e){return this.idbdb&&(this._state.openComplete||s8.letThrough||this._vip)?e():new lt((e,t)=>{if(this._state.openComplete)return t(new sR.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void t(new sR.DatabaseClosed);this.open().catch(sM)}this._state.dbReadyPromise.then(e,t)}).then(e)}use({stack:e,create:t,level:r,name:n}){n&&this.unuse({stack:e,name:n});let i=this._middlewares[e]||(this._middlewares[e]=[]);return i.push({stack:e,create:t,level:null==r?10:r,name:n}),i.sort((e,t)=>e.level-t.level),this}unuse({stack:e,name:t,create:r}){return e&&this._middlewares[e]&&(this._middlewares[e]=this._middlewares[e].filter(e=>r?e.create!==r:!!t&&e.name!==t)),this}open(){return function(e){var t;let r=e._state,{indexedDB:n}=e._deps;if(r.isBeingOpened||e.idbdb)return r.dbReadyPromise.then(()=>r.dbOpenError?lN(r.dbOpenError):e);sv&&(r.openCanceller._stackHolder=sx()),r.isBeingOpened=!0,r.dbOpenError=null,r.openComplete=!1;let i=r.openCanceller;function o(){if(r.openCanceller!==i)throw new sR.DatabaseClosed("db.open() was cancelled")}let a=r.dbReadyResolve,s=null,l=!1;return lt.race([i,("u"<typeof navigator?lt.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(e){var r=function(){return indexedDB.databases().finally(e)};t=setInterval(r,100),r()}).finally(function(){return clearInterval(t)}):Promise.resolve()).then(()=>new lt((t,i)=>{if(o(),!n)throw new sR.MissingAPI;let a=e.name,u=r.autoSchema?n.open(a):n.open(a,Math.round(10*e.verno));if(!u)throw new sR.MissingAPI;u.onerror=ul(i),u.onblocked=lh(e._fireOnBlocked),u.onupgradeneeded=lh(t=>{if(s=u.transaction,r.autoSchema&&!e._options.allowEmptyDB){u.onerror=uu,s.abort(),u.result.close();let e=n.deleteDatabase(a);e.onsuccess=e.onerror=lh(()=>{i(new sR.NoSuchDatabase(`Database ${a} doesnt exist`))})}else{let r,n,a,p;s.onerror=ul(i);var o,c,d=t.oldVersion>0x4000000000000000?0:t.oldVersion;l=d<1,e._novip.idbdb=u.result,o=d/10,c=s,r=e._dbSchema,(n=e._createTransaction("readwrite",e._storeNames,r)).create(c),n._completion.catch(i),a=n._reject.bind(n),p=s8.transless||s8,l_(()=>{s8.trans=n,s8.transless=p,0===o?(aY(r).forEach(e=>{uP(c,e,r[e].primKey,r[e].indexes)}),ux(e,c),lt.follow(()=>e.on.populate.fire(n)).catch(a)):(function({_novip:e},t,r,n){let i=[],o=e._versions,a=e._dbSchema=uk(e,e.idbdb,n),s=!1;return o.filter(e=>e._cfg.version>=t).forEach(o=>{i.push(()=>{let i=a,l=o._cfg.dbschema;uj(e,i,n),uj(e,l,n),a=e._dbSchema=l;let u=uO(i,l);u.add.forEach(e=>{uP(n,e[0],e[1].primKey,e[1].indexes)}),u.change.forEach(e=>{if(e.recreate)throw new sR.Upgrade("Not yet support for changing primary key");{let t=n.objectStore(e.name);e.add.forEach(e=>uC(t,e)),e.change.forEach(e=>{t.deleteIndex(e.name),uC(t,e)}),e.del.forEach(e=>t.deleteIndex(e))}});let c=o._cfg.contentUpgrade;if(c&&o._cfg.version>t){let t;ux(e,n),r._memoizedTables={},s=!0;let o=so(l);u.del.forEach(e=>{o[e]=i[e]}),uS(e,[e.Transaction.prototype]),uE(e,[e.Transaction.prototype],aY(o),o),r.schema=o;let a=sb(c);a&&lx();let d=lt.follow(()=>{if((t=c(r))&&a){var e=lE.bind(null,null);t.then(e,e)}});return t&&"function"==typeof t.then?lt.resolve(t):d.then(()=>t)}}),i.push(t=>{var n;s&&lV||(n=o._cfg.dbschema,[].slice.call(t.db.objectStoreNames).forEach(e=>null==n[e]&&t.db.deleteObjectStore(e))),uS(e,[e.Transaction.prototype]),uE(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),r.schema=e._dbSchema})}),(function e(){return i.length?lt.resolve(i.shift()(r.idbtrans)).then(e):lt.resolve()})().then(()=>{var e;aY(e=a).forEach(t=>{n.db.objectStoreNames.contains(t)||uP(n,t,e[t].primKey,e[t].indexes)})})})(e,o,n,c).catch(a)})}},i),u.onsuccess=lh(()=>{s=null;let n=e._novip.idbdb=u.result,i=a9(n.objectStoreNames);if(i.length>0)try{let t,o=n.transaction(1===i.length?i[0]:i,"readonly");r.autoSchema?function({_novip:e},t,r){e.verno=t.version/10;let n=e._dbSchema=uk(0,t,r);e._storeNames=a9(t.objectStoreNames,0),uE(e,[e._allTables],aY(n),n)}(e,n,o):(uj(e,e._dbSchema,o),((t=uO(uk(0,e.idbdb,o),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.")),ux(e,o)}catch(e){}lB.push(e),n.onversionchange=lh(t=>{r.vcFired=!0,e.on("versionchange").fire(t)}),n.onclose=lh(t=>{e.on("close").fire(t)}),l&&function({indexedDB:e,IDBKeyRange:t},r){uA(e)||r===lW||uR(e,t).put({name:r}).catch(sM)}(e._deps,a),t()},i)}))]).then(()=>(o(),r.onReadyBeingFired=[],lt.resolve(uN(()=>e.on.ready.fire(e.vip))).then(function t(){if(r.onReadyBeingFired.length>0){let n=r.onReadyBeingFired.reduce(sW,sM);return r.onReadyBeingFired=[],lt.resolve(uN(()=>n(e.vip))).then(t)}}))).finally(()=>{r.onReadyBeingFired=null,r.isBeingOpened=!1}).then(()=>e).catch(t=>{r.dbOpenError=t;try{s&&s.abort()}catch(e){}return i===r.openCanceller&&e._close(),lN(t)}).finally(()=>{r.openComplete=!0,a()})}(this)}_close(){let e=this._state,t=lB.indexOf(this);if(t>=0&&lB.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new lt(t=>{e.dbReadyResolve=t}),e.openCanceller=new lt((t,r)=>{e.cancelOpen=r})}close(){this._close();let e=this._state;this._options.autoOpen=!1,e.dbOpenError=new sR.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)}delete(){let e=arguments.length>0,t=this._state;return new lt((r,n)=>{let i=()=>{this.close();var e=this._deps.indexedDB.deleteDatabase(this.name);e.onsuccess=lh(()=>{!function({indexedDB:e,IDBKeyRange:t},r){uA(e)||r===lW||uR(e,t).delete(r).catch(sM)}(this._deps,this.name),r()}),e.onerror=ul(n),e.onblocked=this._fireOnBlocked};if(e)throw new sR.InvalidArgument("Arguments not allowed in db.delete()");t.isBeingOpened?t.dbReadyPromise.then(i):i()})}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 aY(this._allTables).map(e=>this._allTables[e])}transaction(){let e=uI.apply(this,arguments);return this._transaction.apply(this,e)}_transaction(e,t,r){let n,i,o=s8.trans;o&&o.db===this&&-1===e.indexOf("!")||(o=null);let a=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(i=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||e===lK)n=lK;else{if("rw"!=e&&e!=lH)throw new sR.InvalidArgument("Invalid transaction mode: "+e);n=lH}if(o){if(o.mode===lK&&n===lH){if(!a)throw new sR.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");o=null}o&&i.forEach(e=>{if(o&&-1===o.storeNames.indexOf(e)){if(!a)throw new sR.SubTransaction("Table "+e+" not included in parent transaction.");o=null}}),a&&o&&!o.active&&(o=null)}}catch(e){return o?o._promise(null,(t,r)=>{r(e)}):lN(e)}let s=(function e(t,r,n,i,o){return lt.resolve().then(()=>{let a,s=s8.transless||s8,l=t._createTransaction(r,n,t._dbSchema,i);if(i)l.idbtrans=i.idbtrans;else try{l.create(),t._state.PR1398_maxLoop=3}catch(i){return i.name===sT.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then(()=>e(t,r,n,null,o))):lN(i)}let u=sb(o);u&&lx();let c=lt.follow(()=>{if(a=o.call(l,l))if(u){var e=lE.bind(null,null);a.then(e,e)}else"function"==typeof a.next&&"function"==typeof a.throw&&(a=uM(a))},{trans:l,transless:s});return(a&&"function"==typeof a.then?lt.resolve(a).then(e=>l.active?e:lN(new sR.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))):c.then(()=>a)).then(e=>(i&&l._resolve(),l._completion.then(()=>e))).catch(e=>(l._reject(e),lN(e)))})}).bind(null,this,n,i,o,r);return o?o._promise(n,s,"lock"):s8.trans?lk(s8.transless,()=>this._whenReady(s)):this._whenReady(s)}table(e){if(!a0(this._allTables,e))throw new sR.InvalidTable(`Table ${e} does not exist`);return this._allTables[e]}}let uX="u">typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";class uQ{constructor(e){this._subscribe=e}subscribe(e,t,r){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:r})}[uX](){return this}}function u0(e,t){return aY(t).forEach(r=>{uz(e[r]||(e[r]=new uK),t[r])}),e}try{o={indexedDB:aq.indexedDB||aq.mozIndexedDB||aq.webkitIndexedDB||aq.msIndexedDB,IDBKeyRange:aq.IDBKeyRange||aq.webkitIDBKeyRange}}catch(e){o={indexedDB:null,IDBKeyRange:null}}function u1(e){let t=u3;try{u3=!0,up.storagemutated.fire(e)}finally{u3=t}}a1(uJ,{...sN,delete:e=>new uJ(e,{addons:[]}).delete(),exists:e=>new uJ(e,{addons:[]}).open().then(e=>(e.close(),!0)).catch("NoSuchDatabaseError",()=>!1),getDatabaseNames(e){try{return(function({indexedDB:e,IDBKeyRange:t}){return uA(e)?Promise.resolve(e.databases()).then(e=>e.map(e=>e.name).filter(e=>e!==lW)):uR(e,t).toCollection().primaryKeys()})(uJ.dependencies).then(e)}catch(e){return lN(new sR.MissingAPI)}},defineClass:()=>function(e){aJ(this,e)},ignoreTransaction:e=>s8.trans?lk(s8.transless,e):e(),vip:uN,async:function(e){return function(){try{var t=uM(e.apply(this,arguments));return t&&"function"==typeof t.then?t:lt.resolve(t)}catch(e){return lN(e)}}},spawn:function(e,t,r){try{var n=uM(e.apply(r,t||[]));return n&&"function"==typeof n.then?n:lt.resolve(n)}catch(e){return lN(e)}},currentTransaction:{get:()=>s8.trans||null},waitFor:function(e,t){let r=lt.resolve("function"==typeof e?uJ.ignoreTransaction(e):e).timeout(t||6e4);return s8.trans?s8.trans.waitFor(r):r},Promise:lt,debug:{get:()=>sv,set:e=>{sv=e,sw="dexie"===e?()=>!0:lU}},derive:a2,extend:aJ,props:a1,override:a7,Events:lZ,on:up,liveQuery:function(e){let t,r=!1,n=new uQ(n=>{let i=sb(e),o=!1,a={},s={},l={get closed(){return o},unsubscribe:()=>{o=!0,up.storagemutated.unsubscribe(p)}};n.start&&n.start(l);let u=!1,c=!1;function d(){return aY(s).some(e=>a[e]&&function(e,t){let r=uG(t),n=r.next();if(n.done)return!1;let i=n.value,o=uG(e),a=o.next(i.from),s=a.value;for(;!n.done&&!a.done;){if(0>=l6(s.from,i.to)&&l6(s.to,i.from)>=0)return!0;0>l6(i.from,s.from)?i=(n=r.next(s.from)).value:s=(a=o.next(i.from)).value}return!1}(a[e],s[e]))}let p=e=>{u0(a,e),d()&&f()},f=()=>{let h,m;if(u||o)return;a={};let y={},g=(i&&lx(),h=()=>l_(e,{subscr:y,trans:null}),m=s8.trans?lk(s8.transless,h):h(),i&&m.then(lE,lE),m);c||(up(uc,p),c=!0),u=!0,Promise.resolve(g).then(e=>{r=!0,t=e,u=!1,o||(d()?f():(a={},s=y,n.next&&n.next(e)))},e=>{u=!1,r=!1,n.error&&n.error(e),l.unsubscribe()})};return f(),l});return n.hasValue=()=>r,n.getValue=()=>t,n},extendObservabilitySet:u0,getByKeyPath:sn,setByKeyPath:si,delByKeyPath:function(e,t){"string"==typeof t?si(e,t,void 0):"length"in t&&[].map.call(t,function(t){si(e,t,void 0)})},shallowClone:so,deepClone:sd,getObjectDiff:uF,cmp:l6,asap:st,minKey:l$,addons:[],connections:lB,errnames:sT,dependencies:o,semVer:lM,version:lM.split(".").map(e=>parseInt(e)).reduce((e,t,r)=>e+t/Math.pow(10,2*r))}),uJ.maxKey=ug(uJ.dependencies.IDBKeyRange),"u">typeof dispatchEvent&&"u">typeof addEventListener&&(up(uc,e=>{if(!u3){let t;lV?(t=document.createEvent("CustomEvent")).initCustomEvent(ud,!0,!0,e):t=new CustomEvent(ud,{detail:e}),u3=!0,dispatchEvent(t),u3=!1}}),addEventListener(ud,({detail:e})=>{u3||u1(e)}));let u3=!1;if("u">typeof BroadcastChannel){let e=new BroadcastChannel(ud);"function"==typeof e.unref&&e.unref(),up(uc,t=>{u3||e.postMessage(t)}),e.onmessage=e=>{e.data&&u1(e.data)}}else if("u">typeof self&&"u">typeof navigator){up(uc,e=>{try{u3||("u">typeof localStorage&&localStorage.setItem(ud,JSON.stringify({trig:Math.random(),changedParts:e})),"object"==typeof self.clients&&[...self.clients.matchAll({includeUncontrolled:!0})].forEach(t=>t.postMessage({type:ud,changedParts:e})))}catch(e){}}),"u">typeof addEventListener&&addEventListener("storage",e=>{if(e.key===ud){let t=JSON.parse(e.newValue);t&&u1(t.changedParts)}});let e=self.document&&navigator.serviceWorker;e&&e.addEventListener("message",function({data:e}){e&&e.type===ud&&u1(e.changedParts)})}function u4(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}lt.rejectionMapper=function(e,t){if(!e||e instanceof sP||e instanceof TypeError||e instanceof SyntaxError||!e.name||!sA[e.name])return e;var r=new sA[e.name](t||e.message,e);return"stack"in e&&a4(r,"stack",{get:function(){return this.inner.stack}}),r},sw=lU;class u2 extends uJ{constructor(){super("EsmOffline"),u4(this,"syncQueue",void 0),u4(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 u6(){return new u2}let u5=new u2,u8={},u9=Y("offline-synchronization",{});function u7(){return u9}async function ce(){if(u9.getState().synchronization)return;let e=await u5.syncQueue.count(),t={},r=Object.entries(u8),n=r.length,i={},o=new AbortController,a=()=>{let e=u9.getState().synchronization;u9.setState({synchronization:{...e,pendingCount:e.pendingCount-1}})};try{u9.setState({synchronization:{totalCount:e,pendingCount:e,abortController:o}});for(let e=0;e<n&&r.length>0;e++)for(let e=r.length;e--;){let[n,s]=r[e],l=s.dependsOn.map(e=>t[e]);l.every(Boolean)&&(i[n]={},await Promise.all(l),t[n]=ct(s,i,o,a),r.splice(e,1))}await Promise.allSettled(Object.values(t))}finally{u9.setState({synchronization:void 0})}}async function ct({type:e,dependsOn:t,process:r},n,i,o){let a=[],s=[],l=await cr();await u5.syncQueue.where({type:e,userId:l}).each((e,t)=>{a.push([t.primaryKey,e.content,e.descriptor]),s.push(e.content)});for(let u=0;u<a.length;u++){let[c,d,{id:p,dependencies:f=[]}]=a[u];try{let o=await r(d,{abort:i,index:u,items:s,userId:l,dependencies:f.map(({id:e,type:r})=>t.includes(r)?n[r][e]:void 0)});void 0!==p&&(n[e][p]=o),await u5.syncQueue.delete(c)}catch(e){await u5.syncQueue.update(c,{lastError:{name:e?.name,message:e?.message??e?.toString()}})}finally{o()}}}async function cr(){let e=await iW();return e?.uuid||"*"}async function cn(e,t,r,n){let i=n&&n.id;return void 0!==i&&await u5.syncQueue.where({type:t,userId:e}).filter(e=>e?.descriptor.id===i).delete().catch(uJ.errnames.DatabaseClosed),await u5.syncQueue.add({type:t,content:r,userId:e,descriptor:n||{},createdOn:new Date}).catch(uJ.errnames.DatabaseClosed,()=>-1)}async function ci(e,t,r){let n=await cr();return await cn(n,e,t,r)}async function co(e,t){return(await ca(e,t)).map(e=>e.content)}async function ca(e,t){return await u5.syncQueue.where(t?{type:t,userId:e}:{userId:e}).toArray().catch(uJ.errnames.DatabaseClosed,()=>[])}async function cs(e){let t=await cr();return await co(t,e)}async function cl(e){let t=await cr();return await ca(t,e)}async function cu(e){return await u5.syncQueue.get(e).catch(uJ.errnames.DatabaseClosed,()=>void 0)}function cc(e){return!!u8[e]?.options.onBeginEditSyncItem}async function cd(e){let t=await cu(e);if(!t)throw Error(`No sync item with the ID ${e} exists.`);let r=u8[t.type]?.options.onBeginEditSyncItem;if(!r)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.`);r(t)}async function cp(e){await u5.syncQueue.delete(e).catch(uJ.errnames.DatabaseClosed)}function cf(e,t,r,n={}){u8[e]={type:e,dependsOn:t,process:r,options:n}}let ch="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),cm=new Uint8Array(16),cy=[];for(let e=0;e<256;++e)cy.push((e+256).toString(16).slice(1));let cg=function(e,t,r){if(ch&&!t&&!e)return ch();let n=(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(cm)})();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return function(e,t=0){return cy[e[t+0]]+cy[e[t+1]]+cy[e[t+2]]+cy[e[t+3]]+"-"+cy[e[t+4]]+cy[e[t+5]]+"-"+cy[e[t+6]]+cy[e[t+7]]+"-"+cy[e[t+8]]+cy[e[t+9]]+"-"+cy[e[t+10]]+cy[e[t+11]]+cy[e[t+12]]+cy[e[t+13]]+cy[e[t+14]]+cy[e[t+15]]}(n)},cb="OFFLINE+";function cv(){return cb+cg()}function cw(e){return e.startsWith(cb)}let c_={};function cx(){return Object.values(c_)}function cE(e){c_[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.`),c_[e.id]=e}async function cS(e){let t=await cR();return await cD(t,e)}async function cD(e,t){let r=new u2;return await r.dynamicOfflineData.where(t?{type:t,users:e}:{users:e}).toArray().catch(uJ.errnames.DatabaseClosed,()=>[])}async function cO(e,t){let r=await cR();return await cP(r,e,t)}async function cP(e,t,r){let n=new u2,i=await n.dynamicOfflineData.get({type:t,identifier:r}).catch(uJ.errnames.DatabaseClosed,()=>void 0);i?i.users.includes(e)||await n.dynamicOfflineData.update(i.id,{users:[...i.users,e]}).catch(uJ.errnames.DatabaseClosed):await n.dynamicOfflineData.add({users:[e],type:t,identifier:r}).catch(uJ.errnames.DatabaseClosed)}async function cC(e,t){let r=await cR();return await ck(r,e,t)}async function ck(e,t,r){let n=new u2,i=await n.dynamicOfflineData.get({type:t,identifier:r,users:e}).catch(uJ.errnames.DatabaseClosed,()=>void 0);i&&(i.users.length>1?await n.dynamicOfflineData.update(i.id,{users:i.users.filter(t=>t!==e)}).catch(uJ.errnames.DatabaseClosed):await n.dynamicOfflineData.delete(i.id).catch(uJ.errnames.DatabaseClosed))}async function cj(e,t){let r=await cS(e);await Promise.all(r.map(async e=>cT(e.type,e.identifier,t)))}async function cT(e,t,r){await cO(e,t);let n=new u2,i=await cR(),o=await n.dynamicOfflineData.get({type:e,identifier:t}).catch(uJ.errnames.DatabaseClosed,()=>void 0),a=cx().filter(t=>t.type===e);if(!o)return;let s=await Promise.all(a.map(async e=>{try{return e.sync(t,r),{id:e.id,error:void 0}}catch(r){let t=r.message?.toString()??r.toString();return{id:e.id,error:t}}})),l=s.filter(e=>!e.error).map(e=>e.id),u=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:i,succeededHandlers:l,erroredHandlers:u,errors:c};o.id&&await n.dynamicOfflineData.update(o.id,{syncState:d}).catch(uJ.errnames.DatabaseClosed)}async function cR(){let e=(await iW()).uuid;if(!e)throw Error("Using the dynamic offline data API requires a logged in user.");return e}let cA=Y("offline-patients",{offlinePatientDataSyncState:{},handlers:{}});function cN(){return c$(),cA}function cM(e,t){c$(),cE({type:"patient",displayName:t.displayName,id:e,isSynced:()=>Promise.resolve(!0),sync:(e,r)=>t.onOfflinePatientAdded({patientUuid:e,signal:r??new AbortController().signal})})}async function cI(e){c$(),await cT("patient",e)}function c$(){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.")}async function cL(e,t,r=!0){if(e){let n=null,[i,o]=await Promise.all([iR(`${ik}/Patient/${e}`,t).catch(e=>n=e),r?cF(e):Promise.resolve(null)]);if(i.ok)return i.data;if(o)return o;if(n)throw n}return null}async function cF(e){let t=(await cs("patient-registration")).find(t=>t.fhirPatient.id===e);return t?.fhirPatient??null}function cB(e,t){let r=new CustomEvent(`openmrs:${e}`,{detail:t??void 0,cancelable:!0,bubbles:!0});return window.dispatchEvent(r)}function cV(e,t){let r=e=>{t("detail"in e&&null!==e.detail?e.detail:void 0)};return window.addEventListener(`openmrs:${e}`,r),()=>{window.removeEventListener(`openmrs:${e}`,r)}}var cU=r(6170);function cW(e){return{uuid:e.uuid,display:e.display}}function cK(e=null,t=null){let r=new URLSearchParams;e&&r.set("tag",e),t&&r.set("q",t);let n=r.toString();return iA(`${iC}/location${n?"?"+n:""}`).pipe((0,cU.map)(e=>e.data.results.map(cW))).pipe((0,cU.take)(1))}function cH(e){return{uuid:e.uuid,display:e.display,name:e.name}}function cz(){return iA(`${iC}/visittype`).pipe((0,cU.map)(e=>e.data.results.map(cH))).pipe((0,cU.take)(1))}var cG=((en={}).NEWVISIT="startVisit",en.EDITVISIT="editVisit",en.LOADING="loadingVisit",en),cq=((ei={}).NOTSTARTED="notStarted",ei.ONGOING="ongoing",ei);let cY="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))",cZ=function(){try{return JSON.parse(sessionStorage.getItem("openmrs:visitStoreState")||"null")}catch(e){return null}}()||{patientUuid:null,manuallySetVisitUuid:null};function cJ(){return J("visit",cZ)}function cX(e,t){cJ().setState({patientUuid:e,manuallySetVisitUuid:t})}function cQ(e,t){return iR(`${iC}/visit`,{signal:t.signal,method:"POST",headers:{"Content-type":"application/json"},body:e})}function c0(e,t,r){return iR(`${iC}/visit/${e}`,{signal:r.signal,method:"POST",headers:{"Content-type":"application/json"},body:t})}function c1(e,t,r){return iR(`${iC}/visit?patient=${e}&v=${r??cY}`,{signal:t.signal,method:"GET",headers:{"Content-type":"application/json"}})}cJ().subscribe(e=>{var t;t=e,sessionStorage.setItem("openmrs:visitStoreState",JSON.stringify(t))});let c3=new es.BehaviorSubject(null);class c4{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+c4.version}static addUnaryOp(e){return c4.max_unop_len=Math.max(e.length,c4.max_unop_len),c4.unary_ops[e]=1,c4}static addBinaryOp(e,t,r){return c4.max_binop_len=Math.max(e.length,c4.max_binop_len),c4.binary_ops[e]=t,r?c4.right_associative.add(e):c4.right_associative.delete(e),c4}static addIdentifierChar(e){return c4.additional_identifier_chars.add(e),c4}static addLiteral(e,t){return c4.literals[e]=t,c4}static removeUnaryOp(e){return delete c4.unary_ops[e],e.length===c4.max_unop_len&&(c4.max_unop_len=c4.getMaxKeyLen(c4.unary_ops)),c4}static removeAllUnaryOps(){return c4.unary_ops={},c4.max_unop_len=0,c4}static removeIdentifierChar(e){return c4.additional_identifier_chars.delete(e),c4}static removeBinaryOp(e){return delete c4.binary_ops[e],e.length===c4.max_binop_len&&(c4.max_binop_len=c4.getMaxKeyLen(c4.binary_ops)),c4.right_associative.delete(e),c4}static removeAllBinaryOps(){return c4.binary_ops={},c4.max_binop_len=0,c4}static removeLiteral(e){return delete c4.literals[e],c4}static removeAllLiterals(){return c4.literals={},c4}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 c4(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 c4.binary_ops[e]||0}static isIdentifierStart(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!c4.binary_ops[String.fromCharCode(e)]||c4.additional_identifier_chars.has(String.fromCharCode(e))}static isIdentifierPart(e){return c4.isIdentifierStart(e)||c4.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(c4.hooks[e]){let r={context:this,node:t};return c4.hooks.run(e,r),r.node}return t}searchHook(e){if(c4.hooks[e]){let t={context:this};return c4.hooks[e].find(function(e){return e.call(t.context,t),t.node}),t.node}}gobbleSpaces(){let e=this.code;for(;e===c4.SPACE_CODE||e===c4.TAB_CODE||e===c4.LF_CODE||e===c4.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:c4.COMPOUND,body:e};return this.runHook("after-all",t)}gobbleExpressions(e){let t=[],r,n;for(;this.index<this.expr.length;)if((r=this.code)===c4.SEMCOL_CODE||r===c4.COMMA_CODE)this.index++;else if(n=this.gobbleExpression())t.push(n);else if(this.index<this.expr.length){if(r===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,c4.max_binop_len),t=e.length;for(;t>0;){if(c4.binary_ops.hasOwnProperty(e)&&(!c4.isIdentifierStart(this.code)||this.index+e.length<this.expr.length&&!c4.isIdentifierPart(this.expr.charCodeAt(this.index+e.length))))return this.index+=t,e;e=e.substr(0,--t)}return!1}gobbleBinaryExpression(){let e,t,r,n,i,o,a,s,l;if(!(o=this.gobbleToken())||!(t=this.gobbleBinaryOp()))return o;for(i={value:t,prec:c4.binaryPrecedence(t),right_a:c4.right_associative.has(t)},(a=this.gobbleToken())||this.throwError("Expected expression after "+t),n=[o,i,a];t=this.gobbleBinaryOp();){if(0===(r=c4.binaryPrecedence(t))){this.index-=t.length;break}i={value:t,prec:r,right_a:c4.right_associative.has(t)},l=t;let s=e=>i.right_a&&e.right_a?r>e.prec:r<=e.prec;for(;n.length>2&&s(n[n.length-2]);)a=n.pop(),t=n.pop().value,o=n.pop(),e={type:c4.BINARY_EXP,operator:t,left:o,right:a},n.push(e);(e=this.gobbleToken())||this.throwError("Expected expression after "+l),n.push(i,e)}for(s=n.length-1,e=n[s];s>1;)e={type:c4.BINARY_EXP,operator:n[s-1].value,left:n[s-2],right:e},s-=2;return e}gobbleToken(){let e,t,r,n;if(this.gobbleSpaces(),n=this.searchHook("gobble-token"))return this.runHook("after-token",n);if(e=this.code,c4.isDecimalDigit(e)||e===c4.PERIOD_CODE)return this.gobbleNumericLiteral();if(e===c4.SQUOTE_CODE||e===c4.DQUOTE_CODE)n=this.gobbleStringLiteral();else if(e===c4.OBRACK_CODE)n=this.gobbleArray();else{for(r=(t=this.expr.substr(this.index,c4.max_unop_len)).length;r>0;){if(c4.unary_ops.hasOwnProperty(t)&&(!c4.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!c4.isIdentifierPart(this.expr.charCodeAt(this.index+t.length)))){this.index+=r;let e=this.gobbleToken();return e||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:c4.UNARY_EXP,operator:t,argument:e,prefix:!0})}t=t.substr(0,--r)}c4.isIdentifierStart(e)?(n=this.gobbleIdentifier(),c4.literals.hasOwnProperty(n.name)?n={type:c4.LITERAL,value:c4.literals[n.name],raw:n.name}:n.name===c4.this_str&&(n={type:c4.THIS_EXP})):e===c4.OPAREN_CODE&&(n=this.gobbleGroup())}return n?(n=this.gobbleTokenProperty(n),this.runHook("after-token",n)):this.runHook("after-token",!1)}gobbleTokenProperty(e){this.gobbleSpaces();let t=this.code;for(;t===c4.PERIOD_CODE||t===c4.OBRACK_CODE||t===c4.OPAREN_CODE||t===c4.QUMARK_CODE;){let r;if(t===c4.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==c4.PERIOD_CODE)break;r=!0,this.index+=2,this.gobbleSpaces(),t=this.code}this.index++,t===c4.OBRACK_CODE?((e={type:c4.MEMBER_EXP,computed:!0,object:e,property:this.gobbleExpression()}).property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),(t=this.code)!==c4.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):t===c4.OPAREN_CODE?e={type:c4.CALL_EXP,arguments:this.gobbleArguments(c4.CPAREN_CODE),callee:e}:(t===c4.PERIOD_CODE||r)&&(r&&this.index--,this.gobbleSpaces(),e={type:c4.MEMBER_EXP,computed:!1,object:e,property:this.gobbleIdentifier()}),r&&(e.optional=!0),this.gobbleSpaces(),t=this.code}return e}gobbleNumericLiteral(){let e="",t,r;for(;c4.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);if(this.code===c4.PERIOD_CODE)for(e+=this.expr.charAt(this.index++);c4.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++));c4.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);c4.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+e+this.char+")")}return r=this.code,c4.isIdentifierStart(r)?this.throwError("Variable names cannot start with a number ("+e+this.char+")"):(r===c4.PERIOD_CODE||1===e.length&&e.charCodeAt(0)===c4.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:c4.LITERAL,value:parseFloat(e),raw:e}}gobbleStringLiteral(){let e="",t=this.index,r=this.expr.charAt(this.index++),n=!1;for(;this.index<this.expr.length;){let t=this.expr.charAt(this.index++);if(t===r){n=!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 n||this.throwError('Unclosed quote after "'+e+'"'),{type:c4.LITERAL,value:e,raw:this.expr.substring(t,this.index)}}gobbleIdentifier(){let e=this.code,t=this.index;for(c4.isIdentifierStart(e)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length;)if(e=this.code,c4.isIdentifierPart(e))this.index++;else break;return{type:c4.IDENTIFIER,name:this.expr.slice(t,this.index)}}gobbleArguments(e){let t=[],r=!1,n=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let i=this.code;if(i===e){r=!0,this.index++,e===c4.CPAREN_CODE&&n&&n>=t.length&&this.throwError("Unexpected token "+String.fromCharCode(e));break}if(i===c4.COMMA_CODE){if(this.index++,++n!==t.length){if(e===c4.CPAREN_CODE)this.throwError("Unexpected token ,");else if(e===c4.CBRACK_CODE)for(let e=t.length;e<n;e++)t.push(null)}}else if(t.length!==n&&0!==n)this.throwError("Expected comma");else{let e=this.gobbleExpression();e&&e.type!==c4.COMPOUND||this.throwError("Expected comma"),t.push(e)}}return r||this.throwError("Expected "+String.fromCharCode(e)),t}gobbleGroup(){this.index++;let e=this.gobbleExpressions(c4.CPAREN_CODE);if(this.code===c4.CPAREN_CODE)return(this.index++,1===e.length)?e[0]:!!e.length&&{type:c4.SEQUENCE_EXP,expressions:e};this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:c4.ARRAY_EXP,elements:this.gobbleArguments(c4.CBRACK_CODE)}}}Object.assign(c4,{hooks:new class{add(e,t,r){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][r?"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)})}}(c4),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"}),c4.max_unop_len=c4.getMaxKeyLen(c4.unary_ops),c4.max_binop_len=c4.getMaxKeyLen(c4.binary_ops);let c2=e=>new c4(e).parse(),c6=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(c4).filter(e=>!c6.includes(e)&&void 0===c2[e]).forEach(e=>{c2[e]=c4[e]}),c2.Jsep=c4,c2.plugins.register({name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;let r=t.node,n=this.gobbleExpression();if(n||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let i=this.gobbleExpression();if(i||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:r,consequent:n,alternate:i},r.operator&&e.binary_ops[r.operator]<=.9){let n=r;for(;n.right.operator&&e.binary_ops[n.right.operator]<=.9;)n=n.right;t.node.test=n.right,n.right=t.node,t.node=r}}else this.throwError("Expected :")}})}});let c5="ArrowFunctionExpression",c8={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)}},c9={...c8,Promise};function c7(e,t={}){return da(e,t,du)}async function de(e,t={}){return ds(e,t,du)}function dt(e,t={}){return da(e,t,dc)}function dr(e,t={}){return ds(e,t,dc)}function dn(e,t={}){return da(e,t,dd)}function di(e,t={}){return ds(e,t,dd)}function da(e,t={},r){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 n=dy(t,c8),i=dp("string"==typeof e?c2(e):e,n);if(r(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 ds(e,t={},r){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 n=dy(t,c9);return Promise.resolve(dp("string"==typeof e?c2(e):e,n)).then(t=>{if(r(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 dl(e){return c2(e)}function du(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e||e instanceof Date}function dc(e){return"boolean"==typeof e}function dd(e){return"number"==typeof e}function dp(e,t){switch(e.type){case"UnaryExpression":var r,n,i,o,a,s,l,u,c,d,p,f,h,m=e,y=t;let g=dp(m.argument,y);switch(m.operator){case"+":return+g;case"-":return-g;case"~":return~g;case"!":return!g;default:throw`Expression evaluator does not support operator '${m.operator}''`}case"BinaryExpression":var b=e,v=t;switch(b.operator){case"&&":return dp(b.left,v)&&dp(b.right,v);case"||":return dp(b.left,v)||dp(b.right,v);case"??":return dp(b.left,v)??dp(b.right,v)}let w=dp(b.left,v),x=dp(b.right,v);switch(b.operator){case"+":return w+x;case"-":return w-x;case"*":return w*x;case"/":return w/x;case"%":return w%x;case"**":return w**x;case"==":return w==x;case"===":return w===x;case"!=":return w!=x;case"!==":return w!==x;case">":return w>x;case">=":return w>=x;case"<":return w<x;case"<=":return w<=x;case"in":return w in x;default:throw`Expression evaluator does not support operator '${b.operator}' operator`}case"ConditionalExpression":return r=e,n=t,dp(r.test,n)?dp(r.consequent,n):dp(r.alternate,n);case"CallExpression":return dv(dh(e,t));case"ArrowFunctionExpression":let E;return i=e,o=t,E=i.params?.map(e=>{if("Identifier"===e.type)return e.name;throw`Cannot handle parameter of type ${e.type}`})??[],(function(...e){if(e.length<E.length)throw`Required argument(s) ${E.slice(e.length,-1).join(", ")} were not provided`;let t=Object.fromEntries(E.reduce((t,r,n)=>{let i=e[n];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 r of Object.keys(t))if(!e(t[r]))return!1;return!0}if(Array.isArray(t)){for(let r of t)if(!e(r))break}return!1}(i)&&t.push([r,i]),t},[]));return dp(i.body,o.addVariables(t))}).bind(null);case"MemberExpression":return dv(dm(e,t));case"ArrayExpression":return a=e,s=t,a.elements?.map(dw(s));case"SequenceExpression":let S;return l=e,u=t,(S=l.expressions.map(dw(u)))[S.length-1];case"NewExpression":var D=e,O=t;if(D.callee&&"Identifier"===D.callee.type){let e=D.arguments?.map(dw(O));switch(D.callee.name){case"Date":return new Date(...e);case"RegExp":return new RegExp(...e);default:throw`Cannot instantiate object of type ${D.callee.name}`}}if(D.callee)throw"new must be called with either Date or RegExp";throw'Could not handle "new" without a specified class';case"Literal":return e.value;case"Identifier":return c=e,d=t,(d_(c.name),d.variables&&Object.hasOwn(d.variables,c.name))?d.variables[c.name]:Object.hasOwn(d.globals,c.name)?d.globals[c.name]:void 0;case"TemplateLiteral":let P,C;return p=e,f=t,P=p.expressions?.map(dw(f))??[],(C=p.quasis?.map(dw(f))??[]).filter(e=>!e.tail).map(e=>e.value).join("")+P.join("")+C.filter(e=>e.tail).map(e=>e.value).join("");case"TemplateElement":return{value:(h=e).cooked,tail:h.tail};default:throw`Expression evaluator does not support expression of type '${e.type}'`}}function df(e,t){switch(e.type){case"Literal":return e.value;case"Identifier":return e.name;case"MemberExpression":return df(e.property,t);default:throw`VisitExpressionName does not support expression of type '${e.type}'`}}function dh(e,t){let r=db(e.callee,t);if(r===dg||e.optional&&null==r)return dg;let n=e.arguments?.map(dw(t));if(r){if("function"!=typeof r)throw`${dS(e.callee)} is not a function`}else throw`No function named ${dS(e.callee)} is defined in this context`;return r(...n)}function dm(e,t){let r=db(e.object,t);if(r===dg||e.optional&&null==r)return dg;if(null===r)throw TypeError(`TypeError: cannot read properties of null (reading '${dE(e.property,t)}')`);if(void 0===r)switch(e.object.type){case"Identifier":{let r=df(e.object,t);throw ReferenceError(`ReferenceError: ${r} is not defined`)}case"MemberExpression":throw TypeError(`TypeError: cannot read properties of undefined (reading '${dE(e.property,t)}')`);default:throw`VisitMemberExpression does not support operator '${e.object.type}' type`}if("object"!=typeof r&&"function"!=typeof r&&"string"!=typeof r&&"number"!=typeof r)throw`VisitMemberExpression does not support member access on type ${typeof r}`;let n=e.computed?function(e){if(void 0===e)throw{type:"Illegal property access",message:"No property was supplied to the property access"};if("string"!=typeof e&&"number"!=typeof e)throw{type:"Illegal property access",message:`Cannot use a value of type ${null===e?"null":typeof e} as a property name`};return e}(dp(e.property,t)):function(e){if("Identifier"!==e.type)throw`VisitMemberExpression does not support a property of type '${e.type}'`;return e.name}(e.property);d_(n),function(e,t){if(dx.has(String(t)))return;let r=Object(e);for(;null!==r;){if(Object.hasOwn(r,t)){if(r===Object.prototype||r===Function.prototype)throw{type:"Illegal property access",message:`Cannot access the ${t} property of objects`};return}r=Object.getPrototypeOf(r)}}(r,n);let i=r[n];return"function"==typeof i?i.bind(r):i}function dy(e,t){let r={variables:{...e},globals:{...t},addVariables(e){return this.variables={...this.variables,...e},this}};return r.addVariables.bind(r),r}c2.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 r=this.index;if(this.index++,this.gobbleSpaces(),this.code===e.CPAREN_CODE){this.index++;let e=this.gobbleBinaryOp();if("=>"===e){let r=this.gobbleBinaryExpression();r||this.throwError("Expected expression after "+e),t.node={type:c5,params:null,body:r};return}}this.index=r}}),e.hooks.add("after-expression",function(t){!function t(r){r&&(Object.values(r).forEach(e=>{e&&"object"==typeof e&&t(e)}),"=>"===r.operator&&(r.type=c5,r.params=r.left?[r.left]:null,r.body=r.right,r.params&&r.params[0].type===e.SEQUENCE_EXP&&(r.params=r.params[0].expressions),delete r.left,delete r.right,delete r.operator))}(t.node)})}}),c2.plugins.register({name:"new",init(e){e.addUnaryOp("new"),e.hooks.add("after-token",function(t){let r=t.node;if(r&&"new"===r.operator){r.argument&&[e.CALL_EXP,e.MEMBER_EXP].includes(r.argument.type)||this.throwError("Expected new function()"),t.node=r.argument;let n=t.node;for(;n.type===e.MEMBER_EXP||n.type===e.CALL_EXP&&n.callee.type===e.MEMBER_EXP;)n=n.type===e.MEMBER_EXP?n.object:n.callee.object;n.type="NewExpression"}})}}),c2.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 r(t){let r=this.index,n="",i=()=>{for(;e.isDecimalDigit(this.code)||95===this.code;)95===this.code?this.index++:n+=this.expr.charAt(this.index++)};i(),this.code===e.PERIOD_CODE&&(n+=this.expr.charAt(this.index++),i());let o=this.char;("e"===o||"E"===o)&&(n+=this.expr.charAt(this.index++),("+"===(o=this.char)||"-"===o)&&(n+=this.expr.charAt(this.index++)),i(),e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+n+this.char+")"));let a=this.code;if(e.isIdentifierStart(a))this.throwError("Variable names cannot start with a number ("+n+this.char+")");else if(a===e.PERIOD_CODE){n.length>1&&this.throwError(`Unexpected period ${JSON.stringify({chCode:a,number:n},null,2)}`),this.index=r;return}t.node={type:e.LITERAL,value:parseFloat(n),raw:this.expr.substring(r,this.index)}}e.hooks.add("gobble-token",function(n){if(48===this.code){var i,o,a;let s=this.index,l=this.expr.charAt(this.index+1),u=t.call(this,l);if(!u)return;let c="";for(;i=this.code,o=u,95===i||o.some(([e,t])=>i>=e&&i<=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,r.call(this,n);return}this.throwError("unexpected char within number")}n.node={type:e.LITERAL,value:parseInt(c,"x"===(a=l)||"X"===a?16:"b"===a||"B"===a?2:8),raw:this.expr.substring(s,this.index)}}else(e.isDecimalDigit(this.code)||this.code===e.PERIOD_CODE)&&r.call(this,n)})}}),c2.plugins.register({name:"regex",init(e){e.hooks.add("gobble-token",function(t){if(47===this.code){let r=++this.index,n=!1;for(;this.index<this.expr.length;){if(47===this.code&&!n){let n,i=this.expr.slice(r,this.index),o="";for(;++this.index<this.expr.length;){let e=this.code;if(e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57)o+=this.char;else break}try{n=new RegExp(i,o)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:n,raw:this.expr.slice(r-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===e.OBRACK_CODE?n=!0:n&&this.code===e.CBRACK_CODE&&(n=!1),this.index+=92===this.code?2:1}this.throwError("Unclosed Regex")}})}}),c2.plugins.register({name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;let r=t.node,n=this.gobbleExpression();if(n||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let i=this.gobbleExpression();if(i||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:r,consequent:n,alternate:i},r.operator&&e.binary_ops[r.operator]<=.9){let n=r;for(;n.right.operator&&e.binary_ops[n.right.operator]<=.9;)n=n.right;t.node.test=n.right,n.right=t.node,t.node=r}}else this.throwError("Expected :")}})}}),c2.plugins.register({name:"jsepTemplateLiteral",init(e){function t(e,r=!0){if(96===this.code){let t={type:"TemplateLiteral",quasis:[],expressions:[]},n="",i="",o=!1,a=this.expr.length,s=()=>t.quasis.push({type:"TemplateElement",value:{raw:i,cooked:n},tail:o});for(;this.index<a;){let a=this.expr.charAt(++this.index);if("`"===a)return this.index+=1,o=!0,s(),e.node=t,r&&(e.node=this.gobbleTokenProperty(e.node)),e.node;if("$"===a&&"{"===this.expr.charAt(this.index+1))this.index+=2,s(),i="",n="",t.expressions.push(...this.gobbleExpressions(125)),125!==this.code&&this.throwError("unclosed ${");else if("\\"===a)switch(i+=a,a=this.expr.charAt(++this.index),i+=a,a){case"n":n+="\n";break;case"r":n+="\r";break;case"t":n+=" ";break;case"b":n+="\b";break;case"f":n+="\f";break;case"v":n+="\v";break;default:n+=a}else n+=a,i+=a}this.throwError("Unclosed `")}}e.hooks.add("gobble-token",t),e.hooks.add("after-token",function(r){if((r.node.type===e.IDENTIFIER||r.node.type===e.MEMBER_EXP)&&96===this.code)return r.node={type:"TaggedTemplateExpression",tag:r.node,quasi:t.bind(this)(r,!1)},r.node=this.gobbleTokenProperty(r.node),r.node})}}),c2.addBinaryOp("in",7),c2.addBinaryOp("??",1);let dg=Symbol("optional chain short-circuited");function db(e,t){switch(e.type){case"MemberExpression":return dm(e,t);case"CallExpression":return dh(e,t);default:return dp(e,t)}}function dv(e){return e===dg?void 0:e}function dw(e){return function(t){return null===t?null:dp(t,e)}}function d_(e){if("__proto__"===e||"prototype"===e||"constructor"===e)throw{type:"Illegal property access",message:`Cannot access the ${e} property of objects`}}let dx=new Set(["toString","valueOf","hasOwnProperty"]);function dE(e,t){try{return df(e,t)}catch{return"<computed>"}}function dS(e){return e?"MemberExpression"===e.type?e.property?.name:e.name:null}function dD(e){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.`;let t={globals:{...c9},isLocalExpression:!1,variables:new Set};return dO("string"==typeof e?c2(e):e,t),[...t.variables]}function dO(e,t){switch(e.type){case"UnaryExpression":return n=e,i=t,dO(n.argument,i);case"BinaryExpression":return o=e,a=t,[dO(o.left,a),dO(o.right,a)].filter(Boolean);case"ConditionalExpression":return s=e,l=t,[dO(s.consequent,l),dO(s.test,l),dO(s.alternate,l)].filter(Boolean);case"CallExpression":let r;return u=e,c=t,r=dO(u.callee,c),u.arguments?.map(dP(c)),r;case"ArrowFunctionExpression":var n,i,o,a,s,l,u,c,d,p,f,h,m,y,g,b,v=e,w=t;let x={...w};x.isLocalExpression=!0;let E=v.params?.map(dP(x))??[],S=dO(v.body,x)??[];if(S&&Array.isArray(S))for(let e of S)E.includes(e)||w.variables.add(e);return;case"MemberExpression":var D=e,O=t;if(dO(D.object,O),D.computed)return void dO(D.property,O);let P={...O};P.isLocalExpression=!0,dO(D.property,P);return;case"ArrayExpression":return d=e,p=t,void d.elements?.map(dP(p));case"SequenceExpression":return f=e,h=t,void f.expressions?.map(dP(h));case"NewExpression":return m=e,y=t,void m.arguments?.map(dP(y));case"Literal":case"TemplateElement":return;case"Identifier":var C=e,k=t;if(!(C.name in k.globals))if(k.isLocalExpression)return C.name;else k.variables.add(C.name);return;case"TemplateLiteral":return g=e,b=t,void(g.expressions?.map(dP(b)),g.quasis?.map(dP(b)));default:throw`Expression evaluator does not support expression of type '${e.type}'`}}function dP(e){return function(t){return null===t?null:dO(t,e)}}let dC=J("feature-flags",{flags:function(){let e={};for(let t of Object.keys(localStorage))if(t.startsWith("openmrs:feature-flag:")){let r=t.replace("openmrs:feature-flag:",""),n=JSON.parse(localStorage.getItem(`openmrs:feature-flag-meta:${r}`)||"{}");e[r]={enabled:"true"===localStorage.getItem(t),...n}}return e}()});function dk(e,t,r){dC.setState(n=>({flags:{...n.flags,[e]:{enabled:n.flags[e]?.enabled??!1,label:t,description:r}}}))}function dj(){let e=dC.getState().flags;Object.keys(localStorage).filter(e=>e.startsWith("openmrs:feature-flag:")).forEach(t=>{let r=t.replace("openmrs:feature-flag:","");e[r]||(localStorage.removeItem(t),localStorage.removeItem(`openmrs:feature-flag-meta:${r}`))})}function dT(e){return dC.getState().flags[e].enabled}function dR(e,t){dC.subscribe(r=>{t(r.flags[e].enabled)})}function dA(e,t){dC.setState(r=>({flags:{...r.flags,[e]:{...r.flags[e],enabled:t}}}))}function dN(e){return!window.offlineEnabled||(e??navigator.onLine)}dC.subscribe(e=>{for(let[t,r]of Object.entries(e.flags))localStorage.setItem(`openmrs:feature-flag:${t}`,r.enabled.toString()),localStorage.setItem(`openmrs:feature-flag-meta:${t}`,JSON.stringify({label:r.label,description:r.description}))});var dM=e3(function(e,t,r){eQ(e,t,r)});function dI(e=!0,t=!1){return d$(dN(),e,t)}function d$(e,t=!0,r=!1){return!!(e?t:r)}let dL=Y("extensionsInternal",{slots:{},extensions:{}}),dF=Y("extensionRenderings",{renderings:new Map}),dB=()=>J("extensionsInternal",{slots:{},extensions:{}}),dV=()=>J("extensionRenderings",{renderings:new Map});function dU(e){let t=dL.getState(),r=e(t);r!==t&&dL.setState(r)}let dW=null,dK=null;function dH(){let e=dF.getState();return dW&&e===dK||(dW=new Map(e.renderings),dK=e,function(e){for(let t of(d1.clear(),e.values()))d4(t,1);d3=!0}(dW)),dW}function dz(e){dK={renderings:e},dF.setState(dK,!0)}function dG(e){let t=dH();t.has(e.renderingId)||(t.set(e.renderingId,e),d4(e,1),dz(t))}function dq(e){let t=dH(),r=t.get(e);r&&(t.delete(e),d4(r,-1),dz(t))}let dY=()=>J("extensions",{slots:{}}),dZ=0,dJ=new Set;function dX(e){dZ++;try{return e()}finally{if(0==--dZ&&dJ.size>0){let e=Array.from(dJ);for(let t of(dJ.clear(),e))dQ(t)}}}function dQ(e){try{e()}catch(t){console.error(`The extension system's '${e.name}' recomputation failed`,t)}}function d0(e){dZ>0?dJ.add(e):dQ(e)}let d1=new Map,d3=!1;function d4(e,t){let r=JSON.stringify([e.slotName,e.extensionId,e.slotModuleName,e.extensionModuleName]),n=d1.get(r);if(!n){if(t<0)return;d1.set(r,{count:1,record:{slotModuleName:e.slotModuleName,extensionModuleName:e.extensionModuleName,slotName:e.slotName,extensionId:e.extensionId}}),d3=!0;return}n.count+=t,n.count<1&&(d1.delete(r),d3=!0)}function d2(){var e,t;if(dH(),!d3)return;d3=!1;let r=Array.from(d1.values(),({record:e})=>e);r.sort(d6),e=tq.getState().mountedExtensions,t=r,e.length===t.length&&e.every((e,r)=>0===d6(e,t[r]))||tq.setState({mountedExtensions:r})}function d6(e,t){return d5(e.slotName,t.slotName)||d5(e.extensionId,t.extensionId)||d5(e.slotModuleName,t.slotModuleName)||d5(e.extensionModuleName,t.extensionModuleName)}function d5(e,t){return e===t?0:e<t?-1:1}d2(),dF.subscribe(()=>d0(d2));let d8=dB(),d9=dY(),d7=tZ(),pe=tQ(),pt=new Set,pr=!1;function pn(e){if(null===e)pt=null;else if(null!==pt)for(let t of e)pt.add(t);d0(pi)}function pi(){if(!pr){pr=!0;try{for(let e=1;;e++){let t=pt;if(null!==t&&0===t.size)return;pt=new Set;try{!function(e,t,r,n,i,o=null){let a=d9.getState().slots,s={},l=!1,u=dN(),c=Object.entries(n.flags).filter(([,{enabled:e}])=>e).map(([e])=>e);for(let[n,d]of Object.entries(e.slots)){let p=a[n];if(p&&o&&!o.has(n)){s[n]=p;continue}let{config:f}=tX(t,d.name),h=function(e,t,r,n,i,o,a){let s=function(e,t){let r=e.add||[],n=e.remove||[],i=e.order||[],{extensions:o}=d8.getState();return[...t,...r].filter(e=>!n.includes(e)).sort((e,r)=>pm(e,i,o[pl(e)]?.order,t)-pm(r,i,o[pl(r)]?.order,t))}(r,t.slots[e].attachedIds),l=[];for(let u of s){let{config:s}=t1(n,e,u),c=t3(r,e,u),d=c?dM({},s,c):s,p=pl(u),f=t.extensions[p];if(f){let e=d?.["Display conditions"]?.privileges??f.privileges??[];if(e&&("string"==typeof e||Array.isArray(e)&&e.length>0)&&(!a?.user||!iU(e,a.user))||f.featureFlag&&!i.includes(f.featureFlag)||window.offlineEnabled&&!d$(o,f.online,f.offline))continue;l.push({id:u,name:p,moduleName:f.moduleName,config:d,featureFlag:f.featureFlag,meta:f.meta,online:d?.["Display conditions"]?.online??f.online??!0,offline:d?.["Display conditions"]?.offline??f.offline??!1,displayConditionExpression:d?.["Display conditions"]?.expression||f.displayExpression})}}return l}(n,e,f,r,c,u,i.session);p&&p.moduleName===d.moduleName&&e6(p.candidateExtensions,h)?s[n]=p:(s[n]={moduleName:d.moduleName,candidateExtensions:h},l=!0)}(l||Object.keys(a).length!==Object.keys(s).length)&&d9.setState({slots:s})}(d8.getState(),d7.getState(),pe.getState(),dC.getState(),iM.getState(),t)}catch(e){throw pt=null===t||null===pt?null:new Set([...t,...pt]),e}if(e>=20)return void console.error("The extension system stopped recomputing after 20 passes because something keeps invalidating slots in response to the extension store being written. Some slots are left stale until the next write.")}}finally{pr=!1}}}function po(e,t){let r=new Set;for(let n of Object.keys(e))e[n]!==t[n]&&r.add(n);for(let n of Object.keys(t))n in e||r.add(n);return r}function pa(){pn(null)}function ps(e,t){return{moduleName:t,name:e,attachedIds:[]}}function pl(e){let[t]=e.split("#");return t}function pu(e,t){let r=pl(t);return e.extensions[r]}function pc(e){return pu(d8.getState(),e)}d8.subscribe((e,t)=>{pn(e.extensions!==t.extensions?null:po(e.slots,t.slots))}),d7.subscribe((e,t)=>{pn(po(e.slots,t.slots))}),pe.subscribe((e,t)=>{pn(po(e.configs,t.configs))}),dC.subscribe(()=>pn(null)),iM.subscribe(()=>pn(null)),pa(),b(pa);let pd=e=>dU(t=>({...t,extensions:{...t.extensions,[e.name]:{...e}}}));function pp(e,t){dU(r=>{let n=r.slots[e];return n?{...r,slots:{...r.slots,[e]:{...n,attachedIds:[...n.attachedIds,t]}}}:{...r,slots:{...r.slots,[e]:{...ps(e),attachedIds:[t]}}}})}function pf(e,t){dU(r=>{let n=r.slots[e];return n&&n.attachedIds.includes(t)?{...r,slots:{...r.slots,[e]:{...n,attachedIds:n.attachedIds.filter(e=>e!==t)}}}:r})}function ph(e){dU(t=>{let r=t.slots[e];return r?{...t,slots:{...t.slots,[e]:{...r,attachedIds:[]}}}:t})}function pm(e,t,r,n){let i=t.indexOf(e);if(-1!==i)return i;{if(void 0!==r)return 1e3+r;let t=n.indexOf(e);return -1!==t?2e3+t:3e3}}function py(e,t){return function(e,t,r=null,n){let i;return e.filter(e=>{let o=e.displayConditionExpression;if("string"!=typeof o||0===o.trim().length)return!0;i??(i=t&&"object"==typeof t?{session:r,...t}:{session:r});try{return!!dt(o,i)}catch(t){return console.error(`Error while evaluating expression '${o}' for ${e.id}`+(n?` in ${n}`:""),t),!1}})}(pg(e),t,iM.getState().session,e)}function pg(e){return d9.getState().slots[e]?.candidateExtensions??[]}let pb=(e,t)=>d8.setState(r=>{let n=r.slots[t]?.moduleName;if(n&&n!=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 ${n}.`),r;if(n&&n==e)return r;if(r.slots[t])return{...r,slots:{...r.slots,[t]:{...r.slots[t],moduleName:e}}};let i=ps(t,e);return{...r,slots:{...r.slots,[t]:{...i}}}}),pv=()=>{pt=null,dU(()=>({slots:{},extensions:{}})),dV().setState({renderings:new Map}),d9.setState({slots:{}})},pw=Y("left-nav",{slotName:null,basePath:window.spaBase,mode:"normal"});function p_({name:e,basePath:t,mode:r,componentContext:n,state:i}){pw.setState({slotName:e,basePath:t,mode:r??"normal",componentContext:n,state:i})}function px(e){pw.getState().slotName===e&&pw.setState(pw.getInitialState(),!0)}let pE=Y("modalRegistry",{modals:{}});function pS(e){pE.setState(t=>(t.modals[e.name]=e,t))}function pD(e){let t=pE.getState().modals[e];if(!t){let r=pc(e);r&&(t={name:e,load:r.load,moduleName:r.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.`),pS(t))}return t}let pO=Y("workspaceRegistrations",{workspaces:{}}),pP=Y("workspaceGroups",{workspaceGroups:{}});function pC(e){pO.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 pk(e){pP.setState(t=>{let r=t.workspaceGroups[e.name];return r?{workspaceGroups:{...t.workspaceGroups,[e.name]:{...r,members:Array.from(new Set([...r.members,...e.members]))}}}:{workspaceGroups:{...t.workspaceGroups,[e.name]:{name:e.name,members:e.members}}}})}let pj=new Set;function pT(e){let t=pO.getState().workspaces;if(t[e])return t[e];{let t=pc(e);if(t){var r;let n;return pj.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.`),pj.add(e)),{name:t.name,title:(r=t,"string"==typeof(n=r?.meta?.title)?n:n&&"object"==typeof n?oT(r.moduleName,n.key,n.default):r.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 pR(e){let t=pP.getState().workspaceGroups;if(t[e])return t[e];throw Error(`No workspace group named '${e}' has been registered.`)}let pA=Y("workspace2",{registeredGroupsByName:{},registeredWindowsByName:{},registeredWorkspacesByName:{},openedGroup:null,openedWindows:[],workspaceTitleByWorkspaceName:{},isMostRecentlyOpenedWindowHidden:!1});function pN(e){let{registeredWorkspacesByName:t,registeredWindowsByName:r}=pA.getState(),n=t[e];if(n){let t=r[n.window];if(t)return t;throw Error(`No workspace window found with name: ${n.window} for workspace: ${e}`)}throw Error(`No workspace found with name: ${e}`)}function pM(e){let{registeredGroupsByName:t,registeredWindowsByName:r}=pA.getState(),n=r[e];if(n){let r=t[n.group];if(r)return r;throw Error(`No workspace group found with name: ${n.group} for window: ${e}`)}throw Error(`No workspace window found with name: ${e}`)}function pI(e){let{openedWindows:t}=pA.getState();return t.findIndex(t=>t.openedWorkspaces.find(t=>t.workspaceName===e))}function p$(e,t){if(0==t.length)return;let{registeredGroupsByName:r}=pA.getState(),n={...r};for(let r of t){if(n[r.name])throw Error(`Cannot register workspace group ${r.name} more than once`);n[r.name]={...r,moduleName:e}}pA.setState({registeredGroupsByName:n})}function pL(e,t){if(0==t.length)return;let{registeredWindowsByName:r}=pA.getState(),n={...r};for(let r of t){if(n[r.name])throw Error(`Cannot register workspace window ${r.name} more than once`);let t={...r,moduleName:e};n[r.name]=t}pA.setState({registeredWindowsByName:n})}function pF(e,t){if(0==t.length)return;let{registeredWorkspacesByName:r}=pA.getState(),n={...r};for(let r of t){if(n[r.name])throw Error(`Cannot register workspace ${r.name} more than once`);let t={...r,moduleName:e};n[r.name]=t}pA.setState({registeredWorkspacesByName:n})}let pB=0,pV=null,pU={bootstrap:15e3,mount:15e3,unmount:15e3};function pW(e,t){if(e.timeouts)return e;let r=e.name??"parcel",n=Object.fromEntries(Object.keys(pU).filter(t=>e[t]).map(n=>{var i,o;let a,s;return[n,(i=e[n],o=pU[n],a=Array.isArray(i)?i:[i],s=e=>a.reduce((t,i,o)=>t.then(()=>{let t=i(e);return"function"==typeof t?.then&&"function"==typeof t?.catch?t:Promise.reject(Error(`Lifecycle function ${n} at array index ${o} for parcel ${r} did not return a promise`))}),Promise.resolve(void 0)),e=>{let i,a=new Promise((e,t)=>{i=setTimeout(()=>t(Error(`Lifecycle function ${n} for parcel ${r} did not settle within ${o}ms`)),o)});return Promise.race([s(e),a]).finally(()=>clearTimeout(i)).then(e=>(t(n,!1),e),e=>{throw t(n,!0),e})})]}));return{...e,...n}}async function pK(e,t){var r,n;let i,o,a,s,l,u=await (pV??(pV=new Promise((e,t)=>{nC({name:"openmrs-extension-host",bootstrap:()=>Promise.resolve(),mount:t=>(e(t.mountParcel),Promise.resolve()),unmount:()=>Promise.resolve()},{domElement:document.createElement("div")}).mountPromise.catch(t)}).catch(e=>(console.error("The host parcel used to mount extensions could not be mounted. Falling back to mounting extensions as root parcels, which leaks their DOM elements.",e),nC))),pV),c={...t},d=(i=c,o=!1,{retarget:e=>i={...e},release:a=()=>(function(e){for(let t of Object.keys(e))delete e[t]})(i),onSettled(e,t){switch(e){case"bootstrap":t&&a();return;case"mount":o||(o=t);return;case"unmount":(t||o)&&a();return}}});return n=u((r=d.onSettled,"function"==typeof e?()=>e().then(e=>pW(e,r)):pW(e,r)),c),s=e=>t=>e.call(n,d.retarget(t)).catch(e=>{throw"SKIP_BECAUSE_BROKEN"===n.getStatus()&&d.release(),e}),l=n.update&&s(n.update),Object.defineProperty(n,"update",{configurable:!0,enumerable:!0,get:()=>l,set:e=>{l=e&&s(e)}})}function pH(){return pz}function pz(e,t){let r,n=pK(e,t).then(e=>r=e);return{mount:()=>n.then(e=>e.mount()),unmount:()=>n.then(e=>e.unmount()),update:e=>n.then(t=>t.update?.(e)),getStatus:()=>r?.getStatus()??"LOADING_SOURCE_CODE",get loadPromise(){return n.then(e=>e.loadPromise)},get bootstrapPromise(){return n.then(e=>e.bootstrapPromise)},get mountPromise(){return n.then(e=>e.mountPromise)},get unmountPromise(){return n.then(e=>e.unmountPromise)}}}async function pG(e,t,r,n,i=e=>e,o={}){let a=pl(n),s=pc(n),l=null;if(e){if(!s)throw Error(`Couldn't find extension '${a}' to attach to '${t}'`);let{meta:u,moduleName:c,online:d,offline:p,load:f}=s;if(dI(d,p)){let s,d=pB++,p=`${t}/${n}-${d}`;e.dataset.extensionRenderingId=p;let h=e=>{try{dq(p)}catch(t){console.error(e,t)}};try{dG({renderingId:p,extensionName:a,extensionModuleName:c,extensionId:n,slotName:t,slotModuleName:r})}catch(e){throw h(`Recomputing configuration after registering '${n}' failed also failed`),e}try{s=await f()}catch(e){throw h(`Recomputing configuration after '${n}' failed to load also failed`),e}try{l=await pK(i({...s,name:`${t}/${a}-${d}`}),{...o,_meta:u,_extensionContext:{extensionId:n,extensionSlotName:t,extensionSlotModuleName:r,extensionModuleName:c,extensionMeta:u},domElement:e})}catch(e){throw h(`Recomputing configuration after '${n}' failed to mount also failed`),e}l.mountPromise.then(void 0,e=>{console.error(`Extension '${n}' in slot '${t}' failed to mount`,e),h(`Recomputing configuration after '${n}' failed to mount also failed`)}),l.unmountPromise.then(()=>h(`Recomputing configuration after unmounting '${n}' failed`),e=>{console.error(`Extension '${n}' in slot '${t}' failed to unmount`,e),h(`Recomputing configuration after '${n}' failed to unmount also failed`)})}}else console.warn(`Tried to render ${n} into ${t} but no DOM element was available.`);return l}var pq=r(5275),pY=r.n(pq);let pZ=(0,pq.createContext)({moduleName:"",featureName:""});function pJ({to:e,templateParams:t,onBeforeNavigate:r,children:n,...i}){return(0,pq.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}`)},[]),pY().createElement("a",{onClick:n=>{0===n.button&&!n.ctrlKey&&!n.shiftKey&&!n.altKey&&!n.metaKey&&(n.preventDefault(),r?.(n),ib({to:e,templateParams:t})),0===n.button&&(n.ctrlKey||n.metaKey)&&r?.(n),0===n.button&&n.shiftKey&&r?.(n),1===n.button&&r?.(n)},href:iy(e,t),...i},n)}let pX=({state:e,children:t,...r})=>{let{extension:n}=(0,pq.useContext)(pZ),i=(0,pq.useRef)(null),o=(0,pq.useRef)(Promise.resolve()),a=(0,pq.useRef)(!1),s=(0,pq.useRef)(!1),l=(0,pq.useRef)(e),u=(0,pq.useCallback)(e=>{if(!e)return;let t=()=>{"MOUNTED"===e.getStatus()&&e.unmount()};switch(e.getStatus()){case"MOUNTED":e.unmount();break;case"UPDATING":o.current?.then(t,t);break;default:e.mountPromise.then(t,()=>{})}},[]),c=(0,pq.useCallback)((e,t)=>{e.update&&"UNMOUNTING"!==e.getStatus()&&(o.current=Promise.all([e.mountPromise,o.current]).then(()=>{if(i.current?.getStatus()==="MOUNTED"&&i.current.update)return i.current.update({...t})}).catch(e=>{let t=i.current?.getStatus();"UNMOUNTING"!==t&&"NOT_MOUNTED"!==t&&"UNLOADING"!==t&&console.error(`The extension '${n?.extensionId}' failed to update`,e)}))},[]),d=(0,pq.useCallback)(t=>{t&&!i.current&&!s.current&&n?.extensionSlotName&&n.extensionSlotModuleName&&(s.current=!0,pG(t,n.extensionSlotName,n.extensionSlotModuleName,n.extensionId,void 0,e).then(t=>{(s.current=!1,i.current=t,a.current)?u(t):t&&l.current!==e&&c(t,l.current)},()=>{s.current=!1}))},[]);return(0,pq.useEffect)(()=>(a.current=!1,()=>{a.current=!0,u(i.current)}),[]),(0,pq.useEffect)(()=>{l.current=e,i.current&&c(i.current,e)},[e]),n?pY().createElement("div",{ref:d,"data-extension-id":n?.extensionId,style:{position:"relative"},...r}):null};function pQ(e){let t=(0,pq.useRef)(e);return F(t.current,e)||(t.current=e),t.current}function p0(e,t){"function"==typeof t&&(t=t(e));let r={};for(let[n,i]of Object.entries(t)){let t=function(...t){e.setState(e=>i(e,...t))};r[n]=t}return r}let p1=e=>e;function p3(e,t=p1,r){let n=(0,pq.useCallback)(t=>e.subscribe(t),[e]),i=(0,pq.useCallback)(()=>t(e.getState()),[e,t]),o=(0,pq.useSyncExternalStore)(n,i,i),a=(0,pq.useMemo)(()=>r?p0(e,r):null,[e,r]);return(0,pq.useMemo)(()=>a?{...o,...a}:o,[o,a])}function p4(e,t){return p3(e,p1,t)}function p2(e){return function(t){let r=(0,pq.useCallback)(t=>e.subscribe(t),[]),n=(0,pq.useCallback)(()=>e.getState(),[]),i=(0,pq.useSyncExternalStore)(r,n,n),o=(0,pq.useMemo)(()=>t?p0(e,t):null,[t]);return(0,pq.useMemo)(()=>o?{...i,...o}:i,[i,o])}}let p6=[];Object.freeze(p6);let p5={candidateExtensions:p6};Object.freeze(p5);let p8=e=>{let t=(0,pq.useCallback)(t=>t.slots?.[e]??p5,[e]);return p3(dY(),t)},p9=e=>e.session;function p7(e,t){let{candidateExtensions:r}=p8(e),n=p3(iM,p9),i=pQ(t);return(0,pq.useMemo)(()=>py(e,i),[e,i,n,r])}function fe(e,t){let{moduleName:r}=(0,pq.useContext)(pZ);if(!r)throw Error("ComponentContext has not been provided. This should come from @openmrs/esm-react-utils.");return(0,pq.useEffect)(()=>{pb(r,e)},[r,e]),{extensions:p7(e,t),extensionSlotName:e,extensionSlotModuleName:r}}function ft(e){return e}function fr({name:e,extensionSlotName:t,select:r=ft,children:n,state:i,style:o,...a}){if(n&&i)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 s=e??t,l=(0,pq.useRef)(null),{extensions:u,extensionSlotModuleName:c}=fe(s,i),d=(0,pq.useMemo)(()=>r(u),[r,u]),p=(0,pq.useMemo)(()=>{if("function"==typeof n&&!pY().isValidElement(n))return d.map(e=>n(e,i))},[n,d]);return pY().createElement("div",{ref:l,"data-extension-slot-name":s,"data-extension-slot-module-name":c,style:{...o,position:"relative"},...a},s&&d?.map((e,t)=>pY().createElement(pZ.Provider,{key:e.id,value:{moduleName:c,featureName:"",extension:{extensionId:e.id,extensionSlotName:s,extensionSlotModuleName:c,extensionMeta:e.meta}}},p?.[t]??("function"!=typeof n?n:null)??pY().createElement(pX,{state:i}))))}var fn=r(5338);function fi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function fo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fi(Object(r),!0).forEach(function(t){var n,i,o;n=e,i=t,o=r[t],i in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fi(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function fa(e){return(fa="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 fs(e){return(fs="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 fl(e,t){var r;if("function"!=typeof(r=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 r="single-spa-application:".concat(t);return function(){var e=document.getElementById(r);return e||((e=document.createElement("div")).id=r,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(fs(r)));return function(){var e=r(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(fs(e)));return e}}var fu=null;try{fu=require("react").createContext()}catch(e){}var fc={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 fd(e,t){return e.rootComponent?Promise.resolve():e.loadRootComponent(t).then(function(t){e.rootComponent=t})}function fp(e,t){return new Promise(function(r,n){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 i,o=fy(e,t,function(){r(this)}),a=fl(e,t)(),s=function(e){var t=e.reactDom,r=e.renderType,n=e.elementToRender,i=e.domElement,o=t[r];if("function"!=typeof o)throw Error('renderType "'.concat(r,'" did not return a function.'));switch(r){case"createRoot":case"unstable_createRoot":case"createBlockingRoot":case"unstable_createBlockingRoot":var a=o(i);return a.render(n),a;case"hydrateRoot":return o(i,n);default:return o(n,i),null}}({elementToRender:o,domElement:a,reactDom:fm(e),renderType:"function"==typeof(i=e).renderType?i.renderType():i.renderType});e.domElements[t.name]=a,e.renderResults[t.name]=s})}function ff(e,t){return new Promise(function(r){e.unmountResolves[t.name]=r;var n=e.renderResults[t.name];n&&n.unmount?n.unmount():fm(e).unmountComponentAtNode(e.domElements[t.name]),delete e.domElements[t.name],delete e.renderResults[t.name]})}function fh(e,t){return new Promise(function(r){e.updateResolves[t.name]||(e.updateResolves[t.name]=[]),e.updateResolves[t.name].push(r);var n=fy(e,t,null),i=e.renderResults[t.name];if(i&&i.render)i.render(n);else{var o=fl(e,t)();fm(e).render(n,o)}})}function fm(e){return e.ReactDOMClient||e.ReactDOM}function fy(e,t,r){var n=e.React.createElement(e.rootComponent,t),i=fu?e.React.createElement(fu.Provider,{value:t},n):n;return(e.errorBoundary||t.errorBoundary||e.errorBoundaryClass||t.errorBoundaryClass)&&(e.errorBoundaryClass=e.errorBoundaryClass||t.errorBoundaryClass||function(e,t){function r(t){e.React.Component.apply(this,arguments),this.state={caughtError:null,caughtErrorInfo:null},r.displayName="SingleSpaReactErrorBoundary(".concat(t.name,")")}return r.prototype=Object.create(e.React.Component.prototype),r.prototype.render=function(){return this.state.caughtError?(e.errorBoundary||t.errorBoundary)(this.state.caughtError,this.state.caughtErrorInfo,this.props):this.props.children},r.prototype.componentDidCatch=function(e,t){this.setState({caughtError:e,caughtErrorInfo:t})},r}(e,t),i=e.React.createElement(e.errorBoundaryClass,t,i)),i=e.React.createElement(e.SingleSpaRoot,fo(fo({},t),{},{mountFinished:r,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])}}),i)}var fg=r(8395),fb=r(6335),fv=r.n(fb),fw=r(3954);let f_={strictMode:!0,throwErrorsToConsole:!0,disableTranslations:!1},fx=new Map;(0,fw.initCache)(fx);let fE={errorRetryCount:3,fetcher:iR,focusThrottleInterval:18e5,revalidateIfStale:!0,revalidateOnFocus:!1,revalidateOnReconnect:!1,refreshInterval:0,shouldRetryOnError:e=>{if(e instanceof iN){let t=e.response.status;return!!(t>=500)||401===t||403===t||429===t}return!0},provider:()=>fx};function fS(e){if("object"!=typeof e||"string"!=typeof e.featureName||"string"!=typeof e.moduleName)throw Error("Invalid options");let t=Object.assign({},f_,e),r={...fE,...t.swrConfig};return function(e){var n,i,o,a,s;return o=i=class extends(n=pY().Component){componentDidCatch(e,r){r&&r.componentStack&&(e.extra=Object.assign(e.extra||{},{componentStack:r.componentStack})),t.throwErrorsToConsole&&setTimeout(()=>{throw e}),this.setState({caughtError:e,caughtErrorInfo:r})}render(){if(this.state.caughtError)return pY().createElement("div",null,"An error has occurred. Please try reloading the page.");{let n=pY().createElement(pq.Suspense,{fallback:null},pY().createElement(fb.SWRConfig,{value:r},pY().createElement(pZ.Provider,{value:this.state.config},t.disableTranslations?pY().createElement(e,this.props):pY().createElement(fg.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},pY().createElement(e,this.props)))));return t.strictMode&&pY().StrictMode?pY().createElement(pY().StrictMode,null,n):n}}constructor(e){super(e),this.state={caughtError:null,caughtErrorInfo:null,config:{moduleName:t.moduleName,featureName:t.featureName,extension:e._extensionContext}}}},a="displayName",s=`OpenmrsReactComponent(${t.featureName})`,a in o?Object.defineProperty(o,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):o[a]=s,i}}function fD(e,t){return function(e){if("object"!==fa(e))throw Error("single-spa-react requires a configuration object");var t,r=fo(fo({},fc),e);if(!r.React)throw Error("single-spa-react must be passed opts.React");if(!r.ReactDOM&&!r.ReactDOMClient)throw Error("single-spa-react must be passed opts.ReactDOM or opts.ReactDOMClient");if(r.renderType||(null!=(t=r.ReactDOMClient)&&t.createRoot?r.renderType="createRoot":r.renderType="render"),!r.rootComponent&&!r.loadRootComponent)throw Error("single-spa-react must be passed opts.rootComponent or opts.loadRootComponent");if(r.errorBoundary&&"function"!=typeof r.errorBoundary)throw Error("The errorBoundary opt for single-spa-react must either be omitted or be a function that returns React elements");!fu&&r.React.createContext&&(fu=r.React.createContext()),r.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}(r);var n={bootstrap:fd.bind(null,r),mount:fp.bind(null,r),unmount:ff.bind(null,r)};return r.parcelCanUpdate&&(n.update=fh.bind(null,r)),n}({React:pY(),ReactDOMClient:fn,rootComponent:fS(t)(e)})}function fO(e,t){return()=>e().then(({default:e})=>fD(e,t))}function fP(e,t){return()=>Promise.resolve(fD(e,t))}let fC=fO,fk=W()(()=>({}));Z("openmrs-app-context",fk);let fj={};function fT(e,t=e=>e){let r=fk.getState();return e in r?Object.freeze(Object.assign({},t?t(r[e]):r[e])):null}function fR(e,t){fk.setState(r=>(e in r||(r[e]={}),r[e]=t(r[e]),Object.assign({},r)))}function fA(e){return null===e?null:Object.freeze(Object.assign({},e))}let fN=new Map;function fM(e,t){let r=(0,pq.useRef)(t??{}),n=(0,pq.useRef)(t=>fR(e,t)),i=(0,pq.useRef)(Symbol());return(0,pq.useEffect)(()=>{let r=t??{},n=i.current;return null===fT(e)?!function(e,t=fj){fk.setState(r=>{if(e in r)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({},r,{[e]:t===fj?{}:t})})}(e,r):(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.`),fR(e,()=>r)),fN.set(e,n),()=>{fN.get(e)===n&&(fk.setState(t=>(e in t&&delete t[e],t)),fN.delete(e))}},[e]),(0,pq.useEffect)(()=>{let n=t??{};F(r.current,n)||(fR(e,()=>n),r.current=n)},[t]),n.current}function fI({namespace:e,value:t}){return fM(e,t),null}let f$=({children:e,value:t,fallback:r})=>t?pY().createElement(pY().Fragment,null,e):r?pY().createElement(pY().Fragment,null,r):null;function fL(){let e=(0,pq.useRef)();return(!e.current||e.current.signal.aborted)&&(e.current=new AbortController),(0,pq.useEffect)(()=>{let t=e.current;return()=>t?.abort()},[]),e.current}function fF(e,t=e=>e??{}){let[r,n]=(0,pq.useState)(()=>{if(fB(e))return;let r=fT(e);if(null!==r)return t?t(r):r});return(0,pq.useEffect)(()=>{if(fB(e))throw Error(`The namespace supplied to useAppContext must be a non-empty string, but was "${e}".`)},[e]),(0,pq.useEffect)(()=>{var r;let i;return(r=e=>{if(null==e)return void n(void 0);let r=t?t(e):e;n(e=>F(e,r)?e:r)})(fA(i=fT(e))),fk.subscribe(t=>{let n=e in t?t[e]:null;n!==i&&(i=n,r(fA(n)))})},[e,t]),r}function fB(e){return"string"!=typeof e||0===e.trim().length}function fV(e){let t=p7(e);return(0,pq.useMemo)(()=>t.map(e=>e.id),[t])}function fU(e){return p8(e).candidateExtensions}function fW(e,t,r){let{data:n,error:i,mutate:o,isLoading:a,isValidating:s}=fv()(e?av(e,t,r):null,iR);return(0,pq.useMemo)(()=>({isLoading:a,data:n?.data.results??[],error:i,mutate:o,isValidating:s}),[n,i,a,s,o])}function fK(e){(0,pq.useEffect)(()=>{if(e){let e=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}},[e])}let fH={},fz=`No ComponentContext has been provided. This should come from "openmrsComponentDecorator".
16
- Usually this is already applied when using "getAsyncLifecycle" or "getSyncLifecycle".`;function fG(e){let{moduleName:t,extension:r}=(0,pq.useContext)(pZ),n=e?.externalModuleName??t;if(!n&&!r)throw Error(fz);let i=function(e){let t=(0,pq.useMemo)(()=>tY(e),[e]),r=function(e){let[t,r]=(0,pq.useState)(()=>{let t=e.getState();return t.loaded&&t.config?t.config:null});return(0,pq.useEffect)(()=>e?.subscribe(e=>{e.loaded&&e.config&&r(e.config)}),[e]),t}(t);if(!r)throw fH[e]||(fH[e]=new Promise(e=>{let r=t.subscribe(t=>{t.loaded&&t.config&&(e(t.config),r())})})),fH[e];return r}(n),o=function(e){let t=(0,pq.useMemo)(tQ,[]),r=function(e,t){let[r,n]=(0,pq.useState)(t?()=>{let r=t1(e.getState(),t.extensionSlotName,t.extensionId);if(r.loaded&&r.config)return r.config}:null);return(0,pq.useEffect)(()=>{if(t)return e.subscribe(e=>{let i=t1(e,t.extensionSlotName,t.extensionId);i.loaded&&i.config&&!e6(i.config,r)&&n(i.config)})},[e,t,r]),r}(t,e);if(!r&&e){let r=`${e.extensionSlotName}-${e.extensionId}`;throw!fH[r]&&t&&(fH[r]=new Promise(r=>{let n=t.subscribe(t=>{let i=t1(t,e.extensionSlotName,e.extensionId);i.loaded&&i.config&&(r(i.config),n())})})),fH[r]}return r||{}}(r);return(0,pq.useMemo)(()=>e?.externalModuleName&&n===e.externalModuleName?{...i}:{...i,...o},[n,e?.externalModuleName,i,o])}let fq=p7;function fY(){let[e,t]=(0,pq.useState)(dN());return(0,pq.useEffect)(()=>b(({online:e})=>t(e)),[]),e}function fZ(e,t=300){let[r,n]=(0,pq.useState)(e);return(0,pq.useEffect)(()=>{let r=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(r)}},[e,t]),r}var fJ=r(2016),fX=r.n(fJ);let fQ=`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 f0(){let e=`${iC}/emrapi/configuration?v=${fQ}`,t=fX()(e,iR);return(0,pq.useMemo)(()=>({emrConfiguration:t.data?.data,isLoadingEmrConfiguration:t.isLoading,mutateEmrConfiguration:t.mutate,errorFetchingEmrConfiguration:t.error}),[t])}function f1(){return(0,pq.useContext)(pZ).extension}let f3=p2(dB());function f4(e){let t=p7(e);return(0,pq.useMemo)(()=>Object.fromEntries(t.map(e=>[e.name,e.meta])),[t])}let f2=p2(dY());function f6(e){let{flags:t}=p3(dC);return t[e]?.enabled??!1}function f5(){let[,e]=(0,pq.useState)(0);return(0,pq.useCallback)(()=>{e(e=>e+1)},[])}function f8(e,t,r={}){return f7(e,t,f9,r)}let f9={getPaginatedUrl:(e,t,r)=>{if(!e)return null;{let n=new URL(iT(e.toString()),window.location.toString());return n.searchParams.set("limit",""+t),n.searchParams.set("startIndex",""+r),n.searchParams.set("totalCount","true"),n.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 f7(e,t,r,n={}){let{getPaginatedUrl:i,getTotalCount:o,getCurrentPageSize:a,getData:s}=r,{immutable:l,swrConfig:u}=n,c=n.fetcher??iR,[d,p]=(0,pq.useState)(1),f=(0,pq.useRef)(NaN),h=(0,pq.useRef)(NaN),m=(0,pq.useRef)(d),y=(0,pq.useRef)(!1),g=(0,pq.useRef)(!1),b=e?.toString()??"",[v,w]=(0,pq.useState)(b);b!==v&&(w(b),p(1),m.current=1,f.current=NaN,h.current=NaN,y.current=!1,g.current=!1);let x=(d-1)*t,E=(0,pq.useMemo)(()=>i(e,t,x),[e,t,x]),{data:S,...D}=(l?fX():fv())(E,c,u);S?.data&&(f.current=o(S?.data),h.current=a(S?.data),y.current=!0);let O=Math.ceil(f.current/t),P=(0,pq.useCallback)(e=>{if(!Number.isInteger(e)||e<1)return void console.warn(`useServerPagination: ignoring goTo(${e}); page must be a positive integer.`);let r=Math.ceil(f.current/t);!y.current||Number.isNaN(r)||e<=r?(m.current=e,p(e)):console.warn("Invalid attempt to go to out of bounds page: "+e)},[t]);(0,pq.useEffect)(()=>{if(!y.current)return;if(Number.isNaN(f.current)){g.current||(g.current=!0,console.warn(`useServerPagination: ${b} returned no total count, so out-of-range pages cannot be detected.`));return}let e=Math.max(1,Math.ceil(f.current/t));d>e&&(console.warn(`Invalid attempt to go to out of bounds page: ${d}; returning to page ${e}.`),m.current=e,p(e))},[d,t,b,S]);let C=(0,pq.useCallback)(()=>{P(m.current+1)},[P]),k=(0,pq.useCallback)(()=>{P(m.current-1)},[P]);return{data:s(S?.data),totalPages:O,totalCount:f.current,currentPage:d,currentPageSize:h.current,paginated:O>1,showNextButton:d<O,showPreviousButton:d>1,goTo:P,goToNext:C,goToPrevious:k,...D}}function he(e,t,r={}){return f7(e,t,ht(),r)}function ht(){return{getPaginatedUrl:(e,t,r)=>{if(!e)return null;{let n=new URL(iT(e.toString()),window.location.toString());return n.searchParams.set("_count",""+t),n.searchParams.set("_getpagesoffset",""+r),n.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 hr=r(2142),hn=r.n(hr);function hi(e,t={}){return ho(e,f9,t)}function ho(e,t,r={}){let{swrInfiniteConfig:n,immutable:i}=r,{getNextUrl:o,getTotalCount:a,getData:s}=t,l=r.fetcher??iR,u=(0,pq.useCallback)((r,n)=>0==r?e?.toString()??null:t.getNextUrl(n.data),[e]),{data:c,size:d,setSize:p,...f}=hn()(u,l,{...n,...i?{revalidateIfStale:!1,revalidateOnFocus:!1,revalidateOnReconnect:!1}:{}}),h=o(c?.[c.length-1].data),m=a(c?.[0]?.data);return{data:c?.flatMap(e=>s(e.data)),totalCount:m,hasMore:null!=h,loadMore:()=>{p((c?.length??0)+1)},nextUri:h,...f}}function ha(e,t={}){return hs(e,f9,t)}function hs(e,t,r={}){let n=ho(e,t,r),{hasMore:i,error:o,data:a,loadMore:s,isLoading:l,nextUri:u}=n;return((0,pq.useEffect)(()=>{i&&!o&&s()},[i,u]),r.partialData)?n:{...n,data:i||o?void 0:a,isLoading:l||i}}function hl(e,t={}){return hs(e,ht(),t)}function hu(e,t={}){return ho(e,ht(),t)}function hc(){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 hd(){let[e,t]=(0,pq.useState)(hc);return(0,pq.useEffect)(()=>{let e=()=>{t(hc())};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}let hp=e=>"small-desktop"===e||"large-desktop"===e;function hf(e){let t=(0,pq.useContext)(pZ);(0,pq.useEffect)(()=>(t&&t.moduleName&&(e.componentContext=t),p_(e),()=>{px(e.name)}),[t,e])}function hh(){return p3(pw)}function hm(e=null,t=null){let[r,n]=(0,pq.useState)([]);return(0,pq.useEffect)(()=>{let r=cK(e,t).subscribe(e=>{n(e)},e=>{console.error(e)});return()=>r.unsubscribe()},[e,t]),r}function hy(e,t=!0){let r=(0,pq.useRef)(null);return(0,pq.useEffect)(()=>{let n=n=>{t&&r.current&&n.target&&n.target instanceof Node&&(r.current.contains(n.target)||e(n))};return window.addEventListener("mousedown",n),window.addEventListener("touchstart",n),()=>{window.removeEventListener("mousedown",n),window.removeEventListener("touchstart",n)}},[e,t]),r}function hg(e){let t=(0,pq.useRef)();return(0,pq.useEffect)(()=>{let r=new IntersectionObserver(t=>{for(let r of t)if(r.isIntersecting)return void e()},{threshold:1});return t.current&&r.observe(t.current),()=>{t.current&&r.unobserve(t.current)}},[t.current,e]),t}function hb(e,t={}){let{abortController:r,fetchInit:n,url:i,swrConfig:o}=t,a=fL(),s=(0,pq.useMemo)(()=>n?.signal??r?.signal??a.signal,[r?.signal,n?.signal,a.signal]),l=(0,pq.useCallback)(e=>iR(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,i),{...n,signal:s}),[s,n,i]);return fv()(e,l,o)}function hv(e=[],t=10){let[r,n]=(0,pq.useState)(1),i=(0,pq.useMemo)(()=>"number"==typeof t&&t>0?Math.max(1,Math.ceil(e.length/t)):1,[e.length,t]);r>i&&n(i);let o=Math.min(Math.max(1,r),i),a=(0,pq.useMemo)(()=>{let r=(o-1)*t,n=(o+0)*t;return e.slice(r,n)},[e,o,t]),s=(0,pq.useCallback)(e=>{!Number.isInteger(e)||e<1?console.warn(`usePagination: ignoring goTo(${e}); page must be a positive integer.`):n(e)},[]),l=(0,pq.useCallback)(()=>{n(e=>e+1)},[]),u=(0,pq.useCallback)(()=>{n(e=>Math.max(1,e-1))},[]);return(0,pq.useMemo)(()=>({results:a,totalPages:i,currentPage:o,paginated:e.length>t,showNextButton:o<i,showPreviousButton:o>1,goTo:s,goToNext:l,goToPrevious:u}),[a,i,e.length,t,o,s,l,u])}function hw(e,t,r,n){return{pageSizes:(0,pq.useMemo)(()=>{let r=Math.ceil(t/e);return isNaN(r)&&(r=0),[...Array(r).keys()].map(t=>(t+1)*e)},[e,t]),pageItemsCount:(0,pq.useMemo)(()=>e>t?t:e*r>t?e*(r-1)+n:e*r,[e,t,r,n])}}function h_(){let e=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return e&&e[1]}function hx(e){let[t,r]=(0,pq.useState)(e??h_()),{data:n,error:i,isValidating:o}=fv()(t?["patient",t]:null,()=>cL(t,{}));return(0,pq.useEffect)(()=>{let e=()=>{let e=h_();e!==t&&r(e)};return window.addEventListener("single-spa:routing-event",e),()=>window.removeEventListener("single-spa:routing-event",e)},[t]),(0,pq.useMemo)(()=>({isLoading:o&&!i&&!n,patient:n,patientUuid:t,error:i}),[o,i,n,t])}function hE(){let e=`${iC}/metadatamapping/termmapping?v=custom:(metadataUuid)&code=emr.primaryIdentifierType`,{data:t,error:r,isLoading:n}=fv()(e,iR);return(0,pq.useMemo)(()=>({primaryIdentifierCode:t?.data?.results[0]?.metadataUuid,isLoading:n,error:r}),[t,r,n])}function hS(e){let{extensions:t,extensionSlotModuleName:r}=fe(e);return e?t.map(t=>({state:n})=>pY().createElement(pZ.Provider,{value:{moduleName:r,featureName:"",extension:{extensionId:t.id,extensionSlotName:e,extensionSlotModuleName:r,extensionMeta:t.meta}}},pY().createElement(pX,{state:n}))):[]}function hD(){let e=(0,pq.useRef)(),[t,r]=(0,pq.useState)(null),n=null;if(!t){if(s){let e=iL().getState();e.loaded&&(n=e.session)}else s=new Promise(t=>{let r=({loaded:r,session:i})=>{r&&(t(i),n=i,e.current&&(e.current(),e.current=void 0))};r(iL().getState()),n||(e.current=iL().subscribe(r))});if(n)r(n);else throw s}(0,pq.useEffect)(()=>(e.current||(e.current=iL().subscribe(({loaded:e,session:t})=>{e&&(n=t,r(t))})),()=>{e.current&&(e.current(),e.current=void 0)}),[]);let i=t||n;if(!i)if(s)throw console.warn("useSession is in an unexpected state. Attempting to recover."),s;else throw Error("useSession is in an invalid state.");return i}let hO=({privilege:e,fallback:t,children:r})=>{let[n,i]=(0,pq.useState)(null);return((0,pq.useEffect)(()=>{let e=i$({includeAuthStatus:!1}).subscribe(i);return()=>e.unsubscribe()},[]),n&&iU(e,n))?pY().createElement(pY().Fragment,null,r):t?pY().createElement(pY().Fragment,null,t):null};var hP=r(6734),hC=r.n(hP),hk=r(7581);let hj=new Map;function hT(){for(let e of Array.from(hj.values()))e()}let hR={setVisitContext:(e,t)=>null==t?{manuallySetVisitUuid:null}:{manuallySetVisitUuid:t.uuid,patientUuid:t.patient?.uuid}};function hA(e){let t=(0,pq.useId)();return(0,pq.useEffect)(()=>{if(e)return hj.set(t,e),()=>{hj.delete(t)}},[t,e]),{...p4(cJ(),hR),mutateVisit:hT}}function hN(e,t=cY){let r=(0,pq.useRef)(void 0),{patientUuid:n,manuallySetVisitUuid:i,setVisitContext:o}=hA((0,pq.useCallback)(()=>r.current?.(),[])),a=e&&n==e?i:null,s=`?patient=${e}&v=${t}&includeInactive=false`,l=`/${a}?v=${t}`,{data:u,error:c,mutate:d,isValidating:p}=fv()(e?`${iC}/visit${s}`:null,iR),{data:f,error:h,mutate:m,isValidating:y}=fv()(e&&a?`${iC}/visit${l}`:null,iR),g=(0,pq.useMemo)(()=>u?.data.results.find(e=>null===e.stopDatetime)??null,[u]),b=(0,pq.useMemo)(()=>a&&f?f.data:null,[f,a]),v=(0,pq.useRef)(null);(0,pq.useEffect)(()=>{!p&&g&&n===e&&null===i&&o(g),y||(v.current&&b&&v.current.uuid===b.uuid&&!v.current.stopDatetime&&b.stopDatetime&&o(null),v.current=b)},[b,i,g,p,y,n]);let w=(0,pq.useCallback)(()=>{d(),m()},[d,m]);(0,pq.useEffect)(()=>{r.current=w},[w]);let x=!!(!u||a&&!f),E=!!(a?h:c);return{error:c||h,mutate:w,isValidating:p||y,activeVisit:g,currentVisit:b,currentVisitIsRetrospective:!!a,isLoading:x&&!E}}function hM(){let[e,t]=(0,pq.useState)([]);return(0,pq.useEffect)(()=>{let e=cz().subscribe(e=>{t(e)},e=>console.error(e));return()=>e.unsubscribe()},[]),e}hP.extend(hk);let hI=new Map;async function h$(e,t){let r=t.indexOf("#"),n=r>=0,i=n?t.substring(0,r):e,o=n?t.substring(r+1):t,a=await o3(i);return a&&Object.hasOwn(a,o)&&"function"==typeof a[o]?hF(i,a).then(()=>a[o]()):(a?a&&Object.hasOwn(a,o)?console.warn(`The export ${t}, defined in ${e}'s routes.json, is not a function`):console.warn(`${i} does not define a component called "${o}", referenced in ${e}'s routes.json. This cannot be loaded.`):console.warn(`Unknown app ${i} for ${t} defined in ${e}'s routes.json`),hL)}let hL={bootstrap:()=>Promise.resolve(),mount:()=>Promise.resolve(),unmount:()=>Promise.resolve()};async function hF(e,t){if(e in hI)await hI[e];else{let r=t??await o3(e);await (hI[e]=new Promise((t,n)=>{if(Object.hasOwn(r,"startupApp")){let i=r.startupApp;if("function"==typeof i)return Promise.resolve(i()).then(()=>{rp(e),t(null)}).catch(n)}rp(e),t(null)}))}}function hB(e,t){let r=t.name;if(!r)return void console.error(`An extension definition in ${e} is missing an name and thus cannot be
15
+ ${this.stack}`}}let og=Y("session",{loaded:!1,session:null}),ob=0;function ov(e={includeAuthStatus:!0}){return(ob<Date.now()-6e4||!og.getState().loaded)&&ox(),new es.Observable(t=>{let r=r=>{r.loaded&&(e.includeAuthStatus?t.next(r.session):t.next(r.session?.user))};return r(og.getState()),og.subscribe(r)})}function ow(){return(ob<Date.now()-6e4||!og.getState().loaded)&&ox(),og}function o_(e){let t=e.locale??e.user?.userProperties?.defaultLocale;t&&t.includes("_")&&(t=t.replaceAll("_","-")),function(e){if(void 0===e||"string"!=typeof e)return!1;try{new Intl.Locale(e)}catch(e){return!1}return!0}(t)&&t!==document.documentElement.getAttribute("lang")&&document.documentElement.setAttribute("lang",t)}function ox(e,t){ob=Date.now();let r={};return e&&t&&(r.Authorization=`Basic ${window.btoa(`${e}:${t}`)}`),ok(oh(op,{headers:r}))}function oE(){og.setState({loaded:!0,session:{authenticated:!1,sessionId:""}})}function oS(e,t){var r,n;if(void 0===t)return!e;if(!e)return!0;return r=e,n=t,("string"==typeof r?!ee(n.privileges.find(e=>r===e.display)):Array.isArray(r)?r.every(e=>!ee(n.privileges.find(t=>e===t.display))):(ee(r)||console.error(`Could not understand privileges "${r}"`),!0))||!ee(t.roles.find(e=>"System Developer"===e.display))}function oD(){let e,t;return new Promise(r=>{let n=n=>{n.loaded&&n.session.user&&(e=n.session.user,r(n.session.user),t&&t())};n(og.getState()),e||(t=og.subscribe(n))})}function oO(){return new Promise((e,t)=>{ov().subscribe(t=>{e(t.sessionLocation)},t).unsubscribe()})}async function oP(e,t){return ok(oh(op,{method:"POST",body:{sessionLocation:e},headers:{"Content-Type":"application/json"},signal:t.signal}))}async function oC(e,t,r){return r||(r=new AbortController),await oh(`${oc}/user/${e}`,{method:"POST",body:{userProperties:t},headers:{"Content-Type":"application/json"},signal:r.signal}),ox()}function ok(e){return new Promise((t,r)=>{e.then(e=>{let n;"object"==typeof e?.data?(n={loaded:!0,session:e.data},og.setState(n),t(n)):(n={loaded:!1,session:null},og.setState(n),r(n))}).catch(e=>{I(`Failed to fetch new session information: ${e}`);let t={loaded:!1,session:null};og.setState(t),r(t)})})}function oj(){return"development"===window.spaEnv||"true"===localStorage.getItem("openmrs:devtools")}og.subscribe(e=>{e.loaded&&e.session&&o_(e.session)});let oT={"webservices.rest":"2.24.0",fhir2:"1.0.0-SNAPSHOT"};function oR(){rc("@openmrs/esm-api",ol),ox()}let oA="import-map-override:",oN="import-map-overrides-disabled",oM="import-map-overrides:change",oI=!1,o$=null,oL=null;async function oF(){return oL??(oL=oB().then(({map:e,complete:t})=>(t||(oL=null),e))),oL}async function oB(){let e=document.querySelectorAll('script[type="systemjs-importmap"]'),t=[],r=!0;for(let n=0;n<e.length;n++){let i=e[n];try{if(i.src){let e=await fetch(i.src);if(!e.ok)throw Error(`Request for ${i.src} returned ${e.status} ${e.statusText}`);t.push(await e.json())}else i.textContent&&t.push(JSON.parse(i.textContent))}catch(e){r=!1,console.warn(`[import-maps] Failed to parse import map from script tag at index ${n}`,e)}}return{map:oV(t),complete:r}}function oV(e){let t={imports:{}};for(let r of e)r?.imports&&Object.assign(t.imports,r.imports);return t}function oU(){let e={};try{let t=oG();for(let r=0;r<localStorage.length;r++){let n=localStorage.key(r);if(n?.startsWith(oA)){let r=n.slice(oA.length);if(!t.includes(r)){let t=localStorage.getItem(n);t&&(e[r]=t)}}}}catch(e){console.warn("[import-maps] Failed to read import-map overrides from localStorage",e)}return{imports:e}}async function oW(){let e=await oF();return oI?oV([e,o$??oU()]):e}async function oK(){return oF()}async function oH(){return oI?oV([await oF(),oU()]):oF()}function oz(e){if(!oI)return{imports:{}};if(e){let e={};for(let t=0;t<localStorage.length;t++){let r=localStorage.key(t);if(r?.startsWith(oA)){let t=localStorage.getItem(r);t&&(e[r.slice(oA.length)]=t)}}return{imports:e}}return oU()}function oG(){if(!oI)return[];try{let e=localStorage.getItem(oN);if(e){let t=JSON.parse(e);if(Array.isArray(t))return t}}catch{}return[]}function oq(e){return!!oI&&oG().includes(e)}function oY(e,t){if(!oI)return void console.warn("[Security] Import map overrides are disabled in production mode.");try{localStorage.setItem(oA+e,t),window.dispatchEvent(new CustomEvent(oM))}catch(e){console.warn("[import-maps] Failed to write import-map override to localStorage",e)}}function oZ(e){if(!oI)return void console.warn("[Security] Import map overrides are disabled in production mode.");try{localStorage.removeItem(oA+e);let t=oG().filter(t=>t!==e);t.length>0?localStorage.setItem(oN,JSON.stringify(t)):localStorage.removeItem(oN),window.dispatchEvent(new CustomEvent(oM))}catch(e){console.warn("[import-maps] Failed to update import-map overrides in localStorage",e)}}function oJ(){if(!oI)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 r=localStorage.key(t);r?.startsWith(oA)&&e.push(r)}e.forEach(e=>localStorage.removeItem(e)),localStorage.removeItem(oN),window.dispatchEvent(new CustomEvent(oM))}catch(e){console.warn("[import-maps] Failed to clear import-map overrides from localStorage",e)}}function oX(e){if(!oI)return void console.warn("[Security] Import map overrides are disabled in production mode.");try{let t=oG().filter(t=>t!==e);t.length>0?localStorage.setItem(oN,JSON.stringify(t)):localStorage.removeItem(oN),window.dispatchEvent(new CustomEvent(oM))}catch(e){console.warn("[import-maps] Failed to update import-map overrides in localStorage",e)}}let oQ=!1;function o0(){!oQ&&(oQ=!0,(oI="development"===window.spaEnv)&&(o$=oU()))}function o1(e){return e.replace(/[\/\-@]/g,"_")}async function o3(e,t="./start",n){var i;let o,a=!n?.maxLoadingTime||n.maxLoadingTime<=0?6e5:n.maxLoadingTime;await Promise.race([o4(e,n?.importMap),new Promise((t,r)=>{o=setTimeout(()=>{var t;r(Error(`Could not resolve requested script, ${e}, within ${(t=a)<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`}.`))},a)})]),o&&clearTimeout(o);let s=o1(e),l=window[s];if(!("object"==typeof(i=l)&&null!==i&&"init"in i&&"function"==typeof i.init&&"get"in i&&"function"==typeof i.get)){let e=`The global variable ${s} does not refer to a federated module`;throw console.error(e),Error(e)}l.init(r.S.default);let u=(await l.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 o4(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 r=o1(e);if(!window[r]){let r=t??await o2();if(!r.imports.hasOwnProperty(e)){let t=`Could not find the package ${e} defined in the current importmap`;throw console.error(t),Error(t)}let n=r.imports[e];n.startsWith("./")&&(n=window.spaBase+n.substring(1));let i=e in oz().imports;try{return await function(e){var t;let r=(t=window)[o6]??(t[o6]=new Map),n=r.get(e);if(n)return n;if(document.head.querySelector(`script[src="${e}"]`))return console.warn(`Script at ${e} already loaded. Not loading it again.`),Promise.resolve();let i=document.createElement("script");i.src=e,i.type="text/javascript",i.async=!0;let o=new Promise((t,n)=>{let o=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);function a(){clearTimeout(o),i.removeEventListener("load",s),i.removeEventListener("error",l)}function s(){a(),t()}function l(t){a(),r.delete(e),i.remove();let o=`Failed to load script from ${e}`;console.error(o,t),n(t.message??o)}i.addEventListener("load",s),i.addEventListener("error",l),document.head.appendChild(i)});return r.set(e,o),o}(n)}catch(e){return i&&T({kind:"error",title:i8("scriptLoadingFailed","Error: Script failed to load"),description:i8("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:n}),actionButtonLabel:i8("resetOverrides","Reset overrides"),onActionButtonClick(){oJ(),window.location.reload()}}),Promise.reject(e)}}return Promise.resolve()}async function o2(){return oW()}let o6=Symbol.for("__openmrs_script_loading");function o5(e){return!!e&&"object"==typeof e&&!(Object.hasOwn(e,"pages")&&(!e.pages||!Array.isArray(e.pages))||Object.hasOwn(e,"extensions")&&(!e.extensions||!Array.isArray(e.extensions))||Object.hasOwn(e,"workspaces")&&(!e.workspaces||!Array.isArray(e.workspaces))||Object.hasOwn(e,"modals")&&(!e.modals||!Array.isArray(e.modals)))}function o8(e){return!!e&&"object"==typeof e&&"routes"in e&&!!e.routes&&"object"==typeof e.routes&&Object.entries(e.routes).every(([e,t])=>"string"==typeof e&&o5(t))}let o9="openmrs-routes:",o7="openmrs-routes:change",ae=!1,at=null,ar=null;async function an(){return ar??(ar=ai().then(({map:e,complete:t})=>(t||(ar=null),e))),ar}async function ai(){let e=document.querySelectorAll("script[type='openmrs-routes']"),t=[],r=!0;for(let n=0;n<e.length;n++){let i=e[n];try{let e;if(i.src){let t=await fetch(i.src);if(!t.ok)throw Error(`Request for ${i.src} returned ${t.status} ${t.statusText}`);e=await t.json()}else i.textContent&&(e=JSON.parse(i.textContent));e&&o8(e)&&t.push(e)}catch(e){r=!1,console.warn(`[route-maps] Failed to parse routes from script tag at index ${n}`,e)}}return{map:ao(t),complete:r}}function ao(e){let t={routes:{}};for(let r of e)r&&"object"==typeof r&&!Array.isArray(r)&&(Object.assign(t.routes,r.routes),void 0===t.version&&void 0!==r.version&&(t.version=r.version));return t}async function aa(){let e={version:void 0,routes:{}};try{let t=[];for(let e=0;e<localStorage.length;e++){let r=localStorage.key(e);if(r?.startsWith(o9)){let e=localStorage.getItem(r);e&&t.push({moduleName:r.slice(o9.length),raw:e})}}for(let r of(await Promise.allSettled(t.map(async({moduleName:e,raw:t})=>{let r=JSON.parse(t);if(o5(r))return{moduleName:e,routes:r};if("string"==typeof r&&r.startsWith("http")){let t=await fetch(r),n=await t.json();if(o5(n))return{moduleName:e,routes:n};throw Error(`${r} did not resolve to a valid OpenmrsAppRoutes object`)}throw Error(`Override for ${e} is neither a valid routes object nor a URL`)}))))"fulfilled"===r.status?e.routes[r.value.moduleName]=r.value.routes:console.warn("[route-maps] Failed to load route override",r.reason)}catch(e){console.warn("[route-maps] Failed to read route overrides from localStorage",e)}return e}async function as(){let e=await an();return ae?ao([e,at??await aa()]):e}async function al(){return an()}async function au(){return ae?ao([await an(),await aa()]):an()}function ac(){if(!ae)return{};let e={};try{for(let t=0;t<localStorage.length;t++){let r=localStorage.key(t);if(r?.startsWith(o9)){let t=localStorage.getItem(r);t&&(e[r.slice(o9.length)]=t)}}}catch(e){console.warn("[route-maps] Failed to read route overrides from localStorage",e)}return e}function ad(e,t){if(!ae)return void console.warn("[Security] Route overrides are disabled outside development mode.");try{if("string"==typeof t)if(t.startsWith("http"))localStorage.setItem(o9+e,JSON.stringify(t));else{let r=JSON.parse(t);if(!o5(r))return void console.error(`The supplied routes for ${e} is not a valid OpenmrsAppRoutes object`,t);localStorage.setItem(o9+e,JSON.stringify(r))}else if(t instanceof URL)localStorage.setItem(o9+e,JSON.stringify(t.toString()));else{if(!o5(t))return void console.error(`Override for ${e} is not in a valid format. Expected either a Javascript Object, a JSON string of a Javascript object, or a URL`,t);localStorage.setItem(o9+e,JSON.stringify(t))}window.dispatchEvent(new CustomEvent(o7))}catch(e){console.warn("[route-maps] Failed to write route override to localStorage",e)}}function ap(e){if(!ae)return void console.warn("[Security] Route overrides are disabled outside development mode.");try{localStorage.removeItem(o9+e),window.dispatchEvent(new CustomEvent(o7))}catch(e){console.warn("[route-maps] Failed to remove route override from localStorage",e)}}function af(){if(!ae)return void console.warn("[Security] Route overrides are disabled outside development mode.");try{let e=[];for(let t=0;t<localStorage.length;t++){let r=localStorage.key(t);r?.startsWith(o9)&&e.push(r)}e.forEach(e=>localStorage.removeItem(e)),window.dispatchEvent(new CustomEvent(o7))}catch(e){console.warn("[route-maps] Failed to clear route overrides from localStorage",e)}}let ah=null;function am(){return ah||(ah=(ae="development"===window.spaEnv)?aa().then(e=>{at=e}):Promise.resolve())}let ay=`${oc}/attachment`;function ag(e,t){return oh(`${ay}/${e}`,{signal:t.signal})}function ab(e,t,r,n){return oh(av(e,t,n),{signal:r.signal})}function av(e,t,r){return r?`${ay}?patient=${e}&encounter=${r}`:`${ay}?patient=${e}&includeEncounterless=${t}`}async function aw(e,t,r){let n=new FormData;return n.append("fileCaption",t.fileDescription),n.append("patient",e),r&&n.append("encounter",r),t.file?n.append("file",t.file,t.fileName):(n.append("file",new File([""],t.fileName),t.fileName),n.append("base64Content",t.base64Content)),oh(`${ay}`,{method:"POST",body:n})}function a_(e,t){return oh(`${ay}/${e}`,{method:"DELETE",signal:t.signal})}try{self["workbox:window:6.5.4"]&&_()}catch(e){}function ax(e,t){return new Promise(function(r){var n=new MessageChannel;n.port1.onmessage=function(e){r(e.data)},e.postMessage(t,[n.port2])})}function aE(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function aS(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}try{self["workbox:core:6.5.4"]&&_()}catch(e){}var aD=function(){var e=this;this.promise=new Promise(function(t,r){e.resolve=t,e.reject=r})};function aO(e,t){var r=location.href;return new URL(e,r).href===new URL(t,r).href}var aP=function(e,t){this.type=e,Object.assign(this,t)};function aC(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function ak(){}var aj={type:"SKIP_WAITING"};function aT(e,t){if(!t)return e&&e.then?e.then(ak):Promise.resolve()}var aR=function(e){function t(t,r){var n,i;return void 0===r&&(r={}),(n=e.call(this)||this).nn={},n.tn=0,n.rn=new aD,n.en=new aD,n.on=new aD,n.un=0,n.an=new Set,n.cn=function(){var e=n.fn,t=e.installing;n.tn>0||!aO(t.scriptURL,n.sn.toString())||performance.now()>n.un+6e4?(n.vn=t,e.removeEventListener("updatefound",n.cn)):(n.hn=t,n.an.add(t),n.rn.resolve(t)),++n.tn,t.addEventListener("statechange",n.ln)},n.ln=function(e){var t=n.fn,r=e.target,i=r.state,o=r===n.vn,a={sw:r,isExternal:o,originalEvent:e};!o&&n.mn&&(a.isUpdate=!0),n.dispatchEvent(new aP(i,a)),"installed"===i?n.wn=self.setTimeout(function(){"installed"===i&&t.waiting===r&&n.dispatchEvent(new aP("waiting",a))},200):"activating"===i&&(clearTimeout(n.wn),o||n.en.resolve(r))},n.dn=function(e){var t=n.hn,r=t!==navigator.serviceWorker.controller;n.dispatchEvent(new aP("controlling",{isExternal:r,originalEvent:e,sw:t,isUpdate:n.mn})),r||n.on.resolve(t)},i=function(e){var t=e.data,r=e.ports,i=e.source;return aC(n.getSW(),function(){n.an.has(i)&&n.dispatchEvent(new aP("message",{data:t,originalEvent:e,ports:r,sw:i}))})},n.gn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(i.apply(this,e))}catch(e){return Promise.reject(e)}},n.sn=t,n.nn=r,navigator.serviceWorker.addEventListener("message",n.gn),n}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e;var r,n,i=t.prototype;return i.register=function(e){var t=(void 0===e?{}:e).immediate,r=void 0!==t&&t;try{var n,i,o,a=this;return n=function(){if(!r&&"complete"!==document.readyState)return aT(new Promise(function(e){return window.addEventListener("load",e)}))},i=function(){return a.mn=!!navigator.serviceWorker.controller,a.yn=a.pn(),aC(a.bn(),function(e){a.fn=e,a.yn&&(a.hn=a.yn,a.en.resolve(a.yn),a.on.resolve(a.yn),a.yn.addEventListener("statechange",a.ln,{once:!0}));var t=a.fn.waiting;return t&&aO(t.scriptURL,a.sn.toString())&&(a.hn=t,Promise.resolve().then(function(){a.dispatchEvent(new aP("waiting",{sw:t,wasWaitingBeforeRegister:!0}))}).then(function(){})),a.hn&&(a.rn.resolve(a.hn),a.an.add(a.hn)),a.fn.addEventListener("updatefound",a.cn),navigator.serviceWorker.addEventListener("controllerchange",a.dn),a.fn})},(o=n())&&o.then?o.then(i):i(o)}catch(e){return Promise.reject(e)}},i.update=function(){try{return this.fn?aT(this.fn.update()):void 0}catch(e){return Promise.reject(e)}},i.getSW=function(){return void 0!==this.hn?Promise.resolve(this.hn):this.rn.promise},i.messageSW=function(e){try{return aC(this.getSW(),function(t){return ax(t,e)})}catch(e){return Promise.reject(e)}},i.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&ax(this.fn.waiting,aj)},i.pn=function(){var e=navigator.serviceWorker.controller;return e&&aO(e.scriptURL,this.sn.toString())?e:void 0},i.bn=function(){try{var e=this;return function(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}(function(){return aC(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)}},r=[{key:"active",get:function(){return this.en.promise}},{key:"controlling",get:function(){return this.on.promise}}],aE(t.prototype,r),n&&aE(t,n),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,r=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 aS(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)?aS(e,void 0):void 0}}(e))){t&&(e=t);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}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=r()).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 aA(e,t){if(void 0!==p)return console.warn(`The application's Service Worker has already been registered. The new service worker at ${e} will not be registered.`),p;if(!("serviceWorker"in navigator))throw Error("Registering the Service Worker is not possible due to missing browser capabilities.");let r=new aR(e,t);return p=r.register().then(()=>r.controlling.then(()=>r))}function aN(){return p??Promise.resolve(void 0)}let aM="x-omrs-offline-response-body",aI="x-omrs-offline-response-status",a$="x-omrs-offline-caching-strategy";async function aL(e){let t=await aN();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 aF(){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 aB(){return!window.indexedDB}async function aV(){return new Promise(e=>{let t=indexedDB.open("test");t.onerror=()=>e(!0),t.onsuccess=()=>e(!1)})}async function aU(){return await aV()||await aB()||await aF()}let aW="openmrs3:offline-mode",aK="unavailable";function aH(){return{current:aK,notAvailable:"unavailable"===aK,active:"on"===aK}}function az(e){"unavailable"!==aK&&"unavailable"!==e&&(localStorage.setItem(aW,"on"===e?"active":"disabled"),aK=e)}async function aG(){await aU()||(aK="active"===localStorage.getItem(aW)?"on":"off"),navigator.onLine}let aq="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,aY=Object.keys,aZ=Array.isArray;function aJ(e,t){return"object"!=typeof t||aY(t).forEach(function(r){e[r]=t[r]}),e}"u"<typeof Promise||aq.Promise||(aq.Promise=Promise);let aX=Object.getPrototypeOf,aQ={}.hasOwnProperty;function a0(e,t){return aQ.call(e,t)}function a1(e,t){"function"==typeof t&&(t=t(aX(e))),("u"<typeof Reflect?aY:Reflect.ownKeys)(t).forEach(r=>{a4(e,r,t[r])})}let a3=Object.defineProperty;function a4(e,t,r,n){a3(e,t,aJ(r&&a0(r,"get")&&"function"==typeof r.get?{get:r.get,set:r.set,configurable:!0}:{value:r,configurable:!0,writable:!0},n))}function a2(e){return{from:function(t){return e.prototype=Object.create(t.prototype),a4(e.prototype,"constructor",e),{extend:a1.bind(null,e.prototype)}}}}let a6=Object.getOwnPropertyDescriptor;function a5(e,t){let r;return a6(e,t)||(r=aX(e))&&a5(r,t)}let a8=[].slice;function a9(e,t,r){return a8.call(e,t,r)}function a7(e,t){return t(e)}function se(e){if(!e)throw Error("Assertion Failed")}function st(e){aq.setImmediate?setImmediate(e):setTimeout(e,0)}function sr(e,t){return e.reduce((e,r,n)=>{var i=t(r,n);return i&&(e[i[0]]=i[1]),e},{})}function sn(e,t){if(a0(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var r=[],n=0,i=t.length;n<i;++n){var o=sn(e,t[n]);r.push(o)}return r}var a=t.indexOf(".");if(-1!==a){var s=e[t.substr(0,a)];return void 0===s?void 0:sn(s,t.substr(a+1))}}function si(e,t,r){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){se("string"!=typeof r&&"length"in r);for(var n=0,i=t.length;n<i;++n)si(e,t[n],r[n])}else{var o=t.indexOf(".");if(-1!==o){var a=t.substr(0,o),s=t.substr(o+1);if(""===s)void 0===r?aZ(e)&&!isNaN(parseInt(a))?e.splice(a,1):delete e[a]:e[a]=r;else{var l=e[a];l&&a0(e,a)||(l=e[a]={}),si(l,s,r)}}else void 0===r?aZ(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=r}}function so(e){var t={};for(var r in e)a0(e,r)&&(t[r]=e[r]);return t}let sa=[].concat;function ss(e){return sa.apply([],e)}let sl="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(ss([8,16,32,64].map(e=>["Int","Uint","Float"].map(t=>t+e+"Array")))).filter(e=>aq[e]),su=sl.map(e=>aq[e]);sr(sl,e=>[e,!0]);let sc=null;function sd(e){sc="u">typeof WeakMap&&new WeakMap;let t=function e(t){if(!t||"object"!=typeof t)return t;let r=sc&&sc.get(t);if(r)return r;if(aZ(t)){r=[],sc&&sc.set(t,r);for(var n=0,i=t.length;n<i;++n)r.push(e(t[n]))}else if(su.indexOf(t.constructor)>=0)r=t;else{let n=aX(t);for(var o in r=n===Object.prototype?{}:Object.create(n),sc&&sc.set(t,r),t)a0(t,o)&&(r[o]=e(t[o]))}return r}(e);return sc=null,t}let{toString:sp}={};function sf(e){return sp.call(e).slice(8,-1)}let sh="u">typeof Symbol?Symbol.iterator:"@@iterator",sm="symbol"==typeof sh?function(e){var t;return null!=e&&(t=e[sh])&&t.apply(e)}:function(){return null},sy={};function sg(e){var t,r,n,i;if(1==arguments.length){if(aZ(e))return e.slice();if(this===sy&&"string"==typeof e)return[e];if(i=sm(e)){for(r=[];!(n=i.next()).done;)r.push(n.value);return r}if(null==e)return[e];if("number"==typeof(t=e.length)){for(r=Array(t);t--;)r[t]=e[t];return r}return[e]}for(t=arguments.length,r=Array(t);t--;)r[t]=arguments[t];return r}let sb="u">typeof Symbol?e=>"AsyncFunction"===e[Symbol.toStringTag]:()=>!1;var sv="u">typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href),sw=()=>!0;let s_=!Error("").stack;function sx(){if(s_)try{throw sx.arguments,Error()}catch(e){return e}return Error()}function sE(e,t){var r=e.stack;return r?(t=t||0,0===r.indexOf(e.name)&&(t+=(e.name+e.message).split("\n").length),r.split("\n").slice(t).filter(sw).map(e=>"\n"+e).join("")):""}var sS=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],sD=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(sS),sO={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 sP(e,t){this._e=sx(),this.name=e,this.message=t}function sC(e,t){return e+". Errors: "+Object.keys(t).map(e=>t[e].toString()).filter((e,t,r)=>r.indexOf(e)===t).join("\n")}function sk(e,t,r,n){this._e=sx(),this.failures=t,this.failedKeys=n,this.successCount=r,this.message=sC(e,t)}function sj(e,t){this._e=sx(),this.name="BulkError",this.failures=Object.keys(t).map(e=>t[e]),this.failuresByPos=t,this.message=sC(e,t)}a2(sP).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+sE(this._e,2))}},toString:function(){return this.name+": "+this.message}}),a2(sk).from(sP),a2(sj).from(sP);var sT=sD.reduce((e,t)=>(e[t]=t+"Error",e),{}),sR=sD.reduce((e,t)=>{var r=t+"Error";function n(e,n){this._e=sx(),this.name=r,e?"string"==typeof e?(this.message=`${e}${n?"\n "+n:""}`,this.inner=n||null):"object"==typeof e&&(this.message=`${e.name} ${e.message}`,this.inner=e):(this.message=sO[t]||r,this.inner=null)}return a2(n).from(sP),e[t]=n,e},{});sR.Syntax=SyntaxError,sR.Type=TypeError,sR.Range=RangeError;var sA=sS.reduce((e,t)=>(e[t+"Error"]=sR[t],e),{}),sN=sD.reduce((e,t)=>(-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=sR[t]),e),{});function sM(){}function sI(e){return e}function s$(e,t){return null==e||e===sI?t:function(r){return t(e(r))}}function sL(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function sF(e,t){return e===sM?t:function(){var r=e.apply(this,arguments);void 0!==r&&(arguments[0]=r);var n=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return n&&(this.onsuccess=this.onsuccess?sL(n,this.onsuccess):n),i&&(this.onerror=this.onerror?sL(i,this.onerror):i),void 0!==o?o:r}}function sB(e,t){return e===sM?t:function(){e.apply(this,arguments);var r=this.onsuccess,n=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),r&&(this.onsuccess=this.onsuccess?sL(r,this.onsuccess):r),n&&(this.onerror=this.onerror?sL(n,this.onerror):n)}}function sV(e,t){return e===sM?t:function(r){var n=e.apply(this,arguments);aJ(r,n);var i=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return i&&(this.onsuccess=this.onsuccess?sL(i,this.onsuccess):i),o&&(this.onerror=this.onerror?sL(o,this.onerror):o),void 0===n?void 0===a?void 0:a:aJ(n,a)}}function sU(e,t){return e===sM?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function sW(e,t){return e===sM?t:function(){var r=e.apply(this,arguments);if(r&&"function"==typeof r.then){for(var n=this,i=arguments.length,o=Array(i);i--;)o[i]=arguments[i];return r.then(function(){return t.apply(n,o)})}return t.apply(this,arguments)}}sN.ModifyError=sk,sN.DexieError=sP,sN.BulkError=sj;var sK={};let[sH,sz,sG]="u"<typeof Promise?[]:(()=>{let e=Promise.resolve();if("u"<typeof crypto||!crypto.subtle)return[e,aX(e),e];let t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,aX(t),e]})(),sq=sz&&sz.then,sY=sH&&sH.constructor,sZ=!!sG;var sJ=!1,sX=sG?()=>{sG.then(lu)}:aq.setImmediate?setImmediate.bind(null,lu):aq.MutationObserver?()=>{var e=document.createElement("div");new MutationObserver(()=>{lu(),e=null}).observe(e,{attributes:!0}),e.setAttribute("i","1")}:()=>{setTimeout(lu,0)},sQ=function(e,t){s9.push([e,t]),s1&&(sX(),s1=!1)},s0=!0,s1=!0,s3=[],s4=[],s2=null,s6=sI,s5={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:lA,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach(e=>{try{lA(e[0],e[1])}catch(e){}})}},s8=s5,s9=[],s7=0,le=[];function lt(e){if("object"!=typeof this)throw TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=sM,this._lib=!1;var t=this._PSD=s8;if(sv&&(this._stackHolder=sx(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==sK)throw TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&li(this,this._value))}this._state=null,this._value=null,++t.ref,function e(t,r){try{r(r=>{if(null===t._state){if(r===t)throw TypeError("A promise cannot be resolved with itself.");var n=t._lib&&lc();r&&"function"==typeof r.then?e(t,(e,t)=>{r instanceof lt?r._then(e,t):r.then(e,t)}):(t._state=!0,t._value=r,lo(t)),n&&ld()}},li.bind(null,t))}catch(e){li(t,e)}}(this,e)}let lr={get:function(){var e=s8,t=lv;function r(r,n){var i=!e.global&&(e!==s8||t!==lv);let o=i&&!lE();var a=new lt((t,a)=>{la(this,new ln(lj(r,e,i,o),lj(n,e,i,o),t,a,e))});return sv&&ll(a,this),a}return r.prototype=sK,r},set:function(e){a4(this,"then",e&&e.prototype===sK?lr:{get:function(){return e},set:lr.set})}};function ln(e,t,r,n,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=r,this.reject=n,this.psd=i}function li(e,t){if(s4.push(t),null===e._state){var r=e._lib&&lc();t=s6(t),e._state=!1,e._value=t,sv&&null!==t&&"object"==typeof t&&!t._promise&&function(e){try{e.apply(null,void 0)}catch(e){}}(()=>{var r=a5(t,"stack");t._promise=e,a4(t,"stack",{get:()=>sJ?r&&(r.get?r.get.apply(t):r.value):e.stack})}),s3.some(t=>t._value===e._value)||s3.push(e),lo(e),r&&ld()}}function lo(e){var t=e._listeners;e._listeners=[];for(var r=0,n=t.length;r<n;++r)la(e,t[r]);var i=e._PSD;--i.ref||i.finalize(),0===s7&&(++s7,sQ(()=>{0==--s7&&lp()},[]))}function la(e,t){if(null!==e._state){var r=e._state?t.onFulfilled:t.onRejected;if(null===r)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++s7,sQ(ls,[r,e,t])}else e._listeners.push(t)}function ls(e,t,r){try{s2=t;var n,i=t._value;t._state?n=e(i):(s4.length&&(s4=[]),n=e(i),-1===s4.indexOf(i)&&function(e){for(var t=s3.length;t;)if(s3[--t]._value===e._value)return void s3.splice(t,1)}(t)),r.resolve(n)}catch(e){r.reject(e)}finally{s2=null,0==--s7&&lp(),--r.psd.ref||r.psd.finalize()}}function ll(e,t){var r=t?t._numPrev+1:0;r<100&&(e._prev=t,e._numPrev=r)}function lu(){lc()&&ld()}function lc(){var e=s0;return s0=!1,s1=!1,e}function ld(){var e,t,r;do for(;s9.length>0;)for(e=s9,s9=[],r=e.length,t=0;t<r;++t){var n=e[t];n[0].apply(null,n[1])}while(s9.length>0);s0=!0,s1=!0}function lp(){var e=s3;s3=[],e.forEach(e=>{e._PSD.onunhandled.call(null,e._value,e)});for(var t=le.slice(0),r=t.length;r;)t[--r]()}function lf(e){return new lt(sK,!1,e)}function lh(e,t){var r=s8;return function(){var n=lc(),i=s8;try{return lP(r,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{lP(i,!1),n&&ld()}}}a1(lt.prototype,{then:lr,_then:function(e,t){la(this,new ln(null,null,e,t,s8))},catch:function(e){if(1==arguments.length)return this.then(null,e);var t=arguments[0],r=arguments[1];return"function"==typeof t?this.then(null,e=>e instanceof t?r(e):lf(e)):this.then(null,e=>e&&e.name===t?r(e):lf(e))},finally:function(e){return this.then(t=>(e(),t),t=>(e(),lf(t)))},stack:{get:function(){if(this._stack)return this._stack;try{sJ=!0;var e=(function e(t,r,n){if(r.length===n)return r;var i="";if(!1===t._state){var o,a,s=t._value;null!=s?(o=s.name||"Error",a=s.message||s,i=sE(s,0)):(o=s,a=""),r.push(o+(a?": "+a:"")+i)}return sv&&((i=sE(t._stackHolder,2))&&-1===r.indexOf(i)&&r.push(i),t._prev&&e(t._prev,r,n)),r})(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{sJ=!1}}},timeout:function(e,t){return e<1/0?new lt((r,n)=>{var i=setTimeout(()=>n(new sR.Timeout(t)),e);this.then(r,n).finally(clearTimeout.bind(null,i))}):this}}),"u">typeof Symbol&&Symbol.toStringTag&&a4(lt.prototype,Symbol.toStringTag,"Dexie.Promise"),s5.env=lC(),a1(lt,{all:function(){var e=sg.apply(null,arguments).map(lS);return new lt(function(t,r){0===e.length&&t([]);var n=e.length;e.forEach((i,o)=>lt.resolve(i).then(r=>{e[o]=r,--n||t(e)},r))})},resolve:e=>{if(e instanceof lt)return e;if(e&&"function"==typeof e.then)return new lt((t,r)=>{e.then(t,r)});var t=new lt(sK,!0,e);return ll(t,s2),t},reject:lf,race:function(){var e=sg.apply(null,arguments).map(lS);return new lt((t,r)=>{e.map(e=>lt.resolve(e).then(t,r))})},PSD:{get:()=>s8,set:e=>s8=e},totalEchoes:{get:()=>lv},newPSD:l_,usePSD:lk,scheduler:{get:()=>sQ,set:e=>{sQ=e}},rejectionMapper:{get:()=>s6,set:e=>{s6=e}},follow:(e,t)=>new lt((r,n)=>l_((t,r)=>{var n=s8;n.unhandleds=[],n.onunhandled=r,n.finalize=sL(function(){var e;e=()=>{0===this.unhandleds.length?t():r(this.unhandleds[0])},le.push(function t(){e(),le.splice(le.indexOf(t),1)}),++s7,sQ(()=>{0==--s7&&lp()},[])},n.finalize),e()},t,r,n))}),sY&&(sY.allSettled&&a4(lt,"allSettled",function(){let e=sg.apply(null,arguments).map(lS);return new lt(t=>{0===e.length&&t([]);let r=e.length,n=Array(r);e.forEach((e,i)=>lt.resolve(e).then(e=>n[i]={status:"fulfilled",value:e},e=>n[i]={status:"rejected",reason:e}).then(()=>--r||t(n)))})}),sY.any&&"u">typeof AggregateError&&a4(lt,"any",function(){let e=sg.apply(null,arguments).map(lS);return new lt((t,r)=>{0===e.length&&r(AggregateError([]));let n=e.length,i=Array(n);e.forEach((e,o)=>lt.resolve(e).then(e=>t(e),e=>{i[o]=e,--n||r(AggregateError(i))}))})}));let lm={awaits:0,echoes:0,id:0};var ly=0,lg=[],lb=0,lv=0,lw=0;function l_(e,t,r,n){var i=s8,o=Object.create(i);o.parent=i,o.ref=0,o.global=!1,o.id=++lw;var a=s5.env;o.env=sZ?{Promise:lt,PromiseProp:{value:lt,configurable:!0,writable:!0},all:lt.all,race:lt.race,allSettled:lt.allSettled,any:lt.any,resolve:lt.resolve,reject:lt.reject,nthen:lT(a.nthen,o),gthen:lT(a.gthen,o)}:{},t&&aJ(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()};var s=lk(o,e,r,n);return 0===o.ref&&o.finalize(),s}function lx(){return lm.id||(lm.id=++ly),++lm.awaits,lm.echoes+=100,lm.id}function lE(){return!!lm.awaits&&(0==--lm.awaits&&(lm.id=0),lm.echoes=100*lm.awaits,!0)}function lS(e){return lm.echoes&&e&&e.constructor===sY?(lx(),e.then(e=>(lE(),e),e=>(lE(),lN(e)))):e}function lD(e){++lv,lm.echoes&&0!=--lm.echoes||(lm.echoes=lm.id=0),lg.push(s8),lP(e,!0)}function lO(){var e=lg[lg.length-1];lg.pop(),lP(e,!1)}function lP(e,t){var r,n=s8;if((t?!lm.echoes||lb++&&e===s8:!lb||--lb&&e===s8)||(r=t?lD.bind(null,e):lO,sq.call(sH,r)),e!==s8&&(s8=e,n===s5&&(s5.env=lC()),sZ)){var i=s5.env.Promise,o=e.env;sz.then=o.nthen,i.prototype.then=o.gthen,(n.global||e.global)&&(Object.defineProperty(aq,"Promise",o.PromiseProp),i.all=o.all,i.race=o.race,i.resolve=o.resolve,i.reject=o.reject,o.allSettled&&(i.allSettled=o.allSettled),o.any&&(i.any=o.any))}}function lC(){var e=aq.Promise;return sZ?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(aq,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:sz.then,gthen:e.prototype.then}:{}}function lk(e,t,r,n,i){var o=s8;try{return lP(e,!0),t(r,n,i)}finally{lP(o,!1)}}function lj(e,t,r,n){return"function"!=typeof e?e:function(){var i,o=s8;r&&lx(),lP(t,!0);try{return e.apply(this,arguments)}finally{lP(o,!1),n&&(i=lE,sq.call(sH,i))}}}function lT(e,t){return function(r,n){return e.call(this,lj(r,t),lj(n,t))}}-1===(""+sq).indexOf("[native code]")&&(lx=lE=sM);let lR="unhandledrejection";function lA(e,t){var r;try{r=t.onuncatched(e)}catch(e){}if(!1!==r)try{var n,i={promise:t,reason:e};if(aq.document&&document.createEvent?((n=document.createEvent("Event")).initEvent(lR,!0,!0),aJ(n,i)):aq.CustomEvent&&aJ(n=new CustomEvent(lR,{detail:i}),i),n&&aq.dispatchEvent&&(dispatchEvent(n),!aq.PromiseRejectionEvent&&aq.onunhandledrejection))try{aq.onunhandledrejection(n)}catch(e){}sv&&n&&!n.defaultPrevented&&console.warn(`Unhandled rejection: ${e.stack||e}`)}catch(e){}}var lN=lt.reject;let lM="3.2.4",lI=String.fromCharCode(65535),l$=-1/0,lL="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",lF="String expected.",lB=[],lV="u">typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),lU=e=>!/(dexie\.js|dexie\.min\.js)/.test(e),lW="__dbnames",lK="readonly",lH="readwrite";function lz(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}let lG={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function lq(e){return"string"!=typeof e||/\./.test(e)?e=>e:t=>(void 0===t[e]&&e in t&&delete(t=sd(t))[e],t)}class lY{_trans(e,t,r){let n=this._tx||s8.trans,i=this.name;function o(e,r,n){if(!n.schema[i])throw new sR.NotFound("Table "+i+" not part of transaction");return t(n.idbtrans,n)}let a=lc();try{return n&&n.db===this.db?n===s8.trans?n._promise(e,o,r):l_(()=>n._promise(e,o,r),{trans:n,transless:s8.transless||s8}):function e(t,r,n,i){if(t.idbdb&&(t._state.openComplete||s8.letThrough||t._vip)){var o=t._createTransaction(r,n,t._dbSchema);try{o.create(),t._state.PR1398_maxLoop=3}catch(o){return o.name===sT.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then(()=>e(t,r,n,i))):lN(o)}return o._promise(r,(e,t)=>l_(()=>(s8.trans=o,i(e,t,o)))).then(e=>o._completion.then(()=>e))}if(t._state.openComplete)return lN(new sR.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._options.autoOpen)return lN(new sR.DatabaseClosed);t.open().catch(sM)}return t._state.dbReadyPromise.then(()=>e(t,r,n,i))}(this.db,e,[this.name],o)}finally{a&&ld()}}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(aZ(e))return new this.db.WhereClause(this,`[${e.join("+")}]`);let t=aY(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);let r=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(r&&this.db._maxKey!==lI)return this.where(r.name).equals(r.keyPath.map(t=>e[t]));!r&&sv&&console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit of a compound index [${t.join("+")}]`);let{idxByName:n}=this.schema,i=this.db._deps.indexedDB;function o(e,t){try{return 0===i.cmp(e,t)}catch(e){return!1}}let[a,s]=t.reduce(([t,r],i)=>{let a=n[i],s=e[i];return[t||a,t||!a?lz(r,a&&a.multi?e=>{let t=sn(e,i);return aZ(t)&&t.some(e=>o(s,e))}:e=>o(s,sn(e,i))):r]},[null,null]);return a?this.where(a.name).equals(e[a.keyPath]).filter(s):r?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,aZ(e)?`[${e.join("+")}]`:e))}reverse(){return this.toCollection().reverse()}mapToClass(e){this.schema.mappedClass=e;let t=t=>{if(!t)return t;let r=Object.create(e.prototype);for(var n in t)if(a0(t,n))try{r[n]=t[n]}catch(e){}return r};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){aJ(this,e)})}add(e,t){let{auto:r,keyPath:n}=this.schema.primKey,i=e;return n&&r&&(i=lq(n)(e)),this._trans("readwrite",e=>this.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[i]})).then(e=>e.numFailures?lt.reject(e.failures[0]):e.lastResult).then(t=>{if(n)try{si(e,n,t)}catch(e){}return t})}update(e,t){if("object"!=typeof e||aZ(e))return this.where(":id").equals(e).modify(t);{let r=sn(e,this.schema.primKey.keyPath);if(void 0===r)return lN(new sR.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?aY(t).forEach(r=>{si(e,r,t[r])}):t(e,{value:e,primKey:r})}catch(e){}return this.where(":id").equals(r).modify(t)}}put(e,t){let{auto:r,keyPath:n}=this.schema.primKey,i=e;return n&&r&&(i=lq(n)(e)),this._trans("readwrite",e=>this.core.mutate({trans:e,type:"put",values:[i],keys:null!=t?[t]:null})).then(e=>e.numFailures?lt.reject(e.failures[0]):e.lastResult).then(t=>{if(n)try{si(e,n,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?lt.reject(e.failures[0]):void 0)}clear(){return this._trans("readwrite",e=>this.core.mutate({trans:e,type:"deleteRange",range:lG})).then(e=>e.numFailures?lt.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,r){let n=Array.isArray(t)?t:void 0,i=(r=r||(n?void 0:t))?r.allKeys:void 0;return this._trans("readwrite",t=>{let{auto:r,keyPath:o}=this.schema.primKey;if(o&&n)throw new sR.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(n&&n.length!==e.length)throw new sR.InvalidArgument("Arguments objects and keys must have the same length");let a=e.length,s=o&&r?e.map(lq(o)):e;return this.core.mutate({trans:t,type:"add",keys:n,values:s,wantResults:i}).then(({numFailures:e,results:t,lastResult:r,failures:n})=>{if(0===e)return i?t:r;throw new sj(`${this.name}.bulkAdd(): ${e} of ${a} operations failed`,n)})})}bulkPut(e,t,r){let n=Array.isArray(t)?t:void 0,i=(r=r||(n?void 0:t))?r.allKeys:void 0;return this._trans("readwrite",t=>{let{auto:r,keyPath:o}=this.schema.primKey;if(o&&n)throw new sR.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(n&&n.length!==e.length)throw new sR.InvalidArgument("Arguments objects and keys must have the same length");let a=e.length,s=o&&r?e.map(lq(o)):e;return this.core.mutate({trans:t,type:"put",keys:n,values:s,wantResults:i}).then(({numFailures:e,results:t,lastResult:r,failures:n})=>{if(0===e)return i?t:r;throw new sj(`${this.name}.bulkPut(): ${e} of ${a} operations failed`,n)})})}bulkDelete(e){let t=e.length;return this._trans("readwrite",t=>this.core.mutate({trans:t,type:"delete",keys:e})).then(({numFailures:e,lastResult:r,failures:n})=>{if(0===e)return r;throw new sj(`${this.name}.bulkDelete(): ${e} of ${t} operations failed`,n)})}}function lZ(e){var t={},r=function(r,n){if(n){for(var i=arguments.length,o=Array(i-1);--i;)o[i-1]=arguments[i];return t[r].subscribe.apply(null,o),e}if("string"==typeof r)return t[r]};r.addEventType=o;for(var n=1,i=arguments.length;n<i;++n)o(arguments[n]);return r;function o(e,n,i){if("object"!=typeof e){n||(n=sU),i||(i=sM);var a={subscribers:[],fire:i,subscribe:function(e){-1===a.subscribers.indexOf(e)&&(a.subscribers.push(e),a.fire=n(a.fire,e))},unsubscribe:function(e){a.subscribers=a.subscribers.filter(function(t){return t!==e}),a.fire=a.subscribers.reduce(n,i)}};return t[e]=r[e]=a,a}aY(e).forEach(function(t){var r=e[t];if(aZ(r))o(t,e[t][0],e[t][1]);else{if("asap"!==r)throw new sR.InvalidArgument("Invalid event config");var n=o(t,sI,function(){for(var e=arguments.length,t=Array(e);e--;)t[e]=arguments[e];n.subscribers.forEach(function(e){st(function(){e.apply(null,t)})})})}})}}function lJ(e,t){return a2(t).from({prototype:e}),t}function lX(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function lQ(e,t){e.filter=lz(e.filter,t)}function l0(e,t,r){var n=e.replayFilter;e.replayFilter=n?()=>lz(n(),t()):t,e.justLimit=r&&!n}function l1(e,t){if(e.isPrimKey)return t.primaryKey;let r=t.getIndexByKeyPath(e.index);if(!r)throw new sR.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return r}function l3(e,t,r){let n=l1(e,t.schema);return t.openCursor({trans:r,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:n,range:e.range}})}function l4(e,t,r,n){let i=e.replayFilter?lz(e.filter,e.replayFilter()):e.filter;if(e.or){let o={},a=(e,r,n)=>{if(!i||i(r,n,e=>r.stop(e),e=>r.fail(e))){var a=r.primaryKey,s=""+a;"[object ArrayBuffer]"===s&&(s=""+new Uint8Array(a)),a0(o,s)||(o[s]=!0,t(e,r,n))}};return Promise.all([e.or._iterate(a,r),l2(l3(e,n,r),e.algorithm,a,!e.keysOnly&&e.valueMapper)])}return l2(l3(e,n,r),lz(e.algorithm,i),t,!e.keysOnly&&e.valueMapper)}function l2(e,t,r,n){var i=lh(n?(e,t,i)=>r(n(e),t,i):r);return e.then(e=>{if(e)return e.start(()=>{var r=()=>e.continue();t&&!t(e,e=>r=e,t=>{e.stop(t),r=sM},t=>{e.fail(t),r=sM})||i(e.value,e,e=>r=e),r()})})}function l6(e,t){try{let r=l5(e),n=l5(t);if(r!==n)return"Array"===r?1:"Array"===n?-1:"binary"===r?1:"binary"===n?-1:"string"===r?1:"string"===n?-1:"Date"===r?1:"Date"!==n?NaN:-1;switch(r){case"number":case"Date":case"string":return e>t?1:e<t?-1:0;case"binary":return function(e,t){let r=e.length,n=t.length,i=r<n?r:n;for(let r=0;r<i;++r)if(e[r]!==t[r])return e[r]<t[r]?-1:1;return r===n?0:r<n?-1:1}(l8(e),l8(t));case"Array":return function(e,t){let r=e.length,n=t.length,i=r<n?r:n;for(let r=0;r<i;++r){let n=l6(e[r],t[r]);if(0!==n)return n}return r===n?0:r<n?-1:1}(e,t)}}catch(e){}return NaN}function l5(e){let t=typeof e;if("object"!==t)return t;if(ArrayBuffer.isView(e))return"binary";let r=sf(e);return"ArrayBuffer"===r?"binary":r}function l8(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}class l9{_read(e,t){var r=this._ctx;return r.error?r.table._trans(null,lN.bind(null,r.error)):r.table._trans("readonly",e).then(t)}_write(e){var t=this._ctx;return t.error?t.table._trans(null,lN.bind(null,t.error)):t.table._trans("readwrite",e,"locked")}_addAlgorithm(e){var t=this._ctx;t.algorithm=lz(t.algorithm,e)}_iterate(e,t){return l4(this._ctx,e,t,this._ctx.table.core)}clone(e){var t=Object.create(this.constructor.prototype),r=Object.create(this._ctx);return e&&aJ(r,e),t._ctx=r,t}raw(){return this._ctx.valueMapper=null,this}each(e){var t=this._ctx;return this._read(r=>l4(t,e,r,t.table.core))}count(e){return this._read(e=>{let t=this._ctx,r=t.table.core;if(lX(t,!0))return r.count({trans:e,query:{index:l1(t,r.schema),range:t.range}}).then(e=>Math.min(e,t.limit));var n=0;return l4(t,()=>(++n,!1),e,r).then(()=>n)}).then(e)}sortBy(e,t){let r=e.split(".").reverse(),n=r[0],i=r.length-1;function o(e,t){return t?o(e[r[t]],t-1):e[n]}var a="next"===this._ctx.dir?1:-1;function s(e,t){var r=o(e,i),n=o(t,i);return r<n?-a:r>n?a: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&&lX(t,!0)&&t.limit>0){let{valueMapper:r}=t,n=l1(t,t.table.core.schema);return t.table.core.query({trans:e,limit:t.limit,values:!0,query:{index:n,range:t.range}}).then(({result:e})=>r?e.map(r):e)}{let r=[];return l4(t,e=>r.push(e),e,t.table.core).then(()=>r)}},e)}offset(e){var t=this._ctx;return e<=0||(t.offset+=e,lX(t)?l0(t,()=>{var t=e;return(e,r)=>0===t||(1===t?--t:r(()=>{e.advance(t),t=0}),!1)}):l0(t,()=>{var t=e;return()=>--t<0})),this}limit(e){return this._ctx.limit=Math.min(this._ctx.limit,e),l0(this._ctx,()=>{var t=e;return function(e,r,n){return--t<=0&&r(n),t>=0}},!0),this}until(e,t){return lQ(this._ctx,function(r,n,i){return!e(r.value)||(n(i),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 lQ(this._ctx,function(t){return e(t.value)}),(t=this._ctx).isMatch=lz(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,r){e(r.key,r)})}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,r){e(r.primaryKey,r)})}keys(e){var t=this._ctx;t.keysOnly=!t.isMatch;var r=[];return this.each(function(e,t){r.push(t.key)}).then(function(){return r}).then(e)}primaryKeys(e){var t=this._ctx;if("next"===t.dir&&lX(t,!0)&&t.limit>0)return this._read(e=>{var r=l1(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:r,range:t.range}})}).then(({result:e})=>e).then(e);t.keysOnly=!t.isMatch;var r=[];return this.each(function(e,t){r.push(t.primaryKey)}).then(function(){return r}).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 r={};return lQ(this._ctx,function(e){var t=e.primaryKey.toString(),n=a0(r,t);return r[t]=!0,!n}),this}modify(e){var t=this._ctx;return this._write(r=>{var n;if("function"==typeof e)n=e;else{var i=aY(e),o=i.length;n=function(t){for(var r=!1,n=0;n<o;++n){var a=i[n],s=e[a];sn(t,a)!==s&&(si(t,a,s),r=!0)}return r}}let a=t.table.core,{outbound:s,extractKey:l}=a.schema.primaryKey,u=this.db._options.modifyChunkSize||200,c=[],d=0,p=[],f=(e,t)=>{let{failures:r,numFailures:n}=t;for(let t of(d+=e-n,aY(r)))c.push(r[t])};return this.clone().primaryKeys().then(i=>{let o=c=>{let d=Math.min(u,i.length-c);return a.getMany({trans:r,keys:i.slice(c,c+d),cache:"immutable"}).then(p=>{let h=[],m=[],y=s?[]:null,g=[];for(let e=0;e<d;++e){let t=p[e],r={value:sd(t),primKey:i[c+e]};!1!==n.call(r,r.value,r)&&(null==r.value?g.push(i[c+e]):s||0===l6(l(t),l(r.value))?(m.push(r.value),s&&y.push(i[c+e])):(g.push(i[c+e]),h.push(r.value)))}let b=lX(t)&&t.limit===1/0&&("function"!=typeof e||e===l7)&&{index:t.index,range:t.range};return Promise.resolve(h.length>0&&a.mutate({trans:r,type:"add",values:h}).then(e=>{for(let t in e.failures)g.splice(parseInt(t),1);f(h.length,e)})).then(()=>(m.length>0||b&&"object"==typeof e)&&a.mutate({trans:r,type:"put",keys:y,values:m,criteria:b,changeSpec:"function"!=typeof e&&e}).then(e=>f(m.length,e))).then(()=>(g.length>0||b&&e===l7)&&a.mutate({trans:r,type:"delete",keys:g,criteria:b}).then(e=>f(g.length,e))).then(()=>i.length>c+d&&o(c+u))})};return o(0).then(()=>{if(c.length>0)throw new sk("Error modifying one or more objects",c,d,p);return i.length})})})}delete(){var e=this._ctx,t=e.range;return lX(e)&&(e.isPrimKey&&!lV||3===t.type)?this._write(r=>{let{primaryKey:n}=e.table.core.schema;return e.table.core.count({trans:r,query:{index:n,range:t}}).then(n=>e.table.core.mutate({trans:r,type:"deleteRange",range:t}).then(({failures:e,lastResult:t,results:r,numFailures:i})=>{if(i)throw new sk("Could not delete some values",Object.keys(e).map(t=>e[t]),n-i);return n-i}))}):this.modify(l7)}}let l7=(e,t)=>t.value=null;function ue(e,t){return e<t?-1:+(e!==t)}function ut(e,t){return e>t?-1:+(e!==t)}function ur(e,t,r){var n=e instanceof us?new e.Collection(e):e;return n._ctx.error=r?new r(t):TypeError(t),n}function un(e){return new e.Collection(e,()=>ua("")).limit(0)}function ui(e,t,r,n){var i,o,a,s,l,u,c,d=r.length;if(!r.every(e=>"string"==typeof e))return ur(e,lF);function p(e){i="next"===e?e=>e.toUpperCase():e=>e.toLowerCase(),o="next"===e?e=>e.toLowerCase():e=>e.toUpperCase(),a="next"===e?ue:ut;var t=r.map(function(e){return{lower:o(e),upper:i(e)}}).sort(function(e,t){return a(e.lower,t.lower)});s=t.map(function(e){return e.upper}),l=t.map(function(e){return e.lower}),u=e,c="next"===e?"":n}p("next");var f=new e.Collection(e,()=>uo(s[0],l[d-1]+n));f._ondirectionchange=function(e){p(e)};var h=0;return f._addAlgorithm(function(e,r,n){var i=e.key;if("string"!=typeof i)return!1;var p=o(i);if(t(p,l,h))return!0;for(var f=null,m=h;m<d;++m){var y=function(e,t,r,n,i,o){for(var a=Math.min(e.length,n.length),s=-1,l=0;l<a;++l){var u=t[l];if(u!==n[l])return 0>i(e[l],r[l])?e.substr(0,l)+r[l]+r.substr(l+1):0>i(e[l],n[l])?e.substr(0,l)+n[l]+r.substr(l+1):s>=0?e.substr(0,s)+t[s]+r.substr(s+1):null;0>i(e[l],u)&&(s=l)}return a<n.length&&"next"===o?e+r.substr(e.length):a<e.length&&"prev"===o?e.substr(0,r.length):s<0?null:e.substr(0,s)+n[s]+r.substr(s+1)}(i,p,s[m],l[m],a,u);null===y&&null===f?h=m+1:(null===f||a(f,y)>0)&&(f=y)}return r(null!==f?function(){e.continue(f+c)}:n),!1}),f}function uo(e,t,r,n){return{type:2,lower:e,upper:t,lowerOpen:r,upperOpen:n}}function ua(e){return{type:1,lower:e,upper:e}}class us{get Collection(){return this._ctx.table.db.Collection}between(e,t,r,n){r=!1!==r,n=!0===n;try{return this._cmp(e,t)>0||0===this._cmp(e,t)&&(r||n)&&(!r||!n)?un(this):new this.Collection(this,()=>uo(e,t,!r,!n))}catch(e){return ur(this,lL)}}equals(e){return null==e?ur(this,lL):new this.Collection(this,()=>ua(e))}above(e){return null==e?ur(this,lL):new this.Collection(this,()=>uo(e,void 0,!0))}aboveOrEqual(e){return null==e?ur(this,lL):new this.Collection(this,()=>uo(e,void 0,!1))}below(e){return null==e?ur(this,lL):new this.Collection(this,()=>uo(void 0,e,!1,!0))}belowOrEqual(e){return null==e?ur(this,lL):new this.Collection(this,()=>uo(void 0,e))}startsWith(e){return"string"!=typeof e?ur(this,lF):this.between(e,e+lI,!0,!0)}startsWithIgnoreCase(e){return""===e?this.startsWith(e):ui(this,(e,t)=>0===e.indexOf(t[0]),[e],lI)}equalsIgnoreCase(e){return ui(this,(e,t)=>e===t[0],[e],"")}anyOfIgnoreCase(){var e=sg.apply(sy,arguments);return 0===e.length?un(this):ui(this,(e,t)=>-1!==t.indexOf(e),e,"")}startsWithAnyOfIgnoreCase(){var e=sg.apply(sy,arguments);return 0===e.length?un(this):ui(this,(e,t)=>t.some(t=>0===e.indexOf(t)),e,lI)}anyOf(){let e=sg.apply(sy,arguments),t=this._cmp;try{e.sort(t)}catch(e){return ur(this,lL)}if(0===e.length)return un(this);let r=new this.Collection(this,()=>uo(e[0],e[e.length-1]));r._ondirectionchange=r=>{t="next"===r?this._ascending:this._descending,e.sort(t)};let n=0;return r._addAlgorithm((r,i,o)=>{let a=r.key;for(;t(a,e[n])>0;)if(++n===e.length)return i(o),!1;return 0===t(a,e[n])||(i(()=>{r.continue(e[n])}),!1)}),r}notEqual(e){return this.inAnyRange([[l$,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){let e=sg.apply(sy,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return ur(this,lL)}let t=e.reduce((e,t)=>e?e.concat([[e[e.length-1][1],t]]):[[l$,t]],null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})}inAnyRange(e,t){let r=this._cmp,n=this._ascending,i=this._descending,o=this._min,a=this._max;if(0===e.length)return un(this);if(!e.every(e=>void 0!==e[0]&&void 0!==e[1]&&0>=n(e[0],e[1])))return ur(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",sR.InvalidArgument);let s=!t||!1!==t.includeLowers,l=t&&!0===t.includeUppers,u,c=n;function d(e,t){return c(e[0],t[0])}try{(u=e.reduce(function(e,t){let n=0,i=e.length;for(;n<i;++n){let i=e[n];if(0>r(t[0],i[1])&&r(t[1],i[0])>0){i[0]=o(i[0],t[0]),i[1]=a(i[1],t[1]);break}}return n===i&&e.push(t),e},[])).sort(d)}catch(e){return ur(this,lL)}let p=0,f=l?e=>n(e,u[p][1])>0:e=>n(e,u[p][1])>=0,h=s?e=>i(e,u[p][0])>0:e=>i(e,u[p][0])>=0,m=f,y=new this.Collection(this,()=>uo(u[0][0],u[u.length-1][1],!s,!l));return y._ondirectionchange=e=>{"next"===e?(m=f,c=n):(m=h,c=i),u.sort(d)},y._addAlgorithm((e,t,r)=>{for(var i=e.key;m(i);)if(++p===u.length)return t(r),!1;return!!(!f(i)&&!h(i))||(0===this._cmp(i,u[p][1])||0===this._cmp(i,u[p][0])||t(()=>{c===n?e.continue(u[p][0]):e.continue(u[p][1])}),!1)}),y}startsWithAnyOf(){let e=sg.apply(sy,arguments);return e.every(e=>"string"==typeof e)?0===e.length?un(this):this.inAnyRange(e.map(e=>[e,e+lI])):ur(this,"startsWithAnyOf() only works with strings")}}function ul(e){return lh(function(t){return uu(t),e(t.target.error),!1})}function uu(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}let uc="storagemutated",ud="x-storagemutated-1",up=lZ(null,uc);class uf{_lock(){return se(!s8.global),++this._reculock,1!==this._reculock||s8.global||(s8.lockOwnerFor=this),this}_unlock(){if(se(!s8.global),0==--this._reculock)for(s8.global||(s8.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{lk(e[1],e[0])}catch(e){}}return this}_locked(){return this._reculock&&s8.lockOwnerFor!==this}create(e){if(!this.mode)return this;let t=this.db.idbdb,r=this.db._state.dbOpenError;if(se(!this.idbtrans),!e&&!t)switch(r&&r.name){case"DatabaseClosedError":throw new sR.DatabaseClosed(r);case"MissingAPIError":throw new sR.MissingAPI(r.message,r);default:throw new sR.OpenFailed(r)}if(!this.active)throw new sR.TransactionInactive;return se(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=lh(t=>{uu(t),this._reject(e.error)}),e.onabort=lh(t=>{uu(t),this.active&&this._reject(new sR.Abort(e.error)),this.active=!1,this.on("abort").fire(t)}),e.oncomplete=lh(()=>{this.active=!1,this._resolve(),"mutatedParts"in e&&up.storagemutated.fire(e.mutatedParts)}),this}_promise(e,t,r){if("readwrite"===e&&"readwrite"!==this.mode)return lN(new sR.ReadOnly("Transaction is readonly"));if(!this.active)return lN(new sR.TransactionInactive);if(this._locked())return new lt((n,i)=>{this._blockedFuncs.push([()=>{this._promise(e,t,r).then(n,i)},s8])});if(r)return l_(()=>{var e=new lt((e,r)=>{this._lock();let n=t(e,r,this);n&&n.then&&n.then(e,r)});return e.finally(()=>this._unlock()),e._lib=!0,e});var n=new lt((e,r)=>{var n=t(e,r,this);n&&n.then&&n.then(e,r)});return n._lib=!0,n}_root(){return this.parent?this.parent._root():this}waitFor(e){var t=this._root();let r=lt.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then(()=>r);else{t._waitingFor=r,t._waitingQueue=[];var n=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(n.get(-1/0).onsuccess=e)}()}var i=t._waitingFor;return new lt((e,n)=>{r.then(r=>t._waitingQueue.push(lh(e.bind(null,r))),e=>t._waitingQueue.push(lh(n.bind(null,e)))).finally(()=>{t._waitingFor===i&&(t._waitingFor=null)})})}abort(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new sR.Abort))}table(e){let t=this._memoizedTables||(this._memoizedTables={});if(a0(t,e))return t[e];let r=this.schema[e];if(!r)throw new sR.NotFound("Table "+e+" not part of transaction");let n=new this.db.Table(e,r,this);return n.core=this.db.core.table(e),t[e]=n,n}}function uh(e,t,r,n,i,o,a){return{name:e,keyPath:t,unique:r,multi:n,auto:i,compound:o,src:(r&&!a?"&":"")+(n?"*":"")+(i?"++":"")+um(t)}}function um(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function uy(e,t,r){return{name:e,primKey:t,indexes:r,mappedClass:null,idxByName:sr(r,e=>[e.name,e])}}let ug=e=>{try{return e.only([[]]),ug=()=>[[]],[[]]}catch(e){return ug=()=>lI,lI}};function ub(e){return null==e?()=>{}:"string"==typeof e?1===e.split(".").length?t=>t[e]:t=>sn(t,e):t=>sn(t,e)}function uv(e){return[].slice.call(e)}let uw=0;function u_(e){return null==e?":id":"string"==typeof e?e:`[${e.join("+")}]`}function ux({_novip:e},t){let r=t.db,n=function(e,t,{IDBKeyRange:r,indexedDB:n},i){var o;return{dbcore:(o=function(e,t,r){let n;function i(e){if(3===e.type)return null;if(4===e.type)throw Error("Cannot convert never type to IDBKeyRange");let{lower:r,upper:n,lowerOpen:i,upperOpen:o}=e;return void 0===r?void 0===n?null:t.upperBound(n,!!o):void 0===n?t.lowerBound(r,!!i):t.bound(r,n,!!i,!!o)}let{schema:o,hasGetAll:a}=(n=uv(e.objectStoreNames),{schema:{name:e.name,tables:n.map(e=>r.objectStore(e)).map(e=>{let{keyPath:t,autoIncrement:r}=e,n=aZ(t),i=null==t,o={},a={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:i,compound:n,keyPath:t,autoIncrement:r,unique:!0,extractKey:ub(t)},indexes:uv(e.indexNames).map(t=>e.index(t)).map(e=>{let{name:t,unique:r,multiEntry:n,keyPath:i}=e,a={name:t,compound:aZ(i),keyPath:i,unique:r,multiEntry:n,extractKey:ub(i)};return o[u_(i)]=a,a}),getIndexByKeyPath:e=>o[u_(e)]};return o[":id"]=a.primaryKey,null!=t&&(o[u_(t)]=a.primaryKey),a})},hasGetAll:n.length>0&&"getAll"in r.objectStore(n[0])&&!("u">typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),s=o.tables.map(e=>{let t;return{name:t=e.name,schema:e,mutate:function({trans:e,type:r,keys:n,values:o,range:a}){return new Promise((s,l)=>{let u;s=lh(s);let c=e.objectStore(t),d=null==c.keyPath,p="put"===r||"add"===r;if(!p&&"delete"!==r&&"deleteRange"!==r)throw Error("Invalid operation type: "+r);let{length:f}=n||o||{length:1};if(n&&o&&n.length!==o.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=[],y=0,g=e=>{++y,uu(e)};if("deleteRange"===r){if(4===a.type)return s({numFailures:y,failures:m,results:[],lastResult:void 0});3===a.type?h.push(u=c.clear()):h.push(u=c.delete(i(a)))}else{let[e,t]=p?d?[o,n]:[o,null]:[n,null];if(p)for(let n=0;n<f;++n)h.push(u=t&&void 0!==t[n]?c[r](e[n],t[n]):c[r](e[n])),u.onerror=g;else for(let t=0;t<f;++t)h.push(u=c[r](e[t])),u.onerror=g}let b=e=>{let t=e.target.result;h.forEach((e,t)=>null!=e.error&&(m[t]=e.error)),s({numFailures:y,failures:m,results:"delete"===r?n:h.map(e=>e.result),lastResult:t})};u.onerror=e=>{g(e),b(e)},u.onsuccess=b})},getMany:({trans:e,keys:r})=>new Promise((n,i)=>{n=lh(n);let o=e.objectStore(t),a=r.length,s=Array(a),l,u=0,c=0,d=e=>{let t=e.target;s[t._pos]=t.result,++c===u&&n(s)},p=ul(i);for(let e=0;e<a;++e)null!=r[e]&&((l=o.get(r[e]))._pos=e,l.onsuccess=d,l.onerror=p,++u);0===u&&n(s)}),get:({trans:e,key:r})=>new Promise((n,i)=>{n=lh(n);let o=e.objectStore(t).get(r);o.onsuccess=e=>n(e.target.result),o.onerror=ul(i)}),query:e=>new Promise((r,n)=>{r=lh(r);let{trans:o,values:s,limit:l,query:u}=e,c=l===1/0?void 0:l,{index:d,range:p}=u,f=o.objectStore(t),h=d.isPrimaryKey?f:f.index(d.name),m=i(p);if(0===l)return r({result:[]});if(a){let e=s?h.getAll(m,c):h.getAllKeys(m,c);e.onsuccess=e=>r({result:e.target.result}),e.onerror=ul(n)}else{let e=0,t=!s&&"openKeyCursor"in h?h.openKeyCursor(m):h.openCursor(m),i=[];t.onsuccess=n=>{let o=t.result;return o?(i.push(s?o.value:o.primaryKey),++e===l?r({result:i}):void o.continue()):r({result:i})},t.onerror=ul(n)}}),openCursor:function({trans:e,values:r,query:n,reverse:o,unique:a}){return new Promise((s,l)=>{s=lh(s);let{index:u,range:c}=n,d=e.objectStore(t),p=u.isPrimaryKey?d:d.index(u.name),f=o?a?"prevunique":"prev":a?"nextunique":"next",h=!r&&"openKeyCursor"in p?p.openKeyCursor(i(c),f):p.openCursor(i(c),f);h.onerror=ul(l),h.onsuccess=lh(t=>{let r=h.result;if(!r)return void s(null);r.___id=++uw,r.done=!1;let n=r.continue.bind(r),i=r.continuePrimaryKey;i&&(i=i.bind(r));let o=r.advance.bind(r),a=()=>{throw Error("Cursor not stopped")};r.trans=e,r.stop=r.continue=r.continuePrimaryKey=r.advance=()=>{throw Error("Cursor not started")},r.fail=lh(l),r.next=function(){let e=1;return this.start(()=>e--?this.continue():this.stop()).then(()=>this)},r.start=e=>{let t=new Promise((e,t)=>{e=lh(e),h.onerror=ul(t),r.fail=t,r.stop=t=>{r.stop=r.continue=r.continuePrimaryKey=r.advance=a,e(t)}}),s=()=>{if(h.result)try{e()}catch(e){r.fail(e)}else r.done=!0,r.start=()=>{throw Error("Cursor behind last entry")},r.stop()};return h.onsuccess=lh(e=>{h.onsuccess=s,s()}),r.continue=n,r.continuePrimaryKey=i,r.advance=o,s(),t},s(r)},l)})},count({query:e,trans:r}){let{index:n,range:o}=e;return new Promise((e,a)=>{let s=r.objectStore(t),l=n.isPrimaryKey?s:s.index(n.name),u=i(o),c=u?l.count(u):l.count();c.onsuccess=lh(t=>e(t.target.result)),c.onerror=ul(a)})}}}),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:ug(t),schema:o}}(t,r,i),e.dbcore.reduce((e,{create:t})=>({...e,...t(e)}),o))}}(e._middlewares,r,e._deps,t);e.core=n.dbcore,e.tables.forEach(t=>{let r=t.name;e.core.schema.tables.some(e=>e.name===r)&&(t.core=e.core.table(r),e[r]instanceof e.Table&&(e[r].core=t.core))})}function uE({_novip:e},t,r,n){r.forEach(r=>{let i=n[r];t.forEach(t=>{let n=a5(t,r);(!n||"value"in n&&void 0===n.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?a4(t,r,{get(){return this.table(r)},set(e){a3(this,r,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[r]=new e.Table(r,i))})})}function uS({_novip:e},t){t.forEach(t=>{for(let r in t)t[r]instanceof e.Table&&delete t[r]})}function uD(e,t){return e._cfg.version-t._cfg.version}function uO(e,t){let r,n={del:[],add:[],change:[]};for(r in e)t[r]||n.del.push(r);for(r in t){let i=e[r],o=t[r];if(i){let e={name:r,def:o,recreate:!1,del:[],add:[],change:[]};if(""+(i.primKey.keyPath||"")==""+(o.primKey.keyPath||"")&&(i.primKey.auto===o.primKey.auto||lV)){let t,r=i.idxByName,a=o.idxByName;for(t in r)a[t]||e.del.push(t);for(t in a){let n=r[t],i=a[t];n?n.src!==i.src&&e.change.push(i):e.add.push(i)}(e.del.length>0||e.add.length>0||e.change.length>0)&&n.change.push(e)}else e.recreate=!0,n.change.push(e)}else n.add.push([r,o])}return n}function uP(e,t,r,n){let i=e.db.createObjectStore(t,r.keyPath?{keyPath:r.keyPath,autoIncrement:r.auto}:{autoIncrement:r.auto});return n.forEach(e=>uC(i,e)),i}function uC(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function uk(e,t,r){let n={};return a9(t.objectStoreNames,0).forEach(e=>{let t=r.objectStore(e),i=t.keyPath,o=uh(um(i),i||"",!1,!1,!!t.autoIncrement,i&&"string"!=typeof i,!0),a=[];for(let e=0;e<t.indexNames.length;++e){let r=t.index(t.indexNames[e]);i=r.keyPath;var s=uh(r.name,i,!!r.unique,!!r.multiEntry,!1,i&&"string"!=typeof i,!1);a.push(s)}n[e]=uy(e,o,a)}),n}function uj({_novip:e},t,r){let n=r.db.objectStoreNames;for(let i=0;i<n.length;++i){let o=n[i],a=r.objectStore(o);e._hasGetAll="getAll"in a;for(let e=0;e<a.indexNames.length;++e){let r=a.indexNames[e],n=a.index(r).keyPath,i="string"==typeof n?n:"["+a9(n).join("+")+"]";if(t[o]){let e=t[o].idxByName[i];e&&(e.name=r,delete t[o].idxByName[i],t[o].idxByName[r]=e)}}}"u">typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&aq.WorkerGlobalScope&&aq instanceof aq.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}class uT{_parseStoresSpec(e,t){aY(e).forEach(r=>{if(null!==e[r]){var n=e[r].split(",").map((e,t)=>{let r=(e=e.trim()).replace(/([&*]|\+\+)/g,""),n=/^\[/.test(r)?r.match(/^\[(.*)\]$/)[1].split("+"):r;return uh(r,n||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),aZ(n),0===t)}),i=n.shift();if(i.multi)throw new sR.Schema("Primary key cannot be multi-valued");n.forEach(e=>{if(e.auto)throw new sR.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new sR.Schema("Index must have a name and cannot be an empty string")}),t[r]=uy(r,i,n)}})}stores(e){let t=this.db;this._cfg.storesSource=this._cfg.storesSource?aJ(this._cfg.storesSource,e):e;let r=t._versions,n={},i={};return r.forEach(e=>{aJ(n,e._cfg.storesSource),i=e._cfg.dbschema={},e._parseStoresSpec(n,i)}),t._dbSchema=i,uS(t,[t._allTables,t,t.Transaction.prototype]),uE(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],aY(i),i),t._storeNames=aY(i),this}upgrade(e){return this._cfg.contentUpgrade=sW(this._cfg.contentUpgrade||sM,e),this}}function uR(e,t){let r=e._dbNamesDB;return r||(r=e._dbNamesDB=new uJ(lW,{addons:[],indexedDB:e,IDBKeyRange:t})).version(1).stores({dbnames:"name"}),r.table("dbnames")}function uA(e){return e&&"function"==typeof e.databases}function uN(e){return l_(function(){return s8.letThrough=!0,e()})}function uM(e){var t=t=>e.next(t),r=i(t),n=i(t=>e.throw(t));function i(e){return t=>{var i=e(t),o=i.value;return i.done?o:o&&"function"==typeof o.then?o.then(r,n):aZ(o)?Promise.all(o).then(r,n):r(o)}}return i(t)()}function uI(e,t,r){var n=arguments.length;if(n<2)throw new sR.InvalidArgument("Too few arguments");for(var i=Array(n-1);--n;)i[n-1]=arguments[n];return r=i.pop(),[e,ss(i),r]}function u$(e,t,r){let n=aZ(e)?e.slice():[e];for(let e=0;e<r;++e)n.push(t);return n}let uL={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return{...e,table(t){let r=e.table(t),{schema:n}=r,i={},o=[];function a(e,t,r){let n=u_(e),s=i[n]=i[n]||[],l=null==e?0:"string"==typeof e?1:e.length,u=t>0,c={...r,isVirtual:u,keyTail:t,keyLength:l,extractKey:ub(e),unique:!u&&r.unique};return s.push(c),c.isPrimaryKey||o.push(c),l>1&&a(2===l?e[0]:e.slice(0,l-1),t+1,r),s.sort((e,t)=>e.keyTail-t.keyTail),c}let s=a(n.primaryKey.keyPath,0,n.primaryKey);for(let e of(i[":id"]=[s],n.indexes))a(e.keyPath,0,e);function l(t){var r,n;let i=t.query.index;return i.isVirtual?{...t,query:{index:i,range:(r=t.query.range,n=i.keyTail,{type:1===r.type?2:r.type,lower:u$(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,n),lowerOpen:!0,upper:u$(r.upper,r.upperOpen?e.MIN_KEY:e.MAX_KEY,n),upperOpen:!0})}}:t}return{...r,schema:{...n,primaryKey:s,indexes:o,getIndexByKeyPath:function(e){let t=i[u_(e)];return t&&t[0]}},count:e=>r.count(l(e)),query:e=>r.query(l(e)),openCursor(t){let{keyTail:n,isVirtual:i,keyLength:o}=t.query.index;return i?r.openCursor(l(t)).then(r=>r&&Object.create(r,{continue:{value:function(i){null!=i?r.continue(u$(i,t.reverse?e.MAX_KEY:e.MIN_KEY,n)):t.unique?r.continue(r.key.slice(0,o).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,n)):r.continue()}},continuePrimaryKey:{value(t,i){r.continuePrimaryKey(u$(t,e.MAX_KEY,n),i)}},primaryKey:{get:()=>r.primaryKey},key:{get(){let e=r.key;return 1===o?e[0]:e.slice(0,o)}},value:{get:()=>r.value}})):r.openCursor(t)}}}}}};function uF(e,t,r,n){return r=r||{},n=n||"",aY(e).forEach(i=>{if(a0(t,i)){var o=e[i],a=t[i];if("object"==typeof o&&"object"==typeof a&&o&&a){let e=sf(o);e!==sf(a)?r[n+i]=t[i]:"Object"===e?uF(o,a,r,n+i+"."):o!==a&&(r[n+i]=t[i])}else o!==a&&(r[n+i]=t[i])}else r[n+i]=void 0}),aY(t).forEach(i=>{a0(e,i)||(r[n+i]=t[i])}),r}let uB={stack:"dbcore",name:"HooksMiddleware",level:2,create:e=>({...e,table(t){let r=e.table(t),{primaryKey:n}=r.schema;return{...r,mutate(e){let i=s8.trans,{deleting:o,creating:a,updating:s}=i.table(t).hook;switch(e.type){case"add":if(a.fire===sM)break;return i._promise("readwrite",()=>l(e),!0);case"put":if(a.fire===sM&&s.fire===sM)break;return i._promise("readwrite",()=>l(e),!0);case"delete":if(o.fire===sM)break;return i._promise("readwrite",()=>l(e),!0);case"deleteRange":if(o.fire===sM)break;return i._promise("readwrite",()=>(function e(t,i,o){return r.query({trans:t,values:!1,query:{index:n,range:i},limit:o}).then(({result:r})=>l({type:"delete",keys:r,trans:t}).then(n=>n.numFailures>0?Promise.reject(n.failures[0]):r.length<o?{failures:[],numFailures:0,lastResult:void 0}:e(t,{...i,lower:r[r.length-1],lowerOpen:!0},o)))})(e.trans,e.range,1e4),!0)}return r.mutate(e);function l(e){var t,i;let l=s8.trans,u=e.keys||("delete"===(t=e).type?t.keys:t.keys||t.values.map(n.extractKey));if(!u)throw Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?{...e,keys:u}:{...e}).type&&(e.values=[...e.values]),e.keys&&(e.keys=[...e.keys]),("add"===(i=e).type?Promise.resolve([]):r.getMany({trans:i.trans,keys:u,cache:"immutable"})).then(t=>{let i=u.map((r,i)=>{let u=t[i],c={onerror:null,onsuccess:null};if("delete"===e.type)o.fire.call(c,r,u,l);else if("add"===e.type||void 0===u){let t=a.fire.call(c,r,e.values[i],l);null==r&&null!=t&&(r=t,e.keys[i]=r,n.outbound||si(e.values[i],n.keyPath,r))}else{let t=uF(u,e.values[i]),n=s.fire.call(c,t,r,u,l);if(n){let t=e.values[i];Object.keys(n).forEach(e=>{a0(t,e)?t[e]=n[e]:si(t,e,n[e])})}}return c});return r.mutate(e).then(({failures:r,results:n,numFailures:o,lastResult:a})=>{for(let o=0;o<u.length;++o){let a=n?n[o]:u[o],s=i[o];null==a?s.onerror&&s.onerror(r[o]):s.onsuccess&&s.onsuccess("put"===e.type&&t[o]?e.values[o]:a)}return{failures:r,results:n,numFailures:o,lastResult:a}}).catch(e=>(i.forEach(t=>t.onerror&&t.onerror(e)),Promise.reject(e)))})}}}}})};function uV(e,t,r){try{if(!t||t.keys.length<e.length)return null;let n=[];for(let i=0,o=0;i<t.keys.length&&o<e.length;++i)0===l6(t.keys[i],e[o])&&(n.push(r?sd(t.values[i]):t.values[i]),++o);return n.length===e.length?n:null}catch(e){return null}}let uU={stack:"dbcore",level:-1,create:e=>({table:t=>{let r=e.table(t);return{...r,getMany:e=>{if(!e.cache)return r.getMany(e);let t=uV(e.keys,e.trans._cache,"clone"===e.cache);return t?lt.resolve(t):r.getMany(e).then(t=>(e.trans._cache={keys:e.keys,values:"clone"===e.cache?sd(t):t},t))},mutate:e=>("add"!==e.type&&(e.trans._cache=null),r.mutate(e))}}})};function uW(e){return!("from"in e)}let uK=function(e,t){if(!this){let t=new uK;return e&&"d"in e&&aJ(t,e),t}aJ(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function uH(e,t,r){let n=l6(t,r);if(isNaN(n))return;if(n>0)throw RangeError();if(uW(e))return aJ(e,{from:t,to:r,d:1});let i=e.l,o=e.r;if(0>l6(r,e.from))return i?uH(i,t,r):e.l={from:t,to:r,d:1,l:null,r:null},uq(e);if(l6(t,e.to)>0)return o?uH(o,t,r):e.r={from:t,to:r,d:1,l:null,r:null},uq(e);0>l6(t,e.from)&&(e.from=t,e.l=null,e.d=o?o.d+1:1),l6(r,e.to)>0&&(e.to=r,e.r=null,e.d=e.l?e.l.d+1:1);let a=!e.r;i&&!e.l&&uz(e,i),o&&a&&uz(e,o)}function uz(e,t){uW(t)||function e(t,{from:r,to:n,l:i,r:o}){uH(t,r,n),i&&e(t,i),o&&e(t,o)}(e,t)}function uG(e){let t=uW(e)?null:{s:0,n:e};return{next(e){let r=arguments.length>0;for(;t;)switch(t.s){case 0:if(t.s=1,r)for(;t.n.l&&0>l6(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,!r||0>=l6(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 uq(e){var t,r;let n=((null==(t=e.r)?void 0:t.d)||0)-((null==(r=e.l)?void 0:r.d)||0),i=n>1?"r":n<-1?"l":"";if(i){let t="r"===i?"l":"r",r={...e},n=e[i];e.from=n.from,e.to=n.to,e[i]=n[i],r[i]=n[t],e[t]=r,r.d=uY(r)}e.d=uY(e)}function uY({r:e,l:t}){return(e?t?Math.max(e.d,t.d):e.d:t?t.d:0)+1}a1(uK.prototype,{add(e){return uz(this,e),this},addKey(e){return uH(this,e,e),this},addKeys(e){return e.forEach(e=>uH(this,e,e)),this},[sh](){return uG(this)}});let uZ={stack:"dbcore",level:0,create:e=>{let t=e.schema.name,r=new uK(e.MIN_KEY,e.MAX_KEY);return{...e,table:n=>{let i=e.table(n),{schema:o}=i,{primaryKey:a}=o,{extractKey:s,outbound:l}=a,u={...i,mutate:e=>{let a=e.trans,s=a.mutatedParts||(a.mutatedParts={}),l=e=>{let r=`idb://${t}/${n}/${e}`;return s[r]||(s[r]=new uK)},u=l(""),c=l(":dels"),{type:d}=e,[p,f]="deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[],h=e.trans._cache;return i.mutate(e).then(e=>{if(aZ(p)){"delete"!==d&&(p=e.results),u.addKeys(p);let t=uV(p,h);t||"add"===d||c.addKeys(p),(t||f)&&o.indexes.forEach(function(e){let r=l(e.name||"");function n(t){return null!=t?e.extractKey(t):null}let i=t=>e.multiEntry&&aZ(t)?t.forEach(e=>r.addKey(e)):r.addKey(t);(t||f).forEach((e,r)=>{let o=t&&n(t[r]),a=f&&n(f[r]);0!==l6(o,a)&&(null!=o&&i(o),null!=a&&i(a))})})}else if(p){let e={from:p.lower,to:p.upper};c.add(e),u.add(e)}else u.add(r),c.add(r),o.indexes.forEach(e=>l(e.name).add(r));return e})}},c=({query:{index:t,range:r}})=>{var n,i;return[t,new uK(null!=(n=r.lower)?n:e.MIN_KEY,null!=(i=r.upper)?i:e.MAX_KEY)]},d={get:e=>[a,new uK(e.key)],getMany:e=>[a,(new uK).addKeys(e.keys)],count:c,query:c,openCursor:c};return aY(d).forEach(e=>{u[e]=function(o){let{subscr:a}=s8;if(a){let u=e=>{let r=`idb://${t}/${n}/${e}`;return a[r]||(a[r]=new uK)},c=u(""),p=u(":dels"),[f,h]=d[e](o);if(u(f.name||"").add(h),!f.isPrimaryKey){if("count"!==e){let t="query"===e&&l&&o.values&&i.query({...o,values:!1});return i[e].apply(this,arguments).then(r=>{if("query"===e){if(l&&o.values)return t.then(({result:e})=>(c.addKeys(e),r));let e=o.values?r.result.map(s):r.result;o.values?c.addKeys(e):p.addKeys(e)}else if("openCursor"===e){let e=o.values;return r&&Object.create(r,{key:{get:()=>(p.addKey(r.primaryKey),r.key)},primaryKey:{get(){let e=r.primaryKey;return p.addKey(e),e}},value:{get:()=>(e&&c.addKey(r.primaryKey),r.value)}})}return r})}p.add(r)}}return i[e].apply(this,arguments)}}),u}}}};class uJ{constructor(e,t){var r;this._middlewares={},this.verno=0;const n=uJ.dependencies;this._options=t={addons:uJ.addons,autoOpen:!0,indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange,...t},this._deps={indexedDB:t.indexedDB,IDBKeyRange:t.IDBKeyRange};const{addons:i}=t;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;const o={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:sM,dbReadyPromise:null,cancelOpen:sM,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};o.dbReadyPromise=new lt(e=>{o.dbReadyResolve=e}),o.openCanceller=new lt((e,t)=>{o.cancelOpen=t}),this._state=o,this.name=e,this.on=lZ(this,"populate","blocked","versionchange","close",{ready:[sW,sM]}),this.on.ready.subscribe=a7(this.on.ready.subscribe,e=>(t,r)=>{uJ.vip(()=>{let n=this._state;if(n.openComplete)n.dbOpenError||lt.resolve().then(t),r&&e(t);else if(n.onReadyBeingFired)n.onReadyBeingFired.push(t),r&&e(t);else{e(t);let n=this;r||e(function e(){n.on.ready.unsubscribe(t),n.on.ready.unsubscribe(e)})}})}),this.Collection=(r=this,lJ(l9.prototype,function(e,t){this.db=r;let n=lG,i=null;if(t)try{n=t()}catch(e){i=e}let o=e._ctx,a=o.table,s=a.hook.reading.fire;this._ctx={table:a,index:o.index,isPrimKey:!o.index||a.schema.primKey.keyPath&&o.index===a.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:i,or:o.or,valueMapper:s!==sI?s:null}})),this.Table=function(e){return lJ(lY.prototype,function(t,r,n){this.db=e,this._tx=n,this.name=t,this.schema=r,this.hook=e._allTables[t]?e._allTables[t].hook:lZ(null,{creating:[sF,sM],reading:[s$,sI],updating:[sV,sM],deleting:[sB,sM]})})}(this),this.Transaction=function(e){return lJ(uf.prototype,function(t,r,n,i,o){this.db=e,this.mode=t,this.storeNames=r,this.schema=n,this.chromeTransactionDurability=i,this.idbtrans=null,this.on=lZ(this,"complete","error","abort"),this.parent=o||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new lt((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(),lN(e)})})}(this),this.Version=function(e){return lJ(uT.prototype,function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})}(this),this.WhereClause=function(e){return lJ(us.prototype,function(t,r,n){this.db=e,this._ctx={table:t,index:":id"===r?null:r,or:n};let i=e._deps.indexedDB;if(!i)throw new sR.MissingAPI;this._cmp=this._ascending=i.cmp.bind(i),this._descending=(e,t)=>i.cmp(t,e),this._max=(e,t)=>i.cmp(e,t)>0?e:t,this._min=(e,t)=>0>i.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=ug(t.IDBKeyRange),this._createTransaction=(e,t,r,n)=>new this.Transaction(e,t,r,this._options.chromeTransactionDurability,n),this._fireOnBlocked=e=>{this.on("blocked").fire(e),lB.filter(e=>e.name===this.name&&e!==this&&!e._state.vcFired).map(t=>t.on("versionchange").fire(e))},this.use(uL),this.use(uB),this.use(uZ),this.use(uU),this.vip=Object.create(this,{_vip:{value:!0}}),i.forEach(e=>e(this))}version(e){if(isNaN(e)||e<.1)throw new sR.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new sR.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);let t=this._versions;var r=t.filter(t=>t._cfg.version===e)[0];return r||(r=new this.Version(e),t.push(r),t.sort(uD),r.stores({}),this._state.autoSchema=!1,r)}_whenReady(e){return this.idbdb&&(this._state.openComplete||s8.letThrough||this._vip)?e():new lt((e,t)=>{if(this._state.openComplete)return t(new sR.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void t(new sR.DatabaseClosed);this.open().catch(sM)}this._state.dbReadyPromise.then(e,t)}).then(e)}use({stack:e,create:t,level:r,name:n}){n&&this.unuse({stack:e,name:n});let i=this._middlewares[e]||(this._middlewares[e]=[]);return i.push({stack:e,create:t,level:null==r?10:r,name:n}),i.sort((e,t)=>e.level-t.level),this}unuse({stack:e,name:t,create:r}){return e&&this._middlewares[e]&&(this._middlewares[e]=this._middlewares[e].filter(e=>r?e.create!==r:!!t&&e.name!==t)),this}open(){return function(e){var t;let r=e._state,{indexedDB:n}=e._deps;if(r.isBeingOpened||e.idbdb)return r.dbReadyPromise.then(()=>r.dbOpenError?lN(r.dbOpenError):e);sv&&(r.openCanceller._stackHolder=sx()),r.isBeingOpened=!0,r.dbOpenError=null,r.openComplete=!1;let i=r.openCanceller;function o(){if(r.openCanceller!==i)throw new sR.DatabaseClosed("db.open() was cancelled")}let a=r.dbReadyResolve,s=null,l=!1;return lt.race([i,("u"<typeof navigator?lt.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(e){var r=function(){return indexedDB.databases().finally(e)};t=setInterval(r,100),r()}).finally(function(){return clearInterval(t)}):Promise.resolve()).then(()=>new lt((t,i)=>{if(o(),!n)throw new sR.MissingAPI;let a=e.name,u=r.autoSchema?n.open(a):n.open(a,Math.round(10*e.verno));if(!u)throw new sR.MissingAPI;u.onerror=ul(i),u.onblocked=lh(e._fireOnBlocked),u.onupgradeneeded=lh(t=>{if(s=u.transaction,r.autoSchema&&!e._options.allowEmptyDB){u.onerror=uu,s.abort(),u.result.close();let e=n.deleteDatabase(a);e.onsuccess=e.onerror=lh(()=>{i(new sR.NoSuchDatabase(`Database ${a} doesnt exist`))})}else{let r,n,a,p;s.onerror=ul(i);var o,c,d=t.oldVersion>0x4000000000000000?0:t.oldVersion;l=d<1,e._novip.idbdb=u.result,o=d/10,c=s,r=e._dbSchema,(n=e._createTransaction("readwrite",e._storeNames,r)).create(c),n._completion.catch(i),a=n._reject.bind(n),p=s8.transless||s8,l_(()=>{s8.trans=n,s8.transless=p,0===o?(aY(r).forEach(e=>{uP(c,e,r[e].primKey,r[e].indexes)}),ux(e,c),lt.follow(()=>e.on.populate.fire(n)).catch(a)):(function({_novip:e},t,r,n){let i=[],o=e._versions,a=e._dbSchema=uk(e,e.idbdb,n),s=!1;return o.filter(e=>e._cfg.version>=t).forEach(o=>{i.push(()=>{let i=a,l=o._cfg.dbschema;uj(e,i,n),uj(e,l,n),a=e._dbSchema=l;let u=uO(i,l);u.add.forEach(e=>{uP(n,e[0],e[1].primKey,e[1].indexes)}),u.change.forEach(e=>{if(e.recreate)throw new sR.Upgrade("Not yet support for changing primary key");{let t=n.objectStore(e.name);e.add.forEach(e=>uC(t,e)),e.change.forEach(e=>{t.deleteIndex(e.name),uC(t,e)}),e.del.forEach(e=>t.deleteIndex(e))}});let c=o._cfg.contentUpgrade;if(c&&o._cfg.version>t){let t;ux(e,n),r._memoizedTables={},s=!0;let o=so(l);u.del.forEach(e=>{o[e]=i[e]}),uS(e,[e.Transaction.prototype]),uE(e,[e.Transaction.prototype],aY(o),o),r.schema=o;let a=sb(c);a&&lx();let d=lt.follow(()=>{if((t=c(r))&&a){var e=lE.bind(null,null);t.then(e,e)}});return t&&"function"==typeof t.then?lt.resolve(t):d.then(()=>t)}}),i.push(t=>{var n;s&&lV||(n=o._cfg.dbschema,[].slice.call(t.db.objectStoreNames).forEach(e=>null==n[e]&&t.db.deleteObjectStore(e))),uS(e,[e.Transaction.prototype]),uE(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),r.schema=e._dbSchema})}),(function e(){return i.length?lt.resolve(i.shift()(r.idbtrans)).then(e):lt.resolve()})().then(()=>{var e;aY(e=a).forEach(t=>{n.db.objectStoreNames.contains(t)||uP(n,t,e[t].primKey,e[t].indexes)})})})(e,o,n,c).catch(a)})}},i),u.onsuccess=lh(()=>{s=null;let n=e._novip.idbdb=u.result,i=a9(n.objectStoreNames);if(i.length>0)try{let t,o=n.transaction(1===i.length?i[0]:i,"readonly");r.autoSchema?function({_novip:e},t,r){e.verno=t.version/10;let n=e._dbSchema=uk(0,t,r);e._storeNames=a9(t.objectStoreNames,0),uE(e,[e._allTables],aY(n),n)}(e,n,o):(uj(e,e._dbSchema,o),((t=uO(uk(0,e.idbdb,o),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.")),ux(e,o)}catch(e){}lB.push(e),n.onversionchange=lh(t=>{r.vcFired=!0,e.on("versionchange").fire(t)}),n.onclose=lh(t=>{e.on("close").fire(t)}),l&&function({indexedDB:e,IDBKeyRange:t},r){uA(e)||r===lW||uR(e,t).put({name:r}).catch(sM)}(e._deps,a),t()},i)}))]).then(()=>(o(),r.onReadyBeingFired=[],lt.resolve(uN(()=>e.on.ready.fire(e.vip))).then(function t(){if(r.onReadyBeingFired.length>0){let n=r.onReadyBeingFired.reduce(sW,sM);return r.onReadyBeingFired=[],lt.resolve(uN(()=>n(e.vip))).then(t)}}))).finally(()=>{r.onReadyBeingFired=null,r.isBeingOpened=!1}).then(()=>e).catch(t=>{r.dbOpenError=t;try{s&&s.abort()}catch(e){}return i===r.openCanceller&&e._close(),lN(t)}).finally(()=>{r.openComplete=!0,a()})}(this)}_close(){let e=this._state,t=lB.indexOf(this);if(t>=0&&lB.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new lt(t=>{e.dbReadyResolve=t}),e.openCanceller=new lt((t,r)=>{e.cancelOpen=r})}close(){this._close();let e=this._state;this._options.autoOpen=!1,e.dbOpenError=new sR.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)}delete(){let e=arguments.length>0,t=this._state;return new lt((r,n)=>{let i=()=>{this.close();var e=this._deps.indexedDB.deleteDatabase(this.name);e.onsuccess=lh(()=>{!function({indexedDB:e,IDBKeyRange:t},r){uA(e)||r===lW||uR(e,t).delete(r).catch(sM)}(this._deps,this.name),r()}),e.onerror=ul(n),e.onblocked=this._fireOnBlocked};if(e)throw new sR.InvalidArgument("Arguments not allowed in db.delete()");t.isBeingOpened?t.dbReadyPromise.then(i):i()})}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 aY(this._allTables).map(e=>this._allTables[e])}transaction(){let e=uI.apply(this,arguments);return this._transaction.apply(this,e)}_transaction(e,t,r){let n,i,o=s8.trans;o&&o.db===this&&-1===e.indexOf("!")||(o=null);let a=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(i=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||e===lK)n=lK;else{if("rw"!=e&&e!=lH)throw new sR.InvalidArgument("Invalid transaction mode: "+e);n=lH}if(o){if(o.mode===lK&&n===lH){if(!a)throw new sR.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");o=null}o&&i.forEach(e=>{if(o&&-1===o.storeNames.indexOf(e)){if(!a)throw new sR.SubTransaction("Table "+e+" not included in parent transaction.");o=null}}),a&&o&&!o.active&&(o=null)}}catch(e){return o?o._promise(null,(t,r)=>{r(e)}):lN(e)}let s=(function e(t,r,n,i,o){return lt.resolve().then(()=>{let a,s=s8.transless||s8,l=t._createTransaction(r,n,t._dbSchema,i);if(i)l.idbtrans=i.idbtrans;else try{l.create(),t._state.PR1398_maxLoop=3}catch(i){return i.name===sT.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then(()=>e(t,r,n,null,o))):lN(i)}let u=sb(o);u&&lx();let c=lt.follow(()=>{if(a=o.call(l,l))if(u){var e=lE.bind(null,null);a.then(e,e)}else"function"==typeof a.next&&"function"==typeof a.throw&&(a=uM(a))},{trans:l,transless:s});return(a&&"function"==typeof a.then?lt.resolve(a).then(e=>l.active?e:lN(new sR.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))):c.then(()=>a)).then(e=>(i&&l._resolve(),l._completion.then(()=>e))).catch(e=>(l._reject(e),lN(e)))})}).bind(null,this,n,i,o,r);return o?o._promise(n,s,"lock"):s8.trans?lk(s8.transless,()=>this._whenReady(s)):this._whenReady(s)}table(e){if(!a0(this._allTables,e))throw new sR.InvalidTable(`Table ${e} does not exist`);return this._allTables[e]}}let uX="u">typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";class uQ{constructor(e){this._subscribe=e}subscribe(e,t,r){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:r})}[uX](){return this}}function u0(e,t){return aY(t).forEach(r=>{uz(e[r]||(e[r]=new uK),t[r])}),e}try{o={indexedDB:aq.indexedDB||aq.mozIndexedDB||aq.webkitIndexedDB||aq.msIndexedDB,IDBKeyRange:aq.IDBKeyRange||aq.webkitIDBKeyRange}}catch(e){o={indexedDB:null,IDBKeyRange:null}}function u1(e){let t=u3;try{u3=!0,up.storagemutated.fire(e)}finally{u3=t}}a1(uJ,{...sN,delete:e=>new uJ(e,{addons:[]}).delete(),exists:e=>new uJ(e,{addons:[]}).open().then(e=>(e.close(),!0)).catch("NoSuchDatabaseError",()=>!1),getDatabaseNames(e){try{return(function({indexedDB:e,IDBKeyRange:t}){return uA(e)?Promise.resolve(e.databases()).then(e=>e.map(e=>e.name).filter(e=>e!==lW)):uR(e,t).toCollection().primaryKeys()})(uJ.dependencies).then(e)}catch(e){return lN(new sR.MissingAPI)}},defineClass:()=>function(e){aJ(this,e)},ignoreTransaction:e=>s8.trans?lk(s8.transless,e):e(),vip:uN,async:function(e){return function(){try{var t=uM(e.apply(this,arguments));return t&&"function"==typeof t.then?t:lt.resolve(t)}catch(e){return lN(e)}}},spawn:function(e,t,r){try{var n=uM(e.apply(r,t||[]));return n&&"function"==typeof n.then?n:lt.resolve(n)}catch(e){return lN(e)}},currentTransaction:{get:()=>s8.trans||null},waitFor:function(e,t){let r=lt.resolve("function"==typeof e?uJ.ignoreTransaction(e):e).timeout(t||6e4);return s8.trans?s8.trans.waitFor(r):r},Promise:lt,debug:{get:()=>sv,set:e=>{sv=e,sw="dexie"===e?()=>!0:lU}},derive:a2,extend:aJ,props:a1,override:a7,Events:lZ,on:up,liveQuery:function(e){let t,r=!1,n=new uQ(n=>{let i=sb(e),o=!1,a={},s={},l={get closed(){return o},unsubscribe:()=>{o=!0,up.storagemutated.unsubscribe(p)}};n.start&&n.start(l);let u=!1,c=!1;function d(){return aY(s).some(e=>a[e]&&function(e,t){let r=uG(t),n=r.next();if(n.done)return!1;let i=n.value,o=uG(e),a=o.next(i.from),s=a.value;for(;!n.done&&!a.done;){if(0>=l6(s.from,i.to)&&l6(s.to,i.from)>=0)return!0;0>l6(i.from,s.from)?i=(n=r.next(s.from)).value:s=(a=o.next(i.from)).value}return!1}(a[e],s[e]))}let p=e=>{u0(a,e),d()&&f()},f=()=>{let h,m;if(u||o)return;a={};let y={},g=(i&&lx(),h=()=>l_(e,{subscr:y,trans:null}),m=s8.trans?lk(s8.transless,h):h(),i&&m.then(lE,lE),m);c||(up(uc,p),c=!0),u=!0,Promise.resolve(g).then(e=>{r=!0,t=e,u=!1,o||(d()?f():(a={},s=y,n.next&&n.next(e)))},e=>{u=!1,r=!1,n.error&&n.error(e),l.unsubscribe()})};return f(),l});return n.hasValue=()=>r,n.getValue=()=>t,n},extendObservabilitySet:u0,getByKeyPath:sn,setByKeyPath:si,delByKeyPath:function(e,t){"string"==typeof t?si(e,t,void 0):"length"in t&&[].map.call(t,function(t){si(e,t,void 0)})},shallowClone:so,deepClone:sd,getObjectDiff:uF,cmp:l6,asap:st,minKey:l$,addons:[],connections:lB,errnames:sT,dependencies:o,semVer:lM,version:lM.split(".").map(e=>parseInt(e)).reduce((e,t,r)=>e+t/Math.pow(10,2*r))}),uJ.maxKey=ug(uJ.dependencies.IDBKeyRange),"u">typeof dispatchEvent&&"u">typeof addEventListener&&(up(uc,e=>{if(!u3){let t;lV?(t=document.createEvent("CustomEvent")).initCustomEvent(ud,!0,!0,e):t=new CustomEvent(ud,{detail:e}),u3=!0,dispatchEvent(t),u3=!1}}),addEventListener(ud,({detail:e})=>{u3||u1(e)}));let u3=!1;if("u">typeof BroadcastChannel){let e=new BroadcastChannel(ud);"function"==typeof e.unref&&e.unref(),up(uc,t=>{u3||e.postMessage(t)}),e.onmessage=e=>{e.data&&u1(e.data)}}else if("u">typeof self&&"u">typeof navigator){up(uc,e=>{try{u3||("u">typeof localStorage&&localStorage.setItem(ud,JSON.stringify({trig:Math.random(),changedParts:e})),"object"==typeof self.clients&&[...self.clients.matchAll({includeUncontrolled:!0})].forEach(t=>t.postMessage({type:ud,changedParts:e})))}catch(e){}}),"u">typeof addEventListener&&addEventListener("storage",e=>{if(e.key===ud){let t=JSON.parse(e.newValue);t&&u1(t.changedParts)}});let e=self.document&&navigator.serviceWorker;e&&e.addEventListener("message",function({data:e}){e&&e.type===ud&&u1(e.changedParts)})}function u4(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}lt.rejectionMapper=function(e,t){if(!e||e instanceof sP||e instanceof TypeError||e instanceof SyntaxError||!e.name||!sA[e.name])return e;var r=new sA[e.name](t||e.message,e);return"stack"in e&&a4(r,"stack",{get:function(){return this.inner.stack}}),r},sw=lU;class u2 extends uJ{constructor(){super("EsmOffline"),u4(this,"syncQueue",void 0),u4(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 u6(){return new u2}let u5=new u2,u8={},u9=Y("offline-synchronization",{});function u7(){return u9}async function ce(){if(u9.getState().synchronization)return;let e=await u5.syncQueue.count(),t={},r=Object.entries(u8),n=r.length,i={},o=new AbortController,a=()=>{let e=u9.getState().synchronization;u9.setState({synchronization:{...e,pendingCount:e.pendingCount-1}})};try{u9.setState({synchronization:{totalCount:e,pendingCount:e,abortController:o}});for(let e=0;e<n&&r.length>0;e++)for(let e=r.length;e--;){let[n,s]=r[e],l=s.dependsOn.map(e=>t[e]);l.every(Boolean)&&(i[n]={},await Promise.all(l),t[n]=ct(s,i,o,a),r.splice(e,1))}await Promise.allSettled(Object.values(t))}finally{u9.setState({synchronization:void 0})}}async function ct({type:e,dependsOn:t,process:r},n,i,o){let a=[],s=[],l=await cr();await u5.syncQueue.where({type:e,userId:l}).each((e,t)=>{a.push([t.primaryKey,e.content,e.descriptor]),s.push(e.content)});for(let u=0;u<a.length;u++){let[c,d,{id:p,dependencies:f=[]}]=a[u];try{let o=await r(d,{abort:i,index:u,items:s,userId:l,dependencies:f.map(({id:e,type:r})=>t.includes(r)?n[r][e]:void 0)});void 0!==p&&(n[e][p]=o),await u5.syncQueue.delete(c)}catch(e){await u5.syncQueue.update(c,{lastError:{name:e?.name,message:e?.message??e?.toString()}})}finally{o()}}}async function cr(){let e=await oD();return e?.uuid||"*"}async function cn(e,t,r,n){let i=n&&n.id;return void 0!==i&&await u5.syncQueue.where({type:t,userId:e}).filter(e=>e?.descriptor.id===i).delete().catch(uJ.errnames.DatabaseClosed),await u5.syncQueue.add({type:t,content:r,userId:e,descriptor:n||{},createdOn:new Date}).catch(uJ.errnames.DatabaseClosed,()=>-1)}async function ci(e,t,r){let n=await cr();return await cn(n,e,t,r)}async function co(e,t){return(await ca(e,t)).map(e=>e.content)}async function ca(e,t){return await u5.syncQueue.where(t?{type:t,userId:e}:{userId:e}).toArray().catch(uJ.errnames.DatabaseClosed,()=>[])}async function cs(e){let t=await cr();return await co(t,e)}async function cl(e){let t=await cr();return await ca(t,e)}async function cu(e){return await u5.syncQueue.get(e).catch(uJ.errnames.DatabaseClosed,()=>void 0)}function cc(e){return!!u8[e]?.options.onBeginEditSyncItem}async function cd(e){let t=await cu(e);if(!t)throw Error(`No sync item with the ID ${e} exists.`);let r=u8[t.type]?.options.onBeginEditSyncItem;if(!r)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.`);r(t)}async function cp(e){await u5.syncQueue.delete(e).catch(uJ.errnames.DatabaseClosed)}function cf(e,t,r,n={}){u8[e]={type:e,dependsOn:t,process:r,options:n}}let ch="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),cm=new Uint8Array(16),cy=[];for(let e=0;e<256;++e)cy.push((e+256).toString(16).slice(1));let cg=function(e,t,r){if(ch&&!t&&!e)return ch();let n=(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(cm)})();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return function(e,t=0){return cy[e[t+0]]+cy[e[t+1]]+cy[e[t+2]]+cy[e[t+3]]+"-"+cy[e[t+4]]+cy[e[t+5]]+"-"+cy[e[t+6]]+cy[e[t+7]]+"-"+cy[e[t+8]]+cy[e[t+9]]+"-"+cy[e[t+10]]+cy[e[t+11]]+cy[e[t+12]]+cy[e[t+13]]+cy[e[t+14]]+cy[e[t+15]]}(n)},cb="OFFLINE+";function cv(){return cb+cg()}function cw(e){return e.startsWith(cb)}let c_={};function cx(){return Object.values(c_)}function cE(e){c_[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.`),c_[e.id]=e}async function cS(e){let t=await cR();return await cD(t,e)}async function cD(e,t){let r=new u2;return await r.dynamicOfflineData.where(t?{type:t,users:e}:{users:e}).toArray().catch(uJ.errnames.DatabaseClosed,()=>[])}async function cO(e,t){let r=await cR();return await cP(r,e,t)}async function cP(e,t,r){let n=new u2,i=await n.dynamicOfflineData.get({type:t,identifier:r}).catch(uJ.errnames.DatabaseClosed,()=>void 0);i?i.users.includes(e)||await n.dynamicOfflineData.update(i.id,{users:[...i.users,e]}).catch(uJ.errnames.DatabaseClosed):await n.dynamicOfflineData.add({users:[e],type:t,identifier:r}).catch(uJ.errnames.DatabaseClosed)}async function cC(e,t){let r=await cR();return await ck(r,e,t)}async function ck(e,t,r){let n=new u2,i=await n.dynamicOfflineData.get({type:t,identifier:r,users:e}).catch(uJ.errnames.DatabaseClosed,()=>void 0);i&&(i.users.length>1?await n.dynamicOfflineData.update(i.id,{users:i.users.filter(t=>t!==e)}).catch(uJ.errnames.DatabaseClosed):await n.dynamicOfflineData.delete(i.id).catch(uJ.errnames.DatabaseClosed))}async function cj(e,t){let r=await cS(e);await Promise.all(r.map(async e=>cT(e.type,e.identifier,t)))}async function cT(e,t,r){await cO(e,t);let n=new u2,i=await cR(),o=await n.dynamicOfflineData.get({type:e,identifier:t}).catch(uJ.errnames.DatabaseClosed,()=>void 0),a=cx().filter(t=>t.type===e);if(!o)return;let s=await Promise.all(a.map(async e=>{try{return e.sync(t,r),{id:e.id,error:void 0}}catch(r){let t=r.message?.toString()??r.toString();return{id:e.id,error:t}}})),l=s.filter(e=>!e.error).map(e=>e.id),u=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:i,succeededHandlers:l,erroredHandlers:u,errors:c};o.id&&await n.dynamicOfflineData.update(o.id,{syncState:d}).catch(uJ.errnames.DatabaseClosed)}async function cR(){let e=(await oD()).uuid;if(!e)throw Error("Using the dynamic offline data API requires a logged in user.");return e}let cA=Y("offline-patients",{offlinePatientDataSyncState:{},handlers:{}});function cN(){return c$(),cA}function cM(e,t){c$(),cE({type:"patient",displayName:t.displayName,id:e,isSynced:()=>Promise.resolve(!0),sync:(e,r)=>t.onOfflinePatientAdded({patientUuid:e,signal:r??new AbortController().signal})})}async function cI(e){c$(),await cT("patient",e)}function c$(){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.")}async function cL(e,t,r=!0){if(e){let n=null,[i,o]=await Promise.all([oh(`${od}/Patient/${e}`,t).catch(e=>n=e),r?cF(e):Promise.resolve(null)]);if(i.ok)return i.data;if(o)return o;if(n)throw n}return null}async function cF(e){let t=(await cs("patient-registration")).find(t=>t.fhirPatient.id===e);return t?.fhirPatient??null}function cB(e,t){let r=new CustomEvent(`openmrs:${e}`,{detail:t??void 0,cancelable:!0,bubbles:!0});return window.dispatchEvent(r)}function cV(e,t){let r=e=>{t("detail"in e&&null!==e.detail?e.detail:void 0)};return window.addEventListener(`openmrs:${e}`,r),()=>{window.removeEventListener(`openmrs:${e}`,r)}}var cU=r(6170);function cW(e){return{uuid:e.uuid,display:e.display}}function cK(e=null,t=null){let r=new URLSearchParams;e&&r.set("tag",e),t&&r.set("q",t);let n=r.toString();return om(`${oc}/location${n?"?"+n:""}`).pipe((0,cU.map)(e=>e.data.results.map(cW))).pipe((0,cU.take)(1))}function cH(e){return{uuid:e.uuid,display:e.display,name:e.name}}function cz(){return om(`${oc}/visittype`).pipe((0,cU.map)(e=>e.data.results.map(cH))).pipe((0,cU.take)(1))}var cG=((en={}).NEWVISIT="startVisit",en.EDITVISIT="editVisit",en.LOADING="loadingVisit",en),cq=((ei={}).NOTSTARTED="notStarted",ei.ONGOING="ongoing",ei);let cY="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))",cZ=function(){try{return JSON.parse(sessionStorage.getItem("openmrs:visitStoreState")||"null")}catch(e){return null}}()||{patientUuid:null,manuallySetVisitUuid:null};function cJ(){return J("visit",cZ)}function cX(e,t){cJ().setState({patientUuid:e,manuallySetVisitUuid:t})}function cQ(e,t){return oh(`${oc}/visit`,{signal:t.signal,method:"POST",headers:{"Content-type":"application/json"},body:e})}function c0(e,t,r){return oh(`${oc}/visit/${e}`,{signal:r.signal,method:"POST",headers:{"Content-type":"application/json"},body:t})}function c1(e,t,r){return oh(`${oc}/visit?patient=${e}&v=${r??cY}`,{signal:t.signal,method:"GET",headers:{"Content-type":"application/json"}})}cJ().subscribe(e=>{var t;t=e,sessionStorage.setItem("openmrs:visitStoreState",JSON.stringify(t))});let c3=new es.BehaviorSubject(null);class c4{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+c4.version}static addUnaryOp(e){return c4.max_unop_len=Math.max(e.length,c4.max_unop_len),c4.unary_ops[e]=1,c4}static addBinaryOp(e,t,r){return c4.max_binop_len=Math.max(e.length,c4.max_binop_len),c4.binary_ops[e]=t,r?c4.right_associative.add(e):c4.right_associative.delete(e),c4}static addIdentifierChar(e){return c4.additional_identifier_chars.add(e),c4}static addLiteral(e,t){return c4.literals[e]=t,c4}static removeUnaryOp(e){return delete c4.unary_ops[e],e.length===c4.max_unop_len&&(c4.max_unop_len=c4.getMaxKeyLen(c4.unary_ops)),c4}static removeAllUnaryOps(){return c4.unary_ops={},c4.max_unop_len=0,c4}static removeIdentifierChar(e){return c4.additional_identifier_chars.delete(e),c4}static removeBinaryOp(e){return delete c4.binary_ops[e],e.length===c4.max_binop_len&&(c4.max_binop_len=c4.getMaxKeyLen(c4.binary_ops)),c4.right_associative.delete(e),c4}static removeAllBinaryOps(){return c4.binary_ops={},c4.max_binop_len=0,c4}static removeLiteral(e){return delete c4.literals[e],c4}static removeAllLiterals(){return c4.literals={},c4}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 c4(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 c4.binary_ops[e]||0}static isIdentifierStart(e){return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!c4.binary_ops[String.fromCharCode(e)]||c4.additional_identifier_chars.has(String.fromCharCode(e))}static isIdentifierPart(e){return c4.isIdentifierStart(e)||c4.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(c4.hooks[e]){let r={context:this,node:t};return c4.hooks.run(e,r),r.node}return t}searchHook(e){if(c4.hooks[e]){let t={context:this};return c4.hooks[e].find(function(e){return e.call(t.context,t),t.node}),t.node}}gobbleSpaces(){let e=this.code;for(;e===c4.SPACE_CODE||e===c4.TAB_CODE||e===c4.LF_CODE||e===c4.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:c4.COMPOUND,body:e};return this.runHook("after-all",t)}gobbleExpressions(e){let t=[],r,n;for(;this.index<this.expr.length;)if((r=this.code)===c4.SEMCOL_CODE||r===c4.COMMA_CODE)this.index++;else if(n=this.gobbleExpression())t.push(n);else if(this.index<this.expr.length){if(r===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,c4.max_binop_len),t=e.length;for(;t>0;){if(c4.binary_ops.hasOwnProperty(e)&&(!c4.isIdentifierStart(this.code)||this.index+e.length<this.expr.length&&!c4.isIdentifierPart(this.expr.charCodeAt(this.index+e.length))))return this.index+=t,e;e=e.substr(0,--t)}return!1}gobbleBinaryExpression(){let e,t,r,n,i,o,a,s,l;if(!(o=this.gobbleToken())||!(t=this.gobbleBinaryOp()))return o;for(i={value:t,prec:c4.binaryPrecedence(t),right_a:c4.right_associative.has(t)},(a=this.gobbleToken())||this.throwError("Expected expression after "+t),n=[o,i,a];t=this.gobbleBinaryOp();){if(0===(r=c4.binaryPrecedence(t))){this.index-=t.length;break}i={value:t,prec:r,right_a:c4.right_associative.has(t)},l=t;let s=e=>i.right_a&&e.right_a?r>e.prec:r<=e.prec;for(;n.length>2&&s(n[n.length-2]);)a=n.pop(),t=n.pop().value,o=n.pop(),e={type:c4.BINARY_EXP,operator:t,left:o,right:a},n.push(e);(e=this.gobbleToken())||this.throwError("Expected expression after "+l),n.push(i,e)}for(s=n.length-1,e=n[s];s>1;)e={type:c4.BINARY_EXP,operator:n[s-1].value,left:n[s-2],right:e},s-=2;return e}gobbleToken(){let e,t,r,n;if(this.gobbleSpaces(),n=this.searchHook("gobble-token"))return this.runHook("after-token",n);if(e=this.code,c4.isDecimalDigit(e)||e===c4.PERIOD_CODE)return this.gobbleNumericLiteral();if(e===c4.SQUOTE_CODE||e===c4.DQUOTE_CODE)n=this.gobbleStringLiteral();else if(e===c4.OBRACK_CODE)n=this.gobbleArray();else{for(r=(t=this.expr.substr(this.index,c4.max_unop_len)).length;r>0;){if(c4.unary_ops.hasOwnProperty(t)&&(!c4.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!c4.isIdentifierPart(this.expr.charCodeAt(this.index+t.length)))){this.index+=r;let e=this.gobbleToken();return e||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:c4.UNARY_EXP,operator:t,argument:e,prefix:!0})}t=t.substr(0,--r)}c4.isIdentifierStart(e)?(n=this.gobbleIdentifier(),c4.literals.hasOwnProperty(n.name)?n={type:c4.LITERAL,value:c4.literals[n.name],raw:n.name}:n.name===c4.this_str&&(n={type:c4.THIS_EXP})):e===c4.OPAREN_CODE&&(n=this.gobbleGroup())}return n?(n=this.gobbleTokenProperty(n),this.runHook("after-token",n)):this.runHook("after-token",!1)}gobbleTokenProperty(e){this.gobbleSpaces();let t=this.code;for(;t===c4.PERIOD_CODE||t===c4.OBRACK_CODE||t===c4.OPAREN_CODE||t===c4.QUMARK_CODE;){let r;if(t===c4.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==c4.PERIOD_CODE)break;r=!0,this.index+=2,this.gobbleSpaces(),t=this.code}this.index++,t===c4.OBRACK_CODE?((e={type:c4.MEMBER_EXP,computed:!0,object:e,property:this.gobbleExpression()}).property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),(t=this.code)!==c4.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):t===c4.OPAREN_CODE?e={type:c4.CALL_EXP,arguments:this.gobbleArguments(c4.CPAREN_CODE),callee:e}:(t===c4.PERIOD_CODE||r)&&(r&&this.index--,this.gobbleSpaces(),e={type:c4.MEMBER_EXP,computed:!1,object:e,property:this.gobbleIdentifier()}),r&&(e.optional=!0),this.gobbleSpaces(),t=this.code}return e}gobbleNumericLiteral(){let e="",t,r;for(;c4.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);if(this.code===c4.PERIOD_CODE)for(e+=this.expr.charAt(this.index++);c4.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++));c4.isDecimalDigit(this.code);)e+=this.expr.charAt(this.index++);c4.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+e+this.char+")")}return r=this.code,c4.isIdentifierStart(r)?this.throwError("Variable names cannot start with a number ("+e+this.char+")"):(r===c4.PERIOD_CODE||1===e.length&&e.charCodeAt(0)===c4.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:c4.LITERAL,value:parseFloat(e),raw:e}}gobbleStringLiteral(){let e="",t=this.index,r=this.expr.charAt(this.index++),n=!1;for(;this.index<this.expr.length;){let t=this.expr.charAt(this.index++);if(t===r){n=!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 n||this.throwError('Unclosed quote after "'+e+'"'),{type:c4.LITERAL,value:e,raw:this.expr.substring(t,this.index)}}gobbleIdentifier(){let e=this.code,t=this.index;for(c4.isIdentifierStart(e)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length;)if(e=this.code,c4.isIdentifierPart(e))this.index++;else break;return{type:c4.IDENTIFIER,name:this.expr.slice(t,this.index)}}gobbleArguments(e){let t=[],r=!1,n=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let i=this.code;if(i===e){r=!0,this.index++,e===c4.CPAREN_CODE&&n&&n>=t.length&&this.throwError("Unexpected token "+String.fromCharCode(e));break}if(i===c4.COMMA_CODE){if(this.index++,++n!==t.length){if(e===c4.CPAREN_CODE)this.throwError("Unexpected token ,");else if(e===c4.CBRACK_CODE)for(let e=t.length;e<n;e++)t.push(null)}}else if(t.length!==n&&0!==n)this.throwError("Expected comma");else{let e=this.gobbleExpression();e&&e.type!==c4.COMPOUND||this.throwError("Expected comma"),t.push(e)}}return r||this.throwError("Expected "+String.fromCharCode(e)),t}gobbleGroup(){this.index++;let e=this.gobbleExpressions(c4.CPAREN_CODE);if(this.code===c4.CPAREN_CODE)return(this.index++,1===e.length)?e[0]:!!e.length&&{type:c4.SEQUENCE_EXP,expressions:e};this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:c4.ARRAY_EXP,elements:this.gobbleArguments(c4.CBRACK_CODE)}}}Object.assign(c4,{hooks:new class{add(e,t,r){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][r?"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)})}}(c4),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"}),c4.max_unop_len=c4.getMaxKeyLen(c4.unary_ops),c4.max_binop_len=c4.getMaxKeyLen(c4.binary_ops);let c2=e=>new c4(e).parse(),c6=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(c4).filter(e=>!c6.includes(e)&&void 0===c2[e]).forEach(e=>{c2[e]=c4[e]}),c2.Jsep=c4,c2.plugins.register({name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;let r=t.node,n=this.gobbleExpression();if(n||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let i=this.gobbleExpression();if(i||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:r,consequent:n,alternate:i},r.operator&&e.binary_ops[r.operator]<=.9){let n=r;for(;n.right.operator&&e.binary_ops[n.right.operator]<=.9;)n=n.right;t.node.test=n.right,n.right=t.node,t.node=r}}else this.throwError("Expected :")}})}});let c5="ArrowFunctionExpression",c8={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)}},c9={...c8,Promise};function c7(e,t={}){return da(e,t,du)}async function de(e,t={}){return ds(e,t,du)}function dt(e,t={}){return da(e,t,dc)}function dr(e,t={}){return ds(e,t,dc)}function dn(e,t={}){return da(e,t,dd)}function di(e,t={}){return ds(e,t,dd)}function da(e,t={},r){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 n=dy(t,c8),i=dp("string"==typeof e?c2(e):e,n);if(r(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 ds(e,t={},r){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 n=dy(t,c9);return Promise.resolve(dp("string"==typeof e?c2(e):e,n)).then(t=>{if(r(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 dl(e){return c2(e)}function du(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e||e instanceof Date}function dc(e){return"boolean"==typeof e}function dd(e){return"number"==typeof e}function dp(e,t){switch(e.type){case"UnaryExpression":var r,n,i,o,a,s,l,u,c,d,p,f,h,m=e,y=t;let g=dp(m.argument,y);switch(m.operator){case"+":return+g;case"-":return-g;case"~":return~g;case"!":return!g;default:throw`Expression evaluator does not support operator '${m.operator}''`}case"BinaryExpression":var b=e,v=t;switch(b.operator){case"&&":return dp(b.left,v)&&dp(b.right,v);case"||":return dp(b.left,v)||dp(b.right,v);case"??":return dp(b.left,v)??dp(b.right,v)}let w=dp(b.left,v),x=dp(b.right,v);switch(b.operator){case"+":return w+x;case"-":return w-x;case"*":return w*x;case"/":return w/x;case"%":return w%x;case"**":return w**x;case"==":return w==x;case"===":return w===x;case"!=":return w!=x;case"!==":return w!==x;case">":return w>x;case">=":return w>=x;case"<":return w<x;case"<=":return w<=x;case"in":return w in x;default:throw`Expression evaluator does not support operator '${b.operator}' operator`}case"ConditionalExpression":return r=e,n=t,dp(r.test,n)?dp(r.consequent,n):dp(r.alternate,n);case"CallExpression":return dv(dh(e,t));case"ArrowFunctionExpression":let E;return i=e,o=t,E=i.params?.map(e=>{if("Identifier"===e.type)return e.name;throw`Cannot handle parameter of type ${e.type}`})??[],(function(...e){if(e.length<E.length)throw`Required argument(s) ${E.slice(e.length,-1).join(", ")} were not provided`;let t=Object.fromEntries(E.reduce((t,r,n)=>{let i=e[n];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 r of Object.keys(t))if(!e(t[r]))return!1;return!0}if(Array.isArray(t)){for(let r of t)if(!e(r))break}return!1}(i)&&t.push([r,i]),t},[]));return dp(i.body,o.addVariables(t))}).bind(null);case"MemberExpression":return dv(dm(e,t));case"ArrayExpression":return a=e,s=t,a.elements?.map(dw(s));case"SequenceExpression":let S;return l=e,u=t,(S=l.expressions.map(dw(u)))[S.length-1];case"NewExpression":var D=e,O=t;if(D.callee&&"Identifier"===D.callee.type){let e=D.arguments?.map(dw(O));switch(D.callee.name){case"Date":return new Date(...e);case"RegExp":return new RegExp(...e);default:throw`Cannot instantiate object of type ${D.callee.name}`}}if(D.callee)throw"new must be called with either Date or RegExp";throw'Could not handle "new" without a specified class';case"Literal":return e.value;case"Identifier":return c=e,d=t,(d_(c.name),d.variables&&Object.hasOwn(d.variables,c.name))?d.variables[c.name]:Object.hasOwn(d.globals,c.name)?d.globals[c.name]:void 0;case"TemplateLiteral":let P,C;return p=e,f=t,P=p.expressions?.map(dw(f))??[],(C=p.quasis?.map(dw(f))??[]).filter(e=>!e.tail).map(e=>e.value).join("")+P.join("")+C.filter(e=>e.tail).map(e=>e.value).join("");case"TemplateElement":return{value:(h=e).cooked,tail:h.tail};default:throw`Expression evaluator does not support expression of type '${e.type}'`}}function df(e,t){switch(e.type){case"Literal":return e.value;case"Identifier":return e.name;case"MemberExpression":return df(e.property,t);default:throw`VisitExpressionName does not support expression of type '${e.type}'`}}function dh(e,t){let r=db(e.callee,t);if(r===dg||e.optional&&null==r)return dg;let n=e.arguments?.map(dw(t));if(r){if("function"!=typeof r)throw`${dS(e.callee)} is not a function`}else throw`No function named ${dS(e.callee)} is defined in this context`;return r(...n)}function dm(e,t){let r=db(e.object,t);if(r===dg||e.optional&&null==r)return dg;if(null===r)throw TypeError(`TypeError: cannot read properties of null (reading '${dE(e.property,t)}')`);if(void 0===r)switch(e.object.type){case"Identifier":{let r=df(e.object,t);throw ReferenceError(`ReferenceError: ${r} is not defined`)}case"MemberExpression":throw TypeError(`TypeError: cannot read properties of undefined (reading '${dE(e.property,t)}')`);default:throw`VisitMemberExpression does not support operator '${e.object.type}' type`}if("object"!=typeof r&&"function"!=typeof r&&"string"!=typeof r&&"number"!=typeof r)throw`VisitMemberExpression does not support member access on type ${typeof r}`;let n=e.computed?function(e){if(void 0===e)throw{type:"Illegal property access",message:"No property was supplied to the property access"};if("string"!=typeof e&&"number"!=typeof e)throw{type:"Illegal property access",message:`Cannot use a value of type ${null===e?"null":typeof e} as a property name`};return e}(dp(e.property,t)):function(e){if("Identifier"!==e.type)throw`VisitMemberExpression does not support a property of type '${e.type}'`;return e.name}(e.property);d_(n),function(e,t){if(dx.has(String(t)))return;let r=Object(e);for(;null!==r;){if(Object.hasOwn(r,t)){if(r===Object.prototype||r===Function.prototype)throw{type:"Illegal property access",message:`Cannot access the ${t} property of objects`};return}r=Object.getPrototypeOf(r)}}(r,n);let i=r[n];return"function"==typeof i?i.bind(r):i}function dy(e,t){let r={variables:{...e},globals:{...t},addVariables(e){return this.variables={...this.variables,...e},this}};return r.addVariables.bind(r),r}c2.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 r=this.index;if(this.index++,this.gobbleSpaces(),this.code===e.CPAREN_CODE){this.index++;let e=this.gobbleBinaryOp();if("=>"===e){let r=this.gobbleBinaryExpression();r||this.throwError("Expected expression after "+e),t.node={type:c5,params:null,body:r};return}}this.index=r}}),e.hooks.add("after-expression",function(t){!function t(r){r&&(Object.values(r).forEach(e=>{e&&"object"==typeof e&&t(e)}),"=>"===r.operator&&(r.type=c5,r.params=r.left?[r.left]:null,r.body=r.right,r.params&&r.params[0].type===e.SEQUENCE_EXP&&(r.params=r.params[0].expressions),delete r.left,delete r.right,delete r.operator))}(t.node)})}}),c2.plugins.register({name:"new",init(e){e.addUnaryOp("new"),e.hooks.add("after-token",function(t){let r=t.node;if(r&&"new"===r.operator){r.argument&&[e.CALL_EXP,e.MEMBER_EXP].includes(r.argument.type)||this.throwError("Expected new function()"),t.node=r.argument;let n=t.node;for(;n.type===e.MEMBER_EXP||n.type===e.CALL_EXP&&n.callee.type===e.MEMBER_EXP;)n=n.type===e.MEMBER_EXP?n.object:n.callee.object;n.type="NewExpression"}})}}),c2.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 r(t){let r=this.index,n="",i=()=>{for(;e.isDecimalDigit(this.code)||95===this.code;)95===this.code?this.index++:n+=this.expr.charAt(this.index++)};i(),this.code===e.PERIOD_CODE&&(n+=this.expr.charAt(this.index++),i());let o=this.char;("e"===o||"E"===o)&&(n+=this.expr.charAt(this.index++),("+"===(o=this.char)||"-"===o)&&(n+=this.expr.charAt(this.index++)),i(),e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+n+this.char+")"));let a=this.code;if(e.isIdentifierStart(a))this.throwError("Variable names cannot start with a number ("+n+this.char+")");else if(a===e.PERIOD_CODE){n.length>1&&this.throwError(`Unexpected period ${JSON.stringify({chCode:a,number:n},null,2)}`),this.index=r;return}t.node={type:e.LITERAL,value:parseFloat(n),raw:this.expr.substring(r,this.index)}}e.hooks.add("gobble-token",function(n){if(48===this.code){var i,o,a;let s=this.index,l=this.expr.charAt(this.index+1),u=t.call(this,l);if(!u)return;let c="";for(;i=this.code,o=u,95===i||o.some(([e,t])=>i>=e&&i<=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,r.call(this,n);return}this.throwError("unexpected char within number")}n.node={type:e.LITERAL,value:parseInt(c,"x"===(a=l)||"X"===a?16:"b"===a||"B"===a?2:8),raw:this.expr.substring(s,this.index)}}else(e.isDecimalDigit(this.code)||this.code===e.PERIOD_CODE)&&r.call(this,n)})}}),c2.plugins.register({name:"regex",init(e){e.hooks.add("gobble-token",function(t){if(47===this.code){let r=++this.index,n=!1;for(;this.index<this.expr.length;){if(47===this.code&&!n){let n,i=this.expr.slice(r,this.index),o="";for(;++this.index<this.expr.length;){let e=this.code;if(e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57)o+=this.char;else break}try{n=new RegExp(i,o)}catch(e){this.throwError(e.message)}return t.node={type:e.LITERAL,value:n,raw:this.expr.slice(r-1,this.index)},t.node=this.gobbleTokenProperty(t.node),t.node}this.code===e.OBRACK_CODE?n=!0:n&&this.code===e.CBRACK_CODE&&(n=!1),this.index+=92===this.code?2:1}this.throwError("Unclosed Regex")}})}}),c2.plugins.register({name:"ternary",init(e){e.hooks.add("after-expression",function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;let r=t.node,n=this.gobbleExpression();if(n||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let i=this.gobbleExpression();if(i||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:r,consequent:n,alternate:i},r.operator&&e.binary_ops[r.operator]<=.9){let n=r;for(;n.right.operator&&e.binary_ops[n.right.operator]<=.9;)n=n.right;t.node.test=n.right,n.right=t.node,t.node=r}}else this.throwError("Expected :")}})}}),c2.plugins.register({name:"jsepTemplateLiteral",init(e){function t(e,r=!0){if(96===this.code){let t={type:"TemplateLiteral",quasis:[],expressions:[]},n="",i="",o=!1,a=this.expr.length,s=()=>t.quasis.push({type:"TemplateElement",value:{raw:i,cooked:n},tail:o});for(;this.index<a;){let a=this.expr.charAt(++this.index);if("`"===a)return this.index+=1,o=!0,s(),e.node=t,r&&(e.node=this.gobbleTokenProperty(e.node)),e.node;if("$"===a&&"{"===this.expr.charAt(this.index+1))this.index+=2,s(),i="",n="",t.expressions.push(...this.gobbleExpressions(125)),125!==this.code&&this.throwError("unclosed ${");else if("\\"===a)switch(i+=a,a=this.expr.charAt(++this.index),i+=a,a){case"n":n+="\n";break;case"r":n+="\r";break;case"t":n+=" ";break;case"b":n+="\b";break;case"f":n+="\f";break;case"v":n+="\v";break;default:n+=a}else n+=a,i+=a}this.throwError("Unclosed `")}}e.hooks.add("gobble-token",t),e.hooks.add("after-token",function(r){if((r.node.type===e.IDENTIFIER||r.node.type===e.MEMBER_EXP)&&96===this.code)return r.node={type:"TaggedTemplateExpression",tag:r.node,quasi:t.bind(this)(r,!1)},r.node=this.gobbleTokenProperty(r.node),r.node})}}),c2.addBinaryOp("in",7),c2.addBinaryOp("??",1);let dg=Symbol("optional chain short-circuited");function db(e,t){switch(e.type){case"MemberExpression":return dm(e,t);case"CallExpression":return dh(e,t);default:return dp(e,t)}}function dv(e){return e===dg?void 0:e}function dw(e){return function(t){return null===t?null:dp(t,e)}}function d_(e){if("__proto__"===e||"prototype"===e||"constructor"===e)throw{type:"Illegal property access",message:`Cannot access the ${e} property of objects`}}let dx=new Set(["toString","valueOf","hasOwnProperty"]);function dE(e,t){try{return df(e,t)}catch{return"<computed>"}}function dS(e){return e?"MemberExpression"===e.type?e.property?.name:e.name:null}function dD(e){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.`;let t={globals:{...c9},isLocalExpression:!1,variables:new Set};return dO("string"==typeof e?c2(e):e,t),[...t.variables]}function dO(e,t){switch(e.type){case"UnaryExpression":return n=e,i=t,dO(n.argument,i);case"BinaryExpression":return o=e,a=t,[dO(o.left,a),dO(o.right,a)].filter(Boolean);case"ConditionalExpression":return s=e,l=t,[dO(s.consequent,l),dO(s.test,l),dO(s.alternate,l)].filter(Boolean);case"CallExpression":let r;return u=e,c=t,r=dO(u.callee,c),u.arguments?.map(dP(c)),r;case"ArrowFunctionExpression":var n,i,o,a,s,l,u,c,d,p,f,h,m,y,g,b,v=e,w=t;let x={...w};x.isLocalExpression=!0;let E=v.params?.map(dP(x))??[],S=dO(v.body,x)??[];if(S&&Array.isArray(S))for(let e of S)E.includes(e)||w.variables.add(e);return;case"MemberExpression":var D=e,O=t;if(dO(D.object,O),D.computed)return void dO(D.property,O);let P={...O};P.isLocalExpression=!0,dO(D.property,P);return;case"ArrayExpression":return d=e,p=t,void d.elements?.map(dP(p));case"SequenceExpression":return f=e,h=t,void f.expressions?.map(dP(h));case"NewExpression":return m=e,y=t,void m.arguments?.map(dP(y));case"Literal":case"TemplateElement":return;case"Identifier":var C=e,k=t;if(!(C.name in k.globals))if(k.isLocalExpression)return C.name;else k.variables.add(C.name);return;case"TemplateLiteral":return g=e,b=t,void(g.expressions?.map(dP(b)),g.quasis?.map(dP(b)));default:throw`Expression evaluator does not support expression of type '${e.type}'`}}function dP(e){return function(t){return null===t?null:dO(t,e)}}let dC=J("feature-flags",{flags:function(){let e={};for(let t of Object.keys(localStorage))if(t.startsWith("openmrs:feature-flag:")){let r=t.replace("openmrs:feature-flag:",""),n=JSON.parse(localStorage.getItem(`openmrs:feature-flag-meta:${r}`)||"{}");e[r]={enabled:"true"===localStorage.getItem(t),...n}}return e}()});function dk(e,t,r){dC.setState(n=>({flags:{...n.flags,[e]:{enabled:n.flags[e]?.enabled??!1,label:t,description:r}}}))}function dj(){let e=dC.getState().flags;Object.keys(localStorage).filter(e=>e.startsWith("openmrs:feature-flag:")).forEach(t=>{let r=t.replace("openmrs:feature-flag:","");e[r]||(localStorage.removeItem(t),localStorage.removeItem(`openmrs:feature-flag-meta:${r}`))})}function dT(e){return dC.getState().flags[e].enabled}function dR(e,t){dC.subscribe(r=>{t(r.flags[e].enabled)})}function dA(e,t){dC.setState(r=>({flags:{...r.flags,[e]:{...r.flags[e],enabled:t}}}))}function dN(e){return!window.offlineEnabled||(e??navigator.onLine)}dC.subscribe(e=>{for(let[t,r]of Object.entries(e.flags))localStorage.setItem(`openmrs:feature-flag:${t}`,r.enabled.toString()),localStorage.setItem(`openmrs:feature-flag-meta:${t}`,JSON.stringify({label:r.label,description:r.description}))});var dM=e3(function(e,t,r){eQ(e,t,r)});function dI(e=!0,t=!1){return d$(dN(),e,t)}function d$(e,t=!0,r=!1){return!!(e?t:r)}let dL=Y("extensionsInternal",{slots:{},extensions:{}}),dF=Y("extensionRenderings",{renderings:new Map}),dB=()=>J("extensionsInternal",{slots:{},extensions:{}}),dV=()=>J("extensionRenderings",{renderings:new Map});function dU(e){let t=dL.getState(),r=e(t);r!==t&&dL.setState(r)}let dW=null,dK=null;function dH(){let e=dF.getState();return dW&&e===dK||(dW=new Map(e.renderings),dK=e,function(e){for(let t of(d1.clear(),e.values()))d4(t,1);d3=!0}(dW)),dW}function dz(e){dK={renderings:e},dF.setState(dK,!0)}function dG(e){let t=dH();t.has(e.renderingId)||(t.set(e.renderingId,e),d4(e,1),dz(t))}function dq(e){let t=dH(),r=t.get(e);r&&(t.delete(e),d4(r,-1),dz(t))}let dY=()=>J("extensions",{slots:{}}),dZ=0,dJ=new Set;function dX(e){dZ++;try{return e()}finally{if(0==--dZ&&dJ.size>0){let e=Array.from(dJ);for(let t of(dJ.clear(),e))dQ(t)}}}function dQ(e){try{e()}catch(t){console.error(`The extension system's '${e.name}' recomputation failed`,t)}}function d0(e){dZ>0?dJ.add(e):dQ(e)}let d1=new Map,d3=!1;function d4(e,t){let r=JSON.stringify([e.slotName,e.extensionId,e.slotModuleName,e.extensionModuleName]),n=d1.get(r);if(!n){if(t<0)return;d1.set(r,{count:1,record:{slotModuleName:e.slotModuleName,extensionModuleName:e.extensionModuleName,slotName:e.slotName,extensionId:e.extensionId}}),d3=!0;return}n.count+=t,n.count<1&&(d1.delete(r),d3=!0)}function d2(){var e,t;if(dH(),!d3)return;d3=!1;let r=Array.from(d1.values(),({record:e})=>e);r.sort(d6),e=tq.getState().mountedExtensions,t=r,e.length===t.length&&e.every((e,r)=>0===d6(e,t[r]))||tq.setState({mountedExtensions:r})}function d6(e,t){return d5(e.slotName,t.slotName)||d5(e.extensionId,t.extensionId)||d5(e.slotModuleName,t.slotModuleName)||d5(e.extensionModuleName,t.extensionModuleName)}function d5(e,t){return e===t?0:e<t?-1:1}d2(),dF.subscribe(()=>d0(d2));let d8=dB(),d9=dY(),d7=tZ(),pe=tQ(),pt=new Set,pr=!1;function pn(e){if(null===e)pt=null;else if(null!==pt)for(let t of e)pt.add(t);d0(pi)}function pi(){if(!pr){pr=!0;try{for(let e=1;;e++){let t=pt;if(null!==t&&0===t.size)return;pt=new Set;try{!function(e,t,r,n,i,o=null){let a=d9.getState().slots,s={},l=!1,u=dN(),c=Object.entries(n.flags).filter(([,{enabled:e}])=>e).map(([e])=>e);for(let[n,d]of Object.entries(e.slots)){let p=a[n];if(p&&o&&!o.has(n)){s[n]=p;continue}let{config:f}=tX(t,d.name),h=function(e,t,r,n,i,o,a){let s=function(e,t){let r=e.add||[],n=e.remove||[],i=e.order||[],{extensions:o}=d8.getState();return[...t,...r].filter(e=>!n.includes(e)).sort((e,r)=>pm(e,i,o[pl(e)]?.order,t)-pm(r,i,o[pl(r)]?.order,t))}(r,t.slots[e].attachedIds),l=[];for(let u of s){let{config:s}=t1(n,e,u),c=t3(r,e,u),d=c?dM({},s,c):s,p=pl(u),f=t.extensions[p];if(f){let e=d?.["Display conditions"]?.privileges??f.privileges??[];if(e&&("string"==typeof e||Array.isArray(e)&&e.length>0)&&(!a?.user||!oS(e,a.user))||f.featureFlag&&!i.includes(f.featureFlag)||window.offlineEnabled&&!d$(o,f.online,f.offline))continue;l.push({id:u,name:p,moduleName:f.moduleName,config:d,featureFlag:f.featureFlag,meta:f.meta,online:d?.["Display conditions"]?.online??f.online??!0,offline:d?.["Display conditions"]?.offline??f.offline??!1,displayConditionExpression:d?.["Display conditions"]?.expression||f.displayExpression})}}return l}(n,e,f,r,c,u,i.session);p&&p.moduleName===d.moduleName&&e6(p.candidateExtensions,h)?s[n]=p:(s[n]={moduleName:d.moduleName,candidateExtensions:h},l=!0)}(l||Object.keys(a).length!==Object.keys(s).length)&&d9.setState({slots:s})}(d8.getState(),d7.getState(),pe.getState(),dC.getState(),og.getState(),t)}catch(e){throw pt=null===t||null===pt?null:new Set([...t,...pt]),e}if(e>=20)return void console.error("The extension system stopped recomputing after 20 passes because something keeps invalidating slots in response to the extension store being written. Some slots are left stale until the next write.")}}finally{pr=!1}}}function po(e,t){let r=new Set;for(let n of Object.keys(e))e[n]!==t[n]&&r.add(n);for(let n of Object.keys(t))n in e||r.add(n);return r}function pa(){pn(null)}function ps(e,t){return{moduleName:t,name:e,attachedIds:[]}}function pl(e){let[t]=e.split("#");return t}function pu(e,t){let r=pl(t);return e.extensions[r]}function pc(e){return pu(d8.getState(),e)}d8.subscribe((e,t)=>{pn(e.extensions!==t.extensions?null:po(e.slots,t.slots))}),d7.subscribe((e,t)=>{pn(po(e.slots,t.slots))}),pe.subscribe((e,t)=>{pn(po(e.configs,t.configs))}),dC.subscribe(()=>pn(null)),og.subscribe(()=>pn(null)),pa(),b(pa);let pd=e=>dU(t=>({...t,extensions:{...t.extensions,[e.name]:{...e}}}));function pp(e,t){dU(r=>{let n=r.slots[e];return n?{...r,slots:{...r.slots,[e]:{...n,attachedIds:[...n.attachedIds,t]}}}:{...r,slots:{...r.slots,[e]:{...ps(e),attachedIds:[t]}}}})}function pf(e,t){dU(r=>{let n=r.slots[e];return n&&n.attachedIds.includes(t)?{...r,slots:{...r.slots,[e]:{...n,attachedIds:n.attachedIds.filter(e=>e!==t)}}}:r})}function ph(e){dU(t=>{let r=t.slots[e];return r?{...t,slots:{...t.slots,[e]:{...r,attachedIds:[]}}}:t})}function pm(e,t,r,n){let i=t.indexOf(e);if(-1!==i)return i;{if(void 0!==r)return 1e3+r;let t=n.indexOf(e);return -1!==t?2e3+t:3e3}}function py(e,t){return function(e,t,r=null,n){let i;return e.filter(e=>{let o=e.displayConditionExpression;if("string"!=typeof o||0===o.trim().length)return!0;i??(i=t&&"object"==typeof t?{session:r,...t}:{session:r});try{return!!dt(o,i)}catch(t){return console.error(`Error while evaluating expression '${o}' for ${e.id}`+(n?` in ${n}`:""),t),!1}})}(pg(e),t,og.getState().session,e)}function pg(e){return d9.getState().slots[e]?.candidateExtensions??[]}let pb=(e,t)=>d8.setState(r=>{let n=r.slots[t]?.moduleName;if(n&&n!=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 ${n}.`),r;if(n&&n==e)return r;if(r.slots[t])return{...r,slots:{...r.slots,[t]:{...r.slots[t],moduleName:e}}};let i=ps(t,e);return{...r,slots:{...r.slots,[t]:{...i}}}}),pv=()=>{pt=null,dU(()=>({slots:{},extensions:{}})),dV().setState({renderings:new Map}),d9.setState({slots:{}})},pw=Y("left-nav",{slotName:null,basePath:window.spaBase,mode:"normal"});function p_({name:e,basePath:t,mode:r,componentContext:n,state:i}){pw.setState({slotName:e,basePath:t,mode:r??"normal",componentContext:n,state:i})}function px(e){pw.getState().slotName===e&&pw.setState(pw.getInitialState(),!0)}let pE=Y("modalRegistry",{modals:{}});function pS(e){pE.setState(t=>(t.modals[e.name]=e,t))}function pD(e){let t=pE.getState().modals[e];if(!t){let r=pc(e);r&&(t={name:e,load:r.load,moduleName:r.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.`),pS(t))}return t}let pO=Y("workspaceRegistrations",{workspaces:{}}),pP=Y("workspaceGroups",{workspaceGroups:{}});function pC(e){pO.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 pk(e){pP.setState(t=>{let r=t.workspaceGroups[e.name];return r?{workspaceGroups:{...t.workspaceGroups,[e.name]:{...r,members:Array.from(new Set([...r.members,...e.members]))}}}:{workspaceGroups:{...t.workspaceGroups,[e.name]:{name:e.name,members:e.members}}}})}let pj=new Set;function pT(e){let t=pO.getState().workspaces;if(t[e])return t[e];{let t=pc(e);if(t){var r;let n;return pj.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.`),pj.add(e)),{name:t.name,title:(r=t,"string"==typeof(n=r?.meta?.title)?n:n&&"object"==typeof n?i5(r.moduleName,n.key,n.default):r.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 pR(e){let t=pP.getState().workspaceGroups;if(t[e])return t[e];throw Error(`No workspace group named '${e}' has been registered.`)}let pA=Y("workspace2",{registeredGroupsByName:{},registeredWindowsByName:{},registeredWorkspacesByName:{},openedGroup:null,openedWindows:[],workspaceTitleByWorkspaceName:{},isMostRecentlyOpenedWindowHidden:!1});function pN(e){let{registeredWorkspacesByName:t,registeredWindowsByName:r}=pA.getState(),n=t[e];if(n){let t=r[n.window];if(t)return t;throw Error(`No workspace window found with name: ${n.window} for workspace: ${e}`)}throw Error(`No workspace found with name: ${e}`)}function pM(e){let{registeredGroupsByName:t,registeredWindowsByName:r}=pA.getState(),n=r[e];if(n){let r=t[n.group];if(r)return r;throw Error(`No workspace group found with name: ${n.group} for window: ${e}`)}throw Error(`No workspace window found with name: ${e}`)}function pI(e){let{openedWindows:t}=pA.getState();return t.findIndex(t=>t.openedWorkspaces.find(t=>t.workspaceName===e))}function p$(e,t){if(0==t.length)return;let{registeredGroupsByName:r}=pA.getState(),n={...r};for(let r of t){if(n[r.name])throw Error(`Cannot register workspace group ${r.name} more than once`);n[r.name]={...r,moduleName:e}}pA.setState({registeredGroupsByName:n})}function pL(e,t){if(0==t.length)return;let{registeredWindowsByName:r}=pA.getState(),n={...r};for(let r of t){if(n[r.name])throw Error(`Cannot register workspace window ${r.name} more than once`);let t={...r,moduleName:e};n[r.name]=t}pA.setState({registeredWindowsByName:n})}function pF(e,t){if(0==t.length)return;let{registeredWorkspacesByName:r}=pA.getState(),n={...r};for(let r of t){if(n[r.name])throw Error(`Cannot register workspace ${r.name} more than once`);let t={...r,moduleName:e};n[r.name]=t}pA.setState({registeredWorkspacesByName:n})}let pB=0,pV=null,pU={bootstrap:15e3,mount:15e3,unmount:15e3};function pW(e,t){if(e.timeouts)return e;let r=e.name??"parcel",n=Object.fromEntries(Object.keys(pU).filter(t=>e[t]).map(n=>{var i,o;let a,s;return[n,(i=e[n],o=pU[n],a=Array.isArray(i)?i:[i],s=e=>a.reduce((t,i,o)=>t.then(()=>{let t=i(e);return"function"==typeof t?.then&&"function"==typeof t?.catch?t:Promise.reject(Error(`Lifecycle function ${n} at array index ${o} for parcel ${r} did not return a promise`))}),Promise.resolve(void 0)),e=>{let i,a=new Promise((e,t)=>{i=setTimeout(()=>t(Error(`Lifecycle function ${n} for parcel ${r} did not settle within ${o}ms`)),o)});return Promise.race([s(e),a]).finally(()=>clearTimeout(i)).then(e=>(t(n,!1),e),e=>{throw t(n,!0),e})})]}));return{...e,...n}}async function pK(e,t){var r,n;let i,o,a,s,l,u=await (pV??(pV=new Promise((e,t)=>{nC({name:"openmrs-extension-host",bootstrap:()=>Promise.resolve(),mount:t=>(e(t.mountParcel),Promise.resolve()),unmount:()=>Promise.resolve()},{domElement:document.createElement("div")}).mountPromise.catch(t)}).catch(e=>(console.error("The host parcel used to mount extensions could not be mounted. Falling back to mounting extensions as root parcels, which leaks their DOM elements.",e),nC))),pV),c={...t},d=(i=c,o=!1,{retarget:e=>i={...e},release:a=()=>(function(e){for(let t of Object.keys(e))delete e[t]})(i),onSettled(e,t){switch(e){case"bootstrap":t&&a();return;case"mount":o||(o=t);return;case"unmount":(t||o)&&a();return}}});return n=u((r=d.onSettled,"function"==typeof e?()=>e().then(e=>pW(e,r)):pW(e,r)),c),s=e=>t=>e.call(n,d.retarget(t)).catch(e=>{throw"SKIP_BECAUSE_BROKEN"===n.getStatus()&&d.release(),e}),l=n.update&&s(n.update),Object.defineProperty(n,"update",{configurable:!0,enumerable:!0,get:()=>l,set:e=>{l=e&&s(e)}})}function pH(){return pz}function pz(e,t){let r,n=pK(e,t).then(e=>r=e);return{mount:()=>n.then(e=>e.mount()),unmount:()=>n.then(e=>e.unmount()),update:e=>n.then(t=>t.update?.(e)),getStatus:()=>r?.getStatus()??"LOADING_SOURCE_CODE",get loadPromise(){return n.then(e=>e.loadPromise)},get bootstrapPromise(){return n.then(e=>e.bootstrapPromise)},get mountPromise(){return n.then(e=>e.mountPromise)},get unmountPromise(){return n.then(e=>e.unmountPromise)}}}async function pG(e,t,r,n,i=e=>e,o={}){let a=pl(n),s=pc(n),l=null;if(e){if(!s)throw Error(`Couldn't find extension '${a}' to attach to '${t}'`);let{meta:u,moduleName:c,online:d,offline:p,load:f}=s;if(dI(d,p)){let s,d=pB++,p=`${t}/${n}-${d}`;e.dataset.extensionRenderingId=p;let h=e=>{try{dq(p)}catch(t){console.error(e,t)}};try{dG({renderingId:p,extensionName:a,extensionModuleName:c,extensionId:n,slotName:t,slotModuleName:r})}catch(e){throw h(`Recomputing configuration after registering '${n}' failed also failed`),e}try{s=await f()}catch(e){throw h(`Recomputing configuration after '${n}' failed to load also failed`),e}try{l=await pK(i({...s,name:`${t}/${a}-${d}`}),{...o,_meta:u,_extensionContext:{extensionId:n,extensionSlotName:t,extensionSlotModuleName:r,extensionModuleName:c,extensionMeta:u},domElement:e})}catch(e){throw h(`Recomputing configuration after '${n}' failed to mount also failed`),e}l.mountPromise.then(void 0,e=>{console.error(`Extension '${n}' in slot '${t}' failed to mount`,e),h(`Recomputing configuration after '${n}' failed to mount also failed`)}),l.unmountPromise.then(()=>h(`Recomputing configuration after unmounting '${n}' failed`),e=>{console.error(`Extension '${n}' in slot '${t}' failed to unmount`,e),h(`Recomputing configuration after '${n}' failed to unmount also failed`)})}}else console.warn(`Tried to render ${n} into ${t} but no DOM element was available.`);return l}var pq=r(5275),pY=r.n(pq);let pZ=(0,pq.createContext)({moduleName:"",featureName:""});function pJ({to:e,templateParams:t,onBeforeNavigate:r,children:n,...i}){return(0,pq.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}`)},[]),pY().createElement("a",{onClick:n=>{0===n.button&&!n.ctrlKey&&!n.shiftKey&&!n.altKey&&!n.metaKey&&(n.preventDefault(),r?.(n),oe({to:e,templateParams:t})),0===n.button&&(n.ctrlKey||n.metaKey)&&r?.(n),0===n.button&&n.shiftKey&&r?.(n),1===n.button&&r?.(n)},href:i9(e,t),...i},n)}let pX=({state:e,children:t,...r})=>{let{extension:n}=(0,pq.useContext)(pZ),i=(0,pq.useRef)(null),o=(0,pq.useRef)(Promise.resolve()),a=(0,pq.useRef)(!1),s=(0,pq.useRef)(!1),l=(0,pq.useRef)(e),u=(0,pq.useCallback)(e=>{if(!e)return;let t=()=>{"MOUNTED"===e.getStatus()&&e.unmount()};switch(e.getStatus()){case"MOUNTED":e.unmount();break;case"UPDATING":o.current?.then(t,t);break;default:e.mountPromise.then(t,()=>{})}},[]),c=(0,pq.useCallback)((e,t)=>{e.update&&"UNMOUNTING"!==e.getStatus()&&(o.current=Promise.all([e.mountPromise,o.current]).then(()=>{if(i.current?.getStatus()==="MOUNTED"&&i.current.update)return i.current.update({...t})}).catch(e=>{let t=i.current?.getStatus();"UNMOUNTING"!==t&&"NOT_MOUNTED"!==t&&"UNLOADING"!==t&&console.error(`The extension '${n?.extensionId}' failed to update`,e)}))},[]),d=(0,pq.useCallback)(t=>{t&&!i.current&&!s.current&&n?.extensionSlotName&&n.extensionSlotModuleName&&(s.current=!0,pG(t,n.extensionSlotName,n.extensionSlotModuleName,n.extensionId,void 0,e).then(t=>{(s.current=!1,i.current=t,a.current)?u(t):t&&l.current!==e&&c(t,l.current)},()=>{s.current=!1}))},[]);return(0,pq.useEffect)(()=>(a.current=!1,()=>{a.current=!0,u(i.current)}),[]),(0,pq.useEffect)(()=>{l.current=e,i.current&&c(i.current,e)},[e]),n?pY().createElement("div",{ref:d,"data-extension-id":n?.extensionId,style:{position:"relative"},...r}):null};function pQ(e){let t=(0,pq.useRef)(e);return F(t.current,e)||(t.current=e),t.current}function p0(e,t){"function"==typeof t&&(t=t(e));let r={};for(let[n,i]of Object.entries(t)){let t=function(...t){e.setState(e=>i(e,...t))};r[n]=t}return r}let p1=e=>e;function p3(e,t=p1,r){let n=(0,pq.useCallback)(t=>e.subscribe(t),[e]),i=(0,pq.useCallback)(()=>t(e.getState()),[e,t]),o=(0,pq.useSyncExternalStore)(n,i,i),a=(0,pq.useMemo)(()=>r?p0(e,r):null,[e,r]);return(0,pq.useMemo)(()=>a?{...o,...a}:o,[o,a])}function p4(e,t){return p3(e,p1,t)}function p2(e){return function(t){let r=(0,pq.useCallback)(t=>e.subscribe(t),[]),n=(0,pq.useCallback)(()=>e.getState(),[]),i=(0,pq.useSyncExternalStore)(r,n,n),o=(0,pq.useMemo)(()=>t?p0(e,t):null,[t]);return(0,pq.useMemo)(()=>o?{...i,...o}:i,[i,o])}}let p6=[];Object.freeze(p6);let p5={candidateExtensions:p6};Object.freeze(p5);let p8=e=>{let t=(0,pq.useCallback)(t=>t.slots?.[e]??p5,[e]);return p3(dY(),t)},p9=e=>e.session;function p7(e,t){let{candidateExtensions:r}=p8(e),n=p3(og,p9),i=pQ(t);return(0,pq.useMemo)(()=>py(e,i),[e,i,n,r])}function fe(e,t){let{moduleName:r}=(0,pq.useContext)(pZ);if(!r)throw Error("ComponentContext has not been provided. This should come from @openmrs/esm-react-utils.");return(0,pq.useEffect)(()=>{pb(r,e)},[r,e]),{extensions:p7(e,t),extensionSlotName:e,extensionSlotModuleName:r}}function ft(e){return e}function fr({name:e,extensionSlotName:t,select:r=ft,children:n,state:i,style:o,...a}){if(n&&i)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 s=e??t,l=(0,pq.useRef)(null),{extensions:u,extensionSlotModuleName:c}=fe(s,i),d=(0,pq.useMemo)(()=>r(u),[r,u]),p=(0,pq.useMemo)(()=>{if("function"==typeof n&&!pY().isValidElement(n))return d.map(e=>n(e,i))},[n,d]);return pY().createElement("div",{ref:l,"data-extension-slot-name":s,"data-extension-slot-module-name":c,style:{...o,position:"relative"},...a},s&&d?.map((e,t)=>pY().createElement(pZ.Provider,{key:e.id,value:{moduleName:c,featureName:"",extension:{extensionId:e.id,extensionSlotName:s,extensionSlotModuleName:c,extensionMeta:e.meta}}},p?.[t]??("function"!=typeof n?n:null)??pY().createElement(pX,{state:i}))))}var fn=r(5338);function fi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function fo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fi(Object(r),!0).forEach(function(t){var n,i,o;n=e,i=t,o=r[t],i in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fi(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function fa(e){return(fa="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 fs(e){return(fs="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 fl(e,t){var r;if("function"!=typeof(r=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 r="single-spa-application:".concat(t);return function(){var e=document.getElementById(r);return e||((e=document.createElement("div")).id=r,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(fs(r)));return function(){var e=r(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(fs(e)));return e}}var fu=null;try{fu=require("react").createContext()}catch(e){}var fc={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 fd(e,t){return e.rootComponent?Promise.resolve():e.loadRootComponent(t).then(function(t){e.rootComponent=t})}function fp(e,t){return new Promise(function(r,n){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 i,o=fy(e,t,function(){r(this)}),a=fl(e,t)(),s=function(e){var t=e.reactDom,r=e.renderType,n=e.elementToRender,i=e.domElement,o=t[r];if("function"!=typeof o)throw Error('renderType "'.concat(r,'" did not return a function.'));switch(r){case"createRoot":case"unstable_createRoot":case"createBlockingRoot":case"unstable_createBlockingRoot":var a=o(i);return a.render(n),a;case"hydrateRoot":return o(i,n);default:return o(n,i),null}}({elementToRender:o,domElement:a,reactDom:fm(e),renderType:"function"==typeof(i=e).renderType?i.renderType():i.renderType});e.domElements[t.name]=a,e.renderResults[t.name]=s})}function ff(e,t){return new Promise(function(r){e.unmountResolves[t.name]=r;var n=e.renderResults[t.name];n&&n.unmount?n.unmount():fm(e).unmountComponentAtNode(e.domElements[t.name]),delete e.domElements[t.name],delete e.renderResults[t.name]})}function fh(e,t){return new Promise(function(r){e.updateResolves[t.name]||(e.updateResolves[t.name]=[]),e.updateResolves[t.name].push(r);var n=fy(e,t,null),i=e.renderResults[t.name];if(i&&i.render)i.render(n);else{var o=fl(e,t)();fm(e).render(n,o)}})}function fm(e){return e.ReactDOMClient||e.ReactDOM}function fy(e,t,r){var n=e.React.createElement(e.rootComponent,t),i=fu?e.React.createElement(fu.Provider,{value:t},n):n;return(e.errorBoundary||t.errorBoundary||e.errorBoundaryClass||t.errorBoundaryClass)&&(e.errorBoundaryClass=e.errorBoundaryClass||t.errorBoundaryClass||function(e,t){function r(t){e.React.Component.apply(this,arguments),this.state={caughtError:null,caughtErrorInfo:null},r.displayName="SingleSpaReactErrorBoundary(".concat(t.name,")")}return r.prototype=Object.create(e.React.Component.prototype),r.prototype.render=function(){return this.state.caughtError?(e.errorBoundary||t.errorBoundary)(this.state.caughtError,this.state.caughtErrorInfo,this.props):this.props.children},r.prototype.componentDidCatch=function(e,t){this.setState({caughtError:e,caughtErrorInfo:t})},r}(e,t),i=e.React.createElement(e.errorBoundaryClass,t,i)),i=e.React.createElement(e.SingleSpaRoot,fo(fo({},t),{},{mountFinished:r,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])}}),i)}var fg=r(8395),fb=r(6335),fv=r.n(fb),fw=r(3954);let f_={strictMode:!0,throwErrorsToConsole:!0,disableTranslations:!1},fx=new Map;(0,fw.initCache)(fx);let fE={errorRetryCount:3,fetcher:oh,focusThrottleInterval:18e5,revalidateIfStale:!0,revalidateOnFocus:!1,revalidateOnReconnect:!1,refreshInterval:0,shouldRetryOnError:e=>{if(e instanceof oy){let t=e.response.status;return!!(t>=500)||401===t||403===t||429===t}return!0},provider:()=>fx};function fS(e){if("object"!=typeof e||"string"!=typeof e.featureName||"string"!=typeof e.moduleName)throw Error("Invalid options");let t=Object.assign({},f_,e),r={...fE,...t.swrConfig};return function(e){var n,i,o,a,s;return o=i=class extends(n=pY().Component){componentDidCatch(e,r){r&&r.componentStack&&(e.extra=Object.assign(e.extra||{},{componentStack:r.componentStack})),t.throwErrorsToConsole&&setTimeout(()=>{throw e}),this.setState({caughtError:e,caughtErrorInfo:r})}render(){if(this.state.caughtError)return pY().createElement("div",null,"An error has occurred. Please try reloading the page.");{let n=pY().createElement(pq.Suspense,{fallback:null},pY().createElement(fb.SWRConfig,{value:r},pY().createElement(pZ.Provider,{value:this.state.config},t.disableTranslations?pY().createElement(e,this.props):pY().createElement(fg.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},pY().createElement(e,this.props)))));return t.strictMode&&pY().StrictMode?pY().createElement(pY().StrictMode,null,n):n}}constructor(e){super(e),this.state={caughtError:null,caughtErrorInfo:null,config:{moduleName:t.moduleName,featureName:t.featureName,extension:e._extensionContext}}}},a="displayName",s=`OpenmrsReactComponent(${t.featureName})`,a in o?Object.defineProperty(o,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):o[a]=s,i}}function fD(e,t){return function(e){if("object"!==fa(e))throw Error("single-spa-react requires a configuration object");var t,r=fo(fo({},fc),e);if(!r.React)throw Error("single-spa-react must be passed opts.React");if(!r.ReactDOM&&!r.ReactDOMClient)throw Error("single-spa-react must be passed opts.ReactDOM or opts.ReactDOMClient");if(r.renderType||(null!=(t=r.ReactDOMClient)&&t.createRoot?r.renderType="createRoot":r.renderType="render"),!r.rootComponent&&!r.loadRootComponent)throw Error("single-spa-react must be passed opts.rootComponent or opts.loadRootComponent");if(r.errorBoundary&&"function"!=typeof r.errorBoundary)throw Error("The errorBoundary opt for single-spa-react must either be omitted or be a function that returns React elements");!fu&&r.React.createContext&&(fu=r.React.createContext()),r.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}(r);var n={bootstrap:fd.bind(null,r),mount:fp.bind(null,r),unmount:ff.bind(null,r)};return r.parcelCanUpdate&&(n.update=fh.bind(null,r)),n}({React:pY(),ReactDOMClient:fn,rootComponent:fS(t)(e)})}function fO(e,t){return()=>e().then(({default:e})=>fD(e,t))}function fP(e,t){return()=>Promise.resolve(fD(e,t))}let fC=fO,fk=W()(()=>({}));Z("openmrs-app-context",fk);let fj={};function fT(e,t=e=>e){let r=fk.getState();return e in r?Object.freeze(Object.assign({},t?t(r[e]):r[e])):null}function fR(e,t){fk.setState(r=>(e in r||(r[e]={}),r[e]=t(r[e]),Object.assign({},r)))}function fA(e){return null===e?null:Object.freeze(Object.assign({},e))}let fN=new Map;function fM(e,t){let r=(0,pq.useRef)(t??{}),n=(0,pq.useRef)(t=>fR(e,t)),i=(0,pq.useRef)(Symbol());return(0,pq.useEffect)(()=>{let r=t??{},n=i.current;return null===fT(e)?!function(e,t=fj){fk.setState(r=>{if(e in r)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({},r,{[e]:t===fj?{}:t})})}(e,r):(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.`),fR(e,()=>r)),fN.set(e,n),()=>{fN.get(e)===n&&(fk.setState(t=>(e in t&&delete t[e],t)),fN.delete(e))}},[e]),(0,pq.useEffect)(()=>{let n=t??{};F(r.current,n)||(fR(e,()=>n),r.current=n)},[t]),n.current}function fI({namespace:e,value:t}){return fM(e,t),null}let f$=({children:e,value:t,fallback:r})=>t?pY().createElement(pY().Fragment,null,e):r?pY().createElement(pY().Fragment,null,r):null;function fL(){let e=(0,pq.useRef)();return(!e.current||e.current.signal.aborted)&&(e.current=new AbortController),(0,pq.useEffect)(()=>{let t=e.current;return()=>t?.abort()},[]),e.current}function fF(e,t=e=>e??{}){let[r,n]=(0,pq.useState)(()=>{if(fB(e))return;let r=fT(e);if(null!==r)return t?t(r):r});return(0,pq.useEffect)(()=>{if(fB(e))throw Error(`The namespace supplied to useAppContext must be a non-empty string, but was "${e}".`)},[e]),(0,pq.useEffect)(()=>{var r;let i;return(r=e=>{if(null==e)return void n(void 0);let r=t?t(e):e;n(e=>F(e,r)?e:r)})(fA(i=fT(e))),fk.subscribe(t=>{let n=e in t?t[e]:null;n!==i&&(i=n,r(fA(n)))})},[e,t]),r}function fB(e){return"string"!=typeof e||0===e.trim().length}function fV(e){let t=p7(e);return(0,pq.useMemo)(()=>t.map(e=>e.id),[t])}function fU(e){return p8(e).candidateExtensions}function fW(e,t,r){let{data:n,error:i,mutate:o,isLoading:a,isValidating:s}=fv()(e?av(e,t,r):null,oh);return(0,pq.useMemo)(()=>({isLoading:a,data:n?.data.results??[],error:i,mutate:o,isValidating:s}),[n,i,a,s,o])}function fK(e){(0,pq.useEffect)(()=>{if(e){let e=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}},[e])}let fH={},fz=`No ComponentContext has been provided. This should come from "openmrsComponentDecorator".
16
+ Usually this is already applied when using "getAsyncLifecycle" or "getSyncLifecycle".`;function fG(e){let{moduleName:t,extension:r}=(0,pq.useContext)(pZ),n=e?.externalModuleName??t;if(!n&&!r)throw Error(fz);let i=function(e){let t=(0,pq.useMemo)(()=>tY(e),[e]),r=function(e){let[t,r]=(0,pq.useState)(()=>{let t=e.getState();return t.loaded&&t.config?t.config:null});return(0,pq.useEffect)(()=>e?.subscribe(e=>{e.loaded&&e.config&&r(e.config)}),[e]),t}(t);if(!r)throw fH[e]||(fH[e]=new Promise(e=>{let r=t.subscribe(t=>{t.loaded&&t.config&&(e(t.config),r())})})),fH[e];return r}(n),o=function(e){let t=(0,pq.useMemo)(tQ,[]),r=function(e,t){let[r,n]=(0,pq.useState)(t?()=>{let r=t1(e.getState(),t.extensionSlotName,t.extensionId);if(r.loaded&&r.config)return r.config}:null);return(0,pq.useEffect)(()=>{if(t)return e.subscribe(e=>{let i=t1(e,t.extensionSlotName,t.extensionId);i.loaded&&i.config&&!e6(i.config,r)&&n(i.config)})},[e,t,r]),r}(t,e);if(!r&&e){let r=`${e.extensionSlotName}-${e.extensionId}`;throw!fH[r]&&t&&(fH[r]=new Promise(r=>{let n=t.subscribe(t=>{let i=t1(t,e.extensionSlotName,e.extensionId);i.loaded&&i.config&&(r(i.config),n())})})),fH[r]}return r||{}}(r);return(0,pq.useMemo)(()=>e?.externalModuleName&&n===e.externalModuleName?{...i}:{...i,...o},[n,e?.externalModuleName,i,o])}let fq=p7;function fY(){let[e,t]=(0,pq.useState)(dN());return(0,pq.useEffect)(()=>b(({online:e})=>t(e)),[]),e}function fZ(e,t=300){let[r,n]=(0,pq.useState)(e);return(0,pq.useEffect)(()=>{let r=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(r)}},[e,t]),r}var fJ=r(2016),fX=r.n(fJ);let fQ=`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 f0(){let e=`${oc}/emrapi/configuration?v=${fQ}`,t=fX()(e,oh);return(0,pq.useMemo)(()=>({emrConfiguration:t.data?.data,isLoadingEmrConfiguration:t.isLoading,mutateEmrConfiguration:t.mutate,errorFetchingEmrConfiguration:t.error}),[t])}function f1(){return(0,pq.useContext)(pZ).extension}let f3=p2(dB());function f4(e){let t=p7(e);return(0,pq.useMemo)(()=>Object.fromEntries(t.map(e=>[e.name,e.meta])),[t])}let f2=p2(dY());function f6(e){let{flags:t}=p3(dC);return t[e]?.enabled??!1}function f5(){let[,e]=(0,pq.useState)(0);return(0,pq.useCallback)(()=>{e(e=>e+1)},[])}function f8(e,t,r={}){return f7(e,t,f9,r)}let f9={getPaginatedUrl:(e,t,r)=>{if(!e)return null;{let n=new URL(of(e.toString()),window.location.toString());return n.searchParams.set("limit",""+t),n.searchParams.set("startIndex",""+r),n.searchParams.set("totalCount","true"),n.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 f7(e,t,r,n={}){let{getPaginatedUrl:i,getTotalCount:o,getCurrentPageSize:a,getData:s}=r,{immutable:l,swrConfig:u}=n,c=n.fetcher??oh,[d,p]=(0,pq.useState)(1),f=(0,pq.useRef)(NaN),h=(0,pq.useRef)(NaN),m=(0,pq.useRef)(d),y=(0,pq.useRef)(!1),g=(0,pq.useRef)(!1),b=e?.toString()??"",[v,w]=(0,pq.useState)(b);b!==v&&(w(b),p(1),m.current=1,f.current=NaN,h.current=NaN,y.current=!1,g.current=!1);let x=(d-1)*t,E=(0,pq.useMemo)(()=>i(e,t,x),[e,t,x]),{data:S,...D}=(l?fX():fv())(E,c,u);S?.data&&(f.current=o(S?.data),h.current=a(S?.data),y.current=!0);let O=Math.ceil(f.current/t),P=(0,pq.useCallback)(e=>{if(!Number.isInteger(e)||e<1)return void console.warn(`useServerPagination: ignoring goTo(${e}); page must be a positive integer.`);let r=Math.ceil(f.current/t);!y.current||Number.isNaN(r)||e<=r?(m.current=e,p(e)):console.warn("Invalid attempt to go to out of bounds page: "+e)},[t]);(0,pq.useEffect)(()=>{if(!y.current)return;if(Number.isNaN(f.current)){g.current||(g.current=!0,console.warn(`useServerPagination: ${b} returned no total count, so out-of-range pages cannot be detected.`));return}let e=Math.max(1,Math.ceil(f.current/t));d>e&&(console.warn(`Invalid attempt to go to out of bounds page: ${d}; returning to page ${e}.`),m.current=e,p(e))},[d,t,b,S]);let C=(0,pq.useCallback)(()=>{P(m.current+1)},[P]),k=(0,pq.useCallback)(()=>{P(m.current-1)},[P]);return{data:s(S?.data),totalPages:O,totalCount:f.current,currentPage:d,currentPageSize:h.current,paginated:O>1,showNextButton:d<O,showPreviousButton:d>1,goTo:P,goToNext:C,goToPrevious:k,...D}}function he(e,t,r={}){return f7(e,t,ht(),r)}function ht(){return{getPaginatedUrl:(e,t,r)=>{if(!e)return null;{let n=new URL(of(e.toString()),window.location.toString());return n.searchParams.set("_count",""+t),n.searchParams.set("_getpagesoffset",""+r),n.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 hr=r(2142),hn=r.n(hr);function hi(e,t={}){return ho(e,f9,t)}function ho(e,t,r={}){let{swrInfiniteConfig:n,immutable:i}=r,{getNextUrl:o,getTotalCount:a,getData:s}=t,l=r.fetcher??oh,u=(0,pq.useCallback)((r,n)=>0==r?e?.toString()??null:t.getNextUrl(n.data),[e]),{data:c,size:d,setSize:p,...f}=hn()(u,l,{...n,...i?{revalidateIfStale:!1,revalidateOnFocus:!1,revalidateOnReconnect:!1}:{}}),h=o(c?.[c.length-1].data),m=a(c?.[0]?.data);return{data:c?.flatMap(e=>s(e.data)),totalCount:m,hasMore:null!=h,loadMore:()=>{p((c?.length??0)+1)},nextUri:h,...f}}function ha(e,t={}){return hs(e,f9,t)}function hs(e,t,r={}){let n=ho(e,t,r),{hasMore:i,error:o,data:a,loadMore:s,isLoading:l,nextUri:u}=n;return((0,pq.useEffect)(()=>{i&&!o&&s()},[i,u]),r.partialData)?n:{...n,data:i||o?void 0:a,isLoading:l||i}}function hl(e,t={}){return hs(e,ht(),t)}function hu(e,t={}){return ho(e,ht(),t)}function hc(){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 hd(){let[e,t]=(0,pq.useState)(hc);return(0,pq.useEffect)(()=>{let e=()=>{t(hc())};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}let hp=e=>"small-desktop"===e||"large-desktop"===e;function hf(e){let t=(0,pq.useContext)(pZ);(0,pq.useEffect)(()=>(t&&t.moduleName&&(e.componentContext=t),p_(e),()=>{px(e.name)}),[t,e])}function hh(){return p3(pw)}function hm(e=null,t=null){let[r,n]=(0,pq.useState)([]);return(0,pq.useEffect)(()=>{let r=cK(e,t).subscribe(e=>{n(e)},e=>{console.error(e)});return()=>r.unsubscribe()},[e,t]),r}function hy(e,t=!0){let r=(0,pq.useRef)(null);return(0,pq.useEffect)(()=>{let n=n=>{t&&r.current&&n.target&&n.target instanceof Node&&(r.current.contains(n.target)||e(n))};return window.addEventListener("mousedown",n),window.addEventListener("touchstart",n),()=>{window.removeEventListener("mousedown",n),window.removeEventListener("touchstart",n)}},[e,t]),r}function hg(e){let t=(0,pq.useRef)();return(0,pq.useEffect)(()=>{let r=new IntersectionObserver(t=>{for(let r of t)if(r.isIntersecting)return void e()},{threshold:1});return t.current&&r.observe(t.current),()=>{t.current&&r.unobserve(t.current)}},[t.current,e]),t}function hb(e,t={}){let{abortController:r,fetchInit:n,url:i,swrConfig:o}=t,a=fL(),s=(0,pq.useMemo)(()=>n?.signal??r?.signal??a.signal,[r?.signal,n?.signal,a.signal]),l=(0,pq.useCallback)(e=>oh(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,i),{...n,signal:s}),[s,n,i]);return fv()(e,l,o)}function hv(e=[],t=10){let[r,n]=(0,pq.useState)(1),i=(0,pq.useMemo)(()=>"number"==typeof t&&t>0?Math.max(1,Math.ceil(e.length/t)):1,[e.length,t]);r>i&&n(i);let o=Math.min(Math.max(1,r),i),a=(0,pq.useMemo)(()=>{let r=(o-1)*t,n=(o+0)*t;return e.slice(r,n)},[e,o,t]),s=(0,pq.useCallback)(e=>{!Number.isInteger(e)||e<1?console.warn(`usePagination: ignoring goTo(${e}); page must be a positive integer.`):n(e)},[]),l=(0,pq.useCallback)(()=>{n(e=>e+1)},[]),u=(0,pq.useCallback)(()=>{n(e=>Math.max(1,e-1))},[]);return(0,pq.useMemo)(()=>({results:a,totalPages:i,currentPage:o,paginated:e.length>t,showNextButton:o<i,showPreviousButton:o>1,goTo:s,goToNext:l,goToPrevious:u}),[a,i,e.length,t,o,s,l,u])}function hw(e,t,r,n){return{pageSizes:(0,pq.useMemo)(()=>{let r=Math.ceil(t/e);return isNaN(r)&&(r=0),[...Array(r).keys()].map(t=>(t+1)*e)},[e,t]),pageItemsCount:(0,pq.useMemo)(()=>e>t?t:e*r>t?e*(r-1)+n:e*r,[e,t,r,n])}}function h_(){let e=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return e&&e[1]}function hx(e){let[t,r]=(0,pq.useState)(e??h_()),{data:n,error:i,isValidating:o}=fv()(t?["patient",t]:null,()=>cL(t,{}));return(0,pq.useEffect)(()=>{let e=()=>{let e=h_();e!==t&&r(e)};return window.addEventListener("single-spa:routing-event",e),()=>window.removeEventListener("single-spa:routing-event",e)},[t]),(0,pq.useMemo)(()=>({isLoading:o&&!i&&!n,patient:n,patientUuid:t,error:i}),[o,i,n,t])}function hE(){let e=`${oc}/metadatamapping/termmapping?v=custom:(metadataUuid)&code=emr.primaryIdentifierType`,{data:t,error:r,isLoading:n}=fv()(e,oh);return(0,pq.useMemo)(()=>({primaryIdentifierCode:t?.data?.results[0]?.metadataUuid,isLoading:n,error:r}),[t,r,n])}function hS(e){let{extensions:t,extensionSlotModuleName:r}=fe(e);return e?t.map(t=>({state:n})=>pY().createElement(pZ.Provider,{value:{moduleName:r,featureName:"",extension:{extensionId:t.id,extensionSlotName:e,extensionSlotModuleName:r,extensionMeta:t.meta}}},pY().createElement(pX,{state:n}))):[]}function hD(){let e=(0,pq.useRef)(),[t,r]=(0,pq.useState)(null),n=null;if(!t){if(s){let e=ow().getState();e.loaded&&(n=e.session)}else s=new Promise(t=>{let r=({loaded:r,session:i})=>{r&&(t(i),n=i,e.current&&(e.current(),e.current=void 0))};r(ow().getState()),n||(e.current=ow().subscribe(r))});if(n)r(n);else throw s}(0,pq.useEffect)(()=>(e.current||(e.current=ow().subscribe(({loaded:e,session:t})=>{e&&(n=t,r(t))})),()=>{e.current&&(e.current(),e.current=void 0)}),[]);let i=t||n;if(!i)if(s)throw console.warn("useSession is in an unexpected state. Attempting to recover."),s;else throw Error("useSession is in an invalid state.");return i}let hO=({privilege:e,fallback:t,children:r})=>{let[n,i]=(0,pq.useState)(null);return((0,pq.useEffect)(()=>{let e=ov({includeAuthStatus:!1}).subscribe(i);return()=>e.unsubscribe()},[]),n&&oS(e,n))?pY().createElement(pY().Fragment,null,r):t?pY().createElement(pY().Fragment,null,t):null};var hP=r(6734),hC=r.n(hP),hk=r(7581);let hj=new Map;function hT(){for(let e of Array.from(hj.values()))e()}let hR={setVisitContext:(e,t)=>null==t?{manuallySetVisitUuid:null}:{manuallySetVisitUuid:t.uuid,patientUuid:t.patient?.uuid}};function hA(e){let t=(0,pq.useId)();return(0,pq.useEffect)(()=>{if(e)return hj.set(t,e),()=>{hj.delete(t)}},[t,e]),{...p4(cJ(),hR),mutateVisit:hT}}function hN(e,t=cY){let r=(0,pq.useRef)(void 0),{patientUuid:n,manuallySetVisitUuid:i,setVisitContext:o}=hA((0,pq.useCallback)(()=>r.current?.(),[])),a=e&&n==e?i:null,s=`?patient=${e}&v=${t}&includeInactive=false`,l=`/${a}?v=${t}`,{data:u,error:c,mutate:d,isValidating:p}=fv()(e?`${oc}/visit${s}`:null,oh),{data:f,error:h,mutate:m,isValidating:y}=fv()(e&&a?`${oc}/visit${l}`:null,oh),g=(0,pq.useMemo)(()=>u?.data.results.find(e=>null===e.stopDatetime)??null,[u]),b=(0,pq.useMemo)(()=>a&&f?f.data:null,[f,a]),v=(0,pq.useRef)(null);(0,pq.useEffect)(()=>{!p&&g&&n===e&&null===i&&o(g),y||(v.current&&b&&v.current.uuid===b.uuid&&!v.current.stopDatetime&&b.stopDatetime&&o(null),v.current=b)},[b,i,g,p,y,n]);let w=(0,pq.useCallback)(()=>{d(),m()},[d,m]);(0,pq.useEffect)(()=>{r.current=w},[w]);let x=!!(!u||a&&!f),E=!!(a?h:c);return{error:c||h,mutate:w,isValidating:p||y,activeVisit:g,currentVisit:b,currentVisitIsRetrospective:!!a,isLoading:x&&!E}}function hM(){let[e,t]=(0,pq.useState)([]);return(0,pq.useEffect)(()=>{let e=cz().subscribe(e=>{t(e)},e=>console.error(e));return()=>e.unsubscribe()},[]),e}hP.extend(hk);let hI=new Map;async function h$(e,t){let r=t.indexOf("#"),n=r>=0,i=n?t.substring(0,r):e,o=n?t.substring(r+1):t,a=await o3(i);return a&&Object.hasOwn(a,o)&&"function"==typeof a[o]?hF(i,a).then(()=>a[o]()):(a?a&&Object.hasOwn(a,o)?console.warn(`The export ${t}, defined in ${e}'s routes.json, is not a function`):console.warn(`${i} does not define a component called "${o}", referenced in ${e}'s routes.json. This cannot be loaded.`):console.warn(`Unknown app ${i} for ${t} defined in ${e}'s routes.json`),hL)}let hL={bootstrap:()=>Promise.resolve(),mount:()=>Promise.resolve(),unmount:()=>Promise.resolve()};async function hF(e,t){if(e in hI)await hI[e];else{let r=t??await o3(e);await (hI[e]=new Promise((t,n)=>{if(Object.hasOwn(r,"startupApp")){let i=r.startupApp;if("function"==typeof i)return Promise.resolve(i()).then(()=>{rp(e),t(null)}).catch(n)}rp(e),t(null)}))}}function hB(e,t){let r=t.name;if(!r)return void console.error(`An extension definition in ${e} is missing an name and thus cannot be
17
17
  registered. To fix this, ensure that you define the "name" field inside the
18
18
  extension definition.`,t);t.slots&&t.slot&&console.warn(`The extension ${r} from ${e} declares both a 'slots' property and
19
19
  a 'slot' property. Only the 'slots' property will be honored.`);let n=t.slots?t.slots:t.slot?[t.slot]:[];if(!t.component)return void console.error(`The extension ${r} from ${e} is missing a 'component' entry and thus cannot be registered.
@@ -29,7 +29,7 @@ To fix this, ensure that you define the "description" field inside the feature f
29
29
  To fix this, ensure that you define the "label" field inside the feature flag definition.`,t):console.error(`A feature flag definition in ${e} is missing a name and thus cannot be registered.
30
30
  To fix this, ensure that you define the "name" field inside the feature flag definition.`,t);else console.warn(`A feature flag for ${e} could not be registered as it does not appear to have the required properties`,t)})}})(e,t))}function hW(){hV.sort((e,t)=>e.appName.localeCompare(t.appName,"en"));let e=new Map;for(let t of hV){e.has(t.appName)?e.set(t.appName,e.get(t.appName)+1):e.set(t.appName,0);let r=e.get(t.appName),n=`${t.appName}-page-${r}`,i=t.containerDomId??"omrs-apps-container",o=document.getElementById(i),a=`single-spa-application:${n}`;if(o){let e=document.createElement("div");e.id=a,o?.appendChild(e)}else throw Error(`${t.appName} ${t.component} cannot be mounted to "${i}"; DOM element does not exist.`);!function(e,t){let r=void 0!==t.route?t.route:void 0!==t.routeRegex&&new RegExp(t.routeRegex);!1===r?console.warn(`A registered page definition is missing a route and thus cannot be registered.
31
31
  To fix this, ensure that you define the "route" (or alternatively the "routeRegex") field inside the extension definition.`,e):t.component?n7(e,()=>h$(t.appName,t.component),function(e,{online:t,offline:r,featureFlag:n}){return window.offlineEnabled?i=>!!(navigator.onLine&&(t??!0)||!navigator.onLine&&r)&&(!n||!!dT(n))&&e(i):e}(function e(t){if(Array.isArray(t)){let r=t.map(e);return e=>r.some(t=>t(e))}return"string"==typeof t?ia(window.getOpenmrsSpaBase()+t):t instanceof RegExp?e=>t.test(e.pathname.replace(window.getOpenmrsSpaBase(),"")):()=>t}(r),t)):console.warn(`A registered page definition is missing a component and thus cannot be registered.
32
- To fix this, ensure that you define the "component" field inside the page definition.`,e)}(n,t)}}let hK={PHONE_MIN:0,PHONE_MAX:600,TABLET_MIN:601,TABLET_MAX:1023,SMALL_DESKTOP_MIN:1024,SMALL_DESKTOP_MAX:1439,LARGE_DESKTOP_MIN:1440,LARGE_DESKTOP_MAX:Number.MAX_SAFE_INTEGER};function hH(){document.body.classList.toggle("omrs-breakpoint-lt-tablet",window.innerWidth<hK.TABLET_MIN),document.body.classList.toggle("omrs-breakpoint-gt-phone",window.innerWidth>hK.PHONE_MAX),document.body.classList.toggle("omrs-breakpoint-gt-tablet",window.innerWidth>hK.TABLET_MAX),document.body.classList.toggle("omrs-breakpoint-lt-desktop",window.innerWidth<hK.SMALL_DESKTOP_MIN),document.body.classList.toggle("omrs-breakpoint-lt-small-desktop",window.innerWidth<hK.SMALL_DESKTOP_MIN),document.body.classList.toggle("omrs-breakpoint-lt-large-desktop",window.innerWidth<hK.LARGE_DESKTOP_MIN),document.body.classList.toggle("omrs-breakpoint-gt-small-desktop",window.innerWidth>hK.SMALL_DESKTOP_MAX)}let hz=!1;function hG(){hz||(window.addEventListener("resize",hH),hH(),hz=!0)}var hq=r(4848),hY=r(6942),hZ=r.n(hY);function hJ({title:e,children:t}){let r="tablet"===hd();return(0,hq.jsxs)("div",{className:hZ()({"-esm-billing__card-header-module__tabletHeader___rUYi0":r,"-esm-billing__card-header-module__desktopHeader___CDa37":!r}),children:[(0,hq.jsx)("h4",{children:e}),t]})}let hX=["red","magenta","purple","blue","teal","cyan","gray","green","warm-gray","cool-gray","high-contrast","outline"],hQ={primaryColor:{_type:tL.String,_description:"The color for displaying primary diagnoses tags",_default:"red",_validators:[rK.oneOf(hX)]},secondaryColor:{_type:tL.String,_description:"The color for displaying secondary diagnoses tags",_default:"blue",_validators:[rK.oneOf(hX)]}},h0={"Brand color #1":{_default:"#005d5d",_type:tL.String},"Brand color #2":{_default:"#004144",_type:tL.String},"Brand color #3":{_default:"#007d79",_type:tL.String},excludePatientIdentifierCodeTypes:{uuids:{_type:tL.Array,_description:"List of UUIDs of patient identifier types to exclude from rendering in the patient banner",_default:[],_elements:{_type:tL.UUID}}},implementationName:{_type:tL.String,_description:"A name of the place (or authority) where all possible locations a user can choose are located.",_default:"Clinic"},patientPhotoConceptUuid:{_type:tL.ConceptUuid,_default:"736e8771-e501-4615-bfa7-570c03f4bef5",_description:"Used to look up the patient photo, which is stored as an attachment obs. Set to `null` in order to disable the feature and use only generated avatars. To remove the avatars entirely, use extension configuration's `remove` feature."},preferredCalendar:{_type:tL.Object,_description:"Keys should be locale codes, and values should be the preferred calendar for that locale. For example, {'am': 'ethiopic'}.",_default:{am:"ethiopic"},_elements:{_validators:[rK.oneOf(["buddhist","chinese","coptic","dangi","ethioaa","ethiopic","gregory","hebrew","indian","islamic","islamic-umalqura","islamic-tbla","islamic-civil","islamic-rgsa","iso8601","japanese","persian","roc","islamicc"])]}},preferredDateLocale:{_type:tL.Object,_description:"Allows setting the locale used for date formatting for any browser locale. Does not affect time formatting. Keys should be locale codes, and values should be the preferred locale for formatting dates. For example, {'en': 'en-US', 'fr-CA': 'en-CA'}.",_default:{en:"en-GB"},_elements:{_type:tL.String}},diagnosisTags:hQ};var h1=r(6800);let h3={"carbon.table.batch.cancel":"cancel","carbon.table.batch.items.selected":"batchActionsItemsSelected","carbon.table.batch.item.selected":"batchActionItemSelected","carbon.table.batch.selectAll":"selectAll"},h4=e=>(0,hq.jsx)(h1.GGC,{translateWithId:(e,t)=>{let r=h3[e];return r?oR(r,e,t):e},...e}),h2="-esm-billing__custom-overflow-menu-module__container___lY3iq",h6="-esm-billing__custom-overflow-menu-module__menu___dReHr",h5="-esm-billing__custom-overflow-menu-module__show___48R0e",h8="-esm-billing__custom-overflow-menu-module__overflowMenuButton___tsY8r",h9=(0,pq.createContext)(null);function h7(){let e=(0,pq.useContext)(h9);if(!e)throw Error("useCustomOverflowMenu must be used within a CustomOverflowMenu");return e}function me({menuTitle:e,children:t}){let[r,n]=pY().useState(!1),i=hy(()=>n(!1),r),o="tablet"===hd(),a=(0,pq.useCallback)(()=>n(e=>!e),[]),s=(0,pq.useRef)(null),l=(0,pq.useRef)(null),u=(0,pq.useId)(),c=`custom-overflow-menu-trigger-${u}`,d=`custom-overflow-menu-${u}`,p=(0,pq.useCallback)(()=>{n(!1),s.current?.focus()},[]),f=(0,pq.useMemo)(()=>({closeMenu:p}),[p]),h=(0,pq.useCallback)(e=>{"Escape"===e.key&&r&&(e.stopPropagation(),p())},[p,r]),m=pq.Children.toArray(t);(0,pq.useEffect)(()=>{if(r&&l.current){let e=l.current.querySelector('[role="menuitem"]:not([disabled])');e?.focus()}},[r]);let y=(0,pq.useCallback)(({currentIndex:e,direction:t})=>{let r=l.current?.querySelectorAll('[role="menuitem"]:not([disabled])');if(!r?.length)return;let n=document.activeElement?.closest?.('[role="menuitem"]')??document.activeElement,i=Array.from(r).indexOf(n);if(-1===i)return void r[t>0?0:r.length-1]?.focus();let o=i+t,a=o<0?r.length-1:o>=r.length?0:o;r[a]?.focus()},[]),g=m.map((e,t)=>(0,pq.isValidElement)(e)?(0,pq.cloneElement)(e,{closeMenu:p,handleOverflowMenuItemFocus:y,index:t}):e);return(0,hq.jsxs)("div",{"data-overflow-menu":!0,className:hZ()("cds--overflow-menu",h2),ref:i,children:[(0,hq.jsx)("button",{className:hZ()("cds--btn","cds--btn--ghost","cds--overflow-menu__trigger",{"cds--overflow-menu--open":r},h8),"aria-controls":d,"aria-expanded":r,"aria-haspopup":"true",id:c,onClick:a,onKeyDown:h,ref:s,children:e}),(0,hq.jsxs)("div",{className:hZ()("cds--overflow-menu-options","cds--overflow-menu--flip",h6,{[h5]:r}),"aria-labelledby":c,"data-floating-menu-direction":"bottom",id:d,onKeyDown:h,ref:l,role:"menu",tabIndex:-1,children:[(0,hq.jsx)("ul",{className:hZ()("cds--overflow-menu-options__content",{"cds--overflow-menu-options--lg":o}),children:(0,hq.jsx)(h9.Provider,{value:f,children:g})}),(0,hq.jsx)("span",{})]})]})}function mt(e){let t=(0,pq.useContext)(h9);return(0,hq.jsx)(h1.XSD,{...e,closeMenu:t?.closeMenu})}var mr=r(7767),mn=r(4976);let mi=["omrs-icon-activity","omrs-icon-add","omrs-icon-arrow-down","omrs-icon-arrow-left","omrs-icon-arrow-right","omrs-icon-arrow-up","omrs-icon-baby","omrs-icon-calendar-heat-map","omrs-icon-calendar","omrs-icon-caret-down","omrs-icon-caret-left","omrs-icon-caret-right","omrs-icon-caret-up","omrs-icon-chart-average","omrs-icon-chart-line","omrs-icon-checkmark-filled","omrs-icon-checkmark-outline","omrs-icon-chemistry","omrs-icon-chevron-down","omrs-icon-chevron-left","omrs-icon-chevron-right","omrs-icon-chevron-up","omrs-icon-close","omrs-icon-close-filled","omrs-icon-close-outline","omrs-icon-document","omrs-icon-document-attachment","omrs-icon-download","omrs-icon-drug-order","omrs-icon-edit","omrs-icon-event-schedule","omrs-icon-events","omrs-icon-gender-female","omrs-icon-gender-male","omrs-icon-gender-other","omrs-icon-gender-unknown","omrs-icon-generic-order-type","omrs-icon-group","omrs-icon-group-access","omrs-icon-hospital-bed","omrs-icon-image-medical","omrs-icon-information","omrs-icon-information-filled","omrs-icon-information-square","omrs-icon-inventory-management","omrs-icon-lab-order","omrs-icon-list-checked","omrs-icon-location","omrs-icon-material-order","omrs-icon-maximize","omrs-icon-medication","omrs-icon-message-queue","omrs-icon-microscope","omrs-icon-mobile-check","omrs-icon-money","omrs-icon-mother","omrs-icon-movement","omrs-icon-overflow-menu--horizontal","omrs-icon-overflow-menu--vertical","omrs-icon-password","omrs-icon-pedestrian-family","omrs-icon-pen","omrs-icon-printer","omrs-icon-procedure-order","omrs-icon-programs","omrs-icon-renew","omrs-icon-referral-order","omrs-icon-report","omrs-icon-reset","omrs-icon-save","omrs-icon-search","omrs-icon-settings","omrs-icon-shopping-cart","omrs-icon-shopping-cart--arrow-down","omrs-icon-sticky-note-add","omrs-icon-switcher","omrs-icon-syringe","omrs-icon-table-of-contents","omrs-icon-table","omrs-icon-time","omrs-icon-tools","omrs-icon-translate","omrs-icon-trash-can","omrs-icon-tree-view--alt","omrs-icon-two-factor-authentication","omrs-icon-user-avatar","omrs-icon-user-follow","omrs-icon-user-xray","omrs-icon-user","omrs-icon-view-off","omrs-icon-view","omrs-icon-warning"],mo=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-activity",iconProps:e})})),ma=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-add",iconProps:e})})),ms=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-arrow-down",iconProps:e})})),ml=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-arrow-left",iconProps:e})})),mu=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-arrow-right",iconProps:e})})),mc=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-arrow-up",iconProps:e})})),md=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-baby",iconProps:e})})),mp=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-calendar-heat-map",iconProps:e})})),mf=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-calendar",iconProps:e})})),mh=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-caret-down",iconProps:e})})),mm=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-caret-left",iconProps:e})})),my=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-caret-right",iconProps:e})})),mg=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-caret-up",iconProps:e})})),mb=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-chart-average",iconProps:e})})),mv=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-chart-line",iconProps:e})})),mw=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-checkmark-filled",iconProps:e})})),m_=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-checkmark-outline",iconProps:e})})),mx=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-chemistry",iconProps:e})})),mE=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-chevron-down",iconProps:e})})),mS=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-chevron-left",iconProps:e})})),mD=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-chevron-right",iconProps:e})})),mO=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-chevron-up",iconProps:e})})),mP=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-close",iconProps:e})})),mC=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-close-filled",iconProps:e})})),mk=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-close-outline",iconProps:e})})),mj=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-document",iconProps:e})})),mT=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-document-attachment",iconProps:e})})),mR=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-download",iconProps:e})})),mA=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-drug-order",iconProps:e})})),mN=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-edit",iconProps:e})})),mM=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-event-schedule",iconProps:e})})),mI=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-events",iconProps:e})})),m$=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-gender-female",iconProps:e})})),mL=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-gender-male",iconProps:e})})),mF=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-gender-other",iconProps:e})})),mB=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-gender-unknown",iconProps:e})})),mV=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-generic-order-type",iconProps:e})})),mU=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-group",iconProps:e})})),mW=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-group-access",iconProps:e})})),mK=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-hospital-bed",iconProps:e})})),mH=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-image-medical",iconProps:e})})),mz=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-information",iconProps:e})})),mG=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-information-filled",iconProps:e})})),mq=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-information-square",iconProps:e})})),mY=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-inventory-management",iconProps:e})})),mZ=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-lab-order",iconProps:e})})),mJ=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-list-checked",iconProps:e})})),mX=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-location",iconProps:e})})),mQ=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-material-order",iconProps:e})})),m0=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-maximize",iconProps:e})})),m1=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-medication",iconProps:e})})),m3=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-message-queue",iconProps:e})})),m4=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-microscope",iconProps:e})})),m2=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-mobile-check",iconProps:e})})),m6=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-money",iconProps:e})})),m5=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-mother",iconProps:e})})),m8=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-movement",iconProps:e})})),m9=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-overflow-menu--horizontal",iconProps:e})})),m7=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-overflow-menu--horizontal",iconProps:e})})),ye=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-password",iconProps:e})})),yt=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-pedestrian-family",iconProps:e})})),yr=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-pen",iconProps:e})})),yn=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-printer",iconProps:e})})),yi=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-procedure-order",iconProps:e})})),yo=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-programs",iconProps:e})})),ya=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-referral-order",iconProps:e})})),ys=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-renew",iconProps:e})})),yl=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-report",iconProps:e})})),yu=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-reset",iconProps:e})})),yc=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-save",iconProps:e})})),yd=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-search",iconProps:e})})),yp=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-settings",iconProps:e})})),yf=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-switcher",iconProps:e})})),yh=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-shopping-cart",iconProps:e})})),ym=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-shopping-cart--arrow-down",iconProps:e})})),yy=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-sticky-note-add",iconProps:e})})),yg=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-syringe",iconProps:e})})),yb=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-table-of-contents",iconProps:e})})),yv=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-table",iconProps:e})})),yw=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-time",iconProps:e})})),y_=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-tools",iconProps:e})})),yx=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-translate",iconProps:e})})),yE=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-trash-can",iconProps:e})})),yS=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-tree-view--alt",iconProps:e})})),yD=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-two-factor-authentication",iconProps:e})})),yO=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-user-avatar",iconProps:e})})),yP=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-user-follow",iconProps:e})})),yC=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-user-xray",iconProps:e})})),yk=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-user",iconProps:e})})),yj=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-view-off",iconProps:e})})),yT=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-view",iconProps:e})})),yR=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-warning",iconProps:e})})),yA=yR,yN=mT,yM=mJ,yI=mH,y$=ym,yL=(0,pq.memo)((0,pq.forwardRef)(function({icon:e,fallback:t,...r},n){let i=(0,pq.useRef)(e?document.getElementById(e):void 0);return(0,pq.useEffect)(()=>{let t=document.getElementById("omrs-svgs-container"),r=new MutationObserver(t=>{for(let r of t)"childList"===r.type&&(i.current=e?document.getElementById(e):void 0)});return t&&r.observe(t,{childList:!0}),()=>r.disconnect()},[e]),(0,hq.jsx)(f$,{value:i.current,fallback:t,children:(0,hq.jsx)(yF,{ref:n,icon:e,iconProps:r})})})),yF=(0,pq.memo)((0,pq.forwardRef)(function({icon:e,iconProps:t},r){let{className:n,fill:i,size:o}=Object.assign({},{fill:"currentColor",size:20},t);(o<=0||o>72)&&(console.error(`Invalid size '${o}' specified for ${e}. Defaulting to 20.`),o=20);let a=(0,pq.useRef)(null);return(0,pq.useImperativeHandle)(r,()=>a.current),(0,pq.useEffect)(()=>{a.current&&"currentColor"!==i&&a.current.style.setProperty("--omrs-icon-fill",i)},[]),(0,hq.jsx)("svg",{ref:a,className:hZ()("omrs-icon","-esm-billing__icons-module__icon___sq7Qp",n),height:o,width:o,viewBox:"0 0 16 16",children:(0,hq.jsx)("use",{href:`#${e}`})})})),yB=({path:e,title:t,basePath:r,icon:n})=>{let{t:i}=(0,fg.useTranslation)(),o=(0,mr.zy)(),a=(0,pq.useMemo)(()=>{if(!e)return!1;let t=e.startsWith("/")?e.slice(1):e;if(t.startsWith("http"))return t===window.location.href;let r=t.split("/").map(e=>decodeURIComponent(e)),n=(o.pathname??"").split("/").slice(1).map(e=>decodeURIComponent(e));return n.some((e,t)=>r.every((e,r)=>n[t+r]===e))},[o.pathname,e]);return(0,hq.jsx)("div",{children:(0,hq.jsx)(pJ,{className:hZ()("cds--side-nav__link",{"active-left-nav-link":a}),to:`${r}/${encodeURIComponent(e)}`,children:(0,hq.jsxs)("span",{className:"-esm-billing__dashboard-module__menu___Lg1M+",children:[(0,hq.jsx)(yL,{icon:n,className:"-esm-billing__dashboard-module__icon___Y2DxK",size:16}),(0,hq.jsx)("span",{children:i(t)})]})})},e)};function yV(e){return function({basePath:t}){return(0,hq.jsx)(mn.Kd,{children:(0,hq.jsx)(yB,{basePath:t,...e})})}}function yU(e){let t=(0,pq.useRef)(null),r=(0,pq.useRef)(void 0),n=(0,pq.useCallback)(t=>{if("function"==typeof e){let r=e(t);return()=>{"function"==typeof r?r():e(null)}}if(e)return e.current=t,()=>{e.current=null}},[e]);return(0,pq.useMemo)(()=>({get current(){return t.current},set current(value){t.current=value,r.current&&(r.current(),r.current=void 0),null!=value&&(r.current=n(value))}}),[n])}function yW(...e){return 1===e.length&&e[0]?e[0]:t=>{let r=!1,n=e.map(e=>{let n=yK(e,t);return r||="function"==typeof n,n});if(r)return()=>{n.forEach((t,r)=>{"function"==typeof t?t():yK(e[r],null)})}}}function yK(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function yH(...e){return(...t)=>{for(let r of e)"function"==typeof r&&r(...t)}}let yz="u">typeof document?pY().useLayoutEffect:()=>{},yG={prefix:String(Math.round(1e10*Math.random())),current:0},yq=pY().createContext(yG),yY=pY().createContext(!1),yZ=("u">typeof window&&window.document&&window.document.createElement,new WeakMap),yJ="function"==typeof pY().useId?function(e){let t=pY().useId(),[r]=(0,pq.useState)(y1()),n=r?"react-aria":`react-aria${yG.prefix}`;return e||`${n}-${t}`}:function(e){let t=(0,pq.useContext)(yq),r=function(e=!1){let t=(0,pq.useContext)(yq),r=(0,pq.useRef)(null);if(null===r.current&&!e){let e=pY().__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED?.ReactCurrentOwner?.current;if(e){let r=yZ.get(e);null==r?yZ.set(e,{id:t.current,state:e.memoizedState}):e.memoizedState!==r.state&&(t.current=r.id,yZ.delete(e))}r.current=++t.current}return r.current}(!!e),n=`react-aria${t.prefix}`;return e||`${n}-${r}`};function yX(){return!1}function yQ(){return!0}function y0(e){return()=>{}}function y1(){return"function"==typeof pY().useSyncExternalStore?pY().useSyncExternalStore(y0,yX,yQ):(0,pq.useContext)(yY)}let y3=!!("u">typeof window&&window.document&&window.document.createElement),y4=new Map;function y2(e){let[t,r]=(0,pq.useState)(e),n=(0,pq.useRef)(null),i=yJ(t),o=(0,pq.useRef)(null);if(l&&l.register(o,i),y3){let e=y4.get(i);e&&!e.includes(n)?e.push(n):y4.set(i,[n])}return yz(()=>()=>{l&&l.unregister(o),y4.delete(i)},[i]),(0,pq.useEffect)(()=>{let e=n.current;return e&&r(e),()=>{e&&(n.current=null)}}),i}function y6(e=[]){let t=y2(),[r,n]=function(e){let[t,r]=(0,pq.useState)(e),n=(0,pq.useRef)(t),i=(0,pq.useRef)(null),o=(0,pq.useRef)(()=>{if(!i.current)return;let e=i.current.next();if(e.done){i.current=null;return}n.current===e.value?o.current():r(e.value)});return yz(()=>{n.current=t,i.current&&o.current()}),[t,(0,pq.useCallback)(e=>{i.current=e(n.current),o.current()},[o])]}(t),i=(0,pq.useCallback)(()=>{n(function*(){yield t,yield document.getElementById(t)?t:void 0})},[t,n]);return yz(i,[t,i,...e]),r}"u">typeof FinalizationRegistry&&(l=new FinalizationRegistry(e=>{y4.delete(e)}));let y5=function(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=function e(t){var r,n,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t)if(Array.isArray(t)){var o=t.length;for(r=0;r<o;r++)t[r]&&(n=e(t[r]))&&(i&&(i+=" "),i+=n)}else for(n in t)t[n]&&(i&&(i+=" "),i+=n);return i}(e))&&(n&&(n+=" "),n+=t);return n};function y8(...e){let t={...e[0]};for(let r=1;r<e.length;r++){let n=e[r];for(let e in n){let r=t[e],i=n[e];"function"==typeof r&&"function"==typeof i&&"o"===e[0]&&"n"===e[1]&&e.charCodeAt(2)>=65&&90>=e.charCodeAt(2)?t[e]=yH(r,i):("className"===e||"UNSAFE_className"===e)&&"string"==typeof r&&"string"==typeof i?t[e]=y5(r,i):"id"===e&&r&&i?t.id=function(e,t){if(e===t)return e;let r=y4.get(e);if(r)return r.forEach(e=>e.current=t),t;let n=y4.get(t);return n?(n.forEach(t=>t.current=e),e):t}(r,i):"ref"===e&&r&&i?t.ref=yW(r,i):t[e]=void 0!==i?i:r}}return t}let y9=Symbol("default");function y7({values:e,children:t}){for(let[r,n]of e)t=pY().createElement(r.Provider,{value:n},t);return t}function ge(e){let{className:t,style:r,children:n,defaultClassName:i,defaultChildren:o,defaultStyle:a,values:s}=e;return(0,pq.useMemo)(()=>{let e,l,u;return e="function"==typeof t?t({...s,defaultClassName:i}):t,l="function"==typeof r?r({...s,defaultStyle:a||{}}):r,u="function"==typeof n?n({...s,defaultChildren:o}):null==n?o:n,{className:null!=e?e:i,style:l||a?{...a,...l}:void 0,children:null!=u?u:o,"data-rac":""}},[t,r,n,i,o,a,s])}function gt(e,t){let r=(0,pq.useContext)(e);if(null===t)return null;if(r&&"object"==typeof r&&"slots"in r&&r.slots){let e=t||y9;if(!r.slots[e]){let e=new Intl.ListFormat().format(Object.keys(r.slots).map(e=>`"${e}"`)),n=t?`Invalid slot "${t}".`:"A slot prop is required.";throw Error(`${n} Valid slot names are ${e}.`)}return r.slots[e]}return r}function gr(e,t,r){let{ref:n,...i}=gt(r,e.slot)||{},o=yU((0,pq.useMemo)(()=>yW(t,n),[t,n])),a=y8(i,e);return"style"in i&&i.style&&"style"in e&&e.style&&("function"==typeof i.style||"function"==typeof e.style?a.style=t=>{let r="function"==typeof i.style?i.style(t):i.style,n={...t.defaultStyle,...r},o="function"==typeof e.style?e.style({...t,defaultStyle:n}):e.style;return{...n,...o}}:a.style={...i.style,...e.style}),[a,o]}function gn(e=!0){let[t,r]=(0,pq.useState)(e),n=(0,pq.useRef)(!1),i=(0,pq.useCallback)(e=>{n.current=!0,r(!!e)},[]);return yz(()=>{n.current||r(!1)},[]),[i,t]}function gi(e){let t=/^(data-.*)$/,r={};for(let n in e)t.test(n)||(r[n]=e[n]);return r}let go=(0,pq.createContext)(null),ga=null;function gs(e,t="assertive",r=7e3){ga?ga.announce(e,t,r):(ga=new gl,("boolean"==typeof IS_REACT_ACT_ENVIRONMENT?IS_REACT_ACT_ENVIRONMENT:"u">typeof jest)?ga.announce(e,t,r):setTimeout(()=>{(null==ga?void 0:ga.isAttached())&&(null==ga||ga.announce(e,t,r))},100))}class gl{isAttached(){var e;return null==(e=this.node)?void 0:e.isConnected}createLog(e){let t=document.createElement("div");return t.setAttribute("role","log"),t.setAttribute("aria-live",e),t.setAttribute("aria-relevant","additions"),t}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(e,t="assertive",r=7e3){var n,i;if(!this.node)return;let o=document.createElement("div");"object"==typeof e?(o.setAttribute("role","img"),o.setAttribute("aria-labelledby",e["aria-labelledby"])):o.textContent=e,"assertive"===t?null==(n=this.assertiveLog)||n.appendChild(o):null==(i=this.politeLog)||i.appendChild(o),""!==e&&setTimeout(()=>{o.remove()},r)}clear(e){this.node&&((!e||"assertive"===e)&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!e||"polite"===e)&&this.politeLog&&(this.politeLog.innerHTML=""))}constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,"u">typeof document&&(this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,{border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"}),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}}let gu=new Set(["id"]),gc=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),gd=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),gp=new Set(["dir","lang","hidden","inert","translate"]),gf=new Set(["onClick","onAuxClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onGotPointerCapture","onLostPointerCapture","onScroll","onWheel","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionCancel","onTransitionEnd","onTransitionRun","onTransitionStart"]),gh=/^(data-.*)$/;function gm(e,t={}){let{labelable:r,isLink:n,global:i,events:o=i,propNames:a}=t,s={};for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(gu.has(t)||r&&gc.has(t)||n&&gd.has(t)||i&&gp.has(t)||o&&(gf.has(t)||t.endsWith("Capture")&&gf.has(t.slice(0,-7)))||a?.has(t)||gh.test(t))&&(s[t]=e[t]);return s}function gy(e){if(function(){if(null==gg){gg=!1;try{document.createElement("div").focus({get preventScroll(){return gg=!0,!0}})}catch{}}return gg}())e.focus({preventScroll:!0});else{let t=function(e){let t=e.parentNode,r=[],n=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==n;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&r.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return n instanceof HTMLElement&&r.push({element:n,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft}),r}(e);e.focus(),function(e){for(let{element:t,scrollTop:r,scrollLeft:n}of e)t.scrollTop=r,t.scrollLeft=n}(t)}}let gg=null,gb=e=>e?.ownerDocument??document,gv=e=>e&&"window"in e&&e.window===e?e:gb(e).defaultView||window;function gw(e,t){return!!t&&!!e&&e.contains(t)}function g_(e){return e.target}function gx(e){if(!e)return!1;let t=e.getRootNode(),r=gv(e);if(!(t instanceof r.Document||t instanceof r.ShadowRoot))return!1;let n=t.activeElement;return null!=n&&e.contains(n)}let gE="u">typeof Element&&"checkVisibility"in Element.prototype;function gS(e,t){return gE?e.checkVisibility({visibilityProperty:!0})&&!e.closest("[data-react-aria-prevent-focus]"):"#comment"!==e.nodeName&&function(e){let t=gv(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:r,visibility:n}=e.style,i="none"!==r&&"hidden"!==n&&"collapse"!==n;if(i){let{getComputedStyle:t}=e.ownerDocument.defaultView,{display:r,visibility:n}=t(e);i="none"!==r&&"hidden"!==n&&"collapse"!==n}return i}(e)&&!e.hasAttribute("hidden")&&!e.hasAttribute("data-react-aria-prevent-focus")&&("DETAILS"!==e.nodeName||!t||"SUMMARY"===t.nodeName||e.hasAttribute("open"))&&(!e.parentElement||gS(e.parentElement,e))}let gD=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])',"permission"],gO=gD.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";gD.push('[tabindex]:not([tabindex="-1"]):not([disabled])');let gP=gD.join(':not([hidden]):not([tabindex="-1"]),');function gC(e,t){return e.matches(gO)&&!gj(e)&&(t?.skipVisibilityCheck||gS(e))}function gk(e){return e.matches(gP)&&gS(e)&&!gj(e)}function gj(e){let t=e;for(;null!=t;){if(t instanceof t.ownerDocument.defaultView.HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}function gT(e){return e.nativeEvent=e,e.isDefaultPrevented=()=>e.defaultPrevented,e.isPropagationStopped=()=>e.cancelBubble,e.persist=()=>{},e}function gR(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function gA(e){let t=(0,pq.useRef)({isFocused:!1,observer:null});return yz(()=>{let e=t.current;return()=>{e.observer&&(e.observer.disconnect(),e.observer=null)}},[]),(0,pq.useCallback)(r=>{let n=g_(r);(n instanceof HTMLButtonElement||n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement)&&(t.current.isFocused=!0,n.addEventListener("focusout",r=>{if(t.current.isFocused=!1,n.disabled){let t=gT(r);e?.(t)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)},{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&n.disabled){t.current.observer?.disconnect();let e=n===((e=document)=>e.activeElement)()?null:((e=document)=>e.activeElement)();n.dispatchEvent(new FocusEvent("blur",{relatedTarget:e})),n.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:e}))}}),t.current.observer.observe(n,{attributes:!0,attributeFilter:["disabled"]}))},[e])}let gN=!1;function gM(e){if("u"<typeof window||null==window.navigator)return!1;let t=window.navigator.userAgentData?.brands;return Array.isArray(t)&&t.some(t=>e.test(t.brand))||e.test(window.navigator.userAgent)}function gI(e){return"u">typeof window&&null!=window.navigator&&e.test(window.navigator.userAgentData?.platform||window.navigator.platform)}function g$(e){let t=null;return()=>(null==t&&(t=e()),t)}let gL=g$(function(){return gI(/^Mac/i)}),gF=g$(function(){return gI(/^iPhone/i)}),gB=g$(function(){return gI(/^iPad/i)||gL()&&navigator.maxTouchPoints>1}),gV=g$(function(){return gF()||gB()});g$(function(){return gL()||gV()});let gU=g$(function(){return gM(/AppleWebKit/i)&&!gW()}),gW=g$(function(){return gM(/Chrome/i)}),gK=g$(function(){return gM(/Android/i)}),gH=g$(function(){return gM(/Firefox/i)});function gz(e){return""===e.pointerType&&!!e.isTrusted||(gK()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function gG(e,t,r=!0){let{metaKey:n,ctrlKey:i,altKey:o,shiftKey:a}=t;gH()&&window.event?.type?.startsWith("key")&&"_blank"===e.target&&(gL()?n=!0:i=!0);let s=gU()&&gL()&&!gB()&&1?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:n,ctrlKey:i,altKey:o,shiftKey:a}):new MouseEvent("click",{metaKey:n,ctrlKey:i,altKey:o,shiftKey:a,detail:1,bubbles:!0,cancelable:!0});gG.isOpening=r,gy(e),e.dispatchEvent(s),gG.isOpening=!1}gG.isOpening=!1;let gq=null,gY=new Set,gZ=new Map,gJ=!1,gX=!1,gQ={Tab:!0,Escape:!0};function g0(e,t){for(let r of gY)r(e,t)}function g1(e){gJ=!0,gG.isOpening||e.metaKey||!gL()&&e.altKey||e.ctrlKey||"Control"===e.key||"Shift"===e.key||"Meta"===e.key||(gq="keyboard",g0("keyboard",e))}function g3(e){gq="pointer","pointerType"in e&&e.pointerType,("mousedown"===e.type||"pointerdown"===e.type)&&(gJ=!0,g0("pointer",e))}function g4(e){!gG.isOpening&&gz(e)&&(gJ=!0,gq="virtual")}function g2(e){let t=gv(g_(e)),r=gb(g_(e));g_(e)!==t&&g_(e)!==r&&!gN&&e.isTrusted&&(gJ||gX||(gq="virtual",g0("virtual",e)),gJ=!1,gX=!1)}function g6(){gN||(gJ=!1,gX=!0)}function g5(e){if("u"<typeof window||"u"<typeof document)return;let t=gv(e),r=gb(e);if(gZ.get(t))return;let n=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){gJ=!0,n.apply(this,arguments)},r.addEventListener("keydown",g1,!0),r.addEventListener("keyup",g1,!0),r.addEventListener("click",g4,!0),t.addEventListener("focus",g2,!0),t.addEventListener("blur",g6,!1),"u">typeof PointerEvent&&(r.addEventListener("pointerdown",g3,!0),r.addEventListener("pointermove",g3,!0),r.addEventListener("pointerup",g3,!0)),t.addEventListener("beforeunload",()=>{g8(e)},{once:!0}),gZ.set(t,{focus:n})}let g8=(e,t)=>{let r=gv(e),n=gb(e);t&&n.removeEventListener("DOMContentLoaded",t),gZ.has(r)&&(r.HTMLElement.prototype.focus=gZ.get(r).focus,n.removeEventListener("keydown",g1,!0),n.removeEventListener("keyup",g1,!0),n.removeEventListener("click",g4,!0),r.removeEventListener("focus",g2,!0),r.removeEventListener("blur",g6,!1),"u">typeof PointerEvent&&(n.removeEventListener("pointerdown",g3,!0),n.removeEventListener("pointermove",g3,!0),n.removeEventListener("pointerup",g3,!0)),gZ.delete(r))};function g9(){return"pointer"!==gq}"u">typeof document&&("loading"!==(f=gb(void 0)).readyState?g5(void 0):f.addEventListener("DOMContentLoaded",()=>{g5(void 0)}));let g7=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]),be=new Map,bt=new Set;function br(){if("u"<typeof window)return;function e(e){return"propertyName"in e}let t=r=>{let n=g_(r);if(!e(r)||!n)return;let i=be.get(n);if(i&&(i.delete(r.propertyName),0===i.size&&(n.removeEventListener("transitioncancel",t),be.delete(n)),0===be.size)){for(let e of bt)e();bt.clear()}};document.body.addEventListener("transitionrun",r=>{let n=g_(r);if(!e(r)||!n)return;let i=be.get(n);i||(i=new Set,be.set(n,i),n.addEventListener("transitioncancel",t,{once:!0})),i.add(r.propertyName)}),document.body.addEventListener("transitionend",t)}function bn(e){requestAnimationFrame(()=>{for(let[e]of be)"isConnected"in e&&!e.isConnected&&be.delete(e);0===be.size?e():bt.add(e)})}function bi(e){if(!e.isConnected)return;let t=gb(e);if("virtual"===gq){let r=((e=document)=>e.activeElement)(t);bn(()=>{let n=((e=document)=>e.activeElement)(t);(n===r||n===t.body)&&e.isConnected&&gy(e)})}else gy(e)}function bo(e){let{isDisabled:t,onFocus:r,onBlur:n,onFocusChange:i}=e,o=(0,pq.useCallback)(e=>{if(g_(e)===e.currentTarget)return n&&n(e),i&&i(!1),!0},[n,i]),a=gA(o),s=(0,pq.useCallback)(e=>{let t=g_(e),n=gb(t),o=n?((e=document)=>e.activeElement)(n):((e=document)=>e.activeElement)();t===e.currentTarget&&t===o&&(r&&r(e),i&&i(!0),a(e))},[i,r,a]);return{focusProps:{onFocus:!t&&(r||i||n)?s:void 0,onBlur:!t&&(n||i)?o:void 0}}}function ba(e){if(!e)return;let t=!0;return r=>{e({...r,preventDefault(){r.preventDefault()},isDefaultPrevented:()=>r.isDefaultPrevented(),stopPropagation(){t=!0},continuePropagation(){t=!1},isPropagationStopped:()=>t}),t&&r.stopPropagation()}}function bs(e,t){yz(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}"u">typeof document&&("loading"!==document.readyState?br():document.addEventListener("DOMContentLoaded",br));let bl=pY().createContext(null);function bu(e,t){let{focusProps:r}=bo(e),{keyboardProps:n}={keyboardProps:e.isDisabled?{}:{onKeyDown:ba(e.onKeyDown),onKeyUp:ba(e.onKeyUp)}},i=y8(r,n),o=function(e){let t=(0,pq.useContext)(bl)||{};bs(t,e);let{ref:r,...n}=t;return n}(t),a=e.isDisabled?{}:o,s=(0,pq.useRef)(e.autoFocus);(0,pq.useEffect)(()=>{s.current&&t.current&&bi(t.current),s.current=!1},[t]);let l=e.excludeFromTabOrder?-1:0;return e.isDisabled&&(l=void 0),{focusableProps:y8({...i,tabIndex:l},a)}}pY().forwardRef(function(e,t){let{children:r,...n}=e,i=yU(t),o={...n,ref:i};return pY().createElement(bl.Provider,{value:o},r)});let bc="default",bd="",bp=new WeakMap;function bf(e){if(gV())"disabled"===bc&&(bc="restoring",setTimeout(()=>{bn(()=>{if("restoring"===bc){let t=gb(e);"none"===t.documentElement.style.webkitUserSelect&&(t.documentElement.style.webkitUserSelect=bd||""),bd="",bc="default"}})},300));else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&bp.has(e)){let t=bp.get(e),r="userSelect"in e.style?"userSelect":"webkitUserSelect";"none"===e.style[r]&&(e.style[r]=t),""===e.getAttribute("style")&&e.removeAttribute("style"),bp.delete(e)}}function bh(e){let t=e?.defaultView;return t?.__webpack_nonce__||globalThis.__webpack_nonce__||void 0}let bm=new WeakMap;function by(e){let t=e??("u">typeof document?document:void 0);if(!t)return bh(t);if(bm.has(t))return bm.get(t);let r=t.querySelector('meta[property="csp-nonce"]'),n=r&&r instanceof gv(r).HTMLMetaElement&&(r.nonce||r.content)||bh(t)||void 0;return void 0!==n&&bm.set(t,n),n}let bg=pY().createContext({register:()=>{}});bg.displayName="PressResponderContext";let bb=pY().useInsertionEffect??yz;function bv(e){let t=(0,pq.useRef)(null);return bb(()=>{t.current=e},[e]),(0,pq.useCallback)((...e)=>{let r=t.current;return r?.(...e)},[])}function bw(){let e=(0,pq.useRef)(new Map),t=(0,pq.useCallback)((t,r,n,i)=>{let o=i?.once?(...t)=>{e.current.delete(n),n(...t)}:n;e.current.set(n,{type:r,eventTarget:t,fn:o,options:i}),t.addEventListener(r,o,i)},[]),r=(0,pq.useCallback)((t,r,n,i)=>{let o=e.current.get(n)?.fn||n;t.removeEventListener(r,o,i),e.current.delete(n)},[]),n=(0,pq.useCallback)(()=>{e.current.forEach((e,t)=>{r(e.eventTarget,e.type,t,e.options)})},[r]);return(0,pq.useEffect)(()=>n,[n]),{addGlobalListener:t,removeGlobalListener:r,removeAllGlobalListeners:n}}var b_=r(7643),bx=r.n(b_);class bE{#e;constructor(e,t,r,n){this.#e=!0;let i=n?.target??r.currentTarget;const o=i?.getBoundingClientRect();let a,s=0,l,u=null;null!=r.clientX&&null!=r.clientY&&(l=r.clientX,u=r.clientY),o&&(null!=l&&null!=u?(a=l-o.left,s=u-o.top):(a=o.width/2,s=o.height/2)),this.type=e,this.pointerType=t,this.target=r.currentTarget,this.shiftKey=r.shiftKey,this.metaKey=r.metaKey,this.ctrlKey=r.ctrlKey,this.altKey=r.altKey,this.x=a,this.y=s,this.key=r.key}continuePropagation(){this.#e=!1}get shouldStopPropagation(){return this.#e}}let bS=Symbol("linkClicked"),bD="react-aria-pressable-style",bO="data-react-aria-pressable";function bP(e){let{onPress:t,onPressChange:r,onPressStart:n,onPressEnd:i,onPressUp:o,onClick:a,isDisabled:s,isPressed:l,preventFocusOnPress:u,shouldCancelOnPointerExit:c,allowTextSelectionOnPress:d,ref:p,...f}=function(e){let t=(0,pq.useContext)(bg);if(t){let{register:r,ref:n,...i}=t;e=y8(i,e),r()}return bs(t,e.ref),e}(e),[h,m]=(0,pq.useState)(!1),y=(0,pq.useRef)({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:g,removeAllGlobalListeners:b}=bw(),v=(0,pq.useCallback)((e,t)=>{let i=y.current;if(s||i.didFirePressStart)return!1;let o=!0;if(i.isTriggeringEvent=!0,n){let r=new bE("pressstart",t,e);n(r),o=r.shouldStopPropagation}return r&&r(!0),i.isTriggeringEvent=!1,i.didFirePressStart=!0,m(!0),o},[s,n,r]),w=(0,pq.useCallback)((e,n,o=!0)=>{let a=y.current;if(!a.didFirePressStart)return!1;a.didFirePressStart=!1,a.isTriggeringEvent=!0;let l=!0;if(i){let t=new bE("pressend",n,e);i(t),l=t.shouldStopPropagation}if(r&&r(!1),m(!1),t&&o&&!s){let r=new bE("press",n,e);t(r),l&&=r.shouldStopPropagation}return a.isTriggeringEvent=!1,l},[s,i,r,t]),x=bv(w),E=bv((0,pq.useCallback)((e,t)=>{let r=y.current;if(s)return!1;if(o){r.isTriggeringEvent=!0;let n=new bE("pressup",t,e);return o(n),r.isTriggeringEvent=!1,n.shouldStopPropagation}return!0},[s,o])),S=(0,pq.useCallback)(e=>{let t=y.current;if(t.isPressed&&t.target){for(let r of(t.didFirePressStart&&null!=t.pointerType&&w(bj(t.target,e),t.pointerType,!1),t.isPressed=!1,t.isOverTarget=!1,t.activePointerId=null,t.pointerType=null,b(),d||bf(t.target),t.disposables))r();t.disposables=[]}},[d,b,w]),D=bv(S),O=(0,pq.useCallback)(e=>{c&&S(e)},[c,S]),P=(0,pq.useCallback)(e=>{s||a?.(e)},[s,a]),C=(0,pq.useCallback)((e,t)=>{if(!s&&a){let r=new MouseEvent("click",e);gR(r,t),a(gT(r))}},[s,a]),k=(0,pq.useMemo)(()=>{let e=y.current,t={onKeyDown(t){if(bk(t.nativeEvent,t.currentTarget)&&gw(t.currentTarget,g_(t))){bT(g_(t),t.key)&&t.preventDefault();let n=!0;e.isPressed||t.repeat||(e.target=t.currentTarget,e.isPressed=!0,e.pointerType="keyboard",n=v(t,"keyboard"));let i=t.currentTarget;g(gb(t.currentTarget),"keyup",yH(t=>{bk(t,i)&&!t.repeat&&gw(i,g_(t))&&e.target&&E(bj(e.target,t),"keyboard")},r),!0),n&&t.stopPropagation(),t.metaKey&&gL()&&e.metaKeyEvents?.set(t.key,t.nativeEvent)}else"Meta"===t.key&&(e.metaKeyEvents=new Map)},onClick(t){if((!t||gw(t.currentTarget,g_(t)))&&t&&0===t.button&&!e.isTriggeringEvent&&!gG.isOpening){let r=!0;if(s&&t.preventDefault(),!e.ignoreEmulatedMouseEvents&&!e.isPressed&&("virtual"===e.pointerType||gz(t.nativeEvent))){let e=v(t,"virtual"),n=E(t,"virtual"),i=x(t,"virtual");P(t),r=e&&n&&i}else if(e.isPressed&&"keyboard"!==e.pointerType){let n=e.pointerType||t.nativeEvent.pointerType||"virtual",i=E(bj(t.currentTarget,t),n),o=x(bj(t.currentTarget,t),n,!0);r=i&&o,e.isOverTarget=!1,P(t),D(t)}e.ignoreEmulatedMouseEvents=!1,r&&t.stopPropagation()}}},r=t=>{if(e.isPressed&&e.target&&bk(t,e.target)){bT(g_(t),t.key)&&t.preventDefault();let r=g_(t),n=gw(e.target,r);x(bj(e.target,t),"keyboard",n),n&&C(t,e.target),b(),"Enter"!==t.key&&bC(e.target)&&gw(e.target,r)&&!t[bS]&&(t[bS]=!0,gG(e.target,t,!1)),e.isPressed=!1,e.metaKeyEvents?.delete(t.key)}else if("Meta"===t.key&&e.metaKeyEvents?.size){let t=e.metaKeyEvents;for(let r of(e.metaKeyEvents=void 0,t.values()))e.target?.dispatchEvent(new KeyboardEvent("keyup",r))}};if("u">typeof PointerEvent){t.onPointerDown=t=>{var i;if(0!==t.button||!gw(t.currentTarget,g_(t)))return;if(i=t.nativeEvent,!gK()&&0===i.width&&0===i.height||1===i.width&&1===i.height&&0===i.pressure&&0===i.detail&&"mouse"===i.pointerType){e.pointerType="virtual";return}e.pointerType=t.pointerType;let o=!0;if(!e.isPressed){e.isPressed=!0,e.isOverTarget=!0,e.activePointerId=t.pointerId,e.target=t.currentTarget,d||function(e){if(gV()){if("default"===bc){let t=gb(e);bd=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect="none"}bc="disabled"}else if(e instanceof HTMLElement||e instanceof SVGElement){let t="userSelect"in e.style?"userSelect":"webkitUserSelect";bp.set(e,e.style[t]),e.style[t]="none"}}(e.target),o=v(t,e.pointerType);let i=g_(t);"releasePointerCapture"in i&&("hasPointerCapture"in i?i.hasPointerCapture(t.pointerId)&&i.releasePointerCapture(t.pointerId):i.releasePointerCapture(t.pointerId)),g(gb(t.currentTarget),"pointerup",r,!1),g(gb(t.currentTarget),"pointercancel",n,!1)}o&&t.stopPropagation()},t.onMouseDown=t=>{if(gw(t.currentTarget,g_(t))&&0===t.button){if(u){let r=function(e){for(;e&&!gC(e,{skipVisibilityCheck:!0});)e=e.parentElement;let t=gv(e),r=t.document.activeElement;if(!r||r===e)return;gN=!0;let n=!1,i=e=>{(g_(e)===r||n)&&e.stopImmediatePropagation()},o=t=>{(g_(t)===r||n)&&(t.stopImmediatePropagation(),e||n||(n=!0,gy(r),l()))},a=t=>{(g_(t)===e||n)&&t.stopImmediatePropagation()},s=t=>{(g_(t)===e||n)&&(t.stopImmediatePropagation(),n||(n=!0,gy(r),l()))};t.addEventListener("blur",i,!0),t.addEventListener("focusout",o,!0),t.addEventListener("focusin",s,!0),t.addEventListener("focus",a,!0);let l=()=>{cancelAnimationFrame(u),t.removeEventListener("blur",i,!0),t.removeEventListener("focusout",o,!0),t.removeEventListener("focusin",s,!0),t.removeEventListener("focus",a,!0),gN=!1,n=!1},u=requestAnimationFrame(l);return l}(t.target);r&&e.disposables.push(r)}t.stopPropagation()}},t.onPointerUp=t=>{gw(t.currentTarget,g_(t))&&"virtual"!==e.pointerType&&(0!==t.button||e.isPressed||E(t,e.pointerType||t.pointerType))},t.onPointerEnter=t=>{t.pointerId===e.activePointerId&&e.target&&!e.isOverTarget&&null!=e.pointerType&&(e.isOverTarget=!0,v(bj(e.target,t),e.pointerType))},t.onPointerLeave=t=>{t.pointerId===e.activePointerId&&e.target&&e.isOverTarget&&null!=e.pointerType&&(e.isOverTarget=!1,x(bj(e.target,t),e.pointerType,!1),O(t))};let r=t=>{if(t.pointerId===e.activePointerId&&e.isPressed&&0===t.button&&e.target){if(gw(e.target,g_(t))&&null!=e.pointerType){let r=!1,n=setTimeout(()=>{e.isPressed&&e.target instanceof HTMLElement&&(r?D(t):(gy(e.target),e.target.click()))},80);g(t.currentTarget,"click",()=>r=!0,!0),e.disposables.push(()=>clearTimeout(n))}else D(t);e.isOverTarget=!1}},n=e=>{D(e)};t.onDragStart=e=>{gw(e.currentTarget,g_(e))&&D(e)}}return t},[g,s,u,b,d,O,v,P,C]);return(0,pq.useEffect)(()=>{if(!p)return;let e=gb(p.current);if(!e||!e.head||e.getElementById(bD))return;let t=e.createElement("style");t.id=bD;let r=by(e);r&&(t.nonce=r),t.textContent=`
32
+ To fix this, ensure that you define the "component" field inside the page definition.`,e)}(n,t)}}let hK={PHONE_MIN:0,PHONE_MAX:600,TABLET_MIN:601,TABLET_MAX:1023,SMALL_DESKTOP_MIN:1024,SMALL_DESKTOP_MAX:1439,LARGE_DESKTOP_MIN:1440,LARGE_DESKTOP_MAX:Number.MAX_SAFE_INTEGER};function hH(){document.body.classList.toggle("omrs-breakpoint-lt-tablet",window.innerWidth<hK.TABLET_MIN),document.body.classList.toggle("omrs-breakpoint-gt-phone",window.innerWidth>hK.PHONE_MAX),document.body.classList.toggle("omrs-breakpoint-gt-tablet",window.innerWidth>hK.TABLET_MAX),document.body.classList.toggle("omrs-breakpoint-lt-desktop",window.innerWidth<hK.SMALL_DESKTOP_MIN),document.body.classList.toggle("omrs-breakpoint-lt-small-desktop",window.innerWidth<hK.SMALL_DESKTOP_MIN),document.body.classList.toggle("omrs-breakpoint-lt-large-desktop",window.innerWidth<hK.LARGE_DESKTOP_MIN),document.body.classList.toggle("omrs-breakpoint-gt-small-desktop",window.innerWidth>hK.SMALL_DESKTOP_MAX)}let hz=!1;function hG(){hz||(window.addEventListener("resize",hH),hH(),hz=!0)}var hq=r(4848),hY=r(6942),hZ=r.n(hY);function hJ({title:e,children:t}){let r="tablet"===hd();return(0,hq.jsxs)("div",{className:hZ()({"-esm-billing__card-header-module__tabletHeader___rUYi0":r,"-esm-billing__card-header-module__desktopHeader___CDa37":!r}),children:[(0,hq.jsx)("h4",{children:e}),t]})}let hX=["red","magenta","purple","blue","teal","cyan","gray","green","warm-gray","cool-gray","high-contrast","outline"],hQ={primaryColor:{_type:tL.String,_description:"The color for displaying primary diagnoses tags",_default:"red",_validators:[rK.oneOf(hX)]},secondaryColor:{_type:tL.String,_description:"The color for displaying secondary diagnoses tags",_default:"blue",_validators:[rK.oneOf(hX)]}},h0={"Brand color #1":{_default:"#005d5d",_type:tL.String},"Brand color #2":{_default:"#004144",_type:tL.String},"Brand color #3":{_default:"#007d79",_type:tL.String},excludePatientIdentifierCodeTypes:{uuids:{_type:tL.Array,_description:"List of UUIDs of patient identifier types to exclude from rendering in the patient banner",_default:[],_elements:{_type:tL.UUID}}},implementationName:{_type:tL.String,_description:"A name of the place (or authority) where all possible locations a user can choose are located.",_default:"Clinic"},patientPhotoConceptUuid:{_type:tL.ConceptUuid,_default:"736e8771-e501-4615-bfa7-570c03f4bef5",_description:"Used to look up the patient photo, which is stored as an attachment obs. Set to `null` in order to disable the feature and use only generated avatars. To remove the avatars entirely, use extension configuration's `remove` feature."},preferredCalendar:{_type:tL.Object,_description:"Keys should be locale codes, and values should be the preferred calendar for that locale. For example, {'am': 'ethiopic'}.",_default:{am:"ethiopic"},_elements:{_validators:[rK.oneOf(["buddhist","chinese","coptic","dangi","ethioaa","ethiopic","gregory","hebrew","indian","islamic","islamic-umalqura","islamic-tbla","islamic-civil","islamic-rgsa","iso8601","japanese","persian","roc","islamicc"])]}},preferredDateLocale:{_type:tL.Object,_description:"Allows setting the locale used for date formatting for any browser locale. Does not affect time formatting. Keys should be locale codes, and values should be the preferred locale for formatting dates. For example, {'en': 'en-US', 'fr-CA': 'en-CA'}.",_default:{en:"en-GB"},_elements:{_type:tL.String}},diagnosisTags:hQ};var h1=r(6800);let h3={"carbon.table.batch.cancel":"cancel","carbon.table.batch.items.selected":"batchActionsItemsSelected","carbon.table.batch.item.selected":"batchActionItemSelected","carbon.table.batch.selectAll":"selectAll"},h4=e=>(0,hq.jsx)(h1.GGC,{translateWithId:(e,t)=>{let r=h3[e];return r?i8(r,e,t):e},...e}),h2="-esm-billing__custom-overflow-menu-module__container___lY3iq",h6="-esm-billing__custom-overflow-menu-module__menu___dReHr",h5="-esm-billing__custom-overflow-menu-module__show___48R0e",h8="-esm-billing__custom-overflow-menu-module__overflowMenuButton___tsY8r",h9=(0,pq.createContext)(null);function h7(){let e=(0,pq.useContext)(h9);if(!e)throw Error("useCustomOverflowMenu must be used within a CustomOverflowMenu");return e}function me({menuTitle:e,children:t}){let[r,n]=pY().useState(!1),i=hy(()=>n(!1),r),o="tablet"===hd(),a=(0,pq.useCallback)(()=>n(e=>!e),[]),s=(0,pq.useRef)(null),l=(0,pq.useRef)(null),u=(0,pq.useId)(),c=`custom-overflow-menu-trigger-${u}`,d=`custom-overflow-menu-${u}`,p=(0,pq.useCallback)(()=>{n(!1),s.current?.focus()},[]),f=(0,pq.useMemo)(()=>({closeMenu:p}),[p]),h=(0,pq.useCallback)(e=>{"Escape"===e.key&&r&&(e.stopPropagation(),p())},[p,r]),m=pq.Children.toArray(t);(0,pq.useEffect)(()=>{if(r&&l.current){let e=l.current.querySelector('[role="menuitem"]:not([disabled])');e?.focus()}},[r]);let y=(0,pq.useCallback)(({currentIndex:e,direction:t})=>{let r=l.current?.querySelectorAll('[role="menuitem"]:not([disabled])');if(!r?.length)return;let n=document.activeElement?.closest?.('[role="menuitem"]')??document.activeElement,i=Array.from(r).indexOf(n);if(-1===i)return void r[t>0?0:r.length-1]?.focus();let o=i+t,a=o<0?r.length-1:o>=r.length?0:o;r[a]?.focus()},[]),g=m.map((e,t)=>(0,pq.isValidElement)(e)?(0,pq.cloneElement)(e,{closeMenu:p,handleOverflowMenuItemFocus:y,index:t}):e);return(0,hq.jsxs)("div",{"data-overflow-menu":!0,className:hZ()("cds--overflow-menu",h2),ref:i,children:[(0,hq.jsx)("button",{className:hZ()("cds--btn","cds--btn--ghost","cds--overflow-menu__trigger",{"cds--overflow-menu--open":r},h8),"aria-controls":d,"aria-expanded":r,"aria-haspopup":"true",id:c,onClick:a,onKeyDown:h,ref:s,children:e}),(0,hq.jsxs)("div",{className:hZ()("cds--overflow-menu-options","cds--overflow-menu--flip",h6,{[h5]:r}),"aria-labelledby":c,"data-floating-menu-direction":"bottom",id:d,onKeyDown:h,ref:l,role:"menu",tabIndex:-1,children:[(0,hq.jsx)("ul",{className:hZ()("cds--overflow-menu-options__content",{"cds--overflow-menu-options--lg":o}),children:(0,hq.jsx)(h9.Provider,{value:f,children:g})}),(0,hq.jsx)("span",{})]})]})}function mt(e){let t=(0,pq.useContext)(h9);return(0,hq.jsx)(h1.XSD,{...e,closeMenu:t?.closeMenu})}var mr=r(7767),mn=r(4976);let mi=["omrs-icon-activity","omrs-icon-add","omrs-icon-arrow-down","omrs-icon-arrow-left","omrs-icon-arrow-right","omrs-icon-arrow-up","omrs-icon-baby","omrs-icon-calendar-heat-map","omrs-icon-calendar","omrs-icon-caret-down","omrs-icon-caret-left","omrs-icon-caret-right","omrs-icon-caret-up","omrs-icon-chart-average","omrs-icon-chart-line","omrs-icon-checkmark-filled","omrs-icon-checkmark-outline","omrs-icon-chemistry","omrs-icon-chevron-down","omrs-icon-chevron-left","omrs-icon-chevron-right","omrs-icon-chevron-up","omrs-icon-close","omrs-icon-close-filled","omrs-icon-close-outline","omrs-icon-document","omrs-icon-document-attachment","omrs-icon-download","omrs-icon-drug-order","omrs-icon-edit","omrs-icon-event-schedule","omrs-icon-events","omrs-icon-gender-female","omrs-icon-gender-male","omrs-icon-gender-other","omrs-icon-gender-unknown","omrs-icon-generic-order-type","omrs-icon-group","omrs-icon-group-access","omrs-icon-hospital-bed","omrs-icon-image-medical","omrs-icon-information","omrs-icon-information-filled","omrs-icon-information-square","omrs-icon-inventory-management","omrs-icon-lab-order","omrs-icon-list-checked","omrs-icon-location","omrs-icon-material-order","omrs-icon-maximize","omrs-icon-medication","omrs-icon-message-queue","omrs-icon-microscope","omrs-icon-mobile-check","omrs-icon-money","omrs-icon-mother","omrs-icon-movement","omrs-icon-overflow-menu--horizontal","omrs-icon-overflow-menu--vertical","omrs-icon-password","omrs-icon-pedestrian-family","omrs-icon-pen","omrs-icon-printer","omrs-icon-procedure-order","omrs-icon-programs","omrs-icon-renew","omrs-icon-referral-order","omrs-icon-report","omrs-icon-reset","omrs-icon-save","omrs-icon-search","omrs-icon-settings","omrs-icon-shopping-cart","omrs-icon-shopping-cart--arrow-down","omrs-icon-sticky-note-add","omrs-icon-switcher","omrs-icon-syringe","omrs-icon-table-of-contents","omrs-icon-table","omrs-icon-time","omrs-icon-tools","omrs-icon-translate","omrs-icon-trash-can","omrs-icon-tree-view--alt","omrs-icon-two-factor-authentication","omrs-icon-user-avatar","omrs-icon-user-follow","omrs-icon-user-xray","omrs-icon-user","omrs-icon-view-off","omrs-icon-view","omrs-icon-warning"],mo=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-activity",iconProps:e})})),ma=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-add",iconProps:e})})),ms=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-arrow-down",iconProps:e})})),ml=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-arrow-left",iconProps:e})})),mu=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-arrow-right",iconProps:e})})),mc=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-arrow-up",iconProps:e})})),md=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-baby",iconProps:e})})),mp=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-calendar-heat-map",iconProps:e})})),mf=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-calendar",iconProps:e})})),mh=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-caret-down",iconProps:e})})),mm=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-caret-left",iconProps:e})})),my=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-caret-right",iconProps:e})})),mg=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-caret-up",iconProps:e})})),mb=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-chart-average",iconProps:e})})),mv=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-chart-line",iconProps:e})})),mw=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-checkmark-filled",iconProps:e})})),m_=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-checkmark-outline",iconProps:e})})),mx=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-chemistry",iconProps:e})})),mE=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-chevron-down",iconProps:e})})),mS=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-chevron-left",iconProps:e})})),mD=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-chevron-right",iconProps:e})})),mO=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-chevron-up",iconProps:e})})),mP=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-close",iconProps:e})})),mC=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-close-filled",iconProps:e})})),mk=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-close-outline",iconProps:e})})),mj=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-document",iconProps:e})})),mT=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-document-attachment",iconProps:e})})),mR=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-download",iconProps:e})})),mA=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-drug-order",iconProps:e})})),mN=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-edit",iconProps:e})})),mM=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-event-schedule",iconProps:e})})),mI=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-events",iconProps:e})})),m$=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-gender-female",iconProps:e})})),mL=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-gender-male",iconProps:e})})),mF=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-gender-other",iconProps:e})})),mB=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-gender-unknown",iconProps:e})})),mV=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-generic-order-type",iconProps:e})})),mU=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-group",iconProps:e})})),mW=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-group-access",iconProps:e})})),mK=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-hospital-bed",iconProps:e})})),mH=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-image-medical",iconProps:e})})),mz=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-information",iconProps:e})})),mG=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-information-filled",iconProps:e})})),mq=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-information-square",iconProps:e})})),mY=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-inventory-management",iconProps:e})})),mZ=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-lab-order",iconProps:e})})),mJ=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-list-checked",iconProps:e})})),mX=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-location",iconProps:e})})),mQ=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-material-order",iconProps:e})})),m0=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-maximize",iconProps:e})})),m1=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-medication",iconProps:e})})),m3=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-message-queue",iconProps:e})})),m4=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-microscope",iconProps:e})})),m2=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-mobile-check",iconProps:e})})),m6=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-money",iconProps:e})})),m5=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-mother",iconProps:e})})),m8=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-movement",iconProps:e})})),m9=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-overflow-menu--horizontal",iconProps:e})})),m7=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-overflow-menu--horizontal",iconProps:e})})),ye=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-password",iconProps:e})})),yt=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-pedestrian-family",iconProps:e})})),yr=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-pen",iconProps:e})})),yn=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-printer",iconProps:e})})),yi=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-procedure-order",iconProps:e})})),yo=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-programs",iconProps:e})})),ya=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-referral-order",iconProps:e})})),ys=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-renew",iconProps:e})})),yl=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-report",iconProps:e})})),yu=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-reset",iconProps:e})})),yc=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-save",iconProps:e})})),yd=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-search",iconProps:e})})),yp=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-settings",iconProps:e})})),yf=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-switcher",iconProps:e})})),yh=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-shopping-cart",iconProps:e})})),ym=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-shopping-cart--arrow-down",iconProps:e})})),yy=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-sticky-note-add",iconProps:e})})),yg=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-syringe",iconProps:e})})),yb=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-table-of-contents",iconProps:e})})),yv=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-table",iconProps:e})})),yw=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-time",iconProps:e})})),y_=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-tools",iconProps:e})})),yx=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-translate",iconProps:e})})),yE=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-trash-can",iconProps:e})})),yS=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-tree-view--alt",iconProps:e})})),yD=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-two-factor-authentication",iconProps:e})})),yO=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-user-avatar",iconProps:e})})),yP=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-user-follow",iconProps:e})})),yC=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-user-xray",iconProps:e})})),yk=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-user",iconProps:e})})),yj=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-view-off",iconProps:e})})),yT=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-view",iconProps:e})})),yR=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(yF,{ref:t,icon:"omrs-icon-warning",iconProps:e})})),yA=yR,yN=mT,yM=mJ,yI=mH,y$=ym,yL=(0,pq.memo)((0,pq.forwardRef)(function({icon:e,fallback:t,...r},n){let i=(0,pq.useRef)(e?document.getElementById(e):void 0);return(0,pq.useEffect)(()=>{let t=document.getElementById("omrs-svgs-container"),r=new MutationObserver(t=>{for(let r of t)"childList"===r.type&&(i.current=e?document.getElementById(e):void 0)});return t&&r.observe(t,{childList:!0}),()=>r.disconnect()},[e]),(0,hq.jsx)(f$,{value:i.current,fallback:t,children:(0,hq.jsx)(yF,{ref:n,icon:e,iconProps:r})})})),yF=(0,pq.memo)((0,pq.forwardRef)(function({icon:e,iconProps:t},r){let{className:n,fill:i,size:o}=Object.assign({},{fill:"currentColor",size:20},t);(o<=0||o>72)&&(console.error(`Invalid size '${o}' specified for ${e}. Defaulting to 20.`),o=20);let a=(0,pq.useRef)(null);return(0,pq.useImperativeHandle)(r,()=>a.current),(0,pq.useEffect)(()=>{a.current&&"currentColor"!==i&&a.current.style.setProperty("--omrs-icon-fill",i)},[]),(0,hq.jsx)("svg",{ref:a,className:hZ()("omrs-icon","-esm-billing__icons-module__icon___sq7Qp",n),height:o,width:o,viewBox:"0 0 16 16",children:(0,hq.jsx)("use",{href:`#${e}`})})})),yB=({path:e,title:t,basePath:r,icon:n})=>{let{t:i}=(0,fg.useTranslation)(),o=(0,mr.zy)(),a=(0,pq.useMemo)(()=>{if(!e)return!1;let t=e.startsWith("/")?e.slice(1):e;if(t.startsWith("http"))return t===window.location.href;let r=t.split("/").map(e=>decodeURIComponent(e)),n=(o.pathname??"").split("/").slice(1).map(e=>decodeURIComponent(e));return n.some((e,t)=>r.every((e,r)=>n[t+r]===e))},[o.pathname,e]);return(0,hq.jsx)("div",{children:(0,hq.jsx)(pJ,{className:hZ()("cds--side-nav__link",{"active-left-nav-link":a}),to:`${r}/${encodeURIComponent(e)}`,children:(0,hq.jsxs)("span",{className:"-esm-billing__dashboard-module__menu___Lg1M+",children:[(0,hq.jsx)(yL,{icon:n,className:"-esm-billing__dashboard-module__icon___Y2DxK",size:16}),(0,hq.jsx)("span",{children:i(t)})]})})},e)};function yV(e){return function({basePath:t}){return(0,hq.jsx)(mn.Kd,{children:(0,hq.jsx)(yB,{basePath:t,...e})})}}function yU(e){let t=(0,pq.useRef)(null),r=(0,pq.useRef)(void 0),n=(0,pq.useCallback)(t=>{if("function"==typeof e){let r=e(t);return()=>{"function"==typeof r?r():e(null)}}if(e)return e.current=t,()=>{e.current=null}},[e]);return(0,pq.useMemo)(()=>({get current(){return t.current},set current(value){t.current=value,r.current&&(r.current(),r.current=void 0),null!=value&&(r.current=n(value))}}),[n])}function yW(...e){return 1===e.length&&e[0]?e[0]:t=>{let r=!1,n=e.map(e=>{let n=yK(e,t);return r||="function"==typeof n,n});if(r)return()=>{n.forEach((t,r)=>{"function"==typeof t?t():yK(e[r],null)})}}}function yK(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function yH(...e){return(...t)=>{for(let r of e)"function"==typeof r&&r(...t)}}let yz="u">typeof document?pY().useLayoutEffect:()=>{},yG={prefix:String(Math.round(1e10*Math.random())),current:0},yq=pY().createContext(yG),yY=pY().createContext(!1),yZ=("u">typeof window&&window.document&&window.document.createElement,new WeakMap),yJ="function"==typeof pY().useId?function(e){let t=pY().useId(),[r]=(0,pq.useState)(y1()),n=r?"react-aria":`react-aria${yG.prefix}`;return e||`${n}-${t}`}:function(e){let t=(0,pq.useContext)(yq),r=function(e=!1){let t=(0,pq.useContext)(yq),r=(0,pq.useRef)(null);if(null===r.current&&!e){let e=pY().__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED?.ReactCurrentOwner?.current;if(e){let r=yZ.get(e);null==r?yZ.set(e,{id:t.current,state:e.memoizedState}):e.memoizedState!==r.state&&(t.current=r.id,yZ.delete(e))}r.current=++t.current}return r.current}(!!e),n=`react-aria${t.prefix}`;return e||`${n}-${r}`};function yX(){return!1}function yQ(){return!0}function y0(e){return()=>{}}function y1(){return"function"==typeof pY().useSyncExternalStore?pY().useSyncExternalStore(y0,yX,yQ):(0,pq.useContext)(yY)}let y3=!!("u">typeof window&&window.document&&window.document.createElement),y4=new Map;function y2(e){let[t,r]=(0,pq.useState)(e),n=(0,pq.useRef)(null),i=yJ(t),o=(0,pq.useRef)(null);if(l&&l.register(o,i),y3){let e=y4.get(i);e&&!e.includes(n)?e.push(n):y4.set(i,[n])}return yz(()=>()=>{l&&l.unregister(o),y4.delete(i)},[i]),(0,pq.useEffect)(()=>{let e=n.current;return e&&r(e),()=>{e&&(n.current=null)}}),i}function y6(e=[]){let t=y2(),[r,n]=function(e){let[t,r]=(0,pq.useState)(e),n=(0,pq.useRef)(t),i=(0,pq.useRef)(null),o=(0,pq.useRef)(()=>{if(!i.current)return;let e=i.current.next();if(e.done){i.current=null;return}n.current===e.value?o.current():r(e.value)});return yz(()=>{n.current=t,i.current&&o.current()}),[t,(0,pq.useCallback)(e=>{i.current=e(n.current),o.current()},[o])]}(t),i=(0,pq.useCallback)(()=>{n(function*(){yield t,yield document.getElementById(t)?t:void 0})},[t,n]);return yz(i,[t,i,...e]),r}"u">typeof FinalizationRegistry&&(l=new FinalizationRegistry(e=>{y4.delete(e)}));let y5=function(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=function e(t){var r,n,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t)if(Array.isArray(t)){var o=t.length;for(r=0;r<o;r++)t[r]&&(n=e(t[r]))&&(i&&(i+=" "),i+=n)}else for(n in t)t[n]&&(i&&(i+=" "),i+=n);return i}(e))&&(n&&(n+=" "),n+=t);return n};function y8(...e){let t={...e[0]};for(let r=1;r<e.length;r++){let n=e[r];for(let e in n){let r=t[e],i=n[e];"function"==typeof r&&"function"==typeof i&&"o"===e[0]&&"n"===e[1]&&e.charCodeAt(2)>=65&&90>=e.charCodeAt(2)?t[e]=yH(r,i):("className"===e||"UNSAFE_className"===e)&&"string"==typeof r&&"string"==typeof i?t[e]=y5(r,i):"id"===e&&r&&i?t.id=function(e,t){if(e===t)return e;let r=y4.get(e);if(r)return r.forEach(e=>e.current=t),t;let n=y4.get(t);return n?(n.forEach(t=>t.current=e),e):t}(r,i):"ref"===e&&r&&i?t.ref=yW(r,i):t[e]=void 0!==i?i:r}}return t}let y9=Symbol("default");function y7({values:e,children:t}){for(let[r,n]of e)t=pY().createElement(r.Provider,{value:n},t);return t}function ge(e){let{className:t,style:r,children:n,defaultClassName:i,defaultChildren:o,defaultStyle:a,values:s}=e;return(0,pq.useMemo)(()=>{let e,l,u;return e="function"==typeof t?t({...s,defaultClassName:i}):t,l="function"==typeof r?r({...s,defaultStyle:a||{}}):r,u="function"==typeof n?n({...s,defaultChildren:o}):null==n?o:n,{className:null!=e?e:i,style:l||a?{...a,...l}:void 0,children:null!=u?u:o,"data-rac":""}},[t,r,n,i,o,a,s])}function gt(e,t){let r=(0,pq.useContext)(e);if(null===t)return null;if(r&&"object"==typeof r&&"slots"in r&&r.slots){let e=t||y9;if(!r.slots[e]){let e=new Intl.ListFormat().format(Object.keys(r.slots).map(e=>`"${e}"`)),n=t?`Invalid slot "${t}".`:"A slot prop is required.";throw Error(`${n} Valid slot names are ${e}.`)}return r.slots[e]}return r}function gr(e,t,r){let{ref:n,...i}=gt(r,e.slot)||{},o=yU((0,pq.useMemo)(()=>yW(t,n),[t,n])),a=y8(i,e);return"style"in i&&i.style&&"style"in e&&e.style&&("function"==typeof i.style||"function"==typeof e.style?a.style=t=>{let r="function"==typeof i.style?i.style(t):i.style,n={...t.defaultStyle,...r},o="function"==typeof e.style?e.style({...t,defaultStyle:n}):e.style;return{...n,...o}}:a.style={...i.style,...e.style}),[a,o]}function gn(e=!0){let[t,r]=(0,pq.useState)(e),n=(0,pq.useRef)(!1),i=(0,pq.useCallback)(e=>{n.current=!0,r(!!e)},[]);return yz(()=>{n.current||r(!1)},[]),[i,t]}function gi(e){let t=/^(data-.*)$/,r={};for(let n in e)t.test(n)||(r[n]=e[n]);return r}let go=(0,pq.createContext)(null),ga=null;function gs(e,t="assertive",r=7e3){ga?ga.announce(e,t,r):(ga=new gl,("boolean"==typeof IS_REACT_ACT_ENVIRONMENT?IS_REACT_ACT_ENVIRONMENT:"u">typeof jest)?ga.announce(e,t,r):setTimeout(()=>{(null==ga?void 0:ga.isAttached())&&(null==ga||ga.announce(e,t,r))},100))}class gl{isAttached(){var e;return null==(e=this.node)?void 0:e.isConnected}createLog(e){let t=document.createElement("div");return t.setAttribute("role","log"),t.setAttribute("aria-live",e),t.setAttribute("aria-relevant","additions"),t}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(e,t="assertive",r=7e3){var n,i;if(!this.node)return;let o=document.createElement("div");"object"==typeof e?(o.setAttribute("role","img"),o.setAttribute("aria-labelledby",e["aria-labelledby"])):o.textContent=e,"assertive"===t?null==(n=this.assertiveLog)||n.appendChild(o):null==(i=this.politeLog)||i.appendChild(o),""!==e&&setTimeout(()=>{o.remove()},r)}clear(e){this.node&&((!e||"assertive"===e)&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!e||"polite"===e)&&this.politeLog&&(this.politeLog.innerHTML=""))}constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,"u">typeof document&&(this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,{border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"}),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}}let gu=new Set(["id"]),gc=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),gd=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),gp=new Set(["dir","lang","hidden","inert","translate"]),gf=new Set(["onClick","onAuxClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onGotPointerCapture","onLostPointerCapture","onScroll","onWheel","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionCancel","onTransitionEnd","onTransitionRun","onTransitionStart"]),gh=/^(data-.*)$/;function gm(e,t={}){let{labelable:r,isLink:n,global:i,events:o=i,propNames:a}=t,s={};for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(gu.has(t)||r&&gc.has(t)||n&&gd.has(t)||i&&gp.has(t)||o&&(gf.has(t)||t.endsWith("Capture")&&gf.has(t.slice(0,-7)))||a?.has(t)||gh.test(t))&&(s[t]=e[t]);return s}function gy(e){if(function(){if(null==gg){gg=!1;try{document.createElement("div").focus({get preventScroll(){return gg=!0,!0}})}catch{}}return gg}())e.focus({preventScroll:!0});else{let t=function(e){let t=e.parentNode,r=[],n=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==n;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&r.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return n instanceof HTMLElement&&r.push({element:n,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft}),r}(e);e.focus(),function(e){for(let{element:t,scrollTop:r,scrollLeft:n}of e)t.scrollTop=r,t.scrollLeft=n}(t)}}let gg=null,gb=e=>e?.ownerDocument??document,gv=e=>e&&"window"in e&&e.window===e?e:gb(e).defaultView||window;function gw(e,t){return!!t&&!!e&&e.contains(t)}function g_(e){return e.target}function gx(e){if(!e)return!1;let t=e.getRootNode(),r=gv(e);if(!(t instanceof r.Document||t instanceof r.ShadowRoot))return!1;let n=t.activeElement;return null!=n&&e.contains(n)}let gE="u">typeof Element&&"checkVisibility"in Element.prototype;function gS(e,t){return gE?e.checkVisibility({visibilityProperty:!0})&&!e.closest("[data-react-aria-prevent-focus]"):"#comment"!==e.nodeName&&function(e){let t=gv(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:r,visibility:n}=e.style,i="none"!==r&&"hidden"!==n&&"collapse"!==n;if(i){let{getComputedStyle:t}=e.ownerDocument.defaultView,{display:r,visibility:n}=t(e);i="none"!==r&&"hidden"!==n&&"collapse"!==n}return i}(e)&&!e.hasAttribute("hidden")&&!e.hasAttribute("data-react-aria-prevent-focus")&&("DETAILS"!==e.nodeName||!t||"SUMMARY"===t.nodeName||e.hasAttribute("open"))&&(!e.parentElement||gS(e.parentElement,e))}let gD=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])',"permission"],gO=gD.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";gD.push('[tabindex]:not([tabindex="-1"]):not([disabled])');let gP=gD.join(':not([hidden]):not([tabindex="-1"]),');function gC(e,t){return e.matches(gO)&&!gj(e)&&(t?.skipVisibilityCheck||gS(e))}function gk(e){return e.matches(gP)&&gS(e)&&!gj(e)}function gj(e){let t=e;for(;null!=t;){if(t instanceof t.ownerDocument.defaultView.HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}function gT(e){return e.nativeEvent=e,e.isDefaultPrevented=()=>e.defaultPrevented,e.isPropagationStopped=()=>e.cancelBubble,e.persist=()=>{},e}function gR(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function gA(e){let t=(0,pq.useRef)({isFocused:!1,observer:null});return yz(()=>{let e=t.current;return()=>{e.observer&&(e.observer.disconnect(),e.observer=null)}},[]),(0,pq.useCallback)(r=>{let n=g_(r);(n instanceof HTMLButtonElement||n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement)&&(t.current.isFocused=!0,n.addEventListener("focusout",r=>{if(t.current.isFocused=!1,n.disabled){let t=gT(r);e?.(t)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)},{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&n.disabled){t.current.observer?.disconnect();let e=n===((e=document)=>e.activeElement)()?null:((e=document)=>e.activeElement)();n.dispatchEvent(new FocusEvent("blur",{relatedTarget:e})),n.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:e}))}}),t.current.observer.observe(n,{attributes:!0,attributeFilter:["disabled"]}))},[e])}let gN=!1;function gM(e){if("u"<typeof window||null==window.navigator)return!1;let t=window.navigator.userAgentData?.brands;return Array.isArray(t)&&t.some(t=>e.test(t.brand))||e.test(window.navigator.userAgent)}function gI(e){return"u">typeof window&&null!=window.navigator&&e.test(window.navigator.userAgentData?.platform||window.navigator.platform)}function g$(e){let t=null;return()=>(null==t&&(t=e()),t)}let gL=g$(function(){return gI(/^Mac/i)}),gF=g$(function(){return gI(/^iPhone/i)}),gB=g$(function(){return gI(/^iPad/i)||gL()&&navigator.maxTouchPoints>1}),gV=g$(function(){return gF()||gB()});g$(function(){return gL()||gV()});let gU=g$(function(){return gM(/AppleWebKit/i)&&!gW()}),gW=g$(function(){return gM(/Chrome/i)}),gK=g$(function(){return gM(/Android/i)}),gH=g$(function(){return gM(/Firefox/i)});function gz(e){return""===e.pointerType&&!!e.isTrusted||(gK()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function gG(e,t,r=!0){let{metaKey:n,ctrlKey:i,altKey:o,shiftKey:a}=t;gH()&&window.event?.type?.startsWith("key")&&"_blank"===e.target&&(gL()?n=!0:i=!0);let s=gU()&&gL()&&!gB()&&1?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:n,ctrlKey:i,altKey:o,shiftKey:a}):new MouseEvent("click",{metaKey:n,ctrlKey:i,altKey:o,shiftKey:a,detail:1,bubbles:!0,cancelable:!0});gG.isOpening=r,gy(e),e.dispatchEvent(s),gG.isOpening=!1}gG.isOpening=!1;let gq=null,gY=new Set,gZ=new Map,gJ=!1,gX=!1,gQ={Tab:!0,Escape:!0};function g0(e,t){for(let r of gY)r(e,t)}function g1(e){gJ=!0,gG.isOpening||e.metaKey||!gL()&&e.altKey||e.ctrlKey||"Control"===e.key||"Shift"===e.key||"Meta"===e.key||(gq="keyboard",g0("keyboard",e))}function g3(e){gq="pointer","pointerType"in e&&e.pointerType,("mousedown"===e.type||"pointerdown"===e.type)&&(gJ=!0,g0("pointer",e))}function g4(e){!gG.isOpening&&gz(e)&&(gJ=!0,gq="virtual")}function g2(e){let t=gv(g_(e)),r=gb(g_(e));g_(e)!==t&&g_(e)!==r&&!gN&&e.isTrusted&&(gJ||gX||(gq="virtual",g0("virtual",e)),gJ=!1,gX=!1)}function g6(){gN||(gJ=!1,gX=!0)}function g5(e){if("u"<typeof window||"u"<typeof document)return;let t=gv(e),r=gb(e);if(gZ.get(t))return;let n=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){gJ=!0,n.apply(this,arguments)},r.addEventListener("keydown",g1,!0),r.addEventListener("keyup",g1,!0),r.addEventListener("click",g4,!0),t.addEventListener("focus",g2,!0),t.addEventListener("blur",g6,!1),"u">typeof PointerEvent&&(r.addEventListener("pointerdown",g3,!0),r.addEventListener("pointermove",g3,!0),r.addEventListener("pointerup",g3,!0)),t.addEventListener("beforeunload",()=>{g8(e)},{once:!0}),gZ.set(t,{focus:n})}let g8=(e,t)=>{let r=gv(e),n=gb(e);t&&n.removeEventListener("DOMContentLoaded",t),gZ.has(r)&&(r.HTMLElement.prototype.focus=gZ.get(r).focus,n.removeEventListener("keydown",g1,!0),n.removeEventListener("keyup",g1,!0),n.removeEventListener("click",g4,!0),r.removeEventListener("focus",g2,!0),r.removeEventListener("blur",g6,!1),"u">typeof PointerEvent&&(n.removeEventListener("pointerdown",g3,!0),n.removeEventListener("pointermove",g3,!0),n.removeEventListener("pointerup",g3,!0)),gZ.delete(r))};function g9(){return"pointer"!==gq}"u">typeof document&&("loading"!==(f=gb(void 0)).readyState?g5(void 0):f.addEventListener("DOMContentLoaded",()=>{g5(void 0)}));let g7=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]),be=new Map,bt=new Set;function br(){if("u"<typeof window)return;function e(e){return"propertyName"in e}let t=r=>{let n=g_(r);if(!e(r)||!n)return;let i=be.get(n);if(i&&(i.delete(r.propertyName),0===i.size&&(n.removeEventListener("transitioncancel",t),be.delete(n)),0===be.size)){for(let e of bt)e();bt.clear()}};document.body.addEventListener("transitionrun",r=>{let n=g_(r);if(!e(r)||!n)return;let i=be.get(n);i||(i=new Set,be.set(n,i),n.addEventListener("transitioncancel",t,{once:!0})),i.add(r.propertyName)}),document.body.addEventListener("transitionend",t)}function bn(e){requestAnimationFrame(()=>{for(let[e]of be)"isConnected"in e&&!e.isConnected&&be.delete(e);0===be.size?e():bt.add(e)})}function bi(e){if(!e.isConnected)return;let t=gb(e);if("virtual"===gq){let r=((e=document)=>e.activeElement)(t);bn(()=>{let n=((e=document)=>e.activeElement)(t);(n===r||n===t.body)&&e.isConnected&&gy(e)})}else gy(e)}function bo(e){let{isDisabled:t,onFocus:r,onBlur:n,onFocusChange:i}=e,o=(0,pq.useCallback)(e=>{if(g_(e)===e.currentTarget)return n&&n(e),i&&i(!1),!0},[n,i]),a=gA(o),s=(0,pq.useCallback)(e=>{let t=g_(e),n=gb(t),o=n?((e=document)=>e.activeElement)(n):((e=document)=>e.activeElement)();t===e.currentTarget&&t===o&&(r&&r(e),i&&i(!0),a(e))},[i,r,a]);return{focusProps:{onFocus:!t&&(r||i||n)?s:void 0,onBlur:!t&&(n||i)?o:void 0}}}function ba(e){if(!e)return;let t=!0;return r=>{e({...r,preventDefault(){r.preventDefault()},isDefaultPrevented:()=>r.isDefaultPrevented(),stopPropagation(){t=!0},continuePropagation(){t=!1},isPropagationStopped:()=>t}),t&&r.stopPropagation()}}function bs(e,t){yz(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}"u">typeof document&&("loading"!==document.readyState?br():document.addEventListener("DOMContentLoaded",br));let bl=pY().createContext(null);function bu(e,t){let{focusProps:r}=bo(e),{keyboardProps:n}={keyboardProps:e.isDisabled?{}:{onKeyDown:ba(e.onKeyDown),onKeyUp:ba(e.onKeyUp)}},i=y8(r,n),o=function(e){let t=(0,pq.useContext)(bl)||{};bs(t,e);let{ref:r,...n}=t;return n}(t),a=e.isDisabled?{}:o,s=(0,pq.useRef)(e.autoFocus);(0,pq.useEffect)(()=>{s.current&&t.current&&bi(t.current),s.current=!1},[t]);let l=e.excludeFromTabOrder?-1:0;return e.isDisabled&&(l=void 0),{focusableProps:y8({...i,tabIndex:l},a)}}pY().forwardRef(function(e,t){let{children:r,...n}=e,i=yU(t),o={...n,ref:i};return pY().createElement(bl.Provider,{value:o},r)});let bc="default",bd="",bp=new WeakMap;function bf(e){if(gV())"disabled"===bc&&(bc="restoring",setTimeout(()=>{bn(()=>{if("restoring"===bc){let t=gb(e);"none"===t.documentElement.style.webkitUserSelect&&(t.documentElement.style.webkitUserSelect=bd||""),bd="",bc="default"}})},300));else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&bp.has(e)){let t=bp.get(e),r="userSelect"in e.style?"userSelect":"webkitUserSelect";"none"===e.style[r]&&(e.style[r]=t),""===e.getAttribute("style")&&e.removeAttribute("style"),bp.delete(e)}}function bh(e){let t=e?.defaultView;return t?.__webpack_nonce__||globalThis.__webpack_nonce__||void 0}let bm=new WeakMap;function by(e){let t=e??("u">typeof document?document:void 0);if(!t)return bh(t);if(bm.has(t))return bm.get(t);let r=t.querySelector('meta[property="csp-nonce"]'),n=r&&r instanceof gv(r).HTMLMetaElement&&(r.nonce||r.content)||bh(t)||void 0;return void 0!==n&&bm.set(t,n),n}let bg=pY().createContext({register:()=>{}});bg.displayName="PressResponderContext";let bb=pY().useInsertionEffect??yz;function bv(e){let t=(0,pq.useRef)(null);return bb(()=>{t.current=e},[e]),(0,pq.useCallback)((...e)=>{let r=t.current;return r?.(...e)},[])}function bw(){let e=(0,pq.useRef)(new Map),t=(0,pq.useCallback)((t,r,n,i)=>{let o=i?.once?(...t)=>{e.current.delete(n),n(...t)}:n;e.current.set(n,{type:r,eventTarget:t,fn:o,options:i}),t.addEventListener(r,o,i)},[]),r=(0,pq.useCallback)((t,r,n,i)=>{let o=e.current.get(n)?.fn||n;t.removeEventListener(r,o,i),e.current.delete(n)},[]),n=(0,pq.useCallback)(()=>{e.current.forEach((e,t)=>{r(e.eventTarget,e.type,t,e.options)})},[r]);return(0,pq.useEffect)(()=>n,[n]),{addGlobalListener:t,removeGlobalListener:r,removeAllGlobalListeners:n}}var b_=r(7643),bx=r.n(b_);class bE{#e;constructor(e,t,r,n){this.#e=!0;let i=n?.target??r.currentTarget;const o=i?.getBoundingClientRect();let a,s=0,l,u=null;null!=r.clientX&&null!=r.clientY&&(l=r.clientX,u=r.clientY),o&&(null!=l&&null!=u?(a=l-o.left,s=u-o.top):(a=o.width/2,s=o.height/2)),this.type=e,this.pointerType=t,this.target=r.currentTarget,this.shiftKey=r.shiftKey,this.metaKey=r.metaKey,this.ctrlKey=r.ctrlKey,this.altKey=r.altKey,this.x=a,this.y=s,this.key=r.key}continuePropagation(){this.#e=!1}get shouldStopPropagation(){return this.#e}}let bS=Symbol("linkClicked"),bD="react-aria-pressable-style",bO="data-react-aria-pressable";function bP(e){let{onPress:t,onPressChange:r,onPressStart:n,onPressEnd:i,onPressUp:o,onClick:a,isDisabled:s,isPressed:l,preventFocusOnPress:u,shouldCancelOnPointerExit:c,allowTextSelectionOnPress:d,ref:p,...f}=function(e){let t=(0,pq.useContext)(bg);if(t){let{register:r,ref:n,...i}=t;e=y8(i,e),r()}return bs(t,e.ref),e}(e),[h,m]=(0,pq.useState)(!1),y=(0,pq.useRef)({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:g,removeAllGlobalListeners:b}=bw(),v=(0,pq.useCallback)((e,t)=>{let i=y.current;if(s||i.didFirePressStart)return!1;let o=!0;if(i.isTriggeringEvent=!0,n){let r=new bE("pressstart",t,e);n(r),o=r.shouldStopPropagation}return r&&r(!0),i.isTriggeringEvent=!1,i.didFirePressStart=!0,m(!0),o},[s,n,r]),w=(0,pq.useCallback)((e,n,o=!0)=>{let a=y.current;if(!a.didFirePressStart)return!1;a.didFirePressStart=!1,a.isTriggeringEvent=!0;let l=!0;if(i){let t=new bE("pressend",n,e);i(t),l=t.shouldStopPropagation}if(r&&r(!1),m(!1),t&&o&&!s){let r=new bE("press",n,e);t(r),l&&=r.shouldStopPropagation}return a.isTriggeringEvent=!1,l},[s,i,r,t]),x=bv(w),E=bv((0,pq.useCallback)((e,t)=>{let r=y.current;if(s)return!1;if(o){r.isTriggeringEvent=!0;let n=new bE("pressup",t,e);return o(n),r.isTriggeringEvent=!1,n.shouldStopPropagation}return!0},[s,o])),S=(0,pq.useCallback)(e=>{let t=y.current;if(t.isPressed&&t.target){for(let r of(t.didFirePressStart&&null!=t.pointerType&&w(bj(t.target,e),t.pointerType,!1),t.isPressed=!1,t.isOverTarget=!1,t.activePointerId=null,t.pointerType=null,b(),d||bf(t.target),t.disposables))r();t.disposables=[]}},[d,b,w]),D=bv(S),O=(0,pq.useCallback)(e=>{c&&S(e)},[c,S]),P=(0,pq.useCallback)(e=>{s||a?.(e)},[s,a]),C=(0,pq.useCallback)((e,t)=>{if(!s&&a){let r=new MouseEvent("click",e);gR(r,t),a(gT(r))}},[s,a]),k=(0,pq.useMemo)(()=>{let e=y.current,t={onKeyDown(t){if(bk(t.nativeEvent,t.currentTarget)&&gw(t.currentTarget,g_(t))){bT(g_(t),t.key)&&t.preventDefault();let n=!0;e.isPressed||t.repeat||(e.target=t.currentTarget,e.isPressed=!0,e.pointerType="keyboard",n=v(t,"keyboard"));let i=t.currentTarget;g(gb(t.currentTarget),"keyup",yH(t=>{bk(t,i)&&!t.repeat&&gw(i,g_(t))&&e.target&&E(bj(e.target,t),"keyboard")},r),!0),n&&t.stopPropagation(),t.metaKey&&gL()&&e.metaKeyEvents?.set(t.key,t.nativeEvent)}else"Meta"===t.key&&(e.metaKeyEvents=new Map)},onClick(t){if((!t||gw(t.currentTarget,g_(t)))&&t&&0===t.button&&!e.isTriggeringEvent&&!gG.isOpening){let r=!0;if(s&&t.preventDefault(),!e.ignoreEmulatedMouseEvents&&!e.isPressed&&("virtual"===e.pointerType||gz(t.nativeEvent))){let e=v(t,"virtual"),n=E(t,"virtual"),i=x(t,"virtual");P(t),r=e&&n&&i}else if(e.isPressed&&"keyboard"!==e.pointerType){let n=e.pointerType||t.nativeEvent.pointerType||"virtual",i=E(bj(t.currentTarget,t),n),o=x(bj(t.currentTarget,t),n,!0);r=i&&o,e.isOverTarget=!1,P(t),D(t)}e.ignoreEmulatedMouseEvents=!1,r&&t.stopPropagation()}}},r=t=>{if(e.isPressed&&e.target&&bk(t,e.target)){bT(g_(t),t.key)&&t.preventDefault();let r=g_(t),n=gw(e.target,r);x(bj(e.target,t),"keyboard",n),n&&C(t,e.target),b(),"Enter"!==t.key&&bC(e.target)&&gw(e.target,r)&&!t[bS]&&(t[bS]=!0,gG(e.target,t,!1)),e.isPressed=!1,e.metaKeyEvents?.delete(t.key)}else if("Meta"===t.key&&e.metaKeyEvents?.size){let t=e.metaKeyEvents;for(let r of(e.metaKeyEvents=void 0,t.values()))e.target?.dispatchEvent(new KeyboardEvent("keyup",r))}};if("u">typeof PointerEvent){t.onPointerDown=t=>{var i;if(0!==t.button||!gw(t.currentTarget,g_(t)))return;if(i=t.nativeEvent,!gK()&&0===i.width&&0===i.height||1===i.width&&1===i.height&&0===i.pressure&&0===i.detail&&"mouse"===i.pointerType){e.pointerType="virtual";return}e.pointerType=t.pointerType;let o=!0;if(!e.isPressed){e.isPressed=!0,e.isOverTarget=!0,e.activePointerId=t.pointerId,e.target=t.currentTarget,d||function(e){if(gV()){if("default"===bc){let t=gb(e);bd=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect="none"}bc="disabled"}else if(e instanceof HTMLElement||e instanceof SVGElement){let t="userSelect"in e.style?"userSelect":"webkitUserSelect";bp.set(e,e.style[t]),e.style[t]="none"}}(e.target),o=v(t,e.pointerType);let i=g_(t);"releasePointerCapture"in i&&("hasPointerCapture"in i?i.hasPointerCapture(t.pointerId)&&i.releasePointerCapture(t.pointerId):i.releasePointerCapture(t.pointerId)),g(gb(t.currentTarget),"pointerup",r,!1),g(gb(t.currentTarget),"pointercancel",n,!1)}o&&t.stopPropagation()},t.onMouseDown=t=>{if(gw(t.currentTarget,g_(t))&&0===t.button){if(u){let r=function(e){for(;e&&!gC(e,{skipVisibilityCheck:!0});)e=e.parentElement;let t=gv(e),r=t.document.activeElement;if(!r||r===e)return;gN=!0;let n=!1,i=e=>{(g_(e)===r||n)&&e.stopImmediatePropagation()},o=t=>{(g_(t)===r||n)&&(t.stopImmediatePropagation(),e||n||(n=!0,gy(r),l()))},a=t=>{(g_(t)===e||n)&&t.stopImmediatePropagation()},s=t=>{(g_(t)===e||n)&&(t.stopImmediatePropagation(),n||(n=!0,gy(r),l()))};t.addEventListener("blur",i,!0),t.addEventListener("focusout",o,!0),t.addEventListener("focusin",s,!0),t.addEventListener("focus",a,!0);let l=()=>{cancelAnimationFrame(u),t.removeEventListener("blur",i,!0),t.removeEventListener("focusout",o,!0),t.removeEventListener("focusin",s,!0),t.removeEventListener("focus",a,!0),gN=!1,n=!1},u=requestAnimationFrame(l);return l}(t.target);r&&e.disposables.push(r)}t.stopPropagation()}},t.onPointerUp=t=>{gw(t.currentTarget,g_(t))&&"virtual"!==e.pointerType&&(0!==t.button||e.isPressed||E(t,e.pointerType||t.pointerType))},t.onPointerEnter=t=>{t.pointerId===e.activePointerId&&e.target&&!e.isOverTarget&&null!=e.pointerType&&(e.isOverTarget=!0,v(bj(e.target,t),e.pointerType))},t.onPointerLeave=t=>{t.pointerId===e.activePointerId&&e.target&&e.isOverTarget&&null!=e.pointerType&&(e.isOverTarget=!1,x(bj(e.target,t),e.pointerType,!1),O(t))};let r=t=>{if(t.pointerId===e.activePointerId&&e.isPressed&&0===t.button&&e.target){if(gw(e.target,g_(t))&&null!=e.pointerType){let r=!1,n=setTimeout(()=>{e.isPressed&&e.target instanceof HTMLElement&&(r?D(t):(gy(e.target),e.target.click()))},80);g(t.currentTarget,"click",()=>r=!0,!0),e.disposables.push(()=>clearTimeout(n))}else D(t);e.isOverTarget=!1}},n=e=>{D(e)};t.onDragStart=e=>{gw(e.currentTarget,g_(e))&&D(e)}}return t},[g,s,u,b,d,O,v,P,C]);return(0,pq.useEffect)(()=>{if(!p)return;let e=gb(p.current);if(!e||!e.head||e.getElementById(bD))return;let t=e.createElement("style");t.id=bD;let r=by(e);r&&(t.nonce=r),t.textContent=`
33
33
  @layer {
34
34
  [${bO}] {
35
35
  touch-action: pan-x pan-y pinch-zoom;
@@ -40,4 +40,4 @@ To fix this, ensure that you define the "component" field inside the page defini
40
40
  * {
41
41
  overscroll-behavior: contain;
42
42
  }
43
- }`.trim(),document.head.prepend(n),o=HTMLElement.prototype.focus,HTMLElement.prototype.focus=function(e){let t=((e=document)=>e.activeElement)(),r=null!=t&&ED(t);o.call(this,{...e,preventScroll:!0}),e&&e.preventScroll||Ej(this,r)},a=yH(Ek(document,"touchstart",t=>{let n=g_(t);e=wj(n)?n:wT(n,!0),r=!1;let i=n.ownerDocument.defaultView.getSelection();i&&!i.isCollapsed&&i.containsNode(n,!0)&&(r=!0),t.composedPath().some(e=>e instanceof HTMLInputElement&&"range"===e.type)&&(r=!0),"selectionStart"in n&&"selectionEnd"in n&&n.selectionStart<n.selectionEnd&&n.ownerDocument.activeElement===n&&(r=!0)},{passive:!1,capture:!0}),Ek(document,"touchmove",t=>{if(2!==t.touches.length&&!r){if(!e||e===document.documentElement||e===document.body)return void t.preventDefault();e.scrollHeight===e.clientHeight&&e.scrollWidth===e.clientWidth&&t.preventDefault()}},{passive:!1,capture:!0}),Ek(document,"blur",e=>{let t=g_(e),r=e.relatedTarget;if(r&&ED(r))r.focus({preventScroll:!0}),Ej(r,ED(t));else if(!r){let e=t.parentElement?.closest("[tabindex]");e?.focus({preventScroll:!0})}},!0)),()=>{t(),a(),n.remove(),HTMLElement.prototype.focus=o}):yH((s=window.innerWidth-document.documentElement.clientWidth)>0&&("scrollbarGutter"in document.documentElement.style?EC(document.documentElement,"scrollbarGutter","stable"):EC(document.documentElement,"paddingRight",`${s}px`)),EC(document.documentElement,"overflow","hidden"))),()=>{0==--EP&&d()}}},[t])}({isDisabled:o||!t.isOpen}),(0,pq.useEffect)(()=>{if(t.isOpen&&n.current)if(o){var e,r,a=i?.current??n.current;let t=Ee[Ee.length-1];return t&&!t.visibleNodes.has(a)?(t.visibleNodes.add(a),()=>{t.visibleNodes.delete(a)}):void 0}else{let t,o,a,s,l,u,c,d,p,f,h;return e=[i?.current??n.current],o=(r={shouldUseInert:!0})instanceof(t=gv(e?.[0])).Element?{root:r}:r,a=o?.root??document.body,s=o?.shouldUseInert&&x9,l=new Set(e),u=new Set,c=(e,r)=>{s&&e instanceof t.HTMLElement?e.inert=r:r?e.setAttribute("aria-hidden","true"):(e.removeAttribute("aria-hidden"),e instanceof t.HTMLElement&&(e.inert=!1))},d=e=>{for(let t of e.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))l.add(t);let t=e=>{if(u.has(e)||l.has(e)||e.parentElement&&u.has(e.parentElement)&&"row"!==e.parentElement.getAttribute("role"))return NodeFilter.FILTER_REJECT;for(let t of l)if(gw(e,t))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},r=_z(gb(e),e,NodeFilter.SHOW_ELEMENT,{acceptNode:t}),n=t(e);if(n===NodeFilter.FILTER_ACCEPT&&p(e),n!==NodeFilter.FILTER_REJECT){let e=r.nextNode();for(;null!=e;)p(e),e=r.nextNode()}},p=e=>{let r=x7.get(e)??0;(s&&e instanceof t.HTMLElement?e.inert:"true"===e.getAttribute("aria-hidden"))&&0===r||(0===r&&c(e,!0),u.add(e),x7.set(e,r+1))},Ee.length&&Ee[Ee.length-1].disconnect(),d(a),(f=new MutationObserver(e=>{for(let r of e)if("childList"===r.type&&r.target.isConnected&&![...l,...u].some(e=>gw(e,r.target)))for(let e of r.addedNodes){var t;(e instanceof HTMLElement||e instanceof SVGElement)&&("true"===(t=e).dataset.liveAnnouncer||void 0!==t.dataset.reactAriaTopLayer)?l.add(e):e instanceof Element&&d(e)}})).observe(a,{childList:!0,subtree:!0}),h={visibleNodes:l,hiddenNodes:u,observe(){f.observe(a,{childList:!0,subtree:!0})},disconnect(){f.disconnect()}},Ee.push(h),()=>{for(let e of(f.disconnect(),u)){let t=x7.get(e);null!=t&&(1===t?(c(e,!1),x7.delete(e)):x7.set(e,t-1))}h===Ee[Ee.length-1]?(Ee.pop(),Ee.length&&Ee[Ee.length-1].observe()):Ee.splice(Ee.indexOf(h),1)}}},[o,t.isOpen,n,i]),{popoverProps:y8(c,f),arrowProps:h,underlayProps:p,placement:m,triggerAnchorPoint:y}}({...n,offset:null!=(i=n.offset)?i:8,arrowSize:s,groupRef:p?c:u},e),g=n.popoverRef,b=function(e,t=!0){let[r,n]=(0,pq.useState)(!0),i=r&&t;return yz(()=>{if(i&&e.current&&"getAnimations"in e.current)for(let t of e.current.getAnimations())t instanceof CSSTransition&&t.cancel()},[e,i]),EN(e,i,(0,pq.useCallback)(()=>n(!1),[])),i}(g,!!y)||n.isEntering||!1,v=ge({...n,defaultClassName:"react-aria-Popover",values:{trigger:n.trigger||null,placement:y,isEntering:b,isExiting:t}}),w=!n.isNonModal||"SubmenuTrigger"===n.trigger,[x,E]=(0,pq.useState)(!1);yz(()=>{g.current&&E(w&&!g.current.querySelector("[role=dialog]"))},[g,w]),(0,pq.useEffect)(()=>{var e;let t,r;x&&g.current&&!g.current.contains(document.activeElement)&&(r=((e=document)=>e.activeElement)(t=gb(e=g.current)),"virtual"===EM?bn(()=>{((e=document)=>e.activeElement)(t)===r&&e.isConnected&&gy(e)}):gy(e))},[x,g]);let S={...f.style,...v.style},D=pY().createElement("div",{...y8(gm(n),f),...v,role:x?"dialog":void 0,tabIndex:x?-1:void 0,"aria-label":n["aria-label"],"aria-labelledby":n["aria-labelledby"],ref:g,slot:n.slot||void 0,style:S,dir:n.dir,"data-trigger":n.trigger,"data-placement":y,"data-entering":b||void 0,"data-exiting":t||void 0},!n.isNonModal&&pY().createElement(EA,{onDismiss:e.close}),pY().createElement(x8.Provider,{value:{...m,placement:y,ref:a}},v.children),pY().createElement(EA,{onDismiss:e.close}));return p?pY().createElement(xJ,{...n,shouldContainFocus:x,isExiting:t,portalContainer:null!=(o=null!=r?r:null==c?void 0:c.current)?o:void 0},D):pY().createElement(xJ,{...n,shouldContainFocus:x,isExiting:t,portalContainer:r},!n.isNonModal&&e.isOpen&&pY().createElement("div",{"data-testid":"underlay",...h,style:{position:"fixed",inset:0}}),pY().createElement("div",{ref:u,style:{display:"contents"}},pY().createElement(EZ.Provider,{value:u},D)))}function EQ(e){return e?.start!=null&&null!=e.end}let E0=(0,pq.createContext)(null),E1=(0,pq.createContext)(null),E3=(0,pq.createContext)(null),E4=(0,pq.createContext)(null),E2=(0,pq.forwardRef)(function(e,t){var r,n;[e,t]=gr(e,t,E0);let{validationBehavior:i}=gt(x2)||{},o=null!=(n=null!=(r=e.validationBehavior)?r:i)?n:"native",a=function(e){let t=Eq(e),[r,n]=_S(e.value,e.defaultValue||null,e.onChange),[i]=(0,pq.useState)(r),o=r||e.placeholderValue||null,[a,s]=xR(o,e.granularity),l=null!=r?r.toDate(s??"UTC"):null,u="hour"===a||"minute"===a||"second"===a,c=e.shouldCloseOnSelect??!0,[d,p]=(0,pq.useState)(null),[f,h]=(0,pq.useState)(null);if(r&&(d=r,"hour"in r&&(f=r)),o&&!(a in o))throw Error("Invalid granularity "+a+" for value "+o.toString());let m=r?.calendar.identifier==="gregory"&&"BC"===r.era,y=(0,pq.useMemo)(()=>({granularity:a,timeZone:s,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,showEra:m}),[a,e.hourCycle,e.shouldForceLeadingZeros,s,e.hideTimeZone,m]),{minValue:g,maxValue:b,isDateUnavailable:v}=e,w=(0,pq.useMemo)(()=>xO(r,g,b,v,y),[r,g,b,v,y]),x=xv({...e,value:r,builtinValidation:w}),E=x.displayValidation.isInvalid,S=e.validationState||(E?"invalid":null),D=(e,t)=>{n("timeZone"in t?t.set(v5(e)):v8(e,t)),p(null),h(null),x.commitValidation()};return{...x,value:r,defaultValue:e.defaultValue??i,setValue:n,dateValue:d,timeValue:f,setDateValue:r=>{let i="function"==typeof c?c():c;u?f||i?D(r,f||xj(e.defaultValue||e.placeholderValue)):p(r):(n(r),x.commitValidation()),i&&t.setOpen(!1)},setTimeValue:e=>{d&&e?D(d,e):h(e)},granularity:a,hasTime:u,...t,setOpen(n){!n&&!r&&d&&u&&D(d,f||xj(e.defaultValue||e.placeholderValue)),t.setOpen(n)},validationState:S,isInvalid:E,formatValue:(e,t)=>l?new vo(e,xk(t,y)).format(l):"",getDateFormatter:(e,t)=>new vo(e,xk({},{...y,...t}))}}({...e,validationBehavior:o}),s=(0,pq.useRef)(null),[l,u]=gn(!e["aria-label"]&&!e["aria-labelledby"]),{groupProps:c,labelProps:d,fieldProps:p,buttonProps:f,dialogProps:h,calendarProps:m,descriptionProps:y,errorMessageProps:g,...b}=function(e,t,r){var n;let i=y2(),o=y2(),a=y2(),s=vw((n=xn)&&n.__esModule?n.default:n,"@react-aria/datepicker"),{isInvalid:l,validationErrors:u,validationDetails:c}=t.displayValidation,{labelProps:d,fieldProps:p,descriptionProps:f,errorMessageProps:h}=xa({...e,labelElementType:"span",isInvalid:l,errorMessage:e.errorMessage||u}),m=xi(t,r),y=p["aria-labelledby"]||p.id,{locale:g}=b9(),b=t.formatValue(g,{month:"long"}),v=w$(b?s.format("selectedDateDescription",{date:b}):""),w=[v["aria-describedby"],p["aria-describedby"]].filter(Boolean).join(" ")||void 0,x=gm(e),E=(0,pq.useMemo)(()=>_9(r),[r]),S=(0,pq.useRef)(!1),{focusWithinProps:D}=bN({...e,isDisabled:t.isOpen,onBlurWithin:t=>{gw(document.getElementById(o),t.relatedTarget)||(S.current=!1,e.onBlur?.(t),e.onFocusChange?.(!1))},onFocusWithin:t=>{S.current||(S.current=!0,e.onFocus?.(t),e.onFocusChange?.(!0))}});return{groupProps:y8(x,m,p,v,D,{role:"group","aria-disabled":e.isDisabled||null,"aria-labelledby":y,"aria-describedby":w,onKeyDown(r){!t.isOpen&&e.onKeyDown&&e.onKeyDown(r)},onKeyUp(r){!t.isOpen&&e.onKeyUp&&e.onKeyUp(r)}}),labelProps:{...d,onClick:()=>{E.focusFirst()}},fieldProps:{...p,id:a,[xc]:"presentation","aria-describedby":w,value:t.value,defaultValue:t.defaultValue,onChange:t.setValue,placeholderValue:e.placeholderValue,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,granularity:e.granularity,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isRequired:e.isRequired,validationBehavior:e.validationBehavior,[xb]:t,autoFocus:e.autoFocus,name:e.name,form:e.form},descriptionProps:f,errorMessageProps:h,buttonProps:{...v,id:i,"aria-haspopup":"dialog","aria-label":s.format("calendar"),"aria-labelledby":`${i} ${y}`,"aria-describedby":w,"aria-expanded":t.isOpen,isDisabled:e.isDisabled||e.isReadOnly,onPress:()=>t.setOpen(!0)},dialogProps:{id:o,"aria-labelledby":`${i} ${y}`},calendarProps:{autoFocus:!0,value:t.dateValue,onChange:t.setDateValue,minValue:e.minValue,maxValue:e.maxValue,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isDateUnavailable:e.isDateUnavailable,defaultFocusedValue:t.dateValue?void 0:e.placeholderValue,isInvalid:t.isInvalid,errorMessage:"function"==typeof e.errorMessage?e.errorMessage(t.displayValidation):e.errorMessage||t.displayValidation.validationErrors.join(" "),firstDayOfWeek:e.firstDayOfWeek,pageBehavior:e.pageBehavior},isInvalid:l,validationErrors:u,validationDetails:c}}({...gi(e),label:u,validationBehavior:o},a,s),[v,w]=(0,pq.useState)(null),x=(0,pq.useCallback)(()=>{s.current&&w(s.current.offsetWidth+"px")},[]);Ew({ref:s,onResize:x});let{focusProps:E,isFocused:S,isFocusVisible:D}=bM({within:!0}),O=ge({...e,values:{state:a,isFocusWithin:S,isFocusVisible:D,isDisabled:e.isDisabled||!1,isInvalid:a.isInvalid,isOpen:a.isOpen},defaultClassName:"react-aria-DatePicker"}),P=gm(e);return delete P.id,pY().createElement(y7,{values:[[E3,a],[_U,{...c,ref:s,isInvalid:a.isInvalid}],[xU,p],[bK,{...f,isPressed:a.isOpen}],[x6,{...d,ref:l,elementType:"span"}],[_j,m],[xQ,a],[EY,{trigger:"DatePicker",triggerRef:s,placement:"bottom start",style:{"--trigger-width":v}}],[xX,h],[bG,{slots:{description:y,errorMessage:g}}],[x1,b]]},pY().createElement("div",{...E,...P,...O,ref:t,slot:e.slot||void 0,"data-focus-within":S||void 0,"data-invalid":a.isInvalid||void 0,"data-focus-visible":D||void 0,"data-disabled":e.isDisabled||void 0,"data-open":a.isOpen||void 0}))}),E6=(0,pq.forwardRef)(function(e,t){var r,n;[e,t]=gr(e,t,E1);let{validationBehavior:i}=gt(x2)||{},o=null!=(n=null!=(r=e.validationBehavior)?r:i)?n:"native",a=function(e){let t=Eq(e),[r,n]=_S(e.value,e.defaultValue||null,e.onChange),[i]=(0,pq.useState)(r),[o,a]=(0,pq.useState)(()=>r||{start:null,end:null});null==r&&o.start&&o.end&&a(o={start:null,end:null});let s=r||o,l=e=>{a(s=e||{start:null,end:null}),EQ(s)?n(s):n(null)},[u,c]=xR(s?.start||s?.end||e.placeholderValue||null,e.granularity),d="hour"===u||"minute"===u||"second"===u,p=e.shouldCloseOnSelect??!0,[f,h]=(0,pq.useState)(null),[m,y]=(0,pq.useState)(null);s&&EQ(s)&&(f=s,"hour"in s.start&&(m=s));let g=(e,t)=>{l({start:"timeZone"in t.start?t.start.set(v5(e.start)):v8(e.start,t.start),end:"timeZone"in t.end?t.end.set(v5(e.end)):v8(e.end,t.end)}),h(null),y(null),P.commitValidation()},b=r=>{let n="function"==typeof p?p():p;d?EQ(r)&&(n||m?.start&&m?.end)?g(r,{start:m?.start||xj(e.placeholderValue),end:m?.end||xj(e.placeholderValue)}):h(r):EQ(r)?(l(r),P.commitValidation()):h(r),n&&t.setOpen(!1)},v=e=>{EQ(f)&&EQ(e)?g(f,e):y(e)},w=s?.start?.calendar.identifier==="gregory"&&"BC"===s.start.era||s?.end?.calendar.identifier==="gregory"&&"BC"===s.end.era,x=(0,pq.useMemo)(()=>({granularity:u,timeZone:c,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,showEra:w}),[u,e.hourCycle,e.shouldForceLeadingZeros,c,e.hideTimeZone,w]),{minValue:E,maxValue:S,isDateUnavailable:D}=e,O=(0,pq.useMemo)(()=>{var e;let t;return e=s,t=xE(xO(e?.start??null,E,S,D,x),xO(e?.end??null,E,S,D,x)),e?.end!=null&&null!=e.start&&0>e.end.compare(e.start)&&(t=xE(t,{isInvalid:!0,validationErrors:[(vh.getGlobalDictionaryForPackage("@react-stately/datepicker")||xS).getStringForLocale("rangeReversed",xD())],validationDetails:{...xh,rangeUnderflow:!0,rangeOverflow:!0,valid:!1}})),t},[s,E,S,D,x]),P=xv({...e,value:r,name:(0,pq.useMemo)(()=>[e.startName,e.endName].filter(e=>null!=e),[e.startName,e.endName]),builtinValidation:O}),C=P.displayValidation.isInvalid,k=e.validationState||(C?"invalid":null);return{...P,value:s,defaultValue:e.defaultValue??i,setValue:l,dateRange:f,timeRange:m,granularity:u,hasTime:d,setDate(e,t){"start"===e?b({start:t,end:f?.end??null}):b({start:f?.start??null,end:t})},setTime(e,t){"start"===e?v({start:t,end:m?.end??null}):v({start:m?.start??null,end:t})},setDateTime(e,t){"start"===e?l({start:t,end:s?.end??null}):l({start:s?.start??null,end:t})},setDateRange:b,setTimeRange:v,...t,setOpen(r){!r&&!(s?.start&&s?.end)&&EQ(f)&&d&&g(f,{start:m?.start||xj(e.placeholderValue),end:m?.end||xj(e.placeholderValue)}),t.setOpen(r)},validationState:k,isInvalid:C,formatValue(t,r){let n;if(!s||!s.start||!s.end)return null;let i="timeZone"in s.start?s.start.timeZone:void 0,o=e.granularity||(s.start&&"minute"in s.start?"minute":"day"),a="timeZone"in s.end?s.end.timeZone:void 0,l=e.granularity||(s.end&&"minute"in s.end?"minute":"day"),u=xk(r,{granularity:o,timeZone:i,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,showEra:"gregory"===s.start.calendar.identifier&&"BC"===s.start.era||"gregory"===s.end.calendar.identifier&&"BC"===s.end.era}),c=s.start.toDate(i||"UTC"),d=s.end.toDate(a||"UTC"),p=new vo(t,u);if(i===a&&o===l&&0!==s.start.compare(s.end)){try{let e=p.formatRangeToParts(c,d),t=-1;for(let r=0;r<e.length;r++){let n=e[r];if("shared"===n.source&&"literal"===n.type)t=r;else if("endRange"===n.source)break}let r="",n="";for(let i=0;i<e.length;i++)i<t?r+=e[i].value:i>t&&(n+=e[i].value);return{start:r,end:n}}catch{}n=p}else n=new vo(t,xk(r,{granularity:l,timeZone:a,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle}));return{start:p.format(c),end:n.format(d)}},getDateFormatter:(e,t)=>new vo(e,xk({},{...x,...t}))}}({...e,validationBehavior:o}),s=(0,pq.useRef)(null),[l,u]=gn(!e["aria-label"]&&!e["aria-labelledby"]),{groupProps:c,labelProps:d,startFieldProps:p,endFieldProps:f,buttonProps:h,dialogProps:m,calendarProps:y,descriptionProps:g,errorMessageProps:b,...v}=function(e,t,r){var n;let i=vw((n=xn)&&n.__esModule?n.default:n,"@react-aria/datepicker"),{isInvalid:o,validationErrors:a,validationDetails:s}=t.displayValidation,{labelProps:l,fieldProps:u,descriptionProps:c,errorMessageProps:d}=xa({...e,labelElementType:"span",isInvalid:o,errorMessage:e.errorMessage||a}),p=u["aria-labelledby"]||u.id,{locale:f}=b9(),h=t.formatValue(f,{month:"long"}),m=w$(h?i.format("selectedRangeDescription",{startDate:h.start,endDate:h.end}):""),y={"aria-label":i.format("startDate"),"aria-labelledby":p},g={"aria-label":i.format("endDate"),"aria-labelledby":p},b=y2(),v=y2(),w=xi(t,r),x=[m["aria-describedby"],u["aria-describedby"]].filter(Boolean).join(" ")||void 0,E=(0,pq.useMemo)(()=>_9(r,{accept:e=>e.id!==b}),[r,b]),S={[xd]:E,[xc]:"presentation","aria-describedby":x,placeholderValue:e.placeholderValue,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,granularity:e.granularity,shouldForceLeadingZeros:e.shouldForceLeadingZeros,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isRequired:e.isRequired,validationBehavior:e.validationBehavior},D=gm(e),O=(0,pq.useRef)(!1),{focusWithinProps:P}=bN({...e,isDisabled:t.isOpen,onBlurWithin:t=>{gw(document.getElementById(v),t.relatedTarget)||(O.current=!1,e.onBlur?.(t),e.onFocusChange?.(!1))},onFocusWithin:t=>{O.current||(O.current=!0,e.onFocus?.(t),e.onFocusChange?.(!0))}}),C=(0,pq.useRef)(xy),k=(0,pq.useRef)(xy);return{groupProps:y8(D,w,u,m,P,{role:"group","aria-disabled":e.isDisabled||null,"aria-describedby":x,onKeyDown(r){!t.isOpen&&e.onKeyDown&&e.onKeyDown(r)},onKeyUp(r){!t.isOpen&&e.onKeyUp&&e.onKeyUp(r)}}),labelProps:{...l,onClick:()=>{E.focusFirst()}},buttonProps:{...m,id:b,"aria-haspopup":"dialog","aria-label":i.format("calendar"),"aria-labelledby":`${b} ${p}`,"aria-describedby":x,"aria-expanded":t.isOpen,isDisabled:e.isDisabled||e.isReadOnly,onPress:()=>t.setOpen(!0)},dialogProps:{id:v,"aria-labelledby":`${b} ${p}`},startFieldProps:{...y,...S,value:t.value?.start??null,defaultValue:t.defaultValue?.start,onChange:e=>t.setDateTime("start",e),autoFocus:e.autoFocus,name:e.startName,form:e.form,[xb]:{realtimeValidation:t.realtimeValidation,displayValidation:t.displayValidation,updateValidation(e){C.current=e,t.updateValidation(xE(e,k.current))},resetValidation:t.resetValidation,commitValidation:t.commitValidation}},endFieldProps:{...g,...S,value:t.value?.end??null,defaultValue:t.defaultValue?.end,onChange:e=>t.setDateTime("end",e),name:e.endName,form:e.form,[xb]:{realtimeValidation:t.realtimeValidation,displayValidation:t.displayValidation,updateValidation(e){k.current=e,t.updateValidation(xE(C.current,e))},resetValidation:t.resetValidation,commitValidation:t.commitValidation}},descriptionProps:c,errorMessageProps:d,calendarProps:{autoFocus:!0,value:t.dateRange?.start&&t.dateRange.end?t.dateRange:null,onChange:t.setDateRange,minValue:e.minValue,maxValue:e.maxValue,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isDateUnavailable:e.isDateUnavailable,allowsNonContiguousRanges:e.allowsNonContiguousRanges,defaultFocusedValue:t.dateRange?void 0:e.placeholderValue,isInvalid:t.isInvalid,errorMessage:"function"==typeof e.errorMessage?e.errorMessage(t.displayValidation):e.errorMessage||t.displayValidation.validationErrors.join(" "),firstDayOfWeek:e.firstDayOfWeek,pageBehavior:e.pageBehavior},isInvalid:o,validationErrors:a,validationDetails:s}}({...gi(e),label:u,validationBehavior:o},a,s),[w,x]=(0,pq.useState)(null),E=(0,pq.useCallback)(()=>{s.current&&x(s.current.offsetWidth+"px")},[]);Ew({ref:s,onResize:E});let{focusProps:S,isFocused:D,isFocusVisible:O}=bM({within:!0}),P=ge({...e,values:{state:a,isFocusWithin:D,isFocusVisible:O,isDisabled:e.isDisabled||!1,isInvalid:a.isInvalid,isOpen:a.isOpen},defaultClassName:"react-aria-DateRangePicker"}),C=gm(e);return delete C.id,pY().createElement(y7,{values:[[E4,a],[_U,{...c,ref:s,isInvalid:a.isInvalid}],[bK,{...h,isPressed:a.isOpen}],[x6,{...d,ref:l,elementType:"span"}],[_T,y],[xQ,a],[EY,{trigger:"DateRangePicker",triggerRef:s,placement:"bottom start",style:{"--trigger-width":w}}],[xX,m],[xU,{slots:{start:p,end:f}}],[bG,{slots:{description:g,errorMessage:b}}],[x1,v]]},pY().createElement("div",{...S,...C,...P,ref:t,slot:e.slot||void 0,"data-focus-within":D||void 0,"data-invalid":a.isInvalid||void 0,"data-focus-visible":O||void 0,"data-disabled":e.isDisabled||void 0,"data-open":a.isOpen||void 0}))});function E5(e){return pY().createElement(b8,e)}function E8(e,t,r=!1){if(null==e)return r?e:void 0;if("string"==typeof e&&!e)return r?null:void 0;if(e instanceof vq||e instanceof vZ||e instanceof vJ)return t?v9(e,t):e;{let r=hC()(e).toDate(),n=new vq(r.getFullYear(),r.getMonth()+1,r.getDate());return t?v9(n,t):n}}function E9(e){if(e)return e.toDate(wc())}function E7(e){if("string"==typeof e&&0!==e.trim().length)try{return new Intl.Locale(e.replace(/[_@]/g,"-")).toString()}catch{return}}function Se(e){let t=e??"",r=E7(t);if(!r)return t;try{return new Intl.DisplayNames([r],{type:"language"}).of(r)??t}catch{return t}}function St(){let e=window.i18next.language,t=E7(e)??e;return"ht"===t&&(t="fr-HT"),t}if("u">typeof navigator){let e=navigator;ea=Array.isArray(e.languages)?e.languages[0]:e.language}else if("u">typeof process){let e=process.env;ea=e.LC_ALL||e.LC_MESSAGES||e.LANG||e.LANGUAGE}var Sr=function(e){e=(e=e.replace(/_/g,"-")).replace(/[.:][\w-]*$/,"");try{return new Intl.Locale(e).baseName}catch{return"en-US"}}(ea||"en-US"),Sn=class extends Date{invalid=null;isValid(){return!Number.isNaN(this.valueOf())}},Si={};for(let e=1;e<100;e++)Si[(e<=9?"0":"")+e]=e+(e>51?1900:2e3);var So={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},Sa="[1234567890一二三四五六七八九〇\\d]",Ss={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},Sl={},Su={"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},Sc={zone:Su,year:Si,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:{}},Sd={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(Su).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,}"},Sp={...Sd,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}"},Sf={},Sh=class e{locale;lookups;vars;numberingSystem;baseName;dateOptions;static factory(t=Sr){return Sf[t.toLowerCase()]||(Sf[t.toLowerCase()]=new e(t)),Sf[t.toLowerCase()]}constructor(e=Sr){this.locale=e,this.lookups={...Sc},this.vars={...Sd};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 r=0;r<e.length;r++)t+=String(this.lookups.digit[e[r]]);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 r=this.lookups.meridiem[t?.toLowerCase()]||0,n=this.toInt(e);return n<12&&12===r&&(n+=12),12===n&&0===r&&(n=0),n}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,r,n]=t;return("-"===e||"−"===e?-1:1)*(60*this.toInt(r)+this.toInt(n||0))}return 0}build(){"latn"===this.dateOptions.numberingSystem?this.lookups.digit=Ss: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(Sl[e])return Sl[e];if("fullwide"===e||"hanidec"===e)return{group:Sa,lookup:{...Ss}};let t=So[e];if(!t)return{group:"\\d",lookup:{...Ss}};let r=String.fromCharCode(t),n=String.fromCharCode(t+9),i={};for(let e=0;e<10;e++)i[String.fromCharCode(t+e)]=e;return Sl[e]={group:`[${r}-${n}]`,lookup:i},Sl[e]}(this.numberingSystem);for(let r in this.lookups.digit=t,Sp)Sp.hasOwnProperty(r)&&(this.vars[r]=Sp[r].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((r,n)=>{["","k","kuu","kuuta"].forEach((i,o)=>{e[r+i+(o<2?"\\.?":"")]=!0,t[r+i]=n+1})});else{let r=[],n=e=>"month"===e.type;for(let e=0;e<12;e++)r.push(new Date(2017,e,1));for(let i of["full","long","medium"]){let o=Intl.DateTimeFormat(this.locale,{dateStyle:i});for(let a=0;a<12;a++){let s=o.formatToParts(r[a]).find(n).value.toLocaleLowerCase(this.locale);/^\d+$/.test(s)||(/^ko/i.test(this.locale)&&(s+="월"),"medium"===i?(s=s.replace(/\.$/,""),e[`${s}\\.?`]=!0):e[s]=!0,t[s]=a+1)}}let i=Intl.DateTimeFormat(this.locale,{month:"short"});for(let o=0;o<12;o++){let a=i.formatToParts(r[o]).find(n).value.toLocaleLowerCase(this.locale);a=a.replace(/\.$/,""),e[`${a}\\.?`]=!0,t[a]=o+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 r=[],n={};for(let i of["long","short"]){let o=Intl.DateTimeFormat(this.locale,{weekday:i});for(let a=0;a<7;a++){let s=o.formatToParts(e[a]).find(t).value.toLocaleLowerCase(this.locale);"short"===i?(s=s.replace(/\.$/,""),r.push(`${s}\\.?`)):r.push(s),n[s]=a}}this.vars.DAYNAME=r.join("|"),this.lookups.dayname=n}buildMeridiems(){let e=[new Date(2017,0,1),new Date(2017,0,1,23,0,0)],t=e=>"dayPeriod"===e.type,r=[],n={},i=Intl.DateTimeFormat(this.locale,{timeStyle:"long"});for(let o=0;o<2;o++){let a=i.formatToParts(e[o]).find(t);if(!a)return;let s=a.value.toLocaleLowerCase(this.locale);r.push(s),n[s]=12*o}this.vars.MERIDIEM=r.join("|"),this.lookups.meridiem=n}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")}},Sm=["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"],Sy={y:"year",M:"month",d:"day",w:"week",h:"hour",m:"minute",s:"second",ms:"millisecond"},Sg=()=>new Date;function Sb(e){return function(t){let r={};for(let n=0,i=e.length;n<i;n++){let i=e[n];i&&(r[i]=t[n])}return r}}var Sv=class{doneChecker;fallback;patterns;formatter;constructor({doneChecker:e,fallback:t,patterns:r,formatter:n}){this.doneChecker=e,this.fallback=t,this.patterns=r,this.formatter=n}attempt(e){if("string"!=typeof e)return this.fallback(e);let t=e.trim(),r={},n=!1;for(let e of this.patterns){let i=t.match(e.regex);if(!i)continue;n=!0;let o=e.handler(i);if(o){for(let[e,t]of Object.entries(o))e in r||void 0===t||(r[e]=t);if(t=(t=t.slice(0,i.index)+t.slice(i.index+i[0].length+1)).trim(),this.doneChecker(r,t))break}}return n?this.formatter(r):this.fallback(e)}},Sw=["year","month","day","hour","minute","second","millisecond","offset"],S_={};function Sx(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 SE=[[/([^\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"]],SS={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," "],...SE],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:SE,id:SE,fr:[[/(\d{2}) h /,"$1:"],[/(\d{2}) min /,"$1:"],[/(\d{2}) s /,"$1"]]};function SD(e,t=Sr){let r=function(e){if(!S_[e]){var t,r;let n,i,o=Sh.factory(e);S_[e]=new Sv({doneChecker:Sx,fallback:(t=e,function(e){let r=String(e).slice(0,50);return""===r&&(r="(empty string)"),{invalid:`Unable to parse "${r}" with locale "${t}"`}}),patterns:(n=[{name:"timestampWithOffset",regex:o.compile("^(_YEAR4_)-(_MONTH_)-(_DAY_)[T ](_H24_):(_MIN_):(_SEC_)(?:.(_MS_))? ?(_OFFSET_|Z)?$"),handler:Sb(["","year","month","day","hour","minute","second","millisecond","offset"])},{name:"timestampWithZone",regex:o.compile("^(_YEAR4_)-(_MONTH_)-(_DAY_)[T ](_H24_):(_MIN_):(_SEC_)(?:.(_MS_))?\\s*(_ZONE_)$"),handler:Sb(["","year","month","day","hour","minute","second","millisecond","zone"])},{name:"timestampWithOffsetAndZone",regex:o.compile("^(_YEAR4_)-(_MONTH_)-(_DAY_)[T ](_H24_):(_MIN_):(_SEC_)(?:.(_MS_))? (_OFFSET_|Z)\\s*(_ZONE_)$"),handler:Sb(["","year","month","day","hour","minute","second","millisecond","offset"])},{name:"chinese",regex:o.compile(`^(${Sa}{2,4})\\s*\u5E74\\s*(${Sa}{1,2})\\s*\u6708\\s*(${Sa}{1,2})\\s*\u65E5$`),handler:Sb(["","year","month","day"])},{name:"korean",regex:o.compile("^(_YEAR_)년\\s*(_MONTH_)월\\s*(_DAY_)일$"),handler:Sb(["","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:Sb(["","monthname","day","hour","minute","second","offset","year"])},{name:"today",regex:/^(now|today|tomorrow|yesterday)$/i,handler:function(e){let t=Sg(),r=e[1].toLowerCase();switch(r){case"tomorrow":t.setUTCDate(t.getUTCDate()+1);break;case"yesterday":t.setUTCDate(t.getUTCDate()-1)}let n={year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate()};return"now"===r&&(n.hour=t.getUTCHours(),n.minute=t.getUTCMinutes(),n.second=t.getUTCSeconds(),n.millisecond=t.getUTCMilliseconds()),console.log("today=>",r,n),n}},{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,r,n]){t=parseFloat(t),"week"===(r=r.length<=2?Sy[r]:(r=r.replace(/s$/,"")).toLowerCase())&&(r="day",t*=7),("-"===e||n)&&(t*=-1);let i=Sg();return"millisecond"===r?i.setUTCMilliseconds(i.getUTCMilliseconds()+t):"second"===r?i.setUTCSeconds(i.getUTCSeconds()+t):"minute"===r?i.setUTCMinutes(i.getUTCMinutes()+t):"hour"===r?i.setUTCHours(i.getUTCHours()+t):"day"===r?i.setUTCDate(i.getUTCDate()+t):"month"===r?i.setUTCMonth(i.getUTCMonth()+t):"year"===r&&i.setUTCFullYear(i.getUTCFullYear()+t),{year:i.getUTCFullYear(),month:i.getUTCMonth()+1,day:i.getUTCDate(),hour:i.getUTCHours(),minute:i.getUTCMinutes(),second:i.getUTCSeconds(),millisecond:i.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:o.compile("(?:^|[\\sT])(_H24_):(_MIN_):(_SEC_)(?:\\.(_MS_))?(Z)?$"),handler:Sb(["","hour","minute","second","millisecond","zone"])},{name:"zone24",regex:o.compile("(_H24_):(_MIN_):(_SEC_)(?:\\.(_MS_))?[\\s\\[(]*(_ZONE_)?[\\s\\])]*$"),handler:Sb(["","hour","minute","second","millisecond","zone"])},{name:"hms12",regex:o.compile("(_H12_):(_MIN_):(_SEC_)\\s*(_MERIDIEM_)"),handler:Sb(["","hour","minute","second","meridiem"])},{name:"hms24",regex:o.compile("(_H24_):(_MIN_):(_SEC_)(?:\\.(_MS_))?"),handler:Sb(["","hour","minute","second","millisecond"])},{name:"hm12",regex:o.compile("(_H12_):(_MIN_)\\s*(_MERIDIEM_)"),handler:Sb(["","hour","minute","meridiem"])},{name:"hm24",regex:o.compile("(_H24_):(_MIN_)"),handler:Sb(["","hour","minute"])},{name:"h12",regex:o.compile("(_H12_)\\s*(_MERIDIEM_)"),handler:Sb(["","hour","meridiem"])},{name:"8digit",regex:/^((?:19|20)\d{2})(\d{2})(\d{2})$/,handler:Sb(["","year","month","day"])},{name:"yearMonthnameDay",regex:o.compile("(_YEAR4_)[\\s.-]+(_MONTHNAME_)[\\s,.-]+(_DAY_)(_ORDINAL_)?"),handler:Sb(["","year","monthname","day"])},{name:"dayMonthnameYear",regex:o.compile("(_DAY_)(_ORDINAL_)?[\\s.-]*(_MONTHNAME_)[\\s,.-]+(_YEAR_)"),handler:Sb(["","day","","monthname","year"])},{name:"monthnameDayYear",regex:o.compile("(_MONTHNAME_)[\\s.-]*(_DAY_)(_ORDINAL_)?[\\s,.-]+(_YEAR_)"),handler:Sb(["","monthname","day","","year"])},{name:"dayMonthname",regex:o.compile("\\b(_DAY_)(_ORDINAL_)?[\\s.-]*(_MONTHNAME_)\\b"),handler:Sb(["","day","","monthname"])},{name:"monthnameDay",regex:o.compile("\\b(_MONTHNAME_)[\\s.-]*(_DAY_)(_ORDINAL_)?\\b"),handler:Sb(["","monthname","day"])},{name:"hmsNoMeridiem",regex:o.compile("\\b(_H12_|_H24_):(_MIN_):(_SEC_)\\b"),handler:Sb(["","hour","minute","second"])},{name:"hmNoMeridiem",regex:o.compile("\\b(_H12_|_H24_):(_MIN_)\\b"),handler:Sb(["","hour","minute"])},{name:"ymd",regex:o.compile("(_YEAR4_)([.-])(_MONTH_)\\2+(_DAY_)"),handler:Sb(["","year","","month","day"])},{name:"mdy",regex:o.compile("(_MONTH_)([/-])(_DAY_)\\2(_YEAR_)"),handler:Sb(["","month","","day","year"])},{name:"dmy",regex:o.compile("(_DAY_)(?:_ORDINAL_)?[./\\s-]+(_MONTH_)[./\\s-]+(_YEAR_)"),handler:Sb(["","day","month","year"])},{name:"yearLoose",regex:o.compile("_YEAR4_"),handler:Sb(["year"])},{name:"dayMonthnameLoose",regex:o.compile("(_DAY_)[\\s.]*(_MONTHNAME_)"),handler:Sb(["","day","monthname"])},{name:"monthnameDayLoose",regex:o.compile("(_MONTHNAME_)[\\s.]*(_DAY_)"),handler:Sb(["","monthname","day"])},{name:"monthname",regex:o.compile("_MONTHNAME_"),handler:Sb(["monthname"])},{name:"year4",regex:o.compile("_YEAR4_"),handler:Sb(["year"])},{name:"md",regex:o.compile("(_MONTH_)[/-](_DAY_)"),handler:Sb(["","month","day"])},{name:"dm",regex:o.compile("(_DAY_)(?:_ORDINAL_)?[./\\s-]+(_MONTH_)"),handler:Sb(["","day","month"])},{name:"day",regex:o.compile("_DAY_"),handler:Sb(["day"])},{name:"year2",regex:o.compile("_YEAR2_"),handler:Sb(["year"])},{name:"onlyZone",regex:o.compile("_ZONE_"),handler:Sb(["zone"])}],i=o.baseName.slice(0,5),Sm.includes(i)?n:n.filter(e=>!["mdy","md"].includes(e.name))),formatter:(r=o,function(e){let t={};for(let[n,i]of Object.entries(e))if("monthname"===n){if(i){let e=r.monthNameToInt(i);void 0!==e&&(t.month=e)}}else if("hour"===n&&e.meridiem){let n=r.h12ToInt(i,e.meridiem);void 0!==n&&(t.hour=n)}else if("zone"===n){if(i){let e=r.zoneToOffset(i);void 0!==e&&(t.offset=e)}}else if("offset"===n){let e=r.offsetToMinutes(i);void 0!==e&&(t.offset=e)}else if("millisecond"===n){let e=r.millisecondToInt(i);"number"==typeof e&&(t.millisecond=e)}else if(Sw.includes(n)){let e=r.toInt(i);"number"==typeof e&&(t[n]=e)}return t.year<100&&(t.year=Si[t.year]),t.year&&"buddhist"===r.dateOptions.calendar&&(t.year-=543),t})})}return S_[e]}(t),n=function(e,t){let r=SS[t.slice(0,2).toLowerCase()];if(!r)return e;for(let[t,n]of r)e=e.replace(t,n);return e}(e,t);return r.attempt(n)}function SO(e){e.month&&e.day&&void 0===e.year&&(e.year=new Date().getFullYear()),60===e.second&&(e.second=59);let t=new Sn(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 Sn(t.valueOf()-60*e.offset*1e3):t}function SP(e,t=Sr){let r=SD(e,t),n=r.invalid?new Sn(NaN):SO(r);return n.isValid()||(n.invalid=`Unable to parse date "${e}"`),n}function SC(e,t=Sr){return e instanceof Date?new Sn(e.valueOf()):"number"==typeof e?new Sn(e):SP(e,t)}Date.fromString=Sn.fromString=SP,Date.fromAny=Sn.fromAny=SC,"u">typeof window&&(window.anyDateParser={fromString:SP,fromAny:SC,fromObject:SO,attempt:SD});var Sk=r(5238),Sj=r(3826);let ST=function(e){return null==e};function SR(e,t){var r=function(e,t){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return t.get(e)}(e,t);return r.get?r.get.call(e):r.value}hP.extend(hk),hP.extend(Sj),hP.extend(Sk);let SA="YYYY-MM-DDTHH:mm:ss.SSSZZ";function SN(e){return null!=e&&28===e.trim().length&&"T"===(e=e.trim())[10]&&":"===e[13]&&":"===e[16]&&"."===e[19]&&("+"===e[23]||"-"===e[23])&&hP(e,SA).isValid()}function SM(e){return hP(e).isToday()}function SI(e){return SN(e)?hP(e,SA).toDate():null}function S$(e,t=!1){let r=hP(e);return t&&(r=r.utc()),r.format(SA)}function SL(e){return hP(e).toDate()}var SF=new WeakMap;let SB=new class{register(e,t){SR(this,SF).set(e,t)}getCalendar(e){if(!e)return;if(e.calendar)return e.calendar;if(e.region){let t=`${e.language}-${e.region}`;if(SR(this,SF).has(t))return SR(this,SF).get(t)}if(e.language&&SR(this,SF).has(e.language))return SR(this,SF).get(e.language);let t=new Intl.DateTimeFormat(e.toString()).resolvedOptions().calendar;return SR(this,SF).set(`${e.language}${e.region?`-${e.region}`:""}`,t),t}constructor(){!function(e,t,r){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object");t.set(e,r)}(this,SF,{writable:!0,value:new Map})}};function SV(e,t){SB.register(e,t)}function SU(e){let t=e??St();return SB.getCalendar(t instanceof Intl.Locale?t:new Intl.Locale(t))}let SW={mode:"standard",time:"for today",day:!0,month:!0,year:!0,noToday:!1};function SK(e,t={}){let r=SD(e,St());if(r.invalid)return console.warn(`Could not parse invalid date '${e}'`),null;!ST(r.day)&&ST(r.month)&&(r=Object.assign({},t$(r,"day"),{month:r.day})),r.month&&(r.month-=1),r.day&&(r=Object.assign({},t$(r,"day"),{date:r.day}));let n=hP().set(r).toDate();return ST(r.year)&&(t.year=!1),ST(r.month)&&(t.month=!1),ST(r.date)&&(t.day=!1),SH(n,t)}function SH(e,t){let r,n=t?.locale??St(),i=new Intl.Locale(n),{calendar:o,mode:a,time:s,day:l,month:u,year:c,noToday:d,numberingSystem:p}={...SW,...{noToday:"am"===i.language},...t},f={calendar:o??SU(i),year:c?"numeric":void 0,month:u?"short":void 0,day:l?"2-digit":void 0,numberingSystem:p},h=hP(e).isToday();if(h&&!d)r=(r=new Intl.RelativeTimeFormat(n,{numeric:"auto"}).format(0,"day"))[0].toLocaleUpperCase(n)+r.slice(1);else{"en"===i.language&&(n="en-GB");let t=new Intl.DateTimeFormat(n,f).formatToParts(e);("en"===i.language||"am"===i.language)&&"standard"==a&&c&&l&&(t=t.map(Sz("-"))),"wide"==a&&(t=t.map(Sz(" — "))),"ethiopic"===f.calendar&&(t=t.filter((e,t,r)=>"era"!==e.type&&("literal"!==e.type||!(t<r.length-1)||"era"!==r[t+1].type))),r=t.map(e=>e.value).join("")}return(!0===s||h&&"for today"===s)&&(r+=`, ${SG(e)}`),r}let Sz=e=>(t,r,n)=>"literal"!==t.type||" "!==t.value||r<n.length-1&&"era"===n[r+1].type?t:{type:"literal",value:e};function SG(e){return e.toLocaleTimeString(St(),{hour:"2-digit",minute:"2-digit"})}function Sq(e,t){return SH(e,{...t,time:!0})}function SY(e,t){let r=SU("string"==typeof t?new Intl.Locale(t):t);return r?v9(e,_m(r)):e}function SZ(e,t){return new Intl.DurationFormat(St(),t).format(e)}function SJ(e,t){if(null==e)return null;if("string"==typeof e){let r=SD(e,St());return r.invalid?(console.warn(`Could not interpret '${e}' as a date`),null):(r.day&&!r.month&&(r={...t$(r,"day"),...{month:r.day}}),r.month&&(r.month-=1),r.day&&(r={...t$(r,"day"),...{date:r.day}}),hP(t).set(r))}return hP(e)}let SX=["years","months","days","hours","minutes","seconds"],SQ={second:"seconds",minute:"minutes",hour:"hours",day:"days",month:"months",year:"years"},S0={seconds:45,minutes:45,hours:22,days:26,months:11,years:1/0};function S1(e,t=hP(),r){let n,i=hP(t),o=SJ(e,i);if(null==o)return null;if("string"==typeof r){let e=SQ[r]??r;return{[e]:i.diff(o,e)}}let{thresholds:a,largestUnit:s,smallestUnit:l}=r??{};if(void 0!==s||void 0!==l){let e,t=l?SQ[l]??l:void 0;return e="auto"===s||void 0===s?function(e,t,r){let n=SX.indexOf(r);for(let i=0;i<SX.length;i++){let o=SX[i];if(t.diff(e,o)>0)return i<=n?o:r}return r}(o,i,t??"seconds"):SQ[s]??s,function(e,t,r,n){let i=SX.indexOf(r),o=SX.indexOf(n),a=SX.slice(i,o+1),s={},l=e;for(let e of a){let r=t.diff(l,e);s[e]=r,l=l.add(r,e)}return s}(o,i,e,t??e)}let u=(n=function(e){let t={...S0};if(e)for(let[r,n]of Object.entries(e))void 0!==n&&(t[SQ[r]??r]=n);return t}(a),i.diff(o,"seconds")<n.seconds?"seconds":i.diff(o,"minutes")<n.minutes?"minutes":i.diff(o,"hours")<n.hours?"hours":i.diff(o,"days")<n.days?"days":i.diff(o,"months")<n.months?"months":"years");return{[u]:i.diff(o,u)}}let S3={style:"short",localeMatcher:"lookup"};function S4(e,t=hP(),r){let n=S1(e,t,r);return null==n?null:SZ(n,"object"==typeof r&&r.formatOptions?{...S3,...r.formatOptions}:S3)}let S2=(0,pq.createContext)(null);function S6(){let e=fG({externalModuleName:"@openmrs/esm-styleguide"}).preferredDateLocale,t=(0,pq.useMemo)(()=>{let t=St();return e[t]&&(t=e[t]),t},[window.i18next.language]),r=(0,pq.useMemo)(()=>{let e=SU(t);return void 0!==e?_m(e):void 0},[t]),n=(0,pq.useMemo)(()=>new Intl.Locale(t,{calendar:r?.identifier}),[t,r]),i=(0,pq.useMemo)(()=>r?v9(wa(wc()),r):wa(wc()),[r]);return{calendar:r,intlLocale:n,today_:i}}let S5=new vq(1793,1,1);var S8={};function S9(){return"u">typeof window&&window.InputEvent&&"function"==typeof InputEvent.prototype.getTargetRanges}function S7(e={}){let{locale:t}=b9();return(0,pq.useMemo)(()=>new(0,x$.K)(t,e),[t,e])}S8={"ar-AE":{decrease:e=>`\u{62E}\u{641}\u{636} ${e.fieldLabel}`,increase:e=>`\u{632}\u{64A}\u{627}\u{62F}\u{629} ${e.fieldLabel}`,numberField:"حقل رقمي"},"bg-BG":{decrease:e=>`\u{41D}\u{430}\u{43C}\u{430}\u{43B}\u{44F}\u{432}\u{430}\u{43D}\u{435} ${e.fieldLabel}`,increase:e=>`\u{423}\u{441}\u{438}\u{43B}\u{432}\u{430}\u{43D}\u{435} ${e.fieldLabel}`,numberField:"Номер на полето"},"cs-CZ":{decrease:e=>`Sn\xed\u{17E}it ${e.fieldLabel}`,increase:e=>`Zv\xfd\u{161}it ${e.fieldLabel}`,numberField:"Č\xedseln\xe9 pole"},"da-DK":{decrease:e=>`Reducer ${e.fieldLabel}`,increase:e=>`\xd8g ${e.fieldLabel}`,numberField:"Talfelt"},"de-DE":{decrease:e=>`${e.fieldLabel} verringern`,increase:e=>`${e.fieldLabel} erh\xf6hen`,numberField:"Nummernfeld"},"el-GR":{decrease:e=>`\u{39C}\u{3B5}\u{3AF}\u{3C9}\u{3C3}\u{3B7} ${e.fieldLabel}`,increase:e=>`\u{391}\u{3CD}\u{3BE}\u{3B7}\u{3C3}\u{3B7} ${e.fieldLabel}`,numberField:"Πεδίο αριθμού"},"en-US":{decrease:e=>`Decrease ${e.fieldLabel}`,increase:e=>`Increase ${e.fieldLabel}`,numberField:"Number field"},"es-ES":{decrease:e=>`Reducir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:"Campo de n\xfamero"},"et-EE":{decrease:e=>`V\xe4henda ${e.fieldLabel}`,increase:e=>`Suurenda ${e.fieldLabel}`,numberField:"Numbri v\xe4li"},"fi-FI":{decrease:e=>`V\xe4henn\xe4 ${e.fieldLabel}`,increase:e=>`Lis\xe4\xe4 ${e.fieldLabel}`,numberField:"Numerokentt\xe4"},"fr-FR":{decrease:e=>`Diminuer ${e.fieldLabel}`,increase:e=>`Augmenter ${e.fieldLabel}`,numberField:"Champ de nombre"},"he-IL":{decrease:e=>`\u{5D4}\u{5E7}\u{5D8}\u{5DF} ${e.fieldLabel}`,increase:e=>`\u{5D4}\u{5D2}\u{5D3}\u{5DC} ${e.fieldLabel}`,numberField:"שדה מספר"},"hr-HR":{decrease:e=>`Smanji ${e.fieldLabel}`,increase:e=>`Pove\u{107}aj ${e.fieldLabel}`,numberField:"Polje broja"},"hu-HU":{decrease:e=>`${e.fieldLabel} cs\xf6kkent\xe9se`,increase:e=>`${e.fieldLabel} n\xf6vel\xe9se`,numberField:"Sz\xe1mmező"},"it-IT":{decrease:e=>`Riduci ${e.fieldLabel}`,increase:e=>`Aumenta ${e.fieldLabel}`,numberField:"Campo numero"},"ja-JP":{decrease:e=>`${e.fieldLabel}\u{3092}\u{7E2E}\u{5C0F}`,increase:e=>`${e.fieldLabel}\u{3092}\u{62E1}\u{5927}`,numberField:"数値フィールド"},"ko-KR":{decrease:e=>`${e.fieldLabel} \u{AC10}\u{C18C}`,increase:e=>`${e.fieldLabel} \u{C99D}\u{AC00}`,numberField:"번호 필드"},"lt-LT":{decrease:e=>`Suma\u{17E}inti ${e.fieldLabel}`,increase:e=>`Padidinti ${e.fieldLabel}`,numberField:"Numerio laukas"},"lv-LV":{decrease:e=>`Samazin\u{101}\u{161}ana ${e.fieldLabel}`,increase:e=>`Palielin\u{101}\u{161}ana ${e.fieldLabel}`,numberField:"Skaitļu lauks"},"nb-NO":{decrease:e=>`Reduser ${e.fieldLabel}`,increase:e=>`\xd8k ${e.fieldLabel}`,numberField:"Tallfelt"},"nl-NL":{decrease:e=>`${e.fieldLabel} verlagen`,increase:e=>`${e.fieldLabel} verhogen`,numberField:"Getalveld"},"pl-PL":{decrease:e=>`Zmniejsz ${e.fieldLabel}`,increase:e=>`Zwi\u{119}ksz ${e.fieldLabel}`,numberField:"Pole numeru"},"pt-BR":{decrease:e=>`Diminuir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:"Campo de n\xfamero"},"pt-PT":{decrease:e=>`Diminuir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:"Campo num\xe9rico"},"ro-RO":{decrease:e=>`Sc\u{103}dere ${e.fieldLabel}`,increase:e=>`Cre\u{219}tere ${e.fieldLabel}`,numberField:"C\xe2mp numeric"},"ru-RU":{decrease:e=>`\u{423}\u{43C}\u{435}\u{43D}\u{44C}\u{448}\u{435}\u{43D}\u{438}\u{435} ${e.fieldLabel}`,increase:e=>`\u{423}\u{432}\u{435}\u{43B}\u{438}\u{447}\u{435}\u{43D}\u{438}\u{435} ${e.fieldLabel}`,numberField:"Числовое поле"},"sk-SK":{decrease:e=>`Zn\xed\u{17E}i\u{165} ${e.fieldLabel}`,increase:e=>`Zv\xfd\u{161}i\u{165} ${e.fieldLabel}`,numberField:"Č\xedseln\xe9 pole"},"sl-SI":{decrease:e=>`Upadati ${e.fieldLabel}`,increase:e=>`Pove\u{10D}ajte ${e.fieldLabel}`,numberField:"Številčno polje"},"sr-SP":{decrease:e=>`Smanji ${e.fieldLabel}`,increase:e=>`Pove\u{107}aj ${e.fieldLabel}`,numberField:"Polje broja"},"sv-SE":{decrease:e=>`Minska ${e.fieldLabel}`,increase:e=>`\xd6ka ${e.fieldLabel}`,numberField:"Nummerf\xe4lt"},"tr-TR":{decrease:e=>`${e.fieldLabel} azalt`,increase:e=>`${e.fieldLabel} artt\u{131}r`,numberField:"Sayı alanı"},"uk-UA":{decrease:e=>`\u{417}\u{43C}\u{435}\u{43D}\u{448}\u{438}\u{442}\u{438} ${e.fieldLabel}`,increase:e=>`\u{417}\u{431}\u{456}\u{43B}\u{44C}\u{448}\u{438}\u{442}\u{438} ${e.fieldLabel}`,numberField:"Поле номера"},"zh-CN":{decrease:e=>`\u{964D}\u{4F4E} ${e.fieldLabel}`,increase:e=>`\u{63D0}\u{9AD8} ${e.fieldLabel}`,numberField:"数字字段"},"zh-TW":{decrease:e=>`\u{7E2E}\u{5C0F} ${e.fieldLabel}`,increase:e=>`\u{653E}\u{5927} ${e.fieldLabel}`,numberField:"數字欄位"}};var De={};De={"ar-AE":{Empty:"فارغ"},"bg-BG":{Empty:"Изпразни"},"cs-CZ":{Empty:"Pr\xe1zdn\xe9"},"da-DK":{Empty:"Tom"},"de-DE":{Empty:"Leer"},"el-GR":{Empty:"Άδειο"},"en-US":{Empty:"Empty"},"es-ES":{Empty:"Vac\xedo"},"et-EE":{Empty:"T\xfchjenda"},"fi-FI":{Empty:"Tyhj\xe4"},"fr-FR":{Empty:"Vide"},"he-IL":{Empty:"ריק"},"hr-HR":{Empty:"Prazno"},"hu-HU":{Empty:"\xdcres"},"it-IT":{Empty:"Vuoto"},"ja-JP":{Empty:"空"},"ko-KR":{Empty:"비어 있음"},"lt-LT":{Empty:"Tuščias"},"lv-LV":{Empty:"Tukšs"},"nb-NO":{Empty:"Tom"},"nl-NL":{Empty:"Leeg"},"pl-PL":{Empty:"Pusty"},"pt-BR":{Empty:"Vazio"},"pt-PT":{Empty:"Vazio"},"ro-RO":{Empty:"Gol"},"ru-RU":{Empty:"Не заполнено"},"sk-SK":{Empty:"Pr\xe1zdne"},"sl-SI":{Empty:"Prazen"},"sr-SP":{Empty:"Prazno"},"sv-SE":{Empty:"Tomt"},"tr-TR":{Empty:"Boş"},"uk-UA":{Empty:"Пусто"},"zh-CN":{Empty:"空"},"zh-TW":{Empty:"空白"}};let Dt=()=>{};function Dr(e){var t;let r=(0,pq.useRef)(void 0),{value:n,textValue:i,minValue:o,maxValue:a,isDisabled:s,isReadOnly:l,isRequired:u,onIncrement:c,onIncrementPage:d,onDecrement:p,onDecrementPage:f,onDecrementToMin:h,onIncrementToMax:m}=e,y=vw((t=De)&&t.__esModule?t.default:t,"@react-aria/spinbutton"),g=(0,pq.useRef)(!1),b=(0,pq.useCallback)(()=>{clearTimeout(r.current),g.current=!1},[]),v=bv(()=>{b()});(0,pq.useEffect)(()=>()=>v(),[]);let w=(0,pq.useRef)(!1),x=()=>{w.current=!0},E=()=>{w.current=!1},S=""===i?y.format("Empty"):(i||`${n}`).replace("-","−");(0,pq.useEffect)(()=>{w.current&&(b7&&b7.clear("assertive"),ve(S,"assertive"))},[S]);let D=(0,pq.useCallback)(()=>{b()},[b]),O=bv(c??Dt),P=bv(p??Dt),C=bv(()=>{(void 0===a||isNaN(a)||void 0===n||isNaN(n)||n<a)&&(O(),k(60))}),k=bv(e=>{v(),g.current=!0,r.current=window.setTimeout(C,e)}),j=bv(()=>{(void 0===o||isNaN(o)||void 0===n||isNaN(n)||n>o)&&(P(),T(60))}),T=bv(e=>{v(),g.current=!0,r.current=window.setTimeout(j,e)}),R=e=>{e.preventDefault()},{addGlobalListener:A,removeAllGlobalListeners:N}=bw(),M=(0,pq.useRef)(!1),[I,$]=(0,pq.useState)(null);(0,pq.useEffect)(()=>{"touch"===I?k(600):I&&k(400)},[I]);let[L,F]=(0,pq.useState)(null);return(0,pq.useEffect)(()=>{"touch"===L?T(600):L&&T(400)},[L]),{spinButtonProps:{role:"spinbutton","aria-valuenow":void 0===n||isNaN(n)?void 0:n,"aria-valuetext":S,"aria-valuemin":o,"aria-valuemax":a,"aria-disabled":s||void 0,"aria-readonly":l||void 0,"aria-required":u||void 0,onKeyDown:e=>{if(!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&!l&&!e.nativeEvent.isComposing)switch(e.key){case"PageUp":if(d){e.preventDefault(),d?.();break}case"ArrowUp":case"Up":c&&(e.preventDefault(),c?.());break;case"PageDown":if(f){e.preventDefault(),f?.();break}case"ArrowDown":case"Down":p&&(e.preventDefault(),p?.());break;case"Home":h&&(e.preventDefault(),h?.());break;case"End":m&&(e.preventDefault(),m?.())}},onFocus:x,onBlur:E},incrementButtonProps:{onPressStart:e=>{b(),"touch"!==e.pointerType?(c?.(),$("mouse")):(A(window,"pointercancel",D,{capture:!0}),M.current=!1,$("touch")),A(window,"contextmenu",R)},onPressUp:e=>{b(),"touch"===e.pointerType&&(M.current=!0),N(),$(null)},onPressEnd:e=>{b(),"touch"===e.pointerType&&!g.current&&M.current&&c?.(),M.current=!1,$(null)},onFocus:x,onBlur:E},decrementButtonProps:{onPressStart:e=>{b(),"touch"!==e.pointerType?(p?.(),F("mouse")):(A(window,"pointercancel",D,{capture:!0}),M.current=!1,F("touch"))},onPressUp:e=>{b(),"touch"===e.pointerType&&(M.current=!0),N(),F(null)},onPressEnd:e=>{b(),"touch"===e.pointerType&&!g.current&&M.current&&p?.(),M.current=!1,F(null)},onFocus:x,onBlur:E}}}let Dn=null;var Di=r(6284);function Do(e,t,r){let n="+"===e?t+r:t-r;if(t%1!=0||r%1!=0){let i=t.toString().split("."),o=r.toString().split("."),a=Math.pow(10,Math.max(i[1]&&i[1].length||0,o[1]&&o[1].length||0));t=Math.round(t*a),r=Math.round(r*a),n=("+"===e?t+r:t-r)/a}return n}let Da=(0,pq.createContext)(null),Ds=(0,pq.createContext)(null),Dl=(0,pq.forwardRef)(function(e,t){var r,n;[e,t]=gr(e,t,Da);let{validationBehavior:i}=gt(x2)||{},o=null!=(n=null!=(r=e.validationBehavior)?r:i)?n:"native",{locale:a}=b9(),s=function(e){let{minValue:t,maxValue:r,step:n,formatOptions:i,value:o,defaultValue:a=NaN,onChange:s,locale:l,isDisabled:u,isReadOnly:c,commitBehavior:d="snap"}=e;null===o&&(o=NaN);let p=(0,pq.useCallback)(e=>void 0===n||isNaN(n)?Et(e,t,r):En(e,t,r,n),[n,t,r]);void 0===o||isNaN(o)||"snap"!==d||(o=p(o)),isNaN(a)||"snap"!==d||(a=p(a));let[f,h]=_S(o,isNaN(a)?NaN:a,s),[m]=(0,pq.useState)(f),[y,g]=(0,pq.useState)(()=>isNaN(f)?"":new(0,x$.K)(l,i).format(f)),b=(0,pq.useMemo)(()=>new(0,Di.d)(l,i),[l,i]),v=(0,pq.useMemo)(()=>b.getNumberingSystem(y),[b,y]),w=(0,pq.useMemo)(()=>new(0,x$.K)(l,{...i,numberingSystem:v}),[l,i,v]),x=(0,pq.useMemo)(()=>w.resolvedOptions(),[w]),E=(0,pq.useCallback)(e=>isNaN(e)||null===e?"":w.format(e),[w]),S=xv({...e,value:f}),D=void 0===n||isNaN(n)?1:n;"percent"===x.style&&(void 0===n||isNaN(n))&&(D=.01);let[O,P]=(0,pq.useState)(f),[C,k]=(0,pq.useState)(l),[j,T]=(0,pq.useState)(i);Object.is(f,O)&&l===C&&i===j||(g(E(f)),P(f),k(l),T(i));let R=(0,pq.useMemo)(()=>b.parse(y),[b,y]),A=(e,n=0)=>{if(isNaN(R))return En(isNaN(n)?0:n,t,r,D);{let n=En(R,t,r,D);return"+"===e&&n>R||"-"===e&&n<R?n:En(Do(e,R,D),t,r,D)}},N=(0,pq.useMemo)(()=>!u&&!c&&(isNaN(R)||void 0===r||isNaN(r)||En(R,t,r,D)>R||Do("+",R,D)<=r),[u,c,t,r,D,R]),M=(0,pq.useMemo)(()=>!u&&!c&&(isNaN(R)||void 0===t||isNaN(t)||En(R,t,r,D)<R||Do("-",R,D)>=t),[u,c,t,r,D,R]);return{...S,validate:e=>b.isValidPartialNumber(e,t,r),increment:()=>{let e=A("+",t);e===f&&g(E(e)),h(e),S.commitValidation()},incrementToMax:()=>{null!=r&&(h(En(r,t,r,D)),S.commitValidation())},decrement:()=>{let e=A("-",r);e===f&&g(E(e)),h(e),S.commitValidation()},decrementToMin:()=>{null!=t&&(h(t),S.commitValidation())},canIncrement:N,canDecrement:M,minValue:t,maxValue:r,numberValue:R,defaultNumberValue:isNaN(a)?m:a,setNumberValue:h,setInputValue:g,inputValue:y,commit:e=>{let t=void 0===e?y:e,r=R;if(void 0!==e&&(r=b.parse(t)),!t.length){h(NaN),g(void 0===o?"":E(f));return}if(isNaN(r))return void g(E(f));let n="snap"===d?p(r):r,i=(n=b.parse(E(n)))!==f;h(n),g(E(void 0===o?n:f)),i&&S.commitValidation()}}}({...e,locale:a,validationBehavior:o}),l=(0,pq.useRef)(null),[u,c]=gn(!e["aria-label"]&&!e["aria-labelledby"]),{labelProps:d,groupProps:p,inputProps:f,incrementButtonProps:h,decrementButtonProps:m,descriptionProps:y,errorMessageProps:g,...b}=function(e,t,r){var n,i,o,a,s,l,u,c,d;let p,{id:f,decrementAriaLabel:h,incrementAriaLabel:m,isDisabled:y,isReadOnly:g,isRequired:b,minValue:v,maxValue:w,autoFocus:x,label:E,formatOptions:S,onBlur:D=()=>{},onFocus:O,onFocusChange:P,onKeyDown:C,onKeyUp:k,description:j,errorMessage:T,isWheelDisabled:R,...A}=e,{increment:N,incrementToMax:M,decrement:I,decrementToMin:$,numberValue:L,inputValue:F,commit:B,commitValidation:V}=t,U=vw((n=S8)&&n.__esModule?n.default:n,"@react-aria/numberfield"),W=(0,pq.useCallback)(()=>{let e=r.current?.value??"";(0,b_.flushSync)(()=>{B()}),r.current?.value!==e&&ve(r.current?.value??"","assertive")},[B,r]),K=y2(f),{focusProps:H}=bo({onBlur(){W()}}),z=S7(S),G=(0,pq.useMemo)(()=>z.resolvedOptions(),[z]),q=S7({...S,currencySign:void 0}),Y=(0,pq.useMemo)(()=>isNaN(L)?"":q.format(L),[q,L]),{spinButtonProps:Z,incrementButtonProps:J,decrementButtonProps:X}=Dr({isDisabled:y,isReadOnly:g,isRequired:b,maxValue:w,minValue:v,onIncrement:N,onIncrementToMax:M,onDecrement:I,onDecrementToMin:$,value:L,textValue:Y}),[Q,ee]=(0,pq.useState)(!1),{focusWithinProps:et}=bN({isDisabled:y,onFocusWithinChange:ee});!function(e,t){let{onScroll:r,isDisabled:n}=e,i=(0,pq.useCallback)(e=>{!e.ctrlKey&&(e.preventDefault(),e.stopPropagation(),r&&r({deltaX:e.deltaX,deltaY:e.deltaY}))},[r]);wk(t,"wheel",n?void 0:i)}({onScroll:(0,pq.useCallback)(e=>{!(Math.abs(e.deltaY)<=Math.abs(e.deltaX))&&(e.deltaY>0?N():e.deltaY<0&&I())},[I,N]),isDisabled:R||y||g||!Q},r);let er=(G.maximumFractionDigits??0)>0,en=void 0===t.minValue||isNaN(t.minValue)||t.minValue<0,ei="numeric";gF()?en?ei="text":er&&(ei="decimal"):gK()&&(en?ei="numeric":er&&(ei="decimal"));let eo=gm(e),ea=(0,pq.useCallback)(e=>{e.nativeEvent.isComposing||("Enter"===e.key?((0,b_.flushSync)(()=>{B()}),V()):e.continuePropagation())},[B,V]),{isInvalid:es,validationErrors:el,validationDetails:eu}=t.displayValidation,{labelProps:ec,inputProps:ed,descriptionProps:ep,errorMessageProps:ef}=function(e,t,r){let n=bv(e=>{let n=r.current;if(!n)return;let i=null;switch(e.inputType){case"historyUndo":case"historyRedo":case"insertLineBreak":return;case"deleteContent":case"deleteByCut":case"deleteByDrag":i=n.value.slice(0,n.selectionStart)+n.value.slice(n.selectionEnd);break;case"deleteContentForward":i=n.selectionEnd===n.selectionStart?n.value.slice(0,n.selectionStart)+n.value.slice(n.selectionEnd+1):n.value.slice(0,n.selectionStart)+n.value.slice(n.selectionEnd);break;case"deleteContentBackward":i=n.selectionEnd===n.selectionStart?n.value.slice(0,n.selectionStart-1)+n.value.slice(n.selectionStart):n.value.slice(0,n.selectionStart)+n.value.slice(n.selectionEnd);break;case"deleteSoftLineBackward":case"deleteHardLineBackward":i=n.value.slice(n.selectionStart);break;default:null!=e.data&&(i=n.value.slice(0,n.selectionStart)+e.data+n.value.slice(n.selectionEnd))}null!=i&&t.validate(i)||e.preventDefault()});(0,pq.useEffect)(()=>{if(!S9()||!r.current)return;let e=r.current;return e.addEventListener("beforeinput",n,!1),()=>{e.removeEventListener("beforeinput",n,!1)}},[r]);let i=S9()?null:e=>{let r=g_(e).value.slice(0,g_(e).selectionStart)+e.data+g_(e).value.slice(g_(e).selectionEnd);t.validate(r)||e.preventDefault()},{labelProps:o,inputProps:a,descriptionProps:s,errorMessageProps:l,...u}=function(e,t){let{inputElementType:r="input",isDisabled:n=!1,isRequired:i=!1,isReadOnly:o=!1,type:a="text",validationBehavior:s="aria"}=e,[l,u]=_S(e.value,e.defaultValue||"",e.onChange),{focusableProps:c}=bu(e,t),d=xv({...e,value:l}),{isInvalid:p,validationErrors:f,validationDetails:h}=d.displayValidation,{labelProps:m,fieldProps:y,descriptionProps:g,errorMessageProps:b}=xa({...e,isInvalid:p,errorMessage:e.errorMessage||f}),v=gm(e,{labelable:!0}),w={type:a,pattern:e.pattern},[x]=(0,pq.useState)(l);return xs(t,e.defaultValue??x,u),xl(e,d,t),{labelProps:m,inputProps:y8(v,"input"===r?w:void 0,{disabled:n,readOnly:o,required:i&&"native"===s,"aria-required":i&&"aria"===s||void 0,"aria-invalid":p||void 0,"aria-errormessage":e["aria-errormessage"],"aria-activedescendant":e["aria-activedescendant"],"aria-autocomplete":e["aria-autocomplete"],"aria-haspopup":e["aria-haspopup"],"aria-controls":e["aria-controls"],value:l,onChange:e=>u(g_(e).value),autoComplete:e.autoComplete,autoCapitalize:e.autoCapitalize,maxLength:e.maxLength,minLength:e.minLength,name:e.name,form:e.form,placeholder:e.placeholder,inputMode:e.inputMode,autoCorrect:e.autoCorrect,spellCheck:e.spellCheck,[parseInt(pY().version,10)>=17?"enterKeyHint":"enterkeyhint"]:e.enterKeyHint,onCopy:e.onCopy,onCut:e.onCut,onPaste:e.onPaste,onCompositionEnd:e.onCompositionEnd,onCompositionStart:e.onCompositionStart,onCompositionUpdate:e.onCompositionUpdate,onSelect:e.onSelect,onBeforeInput:e.onBeforeInput,onInput:e.onInput,...c,...y}),descriptionProps:g,errorMessageProps:b,isInvalid:p,validationErrors:f,validationDetails:h}}(e,r),c=(0,pq.useRef)(null);return{inputProps:y8(a,{onBeforeInput:i,onCompositionStart(){let{value:e,selectionStart:t,selectionEnd:n}=r.current;c.current={value:e,selectionStart:t,selectionEnd:n}},onCompositionEnd(){if(r.current&&!t.validate(r.current.value)){let{value:e,selectionStart:n,selectionEnd:i}=c.current;r.current.value=e,r.current.setSelectionRange(n,i),t.setInputValue(e)}}}),labelProps:o,descriptionProps:s,errorMessageProps:l,...u}}({...A,...eo,name:void 0,form:void 0,label:E,autoFocus:x,isDisabled:y,isReadOnly:g,isRequired:b,validate:void 0,[xb]:t,value:F,defaultValue:"!",autoComplete:"off","aria-label":e["aria-label"]||void 0,"aria-labelledby":e["aria-labelledby"]||void 0,id:K,type:"text",inputMode:ei,onChange:e=>{t.validate(e)&&t.setInputValue(e)},onBlur:D,onFocus:O,onFocusChange:P,onKeyDown:(0,pq.useMemo)(()=>yH(ea,C),[ea,C]),onKeyUp:k,onPaste:t=>{e.onPaste?.(t);let r=g_(t);r&&(r.selectionEnd??-1)-(r.selectionStart??0)===r.value.length&&(t.preventDefault(),B(t.clipboardData?.getData?.("text/plain")?.trim()??""))},description:j,errorMessage:T},t,r);xs(r,t.defaultNumberValue,t.setNumberValue),i=t,o=e.validationBehavior,a=e.commitBehavior,s=r,l=t.minValue,u=t.maxValue,c=e.step,d=t.numberValue,yz(()=>{let e=s.current;if("validate"!==a||i.realtimeValidation.isInvalid||!e||e.disabled||(!Dn&&"u">typeof document&&((Dn=document.createElement("input")).type="number"),!Dn))return;Dn.min=null==l||isNaN(l)?"":String(l),Dn.max=null==u||isNaN(u)?"":String(u),Dn.step=null==c||isNaN(c)?"":String(c),Dn.value=null==d||isNaN(d)?"":String(d);let t=e.validity.valid&&Dn.validity.valid,r=e.validationMessage||Dn.validationMessage,n={isInvalid:!t,validationErrors:r?[r]:[],validationDetails:{badInput:e.validity.badInput,customError:e.validity.customError,patternMismatch:e.validity.patternMismatch,rangeOverflow:Dn.validity.rangeOverflow,rangeUnderflow:Dn.validity.rangeUnderflow,stepMismatch:Dn.validity.stepMismatch,tooLong:e.validity.tooLong,tooShort:e.validity.tooShort,typeMismatch:e.validity.typeMismatch,valueMissing:e.validity.valueMissing,valid:t}};i.updateValidation(n),"native"!==o||Dn.validity.valid||e.setCustomValidity(Dn.validationMessage)});let eh=y8(Z,H,ed,{role:null,"aria-roledescription":gV()?null:U.format("numberField"),"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null,autoCorrect:"off",spellCheck:"false"});"native"===e.validationBehavior&&(eh["aria-required"]=void 0);let em=e=>{((e=document)=>e.activeElement)()!==r.current&&("mouse"===e.pointerType?r.current?.focus():e.target.focus())},ey=e["aria-label"]||("string"==typeof e.label?e.label:"");ey||(p=null!=e.label?ec.id:e["aria-labelledby"]);let eg=y2(),eb=y2(),ev=y8(J,{"aria-label":m||U.format("increase",{fieldLabel:ey}).trim(),id:p&&!m?eg:null,"aria-labelledby":p&&!m?`${eg} ${p}`:null,"aria-controls":K,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!t.canIncrement,onPressStart:em}),ew=y8(X,{"aria-label":h||U.format("decrease",{fieldLabel:ey}).trim(),id:p&&!h?eb:null,"aria-labelledby":p&&!h?`${eb} ${p}`:null,"aria-controls":K,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!t.canDecrement,onPressStart:em});return{groupProps:{...et,role:"group","aria-disabled":y,"aria-invalid":es?"true":void 0},labelProps:ec,inputProps:eh,incrementButtonProps:ev,decrementButtonProps:ew,errorMessageProps:ef,descriptionProps:ep,isInvalid:es,validationErrors:el,validationDetails:eu}}({...gi(e),label:c,validationBehavior:o},s,l),v=ge({...e,values:{state:s,isDisabled:e.isDisabled||!1,isInvalid:b.isInvalid||!1,isRequired:e.isRequired||!1},defaultClassName:"react-aria-NumberField"}),w=gm(e);return delete w.id,pY().createElement(y7,{values:[[Ds,s],[_U,p],[_K,{...f,ref:l}],[x6,{...d,ref:u}],[bK,{slots:{increment:h,decrement:m}}],[bG,{slots:{description:y,errorMessage:g}}],[x1,b]]},pY().createElement("div",{...w,...v,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-required":e.isRequired||void 0,"data-invalid":b.isInvalid||void 0}),e.name&&pY().createElement("input",{type:"hidden",name:e.name,value:isNaN(s.numberValue)?"":s.numberValue}))});function Du(e,t){return Number.parseInt(SH(e,{calendar:t.calendar,locale:t.baseName,day:!1,month:!1,noToday:!0,numberingSystem:"latn"}))}let Dc=(0,pq.forwardRef)(function(e,t){let{className:r}=e,n=(0,pq.useContext)(_R),i=(0,pq.useContext)(_A),o=n??i,a=(0,pq.useContext)(S2),s=wc(),l=SH(o.visibleRange.start.toDate(s),{calendar:a.calendar,locale:a.baseName,day:!1,year:!1,noToday:!0}),u=Du(o.visibleRange.start.toDate(s),a),c=o.maxValue?Du(o.maxValue.toDate(s),a):void 0,d=o.minValue?Du(o.minValue.toDate(s),a):void 0,p=(0,pq.useCallback)(e=>{o.setFocusedDate(o.focusedDate.cycle("year",e-o.focusedDate.year))},[]);return o&&(0,hq.jsxs)("span",{ref:t,className:r,children:[(0,hq.jsx)("span",{children:l}),(0,hq.jsxs)(Dl,{formatOptions:{useGrouping:!1},maxValue:c,minValue:d,onChange:p,value:u,children:[(0,hq.jsx)(_H,{}),(0,hq.jsxs)(_W,{children:[(0,hq.jsx)(bH,{slot:"increment",children:(0,hq.jsx)(mg,{size:8})}),(0,hq.jsx)(bH,{slot:"decrement",children:(0,hq.jsx)(mh,{size:8})})]})]})]})}),Dd="-esm-billing__datepicker-module__inputGroup___-wpzr",Dp="-esm-billing__datepicker-module__inputSegment___ocu7L",Df="-esm-billing__datepicker-module__dateInputWrapper___909Km",Dh="-esm-billing__datepicker-module__invalidText___oHJHi",Dm="-esm-billing__datepicker-module__flatButton___i9LDo",Dy="-esm-billing__datepicker-module__flatButtonMd___VZMkc",Dg="-esm-billing__datepicker-module__flatButtonSm___VA5wy",Db="-esm-billing__datepicker-module__flatButtonLg___MnYLl";function Dv({children:e}){let t=(0,pq.useContext)(E3),r=(0,pq.useContext)(E4),n=t??r,i=hy(()=>n?.close());return(0,hq.jsx)(x0,{className:"-esm-billing__datepicker-module__dialog___2pADb",ref:i,children:e})}let Dw=(0,pq.forwardRef)(function({variant:e,today_:t,minDate:r,maxDate:n},i){let o="range"===e;return(0,hq.jsx)(EJ,{ref:i,className:"-esm-billing__datepicker-module__popover___pb58i",placement:"bottom start",offset:1,isNonModal:!0,children:(0,hq.jsx)(Dv,{children:(0,hq.jsxs)(o?_M:_N,{...o?{minValue:r,maxValue:n,className:"cds--date-picker__calendar"}:{},children:[(0,hq.jsxs)("header",{className:"-esm-billing__datepicker-module__header___+fi16",children:[(0,hq.jsx)(bH,{className:hZ()(Dm,Dy),slot:"previous",children:(0,hq.jsx)(mS,{size:16})}),(0,hq.jsx)(Dc,{className:"-esm-billing__datepicker-module__monthYear___mGhot"}),(0,hq.jsx)(bH,{className:hZ()(Dm,Dy),slot:"next",children:(0,hq.jsx)(mD,{size:16})})]}),(0,hq.jsx)(_$,{className:"-esm-billing__datepicker-module__calendarGrid___z07wV",children:e=>(0,hq.jsx)(_V,{className:hZ()("cds--date-picker__day",{"-esm-billing__datepicker-module__today___dNc4M":0===t.compare(e)}),date:e},e.toString())})]})})})}),D_=(0,pq.forwardRef)(function(e,t){let r=(0,pq.useContext)(E3),[n,i]=gr({slot:e.slot},t,xU),{locale:o}=b9(),a=xV({...n,locale:o,createCalendar:_m}),s=(0,pq.useRef)(null),{fieldProps:l,inputProps:u}=xp({...n,inputRef:s},a,i),c=(0,pq.useCallback)(()=>{a.isDisabled||r.toggle()},[]);return(0,hq.jsxs)(y7,{values:[[xW,a],[_K,{...u,ref:s}],[_U,{...l,ref:i,isInvalid:a.isInvalid}]],children:[(0,hq.jsx)(_W,{...e,id:e.id,ref:t,slot:e.slot||void 0,className:e.className,isDisabled:a.isDisabled,isInvalid:a.isInvalid,onClick:c,children:a.segments.map((t,r)=>(0,pq.cloneElement)(e.children(t),{key:r}))}),(0,hq.jsx)(_H,{})]})}),Dx=(0,pq.forwardRef)(function(e,t){let r=(0,pq.useContext)(E3),n=(0,pq.useContext)(E4);return(r??n).isInvalid?(0,hq.jsx)(yR,{ref:t,size:16,...e}):(0,hq.jsx)(mf,{ref:t,size:16,...e})});class DE{constructor(e,t){this.locale=e,this.dictionary=t}of(e){return this.dictionary.getStringForLocale(e,this.locale)}}let DS=new Map,DD=(0,pq.forwardRef)(function({segment:e,...t},r){let n=(0,pq.useContext)(xW),i=yU(r),{segmentProps:o}=function(e,t,r){let n,i,o,a,s=(0,pq.useRef)(""),{locale:l,direction:u}=b9(),c=function(){var e;let{locale:t}=b9(),r=vv((e=xn)&&e.__esModule?e.default:e,"@react-aria/datepicker");return(0,pq.useMemo)(()=>{try{return new Intl.DisplayNames(t,{type:"dateTimeField"})}catch{return new DE(t,r)}},[t,r])}(),{ariaLabel:d,ariaLabelledBy:p,ariaDescribedBy:f,focusManager:h}=xu.get(t),m=e.isPlaceholder?"":e.text,y=(0,pq.useMemo)(()=>t.dateFormatter.resolvedOptions(),[t.dateFormatter]),g=vc({month:"long",timeZone:y.timeZone}),b=vc({hour:"numeric",hour12:y.hour12,timeZone:y.timeZone});if("month"!==e.type||e.isPlaceholder)"hour"!==e.type||e.isPlaceholder||(m=b.format(t.dateValue));else{let e=g.format(t.dateValue);m=e!==m?`${m} \u{2013} ${e}`:e}let{spinButtonProps:v}=Dr({value:e.value??void 0,textValue:m,minValue:e.minValue,maxValue:e.maxValue,isDisabled:t.isDisabled,isReadOnly:t.isReadOnly||!e.isEditable,isRequired:t.isRequired,onIncrement:()=>{s.current="",t.increment(e.type)},onDecrement:()=>{s.current="",t.decrement(e.type)},onIncrementPage:()=>{s.current="",t.incrementPage(e.type)},onDecrementPage:()=>{s.current="",t.decrementPage(e.type)},onIncrementToMax:()=>{s.current="",t.incrementToMax(e.type)},onDecrementToMin:()=>{s.current="",t.decrementToMin(e.type)}}),w=(0,pq.useMemo)(()=>new(0,Di.d)(l,{maximumFractionDigits:0}),[l]),x=()=>{if(e.text===e.placeholder&&h.focusPrevious(),!w.isValidPartialNumber(e.text)||t.isReadOnly||e.isPlaceholder)("dayPeriod"===e.type||"era"===e.type)&&t.clearSegment(e.type);else{let r=e.text.slice(0,-1),n=w.parse(r);0===(r=0===n?"":r).length||0===n?t.clearSegment(e.type):t.setSegment(e.type,n),s.current=r}},{startsWith:E}=(n=function(e){let{locale:t}=b9(),r=t+(e?Object.entries(e).sort((e,t)=>e[0]<t[0]?-1:1).join():"");if(DS.has(r))return DS.get(r);let n=new Intl.Collator(t,e);return DS.set(r,n),n}({usage:"search",sensitivity:"base"}),i=(0,pq.useCallback)((e,t)=>0===t.length||(e=e.normalize("NFC"),t=t.normalize("NFC"),0===n.compare(e.slice(0,t.length),t)),[n]),o=(0,pq.useCallback)((e,t)=>0===t.length||(e=e.normalize("NFC"),t=t.normalize("NFC"),0===n.compare(e.slice(-t.length),t)),[n]),a=(0,pq.useCallback)((e,t)=>{if(0===t.length)return!0;e=e.normalize("NFC");let r=0,i=(t=t.normalize("NFC")).length;for(;r+i<=e.length;r++){let o=e.slice(r,r+i);if(0===n.compare(t,o))return!0}return!1},[n]),(0,pq.useMemo)(()=>({startsWith:i,endsWith:o,contains:a}),[i,o,a])),S=vc({hour:"numeric",hour12:!0}),D=(0,pq.useMemo)(()=>{let e=new Date;return e.setHours(0),S.formatToParts(e).find(e=>"dayPeriod"===e.type).value},[S]),O=(0,pq.useMemo)(()=>{let e=new Date;return e.setHours(12),S.formatToParts(e).find(e=>"dayPeriod"===e.type).value},[S]),P=vc({year:"numeric",era:"narrow",timeZone:"UTC"}),C=(0,pq.useMemo)(()=>{if("era"!==e.type)return[];let r=v9(new vq(1,1,1),t.calendar),n=t.calendar.getEras().map(e=>{let t=r.set({year:1,month:1,day:1,era:e}).toDate("UTC");return{era:e,formatted:P.formatToParts(t).find(e=>"era"===e.type).value}}),i=function(e){e.sort();let t=e[0],r=e[e.length-1];for(let e=0;e<t.length;e++)if(t[e]!==r[e])return e;return 0}(n.map(e=>e.formatted));if(i)for(let e of n)e.formatted=e.formatted.slice(i);return n},[P,t.calendar,e.type]),k=r=>{if(t.isDisabled||t.isReadOnly)return;let n=s.current+r;switch(e.type){case"dayPeriod":if(E(D,r))t.setSegment("dayPeriod",0);else if(E(O,r))t.setSegment("dayPeriod",1);else break;h.focusNext();break;case"era":{let e=C.find(e=>E(e.formatted,r));e&&(t.setSegment("era",e.era),h.focusNext());break}case"day":case"hour":case"minute":case"second":case"month":case"year":{if(!w.isValidPartialNumber(n))return;let i=w.parse(n),o=i;if(void 0!==e.maxValue&&i>e.maxValue&&(o=w.parse(r)),isNaN(i))return;t.setSegment(e.type,o),void 0!==e.maxValue&&(Number(i+"0")>e.maxValue||n.length>=String(e.maxValue).length)?(s.current="",h.focusNext()):s.current=n}}};wk((0,pq.useRef)("u">typeof document?document:null),"selectionchange",()=>{let e=window.getSelection();e?.anchorNode&&gw(r.current,e?.anchorNode)&&e.collapse(r.current)});let j=(0,pq.useRef)("");wk(r,"beforeinput",n=>{if(r.current)switch(n.preventDefault(),n.inputType){case"deleteContentBackward":case"deleteContentForward":w.isValidPartialNumber(e.text)&&!t.isReadOnly&&x();break;case"insertCompositionText":j.current=r.current.textContent,r.current.textContent=r.current.textContent;break;default:null!=n.data&&k(n.data)}}),wk(r,"input",e=>{let{inputType:t,data:n}=e;"insertCompositionText"===t&&(r.current&&(r.current.textContent=j.current),null!=n&&(E(D,n)||E(O,n))&&k(n))}),yz(()=>{let e=r.current;return()=>{((e=document)=>e.activeElement)()===e&&(h.focusPrevious()||h.focusNext())}},[r,h]);let T=gV()||"timeZoneName"===e.type?{role:"textbox","aria-valuemax":null,"aria-valuemin":null,"aria-valuetext":null,"aria-valuenow":null}:{};e===(0,pq.useMemo)(()=>t.segments.find(e=>e.isEditable),[t.segments])||t.isInvalid||(f=void 0);let R=y2(),A=!t.isDisabled&&!t.isReadOnly&&e.isEditable,N="literal"===e.type?"":c.of(e.type),M=wS({"aria-label":`${N}${d?`, ${d}`:""}${p?", ":""}`,"aria-labelledby":p});if("literal"===e.type)return{segmentProps:{"aria-hidden":!0}};let I={caretColor:"transparent"};if("rtl"===u){I.unicodeBidi="embed";let t=y[e.type];("numeric"===t||"2-digit"===t)&&(I.direction="ltr")}return{segmentProps:y8(v,M,{id:R,...T,"aria-invalid":t.isInvalid?"true":void 0,"aria-describedby":f,"aria-readonly":t.isReadOnly||!e.isEditable?"true":void 0,"data-placeholder":e.isPlaceholder||void 0,contentEditable:A,suppressContentEditableWarning:A,spellCheck:A?"false":void 0,autoCorrect:A?"off":void 0,[parseInt(pY().version,10)>=17?"enterKeyHint":"enterkeyhint"]:A?"next":void 0,inputMode:t.isDisabled||"dayPeriod"===e.type||"era"===e.type||!A?void 0:"numeric",tabIndex:t.isDisabled?void 0:0,onKeyDown:e=>{if("a"===e.key&&(gL()?e.metaKey:e.ctrlKey)&&e.preventDefault(),!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey)switch(e.key){case"Backspace":case"Delete":e.preventDefault(),e.stopPropagation(),x()}},onFocus:()=>{s.current="",r.current&&wN(r.current,{containingElement:wT(r.current)});let e=window.getSelection();e?.collapse(r.current)},style:I,onPointerDown(e){e.stopPropagation()},onMouseDown(e){e.stopPropagation()}})}}(e,n,i),{focusProps:a,isFocused:s,isFocusVisible:l}=bM(),{hoverProps:u,isHovered:c}=bB({...t,isDisabled:n.isDisabled||"literal"===e.type}),d=function(e){let{className:t,style:r,children:n,defaultClassName:i,defaultChildren:o,defaultStyle:a,values:s}=e;return(0,pq.useMemo)(()=>{let e,l,u;return e="function"==typeof t?t({...s,defaultClassName:i}):t,l="function"==typeof r?r({...s,defaultStyle:a||{}}):r,u="function"==typeof n?n({...s,defaultChildren:o}):null==n?o:n,{className:e??i,style:l||a?{...a,...l}:void 0,children:u??o,"data-rac":""}},[t,r,n,i,o,a,s])}({...t,values:{...e,isReadOnly:!e.isEditable,isInvalid:n.isInvalid,isDisabled:n.isDisabled,isHovered:c,isFocused:s,isFocusVisible:l},defaultChildren:e.text}),p=(0,pq.useCallback)(e=>{e.stopPropagation()},[]);return(0,hq.jsx)("span",{...y8(gm(t),o,a,u),...d,ref:i,style:o.style,"data-placeholder":e.isPlaceholder||void 0,"data-invalid":n.isInvalid||void 0,"data-readonly":!e.isEditable||void 0,"data-disabled":n.isDisabled||void 0,"data-type":e.type,"data-hovered":c||void 0,"data-focused":s||void 0,"data-focus-visible":l||void 0,onClick:p})}),DO={short:!1,size:"md"},DP=(0,pq.forwardRef)(function(e,t){let{className:r,defaultValue:n,isDisabled:i,invalid:o,invalidText:a,isInvalid:s,label:l,labelText:u,light:c,maxDate:d,minDate:p,onChange:f,onChangeRaw:h,short:m,size:y,value:g,...b}={...DO,...e},{calendar:v,intlLocale:w,today_:x}=S6(),E=(0,pq.useId)(),S=!!(u??l),D=(0,pq.useMemo)(()=>E8(n,v),[n,v]),O=(0,pq.useMemo)(()=>E8(g,v,!0),[g,v]),P=(0,pq.useMemo)(()=>E8(d,v),[d,v]),C=(0,pq.useMemo)(()=>E8(p??S5,v),[p,v]),k=(0,pq.useMemo)(()=>o||s,[o,s]),j=(0,pq.useMemo)(()=>(h&&f&&console.error("An OpenmrsDatePicker component was created with both onChange and onChangeRaw handlers defined. Only onChangeRaw will be used."),h??(e=>f?.(E9(e)))),[h,f]);return(0,hq.jsx)(E5,{locale:w.toString(),children:(0,hq.jsx)("div",{className:hZ()("cds--form-item",r),children:(0,hq.jsx)(y7,{values:[[S2,w]],children:(0,hq.jsxs)(E2,{className:hZ()("cds--date-picker","cds--date-picker--single",{"cds--date-picker--short":m,"cds--date-picker--light":c}),defaultValue:D,isDisabled:i,isInvalid:k,maxValue:P,minValue:C,value:O,shouldForceLeadingZeros:"en"===w.language||void 0,...b,onChange:j,children:[(0,hq.jsxs)("div",{className:"cds--date-picker-container",children:[S&&(0,hq.jsx)(x5,{className:hZ()("cds--label",{"cds--label--disabled":i}),htmlFor:E,children:u??l}),(0,hq.jsxs)(_W,{className:Dd,children:[(0,hq.jsx)(D_,{id:S?E:void 0,ref:t,className:hZ()("cds--date-picker-input__wrapper","-esm-billing__datepicker-module__inputWrapper___MHJAy",{"-esm-billing__datepicker-module__inputWrapperSm___esx4E":"sm"===y,"-esm-billing__datepicker-module__inputWrapperMd___VQbzP":"md"===y||!y||0===y.length,"-esm-billing__datepicker-module__inputWrapperLg___Rk9Ce":"lg"===y}),children:e=>"era"!==e.type?(0,hq.jsx)(DD,{className:Dp,segment:e}):(0,hq.jsx)(pY().Fragment,{})}),(0,hq.jsx)(bH,{className:hZ()(Dm,{[Dg]:"sm"===y,[Dy]:"md"===y||!y||0===y.length,[Db]:"lg"===y}),children:(0,hq.jsx)(Dx,{})})]}),(0,hq.jsx)(x3,{className:Dh,children:a})]}),(0,hq.jsx)(Dw,{variant:"single",today_:x})]})})})})}),DC=(0,pq.forwardRef)(function({className:e,defaultValue:t,invalid:r,invalidText:n,isDisabled:i,isInvalid:o,label:a,labelText:s,light:l,maxDate:u,minDate:c,onChange:d,onChangeRaw:p,size:f="md",value:h,...m},y){let{calendar:g,intlLocale:b,today_:v}=S6(),w=(0,pq.useId)(),x=!!(s??a),E=(0,pq.useMemo)(()=>{if(h)return{start:E8(h[0],g,!1),end:E8(h[1],g,!1)}},[h,g]),S=(0,pq.useMemo)(()=>{if(t)return{start:E8(t[0],g,!1),end:E8(t[1],g,!1)}},[t,g]),D=(0,pq.useMemo)(()=>E8(c??S5,g,!0),[c,g]),O=(0,pq.useMemo)(()=>E8(u,g,!0),[u,g]),P=(0,pq.useMemo)(()=>r||o,[r,o]),C=(0,pq.useMemo)(()=>(p&&d&&console.error("An OpenmrsDateRangePicker component was created with both onChange and onChangeRaw handlers defined. Only onChangeRaw will be used."),p??(e=>d?.([E9(e.start),E9(e.end)]))),[p,d]);return(0,hq.jsx)(E5,{locale:b.toString(),children:(0,hq.jsx)("div",{className:hZ()("cds--form-item",e),children:(0,hq.jsx)(y7,{values:[[S2,b]],children:(0,hq.jsx)(E6,{id:x?w:void 0,className:hZ()("cds--date-picker",{"cds--date-picker--light":l,"cds--date-picker--disabled":i}),isInvalid:P,shouldForceLeadingZeros:"en"===b.language||void 0,maxValue:O,minValue:D,value:E,defaultValue:S,ref:y,isDisabled:i,...m,onChange:C,children:(0,hq.jsxs)("div",{className:"cds--date-picker-container",children:[x&&(0,hq.jsx)(x5,{className:hZ()("cds--label",{"cds--label--disabled":i}),htmlFor:w,children:s??a}),(0,hq.jsxs)(_W,{className:Dd,children:[(0,hq.jsxs)("div",{className:hZ()("-esm-billing__datepicker-module__inputsWrapper___UyGoG",{"-esm-billing__datepicker-module__inputsWrapperSm___qrGsA":"sm"===f,"-esm-billing__datepicker-module__inputsWrapperMd___pofu4":"md"===f||!f||0===f.length,"-esm-billing__datepicker-module__inputsWrapperLg___eF1Im":"lg"===f}),children:[(0,hq.jsx)(xH,{className:hZ()("cds--date-picker-input__wrapper","-esm-billing__datepicker-module__startInput___C8vnM",Df),slot:"start",children:e=>(0,hq.jsx)(DD,{className:Dp,segment:e})}),(0,hq.jsx)("div",{className:"-esm-billing__datepicker-module__separator___vHLFZ",children:(0,hq.jsx)("span",{"aria-hidden":"true","data-readonly":!0,children:"–"})}),(0,hq.jsx)(xH,{className:hZ()("cds--date-picker-input__wrapper","-esm-billing__datepicker-module__endInput___25OF9",Df),slot:"end",children:e=>(0,hq.jsx)(DD,{className:Dp,segment:e})})]}),(0,hq.jsx)(bH,{className:hZ()(Dm,{[Dg]:"sm"===f,[Dy]:"md"===f||!f||0===f.length,[Db]:"lg"===f}),children:(0,hq.jsx)(Dx,{})})]}),(0,hq.jsx)(x3,{className:Dh,children:n}),(0,hq.jsx)(Dw,{variant:"range",today_:v,minDate:D,maxDate:O})]})})})})})}),Dk=({diagnoses:e})=>{let{diagnosisTags:t}=fG({externalModuleName:"@openmrs/esm-styleguide"});return(0,hq.jsx)("div",{className:"-esm-billing__diagnosis-tags-module__container___l7XiW",children:e.map(e=>{let{rank:r,uuid:n,display:i}=e,o=t[1===r?"primaryColor":"secondaryColor"];return(0,hq.jsx)(h1.vwO,{type:o,children:i},n)})})},Dj={action:"-esm-billing__empty-card-module__action___l4wUo",content:"-esm-billing__empty-card-module__content___XbsSJ",desktopHeading:"-esm-billing__empty-card-module__desktopHeading___0EPXX",tabletHeading:"-esm-billing__empty-card-module__tabletHeading___unl1F",tile:"-esm-billing__empty-card-module__tile___vS3Sj"},DT=({width:e="64",height:t="64"})=>(0,hq.jsx)("svg",{width:e,height:t,viewBox:"0 0 64 64",children:(0,hq.jsx)("use",{href:"#omrs-empty-data-illustration"})}),DR=e=>{let t="tablet"===hd(),r=e.launchForm;return(0,hq.jsx)(h1.Wdr,{className:Dj.layer,children:(0,hq.jsxs)(h1.FAs,{className:Dj.tile,children:[(0,hq.jsx)("div",{className:t?Dj.tabletHeading:Dj.desktopHeading,children:(0,hq.jsx)("h4",{children:e.headerTitle})}),(0,hq.jsx)(DT,{}),(0,hq.jsx)("p",{className:Dj.content,children:oR("emptyStateText","There are no {{displayText}} to display",{displayText:e.displayText})}),(0,hq.jsx)("p",{className:Dj.action,children:r&&(0,hq.jsx)(h1.$nd,{onClick:()=>r(),kind:"ghost",size:t?"lg":"sm",children:oR("recordNewEntry","Record {{ displayText }}",{displayText:e.displayText})})})]})})},DA=({error:e,headerTitle:t})=>{let r="tablet"===hd();return(0,hq.jsx)(h1.Wdr,{children:(0,hq.jsxs)(h1.FAs,{className:"-esm-billing__error-state-module__tile___hHM56",children:[(0,hq.jsx)("div",{className:r?"-esm-billing__error-state-module__tabletHeading___W7a4U":"-esm-billing__error-state-module__desktopHeading___VL8Rv",children:(0,hq.jsx)("h4",{children:t})}),(0,hq.jsxs)("p",{className:"-esm-billing__error-state-module__errorMessage___IytZy",children:[oR("error","Error")," ",`${e?.response?.status}: `,e?.response?.statusText]}),(0,hq.jsx)("p",{className:"-esm-billing__error-state-module__errorCopy___E1yZO",children:oR("errorCopy")})]})})},DN=DA,DM=pY().forwardRef((e,t)=>{let{slotName:r,basePath:n,componentContext:i,state:o}=hh(),a=window.location??{pathname:""},s=p7(r??"");return e.isChildOfHeader&&r&&s.length>0?(0,hq.jsxs)(h1.f8J,{"aria-label":oR("leftNavigation","Left navigation"),className:"-esm-billing__left-nav-module__leftNav___ZqLpw",expanded:!0,isFixedNav:!0,ref:t,...e,children:[(0,hq.jsx)(fr,{name:"global-nav-menu-slot"}),r?(0,hq.jsx)(f$,{value:i,fallback:(0,hq.jsx)(fr,{name:r,state:{basePath:n,currentPath:a,...o}}),children:(0,hq.jsx)(pZ.Provider,{value:i,children:(0,hq.jsx)(fr,{name:r,state:{basePath:n,currentPath:a,...o}})})}):null]}):null}),DI=({selectedLocationUuid:e,defaultLocationUuid:t,locationTag:r,locationsPerRequest:n=50,onChange:i})=>{let[o,a]=(0,pq.useState)(""),s=(0,pq.useId)(),{location:l}=function(e){let t=e?`/ws/fhir2/R4/Location?_id=${e}`:null,{data:r,error:n,isLoading:i}=fX()(t,iR,{shouldRetryOnError:e=>!!e?.response?.status&&e.response.status>=500});return(0,pq.useMemo)(()=>({location:r?.data?.entry?r.data.entry[0]:null,error:t?n:null,isLoading:!!t&&i}),[r,i,n,t])}(t),{locations:u,isLoading:c,hasMore:d,loadingNewData:p,error:f,setPage:h}=function(e,t=0,r=""){let n=fZ(r),{data:i,isLoading:o,isValidating:a,setSize:s,error:l}=hn()(function(r,i){if(i){let e=i.data?.link?.find(e=>"next"===e.relation);if(!e)return null;let t=new URL(e.url);return t.origin===window.location.origin?e.url:new URL(`${t.pathname}${t.search?`?${t.search}`:""}`,window.location.origin).toString()}let o=`${ik}/Location?`,a=new URLSearchParams;return a.append("_summary","data"),t&&a.append("_count",""+t),r&&a.append("_getpagesoffset",""+r*t),e&&a.append("_tag",e),"string"==typeof n&&""!==n&&a.append("name:contains",n),o+a.toString()},iR);return(0,pq.useMemo)(()=>({locations:i?.length?i?.flatMap(e=>e?.data?.entry??[]):[],isLoading:o,totalResults:i?.[0]?.data?.total,hasMore:!!i?.length&&i?.[i.length-1]?.data?.link?.some(e=>"next"===e.relation),loadingNewData:a,error:l||null,setPage:s}),[o,i,a,s,l])}(r,n,o),m=(0,pq.useMemo)(()=>l&&!o&&t?[l,...u.filter(({resource:e})=>e.id!==t)]:u??[],[l,u,t,o]),y=(0,pq.useCallback)(e=>{i(),a(e.trim())},[i]),g=hg((0,pq.useCallback)(()=>{!p&&d&&h(e=>e+1)},[p,d,h])),b=d?Math.max(0,Math.floor(m.length-n/2)):-1;return(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsx)(h1.vji,{"aria-describedby":f?`${s}-error`:void 0,labelText:oR("searchForLocation"),id:s,placeholder:oR("searchForLocation"),onChange:e=>y(e.target.value),size:"lg"}),f&&(0,hq.jsx)("div",{className:"-esm-billing__location-picker-module__errorNotification___MBWvf",id:`${s}-error`,children:(0,hq.jsx)(h1.jeF,{kind:"error",subtitle:oR("errorLoadingLoginLocations","Unable to load login locations. Please try again or contact support if the problem persists."),title:oR("error","Error")})}),(0,hq.jsx)("div",{className:"-esm-billing__location-picker-module__searchResults___aCL93",children:c?(0,hq.jsx)("div",{className:"-esm-billing__location-picker-module__loadingContainer___Vn1H0",children:Array.from({length:5}).map((e,t)=>(0,hq.jsx)(h1.Psq,{className:"-esm-billing__location-picker-module__radioButtonSkeleton___RKMHj",role:"progressbar"},t))}):(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsx)("div",{className:"-esm-billing__location-picker-module__locationResultsContainer___5yuvs",children:m.length>0?(0,hq.jsx)(h1.zWQ,{name:"loginLocations",onChange:e=>{i(e?.toString())},orientation:"vertical",valueSelected:e,children:m.map((e,t)=>(0,hq.jsx)(h1.aaP,{className:"-esm-billing__location-picker-module__locationRadioButton___b52LI",id:e.resource.id,labelText:(0,hq.jsx)("span",{ref:t===b?g:null,children:e.resource.name}),name:e.resource.name,value:e.resource.id},e.resource.id))}):(0,hq.jsx)("div",{className:"-esm-billing__location-picker-module__emptyState___qiPqQ",children:(0,hq.jsx)("p",{className:"-esm-billing__location-picker-module__locationNotFound___tKDOJ",children:oR("noResultsToDisplay")})})}),p&&(0,hq.jsx)("div",{className:"-esm-billing__location-picker-module__loadingIcon___PGwvc",children:(0,hq.jsx)(h1.OuH,{description:oR("loading")})})]})})]})},D$=Y("modalState",{modalContainer:null,modalStack:[]}),DL=0;async function DF(e,t,r={}){let n=pD(t),i=null;if(e){if(!n)throw Error(`No modal named '${t}' has been registered.`);let{load:o}=n,a=await o(),s=DL++;i=await pK({...a,name:`${t}-${s}`},{...r,domElement:e})}else I(`Failed to launch modal. Please notify your administrator. Modal name: ${t}`);return i}function DB(e){return"TO_BE_DELETED"===e.state||"DELETED"===e.state}function DV(e,t){t?.unmount&&(t.unmountPromise?.catch(()=>{}),t.unmount().catch(t=>{console.error(`The modal '${e}' failed to unmount`,t)}))}function DU(e){return e.find(e=>!DB(e))}function DW(e,t){e.container&&(e.container.style.visibility=t?"unset":"hidden")}let DK=window.getComputedStyle(document.body).overflow;function DH({modalStack:e,modalContainer:t}){if(t)if(e.length){t.style.visibility||(addEventListener("keydown",DG),document.body.style.overflow="hidden",t.style.visibility="unset");let r=DU(e);e.forEach(e=>{switch(e.state){case"NEW":{let r=function({size:e}){let t=document.createElement("div");return t.className=`cds--modal-container cds--modal-container--${e}`,t.setAttribute("role","dialog"),t.setAttribute("tabindex","-1"),t.setAttribute("aria-modal","true"),t}({size:e.props?.size??"md"});e.container=r,e.state="MOUNTING",DF(r,e.modalName,e.props).then(n=>{DB(e)?DV(e.modalName,n):n?(e.parcel=n,t.prepend(r),DW(e,DU(D$.getState().modalStack)===e),n.mountPromise.then(()=>{DB(e)||(e.state="MOUNTED")},t=>{I(t),e.parcel=null,Dz(e)})):Dz(e)},t=>{I(t),Dz(e)});break}case"MOUNTING":case"MOUNTED":DW(e,e===r);break;case"TO_BE_DELETED":e.state="DELETED",e.onClose(),DV(e.modalName,e.parcel),e.container?.remove(),setTimeout(()=>{let t=D$.getState();D$.setState({...t,modalStack:t.modalStack.filter(t=>t!==e)})},0)}})}else t.style.removeProperty("visibility"),document.body.style.overflow=DK,removeEventListener("keydown",DG)}function Dz(e){if(DB(e))return;e.state="TO_BE_DELETED";let t=D$.getState();D$.setState({...t,modalStack:[...t.modalStack]})}function DG(e){"Escape"===e.key&&function(){let[e]=D$.getState().modalStack;e&&Dz(e)}()}function Dq(e){D$.subscribe(DH),D$.setState({...D$.getState(),modalContainer:e})}function DY(e,t={},r=()=>{}){let n=()=>{let e=D$.getState().modalStack.find(e=>e.onClose===r);e&&Dz(e)};if(pD(e)){var i;let o,a;i={state:"NEW",onClose:r,modalName:e,props:{close:n,...t}},a=[i,...(o=D$.getState()).modalStack],D$.setState({...o,modalStack:a})}else I(`Failed to launch modal. Please notify your administrator. Modal name: "${e}"`);return n}let DZ=({notification:e})=>{let{description:t,action:r,kind:n,critical:i,title:o,onAction:a}=e;return(0,hq.jsx)(h1.kZS,{actionButtonLabel:r,kind:n||"info",lowContrast:i,subtitle:t,title:o||"",inline:!0,onActionButtonClick:a})},DJ=({subject:e})=>{let[t,r]=(0,pq.useState)([]);return(0,pq.useEffect)(()=>{let t=e.subscribe(e=>r(t=>[...t.filter(t=>t.description!==e.description||t.action!==e.action||t.kind!==e.kind||t.title!==e.title),e]));return()=>t.unsubscribe()},[e]),(0,hq.jsx)(hq.Fragment,{children:t.map(e=>(0,hq.jsx)(DZ,{notification:e},e.id))})},DX=({notification:e})=>{let{actionButtonLabel:t,onActionButtonClick:r=()=>{},subtitle:n,kind:i,title:o,critical:a,progressActionLabel:s,id:l,...u}=e,[c,d]=(0,pq.useState)(t);return(0,hq.jsx)(h1.kZS,{kind:i||"info",actionButtonLabel:c,ariaLabel:oR("closesActionableNotification","Closes actionable notification"),onActionButtonClick:()=>{r(),s&&d(s)},statusIconDescription:oR("actionableNotification","Actionable notification"),subtitle:n,title:o,lowContrast:a,inline:!0,...u})},DQ=({subject:e})=>{let[t,r]=(0,pq.useState)([]);return(0,pq.useEffect)(()=>{let t=e.subscribe(e=>r(t=>[...t.filter(t=>t.subtitle!==e.subtitle||t.actionButtonLabel!==e.actionButtonLabel||t.onActionButtonClick!==e.onActionButtonClick||t.kind!==e.kind||t.title!==e.title),e]));return()=>t.unsubscribe()},[e]),(0,hq.jsx)(hq.Fragment,{children:t.map(e=>(0,hq.jsx)(DX,{notification:e},e.id))})};var D0=r(4065),D1=Object.prototype.hasOwnProperty;let D3=function(e){if(null==e)return!0;if((0,eF.A)(e)&&((0,eL.A)(e)||"string"==typeof e||"function"==typeof e.splice||(0,eB.A)(e)||(0,eU.A)(e)||(0,e$.A)(e)))return!e.length;var t=(0,ta.A)(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if((0,eM.A)(e))return!(0,D0.A)(e).length;for(var r in e)if(D1.call(e,r))return!1;return!0},D4=new es.Subject,D2=0,D6=new es.Subject,D5=0;function D8(e){e&&(0,fn.createRoot)(e).render((0,hq.jsx)(DJ,{subject:D4}))}function D9(e){var t;e&&("string"==typeof(t=e.description)?t.trim().length>0:"object"==typeof t&&(t instanceof Error||!D3(t)))?(e.description instanceof Error&&(e.description=e.description.toLocaleString()),setTimeout(()=>{D4.next({...e,id:D2++})},0)):console.error("showNotification must be called with an object having a 'description' property that is a non-empty string or object")}function D7(e){e&&(0,fn.createRoot)(e).render((0,hq.jsx)(DQ,{subject:D6}))}function Oe(e){var t;e&&("string"==typeof(t=e.actionButtonLabel)?t.trim().length>0:"object"==typeof t&&!D3(t))?setTimeout(()=>{D6.next({...e,id:D5++})},0):console.error("showActionableNotification must be called with an actionButtonLabel that is a non-empty string")}let Ot=["NORMAL","HIGH","CRITICALLY_HIGH","OFF_SCALE_HIGH","LOW","CRITICALLY_LOW","OFF_SCALE_LOW"],Or=["critically_low","critically_high","high","low","normal","off_scale_low","off_scale_high"],On={container:"-esm-billing__numeric-observation-module__container___+Kqi9",card:"-esm-billing__numeric-observation-module__card___Q-ECG","abnormal-value":"-esm-billing__numeric-observation-module__abnormal-value___bx1h9","critical-value":"-esm-billing__numeric-observation-module__critical-value___nSKSX",cell:"-esm-billing__numeric-observation-module__cell___wc90e","critically-high":"-esm-billing__numeric-observation-module__critically-high___fmZfJ","critically-low":"-esm-billing__numeric-observation-module__critically-low___h9797",high:"-esm-billing__numeric-observation-module__high___0-YpP",low:"-esm-billing__numeric-observation-module__low___TuqAk","label-container":"-esm-billing__numeric-observation-module__label-container___FtozC","value-container":"-esm-billing__numeric-observation-module__value-container___R9qoY",label:"-esm-billing__numeric-observation-module__label___0DGA5",value:"-esm-billing__numeric-observation-module__value___ohqoh",units:"-esm-billing__numeric-observation-module__units___xvMd3","pad-right":"-esm-billing__numeric-observation-module__pad-right___umcen","off-scale-low":"-esm-billing__numeric-observation-module__off-scale-low___my+0i","off-scale-high":"-esm-billing__numeric-observation-module__off-scale-high___so9dv",arrow:"-esm-billing__numeric-observation-module__arrow___Agoh9"},Oi=({value:e,unit:t,label:r,interpretation:n,referenceRange:i,conceptUuid:o,variant:a="card",patientUuid:s})=>{let l=(0,pq.useId)(),{referenceRange:u,isLoading:c}=function(e,t){let r=null;e&&(r=t?`${iC}/conceptreferencerange/?patient=${t}&concept=${e}&v=full`:`${iC}/conceptreferencerange/?concept=${e}&v=full`);let{data:n,error:i,isLoading:o}=fX()(r,iR),a=n?.data?.results?.[0];return{referenceRange:a?{hiNormal:a.hiNormal??null,hiAbsolute:a.hiAbsolute??null,hiCritical:a.hiCritical??null,lowNormal:a.lowNormal??null,lowAbsolute:a.lowAbsolute??null,lowCritical:a.lowCritical??null}:void 0,error:i,isLoading:o}}(i||n?void 0:o,s),d=i??u,p=(0,pq.useMemo)(()=>{if(n)return n?"--"===n?"normal":Ot.includes(n)?n.toLowerCase():Or.includes(n)?n:"normal":void 0;if(d&&!c){if(!d||null==e||""===e)return"normal";let t="string"==typeof e?Number.parseFloat(e):e;return Number.isNaN(t)?"normal":null!==d.hiAbsolute&&void 0!==d.hiAbsolute&&t>d.hiAbsolute?"off_scale_high":null!==d.hiCritical&&void 0!==d.hiCritical&&t>=d.hiCritical?"critically_high":null!==d.hiNormal&&void 0!==d.hiNormal&&t>d.hiNormal?"high":null!==d.lowAbsolute&&void 0!==d.lowAbsolute&&t<d.lowAbsolute?"off_scale_low":null!==d.lowCritical&&void 0!==d.lowCritical&&t<=d.lowCritical?"critically_low":null!==d.lowNormal&&void 0!==d.lowNormal&&t<d.lowNormal?"low":"normal"}return"normal"},[n,d,e,c])??"normal",f="critically_low"===p||"critically_high"===p||"off_scale_low"===p||"off_scale_high"===p,h="normal"!==p,m=r?`omrs-numeric-obs-label-${r.replaceAll(/\s+/g,"-").toLowerCase()}-${l}`:void 0,y=`omrs-numeric-obs-value-${l}`,g=`omrs-numeric-obs-unit-${l}`,b=null!=e&&""!==e,v=b?e:oR("notAvailable","Not available"),w=hZ()({[On["critically-low"]]:"critically_low"===p||"off_scale_low"===p,[On["critically-high"]]:"critically_high"===p||"off_scale_high"===p,[On.low]:"low"===p,[On.high]:"high"===p,[On["off-scale-low"]]:"off_scale_low"===p,[On["off-scale-high"]]:"off_scale_high"===p}),x=hZ()({[On.container]:!0,[On.card]:!0,[On["critical-value"]]:f,[On["abnormal-value"]]:h&&!f}),E=hZ()({[On.cell]:!0,[w]:!0});return"cell"===a?(0,hq.jsxs)("div",{className:E,children:[v,b&&t?` ${t}`:""]}):(0,hq.jsxs)("section",{className:x,"data-testid":"numeric-observation-card",children:[r&&(0,hq.jsxs)("div",{className:On["label-container"],children:[(0,hq.jsx)("span",{id:m,className:On.label,children:r}),h&&(0,hq.jsx)("span",{className:On[p.replace("_","-")],title:oR("abnormalValue","Abnormal value")})]}),(0,hq.jsxs)("div",{className:On["value-container"],children:[(0,hq.jsx)("span",{id:y,"aria-labelledby":m&&g?`${m} ${g}`:m||g||void 0,className:On.value,children:v}),b&&t&&(0,hq.jsx)("span",{id:g,className:On.units,children:t})]})]})},Oo="-esm-billing__page-header-module__pageHeader___XNJYe",Oa=e=>{if("children"in e){let{children:t,className:r,...n}=e;return(0,hq.jsx)("div",{className:hZ()(Oo,r),...n,children:t})}{let{title:t,illustration:r,className:n,...i}=e;return(0,hq.jsx)("div",{className:hZ()(Oo,n),...i,children:(0,hq.jsx)(Os,{title:t,illustration:r})})}},Os=({title:e,illustration:t,className:r})=>{let[n,i]=(0,pq.useState)(null);return(0,pq.useEffect)(()=>{rg("@openmrs/esm-styleguide").then(e=>{i(e)})},[]),(0,hq.jsxs)("div",{className:hZ()("-esm-billing__page-header-module__pageHeaderContent___V-mTz",r),children:[t,(0,hq.jsxs)("div",{className:"-esm-billing__page-header-module__pageLabels___vGJvg",children:[n?.implementationName&&(0,hq.jsx)("p",{children:oR(n.implementationName)}),(0,hq.jsx)("p",{className:"-esm-billing__page-header-module__pageName___+eYMc",children:e})]})]})},Ol=({totalItems:e,pageSize:t,onPageNumberChange:r,pageNumber:n,dashboardLinkUrl:i,currentItems:o,dashboardLinkLabel:a})=>{let{pageSizes:s,pageItemsCount:l}=hw(t,e,n,o),u="tablet"===hd(),c=oR("paginationItemsCount","{{pageItemsCount}} / {{totalItems}} items",{totalItems:e,pageItemsCount:l});return(0,hq.jsx)(hq.Fragment,{children:e>0&&(0,hq.jsxs)("div",{className:hZ()({"-esm-billing__pagination-module__tablet___DdaYk":u,"-esm-billing__pagination-module__desktop___rSwlo":!u}),children:[(0,hq.jsxs)("div",{children:[c,i&&(0,hq.jsx)(pJ,{to:i,className:"-esm-billing__pagination-module__configurableLink___cTCLf",children:a??oR("seeAll","See all")})]}),(0,hq.jsx)(h1.dKS,{className:"-esm-billing__pagination-module__pagination___U6anZ",page:n,pageSize:t,pageSizes:s,totalItems:e,onChange:r,pageRangeText:(e,t)=>oR("paginationOfPages","of {{count}} pages",{count:t}),size:u?"lg":"sm"})]})})};function Ou(e){return Od(Of(e,"usual","official"))}function Oc(e){return Ou(e)}function Od(e){var t;let r;return e?e.text??(r=(t=e).given??[],(t.family?r.concat(t.family):r).join(" ")):""}function Op(e){return Od(e)}function Of(e,...t){for(let r of(0==t.length&&(t=["usual"]),t)){let t=e.name?.find(e=>{var t,n;return t=e,n=r,t.use?t.use===n:"usual"===n});if(t)return t}}function Oh(e,t=hP()){let r=hP(t),n=SJ(e,r);if(null==n)return null;let i=r.diff(n,"hours"),o=r.diff(n,"days"),a=r.diff(n,"weeks"),s=r.diff(n,"months"),l=r.diff(n,"years"),u={};if(i<2)u.minutes=r.diff(n,"minutes");else if(o<2)u.hours=i;else if(a<4)u.days=o;else if(l<1){let e=r.subtract(a,"weeks").diff(n,"days");u.weeks=a,u.days=e}else if(l<2){let e=r.subtract(s,"months").diff(n,"days");u.months=s,u.days=e}else if(l<18){let e=r.subtract(l,"year").diff(n,"months");u.years=l,u.months=e}else u.years=l;return u}function Om(e,t=hP()){let r=Oh(e,t);if(null==r)return null;let n={style:"short",localeMatcher:"lookup"};return"minutes"in r&&0===r.minutes&&(n.minutesDisplay="always"),SZ(r,n)}let Oy={container:"-esm-billing__patient-banner-patient-info-module__container___WV40g",activePatientContainer:"-esm-billing__patient-banner-patient-info-module__activePatientContainer___YBgYK",patientBanner:"-esm-billing__patient-banner-patient-info-module__patientBanner___o-DQc",patientName:"-esm-billing__patient-banner-patient-info-module__patientName___KWLAJ",patientAvatar:"-esm-billing__patient-banner-patient-info-module__patientAvatar___gG4I3",patientAvatarButton:"-esm-billing__patient-banner-patient-info-module__patientAvatarButton___by4L9",patientInfo:"-esm-billing__patient-banner-patient-info-module__patientInfo___VU1fL",demographics:"-esm-billing__patient-banner-patient-info-module__demographics___xDHsd",row:"-esm-billing__patient-banner-patient-info-module__row___MlVwp",flexRow:"-esm-billing__patient-banner-patient-info-module__flexRow___9Aj3s",tagsSlot:"-esm-billing__patient-banner-patient-info-module__tagsSlot___PqCHJ",identifiers:"-esm-billing__patient-banner-patient-info-module__identifiers___bbREn",identifier:"-esm-billing__patient-banner-patient-info-module__identifier___HQzz8",primaryIdentifier:"-esm-billing__patient-banner-patient-info-module__primaryIdentifier___ocKCs",secondaryIdentifier:"-esm-billing__patient-banner-patient-info-module__secondaryIdentifier___4MLDH",value:"-esm-billing__patient-banner-patient-info-module__value___tkQTC",tag:"-esm-billing__patient-banner-patient-info-module__tag___u7Kco",gender:"-esm-billing__patient-banner-patient-info-module__gender___7eQuO",separator:"-esm-billing__patient-banner-patient-info-module__separator___CZBA8",tooltipPadding:"-esm-billing__patient-banner-patient-info-module__tooltipPadding___UQr5s",tooltipSmallText:"-esm-billing__patient-banner-patient-info-module__tooltipSmallText___MRUhY",actionsButtonText:"-esm-billing__patient-banner-patient-info-module__actionsButtonText___8ZC1R"};function Og({showIdentifierLabel:e,type:t,value:r}){return(0,hq.jsx)("span",{className:Oy.primaryIdentifier,children:(0,hq.jsxs)(h1.vwO,{className:Oy.tag,type:"gray",children:[e&&t?.text&&(0,hq.jsxs)("span",{className:Oy.label,children:[t.text,": "]}),(0,hq.jsx)("span",{className:Oy.value,children:r})]})})}function Ob({showIdentifierLabel:e,type:t,value:r}){return(0,hq.jsxs)(h1.lRv,{className:Oy.secondaryIdentifier,id:`patient-banner-identifier-${r}`,children:[e&&(0,hq.jsxs)("span",{className:Oy.label,children:[t?.text,": "]}),(0,hq.jsx)("span",{className:Oy.value,children:r})]})}function Ov({identifiers:e,showIdentifierLabel:t}){let{excludePatientIdentifierCodeTypes:r}=fG(),{primaryIdentifierCode:n}=hE(),i=e?.filter(e=>{let t=e.type?.coding?.[0]?.code;return t&&!r?.uuids.includes(t)})??[];return(0,hq.jsx)(hq.Fragment,{children:i?.length?i.map(({value:e,type:r},o)=>(0,hq.jsxs)(pY().Fragment,{children:[(0,hq.jsx)("span",{className:Oy.identifier,children:r?.coding?.[0]?.code===n?(0,hq.jsx)(Og,{showIdentifierLabel:t,type:r,value:e}):(0,hq.jsx)(Ob,{showIdentifierLabel:t,type:r,value:e})}),o<i.length-1&&(0,hq.jsx)("span",{className:Oy.separator,children:"\xb7"})]},e)):""})}let Ow={Female:m$,Male:mL,Other:mF,Unknown:mB},O_=({gender:e})=>{let t=Ow[e];return t?(0,hq.jsx)(t,{fill:"#525252"}):null},Ox={male:"Male",female:"Female",other:"Other",unknown:"Unknown"};function OE({patient:e,renderedFrom:t}){var r;let n,i,o=Ou(e),a=e?.gender&&(i=Ox[n=(r=e.gender).toLowerCase()]??"Unknown",{displayText:oR(n,r),iconKey:i}),s=(0,pq.useMemo)(()=>({patientUuid:e.id,patient:e,renderedFrom:t}),[e.id,e,t]);return(0,hq.jsxs)("div",{className:Oy.patientInfo,children:[(0,hq.jsx)("div",{className:hZ()(Oy.row,Oy.patientNameRow),children:(0,hq.jsxs)("div",{className:Oy.flexRow,children:[(0,hq.jsx)("span",{className:Oy.patientName,children:o}),a&&(0,hq.jsxs)("div",{className:Oy.gender,children:[(0,hq.jsx)(O_,{gender:a.iconKey}),(0,hq.jsx)("span",{children:a.displayText})]}),(0,hq.jsx)(fr,{className:Oy.tagsSlot,name:"patient-banner-tags-slot",state:s})]})}),(0,hq.jsxs)("div",{className:Oy.demographics,children:[e.birthDate&&(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsx)("span",{children:Om(e.birthDate)}),(0,hq.jsx)("span",{className:Oy.separator,children:"\xb7"}),(0,hq.jsx)("span",{children:SK(e.birthDate,{time:!1})}),(0,hq.jsx)("span",{className:Oy.separator,children:"\xb7"})]}),(0,hq.jsx)(Ov,{identifiers:e.identifier,showIdentifierLabel:!0}),(0,hq.jsx)(fr,{className:Oy.extensionSlot,name:"patient-banner-bottom-slot",state:s})]})]})}var OS=r(1673);function OD({patient:e,patientUuid:t,actionsSlotName:r,additionalActionsSlotState:n}){let[i,o]=(0,pq.useState)(!1),{extensions:a}=fe(r),s="tablet"===hd(),l=hy(()=>o(!1),i),u=(0,pq.useRef)(null),c=(0,pq.useRef)(null),d=(0,pq.useId)(),p=`patient-actions-menu-trigger-${d}`,f=`patient-actions-menu-${d}`,h=(0,pq.useCallback)(()=>o(e=>!e),[]),m=(0,pq.useCallback)(()=>{o(!1),u.current?.focus()},[]),y=(0,pq.useCallback)(e=>{if("Escape"===e.key&&i){e.stopPropagation(),m();return}if(("ArrowDown"===e.key||"ArrowUp"===e.key)&&i){e.preventDefault();let t=c.current?.querySelectorAll('[role="menuitem"]:not([disabled])');if(!t?.length)return;let r=document.activeElement?.closest?.('[role="menuitem"]')??document.activeElement,n=Array.from(t).indexOf(r);if(-1===n)return void t["ArrowDown"===e.key?0:t.length-1]?.focus();let i=n+("ArrowDown"===e.key?1:-1),o=i<0?t.length-1:i>=t.length?0:i;t[o]?.focus()}},[m,i]);(0,pq.useEffect)(()=>{if(i&&c.current){let e=c.current.querySelector('[role="menuitem"]:not([disabled])');e?.focus()}},[i]);let g=(0,pq.useMemo)(()=>({patientUuid:t,patient:e,closeMenu:m,...n}),[t,e,m,n]);return 0===a.length?null:(0,hq.jsx)("div",{className:"-esm-billing__patient-banner-actions-menu-module__overflowMenuContainer___7eCLh",children:(0,hq.jsxs)("div",{"data-overflow-menu":!0,className:hZ()("cds--overflow-menu",h2),ref:l,children:[(0,hq.jsxs)("button",{className:hZ()("cds--btn","cds--btn--ghost","cds--overflow-menu__trigger",{"cds--overflow-menu--open":i},h8),"aria-controls":f,"aria-expanded":i,"aria-haspopup":"true",id:p,onClick:h,onKeyDown:y,ref:u,children:[(0,hq.jsx)("span",{className:"-esm-billing__patient-banner-actions-menu-module__actionsButtonText___TbM5a",children:oR("actions","Actions")})," ",(0,hq.jsx)(OS.CH,{size:16,style:{marginLeft:"0.5rem",fill:"#78A9FF"}})]}),(0,hq.jsxs)("div",{className:hZ()("cds--overflow-menu-options","cds--overflow-menu--flip",h6,{[h5]:i}),"aria-labelledby":p,"data-floating-menu-direction":"bottom",id:f,onKeyDown:y,ref:c,role:"menu",tabIndex:-1,children:[(0,hq.jsx)("ul",{className:hZ()("cds--overflow-menu-options__content",{"cds--overflow-menu-options--lg":s}),children:(0,hq.jsx)(fr,{name:r,state:g},r)}),(0,hq.jsx)("span",{})]})]})})}var OO=r(6767),OP=r.n(OO);function OC(e){let{patientPhotoConceptUuid:t}=fG({externalModuleName:"@openmrs/esm-styleguide"}),r=t?`${iC}/obs?patient=${e}&concept=${t}&v=full`:null,{data:n,error:i,isLoading:o}=fv()(e?r:null,iR),a=n?.data?.results[0];return{data:a?{dateTime:a?.obsDatetime,imageSrc:a?.value?.links?.uri}:null,error:i,isLoading:o}}let Ok=({width:e=56,height:t=56,"aria-label":r})=>{let{t:n}=(0,fg.useTranslation)();return(0,hq.jsxs)("svg",{"aria-label":r??n("patientPhotoPlaceholder","Patient photo placeholder"),width:e,height:t,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,hq.jsx)("path",{fill:"#ffffff",d:"M0 0h56v56H0z"}),(0,hq.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m36.75 20.134-.884-.884L19.25 35.866l.884.884 1.25-1.25H34.25a1.252 1.252 0 0 0 1.25-1.25V21.384l1.25-1.25Zm-2.5 14.116H22.634l4.87-4.87 1.487 1.486a1.25 1.25 0 0 0 1.768 0l.991-.991 2.5 2.498v1.877Zm0-3.645-1.616-1.616a1.25 1.25 0 0 0-1.768 0l-.991.991-1.486-1.486 5.861-5.86v7.971Zm-12.5 1.145v-1.875l3.125-3.123.858.859.885-.885-.86-.86a1.25 1.25 0 0 0-1.767 0l-2.241 2.242V21.75h10V20.5h-10c-.69 0-1.25.56-1.25 1.25v10h1.25Z",fill:"#8D8D8D"})]})},Oj="-esm-billing__patient-photo-module__avatar___R93LX";function OT({patientUuid:e,patientName:t,alt:r}){let{data:n,isLoading:i}=OC(e),[o,a]=(0,pq.useState)(null),[s,l]=(0,pq.useState)(!1),u=(0,pq.useMemo)(()=>OP().generate(e),[e]);(0,pq.useEffect)(()=>{if(n?.imageSrc){let e=new URL(n.imageSrc,window.location.origin).pathname;l(!0);let t=!1,r=new Image;return r.onload=()=>{t||(a(e),l(!1))},r.onerror=()=>{t||(a(null),l(!1))},r.src=e,()=>{t=!0}}a(null),l(!1)},[n?.imageSrc]);let c=(0,pq.useMemo)(()=>r||(o?oR("patientPhotoAlt","Profile photo of {{patientName}}",{patientName:t}):oR("patientAvatarAlt","Avatar for {{patientName}}",{patientName:t})),[r,o,t]);return i||s?(0,hq.jsx)(h1.ryE,{className:"-esm-billing__patient-photo-module__skeleton___I-6iq","data-testid":"skeleton-icon"}):n?.imageSrc&&!o?(0,hq.jsx)(Ok,{"aria-label":oR("patientPhotoPlaceholder","Photo placeholder for {{patientName}}",{patientName:t})}):o?(0,hq.jsx)("div",{"aria-label":c,children:(0,hq.jsx)("img",{className:Oj,src:o,alt:c,title:t})}):(0,hq.jsx)("div",{"aria-label":c,children:(0,hq.jsx)("div",{className:Oj,title:t,style:{backgroundImage:u.toDataUrl(),backgroundRepeat:"no-repeat",backgroundSize:"cover"},children:(0,hq.jsx)("span",{className:"-esm-billing__patient-photo-module__initials___JnUBD",children:function(e,t=3){return e.split(/\s+/).filter(Boolean).slice(0,t).map(e=>e[0]).join("")}(t)})})})}let OR=["omrs-pict-appointments","omrs-pict-assessment-1","omrs-pict-assessment-2","omrs-pict-blood-bank","omrs-pict-cardiology","omrs-pict-ct-scan","omrs-pict-dentistry","omrs-pict-digital-trust","omrs-pict-emergency-department","omrs-pict-facility","omrs-pict-geriatrics","omrs-pict-gynaecology","omrs-pict-in-patient","omrs-pict-laboratory","omrs-pict-labs-2","omrs-pict-metadata-export","omrs-pict-obstetrics","omrs-pict-patient-search","omrs-pict-patients","omrs-pict-payments-desk","omrs-pict-pharmacy","omrs-pict-pharmacy-2","omrs-pict-registration","omrs-pict-service-queues","omrs-pict-stock-management","omrs-pict-transfer","omrs-pict-triage","omrs-pict-x-ray"],OA=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-appointments",pictogramProps:e})})),ON=OA,OM=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-assessment-1",pictogramProps:e})})),OI=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-assessment-2",pictogramProps:e})})),O$=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-blood-bank",pictogramProps:e})})),OL=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-cardiology",pictogramProps:e})})),OF=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-ct-scan",pictogramProps:e})})),OB=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-dentistry",pictogramProps:e})})),OV=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-digital-trust",pictogramProps:e})})),OU=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-emergency-department",pictogramProps:e})})),OW=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-facility",pictogramProps:e})})),OK=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-geriatrics",pictogramProps:e})})),OH=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-gynaecology",pictogramProps:e})})),Oz=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-in-patient",pictogramProps:e})})),OG=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-laboratory",pictogramProps:e})})),Oq=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-labs-2",pictogramProps:e})})),OY=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-metadata-export",pictogramProps:e})})),OZ=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-obstetrics",pictogramProps:e})})),OJ=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-patient-search",pictogramProps:e})})),OX=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-patients",pictogramProps:e})})),OQ=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-payments-desk",pictogramProps:e})})),O0=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-pharmacy",pictogramProps:e})})),O1=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-pharmacy-2",pictogramProps:e})})),O3=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-registration",pictogramProps:e})})),O4=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-service-queues",pictogramProps:e})})),O2=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-stock-management",pictogramProps:e})})),O6=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-transfer",pictogramProps:e})})),O5=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-triage",pictogramProps:e})})),O8=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-x-ray",pictogramProps:e})})),O9=OW,O7=OX,Pe=(0,pq.memo)((0,pq.forwardRef)(function({pictogram:e,fallback:t,...r},n){let i=(0,pq.useRef)(document.getElementById(e));return(0,pq.useEffect)(()=>{let t=document.getElementById("omrs-svgs-container"),r=new MutationObserver(t=>{for(let r of t)"childList"===r.type&&(i.current=document.getElementById(e))});return t&&r.observe(t,{childList:!0}),()=>r.disconnect()},[e]),(0,hq.jsx)(f$,{value:i.current,fallback:t,children:(0,hq.jsx)(Pt,{ref:n,pictogram:e,pictogramProps:r})})})),Pt=(0,pq.memo)((0,pq.forwardRef)(function({pictogram:e,pictogramProps:t},r){let{className:n,size:i}=Object.assign({},{size:92},t);return(i<=26||i>144)&&(console.error(`Invalid size '${i}' specified for ${e}. Defaulting to 92.`),i=92),(0,hq.jsx)("svg",{ref:r,className:hZ()("-esm-billing__pictograms-module__pictogram___LTPzD",n),height:i,width:i,children:(0,hq.jsx)("use",{href:`#${e}`})})})),Pr=({children:e})=>"tablet"===hd()?(0,hq.jsx)(h1.Wdr,{children:e}):(0,hq.jsx)(hq.Fragment,{children:e}),Pn=({snackbar:e,closeSnackbar:t})=>{let{actionButtonLabel:r="",kind:n="success",onActionButtonClick:i=()=>{},isLowContrast:o="error"!==n,progressActionLabel:a,subtitle:s="",timeoutInMs:l=5e3,autoClose:u="error"!==n,title:c,id:d,...p}=e,[f,h]=(0,pq.useState)(r),[m,y]=(0,pq.useState)(!0),[g,b]=(0,pq.useState)(!1),v=(0,pq.useCallback)(()=>{setTimeout(t,250)},[t]),w=(0,pq.useCallback)(()=>{b(!0),v()},[v]);return(0,pq.useEffect)(()=>{if(u){let e=setTimeout(w,l);return()=>clearTimeout(e)}},[l,u,w]),(0,pq.useEffect)(()=>{y(!1),window.setTimeout(()=>{y(!0)},0)},[]),(0,hq.jsx)(h1.kZS,{actionButtonLabel:f,"aria-label":oR("closeSnackbar","Close snackbar"),className:hZ()("-esm-billing__snackbar-module__slideIn___TqSN-",{"-esm-billing__snackbar-module__animated___+XPKT":m,"-esm-billing__snackbar-module__slideOut___1cFIY":g}),kind:n,lowContrast:o,onActionButtonClick:()=>{i(),w(),a&&h(a)},onClose:v,statusIconDescription:oR("snackbarNotification","Snackbar notification"),subtitle:s,title:c,...p})},Pi=({subject:e})=>{let[t,r]=(0,pq.useState)([]),n=(0,pq.useCallback)(e=>{r(t=>t.filter(t=>t!==e))},[]);return(0,pq.useEffect)(()=>{let t=e.subscribe(e=>r(t=>[...t.filter(t=>t.subtitle!==e.subtitle||t.actionButtonLabel!==e.actionButtonLabel||t.onActionButtonClick!==e.onActionButtonClick||t.kind!==e.kind||t.title!==e.title),e]));return()=>t.unsubscribe()},[e]),(0,hq.jsx)(hq.Fragment,{children:t.map(e=>(0,hq.jsx)(Pn,{snackbar:e,closeSnackbar:()=>n(e)},e.id))})},Po=new es.Subject,Pa=0;function Ps(e){e&&(0,fn.createRoot)(e).render((0,hq.jsx)(Pi,{subject:Po}))}function Pl(e){var t;e&&"string"==typeof(t=e.title)&&t.trim().length>0?setTimeout(()=>{Po.next({...e,id:Pa++})},0):console.error("showSnackbar must be called with an object having a 'title' property that is a non-empty string")}let Pu=({toast:e,closeToast:t})=>{let{description:r,kind:n,critical:i,title:o,actionButtonLabel:a,onActionButtonClick:s=()=>{}}=e,l=(0,pq.useCallback)(()=>{s(),t()},[t,s]);return(0,hq.jsx)("div",{children:(0,hq.jsx)(h1.kZS,{actionButtonLabel:a,kind:n||"info",lowContrast:i,subtitle:r,title:o||"",onActionButtonClick:l,onClose:t})})},Pc=({subject:e})=>{let[t,r]=(0,pq.useState)([]),n=(0,pq.useCallback)(e=>{r(t=>t.filter(t=>t!==e))},[]);return(0,pq.useEffect)(()=>{let t=e.subscribe(e=>r(t=>[...t.filter(t=>t.description!==e.description||t.kind!==e.kind||t.title!==e.title||t.actionButtonLabel!==e.actionButtonLabel||t.onActionButtonClick!==e.onActionButtonClick),e]));return()=>t.unsubscribe()},[e]),(0,hq.jsx)(hq.Fragment,{children:t.map(e=>(0,hq.jsx)(Pu,{toast:e,closeToast:()=>n(e)},e.id))})},Pd=new es.Subject,Pp=0;function Pf(e){e&&(0,fn.createRoot)(e).render((0,hq.jsx)(Pc,{subject:Pd}))}function Ph(e){var t;e&&("string"==typeof(t=e.description)?t.trim().length>0:"object"==typeof t&&!D3(t))?setTimeout(()=>{Pd.next({...e,id:Pp++})},0):console.error("showToast must be called with an object having a 'description' property that is a non-empty string or object")}function Pm(e,t=!1){if(t)return!0;let r=Pw[e];return!r||!r()}function Py(e,t){let r=PC.getState()?.workspaceGroup,n=r?.name;n&&e===n&&PR(()=>{let n=P$(e);n&&(n.setState({},!0),n.subscribe(()=>{})()),"function"==typeof r?.cleanup&&r.cleanup(),PC.setState(e=>({...e,workspaceGroup:void 0})),"function"==typeof t&&t()},n?e=>e.currentWorkspaceGroup===n:()=>!0)}function Pg(e,t){let{name:r,additionalProps:n}=t;pT(r);let i=()=>{PD(e.name,{ignoreChanges:!0,onWorkspaceClose:()=>Pb(r,n),closeWorkspaceGroup:!1})};Pm(e.name)?i():PN("closing-workspace-launching-new-workspace",i,e.title??e.name)}function Pb(e,t){let r=pT(e),n=PC.getState().workspaceGroup;if(n&&!n.members?.includes(e))return void Py(n.name,()=>{Pb(e,t)});let i=PC.getState().workspaceGroup?.name,o={...r,title:PM(r,t),closeWorkspace:(t={})=>PD(e,t),closeWorkspaceWithSavedChanges:t=>PD(e,{ignoreChanges:!0,...t}),promptBeforeClosing:t=>{var r,n;return r=e,n=t,void(Pw[r]=n)},setTitle:(t,r)=>{o.title=t,o.titleNode=r,PC.setState(t=>{let r=t.openWorkspaces.map(t=>t.name===e?o:t);return{...t,openWorkspaces:r}})},currentWorkspaceGroup:i,additionalProps:t??{}};function a(e,t){PC.setState(r=>{let n=[e,...t??r.openWorkspaces],i=PT(e);return{...r,openWorkspaces:n,workspaceWindowState:i}})}i&&P$(i,t);let s=PC.getState().openWorkspaces,l=s.findIndex(t=>t.name===e),u=s.find(e=>e.type==o.type);if(0===s.length)a(o);else if(s[0].canHide||0===l)if(l>=0){let t=s[l];a({...t,additionalProps:o.additionalProps,...t.title===PM(t,t.additionalProps)&&{title:PM(o,o.additionalProps)}},s.filter(t=>t.name!=e))}else u?(a(u,PC.getState().openWorkspaces.filter(e=>e.type!=o.type)),Pg(u,{name:e,additionalProps:t})):a(o);else Pg(s[0],{name:e,additionalProps:t})}function Pv({targetUrl:e,contextKey:t,workspaceName:r,additionalProps:n}){PO(t),Pb(r,n),ib({to:e})}let Pw={};function P_(e,t){Pw[e]=t}function Px(e){return Pw[e]}function PE(){let e=PC.getState();PC.setState({...e,prompt:null})}let PS={ignoreChanges:!1,onWorkspaceClose:()=>{},closeWorkspaceGroup:!0};function PD(e,t={}){t={...PS,...t};let r=()=>{let r=PC.getState();r.openWorkspaces.find(t=>t.name===e);let n=r.openWorkspaces.filter(t=>t.name!=e),i=PC.getState().workspaceGroup?.name;i&&t.closeWorkspaceGroup&&Py(i),Pw[e]=()=>!1,PC.setState(e=>({...e,prompt:null,openWorkspaces:n,workspaceWindowState:PT(n?.[0])})),t?.onWorkspaceClose?.()};return Pm(e,t?.ignoreChanges)?(r(),!0):(PN("closing-workspace",r,pT(e).title??e),!1)}function PO(e){PC.getState().context!=e&&PC.setState({context:e,openWorkspaces:[],prompt:null})}let PP={context:"",openWorkspaces:[],prompt:null,workspaceWindowState:"normal",workspaceGroup:void 0},PC=Y("workspace",PP);function Pk(){return PC}function Pj(e){let t=PC.getState();PC.setState({...t,workspaceWindowState:e})}function PT(e){return e?.preferredWindowSize??"normal"}function PR(e=()=>{},t=()=>!0){let r=PC.getState().openWorkspaces.filter(t).every(({name:e})=>Pm(e)),n=()=>{PI(),e?.()};r?n():PN("closing-all-workspaces",n)}function PA(){let{workspaceWindowState:e,openWorkspaces:t,prompt:r,workspaceGroup:n}=p3(PC);return(0,pq.useMemo)(()=>({active:t.length>0,prompt:r,workspaceWindowState:e,workspaces:t,workspaceGroup:n}),[t,e,r,n])}function PN(e,t=()=>{},r=""){let n;switch(e){case"closing-workspace":n={title:oR("unsavedChangesTitleText","Unsaved changes"),body:oR("unsavedChangesInOpenedWorkspace","You may have unsaved changes in the opened workspace. Do you want to discard these changes?"),onConfirm:()=>{t?.()},confirmText:oR("discard","Discard")};break;case"closing-all-workspaces":{let e=PC.getState().openWorkspaces.filter(({name:e})=>!Pm(e)).map(({title:e},t)=>`${t+1}. ${e}`);n={title:oR("closingAllWorkspacesPromptTitle","You have unsaved changes"),body:oR("closingAllWorkspacesPromptBody","There may be unsaved changes in the following workspaces. Do you want to discard changes in the following workspaces? {{workspaceNames}}",{workspaceNames:e.join(",")}),onConfirm:()=>{t?.()},confirmText:oR("closeAllOpenedWorkspaces","Discard changes in {{count}} workspaces",{count:e.length})};break}case"closing-workspace-launching-new-workspace":n={title:oR("unsavedChangesTitleText","Unsaved changes"),body:oR("unsavedChangesInWorkspace",'There may be unsaved changes in "{{workspaceName}}". Please save them before opening another workspace.',{workspaceName:r}),onConfirm:()=>{PC.setState(e=>({...e,prompt:null})),t?.()},confirmText:oR("openAnyway","Open anyway")};break;default:console.error(`Workspace system trying to open unknown prompt type "${e}" in function "showWorkspacePrompts"`),t?.();return}PC.setState(e=>({...e,prompt:n}))}function PM(e,t){return t?.workspaceTitle??e.title}function PI(){PC.setState(PP)}function P$(e,t={}){if(!e||"default"===e)return;let r=J(e,{});return t&&r.setState(e=>({...e,...t})),r}let PL="-esm-billing__action-menu-button-module__container___Uwne-",PF="-esm-billing__action-menu-button-module__elementContainer___vWkQO",PB="-esm-billing__action-menu-button-module__active___D7Idw";function PV({getIcon:e,formOpenInTheBackground:t,tagContent:r}){return(0,hq.jsxs)(hq.Fragment,{children:[e({size:16}),t?(0,hq.jsx)("span",{className:"-esm-billing__action-menu-button-module__interruptedTag___7undI",children:"!"}):(0,hq.jsx)("span",{className:"-esm-billing__action-menu-button-module__countTag___XJRiM",children:r})]})}let PU=({getIcon:e,label:t,iconDescription:r,handler:n,type:i,tagContent:o})=>{let a=hd(),{workspaces:s,workspaceWindowState:l}=PA(),u=s?.findIndex(({type:e})=>e===i)??-1,c="hidden"!==l&&0===u,d=u>0||0===u&&"hidden"===l;return"tablet"===a||"phone"===a?(0,hq.jsxs)(h1.$nd,{className:hZ()(PL,{[PB]:c}),iconDescription:r,kind:"ghost",onClick:n,role:"button",tabIndex:0,size:"md",children:[(0,hq.jsx)("span",{className:PF,children:(0,hq.jsx)(PV,{formOpenInTheBackground:d,getIcon:e,tagContent:o})}),(0,hq.jsx)("span",{children:t})]}):(0,hq.jsx)(h1.K0,{align:"left","aria-label":r,className:hZ()(PL,{[PB]:c}),enterDelayMs:300,kind:"ghost",label:t,onClick:n,size:"md",children:(0,hq.jsx)("div",{className:PF,children:(0,hq.jsx)(PV,{formOpenInTheBackground:d,getIcon:e,tagContent:o})})})};var PW=r(4535),PK=r(771),PH=r(4898),Pz=/[\\^$.*+?()[\]{}|]/g,PG=RegExp(Pz.source);let Pq=function(e){return(e=(0,PH.A)(e))&&PG.test(e)?e.replace(Pz,"\\$&"):e};function PY({contextKey:e}){let{prompt:t}=PA();return(0,pq.useEffect)(()=>{RegExp(`/${Pq(e)}(/|$)`).test(window.location.pathname)||console.warn(`WorkspaceContainer has provided an invalid context key: "${e}". The context key must be part of the URL path, with no initial or trailing slash.`)},[]),(0,pq.useEffect)(()=>(PO(e),()=>{PO(null)}),[e]),(0,pq.useEffect)(()=>{let t=t=>{let{detail:{cancelNavigation:r,newUrl:n}}=t,i=RegExp(`/${Pq(e)}(/|$)`),o=new URL(n),a=i.test(o.pathname),s=PC.getState().openWorkspaces.every(({name:e})=>Pm(e));a||(s?PI():(r?.(),PR(()=>{ib({to:n})})))};return window.addEventListener("single-spa:before-routing-event",t),()=>{window.removeEventListener("single-spa:before-routing-event",t)}},[]),null!=t?(0,hq.jsxs)(h1.KXP,{open:!0,onClose:PE,children:[(0,hq.jsx)(h1.rQ0,{title:t.title}),(0,hq.jsx)(h1.cwr,{children:(0,hq.jsx)("p",{className:"-esm-billing__workspace-notification-module__messageBody___M3IAD",children:t.body})}),(0,hq.jsxs)(h1.jlY,{children:[(0,hq.jsx)(h1.$nd,{kind:"secondary",onClick:PE,children:t.cancelText??oR("cancel")}),(0,hq.jsx)(h1.$nd,{kind:"danger",onClick:t.onConfirm,children:t.confirmText??oR("confirm")})]})]}):null}function PZ(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function PJ(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?PZ(Object(r),!0).forEach(function(t){PQ(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):PZ(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function PX(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function PQ(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function P0(e){return(P0=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function P1(e,t){return(P1=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function P3(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var P4=function(e){var t=pq.Component;if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");a.prototype=Object.create(t&&t.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),t&&P1(a,t);var r,n,i,o=(r=function(){if("u"<typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=P0(a);e=r?Reflect.construct(t,arguments,P0(this).constructor):t.apply(this,arguments);if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return P3(this)});function a(e){var t;if(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a),PQ(P3(t=o.call(this,e)),"handleRef",function(e){t.el=e}),PQ(P3(t),"addThingToDo",function(e,r){t.state.hasError&&"unmount"!==e||(t.nextThingToDo=(t.nextThingToDo||Promise.resolve()).then(function(){if(!t.unmounted||"unmount"===e)return r.apply(void 0,arguments)}).catch(function(r){throw t.nextThingToDo=Promise.resolve(),t.setState({hasError:!0}),r&&r.message&&(r.message="During '".concat(e,"', parcel threw an error: ").concat(r.message)),t.props.handleError?t.props.handleError(r):setTimeout(function(){throw r}),r}))}),PQ(P3(t),"getParcelProps",function(){var e=PJ(PJ({},t.props),{},{domElement:t.el});return delete e.mountParcel,delete e.config,delete e.wrapWith,delete e.wrapStyle,delete e.appendTo,delete e.handleError,delete e.parcelDidMount,e}),t.state={hasError:!1},!e.config)throw Error("single-spa-react's Parcel component requires the 'config' prop to either be a parcel config or a loading function that returns a promise. See https://github.com/single-spa/single-spa-react");return t}return n=[{key:"componentDidMount",value:function(){var e=this;this.unmounted=!1,this.addThingToDo("mount",function(){var t,r=e.props.mountParcel||e.mountParcel;if(!r)throw Error("\n <Parcel /> was not passed a mountParcel prop, nor is it rendered where mountParcel is within the React context.\n If you are using <Parcel /> within a module that is not a single-spa application, you will need to import mountRootParcel from single-spa and pass it into <Parcel /> as a mountParcel prop \n ");return e.el?t=e.el:(e.createdDomElement=t=document.createElement(e.props.wrapWith),Object.keys(e.props.wrapStyle).forEach(function(r){t.style[r]=e.props.wrapStyle[r]}),e.props.appendTo.appendChild(t)),e.parcel=r(e.props.config,PJ({domElement:t},e.getParcelProps())),e.parcel.mountPromise.then(e.props.parcelDidMount),e.parcel.mountPromise})}},{key:"componentDidUpdate",value:function(){var e=this;this.addThingToDo("update",function(){if(e.parcel&&e.parcel.update)return e.parcel.update(e.getParcelProps())})}},{key:"componentWillUnmount",value:function(){var e=this;this.addThingToDo("unmount",function(){if(e.parcel&&"MOUNTED"===e.parcel.getStatus())return e.parcel.unmount()}),this.createdDomElement&&this.createdDomElement.parentNode.removeChild(this.createdDomElement),this.unmounted=!0}},{key:"render",value:function(){var e=this;if(this.props.appendTo)return fu&&fu.Consumer?pq.createElement(fu.Consumer,null,function(t){return e.mountParcel=t?t.mountParcel:null,null}):null;var t=fu&&fu.Consumer?pq.createElement(fu.Consumer,null,function(t){return e.mountParcel=t?t.mountParcel:null,null}):void 0;return pq.createElement(this.props.wrapWith,{ref:this.handleRef,style:this.props.wrapStyle,className:this.props.wrapClassName},t)}}],PX(a.prototype,n),i&&PX(a,i),a}();PQ(P4,"defaultProps",{wrapWith:"div",wrapStyle:{},parcelDidMount:function(){}});function P2({workspace:e,additionalPropsFromPage:t}){let[r,n]=(0,pq.useState)(),i=function(e){let[t,r]=(0,pq.useState)({}),[n,i]=(0,pq.useState)(e);return(0,pq.useEffect)(()=>{n!==e&&i(e)},[e]),(0,pq.useEffect)(()=>{let e,t=P$(n);return t&&(r(t.getState()),e=t.subscribe(r)),()=>{t&&e?.()}},[n]),t}(e.currentWorkspaceGroup);(0,pq.useEffect)(()=>{let t=!0;return e.load().then(e=>{t&&n(e)}),()=>{t=!1}},[e]);let o=(0,pq.useMemo)(()=>e&&{closeWorkspace:e.closeWorkspace,closeWorkspaceWithSavedChanges:e.closeWorkspaceWithSavedChanges,promptBeforeClosing:e.promptBeforeClosing,setTitle:e.setTitle,...t,...i,...e.additionalProps},[e,t,i]);return r?(0,hq.jsx)(P4,{config:r,mountParcel:pz,...o},e.name):(0,hq.jsx)(h1.OuH,{className:"-esm-billing__workspace-module__loader___v7QFg",description:`${oR("loading","Loading")} ...`})}function P6({isWithinWorkspace:e,name:t,actionMenuProps:r={}}){let[n,i]=(0,pq.useState)(!1),o=(0,pq.useRef)(window.innerHeight),{featureName:a}=(0,pq.useContext)(pZ),s=hd();(0,pq.useEffect)(()=>{let e=()=>{i(!hp(s)&&o.current>window.innerHeight),o.current!=window.innerHeight&&(o.current=window.innerHeight)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[o]);let l=`action-menu-${t&&"default"!=t?t:a}-items-slot`;return(0,hq.jsx)("aside",{className:hZ()("-esm-billing__action-menu-module__sideRail___Aa96v",{"-esm-billing__action-menu-module__withinWorkspace___2bJET":e,"-esm-billing__action-menu-module__sideRailHidden___Yb0w9":n,"-esm-billing__action-menu-module__sideRailVisible___XIAk7":!n}),children:(0,hq.jsx)("div",{className:"-esm-billing__action-menu-module__container___mzfAh",children:(0,hq.jsx)(fr,{className:"-esm-billing__action-menu-module__chartExtensions___DiJtm",name:l,state:r})})})}function P5({contextKey:e,overlay:t,showSiderailAndBottomNav:r,additionalWorkspaceProps:n,actionMenuProps:i}){let o=hd(),{workspaces:a,workspaceWindowState:s,workspaceGroup:l}=PA(),u=l?.name,c=a[0],d="hidden"===s||null==c,p=c?.width??(t?"wider":"narrow"),f=(0,pq.useMemo)(()=>r||u&&!d,[u,d,r]);return fK(!d&&!hp(o)),(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsxs)("div",{className:r?"-esm-billing__workspace-module__workspaceContainerWithActionMenu___6x1qS":"-esm-billing__workspace-module__workspaceContainerWithoutActionMenu___TJHnt",children:[(0,hq.jsx)("aside",{className:hZ()(t?"-esm-billing__workspace-module__workspaceOverlayOuterContainer___4y++2":"-esm-billing__workspace-module__workspaceWindowSpacer___6kF9R",{"-esm-billing__workspace-module__hiddenRelative___qqT-4":d,"-esm-billing__workspace-module__narrowWorkspace___MMI1u":"narrow"===p,"-esm-billing__workspace-module__widerWorkspace___be-UT":"wider"===p,"-esm-billing__workspace-module__extraWideWorkspace___JmWmj":"extra-wide"===p}),children:(0,hq.jsx)("div",{className:hZ()("-esm-billing__workspace-module__workspaceFixedContainer___TfJP7",{"-esm-billing__workspace-module__maximizedWindow___71jv4":"maximized"===s,"-esm-billing__workspace-module__hiddenFixed___48wS9":d}),children:a.map((e,t)=>(0,hq.jsx)("div",{className:hZ()("-esm-billing__workspace-module__workspaceInnerContainer___h3oyO",{"-esm-billing__workspace-module__hiddenExtraWorkspace___AP+Vj":0!==t}),children:(0,hq.jsx)(pq.Suspense,{fallback:null,children:(0,hq.jsx)(fg.I18nextProvider,{i18n:window.i18next,defaultNS:e.moduleName,children:(0,hq.jsx)(P8,{workspaceInstance:e,additionalWorkspaceProps:n})})})},`workspace-container-${e?e.name:`empty-${t}`}`))})}),(0,hq.jsx)(PY,{contextKey:e})]}),f&&(0,hq.jsx)(P6,{name:u,isWithinWorkspace:!r,actionMenuProps:i})]})}function P8({workspaceInstance:e,additionalWorkspaceProps:t}){let{t:r}=(0,fg.useTranslation)(),n=hd(),{workspaceWindowState:i,workspaceGroup:o}=PA(),a=o?.name,s="maximized"===i;(0,pq.useEffect)(()=>{let t=r(e.title);t!==e.title&&e.setTitle(t)},[e.title,r,e.setTitle]);let{featureName:l}=(0,pq.useContext)(pZ),u=(0,pq.useCallback)(()=>{Pj(s?"normal":"maximized")},[s]),{canHide:c=!1,canMaximize:d=!1,currentWorkspaceGroup:p="",closeWorkspace:f}=(0,pq.useMemo)(()=>e??{},[e]),h=(0,pq.useMemo)(()=>({...t,...e?.additionalProps}),[t,e]);return e&&(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsxs)(h1.Y9Y,{"aria-label":oR("workspaceHeader","Workspace Header"),className:"-esm-billing__workspace-module__header___nACZO",children:[!hp(n)&&!c&&(0,hq.jsx)(h1.dJ2,{"aria-label":oR("close","Close"),renderMenuIcon:(0,hq.jsx)(ml,{}),onClick:()=>f()}),(0,hq.jsx)(h1.bCw,{prefix:"",children:e.titleNode??r(e.title)}),(0,hq.jsx)("div",{className:"-esm-billing__workspace-module__overlayHeaderSpacer___HBnr+"}),(0,hq.jsxs)(h1.wdv,{className:"-esm-billing__workspace-module__headerButtons___heP0Q",children:[(0,hq.jsx)(fr,{name:`workspace-header-group-${e.currentWorkspaceGroup}-slot`,state:h}),(0,hq.jsx)(fr,{name:`workspace-header-type-${e.type}-slot`,state:h}),(0,hq.jsx)(fr,{name:`workspace-header-${l}-slot`,state:h}),hp(n)&&(0,hq.jsxs)(hq.Fragment,{children:[(d||s)&&(0,hq.jsx)(h1.V8d,{"aria-label":s?oR("minimize","Minimize"):oR("maximize","Maximize"),onClick:u,children:s?(0,hq.jsx)(PW.Xj,{}):(0,hq.jsx)(PW.hz,{})}),c&&!a?(0,hq.jsx)(h1.V8d,{"aria-label":oR("hide","Hide"),onClick:()=>Pj("hidden"),children:(0,hq.jsx)(mu,{})}):(0,hq.jsx)(h1.V8d,{"aria-label":oR("close","Close"),onClick:()=>f?.(),children:(0,hq.jsx)(mP,{})})]}),"tablet"===n&&c&&(0,hq.jsx)(h1.V8d,{"aria-label":oR("close","Close"),onClick:()=>f?.(),children:(0,hq.jsx)(PK.d3,{})})]})]}),(0,hq.jsx)("div",{className:hZ()("-esm-billing__workspace-module__workspaceContent___oYdxI",{"-esm-billing__workspace-module__marginWorkspaceContent___7hwHu":!!p}),children:(0,hq.jsx)(P2,{workspace:e,additionalPropsFromPage:t},e.name)})]})}async function P9(e,t){let{openedGroup:r}=pA.getState();if(r){if(r.groupName===e&&Ct(r.props,t))return!0;else if(!await Cr({reason:"CLOSE_WORKSPACE_GROUP",explicit:!1}))return!1}return pA.setState(r=>({...r,openedGroup:{groupName:e,props:t},openedWindows:[]})),!0}async function P7(e){let{openedGroup:t,openedWindows:r}=pA.getState();if(t){if(r.length>0&&!(e||await Cr({reason:"CLOSE_WORKSPACE_GROUP",explicit:!0})))return!1;pA.setState(e=>({...e,openedGroup:null,openedWindows:[]}))}return!0}async function Ce(e,t=null,r=null,n=null){let i=pA.getState();if(!i.registeredWorkspacesByName[e])throw Error(`Unable to launch workspace ${e}. Workspace is not registered`);let o=pN(e);if(!o)throw Error(`Unable to launch workspace ${e}. Workspace is not registered to a workspace window`);let{openedGroup:a}=i,{name:s}=o,l=pM(s);if(!l)throw Error(`Unable to launch workspace ${e}. Workspace window ${o.name} is not registered to a workspace group`);let u=pI(e);if(a&&(a.groupName!==l.name||!Ct(a.props,n)))return!!await Cr({reason:"CLOSE_WORKSPACE_GROUP",explicit:!0})&&(pA.setState({...i,openedGroup:{groupName:l.name,props:n},openedWindows:[{windowName:s,openedWorkspaces:[Cs(e,t)],props:r,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0);if(u>=0){let n=i.openedWindows[u],o=i.openedGroup?.props??{},a=i.isMostRecentlyOpenedWindowHidden,{openedWorkspaces:c}=n;if(Ct(n.props,r)){let d=c.find(t=>t.workspaceName===e);return d&&Ct(d.props,t)?((a||u!==i.openedWindows.length-1)&&pA.setState(Cn.restoreWindow(i,s)),!0):!!await Cr({reason:"CLOSE_WORKSPACE",explicit:!1,windowName:s,workspaceName:e})&&(pA.setState({...i,openedGroup:{groupName:l.name,props:i?.openedGroup?.props??o},openedWindows:[...i.openedWindows.filter((e,t)=>t!==u),{windowName:s,openedWorkspaces:[Cs(e,t)],props:n?.props??r,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0)}return!!await Cr({reason:"CLOSE_WINDOW",explicit:!1,windowName:s})&&(pA.setState({...i,openedGroup:{groupName:l.name,props:o??i?.openedGroup?.props},openedWindows:[...i.openedWindows.filter((e,t)=>t!==u),{windowName:s,openedWorkspaces:[Cs(e,t)],props:r,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0)}return"closable"!=l.persistence?(pA.setState({...i,openedGroup:{groupName:l.name,props:n??i?.openedGroup?.props??null},openedWindows:[...i.openedWindows,{windowName:s,openedWorkspaces:[Cs(e,t)],props:r,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0):!!await Cr({reason:"CLOSE_OTHER_WINDOWS",explicit:!1,windowNameToSpare:o.name})&&(pA.setState({...i,openedGroup:{groupName:l.name,props:n??i?.openedGroup?.props??null},openedWindows:[{windowName:s,openedWorkspaces:[Cs(e,t)],props:r,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0)}function Ct(e,t){return null==e||null==t||F(e,t)}function Cr(e){function t(e,t){let r=[];for(let n=e.openedWorkspaces.length-1;n>=0;n--){let i=e.openedWorkspaces[n];if(i.hasUnsavedChanges&&r.push(i),t&&i.workspaceName===t)break}return r}let{openedWindows:r,workspaceTitleByWorkspaceName:n}=pA.getState(),i=[];switch(e.reason){case"CLOSE_WORKSPACE_GROUP":i=r.flatMap(e=>t(e));break;case"CLOSE_WINDOW":{let n=r.find(t=>t.windowName===e.windowName);if(!n)throw Error(`Window ${e.windowName} not found in opened windows.`);i=t(n);break}case"CLOSE_WORKSPACE":{let n=r.find(t=>t.windowName===e.windowName);if(!n)throw Error(`Window ${e.windowName} not found in opened windows.`);i=t(n,e.workspaceName);break}case"CLOSE_OTHER_WINDOWS":i=r.filter(t=>t.windowName!==e.windowNameToSpare).flatMap(e=>t(e))}return 0===i.length?Promise.resolve(!0):new Promise(e=>{let t=DY("workspace2-close-prompt",{size:"sm",onConfirm:()=>{t(),e(!0)},onCancel:()=>{t(),e(!1)},affectedWorkspaceTitles:i.map(e=>n[e.workspaceName])})})}let Cn={setWindowMaximized(e,t,r){let n=e.openedWindows.findIndex(e=>e.windowName===t),i=[...e.openedWindows],o={...i[n],maximized:r};return i[n]=o,{...e,openedWindows:i}},hideWindow:e=>({...e,isMostRecentlyOpenedWindowHidden:!0}),restoreWindow(e,t){let r=e.openedWindows.findIndex(e=>e.windowName===t),n=e.openedWindows[r],i=[...e.openedWindows.filter((e,t)=>t!==r),n];return{...e,openedWindows:i,isMostRecentlyOpenedWindowHidden:!1}},closeWorkspace(e,t){let r=pI(t);if(r<0)return e;let n={...e.openedWindows[r]},i=n.openedWorkspaces.findIndex(e=>e.workspaceName===t),o=[...e.openedWindows];n.openedWorkspaces=n.openedWorkspaces.slice(0,i);let a=e.isMostRecentlyOpenedWindowHidden;if(0===n.openedWorkspaces.length){let t=r===e.openedWindows.length-1;o.splice(r,1),t&&o.length>0&&(a=!1)}else o[r]=n;return{...e,openedWindows:o,isMostRecentlyOpenedWindowHidden:a}},openChildWorkspace(e,t,r,n){let i=e.registeredWorkspacesByName[r];if(!i)throw Error(`No workspace named "${r}" registered`);let o=e.registeredWorkspacesByName[t];if(!o)throw Error(`No workspace named "${t}" registered`);if(o.window!==i.window)throw Error(`Child workspace ${r} does not belong to the same workspace window as parent workspace ${t}`);let a=e.openedWindows.findIndex(e=>e.windowName===i.window);if(-1==a)throw Error(`Cannot open child workspace ${r} as window ${i.window} is not opened`);let{openedWorkspaces:s}=e.openedWindows[a],l=s.findIndex(e=>e.workspaceName===t);if(-1===l)throw Error(`Cannot open child workspace ${r} from parent workspace ${t} as the parent is not opened within the workspace window`);let u=s.slice(0,l+1);return{openedWindows:e.openedWindows.map((e,t)=>t==a?{...e,openedWorkspaces:[...u,Cs(r,n)]}:e)}},setHasUnsavedChanges(e,t,r){let n=pI(t);if(n<0)return e;let i={...e.openedWindows[n]},o=i.openedWorkspaces.findIndex(e=>e.workspaceName===t);if(o<0)return e;i.openedWorkspaces[o]={...i.openedWorkspaces[o],hasUnsavedChanges:r};let a=[...e.openedWindows];return a[n]=i,{...e,openedWindows:a}},setWorkspaceTitle(e,t,r){let n={...e.workspaceTitleByWorkspaceName};return null===r?delete n[t]:n[t]=r,{...e,workspaceTitleByWorkspaceName:n}}};function Ci(){return p4(pA,Cn)}let Co=()=>(0,pq.useContext)(fu),Ca=()=>Object.keys(pA.getState().registeredWorkspacesByName);function Cs(e,t){return{workspaceName:e,props:t??{},hasUnsavedChanges:!1,uuid:cg()}}let Cl={workspaceOuterContainer:"-esm-billing__workspace2-module__workspaceOuterContainer___DLiCR",narrowWorkspace:"-esm-billing__workspace2-module__narrowWorkspace___VL0kF",widerWorkspace:"-esm-billing__workspace2-module__widerWorkspace___3QgrA",extraWideWorkspace:"-esm-billing__workspace2-module__extraWideWorkspace___s7nnh",workspaceMiddleContainer:"-esm-billing__workspace2-module__workspaceMiddleContainer___mTGNN",maximized:"-esm-billing__workspace2-module__maximized___-yo9l",hidden:"-esm-billing__workspace2-module__hidden___K2ryM",workspaceInnerContainer:"-esm-billing__workspace2-module__workspaceInnerContainer___o3zVl",workspaceSpacer:"-esm-billing__workspace2-module__workspaceSpacer___N6-ox",loader:"-esm-billing__workspace2-module__loader___29hpw",hiddenExtraWorkspace:"-esm-billing__workspace2-module__hiddenExtraWorkspace___-W7TY",header:"-esm-billing__workspace2-module__header___p0kuD",headerButtons:"-esm-billing__workspace2-module__headerButtons___hMydG",workspaceContent:"-esm-billing__workspace2-module__workspaceContent___uROr7",overlayHeaderSpacer:"-esm-billing__workspace2-module__overlayHeaderSpacer___zdrhx",isActionMenuOpened:"-esm-billing__workspace2-module__isActionMenuOpened___Wc1Il",showActionMenu:"-esm-billing__workspace2-module__showActionMenu___qCVQ-",marginWorkspaceContent:"-esm-billing__workspace2-module__marginWorkspaceContent___A+20C",workspaceContainerWithActionMenu:"-esm-billing__workspace2-module__workspaceContainerWithActionMenu___S98dq",workspaceFixedContainer:"-esm-billing__workspace2-module__workspaceFixedContainer___c9Uny",workspaceContainerWithoutActionMenu:"-esm-billing__workspace2-module__workspaceContainerWithoutActionMenu___u8FbT"},Cu=({title:e,children:t,hasUnsavedChanges:r=!1})=>{let n=hd(),{setWindowMaximized:i,hideWindow:o,setHasUnsavedChanges:a,openedWindows:s,openedGroup:l,registeredGroupsByName:u,registeredWindowsByName:c,registeredWorkspacesByName:d,workspaceTitleByWorkspaceName:p,setWorkspaceTitle:f,isMostRecentlyOpenedWindowHidden:h}=Ci(),{workspaceName:m,isRootWorkspace:y,closeWorkspace:g,showActionMenu:b}=Co(),v=pI(m),w=s[v],x=w?.openedWorkspaces.find(e=>e.workspaceName===m);if((0,pq.useEffect)(()=>{x?.hasUnsavedChanges!=r&&a(m,r??!1)},[x?.hasUnsavedChanges,r,m,a]),(0,pq.useEffect)(()=>{p[m]!==e&&f(m,e)},[p,m,e,f]),v<0||null==l||null==x)return null;let E=u[l.groupName];if(!E)throw Error(`Cannot find registered workspace group ${l.groupName}`);let S=d[m].window,D=c[S];if(!D)throw Error(`Cannot find registered workspace window ${S}`);let{icon:O,canMaximize:P}=D,C="closable"===E.persistence,k=!!O&&!C,{maximized:j}=w,T=D?.width??"narrow",R=Object.values(c).some(e=>e.group===l.groupName&&void 0!==e.icon),A=v<s.length-1||h;return(0,hq.jsxs)("div",{className:hZ()(Cl.workspaceOuterContainer,{[Cl.narrowWorkspace]:"narrow"===T,[Cl.widerWorkspace]:"wider"===T,[Cl.extraWideWorkspace]:"extra-wide"===T,[Cl.isActionMenuOpened]:R}),children:[(0,hq.jsx)("div",{className:hZ()(Cl.workspaceSpacer,{[Cl.hidden]:A})}),(0,hq.jsx)("div",{className:hZ()(Cl.workspaceMiddleContainer,{[Cl.maximized]:j,[Cl.hidden]:A,[Cl.isRootWorkspace]:y,[Cl.showActionMenu]:b}),children:(0,hq.jsxs)("div",{className:hZ()(Cl.workspaceInnerContainer,{[Cl.maximized]:j,[Cl.hidden]:A,[Cl.isRootWorkspace]:y}),children:[(0,hq.jsxs)(h1.Y9Y,{"aria-label":oR("workspaceHeader"),className:Cl.header,children:[(0,hq.jsx)(h1.bCw,{prefix:"",children:e}),(0,hq.jsx)("div",{className:Cl.overlayHeaderSpacer}),(0,hq.jsx)(h1.wdv,{className:Cl.headerButtons,children:hp(n)?(0,hq.jsxs)(hq.Fragment,{children:[(P||j)&&(0,hq.jsx)(h1.V8d,{"aria-label":j?oR("minimize"):oR("maximize"),onClick:()=>i(S,!j),children:j?(0,hq.jsx)(PW.Xj,{}):(0,hq.jsx)(PW.hz,{})}),k&&(0,hq.jsx)(h1.V8d,{"aria-label":oR("hide"),onClick:()=>o(),children:(0,hq.jsx)(mu,{})}),!C&&(0,hq.jsx)(h1.V8d,{"aria-label":oR("close"),onClick:()=>g({closeWindow:!0}),children:(0,hq.jsx)(mP,{})})]}):(0,hq.jsxs)(hq.Fragment,{children:[k&&(0,hq.jsx)(h1.V8d,{"aria-label":oR("hide"),onClick:()=>o(),children:(0,hq.jsx)(PK.d3,{})}),(0,hq.jsx)(h1.V8d,{"aria-label":oR("close"),onClick:()=>{C?P7():g({closeWindow:!0})},children:(0,hq.jsx)(mP,{})})]})})]}),(0,hq.jsx)("div",{className:hZ()(Cl.workspaceContent),children:t})]})})]})},Cc="-esm-billing__action-menu-button2-module__container___gYRoa",Cd="-esm-billing__action-menu-button2-module__elementContainer___vBViO",Cp="-esm-billing__action-menu-button2-module__active___uRJRA",Cf="-esm-billing__action-menu-button2-module__focused___D4VYB";function Ch({getIcon:e,hasUnsavedChanges:t,tagContent:r}){return(0,hq.jsxs)(hq.Fragment,{children:[e({size:16}),t?(0,hq.jsx)("span",{className:"-esm-billing__action-menu-button2-module__interruptedTag___35fO7",children:"!"}):(0,hq.jsx)("span",{className:"-esm-billing__action-menu-button2-module__countTag___l8lfc",children:r})]})}let Cm=({icon:e,label:t,tagContent:r,workspaceToLaunch:n,onBeforeWorkspaceLaunch:i})=>{let o=hd(),{openedWindows:a,restoreWindow:s,hideWindow:l,isMostRecentlyOpenedWindowHidden:u}=Ci(),{extension:c}=(0,pq.useContext)(pZ),d=a.findIndex(e=>e.windowName===c?.extensionId),p=a[d],f=null!=p,h=f&&(d<a.length-1||u),m=f&&!h,y=p?.openedWorkspaces.some(e=>e.hasUnsavedChanges)??!1,g=async()=>{if(f)h?s(p.windowName):l();else if(await (i?.()??!0)){let{workspaceName:e,workspaceProps:t,windowProps:r}=n;Ce(e,t,r)}};return"tablet"===o||"phone"===o?(0,hq.jsxs)(h1.$nd,{className:hZ()(Cc,{[Cp]:f&&!m,[Cf]:m}),iconDescription:t,kind:"ghost",onClick:g,role:"button",tabIndex:0,size:"md",children:[(0,hq.jsx)("span",{className:Cd,children:(0,hq.jsx)(Ch,{hasUnsavedChanges:y,getIcon:e,tagContent:r})}),(0,hq.jsx)("span",{children:t})]}):(0,hq.jsx)(h1.K0,{align:"left","aria-label":t,className:hZ()(Cc,{[Cp]:f&&!m,[Cf]:m}),enterDelayMs:300,kind:"ghost",label:t,onClick:g,size:"md",children:(0,hq.jsx)("div",{className:Cd,children:(0,hq.jsx)(Ch,{hasUnsavedChanges:y,getIcon:e,tagContent:r})})})};function Cy({showContactDetails:e,toggleContactDetails:t,className:r}){return(0,hq.jsx)(h1.$nd,{className:r,iconDescription:"Toggle contact details",kind:"ghost",onClick:t,renderIcon:e?mO:mE,children:e?oR("showLess","Show less"):oR("showMore","Show more")})}let Cg={contactDetails:"-esm-billing__patient-banner-contact-details-module__contactDetails___AvROu",deceased:"-esm-billing__patient-banner-contact-details-module__deceased___DDd39",heading:"-esm-billing__patient-banner-contact-details-module__heading___GGJyV",row:"-esm-billing__patient-banner-contact-details-module__row___8JcKK",col:"-esm-billing__patient-banner-contact-details-module__col___ct1O9",relationship:"-esm-billing__patient-banner-contact-details-module__relationship___GTTsg"},Cb=({patientUuid:e})=>{let{cohorts:t=[],isLoading:r}=function(e){let t=e?`${iC}/cohortm/cohortmember?patient=${e}&v=custom:(uuid,patient:ref,cohort:(uuid,name,startDate,endDate))`:null,{data:r,isLoading:n}=fv()(t,iR),i=r?.data?.results.map(e=>({uuid:e.cohort.uuid,name:e.cohort.name,startDate:e.cohort.startDate,endDate:e.cohort.endDate}));return(0,pq.useMemo)(()=>({cohorts:i,isLoading:n}),[n,i])}(e);return(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsxs)("p",{className:Cg.heading,children:[oR("patientLists","Patient Lists")," (",t?.length??0,")"]}),r?(0,hq.jsx)(h1.OuH,{description:`${oR("loading","Loading")} ...`,role:"progressbar"}):(0,hq.jsxs)("ul",{children:[(()=>{if(t?.length>0){let e=t.sort((e,t)=>SL(e?.startDate).getTime()-SL(t?.startDate).getTime()).slice(0,3);return e?.map(e=>(0,hq.jsx)("li",{children:(0,hq.jsx)(pJ,{to:`${window.spaBase}/home/patient-lists/${e.uuid}`,children:e.name},e.uuid)},e.uuid))}return(0,hq.jsx)("li",{children:"--"})})(),t.length>3&&(0,hq.jsx)("li",{className:Cg.link,children:(0,hq.jsx)(pJ,{to:`${window.spaBase}/home/patient-lists`,children:oR("seeMoreLists","See {{count}} more lists",{count:t?.length-3})})})]})]})},Cv=({patientId:e})=>{let{patient:t,isLoading:r}=hx(e),n=t?.address?.find(e=>"home"===e.use),i=e=>e.split("#")[1];return r?(0,hq.jsx)(h1.OuH,{description:`${oR("loading","Loading")} ...`,role:"progressbar"}):(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsx)("p",{className:Cg.heading,children:oR("address","Address")}),(0,hq.jsx)("ul",{children:n?Object.entries(n).filter(([e])=>"id"!==e&&"use"!==e).map(([e,t])=>"extension"===e?n.extension?.[0]?.extension?.map((t,r)=>(0,hq.jsxs)("li",{children:[oR(i(t.url),i(t.url)),": ",t.valueString]},`address-${e}-${r}`)):(0,hq.jsxs)("li",{children:[oR(e,e),": ",t]},`address-${e}`)):(0,hq.jsx)("li",{children:"--"})})]})},Cw=({patientUuid:e})=>{let{isLoading:t,contactAttributes:r}=(e=>{let{contactAttributeTypes:t=[]}=fG({externalModuleName:"@openmrs/esm-patient-banner-app"}),{attributes:r,error:n,isLoading:i}=(e=>{let{data:t,error:r,isLoading:n}=fX()(`${iC}/patient/${e}?v=custom:(uuid,display,identifiers:(identifier,uuid,preferred,location:(uuid,name),identifierType:(uuid,name,format,formatDescription,validator)),person:(uuid,display,gender,birthdate,dead,age,deathDate,birthdateEstimated,causeOfDeath,preferredName:(uuid,preferred,givenName,middleName,familyName),attributes,preferredAddress:(uuid,preferred,address1,address2,cityVillage,longitude,stateProvince,latitude,country,postalCode,countyDistrict,address3,address4,address5,address6,address7)))`,iR);return{isLoading:n,attributes:t?.data.person.attributes??[],error:r}})(e);return{contactAttributes:(0,pq.useMemo)(()=>r.filter(({attributeType:e})=>t?.some(t=>e.uuid===t)),[r,t]),isLoading:i,error:n}})(e),n=(0,pq.useMemo)(()=>r?[...r?.map(e=>[e.attributeType.display?oR(e.attributeType.display,e.attributeType.display):"",e.value])]:[],[r]);return(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsx)("p",{className:Cg.heading,children:oR("contactDetails","Contact Details")}),t?(0,hq.jsx)(h1.OuH,{description:`${oR("loading","Loading")} ...`,role:"progressbar"}):(0,hq.jsx)("ul",{children:n.length?n.map(([e,t],r)=>(0,hq.jsxs)("li",{children:[e,": ",t]},`${e}-${t}-${r}`)):(0,hq.jsx)("li",{children:"--"})})]})},C_=({patientId:e})=>{let{data:t,isLoading:r}=function(e){let t=`${iC}/relationship?v=custom:(display,uuid,personA:(age,display,birthdate,uuid),personB:(age,display,birthdate,uuid),relationshipType:(uuid,display,description,aIsToB,bIsToA))&person=${e}`,{data:r,error:n,isLoading:i,isValidating:o}=fv()(e?t:null,iR),a=r?.data?.results?.length?function(e,t){let r=[];for(let n of t)e===n.personA.uuid?r.push({uuid:`${n.uuid}`,display:n.personB.display,relativeAge:n.personB.age,relativeUuid:n.personB.uuid,relationshipType:n.relationshipType.bIsToA}):r.push({uuid:`${n.uuid}`,display:n.personA.display,relativeAge:n.personA.age,relativeUuid:n.personA.uuid,relationshipType:n.relationshipType.aIsToB});return r}(e,r.data.results):null;return{data:r?a:null,error:n,isLoading:i,isValidating:o}}(e);return(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsx)("p",{className:Cg.heading,children:oR("relationships","Relationships")}),r?(0,hq.jsx)(h1.OuH,{description:`${oR("loading","Loading")} ...`,role:"progressbar"}):(0,hq.jsx)("ul",{children:t&&t.length>0?(0,hq.jsx)(hq.Fragment,{children:t.map(e=>(0,hq.jsxs)("li",{className:Cg.relationship,children:[(0,hq.jsx)("div",{children:(0,hq.jsx)(pJ,{to:`${window.spaBase}/patient/${e.relativeUuid}/chart`,children:e.display})}),(0,hq.jsx)("div",{children:e.relationshipType}),(0,hq.jsx)("div",{children:`${e.relativeAge?e.relativeAge:"--"} ${e.relativeAge?1===e.relativeAge?oR("yearAbbreviation","yr"):oR("yearsAbbreviation","yrs"):""}`})]},e.uuid))}):(0,hq.jsx)("li",{children:"--"})})]})};function Cx({patientId:e,deceased:t}){return(0,hq.jsxs)("div",{className:hZ()(Cg.contactDetails,{[Cg.deceased]:t}),children:[(0,hq.jsxs)("div",{className:Cg.row,children:[(0,hq.jsx)("div",{className:Cg.col,children:(0,hq.jsx)(Cv,{patientId:e})}),(0,hq.jsx)("div",{className:Cg.col,children:(0,hq.jsx)(Cw,{patientUuid:e})})]}),(0,hq.jsxs)("div",{className:Cg.row,children:[(0,hq.jsx)("div",{className:Cg.col,children:(0,hq.jsx)(C_,{patientId:e})}),(0,hq.jsx)("div",{className:Cg.col,children:(0,hq.jsx)(Cb,{patientUuid:e})})]})]})}function CE(e){let t=document.querySelector("template#loading-spinner");if(t){let r=t.content.cloneNode(!0),n=Array.prototype.map.call(r.childNodes,e=>e);return e.appendChild(r),()=>n.forEach(e=>e.remove())}return()=>{}}let CS="-esm-billing__action-menu2-module__container___4aX3S";function CD({workspaceGroup:e,groupProps:t}){let r=hd(),{persistence:n}=e;return(0,hq.jsx)("aside",{className:"-esm-billing__action-menu2-module__sideRail___a7qg9",children:(0,hq.jsxs)("div",{className:CS,children:["closable"==n&&hp(r)&&(0,hq.jsx)(h1.K0,{align:"left",onClick:()=>P7(),label:oR("close"),kind:"ghost",children:(0,hq.jsx)(mP,{})}),(0,hq.jsx)(pZ.Provider,{value:{moduleName:e.moduleName,featureName:e.name},children:(0,hq.jsx)(fr,{className:CS,name:e.name,state:{groupProps:t}})})]})})}function CO(e){let t=new URL(e,window.location.origin).pathname,r=new URL(window.getOpenmrsSpaBase?.()??"/",window.location.origin).pathname,n=r.endsWith("/")?r.slice(0,-1):r,i=null;return n?n===t?i="/":t.startsWith(`${n}/`)&&(i=t.slice(n.length)):i=t,{full:t,spaRelative:i}}let CP=({lifeCycle:e,openedWorkspace:t,openedWindow:r,isRootWorkspace:n,isLeafWorkspace:i,showActionMenu:o})=>{let{openedGroup:a,closeWorkspace:s,openChildWorkspace:l}=Ci(),u=(0,pq.useMemo)(()=>t&&{closeWorkspace:async(e={})=>{let{closeWindow:n=!1,discardUnsavedChanges:i=!1}=e;return n?!!(i||await Cr({reason:"CLOSE_WINDOW",explicit:!0,windowName:r.windowName}))&&(s(r.openedWorkspaces[0].workspaceName),!0):!!(i||await Cr({reason:"CLOSE_WORKSPACE",explicit:!0,windowName:r.windowName,workspaceName:t.workspaceName}))&&(s(t.workspaceName),!0)},launchChildWorkspace:async(e,n)=>{let i=t.workspaceName,{openedWorkspaces:o}=r,a=o.findIndex(e=>e.workspaceName===i);-1===a||a!==o.length-1&&o.slice(a+1).some(e=>e.hasUnsavedChanges)&&!await Cr({reason:"CLOSE_WORKSPACE",explicit:!0,windowName:r.windowName,workspaceName:o[a+1].workspaceName})||l(i,e,n||{})},workspaceName:t.workspaceName,workspaceProps:t.props,windowProps:r.props,groupProps:a&&a.props?a.props:null,workspaceMeta:pA.getState().registeredWorkspacesByName[t.workspaceName]?.meta??{},isRootWorkspace:n,isLeafWorkspace:i,windowName:r.windowName,showActionMenu:o},[t,s,a,r]);if(!e){let{registeredWorkspacesByName:e}=pA.getState(),r=e[t.workspaceName],i=r&&r.window?r.window:void 0,{registeredWindowsByName:s}=pA.getState(),l=i?s[i]:void 0,u=l&&l.width?l.width:"narrow",c=Object.values(s).some(e=>e.group===a?.groupName&&void 0!==e.icon);return(0,hq.jsxs)("div",{className:hZ()(Cl.workspaceOuterContainer,{[Cl.narrowWorkspace]:"narrow"===u,[Cl.widerWorkspace]:"wider"===u,[Cl.extraWideWorkspace]:"extra-wide"===u,[Cl.isActionMenuOpened]:c}),children:[(0,hq.jsx)("div",{className:Cl.workspaceSpacer}),(0,hq.jsx)("div",{className:hZ()(Cl.workspaceMiddleContainer,{[Cl.isRootWorkspace]:n,[Cl.showActionMenu]:o}),children:(0,hq.jsx)("div",{className:hZ()(Cl.workspaceInnerContainer,{[Cl.isRootWorkspace]:n}),children:(0,hq.jsx)(h1.OuH,{className:Cl.loader,description:`${oR("loading")} ...`})})})]})}return(0,hq.jsx)(P4,{config:e,mountParcel:pz,...u},t.workspaceName)},CC=({openedWindow:e,showActionMenu:t})=>{let{openedWorkspaces:r}=e,[n,i]=(0,pq.useState)({}),{registeredWorkspacesByName:o}=pA.getState();return(0,pq.useEffect)(()=>{let e=!1;return Promise.all(r.map(async e=>{let{moduleName:t,component:r}=o[e.workspaceName];return[e.uuid,await h$(t,r)]})).then(t=>{e||i(Object.fromEntries(t))}),()=>{e=!0}},[r]),(0,hq.jsx)(hq.Fragment,{children:r.map((i,o)=>(0,hq.jsx)(CP,{openedWorkspace:i,openedWindow:e,lifeCycle:n[i.uuid],isRootWorkspace:0===o,isLeafWorkspace:o===r.length-1,showActionMenu:t},i.uuid))})};function Ck(e){e&&(0,fn.createRoot)(e).render((0,hq.jsx)(Cj,{}))}function Cj(){let{openedGroup:e,openedWindows:t,registeredGroupsByName:r,registeredWindowsByName:n}=Ci();if((0,pq.useEffect)(()=>cV("before-page-changed",t=>{let{newPage:n,cancelNavigation:i,oldUrl:o,newUrl:a}=t;if(!e)return;if(n)return void i(P7().then(e=>!e));let s=r[e.groupName],l=s?.scopePattern;l&&function(e,t,r){try{let n=new RegExp(e),i=CO(t),o=CO(r);if(null===i.spaRelative||null===o.spaRelative)return!0;let a=n.exec(i.spaRelative),s=n.exec(o.spaRelative);if(a&&s||(a=n.exec(i.full),s=n.exec(o.full)),!a||!s)return!0;if(a.length>1)return!a.slice(1).every((e,t)=>e===s[t+1]);return!1}catch{return!0}}(l,o,a)&&i(P7().then(e=>!e))}),[e,r]),!e)return null;let i=r[e.groupName],o=t.some(e=>e.maximized),{name:a}=i,s=Object.values(n).filter(e=>e.group===a&&void 0!==e.icon).sort((e,t)=>(e.order??Number.MAX_VALUE)-(t.order??Number.MAX_VALUE)).length>0;return(0,hq.jsxs)("div",{className:hZ()("-esm-billing__workspace-windows-and-menu-module__workspaceWindowsAndMenuContainer___crgqC",{"-esm-billing__workspace-windows-and-menu-module__overlay___FCMKG":i.overlay,"-esm-billing__workspace-windows-and-menu-module__hasMaximizedWindow___gk319":o}),children:[(0,hq.jsx)("div",{className:"-esm-billing__workspace-windows-and-menu-module__workspaceWindowsContainer___MrLlf",children:t.map(e=>(0,hq.jsx)(CC,{openedWindow:e,showActionMenu:s},e.windowName))}),s&&(0,hq.jsx)(CD,{workspaceGroup:i,groupProps:e.props})]})}function CT(e,t,r){if(null==e)return r;let n=E7(e);if(!n)return console.warn(`matchLocale: invalid requested locale tag: ${JSON.stringify(e)}`),r;let i=[];for(let e of t){let t=E7(e);if(!t){console.warn(`matchLocale: skipping invalid available locale tag: ${JSON.stringify(e)}`);continue}i.push({canonical:t,original:e})}let o=n;for(;o;){let e=i.find(e=>e.canonical===o);if(e)return e.original;let t=o+"-",r=i.find(e=>e.canonical.startsWith(t));if(r)return r.original;if("ht"===o){o="fr-HT";continue}let n=o.lastIndexOf("-");if(-1===n)break;let a=(o=o.slice(0,n)).lastIndexOf("-");-1!==a&&o.length-a==2&&(o=o.slice(0,a))}return r}function CR(e=window.localStorage){try{return e.getItem("test"),!0}catch{return!1}}function CA(e){return!!e&&e.constructor===Object}var CN=r(9589);function CM(e){let[t,r,n]=e.split(".");return`${t}.${r}.${n}`}function CI(e,t){let r=function(e){let t=e.indexOf("-");if(t>=0){let r=CM(e.slice(0,t)),n=e.slice(t+1);return`${r}-${n}`}return CM(e)}(t);return CN.satisfies(r,e,{includePrerelease:!0})}async function C$(e,t={}){let r,{shouldRetry:n,getDelay:i,onError:o}=t;n=n??(e=>e<=5),i=i??(e=>(function(e,t=!1){return 1e3*Math.pow(2,t?e+1:e)})(e));let a=0;do try{return await CL(i(a)),await e()}catch(e){o?.(e,a),r=e}while(n(a++));throw r}async function CL(e){if(!(e<=0))return new Promise(t=>setTimeout(t,e))}}}]);
43
+ }`.trim(),document.head.prepend(n),o=HTMLElement.prototype.focus,HTMLElement.prototype.focus=function(e){let t=((e=document)=>e.activeElement)(),r=null!=t&&ED(t);o.call(this,{...e,preventScroll:!0}),e&&e.preventScroll||Ej(this,r)},a=yH(Ek(document,"touchstart",t=>{let n=g_(t);e=wj(n)?n:wT(n,!0),r=!1;let i=n.ownerDocument.defaultView.getSelection();i&&!i.isCollapsed&&i.containsNode(n,!0)&&(r=!0),t.composedPath().some(e=>e instanceof HTMLInputElement&&"range"===e.type)&&(r=!0),"selectionStart"in n&&"selectionEnd"in n&&n.selectionStart<n.selectionEnd&&n.ownerDocument.activeElement===n&&(r=!0)},{passive:!1,capture:!0}),Ek(document,"touchmove",t=>{if(2!==t.touches.length&&!r){if(!e||e===document.documentElement||e===document.body)return void t.preventDefault();e.scrollHeight===e.clientHeight&&e.scrollWidth===e.clientWidth&&t.preventDefault()}},{passive:!1,capture:!0}),Ek(document,"blur",e=>{let t=g_(e),r=e.relatedTarget;if(r&&ED(r))r.focus({preventScroll:!0}),Ej(r,ED(t));else if(!r){let e=t.parentElement?.closest("[tabindex]");e?.focus({preventScroll:!0})}},!0)),()=>{t(),a(),n.remove(),HTMLElement.prototype.focus=o}):yH((s=window.innerWidth-document.documentElement.clientWidth)>0&&("scrollbarGutter"in document.documentElement.style?EC(document.documentElement,"scrollbarGutter","stable"):EC(document.documentElement,"paddingRight",`${s}px`)),EC(document.documentElement,"overflow","hidden"))),()=>{0==--EP&&d()}}},[t])}({isDisabled:o||!t.isOpen}),(0,pq.useEffect)(()=>{if(t.isOpen&&n.current)if(o){var e,r,a=i?.current??n.current;let t=Ee[Ee.length-1];return t&&!t.visibleNodes.has(a)?(t.visibleNodes.add(a),()=>{t.visibleNodes.delete(a)}):void 0}else{let t,o,a,s,l,u,c,d,p,f,h;return e=[i?.current??n.current],o=(r={shouldUseInert:!0})instanceof(t=gv(e?.[0])).Element?{root:r}:r,a=o?.root??document.body,s=o?.shouldUseInert&&x9,l=new Set(e),u=new Set,c=(e,r)=>{s&&e instanceof t.HTMLElement?e.inert=r:r?e.setAttribute("aria-hidden","true"):(e.removeAttribute("aria-hidden"),e instanceof t.HTMLElement&&(e.inert=!1))},d=e=>{for(let t of e.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))l.add(t);let t=e=>{if(u.has(e)||l.has(e)||e.parentElement&&u.has(e.parentElement)&&"row"!==e.parentElement.getAttribute("role"))return NodeFilter.FILTER_REJECT;for(let t of l)if(gw(e,t))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},r=_z(gb(e),e,NodeFilter.SHOW_ELEMENT,{acceptNode:t}),n=t(e);if(n===NodeFilter.FILTER_ACCEPT&&p(e),n!==NodeFilter.FILTER_REJECT){let e=r.nextNode();for(;null!=e;)p(e),e=r.nextNode()}},p=e=>{let r=x7.get(e)??0;(s&&e instanceof t.HTMLElement?e.inert:"true"===e.getAttribute("aria-hidden"))&&0===r||(0===r&&c(e,!0),u.add(e),x7.set(e,r+1))},Ee.length&&Ee[Ee.length-1].disconnect(),d(a),(f=new MutationObserver(e=>{for(let r of e)if("childList"===r.type&&r.target.isConnected&&![...l,...u].some(e=>gw(e,r.target)))for(let e of r.addedNodes){var t;(e instanceof HTMLElement||e instanceof SVGElement)&&("true"===(t=e).dataset.liveAnnouncer||void 0!==t.dataset.reactAriaTopLayer)?l.add(e):e instanceof Element&&d(e)}})).observe(a,{childList:!0,subtree:!0}),h={visibleNodes:l,hiddenNodes:u,observe(){f.observe(a,{childList:!0,subtree:!0})},disconnect(){f.disconnect()}},Ee.push(h),()=>{for(let e of(f.disconnect(),u)){let t=x7.get(e);null!=t&&(1===t?(c(e,!1),x7.delete(e)):x7.set(e,t-1))}h===Ee[Ee.length-1]?(Ee.pop(),Ee.length&&Ee[Ee.length-1].observe()):Ee.splice(Ee.indexOf(h),1)}}},[o,t.isOpen,n,i]),{popoverProps:y8(c,f),arrowProps:h,underlayProps:p,placement:m,triggerAnchorPoint:y}}({...n,offset:null!=(i=n.offset)?i:8,arrowSize:s,groupRef:p?c:u},e),g=n.popoverRef,b=function(e,t=!0){let[r,n]=(0,pq.useState)(!0),i=r&&t;return yz(()=>{if(i&&e.current&&"getAnimations"in e.current)for(let t of e.current.getAnimations())t instanceof CSSTransition&&t.cancel()},[e,i]),EN(e,i,(0,pq.useCallback)(()=>n(!1),[])),i}(g,!!y)||n.isEntering||!1,v=ge({...n,defaultClassName:"react-aria-Popover",values:{trigger:n.trigger||null,placement:y,isEntering:b,isExiting:t}}),w=!n.isNonModal||"SubmenuTrigger"===n.trigger,[x,E]=(0,pq.useState)(!1);yz(()=>{g.current&&E(w&&!g.current.querySelector("[role=dialog]"))},[g,w]),(0,pq.useEffect)(()=>{var e;let t,r;x&&g.current&&!g.current.contains(document.activeElement)&&(r=((e=document)=>e.activeElement)(t=gb(e=g.current)),"virtual"===EM?bn(()=>{((e=document)=>e.activeElement)(t)===r&&e.isConnected&&gy(e)}):gy(e))},[x,g]);let S={...f.style,...v.style},D=pY().createElement("div",{...y8(gm(n),f),...v,role:x?"dialog":void 0,tabIndex:x?-1:void 0,"aria-label":n["aria-label"],"aria-labelledby":n["aria-labelledby"],ref:g,slot:n.slot||void 0,style:S,dir:n.dir,"data-trigger":n.trigger,"data-placement":y,"data-entering":b||void 0,"data-exiting":t||void 0},!n.isNonModal&&pY().createElement(EA,{onDismiss:e.close}),pY().createElement(x8.Provider,{value:{...m,placement:y,ref:a}},v.children),pY().createElement(EA,{onDismiss:e.close}));return p?pY().createElement(xJ,{...n,shouldContainFocus:x,isExiting:t,portalContainer:null!=(o=null!=r?r:null==c?void 0:c.current)?o:void 0},D):pY().createElement(xJ,{...n,shouldContainFocus:x,isExiting:t,portalContainer:r},!n.isNonModal&&e.isOpen&&pY().createElement("div",{"data-testid":"underlay",...h,style:{position:"fixed",inset:0}}),pY().createElement("div",{ref:u,style:{display:"contents"}},pY().createElement(EZ.Provider,{value:u},D)))}function EQ(e){return e?.start!=null&&null!=e.end}let E0=(0,pq.createContext)(null),E1=(0,pq.createContext)(null),E3=(0,pq.createContext)(null),E4=(0,pq.createContext)(null),E2=(0,pq.forwardRef)(function(e,t){var r,n;[e,t]=gr(e,t,E0);let{validationBehavior:i}=gt(x2)||{},o=null!=(n=null!=(r=e.validationBehavior)?r:i)?n:"native",a=function(e){let t=Eq(e),[r,n]=_S(e.value,e.defaultValue||null,e.onChange),[i]=(0,pq.useState)(r),o=r||e.placeholderValue||null,[a,s]=xR(o,e.granularity),l=null!=r?r.toDate(s??"UTC"):null,u="hour"===a||"minute"===a||"second"===a,c=e.shouldCloseOnSelect??!0,[d,p]=(0,pq.useState)(null),[f,h]=(0,pq.useState)(null);if(r&&(d=r,"hour"in r&&(f=r)),o&&!(a in o))throw Error("Invalid granularity "+a+" for value "+o.toString());let m=r?.calendar.identifier==="gregory"&&"BC"===r.era,y=(0,pq.useMemo)(()=>({granularity:a,timeZone:s,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,showEra:m}),[a,e.hourCycle,e.shouldForceLeadingZeros,s,e.hideTimeZone,m]),{minValue:g,maxValue:b,isDateUnavailable:v}=e,w=(0,pq.useMemo)(()=>xO(r,g,b,v,y),[r,g,b,v,y]),x=xv({...e,value:r,builtinValidation:w}),E=x.displayValidation.isInvalid,S=e.validationState||(E?"invalid":null),D=(e,t)=>{n("timeZone"in t?t.set(v5(e)):v8(e,t)),p(null),h(null),x.commitValidation()};return{...x,value:r,defaultValue:e.defaultValue??i,setValue:n,dateValue:d,timeValue:f,setDateValue:r=>{let i="function"==typeof c?c():c;u?f||i?D(r,f||xj(e.defaultValue||e.placeholderValue)):p(r):(n(r),x.commitValidation()),i&&t.setOpen(!1)},setTimeValue:e=>{d&&e?D(d,e):h(e)},granularity:a,hasTime:u,...t,setOpen(n){!n&&!r&&d&&u&&D(d,f||xj(e.defaultValue||e.placeholderValue)),t.setOpen(n)},validationState:S,isInvalid:E,formatValue:(e,t)=>l?new vo(e,xk(t,y)).format(l):"",getDateFormatter:(e,t)=>new vo(e,xk({},{...y,...t}))}}({...e,validationBehavior:o}),s=(0,pq.useRef)(null),[l,u]=gn(!e["aria-label"]&&!e["aria-labelledby"]),{groupProps:c,labelProps:d,fieldProps:p,buttonProps:f,dialogProps:h,calendarProps:m,descriptionProps:y,errorMessageProps:g,...b}=function(e,t,r){var n;let i=y2(),o=y2(),a=y2(),s=vw((n=xn)&&n.__esModule?n.default:n,"@react-aria/datepicker"),{isInvalid:l,validationErrors:u,validationDetails:c}=t.displayValidation,{labelProps:d,fieldProps:p,descriptionProps:f,errorMessageProps:h}=xa({...e,labelElementType:"span",isInvalid:l,errorMessage:e.errorMessage||u}),m=xi(t,r),y=p["aria-labelledby"]||p.id,{locale:g}=b9(),b=t.formatValue(g,{month:"long"}),v=w$(b?s.format("selectedDateDescription",{date:b}):""),w=[v["aria-describedby"],p["aria-describedby"]].filter(Boolean).join(" ")||void 0,x=gm(e),E=(0,pq.useMemo)(()=>_9(r),[r]),S=(0,pq.useRef)(!1),{focusWithinProps:D}=bN({...e,isDisabled:t.isOpen,onBlurWithin:t=>{gw(document.getElementById(o),t.relatedTarget)||(S.current=!1,e.onBlur?.(t),e.onFocusChange?.(!1))},onFocusWithin:t=>{S.current||(S.current=!0,e.onFocus?.(t),e.onFocusChange?.(!0))}});return{groupProps:y8(x,m,p,v,D,{role:"group","aria-disabled":e.isDisabled||null,"aria-labelledby":y,"aria-describedby":w,onKeyDown(r){!t.isOpen&&e.onKeyDown&&e.onKeyDown(r)},onKeyUp(r){!t.isOpen&&e.onKeyUp&&e.onKeyUp(r)}}),labelProps:{...d,onClick:()=>{E.focusFirst()}},fieldProps:{...p,id:a,[xc]:"presentation","aria-describedby":w,value:t.value,defaultValue:t.defaultValue,onChange:t.setValue,placeholderValue:e.placeholderValue,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,granularity:e.granularity,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isRequired:e.isRequired,validationBehavior:e.validationBehavior,[xb]:t,autoFocus:e.autoFocus,name:e.name,form:e.form},descriptionProps:f,errorMessageProps:h,buttonProps:{...v,id:i,"aria-haspopup":"dialog","aria-label":s.format("calendar"),"aria-labelledby":`${i} ${y}`,"aria-describedby":w,"aria-expanded":t.isOpen,isDisabled:e.isDisabled||e.isReadOnly,onPress:()=>t.setOpen(!0)},dialogProps:{id:o,"aria-labelledby":`${i} ${y}`},calendarProps:{autoFocus:!0,value:t.dateValue,onChange:t.setDateValue,minValue:e.minValue,maxValue:e.maxValue,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isDateUnavailable:e.isDateUnavailable,defaultFocusedValue:t.dateValue?void 0:e.placeholderValue,isInvalid:t.isInvalid,errorMessage:"function"==typeof e.errorMessage?e.errorMessage(t.displayValidation):e.errorMessage||t.displayValidation.validationErrors.join(" "),firstDayOfWeek:e.firstDayOfWeek,pageBehavior:e.pageBehavior},isInvalid:l,validationErrors:u,validationDetails:c}}({...gi(e),label:u,validationBehavior:o},a,s),[v,w]=(0,pq.useState)(null),x=(0,pq.useCallback)(()=>{s.current&&w(s.current.offsetWidth+"px")},[]);Ew({ref:s,onResize:x});let{focusProps:E,isFocused:S,isFocusVisible:D}=bM({within:!0}),O=ge({...e,values:{state:a,isFocusWithin:S,isFocusVisible:D,isDisabled:e.isDisabled||!1,isInvalid:a.isInvalid,isOpen:a.isOpen},defaultClassName:"react-aria-DatePicker"}),P=gm(e);return delete P.id,pY().createElement(y7,{values:[[E3,a],[_U,{...c,ref:s,isInvalid:a.isInvalid}],[xU,p],[bK,{...f,isPressed:a.isOpen}],[x6,{...d,ref:l,elementType:"span"}],[_j,m],[xQ,a],[EY,{trigger:"DatePicker",triggerRef:s,placement:"bottom start",style:{"--trigger-width":v}}],[xX,h],[bG,{slots:{description:y,errorMessage:g}}],[x1,b]]},pY().createElement("div",{...E,...P,...O,ref:t,slot:e.slot||void 0,"data-focus-within":S||void 0,"data-invalid":a.isInvalid||void 0,"data-focus-visible":D||void 0,"data-disabled":e.isDisabled||void 0,"data-open":a.isOpen||void 0}))}),E6=(0,pq.forwardRef)(function(e,t){var r,n;[e,t]=gr(e,t,E1);let{validationBehavior:i}=gt(x2)||{},o=null!=(n=null!=(r=e.validationBehavior)?r:i)?n:"native",a=function(e){let t=Eq(e),[r,n]=_S(e.value,e.defaultValue||null,e.onChange),[i]=(0,pq.useState)(r),[o,a]=(0,pq.useState)(()=>r||{start:null,end:null});null==r&&o.start&&o.end&&a(o={start:null,end:null});let s=r||o,l=e=>{a(s=e||{start:null,end:null}),EQ(s)?n(s):n(null)},[u,c]=xR(s?.start||s?.end||e.placeholderValue||null,e.granularity),d="hour"===u||"minute"===u||"second"===u,p=e.shouldCloseOnSelect??!0,[f,h]=(0,pq.useState)(null),[m,y]=(0,pq.useState)(null);s&&EQ(s)&&(f=s,"hour"in s.start&&(m=s));let g=(e,t)=>{l({start:"timeZone"in t.start?t.start.set(v5(e.start)):v8(e.start,t.start),end:"timeZone"in t.end?t.end.set(v5(e.end)):v8(e.end,t.end)}),h(null),y(null),P.commitValidation()},b=r=>{let n="function"==typeof p?p():p;d?EQ(r)&&(n||m?.start&&m?.end)?g(r,{start:m?.start||xj(e.placeholderValue),end:m?.end||xj(e.placeholderValue)}):h(r):EQ(r)?(l(r),P.commitValidation()):h(r),n&&t.setOpen(!1)},v=e=>{EQ(f)&&EQ(e)?g(f,e):y(e)},w=s?.start?.calendar.identifier==="gregory"&&"BC"===s.start.era||s?.end?.calendar.identifier==="gregory"&&"BC"===s.end.era,x=(0,pq.useMemo)(()=>({granularity:u,timeZone:c,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,shouldForceLeadingZeros:e.shouldForceLeadingZeros,showEra:w}),[u,e.hourCycle,e.shouldForceLeadingZeros,c,e.hideTimeZone,w]),{minValue:E,maxValue:S,isDateUnavailable:D}=e,O=(0,pq.useMemo)(()=>{var e;let t;return e=s,t=xE(xO(e?.start??null,E,S,D,x),xO(e?.end??null,E,S,D,x)),e?.end!=null&&null!=e.start&&0>e.end.compare(e.start)&&(t=xE(t,{isInvalid:!0,validationErrors:[(vh.getGlobalDictionaryForPackage("@react-stately/datepicker")||xS).getStringForLocale("rangeReversed",xD())],validationDetails:{...xh,rangeUnderflow:!0,rangeOverflow:!0,valid:!1}})),t},[s,E,S,D,x]),P=xv({...e,value:r,name:(0,pq.useMemo)(()=>[e.startName,e.endName].filter(e=>null!=e),[e.startName,e.endName]),builtinValidation:O}),C=P.displayValidation.isInvalid,k=e.validationState||(C?"invalid":null);return{...P,value:s,defaultValue:e.defaultValue??i,setValue:l,dateRange:f,timeRange:m,granularity:u,hasTime:d,setDate(e,t){"start"===e?b({start:t,end:f?.end??null}):b({start:f?.start??null,end:t})},setTime(e,t){"start"===e?v({start:t,end:m?.end??null}):v({start:m?.start??null,end:t})},setDateTime(e,t){"start"===e?l({start:t,end:s?.end??null}):l({start:s?.start??null,end:t})},setDateRange:b,setTimeRange:v,...t,setOpen(r){!r&&!(s?.start&&s?.end)&&EQ(f)&&d&&g(f,{start:m?.start||xj(e.placeholderValue),end:m?.end||xj(e.placeholderValue)}),t.setOpen(r)},validationState:k,isInvalid:C,formatValue(t,r){let n;if(!s||!s.start||!s.end)return null;let i="timeZone"in s.start?s.start.timeZone:void 0,o=e.granularity||(s.start&&"minute"in s.start?"minute":"day"),a="timeZone"in s.end?s.end.timeZone:void 0,l=e.granularity||(s.end&&"minute"in s.end?"minute":"day"),u=xk(r,{granularity:o,timeZone:i,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,showEra:"gregory"===s.start.calendar.identifier&&"BC"===s.start.era||"gregory"===s.end.calendar.identifier&&"BC"===s.end.era}),c=s.start.toDate(i||"UTC"),d=s.end.toDate(a||"UTC"),p=new vo(t,u);if(i===a&&o===l&&0!==s.start.compare(s.end)){try{let e=p.formatRangeToParts(c,d),t=-1;for(let r=0;r<e.length;r++){let n=e[r];if("shared"===n.source&&"literal"===n.type)t=r;else if("endRange"===n.source)break}let r="",n="";for(let i=0;i<e.length;i++)i<t?r+=e[i].value:i>t&&(n+=e[i].value);return{start:r,end:n}}catch{}n=p}else n=new vo(t,xk(r,{granularity:l,timeZone:a,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle}));return{start:p.format(c),end:n.format(d)}},getDateFormatter:(e,t)=>new vo(e,xk({},{...x,...t}))}}({...e,validationBehavior:o}),s=(0,pq.useRef)(null),[l,u]=gn(!e["aria-label"]&&!e["aria-labelledby"]),{groupProps:c,labelProps:d,startFieldProps:p,endFieldProps:f,buttonProps:h,dialogProps:m,calendarProps:y,descriptionProps:g,errorMessageProps:b,...v}=function(e,t,r){var n;let i=vw((n=xn)&&n.__esModule?n.default:n,"@react-aria/datepicker"),{isInvalid:o,validationErrors:a,validationDetails:s}=t.displayValidation,{labelProps:l,fieldProps:u,descriptionProps:c,errorMessageProps:d}=xa({...e,labelElementType:"span",isInvalid:o,errorMessage:e.errorMessage||a}),p=u["aria-labelledby"]||u.id,{locale:f}=b9(),h=t.formatValue(f,{month:"long"}),m=w$(h?i.format("selectedRangeDescription",{startDate:h.start,endDate:h.end}):""),y={"aria-label":i.format("startDate"),"aria-labelledby":p},g={"aria-label":i.format("endDate"),"aria-labelledby":p},b=y2(),v=y2(),w=xi(t,r),x=[m["aria-describedby"],u["aria-describedby"]].filter(Boolean).join(" ")||void 0,E=(0,pq.useMemo)(()=>_9(r,{accept:e=>e.id!==b}),[r,b]),S={[xd]:E,[xc]:"presentation","aria-describedby":x,placeholderValue:e.placeholderValue,hideTimeZone:e.hideTimeZone,hourCycle:e.hourCycle,granularity:e.granularity,shouldForceLeadingZeros:e.shouldForceLeadingZeros,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isRequired:e.isRequired,validationBehavior:e.validationBehavior},D=gm(e),O=(0,pq.useRef)(!1),{focusWithinProps:P}=bN({...e,isDisabled:t.isOpen,onBlurWithin:t=>{gw(document.getElementById(v),t.relatedTarget)||(O.current=!1,e.onBlur?.(t),e.onFocusChange?.(!1))},onFocusWithin:t=>{O.current||(O.current=!0,e.onFocus?.(t),e.onFocusChange?.(!0))}}),C=(0,pq.useRef)(xy),k=(0,pq.useRef)(xy);return{groupProps:y8(D,w,u,m,P,{role:"group","aria-disabled":e.isDisabled||null,"aria-describedby":x,onKeyDown(r){!t.isOpen&&e.onKeyDown&&e.onKeyDown(r)},onKeyUp(r){!t.isOpen&&e.onKeyUp&&e.onKeyUp(r)}}),labelProps:{...l,onClick:()=>{E.focusFirst()}},buttonProps:{...m,id:b,"aria-haspopup":"dialog","aria-label":i.format("calendar"),"aria-labelledby":`${b} ${p}`,"aria-describedby":x,"aria-expanded":t.isOpen,isDisabled:e.isDisabled||e.isReadOnly,onPress:()=>t.setOpen(!0)},dialogProps:{id:v,"aria-labelledby":`${b} ${p}`},startFieldProps:{...y,...S,value:t.value?.start??null,defaultValue:t.defaultValue?.start,onChange:e=>t.setDateTime("start",e),autoFocus:e.autoFocus,name:e.startName,form:e.form,[xb]:{realtimeValidation:t.realtimeValidation,displayValidation:t.displayValidation,updateValidation(e){C.current=e,t.updateValidation(xE(e,k.current))},resetValidation:t.resetValidation,commitValidation:t.commitValidation}},endFieldProps:{...g,...S,value:t.value?.end??null,defaultValue:t.defaultValue?.end,onChange:e=>t.setDateTime("end",e),name:e.endName,form:e.form,[xb]:{realtimeValidation:t.realtimeValidation,displayValidation:t.displayValidation,updateValidation(e){k.current=e,t.updateValidation(xE(C.current,e))},resetValidation:t.resetValidation,commitValidation:t.commitValidation}},descriptionProps:c,errorMessageProps:d,calendarProps:{autoFocus:!0,value:t.dateRange?.start&&t.dateRange.end?t.dateRange:null,onChange:t.setDateRange,minValue:e.minValue,maxValue:e.maxValue,isDisabled:e.isDisabled,isReadOnly:e.isReadOnly,isDateUnavailable:e.isDateUnavailable,allowsNonContiguousRanges:e.allowsNonContiguousRanges,defaultFocusedValue:t.dateRange?void 0:e.placeholderValue,isInvalid:t.isInvalid,errorMessage:"function"==typeof e.errorMessage?e.errorMessage(t.displayValidation):e.errorMessage||t.displayValidation.validationErrors.join(" "),firstDayOfWeek:e.firstDayOfWeek,pageBehavior:e.pageBehavior},isInvalid:o,validationErrors:a,validationDetails:s}}({...gi(e),label:u,validationBehavior:o},a,s),[w,x]=(0,pq.useState)(null),E=(0,pq.useCallback)(()=>{s.current&&x(s.current.offsetWidth+"px")},[]);Ew({ref:s,onResize:E});let{focusProps:S,isFocused:D,isFocusVisible:O}=bM({within:!0}),P=ge({...e,values:{state:a,isFocusWithin:D,isFocusVisible:O,isDisabled:e.isDisabled||!1,isInvalid:a.isInvalid,isOpen:a.isOpen},defaultClassName:"react-aria-DateRangePicker"}),C=gm(e);return delete C.id,pY().createElement(y7,{values:[[E4,a],[_U,{...c,ref:s,isInvalid:a.isInvalid}],[bK,{...h,isPressed:a.isOpen}],[x6,{...d,ref:l,elementType:"span"}],[_T,y],[xQ,a],[EY,{trigger:"DateRangePicker",triggerRef:s,placement:"bottom start",style:{"--trigger-width":w}}],[xX,m],[xU,{slots:{start:p,end:f}}],[bG,{slots:{description:g,errorMessage:b}}],[x1,v]]},pY().createElement("div",{...S,...C,...P,ref:t,slot:e.slot||void 0,"data-focus-within":D||void 0,"data-invalid":a.isInvalid||void 0,"data-focus-visible":O||void 0,"data-disabled":e.isDisabled||void 0,"data-open":a.isOpen||void 0}))});function E5(e){return pY().createElement(b8,e)}function E8(e,t,r=!1){if(null==e)return r?e:void 0;if("string"==typeof e&&!e)return r?null:void 0;if(e instanceof vq||e instanceof vZ||e instanceof vJ)return t?v9(e,t):e;{let r=hC()(e).toDate(),n=new vq(r.getFullYear(),r.getMonth()+1,r.getDate());return t?v9(n,t):n}}function E9(e){if(e)return e.toDate(wc())}function E7(e){if("string"==typeof e&&0!==e.trim().length)try{return new Intl.Locale(e.replace(/[_@]/g,"-")).toString()}catch{return}}function Se(e){let t=e??"",r=E7(t);if(!r)return t;try{return new Intl.DisplayNames([r],{type:"language"}).of(r)??t}catch{return t}}function St(){let e=window.i18next.language,t=E7(e)??e;return"ht"===t&&(t="fr-HT"),t}if("u">typeof navigator){let e=navigator;ea=Array.isArray(e.languages)?e.languages[0]:e.language}else if("u">typeof process){let e=process.env;ea=e.LC_ALL||e.LC_MESSAGES||e.LANG||e.LANGUAGE}var Sr=function(e){e=(e=e.replace(/_/g,"-")).replace(/[.:][\w-]*$/,"");try{return new Intl.Locale(e).baseName}catch{return"en-US"}}(ea||"en-US"),Sn=class extends Date{invalid=null;isValid(){return!Number.isNaN(this.valueOf())}},Si={};for(let e=1;e<100;e++)Si[(e<=9?"0":"")+e]=e+(e>51?1900:2e3);var So={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},Sa="[1234567890一二三四五六七八九〇\\d]",Ss={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},Sl={},Su={"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},Sc={zone:Su,year:Si,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:{}},Sd={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(Su).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,}"},Sp={...Sd,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}"},Sf={},Sh=class e{locale;lookups;vars;numberingSystem;baseName;dateOptions;static factory(t=Sr){return Sf[t.toLowerCase()]||(Sf[t.toLowerCase()]=new e(t)),Sf[t.toLowerCase()]}constructor(e=Sr){this.locale=e,this.lookups={...Sc},this.vars={...Sd};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 r=0;r<e.length;r++)t+=String(this.lookups.digit[e[r]]);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 r=this.lookups.meridiem[t?.toLowerCase()]||0,n=this.toInt(e);return n<12&&12===r&&(n+=12),12===n&&0===r&&(n=0),n}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,r,n]=t;return("-"===e||"−"===e?-1:1)*(60*this.toInt(r)+this.toInt(n||0))}return 0}build(){"latn"===this.dateOptions.numberingSystem?this.lookups.digit=Ss: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(Sl[e])return Sl[e];if("fullwide"===e||"hanidec"===e)return{group:Sa,lookup:{...Ss}};let t=So[e];if(!t)return{group:"\\d",lookup:{...Ss}};let r=String.fromCharCode(t),n=String.fromCharCode(t+9),i={};for(let e=0;e<10;e++)i[String.fromCharCode(t+e)]=e;return Sl[e]={group:`[${r}-${n}]`,lookup:i},Sl[e]}(this.numberingSystem);for(let r in this.lookups.digit=t,Sp)Sp.hasOwnProperty(r)&&(this.vars[r]=Sp[r].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((r,n)=>{["","k","kuu","kuuta"].forEach((i,o)=>{e[r+i+(o<2?"\\.?":"")]=!0,t[r+i]=n+1})});else{let r=[],n=e=>"month"===e.type;for(let e=0;e<12;e++)r.push(new Date(2017,e,1));for(let i of["full","long","medium"]){let o=Intl.DateTimeFormat(this.locale,{dateStyle:i});for(let a=0;a<12;a++){let s=o.formatToParts(r[a]).find(n).value.toLocaleLowerCase(this.locale);/^\d+$/.test(s)||(/^ko/i.test(this.locale)&&(s+="월"),"medium"===i?(s=s.replace(/\.$/,""),e[`${s}\\.?`]=!0):e[s]=!0,t[s]=a+1)}}let i=Intl.DateTimeFormat(this.locale,{month:"short"});for(let o=0;o<12;o++){let a=i.formatToParts(r[o]).find(n).value.toLocaleLowerCase(this.locale);a=a.replace(/\.$/,""),e[`${a}\\.?`]=!0,t[a]=o+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 r=[],n={};for(let i of["long","short"]){let o=Intl.DateTimeFormat(this.locale,{weekday:i});for(let a=0;a<7;a++){let s=o.formatToParts(e[a]).find(t).value.toLocaleLowerCase(this.locale);"short"===i?(s=s.replace(/\.$/,""),r.push(`${s}\\.?`)):r.push(s),n[s]=a}}this.vars.DAYNAME=r.join("|"),this.lookups.dayname=n}buildMeridiems(){let e=[new Date(2017,0,1),new Date(2017,0,1,23,0,0)],t=e=>"dayPeriod"===e.type,r=[],n={},i=Intl.DateTimeFormat(this.locale,{timeStyle:"long"});for(let o=0;o<2;o++){let a=i.formatToParts(e[o]).find(t);if(!a)return;let s=a.value.toLocaleLowerCase(this.locale);r.push(s),n[s]=12*o}this.vars.MERIDIEM=r.join("|"),this.lookups.meridiem=n}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")}},Sm=["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"],Sy={y:"year",M:"month",d:"day",w:"week",h:"hour",m:"minute",s:"second",ms:"millisecond"},Sg=()=>new Date;function Sb(e){return function(t){let r={};for(let n=0,i=e.length;n<i;n++){let i=e[n];i&&(r[i]=t[n])}return r}}var Sv=class{doneChecker;fallback;patterns;formatter;constructor({doneChecker:e,fallback:t,patterns:r,formatter:n}){this.doneChecker=e,this.fallback=t,this.patterns=r,this.formatter=n}attempt(e){if("string"!=typeof e)return this.fallback(e);let t=e.trim(),r={},n=!1;for(let e of this.patterns){let i=t.match(e.regex);if(!i)continue;n=!0;let o=e.handler(i);if(o){for(let[e,t]of Object.entries(o))e in r||void 0===t||(r[e]=t);if(t=(t=t.slice(0,i.index)+t.slice(i.index+i[0].length+1)).trim(),this.doneChecker(r,t))break}}return n?this.formatter(r):this.fallback(e)}},Sw=["year","month","day","hour","minute","second","millisecond","offset"],S_={};function Sx(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 SE=[[/([^\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"]],SS={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," "],...SE],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:SE,id:SE,fr:[[/(\d{2}) h /,"$1:"],[/(\d{2}) min /,"$1:"],[/(\d{2}) s /,"$1"]]};function SD(e,t=Sr){let r=function(e){if(!S_[e]){var t,r;let n,i,o=Sh.factory(e);S_[e]=new Sv({doneChecker:Sx,fallback:(t=e,function(e){let r=String(e).slice(0,50);return""===r&&(r="(empty string)"),{invalid:`Unable to parse "${r}" with locale "${t}"`}}),patterns:(n=[{name:"timestampWithOffset",regex:o.compile("^(_YEAR4_)-(_MONTH_)-(_DAY_)[T ](_H24_):(_MIN_):(_SEC_)(?:.(_MS_))? ?(_OFFSET_|Z)?$"),handler:Sb(["","year","month","day","hour","minute","second","millisecond","offset"])},{name:"timestampWithZone",regex:o.compile("^(_YEAR4_)-(_MONTH_)-(_DAY_)[T ](_H24_):(_MIN_):(_SEC_)(?:.(_MS_))?\\s*(_ZONE_)$"),handler:Sb(["","year","month","day","hour","minute","second","millisecond","zone"])},{name:"timestampWithOffsetAndZone",regex:o.compile("^(_YEAR4_)-(_MONTH_)-(_DAY_)[T ](_H24_):(_MIN_):(_SEC_)(?:.(_MS_))? (_OFFSET_|Z)\\s*(_ZONE_)$"),handler:Sb(["","year","month","day","hour","minute","second","millisecond","offset"])},{name:"chinese",regex:o.compile(`^(${Sa}{2,4})\\s*\u5E74\\s*(${Sa}{1,2})\\s*\u6708\\s*(${Sa}{1,2})\\s*\u65E5$`),handler:Sb(["","year","month","day"])},{name:"korean",regex:o.compile("^(_YEAR_)년\\s*(_MONTH_)월\\s*(_DAY_)일$"),handler:Sb(["","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:Sb(["","monthname","day","hour","minute","second","offset","year"])},{name:"today",regex:/^(now|today|tomorrow|yesterday)$/i,handler:function(e){let t=Sg(),r=e[1].toLowerCase();switch(r){case"tomorrow":t.setUTCDate(t.getUTCDate()+1);break;case"yesterday":t.setUTCDate(t.getUTCDate()-1)}let n={year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate()};return"now"===r&&(n.hour=t.getUTCHours(),n.minute=t.getUTCMinutes(),n.second=t.getUTCSeconds(),n.millisecond=t.getUTCMilliseconds()),console.log("today=>",r,n),n}},{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,r,n]){t=parseFloat(t),"week"===(r=r.length<=2?Sy[r]:(r=r.replace(/s$/,"")).toLowerCase())&&(r="day",t*=7),("-"===e||n)&&(t*=-1);let i=Sg();return"millisecond"===r?i.setUTCMilliseconds(i.getUTCMilliseconds()+t):"second"===r?i.setUTCSeconds(i.getUTCSeconds()+t):"minute"===r?i.setUTCMinutes(i.getUTCMinutes()+t):"hour"===r?i.setUTCHours(i.getUTCHours()+t):"day"===r?i.setUTCDate(i.getUTCDate()+t):"month"===r?i.setUTCMonth(i.getUTCMonth()+t):"year"===r&&i.setUTCFullYear(i.getUTCFullYear()+t),{year:i.getUTCFullYear(),month:i.getUTCMonth()+1,day:i.getUTCDate(),hour:i.getUTCHours(),minute:i.getUTCMinutes(),second:i.getUTCSeconds(),millisecond:i.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:o.compile("(?:^|[\\sT])(_H24_):(_MIN_):(_SEC_)(?:\\.(_MS_))?(Z)?$"),handler:Sb(["","hour","minute","second","millisecond","zone"])},{name:"zone24",regex:o.compile("(_H24_):(_MIN_):(_SEC_)(?:\\.(_MS_))?[\\s\\[(]*(_ZONE_)?[\\s\\])]*$"),handler:Sb(["","hour","minute","second","millisecond","zone"])},{name:"hms12",regex:o.compile("(_H12_):(_MIN_):(_SEC_)\\s*(_MERIDIEM_)"),handler:Sb(["","hour","minute","second","meridiem"])},{name:"hms24",regex:o.compile("(_H24_):(_MIN_):(_SEC_)(?:\\.(_MS_))?"),handler:Sb(["","hour","minute","second","millisecond"])},{name:"hm12",regex:o.compile("(_H12_):(_MIN_)\\s*(_MERIDIEM_)"),handler:Sb(["","hour","minute","meridiem"])},{name:"hm24",regex:o.compile("(_H24_):(_MIN_)"),handler:Sb(["","hour","minute"])},{name:"h12",regex:o.compile("(_H12_)\\s*(_MERIDIEM_)"),handler:Sb(["","hour","meridiem"])},{name:"8digit",regex:/^((?:19|20)\d{2})(\d{2})(\d{2})$/,handler:Sb(["","year","month","day"])},{name:"yearMonthnameDay",regex:o.compile("(_YEAR4_)[\\s.-]+(_MONTHNAME_)[\\s,.-]+(_DAY_)(_ORDINAL_)?"),handler:Sb(["","year","monthname","day"])},{name:"dayMonthnameYear",regex:o.compile("(_DAY_)(_ORDINAL_)?[\\s.-]*(_MONTHNAME_)[\\s,.-]+(_YEAR_)"),handler:Sb(["","day","","monthname","year"])},{name:"monthnameDayYear",regex:o.compile("(_MONTHNAME_)[\\s.-]*(_DAY_)(_ORDINAL_)?[\\s,.-]+(_YEAR_)"),handler:Sb(["","monthname","day","","year"])},{name:"dayMonthname",regex:o.compile("\\b(_DAY_)(_ORDINAL_)?[\\s.-]*(_MONTHNAME_)\\b"),handler:Sb(["","day","","monthname"])},{name:"monthnameDay",regex:o.compile("\\b(_MONTHNAME_)[\\s.-]*(_DAY_)(_ORDINAL_)?\\b"),handler:Sb(["","monthname","day"])},{name:"hmsNoMeridiem",regex:o.compile("\\b(_H12_|_H24_):(_MIN_):(_SEC_)\\b"),handler:Sb(["","hour","minute","second"])},{name:"hmNoMeridiem",regex:o.compile("\\b(_H12_|_H24_):(_MIN_)\\b"),handler:Sb(["","hour","minute"])},{name:"ymd",regex:o.compile("(_YEAR4_)([.-])(_MONTH_)\\2+(_DAY_)"),handler:Sb(["","year","","month","day"])},{name:"mdy",regex:o.compile("(_MONTH_)([/-])(_DAY_)\\2(_YEAR_)"),handler:Sb(["","month","","day","year"])},{name:"dmy",regex:o.compile("(_DAY_)(?:_ORDINAL_)?[./\\s-]+(_MONTH_)[./\\s-]+(_YEAR_)"),handler:Sb(["","day","month","year"])},{name:"yearLoose",regex:o.compile("_YEAR4_"),handler:Sb(["year"])},{name:"dayMonthnameLoose",regex:o.compile("(_DAY_)[\\s.]*(_MONTHNAME_)"),handler:Sb(["","day","monthname"])},{name:"monthnameDayLoose",regex:o.compile("(_MONTHNAME_)[\\s.]*(_DAY_)"),handler:Sb(["","monthname","day"])},{name:"monthname",regex:o.compile("_MONTHNAME_"),handler:Sb(["monthname"])},{name:"year4",regex:o.compile("_YEAR4_"),handler:Sb(["year"])},{name:"md",regex:o.compile("(_MONTH_)[/-](_DAY_)"),handler:Sb(["","month","day"])},{name:"dm",regex:o.compile("(_DAY_)(?:_ORDINAL_)?[./\\s-]+(_MONTH_)"),handler:Sb(["","day","month"])},{name:"day",regex:o.compile("_DAY_"),handler:Sb(["day"])},{name:"year2",regex:o.compile("_YEAR2_"),handler:Sb(["year"])},{name:"onlyZone",regex:o.compile("_ZONE_"),handler:Sb(["zone"])}],i=o.baseName.slice(0,5),Sm.includes(i)?n:n.filter(e=>!["mdy","md"].includes(e.name))),formatter:(r=o,function(e){let t={};for(let[n,i]of Object.entries(e))if("monthname"===n){if(i){let e=r.monthNameToInt(i);void 0!==e&&(t.month=e)}}else if("hour"===n&&e.meridiem){let n=r.h12ToInt(i,e.meridiem);void 0!==n&&(t.hour=n)}else if("zone"===n){if(i){let e=r.zoneToOffset(i);void 0!==e&&(t.offset=e)}}else if("offset"===n){let e=r.offsetToMinutes(i);void 0!==e&&(t.offset=e)}else if("millisecond"===n){let e=r.millisecondToInt(i);"number"==typeof e&&(t.millisecond=e)}else if(Sw.includes(n)){let e=r.toInt(i);"number"==typeof e&&(t[n]=e)}return t.year<100&&(t.year=Si[t.year]),t.year&&"buddhist"===r.dateOptions.calendar&&(t.year-=543),t})})}return S_[e]}(t),n=function(e,t){let r=SS[t.slice(0,2).toLowerCase()];if(!r)return e;for(let[t,n]of r)e=e.replace(t,n);return e}(e,t);return r.attempt(n)}function SO(e){e.month&&e.day&&void 0===e.year&&(e.year=new Date().getFullYear()),60===e.second&&(e.second=59);let t=new Sn(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 Sn(t.valueOf()-60*e.offset*1e3):t}function SP(e,t=Sr){let r=SD(e,t),n=r.invalid?new Sn(NaN):SO(r);return n.isValid()||(n.invalid=`Unable to parse date "${e}"`),n}function SC(e,t=Sr){return e instanceof Date?new Sn(e.valueOf()):"number"==typeof e?new Sn(e):SP(e,t)}Date.fromString=Sn.fromString=SP,Date.fromAny=Sn.fromAny=SC,"u">typeof window&&(window.anyDateParser={fromString:SP,fromAny:SC,fromObject:SO,attempt:SD});var Sk=r(5238),Sj=r(3826);let ST=function(e){return null==e};function SR(e,t){var r=function(e,t){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return t.get(e)}(e,t);return r.get?r.get.call(e):r.value}hP.extend(hk),hP.extend(Sj),hP.extend(Sk);let SA="YYYY-MM-DDTHH:mm:ss.SSSZZ";function SN(e){return null!=e&&28===e.trim().length&&"T"===(e=e.trim())[10]&&":"===e[13]&&":"===e[16]&&"."===e[19]&&("+"===e[23]||"-"===e[23])&&hP(e,SA).isValid()}function SM(e){return hP(e).isToday()}function SI(e){return SN(e)?hP(e,SA).toDate():null}function S$(e,t=!1){let r=hP(e);return t&&(r=r.utc()),r.format(SA)}function SL(e){return hP(e).toDate()}var SF=new WeakMap;let SB=new class{register(e,t){SR(this,SF).set(e,t)}getCalendar(e){if(!e)return;if(e.calendar)return e.calendar;if(e.region){let t=`${e.language}-${e.region}`;if(SR(this,SF).has(t))return SR(this,SF).get(t)}if(e.language&&SR(this,SF).has(e.language))return SR(this,SF).get(e.language);let t=new Intl.DateTimeFormat(e.toString()).resolvedOptions().calendar;return SR(this,SF).set(`${e.language}${e.region?`-${e.region}`:""}`,t),t}constructor(){!function(e,t,r){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object");t.set(e,r)}(this,SF,{writable:!0,value:new Map})}};function SV(e,t){SB.register(e,t)}function SU(e){let t=e??St();return SB.getCalendar(t instanceof Intl.Locale?t:new Intl.Locale(t))}let SW={mode:"standard",time:"for today",day:!0,month:!0,year:!0,noToday:!1};function SK(e,t={}){let r=SD(e,St());if(r.invalid)return console.warn(`Could not parse invalid date '${e}'`),null;!ST(r.day)&&ST(r.month)&&(r=Object.assign({},t$(r,"day"),{month:r.day})),r.month&&(r.month-=1),r.day&&(r=Object.assign({},t$(r,"day"),{date:r.day}));let n=hP().set(r).toDate();return ST(r.year)&&(t.year=!1),ST(r.month)&&(t.month=!1),ST(r.date)&&(t.day=!1),SH(n,t)}function SH(e,t){let r,n=t?.locale??St(),i=new Intl.Locale(n),{calendar:o,mode:a,time:s,day:l,month:u,year:c,noToday:d,numberingSystem:p}={...SW,...{noToday:"am"===i.language},...t},f={calendar:o??SU(i),year:c?"numeric":void 0,month:u?"short":void 0,day:l?"2-digit":void 0,numberingSystem:p},h=hP(e).isToday();if(h&&!d)r=(r=new Intl.RelativeTimeFormat(n,{numeric:"auto"}).format(0,"day"))[0].toLocaleUpperCase(n)+r.slice(1);else{"en"===i.language&&(n="en-GB");let t=new Intl.DateTimeFormat(n,f).formatToParts(e);("en"===i.language||"am"===i.language)&&"standard"==a&&c&&l&&(t=t.map(Sz("-"))),"wide"==a&&(t=t.map(Sz(" — "))),"ethiopic"===f.calendar&&(t=t.filter((e,t,r)=>"era"!==e.type&&("literal"!==e.type||!(t<r.length-1)||"era"!==r[t+1].type))),r=t.map(e=>e.value).join("")}return(!0===s||h&&"for today"===s)&&(r+=`, ${SG(e)}`),r}let Sz=e=>(t,r,n)=>"literal"!==t.type||" "!==t.value||r<n.length-1&&"era"===n[r+1].type?t:{type:"literal",value:e};function SG(e){return e.toLocaleTimeString(St(),{hour:"2-digit",minute:"2-digit"})}function Sq(e,t){return SH(e,{...t,time:!0})}function SY(e,t){let r=SU("string"==typeof t?new Intl.Locale(t):t);return r?v9(e,_m(r)):e}function SZ(e,t){return new Intl.DurationFormat(St(),t).format(e)}function SJ(e,t){if(null==e)return null;if("string"==typeof e){let r=SD(e,St());return r.invalid?(console.warn(`Could not interpret '${e}' as a date`),null):(r.day&&!r.month&&(r={...t$(r,"day"),...{month:r.day}}),r.month&&(r.month-=1),r.day&&(r={...t$(r,"day"),...{date:r.day}}),hP(t).set(r))}return hP(e)}let SX=["years","months","days","hours","minutes","seconds"],SQ={second:"seconds",minute:"minutes",hour:"hours",day:"days",month:"months",year:"years"},S0={seconds:45,minutes:45,hours:22,days:26,months:11,years:1/0};function S1(e,t=hP(),r){let n,i=hP(t),o=SJ(e,i);if(null==o)return null;if("string"==typeof r){let e=SQ[r]??r;return{[e]:i.diff(o,e)}}let{thresholds:a,largestUnit:s,smallestUnit:l}=r??{};if(void 0!==s||void 0!==l){let e,t=l?SQ[l]??l:void 0;return e="auto"===s||void 0===s?function(e,t,r){let n=SX.indexOf(r);for(let i=0;i<SX.length;i++){let o=SX[i];if(t.diff(e,o)>0)return i<=n?o:r}return r}(o,i,t??"seconds"):SQ[s]??s,function(e,t,r,n){let i=SX.indexOf(r),o=SX.indexOf(n),a=SX.slice(i,o+1),s={},l=e;for(let e of a){let r=t.diff(l,e);s[e]=r,l=l.add(r,e)}return s}(o,i,e,t??e)}let u=(n=function(e){let t={...S0};if(e)for(let[r,n]of Object.entries(e))void 0!==n&&(t[SQ[r]??r]=n);return t}(a),i.diff(o,"seconds")<n.seconds?"seconds":i.diff(o,"minutes")<n.minutes?"minutes":i.diff(o,"hours")<n.hours?"hours":i.diff(o,"days")<n.days?"days":i.diff(o,"months")<n.months?"months":"years");return{[u]:i.diff(o,u)}}let S3={style:"short",localeMatcher:"lookup"};function S4(e,t=hP(),r){let n=S1(e,t,r);return null==n?null:SZ(n,"object"==typeof r&&r.formatOptions?{...S3,...r.formatOptions}:S3)}let S2=(0,pq.createContext)(null);function S6(){let e=fG({externalModuleName:"@openmrs/esm-styleguide"}).preferredDateLocale,t=(0,pq.useMemo)(()=>{let t=St();return e[t]&&(t=e[t]),t},[window.i18next.language]),r=(0,pq.useMemo)(()=>{let e=SU(t);return void 0!==e?_m(e):void 0},[t]),n=(0,pq.useMemo)(()=>new Intl.Locale(t,{calendar:r?.identifier}),[t,r]),i=(0,pq.useMemo)(()=>r?v9(wa(wc()),r):wa(wc()),[r]);return{calendar:r,intlLocale:n,today_:i}}let S5=new vq(1793,1,1);var S8={};function S9(){return"u">typeof window&&window.InputEvent&&"function"==typeof InputEvent.prototype.getTargetRanges}function S7(e={}){let{locale:t}=b9();return(0,pq.useMemo)(()=>new(0,x$.K)(t,e),[t,e])}S8={"ar-AE":{decrease:e=>`\u{62E}\u{641}\u{636} ${e.fieldLabel}`,increase:e=>`\u{632}\u{64A}\u{627}\u{62F}\u{629} ${e.fieldLabel}`,numberField:"حقل رقمي"},"bg-BG":{decrease:e=>`\u{41D}\u{430}\u{43C}\u{430}\u{43B}\u{44F}\u{432}\u{430}\u{43D}\u{435} ${e.fieldLabel}`,increase:e=>`\u{423}\u{441}\u{438}\u{43B}\u{432}\u{430}\u{43D}\u{435} ${e.fieldLabel}`,numberField:"Номер на полето"},"cs-CZ":{decrease:e=>`Sn\xed\u{17E}it ${e.fieldLabel}`,increase:e=>`Zv\xfd\u{161}it ${e.fieldLabel}`,numberField:"Č\xedseln\xe9 pole"},"da-DK":{decrease:e=>`Reducer ${e.fieldLabel}`,increase:e=>`\xd8g ${e.fieldLabel}`,numberField:"Talfelt"},"de-DE":{decrease:e=>`${e.fieldLabel} verringern`,increase:e=>`${e.fieldLabel} erh\xf6hen`,numberField:"Nummernfeld"},"el-GR":{decrease:e=>`\u{39C}\u{3B5}\u{3AF}\u{3C9}\u{3C3}\u{3B7} ${e.fieldLabel}`,increase:e=>`\u{391}\u{3CD}\u{3BE}\u{3B7}\u{3C3}\u{3B7} ${e.fieldLabel}`,numberField:"Πεδίο αριθμού"},"en-US":{decrease:e=>`Decrease ${e.fieldLabel}`,increase:e=>`Increase ${e.fieldLabel}`,numberField:"Number field"},"es-ES":{decrease:e=>`Reducir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:"Campo de n\xfamero"},"et-EE":{decrease:e=>`V\xe4henda ${e.fieldLabel}`,increase:e=>`Suurenda ${e.fieldLabel}`,numberField:"Numbri v\xe4li"},"fi-FI":{decrease:e=>`V\xe4henn\xe4 ${e.fieldLabel}`,increase:e=>`Lis\xe4\xe4 ${e.fieldLabel}`,numberField:"Numerokentt\xe4"},"fr-FR":{decrease:e=>`Diminuer ${e.fieldLabel}`,increase:e=>`Augmenter ${e.fieldLabel}`,numberField:"Champ de nombre"},"he-IL":{decrease:e=>`\u{5D4}\u{5E7}\u{5D8}\u{5DF} ${e.fieldLabel}`,increase:e=>`\u{5D4}\u{5D2}\u{5D3}\u{5DC} ${e.fieldLabel}`,numberField:"שדה מספר"},"hr-HR":{decrease:e=>`Smanji ${e.fieldLabel}`,increase:e=>`Pove\u{107}aj ${e.fieldLabel}`,numberField:"Polje broja"},"hu-HU":{decrease:e=>`${e.fieldLabel} cs\xf6kkent\xe9se`,increase:e=>`${e.fieldLabel} n\xf6vel\xe9se`,numberField:"Sz\xe1mmező"},"it-IT":{decrease:e=>`Riduci ${e.fieldLabel}`,increase:e=>`Aumenta ${e.fieldLabel}`,numberField:"Campo numero"},"ja-JP":{decrease:e=>`${e.fieldLabel}\u{3092}\u{7E2E}\u{5C0F}`,increase:e=>`${e.fieldLabel}\u{3092}\u{62E1}\u{5927}`,numberField:"数値フィールド"},"ko-KR":{decrease:e=>`${e.fieldLabel} \u{AC10}\u{C18C}`,increase:e=>`${e.fieldLabel} \u{C99D}\u{AC00}`,numberField:"번호 필드"},"lt-LT":{decrease:e=>`Suma\u{17E}inti ${e.fieldLabel}`,increase:e=>`Padidinti ${e.fieldLabel}`,numberField:"Numerio laukas"},"lv-LV":{decrease:e=>`Samazin\u{101}\u{161}ana ${e.fieldLabel}`,increase:e=>`Palielin\u{101}\u{161}ana ${e.fieldLabel}`,numberField:"Skaitļu lauks"},"nb-NO":{decrease:e=>`Reduser ${e.fieldLabel}`,increase:e=>`\xd8k ${e.fieldLabel}`,numberField:"Tallfelt"},"nl-NL":{decrease:e=>`${e.fieldLabel} verlagen`,increase:e=>`${e.fieldLabel} verhogen`,numberField:"Getalveld"},"pl-PL":{decrease:e=>`Zmniejsz ${e.fieldLabel}`,increase:e=>`Zwi\u{119}ksz ${e.fieldLabel}`,numberField:"Pole numeru"},"pt-BR":{decrease:e=>`Diminuir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:"Campo de n\xfamero"},"pt-PT":{decrease:e=>`Diminuir ${e.fieldLabel}`,increase:e=>`Aumentar ${e.fieldLabel}`,numberField:"Campo num\xe9rico"},"ro-RO":{decrease:e=>`Sc\u{103}dere ${e.fieldLabel}`,increase:e=>`Cre\u{219}tere ${e.fieldLabel}`,numberField:"C\xe2mp numeric"},"ru-RU":{decrease:e=>`\u{423}\u{43C}\u{435}\u{43D}\u{44C}\u{448}\u{435}\u{43D}\u{438}\u{435} ${e.fieldLabel}`,increase:e=>`\u{423}\u{432}\u{435}\u{43B}\u{438}\u{447}\u{435}\u{43D}\u{438}\u{435} ${e.fieldLabel}`,numberField:"Числовое поле"},"sk-SK":{decrease:e=>`Zn\xed\u{17E}i\u{165} ${e.fieldLabel}`,increase:e=>`Zv\xfd\u{161}i\u{165} ${e.fieldLabel}`,numberField:"Č\xedseln\xe9 pole"},"sl-SI":{decrease:e=>`Upadati ${e.fieldLabel}`,increase:e=>`Pove\u{10D}ajte ${e.fieldLabel}`,numberField:"Številčno polje"},"sr-SP":{decrease:e=>`Smanji ${e.fieldLabel}`,increase:e=>`Pove\u{107}aj ${e.fieldLabel}`,numberField:"Polje broja"},"sv-SE":{decrease:e=>`Minska ${e.fieldLabel}`,increase:e=>`\xd6ka ${e.fieldLabel}`,numberField:"Nummerf\xe4lt"},"tr-TR":{decrease:e=>`${e.fieldLabel} azalt`,increase:e=>`${e.fieldLabel} artt\u{131}r`,numberField:"Sayı alanı"},"uk-UA":{decrease:e=>`\u{417}\u{43C}\u{435}\u{43D}\u{448}\u{438}\u{442}\u{438} ${e.fieldLabel}`,increase:e=>`\u{417}\u{431}\u{456}\u{43B}\u{44C}\u{448}\u{438}\u{442}\u{438} ${e.fieldLabel}`,numberField:"Поле номера"},"zh-CN":{decrease:e=>`\u{964D}\u{4F4E} ${e.fieldLabel}`,increase:e=>`\u{63D0}\u{9AD8} ${e.fieldLabel}`,numberField:"数字字段"},"zh-TW":{decrease:e=>`\u{7E2E}\u{5C0F} ${e.fieldLabel}`,increase:e=>`\u{653E}\u{5927} ${e.fieldLabel}`,numberField:"數字欄位"}};var De={};De={"ar-AE":{Empty:"فارغ"},"bg-BG":{Empty:"Изпразни"},"cs-CZ":{Empty:"Pr\xe1zdn\xe9"},"da-DK":{Empty:"Tom"},"de-DE":{Empty:"Leer"},"el-GR":{Empty:"Άδειο"},"en-US":{Empty:"Empty"},"es-ES":{Empty:"Vac\xedo"},"et-EE":{Empty:"T\xfchjenda"},"fi-FI":{Empty:"Tyhj\xe4"},"fr-FR":{Empty:"Vide"},"he-IL":{Empty:"ריק"},"hr-HR":{Empty:"Prazno"},"hu-HU":{Empty:"\xdcres"},"it-IT":{Empty:"Vuoto"},"ja-JP":{Empty:"空"},"ko-KR":{Empty:"비어 있음"},"lt-LT":{Empty:"Tuščias"},"lv-LV":{Empty:"Tukšs"},"nb-NO":{Empty:"Tom"},"nl-NL":{Empty:"Leeg"},"pl-PL":{Empty:"Pusty"},"pt-BR":{Empty:"Vazio"},"pt-PT":{Empty:"Vazio"},"ro-RO":{Empty:"Gol"},"ru-RU":{Empty:"Не заполнено"},"sk-SK":{Empty:"Pr\xe1zdne"},"sl-SI":{Empty:"Prazen"},"sr-SP":{Empty:"Prazno"},"sv-SE":{Empty:"Tomt"},"tr-TR":{Empty:"Boş"},"uk-UA":{Empty:"Пусто"},"zh-CN":{Empty:"空"},"zh-TW":{Empty:"空白"}};let Dt=()=>{};function Dr(e){var t;let r=(0,pq.useRef)(void 0),{value:n,textValue:i,minValue:o,maxValue:a,isDisabled:s,isReadOnly:l,isRequired:u,onIncrement:c,onIncrementPage:d,onDecrement:p,onDecrementPage:f,onDecrementToMin:h,onIncrementToMax:m}=e,y=vw((t=De)&&t.__esModule?t.default:t,"@react-aria/spinbutton"),g=(0,pq.useRef)(!1),b=(0,pq.useCallback)(()=>{clearTimeout(r.current),g.current=!1},[]),v=bv(()=>{b()});(0,pq.useEffect)(()=>()=>v(),[]);let w=(0,pq.useRef)(!1),x=()=>{w.current=!0},E=()=>{w.current=!1},S=""===i?y.format("Empty"):(i||`${n}`).replace("-","−");(0,pq.useEffect)(()=>{w.current&&(b7&&b7.clear("assertive"),ve(S,"assertive"))},[S]);let D=(0,pq.useCallback)(()=>{b()},[b]),O=bv(c??Dt),P=bv(p??Dt),C=bv(()=>{(void 0===a||isNaN(a)||void 0===n||isNaN(n)||n<a)&&(O(),k(60))}),k=bv(e=>{v(),g.current=!0,r.current=window.setTimeout(C,e)}),j=bv(()=>{(void 0===o||isNaN(o)||void 0===n||isNaN(n)||n>o)&&(P(),T(60))}),T=bv(e=>{v(),g.current=!0,r.current=window.setTimeout(j,e)}),R=e=>{e.preventDefault()},{addGlobalListener:A,removeAllGlobalListeners:N}=bw(),M=(0,pq.useRef)(!1),[I,$]=(0,pq.useState)(null);(0,pq.useEffect)(()=>{"touch"===I?k(600):I&&k(400)},[I]);let[L,F]=(0,pq.useState)(null);return(0,pq.useEffect)(()=>{"touch"===L?T(600):L&&T(400)},[L]),{spinButtonProps:{role:"spinbutton","aria-valuenow":void 0===n||isNaN(n)?void 0:n,"aria-valuetext":S,"aria-valuemin":o,"aria-valuemax":a,"aria-disabled":s||void 0,"aria-readonly":l||void 0,"aria-required":u||void 0,onKeyDown:e=>{if(!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey&&!l&&!e.nativeEvent.isComposing)switch(e.key){case"PageUp":if(d){e.preventDefault(),d?.();break}case"ArrowUp":case"Up":c&&(e.preventDefault(),c?.());break;case"PageDown":if(f){e.preventDefault(),f?.();break}case"ArrowDown":case"Down":p&&(e.preventDefault(),p?.());break;case"Home":h&&(e.preventDefault(),h?.());break;case"End":m&&(e.preventDefault(),m?.())}},onFocus:x,onBlur:E},incrementButtonProps:{onPressStart:e=>{b(),"touch"!==e.pointerType?(c?.(),$("mouse")):(A(window,"pointercancel",D,{capture:!0}),M.current=!1,$("touch")),A(window,"contextmenu",R)},onPressUp:e=>{b(),"touch"===e.pointerType&&(M.current=!0),N(),$(null)},onPressEnd:e=>{b(),"touch"===e.pointerType&&!g.current&&M.current&&c?.(),M.current=!1,$(null)},onFocus:x,onBlur:E},decrementButtonProps:{onPressStart:e=>{b(),"touch"!==e.pointerType?(p?.(),F("mouse")):(A(window,"pointercancel",D,{capture:!0}),M.current=!1,F("touch"))},onPressUp:e=>{b(),"touch"===e.pointerType&&(M.current=!0),N(),F(null)},onPressEnd:e=>{b(),"touch"===e.pointerType&&!g.current&&M.current&&p?.(),M.current=!1,F(null)},onFocus:x,onBlur:E}}}let Dn=null;var Di=r(6284);function Do(e,t,r){let n="+"===e?t+r:t-r;if(t%1!=0||r%1!=0){let i=t.toString().split("."),o=r.toString().split("."),a=Math.pow(10,Math.max(i[1]&&i[1].length||0,o[1]&&o[1].length||0));t=Math.round(t*a),r=Math.round(r*a),n=("+"===e?t+r:t-r)/a}return n}let Da=(0,pq.createContext)(null),Ds=(0,pq.createContext)(null),Dl=(0,pq.forwardRef)(function(e,t){var r,n;[e,t]=gr(e,t,Da);let{validationBehavior:i}=gt(x2)||{},o=null!=(n=null!=(r=e.validationBehavior)?r:i)?n:"native",{locale:a}=b9(),s=function(e){let{minValue:t,maxValue:r,step:n,formatOptions:i,value:o,defaultValue:a=NaN,onChange:s,locale:l,isDisabled:u,isReadOnly:c,commitBehavior:d="snap"}=e;null===o&&(o=NaN);let p=(0,pq.useCallback)(e=>void 0===n||isNaN(n)?Et(e,t,r):En(e,t,r,n),[n,t,r]);void 0===o||isNaN(o)||"snap"!==d||(o=p(o)),isNaN(a)||"snap"!==d||(a=p(a));let[f,h]=_S(o,isNaN(a)?NaN:a,s),[m]=(0,pq.useState)(f),[y,g]=(0,pq.useState)(()=>isNaN(f)?"":new(0,x$.K)(l,i).format(f)),b=(0,pq.useMemo)(()=>new(0,Di.d)(l,i),[l,i]),v=(0,pq.useMemo)(()=>b.getNumberingSystem(y),[b,y]),w=(0,pq.useMemo)(()=>new(0,x$.K)(l,{...i,numberingSystem:v}),[l,i,v]),x=(0,pq.useMemo)(()=>w.resolvedOptions(),[w]),E=(0,pq.useCallback)(e=>isNaN(e)||null===e?"":w.format(e),[w]),S=xv({...e,value:f}),D=void 0===n||isNaN(n)?1:n;"percent"===x.style&&(void 0===n||isNaN(n))&&(D=.01);let[O,P]=(0,pq.useState)(f),[C,k]=(0,pq.useState)(l),[j,T]=(0,pq.useState)(i);Object.is(f,O)&&l===C&&i===j||(g(E(f)),P(f),k(l),T(i));let R=(0,pq.useMemo)(()=>b.parse(y),[b,y]),A=(e,n=0)=>{if(isNaN(R))return En(isNaN(n)?0:n,t,r,D);{let n=En(R,t,r,D);return"+"===e&&n>R||"-"===e&&n<R?n:En(Do(e,R,D),t,r,D)}},N=(0,pq.useMemo)(()=>!u&&!c&&(isNaN(R)||void 0===r||isNaN(r)||En(R,t,r,D)>R||Do("+",R,D)<=r),[u,c,t,r,D,R]),M=(0,pq.useMemo)(()=>!u&&!c&&(isNaN(R)||void 0===t||isNaN(t)||En(R,t,r,D)<R||Do("-",R,D)>=t),[u,c,t,r,D,R]);return{...S,validate:e=>b.isValidPartialNumber(e,t,r),increment:()=>{let e=A("+",t);e===f&&g(E(e)),h(e),S.commitValidation()},incrementToMax:()=>{null!=r&&(h(En(r,t,r,D)),S.commitValidation())},decrement:()=>{let e=A("-",r);e===f&&g(E(e)),h(e),S.commitValidation()},decrementToMin:()=>{null!=t&&(h(t),S.commitValidation())},canIncrement:N,canDecrement:M,minValue:t,maxValue:r,numberValue:R,defaultNumberValue:isNaN(a)?m:a,setNumberValue:h,setInputValue:g,inputValue:y,commit:e=>{let t=void 0===e?y:e,r=R;if(void 0!==e&&(r=b.parse(t)),!t.length){h(NaN),g(void 0===o?"":E(f));return}if(isNaN(r))return void g(E(f));let n="snap"===d?p(r):r,i=(n=b.parse(E(n)))!==f;h(n),g(E(void 0===o?n:f)),i&&S.commitValidation()}}}({...e,locale:a,validationBehavior:o}),l=(0,pq.useRef)(null),[u,c]=gn(!e["aria-label"]&&!e["aria-labelledby"]),{labelProps:d,groupProps:p,inputProps:f,incrementButtonProps:h,decrementButtonProps:m,descriptionProps:y,errorMessageProps:g,...b}=function(e,t,r){var n,i,o,a,s,l,u,c,d;let p,{id:f,decrementAriaLabel:h,incrementAriaLabel:m,isDisabled:y,isReadOnly:g,isRequired:b,minValue:v,maxValue:w,autoFocus:x,label:E,formatOptions:S,onBlur:D=()=>{},onFocus:O,onFocusChange:P,onKeyDown:C,onKeyUp:k,description:j,errorMessage:T,isWheelDisabled:R,...A}=e,{increment:N,incrementToMax:M,decrement:I,decrementToMin:$,numberValue:L,inputValue:F,commit:B,commitValidation:V}=t,U=vw((n=S8)&&n.__esModule?n.default:n,"@react-aria/numberfield"),W=(0,pq.useCallback)(()=>{let e=r.current?.value??"";(0,b_.flushSync)(()=>{B()}),r.current?.value!==e&&ve(r.current?.value??"","assertive")},[B,r]),K=y2(f),{focusProps:H}=bo({onBlur(){W()}}),z=S7(S),G=(0,pq.useMemo)(()=>z.resolvedOptions(),[z]),q=S7({...S,currencySign:void 0}),Y=(0,pq.useMemo)(()=>isNaN(L)?"":q.format(L),[q,L]),{spinButtonProps:Z,incrementButtonProps:J,decrementButtonProps:X}=Dr({isDisabled:y,isReadOnly:g,isRequired:b,maxValue:w,minValue:v,onIncrement:N,onIncrementToMax:M,onDecrement:I,onDecrementToMin:$,value:L,textValue:Y}),[Q,ee]=(0,pq.useState)(!1),{focusWithinProps:et}=bN({isDisabled:y,onFocusWithinChange:ee});!function(e,t){let{onScroll:r,isDisabled:n}=e,i=(0,pq.useCallback)(e=>{!e.ctrlKey&&(e.preventDefault(),e.stopPropagation(),r&&r({deltaX:e.deltaX,deltaY:e.deltaY}))},[r]);wk(t,"wheel",n?void 0:i)}({onScroll:(0,pq.useCallback)(e=>{!(Math.abs(e.deltaY)<=Math.abs(e.deltaX))&&(e.deltaY>0?N():e.deltaY<0&&I())},[I,N]),isDisabled:R||y||g||!Q},r);let er=(G.maximumFractionDigits??0)>0,en=void 0===t.minValue||isNaN(t.minValue)||t.minValue<0,ei="numeric";gF()?en?ei="text":er&&(ei="decimal"):gK()&&(en?ei="numeric":er&&(ei="decimal"));let eo=gm(e),ea=(0,pq.useCallback)(e=>{e.nativeEvent.isComposing||("Enter"===e.key?((0,b_.flushSync)(()=>{B()}),V()):e.continuePropagation())},[B,V]),{isInvalid:es,validationErrors:el,validationDetails:eu}=t.displayValidation,{labelProps:ec,inputProps:ed,descriptionProps:ep,errorMessageProps:ef}=function(e,t,r){let n=bv(e=>{let n=r.current;if(!n)return;let i=null;switch(e.inputType){case"historyUndo":case"historyRedo":case"insertLineBreak":return;case"deleteContent":case"deleteByCut":case"deleteByDrag":i=n.value.slice(0,n.selectionStart)+n.value.slice(n.selectionEnd);break;case"deleteContentForward":i=n.selectionEnd===n.selectionStart?n.value.slice(0,n.selectionStart)+n.value.slice(n.selectionEnd+1):n.value.slice(0,n.selectionStart)+n.value.slice(n.selectionEnd);break;case"deleteContentBackward":i=n.selectionEnd===n.selectionStart?n.value.slice(0,n.selectionStart-1)+n.value.slice(n.selectionStart):n.value.slice(0,n.selectionStart)+n.value.slice(n.selectionEnd);break;case"deleteSoftLineBackward":case"deleteHardLineBackward":i=n.value.slice(n.selectionStart);break;default:null!=e.data&&(i=n.value.slice(0,n.selectionStart)+e.data+n.value.slice(n.selectionEnd))}null!=i&&t.validate(i)||e.preventDefault()});(0,pq.useEffect)(()=>{if(!S9()||!r.current)return;let e=r.current;return e.addEventListener("beforeinput",n,!1),()=>{e.removeEventListener("beforeinput",n,!1)}},[r]);let i=S9()?null:e=>{let r=g_(e).value.slice(0,g_(e).selectionStart)+e.data+g_(e).value.slice(g_(e).selectionEnd);t.validate(r)||e.preventDefault()},{labelProps:o,inputProps:a,descriptionProps:s,errorMessageProps:l,...u}=function(e,t){let{inputElementType:r="input",isDisabled:n=!1,isRequired:i=!1,isReadOnly:o=!1,type:a="text",validationBehavior:s="aria"}=e,[l,u]=_S(e.value,e.defaultValue||"",e.onChange),{focusableProps:c}=bu(e,t),d=xv({...e,value:l}),{isInvalid:p,validationErrors:f,validationDetails:h}=d.displayValidation,{labelProps:m,fieldProps:y,descriptionProps:g,errorMessageProps:b}=xa({...e,isInvalid:p,errorMessage:e.errorMessage||f}),v=gm(e,{labelable:!0}),w={type:a,pattern:e.pattern},[x]=(0,pq.useState)(l);return xs(t,e.defaultValue??x,u),xl(e,d,t),{labelProps:m,inputProps:y8(v,"input"===r?w:void 0,{disabled:n,readOnly:o,required:i&&"native"===s,"aria-required":i&&"aria"===s||void 0,"aria-invalid":p||void 0,"aria-errormessage":e["aria-errormessage"],"aria-activedescendant":e["aria-activedescendant"],"aria-autocomplete":e["aria-autocomplete"],"aria-haspopup":e["aria-haspopup"],"aria-controls":e["aria-controls"],value:l,onChange:e=>u(g_(e).value),autoComplete:e.autoComplete,autoCapitalize:e.autoCapitalize,maxLength:e.maxLength,minLength:e.minLength,name:e.name,form:e.form,placeholder:e.placeholder,inputMode:e.inputMode,autoCorrect:e.autoCorrect,spellCheck:e.spellCheck,[parseInt(pY().version,10)>=17?"enterKeyHint":"enterkeyhint"]:e.enterKeyHint,onCopy:e.onCopy,onCut:e.onCut,onPaste:e.onPaste,onCompositionEnd:e.onCompositionEnd,onCompositionStart:e.onCompositionStart,onCompositionUpdate:e.onCompositionUpdate,onSelect:e.onSelect,onBeforeInput:e.onBeforeInput,onInput:e.onInput,...c,...y}),descriptionProps:g,errorMessageProps:b,isInvalid:p,validationErrors:f,validationDetails:h}}(e,r),c=(0,pq.useRef)(null);return{inputProps:y8(a,{onBeforeInput:i,onCompositionStart(){let{value:e,selectionStart:t,selectionEnd:n}=r.current;c.current={value:e,selectionStart:t,selectionEnd:n}},onCompositionEnd(){if(r.current&&!t.validate(r.current.value)){let{value:e,selectionStart:n,selectionEnd:i}=c.current;r.current.value=e,r.current.setSelectionRange(n,i),t.setInputValue(e)}}}),labelProps:o,descriptionProps:s,errorMessageProps:l,...u}}({...A,...eo,name:void 0,form:void 0,label:E,autoFocus:x,isDisabled:y,isReadOnly:g,isRequired:b,validate:void 0,[xb]:t,value:F,defaultValue:"!",autoComplete:"off","aria-label":e["aria-label"]||void 0,"aria-labelledby":e["aria-labelledby"]||void 0,id:K,type:"text",inputMode:ei,onChange:e=>{t.validate(e)&&t.setInputValue(e)},onBlur:D,onFocus:O,onFocusChange:P,onKeyDown:(0,pq.useMemo)(()=>yH(ea,C),[ea,C]),onKeyUp:k,onPaste:t=>{e.onPaste?.(t);let r=g_(t);r&&(r.selectionEnd??-1)-(r.selectionStart??0)===r.value.length&&(t.preventDefault(),B(t.clipboardData?.getData?.("text/plain")?.trim()??""))},description:j,errorMessage:T},t,r);xs(r,t.defaultNumberValue,t.setNumberValue),i=t,o=e.validationBehavior,a=e.commitBehavior,s=r,l=t.minValue,u=t.maxValue,c=e.step,d=t.numberValue,yz(()=>{let e=s.current;if("validate"!==a||i.realtimeValidation.isInvalid||!e||e.disabled||(!Dn&&"u">typeof document&&((Dn=document.createElement("input")).type="number"),!Dn))return;Dn.min=null==l||isNaN(l)?"":String(l),Dn.max=null==u||isNaN(u)?"":String(u),Dn.step=null==c||isNaN(c)?"":String(c),Dn.value=null==d||isNaN(d)?"":String(d);let t=e.validity.valid&&Dn.validity.valid,r=e.validationMessage||Dn.validationMessage,n={isInvalid:!t,validationErrors:r?[r]:[],validationDetails:{badInput:e.validity.badInput,customError:e.validity.customError,patternMismatch:e.validity.patternMismatch,rangeOverflow:Dn.validity.rangeOverflow,rangeUnderflow:Dn.validity.rangeUnderflow,stepMismatch:Dn.validity.stepMismatch,tooLong:e.validity.tooLong,tooShort:e.validity.tooShort,typeMismatch:e.validity.typeMismatch,valueMissing:e.validity.valueMissing,valid:t}};i.updateValidation(n),"native"!==o||Dn.validity.valid||e.setCustomValidity(Dn.validationMessage)});let eh=y8(Z,H,ed,{role:null,"aria-roledescription":gV()?null:U.format("numberField"),"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null,autoCorrect:"off",spellCheck:"false"});"native"===e.validationBehavior&&(eh["aria-required"]=void 0);let em=e=>{((e=document)=>e.activeElement)()!==r.current&&("mouse"===e.pointerType?r.current?.focus():e.target.focus())},ey=e["aria-label"]||("string"==typeof e.label?e.label:"");ey||(p=null!=e.label?ec.id:e["aria-labelledby"]);let eg=y2(),eb=y2(),ev=y8(J,{"aria-label":m||U.format("increase",{fieldLabel:ey}).trim(),id:p&&!m?eg:null,"aria-labelledby":p&&!m?`${eg} ${p}`:null,"aria-controls":K,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!t.canIncrement,onPressStart:em}),ew=y8(X,{"aria-label":h||U.format("decrease",{fieldLabel:ey}).trim(),id:p&&!h?eb:null,"aria-labelledby":p&&!h?`${eb} ${p}`:null,"aria-controls":K,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!t.canDecrement,onPressStart:em});return{groupProps:{...et,role:"group","aria-disabled":y,"aria-invalid":es?"true":void 0},labelProps:ec,inputProps:eh,incrementButtonProps:ev,decrementButtonProps:ew,errorMessageProps:ef,descriptionProps:ep,isInvalid:es,validationErrors:el,validationDetails:eu}}({...gi(e),label:c,validationBehavior:o},s,l),v=ge({...e,values:{state:s,isDisabled:e.isDisabled||!1,isInvalid:b.isInvalid||!1,isRequired:e.isRequired||!1},defaultClassName:"react-aria-NumberField"}),w=gm(e);return delete w.id,pY().createElement(y7,{values:[[Ds,s],[_U,p],[_K,{...f,ref:l}],[x6,{...d,ref:u}],[bK,{slots:{increment:h,decrement:m}}],[bG,{slots:{description:y,errorMessage:g}}],[x1,b]]},pY().createElement("div",{...w,...v,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-required":e.isRequired||void 0,"data-invalid":b.isInvalid||void 0}),e.name&&pY().createElement("input",{type:"hidden",name:e.name,value:isNaN(s.numberValue)?"":s.numberValue}))});function Du(e,t){return Number.parseInt(SH(e,{calendar:t.calendar,locale:t.baseName,day:!1,month:!1,noToday:!0,numberingSystem:"latn"}))}let Dc=(0,pq.forwardRef)(function(e,t){let{className:r}=e,n=(0,pq.useContext)(_R),i=(0,pq.useContext)(_A),o=n??i,a=(0,pq.useContext)(S2),s=wc(),l=SH(o.visibleRange.start.toDate(s),{calendar:a.calendar,locale:a.baseName,day:!1,year:!1,noToday:!0}),u=Du(o.visibleRange.start.toDate(s),a),c=o.maxValue?Du(o.maxValue.toDate(s),a):void 0,d=o.minValue?Du(o.minValue.toDate(s),a):void 0,p=(0,pq.useCallback)(e=>{o.setFocusedDate(o.focusedDate.cycle("year",e-o.focusedDate.year))},[]);return o&&(0,hq.jsxs)("span",{ref:t,className:r,children:[(0,hq.jsx)("span",{children:l}),(0,hq.jsxs)(Dl,{formatOptions:{useGrouping:!1},maxValue:c,minValue:d,onChange:p,value:u,children:[(0,hq.jsx)(_H,{}),(0,hq.jsxs)(_W,{children:[(0,hq.jsx)(bH,{slot:"increment",children:(0,hq.jsx)(mg,{size:8})}),(0,hq.jsx)(bH,{slot:"decrement",children:(0,hq.jsx)(mh,{size:8})})]})]})]})}),Dd="-esm-billing__datepicker-module__inputGroup___-wpzr",Dp="-esm-billing__datepicker-module__inputSegment___ocu7L",Df="-esm-billing__datepicker-module__dateInputWrapper___909Km",Dh="-esm-billing__datepicker-module__invalidText___oHJHi",Dm="-esm-billing__datepicker-module__flatButton___i9LDo",Dy="-esm-billing__datepicker-module__flatButtonMd___VZMkc",Dg="-esm-billing__datepicker-module__flatButtonSm___VA5wy",Db="-esm-billing__datepicker-module__flatButtonLg___MnYLl";function Dv({children:e}){let t=(0,pq.useContext)(E3),r=(0,pq.useContext)(E4),n=t??r,i=hy(()=>n?.close());return(0,hq.jsx)(x0,{className:"-esm-billing__datepicker-module__dialog___2pADb",ref:i,children:e})}let Dw=(0,pq.forwardRef)(function({variant:e,today_:t,minDate:r,maxDate:n},i){let o="range"===e;return(0,hq.jsx)(EJ,{ref:i,className:"-esm-billing__datepicker-module__popover___pb58i",placement:"bottom start",offset:1,isNonModal:!0,children:(0,hq.jsx)(Dv,{children:(0,hq.jsxs)(o?_M:_N,{...o?{minValue:r,maxValue:n,className:"cds--date-picker__calendar"}:{},children:[(0,hq.jsxs)("header",{className:"-esm-billing__datepicker-module__header___+fi16",children:[(0,hq.jsx)(bH,{className:hZ()(Dm,Dy),slot:"previous",children:(0,hq.jsx)(mS,{size:16})}),(0,hq.jsx)(Dc,{className:"-esm-billing__datepicker-module__monthYear___mGhot"}),(0,hq.jsx)(bH,{className:hZ()(Dm,Dy),slot:"next",children:(0,hq.jsx)(mD,{size:16})})]}),(0,hq.jsx)(_$,{className:"-esm-billing__datepicker-module__calendarGrid___z07wV",children:e=>(0,hq.jsx)(_V,{className:hZ()("cds--date-picker__day",{"-esm-billing__datepicker-module__today___dNc4M":0===t.compare(e)}),date:e},e.toString())})]})})})}),D_=(0,pq.forwardRef)(function(e,t){let r=(0,pq.useContext)(E3),[n,i]=gr({slot:e.slot},t,xU),{locale:o}=b9(),a=xV({...n,locale:o,createCalendar:_m}),s=(0,pq.useRef)(null),{fieldProps:l,inputProps:u}=xp({...n,inputRef:s},a,i),c=(0,pq.useCallback)(()=>{a.isDisabled||r.toggle()},[]);return(0,hq.jsxs)(y7,{values:[[xW,a],[_K,{...u,ref:s}],[_U,{...l,ref:i,isInvalid:a.isInvalid}]],children:[(0,hq.jsx)(_W,{...e,id:e.id,ref:t,slot:e.slot||void 0,className:e.className,isDisabled:a.isDisabled,isInvalid:a.isInvalid,onClick:c,children:a.segments.map((t,r)=>(0,pq.cloneElement)(e.children(t),{key:r}))}),(0,hq.jsx)(_H,{})]})}),Dx=(0,pq.forwardRef)(function(e,t){let r=(0,pq.useContext)(E3),n=(0,pq.useContext)(E4);return(r??n).isInvalid?(0,hq.jsx)(yR,{ref:t,size:16,...e}):(0,hq.jsx)(mf,{ref:t,size:16,...e})});class DE{constructor(e,t){this.locale=e,this.dictionary=t}of(e){return this.dictionary.getStringForLocale(e,this.locale)}}let DS=new Map,DD=(0,pq.forwardRef)(function({segment:e,...t},r){let n=(0,pq.useContext)(xW),i=yU(r),{segmentProps:o}=function(e,t,r){let n,i,o,a,s=(0,pq.useRef)(""),{locale:l,direction:u}=b9(),c=function(){var e;let{locale:t}=b9(),r=vv((e=xn)&&e.__esModule?e.default:e,"@react-aria/datepicker");return(0,pq.useMemo)(()=>{try{return new Intl.DisplayNames(t,{type:"dateTimeField"})}catch{return new DE(t,r)}},[t,r])}(),{ariaLabel:d,ariaLabelledBy:p,ariaDescribedBy:f,focusManager:h}=xu.get(t),m=e.isPlaceholder?"":e.text,y=(0,pq.useMemo)(()=>t.dateFormatter.resolvedOptions(),[t.dateFormatter]),g=vc({month:"long",timeZone:y.timeZone}),b=vc({hour:"numeric",hour12:y.hour12,timeZone:y.timeZone});if("month"!==e.type||e.isPlaceholder)"hour"!==e.type||e.isPlaceholder||(m=b.format(t.dateValue));else{let e=g.format(t.dateValue);m=e!==m?`${m} \u{2013} ${e}`:e}let{spinButtonProps:v}=Dr({value:e.value??void 0,textValue:m,minValue:e.minValue,maxValue:e.maxValue,isDisabled:t.isDisabled,isReadOnly:t.isReadOnly||!e.isEditable,isRequired:t.isRequired,onIncrement:()=>{s.current="",t.increment(e.type)},onDecrement:()=>{s.current="",t.decrement(e.type)},onIncrementPage:()=>{s.current="",t.incrementPage(e.type)},onDecrementPage:()=>{s.current="",t.decrementPage(e.type)},onIncrementToMax:()=>{s.current="",t.incrementToMax(e.type)},onDecrementToMin:()=>{s.current="",t.decrementToMin(e.type)}}),w=(0,pq.useMemo)(()=>new(0,Di.d)(l,{maximumFractionDigits:0}),[l]),x=()=>{if(e.text===e.placeholder&&h.focusPrevious(),!w.isValidPartialNumber(e.text)||t.isReadOnly||e.isPlaceholder)("dayPeriod"===e.type||"era"===e.type)&&t.clearSegment(e.type);else{let r=e.text.slice(0,-1),n=w.parse(r);0===(r=0===n?"":r).length||0===n?t.clearSegment(e.type):t.setSegment(e.type,n),s.current=r}},{startsWith:E}=(n=function(e){let{locale:t}=b9(),r=t+(e?Object.entries(e).sort((e,t)=>e[0]<t[0]?-1:1).join():"");if(DS.has(r))return DS.get(r);let n=new Intl.Collator(t,e);return DS.set(r,n),n}({usage:"search",sensitivity:"base"}),i=(0,pq.useCallback)((e,t)=>0===t.length||(e=e.normalize("NFC"),t=t.normalize("NFC"),0===n.compare(e.slice(0,t.length),t)),[n]),o=(0,pq.useCallback)((e,t)=>0===t.length||(e=e.normalize("NFC"),t=t.normalize("NFC"),0===n.compare(e.slice(-t.length),t)),[n]),a=(0,pq.useCallback)((e,t)=>{if(0===t.length)return!0;e=e.normalize("NFC");let r=0,i=(t=t.normalize("NFC")).length;for(;r+i<=e.length;r++){let o=e.slice(r,r+i);if(0===n.compare(t,o))return!0}return!1},[n]),(0,pq.useMemo)(()=>({startsWith:i,endsWith:o,contains:a}),[i,o,a])),S=vc({hour:"numeric",hour12:!0}),D=(0,pq.useMemo)(()=>{let e=new Date;return e.setHours(0),S.formatToParts(e).find(e=>"dayPeriod"===e.type).value},[S]),O=(0,pq.useMemo)(()=>{let e=new Date;return e.setHours(12),S.formatToParts(e).find(e=>"dayPeriod"===e.type).value},[S]),P=vc({year:"numeric",era:"narrow",timeZone:"UTC"}),C=(0,pq.useMemo)(()=>{if("era"!==e.type)return[];let r=v9(new vq(1,1,1),t.calendar),n=t.calendar.getEras().map(e=>{let t=r.set({year:1,month:1,day:1,era:e}).toDate("UTC");return{era:e,formatted:P.formatToParts(t).find(e=>"era"===e.type).value}}),i=function(e){e.sort();let t=e[0],r=e[e.length-1];for(let e=0;e<t.length;e++)if(t[e]!==r[e])return e;return 0}(n.map(e=>e.formatted));if(i)for(let e of n)e.formatted=e.formatted.slice(i);return n},[P,t.calendar,e.type]),k=r=>{if(t.isDisabled||t.isReadOnly)return;let n=s.current+r;switch(e.type){case"dayPeriod":if(E(D,r))t.setSegment("dayPeriod",0);else if(E(O,r))t.setSegment("dayPeriod",1);else break;h.focusNext();break;case"era":{let e=C.find(e=>E(e.formatted,r));e&&(t.setSegment("era",e.era),h.focusNext());break}case"day":case"hour":case"minute":case"second":case"month":case"year":{if(!w.isValidPartialNumber(n))return;let i=w.parse(n),o=i;if(void 0!==e.maxValue&&i>e.maxValue&&(o=w.parse(r)),isNaN(i))return;t.setSegment(e.type,o),void 0!==e.maxValue&&(Number(i+"0")>e.maxValue||n.length>=String(e.maxValue).length)?(s.current="",h.focusNext()):s.current=n}}};wk((0,pq.useRef)("u">typeof document?document:null),"selectionchange",()=>{let e=window.getSelection();e?.anchorNode&&gw(r.current,e?.anchorNode)&&e.collapse(r.current)});let j=(0,pq.useRef)("");wk(r,"beforeinput",n=>{if(r.current)switch(n.preventDefault(),n.inputType){case"deleteContentBackward":case"deleteContentForward":w.isValidPartialNumber(e.text)&&!t.isReadOnly&&x();break;case"insertCompositionText":j.current=r.current.textContent,r.current.textContent=r.current.textContent;break;default:null!=n.data&&k(n.data)}}),wk(r,"input",e=>{let{inputType:t,data:n}=e;"insertCompositionText"===t&&(r.current&&(r.current.textContent=j.current),null!=n&&(E(D,n)||E(O,n))&&k(n))}),yz(()=>{let e=r.current;return()=>{((e=document)=>e.activeElement)()===e&&(h.focusPrevious()||h.focusNext())}},[r,h]);let T=gV()||"timeZoneName"===e.type?{role:"textbox","aria-valuemax":null,"aria-valuemin":null,"aria-valuetext":null,"aria-valuenow":null}:{};e===(0,pq.useMemo)(()=>t.segments.find(e=>e.isEditable),[t.segments])||t.isInvalid||(f=void 0);let R=y2(),A=!t.isDisabled&&!t.isReadOnly&&e.isEditable,N="literal"===e.type?"":c.of(e.type),M=wS({"aria-label":`${N}${d?`, ${d}`:""}${p?", ":""}`,"aria-labelledby":p});if("literal"===e.type)return{segmentProps:{"aria-hidden":!0}};let I={caretColor:"transparent"};if("rtl"===u){I.unicodeBidi="embed";let t=y[e.type];("numeric"===t||"2-digit"===t)&&(I.direction="ltr")}return{segmentProps:y8(v,M,{id:R,...T,"aria-invalid":t.isInvalid?"true":void 0,"aria-describedby":f,"aria-readonly":t.isReadOnly||!e.isEditable?"true":void 0,"data-placeholder":e.isPlaceholder||void 0,contentEditable:A,suppressContentEditableWarning:A,spellCheck:A?"false":void 0,autoCorrect:A?"off":void 0,[parseInt(pY().version,10)>=17?"enterKeyHint":"enterkeyhint"]:A?"next":void 0,inputMode:t.isDisabled||"dayPeriod"===e.type||"era"===e.type||!A?void 0:"numeric",tabIndex:t.isDisabled?void 0:0,onKeyDown:e=>{if("a"===e.key&&(gL()?e.metaKey:e.ctrlKey)&&e.preventDefault(),!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey)switch(e.key){case"Backspace":case"Delete":e.preventDefault(),e.stopPropagation(),x()}},onFocus:()=>{s.current="",r.current&&wN(r.current,{containingElement:wT(r.current)});let e=window.getSelection();e?.collapse(r.current)},style:I,onPointerDown(e){e.stopPropagation()},onMouseDown(e){e.stopPropagation()}})}}(e,n,i),{focusProps:a,isFocused:s,isFocusVisible:l}=bM(),{hoverProps:u,isHovered:c}=bB({...t,isDisabled:n.isDisabled||"literal"===e.type}),d=function(e){let{className:t,style:r,children:n,defaultClassName:i,defaultChildren:o,defaultStyle:a,values:s}=e;return(0,pq.useMemo)(()=>{let e,l,u;return e="function"==typeof t?t({...s,defaultClassName:i}):t,l="function"==typeof r?r({...s,defaultStyle:a||{}}):r,u="function"==typeof n?n({...s,defaultChildren:o}):null==n?o:n,{className:e??i,style:l||a?{...a,...l}:void 0,children:u??o,"data-rac":""}},[t,r,n,i,o,a,s])}({...t,values:{...e,isReadOnly:!e.isEditable,isInvalid:n.isInvalid,isDisabled:n.isDisabled,isHovered:c,isFocused:s,isFocusVisible:l},defaultChildren:e.text}),p=(0,pq.useCallback)(e=>{e.stopPropagation()},[]);return(0,hq.jsx)("span",{...y8(gm(t),o,a,u),...d,ref:i,style:o.style,"data-placeholder":e.isPlaceholder||void 0,"data-invalid":n.isInvalid||void 0,"data-readonly":!e.isEditable||void 0,"data-disabled":n.isDisabled||void 0,"data-type":e.type,"data-hovered":c||void 0,"data-focused":s||void 0,"data-focus-visible":l||void 0,onClick:p})}),DO={short:!1,size:"md"},DP=(0,pq.forwardRef)(function(e,t){let{className:r,defaultValue:n,isDisabled:i,invalid:o,invalidText:a,isInvalid:s,label:l,labelText:u,light:c,maxDate:d,minDate:p,onChange:f,onChangeRaw:h,short:m,size:y,value:g,...b}={...DO,...e},{calendar:v,intlLocale:w,today_:x}=S6(),E=(0,pq.useId)(),S=!!(u??l),D=(0,pq.useMemo)(()=>E8(n,v),[n,v]),O=(0,pq.useMemo)(()=>E8(g,v,!0),[g,v]),P=(0,pq.useMemo)(()=>E8(d,v),[d,v]),C=(0,pq.useMemo)(()=>E8(p??S5,v),[p,v]),k=(0,pq.useMemo)(()=>o||s,[o,s]),j=(0,pq.useMemo)(()=>(h&&f&&console.error("An OpenmrsDatePicker component was created with both onChange and onChangeRaw handlers defined. Only onChangeRaw will be used."),h??(e=>f?.(E9(e)))),[h,f]);return(0,hq.jsx)(E5,{locale:w.toString(),children:(0,hq.jsx)("div",{className:hZ()("cds--form-item",r),children:(0,hq.jsx)(y7,{values:[[S2,w]],children:(0,hq.jsxs)(E2,{className:hZ()("cds--date-picker","cds--date-picker--single",{"cds--date-picker--short":m,"cds--date-picker--light":c}),defaultValue:D,isDisabled:i,isInvalid:k,maxValue:P,minValue:C,value:O,shouldForceLeadingZeros:"en"===w.language||void 0,...b,onChange:j,children:[(0,hq.jsxs)("div",{className:"cds--date-picker-container",children:[S&&(0,hq.jsx)(x5,{className:hZ()("cds--label",{"cds--label--disabled":i}),htmlFor:E,children:u??l}),(0,hq.jsxs)(_W,{className:Dd,children:[(0,hq.jsx)(D_,{id:S?E:void 0,ref:t,className:hZ()("cds--date-picker-input__wrapper","-esm-billing__datepicker-module__inputWrapper___MHJAy",{"-esm-billing__datepicker-module__inputWrapperSm___esx4E":"sm"===y,"-esm-billing__datepicker-module__inputWrapperMd___VQbzP":"md"===y||!y||0===y.length,"-esm-billing__datepicker-module__inputWrapperLg___Rk9Ce":"lg"===y}),children:e=>"era"!==e.type?(0,hq.jsx)(DD,{className:Dp,segment:e}):(0,hq.jsx)(pY().Fragment,{})}),(0,hq.jsx)(bH,{className:hZ()(Dm,{[Dg]:"sm"===y,[Dy]:"md"===y||!y||0===y.length,[Db]:"lg"===y}),children:(0,hq.jsx)(Dx,{})})]}),(0,hq.jsx)(x3,{className:Dh,children:a})]}),(0,hq.jsx)(Dw,{variant:"single",today_:x})]})})})})}),DC=(0,pq.forwardRef)(function({className:e,defaultValue:t,invalid:r,invalidText:n,isDisabled:i,isInvalid:o,label:a,labelText:s,light:l,maxDate:u,minDate:c,onChange:d,onChangeRaw:p,size:f="md",value:h,...m},y){let{calendar:g,intlLocale:b,today_:v}=S6(),w=(0,pq.useId)(),x=!!(s??a),E=(0,pq.useMemo)(()=>{if(h)return{start:E8(h[0],g,!1),end:E8(h[1],g,!1)}},[h,g]),S=(0,pq.useMemo)(()=>{if(t)return{start:E8(t[0],g,!1),end:E8(t[1],g,!1)}},[t,g]),D=(0,pq.useMemo)(()=>E8(c??S5,g,!0),[c,g]),O=(0,pq.useMemo)(()=>E8(u,g,!0),[u,g]),P=(0,pq.useMemo)(()=>r||o,[r,o]),C=(0,pq.useMemo)(()=>(p&&d&&console.error("An OpenmrsDateRangePicker component was created with both onChange and onChangeRaw handlers defined. Only onChangeRaw will be used."),p??(e=>d?.([E9(e.start),E9(e.end)]))),[p,d]);return(0,hq.jsx)(E5,{locale:b.toString(),children:(0,hq.jsx)("div",{className:hZ()("cds--form-item",e),children:(0,hq.jsx)(y7,{values:[[S2,b]],children:(0,hq.jsx)(E6,{id:x?w:void 0,className:hZ()("cds--date-picker",{"cds--date-picker--light":l,"cds--date-picker--disabled":i}),isInvalid:P,shouldForceLeadingZeros:"en"===b.language||void 0,maxValue:O,minValue:D,value:E,defaultValue:S,ref:y,isDisabled:i,...m,onChange:C,children:(0,hq.jsxs)("div",{className:"cds--date-picker-container",children:[x&&(0,hq.jsx)(x5,{className:hZ()("cds--label",{"cds--label--disabled":i}),htmlFor:w,children:s??a}),(0,hq.jsxs)(_W,{className:Dd,children:[(0,hq.jsxs)("div",{className:hZ()("-esm-billing__datepicker-module__inputsWrapper___UyGoG",{"-esm-billing__datepicker-module__inputsWrapperSm___qrGsA":"sm"===f,"-esm-billing__datepicker-module__inputsWrapperMd___pofu4":"md"===f||!f||0===f.length,"-esm-billing__datepicker-module__inputsWrapperLg___eF1Im":"lg"===f}),children:[(0,hq.jsx)(xH,{className:hZ()("cds--date-picker-input__wrapper","-esm-billing__datepicker-module__startInput___C8vnM",Df),slot:"start",children:e=>(0,hq.jsx)(DD,{className:Dp,segment:e})}),(0,hq.jsx)("div",{className:"-esm-billing__datepicker-module__separator___vHLFZ",children:(0,hq.jsx)("span",{"aria-hidden":"true","data-readonly":!0,children:"–"})}),(0,hq.jsx)(xH,{className:hZ()("cds--date-picker-input__wrapper","-esm-billing__datepicker-module__endInput___25OF9",Df),slot:"end",children:e=>(0,hq.jsx)(DD,{className:Dp,segment:e})})]}),(0,hq.jsx)(bH,{className:hZ()(Dm,{[Dg]:"sm"===f,[Dy]:"md"===f||!f||0===f.length,[Db]:"lg"===f}),children:(0,hq.jsx)(Dx,{})})]}),(0,hq.jsx)(x3,{className:Dh,children:n}),(0,hq.jsx)(Dw,{variant:"range",today_:v,minDate:D,maxDate:O})]})})})})})}),Dk=({diagnoses:e})=>{let{diagnosisTags:t}=fG({externalModuleName:"@openmrs/esm-styleguide"});return(0,hq.jsx)("div",{className:"-esm-billing__diagnosis-tags-module__container___l7XiW",children:e.map(e=>{let{rank:r,uuid:n,display:i}=e,o=t[1===r?"primaryColor":"secondaryColor"];return(0,hq.jsx)(h1.vwO,{type:o,children:i},n)})})},Dj={action:"-esm-billing__empty-card-module__action___l4wUo",content:"-esm-billing__empty-card-module__content___XbsSJ",desktopHeading:"-esm-billing__empty-card-module__desktopHeading___0EPXX",tabletHeading:"-esm-billing__empty-card-module__tabletHeading___unl1F",tile:"-esm-billing__empty-card-module__tile___vS3Sj"},DT=({width:e="64",height:t="64"})=>(0,hq.jsx)("svg",{width:e,height:t,viewBox:"0 0 64 64",children:(0,hq.jsx)("use",{href:"#omrs-empty-data-illustration"})}),DR=e=>{let t="tablet"===hd(),r=e.launchForm;return(0,hq.jsx)(h1.Wdr,{className:Dj.layer,children:(0,hq.jsxs)(h1.FAs,{className:Dj.tile,children:[(0,hq.jsx)("div",{className:t?Dj.tabletHeading:Dj.desktopHeading,children:(0,hq.jsx)("h4",{children:e.headerTitle})}),(0,hq.jsx)(DT,{}),(0,hq.jsx)("p",{className:Dj.content,children:i8("emptyStateText","There are no {{displayText}} to display",{displayText:e.displayText})}),(0,hq.jsx)("p",{className:Dj.action,children:r&&(0,hq.jsx)(h1.$nd,{onClick:()=>r(),kind:"ghost",size:t?"lg":"sm",children:i8("recordNewEntry","Record {{ displayText }}",{displayText:e.displayText})})})]})})},DA=({error:e,headerTitle:t})=>{let r="tablet"===hd();return(0,hq.jsx)(h1.Wdr,{children:(0,hq.jsxs)(h1.FAs,{className:"-esm-billing__error-state-module__tile___hHM56",children:[(0,hq.jsx)("div",{className:r?"-esm-billing__error-state-module__tabletHeading___W7a4U":"-esm-billing__error-state-module__desktopHeading___VL8Rv",children:(0,hq.jsx)("h4",{children:t})}),(0,hq.jsxs)("p",{className:"-esm-billing__error-state-module__errorMessage___IytZy",children:[i8("error","Error")," ",`${e?.response?.status}: `,e?.response?.statusText]}),(0,hq.jsx)("p",{className:"-esm-billing__error-state-module__errorCopy___E1yZO",children:i8("errorCopy")})]})})},DN=DA,DM=pY().forwardRef((e,t)=>{let{slotName:r,basePath:n,componentContext:i,state:o}=hh(),a=window.location??{pathname:""},s=p7(r??"");return e.isChildOfHeader&&r&&s.length>0?(0,hq.jsxs)(h1.f8J,{"aria-label":i8("leftNavigation","Left navigation"),className:"-esm-billing__left-nav-module__leftNav___ZqLpw",expanded:!0,isFixedNav:!0,ref:t,...e,children:[(0,hq.jsx)(fr,{name:"global-nav-menu-slot"}),r?(0,hq.jsx)(f$,{value:i,fallback:(0,hq.jsx)(fr,{name:r,state:{basePath:n,currentPath:a,...o}}),children:(0,hq.jsx)(pZ.Provider,{value:i,children:(0,hq.jsx)(fr,{name:r,state:{basePath:n,currentPath:a,...o}})})}):null]}):null}),DI=({selectedLocationUuid:e,defaultLocationUuid:t,locationTag:r,locationsPerRequest:n=50,onChange:i})=>{let[o,a]=(0,pq.useState)(""),s=(0,pq.useId)(),{location:l}=function(e){let t=e?`/ws/fhir2/R4/Location?_id=${e}`:null,{data:r,error:n,isLoading:i}=fX()(t,oh,{shouldRetryOnError:e=>!!e?.response?.status&&e.response.status>=500});return(0,pq.useMemo)(()=>({location:r?.data?.entry?r.data.entry[0]:null,error:t?n:null,isLoading:!!t&&i}),[r,i,n,t])}(t),{locations:u,isLoading:c,hasMore:d,loadingNewData:p,error:f,setPage:h}=function(e,t=0,r=""){let n=fZ(r),{data:i,isLoading:o,isValidating:a,setSize:s,error:l}=hn()(function(r,i){if(i){let e=i.data?.link?.find(e=>"next"===e.relation);if(!e)return null;let t=new URL(e.url);return t.origin===window.location.origin?e.url:new URL(`${t.pathname}${t.search?`?${t.search}`:""}`,window.location.origin).toString()}let o=`${od}/Location?`,a=new URLSearchParams;return a.append("_summary","data"),t&&a.append("_count",""+t),r&&a.append("_getpagesoffset",""+r*t),e&&a.append("_tag",e),"string"==typeof n&&""!==n&&a.append("name:contains",n),o+a.toString()},oh);return(0,pq.useMemo)(()=>({locations:i?.length?i?.flatMap(e=>e?.data?.entry??[]):[],isLoading:o,totalResults:i?.[0]?.data?.total,hasMore:!!i?.length&&i?.[i.length-1]?.data?.link?.some(e=>"next"===e.relation),loadingNewData:a,error:l||null,setPage:s}),[o,i,a,s,l])}(r,n,o),m=(0,pq.useMemo)(()=>l&&!o&&t?[l,...u.filter(({resource:e})=>e.id!==t)]:u??[],[l,u,t,o]),y=(0,pq.useCallback)(e=>{i(),a(e.trim())},[i]),g=hg((0,pq.useCallback)(()=>{!p&&d&&h(e=>e+1)},[p,d,h])),b=d?Math.max(0,Math.floor(m.length-n/2)):-1;return(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsx)(h1.vji,{"aria-describedby":f?`${s}-error`:void 0,labelText:i8("searchForLocation"),id:s,placeholder:i8("searchForLocation"),onChange:e=>y(e.target.value),size:"lg"}),f&&(0,hq.jsx)("div",{className:"-esm-billing__location-picker-module__errorNotification___MBWvf",id:`${s}-error`,children:(0,hq.jsx)(h1.jeF,{kind:"error",subtitle:i8("errorLoadingLoginLocations","Unable to load login locations. Please try again or contact support if the problem persists."),title:i8("error","Error")})}),(0,hq.jsx)("div",{className:"-esm-billing__location-picker-module__searchResults___aCL93",children:c?(0,hq.jsx)("div",{className:"-esm-billing__location-picker-module__loadingContainer___Vn1H0",children:Array.from({length:5}).map((e,t)=>(0,hq.jsx)(h1.Psq,{className:"-esm-billing__location-picker-module__radioButtonSkeleton___RKMHj",role:"progressbar"},t))}):(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsx)("div",{className:"-esm-billing__location-picker-module__locationResultsContainer___5yuvs",children:m.length>0?(0,hq.jsx)(h1.zWQ,{name:"loginLocations",onChange:e=>{i(e?.toString())},orientation:"vertical",valueSelected:e,children:m.map((e,t)=>(0,hq.jsx)(h1.aaP,{className:"-esm-billing__location-picker-module__locationRadioButton___b52LI",id:e.resource.id,labelText:(0,hq.jsx)("span",{ref:t===b?g:null,children:e.resource.name}),name:e.resource.name,value:e.resource.id},e.resource.id))}):(0,hq.jsx)("div",{className:"-esm-billing__location-picker-module__emptyState___qiPqQ",children:(0,hq.jsx)("p",{className:"-esm-billing__location-picker-module__locationNotFound___tKDOJ",children:i8("noResultsToDisplay")})})}),p&&(0,hq.jsx)("div",{className:"-esm-billing__location-picker-module__loadingIcon___PGwvc",children:(0,hq.jsx)(h1.OuH,{description:i8("loading")})})]})})]})},D$=Y("modalState",{modalContainer:null,modalStack:[]}),DL=0;async function DF(e,t,r={}){let n=pD(t),i=null;if(e){if(!n)throw Error(`No modal named '${t}' has been registered.`);let{load:o}=n,a=await o(),s=DL++;i=await pK({...a,name:`${t}-${s}`},{...r,domElement:e})}else I(`Failed to launch modal. Please notify your administrator. Modal name: ${t}`);return i}function DB(e){return"TO_BE_DELETED"===e.state||"DELETED"===e.state}function DV(e,t){t?.unmount&&(t.unmountPromise?.catch(()=>{}),t.unmount().catch(t=>{console.error(`The modal '${e}' failed to unmount`,t)}))}function DU(e){return e.find(e=>!DB(e))}function DW(e,t){e.container&&(e.container.style.visibility=t?"unset":"hidden")}let DK=window.getComputedStyle(document.body).overflow;function DH({modalStack:e,modalContainer:t}){if(t)if(e.length){t.style.visibility||(addEventListener("keydown",DG),document.body.style.overflow="hidden",t.style.visibility="unset");let r=DU(e);e.forEach(e=>{switch(e.state){case"NEW":{let r=function({size:e}){let t=document.createElement("div");return t.className=`cds--modal-container cds--modal-container--${e}`,t.setAttribute("role","dialog"),t.setAttribute("tabindex","-1"),t.setAttribute("aria-modal","true"),t}({size:e.props?.size??"md"});e.container=r,e.state="MOUNTING",DF(r,e.modalName,e.props).then(n=>{DB(e)?DV(e.modalName,n):n?(e.parcel=n,t.prepend(r),DW(e,DU(D$.getState().modalStack)===e),n.mountPromise.then(()=>{DB(e)||(e.state="MOUNTED")},t=>{I(t),e.parcel=null,Dz(e)})):Dz(e)},t=>{I(t),Dz(e)});break}case"MOUNTING":case"MOUNTED":DW(e,e===r);break;case"TO_BE_DELETED":e.state="DELETED",e.onClose(),DV(e.modalName,e.parcel),e.container?.remove(),setTimeout(()=>{let t=D$.getState();D$.setState({...t,modalStack:t.modalStack.filter(t=>t!==e)})},0)}})}else t.style.removeProperty("visibility"),document.body.style.overflow=DK,removeEventListener("keydown",DG)}function Dz(e){if(DB(e))return;e.state="TO_BE_DELETED";let t=D$.getState();D$.setState({...t,modalStack:[...t.modalStack]})}function DG(e){"Escape"===e.key&&function(){let[e]=D$.getState().modalStack;e&&Dz(e)}()}function Dq(e){D$.subscribe(DH),D$.setState({...D$.getState(),modalContainer:e})}function DY(e,t={},r=()=>{}){let n=()=>{let e=D$.getState().modalStack.find(e=>e.onClose===r);e&&Dz(e)};if(pD(e)){var i;let o,a;i={state:"NEW",onClose:r,modalName:e,props:{close:n,...t}},a=[i,...(o=D$.getState()).modalStack],D$.setState({...o,modalStack:a})}else I(`Failed to launch modal. Please notify your administrator. Modal name: "${e}"`);return n}let DZ=({notification:e})=>{let{description:t,action:r,kind:n,critical:i,title:o,onAction:a}=e;return(0,hq.jsx)(h1.kZS,{actionButtonLabel:r,kind:n||"info",lowContrast:i,subtitle:t,title:o||"",inline:!0,onActionButtonClick:a})},DJ=({subject:e})=>{let[t,r]=(0,pq.useState)([]);return(0,pq.useEffect)(()=>{let t=e.subscribe(e=>r(t=>[...t.filter(t=>t.description!==e.description||t.action!==e.action||t.kind!==e.kind||t.title!==e.title),e]));return()=>t.unsubscribe()},[e]),(0,hq.jsx)(hq.Fragment,{children:t.map(e=>(0,hq.jsx)(DZ,{notification:e},e.id))})},DX=({notification:e})=>{let{actionButtonLabel:t,onActionButtonClick:r=()=>{},subtitle:n,kind:i,title:o,critical:a,progressActionLabel:s,id:l,...u}=e,[c,d]=(0,pq.useState)(t);return(0,hq.jsx)(h1.kZS,{kind:i||"info",actionButtonLabel:c,ariaLabel:i8("closesActionableNotification","Closes actionable notification"),onActionButtonClick:()=>{r(),s&&d(s)},statusIconDescription:i8("actionableNotification","Actionable notification"),subtitle:n,title:o,lowContrast:a,inline:!0,...u})},DQ=({subject:e})=>{let[t,r]=(0,pq.useState)([]);return(0,pq.useEffect)(()=>{let t=e.subscribe(e=>r(t=>[...t.filter(t=>t.subtitle!==e.subtitle||t.actionButtonLabel!==e.actionButtonLabel||t.onActionButtonClick!==e.onActionButtonClick||t.kind!==e.kind||t.title!==e.title),e]));return()=>t.unsubscribe()},[e]),(0,hq.jsx)(hq.Fragment,{children:t.map(e=>(0,hq.jsx)(DX,{notification:e},e.id))})};var D0=r(4065),D1=Object.prototype.hasOwnProperty;let D3=function(e){if(null==e)return!0;if((0,eF.A)(e)&&((0,eL.A)(e)||"string"==typeof e||"function"==typeof e.splice||(0,eB.A)(e)||(0,eU.A)(e)||(0,e$.A)(e)))return!e.length;var t=(0,ta.A)(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if((0,eM.A)(e))return!(0,D0.A)(e).length;for(var r in e)if(D1.call(e,r))return!1;return!0},D4=new es.Subject,D2=0,D6=new es.Subject,D5=0;function D8(e){e&&(0,fn.createRoot)(e).render((0,hq.jsx)(DJ,{subject:D4}))}function D9(e){var t;e&&("string"==typeof(t=e.description)?t.trim().length>0:"object"==typeof t&&(t instanceof Error||!D3(t)))?(e.description instanceof Error&&(e.description=e.description.toLocaleString()),setTimeout(()=>{D4.next({...e,id:D2++})},0)):console.error("showNotification must be called with an object having a 'description' property that is a non-empty string or object")}function D7(e){e&&(0,fn.createRoot)(e).render((0,hq.jsx)(DQ,{subject:D6}))}function Oe(e){var t;e&&("string"==typeof(t=e.actionButtonLabel)?t.trim().length>0:"object"==typeof t&&!D3(t))?setTimeout(()=>{D6.next({...e,id:D5++})},0):console.error("showActionableNotification must be called with an actionButtonLabel that is a non-empty string")}let Ot=["NORMAL","HIGH","CRITICALLY_HIGH","OFF_SCALE_HIGH","LOW","CRITICALLY_LOW","OFF_SCALE_LOW"],Or=["critically_low","critically_high","high","low","normal","off_scale_low","off_scale_high"],On={container:"-esm-billing__numeric-observation-module__container___+Kqi9",card:"-esm-billing__numeric-observation-module__card___Q-ECG","abnormal-value":"-esm-billing__numeric-observation-module__abnormal-value___bx1h9","critical-value":"-esm-billing__numeric-observation-module__critical-value___nSKSX",cell:"-esm-billing__numeric-observation-module__cell___wc90e","critically-high":"-esm-billing__numeric-observation-module__critically-high___fmZfJ","critically-low":"-esm-billing__numeric-observation-module__critically-low___h9797",high:"-esm-billing__numeric-observation-module__high___0-YpP",low:"-esm-billing__numeric-observation-module__low___TuqAk","label-container":"-esm-billing__numeric-observation-module__label-container___FtozC","value-container":"-esm-billing__numeric-observation-module__value-container___R9qoY",label:"-esm-billing__numeric-observation-module__label___0DGA5",value:"-esm-billing__numeric-observation-module__value___ohqoh",units:"-esm-billing__numeric-observation-module__units___xvMd3","pad-right":"-esm-billing__numeric-observation-module__pad-right___umcen","off-scale-low":"-esm-billing__numeric-observation-module__off-scale-low___my+0i","off-scale-high":"-esm-billing__numeric-observation-module__off-scale-high___so9dv",arrow:"-esm-billing__numeric-observation-module__arrow___Agoh9"},Oi=({value:e,unit:t,label:r,interpretation:n,referenceRange:i,conceptUuid:o,variant:a="card",patientUuid:s})=>{let l=(0,pq.useId)(),{referenceRange:u,isLoading:c}=function(e,t){let r=null;e&&(r=t?`${oc}/conceptreferencerange/?patient=${t}&concept=${e}&v=full`:`${oc}/conceptreferencerange/?concept=${e}&v=full`);let{data:n,error:i,isLoading:o}=fX()(r,oh),a=n?.data?.results?.[0];return{referenceRange:a?{hiNormal:a.hiNormal??null,hiAbsolute:a.hiAbsolute??null,hiCritical:a.hiCritical??null,lowNormal:a.lowNormal??null,lowAbsolute:a.lowAbsolute??null,lowCritical:a.lowCritical??null}:void 0,error:i,isLoading:o}}(i||n?void 0:o,s),d=i??u,p=(0,pq.useMemo)(()=>{if(n)return n?"--"===n?"normal":Ot.includes(n)?n.toLowerCase():Or.includes(n)?n:"normal":void 0;if(d&&!c){if(!d||null==e||""===e)return"normal";let t="string"==typeof e?Number.parseFloat(e):e;return Number.isNaN(t)?"normal":null!==d.hiAbsolute&&void 0!==d.hiAbsolute&&t>d.hiAbsolute?"off_scale_high":null!==d.hiCritical&&void 0!==d.hiCritical&&t>=d.hiCritical?"critically_high":null!==d.hiNormal&&void 0!==d.hiNormal&&t>d.hiNormal?"high":null!==d.lowAbsolute&&void 0!==d.lowAbsolute&&t<d.lowAbsolute?"off_scale_low":null!==d.lowCritical&&void 0!==d.lowCritical&&t<=d.lowCritical?"critically_low":null!==d.lowNormal&&void 0!==d.lowNormal&&t<d.lowNormal?"low":"normal"}return"normal"},[n,d,e,c])??"normal",f="critically_low"===p||"critically_high"===p||"off_scale_low"===p||"off_scale_high"===p,h="normal"!==p,m=r?`omrs-numeric-obs-label-${r.replaceAll(/\s+/g,"-").toLowerCase()}-${l}`:void 0,y=`omrs-numeric-obs-value-${l}`,g=`omrs-numeric-obs-unit-${l}`,b=null!=e&&""!==e,v=b?e:i8("notAvailable","Not available"),w=hZ()({[On["critically-low"]]:"critically_low"===p||"off_scale_low"===p,[On["critically-high"]]:"critically_high"===p||"off_scale_high"===p,[On.low]:"low"===p,[On.high]:"high"===p,[On["off-scale-low"]]:"off_scale_low"===p,[On["off-scale-high"]]:"off_scale_high"===p}),x=hZ()({[On.container]:!0,[On.card]:!0,[On["critical-value"]]:f,[On["abnormal-value"]]:h&&!f}),E=hZ()({[On.cell]:!0,[w]:!0});return"cell"===a?(0,hq.jsxs)("div",{className:E,children:[v,b&&t?` ${t}`:""]}):(0,hq.jsxs)("section",{className:x,"data-testid":"numeric-observation-card",children:[r&&(0,hq.jsxs)("div",{className:On["label-container"],children:[(0,hq.jsx)("span",{id:m,className:On.label,children:r}),h&&(0,hq.jsx)("span",{className:On[p.replace("_","-")],title:i8("abnormalValue","Abnormal value")})]}),(0,hq.jsxs)("div",{className:On["value-container"],children:[(0,hq.jsx)("span",{id:y,"aria-labelledby":m&&g?`${m} ${g}`:m||g||void 0,className:On.value,children:v}),b&&t&&(0,hq.jsx)("span",{id:g,className:On.units,children:t})]})]})},Oo="-esm-billing__page-header-module__pageHeader___XNJYe",Oa=e=>{if("children"in e){let{children:t,className:r,...n}=e;return(0,hq.jsx)("div",{className:hZ()(Oo,r),...n,children:t})}{let{title:t,illustration:r,className:n,...i}=e;return(0,hq.jsx)("div",{className:hZ()(Oo,n),...i,children:(0,hq.jsx)(Os,{title:t,illustration:r})})}},Os=({title:e,illustration:t,className:r})=>{let[n,i]=(0,pq.useState)(null);return(0,pq.useEffect)(()=>{rg("@openmrs/esm-styleguide").then(e=>{i(e)})},[]),(0,hq.jsxs)("div",{className:hZ()("-esm-billing__page-header-module__pageHeaderContent___V-mTz",r),children:[t,(0,hq.jsxs)("div",{className:"-esm-billing__page-header-module__pageLabels___vGJvg",children:[n?.implementationName&&(0,hq.jsx)("p",{children:i8(n.implementationName)}),(0,hq.jsx)("p",{className:"-esm-billing__page-header-module__pageName___+eYMc",children:e})]})]})},Ol=({totalItems:e,pageSize:t,onPageNumberChange:r,pageNumber:n,dashboardLinkUrl:i,currentItems:o,dashboardLinkLabel:a})=>{let{pageSizes:s,pageItemsCount:l}=hw(t,e,n,o),u="tablet"===hd(),c=i8("paginationItemsCount","{{pageItemsCount}} / {{totalItems}} items",{totalItems:e,pageItemsCount:l});return(0,hq.jsx)(hq.Fragment,{children:e>0&&(0,hq.jsxs)("div",{className:hZ()({"-esm-billing__pagination-module__tablet___DdaYk":u,"-esm-billing__pagination-module__desktop___rSwlo":!u}),children:[(0,hq.jsxs)("div",{children:[c,i&&(0,hq.jsx)(pJ,{to:i,className:"-esm-billing__pagination-module__configurableLink___cTCLf",children:a??i8("seeAll","See all")})]}),(0,hq.jsx)(h1.dKS,{className:"-esm-billing__pagination-module__pagination___U6anZ",page:n,pageSize:t,pageSizes:s,totalItems:e,onChange:r,pageRangeText:(e,t)=>i8("paginationOfPages","of {{count}} pages",{count:t}),size:u?"lg":"sm"})]})})};function Ou(e){return Od(Of(e,"usual","official"))}function Oc(e){return Ou(e)}function Od(e){var t;let r;return e?e.text??(r=(t=e).given??[],(t.family?r.concat(t.family):r).join(" ")):""}function Op(e){return Od(e)}function Of(e,...t){for(let r of(0==t.length&&(t=["usual"]),t)){let t=e.name?.find(e=>{var t,n;return t=e,n=r,t.use?t.use===n:"usual"===n});if(t)return t}}function Oh(e,t=hP()){let r=hP(t),n=SJ(e,r);if(null==n)return null;let i=r.diff(n,"hours"),o=r.diff(n,"days"),a=r.diff(n,"weeks"),s=r.diff(n,"months"),l=r.diff(n,"years"),u={};if(i<2)u.minutes=r.diff(n,"minutes");else if(o<2)u.hours=i;else if(a<4)u.days=o;else if(l<1){let e=r.subtract(a,"weeks").diff(n,"days");u.weeks=a,u.days=e}else if(l<2){let e=r.subtract(s,"months").diff(n,"days");u.months=s,u.days=e}else if(l<18){let e=r.subtract(l,"year").diff(n,"months");u.years=l,u.months=e}else u.years=l;return u}function Om(e,t=hP()){let r=Oh(e,t);if(null==r)return null;let n={style:"short",localeMatcher:"lookup"};return"minutes"in r&&0===r.minutes&&(n.minutesDisplay="always"),SZ(r,n)}let Oy={container:"-esm-billing__patient-banner-patient-info-module__container___WV40g",activePatientContainer:"-esm-billing__patient-banner-patient-info-module__activePatientContainer___YBgYK",patientBanner:"-esm-billing__patient-banner-patient-info-module__patientBanner___o-DQc",patientName:"-esm-billing__patient-banner-patient-info-module__patientName___KWLAJ",patientAvatar:"-esm-billing__patient-banner-patient-info-module__patientAvatar___gG4I3",patientAvatarButton:"-esm-billing__patient-banner-patient-info-module__patientAvatarButton___by4L9",patientInfo:"-esm-billing__patient-banner-patient-info-module__patientInfo___VU1fL",demographics:"-esm-billing__patient-banner-patient-info-module__demographics___xDHsd",row:"-esm-billing__patient-banner-patient-info-module__row___MlVwp",flexRow:"-esm-billing__patient-banner-patient-info-module__flexRow___9Aj3s",tagsSlot:"-esm-billing__patient-banner-patient-info-module__tagsSlot___PqCHJ",identifiers:"-esm-billing__patient-banner-patient-info-module__identifiers___bbREn",identifier:"-esm-billing__patient-banner-patient-info-module__identifier___HQzz8",primaryIdentifier:"-esm-billing__patient-banner-patient-info-module__primaryIdentifier___ocKCs",secondaryIdentifier:"-esm-billing__patient-banner-patient-info-module__secondaryIdentifier___4MLDH",value:"-esm-billing__patient-banner-patient-info-module__value___tkQTC",tag:"-esm-billing__patient-banner-patient-info-module__tag___u7Kco",gender:"-esm-billing__patient-banner-patient-info-module__gender___7eQuO",separator:"-esm-billing__patient-banner-patient-info-module__separator___CZBA8",tooltipPadding:"-esm-billing__patient-banner-patient-info-module__tooltipPadding___UQr5s",tooltipSmallText:"-esm-billing__patient-banner-patient-info-module__tooltipSmallText___MRUhY",actionsButtonText:"-esm-billing__patient-banner-patient-info-module__actionsButtonText___8ZC1R"};function Og({showIdentifierLabel:e,type:t,value:r}){return(0,hq.jsx)("span",{className:Oy.primaryIdentifier,children:(0,hq.jsxs)(h1.vwO,{className:Oy.tag,type:"gray",children:[e&&t?.text&&(0,hq.jsxs)("span",{className:Oy.label,children:[t.text,": "]}),(0,hq.jsx)("span",{className:Oy.value,children:r})]})})}function Ob({showIdentifierLabel:e,type:t,value:r}){return(0,hq.jsxs)(h1.lRv,{className:Oy.secondaryIdentifier,id:`patient-banner-identifier-${r}`,children:[e&&(0,hq.jsxs)("span",{className:Oy.label,children:[t?.text,": "]}),(0,hq.jsx)("span",{className:Oy.value,children:r})]})}function Ov({identifiers:e,showIdentifierLabel:t}){let{excludePatientIdentifierCodeTypes:r}=fG(),{primaryIdentifierCode:n}=hE(),i=e?.filter(e=>{let t=e.type?.coding?.[0]?.code;return t&&!r?.uuids.includes(t)})??[];return(0,hq.jsx)(hq.Fragment,{children:i?.length?i.map(({value:e,type:r},o)=>(0,hq.jsxs)(pY().Fragment,{children:[(0,hq.jsx)("span",{className:Oy.identifier,children:r?.coding?.[0]?.code===n?(0,hq.jsx)(Og,{showIdentifierLabel:t,type:r,value:e}):(0,hq.jsx)(Ob,{showIdentifierLabel:t,type:r,value:e})}),o<i.length-1&&(0,hq.jsx)("span",{className:Oy.separator,children:"\xb7"})]},e)):""})}let Ow={Female:m$,Male:mL,Other:mF,Unknown:mB},O_=({gender:e})=>{let t=Ow[e];return t?(0,hq.jsx)(t,{fill:"#525252"}):null},Ox={male:"Male",female:"Female",other:"Other",unknown:"Unknown"};function OE({patient:e,renderedFrom:t}){var r;let n,i,o=Ou(e),a=e?.gender&&(i=Ox[n=(r=e.gender).toLowerCase()]??"Unknown",{displayText:i8(n,r),iconKey:i}),s=(0,pq.useMemo)(()=>({patientUuid:e.id,patient:e,renderedFrom:t}),[e.id,e,t]);return(0,hq.jsxs)("div",{className:Oy.patientInfo,children:[(0,hq.jsx)("div",{className:hZ()(Oy.row,Oy.patientNameRow),children:(0,hq.jsxs)("div",{className:Oy.flexRow,children:[(0,hq.jsx)("span",{className:Oy.patientName,children:o}),a&&(0,hq.jsxs)("div",{className:Oy.gender,children:[(0,hq.jsx)(O_,{gender:a.iconKey}),(0,hq.jsx)("span",{children:a.displayText})]}),(0,hq.jsx)(fr,{className:Oy.tagsSlot,name:"patient-banner-tags-slot",state:s})]})}),(0,hq.jsxs)("div",{className:Oy.demographics,children:[e.birthDate&&(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsx)("span",{children:Om(e.birthDate)}),(0,hq.jsx)("span",{className:Oy.separator,children:"\xb7"}),(0,hq.jsx)("span",{children:SK(e.birthDate,{time:!1})}),(0,hq.jsx)("span",{className:Oy.separator,children:"\xb7"})]}),(0,hq.jsx)(Ov,{identifiers:e.identifier,showIdentifierLabel:!0}),(0,hq.jsx)(fr,{className:Oy.extensionSlot,name:"patient-banner-bottom-slot",state:s})]})]})}var OS=r(1673);function OD({patient:e,patientUuid:t,actionsSlotName:r,additionalActionsSlotState:n}){let[i,o]=(0,pq.useState)(!1),{extensions:a}=fe(r),s="tablet"===hd(),l=hy(()=>o(!1),i),u=(0,pq.useRef)(null),c=(0,pq.useRef)(null),d=(0,pq.useId)(),p=`patient-actions-menu-trigger-${d}`,f=`patient-actions-menu-${d}`,h=(0,pq.useCallback)(()=>o(e=>!e),[]),m=(0,pq.useCallback)(()=>{o(!1),u.current?.focus()},[]),y=(0,pq.useCallback)(e=>{if("Escape"===e.key&&i){e.stopPropagation(),m();return}if(("ArrowDown"===e.key||"ArrowUp"===e.key)&&i){e.preventDefault();let t=c.current?.querySelectorAll('[role="menuitem"]:not([disabled])');if(!t?.length)return;let r=document.activeElement?.closest?.('[role="menuitem"]')??document.activeElement,n=Array.from(t).indexOf(r);if(-1===n)return void t["ArrowDown"===e.key?0:t.length-1]?.focus();let i=n+("ArrowDown"===e.key?1:-1),o=i<0?t.length-1:i>=t.length?0:i;t[o]?.focus()}},[m,i]);(0,pq.useEffect)(()=>{if(i&&c.current){let e=c.current.querySelector('[role="menuitem"]:not([disabled])');e?.focus()}},[i]);let g=(0,pq.useMemo)(()=>({patientUuid:t,patient:e,closeMenu:m,...n}),[t,e,m,n]);return 0===a.length?null:(0,hq.jsx)("div",{className:"-esm-billing__patient-banner-actions-menu-module__overflowMenuContainer___7eCLh",children:(0,hq.jsxs)("div",{"data-overflow-menu":!0,className:hZ()("cds--overflow-menu",h2),ref:l,children:[(0,hq.jsxs)("button",{className:hZ()("cds--btn","cds--btn--ghost","cds--overflow-menu__trigger",{"cds--overflow-menu--open":i},h8),"aria-controls":f,"aria-expanded":i,"aria-haspopup":"true",id:p,onClick:h,onKeyDown:y,ref:u,children:[(0,hq.jsx)("span",{className:"-esm-billing__patient-banner-actions-menu-module__actionsButtonText___TbM5a",children:i8("actions","Actions")})," ",(0,hq.jsx)(OS.CH,{size:16,style:{marginLeft:"0.5rem",fill:"#78A9FF"}})]}),(0,hq.jsxs)("div",{className:hZ()("cds--overflow-menu-options","cds--overflow-menu--flip",h6,{[h5]:i}),"aria-labelledby":p,"data-floating-menu-direction":"bottom",id:f,onKeyDown:y,ref:c,role:"menu",tabIndex:-1,children:[(0,hq.jsx)("ul",{className:hZ()("cds--overflow-menu-options__content",{"cds--overflow-menu-options--lg":s}),children:(0,hq.jsx)(fr,{name:r,state:g},r)}),(0,hq.jsx)("span",{})]})]})})}var OO=r(6767),OP=r.n(OO);function OC(e){let{patientPhotoConceptUuid:t}=fG({externalModuleName:"@openmrs/esm-styleguide"}),r=t?`${oc}/obs?patient=${e}&concept=${t}&v=full`:null,{data:n,error:i,isLoading:o}=fv()(e?r:null,oh),a=n?.data?.results[0];return{data:a?{dateTime:a?.obsDatetime,imageSrc:a?.value?.links?.uri}:null,error:i,isLoading:o}}let Ok=({width:e=56,height:t=56,"aria-label":r})=>{let{t:n}=(0,fg.useTranslation)();return(0,hq.jsxs)("svg",{"aria-label":r??n("patientPhotoPlaceholder","Patient photo placeholder"),width:e,height:t,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,hq.jsx)("path",{fill:"#ffffff",d:"M0 0h56v56H0z"}),(0,hq.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m36.75 20.134-.884-.884L19.25 35.866l.884.884 1.25-1.25H34.25a1.252 1.252 0 0 0 1.25-1.25V21.384l1.25-1.25Zm-2.5 14.116H22.634l4.87-4.87 1.487 1.486a1.25 1.25 0 0 0 1.768 0l.991-.991 2.5 2.498v1.877Zm0-3.645-1.616-1.616a1.25 1.25 0 0 0-1.768 0l-.991.991-1.486-1.486 5.861-5.86v7.971Zm-12.5 1.145v-1.875l3.125-3.123.858.859.885-.885-.86-.86a1.25 1.25 0 0 0-1.767 0l-2.241 2.242V21.75h10V20.5h-10c-.69 0-1.25.56-1.25 1.25v10h1.25Z",fill:"#8D8D8D"})]})},Oj="-esm-billing__patient-photo-module__avatar___R93LX";function OT({patientUuid:e,patientName:t,alt:r}){let{data:n,isLoading:i}=OC(e),[o,a]=(0,pq.useState)(null),[s,l]=(0,pq.useState)(!1),u=(0,pq.useMemo)(()=>OP().generate(e),[e]);(0,pq.useEffect)(()=>{if(n?.imageSrc){let e=new URL(n.imageSrc,window.location.origin).pathname;l(!0);let t=!1,r=new Image;return r.onload=()=>{t||(a(e),l(!1))},r.onerror=()=>{t||(a(null),l(!1))},r.src=e,()=>{t=!0}}a(null),l(!1)},[n?.imageSrc]);let c=(0,pq.useMemo)(()=>r||(o?i8("patientPhotoAlt","Profile photo of {{patientName}}",{patientName:t}):i8("patientAvatarAlt","Avatar for {{patientName}}",{patientName:t})),[r,o,t]);return i||s?(0,hq.jsx)(h1.ryE,{className:"-esm-billing__patient-photo-module__skeleton___I-6iq","data-testid":"skeleton-icon"}):n?.imageSrc&&!o?(0,hq.jsx)(Ok,{"aria-label":i8("patientPhotoPlaceholder","Photo placeholder for {{patientName}}",{patientName:t})}):o?(0,hq.jsx)("div",{"aria-label":c,children:(0,hq.jsx)("img",{className:Oj,src:o,alt:c,title:t})}):(0,hq.jsx)("div",{"aria-label":c,children:(0,hq.jsx)("div",{className:Oj,title:t,style:{backgroundImage:u.toDataUrl(),backgroundRepeat:"no-repeat",backgroundSize:"cover"},children:(0,hq.jsx)("span",{className:"-esm-billing__patient-photo-module__initials___JnUBD",children:function(e,t=3){return e.split(/\s+/).filter(Boolean).slice(0,t).map(e=>e[0]).join("")}(t)})})})}let OR=["omrs-pict-appointments","omrs-pict-assessment-1","omrs-pict-assessment-2","omrs-pict-blood-bank","omrs-pict-cardiology","omrs-pict-ct-scan","omrs-pict-dentistry","omrs-pict-digital-trust","omrs-pict-emergency-department","omrs-pict-facility","omrs-pict-geriatrics","omrs-pict-gynaecology","omrs-pict-in-patient","omrs-pict-laboratory","omrs-pict-labs-2","omrs-pict-metadata-export","omrs-pict-obstetrics","omrs-pict-patient-search","omrs-pict-patients","omrs-pict-payments-desk","omrs-pict-pharmacy","omrs-pict-pharmacy-2","omrs-pict-registration","omrs-pict-service-queues","omrs-pict-stock-management","omrs-pict-transfer","omrs-pict-triage","omrs-pict-x-ray"],OA=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-appointments",pictogramProps:e})})),ON=OA,OM=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-assessment-1",pictogramProps:e})})),OI=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-assessment-2",pictogramProps:e})})),O$=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-blood-bank",pictogramProps:e})})),OL=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-cardiology",pictogramProps:e})})),OF=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-ct-scan",pictogramProps:e})})),OB=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-dentistry",pictogramProps:e})})),OV=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-digital-trust",pictogramProps:e})})),OU=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-emergency-department",pictogramProps:e})})),OW=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-facility",pictogramProps:e})})),OK=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-geriatrics",pictogramProps:e})})),OH=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-gynaecology",pictogramProps:e})})),Oz=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-in-patient",pictogramProps:e})})),OG=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-laboratory",pictogramProps:e})})),Oq=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-labs-2",pictogramProps:e})})),OY=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-metadata-export",pictogramProps:e})})),OZ=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-obstetrics",pictogramProps:e})})),OJ=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-patient-search",pictogramProps:e})})),OX=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-patients",pictogramProps:e})})),OQ=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-payments-desk",pictogramProps:e})})),O0=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-pharmacy",pictogramProps:e})})),O1=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-pharmacy-2",pictogramProps:e})})),O3=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-registration",pictogramProps:e})})),O4=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-service-queues",pictogramProps:e})})),O2=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-stock-management",pictogramProps:e})})),O6=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-transfer",pictogramProps:e})})),O5=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-triage",pictogramProps:e})})),O8=(0,pq.memo)((0,pq.forwardRef)(function(e,t){return(0,hq.jsx)(Pt,{ref:t,pictogram:"omrs-pict-x-ray",pictogramProps:e})})),O9=OW,O7=OX,Pe=(0,pq.memo)((0,pq.forwardRef)(function({pictogram:e,fallback:t,...r},n){let i=(0,pq.useRef)(document.getElementById(e));return(0,pq.useEffect)(()=>{let t=document.getElementById("omrs-svgs-container"),r=new MutationObserver(t=>{for(let r of t)"childList"===r.type&&(i.current=document.getElementById(e))});return t&&r.observe(t,{childList:!0}),()=>r.disconnect()},[e]),(0,hq.jsx)(f$,{value:i.current,fallback:t,children:(0,hq.jsx)(Pt,{ref:n,pictogram:e,pictogramProps:r})})})),Pt=(0,pq.memo)((0,pq.forwardRef)(function({pictogram:e,pictogramProps:t},r){let{className:n,size:i}=Object.assign({},{size:92},t);return(i<=26||i>144)&&(console.error(`Invalid size '${i}' specified for ${e}. Defaulting to 92.`),i=92),(0,hq.jsx)("svg",{ref:r,className:hZ()("-esm-billing__pictograms-module__pictogram___LTPzD",n),height:i,width:i,children:(0,hq.jsx)("use",{href:`#${e}`})})})),Pr=({children:e})=>"tablet"===hd()?(0,hq.jsx)(h1.Wdr,{children:e}):(0,hq.jsx)(hq.Fragment,{children:e}),Pn=({snackbar:e,closeSnackbar:t})=>{let{actionButtonLabel:r="",kind:n="success",onActionButtonClick:i=()=>{},isLowContrast:o="error"!==n,progressActionLabel:a,subtitle:s="",timeoutInMs:l=5e3,autoClose:u="error"!==n,title:c,id:d,...p}=e,[f,h]=(0,pq.useState)(r),[m,y]=(0,pq.useState)(!0),[g,b]=(0,pq.useState)(!1),v=(0,pq.useCallback)(()=>{setTimeout(t,250)},[t]),w=(0,pq.useCallback)(()=>{b(!0),v()},[v]);return(0,pq.useEffect)(()=>{if(u){let e=setTimeout(w,l);return()=>clearTimeout(e)}},[l,u,w]),(0,pq.useEffect)(()=>{y(!1),window.setTimeout(()=>{y(!0)},0)},[]),(0,hq.jsx)(h1.kZS,{actionButtonLabel:f,"aria-label":i8("closeSnackbar","Close snackbar"),className:hZ()("-esm-billing__snackbar-module__slideIn___TqSN-",{"-esm-billing__snackbar-module__animated___+XPKT":m,"-esm-billing__snackbar-module__slideOut___1cFIY":g}),kind:n,lowContrast:o,onActionButtonClick:()=>{i(),w(),a&&h(a)},onClose:v,statusIconDescription:i8("snackbarNotification","Snackbar notification"),subtitle:s,title:c,...p})},Pi=({subject:e})=>{let[t,r]=(0,pq.useState)([]),n=(0,pq.useCallback)(e=>{r(t=>t.filter(t=>t!==e))},[]);return(0,pq.useEffect)(()=>{let t=e.subscribe(e=>r(t=>[...t.filter(t=>t.subtitle!==e.subtitle||t.actionButtonLabel!==e.actionButtonLabel||t.onActionButtonClick!==e.onActionButtonClick||t.kind!==e.kind||t.title!==e.title),e]));return()=>t.unsubscribe()},[e]),(0,hq.jsx)(hq.Fragment,{children:t.map(e=>(0,hq.jsx)(Pn,{snackbar:e,closeSnackbar:()=>n(e)},e.id))})},Po=new es.Subject,Pa=0;function Ps(e){e&&(0,fn.createRoot)(e).render((0,hq.jsx)(Pi,{subject:Po}))}function Pl(e){var t;e&&"string"==typeof(t=e.title)&&t.trim().length>0?setTimeout(()=>{Po.next({...e,id:Pa++})},0):console.error("showSnackbar must be called with an object having a 'title' property that is a non-empty string")}let Pu=({toast:e,closeToast:t})=>{let{description:r,kind:n,critical:i,title:o,actionButtonLabel:a,onActionButtonClick:s=()=>{}}=e,l=(0,pq.useCallback)(()=>{s(),t()},[t,s]);return(0,hq.jsx)("div",{children:(0,hq.jsx)(h1.kZS,{actionButtonLabel:a,kind:n||"info",lowContrast:i,subtitle:r,title:o||"",onActionButtonClick:l,onClose:t})})},Pc=({subject:e})=>{let[t,r]=(0,pq.useState)([]),n=(0,pq.useCallback)(e=>{r(t=>t.filter(t=>t!==e))},[]);return(0,pq.useEffect)(()=>{let t=e.subscribe(e=>r(t=>[...t.filter(t=>t.description!==e.description||t.kind!==e.kind||t.title!==e.title||t.actionButtonLabel!==e.actionButtonLabel||t.onActionButtonClick!==e.onActionButtonClick),e]));return()=>t.unsubscribe()},[e]),(0,hq.jsx)(hq.Fragment,{children:t.map(e=>(0,hq.jsx)(Pu,{toast:e,closeToast:()=>n(e)},e.id))})},Pd=new es.Subject,Pp=0;function Pf(e){e&&(0,fn.createRoot)(e).render((0,hq.jsx)(Pc,{subject:Pd}))}function Ph(e){var t;e&&("string"==typeof(t=e.description)?t.trim().length>0:"object"==typeof t&&!D3(t))?setTimeout(()=>{Pd.next({...e,id:Pp++})},0):console.error("showToast must be called with an object having a 'description' property that is a non-empty string or object")}function Pm(e,t=!1){if(t)return!0;let r=Pw[e];return!r||!r()}function Py(e,t){let r=PC.getState()?.workspaceGroup,n=r?.name;n&&e===n&&PR(()=>{let n=P$(e);n&&(n.setState({},!0),n.subscribe(()=>{})()),"function"==typeof r?.cleanup&&r.cleanup(),PC.setState(e=>({...e,workspaceGroup:void 0})),"function"==typeof t&&t()},n?e=>e.currentWorkspaceGroup===n:()=>!0)}function Pg(e,t){let{name:r,additionalProps:n}=t;pT(r);let i=()=>{PD(e.name,{ignoreChanges:!0,onWorkspaceClose:()=>Pb(r,n),closeWorkspaceGroup:!1})};Pm(e.name)?i():PN("closing-workspace-launching-new-workspace",i,e.title??e.name)}function Pb(e,t){let r=pT(e),n=PC.getState().workspaceGroup;if(n&&!n.members?.includes(e))return void Py(n.name,()=>{Pb(e,t)});let i=PC.getState().workspaceGroup?.name,o={...r,title:PM(r,t),closeWorkspace:(t={})=>PD(e,t),closeWorkspaceWithSavedChanges:t=>PD(e,{ignoreChanges:!0,...t}),promptBeforeClosing:t=>{var r,n;return r=e,n=t,void(Pw[r]=n)},setTitle:(t,r)=>{o.title=t,o.titleNode=r,PC.setState(t=>{let r=t.openWorkspaces.map(t=>t.name===e?o:t);return{...t,openWorkspaces:r}})},currentWorkspaceGroup:i,additionalProps:t??{}};function a(e,t){PC.setState(r=>{let n=[e,...t??r.openWorkspaces],i=PT(e);return{...r,openWorkspaces:n,workspaceWindowState:i}})}i&&P$(i,t);let s=PC.getState().openWorkspaces,l=s.findIndex(t=>t.name===e),u=s.find(e=>e.type==o.type);if(0===s.length)a(o);else if(s[0].canHide||0===l)if(l>=0){let t=s[l];a({...t,additionalProps:o.additionalProps,...t.title===PM(t,t.additionalProps)&&{title:PM(o,o.additionalProps)}},s.filter(t=>t.name!=e))}else u?(a(u,PC.getState().openWorkspaces.filter(e=>e.type!=o.type)),Pg(u,{name:e,additionalProps:t})):a(o);else Pg(s[0],{name:e,additionalProps:t})}function Pv({targetUrl:e,contextKey:t,workspaceName:r,additionalProps:n}){PO(t),Pb(r,n),oe({to:e})}let Pw={};function P_(e,t){Pw[e]=t}function Px(e){return Pw[e]}function PE(){let e=PC.getState();PC.setState({...e,prompt:null})}let PS={ignoreChanges:!1,onWorkspaceClose:()=>{},closeWorkspaceGroup:!0};function PD(e,t={}){t={...PS,...t};let r=()=>{let r=PC.getState();r.openWorkspaces.find(t=>t.name===e);let n=r.openWorkspaces.filter(t=>t.name!=e),i=PC.getState().workspaceGroup?.name;i&&t.closeWorkspaceGroup&&Py(i),Pw[e]=()=>!1,PC.setState(e=>({...e,prompt:null,openWorkspaces:n,workspaceWindowState:PT(n?.[0])})),t?.onWorkspaceClose?.()};return Pm(e,t?.ignoreChanges)?(r(),!0):(PN("closing-workspace",r,pT(e).title??e),!1)}function PO(e){PC.getState().context!=e&&PC.setState({context:e,openWorkspaces:[],prompt:null})}let PP={context:"",openWorkspaces:[],prompt:null,workspaceWindowState:"normal",workspaceGroup:void 0},PC=Y("workspace",PP);function Pk(){return PC}function Pj(e){let t=PC.getState();PC.setState({...t,workspaceWindowState:e})}function PT(e){return e?.preferredWindowSize??"normal"}function PR(e=()=>{},t=()=>!0){let r=PC.getState().openWorkspaces.filter(t).every(({name:e})=>Pm(e)),n=()=>{PI(),e?.()};r?n():PN("closing-all-workspaces",n)}function PA(){let{workspaceWindowState:e,openWorkspaces:t,prompt:r,workspaceGroup:n}=p3(PC);return(0,pq.useMemo)(()=>({active:t.length>0,prompt:r,workspaceWindowState:e,workspaces:t,workspaceGroup:n}),[t,e,r,n])}function PN(e,t=()=>{},r=""){let n;switch(e){case"closing-workspace":n={title:i8("unsavedChangesTitleText","Unsaved changes"),body:i8("unsavedChangesInOpenedWorkspace","You may have unsaved changes in the opened workspace. Do you want to discard these changes?"),onConfirm:()=>{t?.()},confirmText:i8("discard","Discard")};break;case"closing-all-workspaces":{let e=PC.getState().openWorkspaces.filter(({name:e})=>!Pm(e)).map(({title:e},t)=>`${t+1}. ${e}`);n={title:i8("closingAllWorkspacesPromptTitle","You have unsaved changes"),body:i8("closingAllWorkspacesPromptBody","There may be unsaved changes in the following workspaces. Do you want to discard changes in the following workspaces? {{workspaceNames}}",{workspaceNames:e.join(",")}),onConfirm:()=>{t?.()},confirmText:i8("closeAllOpenedWorkspaces","Discard changes in {{count}} workspaces",{count:e.length})};break}case"closing-workspace-launching-new-workspace":n={title:i8("unsavedChangesTitleText","Unsaved changes"),body:i8("unsavedChangesInWorkspace",'There may be unsaved changes in "{{workspaceName}}". Please save them before opening another workspace.',{workspaceName:r}),onConfirm:()=>{PC.setState(e=>({...e,prompt:null})),t?.()},confirmText:i8("openAnyway","Open anyway")};break;default:console.error(`Workspace system trying to open unknown prompt type "${e}" in function "showWorkspacePrompts"`),t?.();return}PC.setState(e=>({...e,prompt:n}))}function PM(e,t){return t?.workspaceTitle??e.title}function PI(){PC.setState(PP)}function P$(e,t={}){if(!e||"default"===e)return;let r=J(e,{});return t&&r.setState(e=>({...e,...t})),r}let PL="-esm-billing__action-menu-button-module__container___Uwne-",PF="-esm-billing__action-menu-button-module__elementContainer___vWkQO",PB="-esm-billing__action-menu-button-module__active___D7Idw";function PV({getIcon:e,formOpenInTheBackground:t,tagContent:r}){return(0,hq.jsxs)(hq.Fragment,{children:[e({size:16}),t?(0,hq.jsx)("span",{className:"-esm-billing__action-menu-button-module__interruptedTag___7undI",children:"!"}):(0,hq.jsx)("span",{className:"-esm-billing__action-menu-button-module__countTag___XJRiM",children:r})]})}let PU=({getIcon:e,label:t,iconDescription:r,handler:n,type:i,tagContent:o})=>{let a=hd(),{workspaces:s,workspaceWindowState:l}=PA(),u=s?.findIndex(({type:e})=>e===i)??-1,c="hidden"!==l&&0===u,d=u>0||0===u&&"hidden"===l;return"tablet"===a||"phone"===a?(0,hq.jsxs)(h1.$nd,{className:hZ()(PL,{[PB]:c}),iconDescription:r,kind:"ghost",onClick:n,role:"button",tabIndex:0,size:"md",children:[(0,hq.jsx)("span",{className:PF,children:(0,hq.jsx)(PV,{formOpenInTheBackground:d,getIcon:e,tagContent:o})}),(0,hq.jsx)("span",{children:t})]}):(0,hq.jsx)(h1.K0,{align:"left","aria-label":r,className:hZ()(PL,{[PB]:c}),enterDelayMs:300,kind:"ghost",label:t,onClick:n,size:"md",children:(0,hq.jsx)("div",{className:PF,children:(0,hq.jsx)(PV,{formOpenInTheBackground:d,getIcon:e,tagContent:o})})})};var PW=r(4535),PK=r(771),PH=r(4898),Pz=/[\\^$.*+?()[\]{}|]/g,PG=RegExp(Pz.source);let Pq=function(e){return(e=(0,PH.A)(e))&&PG.test(e)?e.replace(Pz,"\\$&"):e};function PY({contextKey:e}){let{prompt:t}=PA();return(0,pq.useEffect)(()=>{RegExp(`/${Pq(e)}(/|$)`).test(window.location.pathname)||console.warn(`WorkspaceContainer has provided an invalid context key: "${e}". The context key must be part of the URL path, with no initial or trailing slash.`)},[]),(0,pq.useEffect)(()=>(PO(e),()=>{PO(null)}),[e]),(0,pq.useEffect)(()=>{let t=t=>{let{detail:{cancelNavigation:r,newUrl:n}}=t,i=RegExp(`/${Pq(e)}(/|$)`),o=new URL(n),a=i.test(o.pathname),s=PC.getState().openWorkspaces.every(({name:e})=>Pm(e));a||(s?PI():(r?.(),PR(()=>{oe({to:n})})))};return window.addEventListener("single-spa:before-routing-event",t),()=>{window.removeEventListener("single-spa:before-routing-event",t)}},[]),null!=t?(0,hq.jsxs)(h1.KXP,{open:!0,onClose:PE,children:[(0,hq.jsx)(h1.rQ0,{title:t.title}),(0,hq.jsx)(h1.cwr,{children:(0,hq.jsx)("p",{className:"-esm-billing__workspace-notification-module__messageBody___M3IAD",children:t.body})}),(0,hq.jsxs)(h1.jlY,{children:[(0,hq.jsx)(h1.$nd,{kind:"secondary",onClick:PE,children:t.cancelText??i8("cancel")}),(0,hq.jsx)(h1.$nd,{kind:"danger",onClick:t.onConfirm,children:t.confirmText??i8("confirm")})]})]}):null}function PZ(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function PJ(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?PZ(Object(r),!0).forEach(function(t){PQ(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):PZ(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function PX(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function PQ(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function P0(e){return(P0=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function P1(e,t){return(P1=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function P3(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var P4=function(e){var t=pq.Component;if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");a.prototype=Object.create(t&&t.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),t&&P1(a,t);var r,n,i,o=(r=function(){if("u"<typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=P0(a);e=r?Reflect.construct(t,arguments,P0(this).constructor):t.apply(this,arguments);if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");return P3(this)});function a(e){var t;if(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,a),PQ(P3(t=o.call(this,e)),"handleRef",function(e){t.el=e}),PQ(P3(t),"addThingToDo",function(e,r){t.state.hasError&&"unmount"!==e||(t.nextThingToDo=(t.nextThingToDo||Promise.resolve()).then(function(){if(!t.unmounted||"unmount"===e)return r.apply(void 0,arguments)}).catch(function(r){throw t.nextThingToDo=Promise.resolve(),t.setState({hasError:!0}),r&&r.message&&(r.message="During '".concat(e,"', parcel threw an error: ").concat(r.message)),t.props.handleError?t.props.handleError(r):setTimeout(function(){throw r}),r}))}),PQ(P3(t),"getParcelProps",function(){var e=PJ(PJ({},t.props),{},{domElement:t.el});return delete e.mountParcel,delete e.config,delete e.wrapWith,delete e.wrapStyle,delete e.appendTo,delete e.handleError,delete e.parcelDidMount,e}),t.state={hasError:!1},!e.config)throw Error("single-spa-react's Parcel component requires the 'config' prop to either be a parcel config or a loading function that returns a promise. See https://github.com/single-spa/single-spa-react");return t}return n=[{key:"componentDidMount",value:function(){var e=this;this.unmounted=!1,this.addThingToDo("mount",function(){var t,r=e.props.mountParcel||e.mountParcel;if(!r)throw Error("\n <Parcel /> was not passed a mountParcel prop, nor is it rendered where mountParcel is within the React context.\n If you are using <Parcel /> within a module that is not a single-spa application, you will need to import mountRootParcel from single-spa and pass it into <Parcel /> as a mountParcel prop \n ");return e.el?t=e.el:(e.createdDomElement=t=document.createElement(e.props.wrapWith),Object.keys(e.props.wrapStyle).forEach(function(r){t.style[r]=e.props.wrapStyle[r]}),e.props.appendTo.appendChild(t)),e.parcel=r(e.props.config,PJ({domElement:t},e.getParcelProps())),e.parcel.mountPromise.then(e.props.parcelDidMount),e.parcel.mountPromise})}},{key:"componentDidUpdate",value:function(){var e=this;this.addThingToDo("update",function(){if(e.parcel&&e.parcel.update)return e.parcel.update(e.getParcelProps())})}},{key:"componentWillUnmount",value:function(){var e=this;this.addThingToDo("unmount",function(){if(e.parcel&&"MOUNTED"===e.parcel.getStatus())return e.parcel.unmount()}),this.createdDomElement&&this.createdDomElement.parentNode.removeChild(this.createdDomElement),this.unmounted=!0}},{key:"render",value:function(){var e=this;if(this.props.appendTo)return fu&&fu.Consumer?pq.createElement(fu.Consumer,null,function(t){return e.mountParcel=t?t.mountParcel:null,null}):null;var t=fu&&fu.Consumer?pq.createElement(fu.Consumer,null,function(t){return e.mountParcel=t?t.mountParcel:null,null}):void 0;return pq.createElement(this.props.wrapWith,{ref:this.handleRef,style:this.props.wrapStyle,className:this.props.wrapClassName},t)}}],PX(a.prototype,n),i&&PX(a,i),a}();PQ(P4,"defaultProps",{wrapWith:"div",wrapStyle:{},parcelDidMount:function(){}});function P2({workspace:e,additionalPropsFromPage:t}){let[r,n]=(0,pq.useState)(),i=function(e){let[t,r]=(0,pq.useState)({}),[n,i]=(0,pq.useState)(e);return(0,pq.useEffect)(()=>{n!==e&&i(e)},[e]),(0,pq.useEffect)(()=>{let e,t=P$(n);return t&&(r(t.getState()),e=t.subscribe(r)),()=>{t&&e?.()}},[n]),t}(e.currentWorkspaceGroup);(0,pq.useEffect)(()=>{let t=!0;return e.load().then(e=>{t&&n(e)}),()=>{t=!1}},[e]);let o=(0,pq.useMemo)(()=>e&&{closeWorkspace:e.closeWorkspace,closeWorkspaceWithSavedChanges:e.closeWorkspaceWithSavedChanges,promptBeforeClosing:e.promptBeforeClosing,setTitle:e.setTitle,...t,...i,...e.additionalProps},[e,t,i]);return r?(0,hq.jsx)(P4,{config:r,mountParcel:pz,...o},e.name):(0,hq.jsx)(h1.OuH,{className:"-esm-billing__workspace-module__loader___v7QFg",description:`${i8("loading","Loading")} ...`})}function P6({isWithinWorkspace:e,name:t,actionMenuProps:r={}}){let[n,i]=(0,pq.useState)(!1),o=(0,pq.useRef)(window.innerHeight),{featureName:a}=(0,pq.useContext)(pZ),s=hd();(0,pq.useEffect)(()=>{let e=()=>{i(!hp(s)&&o.current>window.innerHeight),o.current!=window.innerHeight&&(o.current=window.innerHeight)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[o]);let l=`action-menu-${t&&"default"!=t?t:a}-items-slot`;return(0,hq.jsx)("aside",{className:hZ()("-esm-billing__action-menu-module__sideRail___Aa96v",{"-esm-billing__action-menu-module__withinWorkspace___2bJET":e,"-esm-billing__action-menu-module__sideRailHidden___Yb0w9":n,"-esm-billing__action-menu-module__sideRailVisible___XIAk7":!n}),children:(0,hq.jsx)("div",{className:"-esm-billing__action-menu-module__container___mzfAh",children:(0,hq.jsx)(fr,{className:"-esm-billing__action-menu-module__chartExtensions___DiJtm",name:l,state:r})})})}function P5({contextKey:e,overlay:t,showSiderailAndBottomNav:r,additionalWorkspaceProps:n,actionMenuProps:i}){let o=hd(),{workspaces:a,workspaceWindowState:s,workspaceGroup:l}=PA(),u=l?.name,c=a[0],d="hidden"===s||null==c,p=c?.width??(t?"wider":"narrow"),f=(0,pq.useMemo)(()=>r||u&&!d,[u,d,r]);return fK(!d&&!hp(o)),(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsxs)("div",{className:r?"-esm-billing__workspace-module__workspaceContainerWithActionMenu___6x1qS":"-esm-billing__workspace-module__workspaceContainerWithoutActionMenu___TJHnt",children:[(0,hq.jsx)("aside",{className:hZ()(t?"-esm-billing__workspace-module__workspaceOverlayOuterContainer___4y++2":"-esm-billing__workspace-module__workspaceWindowSpacer___6kF9R",{"-esm-billing__workspace-module__hiddenRelative___qqT-4":d,"-esm-billing__workspace-module__narrowWorkspace___MMI1u":"narrow"===p,"-esm-billing__workspace-module__widerWorkspace___be-UT":"wider"===p,"-esm-billing__workspace-module__extraWideWorkspace___JmWmj":"extra-wide"===p}),children:(0,hq.jsx)("div",{className:hZ()("-esm-billing__workspace-module__workspaceFixedContainer___TfJP7",{"-esm-billing__workspace-module__maximizedWindow___71jv4":"maximized"===s,"-esm-billing__workspace-module__hiddenFixed___48wS9":d}),children:a.map((e,t)=>(0,hq.jsx)("div",{className:hZ()("-esm-billing__workspace-module__workspaceInnerContainer___h3oyO",{"-esm-billing__workspace-module__hiddenExtraWorkspace___AP+Vj":0!==t}),children:(0,hq.jsx)(pq.Suspense,{fallback:null,children:(0,hq.jsx)(fg.I18nextProvider,{i18n:window.i18next,defaultNS:e.moduleName,children:(0,hq.jsx)(P8,{workspaceInstance:e,additionalWorkspaceProps:n})})})},`workspace-container-${e?e.name:`empty-${t}`}`))})}),(0,hq.jsx)(PY,{contextKey:e})]}),f&&(0,hq.jsx)(P6,{name:u,isWithinWorkspace:!r,actionMenuProps:i})]})}function P8({workspaceInstance:e,additionalWorkspaceProps:t}){let{t:r}=(0,fg.useTranslation)(),n=hd(),{workspaceWindowState:i,workspaceGroup:o}=PA(),a=o?.name,s="maximized"===i;(0,pq.useEffect)(()=>{let t=r(e.title);t!==e.title&&e.setTitle(t)},[e.title,r,e.setTitle]);let{featureName:l}=(0,pq.useContext)(pZ),u=(0,pq.useCallback)(()=>{Pj(s?"normal":"maximized")},[s]),{canHide:c=!1,canMaximize:d=!1,currentWorkspaceGroup:p="",closeWorkspace:f}=(0,pq.useMemo)(()=>e??{},[e]),h=(0,pq.useMemo)(()=>({...t,...e?.additionalProps}),[t,e]);return e&&(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsxs)(h1.Y9Y,{"aria-label":i8("workspaceHeader","Workspace Header"),className:"-esm-billing__workspace-module__header___nACZO",children:[!hp(n)&&!c&&(0,hq.jsx)(h1.dJ2,{"aria-label":i8("close","Close"),renderMenuIcon:(0,hq.jsx)(ml,{}),onClick:()=>f()}),(0,hq.jsx)(h1.bCw,{prefix:"",children:e.titleNode??r(e.title)}),(0,hq.jsx)("div",{className:"-esm-billing__workspace-module__overlayHeaderSpacer___HBnr+"}),(0,hq.jsxs)(h1.wdv,{className:"-esm-billing__workspace-module__headerButtons___heP0Q",children:[(0,hq.jsx)(fr,{name:`workspace-header-group-${e.currentWorkspaceGroup}-slot`,state:h}),(0,hq.jsx)(fr,{name:`workspace-header-type-${e.type}-slot`,state:h}),(0,hq.jsx)(fr,{name:`workspace-header-${l}-slot`,state:h}),hp(n)&&(0,hq.jsxs)(hq.Fragment,{children:[(d||s)&&(0,hq.jsx)(h1.V8d,{"aria-label":s?i8("minimize","Minimize"):i8("maximize","Maximize"),onClick:u,children:s?(0,hq.jsx)(PW.Xj,{}):(0,hq.jsx)(PW.hz,{})}),c&&!a?(0,hq.jsx)(h1.V8d,{"aria-label":i8("hide","Hide"),onClick:()=>Pj("hidden"),children:(0,hq.jsx)(mu,{})}):(0,hq.jsx)(h1.V8d,{"aria-label":i8("close","Close"),onClick:()=>f?.(),children:(0,hq.jsx)(mP,{})})]}),"tablet"===n&&c&&(0,hq.jsx)(h1.V8d,{"aria-label":i8("close","Close"),onClick:()=>f?.(),children:(0,hq.jsx)(PK.d3,{})})]})]}),(0,hq.jsx)("div",{className:hZ()("-esm-billing__workspace-module__workspaceContent___oYdxI",{"-esm-billing__workspace-module__marginWorkspaceContent___7hwHu":!!p}),children:(0,hq.jsx)(P2,{workspace:e,additionalPropsFromPage:t},e.name)})]})}async function P9(e,t){let{openedGroup:r}=pA.getState();if(r){if(r.groupName===e&&Ct(r.props,t))return!0;else if(!await Cr({reason:"CLOSE_WORKSPACE_GROUP",explicit:!1}))return!1}return pA.setState(r=>({...r,openedGroup:{groupName:e,props:t},openedWindows:[]})),!0}async function P7(e){let{openedGroup:t,openedWindows:r}=pA.getState();if(t){if(r.length>0&&!(e||await Cr({reason:"CLOSE_WORKSPACE_GROUP",explicit:!0})))return!1;pA.setState(e=>({...e,openedGroup:null,openedWindows:[]}))}return!0}async function Ce(e,t=null,r=null,n=null){let i=pA.getState();if(!i.registeredWorkspacesByName[e])throw Error(`Unable to launch workspace ${e}. Workspace is not registered`);let o=pN(e);if(!o)throw Error(`Unable to launch workspace ${e}. Workspace is not registered to a workspace window`);let{openedGroup:a}=i,{name:s}=o,l=pM(s);if(!l)throw Error(`Unable to launch workspace ${e}. Workspace window ${o.name} is not registered to a workspace group`);let u=pI(e);if(a&&(a.groupName!==l.name||!Ct(a.props,n)))return!!await Cr({reason:"CLOSE_WORKSPACE_GROUP",explicit:!0})&&(pA.setState({...i,openedGroup:{groupName:l.name,props:n},openedWindows:[{windowName:s,openedWorkspaces:[Cs(e,t)],props:r,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0);if(u>=0){let n=i.openedWindows[u],o=i.openedGroup?.props??{},a=i.isMostRecentlyOpenedWindowHidden,{openedWorkspaces:c}=n;if(Ct(n.props,r)){let d=c.find(t=>t.workspaceName===e);return d&&Ct(d.props,t)?((a||u!==i.openedWindows.length-1)&&pA.setState(Cn.restoreWindow(i,s)),!0):!!await Cr({reason:"CLOSE_WORKSPACE",explicit:!1,windowName:s,workspaceName:e})&&(pA.setState({...i,openedGroup:{groupName:l.name,props:i?.openedGroup?.props??o},openedWindows:[...i.openedWindows.filter((e,t)=>t!==u),{windowName:s,openedWorkspaces:[Cs(e,t)],props:n?.props??r,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0)}return!!await Cr({reason:"CLOSE_WINDOW",explicit:!1,windowName:s})&&(pA.setState({...i,openedGroup:{groupName:l.name,props:o??i?.openedGroup?.props},openedWindows:[...i.openedWindows.filter((e,t)=>t!==u),{windowName:s,openedWorkspaces:[Cs(e,t)],props:r,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0)}return"closable"!=l.persistence?(pA.setState({...i,openedGroup:{groupName:l.name,props:n??i?.openedGroup?.props??null},openedWindows:[...i.openedWindows,{windowName:s,openedWorkspaces:[Cs(e,t)],props:r,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0):!!await Cr({reason:"CLOSE_OTHER_WINDOWS",explicit:!1,windowNameToSpare:o.name})&&(pA.setState({...i,openedGroup:{groupName:l.name,props:n??i?.openedGroup?.props??null},openedWindows:[{windowName:s,openedWorkspaces:[Cs(e,t)],props:r,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0)}function Ct(e,t){return null==e||null==t||F(e,t)}function Cr(e){function t(e,t){let r=[];for(let n=e.openedWorkspaces.length-1;n>=0;n--){let i=e.openedWorkspaces[n];if(i.hasUnsavedChanges&&r.push(i),t&&i.workspaceName===t)break}return r}let{openedWindows:r,workspaceTitleByWorkspaceName:n}=pA.getState(),i=[];switch(e.reason){case"CLOSE_WORKSPACE_GROUP":i=r.flatMap(e=>t(e));break;case"CLOSE_WINDOW":{let n=r.find(t=>t.windowName===e.windowName);if(!n)throw Error(`Window ${e.windowName} not found in opened windows.`);i=t(n);break}case"CLOSE_WORKSPACE":{let n=r.find(t=>t.windowName===e.windowName);if(!n)throw Error(`Window ${e.windowName} not found in opened windows.`);i=t(n,e.workspaceName);break}case"CLOSE_OTHER_WINDOWS":i=r.filter(t=>t.windowName!==e.windowNameToSpare).flatMap(e=>t(e))}return 0===i.length?Promise.resolve(!0):new Promise(e=>{let t=DY("workspace2-close-prompt",{size:"sm",onConfirm:()=>{t(),e(!0)},onCancel:()=>{t(),e(!1)},affectedWorkspaceTitles:i.map(e=>n[e.workspaceName])})})}let Cn={setWindowMaximized(e,t,r){let n=e.openedWindows.findIndex(e=>e.windowName===t),i=[...e.openedWindows],o={...i[n],maximized:r};return i[n]=o,{...e,openedWindows:i}},hideWindow:e=>({...e,isMostRecentlyOpenedWindowHidden:!0}),restoreWindow(e,t){let r=e.openedWindows.findIndex(e=>e.windowName===t),n=e.openedWindows[r],i=[...e.openedWindows.filter((e,t)=>t!==r),n];return{...e,openedWindows:i,isMostRecentlyOpenedWindowHidden:!1}},closeWorkspace(e,t){let r=pI(t);if(r<0)return e;let n={...e.openedWindows[r]},i=n.openedWorkspaces.findIndex(e=>e.workspaceName===t),o=[...e.openedWindows];n.openedWorkspaces=n.openedWorkspaces.slice(0,i);let a=e.isMostRecentlyOpenedWindowHidden;if(0===n.openedWorkspaces.length){let t=r===e.openedWindows.length-1;o.splice(r,1),t&&o.length>0&&(a=!1)}else o[r]=n;return{...e,openedWindows:o,isMostRecentlyOpenedWindowHidden:a}},openChildWorkspace(e,t,r,n){let i=e.registeredWorkspacesByName[r];if(!i)throw Error(`No workspace named "${r}" registered`);let o=e.registeredWorkspacesByName[t];if(!o)throw Error(`No workspace named "${t}" registered`);if(o.window!==i.window)throw Error(`Child workspace ${r} does not belong to the same workspace window as parent workspace ${t}`);let a=e.openedWindows.findIndex(e=>e.windowName===i.window);if(-1==a)throw Error(`Cannot open child workspace ${r} as window ${i.window} is not opened`);let{openedWorkspaces:s}=e.openedWindows[a],l=s.findIndex(e=>e.workspaceName===t);if(-1===l)throw Error(`Cannot open child workspace ${r} from parent workspace ${t} as the parent is not opened within the workspace window`);let u=s.slice(0,l+1);return{openedWindows:e.openedWindows.map((e,t)=>t==a?{...e,openedWorkspaces:[...u,Cs(r,n)]}:e)}},setHasUnsavedChanges(e,t,r){let n=pI(t);if(n<0)return e;let i={...e.openedWindows[n]},o=i.openedWorkspaces.findIndex(e=>e.workspaceName===t);if(o<0)return e;i.openedWorkspaces[o]={...i.openedWorkspaces[o],hasUnsavedChanges:r};let a=[...e.openedWindows];return a[n]=i,{...e,openedWindows:a}},setWorkspaceTitle(e,t,r){let n={...e.workspaceTitleByWorkspaceName};return null===r?delete n[t]:n[t]=r,{...e,workspaceTitleByWorkspaceName:n}}};function Ci(){return p4(pA,Cn)}let Co=()=>(0,pq.useContext)(fu),Ca=()=>Object.keys(pA.getState().registeredWorkspacesByName);function Cs(e,t){return{workspaceName:e,props:t??{},hasUnsavedChanges:!1,uuid:cg()}}let Cl={workspaceOuterContainer:"-esm-billing__workspace2-module__workspaceOuterContainer___DLiCR",narrowWorkspace:"-esm-billing__workspace2-module__narrowWorkspace___VL0kF",widerWorkspace:"-esm-billing__workspace2-module__widerWorkspace___3QgrA",extraWideWorkspace:"-esm-billing__workspace2-module__extraWideWorkspace___s7nnh",workspaceMiddleContainer:"-esm-billing__workspace2-module__workspaceMiddleContainer___mTGNN",maximized:"-esm-billing__workspace2-module__maximized___-yo9l",hidden:"-esm-billing__workspace2-module__hidden___K2ryM",workspaceInnerContainer:"-esm-billing__workspace2-module__workspaceInnerContainer___o3zVl",workspaceSpacer:"-esm-billing__workspace2-module__workspaceSpacer___N6-ox",loader:"-esm-billing__workspace2-module__loader___29hpw",hiddenExtraWorkspace:"-esm-billing__workspace2-module__hiddenExtraWorkspace___-W7TY",header:"-esm-billing__workspace2-module__header___p0kuD",headerButtons:"-esm-billing__workspace2-module__headerButtons___hMydG",workspaceContent:"-esm-billing__workspace2-module__workspaceContent___uROr7",overlayHeaderSpacer:"-esm-billing__workspace2-module__overlayHeaderSpacer___zdrhx",isActionMenuOpened:"-esm-billing__workspace2-module__isActionMenuOpened___Wc1Il",showActionMenu:"-esm-billing__workspace2-module__showActionMenu___qCVQ-",marginWorkspaceContent:"-esm-billing__workspace2-module__marginWorkspaceContent___A+20C",workspaceContainerWithActionMenu:"-esm-billing__workspace2-module__workspaceContainerWithActionMenu___S98dq",workspaceFixedContainer:"-esm-billing__workspace2-module__workspaceFixedContainer___c9Uny",workspaceContainerWithoutActionMenu:"-esm-billing__workspace2-module__workspaceContainerWithoutActionMenu___u8FbT"},Cu=({title:e,children:t,hasUnsavedChanges:r=!1})=>{let n=hd(),{setWindowMaximized:i,hideWindow:o,setHasUnsavedChanges:a,openedWindows:s,openedGroup:l,registeredGroupsByName:u,registeredWindowsByName:c,registeredWorkspacesByName:d,workspaceTitleByWorkspaceName:p,setWorkspaceTitle:f,isMostRecentlyOpenedWindowHidden:h}=Ci(),{workspaceName:m,isRootWorkspace:y,closeWorkspace:g,showActionMenu:b}=Co(),v=pI(m),w=s[v],x=w?.openedWorkspaces.find(e=>e.workspaceName===m);if((0,pq.useEffect)(()=>{x?.hasUnsavedChanges!=r&&a(m,r??!1)},[x?.hasUnsavedChanges,r,m,a]),(0,pq.useEffect)(()=>{p[m]!==e&&f(m,e)},[p,m,e,f]),v<0||null==l||null==x)return null;let E=u[l.groupName];if(!E)throw Error(`Cannot find registered workspace group ${l.groupName}`);let S=d[m].window,D=c[S];if(!D)throw Error(`Cannot find registered workspace window ${S}`);let{icon:O,canMaximize:P}=D,C="closable"===E.persistence,k=!!O&&!C,{maximized:j}=w,T=D?.width??"narrow",R=Object.values(c).some(e=>e.group===l.groupName&&void 0!==e.icon),A=v<s.length-1||h;return(0,hq.jsxs)("div",{className:hZ()(Cl.workspaceOuterContainer,{[Cl.narrowWorkspace]:"narrow"===T,[Cl.widerWorkspace]:"wider"===T,[Cl.extraWideWorkspace]:"extra-wide"===T,[Cl.isActionMenuOpened]:R}),children:[(0,hq.jsx)("div",{className:hZ()(Cl.workspaceSpacer,{[Cl.hidden]:A})}),(0,hq.jsx)("div",{className:hZ()(Cl.workspaceMiddleContainer,{[Cl.maximized]:j,[Cl.hidden]:A,[Cl.isRootWorkspace]:y,[Cl.showActionMenu]:b}),children:(0,hq.jsxs)("div",{className:hZ()(Cl.workspaceInnerContainer,{[Cl.maximized]:j,[Cl.hidden]:A,[Cl.isRootWorkspace]:y}),children:[(0,hq.jsxs)(h1.Y9Y,{"aria-label":i8("workspaceHeader"),className:Cl.header,children:[(0,hq.jsx)(h1.bCw,{prefix:"",children:e}),(0,hq.jsx)("div",{className:Cl.overlayHeaderSpacer}),(0,hq.jsx)(h1.wdv,{className:Cl.headerButtons,children:hp(n)?(0,hq.jsxs)(hq.Fragment,{children:[(P||j)&&(0,hq.jsx)(h1.V8d,{"aria-label":j?i8("minimize"):i8("maximize"),onClick:()=>i(S,!j),children:j?(0,hq.jsx)(PW.Xj,{}):(0,hq.jsx)(PW.hz,{})}),k&&(0,hq.jsx)(h1.V8d,{"aria-label":i8("hide"),onClick:()=>o(),children:(0,hq.jsx)(mu,{})}),!C&&(0,hq.jsx)(h1.V8d,{"aria-label":i8("close"),onClick:()=>g({closeWindow:!0}),children:(0,hq.jsx)(mP,{})})]}):(0,hq.jsxs)(hq.Fragment,{children:[k&&(0,hq.jsx)(h1.V8d,{"aria-label":i8("hide"),onClick:()=>o(),children:(0,hq.jsx)(PK.d3,{})}),(0,hq.jsx)(h1.V8d,{"aria-label":i8("close"),onClick:()=>{C?P7():g({closeWindow:!0})},children:(0,hq.jsx)(mP,{})})]})})]}),(0,hq.jsx)("div",{className:hZ()(Cl.workspaceContent),children:t})]})})]})},Cc="-esm-billing__action-menu-button2-module__container___gYRoa",Cd="-esm-billing__action-menu-button2-module__elementContainer___vBViO",Cp="-esm-billing__action-menu-button2-module__active___uRJRA",Cf="-esm-billing__action-menu-button2-module__focused___D4VYB";function Ch({getIcon:e,hasUnsavedChanges:t,tagContent:r}){return(0,hq.jsxs)(hq.Fragment,{children:[e({size:16}),t?(0,hq.jsx)("span",{className:"-esm-billing__action-menu-button2-module__interruptedTag___35fO7",children:"!"}):(0,hq.jsx)("span",{className:"-esm-billing__action-menu-button2-module__countTag___l8lfc",children:r})]})}let Cm=({icon:e,label:t,tagContent:r,workspaceToLaunch:n,onBeforeWorkspaceLaunch:i})=>{let o=hd(),{openedWindows:a,restoreWindow:s,hideWindow:l,isMostRecentlyOpenedWindowHidden:u}=Ci(),{extension:c}=(0,pq.useContext)(pZ),d=a.findIndex(e=>e.windowName===c?.extensionId),p=a[d],f=null!=p,h=f&&(d<a.length-1||u),m=f&&!h,y=p?.openedWorkspaces.some(e=>e.hasUnsavedChanges)??!1,g=async()=>{if(f)h?s(p.windowName):l();else if(await (i?.()??!0)){let{workspaceName:e,workspaceProps:t,windowProps:r}=n;Ce(e,t,r)}};return"tablet"===o||"phone"===o?(0,hq.jsxs)(h1.$nd,{className:hZ()(Cc,{[Cp]:f&&!m,[Cf]:m}),iconDescription:t,kind:"ghost",onClick:g,role:"button",tabIndex:0,size:"md",children:[(0,hq.jsx)("span",{className:Cd,children:(0,hq.jsx)(Ch,{hasUnsavedChanges:y,getIcon:e,tagContent:r})}),(0,hq.jsx)("span",{children:t})]}):(0,hq.jsx)(h1.K0,{align:"left","aria-label":t,className:hZ()(Cc,{[Cp]:f&&!m,[Cf]:m}),enterDelayMs:300,kind:"ghost",label:t,onClick:g,size:"md",children:(0,hq.jsx)("div",{className:Cd,children:(0,hq.jsx)(Ch,{hasUnsavedChanges:y,getIcon:e,tagContent:r})})})};function Cy({showContactDetails:e,toggleContactDetails:t,className:r}){return(0,hq.jsx)(h1.$nd,{className:r,iconDescription:"Toggle contact details",kind:"ghost",onClick:t,renderIcon:e?mO:mE,children:e?i8("showLess","Show less"):i8("showMore","Show more")})}let Cg={contactDetails:"-esm-billing__patient-banner-contact-details-module__contactDetails___AvROu",deceased:"-esm-billing__patient-banner-contact-details-module__deceased___DDd39",heading:"-esm-billing__patient-banner-contact-details-module__heading___GGJyV",row:"-esm-billing__patient-banner-contact-details-module__row___8JcKK",col:"-esm-billing__patient-banner-contact-details-module__col___ct1O9",relationship:"-esm-billing__patient-banner-contact-details-module__relationship___GTTsg"},Cb=({patientUuid:e})=>{let{cohorts:t=[],isLoading:r}=function(e){let t=e?`${oc}/cohortm/cohortmember?patient=${e}&v=custom:(uuid,patient:ref,cohort:(uuid,name,startDate,endDate))`:null,{data:r,isLoading:n}=fv()(t,oh),i=r?.data?.results.map(e=>({uuid:e.cohort.uuid,name:e.cohort.name,startDate:e.cohort.startDate,endDate:e.cohort.endDate}));return(0,pq.useMemo)(()=>({cohorts:i,isLoading:n}),[n,i])}(e);return(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsxs)("p",{className:Cg.heading,children:[i8("patientLists","Patient Lists")," (",t?.length??0,")"]}),r?(0,hq.jsx)(h1.OuH,{description:`${i8("loading","Loading")} ...`,role:"progressbar"}):(0,hq.jsxs)("ul",{children:[(()=>{if(t?.length>0){let e=t.sort((e,t)=>SL(e?.startDate).getTime()-SL(t?.startDate).getTime()).slice(0,3);return e?.map(e=>(0,hq.jsx)("li",{children:(0,hq.jsx)(pJ,{to:`${window.spaBase}/home/patient-lists/${e.uuid}`,children:e.name},e.uuid)},e.uuid))}return(0,hq.jsx)("li",{children:"--"})})(),t.length>3&&(0,hq.jsx)("li",{className:Cg.link,children:(0,hq.jsx)(pJ,{to:`${window.spaBase}/home/patient-lists`,children:i8("seeMoreLists","See {{count}} more lists",{count:t?.length-3})})})]})]})},Cv=({patientId:e})=>{let{patient:t,isLoading:r}=hx(e),n=t?.address?.find(e=>"home"===e.use),i=e=>e.split("#")[1];return r?(0,hq.jsx)(h1.OuH,{description:`${i8("loading","Loading")} ...`,role:"progressbar"}):(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsx)("p",{className:Cg.heading,children:i8("address","Address")}),(0,hq.jsx)("ul",{children:n?Object.entries(n).filter(([e])=>"id"!==e&&"use"!==e).map(([e,t])=>"extension"===e?n.extension?.[0]?.extension?.map((t,r)=>(0,hq.jsxs)("li",{children:[i8(i(t.url),i(t.url)),": ",t.valueString]},`address-${e}-${r}`)):(0,hq.jsxs)("li",{children:[i8(e,e),": ",t]},`address-${e}`)):(0,hq.jsx)("li",{children:"--"})})]})},Cw=({patientUuid:e})=>{let{isLoading:t,contactAttributes:r}=(e=>{let{contactAttributeTypes:t=[]}=fG({externalModuleName:"@openmrs/esm-patient-banner-app"}),{attributes:r,error:n,isLoading:i}=(e=>{let{data:t,error:r,isLoading:n}=fX()(`${oc}/patient/${e}?v=custom:(uuid,display,identifiers:(identifier,uuid,preferred,location:(uuid,name),identifierType:(uuid,name,format,formatDescription,validator)),person:(uuid,display,gender,birthdate,dead,age,deathDate,birthdateEstimated,causeOfDeath,preferredName:(uuid,preferred,givenName,middleName,familyName),attributes,preferredAddress:(uuid,preferred,address1,address2,cityVillage,longitude,stateProvince,latitude,country,postalCode,countyDistrict,address3,address4,address5,address6,address7)))`,oh);return{isLoading:n,attributes:t?.data.person.attributes??[],error:r}})(e);return{contactAttributes:(0,pq.useMemo)(()=>r.filter(({attributeType:e})=>t?.some(t=>e.uuid===t)),[r,t]),isLoading:i,error:n}})(e),n=(0,pq.useMemo)(()=>r?[...r?.map(e=>[e.attributeType.display?i8(e.attributeType.display,e.attributeType.display):"",e.value])]:[],[r]);return(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsx)("p",{className:Cg.heading,children:i8("contactDetails","Contact Details")}),t?(0,hq.jsx)(h1.OuH,{description:`${i8("loading","Loading")} ...`,role:"progressbar"}):(0,hq.jsx)("ul",{children:n.length?n.map(([e,t],r)=>(0,hq.jsxs)("li",{children:[e,": ",t]},`${e}-${t}-${r}`)):(0,hq.jsx)("li",{children:"--"})})]})},C_=({patientId:e})=>{let{data:t,isLoading:r}=function(e){let t=`${oc}/relationship?v=custom:(display,uuid,personA:(age,display,birthdate,uuid),personB:(age,display,birthdate,uuid),relationshipType:(uuid,display,description,aIsToB,bIsToA))&person=${e}`,{data:r,error:n,isLoading:i,isValidating:o}=fv()(e?t:null,oh),a=r?.data?.results?.length?function(e,t){let r=[];for(let n of t)e===n.personA.uuid?r.push({uuid:`${n.uuid}`,display:n.personB.display,relativeAge:n.personB.age,relativeUuid:n.personB.uuid,relationshipType:n.relationshipType.bIsToA}):r.push({uuid:`${n.uuid}`,display:n.personA.display,relativeAge:n.personA.age,relativeUuid:n.personA.uuid,relationshipType:n.relationshipType.aIsToB});return r}(e,r.data.results):null;return{data:r?a:null,error:n,isLoading:i,isValidating:o}}(e);return(0,hq.jsxs)(hq.Fragment,{children:[(0,hq.jsx)("p",{className:Cg.heading,children:i8("relationships","Relationships")}),r?(0,hq.jsx)(h1.OuH,{description:`${i8("loading","Loading")} ...`,role:"progressbar"}):(0,hq.jsx)("ul",{children:t&&t.length>0?(0,hq.jsx)(hq.Fragment,{children:t.map(e=>(0,hq.jsxs)("li",{className:Cg.relationship,children:[(0,hq.jsx)("div",{children:(0,hq.jsx)(pJ,{to:`${window.spaBase}/patient/${e.relativeUuid}/chart`,children:e.display})}),(0,hq.jsx)("div",{children:e.relationshipType}),(0,hq.jsx)("div",{children:`${e.relativeAge?e.relativeAge:"--"} ${e.relativeAge?1===e.relativeAge?i8("yearAbbreviation","yr"):i8("yearsAbbreviation","yrs"):""}`})]},e.uuid))}):(0,hq.jsx)("li",{children:"--"})})]})};function Cx({patientId:e,deceased:t}){return(0,hq.jsxs)("div",{className:hZ()(Cg.contactDetails,{[Cg.deceased]:t}),children:[(0,hq.jsxs)("div",{className:Cg.row,children:[(0,hq.jsx)("div",{className:Cg.col,children:(0,hq.jsx)(Cv,{patientId:e})}),(0,hq.jsx)("div",{className:Cg.col,children:(0,hq.jsx)(Cw,{patientUuid:e})})]}),(0,hq.jsxs)("div",{className:Cg.row,children:[(0,hq.jsx)("div",{className:Cg.col,children:(0,hq.jsx)(C_,{patientId:e})}),(0,hq.jsx)("div",{className:Cg.col,children:(0,hq.jsx)(Cb,{patientUuid:e})})]})]})}function CE(e){let t=document.querySelector("template#loading-spinner");if(t){let r=t.content.cloneNode(!0),n=Array.prototype.map.call(r.childNodes,e=>e);return e.appendChild(r),()=>n.forEach(e=>e.remove())}return()=>{}}let CS="-esm-billing__action-menu2-module__container___4aX3S";function CD({workspaceGroup:e,groupProps:t}){let r=hd(),{persistence:n}=e;return(0,hq.jsx)("aside",{className:"-esm-billing__action-menu2-module__sideRail___a7qg9",children:(0,hq.jsxs)("div",{className:CS,children:["closable"==n&&hp(r)&&(0,hq.jsx)(h1.K0,{align:"left",onClick:()=>P7(),label:i8("close"),kind:"ghost",children:(0,hq.jsx)(mP,{})}),(0,hq.jsx)(pZ.Provider,{value:{moduleName:e.moduleName,featureName:e.name},children:(0,hq.jsx)(fr,{className:CS,name:e.name,state:{groupProps:t}})})]})})}function CO(e){let t=new URL(e,window.location.origin).pathname,r=new URL(window.getOpenmrsSpaBase?.()??"/",window.location.origin).pathname,n=r.endsWith("/")?r.slice(0,-1):r,i=null;return n?n===t?i="/":t.startsWith(`${n}/`)&&(i=t.slice(n.length)):i=t,{full:t,spaRelative:i}}let CP=({lifeCycle:e,openedWorkspace:t,openedWindow:r,isRootWorkspace:n,isLeafWorkspace:i,showActionMenu:o})=>{let{openedGroup:a,closeWorkspace:s,openChildWorkspace:l}=Ci(),u=(0,pq.useMemo)(()=>t&&{closeWorkspace:async(e={})=>{let{closeWindow:n=!1,discardUnsavedChanges:i=!1}=e;return n?!!(i||await Cr({reason:"CLOSE_WINDOW",explicit:!0,windowName:r.windowName}))&&(s(r.openedWorkspaces[0].workspaceName),!0):!!(i||await Cr({reason:"CLOSE_WORKSPACE",explicit:!0,windowName:r.windowName,workspaceName:t.workspaceName}))&&(s(t.workspaceName),!0)},launchChildWorkspace:async(e,n)=>{let i=t.workspaceName,{openedWorkspaces:o}=r,a=o.findIndex(e=>e.workspaceName===i);-1===a||a!==o.length-1&&o.slice(a+1).some(e=>e.hasUnsavedChanges)&&!await Cr({reason:"CLOSE_WORKSPACE",explicit:!0,windowName:r.windowName,workspaceName:o[a+1].workspaceName})||l(i,e,n||{})},workspaceName:t.workspaceName,workspaceProps:t.props,windowProps:r.props,groupProps:a&&a.props?a.props:null,workspaceMeta:pA.getState().registeredWorkspacesByName[t.workspaceName]?.meta??{},isRootWorkspace:n,isLeafWorkspace:i,windowName:r.windowName,showActionMenu:o},[t,s,a,r]);if(!e){let{registeredWorkspacesByName:e}=pA.getState(),r=e[t.workspaceName],i=r&&r.window?r.window:void 0,{registeredWindowsByName:s}=pA.getState(),l=i?s[i]:void 0,u=l&&l.width?l.width:"narrow",c=Object.values(s).some(e=>e.group===a?.groupName&&void 0!==e.icon);return(0,hq.jsxs)("div",{className:hZ()(Cl.workspaceOuterContainer,{[Cl.narrowWorkspace]:"narrow"===u,[Cl.widerWorkspace]:"wider"===u,[Cl.extraWideWorkspace]:"extra-wide"===u,[Cl.isActionMenuOpened]:c}),children:[(0,hq.jsx)("div",{className:Cl.workspaceSpacer}),(0,hq.jsx)("div",{className:hZ()(Cl.workspaceMiddleContainer,{[Cl.isRootWorkspace]:n,[Cl.showActionMenu]:o}),children:(0,hq.jsx)("div",{className:hZ()(Cl.workspaceInnerContainer,{[Cl.isRootWorkspace]:n}),children:(0,hq.jsx)(h1.OuH,{className:Cl.loader,description:`${i8("loading")} ...`})})})]})}return(0,hq.jsx)(P4,{config:e,mountParcel:pz,...u},t.workspaceName)},CC=({openedWindow:e,showActionMenu:t})=>{let{openedWorkspaces:r}=e,[n,i]=(0,pq.useState)({}),{registeredWorkspacesByName:o}=pA.getState();return(0,pq.useEffect)(()=>{let e=!1;return Promise.all(r.map(async e=>{let{moduleName:t,component:r}=o[e.workspaceName];return[e.uuid,await h$(t,r)]})).then(t=>{e||i(Object.fromEntries(t))}),()=>{e=!0}},[r]),(0,hq.jsx)(hq.Fragment,{children:r.map((i,o)=>(0,hq.jsx)(CP,{openedWorkspace:i,openedWindow:e,lifeCycle:n[i.uuid],isRootWorkspace:0===o,isLeafWorkspace:o===r.length-1,showActionMenu:t},i.uuid))})};function Ck(e){e&&(0,fn.createRoot)(e).render((0,hq.jsx)(Cj,{}))}function Cj(){let{openedGroup:e,openedWindows:t,registeredGroupsByName:r,registeredWindowsByName:n}=Ci();if((0,pq.useEffect)(()=>cV("before-page-changed",t=>{let{newPage:n,cancelNavigation:i,oldUrl:o,newUrl:a}=t;if(!e)return;if(n)return void i(P7().then(e=>!e));let s=r[e.groupName],l=s?.scopePattern;l&&function(e,t,r){try{let n=new RegExp(e),i=CO(t),o=CO(r);if(null===i.spaRelative||null===o.spaRelative)return!0;let a=n.exec(i.spaRelative),s=n.exec(o.spaRelative);if(a&&s||(a=n.exec(i.full),s=n.exec(o.full)),!a||!s)return!0;if(a.length>1)return!a.slice(1).every((e,t)=>e===s[t+1]);return!1}catch{return!0}}(l,o,a)&&i(P7().then(e=>!e))}),[e,r]),!e)return null;let i=r[e.groupName],o=t.some(e=>e.maximized),{name:a}=i,s=Object.values(n).filter(e=>e.group===a&&void 0!==e.icon).sort((e,t)=>(e.order??Number.MAX_VALUE)-(t.order??Number.MAX_VALUE)).length>0;return(0,hq.jsxs)("div",{className:hZ()("-esm-billing__workspace-windows-and-menu-module__workspaceWindowsAndMenuContainer___crgqC",{"-esm-billing__workspace-windows-and-menu-module__overlay___FCMKG":i.overlay,"-esm-billing__workspace-windows-and-menu-module__hasMaximizedWindow___gk319":o}),children:[(0,hq.jsx)("div",{className:"-esm-billing__workspace-windows-and-menu-module__workspaceWindowsContainer___MrLlf",children:t.map(e=>(0,hq.jsx)(CC,{openedWindow:e,showActionMenu:s},e.windowName))}),s&&(0,hq.jsx)(CD,{workspaceGroup:i,groupProps:e.props})]})}function CT(e,t,r){if(null==e)return r;let n=E7(e);if(!n)return console.warn(`matchLocale: invalid requested locale tag: ${JSON.stringify(e)}`),r;let i=[];for(let e of t){let t=E7(e);if(!t){console.warn(`matchLocale: skipping invalid available locale tag: ${JSON.stringify(e)}`);continue}i.push({canonical:t,original:e})}let o=n;for(;o;){let e=i.find(e=>e.canonical===o);if(e)return e.original;let t=o+"-",r=i.find(e=>e.canonical.startsWith(t));if(r)return r.original;if("ht"===o){o="fr-HT";continue}let n=o.lastIndexOf("-");if(-1===n)break;let a=(o=o.slice(0,n)).lastIndexOf("-");-1!==a&&o.length-a==2&&(o=o.slice(0,a))}return r}function CR(e=window.localStorage){try{return e.getItem("test"),!0}catch{return!1}}function CA(e){return!!e&&e.constructor===Object}var CN=r(9589);function CM(e){let[t,r,n]=e.split(".");return`${t}.${r}.${n}`}function CI(e,t){let r=function(e){let t=e.indexOf("-");if(t>=0){let r=CM(e.slice(0,t)),n=e.slice(t+1);return`${r}-${n}`}return CM(e)}(t);return CN.satisfies(r,e,{includePrerelease:!0})}async function C$(e,t={}){let r,{shouldRetry:n,getDelay:i,onError:o}=t;n=n??(e=>e<=5),i=i??(e=>(function(e,t=!1){return 1e3*Math.pow(2,t?e+1:e)})(e));let a=0;do try{return await CL(i(a)),await e()}catch(e){o?.(e,a),r=e}while(n(a++));throw r}async function CL(e){if(!(e<=0))return new Promise(t=>setTimeout(t,e))}}}]);