var vn=Object.defineProperty;var d=(t,e)=>vn(t,"name",{value:e,configurable:!0});function Jt(t){return t+.5|0}d(Jt,"m");var _t=d((t,e,i)=>Math.max(Math.min(t,i),e),"b");function Kt(t){return _t(Jt(t*2.55),0,255)}d(Kt,"x");function yt(t){return _t(Jt(t*255),0,255)}d(yt,"d");function ft(t){return _t(Jt(t/2.55)/100,0,1)}d(ft,"o");function Ki(t){return _t(Jt(t*100),0,100)}d(Ki,"X");var st={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},li=[..."0123456789ABCDEF"],Mn=d(t=>li[t&15],"Z"),wn=d(t=>li[(t&240)>>4]+li[t&15],"A"),Me=d(t=>(t&240)>>4===(t&15),"F"),kn=d(t=>Me(t.r)&&Me(t.g)&&Me(t.b)&&Me(t.a),"U");function Sn(t){var e=t.length,i;return t[0]==="#"&&(e===4||e===5?i={r:255&st[t[1]]*17,g:255&st[t[2]]*17,b:255&st[t[3]]*17,a:e===5?st[t[4]]*17:255}:(e===7||e===9)&&(i={r:st[t[1]]<<4|st[t[2]],g:st[t[3]]<<4|st[t[4]],b:st[t[5]]<<4|st[t[6]],a:e===9?st[t[7]]<<4|st[t[8]]:255})),i}d(Sn,"V");var Pn=d((t,e)=>t<255?e(t):"","H");function Dn(t){var e=kn(t)?Mn:wn;return t?"#"+e(t.r)+e(t.g)+e(t.b)+Pn(t.a,e):void 0}d(Dn,"W");var Cn=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Qi(t,e,i){let s=e*Math.min(i,1-i),a=d((n,r=(n+t/30)%12)=>i-s*Math.max(Math.min(r-3,9-r,1),-1),"r");return[a(0),a(8),a(4)]}d(Qi,"$");function On(t,e,i){let s=d((a,n=(a+t/60)%6)=>i-i*e*Math.max(Math.min(n,4-n,1),0),"t");return[s(5),s(3),s(1)]}d(On,"L");function An(t,e,i){let s=Qi(t,1,.5),a;for(e+i>1&&(a=1/(e+i),e*=a,i*=a),a=0;a<3;a++)s[a]*=1-e-i,s[a]+=e;return s}d(An,"j");function Ln(t,e,i,s,a){return t===a?(e-i)/s+(e.5?h/(2-a-n):h/(a+n),o=Ln(e,i,s,h,a),o=o*60+.5),[o|0,l||0,r]}d(hi,"_");function di(t,e,i,s){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,s)).map(yt)}d(di,"M");function ci(t,e,i){return di(Qi,t,e,i)}d(ci,"S");function Tn(t,e,i){return di(An,t,e,i)}d(Tn,"K");function En(t,e,i){return di(On,t,e,i)}d(En,"B");function ts(t){return(t%360+360)%360}d(ts,"P");function Rn(t){let e=Cn.exec(t),i=255,s;if(!e)return;e[5]!==s&&(i=e[6]?Kt(+e[5]):yt(+e[5]));let a=ts(+e[2]),n=+e[3]/100,r=+e[4]/100;return e[1]==="hwb"?s=Tn(a,n,r):e[1]==="hsv"?s=En(a,n,r):s=ci(a,n,r),{r:s[0],g:s[1],b:s[2],a:i}}d(Rn,"Q");function In(t,e){var i=hi(t);i[0]=ts(i[0]+e),i=ci(i),t.r=i[0],t.g=i[1],t.b=i[2]}d(In,"D");function Fn(t){if(!t)return;let e=hi(t),i=e[0],s=Ki(e[1]),a=Ki(e[2]);return t.a<255?`hsla(${i}, ${s}%, ${a}%, ${ft(t.a)})`:`hsl(${i}, ${s}%, ${a}%)`}d(Fn,"v");var Gi={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"},Ji={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 zn(){let t={},e=Object.keys(Ji),i=Object.keys(Gi),s,a,n,r,o;for(s=0;s>16&255,n>>8&255,n&255]}return t}d(zn,"G");var we;function Vn(t){we||(we=zn(),we.transparent=[0,0,0,0]);let e=we[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}d(Vn,"I");var Bn=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Wn(t){let e=Bn.exec(t),i=255,s,a,n;if(e){if(e[7]!==s){let r=+e[7];i=e[8]?Kt(r):_t(r*255,0,255)}return s=+e[1],a=+e[3],n=+e[5],s=255&(e[2]?Kt(s):_t(s,0,255)),a=255&(e[4]?Kt(a):_t(a,0,255)),n=255&(e[6]?Kt(n):_t(n,0,255)),{r:s,g:a,b:n,a:i}}}d(Wn,"z");function Nn(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${ft(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}d(Nn,"C");var oi=d(t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,"w"),Bt=d(t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4),"h");function Hn(t,e,i){let s=Bt(ft(t.r)),a=Bt(ft(t.g)),n=Bt(ft(t.b));return{r:yt(oi(s+i*(Bt(ft(e.r))-s))),g:yt(oi(a+i*(Bt(ft(e.g))-a))),b:yt(oi(n+i*(Bt(ft(e.b))-n))),a:t.a+i*(e.a-t.a)}}d(Hn,"ee");function ke(t,e,i){if(t){let s=hi(t);s[e]=Math.max(0,Math.min(s[e]+s[e]*i,e===0?360:1)),s=ci(s),t.r=s[0],t.g=s[1],t.b=s[2]}}d(ke,"Y");function es(t,e){return t&&Object.assign(e||{},t)}d(es,"T");function Zi(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=yt(t[3]))):(e=es(t,{r:0,g:0,b:0,a:1}),e.a=yt(e.a)),e}d(Zi,"R");function jn(t){return t.charAt(0)==="r"?Wn(t):Rn(t)}d(jn,"ne");var Gt=d(class{constructor(t){if(t instanceof Gt)return t;let e=typeof t,i;e==="object"?i=Zi(t):e==="string"&&(i=Sn(t)||Vn(t)||jn(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=es(this._rgb);return t&&(t.a=ft(t.a)),t}set rgb(t){this._rgb=Zi(t)}rgbString(){return this._valid?Nn(this._rgb):void 0}hexString(){return this._valid?Dn(this._rgb):void 0}hslString(){return this._valid?Fn(this._rgb):void 0}mix(t,e){if(t){let i=this.rgb,s=t.rgb,a,n=e===a?.5:e,r=2*n-1,o=i.a-s.a,l=((r*o===-1?r:(r+o)/(1+r*o))+1)/2;a=1-l,i.r=255&l*i.r+a*s.r+.5,i.g=255&l*i.g+a*s.g+.5,i.b=255&l*i.b+a*s.b+.5,i.a=n*i.a+(1-n)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=Hn(this._rgb,t._rgb,e)),this}clone(){return new Gt(this.rgb)}alpha(t){return this._rgb.a=yt(t),this}clearer(t){let e=this._rgb;return e.a*=1-t,this}greyscale(){let t=this._rgb,e=Jt(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){let e=this._rgb;return e.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ke(this._rgb,2,t),this}darken(t){return ke(this._rgb,2,-t),this}saturate(t){return ke(this._rgb,1,t),this}desaturate(t){return ke(this._rgb,1,-t),this}rotate(t){return In(this._rgb,t),this}},"l");var $n=Object.defineProperty,Yn=d((t,e,i)=>e in t?$n(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,"Mo"),S=d((t,e,i)=>(Yn(t,typeof e!="symbol"?e+"":e,i),i),"S");function gt(){}d(gt,"ct");var Un=(()=>{let t=0;return()=>t++})();function T(t){return t===null||typeof t>"u"}d(T,"T");function F(t){if(Array.isArray&&Array.isArray(t))return!0;let e=Object.prototype.toString.call(t);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}d(F,"z");function A(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}d(A,"A");function W(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}d(W,"W");function et(t,e){return W(t)?t:e}d(et,"Q");function O(t,e){return typeof t>"u"?e:t}d(O,"D");var Xn=d((t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/e,"Ds"),ma=d((t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t,"yi");function I(t,e,i){if(t&&typeof t.call=="function")return t.apply(i,e)}d(I,"I");function R(t,e,i,s){let a,n,r;if(F(t))if(n=t.length,s)for(a=n-1;a>=0;a--)e.call(i,t[a],a);else for(a=0;at,x:t=>t.x,y:t=>t.y};function Gn(t){let e=t.split("."),i=[],s="";for(let a of e)s+=a,s.endsWith("\\")?s=s.slice(0,-1)+".":(i.push(s),s="");return i}d(Gn,"So");function Jn(t){let e=Gn(t);return i=>{for(let s of e){if(s==="")break;i=i&&i[s]}return i}}d(Jn,"Po");function kt(t,e){return(is[e]||(is[e]=Jn(e)))(t)}d(kt,"mt");function zi(t){return t.charAt(0).toUpperCase()+t.slice(1)}d(zi,"Ue");var at=d(t=>typeof t<"u","it"),St=d(t=>typeof t=="function","gt"),ss=d((t,e)=>{if(t.size!==e.size)return!1;for(let i of t)if(!e.has(i))return!1;return!0},"vi");function Zn(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}d(Zn,"Cs");var B=Math.PI,z=2*B,Qn=z+B,Ue=Number.POSITIVE_INFINITY,tr=B/180,N=B/2,Dt=B/4,as=B*2/3,vt=Math.log10,ut=Math.sign;function oe(t,e,i){return Math.abs(t-e)a-n).pop(),e}d(er,"As");function Ht(t){return!isNaN(parseFloat(t))&&isFinite(t)}d(Ht,"Rt");function ir(t,e){let i=Math.round(t);return i-e<=t&&i+e>=t}d(ir,"Ts");function xa(t,e,i){let s,a,n;for(s=0,a=t.length;sl&&h=Math.min(e,i)-s&&t<=Math.max(e,i)+s}d(bt,"ht");function Bi(t,e,i){i=i||(r=>t[r]1;)n=a+s>>1,i(n)?a=n:s=n;return{lo:a,hi:s}}d(Bi,"Xe");var xt=d((t,e,i,s)=>Bi(t,i,s?a=>{let n=t[a][e];return nt[a][e]Bi(t,i,s=>t[s][e]>=i),"Rs");function rr(t,e,i){let s=0,a=t.length;for(;ss&&t[a-1]>i;)a--;return s>0||a{let s="_onData"+zi(i),a=t[i];Object.defineProperty(t,i,{configurable:!0,enumerable:!1,value(...n){let r=a.apply(this,n);return t._chartjs.listeners.forEach(o=>{typeof o[s]=="function"&&o[s](...n)}),r}})})}d(or,"zs");function os(t,e){let i=t._chartjs;if(!i)return;let s=i.listeners,a=s.indexOf(e);a!==-1&&s.splice(a,1),!(s.length>0)&&(ya.forEach(n=>{delete t[n]}),delete t._chartjs)}d(os,"Pi");function va(t){let e=new Set,i,s;for(i=0,s=t.length;i"u"?function(t){return t()}:window.requestAnimationFrame}();function wa(t,e){let i=[],s=!1;return function(...a){i=a,s||(s=!0,Ma.call(window,()=>{s=!1,t.apply(e,i)}))}}d(wa,"Ci");function lr(t,e){let i;return function(...s){return e?(clearTimeout(i),i=setTimeout(t,e,s)):t.apply(this,s),e}}d(lr,"Fs");var Wi=d(t=>t==="start"?"left":t==="end"?"right":"center","Ke"),U=d((t,e,i)=>t==="start"?e:t==="end"?i:(e+i)/2,"X"),hr=d((t,e,i,s)=>t===(s?"left":"right")?i:t==="center"?(e+i)/2:e,"Bs");function ka(t,e,i){let s=e.length,a=0,n=s;if(t._sorted){let{iScale:r,_parsed:o}=t,l=r.axis,{min:h,max:c,minDefined:u,maxDefined:f}=r.getUserBounds();u&&(a=Y(Math.min(xt(o,r.axis,h).lo,i?s:xt(e,l,r.getPixelForValue(h)).lo),0,s-1)),f?n=Y(Math.max(xt(o,r.axis,c,!0).hi+1,i?0:xt(e,l,r.getPixelForValue(c),!0).hi+1),a,s)-a:n=s-a}return{start:a,count:n}}d(ka,"Ai");function Sa(t){let{xScale:e,yScale:i,_scaleRanges:s}=t,a={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!s)return t._scaleRanges=a,!0;let n=s.xmin!==e.min||s.xmax!==e.max||s.ymin!==i.min||s.ymax!==i.max;return Object.assign(s,a),n}d(Sa,"Ti");var Se=d(t=>t===0||t===1,"Be"),ls=d((t,e,i)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*z/i)),"bs"),hs=d((t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*z/i)+1,"_s"),le={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*N)+1,easeOutSine:t=>Math.sin(t*N),easeInOutSine:t=>-.5*(Math.cos(B*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>Se(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Se(t)?t:ls(t,.075,.3),easeOutElastic:t=>Se(t)?t:hs(t,.075,.3),easeInOutElastic(t){return Se(t)?t:t<.5?.5*ls(t*2,.1125,.45):.5+.5*hs(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-le.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?le.easeInBounce(t*2)*.5:le.easeOutBounce(t*2-1)*.5+.5};function Pa(t){if(t&&typeof t=="object"){let e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}d(Pa,"Vs");function ds(t){return Pa(t)?t:new Gt(t)}d(ds,"Li");function ui(t){return Pa(t)?t:new Gt(t).saturate(.5).darken(.1).hexString()}d(ui,"bi");var dr=["x","y","borderWidth","radius","tension"],cr=["color","borderColor","backgroundColor"];function ur(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),t.set("animations",{colors:{type:"color",properties:cr},numbers:{type:"number",properties:dr}}),t.describe("animations",{_fallback:"animation"}),t.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:e=>e|0}}}})}d(ur,"Lo");function fr(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}d(fr,"Ro");var cs=new Map;function gr(t,e){e=e||{};let i=t+JSON.stringify(e),s=cs.get(i);return s||(s=new Intl.NumberFormat(t,e),cs.set(i,s)),s}d(gr,"Eo");function _e(t,e,i){return gr(e,i).format(t)}d(_e,"qt");var Da={values(t){return F(t)?t:""+t},numeric(t,e,i){if(t===0)return"0";let s=this.chart.options.locale,a,n=t;if(i.length>1){let h=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(h<1e-4||h>1e15)&&(a="scientific"),n=pr(t,i)}let r=vt(Math.abs(n)),o=Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:a,minimumFractionDigits:o,maximumFractionDigits:o};return Object.assign(l,this.options.ticks.format),_e(t,s,l)},logarithmic(t,e,i){if(t===0)return"0";let s=i[e].significand||t/Math.pow(10,Math.floor(vt(t)));return[1,2,3,5,10,15].includes(s)||e>.8*i.length?Da.numeric.call(this,t,e,i):""}};function pr(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}d(pr,"Io");var ti={formatters:Da};function mr(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,i)=>i.lineWidth,tickColor:(e,i)=>i.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:ti.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}d(mr,"zo");var Ft=Object.create(null),ki=Object.create(null);function he(t,e){if(!e)return t;let i=e.split(".");for(let s=0,a=i.length;si.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=(i,s)=>ui(s.backgroundColor),this.hoverBorderColor=(i,s)=>ui(s.borderColor),this.hoverColor=(i,s)=>ui(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(t),this.apply(e)}set(t,e){return fi(this,t,e)}get(t){return he(this,t)}describe(t,e){return fi(ki,t,e)}override(t,e){return fi(Ft,t,e)}route(t,e,i,s){let a=he(this,t),n=he(this,i),r="_"+e;Object.defineProperties(a,{[r]:{value:a[e],writable:!0},[e]:{enumerable:!0,get(){let o=this[r],l=n[s];return A(o)?Object.assign({},l,o):O(o,l)},set(o){this[r]=o}}})}apply(t){t.forEach(e=>e(this))}},"xi"),H=new br({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[ur,fr,mr]);function xr(t){return!t||T(t.size)||T(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}d(xr,"Fo");function Xe(t,e,i,s,a){let n=e[a];return n||(n=e[a]=t.measureText(a).width,i.push(a)),n>s&&(s=n),s}d(Xe,"pe");function _r(t,e,i,s){s=s||{};let a=s.data=s.data||{},n=s.garbageCollect=s.garbageCollect||[];s.font!==e&&(a=s.data={},n=s.garbageCollect=[],s.font=e),t.save(),t.font=e;let r=0,o=i.length,l,h,c,u,f;for(l=0;li.length){for(l=0;l0&&t.stroke()}}d(Ca,"Ei");function ge(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&n.strokeColor!=="",l,h;for(t.save(),t.font=a.string,Mr(t,n),l=0;l+t||0,"$o");function Ni(t,e){let i={},s=A(e),a=s?Object.keys(e):e,n=A(t)?s?r=>O(t[r],t[e[r]]):r=>t[r]:()=>t;for(let r of a)i[r]=Cr(n(r));return i}d(Ni,"Je");function Oa(t){return Ni(t,{top:"y",right:"x",bottom:"y",left:"x"})}d(Oa,"Ii");function Rt(t){return Ni(t,["topLeft","topRight","bottomLeft","bottomRight"])}d(Rt,"Dt");function q(t){let e=Oa(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}d(q,"K");function j(t,e){t=t||{},e=e||H.font;let i=O(t.size,e.size);typeof i=="string"&&(i=parseInt(i,10));let s=O(t.style,e.style);s&&!(""+s).match(Pr)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);let a={family:O(t.family,e.family),lineHeight:Dr(O(t.lineHeight,e.lineHeight),i),size:i,style:s,weight:O(t.weight,e.weight),string:""};return a.string=xr(a),a}d(j,"$");function se(t,e,i,s){let a=!0,n,r,o;for(n=0,r=t.length;ni&&o===0?0:o+l,"a");return{min:r(s,-Math.abs(n)),max:r(a,n)}}d(Or,"$s");function Pt(t,e){return Object.assign(Object.create(t),e)}d(Pt,"bt");function Hi(t,e=[""],i=t,s,a=()=>t[0]){at(s)||(s=Ea("_fallback",t));let n={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:s,_getTarget:a,override:r=>Hi([r,...t],e,i,s)};return new Proxy(n,{deleteProperty(r,o){return delete r[o],delete r._keys,delete t[0][o],!0},get(r,o){return La(r,o,()=>zr(o,e,t,r))},getOwnPropertyDescriptor(r,o){return Reflect.getOwnPropertyDescriptor(r._scopes[0],o)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(r,o){return gs(r).includes(o)},ownKeys(r){return gs(r)},set(r,o,l){let h=r._storage||(r._storage=a());return r[o]=h[o]=l,delete r._keys,!0}})}d(Hi,"Qe");function jt(t,e,i,s){let a={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:Aa(t,s),setContext:n=>jt(t,n,i,s),override:n=>jt(t.override(n),e,i,s)};return new Proxy(a,{deleteProperty(n,r){return delete n[r],delete t[r],!0},get(n,r,o){return La(n,r,()=>Lr(n,r,o))},getOwnPropertyDescriptor(n,r){return n._descriptors.allKeys?Reflect.has(t,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,r)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(n,r){return Reflect.has(t,r)},ownKeys(){return Reflect.ownKeys(t)},set(n,r,o){return t[r]=o,delete n[r],!0}})}d(jt,"Lt");function Aa(t,e={scriptable:!0,indexable:!0}){let{_scriptable:i=e.scriptable,_indexable:s=e.indexable,_allKeys:a=e.allKeys}=t;return{allKeys:a,scriptable:i,indexable:s,isScriptable:St(i)?i:()=>i,isIndexable:St(s)?s:()=>s}}d(Aa,"zi");var Ar=d((t,e)=>t?t+zi(e):e,"Uo"),ji=d((t,e)=>A(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object),"Fi");function La(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];let s=i();return t[e]=s,s}d(La,"Us");function Lr(t,e,i){let{_proxy:s,_context:a,_subProxy:n,_descriptors:r}=t,o=s[e];return St(o)&&r.isScriptable(e)&&(o=Tr(e,o,t,i)),F(o)&&o.length&&(o=Er(e,o,t,r.isIndexable)),ji(e,o)&&(o=jt(o,a,n&&n[e],r)),o}d(Lr,"Yo");function Tr(t,e,i,s){let{_proxy:a,_context:n,_subProxy:r,_stack:o}=i;if(o.has(t))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+t);return o.add(t),e=e(n,r||s),o.delete(t),ji(t,e)&&(e=$i(a._scopes,a,t,e)),e}d(Tr,"Xo");function Er(t,e,i,s){let{_proxy:a,_context:n,_subProxy:r,_descriptors:o}=i;if(at(n.index)&&s(t))e=e[n.index%e.length];else if(A(e[0])){let l=e,h=a._scopes.filter(c=>c!==l);e=[];for(let c of l){let u=$i(h,a,t,c);e.push(jt(u,n,r&&r[t],o))}}return e}d(Er,"Ko");function Ta(t,e,i){return St(t)?t(e,i):t}d(Ta,"Ys");var Rr=d((t,e)=>t===!0?e:typeof t=="string"?kt(e,t):void 0,"qo");function Ir(t,e,i,s,a){for(let n of e){let r=Rr(i,n);if(r){t.add(r);let o=Ta(r._fallback,i,a);if(at(o)&&o!==i&&o!==s)return o}else if(r===!1&&at(s)&&i!==s)return null}return!1}d(Ir,"Go");function $i(t,e,i,s){let a=e._rootScopes,n=Ta(e._fallback,i,s),r=[...t,...a],o=new Set;o.add(s);let l=fs(o,r,i,n||i,s);return l===null||at(n)&&n!==i&&(l=fs(o,r,n,l,s),l===null)?!1:Hi(Array.from(o),[""],a,n,()=>Fr(e,i,s))}d($i,"Bi");function fs(t,e,i,s,a){for(;i;)i=Ir(t,e,i,s,a);return i}d(fs,"ys");function Fr(t,e,i){let s=t._getTarget();e in s||(s[e]={});let a=s[e];return F(a)&&A(i)?i:a||{}}d(Fr,"Jo");function zr(t,e,i,s){let a;for(let n of e)if(a=Ea(Ar(n,t),i),at(a))return ji(t,a)?$i(i,s,t,a):a}d(zr,"Qo");function Ea(t,e){for(let i of e){if(!i)continue;let s=i[t];if(at(s))return s}}d(Ea,"Xs");function gs(t){let e=t._keys;return e||(e=t._keys=Vr(t._scopes)),e}d(gs,"vs");function Vr(t){let e=new Set;for(let i of t)for(let s of Object.keys(i).filter(a=>!a.startsWith("_")))e.add(s);return Array.from(e)}d(Vr,"Zo");function Ra(t,e,i,s){let{iScale:a}=t,{key:n="r"}=this._parsing,r=new Array(s),o,l,h,c;for(o=0,l=s;oet==="x"?"y":"x","Ks");function Wr(t,e,i,s){let a=t.skip?e:t,n=e,r=i.skip?e:i,o=wi(n,a),l=wi(r,n),h=o/(o+l),c=l/(o+l);h=isNaN(h)?0:h,c=isNaN(c)?0:c;let u=s*h,f=s*c;return{previous:{x:n.x-u*(r.x-a.x),y:n.y-u*(r.y-a.y)},next:{x:n.x+f*(r.x-a.x),y:n.y+f*(r.y-a.y)}}}d(Wr,"ea");function Nr(t,e,i){let s=t.length,a,n,r,o,l,h=$t(t,0);for(let c=0;c!h.skip)),e.cubicInterpolationMode==="monotone")jr(t,a);else{let h=s?t[t.length-1]:t[0];for(n=0,r=t.length;nt.ownerDocument.defaultView.getComputedStyle(t,null),"ti");function Ur(t,e){return si(t).getPropertyValue(e)}d(Ur,"aa");var Xr=["top","right","bottom","left"];function It(t,e,i){let s={};i=i?"-"+i:"";for(let a=0;a<4;a++){let n=Xr[a];s[n]=parseFloat(t[e+"-"+n+i])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}d(It,"Tt");var qr=d((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot),"la");function Kr(t,e){let i=t.touches,s=i&&i.length?i[0]:t,{offsetX:a,offsetY:n}=s,r=!1,o,l;if(qr(a,n,t.target))o=a,l=n;else{let h=e.getBoundingClientRect();o=s.clientX-h.left,l=s.clientY-h.top,r=!0}return{x:o,y:l,box:r}}d(Kr,"ca");function Lt(t,e){if("native"in t)return t;let{canvas:i,currentDevicePixelRatio:s}=e,a=si(i),n=a.boxSizing==="border-box",r=It(a,"padding"),o=It(a,"border","width"),{x:l,y:h,box:c}=Kr(t,i),u=r.left+(c&&o.left),f=r.top+(c&&o.top),{width:g,height:p}=e;return n&&(g-=r.width+o.width,p-=r.height+o.height),{x:Math.round((l-u)/g*i.width/s),y:Math.round((h-f)/p*i.height/s)}}d(Lt,"Ot");function Gr(t,e,i){let s,a;if(e===void 0||i===void 0){let n=Yi(t);if(!n)e=t.clientWidth,i=t.clientHeight;else{let r=n.getBoundingClientRect(),o=si(n),l=It(o,"border","width"),h=It(o,"padding");e=r.width-h.width-l.width,i=r.height-h.height-l.height,s=qe(o.maxWidth,n,"clientWidth"),a=qe(o.maxHeight,n,"clientHeight")}}return{width:e,height:i,maxWidth:s||Ue,maxHeight:a||Ue}}d(Gr,"ha");var De=d(t=>Math.round(t*10)/10,"Ne");function Jr(t,e,i,s){let a=si(t),n=It(a,"margin"),r=qe(a.maxWidth,t,"clientWidth")||Ue,o=qe(a.maxHeight,t,"clientHeight")||Ue,l=Gr(t,e,i),{width:h,height:c}=l;if(a.boxSizing==="content-box"){let u=It(a,"border","width"),f=It(a,"padding");h-=f.width+u.width,c-=f.height+u.height}return h=Math.max(0,h-n.width),c=Math.max(0,s?h/s:c-n.height),h=De(Math.min(h,r,l.maxWidth)),c=De(Math.min(c,o,l.maxHeight)),h&&!c&&(c=De(h/2)),(e!==void 0||i!==void 0)&&s&&l.height&&c>l.height&&(c=l.height,h=De(Math.floor(c*s))),{width:h,height:c}}d(Jr,"Gs");function ps(t,e,i){let s=e||1,a=Math.floor(t.height*s),n=Math.floor(t.width*s);t.height=Math.floor(t.height),t.width=Math.floor(t.width);let r=t.canvas;return r.style&&(i||!r.style.height&&!r.style.width)&&(r.style.height=`${t.height}px`,r.style.width=`${t.width}px`),t.currentDevicePixelRatio!==s||r.height!==a||r.width!==n?(t.currentDevicePixelRatio=s,r.height=a,r.width=n,t.ctx.setTransform(s,0,0,s,0,0),!0):!1}d(ps,"Wi");var Zr=function(){let t=!1;try{let e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch{}return t}();function ms(t,e){let i=Ur(t,e),s=i&&i.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}d(ms,"Hi");function Tt(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}d(Tt,"kt");function Qr(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:s==="middle"?i<.5?t.y:e.y:s==="after"?i<1?t.y:e.y:i>0?e.y:t.y}}d(Qr,"Qs");function to(t,e,i,s){let a={x:t.cp2x,y:t.cp2y},n={x:e.cp1x,y:e.cp1y},r=Tt(t,a,i),o=Tt(a,n,i),l=Tt(n,e,i),h=Tt(r,o,i),c=Tt(o,l,i);return Tt(h,c,i)}d(to,"Zs");var eo=d(function(t,e){return{x(i){return t+t+e-i},setWidth(i){e=i},textAlign(i){return i==="center"?i:i==="right"?"left":"right"},xPlus(i,s){return i-s},leftForLtr(i,s){return i-s}}},"da"),io=d(function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}},"ua");function Nt(t,e,i){return t?eo(e,i):io()}d(Nt,"Et");function za(t,e){let i,s;(e==="ltr"||e==="rtl")&&(i=t.canvas.style,s=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=s)}d(za,"ji");function Va(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}d(Va,"$i");function Ba(t){return t==="angle"?{between:fe,compare:sr,normalize:it}:{between:bt,compare:(e,i)=>e-i,normalize:e=>e}}d(Ba,"tn");function bs({start:t,end:e,count:i,loop:s,style:a}){return{start:t%i,end:e%i,loop:s&&(e-t+1)%i===0,style:a}}d(bs,"Ms");function so(t,e,i){let{property:s,start:a,end:n}=i,{between:r,normalize:o}=Ba(s),l=e.length,{start:h,end:c,loop:u}=t,f,g;if(u){for(h+=l,c+=l,f=0,g=l;fl(a,M,x)&&o(a,M)!==0,"v"),v=d(()=>o(n,x)===0||l(n,M,x),"x"),w=d(()=>b||_(),"M"),k=d(()=>!b||v(),"k");for(let P=c,D=c;P<=u;++P)y=e[P%r],!y.skip&&(x=h(y[s]),x!==M&&(b=l(x,a,n),m===null&&w()&&(m=o(x,a)===0?P:D),m!==null&&k()&&(p.push(bs({start:m,end:P,loop:f,count:r,style:g})),m=null),D=P,M=x));return m!==null&&p.push(bs({start:m,end:u,loop:f,count:r,style:g})),p}d(Wa,"Ui");function Na(t,e){let i=[],s=t.segments;for(let a=0;aa&&t[n%e].skip;)n--;return n%=e,{start:a,end:n}}d(ao,"ga");function no(t,e,i,s){let a=t.length,n=[],r=e,o=t[e],l;for(l=e+1;l<=i;++l){let h=t[l%a];h.skip||h.stop?o.skip||(s=!1,n.push({start:e%a,end:(l-1)%a,loop:s}),e=r=h.stop?l:null):(r=l,o.skip&&(e=l)),o=h}return r!==null&&n.push({start:e%a,end:r%a,loop:s}),n}d(no,"pa");function ro(t,e){let i=t.points,s=t.options.spanGaps,a=i.length;if(!a)return[];let n=!!t._loop,{start:r,end:o}=ao(i,a,n,s);if(s===!0)return xs(t,[{start:r,end:o,loop:n}],i,e);let l=or({chart:t,initial:e.initial,numSteps:n,currentStep:Math.min(i-e.start,n)}))}_refresh(){this._request||(this._running=!0,this._request=Ma.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;let a=i.items,n=a.length-1,r=!1,o;for(;n>=0;--n)o=a[n],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),r=!0):(a[n]=a[a.length-1],a.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),a.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=a.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){let e=this._charts,i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){let e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;let e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){let e=this._charts.get(t);if(!e||!e.items.length)return;let i=e.items,s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}},"is"),pt=new ho,ys="transparent",co={boolean(t,e,i){return i>.5?e:t},color(t,e,i){let s=ds(t||ys),a=s.valid&&ds(e||ys);return a&&a.valid?a.mix(s,i).hexString():e},number(t,e,i){return t+(e-t)*i}},uo=d(class{constructor(t,e,i,s){let a=e[i];s=se([t.to,s,a,t.from]);let n=se([t.from,a,s]);this._active=!0,this._fn=t.fn||co[t.type||typeof n],this._easing=le[t.easing]||le.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=n,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);let s=this._target[this._prop],a=i-this._start,n=this._duration-a;this._start=i,this._duration=Math.floor(Math.max(n,t.duration)),this._total+=a,this._loop=!!t.loop,this._to=se([t.to,e,s,t.from]),this._from=se([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let e=t-this._start,i=this._duration,s=this._prop,a=this._from,n=this._loop,r=this._to,o;if(this._active=a!==r&&(n||e1?2-o:o,o=this._easing(Math.min(1,Math.max(0,o))),this._target[s]=this._fn(a,r,o)}wait(){let t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){let e=t?"res":"rej",i=this._promises||[];for(let s=0;s{let a=t[s];if(!A(a))return;let n={};for(let r of e)n[r]=a[r];(F(a.properties)&&a.properties||[s]).forEach(r=>{(r===s||!i.has(r))&&i.set(r,n)})})}_animateOptions(t,e){let i=e.options,s=go(t,i);if(!s)return[];let a=this._createAnimations(s,i);return i.$shared&&fo(t.options.$animations,i).then(()=>{t.options=i},()=>{}),a}_createAnimations(t,e){let i=this._properties,s=[],a=t.$animations||(t.$animations={}),n=Object.keys(e),r=Date.now(),o;for(o=n.length-1;o>=0;--o){let l=n[o];if(l.charAt(0)==="$")continue;if(l==="options"){s.push(...this._animateOptions(t,e));continue}let h=e[l],c=a[l],u=i.get(l);if(c)if(u&&c.active()){c.update(u,h,r);continue}else c.cancel();if(!u||!u.duration){t[l]=h;continue}a[l]=c=new uo(u,t,l,h),s.push(c)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}let i=this._createAnimations(t,e);if(i.length)return pt.add(this._chart,i),!0}},"ci");function fo(t,e){let i=[],s=Object.keys(e);for(let a=0;a0||!i&&n<0)return a.index}return null}d(ks,"rn");function Ss(t,e){let{chart:i,_cachedMeta:s}=t,a=i._stacks||(i._stacks={}),{iScale:n,vScale:r,index:o}=s,l=n.axis,h=r.axis,c=xo(n,r,s),u=e.length,f;for(let g=0;gi[s].axis===e).shift()}d(gi,"Xi");function vo(t,e){return Pt(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}d(vo,"Da");function Mo(t,e,i){return Pt(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}d(Mo,"Oa");function Zt(t,e){let i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(let a of e){let n=a._stacks;if(!n||n[s]===void 0||n[s][i]===void 0)return;delete n[s][i],n[s]._visualValues!==void 0&&n[s]._visualValues[i]!==void 0&&delete n[s]._visualValues[i]}}}d(Zt,"xe");var pi=d(t=>t==="reset"||t==="none","Ki"),Ps=d((t,e)=>e?t:Object.assign({},t),"cn"),wo=d((t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:ja(i,!0),values:null},"Ca"),ot=d(class{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=ws(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&&Zt(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=d((c,u,f,g)=>c==="x"?u:c==="r"?g:f,"n"),a=e.xAxisID=O(i.xAxisID,gi(t,"x")),n=e.yAxisID=O(i.yAxisID,gi(t,"y")),r=e.rAxisID=O(i.rAxisID,gi(t,"r")),o=e.indexAxis,l=e.iAxisID=s(o,a,n,r),h=e.vAxisID=s(o,n,a,r);e.xScale=this.getScaleForId(a),e.yScale=this.getScaleForId(n),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&os(this._data,this),t._stacked&&Zt(t)}_dataCheck(){let t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(A(e))this._data=bo(e);else if(i!==e){if(i){os(i,this);let s=this._cachedMeta;Zt(s),s._parsed=[]}e&&Object.isExtensible(e)&&or(e,this),this._syncList=[],this._data=e}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let e=this._cachedMeta,i=this.getDataset(),s=!1;this._dataCheck();let a=e._stacked;e._stacked=ws(e.vScale,e),e.stack!==i.stack&&(s=!0,Zt(e),e.stack=i.stack),this._resyncElements(t),(s||a!==e._stacked)&&Ss(this,e._parsed)}configure(){let t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){let{_cachedMeta:i,_data:s}=this,{iScale:a,_stacked:n}=i,r=a.axis,o=t===0&&e===s.length?!0:i._sorted,l=t>0&&i._parsed[t-1],h,c,u;if(this._parsing===!1)i._parsed=s,i._sorted=!0,u=s;else{F(s[t])?u=this.parseArrayData(i,s,t,e):A(s[t])?u=this.parseObjectData(i,s,t,e):u=this.parsePrimitiveData(i,s,t,e);let f=d(()=>c[r]===null||l&&c[r]p||c=0;--u)if(!g()){this.updateRangeFromParsed(l,t,f,o);break}}return l}getAllParsedValues(t){let e=this._cachedMeta._parsed,i=[],s,a,n;for(s=0,a=e.length;s=0&&tthis.getContext(i,s,e),"g"),p=l.resolveNamedOptions(u,f,g,c);return p.$shared&&(p.$shared=o,a[n]=Object.freeze(Ps(p,o))),p}_resolveAnimations(t,e,i){let s=this.chart,a=this._cachedDataOpts,n=`animation-${e}`,r=a[n];if(r)return r;let o;if(s.options.animation!==!1){let h=this.chart.config,c=h.datasetAnimationScopeKeys(this._type,e),u=h.getOptionScopes(this.getDataset(),c);o=h.createResolver(u,this.getContext(t,i,e))}let l=new Ha(s,o&&o.animations);return o&&o._cacheable&&(a[n]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||pi(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){let i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,a=this.getSharedOptions(i),n=this.includeOptions(e,a)||a!==s;return this.updateSharedOptions(a,e,i),{sharedOptions:a,includeOptions:n}}updateElement(t,e,i,s){pi(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!pi(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;let a=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(a)||a})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let e=this._data,i=this._cachedMeta.data;for(let[r,o,l]of this._syncList)this[r](o,l);this._syncList=[];let s=i.length,a=e.length,n=Math.min(a,s);n&&this.parse(0,n),a>s?this._insertElements(s,a-s,t):a{for(l.length+=e,r=l.length-1;r>=n;r--)l[r]=l[r-e]},"l");for(o(a),r=t;ra-n))}return t._cache.$bar}d(ko,"Aa");function So(t){let e=t.iScale,i=ko(e,t.type),s=e._length,a,n,r,o,l=d(()=>{r===32767||r===-32768||(at(o)&&(s=Math.min(s,Math.abs(r-o)||s)),o=r)},"l");for(a=0,n=i.length;a0?a[t-1]:null,o=tMath.abs(o)&&(l=o,h=r),e[i.axis]=h,e._custom={barStart:l,barEnd:h,start:a,end:n,min:r,max:o}}d(Co,"Ea");function $a(t,e,i,s){return F(t)?Co(t,e,i,s):e[i.axis]=i.parse(t,s),e}d($a,"eo");function Ds(t,e,i,s){let a=t.iScale,n=t.vScale,r=a.getLabels(),o=a===n,l=[],h,c,u,f;for(h=i,c=i+s;h=i?1:-1)}d(Oo,"Ia");function Ao(t){let e,i,s,a,n;return t.horizontal?(e=t.base>t.x,i="left",s="right"):(e=t.baseo.controller.options.grouped),a=i.options.stacked,n=[],r=d(o=>{let l=o.controller.getParsed(e),h=l&&l[o.vScale.axis];if(T(h)||isNaN(h))return!0},"r");for(let o of s)if(!(e!==void 0&&r(o))&&((a===!1||n.indexOf(o.stack)===-1||a===void 0&&o.stack===void 0)&&n.push(o.stack),o.index===t))break;return n.length||n.push(void 0),n}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){let s=this._getStacks(t,i),a=e!==void 0?s.indexOf(e):-1;return a===-1?s.length-1:a}_getRuler(){let t=this.options,e=this._cachedMeta,i=e.iScale,s=[],a,n;for(a=0,n=e.data.length;a=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:a}=e,n=this.getParsed(t),r=s.getLabelForValue(n.x),o=a.getLabelForValue(n.y),l=n._custom;return{label:i[t]||"",value:"("+r+", "+o+(l?", "+l:"")+")"}}update(t){let e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){let a=s==="reset",{iScale:n,vScale:r}=this._cachedMeta,{sharedOptions:o,includeOptions:l}=this._getSharedOptions(e,s),h=n.axis,c=r.axis;for(let u=e;ufe(M,o,l,!0)?1:Math.max(_,_*i,v,v*i),"f"),p=d((M,_,v)=>fe(M,o,l,!0)?-1:Math.min(_,_*i,v,v*i),"g"),b=g(0,h,u),m=g(N,c,f),x=p(B,h,u),y=p(B+N,c,f);s=(b-x)/2,a=(m-y)/2,n=-(b+x)/2,r=-(m+y)/2}return{ratioX:s,ratioY:a,offsetX:n,offsetY:r}}d(Ro,"Na");var Et=d(class extends ot{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){let i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let a=d(o=>+i[o],"o");if(A(i[t])){let{key:o="value"}=this._parsing;a=d(l=>+kt(i[l],o),"o")}let n,r;for(n=t,r=t+e;n0&&!isNaN(t)?z*(Math.abs(t)/e):0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,s=i.data.labels||[],a=_e(e._parsed[t],i.options.locale);return{label:s[t]||"",value:a}}getMaxBorderWidth(t){let e=0,i=this.chart,s,a,n,r,o;if(!t){for(s=0,a=i.data.datasets.length;st!=="spacing",_indexable:t=>t!=="spacing"}),S(Et,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((a,n)=>{let r=t.getDatasetMeta(0).controller.getStyle(n);return{text:a,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,fontColor:s,lineWidth:r.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});var ze=d(class extends ot{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let e=this._cachedMeta,{dataset:i,data:s=[],_dataset:a}=e,n=this.chart._animationsDisabled,{start:r,count:o}=ka(e,s,n);this._drawStart=r,this._drawCount=o,Sa(e)&&(r=0,o=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!a._decimated,i.points=s;let l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!n,options:l},t),this.updateElements(s,r,o,t)}updateElements(t,e,i,s){let a=s==="reset",{iScale:n,vScale:r,_stacked:o,_dataset:l}=this._cachedMeta,{sharedOptions:h,includeOptions:c}=this._getSharedOptions(e,s),u=n.axis,f=r.axis,{spanGaps:g,segment:p}=this.options,b=Ht(g)?g:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||a||s==="none",x=e+i,y=t.length,M=e>0&&this.getParsed(e-1);for(let _=0;_=x){w.skip=!0;continue}let k=this.getParsed(_),P=T(k[f]),D=w[u]=n.getPixelForValue(k[u],_),C=w[f]=a||P?r.getBasePixel():r.getPixelForValue(o?this.applyStack(r,k,o):k[f],_);w.skip=isNaN(D)||isNaN(C)||P,w.stop=_>0&&Math.abs(k[u]-M[u])>b,p&&(w.parsed=k,w.raw=l.data[_]),c&&(w.options=h||this.resolveDataElementOptions(_,v.active?"active":s)),m||this.updateElement(v,_,w,s),M=k}}getMaxOverflow(){let t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;let a=s[0].size(this.resolveDataElementOptions(0)),n=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,a,n)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},"ie");S(ze,"id","line"),S(ze,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),S(ze,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});var de=d(class extends ot{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,s=i.data.labels||[],a=_e(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:a}}parseObjectData(t,e,i,s){return Ra.bind(this)(t,e,i,s)}update(t){let e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){let t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{let a=this.getParsed(s).r;!isNaN(a)&&this.chart.getDataVisibility(s)&&(ae.max&&(e.max=a))}),e}_updateRadius(){let t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),a=Math.max(s/2,0),n=Math.max(i.cutoutPercentage?a/100*i.cutoutPercentage:1,0),r=(a-n)/t.getVisibleDatasetCount();this.outerRadius=a-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,e,i,s){let a=s==="reset",n=this.chart,r=n.options.animation,o=this._cachedMeta.rScale,l=o.xCenter,h=o.yCenter,c=o.getIndexAngle(0)-.5*B,u=c,f,g=360/this.countVisibleElements();for(f=0;f{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?rt(this.resolveDataElementOptions(t,e).angle||i):0}},"Bt");S(de,"id","polarArea"),S(de,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),S(de,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((a,n)=>{let r=t.getDatasetMeta(0).controller.getStyle(n);return{text:a,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,fontColor:s,lineWidth:r.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(n),index:n}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});var Pi=d(class extends Et{},"we");S(Pi,"id","pie"),S(Pi,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});var Ve=d(class extends ot{getLabelAndValue(t){let e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return Ra.bind(this)(t,e,i,s)}update(t){let e=this._cachedMeta,i=e.dataset,s=e.data||[],a=e.iScale.getLabels();if(i.points=s,t!=="resize"){let n=this.resolveDatasetElementOptions(t);this.options.showLine||(n.borderWidth=0);let r={_loop:!0,_fullLoop:a.length===s.length,options:n};this.updateElement(i,void 0,r,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){let a=this._cachedMeta.rScale,n=s==="reset";for(let r=e;r0&&this.getParsed(e-1);for(let M=e;M0&&Math.abs(v[f]-y[f])>m,b&&(w.parsed=v,w.raw=l.data[M]),u&&(w.options=c||this.resolveDataElementOptions(M,_.active?"active":s)),x||this.updateElement(_,M,w,s),y=v}this.updateSharedOptions(c,s,h)}getMaxOverflow(){let t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let r=0;for(let o=e.length-1;o>=0;--o)r=Math.max(r,e[o].size(this.resolveDataElementOptions(o))/2);return r>0&&r}let i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;let a=e[0].size(this.resolveDataElementOptions(0)),n=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,a,n)/2}},"ne");S(Be,"id","scatter"),S(Be,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),S(Be,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Io=Object.freeze({__proto__:null,BarController:Ie,BubbleController:Fe,DoughnutController:Et,LineController:ze,PolarAreaController:de,PieController:Pi,RadarController:Ve,ScatterController:Be});function Ot(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}d(Ot,"It");var Ya=d(class{static override(t){Object.assign(Ya.prototype,t)}constructor(t){this.options=t||{}}init(){}formats(){return Ot()}parse(){return Ot()}format(){return Ot()}add(){return Ot()}diff(){return Ot()}startOf(){return Ot()}endOf(){return Ot()}},"Le"),Fo={_date:Ya};function zo(t,e,i,s){let{controller:a,data:n,_sorted:r}=t,o=a._cachedMeta.iScale;if(o&&e===o.axis&&e!=="r"&&r&&n.length){let l=o._reversePixels?nr:xt;if(s){if(a._sharedOptions){let h=n[0],c=typeof h.getRange=="function"&&h.getRange(e);if(c){let u=l(n,e,i-c),f=l(n,e,i+c);return{lo:u.lo,hi:f.hi}}}}else return l(n,e,i)}return{lo:0,hi:n.length-1}}d(zo,"ja");function ye(t,e,i,s,a){let n=t.getSortedVisibleDatasetMetas(),r=i[e];for(let o=0,l=n.length;o{l[r](e[i],a)&&(n.push({element:l,datasetIndex:h,index:c}),o=o||l.inRange(e.x,e.y,a))}),s&&!o?[]:n}d(As,"fn");var No={evaluateInteractionItems:ye,modes:{index(t,e,i,s){let a=Lt(e,t),n=i.axis||"x",r=i.includeInvisible||!1,o=i.intersect?bi(t,a,n,s,r):xi(t,a,n,!1,s,r),l=[];return o.length?(t.getSortedVisibleDatasetMetas().forEach(h=>{let c=o[0].index,u=h.data[c];u&&!u.skip&&l.push({element:u,datasetIndex:h.index,index:c})}),l):[]},dataset(t,e,i,s){let a=Lt(e,t),n=i.axis||"xy",r=i.includeInvisible||!1,o=i.intersect?bi(t,a,n,s,r):xi(t,a,n,!1,s,r);if(o.length>0){let l=o[0].datasetIndex,h=t.getDatasetMeta(l).data;o=[];for(let c=0;ci.pos===e)}d(Qt,"ye");function Ls(t,e){return t.filter(i=>Ua.indexOf(i.pos)===-1&&i.box.axis===e)}d(Ls,"gn");function te(t,e){return t.sort((i,s)=>{let a=e?s:i,n=e?i:s;return a.weight===n.weight?a.index-n.index:a.weight-n.weight})}d(te,"ve");function Ho(t){let e=[],i,s,a,n,r,o;for(i=0,s=(t||[]).length;ih.box.fullSize),!0),s=te(Qt(e,"left"),!0),a=te(Qt(e,"right")),n=te(Qt(e,"top"),!0),r=te(Qt(e,"bottom")),o=Ls(e,"x"),l=Ls(e,"y");return{fullSize:i,leftAndTop:s.concat(n),rightAndBottom:a.concat(l).concat(r).concat(o),chartArea:Qt(e,"chartArea"),vertical:s.concat(a).concat(l),horizontal:n.concat(r).concat(o)}}d(Yo,"Ja");function Ts(t,e,i,s){return Math.max(t[i],e[i])+Math.max(t[s],e[s])}d(Ts,"pn");function Xa(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}d(Xa,"so");function Uo(t,e,i,s){let{pos:a,box:n}=i,r=t.maxPadding;if(!A(a)){i.size&&(t[a]-=i.size);let u=s[i.stack]||{size:0,count:1};u.size=Math.max(u.size,i.horizontal?n.height:n.width),i.size=u.size/u.count,t[a]+=i.size}n.getPadding&&Xa(r,n.getPadding());let o=Math.max(0,e.outerWidth-Ts(r,t,"left","right")),l=Math.max(0,e.outerHeight-Ts(r,t,"top","bottom")),h=o!==t.w,c=l!==t.h;return t.w=o,t.h=l,i.horizontal?{same:h,other:c}:{same:c,other:h}}d(Uo,"Qa");function Xo(t){let e=t.maxPadding;function i(s){let a=Math.max(e[s]-t[s],0);return t[s]+=a,a}d(i,"e"),t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}d(Xo,"Za");function qo(t,e){let i=e.maxPadding;function s(a){let n={left:0,top:0,right:0,bottom:0};return a.forEach(r=>{n[r]=Math.max(e[r],i[r])}),n}return d(s,"s"),s(t?["left","right"]:["top","bottom"])}d(qo,"tr");function ae(t,e,i,s){let a=[],n,r,o,l,h,c;for(n=0,r=t.length,h=0;n{typeof b.beforeLayout=="function"&&b.beforeLayout()});let c=l.reduce((b,m)=>m.box.options&&m.box.options.display===!1?b:b+1,0)||1,u=Object.freeze({outerWidth:e,outerHeight:i,padding:a,availableWidth:n,availableHeight:r,vBoxMaxWidth:n/2/c,hBoxMaxHeight:r/2}),f=Object.assign({},a);Xa(f,q(s));let g=Object.assign({maxPadding:f,w:n,h:r,x:a.left,y:a.top},a),p=$o(l.concat(h),u);ae(o.fullSize,g,u,p),ae(l,g,u,p),ae(h,g,u,p)&&ae(l,g,u,p),Xo(g),Es(o.leftAndTop,g,u,p),g.x+=g.w,g.y+=g.h,Es(o.rightAndBottom,g,u,p),t.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},R(o.chartArea,b=>{let m=b.box;Object.assign(m,t.chartArea),m.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}},qa=d(class{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}},"hi"),Ko=d(class extends qa{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}},"ns"),We="$chartjs",Go={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Rs=d(t=>t===null||t==="","bn");function Jo(t,e){let i=t.style,s=t.getAttribute("height"),a=t.getAttribute("width");if(t[We]={initial:{height:s,width:a,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",Rs(a)){let n=ms(t,"width");n!==void 0&&(t.width=n)}if(Rs(s))if(t.style.height==="")t.height=t.width/(e||2);else{let n=ms(t,"height");n!==void 0&&(t.height=n)}return t}d(Jo,"ir");var Ka=Zr?{passive:!0}:!1;function Zo(t,e,i){t.addEventListener(e,i,Ka)}d(Zo,"sr");function Qo(t,e,i){t.canvas.removeEventListener(e,i,Ka)}d(Qo,"nr");function tl(t,e){let i=Go[t.type]||t.type,{x:s,y:a}=Lt(t,e);return{type:i,chart:e,native:t,x:s!==void 0?s:null,y:a!==void 0?a:null}}d(tl,"or");function Ke(t,e){for(let i of t)if(i===e||i.contains(e))return!0}d(Ke,"di");function el(t,e,i){let s=t.canvas,a=new MutationObserver(n=>{let r=!1;for(let o of n)r=r||Ke(o.addedNodes,s),r=r&&!Ke(o.removedNodes,s);r&&i()});return a.observe(document,{childList:!0,subtree:!0}),a}d(el,"ar");function il(t,e,i){let s=t.canvas,a=new MutationObserver(n=>{let r=!1;for(let o of n)r=r||Ke(o.removedNodes,s),r=r&&!Ke(o.addedNodes,s);r&&i()});return a.observe(document,{childList:!0,subtree:!0}),a}d(il,"rr");var me=new Map,Is=0;function Ga(){let t=window.devicePixelRatio;t!==Is&&(Is=t,me.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}d(Ga,"oo");function sl(t,e){me.size||window.addEventListener("resize",Ga),me.set(t,e)}d(sl,"lr");function al(t){me.delete(t),me.size||window.removeEventListener("resize",Ga)}d(al,"cr");function nl(t,e,i){let s=t.canvas,a=s&&Yi(s);if(!a)return;let n=wa((o,l)=>{let h=a.clientWidth;i(o,l),h{let l=o[0],h=l.contentRect.width,c=l.contentRect.height;h===0&&c===0||n(h,c)});return r.observe(a),sl(t,n),r}d(nl,"hr");function _i(t,e,i){i&&i.disconnect(),e==="resize"&&al(t)}d(_i,"Qi");function rl(t,e,i){let s=t.canvas,a=wa(n=>{t.ctx!==null&&i(tl(n,t))},t);return Zo(s,e,a),a}d(rl,"dr");var ol=d(class extends qa{acquireContext(t,e){let i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Jo(t,e),i):null}releaseContext(t){let e=t.canvas;if(!e[We])return!1;let i=e[We].initial;["height","width"].forEach(a=>{let n=i[a];T(n)?e.removeAttribute(a):e.setAttribute(a,n)});let s=i.style||{};return Object.keys(s).forEach(a=>{e.style[a]=s[a]}),e.width=e.width,delete e[We],!0}addEventListener(t,e,i){this.removeEventListener(t,e);let s=t.$proxies||(t.$proxies={}),a={attach:el,detach:il,resize:nl}[e]||rl;s[e]=a(t,e,i)}removeEventListener(t,e){let i=t.$proxies||(t.$proxies={}),s=i[e];s&&(({attach:_i,detach:_i,resize:_i}[e]||Qo)(t,e,s),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return Jr(t,e,i,s)}isAttached(t){let e=Yi(t);return!!(e&&e.isConnected)}},"os");function ll(t){return!Fa()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?Ko:ol}d(ll,"ur");var lt=d(class{active=!1;tooltipPosition(t){let{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Ht(this.x)&&Ht(this.y)}getProps(t,e){let i=this.$animations;if(!e||!i)return this;let s={};return t.forEach(a=>{s[a]=i[a]&&i[a].active()?i[a]._to:this[a]}),s}},"nt");S(lt,"defaults",{}),S(lt,"defaultRoutes");function hl(t,e){let i=t.options.ticks,s=dl(t),a=Math.min(i.maxTicksLimit||s,s),n=i.major.enabled?ul(e):[],r=n.length,o=n[0],l=n[r-1],h=[];if(r>a)return fl(e,h,n,r/a),h;let c=cl(n,e,a);if(r>0){let u,f,g=r>1?Math.round((l-o)/(r-1)):null;for(Oe(e,h,c,T(g)?0:o-g,o),u=0,f=r-1;ua)return l}return Math.max(a,1)}d(cl,"pr");function ul(t){let e=[],i,s;for(i=0,s=t.length;it==="left"?"right":t==="right"?"left":t,"xr"),Fs=d((t,e,i)=>e==="top"||e==="left"?t[e]+i:t[e]-i,"xn"),zs=d((t,e)=>Math.min(e||t,t),"yn");function Vs(t,e){let i=[],s=t.length/e,a=t.length,n=0;for(;nr+o)))return l}d(ml,"yr");function bl(t,e){R(t,i=>{let s=i.gc,a=s.length/2,n;if(a>e){for(n=0;ni?i:e,i=s&&e>i?e:i,{min:et(e,et(i,e)),max:et(i,et(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){I(this.options.beforeUpdate,[this])}update(t,e,i){let{beginAtZero:s,grace:a,ticks:n}=this.options,r=n.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Or(this,a,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let o=r=a||i<=1||!this.isHorizontal()){this.labelRotation=s;return}let h=this._getLabelSizes(),c=h.widest.width,u=h.highest.height,f=Y(this.chart.width-c,0,this.maxWidth);r=t.offset?this.maxWidth/i:f/(i-1),c+6>r&&(r=f/(i-(t.offset?.5:1)),o=this.maxHeight-ee(t.grid)-e.padding-Bs(t.title,this.chart.options.font),l=Math.sqrt(c*c+u*u),n=Vi(Math.min(Math.asin(Y((h.highest.height+6)/r,-1,1)),Math.asin(Y(o/l,-1,1))-Math.asin(Y(u/l,-1,1)))),n=Math.max(s,Math.min(a,n))),this.labelRotation=n}afterCalculateLabelRotation(){I(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){I(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:a}}=this,n=this._isVisible(),r=this.isHorizontal();if(n){let o=Bs(s,e.options.font);if(r?(t.width=this.maxWidth,t.height=ee(a)+o):(t.height=this.maxHeight,t.width=ee(a)+o),i.display&&this.ticks.length){let{first:l,last:h,widest:c,highest:u}=this._getLabelSizes(),f=i.padding*2,g=rt(this.labelRotation),p=Math.cos(g),b=Math.sin(g);if(r){let m=i.mirror?0:b*c.width+p*u.height;t.height=Math.min(this.maxHeight,t.height+m+f)}else{let m=i.mirror?0:p*c.width+b*u.height;t.width=Math.min(this.maxWidth,t.width+m+f)}this._calculatePadding(l,h,b,p)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){let{ticks:{align:a,padding:n},position:r}=this.options,o=this.labelRotation!==0,l=r!=="top"&&this.axis==="x";if(this.isHorizontal()){let h=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1),u=0,f=0;o?l?(u=s*t.width,f=i*e.height):(u=i*t.height,f=s*e.width):a==="start"?f=e.width:a==="end"?u=t.width:a!=="inner"&&(u=t.width/2,f=e.width/2),this.paddingLeft=Math.max((u-h+n)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-c+n)*this.width/(this.width-c),0)}else{let h=e.height/2,c=t.height/2;a==="start"?(h=0,c=t.height):a==="end"&&(h=e.height,c=0),this.paddingTop=h+n,this.paddingBottom=c+n}}_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(){I(this.options.afterFit,[this])}isHorizontal(){let{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e({width:n[P]||0,height:r[P]||0}),"w");return{first:k(0),last:k(e-1),widest:k(v),highest:k(w),widths:n,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){let e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let e=this._startPixel+t*this._length;return ar(this._alignToPixels?Ct(this.chart,e,0):e)}getDecimalForPixel(t){let e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){let e=this.ticks||[];if(t>=0&&tr*s?r/i:o/s:o*s0}_computeGridLineItems(t){let e=this.axis,i=this.chart,s=this.options,{grid:a,position:n,border:r}=s,o=a.offset,l=this.isHorizontal(),h=this.ticks.length+(o?1:0),c=ee(a),u=[],f=r.setContext(this.getContext()),g=f.display?f.width:0,p=g/2,b=d(function(L){return Ct(i,L,g)},"b"),m,x,y,M,_,v,w,k,P,D,C,E;if(n==="top")m=b(this.bottom),v=this.bottom-c,k=m-p,D=b(t.top)+p,E=t.bottom;else if(n==="bottom")m=b(this.top),D=t.top,E=b(t.bottom)-p,v=m+p,k=this.top+c;else if(n==="left")m=b(this.right),_=this.right-c,w=m-p,P=b(t.left)+p,C=t.right;else if(n==="right")m=b(this.left),P=t.left,C=b(t.right)-p,_=m+p,w=this.left+c;else if(e==="x"){if(n==="center")m=b((t.top+t.bottom)/2+.5);else if(A(n)){let L=Object.keys(n)[0],V=n[L];m=b(this.chart.scales[L].getPixelForValue(V))}D=t.top,E=t.bottom,v=m+p,k=v+c}else if(e==="y"){if(n==="center")m=b((t.left+t.right)/2);else if(A(n)){let L=Object.keys(n)[0],V=n[L];m=b(this.chart.scales[L].getPixelForValue(V))}_=m-p,w=_-c,P=t.left,C=t.right}let K=O(s.ticks.maxTicksLimit,h),Q=Math.max(1,Math.ceil(h/K));for(x=0;xs.value===t);return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){let e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),a,n,r=d((o,l,h)=>{!h.width||!h.color||(i.save(),i.lineWidth=h.width,i.strokeStyle=h.color,i.setLineDash(h.borderDash||[]),i.lineDashOffset=h.borderDashOffset,i.beginPath(),i.moveTo(o.x,o.y),i.lineTo(l.x,l.y),i.stroke(),i.restore())},"r");if(e.display)for(a=0,n=s.length;a{this.draw(a)}}]:[{z:i,draw:a=>{this.drawBackground(),this.drawGrid(a),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:a=>{this.drawLabels(a)}}]}getMatchingVisibleMetas(t){let e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[],a,n;for(a=0,n=e.length;a{let s=i.split("."),a=s.pop(),n=[t].concat(s).join("."),r=e[i].split("."),o=r.pop(),l=r.join(".");H.route(n,a,l,o)})}d(wl,"Dr");function kl(t){return"id"in t&&"defaults"in t}d(kl,"Or");var Sl=d(class{constructor(){this.controllers=new Ae(ot,"datasets",!0),this.elements=new Ae(lt,"elements"),this.plugins=new Ae(Object,"plugins"),this.scales=new Ae(Yt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(s=>{let a=i||this._getRegistryForType(s);i||a.isForType(s)||a===this.plugins&&s.id?this._exec(t,a,s):R(s,n=>{let r=i||this._getRegistryForType(n);this._exec(t,r,n)})})}_exec(t,e,i){let s=zi(t);I(i["before"+s],[],i),e[t](i),I(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;ea.filter(r=>!n.some(o=>r.plugin.id===o.plugin.id)),"n");this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}},"rs");function Dl(t){let e={},i=[],s=Object.keys(ct.plugins.items);for(let n=0;n1&&Ge(t[0].toLowerCase(),e),t))return t;throw new Error(`Cannot determine type of '${name}' axis. Please provide 'axis' or 'position' option.`)}d(Ge,"ui");function Rl(t,e){let i=Ft[t.type]||{scales:{}},s=e.scales||{},a=Di(t.type,e),n=Object.create(null);return Object.keys(s).forEach(r=>{let o=s[r];if(!A(o))return console.error(`Invalid scale configuration for scale: ${r}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);let l=Ge(r,o),h=Tl(l,a),c=i.scales||{};n[r]=re(Object.create(null),[{axis:l},o,c[l],c[h]])}),t.data.datasets.forEach(r=>{let o=r.type||t.type,l=r.indexAxis||Di(o,e),h=(Ft[o]||{}).scales||{};Object.keys(h).forEach(c=>{let u=Ll(c,l),f=r[u+"AxisID"]||u;n[f]=n[f]||Object.create(null),re(n[f],[{axis:u},s[f],h[c]])})}),Object.keys(n).forEach(r=>{let o=n[r];re(o,[H.scales[o.type],H.scale])}),n}d(Rl,"zr");function Ja(t){let e=t.options||(t.options={});e.plugins=O(e.plugins,{}),e.scales=Rl(t,e)}d(Ja,"ao");function Za(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}d(Za,"ro");function Il(t){return t=t||{},t.data=Za(t.data),Ja(t),t}d(Il,"Fr");var Ws=new Map,Qa=new Set;function Le(t,e){let i=Ws.get(t);return i||(i=e(),Ws.set(t,i),Qa.add(i)),i}d(Le,"si");var ie=d((t,e,i)=>{let s=kt(e,i);s!==void 0&&t.add(s)},"ke"),Fl=d(class{constructor(t){this._config=Il(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Za(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),Ja(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Le(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Le(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Le(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){let e=t.id,i=this.type;return Le(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){let i=this._scopeCache,s=i.get(t);return(!s||e)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){let{options:s,type:a}=this,n=this._cachedScopes(t,i),r=n.get(e);if(r)return r;let o=new Set;e.forEach(h=>{t&&(o.add(t),h.forEach(c=>ie(o,t,c))),h.forEach(c=>ie(o,s,c)),h.forEach(c=>ie(o,Ft[a]||{},c)),h.forEach(c=>ie(o,H,c)),h.forEach(c=>ie(o,ki,c))});let l=Array.from(o);return l.length===0&&l.push(Object.create(null)),Qa.has(e)&&n.set(e,l),l}chartOptionScopes(){let{options:t,type:e}=this;return[t,Ft[e]||{},H.datasets[e]||{},{type:e},H,ki]}resolveNamedOptions(t,e,i,s=[""]){let a={$shared:!0},{resolver:n,subPrefixes:r}=Ns(this._resolverCache,t,s),o=n;if(Vl(n,e)){a.$shared=!1,i=St(i)?i():i;let l=this.createResolver(t,i,r);o=jt(n,i,l)}for(let l of e)a[l]=o[l];return a}createResolver(t,e,i=[""],s){let{resolver:a}=Ns(this._resolverCache,t,i);return A(e)?jt(a,e,void 0,s):a}},"cs");function Ns(t,e,i){let s=t.get(e);s||(s=new Map,t.set(e,s));let a=i.join(),n=s.get(a);return n||(n={resolver:Hi(e,i),subPrefixes:i.filter(r=>!r.toLowerCase().includes("hover"))},s.set(a,n)),n}d(Ns,"wn");var zl=d(t=>A(t)&&Object.getOwnPropertyNames(t).reduce((e,i)=>e||St(t[i]),!1),"Br");function Vl(t,e){let{isScriptable:i,isIndexable:s}=Aa(t);for(let a of e){let n=i(a),r=s(a),o=(r||n)&&t[a];if(n&&(St(o)||zl(o))||r&&F(o))return!0}return!1}d(Vl,"Vr");var Bl="4.2.1",Wl=["top","bottom","left","right","chartArea"];function Hs(t,e){return t==="top"||t==="bottom"||Wl.indexOf(t)===-1&&e==="x"}d(Hs,"Sn");function js(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}d(js,"Pn");function $s(t){let e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),I(i&&i.onComplete,[t],e)}d($s,"Dn");function Nl(t){let e=t.chart,i=e.options.animation;I(i&&i.onProgress,[t],e)}d(Nl,"Hr");function tn(t){return Fa()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}d(tn,"co");var Je={},en=d(t=>{let e=tn(t);return Object.values(Je).filter(i=>i.canvas===e).pop()},"On");function Hl(t,e,i){let s=Object.keys(t);for(let a of s){let n=+a;if(n>=e){let r=t[a];delete t[a],(i>0||n>e)&&(t[n+i]=r)}}}d(Hl,"jr");function jl(t,e,i,s){return!i||t.type==="mouseout"?null:s?e:t}d(jl,"$r");function $l(t){let{xScale:e,yScale:i}=t;if(e&&i)return{left:e.left,right:e.right,top:i.top,bottom:i.bottom}}d($l,"Ur");var J=d(class{static register(...t){ct.add(...t),Ys()}static unregister(...t){ct.remove(...t),Ys()}constructor(t,e){let i=this.config=new Fl(e),s=tn(t),a=en(s);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 n=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||ll(s)),this.platform.updateConfig(i);let r=this.platform.acquireContext(s,n.aspectRatio),o=r&&r.canvas,l=o&&o.height,h=o&&o.width;if(this.id=Un(),this.ctx=r,this.canvas=o,this.width=h,this.height=l,this._options=n,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 Pl,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=lr(c=>this.update(c),n.resizeDelay||0),this._dataChanges=[],Je[this.id]=this,!r||!o){console.error("Failed to create chart: can't acquire context from the given item");return}pt.listen(this,"complete",$s),pt.listen(this,"progress",Nl),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:a}=this;return T(t)?e&&a?a:s?i/s: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 ct}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ps(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return us(this.canvas,this.ctx),this}stop(){return pt.stop(this),this}resize(t,e){pt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){let i=this.options,s=this.canvas,a=i.maintainAspectRatio&&this.aspectRatio,n=this.platform.getMaximumSize(s,t,e,a),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),o=this.width?"resize":"attach";this.width=n.width,this.height=n.height,this._aspectRatio=this.aspectRatio,ps(this,r,!0)&&(this.notifyPlugins("resize",{size:n}),I(i.onResize,[this,n],this),this.attached&&this._doResize(o)&&this.render())}ensureScalesHaveIDs(){let t=this.options.scales||{};R(t,(e,i)=>{e.id=i})}buildOrUpdateScales(){let t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((n,r)=>(n[r]=!1,n),{}),a=[];e&&(a=a.concat(Object.keys(e).map(n=>{let r=e[n],o=Ge(n,r),l=o==="r",h=o==="x";return{options:r,dposition:l?"chartArea":h?"bottom":"left",dtype:l?"radialLinear":h?"category":"linear"}}))),R(a,n=>{let r=n.options,o=r.id,l=Ge(o,r),h=O(r.type,n.dtype);(r.position===void 0||Hs(r.position,l)!==Hs(n.dposition))&&(r.position=n.dposition),s[o]=!0;let c=null;if(o in i&&i[o].type===h)c=i[o];else{let u=ct.getScale(h);c=new u({id:o,type:h,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,t)}),R(s,(n,r)=>{n||delete i[r]}),R(i,n=>{X.configure(this,n,n.options),X.addBox(this,n)})}_updateMetasets(){let t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((s,a)=>s.index-a.index),i>e){for(let s=e;se.length&&delete this._stacks,t.forEach((i,s)=>{e.filter(a=>a===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){let t=[],e=this.data.datasets,i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let e=this.config;e.update();let i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.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 n=0;for(let l=0,h=this.data.datasets.length;l{l.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(js("z","_idx"));let{_active:r,_lastEvent:o}=this;o?this._eventHandler(o,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){R(this.scales,t=>{X.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!ss(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(let{method:i,start:s,count:a}of e){let n=i==="_removeElements"?-a:a;Hl(t,s,n)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let e=this.data.datasets.length,i=d(a=>new Set(t.filter(n=>n[0]===a).map((n,r)=>r+","+n.splice(1).join(","))),"s"),s=i(0);for(let a=1;aa.split(",")).map(a=>({method:a[1],start:+a[2],count:+a[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;X.update(this,this.width,this.height,t);let e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],R(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,a)=>{s._idx=a}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let e=this.ctx,i=t._clip,s=!i.disabled,a=$l(t)||this.chartArea,n={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",n)!==!1&&(s&&ei(e,{left:i.left===!1?0:a.left-i.left,right:i.right===!1?this.width:a.right+i.right,top:i.top===!1?0:a.top-i.top,bottom:i.bottom===!1?this.height:a.bottom+i.bottom}),t.controller.draw(),s&&ii(e),n.cancelable=!1,this.notifyPlugins("afterDatasetDraw",n))}isPointInArea(t){return ge(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){let a=No.modes[e];return typeof a=="function"?a(this,t,i,s):[]}getDatasetMeta(t){let e=this.data.datasets[t],i=this._metasets,s=i.filter(a=>a&&a._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Pt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let e=this.data.datasets[t];if(!e)return!1;let i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){let i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){let s=i?"show":"hide",a=this.getDatasetMeta(t),n=a.controller._resolveAnimations(void 0,s);at(e)?(a.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),n.update(a,{visible:i}),this.update(r=>r.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){let e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),pt.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,a,n),t[a]=n},"s"),s=d((a,n,r)=>{a.offsetX=n,a.offsetY=r,this._eventHandler(a)},"n");R(this.options.events,a=>i(a,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,e=this.platform,i=d((o,l)=>{e.addEventListener(this,o,l),t[o]=l},"s"),s=d((o,l)=>{t[o]&&(e.removeEventListener(this,o,l),delete t[o])},"n"),a=d((o,l)=>{this.canvas&&this.resize(o,l)},"o"),n,r=d(()=>{s("attach",r),this.attached=!0,this.resize(),i("resize",a),i("detach",n)},"r");n=d(()=>{this.attached=!1,s("resize",a),this._stop(),this._resize(0,0),i("attach",r)},"a"),e.isAttached(this.canvas)?r():n()}unbindEvents(){R(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},R(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){let s=i?"set":"remove",a,n,r,o;for(e==="dataset"&&(a=this.getDatasetMeta(t[0].datasetIndex),a.controller["_"+s+"DatasetHoverStyle"]()),r=0,o=t.length;r{let n=this.getDatasetMeta(s);if(!n)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:n.data[a],index:a}});!$e(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){let s=this.options.hover,a=d((o,l)=>o.filter(h=>!l.some(c=>h.datasetIndex===c.datasetIndex&&h.index===c.index)),"o"),n=a(e,t),r=i?t:a(t,e);n.length&&this.updateHoverStyle(n,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(t,e){let i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=d(n=>(n.options.events||this.options.events).includes(t.native.type),"n");if(this.notifyPlugins("beforeEvent",i,s)===!1)return;let a=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(a||i.changed)&&this.render(),this}_handleEvent(t,e,i){let{_active:s=[],options:a}=this,n=e,r=this._getActiveElements(t,s,i,n),o=Zn(t),l=jl(t,this._lastEvent,i,o);i&&(this._lastEvent=null,I(a.onHover,[t,r,this],this),o&&I(a.onClick,[t,r,this],this));let h=!$e(r,s);return(h||e)&&(this._active=r,this._updateHoverStyles(r,s,e)),this._lastEvent=l,h}_getActiveElements(t,e,i,s){if(t.type==="mouseout")return[];if(!i)return e;let a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,s)}},"xt");S(J,"defaults",H),S(J,"instances",Je),S(J,"overrides",Ft),S(J,"registry",ct),S(J,"version",Bl),S(J,"getChart",en);function Ys(){return R(J.instances,t=>t._plugins.invalidate())}d(Ys,"Cn");function Yl(t,e,i){let{startAngle:s,pixelMargin:a,x:n,y:r,outerRadius:o,innerRadius:l}=e,h=a/o;t.beginPath(),t.arc(n,r,o,s-h,i+h),l>a?(h=a/l,t.arc(n,r,l,i+h,s-h,!0)):t.arc(n,r,a,i+N,s-N),t.closePath(),t.clip()}d(Yl,"Yr");function Ul(t){return Ni(t,["outerStart","outerEnd","innerStart","innerEnd"])}d(Ul,"Xr");function Xl(t,e,i,s){let a=Ul(t.options.borderRadius),n=(i-e)/2,r=Math.min(n,s*e/2),o=d(l=>{let h=(i-Math.min(n,l))*s/2;return Y(l,0,Math.min(n,h))},"r");return{outerStart:o(a.outerStart),outerEnd:o(a.outerEnd),innerStart:Y(a.innerStart,0,r),innerEnd:Y(a.innerEnd,0,r)}}d(Xl,"Kr");function Wt(t,e,i,s){return{x:i+t*Math.cos(e),y:s+t*Math.sin(e)}}d(Wt,"Zt");function Ze(t,e,i,s,a,n){let{x:r,y:o,startAngle:l,pixelMargin:h,innerRadius:c}=e,u=Math.max(e.outerRadius+s+i-h,0),f=c>0?c+s+i+h:0,g=0,p=a-l;if(s){let V=c>0?c-s:0,nt=u>0?u-s:0,tt=(V+nt)/2,ht=tt!==0?p*tt/(tt+s):p;g=(p-ht)/2}let b=Math.max(.001,p*u-i/B)/u,m=(p-b)/2,x=l+m+g,y=a-m-g,{outerStart:M,outerEnd:_,innerStart:v,innerEnd:w}=Xl(e,f,u,y-x),k=u-M,P=u-_,D=x+M/k,C=y-_/P,E=f+v,K=f+w,Q=x+v/E,L=y-w/K;if(t.beginPath(),n){let V=(D+C)/2;if(t.arc(r,o,u,D,V),t.arc(r,o,u,V,C),_>0){let $=Wt(P,C,r,o);t.arc($.x,$.y,_,C,y+N)}let nt=Wt(K,y,r,o);if(t.lineTo(nt.x,nt.y),w>0){let $=Wt(K,L,r,o);t.arc($.x,$.y,w,y+N,L+Math.PI)}let tt=(y-w/f+(x+v/f))/2;if(t.arc(r,o,f,y-w/f,tt,!0),t.arc(r,o,f,tt,x+v/f,!0),v>0){let $=Wt(E,Q,r,o);t.arc($.x,$.y,v,Q+Math.PI,x-N)}let ht=Wt(k,x,r,o);if(t.lineTo(ht.x,ht.y),M>0){let $=Wt(k,D,r,o);t.arc($.x,$.y,M,x-N,D)}}else{t.moveTo(r,o);let V=Math.cos(D)*u+r,nt=Math.sin(D)*u+o;t.lineTo(V,nt);let tt=Math.cos(C)*u+r,ht=Math.sin(C)*u+o;t.lineTo(tt,ht)}t.closePath()}d(Ze,"fi");function ql(t,e,i,s,a){let{fullCircles:n,startAngle:r,circumference:o}=e,l=e.endAngle;if(n){Ze(t,e,i,s,l,a);for(let h=0;h=z||fe(a,r,o),g=bt(n,l+u,h+u);return f&&g}getCenterPoint(t){let{x:e,y:i,startAngle:s,endAngle:a,innerRadius:n,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:o,spacing:l}=this.options,h=(s+a)/2,c=(n+r+l+o)/2;return{x:e+Math.cos(h)*c,y:i+Math.sin(h)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){let{options:e,circumference:i}=this,s=(e.offset||0)/4,a=(e.spacing||0)/2,n=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=i>z?Math.floor(i/z):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();let r=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(r)*s,Math.sin(r)*s);let o=1-Math.sin(Math.min(B,i||0)),l=s*o;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,ql(t,this,l,a,n),Kl(t,this,l,a,n),t.restore()}},"oe");S(Ne,"id","arc"),S(Ne,"defaults",{borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),S(Ne,"defaultRoutes",{backgroundColor:"backgroundColor"});function sn(t,e,i=e){t.lineCap=O(i.borderCapStyle,e.borderCapStyle),t.setLineDash(O(i.borderDash,e.borderDash)),t.lineDashOffset=O(i.borderDashOffset,e.borderDashOffset),t.lineJoin=O(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=O(i.borderWidth,e.borderWidth),t.strokeStyle=O(i.borderColor,e.borderColor)}d(sn,"ho");function Gl(t,e,i){t.lineTo(i.x,i.y)}d(Gl,"Jr");function Jl(t){return t.stepped?yr:t.tension||t.cubicInterpolationMode==="monotone"?vr:Gl}d(Jl,"Qr");function an(t,e,i={}){let s=t.length,{start:a=0,end:n=s-1}=i,{start:r,end:o}=e,l=Math.max(a,r),h=Math.min(n,o),c=ao&&n>o;return{count:s,start:l,loop:e.loop,ilen:h(r+(h?o-_:_))%n,"_"),M=d(()=>{b!==m&&(t.lineTo(c,m),t.lineTo(c,b),t.lineTo(c,x))},"y");for(l&&(g=a[y(0)],t.moveTo(g.x,g.y)),f=0;f<=o;++f){if(g=a[y(f)],g.skip)continue;let _=g.x,v=g.y,w=_|0;w===p?(vm&&(m=v),c=(u*c+_)/++u):(M(),t.lineTo(_,v),p=w,u=0,b=m=v),x=v}M()}d(Ql,"tl");function Ci(t){let e=t.options,i=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!i?Ql:Zl}d(Ci,"hs");function th(t){return t.stepped?Qr:t.tension||t.cubicInterpolationMode==="monotone"?to:Tt}d(th,"el");function eh(t,e,i,s){let a=e._path;a||(a=e._path=new Path2D,e.path(a,i,s)&&a.closePath()),sn(t,e.options),t.stroke(a)}d(eh,"il");function ih(t,e,i,s){let{segments:a,options:n}=e,r=Ci(e);for(let o of a)sn(t,n,o.style),t.beginPath(),r(t,e,o,{start:i,end:i+s-1})&&t.closePath(),t.stroke()}d(ih,"sl");var sh=typeof Path2D=="function";function ah(t,e,i,s){sh&&!e.options.segment?eh(t,e,i,s):ih(t,e,i,s)}d(ah,"ol");var Mt=d(class extends lt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){let i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){let s=i.spanGaps?this._loop:this._fullLoop;Yr(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=ro(this,this.options.segment))}first(){let t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){let t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){let i=this.options,s=t[e],a=this.points,n=Na(this,{property:e,start:s,end:s});if(!n.length)return;let r=[],o=th(i),l,h;for(l=0,h=n.length;lt!=="borderDash"&&t!=="fill"});function Us(t,e,i,s){let a=t.options,{[i]:n}=t.getProps([i],s);return Math.abs(e-n)t.replace("rgb(","rgba(").replace(")",", 0.5)"));function rn(t){return Oi[t%Oi.length]}d(rn,"go");function on(t){return Xs[t%Xs.length]}d(on,"po");function ch(t,e){return t.borderColor=rn(e),t.backgroundColor=on(e),++e}d(ch,"ul");function uh(t,e){return t.backgroundColor=t.data.map(()=>rn(e++)),e}d(uh,"fl");function fh(t,e){return t.backgroundColor=t.data.map(()=>on(e++)),e}d(fh,"gl");function gh(t){let e=0;return(i,s)=>{let a=t.getDatasetMeta(s).controller;a instanceof Et?e=uh(i,e):a instanceof de?e=fh(i,e):a&&(e=ch(i,e))}}d(gh,"pl");function qs(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}d(qs,"Ln");function ph(t){return t&&(t.borderColor||t.backgroundColor)}d(ph,"ml");var mh={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,i){if(!i.enabled)return;let{data:{datasets:s},options:a}=t.config,{elements:n}=a;if(!i.forceOverride&&(qs(s)||ph(a)||n&&qs(n)))return;let r=gh(t);s.forEach(r)}};function bh(t,e,i,s,a){let n=a.samples||s;if(n>=i)return t.slice(e,e+i);let r=[],o=(i-2)/(n-2),l=0,h=e+i-1,c=e,u,f,g,p,b;for(r[l++]=t[c],u=0;ug&&(g=p,f=t[y],b=y);r[l++]=f,c=b}return r[l++]=t[h],r}d(bh,"_l");function xh(t,e,i,s){let a=0,n=0,r,o,l,h,c,u,f,g,p,b,m=[],x=e+i-1,y=t[e].x,M=t[x].x-y;for(r=e;rb&&(b=h,f=r),a=(n*a+o.x)/++n;else{let v=r-1;if(!T(u)&&!T(f)){let w=Math.min(u,f),k=Math.max(u,f);w!==g&&w!==v&&m.push({...t[w],x:a}),k!==g&&k!==v&&m.push({...t[k],x:a})}r>0&&v!==g&&m.push(t[v]),m.push(o),c=_,n=0,p=b=h,u=f=g=r}}return m}d(xh,"xl");function ln(t){if(t._decimated){let e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}d(ln,"mo");function Ks(t){t.data.datasets.forEach(e=>{ln(e)})}d(Ks,"Rn");function _h(t,e){let i=e.length,s=0,a,{iScale:n}=t,{min:r,max:o,minDefined:l,maxDefined:h}=n.getUserBounds();return l&&(s=Y(xt(e,n.axis,r).lo,0,i-1)),h?a=Y(xt(e,n.axis,o).hi+1,s,i)-s:a=i-s,{start:s,count:a}}d(_h,"yl");var yh={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled){Ks(t);return}let s=t.width;t.data.datasets.forEach((a,n)=>{let{_data:r,indexAxis:o}=a,l=t.getDatasetMeta(n),h=r||a.data;if(se([o,t.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;let c=t.scales[l.xAxisID];if(c.type!=="linear"&&c.type!=="time"||t.options.parsing)return;let{start:u,count:f}=_h(l,h),g=i.threshold||4*s;if(f<=g){ln(a);return}T(r)&&(a._data=h,delete a.data,Object.defineProperty(a,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(b){this._data=b}}));let p;switch(i.algorithm){case"lttb":p=bh(h,u,f,s,i);break;case"min-max":p=xh(h,u,f,s);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}a._decimated=p})},destroy(t){Ks(t)}};function vh(t,e,i){let s=t.segments,a=t.points,n=e.points,r=[];for(let o of s){let{start:l,end:h}=o;h=Ui(l,h,a);let c=Ai(i,a[l],a[h],o.loop);if(!e.segments){r.push({source:o,target:c,start:a[l],end:a[h]});continue}let u=Na(e,c);for(let f of u){let g=Ai(i,n[f.start],n[f.end],f.loop),p=Wa(o,a,g);for(let b of p)r.push({source:b,target:f,start:{[i]:Gs(c,g,"start",Math.max)},end:{[i]:Gs(c,g,"end",Math.min)}})}}return r}d(vh,"Ml");function Ai(t,e,i,s){if(s)return;let a=e[t],n=i[t];return t==="angle"&&(a=it(a),n=it(n)),{property:t,start:a,end:n}}d(Ai,"us");function Mh(t,e){let{x:i=null,y:s=null}=t||{},a=e.points,n=[];return e.segments.forEach(({start:r,end:o})=>{o=Ui(r,o,a);let l=a[r],h=a[o];s!==null?(n.push({x:l.x,y:s}),n.push({x:h.x,y:s})):i!==null&&(n.push({x:i,y:l.y}),n.push({x:i,y:h.y}))}),n}d(Mh,"kl");function Ui(t,e,i){for(;e>t;e--){let s=i[e];if(!isNaN(s.x)&&!isNaN(s.y))break}return e}d(Ui,"gs");function Gs(t,e,i,s){return t&&e?s(t[i],e[i]):t?t[i]:e?e[i]:0}d(Gs,"En");function hn(t,e){let i=[],s=!1;return F(t)?(s=!0,i=t):i=Mh(t,e),i.length?new Mt({points:i,options:{tension:0},_loop:s,_fullLoop:s}):null}d(hn,"bo");function Js(t){return t&&t.fill!==!1}d(Js,"In");function wh(t,e,i){let s=t[e].fill,a=[e],n;if(!i)return s;for(;s!==!1&&a.indexOf(s)===-1;){if(!W(s))return s;if(n=t[s],!n)return!1;if(n.visible)return s;a.push(s),s=n.fill}return!1}d(wh,"wl");function kh(t,e,i){let s=Ch(t);if(A(s))return isNaN(s.value)?!1:s;let a=parseFloat(s);return W(a)&&Math.floor(a)===a?Sh(s[0],e,a,i):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}d(kh,"Sl");function Sh(t,e,i,s){return(t==="-"||t==="+")&&(i=e+i),i===e||i<0||i>=s?!1:i}d(Sh,"Pl");function Ph(t,e){let i=null;return t==="start"?i=e.bottom:t==="end"?i=e.top:A(t)?i=e.getPixelForValue(t.value):e.getBasePixel&&(i=e.getBasePixel()),i}d(Ph,"Dl");function Dh(t,e,i){let s;return t==="start"?s=i:t==="end"?s=e.options.reverse?e.min:e.max:A(t)?s=t.value:s=e.getBaseValue(),s}d(Dh,"Ol");function Ch(t){let e=t.options,i=e.fill,s=O(i&&i.target,i);return s===void 0&&(s=!!e.backgroundColor),s===!1||s===null?!1:s===!0?"origin":s}d(Ch,"Cl");function Oh(t){let{scale:e,index:i,line:s}=t,a=[],n=s.segments,r=s.points,o=Ah(e,i);o.push(hn({x:null,y:e.bottom},s));for(let l=0;l=0;--r){let o=a[r].$filler;o&&(o.line.updateControlPoints(n,o.axis),s&&o.fill&&Mi(t.ctx,o,n))}},beforeDatasetsDraw(t,e,i){if(i.drawTime!=="beforeDatasetsDraw")return;let s=t.getSortedVisibleDatasetMetas();for(let a=s.length-1;a>=0;--a){let n=s[a].$filler;Js(n)&&Mi(t.ctx,n,t.chartArea)}},beforeDatasetDraw(t,e,i){let s=e.meta.$filler;!Js(s)||i.drawTime!=="beforeDatasetDraw"||Mi(t.ctx,s,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},ea=d((t,e)=>{let{boxHeight:i=e,boxWidth:s=e}=t;return t.usePointStyle&&(i=Math.min(i,e),s=t.pointStyleWidth||Math.min(s,e)),{boxWidth:s,boxHeight:i,itemHeight:Math.max(e,i)}},"Vn"),Nh=d((t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index,"Hl"),ia=d(class extends lt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let t=this.options.labels||{},e=I(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){let{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}let i=t.labels,s=j(i.font),a=s.size,n=this._computeTitleHeight(),{boxWidth:r,itemHeight:o}=ea(i,a),l,h;e.font=s.string,this.isHorizontal()?(l=this.maxWidth,h=this._fitRows(n,a,r,o)+10):(h=this.maxHeight,l=this._fitCols(n,s,r,o)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){let{ctx:a,maxWidth:n,options:{labels:{padding:r}}}=this,o=this.legendHitBoxes=[],l=this.lineWidths=[0],h=s+r,c=t;a.textAlign="left",a.textBaseline="middle";let u=-1,f=-h;return this.legendItems.forEach((g,p)=>{let b=i+e/2+a.measureText(g.text).width;(p===0||l[l.length-1]+b+2*r>n)&&(c+=h,l[l.length-(p>0?0:1)]=0,f+=h,u++),o[p]={left:0,top:f,row:u,width:b,height:s},l[l.length-1]+=b+r}),c}_fitCols(t,e,i,s){let{ctx:a,maxHeight:n,options:{labels:{padding:r}}}=this,o=this.legendHitBoxes=[],l=this.columnSizes=[],h=n-t,c=r,u=0,f=0,g=0,p=0;return this.legendItems.forEach((b,m)=>{let{itemWidth:x,itemHeight:y}=Hh(i,e,a,b,s);m>0&&f+y+2*r>h&&(c+=u+r,l.push({width:u,height:f}),g+=u+r,p++,u=f=0),o[m]={left:g,top:f,col:p,width:x,height:y},u=Math.max(u,x),f+=y+r}),c+=u,l.push({width:u,height:f}),c}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:a}}=this,n=Nt(a,this.left,this.width);if(this.isHorizontal()){let r=0,o=U(i,this.left+s,this.right-this.lineWidths[r]);for(let l of e)r!==l.row&&(r=l.row,o=U(i,this.left+s,this.right-this.lineWidths[r])),l.top+=this.top+t+s,l.left=n.leftForLtr(n.x(o),l.width),o+=l.width+s}else{let r=0,o=U(i,this.top+t+s,this.bottom-this.columnSizes[r].height);for(let l of e)l.col!==r&&(r=l.col,o=U(i,this.top+t+s,this.bottom-this.columnSizes[r].height)),l.top=o,l.left+=this.left+s,l.left=n.leftForLtr(n.x(l.left),l.width),o+=l.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let t=this.ctx;ei(t,this),this._draw(),ii(t)}}_draw(){let{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:a,labels:n}=t,r=H.color,o=Nt(t.rtl,this.left,this.width),l=j(n.font),{padding:h}=n,c=l.size,u=c/2,f;this.drawTitle(),s.textAlign=o.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=l.string;let{boxWidth:g,boxHeight:p,itemHeight:b}=ea(n,c),m=d(function(v,w,k){if(isNaN(g)||g<=0||isNaN(p)||p<0)return;s.save();let P=O(k.lineWidth,1);if(s.fillStyle=O(k.fillStyle,r),s.lineCap=O(k.lineCap,"butt"),s.lineDashOffset=O(k.lineDashOffset,0),s.lineJoin=O(k.lineJoin,"miter"),s.lineWidth=P,s.strokeStyle=O(k.strokeStyle,r),s.setLineDash(O(k.lineDash,[])),n.usePointStyle){let D={radius:p*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:P},C=o.xPlus(v,g/2),E=w+u;Ca(s,D,C,E,n.pointStyleWidth&&g)}else{let D=w+Math.max((c-p)/2,0),C=o.leftForLtr(v,g),E=Rt(k.borderRadius);s.beginPath(),Object.values(E).some(K=>K!==0)?pe(s,{x:C,y:D,w:g,h:p,radius:E}):s.rect(C,D,g,p),s.fill(),P!==0&&s.stroke()}s.restore()},"b"),x=d(function(v,w,k){zt(s,k.text,v,w+b/2,l,{strikethrough:k.hidden,textAlign:o.textAlign(k.textAlign)})},"_"),y=this.isHorizontal(),M=this._computeTitleHeight();y?f={x:U(a,this.left+h,this.right-i[0]),y:this.top+h+M,line:0}:f={x:this.left+h,y:U(a,this.top+M+h,this.bottom-e[0].height),line:0},za(this.ctx,t.textDirection);let _=b+h;this.legendItems.forEach((v,w)=>{s.strokeStyle=v.fontColor,s.fillStyle=v.fontColor;let k=s.measureText(v.text).width,P=o.textAlign(v.textAlign||(v.textAlign=n.textAlign)),D=g+u+k,C=f.x,E=f.y;o.setWidth(this.width),y?w>0&&C+D+h>this.right&&(E=f.y+=_,f.line++,C=f.x=U(a,this.left+h,this.right-i[f.line])):w>0&&E+_>this.bottom&&(C=f.x=C+e[f.line].width+h,f.line++,E=f.y=U(a,this.top+M+h,this.bottom-e[f.line].height));let K=o.x(C);if(m(K,E,v),C=hr(P,C+g+u,y?C+D:this.right,t.rtl),x(o.x(C),E,v),y)f.x+=D+h;else if(typeof v.text!="string"){let Q=l.lineHeight;f.y+=cn(v,Q)}else f.y+=_}),Va(this.ctx,t.textDirection)}drawTitle(){let t=this.options,e=t.title,i=j(e.font),s=q(e.padding);if(!e.display)return;let a=Nt(t.rtl,this.left,this.width),n=this.ctx,r=e.position,o=i.size/2,l=s.top+o,h,c=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+l,c=U(t.align,c,this.right-u);else{let g=this.columnSizes.reduce((p,b)=>Math.max(p,b.height),0);h=l+U(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}let f=U(r,c,c+u);n.textAlign=a.textAlign(Wi(r)),n.textBaseline="middle",n.strokeStyle=e.color,n.fillStyle=e.color,n.font=i.string,zt(n,e.text,f,h,i)}_computeTitleHeight(){let t=this.options.title,e=j(t.font),i=q(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,a;if(bt(t,this.left,this.right)&&bt(e,this.top,this.bottom)){for(a=this.legendHitBoxes,i=0;in.length>r.length?n:r)),e+i.size/2+s.measureText(a).width}d(jh,"$l");function $h(t,e,i){let s=t;return typeof e.text!="string"&&(s=cn(e,i)),s}d($h,"Ul");function cn(t,e){let i=t.text?t.text.length+.5:0;return e*i}d(cn,"_o");function Yh(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}d(Yh,"Yl");var Uh={id:"legend",_element:ia,start(t,e,i){let s=t.legend=new ia({ctx:t.ctx,options:i,chart:t});X.configure(t,s,i),X.addBox(t,s)},stop(t){X.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){let s=t.legend;X.configure(t,s,i),s.options=i},afterUpdate(t){let e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){let s=e.datasetIndex,a=i.chart;a.isDatasetVisible(s)?(a.hide(s),e.hidden=!0):(a.show(s),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){let e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:s,textAlign:a,color:n,useBorderRadius:r,borderRadius:o}}=t.legend.options;return t._getSortedDatasetMetas().map(l=>{let h=l.controller.getStyle(i?0:void 0),c=q(h.borderWidth);return{text:e[l.index].label,fillStyle:h.backgroundColor,fontColor:n,hidden:!l.visible,lineCap:h.borderCapStyle,lineDash:h.borderDash,lineDashOffset:h.borderDashOffset,lineJoin:h.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:h.borderColor,pointStyle:s||h.pointStyle,rotation:h.rotation,textAlign:a||h.textAlign,borderRadius:r&&(o||h.borderRadius),datasetIndex:l.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}},Xi=d(class extends lt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){let i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;let s=F(i.text)?i.text.length:1;this._padding=q(i.padding);let a=s*j(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=a:this.width=a}isHorizontal(){let t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){let{top:e,left:i,bottom:s,right:a,options:n}=this,r=n.align,o=0,l,h,c;return this.isHorizontal()?(h=U(r,i,a),c=e+t,l=a-i):(n.position==="left"?(h=i+t,c=U(r,s,e),o=B*-.5):(h=a-t,c=U(r,e,s),o=B*.5),l=s-e),{titleX:h,titleY:c,maxWidth:l,rotation:o}}draw(){let t=this.ctx,e=this.options;if(!e.display)return;let i=j(e.font),s=i.lineHeight/2+this._padding.top,{titleX:a,titleY:n,maxWidth:r,rotation:o}=this._drawArgs(s);zt(t,e.text,0,0,i,{color:e.color,maxWidth:r,rotation:o,textAlign:Wi(e.align),textBaseline:"middle",translation:[a,n]})}},"Ee");function Xh(t,e){let i=new Xi({ctx:t.ctx,options:e,chart:t});X.configure(t,i,e),X.addBox(t,i),t.titleBlock=i}d(Xh,"Kl");var qh={id:"title",_element:Xi,start(t,e,i){Xh(t,i)},stop(t){let e=t.titleBlock;X.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){let s=t.titleBlock;X.configure(t,s,i),s.options=i},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}},Te=new WeakMap,Kh={id:"subtitle",start(t,e,i){let s=new Xi({ctx:t.ctx,options:i,chart:t});X.configure(t,s,i),X.addBox(t,s),Te.set(t,s)},stop(t){X.removeBox(t,Te.get(t)),Te.delete(t)},beforeUpdate(t,e,i){let s=Te.get(t);X.configure(t,s,i),s.options=i},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}},ce={average(t){if(!t.length)return!1;let e,i,s=0,a=0,n=0;for(e=0,i=t.length;e-1?t.split(` `):t}d(mt,"yt");function Gh(t,e){let{element:i,datasetIndex:s,index:a}=e,n=t.getDatasetMeta(s).controller,{label:r,value:o}=n.getLabelAndValue(a);return{chart:t,label:r,parsed:n.getParsed(a),raw:t.data.datasets[s].data[a],formattedValue:o,dataset:n.getDataset(),dataIndex:a,datasetIndex:s,element:i}}d(Gh,"Jl");function sa(t,e){let i=t.chart.ctx,{body:s,footer:a,title:n}=t,{boxWidth:r,boxHeight:o}=e,l=j(e.bodyFont),h=j(e.titleFont),c=j(e.footerFont),u=n.length,f=a.length,g=s.length,p=q(e.padding),b=p.height,m=0,x=s.reduce((_,v)=>_+v.before.length+v.lines.length+v.after.length,0);if(x+=t.beforeBody.length+t.afterBody.length,u&&(b+=u*h.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),x){let _=e.displayColors?Math.max(o,l.lineHeight):l.lineHeight;b+=g*_+(x-g)*l.lineHeight+(x-1)*e.bodySpacing}f&&(b+=e.footerMarginTop+f*c.lineHeight+(f-1)*e.footerSpacing);let y=0,M=d(function(_){m=Math.max(m,i.measureText(_).width+y)},"y");return i.save(),i.font=h.string,R(t.title,M),i.font=l.string,R(t.beforeBody.concat(t.afterBody),M),y=e.displayColors?r+2+e.boxPadding:0,R(s,_=>{R(_.before,M),R(_.lines,M),R(_.after,M)}),y=0,i.font=c.string,R(t.footer,M),i.restore(),m+=p.width,{width:m,height:b}}d(sa,"Nn");function Jh(t,e){let{y:i,height:s}=e;return it.height-s/2?"bottom":"center"}d(Jh,"Ql");function Zh(t,e,i,s){let{x:a,width:n}=s,r=i.caretSize+i.caretPadding;if(t==="left"&&a+n+r>e.width||t==="right"&&a-n-r<0)return!0}d(Zh,"Zl");function Qh(t,e,i,s){let{x:a,width:n}=i,{width:r,chartArea:{left:o,right:l}}=t,h="center";return s==="center"?h=a<=(o+l)/2?"left":"right":a<=n/2?h="left":a>=r-n/2&&(h="right"),Zh(h,t,e,i)&&(h="center"),h}d(Qh,"tc");function aa(t,e,i){let s=i.yAlign||e.yAlign||Jh(t,i);return{xAlign:i.xAlign||e.xAlign||Qh(t,e,i,s),yAlign:s}}d(aa,"Wn");function td(t,e){let{x:i,width:s}=t;return e==="right"?i-=s:e==="center"&&(i-=s/2),i}d(td,"ec");function ed(t,e,i){let{y:s,height:a}=t;return e==="top"?s+=i:e==="bottom"?s-=a+i:s-=a/2,s}d(ed,"ic");function na(t,e,i,s){let{caretSize:a,caretPadding:n,cornerRadius:r}=t,{xAlign:o,yAlign:l}=i,h=a+n,{topLeft:c,topRight:u,bottomLeft:f,bottomRight:g}=Rt(r),p=td(e,o),b=ed(e,l,h);return l==="center"?o==="left"?p+=h:o==="right"&&(p-=h):o==="left"?p-=Math.max(c,f)+a:o==="right"&&(p+=Math.max(u,g)+a),{x:Y(p,0,s.width-e.width),y:Y(b,0,s.height-e.height)}}d(na,"Hn");function Ee(t,e,i){let s=q(i.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-s.right:t.x+s.left}d(Ee,"oi");function ra(t){return dt([],mt(t))}d(ra,"jn");function id(t,e,i){return Pt(t,{tooltip:e,tooltipItems:i,type:"tooltip"})}d(id,"sc");function oa(t,e){let i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}d(oa,"$n");var un={beforeTitle:gt,title(t){if(t.length>0){let e=t[0],i=e.chart.data.labels,s=i?i.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex"u"?un[e].call(i,s):a}d(G,"Z");var Li=d(class extends lt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,a=new Ha(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=id(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){let{callbacks:i}=e,s=G(i,"beforeTitle",this,t),a=G(i,"title",this,t),n=G(i,"afterTitle",this,t),r=[];return r=dt(r,mt(s)),r=dt(r,mt(a)),r=dt(r,mt(n)),r}getBeforeBody(t,e){return ra(G(e.callbacks,"beforeBody",this,t))}getBody(t,e){let{callbacks:i}=e,s=[];return R(t,a=>{let n={before:[],lines:[],after:[]},r=oa(i,a);dt(n.before,mt(G(r,"beforeLabel",this,a))),dt(n.lines,G(r,"label",this,a)),dt(n.after,mt(G(r,"afterLabel",this,a))),s.push(n)}),s}getAfterBody(t,e){return ra(G(e.callbacks,"afterBody",this,t))}getFooter(t,e){let{callbacks:i}=e,s=G(i,"beforeFooter",this,t),a=G(i,"footer",this,t),n=G(i,"afterFooter",this,t),r=[];return r=dt(r,mt(s)),r=dt(r,mt(a)),r=dt(r,mt(n)),r}_createItems(t){let e=this._active,i=this.chart.data,s=[],a=[],n=[],r=[],o,l;for(o=0,l=e.length;ot.filter(h,c,u,i))),t.itemSort&&(r=r.sort((h,c)=>t.itemSort(h,c,i))),R(r,h=>{let c=oa(t.callbacks,h);s.push(G(c,"labelColor",this,h)),a.push(G(c,"labelPointStyle",this,h)),n.push(G(c,"labelTextColor",this,h))}),this.labelColors=s,this.labelPointStyles=a,this.labelTextColors=n,this.dataPoints=r,r}update(t,e){let i=this.options.setContext(this.getContext()),s=this._active,a,n=[];if(!s.length)this.opacity!==0&&(a={opacity:0});else{let r=ce[i.position].call(this,s,this._eventPosition);n=this._createItems(i),this.title=this.getTitle(n,i),this.beforeBody=this.getBeforeBody(n,i),this.body=this.getBody(n,i),this.afterBody=this.getAfterBody(n,i),this.footer=this.getFooter(n,i);let o=this._size=sa(this,i),l=Object.assign({},r,o),h=aa(this.chart,i,l),c=na(i,l,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,a={opacity:1,x:c.x,y:c.y,width:o.width,height:o.height,caretX:r.x,caretY:r.y}}this._tooltipItems=n,this.$context=void 0,a&&this._resolveAnimations().update(this,a),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){let a=this.getCaretPosition(t,i,s);e.lineTo(a.x1,a.y1),e.lineTo(a.x2,a.y2),e.lineTo(a.x3,a.y3)}getCaretPosition(t,e,i){let{xAlign:s,yAlign:a}=this,{caretSize:n,cornerRadius:r}=i,{topLeft:o,topRight:l,bottomLeft:h,bottomRight:c}=Rt(r),{x:u,y:f}=t,{width:g,height:p}=e,b,m,x,y,M,_;return a==="center"?(M=f+p/2,s==="left"?(b=u,m=b-n,y=M+n,_=M-n):(b=u+g,m=b+n,y=M-n,_=M+n),x=b):(s==="left"?m=u+Math.max(o,h)+n:s==="right"?m=u+g-Math.max(l,c)-n:m=this.caretX,a==="top"?(y=f,M=y-n,b=m-n,x=m+n):(y=f+p,M=y+n,b=m+n,x=m-n),_=y),{x1:b,x2:m,x3:x,y1:y,y2:M,y3:_}}drawTitle(t,e,i){let s=this.title,a=s.length,n,r,o;if(a){let l=Nt(i.rtl,this.x,this.width);for(t.x=Ee(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",n=j(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=n.string,o=0;oy!==0)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,pe(t,{x:b,y:p,w:l,h:o,radius:x}),t.fill(),t.stroke(),t.fillStyle=n.backgroundColor,t.beginPath(),pe(t,{x:m,y:p+1,w:l-2,h:o-2,radius:x}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(b,p,l,o),t.strokeRect(b,p,l,o),t.fillStyle=n.backgroundColor,t.fillRect(m,p+1,l-2,o-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){let{body:s}=this,{bodySpacing:a,bodyAlign:n,displayColors:r,boxHeight:o,boxWidth:l,boxPadding:h}=i,c=j(i.bodyFont),u=c.lineHeight,f=0,g=Nt(i.rtl,this.x,this.width),p=d(function(k){e.fillText(k,g.x(t.x+f),t.y+u/2),t.y+=u+a},"p"),b=g.textAlign(n),m,x,y,M,_,v,w;for(e.textAlign=n,e.textBaseline="middle",e.font=c.string,t.x=Ee(this,b,i),e.fillStyle=i.bodyColor,R(this.beforeBody,p),f=r&&b!=="right"?n==="center"?l/2+h:l+2+h:0,M=0,v=s.length;M0&&e.stroke()}_updateAnimationTarget(t){let e=this.chart,i=this.$animations,s=i&&i.x,a=i&&i.y;if(s||a){let n=ce[t.position].call(this,this._active,this._eventPosition);if(!n)return;let r=this._size=sa(this,t),o=Object.assign({},n,this._size),l=aa(e,t,o),h=na(t,o,l,e);(s._to!==h.x||a._to!==h.y)&&(this.xAlign=l.xAlign,this.yAlign=l.yAlign,this.width=r.width,this.height=r.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){let e=this.options.setContext(this.getContext()),i=this.opacity;if(!i)return;this._updateAnimationTarget(e);let s={width:this.width,height:this.height},a={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;let n=q(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(a,t,s,e),za(t,e.textDirection),a.y+=n.top,this.drawTitle(a,t,e),this.drawBody(a,t,e),this.drawFooter(a,t,e),Va(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){let i=this._active,s=t.map(({datasetIndex:r,index:o})=>{let l=this.chart.getDatasetMeta(r);if(!l)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:l.data[o],index:o}}),a=!$e(i,s),n=this._positionChanged(s,e);(a||n)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let s=this.options,a=this._active||[],n=this._getActiveElements(t,a,e,i),r=this._positionChanged(n,t),o=e||!$e(n,a)||r;return o&&(this._active=n,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),o}_getActiveElements(t,e,i,s){let a=this.options;if(t.type==="mouseout")return[];if(!s)return e;let n=this.chart.getElementsAtEventForMode(t,a.mode,a,i);return a.reverse&&n.reverse(),n}_positionChanged(t,e){let{caretX:i,caretY:s,options:a}=this,n=ce[a.position].call(this,t,e);return n!==!1&&(i!==n.x||s!==n.y)}},"Te");S(Li,"positioners",ce);var sd={id:"tooltip",_element:Li,positioners:ce,afterInit(t,e,i){i&&(t.tooltip=new Li({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){let e=t.tooltip;if(e&&e._willRender()){let i={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){let i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.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:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.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:un},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},ad=Object.freeze({__proto__:null,Colors:mh,Decimation:yh,Filler:Wh,Legend:Uh,SubTitle:Kh,Title:qh,Tooltip:sd}),nd=d((t,e,i,s)=>(typeof e=="string"?(i=t.push(e)-1,s.unshift({index:i,label:e})):isNaN(e)&&(i=null),i),"ac");function rd(t,e,i,s){let a=t.indexOf(e);if(a===-1)return nd(t,e,i,s);let n=t.lastIndexOf(e);return a!==n?i:a}d(rd,"rc");var od=d((t,e)=>t===null?null:Y(Math.round(t),0,e),"lc");function fn(t){let e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},"De");S(Ti,"id","category"),S(Ti,"defaults",{ticks:{callback:fn}});function ld(t,e){let i=[],{bounds:s,step:a,min:n,max:r,precision:o,count:l,maxTicks:h,maxDigits:c,includeBounds:u}=t,f=a||1,g=h-1,{min:p,max:b}=e,m=!T(n),x=!T(r),y=!T(l),M=(b-p)/(c+1),_=ns((b-p)/g/f)*f,v,w,k,P;if(_<1e-14&&!m&&!x)return[{value:p},{value:b}];P=Math.ceil(b/_)-Math.floor(p/_),P>g&&(_=ns(P*_/g/f)*f),T(o)||(v=Math.pow(10,o),_=Math.ceil(_*v)/v),s==="ticks"?(w=Math.floor(p/_)*_,k=Math.ceil(b/_)*_):(w=p,k=b),m&&x&&a&&ir((r-n)/a,_/1e3)?(P=Math.round(Math.min((r-n)/_,h)),_=(r-n)/P,w=n,k=r):y?(w=m?n:w,k=x?r:k,P=l-1,_=(k-w)/P):(P=(k-w)/_,oe(P,Math.round(P),_/1e3)?P=Math.round(P):P=Math.ceil(P));let D=Math.max(rs(_),rs(w));v=Math.pow(10,T(o)?D:o),w=Math.round(w*v)/v,k=Math.round(k*v)/v;let C=0;for(m&&(u&&w!==n?(i.push({value:n}),ws=e?s:o,"a"),r=d(o=>a=i?a:o,"r");if(t){let o=ut(s),l=ut(a);o<0&&l<0?r(0):o>0&&l>0&&n(0)}if(s===a){let o=a===0?1:Math.abs(a*.05);r(a+o),t||n(s-o)}this.min=s,this.max=a}getTickLimit(){let t=this.options.ticks,{maxTicksLimit:e,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,e=t.ticks,i=this.getTickLimit();i=Math.max(2,i);let s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},a=this._range||this,n=ld(s,a);return t.bounds==="ticks"&&xa(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}configure(){let t=this.ticks,e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){let s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return _e(t,this.chart.options.locale,this.options.ticks.format)}},"ce"),Ei=d(class extends Qe{determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=W(t)?t:0,this.max=W(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),e=t?this.width:this.height,i=rt(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,a=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,a.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}},"Oe");S(Ei,"id","linear"),S(Ei,"defaults",{ticks:{callback:ti.formatters.numeric}});var be=d(t=>Math.floor(vt(t)),"Ie"),At=d((t,e)=>Math.pow(10,be(t)+e),"zt");function ha(t){return t/Math.pow(10,be(t))===1}d(ha,"Xn");function da(t,e,i){let s=Math.pow(10,i),a=Math.floor(t/s);return Math.ceil(e/s)-a}d(da,"Kn");function hd(t,e){let i=e-t,s=be(i);for(;da(t,e,s)>10;)s++;for(;da(t,e,s)<10;)s--;return Math.min(s,be(t))}d(hd,"hc");function dd(t,{min:e,max:i}){e=et(t.min,e);let s=[],a=be(e),n=hd(e,i),r=n<0?Math.pow(10,Math.abs(n)):1,o=Math.pow(10,n),l=a>n?Math.pow(10,a):0,h=Math.round((e-l)*r)/r,c=Math.floor((e-l)/o/10)*o*10,u=Math.floor((h-c)/Math.pow(10,n)),f=et(t.min,Math.round((l+c+u*Math.pow(10,n))*r)/r);for(;f=10?u=u<15?15:20:u++,u>=20&&(n++,u=2,r=n>=0?1:r),f=Math.round((l+c+u*Math.pow(10,n))*r)/r;let g=et(t.max,f);return s.push({value:g,major:ha(g),significand:u}),s}d(dd,"dc");var Ri=d(class extends Yt{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){let i=Qe.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return W(i)&&i>0?i:null}determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=W(t)?Math.max(0,t):null,this.max=W(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!W(this._userMin)&&(this.min=t===At(this.min,0)?At(this.min,-1):At(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),i=this.min,s=this.max,a=d(r=>i=t?i:r,"o"),n=d(r=>s=e?s:r,"a");i===s&&(i<=0?(a(1),n(10)):(a(At(i,-1)),n(At(s,1)))),i<=0&&a(At(s,-1)),s<=0&&n(At(i,1)),this.min=i,this.max=s}buildTicks(){let t=this.options,e={min:this._userMin,max:this._userMax},i=dd(e,this);return t.bounds==="ticks"&&xa(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":_e(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=vt(t),this._valueRange=vt(this.max)-vt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(vt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}},"Ce");S(Ri,"id","logarithmic"),S(Ri,"defaults",{ticks:{callback:ti.formatters.logarithmic,major:{enabled:!0}}});function Ii(t){let e=t.ticks;if(e.display&&t.display){let i=q(e.backdropPadding);return O(e.font&&e.font.size,H.font.size)+i.height}return 0}d(Ii,"fs");function cd(t,e,i){return i=F(i)?i:[i],{w:_r(t,e.string,i),h:i.length*e.lineHeight}}d(cd,"uc");function ca(t,e,i,s,a){return t===s||t===a?{start:e-i/2,end:e+i/2}:ta?{start:e-i,end:e}:{start:e,end:e+i}}d(ca,"qn");function ud(t){let e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),s=[],a=[],n=t._pointLabels.length,r=t.options.pointLabels,o=r.centerPointLabels?B/n:0;for(let l=0;le.r&&(o=(s.end-e.r)/n,t.r=Math.max(t.r,e.r+o)),a.starte.b&&(l=(a.end-e.b)/r,t.b=Math.max(t.b,e.b+l))}d(fd,"gc");function gd(t,e,i){let s=[],a=t._pointLabels.length,n=t.options,r=Ii(n)/2,o=t.drawingArea,l=n.pointLabels.centerPointLabels?B/a:0;for(let h=0;h270||i<90)&&(t-=e),t}d(bd,"_c");function xd(t,e){let{ctx:i,options:{pointLabels:s}}=t;for(let a=e-1;a>=0;a--){let n=s.setContext(t.getPointLabelContext(a)),r=j(n.font),{x:o,y:l,textAlign:h,left:c,top:u,right:f,bottom:g}=t._pointLabelItems[a],{backdropColor:p}=n;if(!T(p)){let b=Rt(n.borderRadius),m=q(n.backdropPadding);i.fillStyle=p;let x=c-m.left,y=u-m.top,M=f-c+m.width,_=g-u+m.height;Object.values(b).some(v=>v!==0)?(i.beginPath(),pe(i,{x,y,w:M,h:_,radius:b}),i.fill()):i.fillRect(x,y,M,_)}zt(i,t._pointLabels[a],o,l+r.lineHeight/2,r,{color:n.color,textAlign:h,textBaseline:"middle"})}}d(xd,"xc");function gn(t,e,i,s){let{ctx:a}=t;if(i)a.arc(t.xCenter,t.yCenter,e,0,z);else{let n=t.getPointPosition(0,e);a.moveTo(n.x,n.y);for(let r=1;r{let s=I(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){let t=this.options;t.display&&t.pointLabels.display?ud(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){let e=z/(this._pointLabels.length||1),i=this.options.startAngle||0;return it(t*e+rt(i))}getDistanceFromCenterForValue(t){if(T(t))return NaN;let e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(T(t))return NaN;let e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){let e=this._pointLabels||[];if(t>=0&&t{if(c!==0){o=this.getDistanceFromCenterForValue(h.value);let u=this.getContext(c),f=s.setContext(u),g=a.setContext(u);_d(this,f,o,n,g)}}),i.display){for(t.save(),r=n-1;r>=0;r--){let h=i.setContext(this.getPointLabelContext(r)),{color:c,lineWidth:u}=h;!u||!c||(t.lineWidth=u,t.strokeStyle=c,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,o=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),l=this.getPointPosition(r,o),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){let t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;let s=this.getIndexAngle(0),a,n;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((r,o)=>{if(o===0&&!e.reverse)return;let l=i.setContext(this.getContext(o)),h=j(l.font);if(a=this.getDistanceFromCenterForValue(this.ticks[o].value),l.showLabelBackdrop){t.font=h.string,n=t.measureText(r.label).width,t.fillStyle=l.backdropColor;let c=q(l.backdropPadding);t.fillRect(-n/2-c.left,-a-h.size/2-c.top,n+c.width,h.size+c.height)}zt(t,r.label,0,-a,h,{color:l.color})}),t.restore()}drawTitle(){}},"Ft");S(ne,"id","radialLinear"),S(ne,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ti.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),S(ne,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),S(ne,"descriptors",{angleLines:{_fallback:"grid"}});var ai={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}},Z=Object.keys(ai);function vd(t,e){return t-e}d(vd,"Mc");function ua(t,e){if(T(e))return null;let i=t._adapter,{parser:s,round:a,isoWeekday:n}=t._parseOpts,r=e;return typeof s=="function"&&(r=s(r)),W(r)||(r=typeof s=="string"?i.parse(r,s):i.parse(r)),r===null?null:(a&&(r=a==="week"&&(Ht(n)||n===!0)?i.startOf(r,"isoWeek",n):i.startOf(r,a)),+r)}d(ua,"Gn");function fa(t,e,i,s){let a=Z.length;for(let n=Z.indexOf(t);n=Z.indexOf(i);n--){let r=Z[n];if(ai[r].common&&t._adapter.diff(a,s,r)>=e-1)return r}return Z[i?Z.indexOf(i):0]}d(Md,"kc");function wd(t){for(let e=Z.indexOf(t)+1,i=Z.length;e=e?i[s]:i[a];t[n]=!0}}d(ga,"Qn");function kd(t,e,i,s){let a=t._adapter,n=+a.startOf(e[0].value,s),r=e[e.length-1].value,o,l;for(o=n;o<=r;o=+a.add(o,1,s))l=i[o],l>=0&&(e[l].major=!0);return e}d(kd,"Sc");function pa(t,e,i){let s=[],a={},n=e.length,r,o;for(r=0;r+t.value))}initOffsets(t=[]){let e=0,i=0,s,a;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,a=this.getDecimalForValue(t[t.length-1]),t.length===1?i=a:i=(a-this.getDecimalForValue(t[t.length-2]))/2);let n=t.length<3?.5:.25;e=Y(e,0,n),i=Y(i,0,n),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){let t=this._adapter,e=this.min,i=this.max,s=this.options,a=s.time,n=a.unit||fa(a.minUnit,e,i,this._getLabelCapacity(e)),r=O(s.ticks.stepSize,1),o=n==="week"?a.isoWeekday:!1,l=Ht(o)||o===!0,h={},c=e,u,f;if(l&&(c=+t.startOf(c,"isoWeek",o)),c=+t.startOf(c,l?"day":n),t.diff(i,e,n)>1e5*r)throw new Error(e+" and "+i+" are too far apart with stepSize of "+r+" "+n);let g=s.ticks.source==="data"&&this.getDataTimestamps();for(u=c,f=0;up-b).map(p=>+p)}getLabelForValue(t){let e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){let i=this.options.time.displayFormats,s=this._unit,a=e||i[s];return this._adapter.format(t,a)}_tickFormatFunction(t,e,i,s){let a=this.options,n=a.ticks.callback;if(n)return I(n,[t,e,i],this);let r=a.time.displayFormats,o=this._unit,l=this._majorUnit,h=o&&r[o],c=l&&r[l],u=i[e],f=l&&c&&u&&u.major;return this._adapter.format(t,s||(f?c:h))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e0?r:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;let s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e=t[s].pos&&e<=t[a].pos&&({lo:s,hi:a}=xt(t,"pos",e)),{pos:n,time:o}=t[s],{pos:r,time:l}=t[a]):(e>=t[s].time&&e<=t[a].time&&({lo:s,hi:a}=xt(t,"time",e)),{time:n,pos:o}=t[s],{time:r,pos:l}=t[a]);let h=r-n;return h?o+(l-o)*(e-n)/h:o}d(Re,"ai");var Fi=d(class extends xe{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Re(e,this.min),this._tableRange=Re(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){let{min:e,max:i}=this,s=[],a=[],n,r,o,l,h;for(n=0,r=t.length;n=e&&l<=i&&s.push(l);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(n=0,r=s.length;n=xn?4e-4:t>=_n?3e-4:t>=yn?2e-4:1e-4}d(Dd,"bofaInterestRateFromSavings");function Cd(t,e){return e>=xn?t*.75:e>=_n?t*.5:e>=yn?t*.25:t}d(Cd,"bofaAdditionalPoints");function Od(t,e){return bn(t,()=>e).map(i=>i-t)}d(Od,"hysaGrowth");function ni(t){return bn(t,e=>Dd(e)).map(e=>e-t)}d(ni,"bofaSavingsGrowth");function qi(t,e,i){return ni(t).map(s=>i*Cd(e,t+s)/100)}d(qi,"creditCardGrowth");function Ad(t,e,i){let s=ni(t);return qi(t,e,i).map((a,n)=>a+s[n])}d(Ad,"bofaCombined");function Ld(t,e,i){let s=ni(t);return qi(t,e,i).map((a,n)=>a+s[n]-i*n)}d(Ld,"bofaGrossCombined");function mn(t,e,i,s){return[{label:"HYSA",data:Od(t,Pd(e/100)).map(a=>a.toFixed(2)),borderWidth:1},{label:"BofA Savings Interest",data:ni(t).map(a=>a.toFixed(2)),borderWidth:1},{label:"Credit Card Bonus",data:qi(t,s,i).map(a=>a.toFixed(2)),borderWidth:1},{label:"BofA Savings Interest + Credit Card Bonus",data:Ad(t,s,i).map(a=>a.toFixed(2)),borderWidth:1},{label:"BofA Savings Interest + Credit Card Bonus - Amount spent",data:Ld(t,s,i).map(a=>a.toFixed(2)),borderWidth:1,hidden:!0}]}d(mn,"getDatasets");document.addEventListener("DOMContentLoaded",()=>{function t(o,l){let h=document.getElementById(o);return h.value?(document.getElementById(o+"Display").textContent=h.value,Number(h.value)):(document.getElementById(o+"Display").textContent=String(l),h.value=String(l),l)}d(t,"getOrInit");let e=t("saved",5e4),i=t("hysaPercent",3.75),s=t("monthlySpending",2e3),a=t("avgBasePoints",1.5);J.defaults.color="#ccc",J.defaults.borderColor="#9993",J.defaults.font.family="'M PLUS Code Latin', sans-serif",J.defaults.font.size=16;let n=new J(document.getElementById("myChart"),{normalized:!0,type:"line",data:{labels:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","Jan"],datasets:mn(e,i,s,a)},options:{scales:{y:{beginAtZero:!0}},animation:!1}});function r(){n.data.datasets=mn(e,i,s,a),n.update()}d(r,"updateChart"),document.getElementById("saved")?.addEventListener("input",o=>{o.target.value&&(e=o.target.value,document.getElementById("savedDisplay").textContent=o.target.value,r())}),document.getElementById("monthlySpending")?.addEventListener("input",o=>{o.target.value&&(s=o.target.value,document.getElementById("monthlySpendingDisplay").textContent=o.target.value,r())}),document.getElementById("avgBasePoints")?.addEventListener("input",o=>{o.target.value&&(a=o.target.value,document.getElementById("avgBasePointsDisplay").textContent=o.target.value,r())}),document.getElementById("hysaPercent")?.addEventListener("input",o=>{let l=o.target.value;l&&(i=Number(l),document.getElementById("hysaPercentDisplay").textContent=l,r())})}); /*! Bundled license information: @kurkle/color/dist/color.esm.js: (*! * @kurkle/color v0.3.2 * https://github.com/kurkle/color#readme * (c) 2023 Jukka Kurkela * Released under the MIT License *) */ /*! Bundled license information: chart.js/dist/chunks/helpers.segment.js: (*! * Chart.js v4.2.1 * https://www.chartjs.org * (c) 2023 Chart.js Contributors * Released under the MIT License *) chart.js/dist/chart.js: (*! * Chart.js v4.2.1 * https://www.chartjs.org * (c) 2023 Chart.js Contributors * Released under the MIT License *) */ //# sourceMappingURL=./chart.js.map