@wpmoo/ui 1.0.0-rc.2 → 1.0.0-rc.4
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/ASSET_LICENSE.md +3 -1
- package/README.md +50 -107
- package/certification.json +20 -3
- package/dist/assets/css/moo-ui.css +8254 -7629
- package/dist/assets/css/moo-ui.min.css +3 -3
- package/dist/assets/css/moo.css +595 -71
- package/dist/assets/css/moo.min.css +3 -3
- package/dist/js/chart.js +15258 -0
- package/dist/js/chart.min.js +27 -0
- package/dist/js/combobox.js +98 -40
- package/dist/js/context-menu.js +5 -0
- package/dist/js/datatable.js +5 -0
- package/dist/js/datepicker.js +1154 -0
- package/dist/js/datepicker.min.js +6 -0
- package/dist/js/moo-ui.js +18950 -0
- package/dist/js/moo-ui.min.js +27 -0
- package/dist/js/sidebar.js +67 -25
- package/dist/js/slider.js +324 -0
- package/package.json +24 -4
- package/scss/_components.scss +73 -0
- package/scss/_config.scss +24 -0
- package/scss/_settings.scss +8 -0
- package/scss/components/_accordion.scss +59 -0
- package/scss/components/_alert.scss +94 -0
- package/scss/components/_avatar.scss +154 -0
- package/scss/components/_badge.scss +33 -0
- package/scss/components/_breadcrumb.scss +130 -0
- package/scss/components/_button.scss +228 -0
- package/scss/components/_button_group.scss +51 -0
- package/scss/components/_card.scss +142 -0
- package/scss/components/_checkbox.scss +115 -0
- package/scss/components/_close_button.scss +59 -0
- package/scss/components/_collapsible.scss +43 -0
- package/scss/components/_combobox.scss +258 -0
- package/scss/components/_context-menu.scss +28 -0
- package/scss/components/_datatable.scss +1082 -0
- package/scss/components/_datepicker.scss +236 -0
- package/scss/components/_dialog.scss +66 -0
- package/scss/components/_dropdown.scss +202 -0
- package/scss/components/_field.scss +125 -0
- package/scss/components/_input.scss +35 -0
- package/scss/components/_input_group.scss +201 -0
- package/scss/components/_kbd.scss +10 -0
- package/scss/components/_menubar.scss +16 -0
- package/scss/components/_navigation.scss +41 -0
- package/scss/components/_pagination.scss +70 -0
- package/scss/components/_popover.scss +47 -0
- package/scss/components/_progress.scss +7 -0
- package/scss/components/_radio_group.scss +9 -0
- package/scss/components/_select.scss +7 -0
- package/scss/components/_separator.scss +15 -0
- package/scss/components/_sheet.scss +32 -0
- package/scss/components/_sidebar.scss +7 -0
- package/scss/components/_skeleton.scss +17 -0
- package/scss/components/_slider.scss +214 -0
- package/scss/components/_spinner.scss +17 -0
- package/scss/components/_switch.scss +25 -0
- package/scss/components/_table.scss +7 -0
- package/scss/components/_tabs.scss +139 -0
- package/scss/components/_textarea.scss +7 -0
- package/scss/components/_toast.scss +119 -0
- package/scss/components/_toggle_group.scss +19 -0
- package/scss/components/_tooltip.scss +83 -0
- package/scss/components/sidebar/_collapsed.scss +187 -0
- package/scss/components/sidebar/_identity.scss +72 -0
- package/scss/components/sidebar/_inset.scss +59 -0
- package/scss/components/sidebar/_layout.scss +176 -0
- package/scss/components/sidebar/_menus.scss +236 -0
- package/scss/foundations/_core_global_primitives.scss +5 -0
- package/scss/foundations/_core_state_layer.scss +25 -0
- package/scss/foundations/_focus.scss +139 -0
- package/scss/foundations/_overlay_backdrop.scss +19 -0
- package/scss/moo-core.scss +47 -0
- package/scss/moo-ui.scss +50 -0
- package/scss/settings/_bootstrap_overrides.scss +11 -0
- package/scss/settings/_component_variables.scss +479 -0
- package/scss/settings/_forms.scss +65 -0
- package/scss/settings/_palette.scss +132 -0
- package/scss/themes/_scoped_core.scss +239 -0
- package/scss/themes/_standalone_root.scss +117 -0
- package/scss/utilities/_scroll_fade.scss +193 -0
- package/scss/utilities/_scroll_fade_primitives.scss +43 -0
- package/scss/_facade-settings.scss +0 -51
- package/scss/settings/_facade_public.scss +0 -23
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Moo UI moo-ui.min.js v1.0.0-rc.4 (https://ui.wpmoo.org/)
|
|
3
|
+
* Copyright 2026 WPMoo (https://wpmoo.org)
|
|
4
|
+
* Licensed under MIT (https://github.com/wpmoo-org/ui/blob/main/LICENSE)
|
|
5
|
+
*/
|
|
6
|
+
var Ar=Object.defineProperty;var Pr=(i,t,e)=>t in i?Ar(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var v=(i,t,e)=>Pr(i,typeof t!="symbol"?t+"":t,e);function Be(i){return i+.5|0}var Tt=(i,t,e)=>Math.max(Math.min(i,e),t);function Re(i){return Tt(Be(i*2.55),0,255)}function Ft(i){return Tt(Be(i*255),0,255)}function St(i){return Tt(Be(i/2.55)/100,0,1)}function Xn(i){return Tt(Be(i*100),0,100)}var lt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Ss=[..."0123456789ABCDEF"],Er=i=>Ss[i&15],Or=i=>Ss[(i&240)>>4]+Ss[i&15],Di=i=>(i&240)>>4===(i&15),Tr=i=>Di(i.r)&&Di(i.g)&&Di(i.b)&&Di(i.a);function Fr(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255<[i[1]]*17,g:255<[i[2]]*17,b:255<[i[3]]*17,a:t===5?lt[i[4]]*17:255}:(t===7||t===9)&&(e={r:lt[i[1]]<<4|lt[i[2]],g:lt[i[3]]<<4|lt[i[4]],b:lt[i[5]]<<4|lt[i[6]],a:t===9?lt[i[7]]<<4|lt[i[8]]:255})),e}var Ir=(i,t)=>i<255?t(i):"";function Lr(i){var t=Tr(i)?Er:Or;return i?"#"+t(i.r)+t(i.g)+t(i.b)+Ir(i.a,t):void 0}var Rr=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Qn(i,t,e){let s=t*Math.min(e,1-e),n=(o,a=(o+i/30)%12)=>e-s*Math.max(Math.min(a-3,9-a,1),-1);return[n(0),n(8),n(4)]}function zr(i,t,e){let s=(n,o=(n+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function Br(i,t,e){let s=Qn(i,1,.5),n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)s[n]*=1-t-e,s[n]+=t;return s}function Vr(i,t,e,s,n){return i===n?(t-e)/s+(t<e?6:0):t===n?(e-i)/s+2:(i-t)/s+4}function ks(i){let e=i.r/255,s=i.g/255,n=i.b/255,o=Math.max(e,s,n),a=Math.min(e,s,n),r=(o+a)/2,l,c,h;return o!==a&&(h=o-a,c=r>.5?h/(2-o-a):h/(o+a),l=Vr(e,s,n,h,o),l=l*60+.5),[l|0,c||0,r]}function Ms(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(Ft)}function Ds(i,t,e){return Ms(Qn,i,t,e)}function Nr(i,t,e){return Ms(Br,i,t,e)}function Wr(i,t,e){return Ms(zr,i,t,e)}function to(i){return(i%360+360)%360}function Hr(i){let t=Rr.exec(i),e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?Re(+t[5]):Ft(+t[5]));let n=to(+t[2]),o=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?s=Nr(n,o,a):t[1]==="hsv"?s=Wr(n,o,a):s=Ds(n,o,a),{r:s[0],g:s[1],b:s[2],a:e}}function qr(i,t){var e=ks(i);e[0]=to(e[0]+t),e=Ds(e),i.r=e[0],i.g=e[1],i.b=e[2]}function jr(i){if(!i)return;let t=ks(i),e=t[0],s=Xn(t[1]),n=Xn(t[2]);return i.a<255?`hsla(${e}, ${s}%, ${n}%, ${St(i.a)})`:`hsl(${e}, ${s}%, ${n}%)`}var Gn={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Jn={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function $r(){let i={},t=Object.keys(Jn),e=Object.keys(Gn),s,n,o,a,r;for(s=0;s<t.length;s++){for(a=r=t[s],n=0;n<e.length;n++)o=e[n],r=r.replace(o,Gn[o]);o=parseInt(Jn[a],16),i[r]=[o>>16&255,o>>8&255,o&255]}return i}var Ci;function Yr(i){Ci||(Ci=$r(),Ci.transparent=[0,0,0,0]);let t=Ci[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var Kr=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Ur(i){let t=Kr.exec(i),e=255,s,n,o;if(t){if(t[7]!==s){let a=+t[7];e=t[8]?Re(a):Tt(a*255,0,255)}return s=+t[1],n=+t[3],o=+t[5],s=255&(t[2]?Re(s):Tt(s,0,255)),n=255&(t[4]?Re(n):Tt(n,0,255)),o=255&(t[6]?Re(o):Tt(o,0,255)),{r:s,g:n,b:o,a:e}}}function Xr(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${St(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}var vs=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,le=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function Gr(i,t,e){let s=le(St(i.r)),n=le(St(i.g)),o=le(St(i.b));return{r:Ft(vs(s+e*(le(St(t.r))-s))),g:Ft(vs(n+e*(le(St(t.g))-n))),b:Ft(vs(o+e*(le(St(t.b))-o))),a:i.a+e*(t.a-i.a)}}function Ai(i,t,e){if(i){let s=ks(i);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=Ds(s),i.r=s[0],i.g=s[1],i.b=s[2]}}function eo(i,t){return i&&Object.assign(t||{},i)}function Zn(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=Ft(i[3]))):(t=eo(i,{r:0,g:0,b:0,a:1}),t.a=Ft(t.a)),t}function Jr(i){return i.charAt(0)==="r"?Ur(i):Hr(i)}var ze=class i{constructor(t){if(t instanceof i)return t;let e=typeof t,s;e==="object"?s=Zn(t):e==="string"&&(s=Fr(t)||Yr(t)||Jr(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=eo(this._rgb);return t&&(t.a=St(t.a)),t}set rgb(t){this._rgb=Zn(t)}rgbString(){return this._valid?Xr(this._rgb):void 0}hexString(){return this._valid?Lr(this._rgb):void 0}hslString(){return this._valid?jr(this._rgb):void 0}mix(t,e){if(t){let s=this.rgb,n=t.rgb,o,a=e===o?.5:e,r=2*a-1,l=s.a-n.a,c=((r*l===-1?r:(r+l)/(1+r*l))+1)/2;o=1-c,s.r=255&c*s.r+o*n.r+.5,s.g=255&c*s.g+o*n.g+.5,s.b=255&c*s.b+o*n.b+.5,s.a=a*s.a+(1-a)*n.a,this.rgb=s}return this}interpolate(t,e){return t&&(this._rgb=Gr(this._rgb,t._rgb,e)),this}clone(){return new i(this.rgb)}alpha(t){return this._rgb.a=Ft(t),this}clearer(t){let e=this._rgb;return e.a*=1-t,this}greyscale(){let t=this._rgb,e=Be(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){let e=this._rgb;return e.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Ai(this._rgb,2,t),this}darken(t){return Ai(this._rgb,2,-t),this}saturate(t){return Ai(this._rgb,1,t),this}desaturate(t){return Ai(this._rgb,1,-t),this}rotate(t){return qr(this._rgb,t),this}};function mt(){}var fo=(()=>{let i=0;return()=>i++})();function E(i){return i==null}function z(i){if(Array.isArray&&Array.isArray(i))return!0;let t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function O(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function H(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function it(i,t){return H(i)?i:t}function C(i,t){return typeof i>"u"?t:i}var go=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/t,Es=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function R(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function I(i,t,e,s){let n,o,a;if(z(i))if(o=i.length,s)for(n=o-1;n>=0;n--)t.call(e,i[n],n);else for(n=0;n<o;n++)t.call(e,i[n],n);else if(O(i))for(a=Object.keys(i),o=a.length,n=0;n<o;n++)t.call(e,i[a[n]],a[n])}function We(i,t){let e,s,n,o;if(!i||!t||i.length!==t.length)return!1;for(e=0,s=i.length;e<s;++e)if(n=i[e],o=t[e],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function Ti(i){if(z(i))return i.map(Ti);if(O(i)){let t=Object.create(null),e=Object.keys(i),s=e.length,n=0;for(;n<s;++n)t[e[n]]=Ti(i[e[n]]);return t}return i}function po(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function Zr(i,t,e,s){if(!po(i))return;let n=t[i],o=e[i];O(n)&&O(o)?he(n,o,s):t[i]=Ti(o)}function he(i,t,e){let s=z(t)?t:[t],n=s.length;if(!O(i))return i;e=e||{};let o=e.merger||Zr,a;for(let r=0;r<n;++r){if(a=s[r],!O(a))continue;let l=Object.keys(a);for(let c=0,h=l.length;c<h;++c)o(l[c],i,a,e)}return i}function ue(i,t){return he(i,t,{merger:Qr})}function Qr(i,t,e){if(!po(i))return;let s=t[i],n=e[i];O(s)&&O(n)?ue(s,n):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=Ti(n))}var io={"":i=>i,x:i=>i.x,y:i=>i.y};function tl(i){let t=i.split("."),e=[],s="";for(let n of t)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function el(i){let t=tl(i);return e=>{for(let s of t){if(s==="")break;e=e&&e[s]}return e}}function Dt(i,t){return(io[t]||(io[t]=el(t)))(i)}function Ri(i){return i.charAt(0).toUpperCase()+i.slice(1)}var fe=i=>typeof i<"u",kt=i=>typeof i=="function",Os=(i,t)=>{if(i.size!==t.size)return!1;for(let e of i)if(!t.has(e))return!1;return!0};function _o(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}var F=Math.PI,B=2*F,il=B+F,Fi=Number.POSITIVE_INFINITY,sl=F/180,q=F/2,$t=F/4,so=F*2/3,Mt=Math.log10,ft=Math.sign;function ge(i,t,e){return Math.abs(i-t)<e}function Ts(i){let t=Math.round(i);i=ge(i,t,i/1e3)?t:i;let e=Math.pow(10,Math.floor(Mt(i))),s=i/e;return(s<=1?1:s<=2?2:s<=5?5:10)*e}function mo(i){let t=[],e=Math.sqrt(i),s;for(s=1;s<e;s++)i%s===0&&(t.push(s),t.push(i/s));return e===(e|0)&&t.push(e),t.sort((n,o)=>n-o).pop(),t}function nl(i){return typeof i=="symbol"||typeof i=="object"&&i!==null&&!(Symbol.toPrimitive in i||"toString"in i||"valueOf"in i)}function Ut(i){return!nl(i)&&!isNaN(parseFloat(i))&&isFinite(i)}function bo(i,t){let e=Math.round(i);return e-t<=i&&e+t>=i}function Fs(i,t,e){let s,n,o;for(s=0,n=i.length;s<n;s++)o=i[s][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function ct(i){return i*(F/180)}function zi(i){return i*(180/F)}function Is(i){if(!H(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function Ls(i,t){let e=t.x-i.x,s=t.y-i.y,n=Math.sqrt(e*e+s*s),o=Math.atan2(s,e);return o<-.5*F&&(o+=B),{angle:o,distance:n}}function Ii(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function ol(i,t){return(i-t+il)%B-F}function G(i){return(i%B+B)%B}function pe(i,t,e,s){let n=G(i),o=G(t),a=G(e),r=G(o-n),l=G(a-n),c=G(n-o),h=G(n-a);return n===o||n===a||s&&o===a||r>l&&c<h}function U(i,t,e){return Math.max(t,Math.min(e,i))}function yo(i){return U(i,-32768,32767)}function bt(i,t,e,s=1e-6){return i>=Math.min(t,e)-s&&i<=Math.max(t,e)+s}function Bi(i,t,e){e=e||(a=>i[a]<t);let s=i.length-1,n=0,o;for(;s-n>1;)o=n+s>>1,e(o)?n=o:s=o;return{lo:n,hi:s}}var pt=(i,t,e,s)=>Bi(i,e,s?n=>{let o=i[n][t];return o<e||o===e&&i[n+1][t]===e}:n=>i[n][t]<e),xo=(i,t,e)=>Bi(i,e,s=>i[s][t]>=e);function wo(i,t,e){let s=0,n=i.length;for(;s<n&&i[s]<t;)s++;for(;n>s&&i[n-1]>e;)n--;return s>0||n<i.length?i.slice(s,n):i}var vo=["push","pop","shift","splice","unshift"];function So(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),vo.forEach(e=>{let s="_onData"+Ri(e),n=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){let a=n.apply(this,o);return i._chartjs.listeners.forEach(r=>{typeof r[s]=="function"&&r[s](...o)}),a}})})}function Rs(i,t){let e=i._chartjs;if(!e)return;let s=e.listeners,n=s.indexOf(t);n!==-1&&s.splice(n,1),!(s.length>0)&&(vo.forEach(o=>{delete i[o]}),delete i._chartjs)}function zs(i){let t=new Set(i);return t.size===i.length?i:Array.from(t)}var Bs=(function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame})();function Vs(i,t){let e=[],s=!1;return function(...n){e=n,s||(s=!0,Bs.call(window,()=>{s=!1,i.apply(t,e)}))}}function ko(i,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(i,t,s)):i.apply(this,s),t}}var Vi=i=>i==="start"?"left":i==="end"?"right":"center",J=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,Mo=(i,t,e,s)=>i===(s?"left":"right")?e:i==="center"?(t+e)/2:t;function Ns(i,t,e){let s=t.length,n=0,o=s;if(i._sorted){let{iScale:a,vScale:r,_parsed:l}=i,c=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null,h=a.axis,{min:d,max:u,minDefined:f,maxDefined:g}=a.getUserBounds();if(f){if(n=Math.min(pt(l,h,d).lo,e?s:pt(t,h,a.getPixelForValue(d)).lo),c){let p=l.slice(0,n+1).reverse().findIndex(_=>!E(_[r.axis]));n-=Math.max(0,p)}n=U(n,0,s-1)}if(g){let p=Math.max(pt(l,a.axis,u,!0).hi+1,e?0:pt(t,h,a.getPixelForValue(u),!0).hi+1);if(c){let _=l.slice(p-1).findIndex(m=>!E(m[r.axis]));p+=Math.max(0,_)}o=U(p,n,s)-n}else o=s-n}return{start:n,count:o}}function Ws(i){let{xScale:t,yScale:e,_scaleRanges:s}=i,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!s)return i._scaleRanges=n,!0;let o=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==e.min||s.ymax!==e.max;return Object.assign(s,n),o}var Pi=i=>i===0||i===1,no=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*B/e)),oo=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*B/e)+1,ce={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*q)+1,easeOutSine:i=>Math.sin(i*q),easeInOutSine:i=>-.5*(Math.cos(F*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>Pi(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>Pi(i)?i:no(i,.075,.3),easeOutElastic:i=>Pi(i)?i:oo(i,.075,.3),easeInOutElastic(i){return Pi(i)?i:i<.5?.5*no(i*2,.1125,.45):.5+.5*oo(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-ce.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?ce.easeInBounce(i*2)*.5:ce.easeOutBounce(i*2-1)*.5+.5};function Hs(i){if(i&&typeof i=="object"){let t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function qs(i){return Hs(i)?i:new ze(i)}function Cs(i){return Hs(i)?i:new ze(i).saturate(.5).darken(.1).hexString()}var al=["x","y","borderWidth","radius","tension"],rl=["color","borderColor","backgroundColor"];function ll(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),i.set("animations",{colors:{type:"color",properties:rl},numbers:{type:"number",properties:al}}),i.describe("animations",{_fallback:"animation"}),i.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function cl(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var ao=new Map;function hl(i,t){t=t||{};let e=i+JSON.stringify(t),s=ao.get(e);return s||(s=new Intl.NumberFormat(i,t),ao.set(e,s)),s}function _e(i,t,e){return hl(t,e).format(i)}var Do={values(i){return z(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";let s=this.chart.options.locale,n,o=i;if(e.length>1){let c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),o=dl(i,e)}let a=Mt(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:n,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),_e(i,s,l)},logarithmic(i,t,e){if(i===0)return"0";let s=e[t].significand||i/Math.pow(10,Math.floor(Mt(i)));return[1,2,3,5,10,15].includes(s)||t>.8*e.length?Do.numeric.call(this,i,t,e):""}};function dl(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var He={formatters:Do};function ul(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:He.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}var Rt=Object.create(null),Ni=Object.create(null);function Ve(i,t){if(!t)return i;let e=t.split(".");for(let s=0,n=e.length;s<n;++s){let o=e[s];i=i[o]||(i[o]=Object.create(null))}return i}function As(i,t,e){return typeof t=="string"?he(Ve(i,t),e):he(Ve(i,""),t)}var Ps=class{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=s=>s.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(s,n)=>Cs(n.backgroundColor),this.hoverBorderColor=(s,n)=>Cs(n.borderColor),this.hoverColor=(s,n)=>Cs(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return As(this,t,e)}get(t){return Ve(this,t)}describe(t,e){return As(Ni,t,e)}override(t,e){return As(Rt,t,e)}route(t,e,s,n){let o=Ve(this,t),a=Ve(this,s),r="_"+e;Object.defineProperties(o,{[r]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){let l=this[r],c=a[n];return O(l)?Object.assign({},c,l):C(l,c)},set(l){this[r]=l}}})}apply(t){t.forEach(e=>e(this))}},V=new Ps({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[ll,cl,ul]);function fl(i){return!i||E(i.size)||E(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function Ne(i,t,e,s,n){let o=t[n];return o||(o=t[n]=i.measureText(n).width,e.push(n)),o>s&&(s=o),s}function Co(i,t,e,s){s=s||{};let n=s.data=s.data||{},o=s.garbageCollect=s.garbageCollect||[];s.font!==t&&(n=s.data={},o=s.garbageCollect=[],s.font=t),i.save(),i.font=t;let a=0,r=e.length,l,c,h,d,u;for(l=0;l<r;l++)if(d=e[l],d!=null&&!z(d))a=Ne(i,n,o,a,d);else if(z(d))for(c=0,h=d.length;c<h;c++)u=d[c],u!=null&&!z(u)&&(a=Ne(i,n,o,a,u));i.restore();let f=o.length/2;if(f>e.length){for(l=0;l<f;l++)delete n[o[l]];o.splice(0,f)}return a}function zt(i,t,e){let s=i.currentDevicePixelRatio,n=e!==0?Math.max(e/2,.5):0;return Math.round((t-n)*s)/s+n}function js(i,t){!t&&!i||(t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore())}function Wi(i,t,e,s){$s(i,t,e,s,null)}function $s(i,t,e,s,n){let o,a,r,l,c,h,d,u,f=t.pointStyle,g=t.rotation,p=t.radius,_=(g||0)*sl;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,s),i.rotate(_),i.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),i.restore();return}if(!(isNaN(p)||p<=0)){switch(i.beginPath(),f){default:n?i.ellipse(e,s,n/2,p,0,0,B):i.arc(e,s,p,0,B),i.closePath();break;case"triangle":h=n?n/2:p,i.moveTo(e+Math.sin(_)*h,s-Math.cos(_)*p),_+=so,i.lineTo(e+Math.sin(_)*h,s-Math.cos(_)*p),_+=so,i.lineTo(e+Math.sin(_)*h,s-Math.cos(_)*p),i.closePath();break;case"rectRounded":c=p*.516,l=p-c,a=Math.cos(_+$t)*l,d=Math.cos(_+$t)*(n?n/2-c:l),r=Math.sin(_+$t)*l,u=Math.sin(_+$t)*(n?n/2-c:l),i.arc(e-d,s-r,c,_-F,_-q),i.arc(e+u,s-a,c,_-q,_),i.arc(e+d,s+r,c,_,_+q),i.arc(e-u,s+a,c,_+q,_+F),i.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*p,h=n?n/2:l,i.rect(e-h,s-l,2*h,2*l);break}_+=$t;case"rectRot":d=Math.cos(_)*(n?n/2:p),a=Math.cos(_)*p,r=Math.sin(_)*p,u=Math.sin(_)*(n?n/2:p),i.moveTo(e-d,s-r),i.lineTo(e+u,s-a),i.lineTo(e+d,s+r),i.lineTo(e-u,s+a),i.closePath();break;case"crossRot":_+=$t;case"cross":d=Math.cos(_)*(n?n/2:p),a=Math.cos(_)*p,r=Math.sin(_)*p,u=Math.sin(_)*(n?n/2:p),i.moveTo(e-d,s-r),i.lineTo(e+d,s+r),i.moveTo(e+u,s-a),i.lineTo(e-u,s+a);break;case"star":d=Math.cos(_)*(n?n/2:p),a=Math.cos(_)*p,r=Math.sin(_)*p,u=Math.sin(_)*(n?n/2:p),i.moveTo(e-d,s-r),i.lineTo(e+d,s+r),i.moveTo(e+u,s-a),i.lineTo(e-u,s+a),_+=$t,d=Math.cos(_)*(n?n/2:p),a=Math.cos(_)*p,r=Math.sin(_)*p,u=Math.sin(_)*(n?n/2:p),i.moveTo(e-d,s-r),i.lineTo(e+d,s+r),i.moveTo(e+u,s-a),i.lineTo(e-u,s+a);break;case"line":a=n?n/2:Math.cos(_)*p,r=Math.sin(_)*p,i.moveTo(e-a,s-r),i.lineTo(e+a,s+r);break;case"dash":i.moveTo(e,s),i.lineTo(e+Math.cos(_)*(n?n/2:p),s+Math.sin(_)*p);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function _t(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.x<t.right+e&&i.y>t.top-e&&i.y<t.bottom+e}function qe(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function je(i){i.restore()}function Ao(i,t,e,s,n){if(!t)return i.lineTo(e.x,e.y);if(n==="middle"){let o=(t.x+e.x)/2;i.lineTo(o,t.y),i.lineTo(o,e.y)}else n==="after"!=!!s?i.lineTo(t.x,e.y):i.lineTo(e.x,t.y);i.lineTo(e.x,e.y)}function Po(i,t,e,s){if(!t)return i.lineTo(e.x,e.y);i.bezierCurveTo(s?t.cp1x:t.cp2x,s?t.cp1y:t.cp2y,s?e.cp2x:e.cp1x,s?e.cp2y:e.cp1y,e.x,e.y)}function gl(i,t){t.translation&&i.translate(t.translation[0],t.translation[1]),E(t.rotation)||i.rotate(t.rotation),t.color&&(i.fillStyle=t.color),t.textAlign&&(i.textAlign=t.textAlign),t.textBaseline&&(i.textBaseline=t.textBaseline)}function pl(i,t,e,s,n){if(n.strikethrough||n.underline){let o=i.measureText(s),a=t-o.actualBoundingBoxLeft,r=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,h=n.strikethrough?(l+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=n.decorationWidth||2,i.moveTo(a,h),i.lineTo(r,h),i.stroke()}}function _l(i,t){let e=i.fillStyle;i.fillStyle=t.color,i.fillRect(t.left,t.top,t.width,t.height),i.fillStyle=e}function Bt(i,t,e,s,n,o={}){let a=z(t)?t:[t],r=o.strokeWidth>0&&o.strokeColor!=="",l,c;for(i.save(),i.font=n.string,gl(i,o),l=0;l<a.length;++l)c=a[l],o.backdrop&&_l(i,o.backdrop),r&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),E(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(c,e,s,o.maxWidth)),i.fillText(c,e,s,o.maxWidth),pl(i,e,s,c,o),s+=Number(n.lineHeight);i.restore()}function me(i,t){let{x:e,y:s,w:n,h:o,radius:a}=t;i.arc(e+a.topLeft,s+a.topLeft,a.topLeft,1.5*F,F,!0),i.lineTo(e,s+o-a.bottomLeft),i.arc(e+a.bottomLeft,s+o-a.bottomLeft,a.bottomLeft,F,q,!0),i.lineTo(e+n-a.bottomRight,s+o),i.arc(e+n-a.bottomRight,s+o-a.bottomRight,a.bottomRight,q,0,!0),i.lineTo(e+n,s+a.topRight),i.arc(e+n-a.topRight,s+a.topRight,a.topRight,0,-q,!0),i.lineTo(e+a.topLeft,s)}var ml=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,bl=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function yl(i,t){let e=(""+i).match(ml);if(!e||e[1]==="normal")return t*1.2;switch(i=+e[2],e[3]){case"px":return i;case"%":i/=100;break}return t*i}var xl=i=>+i||0;function Hi(i,t){let e={},s=O(t),n=s?Object.keys(t):t,o=O(i)?s?a=>C(i[a],i[t[a]]):a=>i[a]:()=>i;for(let a of n)e[a]=xl(o(a));return e}function Ys(i){return Hi(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Vt(i){return Hi(i,["topLeft","topRight","bottomLeft","bottomRight"])}function Z(i){let t=Ys(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function $(i,t){i=i||{},t=t||V.font;let e=C(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=C(i.style,t.style);s&&!(""+s).match(bl)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);let n={family:C(i.family,t.family),lineHeight:yl(C(i.lineHeight,t.lineHeight),e),size:e,style:s,weight:C(i.weight,t.weight),string:""};return n.string=fl(n),n}function be(i,t,e,s){let n=!0,o,a,r;for(o=0,a=i.length;o<a;++o)if(r=i[o],r!==void 0&&(t!==void 0&&typeof r=="function"&&(r=r(t),n=!1),e!==void 0&&z(r)&&(r=r[e%r.length],n=!1),r!==void 0))return s&&!n&&(s.cacheable=!1),r}function Eo(i,t,e){let{min:s,max:n}=i,o=Es(t,(n-s)/2),a=(r,l)=>e&&r===0?0:r+l;return{min:a(s,-Math.abs(o)),max:a(n,o)}}function Ct(i,t){return Object.assign(Object.create(i),t)}function qi(i,t=[""],e,s,n=()=>i[0]){let o=e||i;typeof s>"u"&&(s=Fo("_fallback",i));let a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:s,_getTarget:n,override:r=>qi([r,...i],t,o,s)};return new Proxy(a,{deleteProperty(r,l){return delete r[l],delete r._keys,delete i[0][l],!0},get(r,l){return Oo(r,l,()=>Al(l,t,i,r))},getOwnPropertyDescriptor(r,l){return Reflect.getOwnPropertyDescriptor(r._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(r,l){return lo(r).includes(l)},ownKeys(r){return lo(r)},set(r,l,c){let h=r._storage||(r._storage=n());return r[l]=h[l]=c,delete r._keys,!0}})}function Kt(i,t,e,s){let n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:Ks(i,s),setContext:o=>Kt(i,o,e,s),override:o=>Kt(i.override(o),t,e,s)};return new Proxy(n,{deleteProperty(o,a){return delete o[a],delete i[a],!0},get(o,a,r){return Oo(o,a,()=>vl(o,a,r))},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(i,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,a)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,a){return Reflect.has(i,a)},ownKeys(){return Reflect.ownKeys(i)},set(o,a,r){return i[a]=r,delete o[a],!0}})}function Ks(i,t={scriptable:!0,indexable:!0}){let{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:n=t.allKeys}=i;return{allKeys:n,scriptable:e,indexable:s,isScriptable:kt(e)?e:()=>e,isIndexable:kt(s)?s:()=>s}}var wl=(i,t)=>i?i+Ri(t):t,Us=(i,t)=>O(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Oo(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];let s=e();return i[t]=s,s}function vl(i,t,e){let{_proxy:s,_context:n,_subProxy:o,_descriptors:a}=i,r=s[t];return kt(r)&&a.isScriptable(t)&&(r=Sl(t,r,i,e)),z(r)&&r.length&&(r=kl(t,r,i,a.isIndexable)),Us(t,r)&&(r=Kt(r,n,o&&o[t],a)),r}function Sl(i,t,e,s){let{_proxy:n,_context:o,_subProxy:a,_stack:r}=e;if(r.has(i))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+i);r.add(i);let l=t(o,a||s);return r.delete(i),Us(i,l)&&(l=Xs(n._scopes,n,i,l)),l}function kl(i,t,e,s){let{_proxy:n,_context:o,_subProxy:a,_descriptors:r}=e;if(typeof o.index<"u"&&s(i))return t[o.index%t.length];if(O(t[0])){let l=t,c=n._scopes.filter(h=>h!==l);t=[];for(let h of l){let d=Xs(c,n,i,h);t.push(Kt(d,o,a&&a[i],r))}}return t}function To(i,t,e){return kt(i)?i(t,e):i}var Ml=(i,t)=>i===!0?t:typeof i=="string"?Dt(t,i):void 0;function Dl(i,t,e,s,n){for(let o of t){let a=Ml(e,o);if(a){i.add(a);let r=To(a._fallback,e,n);if(typeof r<"u"&&r!==e&&r!==s)return r}else if(a===!1&&typeof s<"u"&&e!==s)return null}return!1}function Xs(i,t,e,s){let n=t._rootScopes,o=To(t._fallback,e,s),a=[...i,...n],r=new Set;r.add(s);let l=ro(r,a,e,o||e,s);return l===null||typeof o<"u"&&o!==e&&(l=ro(r,a,o,l,s),l===null)?!1:qi(Array.from(r),[""],n,o,()=>Cl(t,e,s))}function ro(i,t,e,s,n){for(;e;)e=Dl(i,t,e,s,n);return e}function Cl(i,t,e){let s=i._getTarget();t in s||(s[t]={});let n=s[t];return z(n)&&O(e)?e:n||{}}function Al(i,t,e,s){let n;for(let o of t)if(n=Fo(wl(o,i),e),typeof n<"u")return Us(i,n)?Xs(e,s,i,n):n}function Fo(i,t){for(let e of t){if(!e)continue;let s=e[i];if(typeof s<"u")return s}}function lo(i){let t=i._keys;return t||(t=i._keys=Pl(i._scopes)),t}function Pl(i){let t=new Set;for(let e of i)for(let s of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(s);return Array.from(t)}function Gs(i,t,e,s){let{iScale:n}=i,{key:o="r"}=this._parsing,a=new Array(s),r,l,c,h;for(r=0,l=s;r<l;++r)c=r+e,h=t[c],a[r]={r:n.parse(Dt(h,o),c)};return a}var El=Number.EPSILON||1e-14,de=(i,t)=>t<i.length&&!i[t].skip&&i[t],Io=i=>i==="x"?"y":"x";function Ol(i,t,e,s){let n=i.skip?t:i,o=t,a=e.skip?t:e,r=Ii(o,n),l=Ii(a,o),c=r/(r+l),h=l/(r+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;let d=s*c,u=s*h;return{previous:{x:o.x-d*(a.x-n.x),y:o.y-d*(a.y-n.y)},next:{x:o.x+u*(a.x-n.x),y:o.y+u*(a.y-n.y)}}}function Tl(i,t,e){let s=i.length,n,o,a,r,l,c=de(i,0);for(let h=0;h<s-1;++h)if(l=c,c=de(i,h+1),!(!l||!c)){if(ge(t[h],0,El)){e[h]=e[h+1]=0;continue}n=e[h]/t[h],o=e[h+1]/t[h],r=Math.pow(n,2)+Math.pow(o,2),!(r<=9)&&(a=3/Math.sqrt(r),e[h]=n*a*t[h],e[h+1]=o*a*t[h])}}function Fl(i,t,e="x"){let s=Io(e),n=i.length,o,a,r,l=de(i,0);for(let c=0;c<n;++c){if(a=r,r=l,l=de(i,c+1),!r)continue;let h=r[e],d=r[s];a&&(o=(h-a[e])/3,r[`cp1${e}`]=h-o,r[`cp1${s}`]=d-o*t[c]),l&&(o=(l[e]-h)/3,r[`cp2${e}`]=h+o,r[`cp2${s}`]=d+o*t[c])}}function Il(i,t="x"){let e=Io(t),s=i.length,n=Array(s).fill(0),o=Array(s),a,r,l,c=de(i,0);for(a=0;a<s;++a)if(r=l,l=c,c=de(i,a+1),!!l){if(c){let h=c[t]-l[t];n[a]=h!==0?(c[e]-l[e])/h:0}o[a]=r?c?ft(n[a-1])!==ft(n[a])?0:(n[a-1]+n[a])/2:n[a-1]:n[a]}Tl(i,n,o),Fl(i,o,t)}function Ei(i,t,e){return Math.max(Math.min(i,e),t)}function Ll(i,t){let e,s,n,o,a,r=_t(i[0],t);for(e=0,s=i.length;e<s;++e)a=o,o=r,r=e<s-1&&_t(i[e+1],t),o&&(n=i[e],a&&(n.cp1x=Ei(n.cp1x,t.left,t.right),n.cp1y=Ei(n.cp1y,t.top,t.bottom)),r&&(n.cp2x=Ei(n.cp2x,t.left,t.right),n.cp2y=Ei(n.cp2y,t.top,t.bottom)))}function Lo(i,t,e,s,n){let o,a,r,l;if(t.spanGaps&&(i=i.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Il(i,n);else{let c=s?i[i.length-1]:i[0];for(o=0,a=i.length;o<a;++o)r=i[o],l=Ol(c,r,i[Math.min(o+1,a-(s?0:1))%a],t.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,c=r}t.capBezierPoints&&Ll(i,e)}function ji(){return typeof window<"u"&&typeof document<"u"}function $i(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Li(i,t,e){let s;return typeof i=="string"?(s=parseInt(i,10),i.indexOf("%")!==-1&&(s=s/100*t.parentNode[e])):s=i,s}var Yi=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function Rl(i,t){return Yi(i).getPropertyValue(t)}var zl=["top","right","bottom","left"];function Yt(i,t,e){let s={};e=e?"-"+e:"";for(let n=0;n<4;n++){let o=zl[n];s[o]=parseFloat(i[t+"-"+o+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}var Bl=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function Vl(i,t){let e=i.touches,s=e&&e.length?e[0]:i,{offsetX:n,offsetY:o}=s,a=!1,r,l;if(Bl(n,o,i.target))r=n,l=o;else{let c=t.getBoundingClientRect();r=s.clientX-c.left,l=s.clientY-c.top,a=!0}return{x:r,y:l,box:a}}function Nt(i,t){if("native"in i)return i;let{canvas:e,currentDevicePixelRatio:s}=t,n=Yi(e),o=n.boxSizing==="border-box",a=Yt(n,"padding"),r=Yt(n,"border","width"),{x:l,y:c,box:h}=Vl(i,e),d=a.left+(h&&r.left),u=a.top+(h&&r.top),{width:f,height:g}=t;return o&&(f-=a.width+r.width,g-=a.height+r.height),{x:Math.round((l-d)/f*e.width/s),y:Math.round((c-u)/g*e.height/s)}}function Nl(i,t,e){let s,n;if(t===void 0||e===void 0){let o=i&&$i(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{let a=o.getBoundingClientRect(),r=Yi(o),l=Yt(r,"border","width"),c=Yt(r,"padding");t=a.width-c.width-l.width,e=a.height-c.height-l.height,s=Li(r.maxWidth,o,"clientWidth"),n=Li(r.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:s||Fi,maxHeight:n||Fi}}var Lt=i=>Math.round(i*10)/10;function Ro(i,t,e,s){let n=Yi(i),o=Yt(n,"margin"),a=Li(n.maxWidth,i,"clientWidth")||Fi,r=Li(n.maxHeight,i,"clientHeight")||Fi,l=Nl(i,t,e),{width:c,height:h}=l;if(n.boxSizing==="content-box"){let u=Yt(n,"border","width"),f=Yt(n,"padding");c-=f.width+u.width,h-=f.height+u.height}return c=Math.max(0,c-o.width),h=Math.max(0,s?c/s:h-o.height),c=Lt(Math.min(c,a,l.maxWidth)),h=Lt(Math.min(h,r,l.maxHeight)),c&&!h&&(h=Lt(c/2)),(t!==void 0||e!==void 0)&&s&&l.height&&h>l.height&&(h=l.height,c=Lt(Math.floor(h*s))),{width:c,height:h}}function Js(i,t,e){let s=t||1,n=Lt(i.height*s),o=Lt(i.width*s);i.height=Lt(i.height),i.width=Lt(i.width);let a=i.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${i.height}px`,a.style.width=`${i.width}px`),i.currentDevicePixelRatio!==s||a.height!==n||a.width!==o?(i.currentDevicePixelRatio=s,a.height=n,a.width=o,i.ctx.setTransform(s,0,0,s,0,0),!0):!1}var zo=(function(){let i=!1;try{let t={get passive(){return i=!0,!1}};ji()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i})();function Zs(i,t){let e=Rl(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function It(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function Bo(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:s==="middle"?e<.5?i.y:t.y:s==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function Vo(i,t,e,s){let n={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},a=It(i,n,e),r=It(n,o,e),l=It(o,t,e),c=It(a,r,e),h=It(r,l,e);return It(c,h,e)}var Wl=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,s){return e-s},leftForLtr(e,s){return e-s}}},Hl=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function Xt(i,t,e){return i?Wl(t,e):Hl()}function Qs(i,t){let e,s;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=s)}function tn(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function No(i){return i==="angle"?{between:pe,compare:ol,normalize:G}:{between:bt,compare:(t,e)=>t-e,normalize:t=>t}}function co({start:i,end:t,count:e,loop:s,style:n}){return{start:i%e,end:t%e,loop:s&&(t-i+1)%e===0,style:n}}function ql(i,t,e){let{property:s,start:n,end:o}=e,{between:a,normalize:r}=No(s),l=t.length,{start:c,end:h,loop:d}=i,u,f;if(d){for(c+=l,h+=l,u=0,f=l;u<f&&a(r(t[c%l][s]),n,o);++u)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:d,style:i.style}}function en(i,t,e){if(!e)return[i];let{property:s,start:n,end:o}=e,a=t.length,{compare:r,between:l,normalize:c}=No(s),{start:h,end:d,loop:u,style:f}=ql(i,t,e),g=[],p=!1,_=null,m,b,x,w=()=>l(n,x,m)&&r(n,x)!==0,y=()=>r(o,m)===0||l(o,x,m),S=()=>p||w(),k=()=>!p||y();for(let M=h,D=h;M<=d;++M)b=t[M%a],!b.skip&&(m=c(b[s]),m!==x&&(p=l(m,n,o),_===null&&S()&&(_=r(m,n)===0?M:D),_!==null&&k()&&(g.push(co({start:_,end:M,loop:u,count:a,style:f})),_=null),D=M,x=m));return _!==null&&g.push(co({start:_,end:d,loop:u,count:a,style:f})),g}function sn(i,t){let e=[],s=i.segments;for(let n=0;n<s.length;n++){let o=en(s[n],i.points,t);o.length&&e.push(...o)}return e}function jl(i,t,e,s){let n=0,o=t-1;if(e&&!s)for(;n<t&&!i[n].skip;)n++;for(;n<t&&i[n].skip;)n++;for(n%=t,e&&(o+=n);o>n&&i[o%t].skip;)o--;return o%=t,{start:n,end:o}}function $l(i,t,e,s){let n=i.length,o=[],a=t,r=i[t],l;for(l=t+1;l<=e;++l){let c=i[l%n];c.skip||c.stop?r.skip||(s=!1,o.push({start:t%n,end:(l-1)%n,loop:s}),t=a=c.stop?l:null):(a=l,r.skip&&(t=l)),r=c}return a!==null&&o.push({start:t%n,end:a%n,loop:s}),o}function Wo(i,t){let e=i.points,s=i.options.spanGaps,n=e.length;if(!n)return[];let o=!!i._loop,{start:a,end:r}=jl(e,n,o,s);if(s===!0)return ho(i,[{start:a,end:r,loop:o}],e,t);let l=r<a?r+n:r,c=!!i._fullLoop&&a===0&&r===n-1;return ho(i,$l(e,a,l,c),e,t)}function ho(i,t,e,s){return!s||!s.setContext||!e?t:Yl(i,t,e,s)}function Yl(i,t,e,s){let n=i._chart.getContext(),o=uo(i.options),{_datasetIndex:a,options:{spanGaps:r}}=i,l=e.length,c=[],h=o,d=t[0].start,u=d;function f(g,p,_,m){let b=r?-1:1;if(g!==p){for(g+=l;e[g%l].skip;)g-=b;for(;e[p%l].skip;)p+=b;g%l!==p%l&&(c.push({start:g%l,end:p%l,loop:_,style:m}),h=m,d=p%l)}}for(let g of t){d=r?d:g.start;let p=e[d%l],_;for(u=d+1;u<=g.end;u++){let m=e[u%l];_=uo(s.setContext(Ct(n,{type:"segment",p0:p,p1:m,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:a}))),Kl(_,h)&&f(d,u-1,g.loop,h),p=m,h=_}d<u-1&&f(d,u-1,g.loop,h)}return c}function uo(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function Kl(i,t){if(!t)return!1;let e=[],s=function(n,o){return Hs(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(i,s)!==JSON.stringify(t,s)}function Oi(i,t,e){return i.options.clip?i[e]:t[e]}function Ul(i,t){let{xScale:e,yScale:s}=i;return e&&s?{left:Oi(e,t,"left"),right:Oi(e,t,"right"),top:Oi(s,t,"top"),bottom:Oi(s,t,"bottom")}:t}function nn(i,t){let e=t._clip;if(e.disabled)return!1;let s=Ul(t,i.chartArea);return{left:e.left===!1?0:s.left-(e.left===!0?0:e.left),right:e.right===!1?i.width:s.right+(e.right===!0?0:e.right),top:e.top===!1?0:s.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?i.height:s.bottom+(e.bottom===!0?0:e.bottom)}}var _n=class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,s,n){let o=e.listeners[n],a=e.duration;o.forEach(r=>r({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(s-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=Bs.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;let o=s.items,a=o.length-1,r=!1,l;for(;a>=0;--a)l=o[a],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(t),r=!0):(o[a]=o[o.length-1],o.pop());r&&(n.draw(),this._notify(n,s,t,"progress")),o.length||(s.running=!1,this._notify(n,s,t,"complete"),s.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){let e=this._charts,s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){let e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((s,n)=>Math.max(s,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;let e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){let e=this._charts.get(t);if(!e||!e.items.length)return;let s=e.items,n=s.length-1;for(;n>=0;--n)s[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}},At=new _n,Ho="transparent",Xl={boolean(i,t,e){return e>.5?t:i},color(i,t,e){let s=qs(i||Ho),n=s.valid&&qs(t||Ho);return n&&n.valid?n.mix(s,e).hexString():t},number(i,t,e){return i+(t-i)*e}},mn=class{constructor(t,e,s,n){let o=e[s];n=be([t.to,n,o,t.from]);let a=be([t.from,o,n]);this._active=!0,this._fn=t.fn||Xl[t.type||typeof a],this._easing=ce[t.easing]||ce.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=s,this._from=a,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);let n=this._target[this._prop],o=s-this._start,a=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=be([t.to,e,n,t.from]),this._from=be([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let e=t-this._start,s=this._duration,n=this._prop,o=this._from,a=this._loop,r=this._to,l;if(this._active=o!==r&&(a||e<s),!this._active){this._target[n]=r,this._notify(!0);return}if(e<0){this._target[n]=o;return}l=e/s%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,r,l)}wait(){let t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){let e=t?"res":"rej",s=this._promises||[];for(let n=0;n<s.length;n++)s[n][e]()}},es=class{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!O(t))return;let e=Object.keys(V.animation),s=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{let o=t[n];if(!O(o))return;let a={};for(let r of e)a[r]=o[r];(z(o.properties)&&o.properties||[n]).forEach(r=>{(r===n||!s.has(r))&&s.set(r,a)})})}_animateOptions(t,e){let s=e.options,n=Jl(t,s);if(!n)return[];let o=this._createAnimations(n,s);return s.$shared&&Gl(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,e){let s=this._properties,n=[],o=t.$animations||(t.$animations={}),a=Object.keys(e),r=Date.now(),l;for(l=a.length-1;l>=0;--l){let c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(t,e));continue}let h=e[c],d=o[c],u=s.get(c);if(d)if(u&&d.active()){d.update(u,h,r);continue}else d.cancel();if(!u||!u.duration){t[c]=h;continue}o[c]=d=new mn(u,t,c,h),n.push(d)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}let s=this._createAnimations(t,e);if(s.length)return At.add(this._chart,s),!0}};function Gl(i,t){let e=[],s=Object.keys(t);for(let n=0;n<s.length;n++){let o=i[s[n]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function Jl(i,t){if(!t)return;let e=i.options;if(!e){i.options=t;return}return e.$shared&&(i.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function qo(i,t){let e=i&&i.options||{},s=e.reverse,n=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:s?o:n,end:s?n:o}}function Zl(i,t,e){if(e===!1)return!1;let s=qo(i,e),n=qo(t,e);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}function Ql(i){let t,e,s,n;return O(i)?(t=i.top,e=i.right,s=i.bottom,n=i.left):t=e=s=n=i,{top:t,right:e,bottom:s,left:n,disabled:i===!1}}function Wa(i,t){let e=[],s=i._getSortedDatasetMetas(t),n,o;for(n=0,o=s.length;n<o;++n)e.push(s[n].index);return e}function jo(i,t,e,s={}){let n=i.keys,o=s.mode==="single",a,r,l,c;if(t===null)return;let h=!1;for(a=0,r=n.length;a<r;++a){if(l=+n[a],l===e){if(h=!0,s.all)continue;break}c=i.values[l],H(c)&&(o||t===0||ft(t)===ft(c))&&(t+=c)}return!h&&!s.all?0:t}function tc(i,t){let{iScale:e,vScale:s}=t,n=e.axis==="x"?"x":"y",o=s.axis==="x"?"x":"y",a=Object.keys(i),r=new Array(a.length),l,c,h;for(l=0,c=a.length;l<c;++l)h=a[l],r[l]={[n]:h,[o]:i[h]};return r}function on(i,t){let e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function ec(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function ic(i){let{min:t,max:e,minDefined:s,maxDefined:n}=i.getUserBounds();return{min:s?t:Number.NEGATIVE_INFINITY,max:n?e:Number.POSITIVE_INFINITY}}function sc(i,t,e){let s=i[t]||(i[t]={});return s[e]||(s[e]={})}function $o(i,t,e,s){for(let n of t.getMatchingVisibleMetas(s).reverse()){let o=i[n.index];if(e&&o>0||!e&&o<0)return n.index}return null}function Yo(i,t){let{chart:e,_cachedMeta:s}=i,n=e._stacks||(e._stacks={}),{iScale:o,vScale:a,index:r}=s,l=o.axis,c=a.axis,h=ec(o,a,s),d=t.length,u;for(let f=0;f<d;++f){let g=t[f],{[l]:p,[c]:_}=g,m=g._stacks||(g._stacks={});u=m[c]=sc(n,h,p),u[r]=_,u._top=$o(u,a,!0,s.type),u._bottom=$o(u,a,!1,s.type);let b=u._visualValues||(u._visualValues={});b[r]=_}}function an(i,t){let e=i.scales;return Object.keys(e).filter(s=>e[s].axis===t).shift()}function nc(i,t){return Ct(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function oc(i,t,e){return Ct(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function $e(i,t){let e=i.controller.index,s=i.vScale&&i.vScale.axis;if(s){t=t||i._parsed;for(let n of t){let o=n._stacks;if(!o||o[s]===void 0||o[s][e]===void 0)return;delete o[s][e],o[s]._visualValues!==void 0&&o[s]._visualValues[e]!==void 0&&delete o[s]._visualValues[e]}}}var rn=i=>i==="reset"||i==="none",Ko=(i,t)=>t?i:Object.assign({},i),ac=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Wa(e,!0),values:null},at=class{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=on(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&$e(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(d,u,f,g)=>d==="x"?u:d==="r"?g:f,o=e.xAxisID=C(s.xAxisID,an(t,"x")),a=e.yAxisID=C(s.yAxisID,an(t,"y")),r=e.rAxisID=C(s.rAxisID,an(t,"r")),l=e.indexAxis,c=e.iAxisID=n(l,o,a,r),h=e.vAxisID=n(l,a,o,r);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&Rs(this._data,this),t._stacked&&$e(t)}_dataCheck(){let t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(O(e)){let n=this._cachedMeta;this._data=tc(e,n)}else if(s!==e){if(s){Rs(s,this);let n=this._cachedMeta;$e(n),n._parsed=[]}e&&Object.isExtensible(e)&&So(e,this),this._syncList=[],this._data=e}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let e=this._cachedMeta,s=this.getDataset(),n=!1;this._dataCheck();let o=e._stacked;e._stacked=on(e.vScale,e),e.stack!==s.stack&&(n=!0,$e(e),e.stack=s.stack),this._resyncElements(t),(n||o!==e._stacked)&&(Yo(this,e._parsed),e._stacked=on(e.vScale,e))}configure(){let t=this.chart.config,e=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){let{_cachedMeta:s,_data:n}=this,{iScale:o,_stacked:a}=s,r=o.axis,l=t===0&&e===n.length?!0:s._sorted,c=t>0&&s._parsed[t-1],h,d,u;if(this._parsing===!1)s._parsed=n,s._sorted=!0,u=n;else{z(n[t])?u=this.parseArrayData(s,n,t,e):O(n[t])?u=this.parseObjectData(s,n,t,e):u=this.parsePrimitiveData(s,n,t,e);let f=()=>d[r]===null||c&&d[r]<c[r];for(h=0;h<e;++h)s._parsed[h+t]=d=u[h],l&&(f()&&(l=!1),c=d);s._sorted=l}a&&Yo(this,u)}parsePrimitiveData(t,e,s,n){let{iScale:o,vScale:a}=t,r=o.axis,l=a.axis,c=o.getLabels(),h=o===a,d=new Array(n),u,f,g;for(u=0,f=n;u<f;++u)g=u+s,d[u]={[r]:h||o.parse(c[g],g),[l]:a.parse(e[g],g)};return d}parseArrayData(t,e,s,n){let{xScale:o,yScale:a}=t,r=new Array(n),l,c,h,d;for(l=0,c=n;l<c;++l)h=l+s,d=e[h],r[l]={x:o.parse(d[0],h),y:a.parse(d[1],h)};return r}parseObjectData(t,e,s,n){let{xScale:o,yScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=new Array(n),h,d,u,f;for(h=0,d=n;h<d;++h)u=h+s,f=e[u],c[h]={x:o.parse(Dt(f,r),u),y:a.parse(Dt(f,l),u)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,s){let n=this.chart,o=this._cachedMeta,a=e[t.axis],r={keys:Wa(n,!0),values:e._stacks[t.axis]._visualValues};return jo(r,a,o.index,{mode:s})}updateRangeFromParsed(t,e,s,n){let o=s[e.axis],a=o===null?NaN:o,r=n&&s._stacks[e.axis];n&&r&&(n.values=r,a=jo(n,o,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){let s=this._cachedMeta,n=s._parsed,o=s._sorted&&t===s.iScale,a=n.length,r=this._getOtherScale(t),l=ac(e,s,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=ic(r),u,f;function g(){f=n[u];let p=f[r.axis];return!H(f[t.axis])||h>p||d<p}for(u=0;u<a&&!(!g()&&(this.updateRangeFromParsed(c,t,f,l),o));++u);if(o){for(u=a-1;u>=0;--u)if(!g()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){let e=this._cachedMeta._parsed,s=[],n,o,a;for(n=0,o=e.length;n<o;++n)a=e[n][t.axis],H(a)&&s.push(a);return s}getMaxOverflow(){return!1}getLabelAndValue(t){let e=this._cachedMeta,s=e.iScale,n=e.vScale,o=this.getParsed(t);return{label:s?""+s.getLabelForValue(o[s.axis]):"",value:n?""+n.getLabelForValue(o[n.axis]):""}}_update(t){let e=this._cachedMeta;this.update(t||"default"),e._clip=Ql(C(this.options.clip,Zl(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){let t=this._ctx,e=this.chart,s=this._cachedMeta,n=s.data||[],o=e.chartArea,a=[],r=this._drawStart||0,l=this._drawCount||n.length-r,c=this.options.drawActiveElementsOnTop,h;for(s.dataset&&s.dataset.draw(t,o,r,l),h=r;h<r+l;++h){let d=n[h];d.hidden||(d.active&&c?a.push(d):d.draw(t,o))}for(h=0;h<a.length;++h)a[h].draw(t,o)}getStyle(t,e){let s=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(t||0,s)}getContext(t,e,s){let n=this.getDataset(),o;if(t>=0&&t<this._cachedMeta.data.length){let a=this._cachedMeta.data[t];o=a.$context||(a.$context=oc(this.getContext(),t,a)),o.parsed=this.getParsed(t),o.raw=n.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=nc(this.chart.getContext(),this.index)),o.dataset=n,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=s,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",s){let n=e==="active",o=this._cachedDataOpts,a=t+"-"+e,r=o[a],l=this.enableOptionSharing&&fe(s);if(r)return Ko(r,l);let c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),d=n?[`${t}Hover`,"hover",t,""]:[t,""],u=c.getOptionScopes(this.getDataset(),h),f=Object.keys(V.elements[t]),g=()=>this.getContext(s,n,e),p=c.resolveNamedOptions(u,f,g,d);return p.$shared&&(p.$shared=l,o[a]=Object.freeze(Ko(p,l))),p}_resolveAnimations(t,e,s){let n=this.chart,o=this._cachedDataOpts,a=`animation-${e}`,r=o[a];if(r)return r;let l;if(n.options.animation!==!1){let h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),u=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(u,this.getContext(t,s,e))}let c=new es(n,l&&l.animations);return l&&l._cacheable&&(o[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||rn(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){let s=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(s),a=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,s),{sharedOptions:o,includeOptions:a}}updateElement(t,e,s,n){rn(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!rn(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,n){t.active=n;let o=this.getStyle(e,n);this._resolveAnimations(e,s,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let e=this._data,s=this._cachedMeta.data;for(let[r,l,c]of this._syncList)this[r](l,c);this._syncList=[];let n=s.length,o=e.length,a=Math.min(o,n);a&&this.parse(0,a),o>n?this._insertElements(n,o-n,t):o<n&&this._removeElements(o,n-o)}_insertElements(t,e,s=!0){let n=this._cachedMeta,o=n.data,a=t+e,r,l=c=>{for(c.length+=e,r=c.length-1;r>=a;r--)c[r]=c[r-e]};for(l(o),r=t;r<a;++r)o[r]=new this.dataElementType;this._parsing&&l(n._parsed),this.parse(t,e),s&&this.updateElements(o,t,e,"reset")}updateElements(t,e,s,n){}_removeElements(t,e){let s=this._cachedMeta;if(this._parsing){let n=s._parsed.splice(t,e);s._stacked&&$e(s,n)}s.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{let[e,s,n]=t;this[e](s,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){let t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);let s=arguments.length-2;s&&this._sync(["_insertElements",t,s])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}};v(at,"defaults",{}),v(at,"datasetElementType",null),v(at,"dataElementType",null);function rc(i,t){if(!i._cache.$bar){let e=i.getMatchingVisibleMetas(t),s=[];for(let n=0,o=e.length;n<o;n++)s=s.concat(e[n].controller.getAllParsedValues(i));i._cache.$bar=zs(s.sort((n,o)=>n-o))}return i._cache.$bar}function lc(i){let t=i.iScale,e=rc(t,i.type),s=t._length,n,o,a,r,l=()=>{a===32767||a===-32768||(fe(r)&&(s=Math.min(s,Math.abs(a-r)||s)),r=a)};for(n=0,o=e.length;n<o;++n)a=t.getPixelForValue(e[n]),l();for(r=void 0,n=0,o=t.ticks.length;n<o;++n)a=t.getPixelForTick(n),l();return s}function cc(i,t,e,s){let n=e.barThickness,o,a;return E(n)?(o=t.min*e.categoryPercentage,a=e.barPercentage):(o=n*s,a=1),{chunk:o/s,ratio:a,start:t.pixels[i]-o/2}}function hc(i,t,e,s){let n=t.pixels,o=n[i],a=i>0?n[i-1]:null,r=i<n.length-1?n[i+1]:null,l=e.categoryPercentage;a===null&&(a=o-(r===null?t.end-t.start:r-o)),r===null&&(r=o+o-a);let c=o-(o-Math.min(a,r))/2*l;return{chunk:Math.abs(r-a)/2*l/s,ratio:e.barPercentage,start:c}}function dc(i,t,e,s){let n=e.parse(i[0],s),o=e.parse(i[1],s),a=Math.min(n,o),r=Math.max(n,o),l=a,c=r;Math.abs(a)>Math.abs(r)&&(l=r,c=a),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:n,end:o,min:a,max:r}}function Ha(i,t,e,s){return z(i)?dc(i,t,e,s):t[e.axis]=e.parse(i,s),t}function Uo(i,t,e,s){let n=i.iScale,o=i.vScale,a=n.getLabels(),r=n===o,l=[],c,h,d,u;for(c=e,h=e+s;c<h;++c)u=t[c],d={},d[n.axis]=r||n.parse(a[c],c),l.push(Ha(u,d,o,c));return l}function ln(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function uc(i,t,e){return i!==0?ft(i):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function fc(i){let t,e,s,n,o;return i.horizontal?(t=i.base>i.x,e="left",s="right"):(t=i.base<i.y,e="bottom",s="top"),t?(n="end",o="start"):(n="start",o="end"),{start:e,end:s,reverse:t,top:n,bottom:o}}function gc(i,t,e,s){let n=t.borderSkipped,o={};if(!n){i.borderSkipped=o;return}if(n===!0){i.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}let{start:a,end:r,reverse:l,top:c,bottom:h}=fc(i);n==="middle"&&e&&(i.enableBorderRadius=!0,(e._top||0)===s?n=c:(e._bottom||0)===s?n=h:(o[Xo(h,a,r,l)]=!0,n=c)),o[Xo(n,a,r,l)]=!0,i.borderSkipped=o}function Xo(i,t,e,s){return s?(i=pc(i,t,e),i=Go(i,e,t)):i=Go(i,t,e),i}function pc(i,t,e){return i===t?e:i===e?t:i}function Go(i,t,e){return i==="start"?t:i==="end"?e:i}function _c(i,{inflateAmount:t},e){i.inflateAmount=t==="auto"?e===1?.33:0:t}var xe=class extends at{parsePrimitiveData(t,e,s,n){return Uo(t,e,s,n)}parseArrayData(t,e,s,n){return Uo(t,e,s,n)}parseObjectData(t,e,s,n){let{iScale:o,vScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?r:l,h=a.axis==="x"?r:l,d=[],u,f,g,p;for(u=s,f=s+n;u<f;++u)p=e[u],g={},g[o.axis]=o.parse(Dt(p,c),u),d.push(Ha(Dt(p,h),g,a,u));return d}updateRangeFromParsed(t,e,s,n){super.updateRangeFromParsed(t,e,s,n);let o=s._custom;o&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){let e=this._cachedMeta,{iScale:s,vScale:n}=e,o=this.getParsed(t),a=o._custom,r=ln(a)?"["+a.start+", "+a.end+"]":""+n.getLabelForValue(o[n.axis]);return{label:""+s.getLabelForValue(o[s.axis]),value:r}}initialize(){this.enableOptionSharing=!0,super.initialize();let t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){let e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,s,n){let o=n==="reset",{index:a,_cachedMeta:{vScale:r}}=this,l=r.getBasePixel(),c=r.isHorizontal(),h=this._getRuler(),{sharedOptions:d,includeOptions:u}=this._getSharedOptions(e,n);for(let f=e;f<e+s;f++){let g=this.getParsed(f),p=o||E(g[r.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),_=this._calculateBarIndexPixels(f,h),m=(g._stacks||{})[r.axis],b={horizontal:c,base:p.base,enableBorderRadius:!m||ln(g._custom)||a===m._top||a===m._bottom,x:c?p.head:_.center,y:c?_.center:p.head,height:c?_.size:Math.abs(p.size),width:c?Math.abs(p.size):_.size};u&&(b.options=d||this.resolveDataElementOptions(f,t[f].active?"active":n));let x=b.options||t[f].options;gc(b,x,m,a),_c(b,x,h.ratio),this.updateElement(t[f],f,b,n)}}_getStacks(t,e){let{iScale:s}=this._cachedMeta,n=s.getMatchingVisibleMetas(this._type).filter(h=>h.controller.options.grouped),o=s.options.stacked,a=[],r=this._cachedMeta.controller.getParsed(e),l=r&&r[s.axis],c=h=>{let d=h._parsed.find(f=>f[s.axis]===l),u=d&&d[h.vScale.axis];if(E(u)||isNaN(u))return!0};for(let h of n)if(!(e!==void 0&&c(h))&&((o===!1||a.indexOf(h.stack)===-1||o===void 0&&h.stack===void 0)&&a.push(h.stack),h.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){let t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(s=>t[s].axis===e).shift()}_getAxis(){let t={},e=this.getFirstScaleIdForIndexAxis();for(let s of this.chart.data.datasets)t[C(this.chart.options.indexAxis==="x"?s.xAxisID:s.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,s){let n=this._getStacks(t,s),o=e!==void 0?n.indexOf(e):-1;return o===-1?n.length-1:o}_getRuler(){let t=this.options,e=this._cachedMeta,s=e.iScale,n=[],o,a;for(o=0,a=e.data.length;o<a;++o)n.push(s.getPixelForValue(this.getParsed(o)[s.axis],o));let r=t.barThickness;return{min:r||lc(e),pixels:n,start:s._startPixel,end:s._endPixel,stackCount:this._getStackCount(),scale:s,grouped:t.grouped,ratio:r?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){let{_cachedMeta:{vScale:e,_stacked:s,index:n},options:{base:o,minBarLength:a}}=this,r=o||0,l=this.getParsed(t),c=l._custom,h=ln(c),d=l[e.axis],u=0,f=s?this.applyStack(e,l,s):d,g,p;f!==d&&(u=f-d,f=d),h&&(d=c.barStart,f=c.barEnd-c.barStart,d!==0&&ft(d)!==ft(c.barEnd)&&(u=0),u+=d);let _=!E(o)&&!h?o:u,m=e.getPixelForValue(_);if(this.chart.getDataVisibility(t)?g=e.getPixelForValue(u+f):g=m,p=g-m,Math.abs(p)<a){p=uc(p,e,r)*a,d===r&&(m-=p/2);let b=e.getPixelForDecimal(0),x=e.getPixelForDecimal(1),w=Math.min(b,x),y=Math.max(b,x);m=Math.max(Math.min(m,y),w),g=m+p,s&&!h&&(l._stacks[e.axis]._visualValues[n]=e.getValueForPixel(g)-e.getValueForPixel(m))}if(m===e.getPixelForValue(r)){let b=ft(p)*e.getLineWidthForValue(r)/2;m+=b,p-=b}return{size:p,base:m,head:g,center:g+p/2}}_calculateBarIndexPixels(t,e){let s=e.scale,n=this.options,o=n.skipNull,a=C(n.maxBarThickness,1/0),r,l,c=this._getAxisCount();if(e.grouped){let h=o?this._getStackCount(t):e.stackCount,d=n.barThickness==="flex"?hc(t,e,n,h*c):cc(t,e,n,h*c),u=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,f=this._getAxis().indexOf(C(u,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+f;r=d.start+d.chunk*g+d.chunk/2,l=Math.min(a,d.chunk*d.ratio)}else r=s.getPixelForValue(this.getParsed(t)[s.axis],t),l=Math.min(a,e.min*e.ratio);return{base:r-l/2,head:r+l/2,center:r,size:l}}draw(){let t=this._cachedMeta,e=t.vScale,s=t.data,n=s.length,o=0;for(;o<n;++o)this.getParsed(o)[e.axis]!==null&&!s[o].hidden&&s[o].draw(this._ctx)}};v(xe,"id","bar"),v(xe,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),v(xe,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});var we=class extends at{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,s,n){let o=super.parsePrimitiveData(t,e,s,n);for(let a=0;a<o.length;a++)o[a]._custom=this.resolveDataElementOptions(a+s).radius;return o}parseArrayData(t,e,s,n){let o=super.parseArrayData(t,e,s,n);for(let a=0;a<o.length;a++){let r=e[s+a];o[a]._custom=C(r[2],this.resolveDataElementOptions(a+s).radius)}return o}parseObjectData(t,e,s,n){let o=super.parseObjectData(t,e,s,n);for(let a=0;a<o.length;a++){let r=e[s+a];o[a]._custom=C(r&&r.r&&+r.r,this.resolveDataElementOptions(a+s).radius)}return o}getMaxOverflow(){let t=this._cachedMeta.data,e=0;for(let s=t.length-1;s>=0;--s)e=Math.max(e,t[s].size(this.resolveDataElementOptions(s))/2);return e>0&&e}getLabelAndValue(t){let e=this._cachedMeta,s=this.chart.data.labels||[],{xScale:n,yScale:o}=e,a=this.getParsed(t),r=n.getLabelForValue(a.x),l=o.getLabelForValue(a.y),c=a._custom;return{label:s[t]||"",value:"("+r+", "+l+(c?", "+c:"")+")"}}update(t){let e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,s,n){let o=n==="reset",{iScale:a,vScale:r}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,n),h=a.axis,d=r.axis;for(let u=e;u<e+s;u++){let f=t[u],g=!o&&this.getParsed(u),p={},_=p[h]=o?a.getPixelForDecimal(.5):a.getPixelForValue(g[h]),m=p[d]=o?r.getBasePixel():r.getPixelForValue(g[d]);p.skip=isNaN(_)||isNaN(m),c&&(p.options=l||this.resolveDataElementOptions(u,f.active?"active":n),o&&(p.options.radius=0)),this.updateElement(f,u,p,n)}}resolveDataElementOptions(t,e){let s=this.getParsed(t),n=super.resolveDataElementOptions(t,e);n.$shared&&(n=Object.assign({},n,{$shared:!1}));let o=n.radius;return e!=="active"&&(n.radius=0),n.radius+=C(s&&s._custom,o),n}};v(we,"id","bubble"),v(we,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),v(we,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function mc(i,t,e){let s=1,n=1,o=0,a=0;if(t<B){let r=i,l=r+t,c=Math.cos(r),h=Math.sin(r),d=Math.cos(l),u=Math.sin(l),f=(x,w,y)=>pe(x,r,l,!0)?1:Math.max(w,w*e,y,y*e),g=(x,w,y)=>pe(x,r,l,!0)?-1:Math.min(w,w*e,y,y*e),p=f(0,c,d),_=f(q,h,u),m=g(F,c,d),b=g(F+q,h,u);s=(p-m)/2,n=(_-b)/2,o=-(p+m)/2,a=-(_+b)/2}return{ratioX:s,ratioY:n,offsetX:o,offsetY:a}}var Et=class extends at{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){let s=this.getDataset().data,n=this._cachedMeta;if(this._parsing===!1)n._parsed=s;else{let o=l=>+s[l];if(O(s[t])){let{key:l="value"}=this._parsing;o=c=>+Dt(s[c],l)}let a,r;for(a=t,r=t+e;a<r;++a)n._parsed[a]=o(a)}}_getRotation(){return ct(this.options.rotation-90)}_getCircumference(){return ct(this.options.circumference)}_getRotationExtents(){let t=B,e=-B;for(let s=0;s<this.chart.data.datasets.length;++s)if(this.chart.isDatasetVisible(s)&&this.chart.getDatasetMeta(s).type===this._type){let n=this.chart.getDatasetMeta(s).controller,o=n._getRotation(),a=n._getCircumference();t=Math.min(t,o),e=Math.max(e,o+a)}return{rotation:t,circumference:e-t}}update(t){let e=this.chart,{chartArea:s}=e,n=this._cachedMeta,o=n.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,r=Math.max((Math.min(s.width,s.height)-a)/2,0),l=Math.min(go(this.options.cutout,r),1),c=this._getRingWeight(this.index),{circumference:h,rotation:d}=this._getRotationExtents(),{ratioX:u,ratioY:f,offsetX:g,offsetY:p}=mc(d,h,l),_=(s.width-a)/u,m=(s.height-a)/f,b=Math.max(Math.min(_,m)/2,0),x=Es(this.options.radius,b),w=Math.max(x*l,0),y=(x-w)/this._getVisibleDatasetWeightTotal();this.offsetX=g*x,this.offsetY=p*x,n.total=this.calculateTotal(),this.outerRadius=x-y*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-y*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){let s=this.options,n=this._cachedMeta,o=this._getCircumference();return e&&s.animation.animateRotate||!this.chart.getDataVisibility(t)||n._parsed[t]===null||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*o/B)}updateElements(t,e,s,n){let o=n==="reset",a=this.chart,r=a.chartArea,c=a.options.animation,h=(r.left+r.right)/2,d=(r.top+r.bottom)/2,u=o&&c.animateScale,f=u?0:this.innerRadius,g=u?0:this.outerRadius,{sharedOptions:p,includeOptions:_}=this._getSharedOptions(e,n),m=this._getRotation(),b;for(b=0;b<e;++b)m+=this._circumference(b,o);for(b=e;b<e+s;++b){let x=this._circumference(b,o),w=t[b],y={x:h+this.offsetX,y:d+this.offsetY,startAngle:m,endAngle:m+x,circumference:x,outerRadius:g,innerRadius:f};_&&(y.options=p||this.resolveDataElementOptions(b,w.active?"active":n)),m+=x,this.updateElement(w,b,y,n)}}calculateTotal(){let t=this._cachedMeta,e=t.data,s=0,n;for(n=0;n<e.length;n++){let o=t._parsed[n];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(n)&&!e[n].hidden&&(s+=Math.abs(o))}return s}calculateCircumference(t){let e=this._cachedMeta.total;return e>0&&!isNaN(t)?B*(Math.abs(t)/e):0}getLabelAndValue(t){let e=this._cachedMeta,s=this.chart,n=s.data.labels||[],o=_e(e._parsed[t],s.options.locale);return{label:n[t]||"",value:o}}getMaxBorderWidth(t){let e=0,s=this.chart,n,o,a,r,l;if(!t){for(n=0,o=s.data.datasets.length;n<o;++n)if(s.isDatasetVisible(n)){a=s.getDatasetMeta(n),t=a.data,r=a.controller;break}}if(!t)return 0;for(n=0,o=t.length;n<o;++n)l=r.resolveDataElementOptions(n),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let s=0,n=t.length;s<n;++s){let o=this.resolveDataElementOptions(s);e=Math.max(e,o.offset||0,o.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let s=0;s<t;++s)this.chart.isDatasetVisible(s)&&(e+=this._getRingWeight(s));return e}_getRingWeight(t){return Math.max(C(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}};v(Et,"id","doughnut"),v(Et,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),v(Et,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),v(Et,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data,{labels:{pointStyle:s,textAlign:n,color:o,useBorderRadius:a,borderRadius:r}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((l,c)=>{let d=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:d.backgroundColor,fontColor:o,hidden:!t.getDataVisibility(c),lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:d.borderWidth,strokeStyle:d.borderColor,textAlign:n,pointStyle:s,borderRadius:a&&(r||d.borderRadius),index:c}}):[]}},onClick(t,e,s){s.chart.toggleDataVisibility(e.index),s.chart.update()}}}});var ve=class extends at{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let e=this._cachedMeta,{dataset:s,data:n=[],_dataset:o}=e,a=this.chart._animationsDisabled,{start:r,count:l}=Ns(e,n,a);this._drawStart=r,this._drawCount=l,Ws(e)&&(r=0,l=n.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!o._decimated,s.points=n;let c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(s,void 0,{animated:!a,options:c},t),this.updateElements(n,r,l,t)}updateElements(t,e,s,n){let o=n==="reset",{iScale:a,vScale:r,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,n),u=a.axis,f=r.axis,{spanGaps:g,segment:p}=this.options,_=Ut(g)?g:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||o||n==="none",b=e+s,x=t.length,w=e>0&&this.getParsed(e-1);for(let y=0;y<x;++y){let S=t[y],k=m?S:{};if(y<e||y>=b){k.skip=!0;continue}let M=this.getParsed(y),D=E(M[f]),A=k[u]=a.getPixelForValue(M[u],y),P=k[f]=o||D?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,M,l):M[f],y);k.skip=isNaN(A)||isNaN(P)||D,k.stop=y>0&&Math.abs(M[u]-w[u])>_,p&&(k.parsed=M,k.raw=c.data[y]),d&&(k.options=h||this.resolveDataElementOptions(y,S.active?"active":n)),m||this.updateElement(S,y,k,n),w=M}}getMaxOverflow(){let t=this._cachedMeta,e=t.dataset,s=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return s;let o=n[0].size(this.resolveDataElementOptions(0)),a=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,a)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}};v(ve,"id","line"),v(ve,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),v(ve,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});var te=class extends at{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){let e=this._cachedMeta,s=this.chart,n=s.data.labels||[],o=_e(e._parsed[t].r,s.options.locale);return{label:n[t]||"",value:o}}parseObjectData(t,e,s,n){return Gs.bind(this)(t,e,s,n)}update(t){let e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){let t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((s,n)=>{let o=this.getParsed(n).r;!isNaN(o)&&this.chart.getDataVisibility(n)&&(o<e.min&&(e.min=o),o>e.max&&(e.max=o))}),e}_updateRadius(){let t=this.chart,e=t.chartArea,s=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(n/2,0),a=Math.max(s.cutoutPercentage?o/100*s.cutoutPercentage:1,0),r=(o-a)/t.getVisibleDatasetCount();this.outerRadius=o-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,e,s,n){let o=n==="reset",a=this.chart,l=a.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,d=c.yCenter,u=c.getIndexAngle(0)-.5*F,f=u,g,p=360/this.countVisibleElements();for(g=0;g<e;++g)f+=this._computeAngle(g,n,p);for(g=e;g<e+s;g++){let _=t[g],m=f,b=f+this._computeAngle(g,n,p),x=a.getDataVisibility(g)?c.getDistanceFromCenterForValue(this.getParsed(g).r):0;f=b,o&&(l.animateScale&&(x=0),l.animateRotate&&(m=b=u));let w={x:h,y:d,innerRadius:0,outerRadius:x,startAngle:m,endAngle:b,options:this.resolveDataElementOptions(g,_.active?"active":n)};this.updateElement(_,g,w,n)}}countVisibleElements(){let t=this._cachedMeta,e=0;return t.data.forEach((s,n)=>{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&e++}),e}_computeAngle(t,e,s){return this.chart.getDataVisibility(t)?ct(this.resolveDataElementOptions(t,e).angle||s):0}};v(te,"id","polarArea"),v(te,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),v(te,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:s,color:n}}=t.legend.options;return e.labels.map((o,a)=>{let l=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:n,lineWidth:l.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,s){s.chart.toggleDataVisibility(e.index),s.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});var Ge=class extends Et{};v(Ge,"id","pie"),v(Ge,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});var Se=class extends at{getLabelAndValue(t){let e=this._cachedMeta.vScale,s=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(s[e.axis])}}parseObjectData(t,e,s,n){return Gs.bind(this)(t,e,s,n)}update(t){let e=this._cachedMeta,s=e.dataset,n=e.data||[],o=e.iScale.getLabels();if(s.points=n,t!=="resize"){let a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);let r={_loop:!0,_fullLoop:o.length===n.length,options:a};this.updateElement(s,void 0,r,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,s,n){let o=this._cachedMeta.rScale,a=n==="reset";for(let r=e;r<e+s;r++){let l=t[r],c=this.resolveDataElementOptions(r,l.active?"active":n),h=o.getPointPositionForValue(r,this.getParsed(r).r),d=a?o.xCenter:h.x,u=a?o.yCenter:h.y,f={x:d,y:u,angle:h.angle,skip:isNaN(d)||isNaN(u),options:c};this.updateElement(l,r,f,n)}}};v(Se,"id","radar"),v(Se,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),v(Se,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});var ke=class extends at{getLabelAndValue(t){let e=this._cachedMeta,s=this.chart.data.labels||[],{xScale:n,yScale:o}=e,a=this.getParsed(t),r=n.getLabelForValue(a.x),l=o.getLabelForValue(a.y);return{label:s[t]||"",value:"("+r+", "+l+")"}}update(t){let e=this._cachedMeta,{data:s=[]}=e,n=this.chart._animationsDisabled,{start:o,count:a}=Ns(e,s,n);if(this._drawStart=o,this._drawCount=a,Ws(e)&&(o=0,a=s.length),this.options.showLine){this.datasetElementType||this.addElements();let{dataset:r,_dataset:l}=e;r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!l._decimated,r.points=s;let c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!n,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(s,o,a,t)}addElements(){let{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,s,n){let o=n==="reset",{iScale:a,vScale:r,_stacked:l,_dataset:c}=this._cachedMeta,h=this.resolveDataElementOptions(e,n),d=this.getSharedOptions(h),u=this.includeOptions(n,d),f=a.axis,g=r.axis,{spanGaps:p,segment:_}=this.options,m=Ut(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||n==="none",x=e>0&&this.getParsed(e-1);for(let w=e;w<e+s;++w){let y=t[w],S=this.getParsed(w),k=b?y:{},M=E(S[g]),D=k[f]=a.getPixelForValue(S[f],w),A=k[g]=o||M?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,S,l):S[g],w);k.skip=isNaN(D)||isNaN(A)||M,k.stop=w>0&&Math.abs(S[f]-x[f])>m,_&&(k.parsed=S,k.raw=c.data[w]),u&&(k.options=d||this.resolveDataElementOptions(w,y.active?"active":n)),b||this.updateElement(y,w,k,n),x=S}this.updateSharedOptions(d,n,h)}getMaxOverflow(){let t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let r=0;for(let l=e.length-1;l>=0;--l)r=Math.max(r,e[l].size(this.resolveDataElementOptions(l))/2);return r>0&&r}let s=t.dataset,n=s.options&&s.options.borderWidth||0;if(!e.length)return n;let o=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,o,a)/2}};v(ke,"id","scatter"),v(ke,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),v(ke,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var bc=Object.freeze({__proto__:null,BarController:xe,BubbleController:we,DoughnutController:Et,LineController:ve,PieController:Ge,PolarAreaController:te,RadarController:Se,ScatterController:ke});function Gt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var bn=class i{constructor(t){v(this,"options");this.options=t||{}}static override(t){Object.assign(i.prototype,t)}init(){}formats(){return Gt()}parse(){return Gt()}format(){return Gt()}add(){return Gt()}diff(){return Gt()}startOf(){return Gt()}endOf(){return Gt()}},yc={_date:bn};function xc(i,t,e,s){let{controller:n,data:o,_sorted:a}=i,r=n._cachedMeta.iScale,l=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null;if(r&&t===r.axis&&t!=="r"&&a&&o.length){let c=r._reversePixels?xo:pt;if(s){if(n._sharedOptions){let h=o[0],d=typeof h.getRange=="function"&&h.getRange(t);if(d){let u=c(o,t,e-d),f=c(o,t,e+d);return{lo:u.lo,hi:f.hi}}}}else{let h=c(o,t,e);if(l){let{vScale:d}=n._cachedMeta,{_parsed:u}=i,f=u.slice(0,h.lo+1).reverse().findIndex(p=>!E(p[d.axis]));h.lo-=Math.max(0,f);let g=u.slice(h.hi).findIndex(p=>!E(p[d.axis]));h.hi+=Math.max(0,g)}return h}}return{lo:0,hi:o.length-1}}function ri(i,t,e,s,n){let o=i.getSortedVisibleDatasetMetas(),a=e[t];for(let r=0,l=o.length;r<l;++r){let{index:c,data:h}=o[r],{lo:d,hi:u}=xc(o[r],t,a,n);for(let f=d;f<=u;++f){let g=h[f];g.skip||s(g,c,f)}}}function wc(i){let t=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(s,n){let o=t?Math.abs(s.x-n.x):0,a=e?Math.abs(s.y-n.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function cn(i,t,e,s,n){let o=[];return!n&&!i.isPointInArea(t)||ri(i,e,t,function(r,l,c){!n&&!_t(r,i.chartArea,0)||r.inRange(t.x,t.y,s)&&o.push({element:r,datasetIndex:l,index:c})},!0),o}function vc(i,t,e,s){let n=[];function o(a,r,l){let{startAngle:c,endAngle:h}=a.getProps(["startAngle","endAngle"],s),{angle:d}=Ls(a,{x:t.x,y:t.y});pe(d,c,h)&&n.push({element:a,datasetIndex:r,index:l})}return ri(i,e,t,o),n}function Sc(i,t,e,s,n,o){let a=[],r=wc(e),l=Number.POSITIVE_INFINITY;function c(h,d,u){let f=h.inRange(t.x,t.y,n);if(s&&!f)return;let g=h.getCenterPoint(n);if(!(!!o||i.isPointInArea(g))&&!f)return;let _=r(t,g);_<l?(a=[{element:h,datasetIndex:d,index:u}],l=_):_===l&&a.push({element:h,datasetIndex:d,index:u})}return ri(i,e,t,c),a}function hn(i,t,e,s,n,o){return!o&&!i.isPointInArea(t)?[]:e==="r"&&!s?vc(i,t,e,n):Sc(i,t,e,s,n,o)}function Jo(i,t,e,s,n){let o=[],a=e==="x"?"inXRange":"inYRange",r=!1;return ri(i,e,t,(l,c,h)=>{l[a]&&l[a](t[e],n)&&(o.push({element:l,datasetIndex:c,index:h}),r=r||l.inRange(t.x,t.y,n))}),s&&!r?[]:o}var kc={evaluateInteractionItems:ri,modes:{index(i,t,e,s){let n=Nt(t,i),o=e.axis||"x",a=e.includeInvisible||!1,r=e.intersect?cn(i,n,o,s,a):hn(i,n,o,!1,s,a),l=[];return r.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{let h=r[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,s){let n=Nt(t,i),o=e.axis||"xy",a=e.includeInvisible||!1,r=e.intersect?cn(i,n,o,s,a):hn(i,n,o,!1,s,a);if(r.length>0){let l=r[0].datasetIndex,c=i.getDatasetMeta(l).data;r=[];for(let h=0;h<c.length;++h)r.push({element:c[h],datasetIndex:l,index:h})}return r},point(i,t,e,s){let n=Nt(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;return cn(i,n,o,s,a)},nearest(i,t,e,s){let n=Nt(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;return hn(i,n,o,e.intersect,s,a)},x(i,t,e,s){let n=Nt(t,i);return Jo(i,n,"x",e.intersect,s)},y(i,t,e,s){let n=Nt(t,i);return Jo(i,n,"y",e.intersect,s)}}},qa=["left","top","right","bottom"];function Ye(i,t){return i.filter(e=>e.pos===t)}function Zo(i,t){return i.filter(e=>qa.indexOf(e.pos)===-1&&e.box.axis===t)}function Ke(i,t){return i.sort((e,s)=>{let n=t?s:e,o=t?e:s;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function Mc(i){let t=[],e,s,n,o,a,r;for(e=0,s=(i||[]).length;e<s;++e)n=i[e],{position:o,options:{stack:a,stackWeight:r=1}}=n,t.push({index:e,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:a&&o+a,stackWeight:r});return t}function Dc(i){let t={};for(let e of i){let{stack:s,pos:n,stackWeight:o}=e;if(!s||!qa.includes(n))continue;let a=t[s]||(t[s]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return t}function Cc(i,t){let e=Dc(i),{vBoxMaxWidth:s,hBoxMaxHeight:n}=t,o,a,r;for(o=0,a=i.length;o<a;++o){r=i[o];let{fullSize:l}=r.box,c=e[r.stack],h=c&&r.stackWeight/c.weight;r.horizontal?(r.width=h?h*s:l&&t.availableWidth,r.height=n):(r.width=s,r.height=h?h*n:l&&t.availableHeight)}return e}function Ac(i){let t=Mc(i),e=Ke(t.filter(c=>c.box.fullSize),!0),s=Ke(Ye(t,"left"),!0),n=Ke(Ye(t,"right")),o=Ke(Ye(t,"top"),!0),a=Ke(Ye(t,"bottom")),r=Zo(t,"x"),l=Zo(t,"y");return{fullSize:e,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(a).concat(r),chartArea:Ye(t,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(a).concat(r)}}function Qo(i,t,e,s){return Math.max(i[e],t[e])+Math.max(i[s],t[s])}function ja(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function Pc(i,t,e,s){let{pos:n,box:o}=e,a=i.maxPadding;if(!O(n)){e.size&&(i[n]-=e.size);let d=s[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,i[n]+=e.size}o.getPadding&&ja(a,o.getPadding());let r=Math.max(0,t.outerWidth-Qo(a,i,"left","right")),l=Math.max(0,t.outerHeight-Qo(a,i,"top","bottom")),c=r!==i.w,h=l!==i.h;return i.w=r,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Ec(i){let t=i.maxPadding;function e(s){let n=Math.max(t[s]-i[s],0);return i[s]+=n,n}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function Oc(i,t){let e=t.maxPadding;function s(n){let o={left:0,top:0,right:0,bottom:0};return n.forEach(a=>{o[a]=Math.max(t[a],e[a])}),o}return s(i?["left","right"]:["top","bottom"])}function Je(i,t,e,s){let n=[],o,a,r,l,c,h;for(o=0,a=i.length,c=0;o<a;++o){r=i[o],l=r.box,l.update(r.width||t.w,r.height||t.h,Oc(r.horizontal,t));let{same:d,other:u}=Pc(t,e,r,s);c|=d&&n.length,h=h||u,l.fullSize||n.push(r)}return c&&Je(n,t,e,s)||h}function Ki(i,t,e,s,n){i.top=e,i.left=t,i.right=t+s,i.bottom=e+n,i.width=s,i.height=n}function ta(i,t,e,s){let n=e.padding,{x:o,y:a}=t;for(let r of i){let l=r.box,c=s[r.stack]||{count:1,placed:0,weight:1},h=r.stackWeight/c.weight||1;if(r.horizontal){let d=t.w*h,u=c.size||l.height;fe(c.start)&&(a=c.start),l.fullSize?Ki(l,n.left,a,e.outerWidth-n.right-n.left,u):Ki(l,t.left+c.placed,a,d,u),c.start=a,c.placed+=d,a=l.bottom}else{let d=t.h*h,u=c.size||l.width;fe(c.start)&&(o=c.start),l.fullSize?Ki(l,o,n.top,u,e.outerHeight-n.bottom-n.top):Ki(l,o,t.top+c.placed,u,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=a}var tt={addBox(i,t){i.boxes||(i.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},i.boxes.push(t)},removeBox(i,t){let e=i.boxes?i.boxes.indexOf(t):-1;e!==-1&&i.boxes.splice(e,1)},configure(i,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(i,t,e,s){if(!i)return;let n=Z(i.options.layout.padding),o=Math.max(t-n.width,0),a=Math.max(e-n.height,0),r=Ac(i.boxes),l=r.vertical,c=r.horizontal;I(i.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});let h=l.reduce((p,_)=>_.box.options&&_.box.options.display===!1?p:p+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/h,hBoxMaxHeight:a/2}),u=Object.assign({},n);ja(u,Z(s));let f=Object.assign({maxPadding:u,w:o,h:a,x:n.left,y:n.top},n),g=Cc(l.concat(c),d);Je(r.fullSize,f,d,g),Je(l,f,d,g),Je(c,f,d,g)&&Je(l,f,d,g),Ec(f),ta(r.leftAndTop,f,d,g),f.x+=f.w,f.y+=f.h,ta(r.rightAndBottom,f,d,g),i.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},I(r.chartArea,p=>{let _=p.box;Object.assign(_,i.chartArea),_.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}},is=class{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,n){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):s)}}isAttached(t){return!0}updateConfig(t){}},yn=class extends is{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}},Qi="$chartjs",Tc={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ea=i=>i===null||i==="";function Fc(i,t){let e=i.style,s=i.getAttribute("height"),n=i.getAttribute("width");if(i[Qi]={initial:{height:s,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",ea(n)){let o=Zs(i,"width");o!==void 0&&(i.width=o)}if(ea(s))if(i.style.height==="")i.height=i.width/(t||2);else{let o=Zs(i,"height");o!==void 0&&(i.height=o)}return i}var $a=zo?{passive:!0}:!1;function Ic(i,t,e){i&&i.addEventListener(t,e,$a)}function Lc(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,$a)}function Rc(i,t){let e=Tc[i.type]||i.type,{x:s,y:n}=Nt(i,t);return{type:e,chart:t,native:i,x:s!==void 0?s:null,y:n!==void 0?n:null}}function ss(i,t){for(let e of i)if(e===t||e.contains(t))return!0}function zc(i,t,e){let s=i.canvas,n=new MutationObserver(o=>{let a=!1;for(let r of o)a=a||ss(r.addedNodes,s),a=a&&!ss(r.removedNodes,s);a&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function Bc(i,t,e){let s=i.canvas,n=new MutationObserver(o=>{let a=!1;for(let r of o)a=a||ss(r.removedNodes,s),a=a&&!ss(r.addedNodes,s);a&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}var ni=new Map,ia=0;function Ya(){let i=window.devicePixelRatio;i!==ia&&(ia=i,ni.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function Vc(i,t){ni.size||window.addEventListener("resize",Ya),ni.set(i,t)}function Nc(i){ni.delete(i),ni.size||window.removeEventListener("resize",Ya)}function Wc(i,t,e){let s=i.canvas,n=s&&$i(s);if(!n)return;let o=Vs((r,l)=>{let c=n.clientWidth;e(r,l),c<n.clientWidth&&e()},window),a=new ResizeObserver(r=>{let l=r[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return a.observe(n),Vc(i,o),a}function dn(i,t,e){e&&e.disconnect(),t==="resize"&&Nc(i)}function Hc(i,t,e){let s=i.canvas,n=Vs(o=>{i.ctx!==null&&e(Rc(o,i))},i);return Ic(s,t,n),n}var xn=class extends is{acquireContext(t,e){let s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(Fc(t,e),s):null}releaseContext(t){let e=t.canvas;if(!e[Qi])return!1;let s=e[Qi].initial;["height","width"].forEach(o=>{let a=s[o];E(a)?e.removeAttribute(o):e.setAttribute(o,a)});let n=s.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[Qi],!0}addEventListener(t,e,s){this.removeEventListener(t,e);let n=t.$proxies||(t.$proxies={}),a={attach:zc,detach:Bc,resize:Wc}[e]||Hc;n[e]=a(t,e,s)}removeEventListener(t,e){let s=t.$proxies||(t.$proxies={}),n=s[e];if(!n)return;({attach:dn,detach:dn,resize:dn}[e]||Lc)(t,e,n),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,n){return Ro(t,e,s,n)}isAttached(t){let e=t&&$i(t);return!!(e&&e.isConnected)}};function qc(i){return!ji()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?yn:xn}var rt=class{constructor(){v(this,"x");v(this,"y");v(this,"active",!1);v(this,"options");v(this,"$animations")}tooltipPosition(t){let{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}hasValue(){return Ut(this.x)&&Ut(this.y)}getProps(t,e){let s=this.$animations;if(!e||!s)return this;let n={};return t.forEach(o=>{n[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),n}};v(rt,"defaults",{}),v(rt,"defaultRoutes");function jc(i,t){let e=i.options.ticks,s=$c(i),n=Math.min(e.maxTicksLimit||s,s),o=e.major.enabled?Kc(t):[],a=o.length,r=o[0],l=o[a-1],c=[];if(a>n)return Uc(t,c,o,a/n),c;let h=Yc(o,t,n);if(a>0){let d,u,f=a>1?Math.round((l-r)/(a-1)):null;for(Ui(t,c,h,E(f)?0:r-f,r),d=0,u=a-1;d<u;d++)Ui(t,c,h,o[d],o[d+1]);return Ui(t,c,h,l,E(f)?t.length:l+f),c}return Ui(t,c,h),c}function $c(i){let t=i.options.offset,e=i._tickSize(),s=i._length/e+(t?0:1),n=i._maxLength/e;return Math.floor(Math.min(s,n))}function Yc(i,t,e){let s=Xc(i),n=t.length/e;if(!s)return Math.max(n,1);let o=mo(s);for(let a=0,r=o.length-1;a<r;a++){let l=o[a];if(l>n)return l}return Math.max(n,1)}function Kc(i){let t=[],e,s;for(e=0,s=i.length;e<s;e++)i[e].major&&t.push(e);return t}function Uc(i,t,e,s){let n=0,o=e[0],a;for(s=Math.ceil(s),a=0;a<i.length;a++)a===o&&(t.push(i[a]),n++,o=e[n*s])}function Ui(i,t,e,s,n){let o=C(s,0),a=Math.min(C(n,i.length),i.length),r=0,l,c,h;for(e=Math.ceil(e),n&&(l=n-s,e=l/Math.floor(l/e)),h=o;h<0;)r++,h=Math.round(o+r*e);for(c=Math.max(o,0);c<a;c++)c===h&&(t.push(i[c]),r++,h=Math.round(o+r*e))}function Xc(i){let t=i.length,e,s;if(t<2)return!1;for(s=i[0],e=1;e<t;++e)if(i[e]-i[e-1]!==s)return!1;return s}var Gc=i=>i==="left"?"right":i==="right"?"left":i,sa=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,na=(i,t)=>Math.min(t||i,i);function oa(i,t){let e=[],s=i.length/t,n=i.length,o=0;for(;o<n;o+=s)e.push(i[Math.floor(o)]);return e}function Jc(i,t,e){let s=i.ticks.length,n=Math.min(t,s-1),o=i._startPixel,a=i._endPixel,r=1e-6,l=i.getPixelForTick(n),c;if(!(e&&(s===1?c=Math.max(l-o,a-l):t===0?c=(i.getPixelForTick(1)-l)/2:c=(l-i.getPixelForTick(n-1))/2,l+=n<t?c:-c,l<o-r||l>a+r)))return l}function Zc(i,t){I(i,e=>{let s=e.gc,n=s.length/2,o;if(n>t){for(o=0;o<n;++o)delete e.data[s[o]];s.splice(0,n)}})}function Ue(i){return i.drawTicks?i.tickLength:0}function aa(i,t){if(!i.display)return 0;let e=$(i.font,t),s=Z(i.padding);return(z(i.text)?i.text.length:1)*e.lineHeight+s.height}function Qc(i,t){return Ct(i,{scale:t,type:"scale"})}function th(i,t,e){return Ct(i,{tick:e,index:t,type:"tick"})}function eh(i,t,e){let s=Vi(i);return(e&&t!=="right"||!e&&t==="right")&&(s=Gc(s)),s}function ih(i,t,e,s){let{top:n,left:o,bottom:a,right:r,chart:l}=i,{chartArea:c,scales:h}=l,d=0,u,f,g,p=a-n,_=r-o;if(i.isHorizontal()){if(f=J(s,o,r),O(e)){let m=Object.keys(e)[0],b=e[m];g=h[m].getPixelForValue(b)+p-t}else e==="center"?g=(c.bottom+c.top)/2+p-t:g=sa(i,e,t);u=r-o}else{if(O(e)){let m=Object.keys(e)[0],b=e[m];f=h[m].getPixelForValue(b)-_+t}else e==="center"?f=(c.left+c.right)/2-_+t:f=sa(i,e,t);g=J(s,a,n),d=e==="left"?-q:q}return{titleX:f,titleY:g,maxWidth:u,rotation:d}}var ie=class i extends rt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:s,_suggestedMax:n}=this;return t=it(t,Number.POSITIVE_INFINITY),e=it(e,Number.NEGATIVE_INFINITY),s=it(s,Number.POSITIVE_INFINITY),n=it(n,Number.NEGATIVE_INFINITY),{min:it(t,s),max:it(e,n),minDefined:H(t),maxDefined:H(e)}}getMinMax(t){let{min:e,max:s,minDefined:n,maxDefined:o}=this.getUserBounds(),a;if(n&&o)return{min:e,max:s};let r=this.getMatchingVisibleMetas();for(let l=0,c=r.length;l<c;++l)a=r[l].controller.getMinMax(this,t),n||(e=Math.min(e,a.min)),o||(s=Math.max(s,a.max));return e=o&&e>s?s:e,s=n&&e>s?e:s,{min:it(e,it(s,e)),max:it(s,it(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){R(this.options.beforeUpdate,[this])}update(t,e,s){let{beginAtZero:n,grace:o,ticks:a}=this.options,r=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Eo(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=r<this.ticks.length;this._convertTicksToLabels(l?oa(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=jc(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,s;this.isHorizontal()?(e=this.left,s=this.right):(e=this.top,s=this.bottom,t=!t),this._startPixel=e,this._endPixel=s,this._reversePixels=t,this._length=s-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){R(this.options.afterUpdate,[this])}beforeSetDimensions(){R(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){R(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),R(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){R(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){let e=this.options.ticks,s,n,o;for(s=0,n=t.length;s<n;s++)o=t[s],o.label=R(e.callback,[o.value,s,t],this)}afterTickToLabelConversion(){R(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){R(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let t=this.options,e=t.ticks,s=na(this.ticks.length,t.ticks.maxTicksLimit),n=e.minRotation||0,o=e.maxRotation,a=n,r,l,c;if(!this._isVisible()||!e.display||n>=o||s<=1||!this.isHorizontal()){this.labelRotation=n;return}let h=this._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=U(this.chart.width-d,0,this.maxWidth);r=t.offset?this.maxWidth/s:f/(s-1),d+6>r&&(r=f/(s-(t.offset?.5:1)),l=this.maxHeight-Ue(t.grid)-e.padding-aa(t.title,this.chart.options.font),c=Math.sqrt(d*d+u*u),a=zi(Math.min(Math.asin(U((h.highest.height+6)/r,-1,1)),Math.asin(U(l/c,-1,1))-Math.asin(U(u/c,-1,1)))),a=Math.max(n,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){R(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){R(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:e,options:{ticks:s,title:n,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){let l=aa(n,e.options.font);if(r?(t.width=this.maxWidth,t.height=Ue(o)+l):(t.height=this.maxHeight,t.width=Ue(o)+l),s.display&&this.ticks.length){let{first:c,last:h,widest:d,highest:u}=this._getLabelSizes(),f=s.padding*2,g=ct(this.labelRotation),p=Math.cos(g),_=Math.sin(g);if(r){let m=s.mirror?0:_*d.width+p*u.height;t.height=Math.min(this.maxHeight,t.height+m+f)}else{let m=s.mirror?0:p*d.width+_*u.height;t.width=Math.min(this.maxWidth,t.width+m+f)}this._calculatePadding(c,h,_,p)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,s,n){let{ticks:{align:o,padding:a},position:r}=this.options,l=this.labelRotation!==0,c=r!=="top"&&this.axis==="x";if(this.isHorizontal()){let h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1),u=0,f=0;l?c?(u=n*t.width,f=s*e.height):(u=s*t.height,f=n*e.width):o==="start"?f=e.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,f=e.width/2),this.paddingLeft=Math.max((u-h+a)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-d+a)*this.width/(this.width-d),0)}else{let h=e.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=e.height,d=0),this.paddingTop=h+a,this.paddingBottom=d+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){R(this.options.afterFit,[this])}isHorizontal(){let{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e<s;e++)E(t[e].label)&&(t.splice(e,1),s--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){let e=this.options.ticks.sampleSize,s=this.ticks;e<s.length&&(s=oa(s,e)),this._labelSizes=t=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,s){let{ctx:n,_longestTextCache:o}=this,a=[],r=[],l=Math.floor(e/na(e,s)),c=0,h=0,d,u,f,g,p,_,m,b,x,w,y;for(d=0;d<e;d+=l){if(g=t[d].label,p=this._resolveTickFontOptions(d),n.font=_=p.string,m=o[_]=o[_]||{data:{},gc:[]},b=p.lineHeight,x=w=0,!E(g)&&!z(g))x=Ne(n,m.data,m.gc,x,g),w=b;else if(z(g))for(u=0,f=g.length;u<f;++u)y=g[u],!E(y)&&!z(y)&&(x=Ne(n,m.data,m.gc,x,y),w+=b);a.push(x),r.push(w),c=Math.max(x,c),h=Math.max(w,h)}Zc(o,e);let S=a.indexOf(c),k=r.indexOf(h),M=D=>({width:a[D]||0,height:r[D]||0});return{first:M(0),last:M(e-1),widest:M(S),highest:M(k),widths:a,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){let e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let e=this._startPixel+t*this._length;return yo(this._alignToPixels?zt(this.chart,e,0):e)}getDecimalForPixel(t){let e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){let e=this.ticks||[];if(t>=0&&t<e.length){let s=e[t];return s.$context||(s.$context=th(this.getContext(),t,s))}return this.$context||(this.$context=Qc(this.chart.getContext(),this))}_tickSize(){let t=this.options.ticks,e=ct(this.labelRotation),s=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),o=this._getLabelSizes(),a=t.autoSkipPadding||0,r=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return this.isHorizontal()?l*s>r*n?r/s:l/n:l*n<r*s?l/s:r/n}_isVisible(){let t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){let e=this.axis,s=this.chart,n=this.options,{grid:o,position:a,border:r}=n,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),u=Ue(o),f=[],g=r.setContext(this.getContext()),p=g.display?g.width:0,_=p/2,m=function(N){return zt(s,N,p)},b,x,w,y,S,k,M,D,A,P,T,X;if(a==="top")b=m(this.bottom),k=this.bottom-u,D=b-_,P=m(t.top)+_,X=t.bottom;else if(a==="bottom")b=m(this.top),P=t.top,X=m(t.bottom)-_,k=b+_,D=this.top+u;else if(a==="left")b=m(this.right),S=this.right-u,M=b-_,A=m(t.left)+_,T=t.right;else if(a==="right")b=m(this.left),A=t.left,T=m(t.right)-_,S=b+_,M=this.left+u;else if(e==="x"){if(a==="center")b=m((t.top+t.bottom)/2+.5);else if(O(a)){let N=Object.keys(a)[0],j=a[N];b=m(this.chart.scales[N].getPixelForValue(j))}P=t.top,X=t.bottom,k=b+_,D=k+u}else if(e==="y"){if(a==="center")b=m((t.left+t.right)/2);else if(O(a)){let N=Object.keys(a)[0],j=a[N];b=m(this.chart.scales[N].getPixelForValue(j))}S=b-_,M=S-u,A=t.left,T=t.right}let ot=C(n.ticks.maxTicksLimit,d),L=Math.max(1,Math.ceil(d/ot));for(x=0;x<d;x+=L){let N=this.getContext(x),j=o.setContext(N),ut=r.setContext(N),Q=j.lineWidth,ae=j.color,Mi=ut.dash||[],re=ut.dashOffset,Ie=j.tickWidth,qt=j.tickColor,Le=j.tickBorderDash||[],jt=j.tickBorderDashOffset;w=Jc(this,x,l),w!==void 0&&(y=zt(s,w,Q),c?S=M=A=T=y:k=D=P=X=y,f.push({tx1:S,ty1:k,tx2:M,ty2:D,x1:A,y1:P,x2:T,y2:X,width:Q,color:ae,borderDash:Mi,borderDashOffset:re,tickWidth:Ie,tickColor:qt,tickBorderDash:Le,tickBorderDashOffset:jt}))}return this._ticksLength=d,this._borderValue=b,f}_computeLabelItems(t){let e=this.axis,s=this.options,{position:n,ticks:o}=s,a=this.isHorizontal(),r=this.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=o,u=Ue(s.grid),f=u+h,g=d?-h:f,p=-ct(this.labelRotation),_=[],m,b,x,w,y,S,k,M,D,A,P,T,X="middle";if(n==="top")S=this.bottom-g,k=this._getXAxisLabelAlignment();else if(n==="bottom")S=this.top+g,k=this._getXAxisLabelAlignment();else if(n==="left"){let L=this._getYAxisLabelAlignment(u);k=L.textAlign,y=L.x}else if(n==="right"){let L=this._getYAxisLabelAlignment(u);k=L.textAlign,y=L.x}else if(e==="x"){if(n==="center")S=(t.top+t.bottom)/2+f;else if(O(n)){let L=Object.keys(n)[0],N=n[L];S=this.chart.scales[L].getPixelForValue(N)+f}k=this._getXAxisLabelAlignment()}else if(e==="y"){if(n==="center")y=(t.left+t.right)/2-f;else if(O(n)){let L=Object.keys(n)[0],N=n[L];y=this.chart.scales[L].getPixelForValue(N)}k=this._getYAxisLabelAlignment(u).textAlign}e==="y"&&(l==="start"?X="top":l==="end"&&(X="bottom"));let ot=this._getLabelSizes();for(m=0,b=r.length;m<b;++m){x=r[m],w=x.label;let L=o.setContext(this.getContext(m));M=this.getPixelForTick(m)+o.labelOffset,D=this._resolveTickFontOptions(m),A=D.lineHeight,P=z(w)?w.length:1;let N=P/2,j=L.color,ut=L.textStrokeColor,Q=L.textStrokeWidth,ae=k;a?(y=M,k==="inner"&&(m===b-1?ae=this.options.reverse?"left":"right":m===0?ae=this.options.reverse?"right":"left":ae="center"),n==="top"?c==="near"||p!==0?T=-P*A+A/2:c==="center"?T=-ot.highest.height/2-N*A+A:T=-ot.highest.height+A/2:c==="near"||p!==0?T=A/2:c==="center"?T=ot.highest.height/2-N*A:T=ot.highest.height-P*A,d&&(T*=-1),p!==0&&!L.showLabelBackdrop&&(y+=A/2*Math.sin(p))):(S=M,T=(1-P)*A/2);let Mi;if(L.showLabelBackdrop){let re=Z(L.backdropPadding),Ie=ot.heights[m],qt=ot.widths[m],Le=T-re.top,jt=0-re.left;switch(X){case"middle":Le-=Ie/2;break;case"bottom":Le-=Ie;break}switch(k){case"center":jt-=qt/2;break;case"right":jt-=qt;break;case"inner":m===b-1?jt-=qt:m>0&&(jt-=qt/2);break}Mi={left:jt,top:Le,width:qt+re.width,height:Ie+re.height,color:L.backdropColor}}_.push({label:w,font:D,textOffset:T,options:{rotation:p,color:j,strokeColor:ut,strokeWidth:Q,textAlign:ae,textBaseline:X,translation:[y,S],backdrop:Mi}})}return _}_getXAxisLabelAlignment(){let{position:t,ticks:e}=this.options;if(-ct(this.labelRotation))return t==="top"?"left":"right";let n="center";return e.align==="start"?n="left":e.align==="end"?n="right":e.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(t){let{position:e,ticks:{crossAlign:s,mirror:n,padding:o}}=this.options,a=this._getLabelSizes(),r=t+o,l=a.widest.width,c,h;return e==="left"?n?(h=this.right+o,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-r,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?n?(h=this.left+o,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+r,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;let t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){let{ctx:t,options:{backgroundColor:e},left:s,top:n,width:o,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(s,n,o,a),t.restore())}getLineWidthForValue(t){let e=this.options.grid;if(!this._isVisible()||!e.display)return 0;let n=this.ticks.findIndex(o=>o.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){let e=this.options.grid,s=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),o,a,r=(l,c,h)=>{!h.width||!h.color||(s.save(),s.lineWidth=h.width,s.strokeStyle=h.color,s.setLineDash(h.borderDash||[]),s.lineDashOffset=h.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.stroke(),s.restore())};if(e.display)for(o=0,a=n.length;o<a;++o){let l=n[o];e.drawOnChartArea&&r({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&r({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){let{chart:t,ctx:e,options:{border:s,grid:n}}=this,o=s.setContext(this.getContext()),a=s.display?o.width:0;if(!a)return;let r=n.setContext(this.getContext(0)).lineWidth,l=this._borderValue,c,h,d,u;this.isHorizontal()?(c=zt(t,this.left,a)-a/2,h=zt(t,this.right,r)+r/2,d=u=l):(d=zt(t,this.top,a)-a/2,u=zt(t,this.bottom,r)+r/2,c=h=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,d),e.lineTo(h,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;let s=this.ctx,n=this._computeLabelArea();n&&qe(s,n);let o=this.getLabelItems(t);for(let a of o){let r=a.options,l=a.font,c=a.label,h=a.textOffset;Bt(s,c,0,h,l,r)}n&&je(s)}drawTitle(){let{ctx:t,options:{position:e,title:s,reverse:n}}=this;if(!s.display)return;let o=$(s.font),a=Z(s.padding),r=s.align,l=o.lineHeight/2;e==="bottom"||e==="center"||O(e)?(l+=a.bottom,z(s.text)&&(l+=o.lineHeight*(s.text.length-1))):l+=a.top;let{titleX:c,titleY:h,maxWidth:d,rotation:u}=ih(this,l,e,r);Bt(t,s.text,0,0,o,{color:s.color,maxWidth:d,rotation:u,textAlign:eh(r,e,n),textBaseline:"middle",translation:[c,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){let t=this.options,e=t.ticks&&t.ticks.z||0,s=C(t.grid&&t.grid.z,-1),n=C(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==i.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){let e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[],o,a;for(o=0,a=e.length;o<a;++o){let r=e[o];r[s]===this.id&&(!t||r.type===t)&&n.push(r)}return n}_resolveTickFontOptions(t){let e=this.options.ticks.setContext(this.getContext(t));return $(e.font)}_maxDigits(){let t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}},Ce=class{constructor(t,e,s){this.type=t,this.scope=e,this.override=s,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){let e=Object.getPrototypeOf(t),s;oh(e)&&(s=this.register(e));let n=this.items,o=t.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in n||(n[o]=t,sh(t,a,s),this.override&&V.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){let e=this.items,s=t.id,n=this.scope;s in e&&delete e[s],n&&s in V[n]&&(delete V[n][s],this.override&&delete Rt[s])}};function sh(i,t,e){let s=he(Object.create(null),[e?V.get(e):{},V.get(t),i.defaults]);V.set(t,s),i.defaultRoutes&&nh(t,i.defaultRoutes),i.descriptors&&V.describe(t,i.descriptors)}function nh(i,t){Object.keys(t).forEach(e=>{let s=e.split("."),n=s.pop(),o=[i].concat(s).join("."),a=t[e].split("."),r=a.pop(),l=a.join(".");V.route(o,n,l,r)})}function oh(i){return"id"in i&&"defaults"in i}var wn=class{constructor(){this.controllers=new Ce(at,"datasets",!0),this.elements=new Ce(rt,"elements"),this.plugins=new Ce(Object,"plugins"),this.scales=new Ce(ie,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,s){[...e].forEach(n=>{let o=s||this._getRegistryForType(n);s||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):I(n,a=>{let r=s||this._getRegistryForType(a);this._exec(t,r,a)})})}_exec(t,e,s){let n=Ri(t);R(s["before"+n],[],s),e[t](s),R(s["after"+n],[],s)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){let s=this._typedRegistries[e];if(s.isForType(t))return s}return this.plugins}_get(t,e,s){let n=e.get(t);if(n===void 0)throw new Error('"'+t+'" is not a registered '+s+".");return n}},xt=new wn,vn=class{constructor(){this._init=void 0}notify(t,e,s,n){if(e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;let o=n?this._descriptors(t).filter(n):this._descriptors(t),a=this._notify(o,t,e,s);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),a}_notify(t,e,s,n){n=n||{};for(let o of t){let a=o.plugin,r=a[s],l=[e,n,o.options];if(R(r,l,a)===!1&&n.cancelable)return!1}return!0}invalidate(){E(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;let e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){let s=t&&t.config,n=C(s.options&&s.options.plugins,{}),o=ah(s);return n===!1&&!e?[]:lh(t,o,n,e)}_notifyStateChanges(t){let e=this._oldCache||[],s=this._cache,n=(o,a)=>o.filter(r=>!a.some(l=>r.plugin.id===l.plugin.id));this._notify(n(e,s),t,"stop"),this._notify(n(s,e),t,"start")}};function ah(i){let t={},e=[],s=Object.keys(xt.plugins.items);for(let o=0;o<s.length;o++)e.push(xt.getPlugin(s[o]));let n=i.plugins||[];for(let o=0;o<n.length;o++){let a=n[o];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function rh(i,t){return!t&&i===!1?null:i===!0?{}:i}function lh(i,{plugins:t,localIds:e},s,n){let o=[],a=i.getContext();for(let r of t){let l=r.id,c=rh(s[l],n);c!==null&&o.push({plugin:r,options:ch(i.config,{plugin:r,local:e[l]},c,a)})}return o}function ch(i,{plugin:t,local:e},s,n){let o=i.pluginScopeKeys(t),a=i.getOptionScopes(s,o);return e&&t.defaults&&a.push(t.defaults),i.createResolver(a,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Sn(i,t){let e=V.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function hh(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function dh(i,t){return i===t?"_index_":"_value_"}function ra(i){if(i==="x"||i==="y"||i==="r")return i}function uh(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function kn(i,...t){if(ra(i))return i;for(let e of t){let s=e.axis||uh(e.position)||i.length>1&&ra(i[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function la(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function fh(i,t){if(t.data&&t.data.datasets){let e=t.data.datasets.filter(s=>s.xAxisID===i||s.yAxisID===i);if(e.length)return la(i,"x",e[0])||la(i,"y",e[0])}return{}}function gh(i,t){let e=Rt[i.type]||{scales:{}},s=t.scales||{},n=Sn(i.type,t),o=Object.create(null);return Object.keys(s).forEach(a=>{let r=s[a];if(!O(r))return console.error(`Invalid scale configuration for scale: ${a}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);let l=kn(a,r,fh(a,i),V.scales[r.type]),c=dh(l,n),h=e.scales||{};o[a]=ue(Object.create(null),[{axis:l},r,h[l],h[c]])}),i.data.datasets.forEach(a=>{let r=a.type||i.type,l=a.indexAxis||Sn(r,t),h=(Rt[r]||{}).scales||{};Object.keys(h).forEach(d=>{let u=hh(d,l),f=a[u+"AxisID"]||u;o[f]=o[f]||Object.create(null),ue(o[f],[{axis:u},s[f],h[d]])})}),Object.keys(o).forEach(a=>{let r=o[a];ue(r,[V.scales[r.type],V.scale])}),o}function Ka(i){let t=i.options||(i.options={});t.plugins=C(t.plugins,{}),t.scales=gh(i,t)}function Ua(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function ph(i){return i=i||{},i.data=Ua(i.data),Ka(i),i}var ca=new Map,Xa=new Set;function Xi(i,t){let e=ca.get(i);return e||(e=t(),ca.set(i,e),Xa.add(e)),e}var Xe=(i,t,e)=>{let s=Dt(t,e);s!==void 0&&i.add(s)},Mn=class{constructor(t){this._config=ph(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Ua(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),Ka(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Xi(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Xi(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Xi(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){let e=t.id,s=this.type;return Xi(`${s}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){let s=this._scopeCache,n=s.get(t);return(!n||e)&&(n=new Map,s.set(t,n)),n}getOptionScopes(t,e,s){let{options:n,type:o}=this,a=this._cachedScopes(t,s),r=a.get(e);if(r)return r;let l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>Xe(l,t,d))),h.forEach(d=>Xe(l,n,d)),h.forEach(d=>Xe(l,Rt[o]||{},d)),h.forEach(d=>Xe(l,V,d)),h.forEach(d=>Xe(l,Ni,d))});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Xa.has(e)&&a.set(e,c),c}chartOptionScopes(){let{options:t,type:e}=this;return[t,Rt[e]||{},V.datasets[e]||{},{type:e},V,Ni]}resolveNamedOptions(t,e,s,n=[""]){let o={$shared:!0},{resolver:a,subPrefixes:r}=ha(this._resolverCache,t,n),l=a;if(mh(a,e)){o.$shared=!1,s=kt(s)?s():s;let c=this.createResolver(t,s,r);l=Kt(a,s,c)}for(let c of e)o[c]=l[c];return o}createResolver(t,e,s=[""],n){let{resolver:o}=ha(this._resolverCache,t,s);return O(e)?Kt(o,e,void 0,n):o}};function ha(i,t,e){let s=i.get(t);s||(s=new Map,i.set(t,s));let n=e.join(),o=s.get(n);return o||(o={resolver:qi(t,e),subPrefixes:e.filter(r=>!r.toLowerCase().includes("hover"))},s.set(n,o)),o}var _h=i=>O(i)&&Object.getOwnPropertyNames(i).some(t=>kt(i[t]));function mh(i,t){let{isScriptable:e,isIndexable:s}=Ks(i);for(let n of t){let o=e(n),a=s(n),r=(a||o)&&i[n];if(o&&(kt(r)||_h(r))||a&&z(r))return!0}return!1}var bh="4.5.1",yh=["top","bottom","left","right","chartArea"];function da(i,t){return i==="top"||i==="bottom"||yh.indexOf(i)===-1&&t==="x"}function ua(i,t){return function(e,s){return e[i]===s[i]?e[t]-s[t]:e[i]-s[i]}}function fa(i){let t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),R(e&&e.onComplete,[i],t)}function xh(i){let t=i.chart,e=t.options.animation;R(e&&e.onProgress,[i],t)}function Ga(i){return ji()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}var ts={},ga=i=>{let t=Ga(i);return Object.values(ts).filter(e=>e.canvas===t).pop()};function wh(i,t,e){let s=Object.keys(i);for(let n of s){let o=+n;if(o>=t){let a=i[n];delete i[n],(e>0||o>t)&&(i[o+e]=a)}}}function vh(i,t,e,s){return!e||i.type==="mouseout"?null:s?t:i}var ht=class{static register(...t){xt.add(...t),pa()}static unregister(...t){xt.remove(...t),pa()}constructor(t,e){let s=this.config=new Mn(e),n=Ga(t),o=ga(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");let a=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||qc(n)),this.platform.updateConfig(s);let r=this.platform.acquireContext(n,a.aspectRatio),l=r&&r.canvas,c=l&&l.height,h=l&&l.width;if(this.id=fo(),this.ctx=r,this.canvas=l,this.width=h,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new vn,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ko(d=>this.update(d),a.resizeDelay||0),this._dataChanges=[],ts[this.id]=this,!r||!l){console.error("Failed to create chart: can't acquire context from the given item");return}At.listen(this,"complete",fa),At.listen(this,"progress",xh),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:o}=this;return E(t)?e&&o?o:n?s/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return xt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Js(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return js(this.canvas,this.ctx),this}stop(){return At.stop(this),this}resize(t,e){At.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){let s=this.options,n=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(n,t,e,o),r=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Js(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),R(s.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){let e=this.options.scales||{};I(e,(s,n)=>{s.id=n})}buildOrUpdateScales(){let t=this.options,e=t.scales,s=this.scales,n=Object.keys(s).reduce((a,r)=>(a[r]=!1,a),{}),o=[];e&&(o=o.concat(Object.keys(e).map(a=>{let r=e[a],l=kn(a,r),c=l==="r",h=l==="x";return{options:r,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),I(o,a=>{let r=a.options,l=r.id,c=kn(l,r),h=C(r.type,a.dtype);(r.position===void 0||da(r.position,c)!==da(a.dposition))&&(r.position=a.dposition),n[l]=!0;let d=null;if(l in s&&s[l].type===h)d=s[l];else{let u=xt.getScale(h);d=new u({id:l,type:h,ctx:this.ctx,chart:this}),s[d.id]=d}d.init(r,t)}),I(n,(a,r)=>{a||delete s[r]}),I(s,a=>{tt.configure(this,a,a.options),tt.addBox(this,a)})}_updateMetasets(){let t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((n,o)=>n.index-o.index),s>e){for(let n=e;n<s;++n)this._destroyDatasetMeta(n);t.splice(e,s-e)}this._sortedMetasets=t.slice(0).sort(ua("order","index"))}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((s,n)=>{e.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){let t=[],e=this.data.datasets,s,n;for(this._removeUnreferencedMetasets(),s=0,n=e.length;s<n;s++){let o=e[s],a=this.getDatasetMeta(s),r=o.type||this.config.type;if(a.type&&a.type!==r&&(this._destroyDatasetMeta(s),a=this.getDatasetMeta(s)),a.type=r,a.indexAxis=o.indexAxis||Sn(r,this.options),a.order=o.order||0,a.index=s,a.label=""+o.label,a.visible=this.isDatasetVisible(s),a.controller)a.controller.updateIndex(s),a.controller.linkScales();else{let l=xt.getController(r),{datasetElementType:c,dataElementType:h}=V.datasets[r];Object.assign(l,{dataElementType:xt.getElement(h),datasetElementType:c&&xt.getElement(c)}),a.controller=new l(this,s),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){I(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let e=this.config;e.update();let s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;let o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,h=this.data.datasets.length;c<h;c++){let{controller:d}=this.getDatasetMeta(c),u=!n&&o.indexOf(d)===-1;d.buildOrUpdateElements(u),a=Math.max(+d.getMaxOverflow(),a)}a=this._minPadding=s.layout.autoPadding?a:0,this._updateLayout(a),n||I(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(ua("z","_idx"));let{_active:r,_lastEvent:l}=this;l?this._eventHandler(l,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){I(this.scales,t=>{tt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!Os(e,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(let{method:s,start:n,count:o}of e){let a=s==="_removeElements"?-o:o;wh(t,n,a)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let e=this.data.datasets.length,s=o=>new Set(t.filter(a=>a[0]===o).map((a,r)=>r+","+a.splice(1).join(","))),n=s(0);for(let o=1;o<e;o++)if(!Os(n,s(o)))return;return Array.from(n).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;tt.update(this,this.width,this.height,t);let e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],I(this.boxes,n=>{s&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e<s;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,s=this.data.datasets.length;e<s;++e)this._updateDataset(e,kt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){let s=this.getDatasetMeta(t),n={meta:s,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",n)!==!1&&(s.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(At.has(this)?this.attached&&!At.running(this)&&At.start(this):(this.draw(),fa({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){let{width:s,height:n}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(s,n)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;let e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){let e=this._sortedMetasets,s=[],n,o;for(n=0,o=e.length;n<o;++n){let a=e[n];(!t||a.visible)&&s.push(a)}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;let t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let e=this.ctx,s={meta:t,index:t.index,cancelable:!0},n=nn(this,t);this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(n&&qe(e,n),t.controller.draw(),n&&je(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return _t(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){let o=kc.modes[e];return typeof o=="function"?o(this,t,s,n):[]}getDatasetMeta(t){let e=this.data.datasets[t],s=this._metasets,n=s.filter(o=>o&&o._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},s.push(n)),n}getContext(){return this.$context||(this.$context=Ct(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let e=this.data.datasets[t];if(!e)return!1;let s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){let s=this.getDatasetMeta(t);s.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){let n=s?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,n);fe(e)?(o.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),a.update(o,{visible:s}),this.update(r=>r.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){let e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),At.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),js(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete ts[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let t=this._listeners,e=this.platform,s=(o,a)=>{e.addEventListener(this,o,a),t[o]=a},n=(o,a,r)=>{o.offsetX=a,o.offsetY=r,this._eventHandler(o)};I(this.options.events,o=>s(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,e=this.platform,s=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},n=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)},a,r=()=>{n("attach",r),this.attached=!0,this.resize(),s("resize",o),s("detach",a)};a=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),s("attach",r)},e.isAttached(this.canvas)?r():a()}unbindEvents(){I(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},I(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,s){let n=s?"set":"remove",o,a,r,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),r=0,l=t.length;r<l;++r){a=t[r];let c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[n+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){let e=this._active||[],s=t.map(({datasetIndex:o,index:a})=>{let r=this.getDatasetMeta(o);if(!r)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:r.data[a],index:a}});!We(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,s){let n=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),a=o(e,t),r=s?t:o(t,e);a.length&&this.updateHoverStyle(a,n.mode,!1),r.length&&n.mode&&this.updateHoverStyle(r,n.mode,!0)}_eventHandler(t,e){let s={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,n)===!1)return;let o=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,n),(o||s.changed)&&this.render(),this}_handleEvent(t,e,s){let{_active:n=[],options:o}=this,a=e,r=this._getActiveElements(t,n,s,a),l=_o(t),c=vh(t,this._lastEvent,s,l);s&&(this._lastEvent=null,R(o.onHover,[t,r,this],this),l&&R(o.onClick,[t,r,this],this));let h=!We(r,n);return(h||e)&&(this._active=r,this._updateHoverStyles(r,n,e)),this._lastEvent=c,h}_getActiveElements(t,e,s,n){if(t.type==="mouseout")return[];if(!s)return e;let o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}};v(ht,"defaults",V),v(ht,"instances",ts),v(ht,"overrides",Rt),v(ht,"registry",xt),v(ht,"version",bh),v(ht,"getChart",ga);function pa(){return I(ht.instances,i=>i._plugins.invalidate())}function Sh(i,t,e){let{startAngle:s,x:n,y:o,outerRadius:a,innerRadius:r,options:l}=t,{borderWidth:c,borderJoinStyle:h}=l,d=Math.min(c/a,G(s-e));if(i.beginPath(),i.arc(n,o,a-c/2,s+d/2,e-d/2),r>0){let u=Math.min(c/r,G(s-e));i.arc(n,o,r+c/2,e-u/2,s+u/2,!0)}else{let u=Math.min(c/2,a*G(s-e));if(h==="round")i.arc(n,o,u,e-F/2,s+F/2,!0);else if(h==="bevel"){let f=2*u*u,g=-f*Math.cos(e+F/2)+n,p=-f*Math.sin(e+F/2)+o,_=f*Math.cos(s+F/2)+n,m=f*Math.sin(s+F/2)+o;i.lineTo(g,p),i.lineTo(_,m)}}i.closePath(),i.moveTo(0,0),i.rect(0,0,i.canvas.width,i.canvas.height),i.clip("evenodd")}function kh(i,t,e){let{startAngle:s,pixelMargin:n,x:o,y:a,outerRadius:r,innerRadius:l}=t,c=n/r;i.beginPath(),i.arc(o,a,r,s-c,e+c),l>n?(c=n/l,i.arc(o,a,l,e+c,s-c,!0)):i.arc(o,a,n,e+q,s-q),i.closePath(),i.clip()}function Mh(i){return Hi(i,["outerStart","outerEnd","innerStart","innerEnd"])}function Dh(i,t,e,s){let n=Mh(i.options.borderRadius),o=(e-t)/2,a=Math.min(o,s*t/2),r=l=>{let c=(e-Math.min(o,l))*s/2;return U(l,0,Math.min(o,c))};return{outerStart:r(n.outerStart),outerEnd:r(n.outerEnd),innerStart:U(n.innerStart,0,a),innerEnd:U(n.innerEnd,0,a)}}function ye(i,t,e,s){return{x:e+i*Math.cos(t),y:s+i*Math.sin(t)}}function ns(i,t,e,s,n,o){let{x:a,y:r,startAngle:l,pixelMargin:c,innerRadius:h}=t,d=Math.max(t.outerRadius+s+e-c,0),u=h>0?h+s+e+c:0,f=0,g=n-l;if(s){let L=h>0?h-s:0,N=d>0?d-s:0,j=(L+N)/2,ut=j!==0?g*j/(j+s):g;f=(g-ut)/2}let p=Math.max(.001,g*d-e/F)/d,_=(g-p)/2,m=l+_+f,b=n-_-f,{outerStart:x,outerEnd:w,innerStart:y,innerEnd:S}=Dh(t,u,d,b-m),k=d-x,M=d-w,D=m+x/k,A=b-w/M,P=u+y,T=u+S,X=m+y/P,ot=b-S/T;if(i.beginPath(),o){let L=(D+A)/2;if(i.arc(a,r,d,D,L),i.arc(a,r,d,L,A),w>0){let Q=ye(M,A,a,r);i.arc(Q.x,Q.y,w,A,b+q)}let N=ye(T,b,a,r);if(i.lineTo(N.x,N.y),S>0){let Q=ye(T,ot,a,r);i.arc(Q.x,Q.y,S,b+q,ot+Math.PI)}let j=(b-S/u+(m+y/u))/2;if(i.arc(a,r,u,b-S/u,j,!0),i.arc(a,r,u,j,m+y/u,!0),y>0){let Q=ye(P,X,a,r);i.arc(Q.x,Q.y,y,X+Math.PI,m-q)}let ut=ye(k,m,a,r);if(i.lineTo(ut.x,ut.y),x>0){let Q=ye(k,D,a,r);i.arc(Q.x,Q.y,x,m-q,D)}}else{i.moveTo(a,r);let L=Math.cos(D)*d+a,N=Math.sin(D)*d+r;i.lineTo(L,N);let j=Math.cos(A)*d+a,ut=Math.sin(A)*d+r;i.lineTo(j,ut)}i.closePath()}function Ch(i,t,e,s,n){let{fullCircles:o,startAngle:a,circumference:r}=t,l=t.endAngle;if(o){ns(i,t,e,s,l,n);for(let c=0;c<o;++c)i.fill();isNaN(r)||(l=a+(r%B||B))}return ns(i,t,e,s,l,n),i.fill(),l}function Ah(i,t,e,s,n){let{fullCircles:o,startAngle:a,circumference:r,options:l}=t,{borderWidth:c,borderJoinStyle:h,borderDash:d,borderDashOffset:u,borderRadius:f}=l,g=l.borderAlign==="inner";if(!c)return;i.setLineDash(d||[]),i.lineDashOffset=u,g?(i.lineWidth=c*2,i.lineJoin=h||"round"):(i.lineWidth=c,i.lineJoin=h||"bevel");let p=t.endAngle;if(o){ns(i,t,e,s,p,n);for(let _=0;_<o;++_)i.stroke();isNaN(r)||(p=a+(r%B||B))}g&&kh(i,t,p),l.selfJoin&&p-a>=F&&f===0&&h!=="miter"&&Sh(i,t,p),o||(ns(i,t,e,s,p,n),i.stroke())}var Zt=class extends rt{constructor(e){super();v(this,"circumference");v(this,"endAngle");v(this,"fullCircles");v(this,"innerRadius");v(this,"outerRadius");v(this,"pixelMargin");v(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,s,n){let o=this.getProps(["x","y"],n),{angle:a,distance:r}=Ls(o,{x:e,y:s}),{startAngle:l,endAngle:c,innerRadius:h,outerRadius:d,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),f=(this.options.spacing+this.options.borderWidth)/2,g=C(u,c-l),p=pe(a,l,c)&&l!==c,_=g>=B||p,m=bt(r,h+f,d+f);return _&&m}getCenterPoint(e){let{x:s,y:n,startAngle:o,endAngle:a,innerRadius:r,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:h}=this.options,d=(o+a)/2,u=(r+l+h+c)/2;return{x:s+Math.cos(d)*u,y:n+Math.sin(d)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){let{options:s,circumference:n}=this,o=(s.offset||0)/4,a=(s.spacing||0)/2,r=s.circular;if(this.pixelMargin=s.borderAlign==="inner"?.33:0,this.fullCircles=n>B?Math.floor(n/B):0,n===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*o,Math.sin(l)*o);let c=1-Math.sin(Math.min(F,n||0)),h=o*c;e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,Ch(e,this,h,a,r),Ah(e,this,h,a,r),e.restore()}};v(Zt,"id","arc"),v(Zt,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),v(Zt,"defaultRoutes",{backgroundColor:"backgroundColor"}),v(Zt,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Ja(i,t,e=t){i.lineCap=C(e.borderCapStyle,t.borderCapStyle),i.setLineDash(C(e.borderDash,t.borderDash)),i.lineDashOffset=C(e.borderDashOffset,t.borderDashOffset),i.lineJoin=C(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=C(e.borderWidth,t.borderWidth),i.strokeStyle=C(e.borderColor,t.borderColor)}function Ph(i,t,e){i.lineTo(e.x,e.y)}function Eh(i){return i.stepped?Ao:i.tension||i.cubicInterpolationMode==="monotone"?Po:Ph}function Za(i,t,e={}){let s=i.length,{start:n=0,end:o=s-1}=e,{start:a,end:r}=t,l=Math.max(n,a),c=Math.min(o,r),h=n<a&&o<a||n>r&&o>r;return{count:s,start:l,loop:t.loop,ilen:c<l&&!h?s+c-l:c-l}}function Oh(i,t,e,s){let{points:n,options:o}=t,{count:a,start:r,loop:l,ilen:c}=Za(n,e,s),h=Eh(o),{move:d=!0,reverse:u}=s||{},f,g,p;for(f=0;f<=c;++f)g=n[(r+(u?c-f:f))%a],!g.skip&&(d?(i.moveTo(g.x,g.y),d=!1):h(i,p,g,u,o.stepped),p=g);return l&&(g=n[(r+(u?c:0))%a],h(i,p,g,u,o.stepped)),!!l}function Th(i,t,e,s){let n=t.points,{count:o,start:a,ilen:r}=Za(n,e,s),{move:l=!0,reverse:c}=s||{},h=0,d=0,u,f,g,p,_,m,b=w=>(a+(c?r-w:w))%o,x=()=>{p!==_&&(i.lineTo(h,_),i.lineTo(h,p),i.lineTo(h,m))};for(l&&(f=n[b(0)],i.moveTo(f.x,f.y)),u=0;u<=r;++u){if(f=n[b(u)],f.skip)continue;let w=f.x,y=f.y,S=w|0;S===g?(y<p?p=y:y>_&&(_=y),h=(d*h+w)/++d):(x(),i.lineTo(w,y),g=S,d=0,p=_=y),m=y}x()}function Dn(i){let t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Th:Oh}function Fh(i){return i.stepped?Bo:i.tension||i.cubicInterpolationMode==="monotone"?Vo:It}function Ih(i,t,e,s){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,s)&&n.closePath()),Ja(i,t.options),i.stroke(n)}function Lh(i,t,e,s){let{segments:n,options:o}=t,a=Dn(t);for(let r of n)Ja(i,o,r.style),i.beginPath(),a(i,t,r,{start:e,end:e+s-1})&&i.closePath(),i.stroke()}var Rh=typeof Path2D=="function";function zh(i,t,e,s){Rh&&!t.options.segment?Ih(i,t,e,s):Lh(i,t,e,s)}var wt=class extends rt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){let s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){let n=s.spanGaps?this._loop:this._fullLoop;Lo(this._points,s,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Wo(this,this.options.segment))}first(){let t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){let t=this.segments,e=this.points,s=t.length;return s&&e[t[s-1].end]}interpolate(t,e){let s=this.options,n=t[e],o=this.points,a=sn(this,{property:e,start:n,end:n});if(!a.length)return;let r=[],l=Fh(s),c,h;for(c=0,h=a.length;c<h;++c){let{start:d,end:u}=a[c],f=o[d],g=o[u];if(f===g){r.push(f);continue}let p=Math.abs((n-f[e])/(g[e]-f[e])),_=l(f,g,p,s.stepped);_[e]=t[e],r.push(_)}return r.length===1?r[0]:r}pathSegment(t,e,s){return Dn(this)(t,this,e,s)}path(t,e,s){let n=this.segments,o=Dn(this),a=this._loop;e=e||0,s=s||this.points.length-e;for(let r of n)a&=o(t,this,r,{start:e,end:e+s-1});return!!a}draw(t,e,s,n){let o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),zh(t,this,s,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}};v(wt,"id","line"),v(wt,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),v(wt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),v(wt,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function _a(i,t,e,s){let n=i.options,{[e]:o}=i.getProps([e],s);return Math.abs(t-o)<n.radius+n.hitRadius}var Me=class extends rt{constructor(e){super();v(this,"parsed");v(this,"skip");v(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,s,n){let o=this.options,{x:a,y:r}=this.getProps(["x","y"],n);return Math.pow(e-a,2)+Math.pow(s-r,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(e,s){return _a(this,e,"x",s)}inYRange(e,s){return _a(this,e,"y",s)}getCenterPoint(e){let{x:s,y:n}=this.getProps(["x","y"],e);return{x:s,y:n}}size(e){e=e||this.options||{};let s=e.radius||0;s=Math.max(s,s&&e.hoverRadius||0);let n=s&&e.borderWidth||0;return(s+n)*2}draw(e,s){let n=this.options;this.skip||n.radius<.1||!_t(this,s,this.size(n)/2)||(e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.fillStyle=n.backgroundColor,Wi(e,n,this.x,this.y))}getRange(){let e=this.options||{};return e.radius+e.hitRadius}};v(Me,"id","point"),v(Me,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),v(Me,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Qa(i,t){let{x:e,y:s,base:n,width:o,height:a}=i.getProps(["x","y","base","width","height"],t),r,l,c,h,d;return i.horizontal?(d=a/2,r=Math.min(e,n),l=Math.max(e,n),c=s-d,h=s+d):(d=o/2,r=e-d,l=e+d,c=Math.min(s,n),h=Math.max(s,n)),{left:r,top:c,right:l,bottom:h}}function Wt(i,t,e,s){return i?0:U(t,e,s)}function Bh(i,t,e){let s=i.options.borderWidth,n=i.borderSkipped,o=Ys(s);return{t:Wt(n.top,o.top,0,e),r:Wt(n.right,o.right,0,t),b:Wt(n.bottom,o.bottom,0,e),l:Wt(n.left,o.left,0,t)}}function Vh(i,t,e){let{enableBorderRadius:s}=i.getProps(["enableBorderRadius"]),n=i.options.borderRadius,o=Vt(n),a=Math.min(t,e),r=i.borderSkipped,l=s||O(n);return{topLeft:Wt(!l||r.top||r.left,o.topLeft,0,a),topRight:Wt(!l||r.top||r.right,o.topRight,0,a),bottomLeft:Wt(!l||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:Wt(!l||r.bottom||r.right,o.bottomRight,0,a)}}function Nh(i){let t=Qa(i),e=t.right-t.left,s=t.bottom-t.top,n=Bh(i,e/2,s/2),o=Vh(i,e/2,s/2);return{outer:{x:t.left,y:t.top,w:e,h:s,radius:o},inner:{x:t.left+n.l,y:t.top+n.t,w:e-n.l-n.r,h:s-n.t-n.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,o.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(n.b,n.r))}}}}function un(i,t,e,s){let n=t===null,o=e===null,r=i&&!(n&&o)&&Qa(i,s);return r&&(n||bt(t,r.left,r.right))&&(o||bt(e,r.top,r.bottom))}function Wh(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function Hh(i,t){i.rect(t.x,t.y,t.w,t.h)}function fn(i,t,e={}){let s=i.x!==e.x?-t:0,n=i.y!==e.y?-t:0,o=(i.x+i.w!==e.x+e.w?t:0)-s,a=(i.y+i.h!==e.y+e.h?t:0)-n;return{x:i.x+s,y:i.y+n,w:i.w+o,h:i.h+a,radius:i.radius}}var De=class extends rt{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){let{inflateAmount:e,options:{borderColor:s,backgroundColor:n}}=this,{inner:o,outer:a}=Nh(this),r=Wh(a.radius)?me:Hh;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),r(t,fn(a,e,o)),t.clip(),r(t,fn(o,-e,a)),t.fillStyle=s,t.fill("evenodd")),t.beginPath(),r(t,fn(o,e)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,e,s){return un(this,t,e,s)}inXRange(t,e){return un(this,t,null,e)}inYRange(t,e){return un(this,null,t,e)}getCenterPoint(t){let{x:e,y:s,base:n,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+n)/2:e,y:o?s:(s+n)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}};v(De,"id","bar"),v(De,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),v(De,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var qh=Object.freeze({__proto__:null,ArcElement:Zt,BarElement:De,LineElement:wt,PointElement:Me}),Cn=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],ma=Cn.map(i=>i.replace("rgb(","rgba(").replace(")",", 0.5)"));function tr(i){return Cn[i%Cn.length]}function er(i){return ma[i%ma.length]}function jh(i,t){return i.borderColor=tr(t),i.backgroundColor=er(t),++t}function $h(i,t){return i.backgroundColor=i.data.map(()=>tr(t++)),t}function Yh(i,t){return i.backgroundColor=i.data.map(()=>er(t++)),t}function Kh(i){let t=0;return(e,s)=>{let n=i.getDatasetMeta(s).controller;n instanceof Et?t=$h(e,t):n instanceof te?t=Yh(e,t):n&&(t=jh(e,t))}}function ba(i){let t;for(t in i)if(i[t].borderColor||i[t].backgroundColor)return!0;return!1}function Uh(i){return i&&(i.borderColor||i.backgroundColor)}function Xh(){return V.borderColor!=="rgba(0,0,0,0.1)"||V.backgroundColor!=="rgba(0,0,0,0.1)"}var Gh={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(i,t,e){if(!e.enabled)return;let{data:{datasets:s},options:n}=i.config,{elements:o}=n,a=ba(s)||Uh(n)||o&&ba(o)||Xh();if(!e.forceOverride&&a)return;let r=Kh(i);s.forEach(r)}};function Jh(i,t,e,s,n){let o=n.samples||s;if(o>=e)return i.slice(t,t+e);let a=[],r=(e-2)/(o-2),l=0,c=t+e-1,h=t,d,u,f,g,p;for(a[l++]=i[h],d=0;d<o-2;d++){let _=0,m=0,b,x=Math.floor((d+1)*r)+1+t,w=Math.min(Math.floor((d+2)*r)+1,e)+t,y=w-x;for(b=x;b<w;b++)_+=i[b].x,m+=i[b].y;_/=y,m/=y;let S=Math.floor(d*r)+1+t,k=Math.min(Math.floor((d+1)*r)+1,e)+t,{x:M,y:D}=i[h];for(f=g=-1,b=S;b<k;b++)g=.5*Math.abs((M-_)*(i[b].y-D)-(M-i[b].x)*(m-D)),g>f&&(f=g,u=i[b],p=b);a[l++]=u,h=p}return a[l++]=i[c],a}function Zh(i,t,e,s){let n=0,o=0,a,r,l,c,h,d,u,f,g,p,_=[],m=t+e-1,b=i[t].x,w=i[m].x-b;for(a=t;a<t+e;++a){r=i[a],l=(r.x-b)/w*s,c=r.y;let y=l|0;if(y===h)c<g?(g=c,d=a):c>p&&(p=c,u=a),n=(o*n+r.x)/++o;else{let S=a-1;if(!E(d)&&!E(u)){let k=Math.min(d,u),M=Math.max(d,u);k!==f&&k!==S&&_.push({...i[k],x:n}),M!==f&&M!==S&&_.push({...i[M],x:n})}a>0&&S!==f&&_.push(i[S]),_.push(r),h=y,o=0,g=p=c,d=u=f=a}}return _}function ir(i){if(i._decimated){let t=i._data;delete i._decimated,delete i._data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function ya(i){i.data.datasets.forEach(t=>{ir(t)})}function Qh(i,t){let e=t.length,s=0,n,{iScale:o}=i,{min:a,max:r,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(s=U(pt(t,o.axis,a).lo,0,e-1)),c?n=U(pt(t,o.axis,r).hi+1,s,e)-s:n=e-s,{start:s,count:n}}var td={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(i,t,e)=>{if(!e.enabled){ya(i);return}let s=i.width;i.data.datasets.forEach((n,o)=>{let{_data:a,indexAxis:r}=n,l=i.getDatasetMeta(o),c=a||n.data;if(be([r,i.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;let h=i.scales[l.xAxisID];if(h.type!=="linear"&&h.type!=="time"||i.options.parsing)return;let{start:d,count:u}=Qh(l,c),f=e.threshold||4*s;if(u<=f){ir(n);return}E(a)&&(n._data=c,delete n.data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(p){this._data=p}}));let g;switch(e.algorithm){case"lttb":g=Jh(c,d,u,s,e);break;case"min-max":g=Zh(c,d,u,s);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}n._decimated=g})},destroy(i){ya(i)}};function ed(i,t,e){let s=i.segments,n=i.points,o=t.points,a=[];for(let r of s){let{start:l,end:c}=r;c=rs(l,c,n);let h=An(e,n[l],n[c],r.loop);if(!t.segments){a.push({source:r,target:h,start:n[l],end:n[c]});continue}let d=sn(t,h);for(let u of d){let f=An(e,o[u.start],o[u.end],u.loop),g=en(r,n,f);for(let p of g)a.push({source:p,target:u,start:{[e]:xa(h,f,"start",Math.max)},end:{[e]:xa(h,f,"end",Math.min)}})}}return a}function An(i,t,e,s){if(s)return;let n=t[i],o=e[i];return i==="angle"&&(n=G(n),o=G(o)),{property:i,start:n,end:o}}function id(i,t){let{x:e=null,y:s=null}=i||{},n=t.points,o=[];return t.segments.forEach(({start:a,end:r})=>{r=rs(a,r,n);let l=n[a],c=n[r];s!==null?(o.push({x:l.x,y:s}),o.push({x:c.x,y:s})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}))}),o}function rs(i,t,e){for(;t>i;t--){let s=e[t];if(!isNaN(s.x)&&!isNaN(s.y))break}return t}function xa(i,t,e,s){return i&&t?s(i[e],t[e]):i?i[e]:t?t[e]:0}function sr(i,t){let e=[],s=!1;return z(i)?(s=!0,e=i):e=id(i,t),e.length?new wt({points:e,options:{tension:0},_loop:s,_fullLoop:s}):null}function wa(i){return i&&i.fill!==!1}function sd(i,t,e){let n=i[t].fill,o=[t],a;if(!e)return n;for(;n!==!1&&o.indexOf(n)===-1;){if(!H(n))return n;if(a=i[n],!a)return!1;if(a.visible)return n;o.push(n),n=a.fill}return!1}function nd(i,t,e){let s=ld(i);if(O(s))return isNaN(s.value)?!1:s;let n=parseFloat(s);return H(n)&&Math.floor(n)===n?od(s[0],t,n,e):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function od(i,t,e,s){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=s?!1:e}function ad(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:O(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function rd(i,t,e){let s;return i==="start"?s=e:i==="end"?s=t.options.reverse?t.min:t.max:O(i)?s=i.value:s=t.getBaseValue(),s}function ld(i){let t=i.options,e=t.fill,s=C(e&&e.target,e);return s===void 0&&(s=!!t.backgroundColor),s===!1||s===null?!1:s===!0?"origin":s}function cd(i){let{scale:t,index:e,line:s}=i,n=[],o=s.segments,a=s.points,r=hd(t,e);r.push(sr({x:null,y:t.bottom},s));for(let l=0;l<o.length;l++){let c=o[l];for(let h=c.start;h<=c.end;h++)dd(n,a[h],r)}return new wt({points:n,options:{}})}function hd(i,t){let e=[],s=i.getMatchingVisibleMetas("line");for(let n=0;n<s.length;n++){let o=s[n];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function dd(i,t,e){let s=[];for(let n=0;n<e.length;n++){let o=e[n],{first:a,last:r,point:l}=ud(o,t,"x");if(!(!l||a&&r)){if(a)s.unshift(l);else if(i.push(l),!r)break}}i.push(...s)}function ud(i,t,e){let s=i.interpolate(t,e);if(!s)return{};let n=s[e],o=i.segments,a=i.points,r=!1,l=!1;for(let c=0;c<o.length;c++){let h=o[c],d=a[h.start][e],u=a[h.end][e];if(bt(n,d,u)){r=n===d,l=n===u;break}}return{first:r,last:l,point:s}}var os=class{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,s){let{x:n,y:o,radius:a}=this;return e=e||{start:0,end:B},t.arc(n,o,a,e.end,e.start,!0),!s.bounds}interpolate(t){let{x:e,y:s,radius:n}=this,o=t.angle;return{x:e+Math.cos(o)*n,y:s+Math.sin(o)*n,angle:o}}};function fd(i){let{chart:t,fill:e,line:s}=i;if(H(e))return gd(t,e);if(e==="stack")return cd(i);if(e==="shape")return!0;let n=pd(i);return n instanceof os?n:sr(n,s)}function gd(i,t){let e=i.getDatasetMeta(t);return e&&i.isDatasetVisible(t)?e.dataset:null}function pd(i){return(i.scale||{}).getPointPositionForValue?md(i):_d(i)}function _d(i){let{scale:t={},fill:e}=i,s=ad(e,t);if(H(s)){let n=t.isHorizontal();return{x:n?s:null,y:n?null:s}}return null}function md(i){let{scale:t,fill:e}=i,s=t.options,n=t.getLabels().length,o=s.reverse?t.max:t.min,a=rd(e,t,o),r=[];if(s.grid.circular){let l=t.getPointPositionForValue(0,o);return new os({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(a)})}for(let l=0;l<n;++l)r.push(t.getPointPositionForValue(l,a));return r}function gn(i,t,e){let s=fd(t),{chart:n,index:o,line:a,scale:r,axis:l}=t,c=a.options,h=c.fill,d=c.backgroundColor,{above:u=d,below:f=d}=h||{},g=n.getDatasetMeta(o),p=nn(n,g);s&&a.points.length&&(qe(i,e),bd(i,{line:a,target:s,above:u,below:f,area:e,scale:r,axis:l,clip:p}),je(i))}function bd(i,t){let{line:e,target:s,above:n,below:o,area:a,scale:r,clip:l}=t,c=e._loop?"angle":t.axis;i.save();let h=o;o!==n&&(c==="x"?(va(i,s,a.top),pn(i,{line:e,target:s,color:n,scale:r,property:c,clip:l}),i.restore(),i.save(),va(i,s,a.bottom)):c==="y"&&(Sa(i,s,a.left),pn(i,{line:e,target:s,color:o,scale:r,property:c,clip:l}),i.restore(),i.save(),Sa(i,s,a.right),h=n)),pn(i,{line:e,target:s,color:h,scale:r,property:c,clip:l}),i.restore()}function va(i,t,e){let{segments:s,points:n}=t,o=!0,a=!1;i.beginPath();for(let r of s){let{start:l,end:c}=r,h=n[l],d=n[rs(l,c,n)];o?(i.moveTo(h.x,h.y),o=!1):(i.lineTo(h.x,e),i.lineTo(h.x,h.y)),a=!!t.pathSegment(i,r,{move:a}),a?i.closePath():i.lineTo(d.x,e)}i.lineTo(t.first().x,e),i.closePath(),i.clip()}function Sa(i,t,e){let{segments:s,points:n}=t,o=!0,a=!1;i.beginPath();for(let r of s){let{start:l,end:c}=r,h=n[l],d=n[rs(l,c,n)];o?(i.moveTo(h.x,h.y),o=!1):(i.lineTo(e,h.y),i.lineTo(h.x,h.y)),a=!!t.pathSegment(i,r,{move:a}),a?i.closePath():i.lineTo(e,d.y)}i.lineTo(e,t.first().y),i.closePath(),i.clip()}function pn(i,t){let{line:e,target:s,property:n,color:o,scale:a,clip:r}=t,l=ed(e,s,n);for(let{source:c,target:h,start:d,end:u}of l){let{style:{backgroundColor:f=o}={}}=c,g=s!==!0;i.save(),i.fillStyle=f,yd(i,a,r,g&&An(n,d,u)),i.beginPath();let p=!!e.pathSegment(i,c),_;if(g){p?i.closePath():ka(i,s,u,n);let m=!!s.pathSegment(i,h,{move:p,reverse:!0});_=p&&m,_||ka(i,s,d,n)}i.closePath(),i.fill(_?"evenodd":"nonzero"),i.restore()}}function yd(i,t,e,s){let n=t.chart.chartArea,{property:o,start:a,end:r}=s||{};if(o==="x"||o==="y"){let l,c,h,d;o==="x"?(l=a,c=n.top,h=r,d=n.bottom):(l=n.left,c=a,h=n.right,d=r),i.beginPath(),e&&(l=Math.max(l,e.left),h=Math.min(h,e.right),c=Math.max(c,e.top),d=Math.min(d,e.bottom)),i.rect(l,c,h-l,d-c),i.clip()}}function ka(i,t,e,s){let n=t.interpolate(e,s);n&&i.lineTo(n.x,n.y)}var xd={id:"filler",afterDatasetsUpdate(i,t,e){let s=(i.data.datasets||[]).length,n=[],o,a,r,l;for(a=0;a<s;++a)o=i.getDatasetMeta(a),r=o.dataset,l=null,r&&r.options&&r instanceof wt&&(l={visible:i.isDatasetVisible(a),index:a,fill:nd(r,a,s),chart:i,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=l,n.push(l);for(a=0;a<s;++a)l=n[a],!(!l||l.fill===!1)&&(l.fill=sd(n,a,e.propagate))},beforeDraw(i,t,e){let s=e.drawTime==="beforeDraw",n=i.getSortedVisibleDatasetMetas(),o=i.chartArea;for(let a=n.length-1;a>=0;--a){let r=n[a].$filler;r&&(r.line.updateControlPoints(o,r.axis),s&&r.fill&&gn(i.ctx,r,o))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;let s=i.getSortedVisibleDatasetMetas();for(let n=s.length-1;n>=0;--n){let o=s[n].$filler;wa(o)&&gn(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,t,e){let s=t.meta.$filler;!wa(s)||e.drawTime!=="beforeDatasetDraw"||gn(i.ctx,s,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},Ma=(i,t)=>{let{boxHeight:e=t,boxWidth:s=t}=i;return i.usePointStyle&&(e=Math.min(e,t),s=i.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(t,e)}},wd=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index,as=class extends rt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let t=this.options.labels||{},e=R(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,n)=>t.sort(s,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){let{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}let s=t.labels,n=$(s.font),o=n.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:l}=Ma(s,o),c,h;e.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(a,o,r,l)+10):(h=this.maxHeight,c=this._fitCols(a,n,r,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,n){let{ctx:o,maxWidth:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+r,d=t;o.textAlign="left",o.textBaseline="middle";let u=-1,f=-h;return this.legendItems.forEach((g,p)=>{let _=s+e/2+o.measureText(g.text).width;(p===0||c[c.length-1]+_+2*r>a)&&(d+=h,c[c.length-(p>0?0:1)]=0,f+=h,u++),l[p]={left:0,top:f,row:u,width:_,height:n},c[c.length-1]+=_+r}),d}_fitCols(t,e,s,n){let{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=a-t,d=r,u=0,f=0,g=0,p=0;return this.legendItems.forEach((_,m)=>{let{itemWidth:b,itemHeight:x}=vd(s,e,o,_,n);m>0&&f+x+2*r>h&&(d+=u+r,c.push({width:u,height:f}),g+=u+r,p++,u=f=0),l[m]={left:g,top:f,col:p,width:b,height:x},u=Math.max(u,b),f+=x+r}),d+=u,c.push({width:u,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:n},rtl:o}}=this,a=Xt(o,this.left,this.width);if(this.isHorizontal()){let r=0,l=J(s,this.left+n,this.right-this.lineWidths[r]);for(let c of e)r!==c.row&&(r=c.row,l=J(s,this.left+n,this.right-this.lineWidths[r])),c.top+=this.top+t+n,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+n}else{let r=0,l=J(s,this.top+t+n,this.bottom-this.columnSizes[r].height);for(let c of e)c.col!==r&&(r=c.col,l=J(s,this.top+t+n,this.bottom-this.columnSizes[r].height)),c.top=l,c.left+=this.left+n,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let t=this.ctx;qe(t,this),this._draw(),je(t)}}_draw(){let{options:t,columnSizes:e,lineWidths:s,ctx:n}=this,{align:o,labels:a}=t,r=V.color,l=Xt(t.rtl,this.left,this.width),c=$(a.font),{padding:h}=a,d=c.size,u=d/2,f;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;let{boxWidth:g,boxHeight:p,itemHeight:_}=Ma(a,d),m=function(S,k,M){if(isNaN(g)||g<=0||isNaN(p)||p<0)return;n.save();let D=C(M.lineWidth,1);if(n.fillStyle=C(M.fillStyle,r),n.lineCap=C(M.lineCap,"butt"),n.lineDashOffset=C(M.lineDashOffset,0),n.lineJoin=C(M.lineJoin,"miter"),n.lineWidth=D,n.strokeStyle=C(M.strokeStyle,r),n.setLineDash(C(M.lineDash,[])),a.usePointStyle){let A={radius:p*Math.SQRT2/2,pointStyle:M.pointStyle,rotation:M.rotation,borderWidth:D},P=l.xPlus(S,g/2),T=k+u;$s(n,A,P,T,a.pointStyleWidth&&g)}else{let A=k+Math.max((d-p)/2,0),P=l.leftForLtr(S,g),T=Vt(M.borderRadius);n.beginPath(),Object.values(T).some(X=>X!==0)?me(n,{x:P,y:A,w:g,h:p,radius:T}):n.rect(P,A,g,p),n.fill(),D!==0&&n.stroke()}n.restore()},b=function(S,k,M){Bt(n,M.text,S,k+_/2,c,{strikethrough:M.hidden,textAlign:l.textAlign(M.textAlign)})},x=this.isHorizontal(),w=this._computeTitleHeight();x?f={x:J(o,this.left+h,this.right-s[0]),y:this.top+h+w,line:0}:f={x:this.left+h,y:J(o,this.top+w+h,this.bottom-e[0].height),line:0},Qs(this.ctx,t.textDirection);let y=_+h;this.legendItems.forEach((S,k)=>{n.strokeStyle=S.fontColor,n.fillStyle=S.fontColor;let M=n.measureText(S.text).width,D=l.textAlign(S.textAlign||(S.textAlign=a.textAlign)),A=g+u+M,P=f.x,T=f.y;l.setWidth(this.width),x?k>0&&P+A+h>this.right&&(T=f.y+=y,f.line++,P=f.x=J(o,this.left+h,this.right-s[f.line])):k>0&&T+y>this.bottom&&(P=f.x=P+e[f.line].width+h,f.line++,T=f.y=J(o,this.top+w+h,this.bottom-e[f.line].height));let X=l.x(P);if(m(X,T,S),P=Mo(D,P+g+u,x?P+A:this.right,t.rtl),b(l.x(P),T,S),x)f.x+=A+h;else if(typeof S.text!="string"){let ot=c.lineHeight;f.y+=nr(S,ot)+h}else f.y+=y}),tn(this.ctx,t.textDirection)}drawTitle(){let t=this.options,e=t.title,s=$(e.font),n=Z(e.padding);if(!e.display)return;let o=Xt(t.rtl,this.left,this.width),a=this.ctx,r=e.position,l=s.size/2,c=n.top+l,h,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+c,d=J(t.align,d,this.right-u);else{let g=this.columnSizes.reduce((p,_)=>Math.max(p,_.height),0);h=c+J(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}let f=J(r,d,d+u);a.textAlign=o.textAlign(Vi(r)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=s.string,Bt(a,e.text,f,h,s)}_computeTitleHeight(){let t=this.options.title,e=$(t.font),s=Z(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,n,o;if(bt(t,this.left,this.right)&&bt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;s<o.length;++s)if(n=o[s],bt(t,n.left,n.left+n.width)&&bt(e,n.top,n.top+n.height))return this.legendItems[s]}return null}handleEvent(t){let e=this.options;if(!Md(t.type,e))return;let s=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){let n=this._hoveredItem,o=wd(n,s);n&&!o&&R(e.onLeave,[t,n,this],this),this._hoveredItem=s,s&&!o&&R(e.onHover,[t,s,this],this)}else s&&R(e.onClick,[t,s,this],this)}};function vd(i,t,e,s,n){let o=Sd(s,i,t,e),a=kd(n,s,t.lineHeight);return{itemWidth:o,itemHeight:a}}function Sd(i,t,e,s){let n=i.text;return n&&typeof n!="string"&&(n=n.reduce((o,a)=>o.length>a.length?o:a)),t+e.size/2+s.measureText(n).width}function kd(i,t,e){let s=i;return typeof t.text!="string"&&(s=nr(t,e)),s}function nr(i,t){let e=i.text?i.text.length:0;return t*e}function Md(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var Dd={id:"legend",_element:as,start(i,t,e){let s=i.legend=new as({ctx:i.ctx,options:e,chart:i});tt.configure(i,s,e),tt.addBox(i,s)},stop(i){tt.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){let s=i.legend;tt.configure(i,s,e),s.options=e},afterUpdate(i){let t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){let s=t.datasetIndex,n=e.chart;n.isDatasetVisible(s)?(n.hide(s),t.hidden=!0):(n.show(s),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){let t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:n,color:o,useBorderRadius:a,borderRadius:r}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{let c=l.controller.getStyle(e?0:void 0),h=Z(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:s||c.pointStyle,rotation:c.rotation,textAlign:n||c.textAlign,borderRadius:a&&(r||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}},oi=class extends rt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){let s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;let n=z(s.text)?s.text.length:1;this._padding=Z(s.padding);let o=n*$(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){let t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){let{top:e,left:s,bottom:n,right:o,options:a}=this,r=a.align,l=0,c,h,d;return this.isHorizontal()?(h=J(r,s,o),d=e+t,c=o-s):(a.position==="left"?(h=s+t,d=J(r,n,e),l=F*-.5):(h=o-t,d=J(r,e,n),l=F*.5),c=n-e),{titleX:h,titleY:d,maxWidth:c,rotation:l}}draw(){let t=this.ctx,e=this.options;if(!e.display)return;let s=$(e.font),o=s.lineHeight/2+this._padding.top,{titleX:a,titleY:r,maxWidth:l,rotation:c}=this._drawArgs(o);Bt(t,e.text,0,0,s,{color:e.color,maxWidth:l,rotation:c,textAlign:Vi(e.align),textBaseline:"middle",translation:[a,r]})}};function Cd(i,t){let e=new oi({ctx:i.ctx,options:t,chart:i});tt.configure(i,e,t),tt.addBox(i,e),i.titleBlock=e}var Ad={id:"title",_element:oi,start(i,t,e){Cd(i,e)},stop(i){let t=i.titleBlock;tt.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){let s=i.titleBlock;tt.configure(i,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},Gi=new WeakMap,Pd={id:"subtitle",start(i,t,e){let s=new oi({ctx:i.ctx,options:e,chart:i});tt.configure(i,s,e),tt.addBox(i,s),Gi.set(i,s)},stop(i){tt.removeBox(i,Gi.get(i)),Gi.delete(i)},beforeUpdate(i,t,e){let s=Gi.get(i);tt.configure(i,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},Ze={average(i){if(!i.length)return!1;let t,e,s=new Set,n=0,o=0;for(t=0,e=i.length;t<e;++t){let r=i[t].element;if(r&&r.hasValue()){let l=r.tooltipPosition();s.add(l.x),n+=l.y,++o}}return o===0||s.size===0?!1:{x:[...s].reduce((r,l)=>r+l)/s.size,y:n/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,s=t.y,n=Number.POSITIVE_INFINITY,o,a,r;for(o=0,a=i.length;o<a;++o){let l=i[o].element;if(l&&l.hasValue()){let c=l.getCenterPoint(),h=Ii(t,c);h<n&&(n=h,r=l)}}if(r){let l=r.tooltipPosition();e=l.x,s=l.y}return{x:e,y:s}}};function yt(i,t){return t&&(z(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function Pt(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
|
|
7
|
+
`)>-1?i.split(`
|
|
8
|
+
`):i}function Ed(i,t){let{element:e,datasetIndex:s,index:n}=t,o=i.getDatasetMeta(s).controller,{label:a,value:r}=o.getLabelAndValue(n);return{chart:i,label:a,parsed:o.getParsed(n),raw:i.data.datasets[s].data[n],formattedValue:r,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function Da(i,t){let e=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:a,boxHeight:r}=t,l=$(t.bodyFont),c=$(t.titleFont),h=$(t.footerFont),d=o.length,u=n.length,f=s.length,g=Z(t.padding),p=g.height,_=0,m=s.reduce((w,y)=>w+y.before.length+y.lines.length+y.after.length,0);if(m+=i.beforeBody.length+i.afterBody.length,d&&(p+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),m){let w=t.displayColors?Math.max(r,l.lineHeight):l.lineHeight;p+=f*w+(m-f)*l.lineHeight+(m-1)*t.bodySpacing}u&&(p+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let b=0,x=function(w){_=Math.max(_,e.measureText(w).width+b)};return e.save(),e.font=c.string,I(i.title,x),e.font=l.string,I(i.beforeBody.concat(i.afterBody),x),b=t.displayColors?a+2+t.boxPadding:0,I(s,w=>{I(w.before,x),I(w.lines,x),I(w.after,x)}),b=0,e.font=h.string,I(i.footer,x),e.restore(),_+=g.width,{width:_,height:p}}function Od(i,t){let{y:e,height:s}=t;return e<s/2?"top":e>i.height-s/2?"bottom":"center"}function Td(i,t,e,s){let{x:n,width:o}=s,a=e.caretSize+e.caretPadding;if(i==="left"&&n+o+a>t.width||i==="right"&&n-o-a<0)return!0}function Fd(i,t,e,s){let{x:n,width:o}=e,{width:a,chartArea:{left:r,right:l}}=i,c="center";return s==="center"?c=n<=(r+l)/2?"left":"right":n<=o/2?c="left":n>=a-o/2&&(c="right"),Td(c,i,t,e)&&(c="center"),c}function Ca(i,t,e){let s=e.yAlign||t.yAlign||Od(i,e);return{xAlign:e.xAlign||t.xAlign||Fd(i,t,e,s),yAlign:s}}function Id(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function Ld(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function Aa(i,t,e,s){let{caretSize:n,caretPadding:o,cornerRadius:a}=i,{xAlign:r,yAlign:l}=e,c=n+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=Vt(a),g=Id(t,r),p=Ld(t,l,c);return l==="center"?r==="left"?g+=c:r==="right"&&(g-=c):r==="left"?g-=Math.max(h,u)+n:r==="right"&&(g+=Math.max(d,f)+n),{x:U(g,0,s.width-t.width),y:U(p,0,s.height-t.height)}}function Ji(i,t,e){let s=Z(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function Pa(i){return yt([],Pt(i))}function Rd(i,t,e){return Ct(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Ea(i,t){let e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}var or={beforeTitle:mt,title(i){if(i.length>0){let t=i[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex<s)return e[t.dataIndex]}return""},afterTitle:mt,beforeBody:mt,beforeLabel:mt,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let t=i.dataset.label||"";t&&(t+=": ");let e=i.formattedValue;return E(e)||(t+=e),t},labelColor(i){let e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(i){let e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:mt,afterBody:mt,beforeFooter:mt,footer:mt,afterFooter:mt};function st(i,t,e,s){let n=i[t].call(e,s);return typeof n>"u"?or[t].call(e,s):n}var si=class extends rt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let e=this.chart,s=this.options.setContext(this.getContext()),n=s.enabled&&e.options.animation&&s.animations,o=new es(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Rd(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){let{callbacks:s}=e,n=st(s,"beforeTitle",this,t),o=st(s,"title",this,t),a=st(s,"afterTitle",this,t),r=[];return r=yt(r,Pt(n)),r=yt(r,Pt(o)),r=yt(r,Pt(a)),r}getBeforeBody(t,e){return Pa(st(e.callbacks,"beforeBody",this,t))}getBody(t,e){let{callbacks:s}=e,n=[];return I(t,o=>{let a={before:[],lines:[],after:[]},r=Ea(s,o);yt(a.before,Pt(st(r,"beforeLabel",this,o))),yt(a.lines,st(r,"label",this,o)),yt(a.after,Pt(st(r,"afterLabel",this,o))),n.push(a)}),n}getAfterBody(t,e){return Pa(st(e.callbacks,"afterBody",this,t))}getFooter(t,e){let{callbacks:s}=e,n=st(s,"beforeFooter",this,t),o=st(s,"footer",this,t),a=st(s,"afterFooter",this,t),r=[];return r=yt(r,Pt(n)),r=yt(r,Pt(o)),r=yt(r,Pt(a)),r}_createItems(t){let e=this._active,s=this.chart.data,n=[],o=[],a=[],r=[],l,c;for(l=0,c=e.length;l<c;++l)r.push(Ed(this.chart,e[l]));return t.filter&&(r=r.filter((h,d,u)=>t.filter(h,d,u,s))),t.itemSort&&(r=r.sort((h,d)=>t.itemSort(h,d,s))),I(r,h=>{let d=Ea(t.callbacks,h);n.push(st(d,"labelColor",this,h)),o.push(st(d,"labelPointStyle",this,h)),a.push(st(d,"labelTextColor",this,h))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=r,r}update(t,e){let s=this.options.setContext(this.getContext()),n=this._active,o,a=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{let r=Ze[s.position].call(this,n,this._eventPosition);a=this._createItems(s),this.title=this.getTitle(a,s),this.beforeBody=this.getBeforeBody(a,s),this.body=this.getBody(a,s),this.afterBody=this.getAfterBody(a,s),this.footer=this.getFooter(a,s);let l=this._size=Da(this,s),c=Object.assign({},r,l),h=Ca(this.chart,s,c),d=Aa(s,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:r.x,caretY:r.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,n){let o=this.getCaretPosition(t,s,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,s){let{xAlign:n,yAlign:o}=this,{caretSize:a,cornerRadius:r}=s,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=Vt(r),{x:u,y:f}=t,{width:g,height:p}=e,_,m,b,x,w,y;return o==="center"?(w=f+p/2,n==="left"?(_=u,m=_-a,x=w+a,y=w-a):(_=u+g,m=_+a,x=w-a,y=w+a),b=_):(n==="left"?m=u+Math.max(l,h)+a:n==="right"?m=u+g-Math.max(c,d)-a:m=this.caretX,o==="top"?(x=f,w=x-a,_=m-a,b=m+a):(x=f+p,w=x+a,_=m+a,b=m-a),y=x),{x1:_,x2:m,x3:b,y1:x,y2:w,y3:y}}drawTitle(t,e,s){let n=this.title,o=n.length,a,r,l;if(o){let c=Xt(s.rtl,this.x,this.width);for(t.x=Ji(this,s.titleAlign,s),e.textAlign=c.textAlign(s.titleAlign),e.textBaseline="middle",a=$(s.titleFont),r=s.titleSpacing,e.fillStyle=s.titleColor,e.font=a.string,l=0;l<o;++l)e.fillText(n[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r,l+1===o&&(t.y+=s.titleMarginBottom-r)}}_drawColorBox(t,e,s,n,o){let a=this.labelColors[s],r=this.labelPointStyles[s],{boxHeight:l,boxWidth:c}=o,h=$(o.bodyFont),d=Ji(this,"left",o),u=n.x(d),f=l<h.lineHeight?(h.lineHeight-l)/2:0,g=e.y+f;if(o.usePointStyle){let p={radius:Math.min(c,l)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},_=n.leftForLtr(u,c)+c/2,m=g+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Wi(t,p,_,m),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Wi(t,p,_,m)}else{t.lineWidth=O(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;let p=n.leftForLtr(u,c),_=n.leftForLtr(n.xPlus(u,1),c-2),m=Vt(a.borderRadius);Object.values(m).some(b=>b!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,me(t,{x:p,y:g,w:c,h:l,radius:m}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),me(t,{x:_,y:g+1,w:c-2,h:l-2,radius:m}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(p,g,c,l),t.strokeRect(p,g,c,l),t.fillStyle=a.backgroundColor,t.fillRect(_,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){let{body:n}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:l,boxWidth:c,boxPadding:h}=s,d=$(s.bodyFont),u=d.lineHeight,f=0,g=Xt(s.rtl,this.x,this.width),p=function(M){e.fillText(M,g.x(t.x+f),t.y+u/2),t.y+=u+o},_=g.textAlign(a),m,b,x,w,y,S,k;for(e.textAlign=a,e.textBaseline="middle",e.font=d.string,t.x=Ji(this,_,s),e.fillStyle=s.bodyColor,I(this.beforeBody,p),f=r&&_!=="right"?a==="center"?c/2+h:c+2+h:0,w=0,S=n.length;w<S;++w){for(m=n[w],b=this.labelTextColors[w],e.fillStyle=b,I(m.before,p),x=m.lines,r&&x.length&&(this._drawColorBox(e,t,w,g,s),u=Math.max(d.lineHeight,l)),y=0,k=x.length;y<k;++y)p(x[y]),u=d.lineHeight;I(m.after,p)}f=0,u=d.lineHeight,I(this.afterBody,p),t.y-=o}drawFooter(t,e,s){let n=this.footer,o=n.length,a,r;if(o){let l=Xt(s.rtl,this.x,this.width);for(t.x=Ji(this,s.footerAlign,s),t.y+=s.footerMarginTop,e.textAlign=l.textAlign(s.footerAlign),e.textBaseline="middle",a=$(s.footerFont),e.fillStyle=s.footerColor,e.font=a.string,r=0;r<o;++r)e.fillText(n[r],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+s.footerSpacing}}drawBackground(t,e,s,n){let{xAlign:o,yAlign:a}=this,{x:r,y:l}=t,{width:c,height:h}=s,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:g}=Vt(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(r+d,l),a==="top"&&this.drawCaret(t,e,s,n),e.lineTo(r+c-u,l),e.quadraticCurveTo(r+c,l,r+c,l+u),a==="center"&&o==="right"&&this.drawCaret(t,e,s,n),e.lineTo(r+c,l+h-g),e.quadraticCurveTo(r+c,l+h,r+c-g,l+h),a==="bottom"&&this.drawCaret(t,e,s,n),e.lineTo(r+f,l+h),e.quadraticCurveTo(r,l+h,r,l+h-f),a==="center"&&o==="left"&&this.drawCaret(t,e,s,n),e.lineTo(r,l+d),e.quadraticCurveTo(r,l,r+d,l),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){let e=this.chart,s=this.$animations,n=s&&s.x,o=s&&s.y;if(n||o){let a=Ze[t.position].call(this,this._active,this._eventPosition);if(!a)return;let r=this._size=Da(this,t),l=Object.assign({},a,this._size),c=Ca(e,t,l),h=Aa(t,l,c,e);(n._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=r.width,this.height=r.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){let e=this.options.setContext(this.getContext()),s=this.opacity;if(!s)return;this._updateAnimationTarget(e);let n={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;let a=Z(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=s,this.drawBackground(o,t,n,e),Qs(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),tn(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){let s=this._active,n=t.map(({datasetIndex:r,index:l})=>{let c=this.chart.getDatasetMeta(r);if(!c)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:c.data[l],index:l}}),o=!We(s,n),a=this._positionChanged(n,e);(o||a)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let n=this.options,o=this._active||[],a=this._getActiveElements(t,o,e,s),r=this._positionChanged(a,t),l=e||!We(a,o)||r;return l&&(this._active=a,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,s,n){let o=this.options;if(t.type==="mouseout")return[];if(!n)return e.filter(r=>this.chart.data.datasets[r.datasetIndex]&&this.chart.getDatasetMeta(r.datasetIndex).controller.getParsed(r.index)!==void 0);let a=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&a.reverse(),a}_positionChanged(t,e){let{caretX:s,caretY:n,options:o}=this,a=Ze[o.position].call(this,t,e);return a!==!1&&(s!==a.x||n!==a.y)}};v(si,"positioners",Ze);var zd={id:"tooltip",_element:si,positioners:Ze,afterInit(i,t,e){e&&(i.tooltip=new si({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){let t=i.tooltip;if(t&&t._willRender()){let e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){let e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:or},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Bd=Object.freeze({__proto__:null,Colors:Gh,Decimation:td,Filler:xd,Legend:Dd,SubTitle:Pd,Title:Ad,Tooltip:zd}),Vd=(i,t,e,s)=>(typeof t=="string"?(e=i.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Nd(i,t,e,s){let n=i.indexOf(t);if(n===-1)return Vd(i,t,e,s);let o=i.lastIndexOf(t);return n!==o?e:n}var Wd=(i,t)=>i===null?null:U(Math.round(i),0,t);function Oa(i){let t=this.getLabels();return i>=0&&i<t.length?t[i]:i}var Qe=class extends ie{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let e=this._addedLabels;if(e.length){let s=this.getLabels();for(let{index:n,label:o}of e)s[n]===o&&s.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(E(t))return null;let s=this.getLabels();return e=isFinite(e)&&s[e]===t?e:Nd(s,t,C(e,t),this._addedLabels),Wd(e,s.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),{min:s,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(s=0),e||(n=this.getLabels().length-1)),this.min=s,this.max=n}buildTicks(){let t=this.min,e=this.max,s=this.options.offset,n=[],o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let a=t;a<=e;a++)n.push({value:a});return n}getLabelForValue(t){return Oa.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){let e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}};v(Qe,"id","category"),v(Qe,"defaults",{ticks:{callback:Oa}});function Hd(i,t){let e=[],{bounds:n,step:o,min:a,max:r,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=i,f=o||1,g=h-1,{min:p,max:_}=t,m=!E(a),b=!E(r),x=!E(c),w=(_-p)/(d+1),y=Ts((_-p)/g/f)*f,S,k,M,D;if(y<1e-14&&!m&&!b)return[{value:p},{value:_}];D=Math.ceil(_/y)-Math.floor(p/y),D>g&&(y=Ts(D*y/g/f)*f),E(l)||(S=Math.pow(10,l),y=Math.ceil(y*S)/S),n==="ticks"?(k=Math.floor(p/y)*y,M=Math.ceil(_/y)*y):(k=p,M=_),m&&b&&o&&bo((r-a)/o,y/1e3)?(D=Math.round(Math.min((r-a)/y,h)),y=(r-a)/D,k=a,M=r):x?(k=m?a:k,M=b?r:M,D=c-1,y=(M-k)/D):(D=(M-k)/y,ge(D,Math.round(D),y/1e3)?D=Math.round(D):D=Math.ceil(D));let A=Math.max(Is(y),Is(k));S=Math.pow(10,E(l)?A:l),k=Math.round(k*S)/S,M=Math.round(M*S)/S;let P=0;for(m&&(u&&k!==a?(e.push({value:a}),k<a&&P++,ge(Math.round((k+P*y)*S)/S,a,Ta(a,w,i))&&P++):k<a&&P++);P<D;++P){let T=Math.round((k+P*y)*S)/S;if(b&&T>r)break;e.push({value:T})}return b&&u&&M!==r?e.length&&ge(e[e.length-1].value,r,Ta(r,w,i))?e[e.length-1].value=r:e.push({value:r}):(!b||M===r)&&e.push({value:M}),e}function Ta(i,t,{horizontal:e,minRotation:s}){let n=ct(s),o=(e?Math.sin(n):Math.cos(n))||.001,a=.75*t*(""+i).length;return Math.min(t/o,a)}var Ae=class extends ie{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return E(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:e,maxDefined:s}=this.getUserBounds(),{min:n,max:o}=this,a=l=>n=e?n:l,r=l=>o=s?o:l;if(t){let l=ft(n),c=ft(o);l<0&&c<0?r(0):l>0&&c>0&&a(0)}if(n===o){let l=o===0?1:Math.abs(o*.05);r(o+l),t||a(n-l)}this.min=n,this.max=o}getTickLimit(){let t=this.options.ticks,{maxTicksLimit:e,stepSize:s}=t,n;return s?(n=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,e=t.ticks,s=this.getTickLimit();s=Math.max(2,s);let n={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,a=Hd(n,o);return t.bounds==="ticks"&&Fs(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){let t=this.ticks,e=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){let n=(s-e)/Math.max(t.length-1,1)/2;e-=n,s+=n}this._startValue=e,this._endValue=s,this._valueRange=s-e}getLabelForValue(t){return _e(t,this.chart.options.locale,this.options.ticks.format)}},ti=class extends Ae{determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=H(t)?t:0,this.max=H(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),e=t?this.width:this.height,s=ct(this.options.ticks.minRotation),n=(t?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}};v(ti,"id","linear"),v(ti,"defaults",{ticks:{callback:He.formatters.numeric}});var ai=i=>Math.floor(Mt(i)),Jt=(i,t)=>Math.pow(10,ai(i)+t);function Fa(i){return i/Math.pow(10,ai(i))===1}function Ia(i,t,e){let s=Math.pow(10,e),n=Math.floor(i/s);return Math.ceil(t/s)-n}function qd(i,t){let e=t-i,s=ai(e);for(;Ia(i,t,s)>10;)s++;for(;Ia(i,t,s)<10;)s--;return Math.min(s,ai(i))}function jd(i,{min:t,max:e}){t=it(i.min,t);let s=[],n=ai(t),o=qd(t,e),a=o<0?Math.pow(10,Math.abs(o)):1,r=Math.pow(10,o),l=n>o?Math.pow(10,n):0,c=Math.round((t-l)*a)/a,h=Math.floor((t-l)/r/10)*r*10,d=Math.floor((c-h)/Math.pow(10,o)),u=it(i.min,Math.round((l+h+d*Math.pow(10,o))*a)/a);for(;u<e;)s.push({value:u,major:Fa(u),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,a=o>=0?1:a),u=Math.round((l+h+d*Math.pow(10,o))*a)/a;let f=it(i.max,u);return s.push({value:f,major:Fa(f),significand:d}),s}var ei=class extends ie{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){let s=Ae.prototype.parse.apply(this,[t,e]);if(s===0){this._zero=!0;return}return H(s)&&s>0?s:null}determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=H(t)?Math.max(0,t):null,this.max=H(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!H(this._userMin)&&(this.min=t===Jt(this.min,0)?Jt(this.min,-1):Jt(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),s=this.min,n=this.max,o=r=>s=t?s:r,a=r=>n=e?n:r;s===n&&(s<=0?(o(1),a(10)):(o(Jt(s,-1)),a(Jt(n,1)))),s<=0&&o(Jt(n,-1)),n<=0&&a(Jt(s,1)),this.min=s,this.max=n}buildTicks(){let t=this.options,e={min:this._userMin,max:this._userMax},s=jd(e,this);return t.bounds==="ticks"&&Fs(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}getLabelForValue(t){return t===void 0?"0":_e(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=Mt(t),this._valueRange=Mt(this.max)-Mt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Mt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}};v(ei,"id","logarithmic"),v(ei,"defaults",{ticks:{callback:He.formatters.logarithmic,major:{enabled:!0}}});function Pn(i){let t=i.ticks;if(t.display&&i.display){let e=Z(t.backdropPadding);return C(t.font&&t.font.size,V.font.size)+e.height}return 0}function $d(i,t,e){return e=z(e)?e:[e],{w:Co(i,t.string,e),h:e.length*t.lineHeight}}function La(i,t,e,s,n){return i===s||i===n?{start:t-e/2,end:t+e/2}:i<s||i>n?{start:t-e,end:t}:{start:t,end:t+e}}function Yd(i){let t={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},e=Object.assign({},t),s=[],n=[],o=i._pointLabels.length,a=i.options.pointLabels,r=a.centerPointLabels?F/o:0;for(let l=0;l<o;l++){let c=a.setContext(i.getPointLabelContext(l));n[l]=c.padding;let h=i.getPointPosition(l,i.drawingArea+n[l],r),d=$(c.font),u=$d(i.ctx,d,i._pointLabels[l]);s[l]=u;let f=G(i.getIndexAngle(l)+r),g=Math.round(zi(f)),p=La(g,h.x,u.w,0,180),_=La(g,h.y,u.h,90,270);Kd(e,t,f,p,_)}i.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),i._pointLabelItems=Gd(i,s,n)}function Kd(i,t,e,s,n){let o=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e)),r=0,l=0;s.start<t.l?(r=(t.l-s.start)/o,i.l=Math.min(i.l,t.l-r)):s.end>t.r&&(r=(s.end-t.r)/o,i.r=Math.max(i.r,t.r+r)),n.start<t.t?(l=(t.t-n.start)/a,i.t=Math.min(i.t,t.t-l)):n.end>t.b&&(l=(n.end-t.b)/a,i.b=Math.max(i.b,t.b+l))}function Ud(i,t,e){let s=i.drawingArea,{extra:n,additionalAngle:o,padding:a,size:r}=e,l=i.getPointPosition(t,s+n+a,o),c=Math.round(zi(G(l.angle+q))),h=Qd(l.y,r.h,c),d=Jd(c),u=Zd(l.x,r.w,d);return{visible:!0,x:l.x,y:h,textAlign:d,left:u,top:h,right:u+r.w,bottom:h+r.h}}function Xd(i,t){if(!t)return!0;let{left:e,top:s,right:n,bottom:o}=i;return!(_t({x:e,y:s},t)||_t({x:e,y:o},t)||_t({x:n,y:s},t)||_t({x:n,y:o},t))}function Gd(i,t,e){let s=[],n=i._pointLabels.length,o=i.options,{centerPointLabels:a,display:r}=o.pointLabels,l={extra:Pn(o)/2,additionalAngle:a?F/n:0},c;for(let h=0;h<n;h++){l.padding=e[h],l.size=t[h];let d=Ud(i,h,l);s.push(d),r==="auto"&&(d.visible=Xd(d,c),d.visible&&(c=d))}return s}function Jd(i){return i===0||i===180?"center":i<180?"left":"right"}function Zd(i,t,e){return e==="right"?i-=t:e==="center"&&(i-=t/2),i}function Qd(i,t,e){return e===90||e===270?i-=t/2:(e>270||e<90)&&(i-=t),i}function tu(i,t,e){let{left:s,top:n,right:o,bottom:a}=e,{backdropColor:r}=t;if(!E(r)){let l=Vt(t.borderRadius),c=Z(t.backdropPadding);i.fillStyle=r;let h=s-c.left,d=n-c.top,u=o-s+c.width,f=a-n+c.height;Object.values(l).some(g=>g!==0)?(i.beginPath(),me(i,{x:h,y:d,w:u,h:f,radius:l}),i.fill()):i.fillRect(h,d,u,f)}}function eu(i,t){let{ctx:e,options:{pointLabels:s}}=i;for(let n=t-1;n>=0;n--){let o=i._pointLabelItems[n];if(!o.visible)continue;let a=s.setContext(i.getPointLabelContext(n));tu(e,a,o);let r=$(a.font),{x:l,y:c,textAlign:h}=o;Bt(e,i._pointLabels[n],l,c+r.lineHeight/2,r,{color:a.color,textAlign:h,textBaseline:"middle"})}}function ar(i,t,e,s){let{ctx:n}=i;if(e)n.arc(i.xCenter,i.yCenter,t,0,B);else{let o=i.getPointPosition(0,t);n.moveTo(o.x,o.y);for(let a=1;a<s;a++)o=i.getPointPosition(a,t),n.lineTo(o.x,o.y)}}function iu(i,t,e,s,n){let o=i.ctx,a=t.circular,{color:r,lineWidth:l}=t;!a&&!s||!r||!l||e<0||(o.save(),o.strokeStyle=r,o.lineWidth=l,o.setLineDash(n.dash||[]),o.lineDashOffset=n.dashOffset,o.beginPath(),ar(i,e,a,s),o.closePath(),o.stroke(),o.restore())}function su(i,t,e){return Ct(i,{label:e,index:t,type:"pointLabel"})}var Qt=class extends Ae{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let t=this._padding=Z(Pn(this.options)/2),e=this.width=this.maxWidth-t.width,s=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+s/2+t.top),this.drawingArea=Math.floor(Math.min(e,s)/2)}determineDataLimits(){let{min:t,max:e}=this.getMinMax(!1);this.min=H(t)&&!isNaN(t)?t:0,this.max=H(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Pn(this.options))}generateTickLabels(t){Ae.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,s)=>{let n=R(this.options.pointLabels.callback,[e,s],this);return n||n===0?n:""}).filter((e,s)=>this.chart.getDataVisibility(s))}fit(){let t=this.options;t.display&&t.pointLabels.display?Yd(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,s,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((s-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,s,n))}getIndexAngle(t){let e=B/(this._pointLabels.length||1),s=this.options.startAngle||0;return G(t*e+ct(s))}getDistanceFromCenterForValue(t){if(E(t))return NaN;let e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(E(t))return NaN;let e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){let e=this._pointLabels||[];if(t>=0&&t<e.length){let s=e[t];return su(this.getContext(),t,s)}}getPointPosition(t,e,s=0){let n=this.getIndexAngle(t)-q+s;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter,angle:n}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){let{left:e,top:s,right:n,bottom:o}=this._pointLabelItems[t];return{left:e,top:s,right:n,bottom:o}}drawBackground(){let{backgroundColor:t,grid:{circular:e}}=this.options;if(t){let s=this.ctx;s.save(),s.beginPath(),ar(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),s.closePath(),s.fillStyle=t,s.fill(),s.restore()}}drawGrid(){let t=this.ctx,e=this.options,{angleLines:s,grid:n,border:o}=e,a=this._pointLabels.length,r,l,c;if(e.pointLabels.display&&eu(this,a),n.display&&this.ticks.forEach((h,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(h.value);let u=this.getContext(d),f=n.setContext(u),g=o.setContext(u);iu(this,f,l,a,g)}}),s.display){for(t.save(),r=a-1;r>=0;r--){let h=s.setContext(this.getPointLabelContext(r)),{color:d,lineWidth:u}=h;!u||!d||(t.lineWidth=u,t.strokeStyle=d,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),c=this.getPointPosition(r,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){let t=this.ctx,e=this.options,s=e.ticks;if(!s.display)return;let n=this.getIndexAngle(0),o,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((r,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;let c=s.setContext(this.getContext(l)),h=$(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=h.string,a=t.measureText(r.label).width,t.fillStyle=c.backdropColor;let d=Z(c.backdropPadding);t.fillRect(-a/2-d.left,-o-h.size/2-d.top,a+d.width,h.size+d.height)}Bt(t,r.label,0,-o,h,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}};v(Qt,"id","radialLinear"),v(Qt,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:He.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),v(Qt,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),v(Qt,"descriptors",{angleLines:{_fallback:"grid"}});var ls={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},nt=Object.keys(ls);function Ra(i,t){return i-t}function za(i,t){if(E(t))return null;let e=i._adapter,{parser:s,round:n,isoWeekday:o}=i._parseOpts,a=t;return typeof s=="function"&&(a=s(a)),H(a)||(a=typeof s=="string"?e.parse(a,s):e.parse(a)),a===null?null:(n&&(a=n==="week"&&(Ut(o)||o===!0)?e.startOf(a,"isoWeek",o):e.startOf(a,n)),+a)}function Ba(i,t,e,s){let n=nt.length;for(let o=nt.indexOf(i);o<n-1;++o){let a=ls[nt[o]],r=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(r*a.size))<=s)return nt[o]}return nt[n-1]}function nu(i,t,e,s,n){for(let o=nt.length-1;o>=nt.indexOf(e);o--){let a=nt[o];if(ls[a].common&&i._adapter.diff(n,s,a)>=t-1)return a}return nt[e?nt.indexOf(e):0]}function ou(i){for(let t=nt.indexOf(i)+1,e=nt.length;t<e;++t)if(ls[nt[t]].common)return nt[t]}function Va(i,t,e){if(!e)i[t]=!0;else if(e.length){let{lo:s,hi:n}=Bi(e,t),o=e[s]>=t?e[s]:e[n];i[o]=!0}}function au(i,t,e,s){let n=i._adapter,o=+n.startOf(t[0].value,s),a=t[t.length-1].value,r,l;for(r=o;r<=a;r=+n.add(r,1,s))l=e[r],l>=0&&(t[l].major=!0);return t}function Na(i,t,e){let s=[],n={},o=t.length,a,r;for(a=0;a<o;++a)r=t[a],n[r]=a,s.push({value:r,major:!1});return o===0||!e?s:au(i,s,n,e)}var ee=class extends ie{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){let s=t.time||(t.time={}),n=this._adapter=new yc._date(t.adapters.date);n.init(e),ue(s.displayFormats,n.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:za(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,e=this._adapter,s=t.time.unit||"day",{min:n,max:o,minDefined:a,maxDefined:r}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(n=Math.min(n,c.min)),!r&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!a||!r)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),n=H(n)&&!isNaN(n)?n:+e.startOf(Date.now(),s),o=H(o)&&!isNaN(o)?o:+e.endOf(Date.now(),s)+1,this.min=Math.min(n,o-1),this.max=Math.max(n+1,o)}_getLabelBounds(){let t=this.getLabelTimestamps(),e=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],s=t[t.length-1]),{min:e,max:s}}buildTicks(){let t=this.options,e=t.time,s=t.ticks,n=s.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);let o=this.min,a=this.max,r=wo(n,o,a);return this._unit=e.unit||(s.autoSkip?Ba(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):nu(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:ou(this._unit),this.initOffsets(n),t.reverse&&r.reverse(),Na(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,s=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?s=o:s=(o-this.getDecimalForValue(t[t.length-2]))/2);let a=t.length<3?.5:.25;e=U(e,0,a),s=U(s,0,a),this._offsets={start:e,end:s,factor:1/(e+1+s)}}_generate(){let t=this._adapter,e=this.min,s=this.max,n=this.options,o=n.time,a=o.unit||Ba(o.minUnit,e,s,this._getLabelCapacity(e)),r=C(n.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,c=Ut(l)||l===!0,h={},d=e,u,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":a),t.diff(s,e,a)>1e5*r)throw new Error(e+" and "+s+" are too far apart with stepSize of "+r+" "+a);let g=n.ticks.source==="data"&&this.getDataTimestamps();for(u=d,f=0;u<s;u=+t.add(u,r,a),f++)Va(h,u,g);return(u===s||n.bounds==="ticks"||f===1)&&Va(h,u,g),Object.keys(h).sort(Ra).map(p=>+p)}getLabelForValue(t){let e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}format(t,e){let n=this.options.time.displayFormats,o=this._unit,a=e||n[o];return this._adapter.format(t,a)}_tickFormatFunction(t,e,s,n){let o=this.options,a=o.ticks.callback;if(a)return R(a,[t,e,s],this);let r=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&r[l],d=c&&r[c],u=s[e],f=c&&d&&u&&u.major;return this._adapter.format(t,n||(f?d:h))}generateTickLabels(t){let e,s,n;for(e=0,s=t.length;e<s;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){let e=this._offsets,s=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+s)*e.factor)}getValueForPixel(t){let e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+s*(this.max-this.min)}_getLabelSize(t){let e=this.options.ticks,s=this.ctx.measureText(t).width,n=ct(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(n),a=Math.sin(n),r=this._resolveTickFontOptions(0).size;return{w:s*o+r*a,h:s*a+r*o}}_getLabelCapacity(t){let e=this.options.time,s=e.displayFormats,n=s[e.unit]||s.millisecond,o=this._tickFormatFunction(t,0,Na(this,[t],this._majorUnit),n),a=this._getLabelSize(o),r=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return r>0?r:1}getDataTimestamps(){let t=this._cache.data||[],e,s;if(t.length)return t;let n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,s=n.length;e<s;++e)t=t.concat(n[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){let t=this._cache.labels||[],e,s;if(t.length)return t;let n=this.getLabels();for(e=0,s=n.length;e<s;++e)t.push(za(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return zs(t.sort(Ra))}};v(ee,"id","time"),v(ee,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Zi(i,t,e){let s=0,n=i.length-1,o,a,r,l;e?(t>=i[s].pos&&t<=i[n].pos&&({lo:s,hi:n}=pt(i,"pos",t)),{pos:o,time:r}=i[s],{pos:a,time:l}=i[n]):(t>=i[s].time&&t<=i[n].time&&({lo:s,hi:n}=pt(i,"time",t)),{time:o,pos:r}=i[s],{time:a,pos:l}=i[n]);let c=a-o;return c?r+(l-r)*(t-o)/c:r}var ii=class extends ee{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Zi(e,this.min),this._tableRange=Zi(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){let{min:e,max:s}=this,n=[],o=[],a,r,l,c,h;for(a=0,r=t.length;a<r;++a)c=t[a],c>=e&&c<=s&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(a=0,r=n.length;a<r;++a)h=n[a+1],l=n[a-1],c=n[a],Math.round((h+l)/2)!==c&&o.push({time:c,pos:a/(r-1)});return o}_generate(){let t=this.min,e=this.max,s=super.getDataTimestamps();return(!s.includes(t)||!s.length)&&s.splice(0,0,t),(!s.includes(e)||s.length===1)&&s.push(e),s.sort((n,o)=>n-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;let e=this.getDataTimestamps(),s=this.getLabelTimestamps();return e.length&&s.length?t=this.normalize(e.concat(s)):t=e.length?e:s,t=this._cache.all=t,t}getDecimalForValue(t){return(Zi(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){let e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return Zi(this._table,s*this._tableRange+this._minPos,!0)}};v(ii,"id","timeseries"),v(ii,"defaults",ee.defaults);var ru=Object.freeze({__proto__:null,CategoryScale:Qe,LinearScale:ti,LogarithmicScale:ei,RadialLinearScale:Qt,TimeScale:ee,TimeSeriesScale:ii}),rr=[bc,qh,Bd,ru];ht.register(...rr);var En=ht;var li=new WeakMap,gr=new Map([["area",{chartType:"line",family:"cartesian",fillByDefault:!0,pointRadiusDefault:0}],["line",{chartType:"line",family:"cartesian",fillByDefault:!0}],["bar",{chartType:"bar",family:"cartesian"}],["pie",{chartType:"pie",family:"arc"}],["doughnut",{chartType:"doughnut",family:"arc"}],["polarArea",{chartType:"polarArea",family:"radial"}],["radar",{chartType:"radar",family:"radial"}],["scatter",{chartType:"scatter",family:"point"}],["bubble",{chartType:"bubble",family:"point"}]]),On=Array.from(gr.keys()),lu=new Set(["__proto__","constructor","prototype"]),ci=6,Tn=ci/2,ds=5,In=12,cu=1.5,hu=1.5,Vn=1,du=ds+Vn,pr="circle",Ln=ci*Math.SQRT2,uu=ci+In/2-Ln-2,Fn=Symbol("mooChartThemeState"),fu=["backgroundColor","borderColor","hoverBackgroundColor","hoverBorderColor","pointBackgroundColor","pointBorderColor","pointHoverBackgroundColor","pointHoverBorderColor"],gu=["--bs-body-color","--bs-body-bg","--bs-secondary-color","--bs-secondary-bg","--bs-tertiary-color","--bs-tertiary-bg","--bs-border-color","--bs-primary","--bs-success","--bs-info","--bs-warning","--bs-danger","--bs-emphasis-color","--bs-info-text-emphasis","--bs-success-text-emphasis","--bs-warning-text-emphasis","--bs-danger-text-emphasis","--moo-chart-1","--moo-chart-2","--moo-chart-3","--moo-chart-4","--moo-chart-5"],us=["primary","success","info","warning","danger"];function lr(i,t){let e=t?.getComputedStyle?.(i),s={};return e&&gu.forEach(n=>{s[n]=e.getPropertyValue(n).trim()}),s}function pu(i){return i?.closest?.("[data-bs-theme]")||i?.ownerDocument?.documentElement||null}function cr(i){return(i?.getAttribute?.("data-bs-theme")||i?.dataset?.bsTheme)==="dark"}function hr(i,t,e,s,n){let o=i?.createElement,a=t?.getComputedStyle,r=i?.documentElement;if(!o||!a||!r)return s;let l=o.call(i,"span");if(l.style.color=e,!l.style.color)return s;l.hidden=!0,(n?.appendChild?n:r).appendChild(l);try{return a.call(t,l).color||s}finally{l.remove()}}function dr(i,t=!1,e=s=>s){let s={primary:i["--moo-chart-1"]||i["--bs-info"]||i["--bs-info-text-emphasis"],success:i["--moo-chart-2"]||i["--bs-success"],info:i["--moo-chart-3"]||i["--bs-info"],warning:i["--moo-chart-4"]||i["--bs-warning"],danger:i["--moo-chart-5"]||i["--bs-danger"]},n={primary:i["--moo-chart-1"]||i["--bs-info-text-emphasis"]||i["--bs-info"],success:i["--moo-chart-2"]||i["--bs-success-text-emphasis"]||i["--bs-success"],info:i["--moo-chart-3"]||i["--bs-info-text-emphasis"]||i["--bs-info"],warning:i["--moo-chart-4"]||i["--bs-warning-text-emphasis"]||i["--bs-warning"],danger:i["--moo-chart-5"]||i["--bs-danger-text-emphasis"]||i["--bs-danger"]},o=t?n:s;return{color:i["--bs-body-color"],backgroundColor:i["--bs-body-bg"],borderColor:i["--bs-border-color"],gridColor:i["--bs-secondary-color"],tickColor:i["--bs-secondary-color"],textColor:i["--bs-body-color"],secondaryText:i["--bs-secondary-color"],resolveColor:e,...o}}function cs(i,t,e=22){return i.resolveColor(`color-mix(in srgb, ${t} ${e}%, transparent)`,t)}function ur(i,t){return i.resolveColor(`color-mix(in srgb, ${t} 92%, ${i.color})`,t)}function _u(i,t){return Array.from({length:Math.max(t,1)},(e,s)=>{let n=us[s%us.length];return i[n]})}function _r(i){return new Set(fu.filter(t=>Object.prototype.hasOwnProperty.call(i,t)))}function mr(i,t=null){return i[Fn]||Object.defineProperty(i,Fn,{value:{explicitColorFields:t||_r(i)}}),i[Fn]}function W(i,t,e,s){s.explicitColorFields.has(t)||(i[t]=e)}function mu(){return{pointStyle:pr,rotation:0}}function bu(i){let e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:Vn,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}}function yu(i){return En.defaults.plugins.legend.labels.generateLabels(i).map(t=>({...t,lineWidth:Vn}))}function br(i,t,e,s,n=null){let o=us[t%us.length],a=s[o],r=ur(s,a),l=a,c=i.type||e.chartType,h=mr(i,n);if(c==="line")W(i,"borderColor",r,h),W(i,"backgroundColor",cs(s,a),h),W(i,"pointBackgroundColor",l,h),W(i,"pointBorderColor",l,h),i.pointBorderWidth=0,i.borderWidth===void 0&&(i.borderWidth=cu),i.clip===void 0&&(i.clip=du),i.pointRadius===void 0&&(i.pointRadius=e.pointRadiusDefault??Tn),i.pointHoverRadius=ds,W(i,"pointHoverBackgroundColor",l,h),W(i,"pointHoverBorderColor",l,h),i.pointHoverBorderWidth=0,i.tension===void 0&&(i.tension=.3),e.fillByDefault&&i.fill===void 0&&(i.fill=!0);else if(c==="bar")W(i,"backgroundColor",s.resolveColor(`color-mix(in srgb, ${a} 78%, transparent)`,a),h),W(i,"borderColor",r,h),i.borderWidth===void 0&&(i.borderWidth=1),W(i,"hoverBackgroundColor",a,h),W(i,"hoverBorderColor",a,h),i.borderRadius=4;else if(c==="pie"||c==="doughnut"||c==="polarArea"){let d=_u(s,i.data?.length||0);W(i,"backgroundColor",d.map(u=>cs(s,u,78)),h),W(i,"borderColor",d.map(u=>ur(s,u)),h),W(i,"hoverBackgroundColor",d,h),W(i,"hoverBorderColor",d,h),i.borderWidth===void 0&&(i.borderWidth=1)}else c==="radar"?(W(i,"borderColor",r,h),W(i,"backgroundColor",cs(s,a,18),h),W(i,"pointBackgroundColor",l,h),W(i,"pointBorderColor",l,h),W(i,"pointHoverBackgroundColor",l,h),W(i,"pointHoverBorderColor",l,h),i.borderWidth===void 0&&(i.borderWidth=hu),i.pointRadius===void 0&&(i.pointRadius=Tn),i.pointHoverRadius===void 0&&(i.pointHoverRadius=ds),i.pointHoverBorderWidth===void 0&&(i.pointHoverBorderWidth=0),i.fill===void 0&&(i.fill=!0)):(c==="scatter"||c==="bubble")&&(W(i,"backgroundColor",cs(s,a,72),h),W(i,"borderColor",r,h),W(i,"hoverBackgroundColor",a,h),W(i,"hoverBorderColor",a,h),i.borderWidth===void 0&&(i.borderWidth=1),c==="scatter"?(i.pointRadius===void 0&&(i.pointRadius=Tn),i.pointHoverRadius===void 0&&(i.pointHoverRadius=ds),i.pointHoverBorderWidth===void 0&&(i.pointHoverBorderWidth=0)):i.pointHoverRadius===void 0&&(i.pointHoverRadius=7));return i}function xu(i,t,e,s=[]){i&&(i.data.datasets.forEach((n,o)=>{br(n,o,e,t,s[o])}),i.options.scales&&Object.values(i.options.scales).forEach(n=>{n.grid&&(n.grid.color=t.resolveColor(`color-mix(in srgb, ${t.gridColor} 35%, transparent)`,t.gridColor)),n.ticks&&(n.ticks.color=t.secondaryText),n.title&&(n.title.color=t.textColor),n.angleLines&&(n.angleLines.color=t.resolveColor(`color-mix(in srgb, ${t.gridColor} 35%, transparent)`,t.gridColor)),n.pointLabels&&(n.pointLabels.color=t.secondaryText)}),i.options.plugins?.legend?.labels&&(i.options.plugins.legend.labels.color=t.textColor),i.options.plugins?.tooltip&&(i.options.plugins.tooltip.backgroundColor=t.backgroundColor,i.options.plugins.tooltip.titleColor=t.textColor,i.options.plugins.tooltip.bodyColor=t.secondaryText,i.options.plugins.tooltip.borderColor=t.borderColor),i.update("none"))}function Rn(i){return{color:i.resolveColor(`color-mix(in srgb, ${i.gridColor} 35%, transparent)`,i.gridColor)}}function zn(i,t={}){return{color:i.secondaryText,padding:8,...t}}function wu(i,t){let e=t.family==="point"?"linear":void 0;return{x:{...e?{type:e}:{},grid:Rn(i),ticks:zn(i),border:{display:!1}},y:{...e?{type:e}:{},grid:Rn(i),ticks:zn(i),border:{display:!1}}}}function vu(i){return{r:{angleLines:{color:i.resolveColor(`color-mix(in srgb, ${i.gridColor} 35%, transparent)`,i.gridColor)},grid:Rn(i),pointLabels:{color:i.secondaryText},ticks:zn(i,{backdropColor:"transparent"})}}}function Su(i){return i.family==="point"||i.family==="arc"||i.family==="radial"?{mode:"nearest",intersect:!0}:{mode:"index",intersect:!1}}function ku(i){return!!i?.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches}function hs(i){return typeof i=="number"&&Number.isFinite(i)?i.toLocaleString():""}function Mu(i){let t=i.dataset.label||i.label||"",e=i.parsed,s=i.raw;if(e!==null&&typeof e=="object"){let o=[];return typeof e.x=="number"&&Number.isFinite(e.x)&&o.push(`X: ${hs(e.x)}`),typeof e.y=="number"&&Number.isFinite(e.y)&&o.push(`Y: ${hs(e.y)}`),s&&typeof s=="object"&&typeof s.r=="number"&&o.push(`Radius: ${hs(s.r)}`),o.length?t?`${t}: ${o.join(", ")}`:o.join(", "):t}let n=hs(e);return n?t?`${t}: ${n}`:n:t}function Du(i,t,e){let s={responsive:!0,maintainAspectRatio:!1,interaction:Su(t),plugins:{legend:{labels:{color:i.textColor,usePointStyle:!0,pointStyle:pr,boxWidth:ci,boxHeight:ci,generateLabels:yu,font:{size:In},padding:20}},tooltip:{backgroundColor:i.backgroundColor,titleColor:i.textColor,bodyColor:i.secondaryText,borderColor:i.borderColor,borderWidth:1,padding:12,cornerRadius:8,titleFont:{size:13,weight:"600"},bodyFont:{size:In},bodySpacing:6,usePointStyle:!0,boxWidth:Ln,boxHeight:Ln,boxPadding:uu,callbacks:{label:Mu,labelColor:bu,labelPointStyle:mu}}},animation:{duration:600,easing:"easeOutQuart"},hover:{animationDuration:200}};return t.family==="cartesian"||t.family==="point"?s.scales=wu(i,t):t.family==="radial"&&(s.scales=vu(i)),ku(e)&&(s.animation=!1,s.hover.animationDuration=0),s}function Cu(i,t){let e=i.getAttribute("data-chart-data"),s=null,n=!1;if(e!==null&&e.trim()!==""){n=!0;try{s=JSON.parse(e)}catch(r){throw new SyntaxError(`MooChart could not parse data-chart-data as JSON: ${r.message}`)}}let o=Object.prototype.hasOwnProperty.call(t,"data");if(!o&&!n)throw new TypeError("MooChart data-chart-data is required unless config.data is provided.");let a=o?t.data:s;if(a==null||typeof a!="object"||Array.isArray(a)||!Array.isArray(a.labels)||!Array.isArray(a.datasets)){let r=o?"config.data":"data-chart-data";throw new TypeError(`MooChart ${r} must contain labels and datasets arrays.`)}return a}function Au(i){let t=i.getAttribute("data-chart-options");if(t===null||t.trim()==="")return{};try{let e=JSON.parse(t);if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError("MooChart data-chart-options must be a JSON object.");return e}catch(e){throw e instanceof SyntaxError?new SyntaxError(`MooChart could not parse data-chart-options as JSON: ${e.message}`):e}}function fr(i){return i!==null&&typeof i=="object"&&!Array.isArray(i)}function Pu(i){return Object.entries(i||{}).filter(([t])=>!lu.has(t))}function Bn(i={},t={}){let e={...i};return Pu(t).forEach(([s,n])=>{e[s]=fr(n)&&fr(i[s])?Bn(i[s],n):n}),e}function Eu(){return On.slice(0,-1).join(", ")+", and "+On[On.length-1]}function Ou(i,t){let e=t.type||i.getAttribute("data-chart")||"line",s=gr.get(e);if(!s)throw new TypeError(`MooChart supports ${Eu()} charts; received "${e}".`);return{publicType:e,...s}}var hi=class i{static getInstance(t){return t?.nodeType===1&&li.get(t)||null}static getOrCreateInstance(t,e={}){return i.getInstance(t)||new i(t,e)}constructor(t,e={}){if(t?.nodeType!==1||!t.matches(".chart"))throw new TypeError("MooChart requires a .chart root element.");let s=li.get(t);if(s)return s;let n=t.querySelector(":scope > canvas");if(!n)throw new TypeError("MooChart requires a child <canvas> element inside the .chart root.");this._element=t,this._canvas=n,this._document=t.ownerDocument,this._window=this._document?.defaultView,this._config=e||{},this._themeElement=pu(t);let o=Ou(t,this._config),a=Cu(t,this._config),r=Au(t);this._type=o.publicType,this._metadata=o,this._datasetExplicitColorFields=(a.datasets||[]).map(f=>_r(f));let l=cr(this._themeElement),c=lr(this._themeElement,this._window),h=(f,g)=>hr(this._document,this._window,f,g,this._themeElement);this._theme=dr(c,l,h);let d=(a.datasets||[]).map((f,g)=>br({...f},g,o,this._theme,this._datasetExplicitColorFields[g])),u=Bn(Bn(Du(this._theme,o,this._window),r),this._config.options);this._chart=new En(n,{...this._config,type:o.chartType,data:{labels:a.labels||[],datasets:d},options:u}),this._chart.data.datasets.forEach((f,g)=>{mr(f,this._datasetExplicitColorFields[g])}),this._rethemeFrame=null,this._observer=null,this._themeElement&&this._window?.MutationObserver&&(this._observer=new this._window.MutationObserver(f=>{f.forEach(g=>{(g.attributeName==="data-bs-theme"||g.attributeName==="style")&&this._scheduleRetheme()})}),this._observer.observe(this._themeElement,{attributes:!0,attributeFilter:["data-bs-theme","style"]})),li.set(t,this)}get chart(){return this._chart}get element(){return this._element}_scheduleRetheme(){if(this._rethemeFrame!==null)return;let t=this._window?.requestAnimationFrame;if(!t){this._applyTheme();return}this._rethemeFrame=t.call(this._window,()=>{this._rethemeFrame=null,this._applyTheme()})}_applyTheme(){if(!this._chart)return;let t=cr(this._themeElement),e=lr(this._themeElement,this._window),s=(n,o)=>hr(this._document,this._window,n,o,this._themeElement);this._theme=dr(e,t,s),xu(this._chart,this._theme,this._metadata,this._datasetExplicitColorFields)}dispose(){this._rethemeFrame!==null&&this._window?.cancelAnimationFrame&&this._window.cancelAnimationFrame(this._rethemeFrame),this._rethemeFrame=null,this._observer?.disconnect(),this._observer=null,this._chart?.destroy(),this._chart=null,li.get(this._element)===this&&li.delete(this._element)}};var fs=new WeakMap,gs=i=>i.trim().toLowerCase(),di=class i{static getInstance(t){return t?.nodeType===1&&fs.get(t)||null}static getOrCreateInstance(t,e={}){return i.getInstance(t)||new i(t,e)}constructor(t,e={}){if(t?.nodeType!==1||!t.matches(".combobox"))throw new TypeError("Combobox requires a .combobox root element.");let s=fs.get(t);if(s)return s;if(this._element=t,this._document=t.ownerDocument,this._window=this._document.defaultView,this._config={noResultsText:"No results found.",...e},this._input=t.querySelector(".combobox-input"),this._menu=t.querySelector(".combobox-menu"),this._options=Array.from(t.querySelectorAll(".combobox-option")),!this._input||!this._menu||this._options.length===0)throw new TypeError("Combobox requires an input, menu, and at least one option.");this._isMultiple=t.dataset.comboboxMultiple==="true",this._hidden=this._isMultiple?null:t.querySelector('input[type="hidden"]'),this._chipValue=t.querySelector(".combobox-value"),this._valueStore=t.querySelector("[data-combobox-value-store]"),this._chipIconTemplate=t.querySelector("[data-combobox-chip-icon]"),this._clearTrigger=t.querySelector("[data-combobox-clear]"),this._indicator=t.querySelector(".combobox-indicator"),this._groups=Array.from(t.querySelectorAll("[data-combobox-group]")),this._separators=Array.from(t.querySelectorAll("[data-combobox-separator]")),this._listeners=[],this._generated=[],this._startsOpen=this._menu.classList.contains("show"),this._empty=this._menu.querySelector("[data-combobox-empty]"),this._empty||(this._empty=this._document.createElement("li"),this._empty.className="combobox-empty",this._empty.hidden=!0,this._empty.dataset.comboboxEmpty="true",this._empty.textContent=this._config.noResultsText,this._menu.appendChild(this._empty),this._generated.push(this._empty)),this._liveRegion=t.querySelector("[data-combobox-live]"),this._liveRegion||(this._liveRegion=this._document.createElement("span"),this._liveRegion.className="visually-hidden",this._liveRegion.setAttribute("aria-live","polite"),this._liveRegion.dataset.comboboxLive="true",t.appendChild(this._liveRegion),this._generated.push(this._liveRegion)),fs.set(t,this),this._bindEvents(),this._toggleClear(this._input.dataset.comboboxSelected==="true"||t.dataset.comboboxSelected==="true"),this._syncMultipleValue(),this._filterOptions({open:this._startsOpen,activate:this._startsOpen}),this._startsOpen||this._closeMenu(!1)}dispose(){this._listeners.forEach(({target:t,type:e,handler:s,options:n})=>{t.removeEventListener(e,s,n)}),this._listeners=[],this._closeMenu(!1),this._generated.forEach(t=>t.remove()),this._generated=[],this._chipValue?.querySelectorAll("[data-combobox-generated]").forEach(t=>t.remove()),this._valueStore?.querySelectorAll("[data-combobox-generated]").forEach(t=>t.remove()),fs.delete(this._element)}_listen(t,e,s,n){t?.addEventListener(e,s,n),t&&this._listeners.push({target:t,type:e,handler:s,options:n})}_trigger(t,e={}){return this._element.dispatchEvent(new this._window.CustomEvent(`${t}.moo.combobox`,{bubbles:!0,cancelable:t==="show"||t==="hide",detail:e}))}_optionGroupIsHidden(t){return t.closest("[data-combobox-group]")?.hidden||!1}_visibleOptions(){return this._options.filter(t=>!t.hidden&&!t.disabled&&!this._optionGroupIsHidden(t))}_syncGroupVisibility(){if(this._groups.length===0)return;let t=0;this._groups.forEach(e=>{let s=Array.from(e.querySelectorAll(".combobox-option")).some(n=>!n.hidden);e.hidden=!s,t+=s?1:0}),this._separators.forEach(e=>{e.hidden=t<2})}_openMenu(t=!0){if(this._menu.classList.contains("show")){this._input.setAttribute("aria-expanded","true");return}t&&!this._trigger("show")||(this._menu.classList.add("show"),this._input.setAttribute("aria-expanded","true"),t&&this._trigger("shown"))}_closeMenu(t=!0){let e=this._menu.classList.contains("show");e&&t&&!this._trigger("hide")||(this._menu.classList.remove("show"),this._input.setAttribute("aria-expanded","false"),this._input.removeAttribute("aria-activedescendant"),this._options.forEach(s=>{s.removeAttribute("aria-current"),s.classList.remove("active")}),e&&t&&this._trigger("hidden"))}_optionLabel(t){return t?.querySelector(".combobox-option__label")?.textContent?.trim()||""}_selectedOptions(){return this._options.filter(t=>t.getAttribute("aria-selected")==="true")}_toggleClear(t){let e=t?"true":"false";this._element.dataset.comboboxSelected=e,this._input.dataset.comboboxSelected=e,this._clearTrigger&&(this._clearTrigger.hidden=!t,this._indicator&&(this._indicator.hidden=t))}_createChip(t){let e=t.dataset.value||"",s=this._optionLabel(t),n=this._document.createElement("span");n.className="badge text-bg-secondary combobox-chip",n.dataset.value=e,n.dataset.comboboxGenerated="true";let o=this._document.createElement("span");o.className="combobox-chip__label",o.textContent=s,n.appendChild(o);let a=this._document.createElement("button");return a.className="combobox-chip__remove",a.type="button",a.dataset.value=e,a.dataset.comboboxChipRemove="true",a.setAttribute("aria-label",`Remove ${s}`),a.append(this._chipIconTemplate?.content.cloneNode(!0)||"x"),n.appendChild(a),n}_syncMultipleValue(){if(!this._isMultiple)return;let t=this._selectedOptions();if(this._chipValue&&this._chipValue.replaceChildren(...t.map(e=>this._createChip(e))),this._valueStore){this._valueStore.replaceChildren();let e=this._valueStore.dataset.comboboxName||"";t.forEach(s=>{let n=this._document.createElement("input");n.type="hidden",n.name=e,n.value=s.dataset.value||"",n.dataset.comboboxGenerated="true",this._valueStore.appendChild(n)})}this._toggleClear(t.length>0)}_emitChange(){let t=this._selectedOptions();this._trigger("change",{values:t.map(e=>e.dataset.value||"")})}_removeChip(t){let e=this._options.find(s=>s.dataset.value===t);e&&(e.setAttribute("aria-selected","false"),this._syncMultipleValue(),this._emitChange())}_clearSelection(t=!0){this._hidden&&(this._hidden.value=""),this._options.forEach(e=>e.setAttribute("aria-selected","false")),this._isMultiple?this._syncMultipleValue():this._toggleClear(!1),t&&this._emitChange()}_clearStaleSelection(){if(this._isMultiple){this._input.value="",this._options.forEach(s=>{s.hidden=!1}),this._syncGroupVisibility(),this._empty.hidden=!0;return}let t=this._selectedOptions()[0]||null,e=this._optionLabel(t);!this._input.value||e&&gs(this._input.value)===gs(e)||(this._clearSelection(),this._input.value="")}_activeOption(){let t=this._input.getAttribute("aria-activedescendant");return t&&this._visibleOptions().find(e=>e.id===t)||null}_selectedOption(){return this._isMultiple?null:this._visibleOptions().find(t=>t.getAttribute("aria-selected")==="true")||null}_preferredActiveOption(){return this._selectedOption()||this._visibleOptions()[0]||null}_activatePreferredOptionIfNeeded(){this._activeOption()||this._setActiveOption(this._preferredActiveOption())}_setActiveOption(t,{scroll:e=!0}={}){if(this._options.forEach(s=>{let n=s===t;n?s.setAttribute("aria-current","true"):s.removeAttribute("aria-current"),s.classList.toggle("active",n)}),!t){this._input.removeAttribute("aria-activedescendant");return}if(this._input.setAttribute("aria-activedescendant",t.id),e){let s=t.getBoundingClientRect(),n=this._menu.getBoundingClientRect();s.top<n.top?this._menu.scrollTop-=n.top-s.top:s.bottom>n.bottom&&(this._menu.scrollTop+=s.bottom-n.bottom)}}_activateOptionFromPointer(t,e){e.pointerType==="touch"||t.disabled||t.getAttribute("aria-disabled")==="true"||t===this._activeOption()||this._setActiveOption(t,{scroll:!1})}_restoreSelectedActiveOption(){if(!this._menu.classList.contains("show"))return;let t=this._selectedOption();t&&this._setActiveOption(t,{scroll:!1})}_chooseOption(t){if(!(!t||t.disabled)){if(this._isMultiple){t.setAttribute("aria-selected",t.getAttribute("aria-selected")==="true"?"false":"true"),this._input.value="",this._syncMultipleValue(),this._filterOptions(),this._setActiveOption(t),this._emitChange();return}this._options.forEach(e=>{e.setAttribute("aria-selected",e===t?"true":"false")}),this._input.value=this._optionLabel(t),this._hidden&&(this._hidden.value=t.dataset.value||""),this._toggleClear(!0),this._setActiveOption(t),this._emitChange()}}_filterOptions({open:t=!0,activate:e=!0,resetActive:s=!1}={}){t&&this._openMenu();let n=gs(this._input.value),o=0;this._options.forEach(a=>{let r=!n||gs(a.textContent).includes(n);a.hidden=!r,o+=r?1:0}),this._syncGroupVisibility(),this._empty.hidden=o!==0,this._liveRegion.textContent=o===0?"No results":`${o} result${o===1?"":"s"}`,s&&this._setActiveOption(null,{scroll:!1}),e&&this._activatePreferredOptionIfNeeded()}_bindEvents(){this._listen(this._input,"focus",()=>{this._openMenu(),!this._isMultiple&&this._input.dataset.comboboxSelected==="true"&&this._input.select(),this._activatePreferredOptionIfNeeded()}),this._listen(this._input,"input",()=>{this._isMultiple||this._clearSelection(),this._filterOptions({resetActive:!0})}),this._listen(this._input,"blur",t=>{let e=t.relatedTarget;e instanceof this._window.Node&&this._element.contains(e)||this._clearStaleSelection()}),this._listen(this._input,"click",()=>{this._openMenu(),this._setActiveOption(this._preferredActiveOption())}),this._listen(this._input,"keydown",t=>this._handleKeydown(t)),this._options.forEach(t=>{this._listen(t,"keydown",e=>this._handleKeydown(e)),this._listen(t,"pointerenter",e=>{this._activateOptionFromPointer(t,e)}),this._listen(t,"click",()=>{this._chooseOption(t),this._isMultiple?this._input.focus():this._closeMenu()})}),this._listen(this._clearTrigger,"click",t=>{t.preventDefault(),this._clearSelection(),this._input.value="",this._input.focus(),this._filterOptions({resetActive:!0})}),this._listen(this._menu,"pointerleave",()=>this._restoreSelectedActiveOption()),this._listen(this._element,"click",t=>this._handleRootClick(t)),this._listen(this._document,"click",t=>{t.target instanceof this._window.Node&&!this._element.contains(t.target)&&this._closeMenu()})}_handleRootClick(t){let e=t.target,s=e instanceof this._window.Element?e.closest("[data-combobox-chip-remove]"):null;s?(t.preventDefault(),this._removeChip(s.dataset.value||""),this._input.focus()):this._isMultiple&&e instanceof this._window.Element&&e.closest(".combobox-chips")&&this._input.focus()}_handleKeydown(t){let e=this._visibleOptions(),s=e.findIndex(a=>a.id===this._input.getAttribute("aria-activedescendant")),n=t.key==="ArrowDown"||t.key==="Down",o=t.key==="ArrowUp"||t.key==="Up";if(this._isMultiple&&t.key==="Backspace"&&this._input.value===""){let a=this._selectedOptions(),r=a[a.length-1];r&&(t.preventDefault(),this._removeChip(r.dataset.value||""))}else if((n||o)&&e.length){t.preventDefault(),this._openMenu();let r=s===-1?0:(s+(n?1:-1)+e.length)%e.length;this._setActiveOption(e[r]),t.target!==this._input&&this._input.focus({preventScroll:!0})}else if(t.key==="Enter"){let a=e[s];a&&(t.preventDefault(),this._chooseOption(a),this._isMultiple||this._closeMenu())}else t.key==="Escape"?(this._closeMenu(),this._input.focus()):t.key==="Tab"&&this._closeMenu()}};var ps=new WeakMap;function Tu(i){let{clientX:t,clientY:e}=i;return{top:e,left:t,right:t,bottom:e,width:0,height:0,x:t,y:e}}function Nn(i){return!!(i?.disabled||i?.getAttribute?.("aria-disabled")==="true")}function Fu(i){let t=i.target,e=t.closest?.(".dropdown-item");return e||t.closest?.("li")?.querySelector(":scope > .dropdown-item")||null}var ui=class i{static getInstance(t){return t?.nodeType===1&&ps.get(t)||null}static getOrCreateInstance(t,e={}){return i.getInstance(t)||new i(t,e)}constructor(t,e={}){if(t?.nodeType!==1||!t.matches(".context-menu"))throw new TypeError("ContextMenu requires a .context-menu root element.");let s=ps.get(t);if(s)return s;if(this._element=t,this._document=t.ownerDocument,this._window=this._document.defaultView,this._menu=t.querySelector(":scope > .context-menu-menu"),this._fallback=t.querySelector(":scope > [data-context-menu-fallback]"),!this._menu)throw new TypeError("ContextMenu requires a .context-menu-menu element.");if(!this._fallback)throw new TypeError("ContextMenu requires an explicit fallback trigger.");let n=this._bootstrap("Dropdown");if(!n)throw new TypeError("ContextMenu requires bootstrap.Dropdown (bootstrap.bundle.js).");this._config={...e},this._listeners=[],this._invoker=null,this._pointerRect=null,this._openMethod=null,this._reference={getBoundingClientRect:()=>this._currentRect(),contextElement:this._fallback},this._dropdown=new n(this._fallback,{reference:this._reference,autoClose:"outside"}),ps.set(t,this),this._bindEvents()}dispose(){this._listeners.forEach(({target:t,type:e,handler:s,options:n})=>{t.removeEventListener(e,s,n)}),this._listeners=[],this._dropdown.dispose(),this._syncExpanded(!1),this._invoker=null,this._pointerRect=null,ps.delete(this._element)}show(t=this._fallback){this._open(t,null)}hide(){this._dropdown.hide()}_listen(t,e,s,n){t.addEventListener(e,s,n),this._listeners.push({target:t,type:e,handler:s,options:n})}_bootstrap(t){return this._window.bootstrap?.[t]||null}_currentRect(){return this._pointerRect?this._pointerRect:(this._invoker||this._fallback).getBoundingClientRect()}_trigger(t,e=!1){return this._element.dispatchEvent(new this._window.CustomEvent(`${t}.moo.context-menu`,{bubbles:!0,cancelable:e}))}_triggers(){return Array.from(this._element.querySelectorAll(":scope > .context-menu-trigger"))}_syncExpanded(t){this._triggers().forEach(e=>{e.setAttribute("aria-expanded",String(t))})}_menuItems(){return Array.from(this._menu.querySelectorAll(".dropdown-item")).filter(t=>!Nn(t)&&!t.classList.contains("disabled"))}_open(t,e,s){Nn(t)||(this._menu.classList.contains("show")&&this._dropdown.hide(),this._invoker=t,this._pointerRect=e?Tu(e):null,this._openMethod=s,this._dropdown.show())}_handleContextMenu(t){let e=t.target.closest(".context-menu-trigger");!e||!this._element.contains(e)||(t.preventDefault(),this._open(e,t,"pointer"))}_handleKeydown(t){let e=t.target.closest(".context-menu-trigger");if(!e||!this._element.contains(e))return;let s=t.shiftKey&&t.key==="F10",n=t.key==="ContextMenu";!s&&!n||(t.preventDefault(),this._open(e,null,"keyboard"))}_handleFallbackClick(){this._invoker=this._fallback,this._pointerRect=null,this._openMethod="pointer"}_handleFallbackKeydown(t){if(!(t.key!==" "&&t.key!=="Spacebar")){if(t.preventDefault(),t.stopPropagation(),this._menu.classList.contains("show")){this._dropdown.hide();return}this._open(this._fallback,null,"fallback-keyboard")}}_handleMenuClick(t){let e=Fu(t);if(!e)return;let s=e.matches(".dropdown-item-check, [data-context-menu-persistent]");if(e.matches('.dropdown-item.disabled, .dropdown-item[aria-disabled="true"], .dropdown-item:disabled')||Nn(e)){t.preventDefault(),t.stopPropagation();return}let o=e.matches("[data-context-menu-radio-group]")?e:null;if(o){t.preventDefault(),t.stopPropagation();let a=o.dataset.contextMenuRadioGroup;this._menu.querySelectorAll(`[data-context-menu-radio-group="${a}"]`).forEach(r=>{let l=r===o;r.classList.toggle("active",l),r.setAttribute("aria-pressed",String(l))});return}s||this._dropdown.hide()}_bindEvents(){this._listen(this._element,"contextmenu",t=>this._handleContextMenu(t)),this._listen(this._element,"keydown",t=>this._handleKeydown(t)),this._listen(this._fallback,"click",()=>this._handleFallbackClick()),this._listen(this._fallback,"keydown",t=>this._handleFallbackKeydown(t)),this._listen(this._menu,"click",t=>this._handleMenuClick(t)),this._listen(this._fallback,"show.bs.dropdown",t=>{this._trigger("show",!0)||t.preventDefault()}),this._listen(this._fallback,"shown.bs.dropdown",()=>{this._syncExpanded(!0),this._openMethod==="fallback-keyboard"?this._fallback.focus():this._openMethod==="keyboard"?this._menuItems()[0]?.focus():this._menu.focus(),this._trigger("shown")}),this._listen(this._fallback,"hide.bs.dropdown",t=>{this._trigger("hide",!0)||t.preventDefault()}),this._listen(this._fallback,"hidden.bs.dropdown",()=>{this._syncExpanded(!1);let t=this._invoker;this._pointerRect=null,this._invoker=null,this._openMethod=null,this._trigger("hidden"),queueMicrotask(()=>{t&&t!==this._fallback&&this._document.activeElement===this._fallback&&t.focus()})})}};var _s=new WeakMap;function se(i){return(i??"").toString().trim().toLowerCase()}var fi=class i{static getInstance(t){return t?.nodeType===1&&_s.get(t)||null}static getOrCreateInstance(t,e={}){return i.getInstance(t)||new i(t,e)}constructor(t,e={}){if(t?.nodeType!==1||!t.matches(".datatable"))throw new TypeError("DataTable requires a .datatable root element.");let s=_s.get(t);if(s)return s;if(this._element=t,this._document=t.ownerDocument,this._window=this._document.defaultView,this._table=t.querySelector(":scope .datatable-table"),this._tbody=this._table?.querySelector(":scope > tbody"),!this._table||!this._tbody)throw new TypeError("DataTable requires a .datatable-table with a tbody.");this._cards=t.querySelector("[data-datatable-cards]");let n=new Map(Array.from(t.querySelectorAll("[data-datatable-card]")).map(o=>[o.dataset.datatableCardFor,o]));this._config={...e},this._listeners=[],this._pageSize=Number(t.dataset.datatablePageSize)||10,this._currentPage=1,this._sortKey=null,this._sortDirection=null,this._selectedIds=new Set,this._facetSelections=new Map,this._visibleFacets=new Map,this._searchTerm="",this._tooltips=[],this._filterMode=t.dataset.datatableFilterMode||"inline",this._reparentedRowMenus=new Map,this._reparentedRowMenuByTrigger=new WeakMap,this._rows=Array.from(this._tbody.querySelectorAll(":scope > tr[data-datatable-row]")).map((o,a)=>({element:o,cardElement:n.get(o.id)||null,index:a,search:se(o.dataset.datatableSearch),facets:this._readFacets(o)})),this._readInitialFacetVisibility(),this._readInitialSort(),_s.set(t,this),this._bindEvents(),this._render(),this._initBulkTooltips(),this._initViewToggle(),this._initRowActionDropdowns()}dispose(){this._disposeRowActionDropdowns(),this._restoreRowActionMenus(),this._listeners.forEach(({target:t,type:e,handler:s,options:n})=>{t.removeEventListener(e,s,n)}),this._listeners=[],this._tooltips.forEach(t=>t.dispose()),this._tooltips=[],_s.delete(this._element)}getSelectedIds(){return Array.from(this._selectedIds)}_listen(t,e,s,n){t&&(t.addEventListener(e,s,n),this._listeners.push({target:t,type:e,handler:s,options:n}))}_rowActionTriggers(){return this._element.querySelectorAll('.table-responsive .table-row-actions [data-bs-toggle="dropdown"], [data-datatable-card] .table-row-actions [data-bs-toggle="dropdown"]')}_initRowActionDropdowns(){let t=this._bootstrap("Dropdown");t&&this._rowActionTriggers().forEach(e=>{t.getOrCreateInstance(e,{popperConfig:s=>({...s,strategy:"fixed",modifiers:[...s.modifiers||[],{name:"flip",options:{fallbackPlacements:["top-end","top-start","bottom-end","bottom-start"]}},{name:"preventOverflow",options:{boundary:"viewport",padding:8}}]})})})}_disposeRowActionDropdowns(){let t=this._bootstrap("Dropdown");t&&this._rowActionTriggers().forEach(e=>{let s=t.getInstance(e);s&&(s.hide(),s.dispose())})}_rowActionMenuForTrigger(t){return t?.closest?.(".table-row-actions")&&t.closest(".dropdown")?.querySelector(":scope > .dropdown-menu")||null}_rowActionOwnerIdForTrigger(t){let e=t?.closest?.("tr[data-datatable-row]")?.id;return e||t?.closest?.("[data-datatable-card]")?.getAttribute("data-datatable-card-for")||""}_reparentRowActionMenu(t){let e=this._rowActionMenuForTrigger(t);if(!e||this._reparentedRowMenus.has(e))return;let s=this._rowActionOwnerIdForTrigger(t);s&&e.setAttribute("data-datatable-row-action-owner",s),t.id&&e.setAttribute("data-datatable-row-action-trigger",t.id),this._reparentedRowMenus.set(e,{parent:e.parentNode,nextSibling:e.nextSibling,trigger:t}),this._reparentedRowMenuByTrigger.set(t,e),this._document.body.appendChild(e)}_restoreRowActionMenuForTrigger(t){let e=this._reparentedRowMenuByTrigger.get(t)||this._rowActionMenuForTrigger(t);e&&this._restoreRowActionMenu(e)}_restoreRowActionMenu(t){let e=this._reparentedRowMenus.get(t);if(!e)return;let{parent:s,nextSibling:n,trigger:o}=e;s?.isConnected?n?.parentNode===s?s.insertBefore(t,n):s.appendChild(t):t.remove(),o&&this._reparentedRowMenuByTrigger.delete(o),t.removeAttribute("data-datatable-row-action-owner"),t.removeAttribute("data-datatable-row-action-trigger"),this._reparentedRowMenus.delete(t)}_restoreRowActionMenus(){Array.from(this._reparentedRowMenus.keys()).forEach(t=>{this._restoreRowActionMenu(t)})}_bootstrap(t){return this._window.bootstrap?.[t]||null}_initBulkTooltips(){let t=this._bootstrap("Tooltip");t&&this._element.querySelectorAll('[data-datatable-bulk-actions] [data-bs-title]:not([data-bs-toggle="dropdown"])').forEach(e=>{this._tooltips.push(t.getOrCreateInstance(e,{animation:!1}))})}_hideBulkTooltips({blur:t=!1}={}){if(this._tooltips.forEach(s=>{s.hide()}),!t)return;let e=this._document.activeElement;e?.closest?.("[data-datatable-bulk-actions]")&&e.blur()}_initViewToggle(){let t=Array.from(this._element.querySelectorAll(".datatable-view-toggle"));if(!t.length)return;let e=t.flatMap(a=>Array.from(a.querySelectorAll("input"))),s=`moo-datatable-view:${this._element.id}`,n=(a,{persist:r=!1}={})=>{if(this._element.dataset.datatableView=a,e.forEach(l=>{l.checked=l.value===a}),r)try{this._window.localStorage.setItem(s,a)}catch{}},o=null;try{o=this._window.localStorage.getItem(s)}catch{o=null}(o==="table"||o==="cards")&&n(o),t.forEach(a=>{this._listen(a,"change",r=>{let l=r.target.value;l!=="table"&&l!=="cards"||n(l,{persist:!0})})})}_readFacets(t){let e={};return Array.from(t.attributes).forEach(s=>{let n=/^data-datatable-facet-(.+)$/.exec(s.name);n&&(e[n[1]]=s.value)}),e}_readInitialFacetVisibility(){this._element.querySelectorAll("[data-datatable-facet]").forEach(t=>{let e=t.dataset.datatableFacet;e&&this._visibleFacets.set(e,!t.hidden)}),this._element.querySelectorAll("[data-datatable-filter-group]").forEach(t=>{let e=t.dataset.datatableFilterGroup;e&&!this._visibleFacets.has(e)&&this._visibleFacets.set(e,!1)}),this._element.querySelectorAll("[data-datatable-filter-option-key]").forEach(t=>{let e=t.dataset.datatableFilterOptionKey;e&&!this._visibleFacets.has(e)&&this._visibleFacets.set(e,!1)})}_readInitialSort(){let t=this._element.querySelector("th[data-datatable-initial-sort][data-datatable-column]"),e=t?.dataset.datatableInitialSort;e!=="asc"&&e!=="desc"||(this._sortKey=t.dataset.datatableColumn||null,this._sortDirection=this._sortKey?e:null)}_trigger(t,e={}){this._element.dispatchEvent(new this._window.CustomEvent(`${t}.moo.datatable`,{bubbles:!0,detail:e}))}_sortValue(t,e){let s=t.element.querySelector(`:scope > [data-datatable-column="${e}"]`);return s?se(s.dataset.datatableSortValue??s.textContent):""}_matchesFilters(t){if(this._searchTerm&&!t.search.includes(this._searchTerm))return!1;for(let[e,s]of this._facetSelections)if(s.size!==0&&!s.has(t.facets[e]))return!1;return!0}_visibleRows(){let t=this._rows.filter(e=>this._matchesFilters(e));if(this._sortKey){let e=this._sortDirection==="desc"?-1:1;t.sort((s,n)=>{let o=this._sortValue(s,this._sortKey),a=this._sortValue(n,this._sortKey);return o===a?s.index-n.index:o>a?e:-e})}else t.sort((e,s)=>e.index-s.index);return t}_pageCount(t){return Math.max(1,Math.ceil(t/this._pageSize))}_render(){let t=this._visibleRows(),e=this._pageCount(t.length);this._currentPage=Math.min(Math.max(1,this._currentPage),e);let s=(this._currentPage-1)*this._pageSize,n=t.slice(s,s+this._pageSize),o=new Set(n.map(c=>c.element.id));this._rows.forEach(c=>{let h=o.has(c.element.id);c.element.hidden=!h,c.cardElement&&(c.cardElement.hidden=!h)});let a=Array.from(this._tbody.children).filter(c=>o.has(c.id)).map(c=>c.id),r=n.map(c=>c.element.id);(a.length!==r.length||a.some((c,h)=>c!==r[h]))&&n.forEach(c=>{this._tbody.appendChild(c.element),this._cards&&c.cardElement&&this._cards.appendChild(c.cardElement)}),this._renderToolbarState(),this._renderSortHeaders(),this._renderSelection(n),this._renderFrameState(t.length),this._renderEmptyState(t.length),this._renderPagination(t.length,e),this._renderPageSize(),this._renderBulkActions()}_renderToolbarState(){let t=!!this._searchTerm,e=Array.from(this._facetSelections.values()).some(n=>n.size>0),s=this._element.querySelector("[data-datatable-reset]");s&&(s.hidden=!(t||e)),this._element.querySelectorAll("[data-datatable-facet]").forEach(n=>{let o=n.dataset.datatableFacet,a=this._facetSelections.get(o)||new Set;this._visibleFacets.has(o)&&(n.hidden=!this._visibleFacets.get(o)),n.querySelector(".datatable-facet-trigger")?.classList.toggle("datatable-facet-trigger-active",a.size>0);let l=n.querySelector("[data-datatable-facet-summary]");l&&(l.hidden=a.size===0,l.replaceChildren(),a.size>2?l.appendChild(this._createFacetBadge(`${a.size} selected`)):a.forEach(c=>{let d=n.querySelector(`[data-datatable-facet-option="${c}"]`)?.querySelector("[data-datatable-facet-option-label]")?.textContent??c;l.appendChild(this._createFacetBadge(d))})),n.querySelectorAll("[data-datatable-facet-option]").forEach(c=>{let h=a.has(c.dataset.datatableFacetOption);c.classList.toggle("active",h),c.setAttribute("aria-pressed",String(h))})}),this._element.querySelectorAll("[data-datatable-filter-toggle]").forEach(n=>{let o=n.dataset.datatableFilterToggle,a=this._visibleFacets.get(o)??!0;n.classList.toggle("active",a),n.setAttribute("aria-pressed",a?"true":"false")}),this._element.querySelectorAll("[data-datatable-filter-option]").forEach(n=>{let o=n.dataset.datatableFilterOptionKey,r=(this._facetSelections.get(o)||new Set).has(n.dataset.datatableFilterOption);n.classList.toggle("active",r),n.setAttribute("aria-pressed",r?"true":"false")}),this._element.querySelectorAll("[data-datatable-filter-group-summary]").forEach(n=>{let o=this._facetSelections.get(n.dataset.datatableFilterGroupSummary)||new Set;n.hidden=o.size===0,n.textContent=o.size>0?`${o.size} selected`:""})}_createFacetBadge(t){let e=this._document.createElement("span");return e.className="datatable-facet-badge",e.textContent=t,e}_renderSelection(t){let e=Array.from(this._element.querySelectorAll("[data-datatable-select-all]"));t.forEach(o=>{[o.element,o.cardElement].forEach(a=>{let r=a?.querySelector("[data-datatable-select-row]");r&&(r.checked=this._selectedIds.has(o.element.id)),a?.classList.toggle("datatable-row-selected",this._selectedIds.has(o.element.id))})});let s=t.length,n=t.filter(o=>this._selectedIds.has(o.element.id)).length;e.forEach(o=>{o.checked=s>0&&n===s,o.indeterminate=n>0&&n<s})}_renderBulkActions(){let t=this._element.querySelector("[data-datatable-bulk-actions]");if(!t)return;t.hidden=this._selectedIds.size===0;let e=t.querySelector("[data-datatable-bulk-count]");e&&(e.textContent=String(this._selectedIds.size))}_renderFrameState(t){let e=t===0;this._element.querySelectorAll(".datatable-frame, .datatable-card-frame").forEach(s=>{s.hidden=e})}_renderEmptyState(t){let e=this._element.querySelector("[data-datatable-empty]");if(!e)return;let s=this._rows.length>0;e.hidden=t!==0,e.querySelector(".datatable-empty-title")?.replaceChildren(this._document.createTextNode(s?"No matching results":"No rows to display"));let n=e.querySelector(".datatable-empty-copy");n&&(n.hidden=!s);let o=e.querySelector("[data-datatable-empty-reset]");o&&(o.hidden=!s)}_sortAriaValue(t){return t==="asc"?"ascending":t==="desc"?"descending":"none"}_renderSortHeaders(){this._element.querySelectorAll("th[data-datatable-column]").forEach(t=>{if(!t.querySelector("[data-datatable-sort-key]")){delete t.dataset.datatableSortState,delete t.dataset.datatableSortDirection,t.removeAttribute("aria-sort");return}let s=t.dataset.datatableColumn,n=s&&s===this._sortKey?this._sortDirection:"none";t.dataset.datatableSortState=n||"none",t.setAttribute("aria-sort",this._sortAriaValue(n)),n==="asc"||n==="desc"?t.dataset.datatableSortDirection=n:delete t.dataset.datatableSortDirection})}_renderPagination(t,e){let s=this._element.querySelector("[data-datatable-page-first]"),n=this._element.querySelector("[data-datatable-page-prev]"),o=this._element.querySelector("[data-datatable-page-next]"),a=this._element.querySelector("[data-datatable-page-last]"),r=this._currentPage<=1,l=this._currentPage>=e;[s,n].forEach(p=>this._setPageItemDisabled(p,r)),[o,a].forEach(p=>this._setPageItemDisabled(p,l));let c=this._element.querySelector("[data-datatable-results-summary]");if(c)if(t===0)c.textContent="No results";else{let p=(this._currentPage-1)*this._pageSize+1,_=Math.min(this._currentPage*this._pageSize,t);c.textContent=`Showing ${p}-${_} of ${t}`}let h=this._element.querySelector("template[data-datatable-page-numbers]");if(!h)return;let d=this._pageWindow(this._currentPage,e),u=Array.from(h.parentNode.querySelectorAll("[data-datatable-page-number], [data-datatable-page-ellipsis]")),f=u.map(p=>p.dataset.datatablePageEllipsis===void 0?Number(p.dataset.datatablePageNumber):"\u2026");if(f.length!==d.length||f.some((p,_)=>p!==d[_])){u.forEach(_=>_.remove());let p=this._document.createDocumentFragment();d.forEach(_=>{let m=this._document.createElement("li");if(m.className="page-item",_==="\u2026")m.dataset.datatablePageEllipsis="",m.innerHTML='<span class="page-link">\u2026</span>';else{m.dataset.datatablePageNumber=String(_);let b=this._document.createElement("button");b.type="button",b.className="page-link",b.textContent=String(_),b.setAttribute("aria-label",`Go to page ${_}`),b.dataset.datatablePageGo=String(_),m.appendChild(b)}p.appendChild(m)}),h.parentNode.insertBefore(p,h)}h.parentNode.querySelectorAll("[data-datatable-page-number]").forEach(p=>{let _=Number(p.dataset.datatablePageNumber)===this._currentPage;p.classList.toggle("active",_),_?p.setAttribute("aria-current","page"):p.removeAttribute("aria-current")})}_renderPageSize(){let t=String(this._pageSize),e=this._element.querySelector("[data-datatable-page-size-value]");e&&(e.textContent=t);let s=this._element.querySelector("[data-datatable-page-size-select]");s&&(s.value=t),this._element.querySelectorAll("[data-datatable-page-size-option]").forEach(n=>{let o=n.dataset.datatablePageSizeOption===t;n.classList.toggle("active",o),n.setAttribute("aria-pressed",o?"true":"false")})}_setPageItemDisabled(t,e){t&&(t.disabled=e,t.closest(".page-item")?.classList.toggle("disabled",e))}_pageWindow(t,e){if(e<=7)return Array.from({length:e},(a,r)=>r+1);let s=new Set([1,e,t-1,t,t+1]),n=Array.from(s).filter(a=>a>=1&&a<=e).sort((a,r)=>a-r),o=[];return n.forEach((a,r)=>{r>0&&a-n[r-1]>1&&o.push("\u2026"),o.push(a)}),o}_isColumnFixed(t){return this._element.querySelector(`th[data-datatable-column="${t}"]`)?.hasAttribute("data-datatable-column-fixed")||!1}_setColumnVisible(t,e,{syncViewToggle:s=!0}={}){!e&&this._isColumnFixed(t)||(this._element.querySelectorAll(`[data-datatable-column="${t}"], [data-datatable-detail-column="${t}"]`).forEach(n=>{n.classList.toggle("datatable-col-hidden",!e)}),s&&this._element.querySelectorAll(`[data-datatable-column-toggle="${t}"]`).forEach(n=>{n.classList.toggle("active",e),n.setAttribute("aria-pressed",String(e))}))}_setSort(t,e){let s=e==="asc"||e==="desc"?e:null;this._sortKey=s?t:null,this._sortDirection=s,this._render(),this._trigger("sort",{key:this._sortKey,direction:this._sortDirection})}_handleSortAction(t){let e=t.target.closest("[data-datatable-sort-action]");if(!e)return;let n=e.closest(".dropdown-menu")?.closest(".datatable-sort")?.querySelector("[data-datatable-sort-key]")?.dataset.datatableSortKey;if(!n)return;let o=e.dataset.datatableSortAction;if(o==="hide"){this._setColumnVisible(n,!1);return}this._setSort(n,o)}_handleFacetClick(t){let e=t.target.closest("[data-datatable-facet-option]"),s=t.target.closest("[data-datatable-facet-clear]");if(!e&&!s)return;let o=t.target.closest("[data-datatable-facet]")?.dataset.datatableFacet;if(!o)return;let a=this._facetSelections.get(o)||new Set;if(s)a.clear();else{let r=e.dataset.datatableFacetOption;a.has(r)?a.delete(r):a.add(r)}this._facetSelections.set(o,a),this._filterMode==="picker"&&a.size===0&&this._visibleFacets.set(o,!1),this._currentPage=1,this._render(),this._trigger("filter")}_handleFacetSearch(t){let e=t.target.closest("[data-datatable-facet-search]");if(!e)return;let s=e.closest("[data-datatable-facet]"),n=se(e.value);s?.querySelectorAll("[data-datatable-facet-option]").forEach(o=>{let a=se(o.querySelector("[data-datatable-facet-option-label]")?.textContent||o.textContent);o.closest("li")?.classList.toggle("datatable-facet-search-hidden",n.length>0&&!a.includes(n))})}_handleFacetSearchKeydown(t){if(t.key!=="ArrowDown")return;let e=t.target.closest("[data-datatable-facet-search]");if(!e)return;let s=e.closest("[data-datatable-facet]"),o=Array.from(s?.querySelectorAll("[data-datatable-facet-option]")||[]).find(a=>!a.closest("li")?.classList.contains("datatable-facet-search-hidden"));o&&(t.preventDefault(),o.focus())}_handleFilterOptionClick(t){let e=t.target.closest("[data-datatable-filter-option]");if(!e)return;let s=e.dataset.datatableFilterOptionKey,n=e.dataset.datatableFilterOption;if(!s||!this._visibleFacets.has(s))return;this._visibleFacets.set(s,!0);let o=this._facetSelections.get(s)||new Set;o.has(n)?o.delete(n):o.add(n),this._facetSelections.set(s,o),o.size===0&&this._visibleFacets.set(s,!1),this._currentPage=1,this._render(),this._trigger("filter")}_showFilterPickerPanel(t=null){this._element.querySelectorAll("[data-datatable-filter-panel]").forEach(e=>{let s=e.dataset.datatableFilterPanel==="facets",n=e.dataset.datatableFilterPanelKey===t;e.hidden=t?!n:!s}),this._element.querySelector(".datatable-search-filter-menu")?.setAttribute("data-datatable-filter-menu-panel",t?"options":"facets")}_handleFilterPickerClick(t){let e=t.target.closest("[data-datatable-filter-group]");if(e){let s=e.dataset.datatableFilterGroup;this._showFilterPickerPanel(s);let n=this._element.querySelector(`[data-datatable-filter-option-search="${s}"]`),o=this._element.querySelector(`[data-datatable-filter-option-key="${s}"]`);(n||o)?.focus({preventScroll:!0});return}t.target.closest("[data-datatable-filter-back]")&&this._showFilterPickerPanel()}_handleFilterOptionSearch(t){let e=t.target.closest("[data-datatable-filter-option-search]");if(!e)return;let s=e.dataset.datatableFilterOptionSearch,n=se(e.value);this._element.querySelectorAll(`[data-datatable-filter-option-key="${s}"]`).forEach(o=>{let a=se(o.querySelector("[data-datatable-filter-option-label]")?.textContent||o.textContent);o.closest("li")?.classList.toggle("datatable-filter-option-search-hidden",n.length>0&&!a.includes(n))})}_handleFilterOptionSearchKeydown(t){if(t.key!=="ArrowDown")return;let e=t.target.closest("[data-datatable-filter-option-search]");if(!e)return;let s=e.dataset.datatableFilterOptionSearch,o=Array.from(this._element.querySelectorAll(`[data-datatable-filter-option-key="${s}"]`)).find(a=>!a.closest("li")?.classList.contains("datatable-filter-option-search-hidden"));o&&(t.preventDefault(),o.focus())}_handleFilterToggleClick(t){let e=t.target.closest("[data-datatable-filter-toggle]");if(!e)return;let s=e.dataset.datatableFilterToggle;if(!s||!this._visibleFacets.has(s))return;let n=!this._visibleFacets.get(s);this._visibleFacets.set(s,n),n||(this._facetSelections.get(s)?.clear(),this._currentPage=1,this._trigger("filter")),this._render()}_handleColumnToggleClick(t){let e=t.target.closest("[data-datatable-column-toggle]");if(!e)return;let s=e.dataset.datatableColumnToggle,n=e.getAttribute("aria-pressed")==="true";this._setColumnVisible(s,n,{syncViewToggle:!1})}_handleReset(){let t=this._element.querySelector("[data-datatable-search]");t&&(t.value=""),this._searchTerm="",this._facetSelections.forEach(e=>e.clear()),this._filterMode==="picker"&&this._visibleFacets.forEach((e,s)=>{this._visibleFacets.set(s,!1)}),this._currentPage=1,this._render(),this._trigger("filter")}_handleSelectAll(t){let e=t.target.checked,s=this._visibleRows(),n=(this._currentPage-1)*this._pageSize;s.slice(n,n+this._pageSize).forEach(a=>{e?this._selectedIds.add(a.element.id):this._selectedIds.delete(a.element.id)}),this._render(),this._trigger("select")}_handleSelectRow(t){let e=t.target.closest("[data-datatable-select-row]");if(!e)return;let s=e.closest("[data-datatable-row]"),n=e.closest("[data-datatable-card]"),o=s?.id||n?.dataset.datatableCardFor;o&&(e.checked?this._selectedIds.add(o):this._selectedIds.delete(o),this._render(),this._trigger("select"))}_handleBulkClick(t){if(t.target.closest("[data-datatable-bulk-clear]")){this._clearSelection();return}let e=t.target.closest("[data-datatable-bulk-update]");if(e){let n=e.dataset.datatableBulkUpdate,o=e.dataset.datatableBulkUpdateValue;this._applyBulkUpdate(n,o,e);return}let s=t.target.closest("[data-datatable-bulk-action]");if(s){let n=s.dataset.datatableBulkAction;if(n==="delete"){this._applyBulkDelete();return}this._trigger(`bulk-${n}`,{ids:this.getSelectedIds()})}}_clearSelection(){this._hideBulkTooltips({blur:!0}),this._selectedIds.clear(),this._render(),this._trigger("select")}_applyBulkUpdate(t,e,s){let n=s.querySelector("svg")?.cloneNode(!0),o=s.querySelector("span")?.textContent?.trim()??e;this._selectedIds.forEach(a=>{let r=this._rows.find(u=>u.element.id===a);if(!r)return;r.element.setAttribute(`data-datatable-facet-${t}`,e),r.facets[t]=e;let l=r.element.querySelector(`[data-datatable-column="${t}"]`);if(!l)return;let c=l.querySelector("[data-datatable-cell-label]");c?c.textContent=o:l.textContent=o;let h=l.querySelector("svg");h&&n&&h.replaceWith(n.cloneNode(!0));let d=r.cardElement?.querySelector(`[data-datatable-detail-column="${t}"] .datatable-card-value`);d&&(d.innerHTML=l.innerHTML)}),this._render(),this._trigger("bulk-update",{key:t,value:e,ids:this.getSelectedIds()})}_applyBulkDelete(){let t=this.getSelectedIds();t.forEach(e=>{let s=this._rows.findIndex(n=>n.element.id===e);s!==-1&&(this._rows[s].element.remove(),this._rows[s].cardElement?.remove(),this._rows.splice(s,1))}),this._selectedIds.clear(),this._render(),this._trigger("bulk-delete",{ids:t})}_handlePageClick(t){let e=t.target.closest("[data-datatable-page-go]");if(e){this._currentPage=Number(e.dataset.datatablePageGo),this._render();return}if(t.target.closest("[data-datatable-page-first]")){this._currentPage=1,this._render();return}if(t.target.closest("[data-datatable-page-prev]")){this._currentPage-=1,this._render();return}if(t.target.closest("[data-datatable-page-next]")){this._currentPage+=1,this._render();return}t.target.closest("[data-datatable-page-last]")&&(this._currentPage=this._pageCount(this._visibleRows().length),this._render())}_setPageSize(t){let e=Number(t);!Number.isFinite(e)||e<=0||(this._pageSize=e,this._element.dataset.datatablePageSize=String(e),this._currentPage=1,this._render())}_bindEvents(){let t=this._element.querySelector("[data-datatable-search]");this._listen(t,"input",n=>{this._searchTerm=se(n.target.value),this._currentPage=1,this._render(),this._trigger("filter")}),this._listen(t,"keydown",n=>{if(n.key!=="Enter")return;n.preventDefault();let o=this._element.querySelector("[data-datatable-filter-menu-trigger]"),a=this._bootstrap("Dropdown");o&&a&&a.getOrCreateInstance(o).hide()}),this._listen(this._element,"click",n=>{this._handleSortAction(n),this._handleFilterPickerClick(n),this._handleFilterOptionClick(n),this._handleFilterToggleClick(n),this._handleFacetClick(n),this._handleColumnToggleClick(n),this._handlePageClick(n),this._handleBulkClick(n),n.target.closest("[data-datatable-empty-reset]")&&this._handleReset(),n.target.closest("[data-datatable-select-row]")&&this._handleSelectRow(n)}),this._listen(this._document,"keydown",n=>{n.key==="Escape"&&this._selectedIds.size>0&&this._clearSelection()}),this._listen(this._element,"show.bs.dropdown",n=>{this._reparentRowActionMenu(n.target);let o=this._bootstrap("Tooltip")?.getInstance(n.target);o?.hide(),o?.disable()}),this._listen(this._element,"hidden.bs.dropdown",n=>{this._restoreRowActionMenuForTrigger(n.target),this._bootstrap("Tooltip")?.getInstance(n.target)?.enable(),n.target.matches("[data-datatable-filter-menu-trigger]")&&this._showFilterPickerPanel()}),this._element.querySelectorAll("[data-datatable-filter-option-search]").forEach(n=>{this._listen(n,"input",o=>this._handleFilterOptionSearch(o)),this._listen(n,"keydown",o=>this._handleFilterOptionSearchKeydown(o))}),this._element.querySelectorAll("[data-datatable-facet-search]").forEach(n=>{this._listen(n,"input",o=>this._handleFacetSearch(o)),this._listen(n,"keydown",o=>this._handleFacetSearchKeydown(o))});let e=this._element.querySelector("[data-datatable-reset]");this._listen(e,"click",()=>this._handleReset()),this._element.querySelectorAll("[data-datatable-select-all]").forEach(n=>{this._listen(n,"change",o=>this._handleSelectAll(o))});let s=this._element.querySelector("[data-datatable-page-size-select]");this._listen(s,"change",n=>this._setPageSize(n.target.value)),this._element.querySelectorAll("[data-datatable-page-size-option]").forEach(n=>{this._listen(n,"click",()=>{this._setPageSize(n.dataset.datatablePageSizeOption)})})}};var gi=new WeakMap,pi=new WeakMap,_i=new WeakMap,vt="en",cf=1440*60*1e3,Iu=new Date(2026,7,16),Pe=8;function $n(i,t){return i?.nodeType===1&&!!i.matches?.(t)}function K(i,t,e,s,n){t&&(t.addEventListener(e,s,n),i.push({target:t,type:e,handler:s,options:n}))}function oe(i){i.forEach(({target:t,type:e,handler:s,options:n})=>{t.removeEventListener(e,s,n)}),i.length=0}function Y(i){if(!i)return null;if(i instanceof Date)return Number.isNaN(i.getTime())?null:new Date(i.getFullYear(),i.getMonth(),i.getDate());if(typeof i=="number")return Y(new Date(i));let t=String(i).trim(),e=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t);if(e){let s=new Date(Number(e[1]),Number(e[2])-1,Number(e[3]));return s.getFullYear()===Number(e[1])&&s.getMonth()===Number(e[2])-1&&s.getDate()===Number(e[3])?s:null}return null}function yr(i){return String(i).padStart(2,"0")}function et(i){return`${i.getFullYear()}-${yr(i.getMonth()+1)}-${yr(i.getDate())}`}function dt(i,t){return!i||!t?0:i.getTime()-t.getTime()}function ne(i,t){return!!(i&&t&&et(i)===et(t))}function Ht(i,t){return new Date(i.getFullYear(),i.getMonth(),i.getDate()+t)}function Wn(i,t){let e=new Date(i.getFullYear(),i.getMonth()+t,1),s=Math.min(i.getDate(),qn(e.getFullYear(),e.getMonth()));return new Date(e.getFullYear(),e.getMonth(),s)}function ms(i=vt){try{if(typeof Intl<"u"&&typeof Intl.Locale=="function"){let t=new Intl.Locale(i||vt),e=t.weekInfo||t.getWeekInfo?.();if(Number.isInteger(e?.firstDay))return e.firstDay%7}}catch{}return 0}function Lu(i=vt){let t=ms(i);return Array.from({length:7},(e,s)=>Ht(Iu,(t+s)%7))}function Ot(i){return new Date(i.getFullYear(),i.getMonth(),1)}function qn(i,t){return new Date(i,t+1,0).getDate()}function Ru(i,t,e){return t&&dt(i,t)<0?new Date(t):e&&dt(i,e)>0?new Date(e):i}function zu(i){if(Array.isArray(i))return i.map(Y).filter(Boolean).map(et);if(!i)return[];let t=String(i).trim();if(!t)return[];try{let e=JSON.parse(t);if(Array.isArray(e))return e.map(Y).filter(Boolean).map(et)}catch{}return t.split(",").map(Y).filter(Boolean).map(et)}function Ee(i,t=vt){return i?new Intl.DateTimeFormat(t||vt,{month:"short",day:"numeric",year:"numeric"}).format(i):""}function xr(i,t=vt){return new Intl.DateTimeFormat(t||vt,{month:"long",year:"numeric"}).format(i)}function Hn(i,t,e=vt){if(i)return t==="yyyy-mm-dd"?et(i):t?Ee(i,e):new Date(i)}function Yn(i,t={}){let e=i.dataset||{},s=t.locale||e.datepickerLocale||e.calendarLocale||vt,n=Y(t.minDate||e.calendarMinDate||e.datepickerMinDate),o=Y(t.maxDate||e.calendarMaxDate||e.datepickerMaxDate);return{locale:s,mode:t.mode||e.calendarMode||e.datepickerMode||"single",placeholder:t.placeholder||e.datepickerPlaceholder||"Pick a date",value:t.value||e.calendarValue||e.datepickerValue||"",startValue:t.startValue||e.calendarStartValue||e.datepickerStartValue||"",endValue:t.endValue||e.calendarEndValue||e.datepickerEndValue||"",minDate:n,maxDate:o,disabledDates:zu(t.disabledDates||e.calendarDisabledDates||e.datepickerDisabledDates),captionLayout:t.captionLayout||e.calendarCaptionLayout||"",showPresets:t.showPresets??(e.calendarShowPresets==="true"||e.datepickerShowPresets==="true")}}function gt(i,t,e,s={},n=!1){return i.dispatchEvent(new t.CustomEvent(e,{bubbles:!0,cancelable:n,detail:s}))}function jn(i,t){i&&(i.value=t||"")}function kr(i,t){i&&(i.value=t||"")}function Kn(i,t,e){if(e){i.dataset.invalid="true",t.classList.add("is-invalid"),t.setAttribute("aria-invalid","true");return}delete i.dataset.invalid,t.classList.remove("is-invalid"),t.removeAttribute("aria-invalid")}function Mr(i,t,e){e?.required&&e.checkValidity()&&Kn(i,t,!1)}function wr(i,t,e){return e<t?t:Math.min(Math.max(i,t),e)}function Bu(i,t,e){let s=i?.ownerDocument?.defaultView||window,n=i?s.getComputedStyle(i).getPropertyValue(t).trim():"",o=Number.parseFloat(n);if(!Number.isFinite(o))return e;if(n.endsWith("rem")){let a=i.ownerDocument.documentElement,r=Number.parseFloat(s.getComputedStyle(a).fontSize);return Number.isFinite(r)?o*r:e}if(n.endsWith("em")){let a=Number.parseFloat(s.getComputedStyle(i).fontSize);return Number.isFinite(a)?o*a:e}return Number.isFinite(o)?o:e}function mi(i,t){return!!(t&&(i._element.contains(t)||i._popover.contains(t)))}function vr(i){let t=i._element.closest("[data-bs-theme]")?.getAttribute("data-bs-theme")||i._document.documentElement.getAttribute("data-bs-theme"),e=getComputedStyle(i._trigger).direction;t&&i._popover.setAttribute("data-bs-theme",t),e==="rtl"&&i._popover.setAttribute("dir","rtl")}function Vu(i){let t=i._popover;if(i._popoverPortal?.host?.parentElement===i._document.body){vr(i);return}let e=i._document.createElement("div");e.className="moo-ui",e.dataset.datepickerPortalHost="",i._popoverPortal={parent:t.parentNode,nextSibling:t.nextSibling,host:e,hadTheme:t.hasAttribute("data-bs-theme"),theme:t.getAttribute("data-bs-theme"),hadDirection:t.hasAttribute("dir"),direction:t.getAttribute("dir")},e.appendChild(t),i._document.body.appendChild(e),vr(i)}function Un(i){let t=i._popoverPortal;if(!t)return;let e=i._popover;t.parent?.isConnected?t.nextSibling?.parentNode===t.parent?t.parent.insertBefore(e,t.nextSibling):t.parent.appendChild(e):e.remove(),t.host?.remove(),t.hadTheme?e.setAttribute("data-bs-theme",t.theme):e.removeAttribute("data-bs-theme"),t.hadDirection?e.setAttribute("dir",t.direction):e.removeAttribute("dir"),i._popoverPortal=null}function Nu(i,t,e,s){let n=Bu(e,"--moo-datepicker-popover-offset",6),o=getComputedStyle(i).direction;t.style.position="fixed",t.style.inset="auto",t.style.right="auto",t.style.bottom="auto",t.style.maxHeight="",t.style.overflowY="";let a=i.getBoundingClientRect(),r=t.getBoundingClientRect(),l=s.innerWidth,c=s.innerHeight,h=o==="rtl"?a.right-r.width:a.left,d=wr(h,Pe,l-r.width-Pe),u=a.bottom+n<=c?c-a.bottom-n-Pe:0,f=a.top-n-Pe,g=r.height>u&&f>u,p=g?"top":"bottom",_=Math.max(0,g?f:u),m=Math.min(r.height,_),b=g?a.top-n-m:a.bottom+n;t.style.left=`${Math.round(d)}px`,t.style.top=`${Math.round(wr(b,Pe,c-m-Pe))}px`,_>0&&(t.style.maxHeight=`${Math.floor(_)}px`,t.style.overflowY="auto"),t.dataset.datepickerPlacement=p}function Wu(i){i.style.position="",i.style.inset="",i.style.right="",i.style.bottom="",i.style.left="",i.style.top="",i.style.maxHeight="",i.style.overflowY="",delete i.dataset.datepickerPlacement}function Dr(i){oe(i._floatingListeners),Vu(i);let t=()=>{i.isOpen()&&Nu(i._trigger,i._popover,i._element,i._window)};i._positionPopover=t,t(),K(i._floatingListeners,i._window,"resize",t),K(i._floatingListeners,i._window,"scroll",t,!0),K(i._floatingListeners,i._document,"scroll",t,!0)}function bs(i){oe(i._floatingListeners),i._positionPopover=null,Wu(i._popover),Un(i)}function Hu(i,t){return new Intl.DateTimeFormat(t||vt,{month:"short"}).format(new Date(2026,i,1))}function qu(i,t,e){let s=i?i.getFullYear():e.getFullYear()-100,n=t?t.getFullYear():e.getFullYear()+20,o=[];for(let a=s;a<=n;a+=1)o.push(a);return o}function Sr(i,t,e=""){let s=i.createElement("span");return s.className=e,s.setAttribute("aria-hidden","true"),s.textContent=t,s}var Oe=class i{static getInstance(t){return t?.nodeType===1&&pi.get(t)||null}static getOrCreateInstance(t,e={}){return i.getInstance(t)||new i(t,e)}constructor(t,e={}){if(!$n(t,"[data-calendar]"))throw new TypeError("MooCalendar requires a [data-calendar] root element.");let s=pi.get(t);if(s)return s;this._element=t,this._document=t.ownerDocument,this._window=this._document.defaultView||window,this._listeners=[],this._disposed=!1,this._config=Yn(t,e),this._mode=this._config.mode==="range"?"range":"single",this._disabledDates=new Set(this._config.disabledDates),this._selectedDate=Y(this._config.value),this._rangeStart=Y(this._config.startValue),this._rangeEnd=Y(this._config.endValue),this._activeDate=this._nearestEnabledDate(this._rangeStart||this._selectedDate||new Date),this._viewDate=Ot(this._activeDate),this._captionId=this._element.id?`${this._element.id}-caption`:`moo-calendar-caption-${Math.random().toString(36).slice(2)}`,this._labelId=this._element.id?`${this._element.id}-label`:`moo-calendar-label-${Math.random().toString(36).slice(2)}`,pi.set(t,this),this._bindEvents(),this._render()}dispose(){this._disposed||(this._disposed=!0,oe(this._listeners),this._element.replaceChildren(),pi.get(this._element)===this&&pi.delete(this._element))}getDate(t=void 0){return this._mode==="range"?this.getDates(t):Hn(this._selectedDate,t,this._config.locale)}getDates(t=void 0){return[Hn(this._rangeStart,t,this._config.locale),Hn(this._rangeEnd,t,this._config.locale)]}setDate(t,e={}){if(this._mode!=="single")return!1;let s=Y(t);return!s||this._isDisabled(s)?!1:(this._selectedDate=s,this._activeDate=s,this._viewDate=Ot(s),this._render(),e.emit!==!1&&this._emitChange(!0),!0)}setDates(t,e,s={}){if(this._mode!=="range")return!1;let n=Y(t),o=Y(e);return n&&this._isDisabled(n)||o&&this._isDisabled(o)?!1:(this._rangeStart=n,this._rangeEnd=o,this._rangeStart&&this._rangeEnd&&dt(this._rangeStart,this._rangeEnd)>0&&([this._rangeStart,this._rangeEnd]=[this._rangeEnd,this._rangeStart]),this._activeDate=this._rangeEnd||this._rangeStart||this._activeDate,this._viewDate=Ot(this._activeDate),this._render(),s.emit!==!1&&this._emitChange(!!(this._rangeStart&&this._rangeEnd)),!0)}clear(t={}){this._selectedDate=null,this._rangeStart=null,this._rangeEnd=null,this._render(),t.emit!==!1&&this._emitChange(!1)}focusActiveDay(){this._dayButton(this._activeDate)?.focus()}_bindEvents(){K(this._listeners,this._element,"click",t=>{let e=t.target,s=e.closest?.("[data-calendar-day]"),n=e.closest?.("[data-calendar-prev]"),o=e.closest?.("[data-calendar-next]"),a=e.closest?.("[data-calendar-preset]");n?this._changeMonth(-1,!0):o?this._changeMonth(1,!0):a?this._selectPreset(a.dataset.calendarPreset):s&&this._selectDate(Y(s.dataset.calendarDay),!0)}),K(this._listeners,this._element,"keydown",t=>{t.target.closest?.("[data-calendar-day]")&&this._handleDayKeydown(t)}),K(this._listeners,this._element,"change",t=>{t.target.matches?.("[data-calendar-month]")&&this._setActiveMonth(this._viewDate.getFullYear(),Number(t.target.value),!0),t.target.matches?.("[data-calendar-year]")&&this._setActiveMonth(Number(t.target.value),this._viewDate.getMonth(),!0)})}_emitChange(t){gt(this._element,this._window,"change.moo.calendar",{date:this._selectedDate?new Date(this._selectedDate):void 0,value:this._selectedDate?et(this._selectedDate):"",startDate:this._rangeStart?new Date(this._rangeStart):void 0,endDate:this._rangeEnd?new Date(this._rangeEnd):void 0,startValue:this._rangeStart?et(this._rangeStart):"",endValue:this._rangeEnd?et(this._rangeEnd):"",complete:t})}_changeMonth(t,e){let s=Ot(Wn(this._viewDate,t));this._setActiveMonth(s.getFullYear(),s.getMonth(),e)}_setActiveMonth(t,e,s=!1){let n=Math.min(this._activeDate.getDate(),qn(t,e));this._activeDate=this._nearestEnabledDate(new Date(t,e,n)),this._viewDate=Ot(this._activeDate),this._render(),s&&this.focusActiveDay()}_selectPreset(t){if(!t)return;let e=new Date,s={today:0,tomorrow:1,"in-3-days":3,"in-a-week":7,"in-2-weeks":14};t in s&&this._selectDate(Ht(e,s[t]),!0)}_handleDayKeydown(t){let e=t.target.closest?.("[data-calendar-day]"),s=Y(e?.dataset?.calendarDay);s&&dt(s,this._activeDate)!==0&&(this._activeDate=s);let n={ArrowRight:1,ArrowLeft:-1,ArrowDown:7,ArrowUp:-7},o=null;if(t.key in n)o=Ht(this._activeDate,n[t.key]);else if(t.key==="Home"){let a=ms(this._config.locale),r=(this._activeDate.getDay()-a+7)%7;o=Ht(this._activeDate,-r)}else if(t.key==="End"){let a=ms(this._config.locale),r=(this._activeDate.getDay()-a+7)%7;o=Ht(this._activeDate,6-r)}else if(t.key==="PageUp")o=Wn(this._activeDate,-1);else if(t.key==="PageDown")o=Wn(this._activeDate,1);else if(t.key==="Enter"||t.key===" "||t.key==="Spacebar"){t.preventDefault(),this._selectDate(this._activeDate,!0);return}else return;t.preventDefault(),this._setActiveDate(o,!0,dt(o,this._activeDate)<0?-1:1)}_setActiveDate(t,e=!1,s=0){let n=s===0?this._nearestEnabledDate(t):this._nextEnabledDate(t,s);this._activeDate=n,this._viewDate=Ot(n),this._render(),e&&this.focusActiveDay()}_nextEnabledDate(t,e){let s=Y(t);if(!s)return this._activeDate;let n=e<0?-1:1;for(let o=0;o<366&&!(this._config.minDate&&dt(s,this._config.minDate)<0||this._config.maxDate&&dt(s,this._config.maxDate)>0);o+=1){if(!this._isDisabled(s))return s;s=Ht(s,n)}return this._activeDate}_nearestEnabledDate(t){let e=Ru(Y(t)||new Date,this._config.minDate,this._config.maxDate);if(!this._isDisabled(e))return e;let s=Ot(e),n=qn(s.getFullYear(),s.getMonth());for(let o=1;o<=n;o+=1){let a=new Date(s.getFullYear(),s.getMonth(),o);if(!this._isDisabled(a))return a}return e}_selectDate(t,e){if(!(!t||this._isDisabled(t))){if(this._activeDate=t,this._viewDate=Ot(t),this._mode==="range"){!this._rangeStart||this._rangeEnd||dt(t,this._rangeStart)<0?(this._rangeStart=t,this._rangeEnd=null):this._rangeEnd=t,this._render(),e&&this._emitChange(!!(this._rangeStart&&this._rangeEnd));return}this._selectedDate=t,this._render(),e&&this._emitChange(!0)}}_isDisabled(t){return!t||this._config.minDate&&dt(t,this._config.minDate)<0||this._config.maxDate&&dt(t,this._config.maxDate)>0?!0:this._disabledDates.has(et(t))}_isSelected(t){return this._mode==="range"?ne(t,this._rangeStart)||ne(t,this._rangeEnd):ne(t,this._selectedDate)}_rangeState(t){return this._mode!=="range"||!this._rangeStart?"":ne(t,this._rangeStart)?"start":ne(t,this._rangeEnd)?"end":this._rangeStart&&this._rangeEnd&&dt(t,this._rangeStart)>0&&dt(t,this._rangeEnd)<0?"middle":""}_dayButton(t){return this._element.querySelector(`[data-calendar-day="${et(t)}"]`)}_render(){let t=this._document,e=t.createDocumentFragment(),s=t.createElement("div");s.className="moo-calendar__header";let n=t.createElement("button");n.className="btn btn-ghost btn-icon-sm moo-calendar__nav",n.type="button",n.dataset.calendarPrev="true",n.setAttribute("aria-label","Previous month"),n.appendChild(Sr(t,"\u2039","moo-calendar__nav-icon"));let o=t.createElement("button");o.className="btn btn-ghost btn-icon-sm moo-calendar__nav",o.type="button",o.dataset.calendarNext="true",o.setAttribute("aria-label","Next month"),o.appendChild(Sr(t,"\u203A","moo-calendar__nav-icon"));let a=t.createElement("div");if(a.className="moo-calendar__caption",a.id=this._captionId,a.setAttribute("aria-live","polite"),this._config.captionLayout==="dropdown"){let f=t.createElement("select");f.className="moo-calendar__select",f.dataset.calendarMonth="true",f.setAttribute("aria-label","Month");for(let p=0;p<12;p+=1){let _=t.createElement("option");_.value=String(p),_.textContent=Hu(p,this._config.locale),_.selected=p===this._viewDate.getMonth(),f.appendChild(_)}let g=t.createElement("select");g.className="moo-calendar__select",g.dataset.calendarYear="true",g.setAttribute("aria-label","Year"),qu(this._config.minDate,this._config.maxDate,this._viewDate).forEach(p=>{let _=t.createElement("option");_.value=String(p),_.textContent=String(p),_.selected=p===this._viewDate.getFullYear(),g.appendChild(_)}),a.append(f,g)}else a.textContent=xr(this._viewDate,this._config.locale);s.append(n,a,o),e.appendChild(s);let r=t.createElement("div");r.id=this._labelId,r.className="visually-hidden",r.textContent=this._element.getAttribute("aria-label")||xr(this._viewDate,this._config.locale),e.appendChild(r);let l=t.createElement("div");l.className="moo-calendar__weekdays",l.setAttribute("role","row"),Lu(this._config.locale).forEach(f=>{let g=t.createElement("span");g.className="moo-calendar__weekday",g.setAttribute("role","columnheader"),g.textContent=new Intl.DateTimeFormat(this._config.locale,{weekday:"narrow"}).format(f),l.appendChild(g)});let c=t.createElement("div");c.className="moo-calendar__grid",c.setAttribute("role","grid"),c.setAttribute("aria-labelledby",this._labelId),c.appendChild(l);let h=Ot(this._viewDate),d=ms(this._config.locale),u=Ht(h,-((h.getDay()-d+7)%7));for(let f=0;f<6;f+=1){let g=t.createElement("div");g.className="moo-calendar__week",g.setAttribute("role","row");for(let p=0;p<7;p+=1){let _=Ht(u,f*7+p),m=et(_),b=t.createElement("div");b.className="moo-calendar__cell",b.setAttribute("role","gridcell");let x=t.createElement("button");x.className="moo-calendar__day",x.type="button",x.dataset.calendarDay=m,x.textContent=String(_.getDate()),x.tabIndex=ne(_,this._activeDate)?0:-1,x.setAttribute("aria-label",Ee(_,this._config.locale));let w=this._isSelected(_);x.dataset.calendarSelected=String(w),b.setAttribute("aria-selected",w?"true":"false"),_.getMonth()!==this._viewDate.getMonth()&&(x.dataset.calendarOutside="true"),ne(_,new Date)&&(x.dataset.calendarToday="true",x.setAttribute("aria-current","date"));let y=this._rangeState(_);y&&(x.dataset.calendarRange=y),this._isDisabled(_)&&(x.disabled=!0,x.setAttribute("aria-disabled","true")),b.appendChild(x),g.appendChild(b)}c.appendChild(g)}if(e.appendChild(c),this._config.showPresets){let f=t.createElement("div");f.className="moo-calendar__presets",[["today","Today"],["tomorrow","Tomorrow"],["in-3-days","In 3 days"],["in-a-week","In a week"],["in-2-weeks","In 2 weeks"]].forEach(([g,p])=>{let _=t.createElement("button");_.className="btn btn-outline-secondary btn-sm moo-calendar__preset",_.type="button",_.dataset.calendarPreset=g,_.textContent=p,f.appendChild(_)}),e.appendChild(f)}this._element.classList.add("moo-calendar"),this._element.dataset.calendar=this._element.dataset.calendar||"",this._element.dataset.calendarMode=this._mode,this._element.dataset.calendarActiveDate=et(this._activeDate),this._mode==="single"&&this._selectedDate?this._element.dataset.calendarValue=et(this._selectedDate):delete this._element.dataset.calendarValue,this._mode==="range"?(this._element.dataset.calendarStartValue=this._rangeStart?et(this._rangeStart):"",this._element.dataset.calendarEndValue=this._rangeEnd?et(this._rangeEnd):""):(delete this._element.dataset.calendarStartValue,delete this._element.dataset.calendarEndValue),this._element.replaceChildren(e)}},bi=class i{static getInstance(t){return t?.nodeType===1&&gi.get(t)||null}static getOrCreateInstance(t,e={}){return i.getInstance(t)||new i(t,e)}constructor(t,e={}){if(!$n(t,"[data-datepicker]"))throw new TypeError("MooDatepicker requires a [data-datepicker] root element.");let s=gi.get(t);if(s)return s;if(this._element=t,this._document=t.ownerDocument,this._window=this._document.defaultView||window,this._listeners=[],this._floatingListeners=[],this._disposed=!1,this._positionPopover=null,this._popoverPortal=null,this._trigger=t.querySelector("[data-datepicker-trigger]"),this._popover=t.querySelector("[data-datepicker-popover]"),this._label=t.querySelector("[data-datepicker-label]"),this._input=t.querySelector("[data-datepicker-input]")||t.querySelector('input[type="hidden"]'),this._validationInput=t.querySelector("[data-datepicker-validation]"),this._calendarRoot=t.querySelector("[data-calendar]"),!this._trigger||!this._popover||!this._label||!this._input||!this._calendarRoot)throw new TypeError("MooDatepicker requires a trigger, popover, calendar, and hidden input.");this._config=Yn(t,{...e,value:e.value||this._input.value||t.dataset.datepickerValue}),this._placeholder=this._config.placeholder,this._defaultValue=this._input.defaultValue||this._input.getAttribute("value")||"",this.calendar=Oe.getOrCreateInstance(this._calendarRoot,{...this._config,mode:"single",value:this._input.value||this._config.value}),gi.set(t,this),this._syncFromCalendar(),this._bindEvents()}dispose(){this._disposed||(this._disposed=!0,oe(this._listeners),this.hide(!1),bs(this),Un(this),oe(this._floatingListeners),this.calendar?.dispose(),gi.get(this._element)===this&&gi.delete(this._element))}show(){this._trigger.disabled||this._element.dataset.datepickerDisabled==="true"||this.isOpen()||gt(this._element,this._window,"show.moo.datepicker",{},!0)&&(this._popover.hidden=!1,this._popover.classList.add("show"),Dr(this),this._trigger.setAttribute("aria-expanded","true"),this.calendar.focusActiveDay(),gt(this._element,this._window,"shown.moo.datepicker"))}hide(t=!0){this.isOpen()&>(this._element,this._window,"hide.moo.datepicker",{},!0)&&(this._popover.hidden=!0,this._popover.classList.remove("show"),bs(this),this._trigger.setAttribute("aria-expanded","false"),t&&this._trigger.focus(),gt(this._element,this._window,"hidden.moo.datepicker"))}toggle(){this.isOpen()?this.hide():this.show()}isOpen(){return!this._popover.hidden}getDate(t=void 0){return this.calendar.getDate(t)}setDate(t,e={}){let s=this.calendar.setDate(t,{emit:!1});return s&&(this._syncFromCalendar(),e.emit!==!1&&this._emitChange()),s}clear(t={}){this.calendar.clear({emit:!1}),this._syncFromCalendar(),t.emit!==!1&&this._emitChange()}_bindEvents(){K(this._listeners,this._trigger,"click",()=>this.toggle()),K(this._listeners,this._popover,"keydown",e=>{e.key==="Escape"&&(e.preventDefault(),this.hide())}),K(this._listeners,this._document,"pointerdown",e=>{this.isOpen()&&!mi(this,e.target)&&this._window.setTimeout(()=>{this.isOpen()&&!mi(this,e.target)&&this.hide()},0)}),K(this._listeners,this._calendarRoot,"change.moo.calendar",e=>{this._syncFromCalendar(),this._emitChange(),e.detail.complete&&this.hide()});let t=this._input.form||this._element.closest("form");K(this._listeners,this._validationInput,"invalid",e=>{e.preventDefault(),Kn(this._element,this._trigger,!0),this._trigger.focus({preventScroll:!0})}),K(this._listeners,t,"reset",()=>{this._window.setTimeout(()=>{this._defaultValue?this.setDate(this._defaultValue,{emit:!1}):this.clear({emit:!1})},0)})}_syncFromCalendar(){let t=this.calendar.getDate("yyyy-mm-dd")||"";jn(this._input,t),kr(this._validationInput,t),Mr(this._element,this._trigger,this._validationInput),this._element.dataset.datepickerValue=t,this._label.textContent=t?Ee(Y(t),this._config.locale):this._placeholder}_emitChange(){gt(this._element,this._window,"change.moo.datepicker",{date:this.getDate(),value:this.getDate("yyyy-mm-dd")||""})}},ys=class i{static getInstance(t){return t?.nodeType===1&&_i.get(t)||null}static getOrCreateInstance(t,e={}){return i.getInstance(t)||new i(t,e)}constructor(t,e={}){if(!$n(t,"[data-datepicker-range]"))throw new TypeError("MooDateRangePicker requires a [data-datepicker-range] root element.");let s=_i.get(t);if(s)return s;if(this._element=t,this._document=t.ownerDocument,this._window=this._document.defaultView||window,this._listeners=[],this._floatingListeners=[],this._disposed=!1,this._positionPopover=null,this._popoverPortal=null,this._trigger=t.querySelector("[data-datepicker-trigger]"),this._popover=t.querySelector("[data-datepicker-popover]"),this._label=t.querySelector("[data-datepicker-label]"),this._startInput=t.querySelector("[data-datepicker-range-start]"),this._endInput=t.querySelector("[data-datepicker-range-end]"),this._validationInput=t.querySelector("[data-datepicker-validation]"),this._calendarRoot=t.querySelector("[data-calendar]"),!this._trigger||!this._popover||!this._label||!this._startInput||!this._endInput||!this._calendarRoot)throw new TypeError("MooDateRangePicker requires a trigger, popover, calendar, and start/end hidden inputs.");this._config=Yn(t,{...e,mode:"range",startValue:e.startValue||this._startInput.value||t.dataset.datepickerStartValue,endValue:e.endValue||this._endInput.value||t.dataset.datepickerEndValue}),this._placeholder=this._config.placeholder,this._defaultStartValue=this._startInput.defaultValue||this._startInput.getAttribute("value")||"",this._defaultEndValue=this._endInput.defaultValue||this._endInput.getAttribute("value")||"",this.calendar=Oe.getOrCreateInstance(this._calendarRoot,this._config),_i.set(t,this),this._syncFromCalendar(),this._bindEvents()}dispose(){this._disposed||(this._disposed=!0,oe(this._listeners),this.hide(!1),bs(this),Un(this),oe(this._floatingListeners),this.calendar?.dispose(),_i.get(this._element)===this&&_i.delete(this._element))}show(){this._trigger.disabled||this._element.dataset.datepickerDisabled==="true"||this.isOpen()||gt(this._element,this._window,"show.moo.datepicker",{},!0)&&(this._popover.hidden=!1,this._popover.classList.add("show"),Dr(this),this._trigger.setAttribute("aria-expanded","true"),this.calendar.focusActiveDay(),gt(this._element,this._window,"shown.moo.datepicker"))}hide(t=!0){this.isOpen()&>(this._element,this._window,"hide.moo.datepicker",{},!0)&&(this._popover.hidden=!0,this._popover.classList.remove("show"),bs(this),this._trigger.setAttribute("aria-expanded","false"),t&&this._trigger.focus(),gt(this._element,this._window,"hidden.moo.datepicker"))}toggle(){this.isOpen()?this.hide():this.show()}isOpen(){return!this._popover.hidden}getDates(t=void 0){return this.calendar.getDates(t)}setDates(t,e,s={}){let n=this.calendar.setDates(t,e,{emit:!1});return n&&(this._syncFromCalendar(),s.emit!==!1&&this._emitChange()),n}clear(t={}){this.calendar.clear({emit:!1}),this._syncFromCalendar(),t.emit!==!1&&this._emitChange()}_bindEvents(){K(this._listeners,this._trigger,"click",()=>this.toggle()),K(this._listeners,this._popover,"keydown",s=>{s.key==="Escape"&&(s.preventDefault(),this.hide())}),K(this._listeners,this._document,"pointerdown",s=>{this.isOpen()&&!mi(this,s.target)&&this._window.setTimeout(()=>{this.isOpen()&&!mi(this,s.target)&&this.hide()},0)});let t=()=>{this._window.setTimeout(()=>{this.isOpen()&&!mi(this,this._document.activeElement)&&this.hide(!1)},0)};K(this._listeners,this._element,"focusout",t),K(this._listeners,this._popover,"focusout",t),K(this._listeners,this._calendarRoot,"change.moo.calendar",s=>{this._syncFromCalendar(),this._emitChange(),s.detail.complete?this.hide():this.calendar.focusActiveDay()});let e=this._startInput.form||this._element.closest("form");K(this._listeners,this._validationInput,"invalid",s=>{s.preventDefault(),Kn(this._element,this._trigger,!0),this._trigger.focus({preventScroll:!0})}),K(this._listeners,e,"reset",()=>{this._window.setTimeout(()=>{this.setDates(this._defaultStartValue,this._defaultEndValue,{emit:!1})},0)})}_syncFromCalendar(){let[t="",e=""]=this.calendar.getDates("yyyy-mm-dd");jn(this._startInput,t||""),jn(this._endInput,e||""),kr(this._validationInput,t&&e?`${t} - ${e}`:""),Mr(this._element,this._trigger,this._validationInput),this._element.dataset.datepickerStartValue=t||"",this._element.dataset.datepickerEndValue=e||"",t&&e?this._label.textContent=`${Ee(Y(t),this._config.locale)} - ${Ee(Y(e),this._config.locale)}`:t?this._label.textContent=Ee(Y(t),this._config.locale):this._label.textContent=this._placeholder}_emitChange(){let[t,e]=this.getDates(),[s="",n=""]=this.getDates("yyyy-mm-dd");gt(this._element,this._window,"change.moo.datepicker",{startDate:t,endDate:e,startValue:s,endValue:n})}};var xs=new WeakMap,yi=class i{static getInstance(t){return t?.nodeType===1&&xs.get(t)||null}static getOrCreateInstance(t,e={}){return i.getInstance(t)||new i(t,e)}constructor(t,e={}){if(t?.nodeType!==1||!t.matches('[data-slot="sidebar-wrapper"]'))throw new TypeError("Sidebar requires a [data-slot=sidebar-wrapper] root.");let s=xs.get(t);if(s)return s;this._element=t,this._document=t.ownerDocument,this._window=this._document.defaultView,this._root=this._document.documentElement,this._sidebar=t.querySelector('[data-slot="sidebar"]'),this._config={breakpoint:"(min-width: 992px)",storagePrefix:"moo-sidebar:",keyboard:!0,...e},this._listeners=[],this._tooltipAnchors=new Set,this._flyout=null,this._flyoutOwner=null,this._offcanvas=null,this._offcanvasTrigger=null,xs.set(t,this),this._bindEvents(),this._restoreState(),this._scrollActiveItemIntoView(),this._element.setAttribute("data-sidebar-ready",""),this._observeDirection()}dispose(){this._listeners.forEach(({target:t,type:e,handler:s,options:n})=>{t.removeEventListener(e,s,n)}),this._listeners=[],this._directionObserver?.disconnect(),this._closeFlyouts(),this._element.querySelectorAll("[data-sidebar-dropdown-positioned]").forEach(t=>this._clearDropdownPosition(t)),this._element.querySelectorAll("[data-sidebar-tooltip]").forEach(t=>this._disposeTooltip(t)),this._offcanvas?.dispose(),this._offcanvas=null,this._offcanvasTrigger=null,this._element.removeAttribute("data-sidebar-ready"),xs.delete(this._element)}_listen(t,e,s,n){t?.addEventListener(e,s,n),t&&this._listeners.push({target:t,type:e,handler:s,options:n})}_bootstrap(t){return this._window.bootstrap?.[t]||null}_isDesktop(){return this._window.matchMedia(this._config.breakpoint).matches}_isCollapsed(){return this._isDesktop()&&this._element.dataset.sidebarState==="collapsed"}_trigger(t,e={}){return this._element.dispatchEvent(new this._window.CustomEvent(`${t}.moo.sidebar`,{bubbles:!0,cancelable:t==="show"||t==="hide",detail:e}))}_observeDirection(){let t=this._window.MutationObserver;t&&(this._directionObserver=new t(()=>{this._closeFlyouts(),this._syncTooltips()}),this._directionObserver.observe(this._root,{attributes:!0,attributeFilter:["dir"]}))}_restoreState(){let t=this._element.dataset.sidebarKey,e=null;if(t)try{e=this._window.localStorage.getItem(this._config.storagePrefix+t)}catch{e=null}let s=e==="collapsed"||e==="expanded"?e:this._element.dataset.sidebarState==="collapsed"?"collapsed":"expanded";this._setState(s,!1,!1)}_scrollActiveItemIntoView(){let e=this._element.querySelector('[data-slot="sidebar-content"] a[data-slot="sidebar-menu-button"][aria-current="page"], [data-slot="sidebar-content"] a.sidebar-menu-button[aria-current="page"], [data-slot="sidebar-content"] a.sidebar-menu-button.active')||this._element.querySelector('[data-slot="sidebar-content"] [data-slot="sidebar-menu-button"][aria-current="page"], [data-slot="sidebar-content"] .sidebar-menu-button[aria-current="page"], [data-slot="sidebar-content"] .sidebar-menu-button.active'),s=e?.closest?.('[data-slot="sidebar-content"]');if(!e||!s||s.clientHeight<=0)return;let n=s.scrollHeight-s.clientHeight;if(n<=0)return;let o=s.getBoundingClientRect(),a=e.getBoundingClientRect();if(o.height<=0||a.height<=0)return;let r=s.scrollTop+a.top-o.top-(s.clientHeight-a.height)/2;s.scrollTop=Math.round(Math.min(Math.max(r,0),n))}_setState(t,e=!0,s=!0){let n=t==="collapsed"?"collapsed":"expanded",o=this._element.dataset.sidebarState;this._element.dataset.sidebarState=n;let a=this._element.dataset.sidebarKey;if(a==="catalog-shell"&&(this._root.dataset.sidebarCatalogState=n),e&&a)try{this._window.localStorage.setItem(this._config.storagePrefix+a,n)}catch{}this._syncControls(),n==="expanded"&&this._element.querySelectorAll(".sidebar-menu-item").forEach(r=>this._resetFlyoutTrigger(r)),this._syncTooltips(),s&&o!==n&&this._trigger("change",{state:n,previousState:o||null})}_toggle(){this._setState(this._element.dataset.sidebarState==="collapsed"?"expanded":"collapsed")}_syncControls(){let t=this._isDesktop()?this._element.dataset.sidebarState==="expanded":this._sidebar?.classList.contains("show")||!1;this._element.querySelectorAll("[data-sidebar-trigger], [data-sidebar-rail]").forEach(e=>e.setAttribute("aria-expanded",String(t)))}_resetFlyoutTrigger(t,e=null){let s=t?.querySelector(":scope > .sidebar-menu-sub-trigger"),n=t?.querySelector(":scope > .sidebar-menu-sub");s&&n&&s.setAttribute("aria-expanded",String(e??n.classList.contains("show")))}_clearDropdownPosition(t){let e=t?.matches?.(".sidebar-menu-item")?t:t?.closest?.(".sidebar-menu-item");e&&(delete e.dataset.sidebarDropdownPositioned,e.style.removeProperty("--moo-sidebar-dropdown-block-start"),e.style.removeProperty("--moo-sidebar-dropdown-inline-start"))}_closeDropdowns(t=null){let e=this._bootstrap("Dropdown");this._element.querySelectorAll('[data-bs-toggle="dropdown"][aria-expanded="true"]').forEach(s=>{s!==t&&(e?e.getOrCreateInstance(s).hide():(s.setAttribute("aria-expanded","false"),s.closest(".dropdown")?.querySelector(".dropdown-menu.show")?.classList.remove("show"),this._clearDropdownPosition(s)))})}_positionDropdown(t){let e=t?.closest?.(".sidebar-menu-item"),s=t?.classList.contains("sidebar-menu-button--workspace")&&t.closest('[data-slot="sidebar-header"]');if(!t||!e||!s||!this._isDesktop()){this._clearDropdownPosition(t);return}this._closeFlyouts();let n=t.getBoundingClientRect(),o=4,a=this._root.dir==="rtl"?this._window.innerWidth-n.left+o:n.right+o;e.style.setProperty("--moo-sidebar-dropdown-block-start",`${Math.round(n.bottom+o)}px`),e.style.setProperty("--moo-sidebar-dropdown-inline-start",`${Math.round(a)}px`),e.dataset.sidebarDropdownPositioned=""}_removeFlyoutPortal(){this._flyout?.remove(),this._flyoutOwner&&this._resetFlyoutTrigger(this._flyoutOwner,!1),this._flyout=null,this._flyoutOwner=null}_closeFlyouts(){this._removeFlyoutPortal(),this._element.querySelectorAll(".sidebar-menu-item--flyout-open").forEach(t=>{t.classList.remove("sidebar-menu-item--flyout-open"),t.style.removeProperty("--moo-sidebar-flyout-block-start"),t.style.removeProperty("--moo-sidebar-flyout-inline-start"),this._resetFlyoutTrigger(t,!1)})}_openFlyout(t){let e=t?.querySelector(":scope > .sidebar-menu-sub"),s=t?.querySelector(":scope > .sidebar-menu-sub-trigger");if(!t||!e||!this._isCollapsed()||this._flyoutOwner===t&&this._flyout)return;this._closeDropdowns(),this._closeFlyouts();let n=t.getBoundingClientRect(),o=4,a=this._root.dir==="rtl"?this._window.innerWidth-n.left+o:n.right+o,r=e.cloneNode(!0);r.removeAttribute("id"),r.classList.remove("collapse","show","collapsing"),r.classList.add("sidebar-menu-flyout"),r.dataset.sidebarFlyout="",r.removeAttribute("style"),r.style.setProperty("--moo-sidebar-flyout-block-start",`${Math.round(n.top)}px`),r.style.setProperty("--moo-sidebar-flyout-inline-start",`${Math.round(a)}px`),(this._element.closest(".moo-ui")||this._document.body).appendChild(r),this._flyout=r,this._flyoutOwner=t,t.classList.add("sidebar-menu-item--flyout-open"),s?.setAttribute("aria-expanded","true")}_tooltipAnchor(t){return t.closest("li")||t}_isIdentityTrigger(t){return t.closest(".sidebar-menu-item--account")||t.classList.contains("sidebar-menu-button--workspace")}_disposeTooltip(t){let e=this._bootstrap("Tooltip");if(!e||!t)return;let s=this._tooltipAnchor(t);e.getInstance(s)?.dispose(),this._tooltipAnchors.delete(s),s.removeAttribute("title"),s.removeAttribute("data-bs-title"),s.removeAttribute("data-bs-original-title"),s.removeAttribute("aria-describedby")}_syncTooltips(){let t=this._bootstrap("Tooltip");if(!t)return;let e=this._isCollapsed(),s=this._root.dir==="rtl"?"left":"right";this._element.querySelectorAll("[data-sidebar-tooltip]").forEach(n=>{if(this._disposeTooltip(n),!e||this._isIdentityTrigger(n)||n.closest(".sidebar-menu-item")?.querySelector(":scope > .sidebar-menu-sub"))return;let o=this._tooltipAnchor(n);new t(o,{title:n.getAttribute("data-sidebar-tooltip"),placement:s,container:"body",trigger:"hover focus"}),this._tooltipAnchors.add(o)})}_bindEvents(){this._listen(this._sidebar,"shown.bs.offcanvas",()=>this._syncControls()),this._listen(this._sidebar,"hidden.bs.offcanvas",()=>{this._syncControls();let t=this._offcanvasTrigger;this._offcanvasTrigger=null,t?.isConnected&&t.focus()}),this._listen(this._document,"show.bs.dropdown",t=>{let e=this._dropdownControl(t.target);e&&(this._closeDropdowns(e),this._disposeTooltip(e),this._positionDropdown(e))}),this._listen(this._document,"hidden.bs.dropdown",t=>{let e=this._dropdownControl(t.target);e&&(this._clearDropdownPosition(e),this._syncTooltips())}),this._listen(this._element,"click",t=>this._handleControlClick(t)),this._listen(this._window,"click",t=>this._handleSubmenuClick(t),!0),this._listen(this._document,"click",t=>this._handleOutsideFlyoutClick(t)),this._listen(this._document,"keydown",t=>this._handleShortcut(t)),this._listen(this._window,"resize",()=>{this._closeFlyouts(),this._element.querySelectorAll("[data-sidebar-dropdown-positioned]").forEach(t=>this._clearDropdownPosition(t)),this._syncControls(),this._syncTooltips()})}_dropdownControl(t){return!(t instanceof this._window.Element)||!this._element.contains(t)?null:t.matches('[data-bs-toggle="dropdown"][data-sidebar-tooltip]')?t:t.querySelector?.('[data-bs-toggle="dropdown"][data-sidebar-tooltip]')||null}_handleControlClick(t){let e=t.target,s=e instanceof this._window.Element?e.closest("[data-sidebar-trigger], [data-sidebar-rail]"):null;if(!s||!this._element.contains(s))return;if(this._isDesktop()){t.preventDefault(),this._closeFlyouts(),this._toggle();return}if(!s.matches("[data-sidebar-trigger]"))return;let n=this._document.getElementById(s.getAttribute("aria-controls")),o=this._bootstrap("Offcanvas");n&&o&&(this._offcanvasTrigger=s,this._offcanvas=o.getOrCreateInstance(n),this._offcanvas.toggle())}_handleSubmenuClick(t){let e=t.target,s=e instanceof this._window.Element?e.closest(".sidebar-menu-sub-trigger"):null,n=s?.closest(".sidebar-menu-item");!s||!n||!this._element.contains(n)||!this._isCollapsed()||(t.preventDefault(),t.stopImmediatePropagation(),this._flyoutOwner===n&&this._flyout?this._closeFlyouts():this._openFlyout(n))}_handleOutsideFlyoutClick(t){this._flyout&&(this._flyout.contains(t.target)?this._closeFlyouts():this._flyoutOwner?.contains(t.target)||this._closeFlyouts())}_handleShortcut(t){let e=t.target,s=e instanceof this._window.Element&&(e.matches("input, textarea, select")||e.isContentEditable);t.defaultPrevented||t.isComposing||s||!this._config.keyboard||!(t.metaKey||t.ctrlKey)||t.key.toLowerCase()!=="b"||!this._isDesktop()||(this._document.querySelector('[data-slot="sidebar-wrapper"][data-sidebar-key]')||this._document.querySelector('[data-slot="sidebar-wrapper"]'))!==this._element||(t.preventDefault(),this._closeFlyouts(),this._toggle())}};var xi=new WeakMap;function Si(i,t){let e=Number(i);return Number.isFinite(e)?e:t}function Fe(i){return Si(i.min,0)}function vi(i){return Si(i.max,100)}function ju(i){if(!i.step||i.step==="any")return 1;let t=Number(i.step);return Number.isFinite(t)&&t>0?t:1}function Te(i,t,e){return Math.min(Math.max(i,t),e)}function Cr(i){let t=String(i);return t.includes(".")?t.split(".").at(-1).length:0}function $u(i,t){let e=Fe(t),s=vi(t);if(t.step==="any")return Number(Te(i,e,s).toFixed(4));let n=ju(t),o=e+Math.round((i-e)/n)*n,a=Math.max(Cr(n),Cr(e));return Te(Number(o.toFixed(a)),e,s)}function wi(i){let t=Fe(i),e=vi(i);return e<=t?0:(Si(i.value,t)-t)/(e-t)*100}function ws(i){return i.value||String(Fe(i))}var ki=class i{static getInstance(t){return t?.nodeType===1&&xi.get(t)||null}static getOrCreateInstance(t,e={}){return i.getInstance(t)||new i(t,e)}constructor(t,e={}){if(t?.nodeType!==1||!t.matches("[data-slider]"))throw new TypeError("MooSlider requires a [data-slider] root element.");let s=xi.get(t);if(s)return s;if(this._element=t,this._document=t.ownerDocument,this._window=this._document.defaultView,this._config={...e},this._listeners=[],this._dragListeners=[],this._draggingInput=null,this._disposed=!1,this._inputs=Array.from(t.querySelectorAll(':scope input[type="range"][data-slider-input]')),this._track=t.querySelector("[data-slider-track]"),this._output=t.querySelector("[data-slider-output]"),this._inputs.length<1||this._inputs.length>2)throw new TypeError("MooSlider requires one or two native range inputs.");if(!this._track)throw new TypeError("MooSlider requires a [data-slider-track] element.");xi.set(t,this),this._bindEvents(),this._sync()}dispose(){this._disposed||(this._disposed=!0,this._clearDragListeners(),this._clearPointerFocus(),this._listeners.forEach(({target:t,type:e,handler:s,options:n})=>{t.removeEventListener(e,s,n)}),this._listeners=[],xi.get(this._element)===this&&xi.delete(this._element))}_listen(t,e,s,n){t&&(t.addEventListener(e,s,n),this._listeners.push({target:t,type:e,handler:s,options:n}))}_listenDuringDrag(t,e,s,n){t&&(t.addEventListener(e,s,n),this._dragListeners.push({target:t,type:e,handler:s,options:n}))}_clearDragListeners(){this._dragListeners.forEach(({target:t,type:e,handler:s,options:n})=>{t.removeEventListener(e,s,n)}),this._dragListeners=[],this._draggingInput=null,this._element.removeAttribute("data-slider-dragging")}_bindEvents(){this._inputs.forEach(e=>{this._listen(e,"input",()=>this._sync(e)),this._listen(e,"change",()=>{this._sync(e),this._trigger("change")}),this._listen(e,"keydown",()=>this._clearPointerFocus()),this._listen(e,"focusout",()=>this._clearPointerFocus())}),new Set(this._inputs.map(e=>e.form||e.closest?.("form")).filter(Boolean)).forEach(e=>{this._listen(e,"reset",()=>{this._window.setTimeout(()=>this._sync(),0)})}),this._listen(this._track,"pointerdown",e=>this._handleTrackPointer(e))}_trigger(t){this._element.dispatchEvent(new this._window.CustomEvent(`${t}.moo.slider`,{bubbles:!0}))}_isRange(){return this._inputs.length===2}_sync(t=null){if(this._isRange()){let[s,n]=this._inputs,o=Si(s.value,Fe(s)),a=Si(n.value,vi(n));o>a&&(t===n?n.value=s.value:s.value=n.value),this._writeFill(wi(s),wi(n)),this._writeOutput(`${ws(s)} - ${ws(n)}`),this._syncAria(s),this._syncAria(n);return}let e=this._inputs[0];this._writeFill(0,wi(e)),this._writeOutput(ws(e)),this._syncAria(e)}_syncAria(t){t.setAttribute("aria-valuemin",String(Fe(t))),t.setAttribute("aria-valuemax",String(vi(t))),t.setAttribute("aria-valuenow",ws(t))}_writeFill(t,e){let s=Te(t,0,100),n=Te(e,0,100);this._element.style.setProperty("--moo-slider-start",`${Math.min(s,n)}%`),this._element.style.setProperty("--moo-slider-end",`${Math.max(s,n)}%`)}_writeOutput(t){this._output&&(this._output.textContent=t)}_handleTrackPointer(t){if(t.button!==void 0&&t.button!==0)return;let e=this._inputs.filter(o=>!o.disabled);if(!e.length)return;t.preventDefault?.();let s=this._pointerPercent(t),n=this._nearestInput(s*100,e);this._setPointerFocus(),this._startDrag(n,t),this._setInputFromPointer(n,t)}_setPointerFocus(){this._element.setAttribute("data-slider-pointer-focus","true")}_clearPointerFocus(){this._element.removeAttribute("data-slider-pointer-focus")}_startDrag(t,e){this._clearDragListeners(),this._draggingInput=t,this._element.setAttribute("data-slider-dragging","true"),this._track.setPointerCapture?.(e.pointerId);let s=e.pointerId,n=r=>s===void 0||r.pointerId===s,o=r=>{!n(r)||this._draggingInput!==t||(r.preventDefault?.(),this._setInputFromPointer(t,r))},a=r=>{!n(r)||this._draggingInput!==t||(r.preventDefault?.(),this._setInputFromPointer(t,r,!1),t.dispatchEvent(new this._window.Event("change",{bubbles:!0})),this._track.releasePointerCapture?.(s),this._clearDragListeners())};this._listenDuringDrag(this._document,"pointermove",o),this._listenDuringDrag(this._document,"pointerup",a),this._listenDuringDrag(this._document,"pointercancel",a)}_setInputFromPointer(t,e,s=!0){let n=this._pointerPercent(e),o=Fe(t),a=vi(t);t.value=String($u(o+n*(a-o),t)),t.focus({preventScroll:!0}),this._sync(t),s&&t.dispatchEvent(new this._window.Event("input",{bubbles:!0}))}_pointerPercent(t){let e=this._track.getBoundingClientRect();return(this._element.dataset.sliderOrientation||"horizontal")==="vertical"?Te((e.bottom-t.clientY)/(e.height||1),0,1):this._horizontalPointerPercent(t,e)}_horizontalPointerPercent(t,e){let n=this._window.getComputedStyle?.(this._element).direction==="rtl"?e.right-t.clientX:t.clientX-e.left;return Te(n/(e.width||1),0,1)}_nearestInput(t,e){if(e.length===1)return e[0];let[s,n]=e,o=wi(s),a=wi(n),r=Math.abs(o-t),l=Math.abs(a-t);return r===l?t>=o?n:s:l<r?n:s}};var Yu={Chart:hi,Combobox:di,ContextMenu:ui,DataTable:fi,Datepicker:bi,MooCalendar:Oe,MooDateRangePicker:ys,Sidebar:yi,Slider:ki};var xf=Yu;export{hi as Chart,di as Combobox,ui as ContextMenu,fi as DataTable,bi as Datepicker,Oe as MooCalendar,ys as MooDateRangePicker,yi as Sidebar,ki as Slider,xf as default};
|
|
9
|
+
/*! Bundled license information:
|
|
10
|
+
|
|
11
|
+
@kurkle/color/dist/color.esm.js:
|
|
12
|
+
(*!
|
|
13
|
+
* @kurkle/color v0.3.4
|
|
14
|
+
* https://github.com/kurkle/color#readme
|
|
15
|
+
* (c) 2024 Jukka Kurkela
|
|
16
|
+
* Released under the MIT License
|
|
17
|
+
*)
|
|
18
|
+
|
|
19
|
+
chart.js/dist/chunks/helpers.dataset.js:
|
|
20
|
+
chart.js/dist/chart.js:
|
|
21
|
+
(*!
|
|
22
|
+
* Chart.js v4.5.1
|
|
23
|
+
* https://www.chartjs.org
|
|
24
|
+
* (c) 2025 Chart.js Contributors
|
|
25
|
+
* Released under the MIT License
|
|
26
|
+
*)
|
|
27
|
+
*/
|