import{a as Ys}from"./chunk-Q3D5PUAM.js";import{h as js}from"./chunk-KYFYXE3K.js";import{P as Bs,T as Vs,U as ye,V as Ns}from"./chunk-BJVL6ZJ5.js";import{a as $s}from"./chunk-KLZQNCJY.js";import{E as te,F as ti,a as Is,g as Fs,o as zs}from"./chunk-7JTNILXC.js";import{H as ei}from"./chunk-CUOYDGDO.js";import{a as Ws}from"./chunk-TTJW756Y.js";import{$ as rs,Da as st,Db as ys,Ec as xt,Hb as qe,Ja as Wi,Jb as rt,Kb as vs,Lb as $i,Ld as Rs,Mc as Ls,Md as Es,Na as Pt,Ng as ii,Oa as fs,Qd as Qe,Sa as gs,Ta as ps,Tb as _e,Ua as Xe,Wb as Ms,Xb as Cs,Y as ss,Yb as xe,Z as os,Zb as Yi,_ as as,_b as ws,_c as Ds,ba as _t,cb as ms,cc as Ss,dc as ks,ec as Ps,fd as Je,gb as Ze,hb as Ke,hd as As,jb as bs,kb as _s,kc as Ge,lb as xs,lc as Os,mb as ot,na as ls,nb as U,oa as cs,ob as J,pb as Ht,sa as hs,ua as ds,vb as ji,vh as Hs,xc as Ui,za as us,zd as Ts}from"./chunk-NY4TI4KT.js";import{a as Ye,b as Ue,e as ur,i as w}from"./chunk-IQVXR75E.js";var dr=ur((Qu,su)=>{su.exports=`<svg width="216" height="271" viewBox="0 0 216 271" fill="none" xmlns="http://www.w3.org/2000/svg">
    <path fill-rule="evenodd" clip-rule="evenodd" d="M-10.2515 23.1156V-23.002L25.1602 0.0568237L-10.2515 23.1156Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M-10.2515 69.2328V23.1152L25.1602 46.174L-10.2515 69.2328Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M25.1618 46.1742V0.0566406L59.75 23.1154L25.1618 46.1742Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M24.75 98V46L59.75 72L24.75 98Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M59.7494 23.1136V-23.0039L95.1611 0.0548706L59.7494 23.1136Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M59.7494 69.2328V23.1152L95.1611 46.174L59.7494 69.2328Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M95.1638 46.1742V0.0566406L129.752 23.1154L95.1638 46.1742Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M129.75 23.1136V-23.0039L165.162 0.0548706L129.75 23.1136Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M129.75 69.2328V23.1152L165.162 46.174L129.75 69.2328Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M165.161 46.1742V0.0566406L199.749 23.1154L165.161 46.1742Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M199.75 23.1156V-23.002L235.162 0.0568237L199.75 23.1156Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M199.75 69.2347V23.1172L235.162 46.176L199.75 69.2347Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M-10.2515 121.121V75.0039L25.1602 98.0627L-10.2515 121.121Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M-10.2515 167.239V121.121L25.1602 144.18L-10.2515 167.239Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M25.1618 144.18V98.0625L59.75 121.121L25.1618 144.18Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M59.7494 121.121V75.0039L95.1611 98.0627L59.7494 121.121Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M59.7494 167.239V121.121L95.1611 144.18L59.7494 167.239Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M95.1638 144.18V98.0625L129.752 121.121L95.1638 144.18Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M129.75 121.121V75.0039L165.162 98.0627L129.75 121.121Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M129.75 167.239V121.121L165.162 144.18L129.75 167.239Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M165.161 144.18V98.0625L199.749 121.121L165.161 144.18Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M199.75 121.121V75.0039L235.162 98.0627L199.75 121.121Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M199.75 167.239V121.121L235.162 144.18L199.75 167.239Z" fill="currentColor" />

    <path fill-rule="evenodd" clip-rule="evenodd" d="M-10.2515 121.116V74.998L25.1602 98.0568L-10.2515 121.116Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M-10.2515 167.233V121.115L25.1602 144.174L-10.2515 167.233Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M25.1618 144.174V98.0566L59.75 121.115L25.1618 144.174Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M59.7494 121.114V74.9961L95.1611 98.0549L59.7494 121.114Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M59.7494 167.233V121.115L95.1611 144.174L59.7494 167.233Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M95.1638 144.174V98.0566L129.752 121.115L95.1638 144.174Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M129.75 121.114V74.9961L165.162 98.0549L129.75 121.114Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M129.75 167.233V121.115L165.162 144.174L129.75 167.233Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M165.161 144.174V98.0566L199.749 121.115L165.161 144.174Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M199.75 121.116V74.998L235.162 98.0568L199.75 121.116Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M199.75 167.235V121.117L235.162 144.176L199.75 167.235Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M-10.2515 219.121V173.004L25.1602 196.063L-10.2515 219.121Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M-10.2515 265.239V219.121L25.1602 242.18L-10.2515 265.239Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M25.1618 242.18V196.062L59.75 219.121L25.1618 242.18Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M59.7494 219.121V173.004L95.1611 196.063L59.7494 219.121Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M59.7494 265.239V219.121L95.1611 242.18L59.7494 265.239Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M95.1638 242.18V196.062L129.752 219.121L95.1638 242.18Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M129.75 219.121V173.004L165.162 196.063L129.75 219.121Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M129.75 265.239V219.121L165.162 242.18L129.75 265.239Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M165.161 242.18V196.062L199.749 219.121L165.161 242.18Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M199.75 219.121V173.004L235.162 196.063L199.75 219.121Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M199.75 265.239V219.121L235.162 242.18L199.75 265.239Z" fill="currentColor" />

    <path fill-rule="evenodd" clip-rule="evenodd" d="M95.75 98V46L130.75 72L95.75 98Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M164.75 98V46L199.75 72L164.75 98Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M95.75 199V147L130.75 173L95.75 199Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M26.75 199V147L61.75 173L26.75 199Z" fill="currentColor" />
    <path fill-rule="evenodd" clip-rule="evenodd" d="M164.75 199V147L199.75 173L164.75 199Z" fill="currentColor" />
  </svg>
`;});function Ce(e){return e+.5|0;}var Ot=(e,i,t)=>Math.max(Math.min(e,t),i);function ve(e){return Ot(Ce(e*2.55),0,255);}function Lt(e){return Ot(Ce(e*255),0,255);}function yt(e){return Ot(Ce(e/2.55)/100,0,1);}function Us(e){return Ot(Ce(e*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},Zi=[..."0123456789ABCDEF"],fr=e=>Zi[e&15],gr=e=>Zi[(e&240)>>4]+Zi[e&15],ni=e=>(e&240)>>4===(e&15),pr=e=>ni(e.r)&&ni(e.g)&&ni(e.b)&&ni(e.a);function mr(e){var i=e.length,t;return e[0]==="#"&&(i===4||i===5?t={r:255&lt[e[1]]*17,g:255&lt[e[2]]*17,b:255&lt[e[3]]*17,a:i===5?lt[e[4]]*17:255}:(i===7||i===9)&&(t={r:lt[e[1]]<<4|lt[e[2]],g:lt[e[3]]<<4|lt[e[4]],b:lt[e[5]]<<4|lt[e[6]],a:i===9?lt[e[7]]<<4|lt[e[8]]:255})),t;}var br=(e,i)=>e<255?i(e):"";function _r(e){var i=pr(e)?fr:gr;return e?"#"+i(e.r)+i(e.g)+i(e.b)+br(e.a,i):void 0;}var xr=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function qs(e,i,t){let n=i*Math.min(t,1-t),s=(o,a=(o+e/30)%12)=>t-n*Math.max(Math.min(a-3,9-a,1),-1);return[s(0),s(8),s(4)];}function yr(e,i,t){let n=(s,o=(s+e/60)%6)=>t-t*i*Math.max(Math.min(o,4-o,1),0);return[n(5),n(3),n(1)];}function vr(e,i,t){let n=qs(e,1,.5),s;for(i+t>1&&(s=1/(i+t),i*=s,t*=s),s=0;s<3;s++)n[s]*=1-i-t,n[s]+=i;return n;}function Mr(e,i,t,n,s){return e===s?(i-t)/n+(i<t?6:0):i===s?(t-e)/n+2:(e-i)/n+4;}function Ki(e){let t=e.r/255,n=e.g/255,s=e.b/255,o=Math.max(t,n,s),a=Math.min(t,n,s),r=(o+a)/2,l,c,h;return o!==a&&(h=o-a,c=r>.5?h/(2-o-a):h/(o+a),l=Mr(t,n,s,h,o),l=l*60+.5),[l|0,c||0,r];}function qi(e,i,t,n){return(Array.isArray(i)?e(i[0],i[1],i[2]):e(i,t,n)).map(Lt);}function Gi(e,i,t){return qi(qs,e,i,t);}function Cr(e,i,t){return qi(vr,e,i,t);}function wr(e,i,t){return qi(yr,e,i,t);}function Gs(e){return(e%360+360)%360;}function Sr(e){let i=xr.exec(e),t=255,n;if(!i)return;i[5]!==n&&(t=i[6]?ve(+i[5]):Lt(+i[5]));let s=Gs(+i[2]),o=+i[3]/100,a=+i[4]/100;return i[1]==="hwb"?n=Cr(s,o,a):i[1]==="hsv"?n=wr(s,o,a):n=Gi(s,o,a),{r:n[0],g:n[1],b:n[2],a:t};}function kr(e,i){var t=Ki(e);t[0]=Gs(t[0]+i),t=Gi(t),e.r=t[0],e.g=t[1],e.b=t[2];}function Pr(e){if(!e)return;let i=Ki(e),t=i[0],n=Us(i[1]),s=Us(i[2]);return e.a<255?`hsla(${t}, ${n}%, ${s}%, ${yt(e.a)})`:`hsl(${t}, ${n}%, ${s}%)`;}var Xs={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"},Zs={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 Or(){let e={},i=Object.keys(Zs),t=Object.keys(Xs),n,s,o,a,r;for(n=0;n<i.length;n++){for(a=r=i[n],s=0;s<t.length;s++)o=t[s],r=r.replace(o,Xs[o]);o=parseInt(Zs[a],16),e[r]=[o>>16&255,o>>8&255,o&255];}return e;}var si;function Lr(e){si||(si=Or(),si.transparent=[0,0,0,0]);let i=si[e.toLowerCase()];return i&&{r:i[0],g:i[1],b:i[2],a:i.length===4?i[3]:255};}var Dr=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Ar(e){let i=Dr.exec(e),t=255,n,s,o;if(i){if(i[7]!==n){let a=+i[7];t=i[8]?ve(a):Ot(a*255,0,255);}return n=+i[1],s=+i[3],o=+i[5],n=255&(i[2]?ve(n):Ot(n,0,255)),s=255&(i[4]?ve(s):Ot(s,0,255)),o=255&(i[6]?ve(o):Ot(o,0,255)),{r:n,g:s,b:o,a:t};}}function Tr(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${yt(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`);}var Xi=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,ee=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function Rr(e,i,t){let n=ee(yt(e.r)),s=ee(yt(e.g)),o=ee(yt(e.b));return{r:Lt(Xi(n+t*(ee(yt(i.r))-n))),g:Lt(Xi(s+t*(ee(yt(i.g))-s))),b:Lt(Xi(o+t*(ee(yt(i.b))-o))),a:e.a+t*(i.a-e.a)};}function oi(e,i,t){if(e){let n=Ki(e);n[i]=Math.max(0,Math.min(n[i]+n[i]*t,i===0?360:1)),n=Gi(n),e.r=n[0],e.g=n[1],e.b=n[2];}}function Js(e,i){return e&&Object.assign(i||{},e);}function Ks(e){var i={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(i={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(i.a=Lt(e[3]))):(i=Js(e,{r:0,g:0,b:0,a:1}),i.a=Lt(i.a)),i;}function Er(e){return e.charAt(0)==="r"?Ar(e):Sr(e);}var Me=class e{constructor(i){if(i instanceof e)return i;let t=typeof i,n;t==="object"?n=Ks(i):t==="string"&&(n=mr(i)||Lr(i)||Er(i)),this._rgb=n,this._valid=!!n;}get valid(){return this._valid;}get rgb(){var i=Js(this._rgb);return i&&(i.a=yt(i.a)),i;}set rgb(i){this._rgb=Ks(i);}rgbString(){return this._valid?Tr(this._rgb):void 0;}hexString(){return this._valid?_r(this._rgb):void 0;}hslString(){return this._valid?Pr(this._rgb):void 0;}mix(i,t){if(i){let n=this.rgb,s=i.rgb,o,a=t===o?.5:t,r=2*a-1,l=n.a-s.a,c=((r*l===-1?r:(r+l)/(1+r*l))+1)/2;o=1-c,n.r=255&c*n.r+o*s.r+.5,n.g=255&c*n.g+o*s.g+.5,n.b=255&c*n.b+o*s.b+.5,n.a=a*n.a+(1-a)*s.a,this.rgb=n;}return this;}interpolate(i,t){return i&&(this._rgb=Rr(this._rgb,i._rgb,t)),this;}clone(){return new e(this.rgb);}alpha(i){return this._rgb.a=Lt(i),this;}clearer(i){let t=this._rgb;return t.a*=1-i,this;}greyscale(){let i=this._rgb,t=Ce(i.r*.3+i.g*.59+i.b*.11);return i.r=i.g=i.b=t,this;}opaquer(i){let t=this._rgb;return t.a*=1+i,this;}negate(){let i=this._rgb;return i.r=255-i.r,i.g=255-i.g,i.b=255-i.b,this;}lighten(i){return oi(this._rgb,2,i),this;}darken(i){return oi(this._rgb,2,-i),this;}saturate(i){return oi(this._rgb,1,i),this;}desaturate(i){return oi(this._rgb,1,-i),this;}rotate(i){return kr(this._rgb,i),this;}};function gt(){}var co=(()=>{let e=0;return()=>e++;})();function D(e){return e==null;}function z(e){if(Array.isArray&&Array.isArray(e))return!0;let i=Object.prototype.toString.call(e);return i.slice(0,7)==="[object"&&i.slice(-6)==="Array]";}function A(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]";}function H(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e);}function tt(e,i){return H(e)?e:i;}function P(e,i){return typeof e>"u"?i:e;}var ho=(e,i)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/i,en=(e,i)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*i:+e;function F(e,i,t){if(e&&typeof e.call=="function")return e.apply(t,i);}function E(e,i,t,n){let s,o,a;if(z(e)){if(o=e.length,n)for(s=o-1;s>=0;s--)i.call(t,e[s],s);else for(s=0;s<o;s++)i.call(t,e[s],s);}else if(A(e))for(a=Object.keys(e),o=a.length,s=0;s<o;s++)i.call(t,e[a[s]],a[s]);}function ke(e,i){let t,n,s,o;if(!e||!i||e.length!==i.length)return!1;for(t=0,n=e.length;t<n;++t)if(s=e[t],o=i[t],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0;}function ci(e){if(z(e))return e.map(ci);if(A(e)){let i=Object.create(null),t=Object.keys(e),n=t.length,s=0;for(;s<n;++s)i[t[s]]=ci(e[t[s]]);return i;}return e;}function uo(e){return["__proto__","prototype","constructor"].indexOf(e)===-1;}function Ir(e,i,t,n){if(!uo(e))return;let s=i[e],o=t[e];A(s)&&A(o)?ne(s,o,n):i[e]=ci(o);}function ne(e,i,t){let n=z(i)?i:[i],s=n.length;if(!A(e))return e;t=t||{};let o=t.merger||Ir,a;for(let r=0;r<s;++r){if(a=n[r],!A(a))continue;let l=Object.keys(a);for(let c=0,h=l.length;c<h;++c)o(l[c],e,a,t);}return e;}function oe(e,i){return ne(e,i,{merger:Fr});}function Fr(e,i,t){if(!uo(e))return;let n=i[e],s=t[e];A(n)&&A(s)?oe(n,s):Object.prototype.hasOwnProperty.call(i,e)||(i[e]=ci(s));}var Qs={"":e=>e,x:e=>e.x,y:e=>e.y};function zr(e){let i=e.split("."),t=[],n="";for(let s of i)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(t.push(n),n="");return t;}function Br(e){let i=zr(e);return t=>{for(let n of i){if(n==="")break;t=t&&t[n];}return t;};}function Ct(e,i){return(Qs[i]||(Qs[i]=Br(i)))(e);}function fi(e){return e.charAt(0).toUpperCase()+e.slice(1);}var ae=e=>typeof e<"u",vt=e=>typeof e=="function",nn=(e,i)=>{if(e.size!==i.size)return!1;for(let t of e)if(!i.has(t))return!1;return!0;};function fo(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu";}var R=Math.PI,B=2*R,Vr=B+R,hi=Number.POSITIVE_INFINITY,Nr=R/180,W=R/2,Wt=R/4,to=R*2/3,Mt=Math.log10,dt=Math.sign;function re(e,i,t){return Math.abs(e-i)<t;}function sn(e){let i=Math.round(e);e=re(e,i,e/1e3)?i:e;let t=Math.pow(10,Math.floor(Mt(e))),n=e/t;return(n<=1?1:n<=2?2:n<=5?5:10)*t;}function go(e){let i=[],t=Math.sqrt(e),n;for(n=1;n<t;n++)e%n===0&&(i.push(n),i.push(e/n));return t===(t|0)&&i.push(t),i.sort((s,o)=>s-o).pop(),i;}function Hr(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e);}function Yt(e){return!Hr(e)&&!isNaN(parseFloat(e))&&isFinite(e);}function po(e,i){let t=Math.round(e);return t-i<=e&&t+i>=e;}function on(e,i,t){let n,s,o;for(n=0,s=e.length;n<s;n++)o=e[n][t],isNaN(o)||(i.min=Math.min(i.min,o),i.max=Math.max(i.max,o));}function ct(e){return e*(R/180);}function gi(e){return e*(180/R);}function an(e){if(!H(e))return;let i=1,t=0;for(;Math.round(e*i)/i!==e;)i*=10,t++;return t;}function rn(e,i){let t=i.x-e.x,n=i.y-e.y,s=Math.sqrt(t*t+n*n),o=Math.atan2(n,t);return o<-.5*R&&(o+=B),{angle:o,distance:s};}function di(e,i){return Math.sqrt(Math.pow(i.x-e.x,2)+Math.pow(i.y-e.y,2));}function Wr(e,i){return(e-i+Vr)%B-R;}function Z(e){return(e%B+B)%B;}function le(e,i,t,n){let s=Z(e),o=Z(i),a=Z(t),r=Z(o-s),l=Z(a-s),c=Z(s-o),h=Z(s-a);return s===o||s===a||n&&o===a||r>l&&c<h;}function Y(e,i,t){return Math.max(i,Math.min(t,e));}function mo(e){return Y(e,-32768,32767);}function pt(e,i,t,n=1e-6){return e>=Math.min(i,t)-n&&e<=Math.max(i,t)+n;}function pi(e,i,t){t=t||(a=>e[a]<i);let n=e.length-1,s=0,o;for(;n-s>1;)o=s+n>>1,t(o)?s=o:n=o;return{lo:s,hi:n};}var ut=(e,i,t,n)=>pi(e,t,n?s=>{let o=e[s][i];return o<t||o===t&&e[s+1][i]===t;}:s=>e[s][i]<t),bo=(e,i,t)=>pi(e,t,n=>e[n][i]>=t);function _o(e,i,t){let n=0,s=e.length;for(;n<s&&e[n]<i;)n++;for(;s>n&&e[s-1]>t;)s--;return n>0||s<e.length?e.slice(n,s):e;}var xo=["push","pop","shift","splice","unshift"];function yo(e,i){if(e._chartjs){e._chartjs.listeners.push(i);return;}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[i]}}),xo.forEach(t=>{let n="_onData"+fi(t),s=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value(...o){let a=s.apply(this,o);return e._chartjs.listeners.forEach(r=>{typeof r[n]=="function"&&r[n](...o);}),a;}});});}function ln(e,i){let t=e._chartjs;if(!t)return;let n=t.listeners,s=n.indexOf(i);s!==-1&&n.splice(s,1),!(n.length>0)&&(xo.forEach(o=>{delete e[o];}),delete e._chartjs);}function cn(e){let i=new Set(e);return i.size===e.length?e:Array.from(i);}var hn=function(){return typeof window>"u"?function(e){return e();}:window.requestAnimationFrame;}();function dn(e,i){let t=[],n=!1;return function(...s){t=s,n||(n=!0,hn.call(window,()=>{n=!1,e.apply(i,t);}));};}function vo(e,i){let t;return function(...n){return i?(clearTimeout(t),t=setTimeout(e,i,n)):e.apply(this,n),i;};}var mi=e=>e==="start"?"left":e==="end"?"right":"center",K=(e,i,t)=>e==="start"?i:e==="end"?t:(i+t)/2,Mo=(e,i,t,n)=>e===(n?"left":"right")?t:e==="center"?(i+t)/2:i;function un(e,i,t){let n=i.length,s=0,o=n;if(e._sorted){let{iScale:a,vScale:r,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,h=a.axis,{min:d,max:u,minDefined:f,maxDefined:p}=a.getUserBounds();if(f){if(s=Math.min(ut(l,h,d).lo,t?n:ut(i,h,a.getPixelForValue(d)).lo),c){let g=l.slice(0,s+1).reverse().findIndex(m=>!D(m[r.axis]));s-=Math.max(0,g);}s=Y(s,0,n-1);}if(p){let g=Math.max(ut(l,a.axis,u,!0).hi+1,t?0:ut(i,h,a.getPixelForValue(u),!0).hi+1);if(c){let m=l.slice(g-1).findIndex(b=>!D(b[r.axis]));g+=Math.max(0,m);}o=Y(g,s,n)-s;}else o=n-s;}return{start:s,count:o};}function fn(e){let{xScale:i,yScale:t,_scaleRanges:n}=e,s={xmin:i.min,xmax:i.max,ymin:t.min,ymax:t.max};if(!n)return e._scaleRanges=s,!0;let o=n.xmin!==i.min||n.xmax!==i.max||n.ymin!==t.min||n.ymax!==t.max;return Object.assign(n,s),o;}var ai=e=>e===0||e===1,eo=(e,i,t)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-i)*B/t)),io=(e,i,t)=>Math.pow(2,-10*e)*Math.sin((e-i)*B/t)+1,ie={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*W)+1,easeOutSine:e=>Math.sin(e*W),easeInOutSine:e=>-.5*(Math.cos(R*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>ai(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>ai(e)?e:eo(e,.075,.3),easeOutElastic:e=>ai(e)?e:io(e,.075,.3),easeInOutElastic(e){return ai(e)?e:e<.5?.5*eo(e*2,.1125,.45):.5+.5*io(e*2-1,.1125,.45);},easeInBack(e){return e*e*((1.70158+1)*e-1.70158);},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1;},easeInOutBack(e){let i=1.70158;return(e/=.5)<1?.5*(e*e*(((i*=1.525)+1)*e-i)):.5*((e-=2)*e*(((i*=1.525)+1)*e+i)+2);},easeInBounce:e=>1-ie.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375;},easeInOutBounce:e=>e<.5?ie.easeInBounce(e*2)*.5:ie.easeOutBounce(e*2-1)*.5+.5};function gn(e){if(e&&typeof e=="object"){let i=e.toString();return i==="[object CanvasPattern]"||i==="[object CanvasGradient]";}return!1;}function pn(e){return gn(e)?e:new Me(e);}function Ji(e){return gn(e)?e:new Me(e).saturate(.5).darken(.1).hexString();}var jr=["x","y","borderWidth","radius","tension"],$r=["color","borderColor","backgroundColor"];function Yr(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:i=>i!=="onProgress"&&i!=="onComplete"&&i!=="fn"}),e.set("animations",{colors:{type:"color",properties:$r},numbers:{type:"number",properties:jr}}),e.describe("animations",{_fallback:"animation"}),e.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:i=>i|0}}}});}function Ur(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});}var no=new Map();function Xr(e,i){i=i||{};let t=e+JSON.stringify(i),n=no.get(t);return n||(n=new Intl.NumberFormat(e,i),no.set(t,n)),n;}function ce(e,i,t){return Xr(i,t).format(e);}var Co={values(e){return z(e)?e:""+e;},numeric(e,i,t){if(e===0)return"0";let n=this.chart.options.locale,s,o=e;if(t.length>1){let c=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=Zr(e,t);}let a=Mt(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),ce(e,n,l);},logarithmic(e,i,t){if(e===0)return"0";let n=t[i].significand||e/Math.pow(10,Math.floor(Mt(e)));return[1,2,3,5,10,15].includes(n)||i>.8*t.length?Co.numeric.call(this,e,i,t):"";}};function Zr(e,i){let t=i.length>3?i[2].value-i[1].value:i[1].value-i[0].value;return Math.abs(t)>=1&&e!==Math.floor(e)&&(t=e-Math.floor(e)),t;}var Pe={formatters:Co};function Kr(e){e.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:(i,t)=>t.lineWidth,tickColor:(i,t)=>t.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:Pe.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:i=>!i.startsWith("before")&&!i.startsWith("after")&&i!=="callback"&&i!=="parser",_indexable:i=>i!=="borderDash"&&i!=="tickBorderDash"&&i!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:i=>i!=="backdropPadding"&&i!=="callback",_indexable:i=>i!=="backdropPadding"});}var Tt=Object.create(null),bi=Object.create(null);function we(e,i){if(!i)return e;let t=i.split(".");for(let n=0,s=t.length;n<s;++n){let o=t[n];e=e[o]||(e[o]=Object.create(null));}return e;}function Qi(e,i,t){return typeof i=="string"?ne(we(e,i),t):ne(we(e,""),i);}var tn=class{constructor(i,t){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=n=>n.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=(n,s)=>Ji(s.backgroundColor),this.hoverBorderColor=(n,s)=>Ji(s.borderColor),this.hoverColor=(n,s)=>Ji(s.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(i),this.apply(t);}set(i,t){return Qi(this,i,t);}get(i){return we(this,i);}describe(i,t){return Qi(bi,i,t);}override(i,t){return Qi(Tt,i,t);}route(i,t,n,s){let o=we(this,i),a=we(this,n),r="_"+t;Object.defineProperties(o,{[r]:{value:o[t],writable:!0},[t]:{enumerable:!0,get(){let l=this[r],c=a[s];return A(l)?Object.assign({},c,l):P(l,c);},set(l){this[r]=l;}}});}apply(i){i.forEach(t=>t(this));}},V=new tn({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Yr,Ur,Kr]);function qr(e){return!e||D(e.size)||D(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family;}function Se(e,i,t,n,s){let o=i[s];return o||(o=i[s]=e.measureText(s).width,t.push(s)),o>n&&(n=o),n;}function wo(e,i,t,n){n=n||{};let s=n.data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==i&&(s=n.data={},o=n.garbageCollect=[],n.font=i),e.save(),e.font=i;let a=0,r=t.length,l,c,h,d,u;for(l=0;l<r;l++)if(d=t[l],d!=null&&!z(d))a=Se(e,s,o,a,d);else if(z(d))for(c=0,h=d.length;c<h;c++)u=d[c],u!=null&&!z(u)&&(a=Se(e,s,o,a,u));e.restore();let f=o.length/2;if(f>t.length){for(l=0;l<f;l++)delete s[o[l]];o.splice(0,f);}return a;}function Rt(e,i,t){let n=e.currentDevicePixelRatio,s=t!==0?Math.max(t/2,.5):0;return Math.round((i-s)*n)/n+s;}function mn(e,i){!i&&!e||(i=i||e.getContext("2d"),i.save(),i.resetTransform(),i.clearRect(0,0,e.width,e.height),i.restore());}function _i(e,i,t,n){bn(e,i,t,n,null);}function bn(e,i,t,n,s){let o,a,r,l,c,h,d,u,f=i.pointStyle,p=i.rotation,g=i.radius,m=(p||0)*Nr;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(t,n),e.rotate(m),e.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),e.restore();return;}if(!(isNaN(g)||g<=0)){switch(e.beginPath(),f){default:s?e.ellipse(t,n,s/2,g,0,0,B):e.arc(t,n,g,0,B),e.closePath();break;case"triangle":h=s?s/2:g,e.moveTo(t+Math.sin(m)*h,n-Math.cos(m)*g),m+=to,e.lineTo(t+Math.sin(m)*h,n-Math.cos(m)*g),m+=to,e.lineTo(t+Math.sin(m)*h,n-Math.cos(m)*g),e.closePath();break;case"rectRounded":c=g*.516,l=g-c,a=Math.cos(m+Wt)*l,d=Math.cos(m+Wt)*(s?s/2-c:l),r=Math.sin(m+Wt)*l,u=Math.sin(m+Wt)*(s?s/2-c:l),e.arc(t-d,n-r,c,m-R,m-W),e.arc(t+u,n-a,c,m-W,m),e.arc(t+d,n+r,c,m,m+W),e.arc(t-u,n+a,c,m+W,m+R),e.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,h=s?s/2:l,e.rect(t-h,n-l,2*h,2*l);break;}m+=Wt;case"rectRot":d=Math.cos(m)*(s?s/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(s?s/2:g),e.moveTo(t-d,n-r),e.lineTo(t+u,n-a),e.lineTo(t+d,n+r),e.lineTo(t-u,n+a),e.closePath();break;case"crossRot":m+=Wt;case"cross":d=Math.cos(m)*(s?s/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(s?s/2:g),e.moveTo(t-d,n-r),e.lineTo(t+d,n+r),e.moveTo(t+u,n-a),e.lineTo(t-u,n+a);break;case"star":d=Math.cos(m)*(s?s/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(s?s/2:g),e.moveTo(t-d,n-r),e.lineTo(t+d,n+r),e.moveTo(t+u,n-a),e.lineTo(t-u,n+a),m+=Wt,d=Math.cos(m)*(s?s/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(s?s/2:g),e.moveTo(t-d,n-r),e.lineTo(t+d,n+r),e.moveTo(t+u,n-a),e.lineTo(t-u,n+a);break;case"line":a=s?s/2:Math.cos(m)*g,r=Math.sin(m)*g,e.moveTo(t-a,n-r),e.lineTo(t+a,n+r);break;case"dash":e.moveTo(t,n),e.lineTo(t+Math.cos(m)*(s?s/2:g),n+Math.sin(m)*g);break;case!1:e.closePath();break;}e.fill(),i.borderWidth>0&&e.stroke();}}function ft(e,i,t){return t=t||.5,!i||e&&e.x>i.left-t&&e.x<i.right+t&&e.y>i.top-t&&e.y<i.bottom+t;}function Oe(e,i){e.save(),e.beginPath(),e.rect(i.left,i.top,i.right-i.left,i.bottom-i.top),e.clip();}function Le(e){e.restore();}function So(e,i,t,n,s){if(!i)return e.lineTo(t.x,t.y);if(s==="middle"){let o=(i.x+t.x)/2;e.lineTo(o,i.y),e.lineTo(o,t.y);}else s==="after"!=!!n?e.lineTo(i.x,t.y):e.lineTo(t.x,i.y);e.lineTo(t.x,t.y);}function ko(e,i,t,n){if(!i)return e.lineTo(t.x,t.y);e.bezierCurveTo(n?i.cp1x:i.cp2x,n?i.cp1y:i.cp2y,n?t.cp2x:t.cp1x,n?t.cp2y:t.cp1y,t.x,t.y);}function Gr(e,i){i.translation&&e.translate(i.translation[0],i.translation[1]),D(i.rotation)||e.rotate(i.rotation),i.color&&(e.fillStyle=i.color),i.textAlign&&(e.textAlign=i.textAlign),i.textBaseline&&(e.textBaseline=i.textBaseline);}function Jr(e,i,t,n,s){if(s.strikethrough||s.underline){let o=e.measureText(n),a=i-o.actualBoundingBoxLeft,r=i+o.actualBoundingBoxRight,l=t-o.actualBoundingBoxAscent,c=t+o.actualBoundingBoxDescent,h=s.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=s.decorationWidth||2,e.moveTo(a,h),e.lineTo(r,h),e.stroke();}}function Qr(e,i){let t=e.fillStyle;e.fillStyle=i.color,e.fillRect(i.left,i.top,i.width,i.height),e.fillStyle=t;}function Et(e,i,t,n,s,o={}){let a=z(i)?i:[i],r=o.strokeWidth>0&&o.strokeColor!=="",l,c;for(e.save(),e.font=s.string,Gr(e,o),l=0;l<a.length;++l)c=a[l],o.backdrop&&Qr(e,o.backdrop),r&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),D(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,t,n,o.maxWidth)),e.fillText(c,t,n,o.maxWidth),Jr(e,t,n,c,o),n+=Number(s.lineHeight);e.restore();}function he(e,i){let{x:t,y:n,w:s,h:o,radius:a}=i;e.arc(t+a.topLeft,n+a.topLeft,a.topLeft,1.5*R,R,!0),e.lineTo(t,n+o-a.bottomLeft),e.arc(t+a.bottomLeft,n+o-a.bottomLeft,a.bottomLeft,R,W,!0),e.lineTo(t+s-a.bottomRight,n+o),e.arc(t+s-a.bottomRight,n+o-a.bottomRight,a.bottomRight,W,0,!0),e.lineTo(t+s,n+a.topRight),e.arc(t+s-a.topRight,n+a.topRight,a.topRight,0,-W,!0),e.lineTo(t+a.topLeft,n);}var tl=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,el=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function il(e,i){let t=(""+e).match(tl);if(!t||t[1]==="normal")return i*1.2;switch(e=+t[2],t[3]){case"px":return e;case"%":e/=100;break;}return i*e;}var nl=e=>+e||0;function xi(e,i){let t={},n=A(i),s=n?Object.keys(i):i,o=A(e)?n?a=>P(e[a],e[i[a]]):a=>e[a]:()=>e;for(let a of s)t[a]=nl(o(a));return t;}function _n(e){return xi(e,{top:"y",right:"x",bottom:"y",left:"x"});}function It(e){return xi(e,["topLeft","topRight","bottomLeft","bottomRight"]);}function q(e){let i=_n(e);return i.width=i.left+i.right,i.height=i.top+i.bottom,i;}function $(e,i){e=e||{},i=i||V.font;let t=P(e.size,i.size);typeof t=="string"&&(t=parseInt(t,10));let n=P(e.style,i.style);n&&!(""+n).match(el)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);let s={family:P(e.family,i.family),lineHeight:il(P(e.lineHeight,i.lineHeight),t),size:t,style:n,weight:P(e.weight,i.weight),string:""};return s.string=qr(s),s;}function de(e,i,t,n){let s=!0,o,a,r;for(o=0,a=e.length;o<a;++o)if(r=e[o],r!==void 0&&(i!==void 0&&typeof r=="function"&&(r=r(i),s=!1),t!==void 0&&z(r)&&(r=r[t%r.length],s=!1),r!==void 0))return n&&!s&&(n.cacheable=!1),r;}function Po(e,i,t){let{min:n,max:s}=e,o=en(i,(s-n)/2),a=(r,l)=>t&&r===0?0:r+l;return{min:a(n,-Math.abs(o)),max:a(s,o)};}function wt(e,i){return Object.assign(Object.create(e),i);}function yi(e,i=[""],t,n,s=()=>e[0]){let o=t||e;typeof n>"u"&&(n=Do("_fallback",e));let a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:n,_getTarget:s,override:r=>yi([r,...e],i,o,n)};return new Proxy(a,{deleteProperty(r,l){return delete r[l],delete r._keys,delete e[0][l],!0;},get(r,l){return Oo(r,l,()=>dl(l,i,e,r));},getOwnPropertyDescriptor(r,l){return Reflect.getOwnPropertyDescriptor(r._scopes[0],l);},getPrototypeOf(){return Reflect.getPrototypeOf(e[0]);},has(r,l){return oo(r).includes(l);},ownKeys(r){return oo(r);},set(r,l,c){let h=r._storage||(r._storage=s());return r[l]=h[l]=c,delete r._keys,!0;}});}function $t(e,i,t,n){let s={_cacheable:!1,_proxy:e,_context:i,_subProxy:t,_stack:new Set(),_descriptors:xn(e,n),setContext:o=>$t(e,o,t,n),override:o=>$t(e.override(o),i,t,n)};return new Proxy(s,{deleteProperty(o,a){return delete o[a],delete e[a],!0;},get(o,a,r){return Oo(o,a,()=>ol(o,a,r));},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(e,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,a);},getPrototypeOf(){return Reflect.getPrototypeOf(e);},has(o,a){return Reflect.has(e,a);},ownKeys(){return Reflect.ownKeys(e);},set(o,a,r){return e[a]=r,delete o[a],!0;}});}function xn(e,i={scriptable:!0,indexable:!0}){let{_scriptable:t=i.scriptable,_indexable:n=i.indexable,_allKeys:s=i.allKeys}=e;return{allKeys:s,scriptable:t,indexable:n,isScriptable:vt(t)?t:()=>t,isIndexable:vt(n)?n:()=>n};}var sl=(e,i)=>e?e+fi(i):i,yn=(e,i)=>A(i)&&e!=="adapters"&&(Object.getPrototypeOf(i)===null||i.constructor===Object);function Oo(e,i,t){if(Object.prototype.hasOwnProperty.call(e,i)||i==="constructor")return e[i];let n=t();return e[i]=n,n;}function ol(e,i,t){let{_proxy:n,_context:s,_subProxy:o,_descriptors:a}=e,r=n[i];return vt(r)&&a.isScriptable(i)&&(r=al(i,r,e,t)),z(r)&&r.length&&(r=rl(i,r,e,a.isIndexable)),yn(i,r)&&(r=$t(r,s,o&&o[i],a)),r;}function al(e,i,t,n){let{_proxy:s,_context:o,_subProxy:a,_stack:r}=t;if(r.has(e))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+e);r.add(e);let l=i(o,a||n);return r.delete(e),yn(e,l)&&(l=vn(s._scopes,s,e,l)),l;}function rl(e,i,t,n){let{_proxy:s,_context:o,_subProxy:a,_descriptors:r}=t;if(typeof o.index<"u"&&n(e))return i[o.index%i.length];if(A(i[0])){let l=i,c=s._scopes.filter(h=>h!==l);i=[];for(let h of l){let d=vn(c,s,e,h);i.push($t(d,o,a&&a[e],r));}}return i;}function Lo(e,i,t){return vt(e)?e(i,t):e;}var ll=(e,i)=>e===!0?i:typeof e=="string"?Ct(i,e):void 0;function cl(e,i,t,n,s){for(let o of i){let a=ll(t,o);if(a){e.add(a);let r=Lo(a._fallback,t,s);if(typeof r<"u"&&r!==t&&r!==n)return r;}else if(a===!1&&typeof n<"u"&&t!==n)return null;}return!1;}function vn(e,i,t,n){let s=i._rootScopes,o=Lo(i._fallback,t,n),a=[...e,...s],r=new Set();r.add(n);let l=so(r,a,t,o||t,n);return l===null||typeof o<"u"&&o!==t&&(l=so(r,a,o,l,n),l===null)?!1:yi(Array.from(r),[""],s,o,()=>hl(i,t,n));}function so(e,i,t,n,s){for(;t;)t=cl(e,i,t,n,s);return t;}function hl(e,i,t){let n=e._getTarget();i in n||(n[i]={});let s=n[i];return z(s)&&A(t)?t:s||{};}function dl(e,i,t,n){let s;for(let o of i)if(s=Do(sl(o,e),t),typeof s<"u")return yn(e,s)?vn(t,n,e,s):s;}function Do(e,i){for(let t of i){if(!t)continue;let n=t[e];if(typeof n<"u")return n;}}function oo(e){let i=e._keys;return i||(i=e._keys=ul(e._scopes)),i;}function ul(e){let i=new Set();for(let t of e)for(let n of Object.keys(t).filter(s=>!s.startsWith("_")))i.add(n);return Array.from(i);}function Mn(e,i,t,n){let{iScale:s}=e,{key:o="r"}=this._parsing,a=new Array(n),r,l,c,h;for(r=0,l=n;r<l;++r)c=r+t,h=i[c],a[r]={r:s.parse(Ct(h,o),c)};return a;}var fl=Number.EPSILON||1e-14,se=(e,i)=>i<e.length&&!e[i].skip&&e[i],Ao=e=>e==="x"?"y":"x";function gl(e,i,t,n){let s=e.skip?i:e,o=i,a=t.skip?i:t,r=di(o,s),l=di(a,o),c=r/(r+l),h=l/(r+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;let d=n*c,u=n*h;return{previous:{x:o.x-d*(a.x-s.x),y:o.y-d*(a.y-s.y)},next:{x:o.x+u*(a.x-s.x),y:o.y+u*(a.y-s.y)}};}function pl(e,i,t){let n=e.length,s,o,a,r,l,c=se(e,0);for(let h=0;h<n-1;++h)if(l=c,c=se(e,h+1),!(!l||!c)){if(re(i[h],0,fl)){t[h]=t[h+1]=0;continue;}s=t[h]/i[h],o=t[h+1]/i[h],r=Math.pow(s,2)+Math.pow(o,2),!(r<=9)&&(a=3/Math.sqrt(r),t[h]=s*a*i[h],t[h+1]=o*a*i[h]);}}function ml(e,i,t="x"){let n=Ao(t),s=e.length,o,a,r,l=se(e,0);for(let c=0;c<s;++c){if(a=r,r=l,l=se(e,c+1),!r)continue;let h=r[t],d=r[n];a&&(o=(h-a[t])/3,r[`cp1${t}`]=h-o,r[`cp1${n}`]=d-o*i[c]),l&&(o=(l[t]-h)/3,r[`cp2${t}`]=h+o,r[`cp2${n}`]=d+o*i[c]);}}function bl(e,i="x"){let t=Ao(i),n=e.length,s=Array(n).fill(0),o=Array(n),a,r,l,c=se(e,0);for(a=0;a<n;++a)if(r=l,l=c,c=se(e,a+1),!!l){if(c){let h=c[i]-l[i];s[a]=h!==0?(c[t]-l[t])/h:0;}o[a]=r?c?dt(s[a-1])!==dt(s[a])?0:(s[a-1]+s[a])/2:s[a-1]:s[a];}pl(e,s,o),ml(e,o,i);}function ri(e,i,t){return Math.max(Math.min(e,t),i);}function _l(e,i){let t,n,s,o,a,r=ft(e[0],i);for(t=0,n=e.length;t<n;++t)a=o,o=r,r=t<n-1&&ft(e[t+1],i),o&&(s=e[t],a&&(s.cp1x=ri(s.cp1x,i.left,i.right),s.cp1y=ri(s.cp1y,i.top,i.bottom)),r&&(s.cp2x=ri(s.cp2x,i.left,i.right),s.cp2y=ri(s.cp2y,i.top,i.bottom)));}function To(e,i,t,n,s){let o,a,r,l;if(i.spanGaps&&(e=e.filter(c=>!c.skip)),i.cubicInterpolationMode==="monotone")bl(e,s);else{let c=n?e[e.length-1]:e[0];for(o=0,a=e.length;o<a;++o)r=e[o],l=gl(c,r,e[Math.min(o+1,a-(n?0:1))%a],i.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,c=r;}i.capBezierPoints&&_l(e,t);}function vi(){return typeof window<"u"&&typeof document<"u";}function Mi(e){let i=e.parentNode;return i&&i.toString()==="[object ShadowRoot]"&&(i=i.host),i;}function ui(e,i,t){let n;return typeof e=="string"?(n=parseInt(e,10),e.indexOf("%")!==-1&&(n=n/100*i.parentNode[t])):n=e,n;}var Ci=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function xl(e,i){return Ci(e).getPropertyValue(i);}var yl=["top","right","bottom","left"];function jt(e,i,t){let n={};t=t?"-"+t:"";for(let s=0;s<4;s++){let o=yl[s];n[o]=parseFloat(e[i+"-"+o+t])||0;}return n.width=n.left+n.right,n.height=n.top+n.bottom,n;}var vl=(e,i,t)=>(e>0||i>0)&&(!t||!t.shadowRoot);function Ml(e,i){let t=e.touches,n=t&&t.length?t[0]:e,{offsetX:s,offsetY:o}=n,a=!1,r,l;if(vl(s,o,e.target))r=s,l=o;else{let c=i.getBoundingClientRect();r=n.clientX-c.left,l=n.clientY-c.top,a=!0;}return{x:r,y:l,box:a};}function Ft(e,i){if("native"in e)return e;let{canvas:t,currentDevicePixelRatio:n}=i,s=Ci(t),o=s.boxSizing==="border-box",a=jt(s,"padding"),r=jt(s,"border","width"),{x:l,y:c,box:h}=Ml(e,t),d=a.left+(h&&r.left),u=a.top+(h&&r.top),{width:f,height:p}=i;return o&&(f-=a.width+r.width,p-=a.height+r.height),{x:Math.round((l-d)/f*t.width/n),y:Math.round((c-u)/p*t.height/n)};}function Cl(e,i,t){let n,s;if(i===void 0||t===void 0){let o=e&&Mi(e);if(!o)i=e.clientWidth,t=e.clientHeight;else{let a=o.getBoundingClientRect(),r=Ci(o),l=jt(r,"border","width"),c=jt(r,"padding");i=a.width-c.width-l.width,t=a.height-c.height-l.height,n=ui(r.maxWidth,o,"clientWidth"),s=ui(r.maxHeight,o,"clientHeight");}}return{width:i,height:t,maxWidth:n||hi,maxHeight:s||hi};}var At=e=>Math.round(e*10)/10;function Ro(e,i,t,n){let s=Ci(e),o=jt(s,"margin"),a=ui(s.maxWidth,e,"clientWidth")||hi,r=ui(s.maxHeight,e,"clientHeight")||hi,l=Cl(e,i,t),{width:c,height:h}=l;if(s.boxSizing==="content-box"){let u=jt(s,"border","width"),f=jt(s,"padding");c-=f.width+u.width,h-=f.height+u.height;}return c=Math.max(0,c-o.width),h=Math.max(0,n?c/n:h-o.height),c=At(Math.min(c,a,l.maxWidth)),h=At(Math.min(h,r,l.maxHeight)),c&&!h&&(h=At(c/2)),(i!==void 0||t!==void 0)&&n&&l.height&&h>l.height&&(h=l.height,c=At(Math.floor(h*n))),{width:c,height:h};}function Cn(e,i,t){let n=i||1,s=At(e.height*n),o=At(e.width*n);e.height=At(e.height),e.width=At(e.width);let a=e.canvas;return a.style&&(t||!a.style.height&&!a.style.width)&&(a.style.height=`${e.height}px`,a.style.width=`${e.width}px`),e.currentDevicePixelRatio!==n||a.height!==s||a.width!==o?(e.currentDevicePixelRatio=n,a.height=s,a.width=o,e.ctx.setTransform(n,0,0,n,0,0),!0):!1;}var Eo=function(){let e=!1;try{let i={get passive(){return e=!0,!1;}};vi()&&(window.addEventListener("test",null,i),window.removeEventListener("test",null,i));}catch(i){}return e;}();function wn(e,i){let t=xl(e,i),n=t&&t.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0;}function Dt(e,i,t,n){return{x:e.x+t*(i.x-e.x),y:e.y+t*(i.y-e.y)};}function Io(e,i,t,n){return{x:e.x+t*(i.x-e.x),y:n==="middle"?t<.5?e.y:i.y:n==="after"?t<1?e.y:i.y:t>0?i.y:e.y};}function Fo(e,i,t,n){let s={x:e.cp2x,y:e.cp2y},o={x:i.cp1x,y:i.cp1y},a=Dt(e,s,t),r=Dt(s,o,t),l=Dt(o,i,t),c=Dt(a,r,t),h=Dt(r,l,t);return Dt(c,h,t);}var wl=function(e,i){return{x(t){return e+e+i-t;},setWidth(t){i=t;},textAlign(t){return t==="center"?t:t==="right"?"left":"right";},xPlus(t,n){return t-n;},leftForLtr(t,n){return t-n;}};},Sl=function(){return{x(e){return e;},setWidth(e){},textAlign(e){return e;},xPlus(e,i){return e+i;},leftForLtr(e,i){return e;}};};function Ut(e,i,t){return e?wl(i,t):Sl();}function Sn(e,i){let t,n;(i==="ltr"||i==="rtl")&&(t=e.canvas.style,n=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",i,"important"),e.prevTextDirection=n);}function kn(e,i){i!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",i[0],i[1]));}function zo(e){return e==="angle"?{between:le,compare:Wr,normalize:Z}:{between:pt,compare:(i,t)=>i-t,normalize:i=>i};}function ao({start:e,end:i,count:t,loop:n,style:s}){return{start:e%t,end:i%t,loop:n&&(i-e+1)%t===0,style:s};}function kl(e,i,t){let{property:n,start:s,end:o}=t,{between:a,normalize:r}=zo(n),l=i.length,{start:c,end:h,loop:d}=e,u,f;if(d){for(c+=l,h+=l,u=0,f=l;u<f&&a(r(i[c%l][n]),s,o);++u)c--,h--;c%=l,h%=l;}return h<c&&(h+=l),{start:c,end:h,loop:d,style:e.style};}function Pn(e,i,t){if(!t)return[e];let{property:n,start:s,end:o}=t,a=i.length,{compare:r,between:l,normalize:c}=zo(n),{start:h,end:d,loop:u,style:f}=kl(e,i,t),p=[],g=!1,m=null,b,_,y,M=()=>l(s,y,b)&&r(s,y)!==0,x=()=>r(o,b)===0||l(o,y,b),v=()=>g||M(),S=()=>!g||x();for(let C=h,k=h;C<=d;++C)_=i[C%a],!_.skip&&(b=c(_[n]),b!==y&&(g=l(b,s,o),m===null&&v()&&(m=r(b,s)===0?C:k),m!==null&&S()&&(p.push(ao({start:m,end:C,loop:u,count:a,style:f})),m=null),k=C,y=b));return m!==null&&p.push(ao({start:m,end:d,loop:u,count:a,style:f})),p;}function On(e,i){let t=[],n=e.segments;for(let s=0;s<n.length;s++){let o=Pn(n[s],e.points,i);o.length&&t.push(...o);}return t;}function Pl(e,i,t,n){let s=0,o=i-1;if(t&&!n)for(;s<i&&!e[s].skip;)s++;for(;s<i&&e[s].skip;)s++;for(s%=i,t&&(o+=s);o>s&&e[o%i].skip;)o--;return o%=i,{start:s,end:o};}function Ol(e,i,t,n){let s=e.length,o=[],a=i,r=e[i],l;for(l=i+1;l<=t;++l){let c=e[l%s];c.skip||c.stop?r.skip||(n=!1,o.push({start:i%s,end:(l-1)%s,loop:n}),i=a=c.stop?l:null):(a=l,r.skip&&(i=l)),r=c;}return a!==null&&o.push({start:i%s,end:a%s,loop:n}),o;}function Bo(e,i){let t=e.points,n=e.options.spanGaps,s=t.length;if(!s)return[];let o=!!e._loop,{start:a,end:r}=Pl(t,s,o,n);if(n===!0)return ro(e,[{start:a,end:r,loop:o}],t,i);let l=r<a?r+s:r,c=!!e._fullLoop&&a===0&&r===s-1;return ro(e,Ol(t,a,l,c),t,i);}function ro(e,i,t,n){return!n||!n.setContext||!t?i:Ll(e,i,t,n);}function Ll(e,i,t,n){let s=e._chart.getContext(),o=lo(e.options),{_datasetIndex:a,options:{spanGaps:r}}=e,l=t.length,c=[],h=o,d=i[0].start,u=d;function f(p,g,m,b){let _=r?-1:1;if(p!==g){for(p+=l;t[p%l].skip;)p-=_;for(;t[g%l].skip;)g+=_;p%l!==g%l&&(c.push({start:p%l,end:g%l,loop:m,style:b}),h=b,d=g%l);}}for(let p of i){d=r?d:p.start;let g=t[d%l],m;for(u=d+1;u<=p.end;u++){let b=t[u%l];m=lo(n.setContext(wt(s,{type:"segment",p0:g,p1:b,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:a}))),Dl(m,h)&&f(d,u-1,p.loop,h),g=b,h=m;}d<u-1&&f(d,u-1,p.loop,h);}return c;}function lo(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor};}function Dl(e,i){if(!i)return!1;let t=[],n=function(s,o){return gn(o)?(t.includes(o)||t.push(o),t.indexOf(o)):o;};return JSON.stringify(e,n)!==JSON.stringify(i,n);}function li(e,i,t){return e.options.clip?e[t]:i[t];}function Al(e,i){let{xScale:t,yScale:n}=e;return t&&n?{left:li(t,i,"left"),right:li(t,i,"right"),top:li(n,i,"top"),bottom:li(n,i,"bottom")}:i;}function Ln(e,i){let t=i._clip;if(t.disabled)return!1;let n=Al(i,e.chartArea);return{left:t.left===!1?0:n.left-(t.left===!0?0:t.left),right:t.right===!1?e.width:n.right+(t.right===!0?0:t.right),top:t.top===!1?0:n.top-(t.top===!0?0:t.top),bottom:t.bottom===!1?e.height:n.bottom+(t.bottom===!0?0:t.bottom)};}var Hn=class{constructor(){this._request=null,this._charts=new Map(),this._running=!1,this._lastDate=void 0;}_notify(i,t,n,s){let o=t.listeners[s],a=t.duration;o.forEach(r=>r({chart:i,initial:t.initial,numSteps:a,currentStep:Math.min(n-t.start,a)}));}_refresh(){this._request||(this._running=!0,this._request=hn.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh();}));}_update(i=Date.now()){let t=0;this._charts.forEach((n,s)=>{if(!n.running||!n.items.length)return;let o=n.items,a=o.length-1,r=!1,l;for(;a>=0;--a)l=o[a],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(i),r=!0):(o[a]=o[o.length-1],o.pop());r&&(s.draw(),this._notify(s,n,i,"progress")),o.length||(n.running=!1,this._notify(s,n,i,"complete"),n.initial=!1),t+=o.length;}),this._lastDate=i,t===0&&(this._running=!1);}_getAnims(i){let t=this._charts,n=t.get(i);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(i,n)),n;}listen(i,t,n){this._getAnims(i).listeners[t].push(n);}add(i,t){!t||!t.length||this._getAnims(i).items.push(...t);}has(i){return this._getAnims(i).items.length>0;}start(i){let t=this._charts.get(i);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((n,s)=>Math.max(n,s._duration),0),this._refresh());}running(i){if(!this._running)return!1;let t=this._charts.get(i);return!(!t||!t.running||!t.items.length);}stop(i){let t=this._charts.get(i);if(!t||!t.items.length)return;let n=t.items,s=n.length-1;for(;s>=0;--s)n[s].cancel();t.items=[],this._notify(i,t,Date.now(),"complete");}remove(i){return this._charts.delete(i);}},St=new Hn(),Vo="transparent",Tl={boolean(e,i,t){return t>.5?i:e;},color(e,i,t){let n=pn(e||Vo),s=n.valid&&pn(i||Vo);return s&&s.valid?s.mix(n,t).hexString():i;},number(e,i,t){return e+(i-e)*t;}},Wn=class{constructor(i,t,n,s){let o=t[n];s=de([i.to,s,o,i.from]);let a=de([i.from,o,s]);this._active=!0,this._fn=i.fn||Tl[i.type||typeof a],this._easing=ie[i.easing]||ie.linear,this._start=Math.floor(Date.now()+(i.delay||0)),this._duration=this._total=Math.floor(i.duration),this._loop=!!i.loop,this._target=t,this._prop=n,this._from=a,this._to=s,this._promises=void 0;}active(){return this._active;}update(i,t,n){if(this._active){this._notify(!1);let s=this._target[this._prop],o=n-this._start,a=this._duration-o;this._start=n,this._duration=Math.floor(Math.max(a,i.duration)),this._total+=o,this._loop=!!i.loop,this._to=de([i.to,t,s,i.from]),this._from=de([i.from,s,t]);}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1));}tick(i){let t=i-this._start,n=this._duration,s=this._prop,o=this._from,a=this._loop,r=this._to,l;if(this._active=o!==r&&(a||t<n),!this._active){this._target[s]=r,this._notify(!0);return;}if(t<0){this._target[s]=o;return;}l=t/n%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,r,l);}wait(){let i=this._promises||(this._promises=[]);return new Promise((t,n)=>{i.push({res:t,rej:n});});}_notify(i){let t=i?"res":"rej",n=this._promises||[];for(let s=0;s<n.length;s++)n[s][t]();}},Ti=class{constructor(i,t){this._chart=i,this._properties=new Map(),this.configure(t);}configure(i){if(!A(i))return;let t=Object.keys(V.animation),n=this._properties;Object.getOwnPropertyNames(i).forEach(s=>{let o=i[s];if(!A(o))return;let a={};for(let r of t)a[r]=o[r];(z(o.properties)&&o.properties||[s]).forEach(r=>{(r===s||!n.has(r))&&n.set(r,a);});});}_animateOptions(i,t){let n=t.options,s=El(i,n);if(!s)return[];let o=this._createAnimations(s,n);return n.$shared&&Rl(i.options.$animations,n).then(()=>{i.options=n;},()=>{}),o;}_createAnimations(i,t){let n=this._properties,s=[],o=i.$animations||(i.$animations={}),a=Object.keys(t),r=Date.now(),l;for(l=a.length-1;l>=0;--l){let c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(i,t));continue;}let h=t[c],d=o[c],u=n.get(c);if(d)if(u&&d.active()){d.update(u,h,r);continue;}else d.cancel();if(!u||!u.duration){i[c]=h;continue;}o[c]=d=new Wn(u,i,c,h),s.push(d);}return s;}update(i,t){if(this._properties.size===0){Object.assign(i,t);return;}let n=this._createAnimations(i,t);if(n.length)return St.add(this._chart,n),!0;}};function Rl(e,i){let t=[],n=Object.keys(i);for(let s=0;s<n.length;s++){let o=e[n[s]];o&&o.active()&&t.push(o.wait());}return Promise.all(t);}function El(e,i){if(!i)return;let t=e.options;if(!t){e.options=i;return;}return t.$shared&&(e.options=t=Object.assign({},t,{$shared:!1,$animations:{}})),t;}function No(e,i){let t=e&&e.options||{},n=t.reverse,s=t.min===void 0?i:0,o=t.max===void 0?i:0;return{start:n?o:s,end:n?s:o};}function Il(e,i,t){if(t===!1)return!1;let n=No(e,t),s=No(i,t);return{top:s.end,right:n.end,bottom:s.start,left:n.start};}function Fl(e){let i,t,n,s;return A(e)?(i=e.top,t=e.right,n=e.bottom,s=e.left):i=t=n=s=e,{top:i,right:t,bottom:n,left:s,disabled:e===!1};}function Va(e,i){let t=[],n=e._getSortedDatasetMetas(i),s,o;for(s=0,o=n.length;s<o;++s)t.push(n[s].index);return t;}function Ho(e,i,t,n={}){let s=e.keys,o=n.mode==="single",a,r,l,c;if(i===null)return;let h=!1;for(a=0,r=s.length;a<r;++a){if(l=+s[a],l===t){if(h=!0,n.all)continue;break;}c=e.values[l],H(c)&&(o||i===0||dt(i)===dt(c))&&(i+=c);}return!h&&!n.all?0:i;}function zl(e,i){let{iScale:t,vScale:n}=i,s=t.axis==="x"?"x":"y",o=n.axis==="x"?"x":"y",a=Object.keys(e),r=new Array(a.length),l,c,h;for(l=0,c=a.length;l<c;++l)h=a[l],r[l]={[s]:h,[o]:e[h]};return r;}function Dn(e,i){let t=e&&e.options.stacked;return t||t===void 0&&i.stack!==void 0;}function Bl(e,i,t){return`${e.id}.${i.id}.${t.stack||t.type}`;}function Vl(e){let{min:i,max:t,minDefined:n,maxDefined:s}=e.getUserBounds();return{min:n?i:Number.NEGATIVE_INFINITY,max:s?t:Number.POSITIVE_INFINITY};}function Nl(e,i,t){let n=e[i]||(e[i]={});return n[t]||(n[t]={});}function Wo(e,i,t,n){for(let s of i.getMatchingVisibleMetas(n).reverse()){let o=e[s.index];if(t&&o>0||!t&&o<0)return s.index;}return null;}function jo(e,i){let{chart:t,_cachedMeta:n}=e,s=t._stacks||(t._stacks={}),{iScale:o,vScale:a,index:r}=n,l=o.axis,c=a.axis,h=Bl(o,a,n),d=i.length,u;for(let f=0;f<d;++f){let p=i[f],{[l]:g,[c]:m}=p,b=p._stacks||(p._stacks={});u=b[c]=Nl(s,h,g),u[r]=m,u._top=Wo(u,a,!0,n.type),u._bottom=Wo(u,a,!1,n.type);let _=u._visualValues||(u._visualValues={});_[r]=m;}}function An(e,i){let t=e.scales;return Object.keys(t).filter(n=>t[n].axis===i).shift();}function Hl(e,i){return wt(e,{active:!1,dataset:void 0,datasetIndex:i,index:i,mode:"default",type:"dataset"});}function Wl(e,i,t){return wt(e,{active:!1,dataIndex:i,parsed:void 0,raw:void 0,element:t,index:i,mode:"default",type:"data"});}function De(e,i){let t=e.controller.index,n=e.vScale&&e.vScale.axis;if(n){i=i||e._parsed;for(let s of i){let o=s._stacks;if(!o||o[n]===void 0||o[n][t]===void 0)return;delete o[n][t],o[n]._visualValues!==void 0&&o[n]._visualValues[t]!==void 0&&delete o[n]._visualValues[t];}}}var Tn=e=>e==="reset"||e==="none",$o=(e,i)=>i?e:Object.assign({},e),jl=(e,i,t)=>e&&!i.hidden&&i._stacked&&{keys:Va(t,!0),values:null},Bt=(()=>{class e{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,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=Dn(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&&De(this._cachedMeta),this.index=t;}linkScales(){let t=this.chart,n=this._cachedMeta,s=this.getDataset(),o=(u,f,p,g)=>u==="x"?f:u==="r"?g:p,a=n.xAxisID=P(s.xAxisID,An(t,"x")),r=n.yAxisID=P(s.yAxisID,An(t,"y")),l=n.rAxisID=P(s.rAxisID,An(t,"r")),c=n.indexAxis,h=n.iAxisID=o(c,a,r,l),d=n.vAxisID=o(c,r,a,l);n.xScale=this.getScaleForId(a),n.yScale=this.getScaleForId(r),n.rScale=this.getScaleForId(l),n.iScale=this.getScaleForId(h),n.vScale=this.getScaleForId(d);}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 n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale;}reset(){this._update("reset");}_destroy(){let t=this._cachedMeta;this._data&&ln(this._data,this),t._stacked&&De(t);}_dataCheck(){let t=this.getDataset(),n=t.data||(t.data=[]),s=this._data;if(A(n)){let o=this._cachedMeta;this._data=zl(n,o);}else if(s!==n){if(s){ln(s,this);let o=this._cachedMeta;De(o),o._parsed=[];}n&&Object.isExtensible(n)&&yo(n,this),this._syncList=[],this._data=n;}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType());}buildOrUpdateElements(t){let n=this._cachedMeta,s=this.getDataset(),o=!1;this._dataCheck();let a=n._stacked;n._stacked=Dn(n.vScale,n),n.stack!==s.stack&&(o=!0,De(n),n.stack=s.stack),this._resyncElements(t),(o||a!==n._stacked)&&(jo(this,n._parsed),n._stacked=Dn(n.vScale,n));}configure(){let t=this.chart.config,n=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={};}parse(t,n){let{_cachedMeta:s,_data:o}=this,{iScale:a,_stacked:r}=s,l=a.axis,c=t===0&&n===o.length?!0:s._sorted,h=t>0&&s._parsed[t-1],d,u,f;if(this._parsing===!1)s._parsed=o,s._sorted=!0,f=o;else{z(o[t])?f=this.parseArrayData(s,o,t,n):A(o[t])?f=this.parseObjectData(s,o,t,n):f=this.parsePrimitiveData(s,o,t,n);let p=()=>u[l]===null||h&&u[l]<h[l];for(d=0;d<n;++d)s._parsed[d+t]=u=f[d],c&&(p()&&(c=!1),h=u);s._sorted=c;}r&&jo(this,f);}parsePrimitiveData(t,n,s,o){let{iScale:a,vScale:r}=t,l=a.axis,c=r.axis,h=a.getLabels(),d=a===r,u=new Array(o),f,p,g;for(f=0,p=o;f<p;++f)g=f+s,u[f]={[l]:d||a.parse(h[g],g),[c]:r.parse(n[g],g)};return u;}parseArrayData(t,n,s,o){let{xScale:a,yScale:r}=t,l=new Array(o),c,h,d,u;for(c=0,h=o;c<h;++c)d=c+s,u=n[d],l[c]={x:a.parse(u[0],d),y:r.parse(u[1],d)};return l;}parseObjectData(t,n,s,o){let{xScale:a,yScale:r}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,h=new Array(o),d,u,f,p;for(d=0,u=o;d<u;++d)f=d+s,p=n[f],h[d]={x:a.parse(Ct(p,l),f),y:r.parse(Ct(p,c),f)};return h;}getParsed(t){return this._cachedMeta._parsed[t];}getDataElement(t){return this._cachedMeta.data[t];}applyStack(t,n,s){let o=this.chart,a=this._cachedMeta,r=n[t.axis],l={keys:Va(o,!0),values:n._stacks[t.axis]._visualValues};return Ho(l,r,a.index,{mode:s});}updateRangeFromParsed(t,n,s,o){let a=s[n.axis],r=a===null?NaN:a,l=o&&s._stacks[n.axis];o&&l&&(o.values=l,r=Ho(o,a,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r);}getMinMax(t,n){let s=this._cachedMeta,o=s._parsed,a=s._sorted&&t===s.iScale,r=o.length,l=this._getOtherScale(t),c=jl(n,s,this.chart),h={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:u}=Vl(l),f,p;function g(){p=o[f];let m=p[l.axis];return!H(p[t.axis])||d>m||u<m;}for(f=0;f<r&&!(!g()&&(this.updateRangeFromParsed(h,t,p,c),a));++f);if(a){for(f=r-1;f>=0;--f)if(!g()){this.updateRangeFromParsed(h,t,p,c);break;}}return h;}getAllParsedValues(t){let n=this._cachedMeta._parsed,s=[],o,a,r;for(o=0,a=n.length;o<a;++o)r=n[o][t.axis],H(r)&&s.push(r);return s;}getMaxOverflow(){return!1;}getLabelAndValue(t){let n=this._cachedMeta,s=n.iScale,o=n.vScale,a=this.getParsed(t);return{label:s?""+s.getLabelForValue(a[s.axis]):"",value:o?""+o.getLabelForValue(a[o.axis]):""};}_update(t){let n=this._cachedMeta;this.update(t||"default"),n._clip=Fl(P(this.options.clip,Il(n.xScale,n.yScale,this.getMaxOverflow())));}update(t){}draw(){let t=this._ctx,n=this.chart,s=this._cachedMeta,o=s.data||[],a=n.chartArea,r=[],l=this._drawStart||0,c=this._drawCount||o.length-l,h=this.options.drawActiveElementsOnTop,d;for(s.dataset&&s.dataset.draw(t,a,l,c),d=l;d<l+c;++d){let u=o[d];u.hidden||(u.active&&h?r.push(u):u.draw(t,a));}for(d=0;d<r.length;++d)r[d].draw(t,a);}getStyle(t,n){let s=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(t||0,s);}getContext(t,n,s){let o=this.getDataset(),a;if(t>=0&&t<this._cachedMeta.data.length){let r=this._cachedMeta.data[t];a=r.$context||(r.$context=Wl(this.getContext(),t,r)),a.parsed=this.getParsed(t),a.raw=o.data[t],a.index=a.dataIndex=t;}else a=this.$context||(this.$context=Hl(this.chart.getContext(),this.index)),a.dataset=o,a.index=a.datasetIndex=this.index;return a.active=!!n,a.mode=s,a;}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t);}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t);}_resolveElementOptions(t,n="default",s){let o=n==="active",a=this._cachedDataOpts,r=t+"-"+n,l=a[r],c=this.enableOptionSharing&&ae(s);if(l)return $o(l,c);let h=this.chart.config,d=h.datasetElementScopeKeys(this._type,t),u=o?[`${t}Hover`,"hover",t,""]:[t,""],f=h.getOptionScopes(this.getDataset(),d),p=Object.keys(V.elements[t]),g=()=>this.getContext(s,o,n),m=h.resolveNamedOptions(f,p,g,u);return m.$shared&&(m.$shared=c,a[r]=Object.freeze($o(m,c))),m;}_resolveAnimations(t,n,s){let o=this.chart,a=this._cachedDataOpts,r=`animation-${n}`,l=a[r];if(l)return l;let c;if(o.options.animation!==!1){let d=this.chart.config,u=d.datasetAnimationScopeKeys(this._type,n),f=d.getOptionScopes(this.getDataset(),u);c=d.createResolver(f,this.getContext(t,s,n));}let h=new Ti(o,c&&c.animations);return c&&c._cacheable&&(a[r]=Object.freeze(h)),h;}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t));}includeOptions(t,n){return!n||Tn(t)||this.chart._animationsDisabled;}_getSharedOptions(t,n){let s=this.resolveDataElementOptions(t,n),o=this._sharedOptions,a=this.getSharedOptions(s),r=this.includeOptions(n,a)||a!==o;return this.updateSharedOptions(a,n,s),{sharedOptions:a,includeOptions:r};}updateElement(t,n,s,o){Tn(o)?Object.assign(t,s):this._resolveAnimations(n,o).update(t,s);}updateSharedOptions(t,n,s){t&&!Tn(n)&&this._resolveAnimations(void 0,n).update(t,s);}_setStyle(t,n,s,o){t.active=o;let a=this.getStyle(n,o);this._resolveAnimations(n,s,o).update(t,{options:!o&&this.getSharedOptions(a)||a});}removeHoverStyle(t,n,s){this._setStyle(t,s,"active",!1);}setHoverStyle(t,n,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 n=this._data,s=this._cachedMeta.data;for(let[l,c,h]of this._syncList)this[l](c,h);this._syncList=[];let o=s.length,a=n.length,r=Math.min(a,o);r&&this.parse(0,r),a>o?this._insertElements(o,a-o,t):a<o&&this._removeElements(a,o-a);}_insertElements(t,n,s=!0){let o=this._cachedMeta,a=o.data,r=t+n,l,c=h=>{for(h.length+=n,l=h.length-1;l>=r;l--)h[l]=h[l-n];};for(c(a),l=t;l<r;++l)a[l]=new this.dataElementType();this._parsing&&c(o._parsed),this.parse(t,n),s&&this.updateElements(a,t,n,"reset");}updateElements(t,n,s,o){}_removeElements(t,n){let s=this._cachedMeta;if(this._parsing){let o=s._parsed.splice(t,n);s._stacked&&De(s,o);}s.data.splice(t,n);}_sync(t){if(this._parsing)this._syncList.push(t);else{let[n,s,o]=t;this[n](s,o);}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,n){n&&this._sync(["_removeElements",t,n]);let s=arguments.length-2;s&&this._sync(["_insertElements",t,s]);}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length]);}}return w(e,"defaults",{}),w(e,"datasetElementType",null),w(e,"dataElementType",null),e;})();function $l(e,i){if(!e._cache.$bar){let t=e.getMatchingVisibleMetas(i),n=[];for(let s=0,o=t.length;s<o;s++)n=n.concat(t[s].controller.getAllParsedValues(e));e._cache.$bar=cn(n.sort((s,o)=>s-o));}return e._cache.$bar;}function Yl(e){let i=e.iScale,t=$l(i,e.type),n=i._length,s,o,a,r,l=()=>{a===32767||a===-32768||(ae(r)&&(n=Math.min(n,Math.abs(a-r)||n)),r=a);};for(s=0,o=t.length;s<o;++s)a=i.getPixelForValue(t[s]),l();for(r=void 0,s=0,o=i.ticks.length;s<o;++s)a=i.getPixelForTick(s),l();return n;}function Ul(e,i,t,n){let s=t.barThickness,o,a;return D(s)?(o=i.min*t.categoryPercentage,a=t.barPercentage):(o=s*n,a=1),{chunk:o/n,ratio:a,start:i.pixels[e]-o/2};}function Xl(e,i,t,n){let s=i.pixels,o=s[e],a=e>0?s[e-1]:null,r=e<s.length-1?s[e+1]:null,l=t.categoryPercentage;a===null&&(a=o-(r===null?i.end-i.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/n,ratio:t.barPercentage,start:c};}function Zl(e,i,t,n){let s=t.parse(e[0],n),o=t.parse(e[1],n),a=Math.min(s,o),r=Math.max(s,o),l=a,c=r;Math.abs(a)>Math.abs(r)&&(l=r,c=a),i[t.axis]=c,i._custom={barStart:l,barEnd:c,start:s,end:o,min:a,max:r};}function Na(e,i,t,n){return z(e)?Zl(e,i,t,n):i[t.axis]=t.parse(e,n),i;}function Yo(e,i,t,n){let s=e.iScale,o=e.vScale,a=s.getLabels(),r=s===o,l=[],c,h,d,u;for(c=t,h=t+n;c<h;++c)u=i[c],d={},d[s.axis]=r||s.parse(a[c],c),l.push(Na(u,d,o,c));return l;}function Rn(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0;}function Kl(e,i,t){return e!==0?dt(e):(i.isHorizontal()?1:-1)*(i.min>=t?1:-1);}function ql(e){let i,t,n,s,o;return e.horizontal?(i=e.base>e.x,t="left",n="right"):(i=e.base<e.y,t="bottom",n="top"),i?(s="end",o="start"):(s="start",o="end"),{start:t,end:n,reverse:i,top:s,bottom:o};}function Gl(e,i,t,n){let s=i.borderSkipped,o={};if(!s){e.borderSkipped=o;return;}if(s===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return;}let{start:a,end:r,reverse:l,top:c,bottom:h}=ql(e);s==="middle"&&t&&(e.enableBorderRadius=!0,(t._top||0)===n?s=c:(t._bottom||0)===n?s=h:(o[Uo(h,a,r,l)]=!0,s=c)),o[Uo(s,a,r,l)]=!0,e.borderSkipped=o;}function Uo(e,i,t,n){return n?(e=Jl(e,i,t),e=Xo(e,t,i)):e=Xo(e,i,t),e;}function Jl(e,i,t){return e===i?t:e===t?i:e;}function Xo(e,i,t){return e==="start"?i:e==="end"?t:e;}function Ql(e,{inflateAmount:i},t){e.inflateAmount=i==="auto"?t===1?.33:0:i;}var tc=(()=>{class e extends Bt{parsePrimitiveData(t,n,s,o){return Yo(t,n,s,o);}parseArrayData(t,n,s,o){return Yo(t,n,s,o);}parseObjectData(t,n,s,o){let{iScale:a,vScale:r}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,h=a.axis==="x"?l:c,d=r.axis==="x"?l:c,u=[],f,p,g,m;for(f=s,p=s+o;f<p;++f)m=n[f],g={},g[a.axis]=a.parse(Ct(m,h),f),u.push(Na(Ct(m,d),g,r,f));return u;}updateRangeFromParsed(t,n,s,o){super.updateRangeFromParsed(t,n,s,o);let a=s._custom;a&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,a.min),t.max=Math.max(t.max,a.max));}getMaxOverflow(){return 0;}getLabelAndValue(t){let n=this._cachedMeta,{iScale:s,vScale:o}=n,a=this.getParsed(t),r=a._custom,l=Rn(r)?"["+r.start+", "+r.end+"]":""+o.getLabelForValue(a[o.axis]);return{label:""+s.getLabelForValue(a[s.axis]),value:l};}initialize(){this.enableOptionSharing=!0,super.initialize();let t=this._cachedMeta;t.stack=this.getDataset().stack;}update(t){let n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t);}updateElements(t,n,s,o){let a=o==="reset",{index:r,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),h=l.isHorizontal(),d=this._getRuler(),{sharedOptions:u,includeOptions:f}=this._getSharedOptions(n,o);for(let p=n;p<n+s;p++){let g=this.getParsed(p),m=a||D(g[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(p),b=this._calculateBarIndexPixels(p,d),_=(g._stacks||{})[l.axis],y={horizontal:h,base:m.base,enableBorderRadius:!_||Rn(g._custom)||r===_._top||r===_._bottom,x:h?m.head:b.center,y:h?b.center:m.head,height:h?b.size:Math.abs(m.size),width:h?Math.abs(m.size):b.size};f&&(y.options=u||this.resolveDataElementOptions(p,t[p].active?"active":o));let M=y.options||t[p].options;Gl(y,M,_,r),Ql(y,M,d.ratio),this.updateElement(t[p],p,y,o);}}_getStacks(t,n){let{iScale:s}=this._cachedMeta,o=s.getMatchingVisibleMetas(this._type).filter(d=>d.controller.options.grouped),a=s.options.stacked,r=[],l=this._cachedMeta.controller.getParsed(n),c=l&&l[s.axis],h=d=>{let u=d._parsed.find(p=>p[s.axis]===c),f=u&&u[d.vScale.axis];if(D(f)||isNaN(f))return!0;};for(let d of o)if(!(n!==void 0&&h(d))&&((a===!1||r.indexOf(d.stack)===-1||a===void 0&&d.stack===void 0)&&r.push(d.stack),d.index===t))break;return r.length||r.push(void 0),r;}_getStackCount(t){return this._getStacks(void 0,t).length;}_getAxisCount(){return this._getAxis().length;}getFirstScaleIdForIndexAxis(){let t=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(t).filter(s=>t[s].axis===n).shift();}_getAxis(){let t={},n=this.getFirstScaleIdForIndexAxis();for(let s of this.chart.data.datasets)t[P(this.chart.options.indexAxis==="x"?s.xAxisID:s.yAxisID,n)]=!0;return Object.keys(t);}_getStackIndex(t,n,s){let o=this._getStacks(t,s),a=n!==void 0?o.indexOf(n):-1;return a===-1?o.length-1:a;}_getRuler(){let t=this.options,n=this._cachedMeta,s=n.iScale,o=[],a,r;for(a=0,r=n.data.length;a<r;++a)o.push(s.getPixelForValue(this.getParsed(a)[s.axis],a));let l=t.barThickness;return{min:l||Yl(n),pixels:o,start:s._startPixel,end:s._endPixel,stackCount:this._getStackCount(),scale:s,grouped:t.grouped,ratio:l?1:t.categoryPercentage*t.barPercentage};}_calculateBarValuePixels(t){let{_cachedMeta:{vScale:n,_stacked:s,index:o},options:{base:a,minBarLength:r}}=this,l=a||0,c=this.getParsed(t),h=c._custom,d=Rn(h),u=c[n.axis],f=0,p=s?this.applyStack(n,c,s):u,g,m;p!==u&&(f=p-u,p=u),d&&(u=h.barStart,p=h.barEnd-h.barStart,u!==0&&dt(u)!==dt(h.barEnd)&&(f=0),f+=u);let b=!D(a)&&!d?a:f,_=n.getPixelForValue(b);if(this.chart.getDataVisibility(t)?g=n.getPixelForValue(f+p):g=_,m=g-_,Math.abs(m)<r){m=Kl(m,n,l)*r,u===l&&(_-=m/2);let y=n.getPixelForDecimal(0),M=n.getPixelForDecimal(1),x=Math.min(y,M),v=Math.max(y,M);_=Math.max(Math.min(_,v),x),g=_+m,s&&!d&&(c._stacks[n.axis]._visualValues[o]=n.getValueForPixel(g)-n.getValueForPixel(_));}if(_===n.getPixelForValue(l)){let y=dt(m)*n.getLineWidthForValue(l)/2;_+=y,m-=y;}return{size:m,base:_,head:g,center:g+m/2};}_calculateBarIndexPixels(t,n){let s=n.scale,o=this.options,a=o.skipNull,r=P(o.maxBarThickness,1/0),l,c,h=this._getAxisCount();if(n.grouped){let d=a?this._getStackCount(t):n.stackCount,u=o.barThickness==="flex"?Xl(t,n,o,d*h):Ul(t,n,o,d*h),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,p=this._getAxis().indexOf(P(f,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,a?t:void 0)+p;l=u.start+u.chunk*g+u.chunk/2,c=Math.min(r,u.chunk*u.ratio);}else l=s.getPixelForValue(this.getParsed(t)[s.axis],t),c=Math.min(r,n.min*n.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c};}draw(){let t=this._cachedMeta,n=t.vScale,s=t.data,o=s.length,a=0;for(;a<o;++a)this.getParsed(a)[n.axis]!==null&&!s[a].hidden&&s[a].draw(this._ctx);}}return w(e,"id","bar"),w(e,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),w(e,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}}),e;})(),ec=(()=>{class e extends Bt{initialize(){this.enableOptionSharing=!0,super.initialize();}parsePrimitiveData(t,n,s,o){let a=super.parsePrimitiveData(t,n,s,o);for(let r=0;r<a.length;r++)a[r]._custom=this.resolveDataElementOptions(r+s).radius;return a;}parseArrayData(t,n,s,o){let a=super.parseArrayData(t,n,s,o);for(let r=0;r<a.length;r++){let l=n[s+r];a[r]._custom=P(l[2],this.resolveDataElementOptions(r+s).radius);}return a;}parseObjectData(t,n,s,o){let a=super.parseObjectData(t,n,s,o);for(let r=0;r<a.length;r++){let l=n[s+r];a[r]._custom=P(l&&l.r&&+l.r,this.resolveDataElementOptions(r+s).radius);}return a;}getMaxOverflow(){let t=this._cachedMeta.data,n=0;for(let s=t.length-1;s>=0;--s)n=Math.max(n,t[s].size(this.resolveDataElementOptions(s))/2);return n>0&&n;}getLabelAndValue(t){let n=this._cachedMeta,s=this.chart.data.labels||[],{xScale:o,yScale:a}=n,r=this.getParsed(t),l=o.getLabelForValue(r.x),c=a.getLabelForValue(r.y),h=r._custom;return{label:s[t]||"",value:"("+l+", "+c+(h?", "+h:"")+")"};}update(t){let n=this._cachedMeta.data;this.updateElements(n,0,n.length,t);}updateElements(t,n,s,o){let a=o==="reset",{iScale:r,vScale:l}=this._cachedMeta,{sharedOptions:c,includeOptions:h}=this._getSharedOptions(n,o),d=r.axis,u=l.axis;for(let f=n;f<n+s;f++){let p=t[f],g=!a&&this.getParsed(f),m={},b=m[d]=a?r.getPixelForDecimal(.5):r.getPixelForValue(g[d]),_=m[u]=a?l.getBasePixel():l.getPixelForValue(g[u]);m.skip=isNaN(b)||isNaN(_),h&&(m.options=c||this.resolveDataElementOptions(f,p.active?"active":o),a&&(m.options.radius=0)),this.updateElement(p,f,m,o);}}resolveDataElementOptions(t,n){let s=this.getParsed(t),o=super.resolveDataElementOptions(t,n);o.$shared&&(o=Object.assign({},o,{$shared:!1}));let a=o.radius;return n!=="active"&&(o.radius=0),o.radius+=P(s&&s._custom,a),o;}}return w(e,"id","bubble"),w(e,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),w(e,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}}),e;})();function ic(e,i,t){let n=1,s=1,o=0,a=0;if(i<B){let r=e,l=r+i,c=Math.cos(r),h=Math.sin(r),d=Math.cos(l),u=Math.sin(l),f=(y,M,x)=>le(y,r,l,!0)?1:Math.max(M,M*t,x,x*t),p=(y,M,x)=>le(y,r,l,!0)?-1:Math.min(M,M*t,x,x*t),g=f(0,c,d),m=f(W,h,u),b=p(R,c,d),_=p(R+W,h,u);n=(g-b)/2,s=(m-_)/2,o=-(g+b)/2,a=-(m+_)/2;}return{ratioX:n,ratioY:s,offsetX:o,offsetY:a};}var is=(()=>{class e extends Bt{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0;}linkScales(){}parse(t,n){let s=this.getDataset().data,o=this._cachedMeta;if(this._parsing===!1)o._parsed=s;else{let a=c=>+s[c];if(A(s[t])){let{key:c="value"}=this._parsing;a=h=>+Ct(s[h],c);}let r,l;for(r=t,l=t+n;r<l;++r)o._parsed[r]=a(r);}}_getRotation(){return ct(this.options.rotation-90);}_getCircumference(){return ct(this.options.circumference);}_getRotationExtents(){let t=B,n=-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 o=this.chart.getDatasetMeta(s).controller,a=o._getRotation(),r=o._getCircumference();t=Math.min(t,a),n=Math.max(n,a+r);}return{rotation:t,circumference:n-t};}update(t){let n=this.chart,{chartArea:s}=n,o=this._cachedMeta,a=o.data,r=this.getMaxBorderWidth()+this.getMaxOffset(a)+this.options.spacing,l=Math.max((Math.min(s.width,s.height)-r)/2,0),c=Math.min(ho(this.options.cutout,l),1),h=this._getRingWeight(this.index),{circumference:d,rotation:u}=this._getRotationExtents(),{ratioX:f,ratioY:p,offsetX:g,offsetY:m}=ic(u,d,c),b=(s.width-r)/f,_=(s.height-r)/p,y=Math.max(Math.min(b,_)/2,0),M=en(this.options.radius,y),x=Math.max(M*c,0),v=(M-x)/this._getVisibleDatasetWeightTotal();this.offsetX=g*M,this.offsetY=m*M,o.total=this.calculateTotal(),this.outerRadius=M-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*h,0),this.updateElements(a,0,a.length,t);}_circumference(t,n){let s=this.options,o=this._cachedMeta,a=this._getCircumference();return n&&s.animation.animateRotate||!this.chart.getDataVisibility(t)||o._parsed[t]===null||o.data[t].hidden?0:this.calculateCircumference(o._parsed[t]*a/B);}updateElements(t,n,s,o){let a=o==="reset",r=this.chart,l=r.chartArea,h=r.options.animation,d=(l.left+l.right)/2,u=(l.top+l.bottom)/2,f=a&&h.animateScale,p=f?0:this.innerRadius,g=f?0:this.outerRadius,{sharedOptions:m,includeOptions:b}=this._getSharedOptions(n,o),_=this._getRotation(),y;for(y=0;y<n;++y)_+=this._circumference(y,a);for(y=n;y<n+s;++y){let M=this._circumference(y,a),x=t[y],v={x:d+this.offsetX,y:u+this.offsetY,startAngle:_,endAngle:_+M,circumference:M,outerRadius:g,innerRadius:p};b&&(v.options=m||this.resolveDataElementOptions(y,x.active?"active":o)),_+=M,this.updateElement(x,y,v,o);}}calculateTotal(){let t=this._cachedMeta,n=t.data,s=0,o;for(o=0;o<n.length;o++){let a=t._parsed[o];a!==null&&!isNaN(a)&&this.chart.getDataVisibility(o)&&!n[o].hidden&&(s+=Math.abs(a));}return s;}calculateCircumference(t){let n=this._cachedMeta.total;return n>0&&!isNaN(t)?B*(Math.abs(t)/n):0;}getLabelAndValue(t){let n=this._cachedMeta,s=this.chart,o=s.data.labels||[],a=ce(n._parsed[t],s.options.locale);return{label:o[t]||"",value:a};}getMaxBorderWidth(t){let n=0,s=this.chart,o,a,r,l,c;if(!t){for(o=0,a=s.data.datasets.length;o<a;++o)if(s.isDatasetVisible(o)){r=s.getDatasetMeta(o),t=r.data,l=r.controller;break;}}if(!t)return 0;for(o=0,a=t.length;o<a;++o)c=l.resolveDataElementOptions(o),c.borderAlign!=="inner"&&(n=Math.max(n,c.borderWidth||0,c.hoverBorderWidth||0));return n;}getMaxOffset(t){let n=0;for(let s=0,o=t.length;s<o;++s){let a=this.resolveDataElementOptions(s);n=Math.max(n,a.offset||0,a.hoverOffset||0);}return n;}_getRingWeightOffset(t){let n=0;for(let s=0;s<t;++s)this.chart.isDatasetVisible(s)&&(n+=this._getRingWeight(s));return n;}_getRingWeight(t){return Math.max(P(this.chart.data.datasets[t].weight,1),0);}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1;}}return w(e,"id","doughnut"),w(e,"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"}),w(e,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),w(e,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let n=t.data,{labels:{pointStyle:s,textAlign:o,color:a,useBorderRadius:r,borderRadius:l}}=t.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((c,h)=>{let u=t.getDatasetMeta(0).controller.getStyle(h);return{text:c,fillStyle:u.backgroundColor,fontColor:a,hidden:!t.getDataVisibility(h),lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:u.borderWidth,strokeStyle:u.borderColor,textAlign:o,pointStyle:s,borderRadius:r&&(l||u.borderRadius),index:h};}):[];}},onClick(t,n,s){s.chart.toggleDataVisibility(n.index),s.chart.update();}}}}),e;})(),nc=(()=>{class e extends Bt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize();}update(t){let n=this._cachedMeta,{dataset:s,data:o=[],_dataset:a}=n,r=this.chart._animationsDisabled,{start:l,count:c}=un(n,o,r);this._drawStart=l,this._drawCount=c,fn(n)&&(l=0,c=o.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!a._decimated,s.points=o;let h=this.resolveDatasetElementOptions(t);this.options.showLine||(h.borderWidth=0),h.segment=this.options.segment,this.updateElement(s,void 0,{animated:!r,options:h},t),this.updateElements(o,l,c,t);}updateElements(t,n,s,o){let a=o==="reset",{iScale:r,vScale:l,_stacked:c,_dataset:h}=this._cachedMeta,{sharedOptions:d,includeOptions:u}=this._getSharedOptions(n,o),f=r.axis,p=l.axis,{spanGaps:g,segment:m}=this.options,b=Yt(g)?g:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||a||o==="none",y=n+s,M=t.length,x=n>0&&this.getParsed(n-1);for(let v=0;v<M;++v){let S=t[v],C=_?S:{};if(v<n||v>=y){C.skip=!0;continue;}let k=this.getParsed(v),L=D(k[p]),O=C[f]=r.getPixelForValue(k[f],v),T=C[p]=a||L?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,k,c):k[p],v);C.skip=isNaN(O)||isNaN(T)||L,C.stop=v>0&&Math.abs(k[f]-x[f])>b,m&&(C.parsed=k,C.raw=h.data[v]),u&&(C.options=d||this.resolveDataElementOptions(v,S.active?"active":o)),_||this.updateElement(S,v,C,o),x=k;}}getMaxOverflow(){let t=this._cachedMeta,n=t.dataset,s=n.options&&n.options.borderWidth||0,o=t.data||[];if(!o.length)return s;let a=o[0].size(this.resolveDataElementOptions(0)),r=o[o.length-1].size(this.resolveDataElementOptions(o.length-1));return Math.max(s,a,r)/2;}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw();}}return w(e,"id","line"),w(e,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),w(e,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}}),e;})(),Ha=(()=>{class e extends Bt{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0;}getLabelAndValue(t){let n=this._cachedMeta,s=this.chart,o=s.data.labels||[],a=ce(n._parsed[t].r,s.options.locale);return{label:o[t]||"",value:a};}parseObjectData(t,n,s,o){return Mn.bind(this)(t,n,s,o);}update(t){let n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t);}getMinMax(){let t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((s,o)=>{let a=this.getParsed(o).r;!isNaN(a)&&this.chart.getDataVisibility(o)&&(a<n.min&&(n.min=a),a>n.max&&(n.max=a));}),n;}_updateRadius(){let t=this.chart,n=t.chartArea,s=t.options,o=Math.min(n.right-n.left,n.bottom-n.top),a=Math.max(o/2,0),r=Math.max(s.cutoutPercentage?a/100*s.cutoutPercentage:1,0),l=(a-r)/t.getVisibleDatasetCount();this.outerRadius=a-l*this.index,this.innerRadius=this.outerRadius-l;}updateElements(t,n,s,o){let a=o==="reset",r=this.chart,c=r.options.animation,h=this._cachedMeta.rScale,d=h.xCenter,u=h.yCenter,f=h.getIndexAngle(0)-.5*R,p=f,g,m=360/this.countVisibleElements();for(g=0;g<n;++g)p+=this._computeAngle(g,o,m);for(g=n;g<n+s;g++){let b=t[g],_=p,y=p+this._computeAngle(g,o,m),M=r.getDataVisibility(g)?h.getDistanceFromCenterForValue(this.getParsed(g).r):0;p=y,a&&(c.animateScale&&(M=0),c.animateRotate&&(_=y=f));let x={x:d,y:u,innerRadius:0,outerRadius:M,startAngle:_,endAngle:y,options:this.resolveDataElementOptions(g,b.active?"active":o)};this.updateElement(b,g,x,o);}}countVisibleElements(){let t=this._cachedMeta,n=0;return t.data.forEach((s,o)=>{!isNaN(this.getParsed(o).r)&&this.chart.getDataVisibility(o)&&n++;}),n;}_computeAngle(t,n,s){return this.chart.getDataVisibility(t)?ct(this.resolveDataElementOptions(t,n).angle||s):0;}}return w(e,"id","polarArea"),w(e,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),w(e,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let n=t.data;if(n.labels.length&&n.datasets.length){let{labels:{pointStyle:s,color:o}}=t.legend.options;return n.labels.map((a,r)=>{let c=t.getDatasetMeta(0).controller.getStyle(r);return{text:a,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:o,lineWidth:c.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(r),index:r};});}return[];}},onClick(t,n,s){s.chart.toggleDataVisibility(n.index),s.chart.update();}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}}),e;})(),sc=(()=>{class e extends is{}return w(e,"id","pie"),w(e,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"}),e;})(),oc=(()=>{class e extends Bt{getLabelAndValue(t){let n=this._cachedMeta.vScale,s=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(s[n.axis])};}parseObjectData(t,n,s,o){return Mn.bind(this)(t,n,s,o);}update(t){let n=this._cachedMeta,s=n.dataset,o=n.data||[],a=n.iScale.getLabels();if(s.points=o,t!=="resize"){let r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);let l={_loop:!0,_fullLoop:a.length===o.length,options:r};this.updateElement(s,void 0,l,t);}this.updateElements(o,0,o.length,t);}updateElements(t,n,s,o){let a=this._cachedMeta.rScale,r=o==="reset";for(let l=n;l<n+s;l++){let c=t[l],h=this.resolveDataElementOptions(l,c.active?"active":o),d=a.getPointPositionForValue(l,this.getParsed(l).r),u=r?a.xCenter:d.x,f=r?a.yCenter:d.y,p={x:u,y:f,angle:d.angle,skip:isNaN(u)||isNaN(f),options:h};this.updateElement(c,l,p,o);}}}return w(e,"id","radar"),w(e,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),w(e,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}}),e;})(),ac=(()=>{class e extends Bt{getLabelAndValue(t){let n=this._cachedMeta,s=this.chart.data.labels||[],{xScale:o,yScale:a}=n,r=this.getParsed(t),l=o.getLabelForValue(r.x),c=a.getLabelForValue(r.y);return{label:s[t]||"",value:"("+l+", "+c+")"};}update(t){let n=this._cachedMeta,{data:s=[]}=n,o=this.chart._animationsDisabled,{start:a,count:r}=un(n,s,o);if(this._drawStart=a,this._drawCount=r,fn(n)&&(a=0,r=s.length),this.options.showLine){this.datasetElementType||this.addElements();let{dataset:l,_dataset:c}=n;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!c._decimated,l.points=s;let h=this.resolveDatasetElementOptions(t);h.segment=this.options.segment,this.updateElement(l,void 0,{animated:!o,options:h},t);}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(s,a,r,t);}addElements(){let{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements();}updateElements(t,n,s,o){let a=o==="reset",{iScale:r,vScale:l,_stacked:c,_dataset:h}=this._cachedMeta,d=this.resolveDataElementOptions(n,o),u=this.getSharedOptions(d),f=this.includeOptions(o,u),p=r.axis,g=l.axis,{spanGaps:m,segment:b}=this.options,_=Yt(m)?m:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||a||o==="none",M=n>0&&this.getParsed(n-1);for(let x=n;x<n+s;++x){let v=t[x],S=this.getParsed(x),C=y?v:{},k=D(S[g]),L=C[p]=r.getPixelForValue(S[p],x),O=C[g]=a||k?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,S,c):S[g],x);C.skip=isNaN(L)||isNaN(O)||k,C.stop=x>0&&Math.abs(S[p]-M[p])>_,b&&(C.parsed=S,C.raw=h.data[x]),f&&(C.options=u||this.resolveDataElementOptions(x,v.active?"active":o)),y||this.updateElement(v,x,C,o),M=S;}this.updateSharedOptions(u,o,d);}getMaxOverflow(){let t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let l=0;for(let c=n.length-1;c>=0;--c)l=Math.max(l,n[c].size(this.resolveDataElementOptions(c))/2);return l>0&&l;}let s=t.dataset,o=s.options&&s.options.borderWidth||0;if(!n.length)return o;let a=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(o,a,r)/2;}}return w(e,"id","scatter"),w(e,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),w(e,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}}),e;})(),rc=Object.freeze({__proto__:null,BarController:tc,BubbleController:ec,DoughnutController:is,LineController:nc,PieController:sc,PolarAreaController:Ha,RadarController:oc,ScatterController:ac});function Xt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.");}var jn=class e{static override(i){Object.assign(e.prototype,i);}options;constructor(i){this.options=i||{};}init(){}formats(){return Xt();}parse(){return Xt();}format(){return Xt();}add(){return Xt();}diff(){return Xt();}startOf(){return Xt();}endOf(){return Xt();}},lc={_date:jn};function cc(e,i,t,n){let{controller:s,data:o,_sorted:a}=e,r=s._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(r&&i===r.axis&&i!=="r"&&a&&o.length){let c=r._reversePixels?bo:ut;if(n){if(s._sharedOptions){let h=o[0],d=typeof h.getRange=="function"&&h.getRange(i);if(d){let u=c(o,i,t-d),f=c(o,i,t+d);return{lo:u.lo,hi:f.hi};}}}else{let h=c(o,i,t);if(l){let{vScale:d}=s._cachedMeta,{_parsed:u}=e,f=u.slice(0,h.lo+1).reverse().findIndex(g=>!D(g[d.axis]));h.lo-=Math.max(0,f);let p=u.slice(h.hi).findIndex(g=>!D(g[d.axis]));h.hi+=Math.max(0,p);}return h;}}return{lo:0,hi:o.length-1};}function je(e,i,t,n,s){let o=e.getSortedVisibleDatasetMetas(),a=t[i];for(let r=0,l=o.length;r<l;++r){let{index:c,data:h}=o[r],{lo:d,hi:u}=cc(o[r],i,a,s);for(let f=d;f<=u;++f){let p=h[f];p.skip||n(p,c,f);}}}function hc(e){let i=e.indexOf("x")!==-1,t=e.indexOf("y")!==-1;return function(n,s){let o=i?Math.abs(n.x-s.x):0,a=t?Math.abs(n.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2));};}function En(e,i,t,n,s){let o=[];return!s&&!e.isPointInArea(i)||je(e,t,i,function(r,l,c){!s&&!ft(r,e.chartArea,0)||r.inRange(i.x,i.y,n)&&o.push({element:r,datasetIndex:l,index:c});},!0),o;}function dc(e,i,t,n){let s=[];function o(a,r,l){let{startAngle:c,endAngle:h}=a.getProps(["startAngle","endAngle"],n),{angle:d}=rn(a,{x:i.x,y:i.y});le(d,c,h)&&s.push({element:a,datasetIndex:r,index:l});}return je(e,t,i,o),s;}function uc(e,i,t,n,s,o){let a=[],r=hc(t),l=Number.POSITIVE_INFINITY;function c(h,d,u){let f=h.inRange(i.x,i.y,s);if(n&&!f)return;let p=h.getCenterPoint(s);if(!(!!o||e.isPointInArea(p))&&!f)return;let m=r(i,p);m<l?(a=[{element:h,datasetIndex:d,index:u}],l=m):m===l&&a.push({element:h,datasetIndex:d,index:u});}return je(e,t,i,c),a;}function In(e,i,t,n,s,o){return!o&&!e.isPointInArea(i)?[]:t==="r"&&!n?dc(e,i,t,s):uc(e,i,t,n,s,o);}function Zo(e,i,t,n,s){let o=[],a=t==="x"?"inXRange":"inYRange",r=!1;return je(e,t,i,(l,c,h)=>{l[a]&&l[a](i[t],s)&&(o.push({element:l,datasetIndex:c,index:h}),r=r||l.inRange(i.x,i.y,s));}),n&&!r?[]:o;}var fc={evaluateInteractionItems:je,modes:{index(e,i,t,n){let s=Ft(i,e),o=t.axis||"x",a=t.includeInvisible||!1,r=t.intersect?En(e,s,o,n,a):In(e,s,o,!1,n,a),l=[];return r.length?(e.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(e,i,t,n){let s=Ft(i,e),o=t.axis||"xy",a=t.includeInvisible||!1,r=t.intersect?En(e,s,o,n,a):In(e,s,o,!1,n,a);if(r.length>0){let l=r[0].datasetIndex,c=e.getDatasetMeta(l).data;r=[];for(let h=0;h<c.length;++h)r.push({element:c[h],datasetIndex:l,index:h});}return r;},point(e,i,t,n){let s=Ft(i,e),o=t.axis||"xy",a=t.includeInvisible||!1;return En(e,s,o,n,a);},nearest(e,i,t,n){let s=Ft(i,e),o=t.axis||"xy",a=t.includeInvisible||!1;return In(e,s,o,t.intersect,n,a);},x(e,i,t,n){let s=Ft(i,e);return Zo(e,s,"x",t.intersect,n);},y(e,i,t,n){let s=Ft(i,e);return Zo(e,s,"y",t.intersect,n);}}},Wa=["left","top","right","bottom"];function Ae(e,i){return e.filter(t=>t.pos===i);}function Ko(e,i){return e.filter(t=>Wa.indexOf(t.pos)===-1&&t.box.axis===i);}function Te(e,i){return e.sort((t,n)=>{let s=i?n:t,o=i?t:n;return s.weight===o.weight?s.index-o.index:s.weight-o.weight;});}function gc(e){let i=[],t,n,s,o,a,r;for(t=0,n=(e||[]).length;t<n;++t)s=e[t],{position:o,options:{stack:a,stackWeight:r=1}}=s,i.push({index:t,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:a&&o+a,stackWeight:r});return i;}function pc(e){let i={};for(let t of e){let{stack:n,pos:s,stackWeight:o}=t;if(!n||!Wa.includes(s))continue;let a=i[n]||(i[n]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o;}return i;}function mc(e,i){let t=pc(e),{vBoxMaxWidth:n,hBoxMaxHeight:s}=i,o,a,r;for(o=0,a=e.length;o<a;++o){r=e[o];let{fullSize:l}=r.box,c=t[r.stack],h=c&&r.stackWeight/c.weight;r.horizontal?(r.width=h?h*n:l&&i.availableWidth,r.height=s):(r.width=n,r.height=h?h*s:l&&i.availableHeight);}return t;}function bc(e){let i=gc(e),t=Te(i.filter(c=>c.box.fullSize),!0),n=Te(Ae(i,"left"),!0),s=Te(Ae(i,"right")),o=Te(Ae(i,"top"),!0),a=Te(Ae(i,"bottom")),r=Ko(i,"x"),l=Ko(i,"y");return{fullSize:t,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(a).concat(r),chartArea:Ae(i,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(a).concat(r)};}function qo(e,i,t,n){return Math.max(e[t],i[t])+Math.max(e[n],i[n]);}function ja(e,i){e.top=Math.max(e.top,i.top),e.left=Math.max(e.left,i.left),e.bottom=Math.max(e.bottom,i.bottom),e.right=Math.max(e.right,i.right);}function _c(e,i,t,n){let{pos:s,box:o}=t,a=e.maxPadding;if(!A(s)){t.size&&(e[s]-=t.size);let d=n[t.stack]||{size:0,count:1};d.size=Math.max(d.size,t.horizontal?o.height:o.width),t.size=d.size/d.count,e[s]+=t.size;}o.getPadding&&ja(a,o.getPadding());let r=Math.max(0,i.outerWidth-qo(a,e,"left","right")),l=Math.max(0,i.outerHeight-qo(a,e,"top","bottom")),c=r!==e.w,h=l!==e.h;return e.w=r,e.h=l,t.horizontal?{same:c,other:h}:{same:h,other:c};}function xc(e){let i=e.maxPadding;function t(n){let s=Math.max(i[n]-e[n],0);return e[n]+=s,s;}e.y+=t("top"),e.x+=t("left"),t("right"),t("bottom");}function yc(e,i){let t=i.maxPadding;function n(s){let o={left:0,top:0,right:0,bottom:0};return s.forEach(a=>{o[a]=Math.max(i[a],t[a]);}),o;}return n(e?["left","right"]:["top","bottom"]);}function Ie(e,i,t,n){let s=[],o,a,r,l,c,h;for(o=0,a=e.length,c=0;o<a;++o){r=e[o],l=r.box,l.update(r.width||i.w,r.height||i.h,yc(r.horizontal,i));let{same:d,other:u}=_c(i,t,r,n);c|=d&&s.length,h=h||u,l.fullSize||s.push(r);}return c&&Ie(s,i,t,n)||h;}function wi(e,i,t,n,s){e.top=t,e.left=i,e.right=i+n,e.bottom=t+s,e.width=n,e.height=s;}function Go(e,i,t,n){let s=t.padding,{x:o,y:a}=i;for(let r of e){let l=r.box,c=n[r.stack]||{count:1,placed:0,weight:1},h=r.stackWeight/c.weight||1;if(r.horizontal){let d=i.w*h,u=c.size||l.height;ae(c.start)&&(a=c.start),l.fullSize?wi(l,s.left,a,t.outerWidth-s.right-s.left,u):wi(l,i.left+c.placed,a,d,u),c.start=a,c.placed+=d,a=l.bottom;}else{let d=i.h*h,u=c.size||l.width;ae(c.start)&&(o=c.start),l.fullSize?wi(l,o,s.top,u,t.outerHeight-s.bottom-s.top):wi(l,o,i.top+c.placed,u,d),c.start=o,c.placed+=d,o=l.right;}}i.x=o,i.y=a;}var Q={addBox(e,i){e.boxes||(e.boxes=[]),i.fullSize=i.fullSize||!1,i.position=i.position||"top",i.weight=i.weight||0,i._layers=i._layers||function(){return[{z:0,draw(t){i.draw(t);}}];},e.boxes.push(i);},removeBox(e,i){let t=e.boxes?e.boxes.indexOf(i):-1;t!==-1&&e.boxes.splice(t,1);},configure(e,i,t){i.fullSize=t.fullSize,i.position=t.position,i.weight=t.weight;},update(e,i,t,n){if(!e)return;let s=q(e.options.layout.padding),o=Math.max(i-s.width,0),a=Math.max(t-s.height,0),r=bc(e.boxes),l=r.vertical,c=r.horizontal;E(e.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout();});let h=l.reduce((g,m)=>m.box.options&&m.box.options.display===!1?g:g+1,0)||1,d=Object.freeze({outerWidth:i,outerHeight:t,padding:s,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/h,hBoxMaxHeight:a/2}),u=Object.assign({},s);ja(u,q(n));let f=Object.assign({maxPadding:u,w:o,h:a,x:s.left,y:s.top},s),p=mc(l.concat(c),d);Ie(r.fullSize,f,d,p),Ie(l,f,d,p),Ie(c,f,d,p)&&Ie(l,f,d,p),xc(f),Go(r.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,Go(r.rightAndBottom,f,d,p),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},E(r.chartArea,g=>{let m=g.box;Object.assign(m,e.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0});});}},Ri=class{acquireContext(i,t){}releaseContext(i){return!1;}addEventListener(i,t,n){}removeEventListener(i,t,n){}getDevicePixelRatio(){return 1;}getMaximumSize(i,t,n,s){return t=Math.max(0,t||i.width),n=n||i.height,{width:t,height:Math.max(0,s?Math.floor(t/s):n)};}isAttached(i){return!0;}updateConfig(i){}},$n=class extends Ri{acquireContext(i){return i&&i.getContext&&i.getContext("2d")||null;}updateConfig(i){i.options.animation=!1;}},Di="$chartjs",vc={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Jo=e=>e===null||e==="";function Mc(e,i){let t=e.style,n=e.getAttribute("height"),s=e.getAttribute("width");if(e[Di]={initial:{height:n,width:s,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",Jo(s)){let o=wn(e,"width");o!==void 0&&(e.width=o);}if(Jo(n))if(e.style.height==="")e.height=e.width/(i||2);else{let o=wn(e,"height");o!==void 0&&(e.height=o);}return e;}var $a=Eo?{passive:!0}:!1;function Cc(e,i,t){e&&e.addEventListener(i,t,$a);}function wc(e,i,t){e&&e.canvas&&e.canvas.removeEventListener(i,t,$a);}function Sc(e,i){let t=vc[e.type]||e.type,{x:n,y:s}=Ft(e,i);return{type:t,chart:i,native:e,x:n!==void 0?n:null,y:s!==void 0?s:null};}function Ei(e,i){for(let t of e)if(t===i||t.contains(i))return!0;}function kc(e,i,t){let n=e.canvas,s=new MutationObserver(o=>{let a=!1;for(let r of o)a=a||Ei(r.addedNodes,n),a=a&&!Ei(r.removedNodes,n);a&&t();});return s.observe(document,{childList:!0,subtree:!0}),s;}function Pc(e,i,t){let n=e.canvas,s=new MutationObserver(o=>{let a=!1;for(let r of o)a=a||Ei(r.removedNodes,n),a=a&&!Ei(r.addedNodes,n);a&&t();});return s.observe(document,{childList:!0,subtree:!0}),s;}var Ne=new Map(),Qo=0;function Ya(){let e=window.devicePixelRatio;e!==Qo&&(Qo=e,Ne.forEach((i,t)=>{t.currentDevicePixelRatio!==e&&i();}));}function Oc(e,i){Ne.size||window.addEventListener("resize",Ya),Ne.set(e,i);}function Lc(e){Ne.delete(e),Ne.size||window.removeEventListener("resize",Ya);}function Dc(e,i,t){let n=e.canvas,s=n&&Mi(n);if(!s)return;let o=dn((r,l)=>{let c=s.clientWidth;t(r,l),c<s.clientWidth&&t();},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(s),Oc(e,o),a;}function Fn(e,i,t){t&&t.disconnect(),i==="resize"&&Lc(e);}function Ac(e,i,t){let n=e.canvas,s=dn(o=>{e.ctx!==null&&t(Sc(o,e));},e);return Cc(n,i,s),s;}var Yn=class extends Ri{acquireContext(i,t){let n=i&&i.getContext&&i.getContext("2d");return n&&n.canvas===i?(Mc(i,t),n):null;}releaseContext(i){let t=i.canvas;if(!t[Di])return!1;let n=t[Di].initial;["height","width"].forEach(o=>{let a=n[o];D(a)?t.removeAttribute(o):t.setAttribute(o,a);});let s=n.style||{};return Object.keys(s).forEach(o=>{t.style[o]=s[o];}),t.width=t.width,delete t[Di],!0;}addEventListener(i,t,n){this.removeEventListener(i,t);let s=i.$proxies||(i.$proxies={}),a={attach:kc,detach:Pc,resize:Dc}[t]||Ac;s[t]=a(i,t,n);}removeEventListener(i,t){let n=i.$proxies||(i.$proxies={}),s=n[t];if(!s)return;({attach:Fn,detach:Fn,resize:Fn}[t]||wc)(i,t,s),n[t]=void 0;}getDevicePixelRatio(){return window.devicePixelRatio;}getMaximumSize(i,t,n,s){return Ro(i,t,n,s);}isAttached(i){let t=i&&Mi(i);return!!(t&&t.isConnected);}};function Tc(e){return!vi()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?$n:Yn;}var at=class{x;y;active=!1;options;$animations;tooltipPosition(i){let{x:t,y:n}=this.getProps(["x","y"],i);return{x:t,y:n};}hasValue(){return Yt(this.x)&&Yt(this.y);}getProps(i,t){let n=this.$animations;if(!t||!n)return this;let s={};return i.forEach(o=>{s[o]=n[o]&&n[o].active()?n[o]._to:this[o];}),s;}};w(at,"defaults",{}),w(at,"defaultRoutes");function Rc(e,i){let t=e.options.ticks,n=Ec(e),s=Math.min(t.maxTicksLimit||n,n),o=t.major.enabled?Fc(i):[],a=o.length,r=o[0],l=o[a-1],c=[];if(a>s)return zc(i,c,o,a/s),c;let h=Ic(o,i,s);if(a>0){let d,u,f=a>1?Math.round((l-r)/(a-1)):null;for(Si(i,c,h,D(f)?0:r-f,r),d=0,u=a-1;d<u;d++)Si(i,c,h,o[d],o[d+1]);return Si(i,c,h,l,D(f)?i.length:l+f),c;}return Si(i,c,h),c;}function Ec(e){let i=e.options.offset,t=e._tickSize(),n=e._length/t+(i?0:1),s=e._maxLength/t;return Math.floor(Math.min(n,s));}function Ic(e,i,t){let n=Bc(e),s=i.length/t;if(!n)return Math.max(s,1);let o=go(n);for(let a=0,r=o.length-1;a<r;a++){let l=o[a];if(l>s)return l;}return Math.max(s,1);}function Fc(e){let i=[],t,n;for(t=0,n=e.length;t<n;t++)e[t].major&&i.push(t);return i;}function zc(e,i,t,n){let s=0,o=t[0],a;for(n=Math.ceil(n),a=0;a<e.length;a++)a===o&&(i.push(e[a]),s++,o=t[s*n]);}function Si(e,i,t,n,s){let o=P(n,0),a=Math.min(P(s,e.length),e.length),r=0,l,c,h;for(t=Math.ceil(t),s&&(l=s-n,t=l/Math.floor(l/t)),h=o;h<0;)r++,h=Math.round(o+r*t);for(c=Math.max(o,0);c<a;c++)c===h&&(i.push(e[c]),r++,h=Math.round(o+r*t));}function Bc(e){let i=e.length,t,n;if(i<2)return!1;for(n=e[0],t=1;t<i;++t)if(e[t]-e[t-1]!==n)return!1;return n;}var Vc=e=>e==="left"?"right":e==="right"?"left":e,ta=(e,i,t)=>i==="top"||i==="left"?e[i]+t:e[i]-t,ea=(e,i)=>Math.min(i||e,e);function ia(e,i){let t=[],n=e.length/i,s=e.length,o=0;for(;o<s;o+=n)t.push(e[Math.floor(o)]);return t;}function Nc(e,i,t){let n=e.ticks.length,s=Math.min(i,n-1),o=e._startPixel,a=e._endPixel,r=1e-6,l=e.getPixelForTick(s),c;if(!(t&&(n===1?c=Math.max(l-o,a-l):i===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(s-1))/2,l+=s<i?c:-c,l<o-r||l>a+r)))return l;}function Hc(e,i){E(e,t=>{let n=t.gc,s=n.length/2,o;if(s>i){for(o=0;o<s;++o)delete t.data[n[o]];n.splice(0,s);}});}function Re(e){return e.drawTicks?e.tickLength:0;}function na(e,i){if(!e.display)return 0;let t=$(e.font,i),n=q(e.padding);return(z(e.text)?e.text.length:1)*t.lineHeight+n.height;}function Wc(e,i){return wt(e,{scale:i,type:"scale"});}function jc(e,i,t){return wt(e,{tick:t,index:i,type:"tick"});}function $c(e,i,t){let n=mi(e);return(t&&i!=="right"||!t&&i==="right")&&(n=Vc(n)),n;}function Yc(e,i,t,n){let{top:s,left:o,bottom:a,right:r,chart:l}=e,{chartArea:c,scales:h}=l,d=0,u,f,p,g=a-s,m=r-o;if(e.isHorizontal()){if(f=K(n,o,r),A(t)){let b=Object.keys(t)[0],_=t[b];p=h[b].getPixelForValue(_)+g-i;}else t==="center"?p=(c.bottom+c.top)/2+g-i:p=ta(e,t,i);u=r-o;}else{if(A(t)){let b=Object.keys(t)[0],_=t[b];f=h[b].getPixelForValue(_)-m+i;}else t==="center"?f=(c.left+c.right)/2-m+i:f=ta(e,t,i);p=K(n,a,s),d=t==="left"?-W:W;}return{titleX:f,titleY:p,maxWidth:u,rotation:d};}var Gt=class e extends at{constructor(i){super(),this.id=i.id,this.type=i.type,this.options=void 0,this.ctx=i.ctx,this.chart=i.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(i){this.options=i.setContext(this.getContext()),this.axis=i.axis,this._userMin=this.parse(i.min),this._userMax=this.parse(i.max),this._suggestedMin=this.parse(i.suggestedMin),this._suggestedMax=this.parse(i.suggestedMax);}parse(i,t){return i;}getUserBounds(){let{_userMin:i,_userMax:t,_suggestedMin:n,_suggestedMax:s}=this;return i=tt(i,Number.POSITIVE_INFINITY),t=tt(t,Number.NEGATIVE_INFINITY),n=tt(n,Number.POSITIVE_INFINITY),s=tt(s,Number.NEGATIVE_INFINITY),{min:tt(i,n),max:tt(t,s),minDefined:H(i),maxDefined:H(t)};}getMinMax(i){let{min:t,max:n,minDefined:s,maxDefined:o}=this.getUserBounds(),a;if(s&&o)return{min:t,max:n};let r=this.getMatchingVisibleMetas();for(let l=0,c=r.length;l<c;++l)a=r[l].controller.getMinMax(this,i),s||(t=Math.min(t,a.min)),o||(n=Math.max(n,a.max));return t=o&&t>n?n:t,n=s&&t>n?t:n,{min:tt(t,tt(n,t)),max:tt(n,tt(t,n))};}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0};}getTicks(){return this.ticks;}getLabels(){let i=this.chart.data;return this.options.labels||(this.isHorizontal()?i.xLabels:i.yLabels)||i.labels||[];}getLabelItems(i=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(i));}beforeLayout(){this._cache={},this._dataLimitsCached=!1;}beforeUpdate(){F(this.options.beforeUpdate,[this]);}update(i,t,n){let{beginAtZero:s,grace:o,ticks:a}=this.options,r=a.sampleSize;this.beforeUpdate(),this.maxWidth=i,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Po(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=r<this.ticks.length;this._convertTicksToLabels(l?ia(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Rc(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate();}configure(){let i=this.options.reverse,t,n;this.isHorizontal()?(t=this.left,n=this.right):(t=this.top,n=this.bottom,i=!i),this._startPixel=t,this._endPixel=n,this._reversePixels=i,this._length=n-t,this._alignToPixels=this.options.alignToPixels;}afterUpdate(){F(this.options.afterUpdate,[this]);}beforeSetDimensions(){F(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(){F(this.options.afterSetDimensions,[this]);}_callHooks(i){this.chart.notifyPlugins(i,this.getContext()),F(this.options[i],[this]);}beforeDataLimits(){this._callHooks("beforeDataLimits");}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits");}beforeBuildTicks(){this._callHooks("beforeBuildTicks");}buildTicks(){return[];}afterBuildTicks(){this._callHooks("afterBuildTicks");}beforeTickToLabelConversion(){F(this.options.beforeTickToLabelConversion,[this]);}generateTickLabels(i){let t=this.options.ticks,n,s,o;for(n=0,s=i.length;n<s;n++)o=i[n],o.label=F(t.callback,[o.value,n,i],this);}afterTickToLabelConversion(){F(this.options.afterTickToLabelConversion,[this]);}beforeCalculateLabelRotation(){F(this.options.beforeCalculateLabelRotation,[this]);}calculateLabelRotation(){let i=this.options,t=i.ticks,n=ea(this.ticks.length,i.ticks.maxTicksLimit),s=t.minRotation||0,o=t.maxRotation,a=s,r,l,c;if(!this._isVisible()||!t.display||s>=o||n<=1||!this.isHorizontal()){this.labelRotation=s;return;}let h=this._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=Y(this.chart.width-d,0,this.maxWidth);r=i.offset?this.maxWidth/n:f/(n-1),d+6>r&&(r=f/(n-(i.offset?.5:1)),l=this.maxHeight-Re(i.grid)-t.padding-na(i.title,this.chart.options.font),c=Math.sqrt(d*d+u*u),a=gi(Math.min(Math.asin(Y((h.highest.height+6)/r,-1,1)),Math.asin(Y(l/c,-1,1))-Math.asin(Y(u/c,-1,1)))),a=Math.max(s,Math.min(o,a))),this.labelRotation=a;}afterCalculateLabelRotation(){F(this.options.afterCalculateLabelRotation,[this]);}afterAutoSkip(){}beforeFit(){F(this.options.beforeFit,[this]);}fit(){let i={width:0,height:0},{chart:t,options:{ticks:n,title:s,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){let l=na(s,t.options.font);if(r?(i.width=this.maxWidth,i.height=Re(o)+l):(i.height=this.maxHeight,i.width=Re(o)+l),n.display&&this.ticks.length){let{first:c,last:h,widest:d,highest:u}=this._getLabelSizes(),f=n.padding*2,p=ct(this.labelRotation),g=Math.cos(p),m=Math.sin(p);if(r){let b=n.mirror?0:m*d.width+g*u.height;i.height=Math.min(this.maxHeight,i.height+b+f);}else{let b=n.mirror?0:g*d.width+m*u.height;i.width=Math.min(this.maxWidth,i.width+b+f);}this._calculatePadding(c,h,m,g);}}this._handleMargins(),r?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=i.height):(this.width=i.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom);}_calculatePadding(i,t,n,s){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=s*i.width,f=n*t.height):(u=n*i.height,f=s*t.width):o==="start"?f=t.width:o==="end"?u=i.width:o!=="inner"&&(u=i.width/2,f=t.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=t.height/2,d=i.height/2;o==="start"?(h=0,d=i.height):o==="end"&&(h=t.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(){F(this.options.afterFit,[this]);}isHorizontal(){let{axis:i,position:t}=this.options;return t==="top"||t==="bottom"||i==="x";}isFullSize(){return this.options.fullSize;}_convertTicksToLabels(i){this.beforeTickToLabelConversion(),this.generateTickLabels(i);let t,n;for(t=0,n=i.length;t<n;t++)D(i[t].label)&&(i.splice(t,1),n--,t--);this.afterTickToLabelConversion();}_getLabelSizes(){let i=this._labelSizes;if(!i){let t=this.options.ticks.sampleSize,n=this.ticks;t<n.length&&(n=ia(n,t)),this._labelSizes=i=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit);}return i;}_computeLabelSizes(i,t,n){let{ctx:s,_longestTextCache:o}=this,a=[],r=[],l=Math.floor(t/ea(t,n)),c=0,h=0,d,u,f,p,g,m,b,_,y,M,x;for(d=0;d<t;d+=l){if(p=i[d].label,g=this._resolveTickFontOptions(d),s.font=m=g.string,b=o[m]=o[m]||{data:{},gc:[]},_=g.lineHeight,y=M=0,!D(p)&&!z(p))y=Se(s,b.data,b.gc,y,p),M=_;else if(z(p))for(u=0,f=p.length;u<f;++u)x=p[u],!D(x)&&!z(x)&&(y=Se(s,b.data,b.gc,y,x),M+=_);a.push(y),r.push(M),c=Math.max(y,c),h=Math.max(M,h);}Hc(o,t);let v=a.indexOf(c),S=r.indexOf(h),C=k=>({width:a[k]||0,height:r[k]||0});return{first:C(0),last:C(t-1),widest:C(v),highest:C(S),widths:a,heights:r};}getLabelForValue(i){return i;}getPixelForValue(i,t){return NaN;}getValueForPixel(i){}getPixelForTick(i){let t=this.ticks;return i<0||i>t.length-1?null:this.getPixelForValue(t[i].value);}getPixelForDecimal(i){this._reversePixels&&(i=1-i);let t=this._startPixel+i*this._length;return mo(this._alignToPixels?Rt(this.chart,t,0):t);}getDecimalForPixel(i){let t=(i-this._startPixel)/this._length;return this._reversePixels?1-t:t;}getBasePixel(){return this.getPixelForValue(this.getBaseValue());}getBaseValue(){let{min:i,max:t}=this;return i<0&&t<0?t:i>0&&t>0?i:0;}getContext(i){let t=this.ticks||[];if(i>=0&&i<t.length){let n=t[i];return n.$context||(n.$context=jc(this.getContext(),i,n));}return this.$context||(this.$context=Wc(this.chart.getContext(),this));}_tickSize(){let i=this.options.ticks,t=ct(this.labelRotation),n=Math.abs(Math.cos(t)),s=Math.abs(Math.sin(t)),o=this._getLabelSizes(),a=i.autoSkipPadding||0,r=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return this.isHorizontal()?l*n>r*s?r/n:l/s:l*s<r*n?l/n:r/s;}_isVisible(){let i=this.options.display;return i!=="auto"?!!i:this.getMatchingVisibleMetas().length>0;}_computeGridLineItems(i){let t=this.axis,n=this.chart,s=this.options,{grid:o,position:a,border:r}=s,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),u=Re(o),f=[],p=r.setContext(this.getContext()),g=p.display?p.width:0,m=g/2,b=function(N){return Rt(n,N,g);},_,y,M,x,v,S,C,k,L,O,T,X;if(a==="top")_=b(this.bottom),S=this.bottom-u,k=_-m,O=b(i.top)+m,X=i.bottom;else if(a==="bottom")_=b(this.top),O=i.top,X=b(i.bottom)-m,S=_+m,k=this.top+u;else if(a==="left")_=b(this.right),v=this.right-u,C=_-m,L=b(i.left)+m,T=i.right;else if(a==="right")_=b(this.left),L=i.left,T=b(i.right)-m,v=_+m,C=this.left+u;else if(t==="x"){if(a==="center")_=b((i.top+i.bottom)/2+.5);else if(A(a)){let N=Object.keys(a)[0],j=a[N];_=b(this.chart.scales[N].getPixelForValue(j));}O=i.top,X=i.bottom,S=_+m,k=S+u;}else if(t==="y"){if(a==="center")_=b((i.left+i.right)/2);else if(A(a)){let N=Object.keys(a)[0],j=a[N];_=b(this.chart.scales[N].getPixelForValue(j));}v=_-m,C=v-u,L=i.left,T=i.right;}let nt=P(s.ticks.maxTicksLimit,d),I=Math.max(1,Math.ceil(d/nt));for(y=0;y<d;y+=I){let N=this.getContext(y),j=o.setContext(N),ht=r.setContext(N),G=j.lineWidth,Jt=j.color,$e=ht.dash||[],Qt=ht.dashOffset,me=j.tickWidth,Vt=j.tickColor,be=j.tickBorderDash||[],Nt=j.tickBorderDashOffset;M=Nc(this,y,l),M!==void 0&&(x=Rt(n,M,G),c?v=C=L=T=x:S=k=O=X=x,f.push({tx1:v,ty1:S,tx2:C,ty2:k,x1:L,y1:O,x2:T,y2:X,width:G,color:Jt,borderDash:$e,borderDashOffset:Qt,tickWidth:me,tickColor:Vt,tickBorderDash:be,tickBorderDashOffset:Nt}));}return this._ticksLength=d,this._borderValue=_,f;}_computeLabelItems(i){let t=this.axis,n=this.options,{position:s,ticks:o}=n,a=this.isHorizontal(),r=this.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=o,u=Re(n.grid),f=u+h,p=d?-h:f,g=-ct(this.labelRotation),m=[],b,_,y,M,x,v,S,C,k,L,O,T,X="middle";if(s==="top")v=this.bottom-p,S=this._getXAxisLabelAlignment();else if(s==="bottom")v=this.top+p,S=this._getXAxisLabelAlignment();else if(s==="left"){let I=this._getYAxisLabelAlignment(u);S=I.textAlign,x=I.x;}else if(s==="right"){let I=this._getYAxisLabelAlignment(u);S=I.textAlign,x=I.x;}else if(t==="x"){if(s==="center")v=(i.top+i.bottom)/2+f;else if(A(s)){let I=Object.keys(s)[0],N=s[I];v=this.chart.scales[I].getPixelForValue(N)+f;}S=this._getXAxisLabelAlignment();}else if(t==="y"){if(s==="center")x=(i.left+i.right)/2-f;else if(A(s)){let I=Object.keys(s)[0],N=s[I];x=this.chart.scales[I].getPixelForValue(N);}S=this._getYAxisLabelAlignment(u).textAlign;}t==="y"&&(l==="start"?X="top":l==="end"&&(X="bottom"));let nt=this._getLabelSizes();for(b=0,_=r.length;b<_;++b){y=r[b],M=y.label;let I=o.setContext(this.getContext(b));C=this.getPixelForTick(b)+o.labelOffset,k=this._resolveTickFontOptions(b),L=k.lineHeight,O=z(M)?M.length:1;let N=O/2,j=I.color,ht=I.textStrokeColor,G=I.textStrokeWidth,Jt=S;a?(x=C,S==="inner"&&(b===_-1?Jt=this.options.reverse?"left":"right":b===0?Jt=this.options.reverse?"right":"left":Jt="center"),s==="top"?c==="near"||g!==0?T=-O*L+L/2:c==="center"?T=-nt.highest.height/2-N*L+L:T=-nt.highest.height+L/2:c==="near"||g!==0?T=L/2:c==="center"?T=nt.highest.height/2-N*L:T=nt.highest.height-O*L,d&&(T*=-1),g!==0&&!I.showLabelBackdrop&&(x+=L/2*Math.sin(g))):(v=C,T=(1-O)*L/2);let $e;if(I.showLabelBackdrop){let Qt=q(I.backdropPadding),me=nt.heights[b],Vt=nt.widths[b],be=T-Qt.top,Nt=0-Qt.left;switch(X){case"middle":be-=me/2;break;case"bottom":be-=me;break;}switch(S){case"center":Nt-=Vt/2;break;case"right":Nt-=Vt;break;case"inner":b===_-1?Nt-=Vt:b>0&&(Nt-=Vt/2);break;}$e={left:Nt,top:be,width:Vt+Qt.width,height:me+Qt.height,color:I.backdropColor};}m.push({label:M,font:k,textOffset:T,options:{rotation:g,color:j,strokeColor:ht,strokeWidth:G,textAlign:Jt,textBaseline:X,translation:[x,v],backdrop:$e}});}return m;}_getXAxisLabelAlignment(){let{position:i,ticks:t}=this.options;if(-ct(this.labelRotation))return i==="top"?"left":"right";let s="center";return t.align==="start"?s="left":t.align==="end"?s="right":t.align==="inner"&&(s="inner"),s;}_getYAxisLabelAlignment(i){let{position:t,ticks:{crossAlign:n,mirror:s,padding:o}}=this.options,a=this._getLabelSizes(),r=i+o,l=a.widest.width,c,h;return t==="left"?s?(h=this.right+o,n==="near"?c="left":n==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-r,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h=this.left)):t==="right"?s?(h=this.left+o,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+r,n==="near"?c="left":n==="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 i=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:i.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:i.width};}drawBackground(){let{ctx:i,options:{backgroundColor:t},left:n,top:s,width:o,height:a}=this;t&&(i.save(),i.fillStyle=t,i.fillRect(n,s,o,a),i.restore());}getLineWidthForValue(i){let t=this.options.grid;if(!this._isVisible()||!t.display)return 0;let s=this.ticks.findIndex(o=>o.value===i);return s>=0?t.setContext(this.getContext(s)).lineWidth:0;}drawGrid(i){let t=this.options.grid,n=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(i)),o,a,r=(l,c,h)=>{!h.width||!h.color||(n.save(),n.lineWidth=h.width,n.strokeStyle=h.color,n.setLineDash(h.borderDash||[]),n.lineDashOffset=h.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(c.x,c.y),n.stroke(),n.restore());};if(t.display)for(o=0,a=s.length;o<a;++o){let l=s[o];t.drawOnChartArea&&r({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),t.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:i,ctx:t,options:{border:n,grid:s}}=this,o=n.setContext(this.getContext()),a=n.display?o.width:0;if(!a)return;let r=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue,c,h,d,u;this.isHorizontal()?(c=Rt(i,this.left,a)-a/2,h=Rt(i,this.right,r)+r/2,d=u=l):(d=Rt(i,this.top,a)-a/2,u=Rt(i,this.bottom,r)+r/2,c=h=l),t.save(),t.lineWidth=o.width,t.strokeStyle=o.color,t.beginPath(),t.moveTo(c,d),t.lineTo(h,u),t.stroke(),t.restore();}drawLabels(i){if(!this.options.ticks.display)return;let n=this.ctx,s=this._computeLabelArea();s&&Oe(n,s);let o=this.getLabelItems(i);for(let a of o){let r=a.options,l=a.font,c=a.label,h=a.textOffset;Et(n,c,0,h,l,r);}s&&Le(n);}drawTitle(){let{ctx:i,options:{position:t,title:n,reverse:s}}=this;if(!n.display)return;let o=$(n.font),a=q(n.padding),r=n.align,l=o.lineHeight/2;t==="bottom"||t==="center"||A(t)?(l+=a.bottom,z(n.text)&&(l+=o.lineHeight*(n.text.length-1))):l+=a.top;let{titleX:c,titleY:h,maxWidth:d,rotation:u}=Yc(this,l,t,r);Et(i,n.text,0,0,o,{color:n.color,maxWidth:d,rotation:u,textAlign:$c(r,t,s),textBaseline:"middle",translation:[c,h]});}draw(i){this._isVisible()&&(this.drawBackground(),this.drawGrid(i),this.drawBorder(),this.drawTitle(),this.drawLabels(i));}_layers(){let i=this.options,t=i.ticks&&i.ticks.z||0,n=P(i.grid&&i.grid.z,-1),s=P(i.border&&i.border.z,0);return!this._isVisible()||this.draw!==e.prototype.draw?[{z:t,draw:o=>{this.draw(o);}}]:[{z:n,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle();}},{z:s,draw:()=>{this.drawBorder();}},{z:t,draw:o=>{this.drawLabels(o);}}];}getMatchingVisibleMetas(i){let t=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",s=[],o,a;for(o=0,a=t.length;o<a;++o){let r=t[o];r[n]===this.id&&(!i||r.type===i)&&s.push(r);}return s;}_resolveTickFontOptions(i){let t=this.options.ticks.setContext(this.getContext(i));return $(t.font);}_maxDigits(){let i=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/i;}},ge=class{constructor(i,t,n){this.type=i,this.scope=t,this.override=n,this.items=Object.create(null);}isForType(i){return Object.prototype.isPrototypeOf.call(this.type.prototype,i.prototype);}register(i){let t=Object.getPrototypeOf(i),n;Zc(t)&&(n=this.register(t));let s=this.items,o=i.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+i);return o in s||(s[o]=i,Uc(i,a,n),this.override&&V.override(i.id,i.overrides)),a;}get(i){return this.items[i];}unregister(i){let t=this.items,n=i.id,s=this.scope;n in t&&delete t[n],s&&n in V[s]&&(delete V[s][n],this.override&&delete Tt[n]);}};function Uc(e,i,t){let n=ne(Object.create(null),[t?V.get(t):{},V.get(i),e.defaults]);V.set(i,n),e.defaultRoutes&&Xc(i,e.defaultRoutes),e.descriptors&&V.describe(i,e.descriptors);}function Xc(e,i){Object.keys(i).forEach(t=>{let n=t.split("."),s=n.pop(),o=[e].concat(n).join("."),a=i[t].split("."),r=a.pop(),l=a.join(".");V.route(o,s,l,r);});}function Zc(e){return"id"in e&&"defaults"in e;}var Un=class{constructor(){this.controllers=new ge(Bt,"datasets",!0),this.elements=new ge(at,"elements"),this.plugins=new ge(Object,"plugins"),this.scales=new ge(Gt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements];}add(...i){this._each("register",i);}remove(...i){this._each("unregister",i);}addControllers(...i){this._each("register",i,this.controllers);}addElements(...i){this._each("register",i,this.elements);}addPlugins(...i){this._each("register",i,this.plugins);}addScales(...i){this._each("register",i,this.scales);}getController(i){return this._get(i,this.controllers,"controller");}getElement(i){return this._get(i,this.elements,"element");}getPlugin(i){return this._get(i,this.plugins,"plugin");}getScale(i){return this._get(i,this.scales,"scale");}removeControllers(...i){this._each("unregister",i,this.controllers);}removeElements(...i){this._each("unregister",i,this.elements);}removePlugins(...i){this._each("unregister",i,this.plugins);}removeScales(...i){this._each("unregister",i,this.scales);}_each(i,t,n){[...t].forEach(s=>{let o=n||this._getRegistryForType(s);n||o.isForType(s)||o===this.plugins&&s.id?this._exec(i,o,s):E(s,a=>{let r=n||this._getRegistryForType(a);this._exec(i,r,a);});});}_exec(i,t,n){let s=fi(i);F(n["before"+s],[],n),t[i](n),F(n["after"+s],[],n);}_getRegistryForType(i){for(let t=0;t<this._typedRegistries.length;t++){let n=this._typedRegistries[t];if(n.isForType(i))return n;}return this.plugins;}_get(i,t,n){let s=t.get(i);if(s===void 0)throw new Error('"'+i+'" is not a registered '+n+".");return s;}},bt=new Un(),Xn=class{constructor(){this._init=void 0;}notify(i,t,n,s){if(t==="beforeInit"&&(this._init=this._createDescriptors(i,!0),this._notify(this._init,i,"install")),this._init===void 0)return;let o=s?this._descriptors(i).filter(s):this._descriptors(i),a=this._notify(o,i,t,n);return t==="afterDestroy"&&(this._notify(o,i,"stop"),this._notify(this._init,i,"uninstall"),this._init=void 0),a;}_notify(i,t,n,s){s=s||{};for(let o of i){let a=o.plugin,r=a[n],l=[t,s,o.options];if(F(r,l,a)===!1&&s.cancelable)return!1;}return!0;}invalidate(){D(this._cache)||(this._oldCache=this._cache,this._cache=void 0);}_descriptors(i){if(this._cache)return this._cache;let t=this._cache=this._createDescriptors(i);return this._notifyStateChanges(i),t;}_createDescriptors(i,t){let n=i&&i.config,s=P(n.options&&n.options.plugins,{}),o=Kc(n);return s===!1&&!t?[]:Gc(i,o,s,t);}_notifyStateChanges(i){let t=this._oldCache||[],n=this._cache,s=(o,a)=>o.filter(r=>!a.some(l=>r.plugin.id===l.plugin.id));this._notify(s(t,n),i,"stop"),this._notify(s(n,t),i,"start");}};function Kc(e){let i={},t=[],n=Object.keys(bt.plugins.items);for(let o=0;o<n.length;o++)t.push(bt.getPlugin(n[o]));let s=e.plugins||[];for(let o=0;o<s.length;o++){let a=s[o];t.indexOf(a)===-1&&(t.push(a),i[a.id]=!0);}return{plugins:t,localIds:i};}function qc(e,i){return!i&&e===!1?null:e===!0?{}:e;}function Gc(e,{plugins:i,localIds:t},n,s){let o=[],a=e.getContext();for(let r of i){let l=r.id,c=qc(n[l],s);c!==null&&o.push({plugin:r,options:Jc(e.config,{plugin:r,local:t[l]},c,a)});}return o;}function Jc(e,{plugin:i,local:t},n,s){let o=e.pluginScopeKeys(i),a=e.getOptionScopes(n,o);return t&&i.defaults&&a.push(i.defaults),e.createResolver(a,s,[""],{scriptable:!1,indexable:!1,allKeys:!0});}function Zn(e,i){let t=V.datasets[e]||{};return((i.datasets||{})[e]||{}).indexAxis||i.indexAxis||t.indexAxis||"x";}function Qc(e,i){let t=e;return e==="_index_"?t=i:e==="_value_"&&(t=i==="x"?"y":"x"),t;}function th(e,i){return e===i?"_index_":"_value_";}function sa(e){if(e==="x"||e==="y"||e==="r")return e;}function eh(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y";}function Kn(e,...i){if(sa(e))return e;for(let t of i){let n=t.axis||eh(t.position)||e.length>1&&sa(e[0].toLowerCase());if(n)return n;}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`);}function oa(e,i,t){if(t[i+"AxisID"]===e)return{axis:i};}function ih(e,i){if(i.data&&i.data.datasets){let t=i.data.datasets.filter(n=>n.xAxisID===e||n.yAxisID===e);if(t.length)return oa(e,"x",t[0])||oa(e,"y",t[0]);}return{};}function nh(e,i){let t=Tt[e.type]||{scales:{}},n=i.scales||{},s=Zn(e.type,i),o=Object.create(null);return Object.keys(n).forEach(a=>{let r=n[a];if(!A(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,ih(a,e),V.scales[r.type]),c=th(l,s),h=t.scales||{};o[a]=oe(Object.create(null),[{axis:l},r,h[l],h[c]]);}),e.data.datasets.forEach(a=>{let r=a.type||e.type,l=a.indexAxis||Zn(r,i),h=(Tt[r]||{}).scales||{};Object.keys(h).forEach(d=>{let u=Qc(d,l),f=a[u+"AxisID"]||u;o[f]=o[f]||Object.create(null),oe(o[f],[{axis:u},n[f],h[d]]);});}),Object.keys(o).forEach(a=>{let r=o[a];oe(r,[V.scales[r.type],V.scale]);}),o;}function Ua(e){let i=e.options||(e.options={});i.plugins=P(i.plugins,{}),i.scales=nh(e,i);}function Xa(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e;}function sh(e){return e=e||{},e.data=Xa(e.data),Ua(e),e;}var aa=new Map(),Za=new Set();function ki(e,i){let t=aa.get(e);return t||(t=i(),aa.set(e,t),Za.add(t)),t;}var Ee=(e,i,t)=>{let n=Ct(i,t);n!==void 0&&e.add(n);},qn=class{constructor(i){this._config=sh(i),this._scopeCache=new Map(),this._resolverCache=new Map();}get platform(){return this._config.platform;}get type(){return this._config.type;}set type(i){this._config.type=i;}get data(){return this._config.data;}set data(i){this._config.data=Xa(i);}get options(){return this._config.options;}set options(i){this._config.options=i;}get plugins(){return this._config.plugins;}update(){let i=this._config;this.clearCache(),Ua(i);}clearCache(){this._scopeCache.clear(),this._resolverCache.clear();}datasetScopeKeys(i){return ki(i,()=>[[`datasets.${i}`,""]]);}datasetAnimationScopeKeys(i,t){return ki(`${i}.transition.${t}`,()=>[[`datasets.${i}.transitions.${t}`,`transitions.${t}`],[`datasets.${i}`,""]]);}datasetElementScopeKeys(i,t){return ki(`${i}-${t}`,()=>[[`datasets.${i}.elements.${t}`,`datasets.${i}`,`elements.${t}`,""]]);}pluginScopeKeys(i){let t=i.id,n=this.type;return ki(`${n}-plugin-${t}`,()=>[[`plugins.${t}`,...(i.additionalOptionScopes||[])]]);}_cachedScopes(i,t){let n=this._scopeCache,s=n.get(i);return(!s||t)&&(s=new Map(),n.set(i,s)),s;}getOptionScopes(i,t,n){let{options:s,type:o}=this,a=this._cachedScopes(i,n),r=a.get(t);if(r)return r;let l=new Set();t.forEach(h=>{i&&(l.add(i),h.forEach(d=>Ee(l,i,d))),h.forEach(d=>Ee(l,s,d)),h.forEach(d=>Ee(l,Tt[o]||{},d)),h.forEach(d=>Ee(l,V,d)),h.forEach(d=>Ee(l,bi,d));});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Za.has(t)&&a.set(t,c),c;}chartOptionScopes(){let{options:i,type:t}=this;return[i,Tt[t]||{},V.datasets[t]||{},{type:t},V,bi];}resolveNamedOptions(i,t,n,s=[""]){let o={$shared:!0},{resolver:a,subPrefixes:r}=ra(this._resolverCache,i,s),l=a;if(ah(a,t)){o.$shared=!1,n=vt(n)?n():n;let c=this.createResolver(i,n,r);l=$t(a,n,c);}for(let c of t)o[c]=l[c];return o;}createResolver(i,t,n=[""],s){let{resolver:o}=ra(this._resolverCache,i,n);return A(t)?$t(o,t,void 0,s):o;}};function ra(e,i,t){let n=e.get(i);n||(n=new Map(),e.set(i,n));let s=t.join(),o=n.get(s);return o||(o={resolver:yi(i,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},n.set(s,o)),o;}var oh=e=>A(e)&&Object.getOwnPropertyNames(e).some(i=>vt(e[i]));function ah(e,i){let{isScriptable:t,isIndexable:n}=xn(e);for(let s of i){let o=t(s),a=n(s),r=(a||o)&&e[s];if(o&&(vt(r)||oh(r))||a&&z(r))return!0;}return!1;}var rh="4.5.1",lh=["top","bottom","left","right","chartArea"];function la(e,i){return e==="top"||e==="bottom"||lh.indexOf(e)===-1&&i==="x";}function ca(e,i){return function(t,n){return t[e]===n[e]?t[i]-n[i]:t[e]-n[e];};}function ha(e){let i=e.chart,t=i.options.animation;i.notifyPlugins("afterRender"),F(t&&t.onComplete,[e],i);}function ch(e){let i=e.chart,t=i.options.animation;F(t&&t.onProgress,[e],i);}function Ka(e){return vi()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e;}var Ai={},da=e=>{let i=Ka(e);return Object.values(Ai).filter(t=>t.canvas===i).pop();};function hh(e,i,t){let n=Object.keys(e);for(let s of n){let o=+s;if(o>=i){let a=e[s];delete e[s],(t>0||o>i)&&(e[o+t]=a);}}}function dh(e,i,t,n){return!t||e.type==="mouseout"?null:n?i:e;}var Bi=(()=>{class e{static register(...t){bt.add(...t),ua();}static unregister(...t){bt.remove(...t),ua();}constructor(t,n){let s=this.config=new qn(n),o=Ka(t),a=da(o);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas with ID '"+a.canvas.id+"' can be reused.");let r=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||Tc(o))(),this.platform.updateConfig(s);let l=this.platform.acquireContext(o,r.aspectRatio),c=l&&l.canvas,h=c&&c.height,d=c&&c.width;if(this.id=co(),this.ctx=l,this.canvas=c,this.width=d,this.height=h,this._options=r,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 Xn(),this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=vo(u=>this.update(u),r.resizeDelay||0),this._dataChanges=[],Ai[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return;}St.listen(this,"complete",ha),St.listen(this,"progress",ch),this._initialize(),this.attached&&this.update();}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:n},width:s,height:o,_aspectRatio:a}=this;return D(t)?n&&a?a:o?s/o: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 bt;}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Cn(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this;}clear(){return mn(this.canvas,this.ctx),this;}stop(){return St.stop(this),this;}resize(t,n){St.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n);}_resize(t,n){let s=this.options,o=this.canvas,a=s.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(o,t,n,a),l=s.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Cn(this,l,!0)&&(this.notifyPlugins("resize",{size:r}),F(s.onResize,[this,r],this),this.attached&&this._doResize(c)&&this.render());}ensureScalesHaveIDs(){let n=this.options.scales||{};E(n,(s,o)=>{s.id=o;});}buildOrUpdateScales(){let t=this.options,n=t.scales,s=this.scales,o=Object.keys(s).reduce((r,l)=>(r[l]=!1,r),{}),a=[];n&&(a=a.concat(Object.keys(n).map(r=>{let l=n[r],c=Kn(r,l),h=c==="r",d=c==="x";return{options:l,dposition:h?"chartArea":d?"bottom":"left",dtype:h?"radialLinear":d?"category":"linear"};}))),E(a,r=>{let l=r.options,c=l.id,h=Kn(c,l),d=P(l.type,r.dtype);(l.position===void 0||la(l.position,h)!==la(r.dposition))&&(l.position=r.dposition),o[c]=!0;let u=null;if(c in s&&s[c].type===d)u=s[c];else{let f=bt.getScale(d);u=new f({id:c,type:d,ctx:this.ctx,chart:this}),s[u.id]=u;}u.init(l,t);}),E(o,(r,l)=>{r||delete s[l];}),E(s,r=>{Q.configure(this,r,r.options),Q.addBox(this,r);});}_updateMetasets(){let t=this._metasets,n=this.data.datasets.length,s=t.length;if(t.sort((o,a)=>o.index-a.index),s>n){for(let o=n;o<s;++o)this._destroyDatasetMeta(o);t.splice(n,s-n);}this._sortedMetasets=t.slice(0).sort(ca("order","index"));}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((s,o)=>{n.filter(a=>a===s._dataset).length===0&&this._destroyDatasetMeta(o);});}buildOrUpdateControllers(){let t=[],n=this.data.datasets,s,o;for(this._removeUnreferencedMetasets(),s=0,o=n.length;s<o;s++){let a=n[s],r=this.getDatasetMeta(s),l=a.type||this.config.type;if(r.type&&r.type!==l&&(this._destroyDatasetMeta(s),r=this.getDatasetMeta(s)),r.type=l,r.indexAxis=a.indexAxis||Zn(l,this.options),r.order=a.order||0,r.index=s,r.label=""+a.label,r.visible=this.isDatasetVisible(s),r.controller)r.controller.updateIndex(s),r.controller.linkScales();else{let c=bt.getController(l),{datasetElementType:h,dataElementType:d}=V.datasets[l];Object.assign(c,{dataElementType:bt.getElement(d),datasetElementType:h&&bt.getElement(h)}),r.controller=new c(this,s),t.push(r.controller);}}return this._updateMetasets(),t;}_resetElements(){E(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset();},this);}reset(){this._resetElements(),this.notifyPlugins("reset");}update(t){let n=this.config;n.update();let s=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),o=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;let a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let h=0,d=this.data.datasets.length;h<d;h++){let{controller:u}=this.getDatasetMeta(h),f=!o&&a.indexOf(u)===-1;u.buildOrUpdateElements(f),r=Math.max(+u.getMaxOverflow(),r);}r=this._minPadding=s.layout.autoPadding?r:0,this._updateLayout(r),o||E(a,h=>{h.reset();}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(ca("z","_idx"));let{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render();}_updateScales(){E(this.scales,t=>{Q.removeBox(this,t);}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales();}_checkEventBindings(){let t=this.options,n=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!nn(n,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents());}_updateHiddenIndices(){let{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(let{method:s,start:o,count:a}of n){let r=s==="_removeElements"?-a:a;hh(t,o,r);}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let n=this.data.datasets.length,s=a=>new Set(t.filter(r=>r[0]===a).map((r,l)=>l+","+r.splice(1).join(","))),o=s(0);for(let a=1;a<n;a++)if(!nn(o,s(a)))return;return Array.from(o).map(a=>a.split(",")).map(a=>({method:a[1],start:+a[2],count:+a[3]}));}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Q.update(this,this.width,this.height,t);let n=this.chartArea,s=n.width<=0||n.height<=0;this._layers=[],E(this.boxes,o=>{s&&o.position==="chartArea"||(o.configure&&o.configure(),this._layers.push(...o._layers()));},this),this._layers.forEach((o,a)=>{o._idx=a;}),this.notifyPlugins("afterLayout");}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,s=this.data.datasets.length;n<s;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,s=this.data.datasets.length;n<s;++n)this._updateDataset(n,vt(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t});}}_updateDataset(t,n){let s=this.getDatasetMeta(t),o={meta:s,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",o)!==!1&&(s.controller._update(n),o.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",o));}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(St.has(this)?this.attached&&!St.running(this)&&St.start(this):(this.draw(),ha({chart:this})));}draw(){let t;if(this._resizeBeforeDraw){let{width:s,height:o}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(s,o);}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;let n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw");}_getSortedDatasetMetas(t){let n=this._sortedMetasets,s=[],o,a;for(o=0,a=n.length;o<a;++o){let r=n[o];(!t||r.visible)&&s.push(r);}return s;}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0);}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;let t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw");}_drawDataset(t){let n=this.ctx,s={meta:t,index:t.index,cancelable:!0},o=Ln(this,t);this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(o&&Oe(n,o),t.controller.draw(),o&&Le(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s));}isPointInArea(t){return ft(t,this.chartArea,this._minPadding);}getElementsAtEventForMode(t,n,s,o){let a=fc.modes[n];return typeof a=="function"?a(this,t,s,o):[];}getDatasetMeta(t){let n=this.data.datasets[t],s=this._metasets,o=s.filter(a=>a&&a._dataset===n).pop();return o||(o={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},s.push(o)),o;}getContext(){return this.$context||(this.$context=wt(null,{chart:this,type:"chart"}));}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length;}isDatasetVisible(t){let n=this.data.datasets[t];if(!n)return!1;let s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!n.hidden;}setDatasetVisibility(t,n){let s=this.getDatasetMeta(t);s.hidden=!n;}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t];}getDataVisibility(t){return!this._hiddenIndices[t];}_updateVisibility(t,n,s){let o=s?"show":"hide",a=this.getDatasetMeta(t),r=a.controller._resolveAnimations(void 0,o);ae(n)?(a.data[n].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),r.update(a,{visible:s}),this.update(l=>l.datasetIndex===t?o:void 0));}hide(t,n){this._updateVisibility(t,n,!1);}show(t,n){this._updateVisibility(t,n,!0);}_destroyDatasetMeta(t){let n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t];}_stop(){let t,n;for(this.stop(),St.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t);}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),mn(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Ai[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,n=this.platform,s=(a,r)=>{n.addEventListener(this,a,r),t[a]=r;},o=(a,r,l)=>{a.offsetX=r,a.offsetY=l,this._eventHandler(a);};E(this.options.events,a=>s(a,o));}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,n=this.platform,s=(c,h)=>{n.addEventListener(this,c,h),t[c]=h;},o=(c,h)=>{t[c]&&(n.removeEventListener(this,c,h),delete t[c]);},a=(c,h)=>{this.canvas&&this.resize(c,h);},r,l=()=>{o("attach",l),this.attached=!0,this.resize(),s("resize",a),s("detach",r);};r=()=>{this.attached=!1,o("resize",a),this._stop(),this._resize(0,0),s("attach",l);},n.isAttached(this.canvas)?l():r();}unbindEvents(){E(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t);}),this._listeners={},E(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t);}),this._responsiveListeners=void 0;}updateHoverStyle(t,n,s){let o=s?"set":"remove",a,r,l,c;for(n==="dataset"&&(a=this.getDatasetMeta(t[0].datasetIndex),a.controller["_"+o+"DatasetHoverStyle"]()),l=0,c=t.length;l<c;++l){r=t[l];let h=r&&this.getDatasetMeta(r.datasetIndex).controller;h&&h[o+"HoverStyle"](r.element,r.datasetIndex,r.index);}}getActiveElements(){return this._active||[];}setActiveElements(t){let n=this._active||[],s=t.map(({datasetIndex:a,index:r})=>{let l=this.getDatasetMeta(a);if(!l)throw new Error("No dataset found at index "+a);return{datasetIndex:a,element:l.data[r],index:r};});!ke(s,n)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,n));}notifyPlugins(t,n,s){return this._plugins.notify(this,t,n,s);}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1;}_updateHoverStyles(t,n,s){let o=this.options.hover,a=(c,h)=>c.filter(d=>!h.some(u=>d.datasetIndex===u.datasetIndex&&d.index===u.index)),r=a(n,t),l=s?t:a(t,n);r.length&&this.updateHoverStyle(r,o.mode,!1),l.length&&o.mode&&this.updateHoverStyle(l,o.mode,!0);}_eventHandler(t,n){let s={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},o=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,o)===!1)return;let a=this._handleEvent(t,n,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,o),(a||s.changed)&&this.render(),this;}_handleEvent(t,n,s){let{_active:o=[],options:a}=this,r=n,l=this._getActiveElements(t,o,s,r),c=fo(t),h=dh(t,this._lastEvent,s,c);s&&(this._lastEvent=null,F(a.onHover,[t,l,this],this),c&&F(a.onClick,[t,l,this],this));let d=!ke(l,o);return(d||n)&&(this._active=l,this._updateHoverStyles(l,o,n)),this._lastEvent=h,d;}_getActiveElements(t,n,s,o){if(t.type==="mouseout")return[];if(!s)return n;let a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,o);}}return w(e,"defaults",V),w(e,"instances",Ai),w(e,"overrides",Tt),w(e,"registry",bt),w(e,"version",rh),w(e,"getChart",da),e;})();function ua(){return E(Bi.instances,e=>e._plugins.invalidate());}function uh(e,i,t){let{startAngle:n,x:s,y:o,outerRadius:a,innerRadius:r,options:l}=i,{borderWidth:c,borderJoinStyle:h}=l,d=Math.min(c/a,Z(n-t));if(e.beginPath(),e.arc(s,o,a-c/2,n+d/2,t-d/2),r>0){let u=Math.min(c/r,Z(n-t));e.arc(s,o,r+c/2,t-u/2,n+u/2,!0);}else{let u=Math.min(c/2,a*Z(n-t));if(h==="round")e.arc(s,o,u,t-R/2,n+R/2,!0);else if(h==="bevel"){let f=2*u*u,p=-f*Math.cos(t+R/2)+s,g=-f*Math.sin(t+R/2)+o,m=f*Math.cos(n+R/2)+s,b=f*Math.sin(n+R/2)+o;e.lineTo(p,g),e.lineTo(m,b);}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd");}function fh(e,i,t){let{startAngle:n,pixelMargin:s,x:o,y:a,outerRadius:r,innerRadius:l}=i,c=s/r;e.beginPath(),e.arc(o,a,r,n-c,t+c),l>s?(c=s/l,e.arc(o,a,l,t+c,n-c,!0)):e.arc(o,a,s,t+W,n-W),e.closePath(),e.clip();}function gh(e){return xi(e,["outerStart","outerEnd","innerStart","innerEnd"]);}function ph(e,i,t,n){let s=gh(e.options.borderRadius),o=(t-i)/2,a=Math.min(o,n*i/2),r=l=>{let c=(t-Math.min(o,l))*n/2;return Y(l,0,Math.min(o,c));};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:Y(s.innerStart,0,a),innerEnd:Y(s.innerEnd,0,a)};}function ue(e,i,t,n){return{x:t+e*Math.cos(i),y:n+e*Math.sin(i)};}function Ii(e,i,t,n,s,o){let{x:a,y:r,startAngle:l,pixelMargin:c,innerRadius:h}=i,d=Math.max(i.outerRadius+n+t-c,0),u=h>0?h+n+t+c:0,f=0,p=s-l;if(n){let I=h>0?h-n:0,N=d>0?d-n:0,j=(I+N)/2,ht=j!==0?p*j/(j+n):p;f=(p-ht)/2;}let g=Math.max(.001,p*d-t/R)/d,m=(p-g)/2,b=l+m+f,_=s-m-f,{outerStart:y,outerEnd:M,innerStart:x,innerEnd:v}=ph(i,u,d,_-b),S=d-y,C=d-M,k=b+y/S,L=_-M/C,O=u+x,T=u+v,X=b+x/O,nt=_-v/T;if(e.beginPath(),o){let I=(k+L)/2;if(e.arc(a,r,d,k,I),e.arc(a,r,d,I,L),M>0){let G=ue(C,L,a,r);e.arc(G.x,G.y,M,L,_+W);}let N=ue(T,_,a,r);if(e.lineTo(N.x,N.y),v>0){let G=ue(T,nt,a,r);e.arc(G.x,G.y,v,_+W,nt+Math.PI);}let j=(_-v/u+(b+x/u))/2;if(e.arc(a,r,u,_-v/u,j,!0),e.arc(a,r,u,j,b+x/u,!0),x>0){let G=ue(O,X,a,r);e.arc(G.x,G.y,x,X+Math.PI,b-W);}let ht=ue(S,b,a,r);if(e.lineTo(ht.x,ht.y),y>0){let G=ue(S,k,a,r);e.arc(G.x,G.y,y,b-W,k);}}else{e.moveTo(a,r);let I=Math.cos(k)*d+a,N=Math.sin(k)*d+r;e.lineTo(I,N);let j=Math.cos(L)*d+a,ht=Math.sin(L)*d+r;e.lineTo(j,ht);}e.closePath();}function mh(e,i,t,n,s){let{fullCircles:o,startAngle:a,circumference:r}=i,l=i.endAngle;if(o){Ii(e,i,t,n,l,s);for(let c=0;c<o;++c)e.fill();isNaN(r)||(l=a+(r%B||B));}return Ii(e,i,t,n,l,s),e.fill(),l;}function bh(e,i,t,n,s){let{fullCircles:o,startAngle:a,circumference:r,options:l}=i,{borderWidth:c,borderJoinStyle:h,borderDash:d,borderDashOffset:u,borderRadius:f}=l,p=l.borderAlign==="inner";if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=u,p?(e.lineWidth=c*2,e.lineJoin=h||"round"):(e.lineWidth=c,e.lineJoin=h||"bevel");let g=i.endAngle;if(o){Ii(e,i,t,n,g,s);for(let m=0;m<o;++m)e.stroke();isNaN(r)||(g=a+(r%B||B));}p&&fh(e,i,g),l.selfJoin&&g-a>=R&&f===0&&h!=="miter"&&uh(e,i,g),o||(Ii(e,i,t,n,g,s),e.stroke());}var Kt=class extends at{circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(i){super(),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,i&&Object.assign(this,i);}inRange(i,t,n){let s=this.getProps(["x","y"],n),{angle:o,distance:a}=rn(s,{x:i,y:t}),{startAngle:r,endAngle:l,innerRadius:c,outerRadius:h,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),u=(this.options.spacing+this.options.borderWidth)/2,f=P(d,l-r),p=le(o,r,l)&&r!==l,g=f>=B||p,m=pt(a,c+u,h+u);return g&&m;}getCenterPoint(i){let{x:t,y:n,startAngle:s,endAngle:o,innerRadius:a,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],i),{offset:l,spacing:c}=this.options,h=(s+o)/2,d=(a+r+c+l)/2;return{x:t+Math.cos(h)*d,y:n+Math.sin(h)*d};}tooltipPosition(i){return this.getCenterPoint(i);}draw(i){let{options:t,circumference:n}=this,s=(t.offset||0)/4,o=(t.spacing||0)/2,a=t.circular;if(this.pixelMargin=t.borderAlign==="inner"?.33:0,this.fullCircles=n>B?Math.floor(n/B):0,n===0||this.innerRadius<0||this.outerRadius<0)return;i.save();let r=(this.startAngle+this.endAngle)/2;i.translate(Math.cos(r)*s,Math.sin(r)*s);let l=1-Math.sin(Math.min(R,n||0)),c=s*l;i.fillStyle=t.backgroundColor,i.strokeStyle=t.borderColor,mh(i,this,c,o,a),bh(i,this,c,o,a),i.restore();}};w(Kt,"id","arc"),w(Kt,"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}),w(Kt,"defaultRoutes",{backgroundColor:"backgroundColor"}),w(Kt,"descriptors",{_scriptable:!0,_indexable:i=>i!=="borderDash"});function qa(e,i,t=i){e.lineCap=P(t.borderCapStyle,i.borderCapStyle),e.setLineDash(P(t.borderDash,i.borderDash)),e.lineDashOffset=P(t.borderDashOffset,i.borderDashOffset),e.lineJoin=P(t.borderJoinStyle,i.borderJoinStyle),e.lineWidth=P(t.borderWidth,i.borderWidth),e.strokeStyle=P(t.borderColor,i.borderColor);}function _h(e,i,t){e.lineTo(t.x,t.y);}function xh(e){return e.stepped?So:e.tension||e.cubicInterpolationMode==="monotone"?ko:_h;}function Ga(e,i,t={}){let n=e.length,{start:s=0,end:o=n-1}=t,{start:a,end:r}=i,l=Math.max(s,a),c=Math.min(o,r),h=s<a&&o<a||s>r&&o>r;return{count:n,start:l,loop:i.loop,ilen:c<l&&!h?n+c-l:c-l};}function yh(e,i,t,n){let{points:s,options:o}=i,{count:a,start:r,loop:l,ilen:c}=Ga(s,t,n),h=xh(o),{move:d=!0,reverse:u}=n||{},f,p,g;for(f=0;f<=c;++f)p=s[(r+(u?c-f:f))%a],!p.skip&&(d?(e.moveTo(p.x,p.y),d=!1):h(e,g,p,u,o.stepped),g=p);return l&&(p=s[(r+(u?c:0))%a],h(e,g,p,u,o.stepped)),!!l;}function vh(e,i,t,n){let s=i.points,{count:o,start:a,ilen:r}=Ga(s,t,n),{move:l=!0,reverse:c}=n||{},h=0,d=0,u,f,p,g,m,b,_=M=>(a+(c?r-M:M))%o,y=()=>{g!==m&&(e.lineTo(h,m),e.lineTo(h,g),e.lineTo(h,b));};for(l&&(f=s[_(0)],e.moveTo(f.x,f.y)),u=0;u<=r;++u){if(f=s[_(u)],f.skip)continue;let M=f.x,x=f.y,v=M|0;v===p?(x<g?g=x:x>m&&(m=x),h=(d*h+M)/++d):(y(),e.lineTo(M,x),p=v,d=0,g=m=x),b=x;}y();}function Gn(e){let i=e.options,t=i.borderDash&&i.borderDash.length;return!e._decimated&&!e._loop&&!i.tension&&i.cubicInterpolationMode!=="monotone"&&!i.stepped&&!t?vh:yh;}function Mh(e){return e.stepped?Io:e.tension||e.cubicInterpolationMode==="monotone"?Fo:Dt;}function Ch(e,i,t,n){let s=i._path;s||(s=i._path=new Path2D(),i.path(s,t,n)&&s.closePath()),qa(e,i.options),e.stroke(s);}function wh(e,i,t,n){let{segments:s,options:o}=i,a=Gn(i);for(let r of s)qa(e,o,r.style),e.beginPath(),a(e,i,r,{start:t,end:t+n-1})&&e.closePath(),e.stroke();}var Sh=typeof Path2D=="function";function kh(e,i,t,n){Sh&&!i.options.segment?Ch(e,i,t,n):wh(e,i,t,n);}var Vi=(()=>{class e extends at{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,n){let s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){let o=s.spanGaps?this._loop:this._fullLoop;To(this._points,s,t,o,n),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=Bo(this,this.options.segment));}first(){let t=this.segments,n=this.points;return t.length&&n[t[0].start];}last(){let t=this.segments,n=this.points,s=t.length;return s&&n[t[s-1].end];}interpolate(t,n){let s=this.options,o=t[n],a=this.points,r=On(this,{property:n,start:o,end:o});if(!r.length)return;let l=[],c=Mh(s),h,d;for(h=0,d=r.length;h<d;++h){let{start:u,end:f}=r[h],p=a[u],g=a[f];if(p===g){l.push(p);continue;}let m=Math.abs((o-p[n])/(g[n]-p[n])),b=c(p,g,m,s.stepped);b[n]=t[n],l.push(b);}return l.length===1?l[0]:l;}pathSegment(t,n,s){return Gn(this)(t,this,n,s);}path(t,n,s){let o=this.segments,a=Gn(this),r=this._loop;n=n||0,s=s||this.points.length-n;for(let l of o)r&=a(t,this,l,{start:n,end:n+s-1});return!!r;}draw(t,n,s,o){let a=this.options||{};(this.points||[]).length&&a.borderWidth&&(t.save(),kh(t,this,s,o),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0);}}return w(e,"id","line"),w(e,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),w(e,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),w(e,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"}),e;})();function fa(e,i,t,n){let s=e.options,{[t]:o}=e.getProps([t],n);return Math.abs(i-o)<s.radius+s.hitRadius;}var Ph=(()=>{class e extends at{parsed;skip;stop;constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t);}inRange(t,n,s){let o=this.options,{x:a,y:r}=this.getProps(["x","y"],s);return Math.pow(t-a,2)+Math.pow(n-r,2)<Math.pow(o.hitRadius+o.radius,2);}inXRange(t,n){return fa(this,t,"x",n);}inYRange(t,n){return fa(this,t,"y",n);}getCenterPoint(t){let{x:n,y:s}=this.getProps(["x","y"],t);return{x:n,y:s};}size(t){t=t||this.options||{};let n=t.radius||0;n=Math.max(n,n&&t.hoverRadius||0);let s=n&&t.borderWidth||0;return(n+s)*2;}draw(t,n){let s=this.options;this.skip||s.radius<.1||!ft(this,n,this.size(s)/2)||(t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth,t.fillStyle=s.backgroundColor,_i(t,s,this.x,this.y));}getRange(){let t=this.options||{};return t.radius+t.hitRadius;}}return w(e,"id","point"),w(e,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),w(e,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),e;})();function Ja(e,i){let{x:t,y:n,base:s,width:o,height:a}=e.getProps(["x","y","base","width","height"],i),r,l,c,h,d;return e.horizontal?(d=a/2,r=Math.min(t,s),l=Math.max(t,s),c=n-d,h=n+d):(d=o/2,r=t-d,l=t+d,c=Math.min(n,s),h=Math.max(n,s)),{left:r,top:c,right:l,bottom:h};}function zt(e,i,t,n){return e?0:Y(i,t,n);}function Oh(e,i,t){let n=e.options.borderWidth,s=e.borderSkipped,o=_n(n);return{t:zt(s.top,o.top,0,t),r:zt(s.right,o.right,0,i),b:zt(s.bottom,o.bottom,0,t),l:zt(s.left,o.left,0,i)};}function Lh(e,i,t){let{enableBorderRadius:n}=e.getProps(["enableBorderRadius"]),s=e.options.borderRadius,o=It(s),a=Math.min(i,t),r=e.borderSkipped,l=n||A(s);return{topLeft:zt(!l||r.top||r.left,o.topLeft,0,a),topRight:zt(!l||r.top||r.right,o.topRight,0,a),bottomLeft:zt(!l||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:zt(!l||r.bottom||r.right,o.bottomRight,0,a)};}function Dh(e){let i=Ja(e),t=i.right-i.left,n=i.bottom-i.top,s=Oh(e,t/2,n/2),o=Lh(e,t/2,n/2);return{outer:{x:i.left,y:i.top,w:t,h:n,radius:o},inner:{x:i.left+s.l,y:i.top+s.t,w:t-s.l-s.r,h:n-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}};}function zn(e,i,t,n){let s=i===null,o=t===null,r=e&&!(s&&o)&&Ja(e,n);return r&&(s||pt(i,r.left,r.right))&&(o||pt(t,r.top,r.bottom));}function Ah(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight;}function Th(e,i){e.rect(i.x,i.y,i.w,i.h);}function Bn(e,i,t={}){let n=e.x!==t.x?-i:0,s=e.y!==t.y?-i:0,o=(e.x+e.w!==t.x+t.w?i:0)-n,a=(e.y+e.h!==t.y+t.h?i:0)-s;return{x:e.x+n,y:e.y+s,w:e.w+o,h:e.h+a,radius:e.radius};}var fe=class extends at{constructor(i){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,i&&Object.assign(this,i);}draw(i){let{inflateAmount:t,options:{borderColor:n,backgroundColor:s}}=this,{inner:o,outer:a}=Dh(this),r=Ah(a.radius)?he:Th;i.save(),(a.w!==o.w||a.h!==o.h)&&(i.beginPath(),r(i,Bn(a,t,o)),i.clip(),r(i,Bn(o,-t,a)),i.fillStyle=n,i.fill("evenodd")),i.beginPath(),r(i,Bn(o,t)),i.fillStyle=s,i.fill(),i.restore();}inRange(i,t,n){return zn(this,i,t,n);}inXRange(i,t){return zn(this,i,null,t);}inYRange(i,t){return zn(this,null,i,t);}getCenterPoint(i){let{x:t,y:n,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],i);return{x:o?(t+s)/2:t,y:o?n:(n+s)/2};}getRange(i){return i==="x"?this.width/2:this.height/2;}};w(fe,"id","bar"),w(fe,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),w(fe,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Rh=Object.freeze({__proto__:null,ArcElement:Kt,BarElement:fe,LineElement:Vi,PointElement:Ph}),Jn=["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)"],ga=Jn.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function Qa(e){return Jn[e%Jn.length];}function tr(e){return ga[e%ga.length];}function Eh(e,i){return e.borderColor=Qa(i),e.backgroundColor=tr(i),++i;}function Ih(e,i){return e.backgroundColor=e.data.map(()=>Qa(i++)),i;}function Fh(e,i){return e.backgroundColor=e.data.map(()=>tr(i++)),i;}function zh(e){let i=0;return(t,n)=>{let s=e.getDatasetMeta(n).controller;s instanceof is?i=Ih(t,i):s instanceof Ha?i=Fh(t,i):s&&(i=Eh(t,i));};}function pa(e){let i;for(i in e)if(e[i].borderColor||e[i].backgroundColor)return!0;return!1;}function Bh(e){return e&&(e.borderColor||e.backgroundColor);}function Vh(){return V.borderColor!=="rgba(0,0,0,0.1)"||V.backgroundColor!=="rgba(0,0,0,0.1)";}var Nh={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,i,t){if(!t.enabled)return;let{data:{datasets:n},options:s}=e.config,{elements:o}=s,a=pa(n)||Bh(s)||o&&pa(o)||Vh();if(!t.forceOverride&&a)return;let r=zh(e);n.forEach(r);}};function Hh(e,i,t,n,s){let o=s.samples||n;if(o>=t)return e.slice(i,i+t);let a=[],r=(t-2)/(o-2),l=0,c=i+t-1,h=i,d,u,f,p,g;for(a[l++]=e[h],d=0;d<o-2;d++){let m=0,b=0,_,y=Math.floor((d+1)*r)+1+i,M=Math.min(Math.floor((d+2)*r)+1,t)+i,x=M-y;for(_=y;_<M;_++)m+=e[_].x,b+=e[_].y;m/=x,b/=x;let v=Math.floor(d*r)+1+i,S=Math.min(Math.floor((d+1)*r)+1,t)+i,{x:C,y:k}=e[h];for(f=p=-1,_=v;_<S;_++)p=.5*Math.abs((C-m)*(e[_].y-k)-(C-e[_].x)*(b-k)),p>f&&(f=p,u=e[_],g=_);a[l++]=u,h=g;}return a[l++]=e[c],a;}function Wh(e,i,t,n){let s=0,o=0,a,r,l,c,h,d,u,f,p,g,m=[],b=i+t-1,_=e[i].x,M=e[b].x-_;for(a=i;a<i+t;++a){r=e[a],l=(r.x-_)/M*n,c=r.y;let x=l|0;if(x===h)c<p?(p=c,d=a):c>g&&(g=c,u=a),s=(o*s+r.x)/++o;else{let v=a-1;if(!D(d)&&!D(u)){let S=Math.min(d,u),C=Math.max(d,u);S!==f&&S!==v&&m.push(Ue(Ye({},e[S]),{x:s})),C!==f&&C!==v&&m.push(Ue(Ye({},e[C]),{x:s}));}a>0&&v!==f&&m.push(e[v]),m.push(r),h=x,o=0,p=g=c,d=u=f=a;}}return m;}function er(e){if(e._decimated){let i=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:i});}}function ma(e){e.data.datasets.forEach(i=>{er(i);});}function jh(e,i){let t=i.length,n=0,s,{iScale:o}=e,{min:a,max:r,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(n=Y(ut(i,o.axis,a).lo,0,t-1)),c?s=Y(ut(i,o.axis,r).hi+1,n,t)-n:s=t-n,{start:n,count:s};}var $h={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,i,t)=>{if(!t.enabled){ma(e);return;}let n=e.width;e.data.datasets.forEach((s,o)=>{let{_data:a,indexAxis:r}=s,l=e.getDatasetMeta(o),c=a||s.data;if(de([r,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;let h=e.scales[l.xAxisID];if(h.type!=="linear"&&h.type!=="time"||e.options.parsing)return;let{start:d,count:u}=jh(l,c),f=t.threshold||4*n;if(u<=f){er(s);return;}D(a)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated;},set:function(g){this._data=g;}}));let p;switch(t.algorithm){case"lttb":p=Hh(c,d,u,n,t);break;case"min-max":p=Wh(c,d,u,n);break;default:throw new Error(`Unsupported decimation algorithm '${t.algorithm}'`);}s._decimated=p;});},destroy(e){ma(e);}};function Yh(e,i,t){let n=e.segments,s=e.points,o=i.points,a=[];for(let r of n){let{start:l,end:c}=r;c=Ni(l,c,s);let h=Qn(t,s[l],s[c],r.loop);if(!i.segments){a.push({source:r,target:h,start:s[l],end:s[c]});continue;}let d=On(i,h);for(let u of d){let f=Qn(t,o[u.start],o[u.end],u.loop),p=Pn(r,s,f);for(let g of p)a.push({source:g,target:u,start:{[t]:ba(h,f,"start",Math.max)},end:{[t]:ba(h,f,"end",Math.min)}});}}return a;}function Qn(e,i,t,n){if(n)return;let s=i[e],o=t[e];return e==="angle"&&(s=Z(s),o=Z(o)),{property:e,start:s,end:o};}function Uh(e,i){let{x:t=null,y:n=null}=e||{},s=i.points,o=[];return i.segments.forEach(({start:a,end:r})=>{r=Ni(a,r,s);let l=s[a],c=s[r];n!==null?(o.push({x:l.x,y:n}),o.push({x:c.x,y:n})):t!==null&&(o.push({x:t,y:l.y}),o.push({x:t,y:c.y}));}),o;}function Ni(e,i,t){for(;i>e;i--){let n=t[i];if(!isNaN(n.x)&&!isNaN(n.y))break;}return i;}function ba(e,i,t,n){return e&&i?n(e[t],i[t]):e?e[t]:i?i[t]:0;}function ir(e,i){let t=[],n=!1;return z(e)?(n=!0,t=e):t=Uh(e,i),t.length?new Vi({points:t,options:{tension:0},_loop:n,_fullLoop:n}):null;}function _a(e){return e&&e.fill!==!1;}function Xh(e,i,t){let s=e[i].fill,o=[i],a;if(!t)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!H(s))return s;if(a=e[s],!a)return!1;if(a.visible)return s;o.push(s),s=a.fill;}return!1;}function Zh(e,i,t){let n=Jh(e);if(A(n))return isNaN(n.value)?!1:n;let s=parseFloat(n);return H(s)&&Math.floor(s)===s?Kh(n[0],i,s,t):["origin","start","end","stack","shape"].indexOf(n)>=0&&n;}function Kh(e,i,t,n){return(e==="-"||e==="+")&&(t=i+t),t===i||t<0||t>=n?!1:t;}function qh(e,i){let t=null;return e==="start"?t=i.bottom:e==="end"?t=i.top:A(e)?t=i.getPixelForValue(e.value):i.getBasePixel&&(t=i.getBasePixel()),t;}function Gh(e,i,t){let n;return e==="start"?n=t:e==="end"?n=i.options.reverse?i.min:i.max:A(e)?n=e.value:n=i.getBaseValue(),n;}function Jh(e){let i=e.options,t=i.fill,n=P(t&&t.target,t);return n===void 0&&(n=!!i.backgroundColor),n===!1||n===null?!1:n===!0?"origin":n;}function Qh(e){let{scale:i,index:t,line:n}=e,s=[],o=n.segments,a=n.points,r=td(i,t);r.push(ir({x:null,y:i.bottom},n));for(let l=0;l<o.length;l++){let c=o[l];for(let h=c.start;h<=c.end;h++)ed(s,a[h],r);}return new Vi({points:s,options:{}});}function td(e,i){let t=[],n=e.getMatchingVisibleMetas("line");for(let s=0;s<n.length;s++){let o=n[s];if(o.index===i)break;o.hidden||t.unshift(o.dataset);}return t;}function ed(e,i,t){let n=[];for(let s=0;s<t.length;s++){let o=t[s],{first:a,last:r,point:l}=id(o,i,"x");if(!(!l||a&&r)){if(a)n.unshift(l);else if(e.push(l),!r)break;}}e.push(...n);}function id(e,i,t){let n=e.interpolate(i,t);if(!n)return{};let s=n[t],o=e.segments,a=e.points,r=!1,l=!1;for(let c=0;c<o.length;c++){let h=o[c],d=a[h.start][t],u=a[h.end][t];if(pt(s,d,u)){r=s===d,l=s===u;break;}}return{first:r,last:l,point:n};}var Fi=class{constructor(i){this.x=i.x,this.y=i.y,this.radius=i.radius;}pathSegment(i,t,n){let{x:s,y:o,radius:a}=this;return t=t||{start:0,end:B},i.arc(s,o,a,t.end,t.start,!0),!n.bounds;}interpolate(i){let{x:t,y:n,radius:s}=this,o=i.angle;return{x:t+Math.cos(o)*s,y:n+Math.sin(o)*s,angle:o};}};function nd(e){let{chart:i,fill:t,line:n}=e;if(H(t))return sd(i,t);if(t==="stack")return Qh(e);if(t==="shape")return!0;let s=od(e);return s instanceof Fi?s:ir(s,n);}function sd(e,i){let t=e.getDatasetMeta(i);return t&&e.isDatasetVisible(i)?t.dataset:null;}function od(e){return(e.scale||{}).getPointPositionForValue?rd(e):ad(e);}function ad(e){let{scale:i={},fill:t}=e,n=qh(t,i);if(H(n)){let s=i.isHorizontal();return{x:s?n:null,y:s?null:n};}return null;}function rd(e){let{scale:i,fill:t}=e,n=i.options,s=i.getLabels().length,o=n.reverse?i.max:i.min,a=Gh(t,i,o),r=[];if(n.grid.circular){let l=i.getPointPositionForValue(0,o);return new Fi({x:l.x,y:l.y,radius:i.getDistanceFromCenterForValue(a)});}for(let l=0;l<s;++l)r.push(i.getPointPositionForValue(l,a));return r;}function Vn(e,i,t){let n=nd(i),{chart:s,index:o,line:a,scale:r,axis:l}=i,c=a.options,h=c.fill,d=c.backgroundColor,{above:u=d,below:f=d}=h||{},p=s.getDatasetMeta(o),g=Ln(s,p);n&&a.points.length&&(Oe(e,t),ld(e,{line:a,target:n,above:u,below:f,area:t,scale:r,axis:l,clip:g}),Le(e));}function ld(e,i){let{line:t,target:n,above:s,below:o,area:a,scale:r,clip:l}=i,c=t._loop?"angle":i.axis;e.save();let h=o;o!==s&&(c==="x"?(xa(e,n,a.top),Nn(e,{line:t,target:n,color:s,scale:r,property:c,clip:l}),e.restore(),e.save(),xa(e,n,a.bottom)):c==="y"&&(ya(e,n,a.left),Nn(e,{line:t,target:n,color:o,scale:r,property:c,clip:l}),e.restore(),e.save(),ya(e,n,a.right),h=s)),Nn(e,{line:t,target:n,color:h,scale:r,property:c,clip:l}),e.restore();}function xa(e,i,t){let{segments:n,points:s}=i,o=!0,a=!1;e.beginPath();for(let r of n){let{start:l,end:c}=r,h=s[l],d=s[Ni(l,c,s)];o?(e.moveTo(h.x,h.y),o=!1):(e.lineTo(h.x,t),e.lineTo(h.x,h.y)),a=!!i.pathSegment(e,r,{move:a}),a?e.closePath():e.lineTo(d.x,t);}e.lineTo(i.first().x,t),e.closePath(),e.clip();}function ya(e,i,t){let{segments:n,points:s}=i,o=!0,a=!1;e.beginPath();for(let r of n){let{start:l,end:c}=r,h=s[l],d=s[Ni(l,c,s)];o?(e.moveTo(h.x,h.y),o=!1):(e.lineTo(t,h.y),e.lineTo(h.x,h.y)),a=!!i.pathSegment(e,r,{move:a}),a?e.closePath():e.lineTo(t,d.y);}e.lineTo(t,i.first().y),e.closePath(),e.clip();}function Nn(e,i){let{line:t,target:n,property:s,color:o,scale:a,clip:r}=i,l=Yh(t,n,s);for(let{source:c,target:h,start:d,end:u}of l){let{style:{backgroundColor:f=o}={}}=c,p=n!==!0;e.save(),e.fillStyle=f,cd(e,a,r,p&&Qn(s,d,u)),e.beginPath();let g=!!t.pathSegment(e,c),m;if(p){g?e.closePath():va(e,n,u,s);let b=!!n.pathSegment(e,h,{move:g,reverse:!0});m=g&&b,m||va(e,n,d,s);}e.closePath(),e.fill(m?"evenodd":"nonzero"),e.restore();}}function cd(e,i,t,n){let s=i.chart.chartArea,{property:o,start:a,end:r}=n||{};if(o==="x"||o==="y"){let l,c,h,d;o==="x"?(l=a,c=s.top,h=r,d=s.bottom):(l=s.left,c=a,h=s.right,d=r),e.beginPath(),t&&(l=Math.max(l,t.left),h=Math.min(h,t.right),c=Math.max(c,t.top),d=Math.min(d,t.bottom)),e.rect(l,c,h-l,d-c),e.clip();}}function va(e,i,t,n){let s=i.interpolate(t,n);s&&e.lineTo(s.x,s.y);}var hd={id:"filler",afterDatasetsUpdate(e,i,t){let n=(e.data.datasets||[]).length,s=[],o,a,r,l;for(a=0;a<n;++a)o=e.getDatasetMeta(a),r=o.dataset,l=null,r&&r.options&&r instanceof Vi&&(l={visible:e.isDatasetVisible(a),index:a,fill:Zh(r,a,n),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=l,s.push(l);for(a=0;a<n;++a)l=s[a],!(!l||l.fill===!1)&&(l.fill=Xh(s,a,t.propagate));},beforeDraw(e,i,t){let n=t.drawTime==="beforeDraw",s=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let a=s.length-1;a>=0;--a){let r=s[a].$filler;r&&(r.line.updateControlPoints(o,r.axis),n&&r.fill&&Vn(e.ctx,r,o));}},beforeDatasetsDraw(e,i,t){if(t.drawTime!=="beforeDatasetsDraw")return;let n=e.getSortedVisibleDatasetMetas();for(let s=n.length-1;s>=0;--s){let o=n[s].$filler;_a(o)&&Vn(e.ctx,o,e.chartArea);}},beforeDatasetDraw(e,i,t){let n=i.meta.$filler;!_a(n)||t.drawTime!=="beforeDatasetDraw"||Vn(e.ctx,n,e.chartArea);},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},Ma=(e,i)=>{let{boxHeight:t=i,boxWidth:n=i}=e;return e.usePointStyle&&(t=Math.min(t,i),n=e.pointStyleWidth||Math.min(n,i)),{boxWidth:n,boxHeight:t,itemHeight:Math.max(i,t)};},dd=(e,i)=>e!==null&&i!==null&&e.datasetIndex===i.datasetIndex&&e.index===i.index,zi=class extends at{constructor(i){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=i.chart,this.options=i.options,this.ctx=i.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(i,t,n){this.maxWidth=i,this.maxHeight=t,this._margins=n,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 i=this.options.labels||{},t=F(i.generateLabels,[this.chart],this)||[];i.filter&&(t=t.filter(n=>i.filter(n,this.chart.data))),i.sort&&(t=t.sort((n,s)=>i.sort(n,s,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t;}fit(){let{options:i,ctx:t}=this;if(!i.display){this.width=this.height=0;return;}let n=i.labels,s=$(n.font),o=s.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:l}=Ma(n,o),c,h;t.font=s.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(a,o,r,l)+10):(h=this.maxHeight,c=this._fitCols(a,s,r,l)+10),this.width=Math.min(c,i.maxWidth||this.maxWidth),this.height=Math.min(h,i.maxHeight||this.maxHeight);}_fitRows(i,t,n,s){let{ctx:o,maxWidth:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=s+r,d=i;o.textAlign="left",o.textBaseline="middle";let u=-1,f=-h;return this.legendItems.forEach((p,g)=>{let m=n+t/2+o.measureText(p.text).width;(g===0||c[c.length-1]+m+2*r>a)&&(d+=h,c[c.length-(g>0?0:1)]=0,f+=h,u++),l[g]={left:0,top:f,row:u,width:m,height:s},c[c.length-1]+=m+r;}),d;}_fitCols(i,t,n,s){let{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=a-i,d=r,u=0,f=0,p=0,g=0;return this.legendItems.forEach((m,b)=>{let{itemWidth:_,itemHeight:y}=ud(n,t,o,m,s);b>0&&f+y+2*r>h&&(d+=u+r,c.push({width:u,height:f}),p+=u+r,g++,u=f=0),l[b]={left:p,top:f,col:g,width:_,height:y},u=Math.max(u,_),f+=y+r;}),d+=u,c.push({width:u,height:f}),d;}adjustHitBoxes(){if(!this.options.display)return;let i=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:n,labels:{padding:s},rtl:o}}=this,a=Ut(o,this.left,this.width);if(this.isHorizontal()){let r=0,l=K(n,this.left+s,this.right-this.lineWidths[r]);for(let c of t)r!==c.row&&(r=c.row,l=K(n,this.left+s,this.right-this.lineWidths[r])),c.top+=this.top+i+s,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+s;}else{let r=0,l=K(n,this.top+i+s,this.bottom-this.columnSizes[r].height);for(let c of t)c.col!==r&&(r=c.col,l=K(n,this.top+i+s,this.bottom-this.columnSizes[r].height)),c.top=l,c.left+=this.left+s,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+s;}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom";}draw(){if(this.options.display){let i=this.ctx;Oe(i,this),this._draw(),Le(i);}}_draw(){let{options:i,columnSizes:t,lineWidths:n,ctx:s}=this,{align:o,labels:a}=i,r=V.color,l=Ut(i.rtl,this.left,this.width),c=$(a.font),{padding:h}=a,d=c.size,u=d/2,f;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;let{boxWidth:p,boxHeight:g,itemHeight:m}=Ma(a,d),b=function(v,S,C){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;s.save();let k=P(C.lineWidth,1);if(s.fillStyle=P(C.fillStyle,r),s.lineCap=P(C.lineCap,"butt"),s.lineDashOffset=P(C.lineDashOffset,0),s.lineJoin=P(C.lineJoin,"miter"),s.lineWidth=k,s.strokeStyle=P(C.strokeStyle,r),s.setLineDash(P(C.lineDash,[])),a.usePointStyle){let L={radius:g*Math.SQRT2/2,pointStyle:C.pointStyle,rotation:C.rotation,borderWidth:k},O=l.xPlus(v,p/2),T=S+u;bn(s,L,O,T,a.pointStyleWidth&&p);}else{let L=S+Math.max((d-g)/2,0),O=l.leftForLtr(v,p),T=It(C.borderRadius);s.beginPath(),Object.values(T).some(X=>X!==0)?he(s,{x:O,y:L,w:p,h:g,radius:T}):s.rect(O,L,p,g),s.fill(),k!==0&&s.stroke();}s.restore();},_=function(v,S,C){Et(s,C.text,v,S+m/2,c,{strikethrough:C.hidden,textAlign:l.textAlign(C.textAlign)});},y=this.isHorizontal(),M=this._computeTitleHeight();y?f={x:K(o,this.left+h,this.right-n[0]),y:this.top+h+M,line:0}:f={x:this.left+h,y:K(o,this.top+M+h,this.bottom-t[0].height),line:0},Sn(this.ctx,i.textDirection);let x=m+h;this.legendItems.forEach((v,S)=>{s.strokeStyle=v.fontColor,s.fillStyle=v.fontColor;let C=s.measureText(v.text).width,k=l.textAlign(v.textAlign||(v.textAlign=a.textAlign)),L=p+u+C,O=f.x,T=f.y;l.setWidth(this.width),y?S>0&&O+L+h>this.right&&(T=f.y+=x,f.line++,O=f.x=K(o,this.left+h,this.right-n[f.line])):S>0&&T+x>this.bottom&&(O=f.x=O+t[f.line].width+h,f.line++,T=f.y=K(o,this.top+M+h,this.bottom-t[f.line].height));let X=l.x(O);if(b(X,T,v),O=Mo(k,O+p+u,y?O+L:this.right,i.rtl),_(l.x(O),T,v),y)f.x+=L+h;else if(typeof v.text!="string"){let nt=c.lineHeight;f.y+=nr(v,nt)+h;}else f.y+=x;}),kn(this.ctx,i.textDirection);}drawTitle(){let i=this.options,t=i.title,n=$(t.font),s=q(t.padding);if(!t.display)return;let o=Ut(i.rtl,this.left,this.width),a=this.ctx,r=t.position,l=n.size/2,c=s.top+l,h,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+c,d=K(i.align,d,this.right-u);else{let p=this.columnSizes.reduce((g,m)=>Math.max(g,m.height),0);h=c+K(i.align,this.top,this.bottom-p-i.labels.padding-this._computeTitleHeight());}let f=K(r,d,d+u);a.textAlign=o.textAlign(mi(r)),a.textBaseline="middle",a.strokeStyle=t.color,a.fillStyle=t.color,a.font=n.string,Et(a,t.text,f,h,n);}_computeTitleHeight(){let i=this.options.title,t=$(i.font),n=q(i.padding);return i.display?t.lineHeight+n.height:0;}_getLegendItemAt(i,t){let n,s,o;if(pt(i,this.left,this.right)&&pt(t,this.top,this.bottom)){for(o=this.legendHitBoxes,n=0;n<o.length;++n)if(s=o[n],pt(i,s.left,s.left+s.width)&&pt(t,s.top,s.top+s.height))return this.legendItems[n];}return null;}handleEvent(i){let t=this.options;if(!pd(i.type,t))return;let n=this._getLegendItemAt(i.x,i.y);if(i.type==="mousemove"||i.type==="mouseout"){let s=this._hoveredItem,o=dd(s,n);s&&!o&&F(t.onLeave,[i,s,this],this),this._hoveredItem=n,n&&!o&&F(t.onHover,[i,n,this],this);}else n&&F(t.onClick,[i,n,this],this);}};function ud(e,i,t,n,s){let o=fd(n,e,i,t),a=gd(s,n,i.lineHeight);return{itemWidth:o,itemHeight:a};}function fd(e,i,t,n){let s=e.text;return s&&typeof s!="string"&&(s=s.reduce((o,a)=>o.length>a.length?o:a)),i+t.size/2+n.measureText(s).width;}function gd(e,i,t){let n=e;return typeof i.text!="string"&&(n=nr(i,t)),n;}function nr(e,i){let t=e.text?e.text.length:0;return i*t;}function pd(e,i){return!!((e==="mousemove"||e==="mouseout")&&(i.onHover||i.onLeave)||i.onClick&&(e==="click"||e==="mouseup"));}var md={id:"legend",_element:zi,start(e,i,t){let n=e.legend=new zi({ctx:e.ctx,options:t,chart:e});Q.configure(e,n,t),Q.addBox(e,n);},stop(e){Q.removeBox(e,e.legend),delete e.legend;},beforeUpdate(e,i,t){let n=e.legend;Q.configure(e,n,t),n.options=t;},afterUpdate(e){let i=e.legend;i.buildLabels(),i.adjustHitBoxes();},afterEvent(e,i){i.replay||e.legend.handleEvent(i.event);},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,i,t){let n=i.datasetIndex,s=t.chart;s.isDatasetVisible(n)?(s.hide(n),i.hidden=!0):(s.show(n),i.hidden=!1);},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){let i=e.data.datasets,{labels:{usePointStyle:t,pointStyle:n,textAlign:s,color:o,useBorderRadius:a,borderRadius:r}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{let c=l.controller.getStyle(t?0:void 0),h=q(c.borderWidth);return{text:i[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:n||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:a&&(r||c.borderRadius),datasetIndex:l.index};},this);}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}},He=class extends at{constructor(i){super(),this.chart=i.chart,this.options=i.options,this.ctx=i.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(i,t){let n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return;}this.width=this.right=i,this.height=this.bottom=t;let s=z(n.text)?n.text.length:1;this._padding=q(n.padding);let o=s*$(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o;}isHorizontal(){let i=this.options.position;return i==="top"||i==="bottom";}_drawArgs(i){let{top:t,left:n,bottom:s,right:o,options:a}=this,r=a.align,l=0,c,h,d;return this.isHorizontal()?(h=K(r,n,o),d=t+i,c=o-n):(a.position==="left"?(h=n+i,d=K(r,s,t),l=R*-.5):(h=o-i,d=K(r,t,s),l=R*.5),c=s-t),{titleX:h,titleY:d,maxWidth:c,rotation:l};}draw(){let i=this.ctx,t=this.options;if(!t.display)return;let n=$(t.font),o=n.lineHeight/2+this._padding.top,{titleX:a,titleY:r,maxWidth:l,rotation:c}=this._drawArgs(o);Et(i,t.text,0,0,n,{color:t.color,maxWidth:l,rotation:c,textAlign:mi(t.align),textBaseline:"middle",translation:[a,r]});}};function bd(e,i){let t=new He({ctx:e.ctx,options:i,chart:e});Q.configure(e,t,i),Q.addBox(e,t),e.titleBlock=t;}var _d={id:"title",_element:He,start(e,i,t){bd(e,t);},stop(e){let i=e.titleBlock;Q.removeBox(e,i),delete e.titleBlock;},beforeUpdate(e,i,t){let n=e.titleBlock;Q.configure(e,n,t),n.options=t;},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}},Pi=new WeakMap(),xd={id:"subtitle",start(e,i,t){let n=new He({ctx:e.ctx,options:t,chart:e});Q.configure(e,n,t),Q.addBox(e,n),Pi.set(e,n);},stop(e){Q.removeBox(e,Pi.get(e)),Pi.delete(e);},beforeUpdate(e,i,t){let n=Pi.get(e);Q.configure(e,n,t),n.options=t;},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}},Fe={average(e){if(!e.length)return!1;let i,t,n=new Set(),s=0,o=0;for(i=0,t=e.length;i<t;++i){let r=e[i].element;if(r&&r.hasValue()){let l=r.tooltipPosition();n.add(l.x),s+=l.y,++o;}}return o===0||n.size===0?!1:{x:[...n].reduce((r,l)=>r+l)/n.size,y:s/o};},nearest(e,i){if(!e.length)return!1;let t=i.x,n=i.y,s=Number.POSITIVE_INFINITY,o,a,r;for(o=0,a=e.length;o<a;++o){let l=e[o].element;if(l&&l.hasValue()){let c=l.getCenterPoint(),h=di(i,c);h<s&&(s=h,r=l);}}if(r){let l=r.tooltipPosition();t=l.x,n=l.y;}return{x:t,y:n};}};function mt(e,i){return i&&(z(i)?Array.prototype.push.apply(e,i):e.push(i)),e;}function kt(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
`)>-1?e.split(`
`):e;}function yd(e,i){let{element:t,datasetIndex:n,index:s}=i,o=e.getDatasetMeta(n).controller,{label:a,value:r}=o.getLabelAndValue(s);return{chart:e,label:a,parsed:o.getParsed(s),raw:e.data.datasets[n].data[s],formattedValue:r,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:t};}function Ca(e,i){let t=e.chart.ctx,{body:n,footer:s,title:o}=e,{boxWidth:a,boxHeight:r}=i,l=$(i.bodyFont),c=$(i.titleFont),h=$(i.footerFont),d=o.length,u=s.length,f=n.length,p=q(i.padding),g=p.height,m=0,b=n.reduce((M,x)=>M+x.before.length+x.lines.length+x.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*i.titleSpacing+i.titleMarginBottom),b){let M=i.displayColors?Math.max(r,l.lineHeight):l.lineHeight;g+=f*M+(b-f)*l.lineHeight+(b-1)*i.bodySpacing;}u&&(g+=i.footerMarginTop+u*h.lineHeight+(u-1)*i.footerSpacing);let _=0,y=function(M){m=Math.max(m,t.measureText(M).width+_);};return t.save(),t.font=c.string,E(e.title,y),t.font=l.string,E(e.beforeBody.concat(e.afterBody),y),_=i.displayColors?a+2+i.boxPadding:0,E(n,M=>{E(M.before,y),E(M.lines,y),E(M.after,y);}),_=0,t.font=h.string,E(e.footer,y),t.restore(),m+=p.width,{width:m,height:g};}function vd(e,i){let{y:t,height:n}=i;return t<n/2?"top":t>e.height-n/2?"bottom":"center";}function Md(e,i,t,n){let{x:s,width:o}=n,a=t.caretSize+t.caretPadding;if(e==="left"&&s+o+a>i.width||e==="right"&&s-o-a<0)return!0;}function Cd(e,i,t,n){let{x:s,width:o}=t,{width:a,chartArea:{left:r,right:l}}=e,c="center";return n==="center"?c=s<=(r+l)/2?"left":"right":s<=o/2?c="left":s>=a-o/2&&(c="right"),Md(c,e,i,t)&&(c="center"),c;}function wa(e,i,t){let n=t.yAlign||i.yAlign||vd(e,t);return{xAlign:t.xAlign||i.xAlign||Cd(e,i,t,n),yAlign:n};}function wd(e,i){let{x:t,width:n}=e;return i==="right"?t-=n:i==="center"&&(t-=n/2),t;}function Sd(e,i,t){let{y:n,height:s}=e;return i==="top"?n+=t:i==="bottom"?n-=s+t:n-=s/2,n;}function Sa(e,i,t,n){let{caretSize:s,caretPadding:o,cornerRadius:a}=e,{xAlign:r,yAlign:l}=t,c=s+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=It(a),p=wd(i,r),g=Sd(i,l,c);return l==="center"?r==="left"?p+=c:r==="right"&&(p-=c):r==="left"?p-=Math.max(h,u)+s:r==="right"&&(p+=Math.max(d,f)+s),{x:Y(p,0,n.width-i.width),y:Y(g,0,n.height-i.height)};}function Oi(e,i,t){let n=q(t.padding);return i==="center"?e.x+e.width/2:i==="right"?e.x+e.width-n.right:e.x+n.left;}function ka(e){return mt([],kt(e));}function kd(e,i,t){return wt(e,{tooltip:i,tooltipItems:t,type:"tooltip"});}function Pa(e,i){let t=i&&i.dataset&&i.dataset.tooltip&&i.dataset.tooltip.callbacks;return t?e.override(t):e;}var sr={beforeTitle:gt,title(e){if(e.length>0){let i=e[0],t=i.chart.data.labels,n=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return i.dataset.label||"";if(i.label)return i.label;if(n>0&&i.dataIndex<n)return t[i.dataIndex];}return"";},afterTitle:gt,beforeBody:gt,beforeLabel:gt,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let i=e.dataset.label||"";i&&(i+=": ");let t=e.formattedValue;return D(t)||(i+=t),i;},labelColor(e){let t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0};},labelTextColor(){return this.options.bodyColor;},labelPointStyle(e){let t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation};},afterLabel:gt,afterBody:gt,beforeFooter:gt,footer:gt,afterFooter:gt};function et(e,i,t,n){let s=e[i].call(t,n);return typeof s>"u"?sr[i].call(t,n):s;}var Oa=(()=>{class e extends at{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 n=this.chart,s=this.options.setContext(this.getContext()),o=s.enabled&&n.options.animation&&s.animations,a=new Ti(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(a)),a;}getContext(){return this.$context||(this.$context=kd(this.chart.getContext(),this,this._tooltipItems));}getTitle(t,n){let{callbacks:s}=n,o=et(s,"beforeTitle",this,t),a=et(s,"title",this,t),r=et(s,"afterTitle",this,t),l=[];return l=mt(l,kt(o)),l=mt(l,kt(a)),l=mt(l,kt(r)),l;}getBeforeBody(t,n){return ka(et(n.callbacks,"beforeBody",this,t));}getBody(t,n){let{callbacks:s}=n,o=[];return E(t,a=>{let r={before:[],lines:[],after:[]},l=Pa(s,a);mt(r.before,kt(et(l,"beforeLabel",this,a))),mt(r.lines,et(l,"label",this,a)),mt(r.after,kt(et(l,"afterLabel",this,a))),o.push(r);}),o;}getAfterBody(t,n){return ka(et(n.callbacks,"afterBody",this,t));}getFooter(t,n){let{callbacks:s}=n,o=et(s,"beforeFooter",this,t),a=et(s,"footer",this,t),r=et(s,"afterFooter",this,t),l=[];return l=mt(l,kt(o)),l=mt(l,kt(a)),l=mt(l,kt(r)),l;}_createItems(t){let n=this._active,s=this.chart.data,o=[],a=[],r=[],l=[],c,h;for(c=0,h=n.length;c<h;++c)l.push(yd(this.chart,n[c]));return t.filter&&(l=l.filter((d,u,f)=>t.filter(d,u,f,s))),t.itemSort&&(l=l.sort((d,u)=>t.itemSort(d,u,s))),E(l,d=>{let u=Pa(t.callbacks,d);o.push(et(u,"labelColor",this,d)),a.push(et(u,"labelPointStyle",this,d)),r.push(et(u,"labelTextColor",this,d));}),this.labelColors=o,this.labelPointStyles=a,this.labelTextColors=r,this.dataPoints=l,l;}update(t,n){let s=this.options.setContext(this.getContext()),o=this._active,a,r=[];if(!o.length)this.opacity!==0&&(a={opacity:0});else{let l=Fe[s.position].call(this,o,this._eventPosition);r=this._createItems(s),this.title=this.getTitle(r,s),this.beforeBody=this.getBeforeBody(r,s),this.body=this.getBody(r,s),this.afterBody=this.getAfterBody(r,s),this.footer=this.getFooter(r,s);let c=this._size=Ca(this,s),h=Object.assign({},l,c),d=wa(this.chart,s,h),u=Sa(s,h,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,a={opacity:1,x:u.x,y:u.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y};}this._tooltipItems=r,this.$context=void 0,a&&this._resolveAnimations().update(this,a),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:n});}drawCaret(t,n,s,o){let a=this.getCaretPosition(t,s,o);n.lineTo(a.x1,a.y1),n.lineTo(a.x2,a.y2),n.lineTo(a.x3,a.y3);}getCaretPosition(t,n,s){let{xAlign:o,yAlign:a}=this,{caretSize:r,cornerRadius:l}=s,{topLeft:c,topRight:h,bottomLeft:d,bottomRight:u}=It(l),{x:f,y:p}=t,{width:g,height:m}=n,b,_,y,M,x,v;return a==="center"?(x=p+m/2,o==="left"?(b=f,_=b-r,M=x+r,v=x-r):(b=f+g,_=b+r,M=x-r,v=x+r),y=b):(o==="left"?_=f+Math.max(c,d)+r:o==="right"?_=f+g-Math.max(h,u)-r:_=this.caretX,a==="top"?(M=p,x=M-r,b=_-r,y=_+r):(M=p+m,x=M+r,b=_+r,y=_-r),v=M),{x1:b,x2:_,x3:y,y1:M,y2:x,y3:v};}drawTitle(t,n,s){let o=this.title,a=o.length,r,l,c;if(a){let h=Ut(s.rtl,this.x,this.width);for(t.x=Oi(this,s.titleAlign,s),n.textAlign=h.textAlign(s.titleAlign),n.textBaseline="middle",r=$(s.titleFont),l=s.titleSpacing,n.fillStyle=s.titleColor,n.font=r.string,c=0;c<a;++c)n.fillText(o[c],h.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+l,c+1===a&&(t.y+=s.titleMarginBottom-l);}}_drawColorBox(t,n,s,o,a){let r=this.labelColors[s],l=this.labelPointStyles[s],{boxHeight:c,boxWidth:h}=a,d=$(a.bodyFont),u=Oi(this,"left",a),f=o.x(u),p=c<d.lineHeight?(d.lineHeight-c)/2:0,g=n.y+p;if(a.usePointStyle){let m={radius:Math.min(h,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},b=o.leftForLtr(f,h)+h/2,_=g+c/2;t.strokeStyle=a.multiKeyBackground,t.fillStyle=a.multiKeyBackground,_i(t,m,b,_),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,_i(t,m,b,_);}else{t.lineWidth=A(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;let m=o.leftForLtr(f,h),b=o.leftForLtr(o.xPlus(f,1),h-2),_=It(r.borderRadius);Object.values(_).some(y=>y!==0)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,he(t,{x:m,y:g,w:h,h:c,radius:_}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),he(t,{x:b,y:g+1,w:h-2,h:c-2,radius:_}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(m,g,h,c),t.strokeRect(m,g,h,c),t.fillStyle=r.backgroundColor,t.fillRect(b,g+1,h-2,c-2));}t.fillStyle=this.labelTextColors[s];}drawBody(t,n,s){let{body:o}=this,{bodySpacing:a,bodyAlign:r,displayColors:l,boxHeight:c,boxWidth:h,boxPadding:d}=s,u=$(s.bodyFont),f=u.lineHeight,p=0,g=Ut(s.rtl,this.x,this.width),m=function(k){n.fillText(k,g.x(t.x+p),t.y+f/2),t.y+=f+a;},b=g.textAlign(r),_,y,M,x,v,S,C;for(n.textAlign=r,n.textBaseline="middle",n.font=u.string,t.x=Oi(this,b,s),n.fillStyle=s.bodyColor,E(this.beforeBody,m),p=l&&b!=="right"?r==="center"?h/2+d:h+2+d:0,x=0,S=o.length;x<S;++x){for(_=o[x],y=this.labelTextColors[x],n.fillStyle=y,E(_.before,m),M=_.lines,l&&M.length&&(this._drawColorBox(n,t,x,g,s),f=Math.max(u.lineHeight,c)),v=0,C=M.length;v<C;++v)m(M[v]),f=u.lineHeight;E(_.after,m);}p=0,f=u.lineHeight,E(this.afterBody,m),t.y-=a;}drawFooter(t,n,s){let o=this.footer,a=o.length,r,l;if(a){let c=Ut(s.rtl,this.x,this.width);for(t.x=Oi(this,s.footerAlign,s),t.y+=s.footerMarginTop,n.textAlign=c.textAlign(s.footerAlign),n.textBaseline="middle",r=$(s.footerFont),n.fillStyle=s.footerColor,n.font=r.string,l=0;l<a;++l)n.fillText(o[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+s.footerSpacing;}}drawBackground(t,n,s,o){let{xAlign:a,yAlign:r}=this,{x:l,y:c}=t,{width:h,height:d}=s,{topLeft:u,topRight:f,bottomLeft:p,bottomRight:g}=It(o.cornerRadius);n.fillStyle=o.backgroundColor,n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.beginPath(),n.moveTo(l+u,c),r==="top"&&this.drawCaret(t,n,s,o),n.lineTo(l+h-f,c),n.quadraticCurveTo(l+h,c,l+h,c+f),r==="center"&&a==="right"&&this.drawCaret(t,n,s,o),n.lineTo(l+h,c+d-g),n.quadraticCurveTo(l+h,c+d,l+h-g,c+d),r==="bottom"&&this.drawCaret(t,n,s,o),n.lineTo(l+p,c+d),n.quadraticCurveTo(l,c+d,l,c+d-p),r==="center"&&a==="left"&&this.drawCaret(t,n,s,o),n.lineTo(l,c+u),n.quadraticCurveTo(l,c,l+u,c),n.closePath(),n.fill(),o.borderWidth>0&&n.stroke();}_updateAnimationTarget(t){let n=this.chart,s=this.$animations,o=s&&s.x,a=s&&s.y;if(o||a){let r=Fe[t.position].call(this,this._active,this._eventPosition);if(!r)return;let l=this._size=Ca(this,t),c=Object.assign({},r,this._size),h=wa(n,t,c),d=Sa(t,c,h,n);(o._to!==d.x||a._to!==d.y)&&(this.xAlign=h.xAlign,this.yAlign=h.yAlign,this.width=l.width,this.height=l.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,d));}}_willRender(){return!!this.opacity;}draw(t){let n=this.options.setContext(this.getContext()),s=this.opacity;if(!s)return;this._updateAnimationTarget(n);let o={width:this.width,height:this.height},a={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;let r=q(n.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&l&&(t.save(),t.globalAlpha=s,this.drawBackground(a,t,o,n),Sn(t,n.textDirection),a.y+=r.top,this.drawTitle(a,t,n),this.drawBody(a,t,n),this.drawFooter(a,t,n),kn(t,n.textDirection),t.restore());}getActiveElements(){return this._active||[];}setActiveElements(t,n){let s=this._active,o=t.map(({datasetIndex:l,index:c})=>{let h=this.chart.getDatasetMeta(l);if(!h)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:h.data[c],index:c};}),a=!ke(s,o),r=this._positionChanged(o,n);(a||r)&&(this._active=o,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0));}handleEvent(t,n,s=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let o=this.options,a=this._active||[],r=this._getActiveElements(t,a,n,s),l=this._positionChanged(r,t),c=n||!ke(r,a)||l;return c&&(this._active=r,(o.enabled||o.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),c;}_getActiveElements(t,n,s,o){let a=this.options;if(t.type==="mouseout")return[];if(!o)return n.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);let r=this.chart.getElementsAtEventForMode(t,a.mode,a,s);return a.reverse&&r.reverse(),r;}_positionChanged(t,n){let{caretX:s,caretY:o,options:a}=this,r=Fe[a.position].call(this,t,n);return r!==!1&&(s!==r.x||o!==r.y);}}return w(e,"positioners",Fe),e;})(),Pd={id:"tooltip",_element:Oa,positioners:Fe,afterInit(e,i,t){t&&(e.tooltip=new Oa({chart:e,options:t}));},beforeUpdate(e,i,t){e.tooltip&&e.tooltip.initialize(t);},reset(e,i,t){e.tooltip&&e.tooltip.initialize(t);},afterDraw(e){let i=e.tooltip;if(i&&i._willRender()){let t={tooltip:i};if(e.notifyPlugins("beforeTooltipDraw",Ue(Ye({},t),{cancelable:!0}))===!1)return;i.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",t);}},afterEvent(e,i){if(e.tooltip){let t=i.replay;e.tooltip.handleEvent(i.event,t,i.inChartArea)&&(i.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:(e,i)=>i.bodyFont.size,boxWidth:(e,i)=>i.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:sr},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Od=Object.freeze({__proto__:null,Colors:Nh,Decimation:$h,Filler:hd,Legend:md,SubTitle:xd,Title:_d,Tooltip:Pd}),Ld=(e,i,t,n)=>(typeof i=="string"?(t=e.push(i)-1,n.unshift({index:t,label:i})):isNaN(i)&&(t=null),t);function Dd(e,i,t,n){let s=e.indexOf(i);if(s===-1)return Ld(e,i,t,n);let o=e.lastIndexOf(i);return s!==o?t:s;}var Ad=(e,i)=>e===null?null:Y(Math.round(e),0,i);function La(e){let i=this.getLabels();return e>=0&&e<i.length?i[e]:e;}var Td=(()=>{class e extends Gt{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[];}init(t){let n=this._addedLabels;if(n.length){let s=this.getLabels();for(let{index:o,label:a}of n)s[o]===a&&s.splice(o,1);this._addedLabels=[];}super.init(t);}parse(t,n){if(D(t))return null;let s=this.getLabels();return n=isFinite(n)&&s[n]===t?n:Dd(s,t,P(n,t),this._addedLabels),Ad(n,s.length-1);}determineDataLimits(){let{minDefined:t,maxDefined:n}=this.getUserBounds(),{min:s,max:o}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(s=0),n||(o=this.getLabels().length-1)),this.min=s,this.max=o;}buildTicks(){let t=this.min,n=this.max,s=this.options.offset,o=[],a=this.getLabels();a=t===0&&n===a.length-1?a:a.slice(t,n+1),this._valueRange=Math.max(a.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let r=t;r<=n;r++)o.push({value:r});return o;}getLabelForValue(t){return La.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 n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value);}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange);}getBasePixel(){return this.bottom;}}return w(e,"id","category"),w(e,"defaults",{ticks:{callback:La}}),e;})();function Rd(e,i){let t=[],{bounds:s,step:o,min:a,max:r,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=e,f=o||1,p=h-1,{min:g,max:m}=i,b=!D(a),_=!D(r),y=!D(c),M=(m-g)/(d+1),x=sn((m-g)/p/f)*f,v,S,C,k;if(x<1e-14&&!b&&!_)return[{value:g},{value:m}];k=Math.ceil(m/x)-Math.floor(g/x),k>p&&(x=sn(k*x/p/f)*f),D(l)||(v=Math.pow(10,l),x=Math.ceil(x*v)/v),s==="ticks"?(S=Math.floor(g/x)*x,C=Math.ceil(m/x)*x):(S=g,C=m),b&&_&&o&&po((r-a)/o,x/1e3)?(k=Math.round(Math.min((r-a)/x,h)),x=(r-a)/k,S=a,C=r):y?(S=b?a:S,C=_?r:C,k=c-1,x=(C-S)/k):(k=(C-S)/x,re(k,Math.round(k),x/1e3)?k=Math.round(k):k=Math.ceil(k));let L=Math.max(an(x),an(S));v=Math.pow(10,D(l)?L:l),S=Math.round(S*v)/v,C=Math.round(C*v)/v;let O=0;for(b&&(u&&S!==a?(t.push({value:a}),S<a&&O++,re(Math.round((S+O*x)*v)/v,a,Da(a,M,e))&&O++):S<a&&O++);O<k;++O){let T=Math.round((S+O*x)*v)/v;if(_&&T>r)break;t.push({value:T});}return _&&u&&C!==r?t.length&&re(t[t.length-1].value,r,Da(r,M,e))?t[t.length-1].value=r:t.push({value:r}):(!_||C===r)&&t.push({value:C}),t;}function Da(e,i,{horizontal:t,minRotation:n}){let s=ct(n),o=(t?Math.sin(s):Math.cos(s))||.001,a=.75*i*(""+e).length;return Math.min(i/o,a);}var pe=class extends Gt{constructor(i){super(i),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0;}parse(i,t){return D(i)||(typeof i=="number"||i instanceof Number)&&!isFinite(+i)?null:+i;}handleTickRangeOptions(){let{beginAtZero:i}=this.options,{minDefined:t,maxDefined:n}=this.getUserBounds(),{min:s,max:o}=this,a=l=>s=t?s:l,r=l=>o=n?o:l;if(i){let l=dt(s),c=dt(o);l<0&&c<0?r(0):l>0&&c>0&&a(0);}if(s===o){let l=o===0?1:Math.abs(o*.05);r(o+l),i||a(s-l);}this.min=s,this.max=o;}getTickLimit(){let i=this.options.ticks,{maxTicksLimit:t,stepSize:n}=i,s;return n?(s=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),t=t||11),t&&(s=Math.min(t,s)),s;}computeTickLimit(){return Number.POSITIVE_INFINITY;}buildTicks(){let i=this.options,t=i.ticks,n=this.getTickLimit();n=Math.max(2,n);let s={maxTicks:n,bounds:i.bounds,min:i.min,max:i.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},o=this._range||this,a=Rd(s,o);return i.bounds==="ticks"&&on(a,this,"value"),i.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a;}configure(){let i=this.ticks,t=this.min,n=this.max;if(super.configure(),this.options.offset&&i.length){let s=(n-t)/Math.max(i.length-1,1)/2;t-=s,n+=s;}this._startValue=t,this._endValue=n,this._valueRange=n-t;}getLabelForValue(i){return ce(i,this.chart.options.locale,this.options.ticks.format);}},ze=class extends pe{determineDataLimits(){let{min:i,max:t}=this.getMinMax(!0);this.min=H(i)?i:0,this.max=H(t)?t:1,this.handleTickRangeOptions();}computeTickLimit(){let i=this.isHorizontal(),t=i?this.width:this.height,n=ct(this.options.ticks.minRotation),s=(i?Math.sin(n):Math.cos(n))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,o.lineHeight/s));}getPixelForValue(i){return i===null?NaN:this.getPixelForDecimal((i-this._startValue)/this._valueRange);}getValueForPixel(i){return this._startValue+this.getDecimalForPixel(i)*this._valueRange;}};w(ze,"id","linear"),w(ze,"defaults",{ticks:{callback:Pe.formatters.numeric}});var We=e=>Math.floor(Mt(e)),Zt=(e,i)=>Math.pow(10,We(e)+i);function Aa(e){return e/Math.pow(10,We(e))===1;}function Ta(e,i,t){let n=Math.pow(10,t),s=Math.floor(e/n);return Math.ceil(i/n)-s;}function Ed(e,i){let t=i-e,n=We(t);for(;Ta(e,i,n)>10;)n++;for(;Ta(e,i,n)<10;)n--;return Math.min(n,We(e));}function Id(e,{min:i,max:t}){i=tt(e.min,i);let n=[],s=We(i),o=Ed(i,t),a=o<0?Math.pow(10,Math.abs(o)):1,r=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((i-l)*a)/a,h=Math.floor((i-l)/r/10)*r*10,d=Math.floor((c-h)/Math.pow(10,o)),u=tt(e.min,Math.round((l+h+d*Math.pow(10,o))*a)/a);for(;u<t;)n.push({value:u,major:Aa(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=tt(e.max,u);return n.push({value:f,major:Aa(f),significand:d}),n;}var Be=class extends Gt{constructor(i){super(i),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0;}parse(i,t){let n=pe.prototype.parse.apply(this,[i,t]);if(n===0){this._zero=!0;return;}return H(n)&&n>0?n:null;}determineDataLimits(){let{min:i,max:t}=this.getMinMax(!0);this.min=H(i)?Math.max(0,i):null,this.max=H(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!H(this._userMin)&&(this.min=i===Zt(this.min,0)?Zt(this.min,-1):Zt(this.min,0)),this.handleTickRangeOptions();}handleTickRangeOptions(){let{minDefined:i,maxDefined:t}=this.getUserBounds(),n=this.min,s=this.max,o=r=>n=i?n:r,a=r=>s=t?s:r;n===s&&(n<=0?(o(1),a(10)):(o(Zt(n,-1)),a(Zt(s,1)))),n<=0&&o(Zt(s,-1)),s<=0&&a(Zt(n,1)),this.min=n,this.max=s;}buildTicks(){let i=this.options,t={min:this._userMin,max:this._userMax},n=Id(t,this);return i.bounds==="ticks"&&on(n,this,"value"),i.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n;}getLabelForValue(i){return i===void 0?"0":ce(i,this.chart.options.locale,this.options.ticks.format);}configure(){let i=this.min;super.configure(),this._startValue=Mt(i),this._valueRange=Mt(this.max)-Mt(i);}getPixelForValue(i){return(i===void 0||i===0)&&(i=this.min),i===null||isNaN(i)?NaN:this.getPixelForDecimal(i===this.min?0:(Mt(i)-this._startValue)/this._valueRange);}getValueForPixel(i){let t=this.getDecimalForPixel(i);return Math.pow(10,this._startValue+t*this._valueRange);}};w(Be,"id","logarithmic"),w(Be,"defaults",{ticks:{callback:Pe.formatters.logarithmic,major:{enabled:!0}}});function ts(e){let i=e.ticks;if(i.display&&e.display){let t=q(i.backdropPadding);return P(i.font&&i.font.size,V.font.size)+t.height;}return 0;}function Fd(e,i,t){return t=z(t)?t:[t],{w:wo(e,i.string,t),h:t.length*i.lineHeight};}function Ra(e,i,t,n,s){return e===n||e===s?{start:i-t/2,end:i+t/2}:e<n||e>s?{start:i-t,end:i}:{start:i,end:i+t};}function zd(e){let i={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},t=Object.assign({},i),n=[],s=[],o=e._pointLabels.length,a=e.options.pointLabels,r=a.centerPointLabels?R/o:0;for(let l=0;l<o;l++){let c=a.setContext(e.getPointLabelContext(l));s[l]=c.padding;let h=e.getPointPosition(l,e.drawingArea+s[l],r),d=$(c.font),u=Fd(e.ctx,d,e._pointLabels[l]);n[l]=u;let f=Z(e.getIndexAngle(l)+r),p=Math.round(gi(f)),g=Ra(p,h.x,u.w,0,180),m=Ra(p,h.y,u.h,90,270);Bd(t,i,f,g,m);}e.setCenterPoint(i.l-t.l,t.r-i.r,i.t-t.t,t.b-i.b),e._pointLabelItems=Hd(e,n,s);}function Bd(e,i,t,n,s){let o=Math.abs(Math.sin(t)),a=Math.abs(Math.cos(t)),r=0,l=0;n.start<i.l?(r=(i.l-n.start)/o,e.l=Math.min(e.l,i.l-r)):n.end>i.r&&(r=(n.end-i.r)/o,e.r=Math.max(e.r,i.r+r)),s.start<i.t?(l=(i.t-s.start)/a,e.t=Math.min(e.t,i.t-l)):s.end>i.b&&(l=(s.end-i.b)/a,e.b=Math.max(e.b,i.b+l));}function Vd(e,i,t){let n=e.drawingArea,{extra:s,additionalAngle:o,padding:a,size:r}=t,l=e.getPointPosition(i,n+s+a,o),c=Math.round(gi(Z(l.angle+W))),h=$d(l.y,r.h,c),d=Wd(c),u=jd(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 Nd(e,i){if(!i)return!0;let{left:t,top:n,right:s,bottom:o}=e;return!(ft({x:t,y:n},i)||ft({x:t,y:o},i)||ft({x:s,y:n},i)||ft({x:s,y:o},i));}function Hd(e,i,t){let n=[],s=e._pointLabels.length,o=e.options,{centerPointLabels:a,display:r}=o.pointLabels,l={extra:ts(o)/2,additionalAngle:a?R/s:0},c;for(let h=0;h<s;h++){l.padding=t[h],l.size=i[h];let d=Vd(e,h,l);n.push(d),r==="auto"&&(d.visible=Nd(d,c),d.visible&&(c=d));}return n;}function Wd(e){return e===0||e===180?"center":e<180?"left":"right";}function jd(e,i,t){return t==="right"?e-=i:t==="center"&&(e-=i/2),e;}function $d(e,i,t){return t===90||t===270?e-=i/2:(t>270||t<90)&&(e-=i),e;}function Yd(e,i,t){let{left:n,top:s,right:o,bottom:a}=t,{backdropColor:r}=i;if(!D(r)){let l=It(i.borderRadius),c=q(i.backdropPadding);e.fillStyle=r;let h=n-c.left,d=s-c.top,u=o-n+c.width,f=a-s+c.height;Object.values(l).some(p=>p!==0)?(e.beginPath(),he(e,{x:h,y:d,w:u,h:f,radius:l}),e.fill()):e.fillRect(h,d,u,f);}}function Ud(e,i){let{ctx:t,options:{pointLabels:n}}=e;for(let s=i-1;s>=0;s--){let o=e._pointLabelItems[s];if(!o.visible)continue;let a=n.setContext(e.getPointLabelContext(s));Yd(t,a,o);let r=$(a.font),{x:l,y:c,textAlign:h}=o;Et(t,e._pointLabels[s],l,c+r.lineHeight/2,r,{color:a.color,textAlign:h,textBaseline:"middle"});}}function or(e,i,t,n){let{ctx:s}=e;if(t)s.arc(e.xCenter,e.yCenter,i,0,B);else{let o=e.getPointPosition(0,i);s.moveTo(o.x,o.y);for(let a=1;a<n;a++)o=e.getPointPosition(a,i),s.lineTo(o.x,o.y);}}function Xd(e,i,t,n,s){let o=e.ctx,a=i.circular,{color:r,lineWidth:l}=i;!a&&!n||!r||!l||t<0||(o.save(),o.strokeStyle=r,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),or(e,t,a,n),o.closePath(),o.stroke(),o.restore());}function Zd(e,i,t){return wt(e,{label:t,index:i,type:"pointLabel"});}var qt=class extends pe{constructor(i){super(i),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[];}setDimensions(){let i=this._padding=q(ts(this.options)/2),t=this.width=this.maxWidth-i.width,n=this.height=this.maxHeight-i.height;this.xCenter=Math.floor(this.left+t/2+i.left),this.yCenter=Math.floor(this.top+n/2+i.top),this.drawingArea=Math.floor(Math.min(t,n)/2);}determineDataLimits(){let{min:i,max:t}=this.getMinMax(!1);this.min=H(i)&&!isNaN(i)?i:0,this.max=H(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions();}computeTickLimit(){return Math.ceil(this.drawingArea/ts(this.options));}generateTickLabels(i){pe.prototype.generateTickLabels.call(this,i),this._pointLabels=this.getLabels().map((t,n)=>{let s=F(this.options.pointLabels.callback,[t,n],this);return s||s===0?s:"";}).filter((t,n)=>this.chart.getDataVisibility(n));}fit(){let i=this.options;i.display&&i.pointLabels.display?zd(this):this.setCenterPoint(0,0,0,0);}setCenterPoint(i,t,n,s){this.xCenter+=Math.floor((i-t)/2),this.yCenter+=Math.floor((n-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(i,t,n,s));}getIndexAngle(i){let t=B/(this._pointLabels.length||1),n=this.options.startAngle||0;return Z(i*t+ct(n));}getDistanceFromCenterForValue(i){if(D(i))return NaN;let t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-i)*t:(i-this.min)*t;}getValueForDistanceFromCenter(i){if(D(i))return NaN;let t=i/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t;}getPointLabelContext(i){let t=this._pointLabels||[];if(i>=0&&i<t.length){let n=t[i];return Zd(this.getContext(),i,n);}}getPointPosition(i,t,n=0){let s=this.getIndexAngle(i)-W+n;return{x:Math.cos(s)*t+this.xCenter,y:Math.sin(s)*t+this.yCenter,angle:s};}getPointPositionForValue(i,t){return this.getPointPosition(i,this.getDistanceFromCenterForValue(t));}getBasePosition(i){return this.getPointPositionForValue(i||0,this.getBaseValue());}getPointLabelPosition(i){let{left:t,top:n,right:s,bottom:o}=this._pointLabelItems[i];return{left:t,top:n,right:s,bottom:o};}drawBackground(){let{backgroundColor:i,grid:{circular:t}}=this.options;if(i){let n=this.ctx;n.save(),n.beginPath(),or(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),n.closePath(),n.fillStyle=i,n.fill(),n.restore();}}drawGrid(){let i=this.ctx,t=this.options,{angleLines:n,grid:s,border:o}=t,a=this._pointLabels.length,r,l,c;if(t.pointLabels.display&&Ud(this,a),s.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=s.setContext(u),p=o.setContext(u);Xd(this,f,l,a,p);}}),n.display){for(i.save(),r=a-1;r>=0;r--){let h=n.setContext(this.getPointLabelContext(r)),{color:d,lineWidth:u}=h;!u||!d||(i.lineWidth=u,i.strokeStyle=d,i.setLineDash(h.borderDash),i.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),c=this.getPointPosition(r,l),i.beginPath(),i.moveTo(this.xCenter,this.yCenter),i.lineTo(c.x,c.y),i.stroke());}i.restore();}}drawBorder(){}drawLabels(){let i=this.ctx,t=this.options,n=t.ticks;if(!n.display)return;let s=this.getIndexAngle(0),o,a;i.save(),i.translate(this.xCenter,this.yCenter),i.rotate(s),i.textAlign="center",i.textBaseline="middle",this.ticks.forEach((r,l)=>{if(l===0&&this.min>=0&&!t.reverse)return;let c=n.setContext(this.getContext(l)),h=$(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){i.font=h.string,a=i.measureText(r.label).width,i.fillStyle=c.backdropColor;let d=q(c.backdropPadding);i.fillRect(-a/2-d.left,-o-h.size/2-d.top,a+d.width,h.size+d.height);}Et(i,r.label,0,-o,h,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth});}),i.restore();}drawTitle(){}};w(qt,"id","radialLinear"),w(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:Pe.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(i){return i;},padding:5,centerPointLabels:!1}}),w(qt,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),w(qt,"descriptors",{angleLines:{_fallback:"grid"}});var Hi={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}},it=Object.keys(Hi);function Ea(e,i){return e-i;}function Ia(e,i){if(D(i))return null;let t=e._adapter,{parser:n,round:s,isoWeekday:o}=e._parseOpts,a=i;return typeof n=="function"&&(a=n(a)),H(a)||(a=typeof n=="string"?t.parse(a,n):t.parse(a)),a===null?null:(s&&(a=s==="week"&&(Yt(o)||o===!0)?t.startOf(a,"isoWeek",o):t.startOf(a,s)),+a);}function Fa(e,i,t,n){let s=it.length;for(let o=it.indexOf(e);o<s-1;++o){let a=Hi[it[o]],r=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((t-i)/(r*a.size))<=n)return it[o];}return it[s-1];}function Kd(e,i,t,n,s){for(let o=it.length-1;o>=it.indexOf(t);o--){let a=it[o];if(Hi[a].common&&e._adapter.diff(s,n,a)>=i-1)return a;}return it[t?it.indexOf(t):0];}function qd(e){for(let i=it.indexOf(e)+1,t=it.length;i<t;++i)if(Hi[it[i]].common)return it[i];}function za(e,i,t){if(!t)e[i]=!0;else if(t.length){let{lo:n,hi:s}=pi(t,i),o=t[n]>=i?t[n]:t[s];e[o]=!0;}}function Gd(e,i,t,n){let s=e._adapter,o=+s.startOf(i[0].value,n),a=i[i.length-1].value,r,l;for(r=o;r<=a;r=+s.add(r,1,n))l=t[r],l>=0&&(i[l].major=!0);return i;}function Ba(e,i,t){let n=[],s={},o=i.length,a,r;for(a=0;a<o;++a)r=i[a],s[r]=a,n.push({value:r,major:!1});return o===0||!t?n:Gd(e,n,s,t);}var es=(()=>{class e extends Gt{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,n={}){let s=t.time||(t.time={}),o=this._adapter=new lc._date(t.adapters.date);o.init(n),oe(s.displayFormats,o.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(t),this._normalized=n.normalized;}parse(t,n){return t===void 0?null:Ia(this,t);}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]};}determineDataLimits(){let t=this.options,n=this._adapter,s=t.time.unit||"day",{min:o,max:a,minDefined:r,maxDefined:l}=this.getUserBounds();function c(h){!r&&!isNaN(h.min)&&(o=Math.min(o,h.min)),!l&&!isNaN(h.max)&&(a=Math.max(a,h.max));}(!r||!l)&&(c(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&c(this.getMinMax(!1))),o=H(o)&&!isNaN(o)?o:+n.startOf(Date.now(),s),a=H(a)&&!isNaN(a)?a:+n.endOf(Date.now(),s)+1,this.min=Math.min(o,a-1),this.max=Math.max(o+1,a);}_getLabelBounds(){let t=this.getLabelTimestamps(),n=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],s=t[t.length-1]),{min:n,max:s};}buildTicks(){let t=this.options,n=t.time,s=t.ticks,o=s.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&o.length&&(this.min=this._userMin||o[0],this.max=this._userMax||o[o.length-1]);let a=this.min,r=this.max,l=_o(o,a,r);return this._unit=n.unit||(s.autoSkip?Fa(n.minUnit,this.min,this.max,this._getLabelCapacity(a)):Kd(this,l.length,n.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:qd(this._unit),this.initOffsets(o),t.reverse&&l.reverse(),Ba(this,l,this._majorUnit);}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value));}initOffsets(t=[]){let n=0,s=0,o,a;this.options.offset&&t.length&&(o=this.getDecimalForValue(t[0]),t.length===1?n=1-o:n=(this.getDecimalForValue(t[1])-o)/2,a=this.getDecimalForValue(t[t.length-1]),t.length===1?s=a:s=(a-this.getDecimalForValue(t[t.length-2]))/2);let r=t.length<3?.5:.25;n=Y(n,0,r),s=Y(s,0,r),this._offsets={start:n,end:s,factor:1/(n+1+s)};}_generate(){let t=this._adapter,n=this.min,s=this.max,o=this.options,a=o.time,r=a.unit||Fa(a.minUnit,n,s,this._getLabelCapacity(n)),l=P(o.ticks.stepSize,1),c=r==="week"?a.isoWeekday:!1,h=Yt(c)||c===!0,d={},u=n,f,p;if(h&&(u=+t.startOf(u,"isoWeek",c)),u=+t.startOf(u,h?"day":r),t.diff(s,n,r)>1e5*l)throw new Error(n+" and "+s+" are too far apart with stepSize of "+l+" "+r);let g=o.ticks.source==="data"&&this.getDataTimestamps();for(f=u,p=0;f<s;f=+t.add(f,l,r),p++)za(d,f,g);return(f===s||o.bounds==="ticks"||p===1)&&za(d,f,g),Object.keys(d).sort(Ea).map(m=>+m);}getLabelForValue(t){let n=this._adapter,s=this.options.time;return s.tooltipFormat?n.format(t,s.tooltipFormat):n.format(t,s.displayFormats.datetime);}format(t,n){let o=this.options.time.displayFormats,a=this._unit,r=n||o[a];return this._adapter.format(t,r);}_tickFormatFunction(t,n,s,o){let a=this.options,r=a.ticks.callback;if(r)return F(r,[t,n,s],this);let l=a.time.displayFormats,c=this._unit,h=this._majorUnit,d=c&&l[c],u=h&&l[h],f=s[n],p=h&&u&&f&&f.major;return this._adapter.format(t,o||(p?u:d));}generateTickLabels(t){let n,s,o;for(n=0,s=t.length;n<s;++n)o=t[n],o.label=this._tickFormatFunction(o.value,n,t);}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min);}getPixelForValue(t){let n=this._offsets,s=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+s)*n.factor);}getValueForPixel(t){let n=this._offsets,s=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+s*(this.max-this.min);}_getLabelSize(t){let n=this.options.ticks,s=this.ctx.measureText(t).width,o=ct(this.isHorizontal()?n.maxRotation:n.minRotation),a=Math.cos(o),r=Math.sin(o),l=this._resolveTickFontOptions(0).size;return{w:s*a+l*r,h:s*r+l*a};}_getLabelCapacity(t){let n=this.options.time,s=n.displayFormats,o=s[n.unit]||s.millisecond,a=this._tickFormatFunction(t,0,Ba(this,[t],this._majorUnit),o),r=this._getLabelSize(a),l=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return l>0?l:1;}getDataTimestamps(){let t=this._cache.data||[],n,s;if(t.length)return t;let o=this.getMatchingVisibleMetas();if(this._normalized&&o.length)return this._cache.data=o[0].controller.getAllParsedValues(this);for(n=0,s=o.length;n<s;++n)t=t.concat(o[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t);}getLabelTimestamps(){let t=this._cache.labels||[],n,s;if(t.length)return t;let o=this.getLabels();for(n=0,s=o.length;n<s;++n)t.push(Ia(this,o[n]));return this._cache.labels=this._normalized?t:this.normalize(t);}normalize(t){return cn(t.sort(Ea));}}return w(e,"id","time"),w(e,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}}),e;})();function Li(e,i,t){let n=0,s=e.length-1,o,a,r,l;t?(i>=e[n].pos&&i<=e[s].pos&&({lo:n,hi:s}=ut(e,"pos",i)),{pos:o,time:r}=e[n],{pos:a,time:l}=e[s]):(i>=e[n].time&&i<=e[s].time&&({lo:n,hi:s}=ut(e,"time",i)),{time:o,pos:r}=e[n],{time:a,pos:l}=e[s]);let c=a-o;return c?r+(l-r)*(i-o)/c:r;}var Ve=class extends es{constructor(i){super(i),this._table=[],this._minPos=void 0,this._tableRange=void 0;}initOffsets(){let i=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(i);this._minPos=Li(t,this.min),this._tableRange=Li(t,this.max)-this._minPos,super.initOffsets(i);}buildLookupTable(i){let{min:t,max:n}=this,s=[],o=[],a,r,l,c,h;for(a=0,r=i.length;a<r;++a)c=i[a],c>=t&&c<=n&&s.push(c);if(s.length<2)return[{time:t,pos:0},{time:n,pos:1}];for(a=0,r=s.length;a<r;++a)h=s[a+1],l=s[a-1],c=s[a],Math.round((h+l)/2)!==c&&o.push({time:c,pos:a/(r-1)});return o;}_generate(){let i=this.min,t=this.max,n=super.getDataTimestamps();return(!n.includes(i)||!n.length)&&n.splice(0,0,i),(!n.includes(t)||n.length===1)&&n.push(t),n.sort((s,o)=>s-o);}_getTimestampsForTable(){let i=this._cache.all||[];if(i.length)return i;let t=this.getDataTimestamps(),n=this.getLabelTimestamps();return t.length&&n.length?i=this.normalize(t.concat(n)):i=t.length?t:n,i=this._cache.all=i,i;}getDecimalForValue(i){return(Li(this._table,i)-this._minPos)/this._tableRange;}getValueForPixel(i){let t=this._offsets,n=this.getDecimalForPixel(i)/t.factor-t.end;return Li(this._table,n*this._tableRange+this._minPos,!0);}};w(Ve,"id","timeseries"),w(Ve,"defaults",es.defaults);var Jd=Object.freeze({__proto__:null,CategoryScale:Td,LinearScale:ze,LogarithmicScale:Be,RadialLinearScale:qt,TimeScale:es,TimeSeriesScale:Ve}),ar=[rc,Rh,Od,Jd];Bi.register(...ar);var rr=Bi;var Qd={root:({instance:e})=>({display:"block",position:"relative",width:e.width,height:e.height})},tu={root:"p-chart"},lr=(()=>{let i=class i extends Bs{name="chart";classes=tu;inlineStyles=Qd;};w(i,"\u0275fac",(()=>{let n;return function(o){return(n||(n=hs(i)))(o||i);};})()),w(i,"\u0275prov",os({token:i,factory:i.ɵfac}));let e=i;return e;})();var cr=new rs("CHART_INSTANCE"),eu=(()=>{let i=class i extends Vs{el;zone;componentName="Chart";$pcChart=_t(cr,{optional:!0,skipSelf:!0})??void 0;bindDirectiveInstance=_t(ye,{self:!0});onAfterViewChecked(){this.bindDirectiveInstance.setAttrs(this.ptms(["host","root"]));}type;plugins=[];width;height;responsive=!0;ariaLabel;ariaLabelledBy;get data(){return this._data;}set data(n){this._data=n,this.reinit();}get options(){return this._options;}set options(n){this._options=n,this.reinit();}onDataSelect=new ls();isBrowser=!1;initialized;_data;_options={};chart;_componentStyle=_t(lr);constructor(n,s){super(),this.el=n,this.zone=s;}onAfterViewInit(){this.initChart(),this.initialized=!0;}onCanvasClick(n){if(this.chart){let s=this.chart.getElementsAtEventForMode(n,"nearest",{intersect:!0},!1),o=this.chart.getElementsAtEventForMode(n,"dataset",{intersect:!0},!1);s&&s[0]&&o&&this.onDataSelect.emit({originalEvent:n,element:s[0],dataset:o});}}initChart(){if(As(this.platformId)){let n=this.options||{};n.responsive=this.responsive,n.responsive&&(this.height||this.width)&&(n.maintainAspectRatio=!1),this.zone.runOutsideAngular(()=>{this.chart=new rr(this.el.nativeElement.children[0],{type:this.type,data:this.data,options:this.options,plugins:this.plugins});});}}getCanvas(){return this.el.nativeElement.children[0];}getBase64Image(){return this.chart.toBase64Image();}generateLegend(){if(this.chart)return this.chart.generateLegend();}refresh(){this.chart&&this.chart.update();}reinit(){this.chart&&(this.chart.destroy(),this.initChart());}onDestroy(){this.chart&&(this.chart.destroy(),this.initialized=!1,this.chart=null);}};w(i,"\u0275fac",function(s){return new(s||i)(Wi(ds),Wi(cs));}),w(i,"\u0275cmp",Pt({type:i,selectors:[["p-chart"]],hostVars:4,hostBindings:function(s,o){s&2&&(Ms(o.sx("root")),Cs(o.cx("root")));},inputs:{type:"type",plugins:"plugins",width:"width",height:"height",responsive:[2,"responsive","responsive",Ls],ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",data:"data",options:"options"},outputs:{onDataSelect:"onDataSelect"},features:[Ge([lr,{provide:cr,useExisting:i}]),gs([ye]),ps],decls:1,vars:5,consts:[["role","img",3,"click","pBind"]],template:function(s,o){s&1&&(U(0,"canvas",0),qe("click",function(r){return o.onCanvasClick(r);}),J()),s&2&&(ot("pBind",o.ptm("canvas")),ms("aria-label",o.ariaLabel)("aria-labelledby",o.ariaLabelledBy)("width",o.responsive&&!o.width?null:o.width)("height",o.responsive&&!o.height?null:o.height));},dependencies:[Je,ii,Ns,ye],encapsulation:2,changeDetection:0}));let e=i;return e;})(),Wu=(()=>{let i=class i{};w(i,"\u0275fac",function(s){return new(s||i)();}),w(i,"\u0275mod",fs({type:i})),w(i,"\u0275inj",as({imports:[eu,ii,ii]}));let e=i;return e;})();var iu=[[["",8,"icon"]],[["",8,"label"]]],nu=[".icon",".label"],hr=(()=>{let i=class i{help=xt.required();};w(i,"\u0275fac",function(s){return new(s||i)();}),w(i,"\u0275cmp",Pt({type:i,selectors:[["my-unavailable-menu-entry"]],inputs:{help:[1,"help"]},ngContentSelectors:nu,decls:10,vars:1,consts:()=>{let n;n="Func\u021Bionalitate indisponibil\u0103";let s;return s="INDISPONIBIL",[s,[1,"unavailable"],[1,"badge-help"],[1,"pt-badge","badge-secondary-on-secondary"],["helpTitle",n,"container","body"]];},template:function(s,o){s&1&&(vs(iu),U(0,"div",1),$i(1),U(2,"div")(3,"div"),$i(4,1),J(),U(5,"div",2)(6,"div",3),ys(7,0),J(),U(8,"my-help",4),xe(9),J()()()()),s&2&&(st(9),ws(" ",o.help()," "));},dependencies:[Qe,te,ti,ei,$s],styles:[`.unavailable[_ngcontent-%COMP%]{display:flex;align-items:center}.unavailable[_ngcontent-%COMP%]   my-help[_ngcontent-%COMP%]{color:var(--fg-200)}@media only screen and (max-width:1000px){.unavailable[_ngcontent-%COMP%]{flex-direction:column;text-align:center;align-items:center}.badge-help[_ngcontent-%COMP%]{display:flex;margin-top:.25rem}}
/*# sourceMappingURL=unavailable-menu-entry.component-J3BKOWVD.css.map */`]}));let e=i;return e;})();var ou=()=>({exact:!0});function au(e,i){e&1&&(U(0,"div",6),Ht(1,"div"),J());}function ru(e,i){if(e&1&&(U(0,"div",9),Ht(1,"my-global-icon",10),J()),e&2){let t=rt(3).$implicit;st(),ot("iconName",t.icon);}}function lu(e,i){if(e&1&&Ze(0,ru,2,1,"div",9),e&2){let t=rt(2).$implicit;Ke(t.icon?0:-1);}}function cu(e,i){if(e&1&&(U(0,"span"),xe(1),J()),e&2){let t=rt(2).$implicit;st(),Yi(t.label);}}function hu(e,i){e&1&&Ht(0,"span",13);}function du(e,i){e&1&&Ht(0,"span",14);}function uu(e,i){if(e&1&&(U(0,"my-unavailable-menu-entry",7),Xe(1,hu,1,0,"span",11)(2,du,1,0,"span",12),J()),e&2){rt();let t=_e(1),n=_e(3),s=rt().$implicit;ot("help",s.unavailableText()),st(),ot("ngTemplateOutlet",t),st(),ot("ngTemplateOutlet",n);}}function fu(e,i){e&1&&ji(0);}function gu(e,i){e&1&&ji(0);}function pu(e,i){if(e&1&&(U(0,"a",8),Xe(1,fu,1,0,"ng-container",15)(2,gu,1,0,"ng-container",15),J()),e&2){rt();let t=_e(1),n=_e(3),s=rt().$implicit,o=rt();ot("routerLink",s.routerLink)("queryParams",o.globalQueryParams())("routerLinkActiveOptions",Os(5,ou)),st(),ot("ngTemplateOutlet",t),st(),ot("ngTemplateOutlet",n);}}function mu(e,i){if(e&1&&(Xe(0,lu,1,1,"ng-template",null,0,Ui)(2,cu,2,1,"ng-template",null,1,Ui),Ze(4,uu,3,3,"my-unavailable-menu-entry",7)(5,pu,3,6,"a",8)),e&2){let t=rt().$implicit,n=rt();st(4),Ke(n.isUnavailable(t)?4:5);}}function bu(e,i){if(e&1&&Ze(0,au,2,0,"div",6)(1,mu,6,1),e&2){let t=i.$implicit,n=rt();Ke(t.type==="separator"?0:t.type==="link"&&n.isDisplayed(t)?1:-1);}}var uf=(()=>{let i=class i{domSanitizer=_t(Ts);config=xt.required();globalQueryParams=xt();lateralMenuBackground=this.domSanitizer.bypassSecurityTrustHtml(dr());isDisplayed(n){return n.isDisplayed?n.isDisplayed():!0;}isUnavailable(n){return n.unavailableText?!!n.unavailableText():!1;}};w(i,"\u0275fac",function(s){return new(s||i)();}),w(i,"\u0275cmp",Pt({type:i,selectors:[["my-lateral-menu"]],inputs:{config:[1,"config"],globalQueryParams:[1,"globalQueryParams"]},decls:8,vars:2,consts:[["icon",""],["label",""],[1,"menu"],["aria-hidden","true",1,"svg-container",3,"innerHTML"],[1,"ul-unstyle"],[1,"menu-placeholder"],[1,"separator"],[3,"help"],["queryParamsHandling","merge","routerLinkActive","active",3,"routerLink","queryParams","routerLinkActiveOptions"],[1,"global-icon-wrapper"],[3,"iconName"],["class","icon",4,"ngTemplateOutlet"],["class","label",4,"ngTemplateOutlet"],[1,"icon"],[1,"label"],[4,"ngTemplateOutlet"]],template:function(s,o){s&1&&(U(0,"div",2),Ht(1,"div",3),U(2,"h1"),xe(3),J(),U(4,"ul",4),_s(5,bu,2,1,null,null,bs),J()(),Ht(7,"div",5)),s&2&&(st(),ot("innerHTML",o.lateralMenuBackground,us),st(2),Yi(o.config().title),st(2),xs(o.config().entries));},dependencies:[Je,Ds,Qe,Rs,Es,te,ti,ei,Ws,hr],styles:[`menu[_ngcontent-%COMP%], .menu-placeholder[_ngcontent-%COMP%], h1[_ngcontent-%COMP%], ul[_ngcontent-%COMP%]{position:relative;z-index:1}.svg-container[_ngcontent-%COMP%]{position:absolute;top:0;opacity:.3;z-index:0;overflow:hidden;width:100%;height:100%}.svg-container[_ngcontent-%COMP%]     svg{color:var(--bg-secondary-450);-webkit-mask-image:linear-gradient(to bottom,#000 25%,transparent 100%);mask-image:linear-gradient(to bottom,#000 25%,transparent 100%)}h1[_ngcontent-%COMP%]{color:var(--fg-200);font-weight:700;margin-bottom:1rem;text-align:center;font-size:.875rem}.menu[_ngcontent-%COMP%], .menu-placeholder[_ngcontent-%COMP%]{position:sticky;top:var(--header-height);width:calc(248px - 2rem);max-height:calc(100vh - var(--header-height));z-index:12600;margin-inline-end:var(--x-margin-content)}.menu[_ngcontent-%COMP%]{padding-top:1.5rem;padding-bottom:1.5rem;background-color:var(--bg-secondary-400);border-radius:14px;overflow:auto}.global-icon-wrapper[_ngcontent-%COMP%]{display:inline-block;border-radius:100%;padding:5px;background-color:var(--bg);line-height:1;width:fit-content;height:fit-content;margin-inline-end:.75rem}.global-icon-wrapper[_ngcontent-%COMP%]   my-global-icon[_ngcontent-%COMP%]{color:var(--primary);display:inline-block;width:22px;height:22px;line-height:22px}li[_ngcontent-%COMP%]{list-style:none}a[_ngcontent-%COMP%], my-unavailable-menu-entry[_ngcontent-%COMP%], .separator[_ngcontent-%COMP%]{padding-inline-start:calc(1.275rem + .3vw)}@media(min-width:1200px){a[_ngcontent-%COMP%], my-unavailable-menu-entry[_ngcontent-%COMP%], .separator[_ngcontent-%COMP%]{padding-inline-start:1.5rem}}my-unavailable-menu-entry[_ngcontent-%COMP%]{color:var(--secondary-icon-color)}my-unavailable-menu-entry[_ngcontent-%COMP%]   .global-icon-wrapper[_ngcontent-%COMP%]   my-global-icon[_ngcontent-%COMP%]{color:var(--secondary-icon-color)!important}a[_ngcontent-%COMP%], my-unavailable-menu-entry[_ngcontent-%COMP%]{display:block;padding-top:.5rem;padding-bottom:.5rem}a[_ngcontent-%COMP%]{color:var(--fg-350)}a[_ngcontent-%COMP%], a[_ngcontent-%COMP%]:hover, a[_ngcontent-%COMP%]:focus, a[_ngcontent-%COMP%]:active{text-decoration:none}a[_ngcontent-%COMP%]:focus:not(:focus-visible){outline:none}a[_ngcontent-%COMP%]:hover{opacity:1;color:var(--fg-400)}a.active[_ngcontent-%COMP%]{color:var(--fg-400);font-weight:700;background-color:var(--bg-secondary-350)}a.active[_ngcontent-%COMP%]   .global-icon-wrapper[_ngcontent-%COMP%]{background-color:var(--primary)}a.active[_ngcontent-%COMP%]   .global-icon-wrapper[_ngcontent-%COMP%]   my-global-icon[_ngcontent-%COMP%]{color:var(--bg)}.separator[_ngcontent-%COMP%]{padding-top:1rem;padding-bottom:1rem;padding-inline-end:calc(1.275rem + .3vw)}@media(min-width:1200px){.separator[_ngcontent-%COMP%]{padding-inline-end:1.5rem}}.separator[_ngcontent-%COMP%]:last-child{display:none}.separator[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{height:2px;width:100%;background-color:var(--bg-secondary-500);border-radius:14px}@media screen and (max-width:1000px){h1[_ngcontent-%COMP%]{width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}h1[_ngcontent-%COMP%]:not(caption){position:absolute!important}h1[_ngcontent-%COMP%]   *[_ngcontent-%COMP%]{overflow:hidden!important}ul[_ngcontent-%COMP%]{display:flex;margin:0 auto;width:fit-content}.menu-placeholder[_ngcontent-%COMP%]{display:none}.menu[_ngcontent-%COMP%]{position:fixed;bottom:0;top:unset;width:calc(100vw - var(--menu-width) - var(--x-margin-content) * 2);padding:.75rem .5rem;border:1px solid var(--bg-secondary-450);border-bottom:0;border-end-end-radius:0;border-end-start-radius:0}a[_ngcontent-%COMP%]{display:flex;flex-direction:column;text-align:center;align-items:center}a.active[_ngcontent-%COMP%]{background-color:inherit}a[_ngcontent-%COMP%], .separator[_ngcontent-%COMP%], my-unavailable-menu-entry[_ngcontent-%COMP%]{font-size:12px;line-height:1.2;padding:0 .5rem}.separator[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{width:2px;height:100%}.global-icon-wrapper[_ngcontent-%COMP%]{margin:0 0 .25rem}}@media screen and (max-width:500px){.menu[_ngcontent-%COMP%]{border-radius:0;border-width:1px 0 0;width:100vw;left:0}}
/*# sourceMappingURL=lateral-menu.component-MBZQEATE.css.map */`]}));let e=i;return e;})();var Mf=(()=>{let i=class i{serverService=_t(Hs);playerSettingsService=_t(Ys);inputId=xt.required();mode=xt.required();channel=xt();themes;selectedId;ngOnInit(){if(this.mode()==="video"&&!this.channel())throw new Error("Channel must be specified in video mode");this.buildOptions();}propagateChange=n=>{};writeValue(n){this.selectedId=n;}registerOnChange(n){this.propagateChange=n;}registerOnTouched(){}onModelChange(){this.propagateChange(this.selectedId);}buildOptions(){let n=this.serverService.getHTMLConfig(),s=n.instance.name,o=this.getLabelOf(n.defaults.player.theme);this.themes=[],(this.mode()==="channel"||this.mode()==="video")&&this.themes.push({id:"instance-default",label:"Setare "+s+" ("+o+")"}),this.mode()==="video"&&(this.themes.push({id:"channel-default",label:"Setare "+this.channel().displayName+""}),this.scheduleChannelUpdate()),this.themes=this.themes.concat(this.getPlayerThemes());}scheduleChannelUpdate(){this.playerSettingsService.getChannelSettings({channelHandle:this.channel().name,raw:!0}).subscribe({next:n=>{this.themes.find(s=>s.id==="channel-default").label=this.buildChannelLabel(n);}});}buildChannelLabel(n){let s=this.serverService.getHTMLConfig(),o=s.instance.name,a=this.getLabelOf(s.defaults.player.theme),r=n.theme,l=r==="instance-default"?"din setarea "+o+": "+a+"":this.getLabelOf(r);return"Setare canal "+this.channel().displayName+" ("+l+")";}getLabelOf(n){return this.getPlayerThemes().find(s=>s.id===n)?.label;}getPlayerThemes(){return[{id:"galaxy",label:"Galaxy",description:"Tema original\u0103"},{id:"lucide",label:"Lucide",description:"O tem\u0103 curat\u0103 \u0219i modern\u0103"}];}};w(i,"\u0275fac",function(s){return new(s||i)();}),w(i,"\u0275cmp",Pt({type:i,selectors:[["my-select-player-theme"]],inputs:{inputId:[1,"inputId"],mode:[1,"mode"],channel:[1,"channel"]},features:[Ge([{provide:Is,useExisting:ss(()=>i),multi:!0}])],decls:1,vars:3,consts:[["filter","false",3,"ngModelChange","inputId","items","ngModel"]],template:function(s,o){s&1&&(U(0,"my-select-options",0),Ps("ngModelChange",function(r){return ks(o.selectedId,r)||(o.selectedId=r),r;}),qe("ngModelChange",function(){return o.onModelChange();}),J()),s&2&&(ot("inputId",o.inputId())("items",o.themes),Ss("ngModel",o.selectedId));},dependencies:[te,Fs,zs,js],encapsulation:2}));let e=i;return e;})();export{uf as a,Mf as b,P as c,F as d,E as e,dt as f,re as g,V as h,ft as i,Ft as j,eu as k,Wu as l};/**i18n:347eeb695970c32bc275618edc2e751c67145d9fc3012e70543c114a99b9e016*///# sourceMappingURL=chunk-NKAZMGCL.js.map