@openmrs/esm-styleguide
Version:
The styleguide for OpenMRS SPA
2 lines • 768 kB
JavaScript
/*! For license information please see openmrs-esm-styleguide.js.LICENSE.txt */
System.register(["@openmrs/esm-error-handling","@openmrs/esm-extensions","@openmrs/esm-navigation","@openmrs/esm-react-utils","@openmrs/esm-state","@openmrs/esm-translations","dayjs","i18next","react","react-dom","react-i18next","rxjs"],(function(e,t){var n={},r={},o={},i={},a={},u={},s={},c={},l={},f={},d={},h={};return Object.defineProperty(l,"__esModule",{value:!0}),Object.defineProperty(f,"__esModule",{value:!0}),{setters:[function(){},function(e){r.getExtensionInternalStore=e.getExtensionInternalStore,r.getExtensionStore=e.getExtensionStore},function(){},function(){},function(e){a.createGlobalStore=e.createGlobalStore,a.getGlobalStore=e.getGlobalStore},function(){},function(e){s.default=e.default},function(e){c.default=e.default},function(e){Object.keys(e).forEach((function(t){l[t]=e[t]}))},function(e){Object.keys(e).forEach((function(t){f[t]=e[t]}))},function(){},function(e){h.BehaviorSubject=e.BehaviorSubject,h.Subject=e.Subject}],execute:function(){e((()=>{var e={701:function(e){e.exports=function(){"use strict";return function(e,t,n){t.prototype.isToday=function(){var e="YYYY-MM-DD",t=n();return this.format(e)===t.format(e)}}}()},353:(e,t,n)=>{!function(t){"use strict";var r=function(e){return function(t,n){return"object"==typeof t&&(n=t,t=null),null==t&&(t=(new Date).toString()),n||(n={}),e.call(this,t,n)}},o=n(42),i=e.exports={generate:r((function(e,t){return new o(e,t)}))};t&&(t.fn.geopattern=r((function(e,n){return this.each((function(){var r=t(this).attr("data-title-sha");r&&(n=t.extend({hash:r},n));var o=i.generate(e,n);t(this).css("background-image",o.toDataUrl())}))})))}("undefined"!=typeof jQuery?jQuery:null)},851:e=>{"use strict";e.exports={hex2rgb:function(e){e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(e,t,n,r){return t+t+n+n+r+r}));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=e.r,n=e.g,r=e.b;t/=255,n/=255,r/=255;var o,i,a=Math.max(t,n,r),u=Math.min(t,n,r),s=(a+u)/2;if(a===u)o=i=0;else{var c=a-u;switch(i=s>.5?c/(2-a-u):c/(a+u),a){case t:o=(n-r)/c+(n<r?6:0);break;case n:o=(r-t)/c+2;break;case r:o=(t-n)/c+4}o/=6}return{h:o,s:i,l:s}},hsl2rgb:function(e){var t,n,r,o=function(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e},i=e.h,a=e.s,u=e.l;if(0===a)t=n=r=u;else{var s=u<.5?u*(1+a):u+a-u*a,c=2*u-s;t=o(c,s,i+1/3),n=o(c,s,i),r=o(c,s,i-1/3)}return{r:Math.round(255*t),g:Math.round(255*n),b:Math.round(255*r)}},rgb2rgbString:function(e){return"rgb("+[e.r,e.g,e.b].join(",")+")"}}},42:(e,t,n)=>{"use strict";var r=n(495),o=n(851),i=n(451),a=n(138),u={baseColor:"#933c3c"},s=["octogons","overlappingCircles","plusSigns","xes","sineWaves","hexagons","overlappingRings","plaid","triangles","squares","concentricCircles","diamonds","tessellation","nestedSquares","mosaicSquares","chevrons"],c="#222",l="#ddd",f="#000",d=.02,h=.02,p=.15;function y(e,t,n){return parseInt(e.substr(t,n||1),16)}function v(e,t,n,r,o){return(parseFloat(e)-t)*(o-r)/(n-t)+r}function m(e){return e%2==0?l:c}function g(e){return v(e,0,15,h,p)}var b=e.exports=function(e,t){return this.opts=r({},u,t),this.hash=t.hash||i(e),this.svg=new a,this.generateBackground(),this.generatePattern(),this};function w(e){return[[e,0,e,3*e],[0,e,3*e,e]]}function _(e){return[0,0,e,e,0,e,0,0].join(",")}function E(e,t,n,r,o){var i=_(r),a=g(o[0]),u=m(o[0]),s={stroke:f,"stroke-opacity":d,"fill-opacity":a,fill:u};e.polyline(i,s).transform({translate:[t+r,n],scale:[-1,1]}),e.polyline(i,s).transform({translate:[t+r,n+2*r],scale:[1,-1]}),a=g(o[1]),u=m(o[1]),s={stroke:f,"stroke-opacity":d,"fill-opacity":a,fill:u},e.polyline(i,s).transform({translate:[t+r,n+2*r],scale:[-1,-1]}),e.polyline(i,s).transform({translate:[t+r,n],scale:[1,1]})}function S(e,t,n,r,o){var i=g(o),a=m(o),u=_(r),s={stroke:f,"stroke-opacity":d,"fill-opacity":i,fill:a};e.polyline(u,s).transform({translate:[t,n+r],scale:[1,-1]}),e.polyline(u,s).transform({translate:[t+2*r,n+r],scale:[-1,-1]}),e.polyline(u,s).transform({translate:[t,n+r],scale:[1,1]}),e.polyline(u,s).transform({translate:[t+2*r,n+r],scale:[-1,1]})}b.prototype.toSvg=function(){return this.svg.toString()},b.prototype.toString=function(){return this.toSvg()},b.prototype.toBase64=function(){var e=this.toSvg();return"undefined"!=typeof window&&"function"==typeof window.btoa?window.btoa(e):new Buffer(e).toString("base64")},b.prototype.toDataUri=function(){return"data:image/svg+xml;base64,"+this.toBase64()},b.prototype.toDataUrl=function(){return'url("'+this.toDataUri()+'")'},b.prototype.generateBackground=function(){var e,t,n,r;this.opts.color?n=o.hex2rgb(this.opts.color):(t=v(y(this.hash,14,3),0,4095,0,359),r=y(this.hash,17),(e=o.rgb2hsl(o.hex2rgb(this.opts.baseColor))).h=(360*e.h-t+360)%360/360,e.s=r%2==0?Math.min(1,(100*e.s+r)/100):Math.max(0,(100*e.s-r)/100),n=o.hsl2rgb(e)),this.color=o.rgb2hex(n),this.svg.rect(0,0,"100%","100%",{fill:o.rgb2rgbString(n)})},b.prototype.generatePattern=function(){var e=this.opts.generator;if(e){if(s.indexOf(e)<0)throw new Error("The generator "+e+" does not exist.")}else e=s[y(this.hash,20)];return this["geo"+e.slice(0,1).toUpperCase()+e.slice(1)]()},b.prototype.geoHexagons=function(){var e,t,n,r,o,i,a,u=v(y(this.hash,0),0,15,8,60),s=u*Math.sqrt(3),c=2*u,l=function(e){var t=e,n=t/2,r=Math.sin(60*Math.PI/180)*t;return[0,r,n,0,n+t,0,2*t,r,n+t,2*r,n,2*r,0,r].join(",")}(u);for(this.svg.setWidth(3*c+3*u),this.svg.setHeight(6*s),t=0,a=0;a<6;a++)for(i=0;i<6;i++)e=i%2==0?a*s:a*s+s/2,n=g(o=y(this.hash,t)),r={fill:m(o),"fill-opacity":n,stroke:f,"stroke-opacity":d},this.svg.polyline(l,r).transform({translate:[i*u*1.5-c/2,e-s/2]}),0===i&&this.svg.polyline(l,r).transform({translate:[6*u*1.5-c/2,e-s/2]}),0===a&&(e=i%2==0?6*s:6*s+s/2,this.svg.polyline(l,r).transform({translate:[i*u*1.5-c/2,e-s/2]})),0===i&&0===a&&this.svg.polyline(l,r).transform({translate:[6*u*1.5-c/2,5*s+s/2]}),t++},b.prototype.geoSineWaves=function(){var e,t,n,r,o,i,a=Math.floor(v(y(this.hash,0),0,15,100,400)),u=Math.floor(v(y(this.hash,1),0,15,30,100)),s=Math.floor(v(y(this.hash,2),0,15,3,30));for(this.svg.setWidth(a),this.svg.setHeight(36*s),e=0;e<36;e++)t=g(o=y(this.hash,e)),r={fill:"none",stroke:m(o),opacity:t,"stroke-width":s+"px"},n="M0 "+u+" C "+(i=a/4*.7)+" 0, "+(a/2-i)+" 0, "+a/2+" "+u+" S "+(a-i)+" "+2*u+", "+a+" "+u+" S "+(1.5*a-i)+" 0, "+1.5*a+", "+u,this.svg.path(n,r).transform({translate:[-a/4,s*e-1.5*u]}),this.svg.path(n,r).transform({translate:[-a/4,s*e-1.5*u+36*s]})},b.prototype.geoChevrons=function(){var e,t,n,r,o,i,a,u,s,c,l=v(y(this.hash,0),0,15,30,80),h=v(y(this.hash,0),0,15,30,80),p=[[0,0,(e=l)/2,(t=h)-(n=.66*t),e/2,t,0,n,0,0],[e/2,t-n,e,0,e,n,e/2,t,e/2,t-n]].map((function(e){return e.join(",")}));for(this.svg.setWidth(6*l),this.svg.setHeight(6*h*.66),o=0,c=0;c<6;c++)for(s=0;s<6;s++)i=g(u=y(this.hash,o)),r=m(u),a={stroke:f,"stroke-opacity":d,fill:r,"fill-opacity":i,"stroke-width":1},this.svg.group(a).transform({translate:[s*l,c*h*.66-h/2]}).polyline(p).end(),0===c&&this.svg.group(a).transform({translate:[s*l,6*h*.66-h/2]}).polyline(p).end(),o+=1},b.prototype.geoPlusSigns=function(){var e,t,n,r,o,i,a,u=v(y(this.hash,0),0,15,10,25),s=3*u,c=w(u);for(this.svg.setWidth(12*u),this.svg.setHeight(12*u),t=0,a=0;a<6;a++)for(i=0;i<6;i++)n=g(o=y(this.hash,t)),e=a%2==0?0:1,r={fill:m(o),stroke:f,"stroke-opacity":d,"fill-opacity":n},this.svg.group(r).transform({translate:[i*s-i*u+e*u-u,a*s-a*u-s/2]}).rect(c).end(),0===i&&this.svg.group(r).transform({translate:[4*s-i*u+e*u-u,a*s-a*u-s/2]}).rect(c).end(),0===a&&this.svg.group(r).transform({translate:[i*s-i*u+e*u-u,4*s-a*u-s/2]}).rect(c).end(),0===i&&0===a&&this.svg.group(r).transform({translate:[4*s-i*u+e*u-u,4*s-a*u-s/2]}).rect(c).end(),t++},b.prototype.geoXes=function(){var e,t,n,r,o,i,a,u=v(y(this.hash,0),0,15,10,25),s=w(u),c=3*u*.943;for(this.svg.setWidth(3*c),this.svg.setHeight(3*c),t=0,a=0;a<6;a++)for(i=0;i<6;i++)n=g(o=y(this.hash,t)),e=i%2==0?a*c-.5*c:a*c-.5*c+c/4,r={fill:m(o),opacity:n},this.svg.group(r).transform({translate:[i*c/2-c/2,e-a*c/2],rotate:[45,c/2,c/2]}).rect(s).end(),0===i&&this.svg.group(r).transform({translate:[6*c/2-c/2,e-a*c/2],rotate:[45,c/2,c/2]}).rect(s).end(),0===a&&(e=i%2==0?6*c-c/2:6*c-c/2+c/4,this.svg.group(r).transform({translate:[i*c/2-c/2,e-6*c/2],rotate:[45,c/2,c/2]}).rect(s).end()),5===a&&this.svg.group(r).transform({translate:[i*c/2-c/2,e-11*c/2],rotate:[45,c/2,c/2]}).rect(s).end(),0===i&&0===a&&this.svg.group(r).transform({translate:[6*c/2-c/2,e-6*c/2],rotate:[45,c/2,c/2]}).rect(s).end(),t++},b.prototype.geoOverlappingCircles=function(){var e,t,n,r,o,i,a=v(y(this.hash,0),0,15,25,200)/2;for(this.svg.setWidth(6*a),this.svg.setHeight(6*a),e=0,i=0;i<6;i++)for(o=0;o<6;o++)t=g(r=y(this.hash,e)),n={fill:m(r),opacity:t},this.svg.circle(o*a,i*a,a,n),0===o&&this.svg.circle(6*a,i*a,a,n),0===i&&this.svg.circle(o*a,6*a,a,n),0===o&&0===i&&this.svg.circle(6*a,6*a,a,n),e++},b.prototype.geoOctogons=function(){var e,t,n,r,o,i,a=v(y(this.hash,0),0,15,10,60),u=function(e){var t=.33*e;return[t,0,e-t,0,e,t,e,e-t,e-t,e,t,e,0,e-t,0,t,t,0].join(",")}(a);for(this.svg.setWidth(6*a),this.svg.setHeight(6*a),t=0,i=0;i<6;i++)for(o=0;o<6;o++)n=g(r=y(this.hash,t)),e=m(r),this.svg.polyline(u,{fill:e,"fill-opacity":n,stroke:f,"stroke-opacity":d}).transform({translate:[o*a,i*a]}),t+=1},b.prototype.geoSquares=function(){var e,t,n,r,o,i,a=v(y(this.hash,0),0,15,10,60);for(this.svg.setWidth(6*a),this.svg.setHeight(6*a),t=0,i=0;i<6;i++)for(o=0;o<6;o++)n=g(r=y(this.hash,t)),e=m(r),this.svg.rect(o*a,i*a,a,a,{fill:e,"fill-opacity":n,stroke:f,"stroke-opacity":d}),t+=1},b.prototype.geoConcentricCircles=function(){var e,t,n,r,o,i,a=v(y(this.hash,0),0,15,10,60),u=a/5;for(this.svg.setWidth(6*(a+u)),this.svg.setHeight(6*(a+u)),t=0,i=0;i<6;i++)for(o=0;o<6;o++)n=g(r=y(this.hash,t)),e=m(r),this.svg.circle(o*a+o*u+(a+u)/2,i*a+i*u+(a+u)/2,a/2,{fill:"none",stroke:e,opacity:n,"stroke-width":u+"px"}),n=g(r=y(this.hash,39-t)),e=m(r),this.svg.circle(o*a+o*u+(a+u)/2,i*a+i*u+(a+u)/2,a/4,{fill:e,"fill-opacity":n}),t+=1},b.prototype.geoOverlappingRings=function(){var e,t,n,r,o,i,a=v(y(this.hash,0),0,15,10,60),u=a/4;for(this.svg.setWidth(6*a),this.svg.setHeight(6*a),e=0,i=0;i<6;i++)for(o=0;o<6;o++)t=g(r=y(this.hash,e)),n={fill:"none",stroke:m(r),opacity:t,"stroke-width":u+"px"},this.svg.circle(o*a,i*a,a-u/2,n),0===o&&this.svg.circle(6*a,i*a,a-u/2,n),0===i&&this.svg.circle(o*a,6*a,a-u/2,n),0===o&&0===i&&this.svg.circle(6*a,6*a,a-u/2,n),e+=1},b.prototype.geoTriangles=function(){var e,t,n,r,o,i,a,u=v(y(this.hash,0),0,15,15,80),s=u/2*Math.sqrt(3),c=function(e,t){var n=e/2;return[n,0,e,t,0,t,n,0].join(",")}(u,s);for(this.svg.setWidth(3*u),this.svg.setHeight(6*s),e=0,a=0;a<6;a++)for(i=0;i<6;i++)t=g(o=y(this.hash,e)),r={fill:m(o),"fill-opacity":t,stroke:f,"stroke-opacity":d},n=a%2==0?i%2==0?180:0:i%2!=0?180:0,this.svg.polyline(c,r).transform({translate:[i*u*.5-u/2,s*a],rotate:[n,u/2,s/2]}),0===i&&this.svg.polyline(c,r).transform({translate:[6*u*.5-u/2,s*a],rotate:[n,u/2,s/2]}),e+=1},b.prototype.geoDiamonds=function(){var e,t,n,r,o,i,a,u,s,c=v(y(this.hash,0),0,15,10,50),l=v(y(this.hash,1),0,15,10,50),h=[(e=c)/2,0,e,(t=l)/2,e/2,t,0,t/2].join(",");for(this.svg.setWidth(6*c),this.svg.setHeight(3*l),r=0,s=0;s<6;s++)for(u=0;u<6;u++)o=g(a=y(this.hash,r)),i={fill:m(a),"fill-opacity":o,stroke:f,"stroke-opacity":d},n=s%2==0?0:c/2,this.svg.polyline(h,i).transform({translate:[u*c-c/2+n,l/2*s-l/2]}),0===u&&this.svg.polyline(h,i).transform({translate:[6*c-c/2+n,l/2*s-l/2]}),0===s&&this.svg.polyline(h,i).transform({translate:[u*c-c/2+n,l/2*6-l/2]}),0===u&&0===s&&this.svg.polyline(h,i).transform({translate:[6*c-c/2+n,l/2*6-l/2]}),r+=1},b.prototype.geoNestedSquares=function(){var e,t,n,r,o,i,a=v(y(this.hash,0),0,15,4,12),u=7*a;for(this.svg.setWidth(6*(u+a)+6*a),this.svg.setHeight(6*(u+a)+6*a),e=0,i=0;i<6;i++)for(o=0;o<6;o++)t=g(r=y(this.hash,e)),n={fill:"none",stroke:m(r),opacity:t,"stroke-width":a+"px"},this.svg.rect(o*u+o*a*2+a/2,i*u+i*a*2+a/2,u,u,n),t=g(r=y(this.hash,39-e)),n={fill:"none",stroke:m(r),opacity:t,"stroke-width":a+"px"},this.svg.rect(o*u+o*a*2+a/2+2*a,i*u+i*a*2+a/2+2*a,3*a,3*a,n),e+=1},b.prototype.geoMosaicSquares=function(){var e,t,n,r=v(y(this.hash,0),0,15,15,50);for(this.svg.setWidth(8*r),this.svg.setHeight(8*r),e=0,n=0;n<4;n++)for(t=0;t<4;t++)t%2==0?n%2==0?S(this.svg,t*r*2,n*r*2,r,y(this.hash,e)):E(this.svg,t*r*2,n*r*2,r,[y(this.hash,e),y(this.hash,e+1)]):n%2==0?E(this.svg,t*r*2,n*r*2,r,[y(this.hash,e),y(this.hash,e+1)]):S(this.svg,t*r*2,n*r*2,r,y(this.hash,e)),e+=1},b.prototype.geoPlaid=function(){var e,t,n,r,o,i,a=0,u=0;for(t=0;t<36;)a+=y(this.hash,t)+5,n=g(i=y(this.hash,t+1)),e=m(i),r=i+5,this.svg.rect(0,a,"100%",r,{opacity:n,fill:e}),a+=r,t+=2;for(t=0;t<36;)u+=y(this.hash,t)+5,n=g(i=y(this.hash,t+1)),e=m(i),o=i+5,this.svg.rect(u,0,o,"100%",{opacity:n,fill:e}),u+=o,t+=2;this.svg.setWidth(u),this.svg.setHeight(a)},b.prototype.geoTessellation=function(){var e,t,n,r,o,i=v(y(this.hash,0),0,15,5,40),a=i*Math.sqrt(3),u=2*i,s=i/2*Math.sqrt(3),c=function(e,t){return[0,0,t,e/2,0,e,0,0].join(",")}(i,s),l=3*i+2*s,h=2*a+2*i;for(this.svg.setWidth(l),this.svg.setHeight(h),t=0;t<20;t++)switch(n=g(o=y(this.hash,t)),e=m(o),r={stroke:f,"stroke-opacity":d,fill:e,"fill-opacity":n,"stroke-width":1},t){case 0:this.svg.rect(-i/2,-i/2,i,i,r),this.svg.rect(l-i/2,-i/2,i,i,r),this.svg.rect(-i/2,h-i/2,i,i,r),this.svg.rect(l-i/2,h-i/2,i,i,r);break;case 1:this.svg.rect(u/2+s,a/2,i,i,r);break;case 2:this.svg.rect(-i/2,h/2-i/2,i,i,r),this.svg.rect(l-i/2,h/2-i/2,i,i,r);break;case 3:this.svg.rect(u/2+s,1.5*a+i,i,i,r);break;case 4:this.svg.polyline(c,r).transform({translate:[i/2,-i/2],rotate:[0,i/2,s/2]}),this.svg.polyline(c,r).transform({translate:[i/2,h- -i/2],rotate:[0,i/2,s/2],scale:[1,-1]});break;case 5:this.svg.polyline(c,r).transform({translate:[l-i/2,-i/2],rotate:[0,i/2,s/2],scale:[-1,1]}),this.svg.polyline(c,r).transform({translate:[l-i/2,h+i/2],rotate:[0,i/2,s/2],scale:[-1,-1]});break;case 6:this.svg.polyline(c,r).transform({translate:[l/2+i/2,a/2]});break;case 7:this.svg.polyline(c,r).transform({translate:[l-l/2-i/2,a/2],scale:[-1,1]});break;case 8:this.svg.polyline(c,r).transform({translate:[l/2+i/2,h-a/2],scale:[1,-1]});break;case 9:this.svg.polyline(c,r).transform({translate:[l-l/2-i/2,h-a/2],scale:[-1,-1]});break;case 10:this.svg.polyline(c,r).transform({translate:[i/2,h/2-i/2]});break;case 11:this.svg.polyline(c,r).transform({translate:[l-i/2,h/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:[i/2-l,i/2],rotate:[-30,0,0]});break;case 14:this.svg.rect(0,0,i,i,r).transform({translate:[i/2,h/2-i/2-i],rotate:[30,0,i]});break;case 15:this.svg.rect(0,0,i,i,r).transform({scale:[-1,1],translate:[i/2-l,h/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,h/2-h-i/2-i],rotate:[30,0,i]});break;case 17:this.svg.rect(0,0,i,i,r).transform({scale:[-1,-1],translate:[i/2-l,h/2-h-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,i/2-h],rotate:[-30,0,0]});break;case 19:this.svg.rect(0,0,i,i,r).transform({scale:[-1,-1],translate:[i/2-l,i/2-h],rotate:[-30,0,0]})}}},451:e=>{"use strict";function t(){var e=function(){for(var e=16;e<80;e++){var t=s[e-3]^s[e-8]^s[e-14]^s[e-16];s[e]=t<<1|t>>>31}var n,l,f=r,d=o,h=i,p=a,y=u;for(e=0;e<80;e++){e<20?(n=p^d&(h^p),l=1518500249):e<40?(n=d^h^p,l=1859775393):e<60?(n=d&h|p&(d|h),l=2400959708):(n=d^h^p,l=3395469782);var v=(f<<5|f>>>27)+n+y+l+(0|s[e]);y=p,p=h,h=d<<30|d>>>2,d=f,f=v}for(r=r+f|0,o=o+d|0,i=i+h|0,a=a+p|0,u=u+y|0,c=0,e=0;e<16;e++)s[e]=0},t=function(t){s[c]|=(255&t)<<l,l?l-=8:(c++,l=24),16===c&&e()},n=function(e){for(var t="",n=28;n>=0;n-=4)t+=(e>>n&15).toString(16);return t},r=1732584193,o=4023233417,i=2562383102,a=271733878,u=3285377520,s=new Uint32Array(80),c=0,l=24,f=0;return{update:function(e){if("string"==typeof e)return function(e){var n=e.length;f+=8*n;for(var r=0;r<n;r++)t(e.charCodeAt(r))}(e);var n=e.length;f+=8*n;for(var r=0;r<n;r++)t(e[r])},digest:function(){t(128),(c>14||14===c&&l<24)&&e(),c=14,l=24,t(0),t(0),t(f>0xffffffffff?f/1099511627776:0),t(f>4294967295?f/4294967296:0);for(var s=24;s>=0;s-=8)t(f>>s);return n(r)+n(o)+n(i)+n(a)+n(u)}}}e.exports=function(e){if(void 0===e)return t();var n=t();return n.update(e),n.digest()}},138:(e,t,n)=>{"use strict";var r=n(495),o=n(97);function i(){return this.width=100,this.height=100,this.svg=o("svg"),this.context=[],this.setAttributes(this.svg,{xmlns:"http://www.w3.org/2000/svg",width:this.width,height:this.height}),this}e.exports=i,i.prototype.currentContext=function(){return this.context[this.context.length-1]||this.svg},i.prototype.end=function(){return this.context.pop(),this},i.prototype.currentNode=function(){var e=this.currentContext();return e.lastChild||e},i.prototype.transform=function(e){return this.currentNode().setAttribute("transform",Object.keys(e).map((function(t){return t+"("+e[t].join(",")+")"})).join(" ")),this},i.prototype.setAttributes=function(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))},i.prototype.setWidth=function(e){this.svg.setAttribute("width",Math.floor(e))},i.prototype.setHeight=function(e){this.svg.setAttribute("height",Math.floor(e))},i.prototype.toString=function(){return this.svg.toString()},i.prototype.rect=function(e,t,n,i,a){var u=this;if(Array.isArray(e))return e.forEach((function(e){u.rect.apply(u,e.concat(a))})),this;var s=o("rect");return this.currentContext().appendChild(s),this.setAttributes(s,r({x:e,y:t,width:n,height:i},a)),this},i.prototype.circle=function(e,t,n,i){var a=o("circle");return this.currentContext().appendChild(a),this.setAttributes(a,r({cx:e,cy:t,r:n},i)),this},i.prototype.path=function(e,t){var n=o("path");return this.currentContext().appendChild(n),this.setAttributes(n,r({d:e},t)),this},i.prototype.polyline=function(e,t){var n=this;if(Array.isArray(e))return e.forEach((function(e){n.polyline(e,t)})),this;var i=o("polyline");return this.currentContext().appendChild(i),this.setAttributes(i,r({points:e},t)),this},i.prototype.group=function(e){var t=o("g");return this.currentContext().appendChild(t),this.context.push(t),this.setAttributes(t,r({},e)),this}},97:e=>{"use strict";var t=e.exports=function(e){return this,(null!=(n=t)&&"undefined"!=typeof Symbol&&n[Symbol.hasInstance]?n[Symbol.hasInstance](this):this instanceof n)?(this.tagName=e,this.attributes=Object.create(null),this.children=[],this.lastChild=null,this):new t(e);var n};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("")}},495:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString;function r(e){if(!e||"[object Object]"!==n.call(e)||e.nodeType||e.setInterval)return!1;var r,o=t.call(e,"constructor"),i=t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!o&&!i)return!1;for(r in e);return void 0===r||t.call(e,r)}e.exports=function e(){var t,n,o,i,a,u,s=arguments[0]||{},c=1,l=arguments.length,f=!1;for("boolean"==typeof s&&(f=s,s=arguments[1]||{},c=2),"object"!=typeof s&&"function"!=typeof s&&(s={});c<l;c++)if(null!=(t=arguments[c]))for(n in t)o=s[n],s!==(i=t[n])&&(f&&i&&(r(i)||(a=Array.isArray(i)))?(a?(a=!1,u=o&&Array.isArray(o)?o:[]):u=o&&r(o)?o:{},s[n]=e(f,u,i)):void 0!==i&&(s[n]=i));return s}},279:(e,t,n)=>{"use strict";var r=n(493);r.createRoot,r.hydrateRoot},651:(e,t,n)=>{"use strict";var r=n(954),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,a=r.useEffect,u=r.useLayoutEffect,s=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,l=r[1];return u((function(){o.value=n,o.getSnapshot=t,c(o)&&l({inst:o})}),[e,n,t]),a((function(){return c(o)&&l({inst:o}),e((function(){c(o)&&l({inst:o})}))}),[e]),s(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:l},921:(e,t,n)=>{"use strict";e.exports=n(651)},641:(e,t,n)=>{function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function a(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}System.register(["@openmrs/esm-config","@openmrs/esm-navigation","@openmrs/esm-error-handling","@openmrs/esm-offline"],(function(e,t){var u={},s={},c={},l={};return{setters:[function(e){u.Type=e.Type,u.defineConfigSchema=e.defineConfigSchema,u.getConfig=e.getConfig,u.validators=e.validators},function(e){s.navigate=e.navigate},function(e){c.reportError=e.reportError},function(e){l.getSynchronizationItems=e.getSynchronizationItems}],execute:function(){e(function(){var e={385:function(){System.register(["@openmrs/esm-utils"],(function(e,t){var n={};return{setters:[function(e){n.shallowEqual=e.shallowEqual}],execute:function(){e(function(){"use strict";var e={618:function(e){e.exports=n}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return function(){var e=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},t=function(e,t){var n=l[e];if(n)return n.active?console.error("Attempted to override the existing store ".concat(e,". Make sure that stores are only created once.")):n.value.setState(t,!0),n.active=!0,n.value;var r=c()((function(){return t}));return l[e]={value:r,active:!0},r},n=function(e,t){var n=l[e];return n?(n.active?console.error("Attempted to override the existing store ".concat(e,". Make sure that stores are only created once.")):n.value=t,n.active=!0,n.value):(l[e]={value:t,active:!0},t)},i=function(e,t){var n=l[e];if(!n){var r=c()((function(){return null!=t?t:{}}));return l[e]={value:r,active:!1},r}return n.value},a=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o,i=function(e){if(Array.isArray(e))return e}(o=n)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),3!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(o)||function(t,n){if(t){if("string"==typeof t)return e(t,3);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,3):void 0}}(o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=i[0],s=i[1],c=i[2],l=void 0===c?s:c,f=void 0===c?function(e){return e}:s;return l(f(a.getState())),a.subscribe((function(e,t){var n=f(e);(0,u.shallowEqual)(t,n)||l(n)}))};r.r(o),r.d(o,{createGlobalStore:function(){return t},getGlobalStore:function(){return i},registerGlobalStore:function(){return n},subscribeTo:function(){return a}});var u=r(618),s=function(e){var t,n=new Set,r=function(e,r){var o="function"==typeof e?e(t):e;if(!Object.is(o,t)){var i=t;t=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},t,o),n.forEach((function(e){return e(t,i)}))}},o=function(){return t},i={setState:r,getState:o,getInitialState:function(){return a},subscribe:function(e){return n.add(e),function(){return n.delete(e)}},destroy:function(){console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},a=t=e(r,o,i);return i},c=function(e){return e?s(e):s},l={};setTimeout((function(){"development"===window.spaEnv&&(window.stores=l)}),1e3)}(),o}())}}}))},824:function(e){"use strict";e.exports=u},254:function(e){"use strict";e.exports=c},513:function(e){"use strict";e.exports=s},738:function(e){"use strict";e.exports=l}},t={};function f(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,f),o.exports}f.d=function(e,t){for(var n in t)f.o(t,n)&&!f.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},f.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var d={};return function(){"use strict";var e=function(e,t){function n(){this.constructor=e}st(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},t=function(e){return"function"==typeof e},u=function(e){setTimeout((function(){throw e}),0)},s=function(e){return null!==e&&"object"==typeof e},c=function(e){return e.reduce((function(e,t){return e.concat(i(t,pt)?t.errors:t)}),[])},l=function(e){return e},h=function(e){if(e||(e=lt.Promise||Promise),!e)throw new Error("no Promise impl found");return e},p=function(e,t,n){var r=g(e,t,n);Kt.length?Kt.forEach((function(e){return e(r)})):setTimeout((function(){throw r}))},y=function(e){if("function"!=typeof e)throw Error(m(28,!1));Kt.push(e)},v=function(e){if("function"!=typeof e)throw Error(m(29,!1));var t=!1;return Kt=Kt.filter((function(n){var r=n===e;return t=t||r,!r})),t},m=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return"single-spa minified message #".concat(e,": ").concat(t?t+" ":"","See https://single-spa.js.org/error/?code=").concat(e).concat(r.length?"&arg=".concat(r.join("&arg=")):"")},g=function(e,t,n){var r,o="".concat(S(t)," '").concat(_(t),"' died in status ").concat(t.status,": ");if(i(e,Error)){try{e.message=o+e.message}catch(e){}r=e}else{console.warn(m(30,!1,t.status,_(t)));try{r=Error(o+JSON.stringify(e))}catch(t){r=e}}return r.appOrParcelName=_(t),t.status=n,r},b=function(e){return e.status===Jt},w=function(e){try{return e.activeWhen(window.location)}catch(t){return p(t,e,nn),!1}},_=function(e){return e.name},E=function(e){return Boolean(e.unmountThisParcel)},S=function(e){return E(e)?"parcel":"application"},O=function(){for(var e=arguments.length-1;e>0;e--)for(var t in arguments[e])"__proto__"!==t&&(arguments[e-1][t]=arguments[e][t]);return arguments[0]},x=function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n];return null},A=function(e){return e&&("function"==typeof e||(t=e,Array.isArray(t)&&!x(t,(function(e){return"function"!=typeof e}))));var t},T=function(e,t){var n=e[t]||[];0===(n=Array.isArray(n)?n:[n]).length&&(n=[function(){return Promise.resolve()}]);var r=S(e),o=_(e);return function(e){return n.reduce((function(n,i,a){return n.then((function(){var n=i(e);return D(n)?n:Promise.reject(m(15,!1,r,o,t,a))}))}),Promise.resolve())}},D=function(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch},k=function(e,t){return Promise.resolve().then((function(){return e.status!==Wt?e:(e.status=Yt,e.bootstrap?U(e,"bootstrap").then(n).catch((function(n){if(t)throw g(n,e,nn);return p(n,e,nn),e})):Promise.resolve().then(n))}));function n(){return e.status=$t,e}},M=function(e,t){return Promise.resolve().then((function(){if(e.status!==Jt)return e;e.status=Xt;var n=Object.keys(e.parcels).map((function(t){return e.parcels[t].unmountThisParcel()}));return Promise.all(n).then(r,(function(n){return r().then((function(){var r=Error(n.message);if(t)throw g(r,e,nn);p(r,e,nn)}))})).then((function(){return e}));function r(){return U(e,"unmount").then((function(){e.status=$t}),(function(n){if(t)throw g(n,e,nn);p(n,e,nn)}))}}))},P=function(e,t){return Promise.resolve().then((function(){return e.status!==$t?e:(on||(window.dispatchEvent(new Vt("single-spa:before-first-mount")),on=!0),e.status=Zt,U(e,"mount").then((function(){return e.status=Jt,an||(window.dispatchEvent(new Vt("single-spa:first-mount")),an=!0),e})).catch((function(n){return e.status=Jt,M(e,!0).then(r,r);function r(){if(t)throw g(n,e,nn);return p(n,e,nn),e}})))}))},j=function(){return C.apply(sn,arguments)},C=function(e,t){var n=this;if(!e||"object"!=typeof e&&"function"!=typeof e)throw Error(m(2,!1));if(e.name&&"string"!=typeof e.name)throw Error(m(3,!1,a(e.name)));var r=un++,o=e.name||"parcel-".concat(r);if("object"!=typeof t)throw Error(m(4,!1,o,void 0===t?"undefined":a(t)));if(!t.domElement)throw Error(m(5,!1,o));var i,u="function"==typeof e,s=u?e:function(){return Promise.resolve(e)},c={id:r,parcels:{},status:u?qt:Wt,customProps:t,parentName:_(n),unmountThisParcel:function(){return p.then((function(){if(c.status!==Jt)throw Error(m(6,!1,o,c.status));return M(c,!0)})).then((function(e){return c.parentName&&delete n.parcels[c.id],e})).then((function(e){return f(e),e})).catch((function(e){throw c.status=nn,d(e),e}))}};n.parcels[r]=c;var l=s();if(!l||"function"!=typeof l.then)throw Error(m(7,!1));l=l.then((function(e){if(!e)throw Error(m(8,!1));if(o=e.name||"parcel-".concat(r),Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!A(e.bootstrap))throw Error(m(9,!1,o));if(!A(e.mount))throw Error(m(10,!1,o));if(!A(e.unmount))throw Error(m(11,!1,o));if(e.update&&!A(e.update))throw Error(m(12,!1,o));var t=T(e,"bootstrap"),n=T(e,"mount"),a=T(e,"unmount");c.status=Wt,c.name=o,c.bootstrap=t,c.mount=n,c.unmount=a,c.timeouts=z(e.timeouts),e.update&&(c.update=T(e,"update"),i.update=function(e){return c.customProps=e,I((t=c,Promise.resolve().then((function(){if(t.status!==Jt)throw Error(m(32,!1,_(t)));return t.status=Qt,U(t,"update").then((function(){return t.status=Jt,t})).catch((function(e){throw g(e,t,nn)}))}))));var t})}));var f,d,h=l.then((function(){return k(c,!0)})),p=h.then((function(){return P(c,!0)})),y=new Promise((function(e,t){f=e,d=t}));return i={mount:function(){return I(Promise.resolve().then((function(){if(c.status!==$t)throw Error(m(13,!1,o,c.status));return n.parcels[r]=c,P(c)})))},unmount:function(){return I(c.unmountThisParcel())},getStatus:function(){return c.status},loadPromise:I(l),bootstrapPromise:I(h),mountPromise:I(p),unmountPromise:I(y)}},I=function(e){return e.then((function(){return null}))},N=function(e){var t=_(e),n="function"==typeof e.customProps?e.customProps(t,window.location):e.customProps;("object"!=typeof n||null===n||Array.isArray(n))&&(n={},console.warn(m(40,!1),t,n));var r=O({},n,{name:t,mountParcel:C.bind(e),singleSpa:zt});return E(e)&&(r.unmountSelf=e.unmountThisParcel),r},R=function(e,t,n){if("number"!=typeof e||e<=0)throw Error(m(16,!1));cn.bootstrap={millis:e,dieOnTimeout:t,warningMillis:n||1e3}},L=function(e,t,n){if("number"!=typeof e||e<=0)throw Error(m(17,!1));cn.mount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}},F=function(e,t,n){if("number"!=typeof e||e<=0)throw Error(m(18,!1));cn.unmount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}},B=function(e,t,n){if("number"!=typeof e||e<=0)throw Error(m(19,!1));cn.unload={millis:e,dieOnTimeout:t,warningMillis:n||1e3}},U=function(e,t){var n=e.timeouts[t],r=n.warningMillis,o=S(e);return new Promise((function(i,a){var u=!1,s=!1;e[t](N(e)).then((function(e){u=!0,i(e)})).catch((function(e){u=!0,a(e)})),setTimeout((function(){return l(1)}),r),setTimeout((function(){return l(!0)}),n.millis);var c=m(31,!1,t,o,_(e),n.millis);function l(e){if(!u)if(!0===e)s=!0,n.dieOnTimeout?a(Error(c)):console.error(c);else if(!s){var t=e,o=t*r;console.warn(c),o+r<n.millis&&setTimeout((function(){return l(t+1)}),r)}}}))},z=function(e){var t={};for(var n in cn)t[n]=O({},cn[n],e&&e[n]||{});return t},H=function(e){return Promise.resolve().then((function(){return e.loadPromise?e.loadPromise:e.status!==Gt&&e.status!==tn?e:(e.status=qt,e.loadPromise=Promise.resolve().then((function(){var r=e.loadApp(N(e));if(!D(r))throw n=!0,Error(m(33,!1,_(e)));return r.then((function(n){var r;e.loadErrorTime=null,"object"!=typeof(t=n)&&(r=34),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!A(t.bootstrap)&&(r=35),A(t.mount)||(r=36),A(t.unmount)||(r=37);var o=S(t);if(r){var i;try{i=JSON.stringify(t)}catch(e){}return console.error(m(r,!1,o,_(e),i),t),p(void 0,e,nn),e}return t.devtools&&t.devtools.overlays&&(e.devtools.overlays=O({},e.devtools.overlays,t.devtools.overlays)),e.status=Wt,e.bootstrap=T(t,"bootstrap"),e.mount=T(t,"mount"),e.unmount=T(t,"unmount"),e.unload=T(t,"unload"),e.timeouts=z(t.timeouts),delete e.loadPromise,e}))})).catch((function(t){var r;return delete e.loadPromise,n?r=nn:(r=tn,e.loadErrorTime=(new Date).getTime()),p(t,e,r),e})));var t,n}))},V=function(e){var t;if("string"==typeof e)t=e;else if(this&&this.href)t=this.href;else{if(!(e&&e.currentTarget&&e.currentTarget.href&&e.preventDefault))throw Error(m(14,!1));t=e.currentTarget.href,e.preventDefault()}var n=Y(window.location.href),r=Y(t);0===t.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=t:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,t)},K=function(e){var t=this;if(e){var n=e[0].type;dn.indexOf(n)>=0&&fn[n].forEach((function(n){try{n.apply(t,e)}catch(e){setTimeout((function(){throw e}))}}))}},G=function(){En([],arguments)},q=function(e,t){return function(){var n=window.location.href,r=e.apply(this,arguments),o=window.location.href;return Ut&&n===o||window.dispatchEvent(function(e,t){var n;try{n=new PopStateEvent("popstate",{state:e})}catch(t){(n=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,e)}return n.singleSpa=!0,n.singleSpaTrigger=t,n}(window.history.state,t)),r}},W=function(e){if(pn)throw Error(m(43,!1));Ut=!e||!e.hasOwnProperty("urlRerouteOnly")||e.urlRerouteOnly,pn=!0,hn=window.history.replaceState,window.addEventListener("hashchange",G),window.addEventListener("popstate",G);var t=window.addEventListener,n=window.removeEventListener;window.addEventListener=function(e,n){if(!("function"==typeof n&&dn.indexOf(e)>=0)||x(fn[e],(function(e){return e===n})))return t.apply(this,arguments);fn[e].push(n)},window.removeEventListener=function(e,t){return"function"==typeof t&&dn.indexOf(e)>=0&&(fn[e]=fn[e].filter((function(e){return e!==t}))),n.apply(this,arguments)},window.history.pushState=q(window.history.pushState,"pushState"),window.history.replaceState=q(hn,"replaceState")},Y=function(e){var t=document.createElement("a");return t.href=e,t},$=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(e||window.$&&window.$.fn&&window.$.fn.jquery&&(e=window.$),e&&!yn){var t=e.fn.on,n=e.fn.off;e.fn.on=function(e,n){return Z.call(this,t,window.addEventListener,e,n,arguments)},e.fn.off=function(e,t){return Z.call(this,n,window.removeEventListener,e,t,arguments)},yn=!0}},Z=function(e,t,n,r,o){return"string"!=typeof n?e.apply(this,o):(n.split(/\s+/).forEach((function(e){dn.indexOf(e)>=0&&(t(e,r),n=n.replace(e,""))})),""===n.trim()?this:e.apply(this,o))},J=function(e){return Promise.resolve().then((function(){var t=vn[_(e)];if(!t)return e;if(e.status===Gt)return Q(e,t),e;if(e.status===en)return t.promise.then((function(){return e}));if(e.status!==$t&&e.status!==tn)return e;var n=e.status===tn?Promise.resolve():U(e,"unload");return e.status=en,n.then((function(){return Q(e,t),e})).catch((function(n){return function(e,t,n){delete vn[_(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,p(n,e,nn),t.reject(n)}(e,t,n),e}))}))},Q=function(e,t){delete vn[_(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,e.status=Gt,t.resolve()},X=function(e,t,n,r){vn[_(e)]={app:e,resolve:n,reject:r},Object.defineProperty(vn[_(e)],"promise",{get:t})},ee=function(e){return vn[e]},te=function(){return mn.filter(b).map(_)},ne=function(){return mn.map(_)},re=function(e){var t=x(mn,(function(t){return _(t)===e}));return t?t.status:null},oe=function(e,t,n,r){var o=function(e,t,n,r){var o,i={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"==typeof e?(function(e){if(Array.isArray(e)||null===e)throw Error(m(39,!1));var t=["name","app","activeWhen","customProps"],n=Object.keys(e).reduce((function(e,n){return t.indexOf(n)>=0?e:e.concat(n)}),[]);if(0!==n.length)throw Error(m(38,!1,t.join(", "),n.join(", ")));if("string"!=typeof e.name||0===e.name.length)throw Error(m(20,!1));if("object"!=typeof e.app&&"function"!=typeof e.app)throw Error(m(20,!1));var r=function(e){return"string"==typeof e||"function"==typeof e};if(!(r(e.activeWhen)||Array.isArray(e.activeWhen)&&e.activeWhen.every(r)))throw Error(m(24,!1));if(!ce(e.customProps))throw Error(m(22,!1))}(e),i.name=e.name,i.loadApp=e.app,i.activeWhen=e.activeWhen,i.customProps=e.customProps):(function(e,t,n,r){if("string"!=typeof e||0===e.length)throw Error(m(20,!1));if(!t)throw Error(m(23,!1));if("function"!=typeof n)throw Error(m(24,!1));if(!ce(r))throw Error(m(22,!1))}(e,t,n,r),i.name=e,i.loadApp=t,i.activeWhen=n,i.customProps=r),i.loadApp="function"!=typeof(o=i.loadApp)?function(){return Promise.resolve(o)}:o,i.customProps=function(e){return e||{}}(i.customProps),i.activeWhen=function(e){var t=Array.isArray(e)?e:[e];return t=t.map((function(e){return"function"==typeof e?e:le(e)})),function(e){return t.some((function(t){return t(e)}))}}(i.activeWhen),i}(e,t,n,r);if(pe()||gn||(gn=!0,setTimeout((function(){pe()||console.warn(m(1,!1))}),5e3)),-1!==ne().indexOf(o.name))throw Error(m(21,!1,o.name));mn.push(O({loadErrorTime:null,status:Gt,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},o)),ln&&($(),En())},ie=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return mn.filter((function(t){return t.activeWhen(e)})).map(_)},ae=function(e){if(0===mn.filter((function(t){return _(t)===e})).length)throw Error(m(25,!1,e));return(ln?ue(e,{waitForUnmount:!1}):Promise.resolve()).then((function(){var t=mn.map(_).indexOf(e);mn.splice(t,1)}))},ue=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof e)throw Error(m(26,!1));var n=x(mn,(function(t){return _(t)===e}));if(!n)throw Error(m(27,!1,e));var r,o=ee(_(n));if(t&&t.waitForUnmount){if(o)return o.promise;var i=new Promise((function(e,t){X(n,(function(){return i}),e,t)}));return i}return o?(r=o.promise,se(n,o.resolve,o.reject)):r=new Promise((function(e,t){X(n,(function(){return r}),e,t),se(n,e,t)})),r},se=function(e,t,n){Promise.resolve().then((function(){if(x(ie(),(function(t){return t===_(e)})))return fe()})).then((function(){return M(e).then(J).then((function(){t(),setTimeout((function(){En()}))}))})).catch(n)},ce=function(e){return!e||"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},le=function(e,t){var n=function(e,t){var n=0,r=!1,o="^";"/"!==e[0]&&(e="/"+e);for(var i=0;i<e.length;i++){var a=e[i];(!r&&":"===a||r&&"/"===a)&&u(i)}return u(e.length),new RegExp(o,"i");function u(i){var a=e.slice(n,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":a,i===e.length)if(r)t&&(o+="$");else{var u=t?"":".*";o="/"===o.charAt(o.length-1)?"".concat(o).concat(u,"$"):"".concat(o,"(/").concat(u,")?(#.*)?$")}r=!r,n=i}}(e,t);return function(e){var t=e.origin;t||(t="".concat(e.protocol,"//").concat(e.host));var r=e.href.replace(t,"").replace(e.search,"").split("?")[0];return n.test(r)}},fe=function(){return En()},de=function(e,t){return w(e)?k(e).then((function(e){return t.then((function(){return w(e)?P(e):e}))})):t.then((function(){return e}))},he=function(e){Sn=!0,ln&&(W(e),En())},pe=function(){return Sn},ye=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},ve=function(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)},me=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},ge=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},be=function(e){return e&&e.startsWith("http")?e:("/"!==e[0]&&(e="/"+e),window.openmrsBase+e)},we=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof e)throw Error("The first argument to @openmrs/api's openmrsFetch function must be a url string");if("object"!=typeof t)throw Error("The second argument to @openmrs/api's openmrsFetch function must be a plain object.");if(!window.openmrsBase)throw Error("@openmrs/api is running in a browser that doesn't have window.openmrsBase, which is provided by openmrs-module-spa's HTML file.");var n=be(e);if(t.headers||(t.headers={}),Rt(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(Mn)&&void 0===t.headers["Disable-WWW-Authenticate"]&&(t.headers["Disable-WWW-Authenticate"]="true"),e.startsWith(Pn)){var r=new URL(n,window.location.toString());r.searchParams.has("_summary")||(r.searchParams.set("_summary","data"),n=r.toString())}var o,i,a=Error();return window.fetch(n,t).then((o=function(e){var t,r,o;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(i){switch(i.label){case 0:return(t=e).ok?204!==t.status?[3,2]:[4,(0,Lt.getConfig)("@openmrs/esm-api")]:[3,4];case 1:return i.sent().followRedirects&&t.headers.has("location")&&(r=t.headers.get("location"))&&(0,Ft.navigate)({to:r}),t.data=null,[2,t];case 2:return[2,t.clone().text().then((function(e){try{e&&(t.data=JSON.parse(e))}catch(e){}return t}))];case 3:return[3,6];case 4:return[4,(0,Lt.getConfig)("@openmrs/esm-api")];case 5:return o=i.sent().redirectAuthFailure,n===be(jn)&&403===t.status||o.enabled&&o.errors.includes(t.status)?(sessionStorage.removeItem(xn),(0,Ft.navigate)({to:o.url}),[2,o.resolvePromise?Promise.resolve():new Promise((function(){}))]):[2,t.clone().text().then((function(e){var r=e;try{r=JSON.parse(e)}catch(e){}throw new Cn(n,t,r,a)}),(function(e){throw new Cn(n,t,null,a)}))];case 6:return[2]}}))},i=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=o.apply(e,t);function a(e){ve(i,n,r,a,u,"next",e)}function u(e){ve(i,n,r,a,u,"throw",e)}a(void 0)}))},function(e){return i.apply(this,arguments)}))},_e=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"!=typeof t)throw Error("The second argument to openmrsObservableFetch must be either omitted or an object");var n=new AbortController;return t.signal=n.signal,new wt((function(r){var o=!1;return we(e,t).then((function(e){o=!0,r.next(e),r.complete()}),(function(e){o=!0,r.error(e)})),function(){o||n.abort()}}))},Ee=function(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)},Se=function(e,t){return we("".concat(In,"/").concat(e),{signal:t.signal})},Oe=function(e,t,n){return we("".concat(In,"?patient=").concat(e,"&includeEncounterless=").concat(t),{signal:n.signal})},xe=function(e,t){return Nn.apply(this,arguments)},Ae=function(e,t){return we("".concat(In,"/").concat(e),{method:"DELETE",signal:t.signal})},Te=function(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)},De=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Te(i,r,o,a,u,"next",e)}function u(e){Te(i,r,o,a,u,"throw",e)}a(void 0)}))}},ke=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},Me=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{includeAuthStatus:!0};return(Bn<Date.now()-6e4||!Fn.getState().loaded)&&Ce(),new wt((function(t){var n=function(n){var r;n.loaded&&(e.includeAuthStatus?t.next(n.session):t.next(null===(r=n.session)||void 0===r?void 0:r.user))};return n(Fn.getState()),Fn.subscribe(n)}))},Pe=function(){return(Bn<Date.now()-6e4||!Fn.getState().loaded)&&Ce(),Fn},je=function(e){var t,n,r,o=null!==(r=null===(t=e.user)||void 0===t||null===(n=t.userProperties)||void 0===n?void 0:n.defaultLocale)&&void 0!==r?r:e.locale;o&&o.includes("_")&&(o=o.replaceAll("_","-")),function(e){if(void 0===e||"string"!=typeof e)return!1;try{new Intl.Locale(e)}catch(e){return!1}return!0}(o)&&o!==document.documentElement.getAttribute("lang")&&document.documentElement.setAttribute("lang",o)},Ce=function(e,t){Bn=Date.now();var n={};return e&&t&&(n.Authorization="Basic ".concat(window.btoa("".concat(e,":").concat(t)))),Ue(we(jn,{headers:n}))},Ie=function(){Fn.setState({loaded:!0,session:{authenticated:!1,sessionId:""}})},Ne=function(e,t){return void 0===t?Boolean(e):!Boolean(e)||function(e,t){return"string"==typeof e?!Ln(t.privileges.find((function(t){return e===t.display}))):Array.isArray(e)?e.every((function(e){return!Ln(t.privileges.find((function(t){return e===t.display})))})):(Ln(e)||console.error('Could not understand privileges "'.concat(e,'"')),!0)}(e,t)||function(e){return!Ln(e.roles.find((function(e){return"System Developer"===e.display})))}(t)},Re=function(){var e,t;return new Promise((function(n){var r=function(r){r.loaded&&r.session.user&&(e=r.session.user,n(r.session.user),t&&t())};r(Fn.getState()),e||(t=Fn.subscribe(r))}))},Le=function(){return new Promise((function(e,t){Me().subscribe((function(t){e(t.sessionLocation)}),t).unsubscribe()}))},Fe=function(e,t){return Un.apply(this,arguments)},Be=function(e,t,n){return zn.apply(this,arguments)},Ue=function(e){return new Promise((function(t,n){e.then((function(e){var r;"object"==typeof(null==e?void 0:e.data)?(r={loaded:!0,session:e.data},Fn.setState(r),t(r)):(r={loaded:!1,session:null},Fn.setState(r),n(r))})).catch((function(e){(0,Rn.reportError)("Failed to fetch new session information: ".concat(e));var t={loaded:!1,session:null};Fn.setState(t),n(t)}))}))},ze=function(){(0,Lt.defineConfigSchema)("@openmrs/esm-api",{redirectAuthFailure:{enabled:{_type:Lt.Type.Boolean,_default:!0,_description:"Whether to redirect logged-out users to `redirectAuthFailure.url`"},url:{_type:Lt.Type.String,_default:"${openmrsSpaBase}/login",_validators:[Lt.validators.isUrl]},errors:{_type:Lt.Type.Array,_default:[401],_elements:{_type:Lt.Type.Number,_validators:[Lt.validators.inRange(100,600)]},_description:"The HTTP error codes for which users will be redirected"},resolvePromise:{_type:Lt.Type.Boolean,_default:!1,_description:"Changes how requests that fail authentication are handled. Try messing with this if redirects to the login page aren't working correctly."}},followRedirects:{_type:Lt.Type.Boolean,_default:!0,_description:"Whether openmrsFetch should support redirects returned from the backend"}})