(()=>{let t,e,i;function s(t){return t&&t.__esModule?t.default:t}/*!
 * Chart.js v4.4.2
 * https://www.chartjs.org
 * (c) 2024 Chart.js Contributors
 * Released under the MIT License
 *//*!
 * Chart.js v4.4.2
 * https://www.chartjs.org
 * (c) 2024 Chart.js Contributors
 * Released under the MIT License
 *//*!
 * @kurkle/color v0.3.2
 * https://github.com/kurkle/color#readme
 * (c) 2023 Jukka Kurkela
 * Released under the MIT License
 */function a(t){return t+.5|0}let n=(t,e,i)=>Math.max(Math.min(t,i),e);function r(t){return n(a(2.55*t),0,255)}function o(t){return n(a(255*t),0,255)}function l(t){return n(a(t/2.55)/100,0,1)}function h(t){return n(a(100*t),0,100)}let d={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},c=[..."0123456789ABCDEF"],u=t=>c[15&t],f=t=>c[(240&t)>>4]+c[15&t],g=t=>(240&t)>>4==(15&t),p=t=>g(t.r)&&g(t.g)&&g(t.b)&&g(t.a),m=(t,e)=>t<255?e(t):"",b=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function x(t,e,i){let s=e*Math.min(i,1-i),a=(e,a=(e+t/30)%12)=>i-s*Math.max(Math.min(a-3,9-a,1),-1);return[a(0),a(8),a(4)]}function _(t,e,i){let s=(s,a=(s+t/60)%6)=>i-i*e*Math.max(Math.min(a,4-a,1),0);return[s(5),s(3),s(1)]}function y(t,e,i){let s;let a=x(t,1,.5);for(e+i>1&&(s=1/(e+i),e*=s,i*=s),s=0;s<3;s++)a[s]*=1-e-i,a[s]+=e;return a}function v(t){let e,i,s;let a=t.r/255,n=t.g/255,r=t.b/255,o=Math.max(a,n,r),l=Math.min(a,n,r),h=(o+l)/2;return o!==l&&(s=o-l,i=h>.5?s/(2-o-l):s/(o+l),e=60*(e=a===o?(n-r)/s+(n<r?6:0):n===o?(r-a)/s+2:(a-n)/s+4)+.5),[0|e,i||0,h]}function M(t,e,i,s){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,s)).map(o)}function w(t){return(t%360+360)%360}let k={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"},S={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"},D=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,P=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,O=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function C(t,e,i){if(t){let s=v(t);s[e]=Math.max(0,Math.min(s[e]+s[e]*i,0===e?360:1)),s=M(x,s,void 0,void 0),t.r=s[0],t.g=s[1],t.b=s[2]}}function L(t,e){return t?Object.assign(e||{},t):t}function T(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=o(t[3]))):(e=L(t,{r:0,g:0,b:0,a:1})).a=o(e.a),e}class A{constructor(e){let i;if(e instanceof A)return e;let s=typeof e;if("object"===s)i=T(e);else if("string"===s){var a,l;l=e.length,"#"===e[0]&&(4===l||5===l?a={r:255&17*d[e[1]],g:255&17*d[e[2]],b:255&17*d[e[3]],a:5===l?17*d[e[4]]:255}:(7===l||9===l)&&(a={r:d[e[1]]<<4|d[e[2]],g:d[e[3]]<<4|d[e[4]],b:d[e[5]]<<4|d[e[6]],a:9===l?d[e[7]]<<4|d[e[8]]:255})),i=a||function(e){t||((t=function(){let t,e,i,s,a;let n={},r=Object.keys(S),o=Object.keys(k);for(t=0;t<r.length;t++){for(e=0,s=a=r[t];e<o.length;e++)i=o[e],a=a.replace(i,k[i]);i=parseInt(S[s],16),n[a]=[i>>16&255,i>>8&255,255&i]}return n}()).transparent=[0,0,0,0]);let i=t[e.toLowerCase()];return i&&{r:i[0],g:i[1],b:i[2],a:4===i.length?i[3]:255}}(e)||("r"===e.charAt(0)?function(t){let e,i,s;let a=D.exec(t),o=255;if(a){if(a[7]!==e){let t=+a[7];o=a[8]?r(t):n(255*t,0,255)}return e=+a[1],i=+a[3],s=+a[5],{r:e=255&(a[2]?r(e):n(e,0,255)),g:i=255&(a[4]?r(i):n(i,0,255)),b:s=255&(a[6]?r(s):n(s,0,255)),a:o}}}(e):function(t){let e;let i=b.exec(t),s=255;if(!i)return;i[5]!==e&&(s=i[6]?r(+i[5]):o(+i[5]));let a=w(+i[2]),n=+i[3]/100,l=+i[4]/100;return{r:(e="hwb"===i[1]?M(y,a,n,l):"hsv"===i[1]?M(_,a,n,l):M(x,a,n,l))[0],g:e[1],b:e[2],a:s}}(e))}this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=L(this._rgb);return t&&(t.a=l(t.a)),t}set rgb(t){this._rgb=T(t)}rgbString(){var t;return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${l(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0}hexString(){var t,e;return this._valid?(e=p(t=this._rgb)?u:f,t?"#"+e(t.r)+e(t.g)+e(t.b)+m(t.a,e):void 0):void 0}hslString(){return this._valid?function(t){if(!t)return;let e=v(t),i=e[0],s=h(e[1]),a=h(e[2]);return t.a<255?`hsla(${i}, ${s}%, ${a}%, ${l(t.a)})`:`hsl(${i}, ${s}%, ${a}%)`}(this._rgb):void 0}mix(t,e){if(t){let i;let s=this.rgb,a=t.rgb,n=e===i?.5:e,r=2*n-1,o=s.a-a.a,l=((r*o==-1?r:(r+o)/(1+r*o))+1)/2;i=1-l,s.r=255&l*s.r+i*a.r+.5,s.g=255&l*s.g+i*a.g+.5,s.b=255&l*s.b+i*a.b+.5,s.a=n*s.a+(1-n)*a.a,this.rgb=s}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){let s=O(l(t.r)),a=O(l(t.g)),n=O(l(t.b));return{r:o(P(s+i*(O(l(e.r))-s))),g:o(P(a+i*(O(l(e.g))-a))),b:o(P(n+i*(O(l(e.b))-n))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new A(this.rgb)}alpha(t){return this._rgb.a=o(t),this}clearer(t){let e=this._rgb;return e.a*=1-t,this}greyscale(){let t=this._rgb,e=a(.3*t.r+.59*t.g+.11*t.b);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 C(this._rgb,2,t),this}darken(t){return C(this._rgb,2,-t),this}saturate(t){return C(this._rgb,1,t),this}desaturate(t){return C(this._rgb,1,-t),this}rotate(t){var e,i;return(i=v(e=this._rgb))[0]=w(i[0]+t),i=M(x,i,void 0,void 0),e.r=i[0],e.g=i[1],e.b=i[2],this}}function E(){}let R=(e=0,()=>e++);function I(t){return null==t}function z(t){if(Array.isArray&&Array.isArray(t))return!0;let e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function F(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function V(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function $(t,e){return V(t)?t:e}function W(t,e){return void 0===t?e:t}let B=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100:+t/e,H=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function N(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function Y(t,e,i,s){let a,n,r;if(z(t)){if(n=t.length,s)for(a=n-1;a>=0;a--)e.call(i,t[a],a);else for(a=0;a<n;a++)e.call(i,t[a],a)}else if(F(t))for(a=0,n=(r=Object.keys(t)).length;a<n;a++)e.call(i,t[r[a]],r[a])}function j(t,e){let i,s,a,n;if(!t||!e||t.length!==e.length)return!1;for(i=0,s=t.length;i<s;++i)if(a=t[i],n=e[i],a.datasetIndex!==n.datasetIndex||a.index!==n.index)return!1;return!0}function U(t){if(z(t))return t.map(U);if(F(t)){let e=Object.create(null),i=Object.keys(t),s=i.length,a=0;for(;a<s;++a)e[i[a]]=U(t[i[a]]);return e}return t}function X(t){return -1===["__proto__","prototype","constructor"].indexOf(t)}function q(t,e,i,s){if(!X(t))return;let a=e[t],n=i[t];F(a)&&F(n)?Z(a,n,s):e[t]=U(n)}function Z(t,e,i){let s;let a=z(e)?e:[e],n=a.length;if(!F(t))return t;let r=(i=i||{}).merger||q;for(let e=0;e<n;++e){if(!F(s=a[e]))continue;let n=Object.keys(s);for(let e=0,a=n.length;e<a;++e)r(n[e],t,s,i)}return t}function G(t,e){return Z(t,e,{merger:K})}function K(t,e,i){if(!X(t))return;let s=e[t],a=i[t];F(s)&&F(a)?G(s,a):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=U(a))}let J={"":t=>t,x:t=>t.x,y:t=>t.y};function Q(t,e){return(J[e]||(J[e]=function(t){let e=function(t){let e=t.split("."),i=[],s="";for(let t of e)(s+=t).endsWith("\\")?s=s.slice(0,-1)+".":(i.push(s),s="");return i}(t);return t=>{for(let i of e){if(""===i)break;t=t&&t[i]}return t}}(e)))(t)}function tt(t){return t.charAt(0).toUpperCase()+t.slice(1)}let te=t=>void 0!==t,ti=t=>"function"==typeof t,ts=(t,e)=>{if(t.size!==e.size)return!1;for(let i of t)if(!e.has(i))return!1;return!0},ta=Math.PI,tn=2*ta,tr=tn+ta,to=Number.POSITIVE_INFINITY,tl=ta/180,th=ta/2,td=ta/4,tc=2*ta/3,tu=Math.log10,tf=Math.sign;function tg(t,e,i){return Math.abs(t-e)<i}function tp(t){let e=Math.round(t),i=Math.pow(10,Math.floor(tu(t=tg(t,e,t/1e3)?e:t))),s=t/i;return(s<=1?1:s<=2?2:s<=5?5:10)*i}function tm(t){return!isNaN(parseFloat(t))&&isFinite(t)}function tb(t,e,i){let s,a,n;for(s=0,a=t.length;s<a;s++)isNaN(n=t[s][i])||(e.min=Math.min(e.min,n),e.max=Math.max(e.max,n))}function tx(t){return ta/180*t}function t_(t){if(!V(t))return;let e=1,i=0;for(;Math.round(t*e)/e!==t;)e*=10,i++;return i}function ty(t,e){let i=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,i);return a<-.5*ta&&(a+=tn),{angle:a,distance:Math.sqrt(i*i+s*s)}}function tv(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function tM(t,e){return(t-e+tr)%tn-ta}function tw(t){return(t%tn+tn)%tn}function tk(t,e,i,s){let a=tw(t),n=tw(e),r=tw(i),o=tw(n-a),l=tw(r-a),h=tw(a-n),d=tw(a-r);return a===n||a===r||s&&n===r||o>l&&h<d}function tS(t,e,i){return Math.max(e,Math.min(i,t))}function tD(t,e,i,s=1e-6){return t>=Math.min(e,i)-s&&t<=Math.max(e,i)+s}function tP(t,e,i){let s;i=i||(i=>t[i]<e);let a=t.length-1,n=0;for(;a-n>1;)i(s=n+a>>1)?n=s:a=s;return{lo:n,hi:a}}let tO=(t,e,i,s)=>tP(t,i,s?s=>{let a=t[s][e];return a<i||a===i&&t[s+1][e]===i}:s=>t[s][e]<i),tC=(t,e,i)=>tP(t,i,s=>t[s][e]>=i),tL=["push","pop","shift","splice","unshift"];function tT(t,e){let i=t._chartjs;if(!i)return;let s=i.listeners,a=s.indexOf(e);-1!==a&&s.splice(a,1),s.length>0||(tL.forEach(e=>{delete t[e]}),delete t._chartjs)}function tA(t){let e=new Set(t);return e.size===t.length?t:Array.from(e)}let tE="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function tR(t,e){let i=[],s=!1;return function(...a){i=a,s||(s=!0,tE.call(window,()=>{s=!1,t.apply(e,i)}))}}let tI=t=>"start"===t?"left":"end"===t?"right":"center",tz=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2,tF=(t,e,i,s)=>t===(s?"left":"right")?i:"center"===t?(e+i)/2:e;function tV(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:d,minDefined:c,maxDefined:u}=r.getUserBounds();c&&(a=tS(Math.min(tO(o,l,h).lo,i?s:tO(e,l,r.getPixelForValue(h)).lo),0,s-1)),n=u?tS(Math.max(tO(o,r.axis,d,!0).hi+1,i?0:tO(e,l,r.getPixelForValue(d),!0).hi+1),a,s)-a:s-a}return{start:a,count:n}}function t$(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}let tW=t=>0===t||1===t,tB=(t,e,i)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*tn/i)),tH=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*tn/i)+1,tN={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*th)+1,easeOutSine:t=>Math.sin(t*th),easeInOutSine:t=>-.5*(Math.cos(ta*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>tW(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(-Math.pow(2,-10*(2*t-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=>tW(t)?t:tB(t,.075,.3),easeOutElastic:t=>tW(t)?t:tH(t,.075,.3),easeInOutElastic:t=>tW(t)?t:t<.5?.5*tB(2*t,.1125,.45):.5+.5*tH(2*t-1,.1125,.45),easeInBack:t=>t*t*(2.70158*t-1.70158),easeOutBack:t=>(t-=1)*t*(2.70158*t+1.70158)+1,easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*(((e*=1.525)+1)*t-e)*.5:.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-tN.easeOutBounce(1-t),easeOutBounce:t=>t<.36363636363636365?7.5625*t*t:t<.7272727272727273?7.5625*(t-=.5454545454545454)*t+.75:t<.9090909090909091?7.5625*(t-=.8181818181818182)*t+.9375:7.5625*(t-=.9545454545454546)*t+.984375,easeInOutBounce:t=>t<.5?.5*tN.easeInBounce(2*t):.5*tN.easeOutBounce(2*t-1)+.5};function tY(t){if(t&&"object"==typeof t){let e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function tj(t){return tY(t)?t:new A(t)}function tU(t){return tY(t)?t:new A(t).saturate(.5).darken(.1).hexString()}let tX=["x","y","borderWidth","radius","tension"],tq=["color","borderColor","backgroundColor"],tZ=new Map;function tG(t,e,i){return(function(t,e){let i=t+JSON.stringify(e=e||{}),s=tZ.get(i);return s||(s=new Intl.NumberFormat(t,e),tZ.set(i,s)),s})(e,i).format(t)}let tK={values:t=>z(t)?t:""+t,numeric(t,e,i){let s;if(0===t)return"0";let a=this.chart.options.locale,n=t;if(i.length>1){let e;let a=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(a<1e-4||a>1e15)&&(s="scientific"),Math.abs(e=i.length>3?i[2].value-i[1].value:i[1].value-i[0].value)>=1&&t!==Math.floor(t)&&(e=t-Math.floor(t)),n=e}let r=tu(Math.abs(n)),o=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:o,maximumFractionDigits:o};return Object.assign(l,this.options.ticks.format),tG(t,a,l)},logarithmic(t,e,i){return 0===t?"0":[1,2,3,5,10,15].includes(i[e].significand||t/Math.pow(10,Math.floor(tu(t))))||e>.8*i.length?tK.numeric.call(this,t,e,i):""}};var tJ,tQ,t0,t1,t2,t5,t3,t4,t6,t8,t7,t9,et,ee,ei,es,ea,en,er,eo,el,eh,ed,ec,eu,ef,eg,ep,em,eb,ex,e_,ey,ev,eM,ew,ek,eS,eD={formatters:tK};let eP=Object.create(null),eO=Object.create(null);function eC(t,e){if(!e)return t;let i=e.split(".");for(let e=0,s=i.length;e<s;++e){let s=i[e];t=t[s]||(t[s]=Object.create(null))}return t}function eL(t,e,i){return"string"==typeof e?Z(eC(t,e),i):Z(eC(t,""),e)}var eT=new class{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.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=(t,e)=>tU(e.backgroundColor),this.hoverBorderColor=(t,e)=>tU(e.borderColor),this.hoverColor=(t,e)=>tU(e.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 eL(this,t,e)}get(t){return eC(this,t)}describe(t,e){return eL(eO,t,e)}override(t,e){return eL(eP,t,e)}route(t,e,i,s){let a=eC(this,t),n=eC(this,i),r="_"+e;Object.defineProperties(a,{[r]:{value:a[e],writable:!0},[e]:{enumerable:!0,get(){let t=this[r],e=n[s];return F(t)?Object.assign({},e,t):W(t,e)},set(t){this[r]=t}}})}apply(t){t.forEach(t=>t(this))}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(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:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:tq},numbers:{type:"number",properties:tX}}),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:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:eD.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:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function eA(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}function eE(t,e,i){let s=t.currentDevicePixelRatio,a=0!==i?Math.max(i/2,.5):0;return Math.round((e-a)*s)/s+a}function eR(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function eI(t,e,i,s){ez(t,e,i,s,null)}function ez(t,e,i,s,a){let n,r,o,l,h,d,c,u;let f=e.pointStyle,g=e.rotation,p=e.radius,m=(g||0)*tl;if(f&&"object"==typeof f&&("[object HTMLImageElement]"===(n=f.toString())||"[object HTMLCanvasElement]"===n)){t.save(),t.translate(i,s),t.rotate(m),t.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),t.restore();return}if(!isNaN(p)&&!(p<=0)){switch(t.beginPath(),f){default:a?t.ellipse(i,s,a/2,p,0,0,tn):t.arc(i,s,p,0,tn),t.closePath();break;case"triangle":d=a?a/2:p,t.moveTo(i+Math.sin(m)*d,s-Math.cos(m)*p),m+=tc,t.lineTo(i+Math.sin(m)*d,s-Math.cos(m)*p),m+=tc,t.lineTo(i+Math.sin(m)*d,s-Math.cos(m)*p),t.closePath();break;case"rectRounded":h=.516*p,r=Math.cos(m+td)*(l=p-h),c=Math.cos(m+td)*(a?a/2-h:l),o=Math.sin(m+td)*l,u=Math.sin(m+td)*(a?a/2-h:l),t.arc(i-c,s-o,h,m-ta,m-th),t.arc(i+u,s-r,h,m-th,m),t.arc(i+c,s+o,h,m,m+th),t.arc(i-u,s+r,h,m+th,m+ta),t.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*p,d=a?a/2:l,t.rect(i-d,s-l,2*d,2*l);break}m+=td;case"rectRot":c=Math.cos(m)*(a?a/2:p),r=Math.cos(m)*p,o=Math.sin(m)*p,u=Math.sin(m)*(a?a/2:p),t.moveTo(i-c,s-o),t.lineTo(i+u,s-r),t.lineTo(i+c,s+o),t.lineTo(i-u,s+r),t.closePath();break;case"crossRot":m+=td;case"cross":c=Math.cos(m)*(a?a/2:p),r=Math.cos(m)*p,o=Math.sin(m)*p,u=Math.sin(m)*(a?a/2:p),t.moveTo(i-c,s-o),t.lineTo(i+c,s+o),t.moveTo(i+u,s-r),t.lineTo(i-u,s+r);break;case"star":c=Math.cos(m)*(a?a/2:p),r=Math.cos(m)*p,o=Math.sin(m)*p,u=Math.sin(m)*(a?a/2:p),t.moveTo(i-c,s-o),t.lineTo(i+c,s+o),t.moveTo(i+u,s-r),t.lineTo(i-u,s+r),m+=td,c=Math.cos(m)*(a?a/2:p),r=Math.cos(m)*p,o=Math.sin(m)*p,u=Math.sin(m)*(a?a/2:p),t.moveTo(i-c,s-o),t.lineTo(i+c,s+o),t.moveTo(i+u,s-r),t.lineTo(i-u,s+r);break;case"line":r=a?a/2:Math.cos(m)*p,o=Math.sin(m)*p,t.moveTo(i-r,s-o),t.lineTo(i+r,s+o);break;case"dash":t.moveTo(i,s),t.lineTo(i+Math.cos(m)*(a?a/2:p),s+Math.sin(m)*p);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}function eF(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function eV(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function e$(t){t.restore()}function eW(t,e,i,s,a){if(!e)return t.lineTo(i.x,i.y);if("middle"===a){let s=(e.x+i.x)/2;t.lineTo(s,e.y),t.lineTo(s,i.y)}else"after"===a!=!!s?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function eB(t,e,i,s){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(s?e.cp1x:e.cp2x,s?e.cp1y:e.cp2y,s?i.cp2x:i.cp1x,s?i.cp2y:i.cp1y,i.x,i.y)}function eH(t,e,i,s,a,n={}){let r,o;let l=z(e)?e:[e],h=n.strokeWidth>0&&""!==n.strokeColor;for(t.save(),t.font=a.string,n.translation&&t.translate(n.translation[0],n.translation[1]),I(n.rotation)||t.rotate(n.rotation),n.color&&(t.fillStyle=n.color),n.textAlign&&(t.textAlign=n.textAlign),n.textBaseline&&(t.textBaseline=n.textBaseline),r=0;r<l.length;++r)o=l[r],n.backdrop&&function(t,e){let i=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=i}(t,n.backdrop),h&&(n.strokeColor&&(t.strokeStyle=n.strokeColor),I(n.strokeWidth)||(t.lineWidth=n.strokeWidth),t.strokeText(o,i,s,n.maxWidth)),t.fillText(o,i,s,n.maxWidth),function(t,e,i,s,a){if(a.strikethrough||a.underline){let n=t.measureText(s),r=e-n.actualBoundingBoxLeft,o=e+n.actualBoundingBoxRight,l=i-n.actualBoundingBoxAscent,h=i+n.actualBoundingBoxDescent,d=a.strikethrough?(l+h)/2:h;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=a.decorationWidth||2,t.moveTo(r,d),t.lineTo(o,d),t.stroke()}}(t,i,s,o,n),s+=Number(a.lineHeight);t.restore()}function eN(t,e){let{x:i,y:s,w:a,h:n,radius:r}=e;t.arc(i+r.topLeft,s+r.topLeft,r.topLeft,1.5*ta,ta,!0),t.lineTo(i,s+n-r.bottomLeft),t.arc(i+r.bottomLeft,s+n-r.bottomLeft,r.bottomLeft,ta,th,!0),t.lineTo(i+a-r.bottomRight,s+n),t.arc(i+a-r.bottomRight,s+n-r.bottomRight,r.bottomRight,th,0,!0),t.lineTo(i+a,s+r.topRight),t.arc(i+a-r.topRight,s+r.topRight,r.topRight,0,-th,!0),t.lineTo(i+r.topLeft,s)}let eY=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,ej=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/,eU=t=>+t||0;function eX(t,e){let i={},s=F(e),a=s?Object.keys(e):e,n=F(t)?s?i=>W(t[i],t[e[i]]):e=>t[e]:()=>t;for(let t of a)i[t]=eU(n(t));return i}function eq(t){return eX(t,{top:"y",right:"x",bottom:"y",left:"x"})}function eZ(t){return eX(t,["topLeft","topRight","bottomLeft","bottomRight"])}function eG(t){let e=eq(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function eK(t,e){t=t||{},e=e||eT.font;let i=W(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let s=W(t.style,e.style);s&&!(""+s).match(ej)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);let a={family:W(t.family,e.family),lineHeight:function(t,e){let i=(""+t).match(eY);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}(W(t.lineHeight,e.lineHeight),i),size:i,style:s,weight:W(t.weight,e.weight),string:""};return a.string=!a||I(a.size)||I(a.family)?null:(a.style?a.style+" ":"")+(a.weight?a.weight+" ":"")+a.size+"px "+a.family,a}function eJ(t,e,i,s){let a,n,r,o=!0;for(a=0,n=t.length;a<n;++a)if(void 0!==(r=t[a])&&(void 0!==e&&"function"==typeof r&&(r=r(e),o=!1),void 0!==i&&z(r)&&(r=r[i%r.length],o=!1),void 0!==r))return s&&!o&&(s.cacheable=!1),r}function eQ(t,e){return Object.assign(Object.create(t),e)}function e0(t,e=[""],i,s,a=()=>t[0]){let n=i||t;void 0===s&&(s=e9("_fallback",t));let r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:n,_fallback:s,_getTarget:a,override:i=>e0([i,...t],e,n,s)};return new Proxy(r,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,s)=>e4(i,s,()=>(function(t,e,i,s){let a;for(let n of e)if(void 0!==(a=e9(e5(n,t),i)))return e3(t,a)?e8(i,s,t,a):a})(s,e,t,i)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>it(t).includes(e),ownKeys:t=>it(t),set(t,e,i){let s=t._storage||(t._storage=a());return t[e]=s[e]=i,delete t._keys,!0}})}function e1(t,e,i,s){let a={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:e2(t,s),setContext:e=>e1(t,e,i,s),override:a=>e1(t.override(a),e,i,s)};return new Proxy(a,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>e4(t,e,()=>(function(t,e,i){let{_proxy:s,_context:a,_subProxy:n,_descriptors:r}=t,o=s[e];return ti(o)&&r.isScriptable(e)&&(o=function(t,e,i,s){let{_proxy:a,_context:n,_subProxy:r,_stack:o}=i;if(o.has(t))throw Error("Recursion detected: "+Array.from(o).join("->")+"->"+t);o.add(t);let l=e(n,r||s);return o.delete(t),e3(t,l)&&(l=e8(a._scopes,a,t,l)),l}(e,o,t,i)),z(o)&&o.length&&(o=function(t,e,i,s){let{_proxy:a,_context:n,_subProxy:r,_descriptors:o}=i;if(void 0!==n.index&&s(t))return e[n.index%e.length];if(F(e[0])){let i=e,s=a._scopes.filter(t=>t!==i);for(let l of(e=[],i)){let i=e8(s,a,t,l);e.push(e1(i,n,r&&r[t],o))}}return e}(e,o,t,r.isIndexable)),e3(e,o)&&(o=e1(o,a,n&&n[e],r)),o})(t,e,i)),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,s)=>(t[i]=s,delete e[i],!0)})}function e2(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:ti(i)?i:()=>i,isIndexable:ti(s)?s:()=>s}}let e5=(t,e)=>t?t+tt(e):e,e3=(t,e)=>F(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function e4(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];let s=i();return t[e]=s,s}let e6=(t,e)=>!0===t?e:"string"==typeof t?Q(e,t):void 0;function e8(t,e,i,s){var a;let n=e._rootScopes,r=ti(a=e._fallback)?a(i,s):a,o=[...t,...n],l=new Set;l.add(s);let h=e7(l,o,i,r||i,s);return null!==h&&(void 0===r||r===i||null!==(h=e7(l,o,r,h,s)))&&e0(Array.from(l),[""],n,r,()=>(function(t,e,i){let s=t._getTarget();e in s||(s[e]={});let a=s[e];return z(a)&&F(i)?i:a||{}})(e,i,s))}function e7(t,e,i,s,a){for(;i;)i=function(t,e,i,s,a){for(let r of e){let e=e6(i,r);if(e){var n;t.add(e);let r=ti(n=e._fallback)?n(i,a):n;if(void 0!==r&&r!==i&&r!==s)return r}else if(!1===e&&void 0!==s&&i!==s)return null}return!1}(t,e,i,s,a);return i}function e9(t,e){for(let i of e){if(!i)continue;let e=i[t];if(void 0!==e)return e}}function it(t){let e=t._keys;return e||(e=t._keys=function(t){let e=new Set;for(let i of t)for(let t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}function ie(t,e,i,s){let a,n,r;let{iScale:o}=t,{key:l="r"}=this._parsing,h=Array(s);for(a=0;a<s;++a)r=e[n=a+i],h[a]={r:o.parse(Q(r,l),n)};return h}let ii=Number.EPSILON||1e-14,is=(t,e)=>e<t.length&&!t[e].skip&&t[e],ia=t=>"x"===t?"y":"x";function ir(t,e,i){return Math.max(Math.min(t,i),e)}function io(){return"undefined"!=typeof window&&"undefined"!=typeof document}function il(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function ih(t,e,i){let s;return"string"==typeof t?(s=parseInt(t,10),-1!==t.indexOf("%")&&(s=s/100*e.parentNode[i])):s=t,s}let id=t=>t.ownerDocument.defaultView.getComputedStyle(t,null),ic=["top","right","bottom","left"];function iu(t,e,i){let s={};i=i?"-"+i:"";for(let a=0;a<4;a++){let n=ic[a];s[n]=parseFloat(t[e+"-"+n+i])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}let ig=(t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot);function ip(t,e){if("native"in t)return t;let{canvas:i,currentDevicePixelRatio:s}=e,a=id(i),n="border-box"===a.boxSizing,r=iu(a,"padding"),o=iu(a,"border","width"),{x:l,y:h,box:d}=function(t,e){let i,s;let a=t.touches,n=a&&a.length?a[0]:t,{offsetX:r,offsetY:o}=n,l=!1;if(ig(r,o,t.target))i=r,s=o;else{let t=e.getBoundingClientRect();i=n.clientX-t.left,s=n.clientY-t.top,l=!0}return{x:i,y:s,box:l}}(t,i),c=r.left+(d&&o.left),u=r.top+(d&&o.top),{width:f,height:g}=e;return n&&(f-=r.width+o.width,g-=r.height+o.height),{x:Math.round((l-c)/f*i.width/s),y:Math.round((h-u)/g*i.height/s)}}let im=t=>Math.round(10*t)/10;function ib(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)}let ix=function(){let t=!1;try{let e={get passive(){return t=!0,!1}};io()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function i_(t,e){let i=id(t).getPropertyValue(e),s=i&&i.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function iy(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function iv(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:"middle"===s?i<.5?t.y:e.y:"after"===s?i<1?t.y:e.y:i>0?e.y:t.y}}function iM(t,e,i,s){let a={x:t.cp2x,y:t.cp2y},n={x:e.cp1x,y:e.cp1y},r=iy(t,a,i),o=iy(a,n,i),l=iy(n,e,i),h=iy(r,o,i),d=iy(o,l,i);return iy(h,d,i)}function iw(t,e,i){var s;return t?(s=i,{x:t=>e+e+s-t,setWidth(t){s=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function ik(t,e){let i,s;("ltr"===e||"rtl"===e)&&(s=[(i=t.canvas.style).getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=s)}function iS(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function iD(t){return"angle"===t?{between:tk,compare:tM,normalize:tw}:{between:tD,compare:(t,e)=>t-e,normalize:t=>t}}function iP({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}}function iO(t,e,i){let s,a,n;if(!i)return[t];let{property:r,start:o,end:l}=i,h=e.length,{compare:d,between:c,normalize:u}=iD(r),{start:f,end:g,loop:p,style:m}=function(t,e,i){let s;let{property:a,start:n,end:r}=i,{between:o,normalize:l}=iD(a),h=e.length,{start:d,end:c,loop:u}=t;if(u){for(d+=h,c+=h,s=0;s<h&&o(l(e[d%h][a]),n,r);++s)d--,c--;d%=h,c%=h}return c<d&&(c+=h),{start:d,end:c,loop:u,style:t.style}}(t,e,i),b=[],x=!1,_=null,y=()=>c(o,n,s)&&0!==d(o,n),v=()=>0===d(l,s)||c(l,n,s),M=()=>x||y(),w=()=>!x||v();for(let t=f,i=f;t<=g;++t)(a=e[t%h]).skip||(s=u(a[r]))===n||(x=c(s,o,l),null===_&&M()&&(_=0===d(s,o)?t:i),null!==_&&w()&&(b.push(iP({start:_,end:t,loop:p,count:h,style:m})),_=null),i=t,n=s);return null!==_&&b.push(iP({start:_,end:g,loop:p,count:h,style:m})),b}function iC(t,e){let i=[],s=t.segments;for(let a=0;a<s.length;a++){let n=iO(s[a],t.points,e);n.length&&i.push(...n)}return i}function iL(t,e,i,s){return s&&s.setContext&&i?function(t,e,i,s){let a=t._chart.getContext(),n=iT(t.options),{_datasetIndex:r,options:{spanGaps:o}}=t,l=i.length,h=[],d=n,c=e[0].start,u=c;function f(t,e,s,a){let n=o?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=n;for(;i[e%l].skip;)e+=n;t%l!=e%l&&(h.push({start:t%l,end:e%l,loop:s,style:a}),d=a,c=e%l)}}for(let t of e){let e;let n=i[(c=o?c:t.start)%l];for(u=c+1;u<=t.end;u++){let o=i[u%l];(function(t,e){if(!e)return!1;let i=[],s=function(t,e){return tY(e)?(i.includes(e)||i.push(e),i.indexOf(e)):e};return JSON.stringify(t,s)!==JSON.stringify(e,s)})(e=iT(s.setContext(eQ(a,{type:"segment",p0:n,p1:o,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:r}))),d)&&f(c,u-1,t.loop,d),n=o,d=e}c<u-1&&f(c,u-1,t.loop,d)}return h}(t,e,i,s):e}function iT(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}var iA=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){let a=e.listeners[s],n=e.duration;a.forEach(s=>s({chart:t,initial:e.initial,numSteps:n,currentStep:Math.min(i-e.start,n)}))}_refresh(){this._request||(this._running=!0,this._request=tE.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{let a;if(!i.running||!i.items.length)return;let n=i.items,r=n.length-1,o=!1;for(;r>=0;--r)(a=n[r])._active?(a._total>i.duration&&(i.duration=a._total),a.tick(t),o=!0):(n[r]=n[n.length-1],n.pop());o&&(s.draw(),this._notify(s,i,t,"progress")),n.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=n.length}),this._lastDate=t,0===e&&(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((t,e)=>Math.max(t,e._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)}};let iE="transparent",iR={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){let s=tj(t||iE),a=s.valid&&tj(e||iE);return a&&a.valid?a.mix(s,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class iI{constructor(t,e,i,s){let a=e[i];s=eJ([t.to,s,a,t.from]);let n=eJ([t.from,a,s]);this._active=!0,this._fn=t.fn||iR[t.type||typeof n],this._easing=tN[t.easing]||tN.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=eJ([t.to,e,s,t.from]),this._from=eJ([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let e;let i=t-this._start,s=this._duration,a=this._prop,n=this._from,r=this._loop,o=this._to;if(this._active=n!==o&&(r||i<s),!this._active){this._target[a]=o,this._notify(!0);return}if(i<0){this._target[a]=n;return}e=i/s%2,e=r&&e>1?2-e:e,e=this._easing(Math.min(1,Math.max(0,e))),this._target[a]=this._fn(n,o,e)}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 t=0;t<i.length;t++)i[t][e]()}}class iz{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!F(t))return;let e=Object.keys(eT.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{let a=t[s];if(!F(a))return;let n={};for(let t of e)n[t]=a[t];(z(a.properties)&&a.properties||[s]).forEach(t=>{t!==s&&i.has(t)||i.set(t,n)})})}_animateOptions(t,e){let i=e.options,s=function(t,e){if(!e)return;let i=t.options;if(!i){t.options=e;return}return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i}(t,i);if(!s)return[];let a=this._createAnimations(s,i);return i.$shared&&(function(t,e){let i=[],s=Object.keys(e);for(let e=0;e<s.length;e++){let a=t[s[e]];a&&a.active()&&i.push(a.wait())}return Promise.all(i)})(t.options.$animations,i).then(()=>{t.options=i},()=>{}),a}_createAnimations(t,e){let i;let s=this._properties,a=[],n=t.$animations||(t.$animations={}),r=Object.keys(e),o=Date.now();for(i=r.length-1;i>=0;--i){let l=r[i];if("$"===l.charAt(0))continue;if("options"===l){a.push(...this._animateOptions(t,e));continue}let h=e[l],d=n[l],c=s.get(l);if(d){if(c&&d.active()){d.update(c,h,o);continue}d.cancel()}if(!c||!c.duration){t[l]=h;continue}n[l]=d=new iI(c,t,l,h),a.push(d)}return a}update(t,e){if(0===this._properties.size){Object.assign(t,e);return}let i=this._createAnimations(t,e);if(i.length)return iA.add(this._chart,i),!0}}function iF(t,e){let i=t&&t.options||{},s=i.reverse,a=void 0===i.min?e:0,n=void 0===i.max?e:0;return{start:s?n:a,end:s?a:n}}function iV(t,e){let i,s;let a=[],n=t._getSortedDatasetMetas(e);for(i=0,s=n.length;i<s;++i)a.push(n[i].index);return a}function i$(t,e,i,s={}){let a,n,r,o;let l=t.keys,h="single"===s.mode;if(null!==e){for(a=0,n=l.length;a<n;++a){if((r=+l[a])===i){if(s.all)continue;break}V(o=t.values[r])&&(h||0===e||tf(e)===tf(o))&&(e+=o)}return e}}function iW(t,e){let i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function iB(t,e,i,s){for(let a of e.getMatchingVisibleMetas(s).reverse()){let e=t[a.index];if(i&&e>0||!i&&e<0)return a.index}return null}function iH(t,e){let i;let{chart:s,_cachedMeta:a}=t,n=s._stacks||(s._stacks={}),{iScale:r,vScale:o,index:l}=a,h=r.axis,d=o.axis,c=`${r.id}.${o.id}.${a.stack||a.type}`,u=e.length;for(let t=0;t<u;++t){let s=e[t],{[h]:r,[d]:u}=s;(i=(s._stacks||(s._stacks={}))[d]=function(t,e,i){let s=t[e]||(t[e]={});return s[i]||(s[i]={})}(n,c,r))[l]=u,i._top=iB(i,o,!0,a.type),i._bottom=iB(i,o,!1,a.type),(i._visualValues||(i._visualValues={}))[l]=u}}function iN(t,e){let i=t.scales;return Object.keys(i).filter(t=>i[t].axis===e).shift()}function iY(t,e){let i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s)for(let a of e=e||t._parsed){let t=a._stacks;if(!t||void 0===t[s]||void 0===t[s][i])return;delete t[s][i],void 0!==t[s]._visualValues&&void 0!==t[s]._visualValues[i]&&delete t[s]._visualValues[i]}}let ij=t=>"reset"===t||"none"===t,iU=(t,e)=>e?t:Object.assign({},t),iX=(t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:iV(i,!0),values:null};class iq{static defaults={};static datasetElementType=null;static dataElementType=null;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=iW(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&&iY(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,a=e.xAxisID=W(i.xAxisID,iN(t,"x")),n=e.yAxisID=W(i.yAxisID,iN(t,"y")),r=e.rAxisID=W(i.rAxisID,iN(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&&tT(this._data,this),t._stacked&&iY(t)}_dataCheck(){let t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(F(e))this._data=function(t){let e,i,s;let a=Object.keys(t),n=Array(a.length);for(e=0,i=a.length;e<i;++e)s=a[e],n[e]={x:s,y:t[s]};return n}(e);else if(i!==e){if(i){tT(i,this);let t=this._cachedMeta;iY(t),t._parsed=[]}e&&Object.isExtensible(e)&&function(t,e){if(t._chartjs){t._chartjs.listeners.push(e);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),tL.forEach(e=>{let i="_onData"+tt(e),s=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){let a=s.apply(this,e);return t._chartjs.listeners.forEach(t=>{"function"==typeof t[i]&&t[i](...e)}),a}})})}(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=iW(e.vScale,e),e.stack!==i.stack&&(s=!0,iY(e),e.stack=i.stack),this._resyncElements(t),(s||a!==e._stacked)&&iH(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 i,s,a;let{_cachedMeta:n,_data:r}=this,{iScale:o,_stacked:l}=n,h=o.axis,d=0===t&&e===r.length||n._sorted,c=t>0&&n._parsed[t-1];if(!1===this._parsing)n._parsed=r,n._sorted=!0,a=r;else{a=z(r[t])?this.parseArrayData(n,r,t,e):F(r[t])?this.parseObjectData(n,r,t,e):this.parsePrimitiveData(n,r,t,e);let o=()=>null===s[h]||c&&s[h]<c[h];for(i=0;i<e;++i)n._parsed[i+t]=s=a[i],d&&(o()&&(d=!1),c=s);n._sorted=d}l&&iH(this,a)}parsePrimitiveData(t,e,i,s){let a,n;let{iScale:r,vScale:o}=t,l=r.axis,h=o.axis,d=r.getLabels(),c=r===o,u=Array(s);for(a=0;a<s;++a)n=a+i,u[a]={[l]:c||r.parse(d[n],n),[h]:o.parse(e[n],n)};return u}parseArrayData(t,e,i,s){let a,n,r;let{xScale:o,yScale:l}=t,h=Array(s);for(a=0;a<s;++a)r=e[n=a+i],h[a]={x:o.parse(r[0],n),y:l.parse(r[1],n)};return h}parseObjectData(t,e,i,s){let a,n,r;let{xScale:o,yScale:l}=t,{xAxisKey:h="x",yAxisKey:d="y"}=this._parsing,c=Array(s);for(a=0;a<s;++a)r=e[n=a+i],c[a]={x:o.parse(Q(r,h),n),y:l.parse(Q(r,d),n)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){let s=this.chart,a=this._cachedMeta,n=e[t.axis];return i$({keys:iV(s,!0),values:e._stacks[t.axis]._visualValues},n,a.index,{mode:i})}updateRangeFromParsed(t,e,i,s){let a=i[e.axis],n=null===a?NaN:a,r=s&&i._stacks[e.axis];s&&r&&(s.values=r,n=i$(s,a,this._cachedMeta.index)),t.min=Math.min(t.min,n),t.max=Math.max(t.max,n)}getMinMax(t,e){let i,s;let a=this._cachedMeta,n=a._parsed,r=a._sorted&&t===a.iScale,o=n.length,l=this._getOtherScale(t),h=iX(e,a,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:u}=function(t){let{min:e,max:i,minDefined:s,maxDefined:a}=t.getUserBounds();return{min:s?e:Number.NEGATIVE_INFINITY,max:a?i:Number.POSITIVE_INFINITY}}(l);function f(){let e=(s=n[i])[l.axis];return!V(s[t.axis])||c>e||u<e}for(i=0;i<o&&(f()||(this.updateRangeFromParsed(d,t,s,h),!r));++i);if(r){for(i=o-1;i>=0;--i)if(!f()){this.updateRangeFromParsed(d,t,s,h);break}}return d}getAllParsedValues(t){let e,i,s;let a=this._cachedMeta._parsed,n=[];for(e=0,i=a.length;e<i;++e)V(s=a[e][t.axis])&&n.push(s);return n}getMaxOverflow(){return!1}getLabelAndValue(t){let e=this._cachedMeta,i=e.iScale,s=e.vScale,a=this.getParsed(t);return{label:i?""+i.getLabelForValue(a[i.axis]):"",value:s?""+s.getLabelForValue(a[s.axis]):""}}_update(t){var e;let i,s,a,n;let r=this._cachedMeta;this.update(t||"default"),r._clip=(F(e=W(this.options.clip,function(t,e,i){if(!1===i)return!1;let s=iF(t,i),a=iF(e,i);return{top:a.end,right:s.end,bottom:a.start,left:s.start}}(r.xScale,r.yScale,this.getMaxOverflow())))?(i=e.top,s=e.right,a=e.bottom,n=e.left):i=s=a=n=e,{top:i,right:s,bottom:a,left:n,disabled:!1===e})}update(t){}draw(){let t;let e=this._ctx,i=this.chart,s=this._cachedMeta,a=s.data||[],n=i.chartArea,r=[],o=this._drawStart||0,l=this._drawCount||a.length-o,h=this.options.drawActiveElementsOnTop;for(s.dataset&&s.dataset.draw(e,n,o,l),t=o;t<o+l;++t){let i=a[t];i.hidden||(i.active&&h?r.push(i):i.draw(e,n))}for(t=0;t<r.length;++t)r[t].draw(e,n)}getStyle(t,e){let i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){var s;let a;let n=this.getDataset();if(t>=0&&t<this._cachedMeta.data.length){let e=this._cachedMeta.data[t];(a=e.$context||(e.$context=eQ(this.getContext(),{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"}))).parsed=this.getParsed(t),a.raw=n.data[t],a.index=a.dataIndex=t}else(a=this.$context||(this.$context=eQ(this.chart.getContext(),{active:!1,dataset:void 0,datasetIndex:s=this.index,index:s,mode:"default",type:"dataset"}))).dataset=n,a.index=a.datasetIndex=this.index;return a.active=!!e,a.mode=i,a}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){let s="active"===e,a=this._cachedDataOpts,n=t+"-"+e,r=a[n],o=this.enableOptionSharing&&te(i);if(r)return iU(r,o);let l=this.chart.config,h=l.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],c=l.getOptionScopes(this.getDataset(),h),u=Object.keys(eT.elements[t]),f=l.resolveNamedOptions(c,u,()=>this.getContext(i,s,e),d);return f.$shared&&(f.$shared=o,a[n]=Object.freeze(iU(f,o))),f}_resolveAnimations(t,e,i){let s;let a=this.chart,n=this._cachedDataOpts,r=`animation-${e}`,o=n[r];if(o)return o;if(!1!==a.options.animation){let a=this.chart.config,n=a.datasetAnimationScopeKeys(this._type,e),r=a.getOptionScopes(this.getDataset(),n);s=a.createResolver(r,this.getContext(t,i,e))}let l=new iz(a,s&&s.animations);return s&&s._cacheable&&(n[r]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ij(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){ij(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!ij(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[t,e,i]of this._syncList)this[t](e,i);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<s&&this._removeElements(a,s-a)}_insertElements(t,e,i=!0){let s;let a=this._cachedMeta,n=a.data,r=t+e,o=t=>{for(t.length+=e,s=t.length-1;s>=r;s--)t[s]=t[s-e]};for(o(n),s=t;s<r;++s)n[s]=new this.dataElementType;this._parsing&&o(a._parsed),this.parse(t,e),i&&this.updateElements(n,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){let i=this._cachedMeta;if(this._parsing){let s=i._parsed.splice(t,e);i._stacked&&iY(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{let[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){let t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);let i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function iZ(t,e,i,s){return z(t)?function(t,e,i,s){let a=i.parse(t[0],s),n=i.parse(t[1],s),r=Math.min(a,n),o=Math.max(a,n),l=r,h=o;Math.abs(r)>Math.abs(o)&&(l=o,h=r),e[i.axis]=h,e._custom={barStart:l,barEnd:h,start:a,end:n,min:r,max:o}}(t,e,i,s):e[i.axis]=i.parse(t,s),e}function iG(t,e,i,s){let a,n,r,o;let l=t.iScale,h=t.vScale,d=l.getLabels(),c=l===h,u=[];for(a=i,n=i+s;a<n;++a)o=e[a],(r={})[l.axis]=c||l.parse(d[a],a),u.push(iZ(o,r,h,a));return u}function iK(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function iJ(t,e,i,s){var a;return t=s?iQ(t=(a=t)===e?i:a===i?e:a,i,e):iQ(t,e,i)}function iQ(t,e,i){return"start"===t?e:"end"===t?i:t}class i0 extends iq{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static 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((e,a)=>{let n=t.getDatasetMeta(0).controller.getStyle(a);return{text:e,fillStyle:n.backgroundColor,strokeStyle:n.borderColor,fontColor:s,lineWidth:n.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};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(!1===this._parsing)s._parsed=i;else{let a,n,r=t=>+i[t];if(F(i[t])){let{key:t="value"}=this._parsing;r=e=>+Q(i[e],t)}for(a=t,n=t+e;a<n;++a)s._parsed[a]=r(a)}}_getRotation(){return tx(this.options.rotation-90)}_getCircumference(){return tx(this.options.circumference)}_getRotationExtents(){let t=tn,e=-tn;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){let s=this.chart.getDatasetMeta(i).controller,a=s._getRotation(),n=s._getCircumference();t=Math.min(t,a),e=Math.max(e,a+n)}return{rotation:t,circumference:e-t}}update(t){let{chartArea:e}=this.chart,i=this._cachedMeta,s=i.data,a=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,n=Math.max((Math.min(e.width,e.height)-a)/2,0),r=Math.min(B(this.options.cutout,n),1),o=this._getRingWeight(this.index),{circumference:l,rotation:h}=this._getRotationExtents(),{ratioX:d,ratioY:c,offsetX:u,offsetY:f}=function(t,e,i){let s=1,a=1,n=0,r=0;if(e<tn){let o=t+e,l=Math.cos(t),h=Math.sin(t),d=Math.cos(o),c=Math.sin(o),u=(e,s,a)=>tk(e,t,o,!0)?1:Math.max(s,s*i,a,a*i),f=(e,s,a)=>tk(e,t,o,!0)?-1:Math.min(s,s*i,a,a*i),g=u(0,l,d),p=u(th,h,c),m=f(ta,l,d),b=f(ta+th,h,c);s=(g-m)/2,a=(p-b)/2,n=-(g+m)/2,r=-(p+b)/2}return{ratioX:s,ratioY:a,offsetX:n,offsetY:r}}(h,l,r),g=(e.width-a)/d,p=(e.height-a)/c,m=H(this.options.radius,Math.max(Math.min(g,p)/2,0)),b=Math.max(m*r,0),x=(m-b)/this._getVisibleDatasetWeightTotal();this.offsetX=u*m,this.offsetY=f*m,i.total=this.calculateTotal(),this.outerRadius=m-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*o,0),this.updateElements(s,0,s.length,t)}_circumference(t,e){let i=this.options,s=this._cachedMeta,a=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===s._parsed[t]||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*a/tn)}updateElements(t,e,i,s){let a;let n="reset"===s,r=this.chart,o=r.chartArea,l=r.options.animation,h=(o.left+o.right)/2,d=(o.top+o.bottom)/2,c=n&&l.animateScale,u=c?0:this.innerRadius,f=c?0:this.outerRadius,{sharedOptions:g,includeOptions:p}=this._getSharedOptions(e,s),m=this._getRotation();for(a=0;a<e;++a)m+=this._circumference(a,n);for(a=e;a<e+i;++a){let e=this._circumference(a,n),i=t[a],r={x:h+this.offsetX,y:d+this.offsetY,startAngle:m,endAngle:m+e,circumference:e,outerRadius:f,innerRadius:u};p&&(r.options=g||this.resolveDataElementOptions(a,i.active?"active":s)),m+=e,this.updateElement(i,a,r,s)}}calculateTotal(){let t;let e=this._cachedMeta,i=e.data,s=0;for(t=0;t<i.length;t++){let a=e._parsed[t];null!==a&&!isNaN(a)&&this.chart.getDataVisibility(t)&&!i[t].hidden&&(s+=Math.abs(a))}return s}calculateCircumference(t){let e=this._cachedMeta.total;return e>0&&!isNaN(t)?Math.abs(t)/e*tn:0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,s=i.data.labels||[],a=tG(e._parsed[t],i.options.locale);return{label:s[t]||"",value:a}}getMaxBorderWidth(t){let e,i,s,a,n,r=0,o=this.chart;if(!t){for(e=0,i=o.data.datasets.length;e<i;++e)if(o.isDatasetVisible(e)){t=(s=o.getDatasetMeta(e)).data,a=s.controller;break}}if(!t)return 0;for(e=0,i=t.length;e<i;++e)"inner"!==(n=a.resolveDataElementOptions(e)).borderAlign&&(r=Math.max(r,n.borderWidth||0,n.hoverBorderWidth||0));return r}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){let t=this.resolveDataElementOptions(i);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(W(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class i1 extends iq{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static 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((e,a)=>{let n=t.getDatasetMeta(0).controller.getStyle(a);return{text:e,fillStyle:n.backgroundColor,strokeStyle:n.borderColor,fontColor:s,lineWidth:n.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}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}}};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=tG(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:a}}parseObjectData(t,e,i,s){return ie.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((t,i)=>{let s=this.getParsed(i).r;!isNaN(s)&&this.chart.getDataVisibility(i)&&(s<e.min&&(e.min=s),s>e.max&&(e.max=s))}),e}_updateRadius(){let t=this.chart,e=t.chartArea,i=t.options,s=Math.max(Math.min(e.right-e.left,e.bottom-e.top)/2,0),a=Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0),n=(s-a)/t.getVisibleDatasetCount();this.outerRadius=s-n*this.index,this.innerRadius=this.outerRadius-n}updateElements(t,e,i,s){let a;let n="reset"===s,r=this.chart,o=r.options.animation,l=this._cachedMeta.rScale,h=l.xCenter,d=l.yCenter,c=l.getIndexAngle(0)-.5*ta,u=c,f=360/this.countVisibleElements();for(a=0;a<e;++a)u+=this._computeAngle(a,s,f);for(a=e;a<e+i;a++){let e=t[a],i=u,g=u+this._computeAngle(a,s,f),p=r.getDataVisibility(a)?l.getDistanceFromCenterForValue(this.getParsed(a).r):0;u=g,n&&(o.animateScale&&(p=0),o.animateRotate&&(i=g=c));let m={x:h,y:d,innerRadius:0,outerRadius:p,startAngle:i,endAngle:g,options:this.resolveDataElementOptions(a,e.active?"active":s)};this.updateElement(e,a,m,s)}}countVisibleElements(){let t=this._cachedMeta,e=0;return t.data.forEach((t,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?tx(this.resolveDataElementOptions(t,e).angle||i):0}}var i2=Object.freeze({__proto__:null,BarController:class extends iq{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,s){return iG(t,e,i,s)}parseArrayData(t,e,i,s){return iG(t,e,i,s)}parseObjectData(t,e,i,s){let a,n,r,o;let{iScale:l,vScale:h}=t,{xAxisKey:d="x",yAxisKey:c="y"}=this._parsing,u="x"===l.axis?d:c,f="x"===h.axis?d:c,g=[];for(a=i,n=i+s;a<n;++a)o=e[a],(r={})[l.axis]=l.parse(Q(o,u),a),g.push(iZ(Q(o,f),r,h,a));return g}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);let a=i._custom;a&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,a.min),t.max=Math.max(t.max,a.max))}getMaxOverflow(){return 0}getLabelAndValue(t){let{iScale:e,vScale:i}=this._cachedMeta,s=this.getParsed(t),a=s._custom,n=iK(a)?"["+a.start+", "+a.end+"]":""+i.getLabelForValue(s[i.axis]);return{label:""+e.getLabelForValue(s[e.axis]),value:n}}initialize(){this.enableOptionSharing=!0,super.initialize(),this._cachedMeta.stack=this.getDataset().stack}update(t){let e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,s){let a="reset"===s,{index:n,_cachedMeta:{vScale:r}}=this,o=r.getBasePixel(),l=r.isHorizontal(),h=this._getRuler(),{sharedOptions:d,includeOptions:c}=this._getSharedOptions(e,s);for(let u=e;u<e+i;u++){let e=this.getParsed(u),i=a||I(e[r.axis])?{base:o,head:o}:this._calculateBarValuePixels(u),f=this._calculateBarIndexPixels(u,h),g=(e._stacks||{})[r.axis],p={horizontal:l,base:i.base,enableBorderRadius:!g||iK(e._custom)||n===g._top||n===g._bottom,x:l?i.head:f.center,y:l?f.center:i.head,height:l?f.size:Math.abs(i.size),width:l?Math.abs(i.size):f.size};c&&(p.options=d||this.resolveDataElementOptions(u,t[u].active?"active":s));let m=p.options||t[u].options;!function(t,e,i,s){let a,n,r,o,l,h=e.borderSkipped,d={};if(!h){t.borderSkipped=d;return}if(!0===h){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}let{start:c,end:u,reverse:f,top:g,bottom:p}=(t.horizontal?(a=t.base>t.x,n="left",r="right"):(a=t.base<t.y,n="bottom",r="top"),a?(o="end",l="start"):(o="start",l="end"),{start:n,end:r,reverse:a,top:o,bottom:l});"middle"===h&&i&&(t.enableBorderRadius=!0,(i._top||0)===s?h=g:(i._bottom||0)===s?h=p:(d[iJ(p,c,u,f)]=!0,h=g)),d[iJ(h,c,u,f)]=!0,t.borderSkipped=d}(p,m,g,n),function(t,{inflateAmount:e},i){t.inflateAmount="auto"===e?1===i?.33:0:e}(p,m,h.ratio),this.updateElement(t[u],u,p,s)}}_getStacks(t,e){let{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(t=>t.controller.options.grouped),a=i.options.stacked,n=[],r=t=>{let i=t.controller.getParsed(e),s=i&&i[t.vScale.axis];if(I(s)||isNaN(s))return!0};for(let i of s)if(!(void 0!==e&&r(i))&&((!1===a||-1===n.indexOf(i.stack)||void 0===a&&void 0===i.stack)&&n.push(i.stack),i.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=void 0!==e?s.indexOf(e):-1;return -1===a?s.length-1:a}_getRuler(){let t,e;let i=this.options,s=this._cachedMeta,a=s.iScale,n=[];for(t=0,e=s.data.length;t<e;++t)n.push(a.getPixelForValue(this.getParsed(t)[a.axis],t));let r=i.barThickness;return{min:r||function(t){let e,i,s,a;let n=t.iScale,r=function(t,e){if(!t._cache.$bar){let i=t.getMatchingVisibleMetas(e),s=[];for(let e=0,a=i.length;e<a;e++)s=s.concat(i[e].controller.getAllParsedValues(t));t._cache.$bar=tA(s.sort((t,e)=>t-e))}return t._cache.$bar}(n,t.type),o=n._length,l=()=>{32767!==s&&-32768!==s&&(te(a)&&(o=Math.min(o,Math.abs(s-a)||o)),a=s)};for(e=0,i=r.length;e<i;++e)s=n.getPixelForValue(r[e]),l();for(e=0,a=void 0,i=n.ticks.length;e<i;++e)s=n.getPixelForTick(e),l();return o}(s),pixels:n,start:a._startPixel,end:a._endPixel,stackCount:this._getStackCount(),scale:a,grouped:i.grouped,ratio:r?1:i.categoryPercentage*i.barPercentage}}_calculateBarValuePixels(t){let e,i;let{_cachedMeta:{vScale:s,_stacked:a,index:n},options:{base:r,minBarLength:o}}=this,l=r||0,h=this.getParsed(t),d=h._custom,c=iK(d),u=h[s.axis],f=0,g=a?this.applyStack(s,h,a):u;g!==u&&(f=g-u,g=u),c&&(u=d.barStart,g=d.barEnd-d.barStart,0!==u&&tf(u)!==tf(d.barEnd)&&(f=0),f+=u);let p=I(r)||c?f:r,m=s.getPixelForValue(p);if(Math.abs(i=(e=this.chart.getDataVisibility(t)?s.getPixelForValue(f+g):m)-m)<o){var b;i=(0!==(b=i)?tf(b):(s.isHorizontal()?1:-1)*(s.min>=l?1:-1))*o,u===l&&(m-=i/2);let t=s.getPixelForDecimal(0),r=s.getPixelForDecimal(1);e=(m=Math.max(Math.min(m,Math.max(t,r)),Math.min(t,r)))+i,a&&!c&&(h._stacks[s.axis]._visualValues[n]=s.getValueForPixel(e)-s.getValueForPixel(m))}if(m===s.getPixelForValue(l)){let t=tf(i)*s.getLineWidthForValue(l)/2;m+=t,i-=t}return{size:i,base:m,head:e,center:e+i/2}}_calculateBarIndexPixels(t,e){let i,s;let a=e.scale,n=this.options,r=n.skipNull,o=W(n.maxBarThickness,1/0);if(e.grouped){let a=r?this._getStackCount(t):e.stackCount,l="flex"===n.barThickness?function(t,e,i,s){let a=e.pixels,n=a[t],r=t>0?a[t-1]:null,o=t<a.length-1?a[t+1]:null,l=i.categoryPercentage;null===r&&(r=n-(null===o?e.end-e.start:o-n)),null===o&&(o=n+n-r);let h=n-(n-Math.min(r,o))/2*l;return{chunk:Math.abs(o-r)/2*l/s,ratio:i.barPercentage,start:h}}(t,e,n,a):function(t,e,i,s){let a,n;let r=i.barThickness;return I(r)?(a=e.min*i.categoryPercentage,n=i.barPercentage):(a=r*s,n=1),{chunk:a/s,ratio:n,start:e.pixels[t]-a/2}}(t,e,n,a),h=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0);i=l.start+l.chunk*h+l.chunk/2,s=Math.min(o,l.chunk*l.ratio)}else i=a.getPixelForValue(this.getParsed(t)[a.axis],t),s=Math.min(o,e.min*e.ratio);return{base:i-s/2,head:i+s/2,center:i,size:s}}draw(){let t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length,a=0;for(;a<s;++a)null!==this.getParsed(a)[e.axis]&&i[a].draw(this._ctx)}},BubbleController:class extends iq{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){let a=super.parsePrimitiveData(t,e,i,s);for(let t=0;t<a.length;t++)a[t]._custom=this.resolveDataElementOptions(t+i).radius;return a}parseArrayData(t,e,i,s){let a=super.parseArrayData(t,e,i,s);for(let t=0;t<a.length;t++){let s=e[i+t];a[t]._custom=W(s[2],this.resolveDataElementOptions(t+i).radius)}return a}parseObjectData(t,e,i,s){let a=super.parseObjectData(t,e,i,s);for(let t=0;t<a.length;t++){let s=e[i+t];a[t]._custom=W(s&&s.r&&+s.r,this.resolveDataElementOptions(t+i).radius)}return a}getMaxOverflow(){let t=this._cachedMeta.data,e=0;for(let i=t.length-1;i>=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="reset"===s,{iScale:n,vScale:r}=this._cachedMeta,{sharedOptions:o,includeOptions:l}=this._getSharedOptions(e,s),h=n.axis,d=r.axis;for(let c=e;c<e+i;c++){let e=t[c],i=!a&&this.getParsed(c),u={},f=u[h]=a?n.getPixelForDecimal(.5):n.getPixelForValue(i[h]),g=u[d]=a?r.getBasePixel():r.getPixelForValue(i[d]);u.skip=isNaN(f)||isNaN(g),l&&(u.options=o||this.resolveDataElementOptions(c,e.active?"active":s),a&&(u.options.radius=0)),this.updateElement(e,c,u,s)}}resolveDataElementOptions(t,e){let i=this.getParsed(t),s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));let a=s.radius;return"active"!==e&&(s.radius=0),s.radius+=W(i&&i._custom,a),s}},DoughnutController:i0,LineController:class extends iq{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};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}=tV(e,s,n);this._drawStart=r,this._drawCount=o,t$(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="reset"===s,{iScale:n,vScale:r,_stacked:o,_dataset:l}=this._cachedMeta,{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,s),c=n.axis,u=r.axis,{spanGaps:f,segment:g}=this.options,p=tm(f)?f:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||a||"none"===s,b=e+i,x=t.length,_=e>0&&this.getParsed(e-1);for(let i=0;i<x;++i){let f=t[i],x=m?f:{};if(i<e||i>=b){x.skip=!0;continue}let y=this.getParsed(i),v=I(y[u]),M=x[c]=n.getPixelForValue(y[c],i),w=x[u]=a||v?r.getBasePixel():r.getPixelForValue(o?this.applyStack(r,y,o):y[u],i);x.skip=isNaN(M)||isNaN(w)||v,x.stop=i>0&&Math.abs(y[c]-_[c])>p,g&&(x.parsed=y,x.raw=l.data[i]),d&&(x.options=h||this.resolveDataElementOptions(i,f.active?"active":s)),m||this.updateElement(f,i,x,s),_=y}}getMaxOverflow(){let t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];return s.length?Math.max(i,s[0].size(this.resolveDataElementOptions(0)),s[s.length-1].size(this.resolveDataElementOptions(s.length-1)))/2:i}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},PieController:class extends i0{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}},PolarAreaController:i1,RadarController:class extends iq{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};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 ie.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,"resize"!==t){let e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);let n={_loop:!0,_fullLoop:a.length===s.length,options:e};this.updateElement(i,void 0,n,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){let a=this._cachedMeta.rScale,n="reset"===s;for(let r=e;r<e+i;r++){let e=t[r],i=this.resolveDataElementOptions(r,e.active?"active":s),o=a.getPointPositionForValue(r,this.getParsed(r).r),l=n?a.xCenter:o.x,h=n?a.yCenter:o.y,d={x:l,y:h,angle:o.angle,skip:isNaN(l)||isNaN(h),options:i};this.updateElement(e,r,d,s)}}},ScatterController:class extends iq{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};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);return{label:i[t]||"",value:"("+r+", "+o+")"}}update(t){let e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled,{start:a,count:n}=tV(e,i,s);if(this._drawStart=a,this._drawCount=n,t$(e)&&(a=0,n=i.length),this.options.showLine){this.datasetElementType||this.addElements();let{dataset:a,_dataset:n}=e;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!n._decimated,a.points=i;let r=this.resolveDatasetElementOptions(t);r.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:r},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,a,n,t)}addElements(){let{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,s){let a="reset"===s,{iScale:n,vScale:r,_stacked:o,_dataset:l}=this._cachedMeta,h=this.resolveDataElementOptions(e,s),d=this.getSharedOptions(h),c=this.includeOptions(s,d),u=n.axis,f=r.axis,{spanGaps:g,segment:p}=this.options,m=tm(g)?g:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||a||"none"===s,x=e>0&&this.getParsed(e-1);for(let h=e;h<e+i;++h){let e=t[h],i=this.getParsed(h),g=b?e:{},_=I(i[f]),y=g[u]=n.getPixelForValue(i[u],h),v=g[f]=a||_?r.getBasePixel():r.getPixelForValue(o?this.applyStack(r,i,o):i[f],h);g.skip=isNaN(y)||isNaN(v)||_,g.stop=h>0&&Math.abs(i[u]-x[u])>m,p&&(g.parsed=i,g.raw=l.data[h]),c&&(g.options=d||this.resolveDataElementOptions(h,e.active?"active":s)),b||this.updateElement(e,h,g,s),x=i}this.updateSharedOptions(d,s,h)}getMaxOverflow(){let t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}let i=t.dataset,s=i.options&&i.options.borderWidth||0;return e.length?Math.max(s,e[0].size(this.resolveDataElementOptions(0)),e[e.length-1].size(this.resolveDataElementOptions(e.length-1)))/2:s}}});function i5(){throw Error("This method is not implemented: Check that a complete date adapter is provided.")}class i3{static override(t){Object.assign(i3.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return i5()}parse(){return i5()}format(){return i5()}add(){return i5()}diff(){return i5()}startOf(){return i5()}endOf(){return i5()}}var i4={_date:i3};function i6(t,e,i,s,a){let n=t.getSortedVisibleDatasetMetas(),r=i[e];for(let t=0,i=n.length;t<i;++t){let{index:i,data:o}=n[t],{lo:l,hi:h}=function(t,e,i,s){let{controller:a,data:n,_sorted:r}=t,o=a._cachedMeta.iScale;if(o&&e===o.axis&&"r"!==e&&r&&n.length){let t=o._reversePixels?tC:tO;if(!s)return t(n,e,i);if(a._sharedOptions){let s=n[0],a="function"==typeof s.getRange&&s.getRange(e);if(a){let s=t(n,e,i-a),r=t(n,e,i+a);return{lo:s.lo,hi:r.hi}}}}return{lo:0,hi:n.length-1}}(n[t],e,r,a);for(let t=l;t<=h;++t){let e=o[t];e.skip||s(e,i,t)}}}function i8(t,e,i,s,a){let n=[];return(a||t.isPointInArea(e))&&i6(t,i,e,function(i,r,o){(a||eF(i,t.chartArea,0))&&i.inRange(e.x,e.y,s)&&n.push({element:i,datasetIndex:r,index:o})},!0),n}function i7(t,e,i,s,a,n){let r;return n||t.isPointInArea(e)?"r"!==i||s?function(t,e,i,s,a,n){let r=[],o=function(t){let e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,s){return Math.sqrt(Math.pow(e?Math.abs(t.x-s.x):0,2)+Math.pow(i?Math.abs(t.y-s.y):0,2))}}(i),l=Number.POSITIVE_INFINITY;return i6(t,i,e,function(i,h,d){let c=i.inRange(e.x,e.y,a);if(s&&!c)return;let u=i.getCenterPoint(a);if(!(n||t.isPointInArea(u))&&!c)return;let f=o(e,u);f<l?(r=[{element:i,datasetIndex:h,index:d}],l=f):f===l&&r.push({element:i,datasetIndex:h,index:d})}),r}(t,e,i,s,a,n):(r=[],i6(t,i,e,function(t,i,s){let{startAngle:n,endAngle:o}=t.getProps(["startAngle","endAngle"],a),{angle:l}=ty(t,{x:e.x,y:e.y});tk(l,n,o)&&r.push({element:t,datasetIndex:i,index:s})}),r):[]}function i9(t,e,i,s,a){let n=[],r="x"===i?"inXRange":"inYRange",o=!1;return(i6(t,i,e,(t,s,l)=>{t[r](e[i],a)&&(n.push({element:t,datasetIndex:s,index:l}),o=o||t.inRange(e.x,e.y,a))}),s&&!o)?[]:n}var st={modes:{index(t,e,i,s){let a=ip(e,t),n=i.axis||"x",r=i.includeInvisible||!1,o=i.intersect?i8(t,a,n,s,r):i7(t,a,n,!1,s,r),l=[];return o.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{let e=o[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})}),l):[]},dataset(t,e,i,s){let a=ip(e,t),n=i.axis||"xy",r=i.includeInvisible||!1,o=i.intersect?i8(t,a,n,s,r):i7(t,a,n,!1,s,r);if(o.length>0){let e=o[0].datasetIndex,i=t.getDatasetMeta(e).data;o=[];for(let t=0;t<i.length;++t)o.push({element:i[t],datasetIndex:e,index:t})}return o},point(t,e,i,s){let a=ip(e,t);return i8(t,a,i.axis||"xy",s,i.includeInvisible||!1)},nearest(t,e,i,s){let a=ip(e,t),n=i.axis||"xy",r=i.includeInvisible||!1;return i7(t,a,n,i.intersect,s,r)},x(t,e,i,s){let a=ip(e,t);return i9(t,a,"x",i.intersect,s)},y(t,e,i,s){let a=ip(e,t);return i9(t,a,"y",i.intersect,s)}}};let se=["left","top","right","bottom"];function si(t,e){return t.filter(t=>t.pos===e)}function ss(t,e){return t.filter(t=>-1===se.indexOf(t.pos)&&t.box.axis===e)}function sa(t,e){return t.sort((t,i)=>{let s=e?i:t,a=e?t:i;return s.weight===a.weight?s.index-a.index:s.weight-a.weight})}function sn(t,e,i,s){return Math.max(t[i],e[i])+Math.max(t[s],e[s])}function sr(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)}function so(t,e,i,s){let a,n,r,o,l,h;let d=[];for(a=0,n=t.length,l=0;a<n;++a){(o=(r=t[a]).box).update(r.width||e.w,r.height||e.h,function(t,e){let i=e.maxPadding;return function(t){let s={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{s[t]=Math.max(e[t],i[t])}),s}(t?["left","right"]:["top","bottom"])}(r.horizontal,e));let{same:n,other:c}=function(t,e,i,s){let{pos:a,box:n}=i,r=t.maxPadding;if(!F(a)){i.size&&(t[a]-=i.size);let e=s[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?n.height:n.width),i.size=e.size/e.count,t[a]+=i.size}n.getPadding&&sr(r,n.getPadding());let o=Math.max(0,e.outerWidth-sn(r,t,"left","right")),l=Math.max(0,e.outerHeight-sn(r,t,"top","bottom")),h=o!==t.w,d=l!==t.h;return t.w=o,t.h=l,i.horizontal?{same:h,other:d}:{same:d,other:h}}(e,i,r,s);l|=n&&d.length,h=h||c,o.fullSize||d.push(r)}return l&&so(d,e,i,s)||h}function sl(t,e,i,s,a){t.top=i,t.left=e,t.right=e+s,t.bottom=i+a,t.width=s,t.height=a}function sh(t,e,i,s){let a=i.padding,{x:n,y:r}=e;for(let o of t){let t=o.box,l=s[o.stack]||{count:1,placed:0,weight:1},h=o.stackWeight/l.weight||1;if(o.horizontal){let s=e.w*h,n=l.size||t.height;te(l.start)&&(r=l.start),t.fullSize?sl(t,a.left,r,i.outerWidth-a.right-a.left,n):sl(t,e.left+l.placed,r,s,n),l.start=r,l.placed+=s,r=t.bottom}else{let s=e.h*h,r=l.size||t.width;te(l.start)&&(n=l.start),t.fullSize?sl(t,n,a.top,r,i.outerHeight-a.bottom-a.top):sl(t,n,e.top+l.placed,r,s),l.start=n,l.placed+=s,n=t.right}}e.x=n,e.y=r}var sd={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){let i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,s){if(!t)return;let a=eG(t.options.layout.padding),n=Math.max(e-a.width,0),r=Math.max(i-a.height,0),o=function(t){let e=function(t){let e,i,s,a,n,r;let o=[];for(e=0,i=(t||[]).length;e<i;++e)s=t[e],({position:a,options:{stack:n,stackWeight:r=1}}=s),o.push({index:e,box:s,pos:a,horizontal:s.isHorizontal(),weight:s.weight,stack:n&&a+n,stackWeight:r});return o}(t),i=sa(e.filter(t=>t.box.fullSize),!0),s=sa(si(e,"left"),!0),a=sa(si(e,"right")),n=sa(si(e,"top"),!0),r=sa(si(e,"bottom")),o=ss(e,"x"),l=ss(e,"y");return{fullSize:i,leftAndTop:s.concat(n),rightAndBottom:a.concat(l).concat(r).concat(o),chartArea:si(e,"chartArea"),vertical:s.concat(a).concat(l),horizontal:n.concat(r).concat(o)}}(t.boxes),l=o.vertical,h=o.horizontal;Y(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});let d=Object.freeze({outerWidth:e,outerHeight:i,padding:a,availableWidth:n,availableHeight:r,vBoxMaxWidth:n/2/(l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1),hBoxMaxHeight:r/2}),c=Object.assign({},a);sr(c,eG(s));let u=Object.assign({maxPadding:c,w:n,h:r,x:a.left,y:a.top},a),f=function(t,e){let i,s,a;let n=function(t){let e={};for(let i of t){let{stack:t,pos:s,stackWeight:a}=i;if(!t||!se.includes(s))continue;let n=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});n.count++,n.weight+=a}return e}(t),{vBoxMaxWidth:r,hBoxMaxHeight:o}=e;for(i=0,s=t.length;i<s;++i){let{fullSize:s}=(a=t[i]).box,l=n[a.stack],h=l&&a.stackWeight/l.weight;a.horizontal?(a.width=h?h*r:s&&e.availableWidth,a.height=o):(a.width=r,a.height=h?h*o:s&&e.availableHeight)}return n}(l.concat(h),d);so(o.fullSize,u,d,f),so(l,u,d,f),so(h,u,d,f)&&so(l,u,d,f),function(t){let e=t.maxPadding;function i(i){let s=Math.max(e[i]-t[i],0);return t[i]+=s,s}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(u),sh(o.leftAndTop,u,d,f),u.x+=u.w,u.y+=u.h,sh(o.rightAndBottom,u,d,f),t.chartArea={left:u.left,top:u.top,right:u.left+u.w,bottom:u.top+u.h,height:u.h,width:u.w},Y(o.chartArea,e=>{let i=e.box;Object.assign(i,t.chartArea),i.update(u.w,u.h,{left:0,top:0,right:0,bottom:0})})}};class sc{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){}}class su extends sc{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}let sf="$chartjs",sg={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},sp=t=>null===t||""===t,sm=!!ix&&{passive:!0};function sb(t,e){for(let i of t)if(i===e||i.contains(e))return!0}function sx(t,e,i){let s=t.canvas,a=new MutationObserver(t=>{let e=!1;for(let i of t)e=(e=e||sb(i.addedNodes,s))&&!sb(i.removedNodes,s);e&&i()});return a.observe(document,{childList:!0,subtree:!0}),a}function s_(t,e,i){let s=t.canvas,a=new MutationObserver(t=>{let e=!1;for(let i of t)e=(e=e||sb(i.removedNodes,s))&&!sb(i.addedNodes,s);e&&i()});return a.observe(document,{childList:!0,subtree:!0}),a}let sy=new Map,sv=0;function sM(){let t=window.devicePixelRatio;t!==sv&&(sv=t,sy.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function sw(t,e,i){let s=t.canvas,a=s&&il(s);if(!a)return;let n=tR((t,e)=>{let s=a.clientWidth;i(t,e),s<a.clientWidth&&i()},window),r=new ResizeObserver(t=>{let e=t[0],i=e.contentRect.width,s=e.contentRect.height;(0!==i||0!==s)&&n(i,s)});return r.observe(a),sy.size||window.addEventListener("resize",sM),sy.set(t,n),r}function sk(t,e,i){i&&i.disconnect(),"resize"===e&&(sy.delete(t),sy.size||window.removeEventListener("resize",sM))}function sS(t,e,i){let s=t.canvas,a=tR(e=>{null!==t.ctx&&i(function(t,e){let i=sg[t.type]||t.type,{x:s,y:a}=ip(t,e);return{type:i,chart:e,native:t,x:void 0!==s?s:null,y:void 0!==a?a:null}}(e,t))},t);return s&&s.addEventListener(e,a,sm),a}class sD extends sc{acquireContext(t,e){let i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(!function(t,e){let i=t.style,s=t.getAttribute("height"),a=t.getAttribute("width");if(t[sf]={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",sp(a)){let e=i_(t,"width");void 0!==e&&(t.width=e)}if(sp(s)){if(""===t.style.height)t.height=t.width/(e||2);else{let e=i_(t,"height");void 0!==e&&(t.height=e)}}}(t,e),i):null}releaseContext(t){let e=t.canvas;if(!e[sf])return!1;let i=e[sf].initial;["height","width"].forEach(t=>{let s=i[t];I(s)?e.removeAttribute(t):e.setAttribute(t,s)});let s=i.style||{};return Object.keys(s).forEach(t=>{e.style[t]=s[t]}),e.width=e.width,delete e[sf],!0}addEventListener(t,e,i){this.removeEventListener(t,e);let s=t.$proxies||(t.$proxies={}),a={attach:sx,detach:s_,resize:sw}[e]||sS;s[e]=a(t,e,i)}removeEventListener(t,e){let i=t.$proxies||(t.$proxies={}),s=i[e];s&&((({attach:sk,detach:sk,resize:sk})[e]||function(t,e,i){t&&t.canvas&&t.canvas.removeEventListener(e,i,sm)})(t,e,s),i[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return function(t,e,i,s){let a=id(t),n=iu(a,"margin"),r=ih(a.maxWidth,t,"clientWidth")||to,o=ih(a.maxHeight,t,"clientHeight")||to,l=function(t,e,i){let s,a;if(void 0===e||void 0===i){let n=il(t);if(n){let t=n.getBoundingClientRect(),r=id(n),o=iu(r,"border","width"),l=iu(r,"padding");e=t.width-l.width-o.width,i=t.height-l.height-o.height,s=ih(r.maxWidth,n,"clientWidth"),a=ih(r.maxHeight,n,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:s||to,maxHeight:a||to}}(t,e,i),{width:h,height:d}=l;if("content-box"===a.boxSizing){let t=iu(a,"border","width"),e=iu(a,"padding");h-=e.width+t.width,d-=e.height+t.height}return h=Math.max(0,h-n.width),d=Math.max(0,s?h/s:d-n.height),h=im(Math.min(h,r,l.maxWidth)),d=im(Math.min(d,o,l.maxHeight)),h&&!d&&(d=im(h/2)),(void 0!==e||void 0!==i)&&s&&l.height&&d>l.height&&(h=im(Math.floor((d=l.height)*s))),{width:h,height:d}}(t,e,i,s)}isAttached(t){let e=il(t);return!!(e&&e.isConnected)}}class sP{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){let{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return tm(this.x)&&tm(this.y)}getProps(t,e){let i=this.$animations;if(!e||!i)return this;let s={};return t.forEach(t=>{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),s}}function sO(t,e,i,s,a){let n,r,o;let l=W(s,0),h=Math.min(W(a,t.length),t.length),d=0;for(i=Math.ceil(i),a&&(i=(n=a-s)/Math.floor(n/i)),o=l;o<0;)o=Math.round(l+ ++d*i);for(r=Math.max(l,0);r<h;r++)r===o&&(e.push(t[r]),o=Math.round(l+ ++d*i))}let sC=t=>"left"===t?"right":"right"===t?"left":t,sL=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i,sT=(t,e)=>Math.min(e||t,t);function sA(t,e){let i=[],s=t.length/e,a=t.length,n=0;for(;n<a;n+=s)i.push(t[Math.floor(n)]);return i}function sE(t){return t.drawTicks?t.tickLength:0}function sR(t,e){if(!t.display)return 0;let i=eK(t.font,e),s=eG(t.padding);return(z(t.text)?t.text.length:1)*i.lineHeight+s.height}class sI extends sP{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=$(t,Number.POSITIVE_INFINITY),e=$(e,Number.NEGATIVE_INFINITY),i=$(i,Number.POSITIVE_INFINITY),s=$(s,Number.NEGATIVE_INFINITY),{min:$(t,i),max:$(e,s),minDefined:V(t),maxDefined:V(e)}}getMinMax(t){let e,{min:i,max:s,minDefined:a,maxDefined:n}=this.getUserBounds();if(a&&n)return{min:i,max:s};let r=this.getMatchingVisibleMetas();for(let o=0,l=r.length;o<l;++o)e=r[o].controller.getMinMax(this,t),a||(i=Math.min(i,e.min)),n||(s=Math.max(s,e.max));return i=n&&i>s?s:i,s=a&&i>s?i:s,{min:$(i,$(s,i)),max:$(s,$(i,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){N(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=function(t,e,i){let{min:s,max:a}=t,n=H(e,(a-s)/2),r=(t,e)=>i&&0===t?0:t+e;return{min:r(s,-Math.abs(n)),max:r(a,n)}}(this,a,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let o=r<this.ticks.length;this._convertTicksToLabels(o?sA(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),n.display&&(n.autoSkip||"auto"===n.source)&&(this.ticks=function(t,e){let i=t.options.ticks,s=function(t){let e=t.options.offset,i=t._tickSize();return Math.floor(Math.min(t._length/i+(e?0:1),t._maxLength/i))}(t),a=Math.min(i.maxTicksLimit||s,s),n=i.major.enabled?function(t){let e,i;let s=[];for(e=0,i=t.length;e<i;e++)t[e].major&&s.push(e);return s}(e):[],r=n.length,o=n[0],l=n[r-1],h=[];if(r>a)return function(t,e,i,s){let a,n=0,r=i[0];for(a=0,s=Math.ceil(s);a<t.length;a++)a===r&&(e.push(t[a]),r=i[++n*s])}(e,h,n,r/a),h;let d=function(t,e,i){let s=function(t){let e,i;let s=t.length;if(s<2)return!1;for(i=t[0],e=1;e<s;++e)if(t[e]-t[e-1]!==i)return!1;return i}(t),a=e.length/i;if(!s)return Math.max(a,1);let n=function(t){let e;let i=[],s=Math.sqrt(t);for(e=1;e<s;e++)t%e==0&&(i.push(e),i.push(t/e));return s===(0|s)&&i.push(s),i.sort((t,e)=>t-e).pop(),i}(s);for(let t=0,e=n.length-1;t<e;t++){let e=n[t];if(e>a)return e}return Math.max(a,1)}(n,e,a);if(r>0){let t,i;let s=r>1?Math.round((l-o)/(r-1)):null;for(sO(e,h,d,I(s)?0:o-s,o),t=0,i=r-1;t<i;t++)sO(e,h,d,n[t],n[t+1]);return sO(e,h,d,l,I(s)?e.length:l+s),h}return sO(e,h,d),h}(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),o&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){N(this.options.afterUpdate,[this])}beforeSetDimensions(){N(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){N(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),N(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){N(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){let e,i,s;let a=this.options.ticks;for(e=0,i=t.length;e<i;e++)(s=t[e]).label=N(a.callback,[s.value,e,t],this)}afterTickToLabelConversion(){N(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){N(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let t,e,i;let s=this.options,a=s.ticks,n=sT(this.ticks.length,s.ticks.maxTicksLimit),r=a.minRotation||0,o=a.maxRotation,l=r;if(!this._isVisible()||!a.display||r>=o||n<=1||!this.isHorizontal()){this.labelRotation=r;return}let h=this._getLabelSizes(),d=h.widest.width,c=h.highest.height,u=tS(this.chart.width-d,0,this.maxWidth);d+6>(t=s.offset?this.maxWidth/n:u/(n-1))&&(t=u/(n-(s.offset?.5:1)),e=this.maxHeight-sE(s.grid)-a.padding-sR(s.title,this.chart.options.font),i=Math.sqrt(d*d+c*c),l=Math.max(r,Math.min(o,l=180/ta*Math.min(Math.asin(tS((h.highest.height+6)/t,-1,1)),Math.asin(tS(e/i,-1,1))-Math.asin(tS(c/i,-1,1)))))),this.labelRotation=l}afterCalculateLabelRotation(){N(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){N(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 n=sR(s,e.options.font);if(r?(t.width=this.maxWidth,t.height=sE(a)+n):(t.height=this.maxHeight,t.width=sE(a)+n),i.display&&this.ticks.length){let{first:e,last:s,widest:a,highest:n}=this._getLabelSizes(),o=2*i.padding,l=tx(this.labelRotation),h=Math.cos(l),d=Math.sin(l);if(r){let e=i.mirror?0:d*a.width+h*n.height;t.height=Math.min(this.maxHeight,t.height+e+o)}else{let e=i.mirror?0:h*a.width+d*n.height;t.width=Math.min(this.maxWidth,t.width+e+o)}this._calculatePadding(e,s,d,h)}}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=0!==this.labelRotation,l="top"!==r&&"x"===this.axis;if(this.isHorizontal()){let r=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1),d=0,c=0;o?l?(d=s*t.width,c=i*e.height):(d=i*t.height,c=s*e.width):"start"===a?c=e.width:"end"===a?d=t.width:"inner"!==a&&(d=t.width/2,c=e.width/2),this.paddingLeft=Math.max((d-r+n)*this.width/(this.width-r),0),this.paddingRight=Math.max((c-h+n)*this.width/(this.width-h),0)}else{let i=e.height/2,s=t.height/2;"start"===a?(i=0,s=t.height):"end"===a&&(i=e.height,s=0),this.paddingTop=i+n,this.paddingBottom=s+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(){N(this.options.afterFit,[this])}isHorizontal(){let{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)I(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){let e=this.options.ticks.sampleSize,i=this.ticks;e<i.length&&(i=sA(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){let s,a,n,r,o,l,h,d,c,u,f;let{ctx:g,_longestTextCache:p}=this,m=[],b=[],x=Math.floor(e/sT(e,i)),_=0,y=0;for(s=0;s<e;s+=x){if(r=t[s].label,o=this._resolveTickFontOptions(s),g.font=l=o.string,h=p[l]=p[l]||{data:{},gc:[]},d=o.lineHeight,c=u=0,I(r)||z(r)){if(z(r))for(a=0,n=r.length;a<n;++a)I(f=r[a])||z(f)||(c=eA(g,h.data,h.gc,c,f),u+=d)}else c=eA(g,h.data,h.gc,c,r),u=d;m.push(c),b.push(u),_=Math.max(c,_),y=Math.max(u,y)}Y(p,t=>{let i;let s=t.gc,a=s.length/2;if(a>e){for(i=0;i<a;++i)delete t.data[s[i]];s.splice(0,a)}});let v=m.indexOf(_),M=b.indexOf(y),w=t=>({width:m[t]||0,height:b[t]||0});return{first:w(0),last:w(e-1),widest:w(v),highest:w(M),widths:m,heights:b}}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 tS(this._alignToPixels?eE(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){let e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){let e=this.ticks||[];if(t>=0&&t<e.length){let i=e[t];return i.$context||(i.$context=eQ(this.getContext(),{tick:i,index:t,type:"tick"}))}return this.$context||(this.$context=eQ(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){let t=this.options.ticks,e=tx(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),a=this._getLabelSizes(),n=t.autoSkipPadding||0,r=a?a.widest.width+n:0,o=a?a.highest.height+n:0;return this.isHorizontal()?o*i>r*s?r/i:o/s:o*s<r*i?o/i:r/s}_isVisible(){let t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){let e,i,s,a,n,r,o,l,h,d,c,u;let f=this.axis,g=this.chart,p=this.options,{grid:m,position:b,border:x}=p,_=m.offset,y=this.isHorizontal(),v=this.ticks.length+(_?1:0),M=sE(m),w=[],k=x.setContext(this.getContext()),S=k.display?k.width:0,D=S/2,P=function(t){return eE(g,t,S)};if("top"===b)e=P(this.bottom),r=this.bottom-M,l=e-D,d=P(t.top)+D,u=t.bottom;else if("bottom"===b)e=P(this.top),d=t.top,u=P(t.bottom)-D,r=e+D,l=this.top+M;else if("left"===b)e=P(this.right),n=this.right-M,o=e-D,h=P(t.left)+D,c=t.right;else if("right"===b)e=P(this.left),h=t.left,c=P(t.right)-D,n=e+D,o=this.left+M;else if("x"===f){if("center"===b)e=P((t.top+t.bottom)/2+.5);else if(F(b)){let t=Object.keys(b)[0],i=b[t];e=P(this.chart.scales[t].getPixelForValue(i))}d=t.top,u=t.bottom,l=(r=e+D)+M}else if("y"===f){if("center"===b)e=P((t.left+t.right)/2);else if(F(b)){let t=Object.keys(b)[0],i=b[t];e=P(this.chart.scales[t].getPixelForValue(i))}o=(n=e-D)-M,h=t.left,c=t.right}let O=W(p.ticks.maxTicksLimit,v),C=Math.max(1,Math.ceil(v/O));for(i=0;i<v;i+=C){let t=this.getContext(i),e=m.setContext(t),f=x.setContext(t),p=e.lineWidth,b=e.color,v=f.dash||[],M=f.dashOffset,k=e.tickWidth,S=e.tickColor,D=e.tickBorderDash||[],P=e.tickBorderDashOffset;void 0!==(s=function(t,e,i){let s;let a=t.ticks.length,n=Math.min(e,a-1),r=t._startPixel,o=t._endPixel,l=t.getPixelForTick(n);if(!i||(s=1===a?Math.max(l-r,o-l):0===e?(t.getPixelForTick(1)-l)/2:(l-t.getPixelForTick(n-1))/2,!((l+=n<e?s:-s)<r-1e-6)&&!(l>o+1e-6)))return l}(this,i,_))&&(a=eE(g,s,p),y?n=o=h=c=a:r=l=d=u=a,w.push({tx1:n,ty1:r,tx2:o,ty2:l,x1:h,y1:d,x2:c,y2:u,width:p,color:b,borderDash:v,borderDashOffset:M,tickWidth:k,tickColor:S,tickBorderDash:D,tickBorderDashOffset:P}))}return this._ticksLength=v,this._borderValue=e,w}_computeLabelItems(t){let e,i,s,a,n,r,o,l,h,d,c;let u=this.axis,f=this.options,{position:g,ticks:p}=f,m=this.isHorizontal(),b=this.ticks,{align:x,crossAlign:_,padding:y,mirror:v}=p,M=sE(f.grid),w=M+y,k=v?-y:w,S=-tx(this.labelRotation),D=[],P="middle";if("top"===g)n=this.bottom-k,r=this._getXAxisLabelAlignment();else if("bottom"===g)n=this.top+k,r=this._getXAxisLabelAlignment();else if("left"===g){let t=this._getYAxisLabelAlignment(M);r=t.textAlign,a=t.x}else if("right"===g){let t=this._getYAxisLabelAlignment(M);r=t.textAlign,a=t.x}else if("x"===u){if("center"===g)n=(t.top+t.bottom)/2+w;else if(F(g)){let t=Object.keys(g)[0],e=g[t];n=this.chart.scales[t].getPixelForValue(e)+w}r=this._getXAxisLabelAlignment()}else if("y"===u){if("center"===g)a=(t.left+t.right)/2-w;else if(F(g)){let t=Object.keys(g)[0],e=g[t];a=this.chart.scales[t].getPixelForValue(e)}r=this._getYAxisLabelAlignment(M).textAlign}"y"===u&&("start"===x?P="top":"end"===x&&(P="bottom"));let O=this._getLabelSizes();for(e=0,i=b.length;e<i;++e){let t;s=b[e].label;let u=p.setContext(this.getContext(e));o=this.getPixelForTick(e)+p.labelOffset,h=(l=this._resolveTickFontOptions(e)).lineHeight;let f=(d=z(s)?s.length:1)/2,x=u.color,y=u.textStrokeColor,M=u.textStrokeWidth,w=r;if(m?(a=o,"inner"===r&&(w=e===i-1?this.options.reverse?"left":"right":0===e?this.options.reverse?"right":"left":"center"),c="top"===g?"near"===_||0!==S?-d*h+h/2:"center"===_?-O.highest.height/2-f*h+h:-O.highest.height+h/2:"near"===_||0!==S?h/2:"center"===_?O.highest.height/2-f*h:O.highest.height-d*h,v&&(c*=-1),0===S||u.showLabelBackdrop||(a+=h/2*Math.sin(S))):(n=o,c=(1-d)*h/2),u.showLabelBackdrop){let s=eG(u.backdropPadding),a=O.heights[e],n=O.widths[e],o=c-s.top,l=0-s.left;switch(P){case"middle":o-=a/2;break;case"bottom":o-=a}switch(r){case"center":l-=n/2;break;case"right":l-=n;break;case"inner":e===i-1?l-=n:e>0&&(l-=n/2)}t={left:l,top:o,width:n+s.width,height:a+s.height,color:u.backdropColor}}D.push({label:s,font:l,textOffset:c,options:{rotation:S,color:x,strokeColor:y,strokeWidth:M,textAlign:w,textBaseline:P,translation:[a,n],backdrop:t}})}return D}_getXAxisLabelAlignment(){let{position:t,ticks:e}=this.options;if(-tx(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){let e,i;let{position:s,ticks:{crossAlign:a,mirror:n,padding:r}}=this.options,o=this._getLabelSizes(),l=t+r,h=o.widest.width;return"left"===s?n?(i=this.right+r,"near"===a?e="left":"center"===a?(e="center",i+=h/2):(e="right",i+=h)):(i=this.right-l,"near"===a?e="right":"center"===a?(e="center",i-=h/2):(e="left",i=this.left)):"right"===s?n?(i=this.left+r,"near"===a?e="right":"center"===a?(e="center",i-=h/2):(e="left",i-=h)):(i=this.left+l,"near"===a?e="left":"center"===a?(e="center",i+=h/2):(e="right",i=this.right)):e="right",{textAlign:e,x:i}}_computeLabelArea(){if(this.options.ticks.mirror)return;let t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){let{ctx:t,options:{backgroundColor:e},left:i,top:s,width:a,height:n}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,a,n),t.restore())}getLineWidthForValue(t){let e=this.options.grid;if(!this._isVisible()||!e.display)return 0;let i=this.ticks.findIndex(e=>e.value===t);return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){let e,i;let s=this.options.grid,a=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),r=(t,e,i)=>{i.width&&i.color&&(a.save(),a.lineWidth=i.width,a.strokeStyle=i.color,a.setLineDash(i.borderDash||[]),a.lineDashOffset=i.borderDashOffset,a.beginPath(),a.moveTo(t.x,t.y),a.lineTo(e.x,e.y),a.stroke(),a.restore())};if(s.display)for(e=0,i=n.length;e<i;++e){let t=n[e];s.drawOnChartArea&&r({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),s.drawTicks&&r({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){let t,e,i,s;let{chart:a,ctx:n,options:{border:r,grid:o}}=this,l=r.setContext(this.getContext()),h=r.display?l.width:0;if(!h)return;let d=o.setContext(this.getContext(0)).lineWidth,c=this._borderValue;this.isHorizontal()?(t=eE(a,this.left,h)-h/2,e=eE(a,this.right,d)+d/2,i=s=c):(i=eE(a,this.top,h)-h/2,s=eE(a,this.bottom,d)+d/2,t=e=c),n.save(),n.lineWidth=l.width,n.strokeStyle=l.color,n.beginPath(),n.moveTo(t,i),n.lineTo(e,s),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;let e=this.ctx,i=this._computeLabelArea();for(let s of(i&&eV(e,i),this.getLabelItems(t))){let t=s.options,i=s.font;eH(e,s.label,0,s.textOffset,i,t)}i&&e$(e)}drawTitle(){let t;let{ctx:e,options:{position:i,title:s,reverse:a}}=this;if(!s.display)return;let n=eK(s.font),r=eG(s.padding),o=s.align,l=n.lineHeight/2;"bottom"===i||"center"===i||F(i)?(l+=r.bottom,z(s.text)&&(l+=n.lineHeight*(s.text.length-1))):l+=r.top;let{titleX:h,titleY:d,maxWidth:c,rotation:u}=function(t,e,i,s){let a,n,r;let{top:o,left:l,bottom:h,right:d,chart:c}=t,{chartArea:u,scales:f}=c,g=0,p=h-o,m=d-l;if(t.isHorizontal()){if(n=tz(s,l,d),F(i)){let t=Object.keys(i)[0],s=i[t];r=f[t].getPixelForValue(s)+p-e}else r="center"===i?(u.bottom+u.top)/2+p-e:sL(t,i,e);a=d-l}else{if(F(i)){let t=Object.keys(i)[0],s=i[t];n=f[t].getPixelForValue(s)-m+e}else n="center"===i?(u.left+u.right)/2-m+e:sL(t,i,e);r=tz(s,h,o),g="left"===i?-th:th}return{titleX:n,titleY:r,maxWidth:a,rotation:g}}(this,l,i,o);eH(e,s.text,0,0,n,{color:s.color,maxWidth:c,rotation:u,textAlign:(t=tI(o),(a&&"right"!==i||!a&&"right"===i)&&(t=sC(t)),t),textBaseline:"middle",translation:[h,d]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){let t=this.options,e=t.ticks&&t.ticks.z||0,i=W(t.grid&&t.grid.z,-1),s=W(t.border&&t.border.z,0);return this._isVisible()&&this.draw===sI.prototype.draw?[{z:i,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){let e,i;let s=this.chart.getSortedVisibleDatasetMetas(),a=this.axis+"AxisID",n=[];for(e=0,i=s.length;e<i;++e){let i=s[e];i[a]!==this.id||t&&i.type!==t||n.push(i)}return n}_resolveTickFontOptions(t){return eK(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){let t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class sz{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){let e;let i=Object.getPrototypeOf(t);"id"in i&&"defaults"in i&&(e=this.register(i));let s=this.items,a=t.id,n=this.scope+"."+a;if(!a)throw Error("class does not have id: "+t);return a in s||(s[a]=t,function(t,e,i){let s=Z(Object.create(null),[i?eT.get(i):{},eT.get(e),t.defaults]);eT.set(e,s),t.defaultRoutes&&function(t,e){Object.keys(e).forEach(i=>{let s=i.split("."),a=s.pop(),n=[t].concat(s).join("."),r=e[i].split("."),o=r.pop(),l=r.join(".");eT.route(n,a,l,o)})}(e,t.defaultRoutes),t.descriptors&&eT.describe(e,t.descriptors)}(t,n,e),this.override&&eT.override(t.id,t.overrides)),n}get(t){return this.items[t]}unregister(t){let e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in eT[s]&&(delete eT[s][i],this.override&&delete eP[i])}}var sF=new class{constructor(){this.controllers=new sz(iq,"datasets",!0),this.elements=new sz(sP,"elements"),this.plugins=new sz(Object,"plugins"),this.scales=new sz(sI,"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(e=>{let s=i||this._getRegistryForType(e);i||s.isForType(e)||s===this.plugins&&e.id?this._exec(t,s,e):Y(e,e=>{let s=i||this._getRegistryForType(e);this._exec(t,s,e)})})}_exec(t,e,i){let s=tt(t);N(i["before"+s],[],i),e[t](i),N(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){let i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){let s=e.get(t);if(void 0===s)throw Error('"'+t+'" is not a registered '+i+".");return s}};class sV{constructor(){this._init=[]}notify(t,e,i,s){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));let a=s?this._descriptors(t).filter(s):this._descriptors(t),n=this._notify(a,t,e,i);return"afterDestroy"===e&&(this._notify(a,t,"stop"),this._notify(this._init,t,"uninstall")),n}_notify(t,e,i,s){for(let a of(s=s||{},t)){let t=a.plugin;if(!1===N(t[i],[e,s,a.options],t)&&s.cancelable)return!1}return!0}invalidate(){I(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;let e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){let i=t&&t.config,s=W(i.options&&i.options.plugins,{}),a=function(t){let e={},i=[],s=Object.keys(sF.plugins.items);for(let t=0;t<s.length;t++)i.push(sF.getPlugin(s[t]));let a=t.plugins||[];for(let t=0;t<a.length;t++){let s=a[t];-1===i.indexOf(s)&&(i.push(s),e[s.id]=!0)}return{plugins:i,localIds:e}}(i);return!1!==s||e?function(t,{plugins:e,localIds:i},s,a){let n=[],r=t.getContext();for(let l of e){var o;let e=l.id,h=(o=s[e],a||!1!==o?!0===o?{}:o:null);null!==h&&n.push({plugin:l,options:function(t,{plugin:e,local:i},s,a){let n=t.pluginScopeKeys(e),r=t.getOptionScopes(s,n);return i&&e.defaults&&r.push(e.defaults),t.createResolver(r,a,[""],{scriptable:!1,indexable:!1,allKeys:!0})}(t.config,{plugin:l,local:i[e]},h,r)})}return n}(t,a,s,e):[]}_notifyStateChanges(t){let e=this._oldCache||[],i=this._cache,s=(t,e)=>t.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function s$(t,e){let i=eT.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function sW(t){if("x"===t||"y"===t||"r"===t)return t}function sB(t,...e){if(sW(t))return t;for(let s of e){var i;let e=s.axis||("top"===(i=s.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.length>1&&sW(t[0].toLowerCase());if(e)return e}throw Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function sH(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function sN(t){let e=t.options||(t.options={});e.plugins=W(e.plugins,{}),e.scales=function(t,e){let i=eP[t.type]||{scales:{}},s=e.scales||{},a=s$(t.type,e),n=Object.create(null);return Object.keys(s).forEach(e=>{let r=s[e];if(!F(r))return console.error(`Invalid scale configuration for scale: ${e}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);let o=sB(e,r,function(t,e){if(e.data&&e.data.datasets){let i=e.data.datasets.filter(e=>e.xAxisID===t||e.yAxisID===t);if(i.length)return sH(t,"x",i[0])||sH(t,"y",i[0])}return{}}(e,t),eT.scales[r.type]),l=o===a?"_index_":"_value_",h=i.scales||{};n[e]=G(Object.create(null),[{axis:o},r,h[o],h[l]])}),t.data.datasets.forEach(i=>{let a=i.type||t.type,r=i.indexAxis||s$(a,e),o=(eP[a]||{}).scales||{};Object.keys(o).forEach(t=>{let e;let a=(e=t,"_index_"===t?e=r:"_value_"===t&&(e="x"===r?"y":"x"),e),l=i[a+"AxisID"]||a;n[l]=n[l]||Object.create(null),G(n[l],[{axis:a},s[l],o[t]])})}),Object.keys(n).forEach(t=>{let e=n[t];G(e,[eT.scales[e.type],eT.scale])}),n}(t,e)}function sY(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}let sj=new Map,sU=new Set;function sX(t,e){let i=sj.get(t);return i||(i=e(),sj.set(t,i),sU.add(i)),i}let sq=(t,e,i)=>{let s=Q(e,i);void 0!==s&&t.add(s)};class sZ{constructor(t){var e;this._config=((e=(e=t)||{}).data=sY(e.data),sN(e),e),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=sY(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(),sN(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return sX(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return sX(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return sX(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){let e=t.id,i=this.type;return sX(`${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(e=>{t&&(o.add(t),e.forEach(e=>sq(o,t,e))),e.forEach(t=>sq(o,s,t)),e.forEach(t=>sq(o,eP[a]||{},t)),e.forEach(t=>sq(o,eT,t)),e.forEach(t=>sq(o,eO,t))});let l=Array.from(o);return 0===l.length&&l.push(Object.create(null)),sU.has(e)&&n.set(e,l),l}chartOptionScopes(){let{options:t,type:e}=this;return[t,eP[e]||{},eT.datasets[e]||{},{type:e},eT,eO]}resolveNamedOptions(t,e,i,s=[""]){let a={$shared:!0},{resolver:n,subPrefixes:r}=sG(this._resolverCache,t,s),o=n;if(function(t,e){let{isScriptable:i,isIndexable:s}=e2(t);for(let a of e){let e=i(a),n=s(a),r=(n||e)&&t[a];if(e&&(ti(r)||sK(r))||n&&z(r))return!0}return!1}(n,e)){a.$shared=!1,i=ti(i)?i():i;let e=this.createResolver(t,i,r);o=e1(n,i,e)}for(let t of e)a[t]=o[t];return a}createResolver(t,e,i=[""],s){let{resolver:a}=sG(this._resolverCache,t,i);return F(e)?e1(a,e,void 0,s):a}}function sG(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:e0(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},s.set(a,n)),n}let sK=t=>F(t)&&Object.getOwnPropertyNames(t).some(e=>ti(t[e])),sJ=["top","bottom","left","right","chartArea"];function sQ(t,e){return"top"===t||"bottom"===t||-1===sJ.indexOf(t)&&"x"===e}function s0(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}function s1(t){let e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),N(i&&i.onComplete,[t],e)}function s2(t){let e=t.chart,i=e.options.animation;N(i&&i.onProgress,[t],e)}function s5(t){return io()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}let s3={},s4=t=>{let e=s5(t);return Object.values(s3).filter(t=>t.canvas===e).pop()};function s6(t,e,i){return t.options.clip?t[i]:e[i]}class s8{static defaults=eT;static instances=s3;static overrides=eP;static registry=sF;static version="4.4.2";static getChart=s4;static register(...t){sF.add(...t),s7()}static unregister(...t){sF.remove(...t),s7()}constructor(t,e){var i,s;let a;let n=this.config=new sZ(e),r=s5(t),o=s4(r);if(o)throw Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");let l=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||(!io()||"undefined"!=typeof OffscreenCanvas&&r instanceof OffscreenCanvas?su:sD)),this.platform.updateConfig(n);let h=this.platform.acquireContext(r,l.aspectRatio),d=h&&h.canvas,c=d&&d.height,u=d&&d.width;if(this.id=R(),this.ctx=h,this.canvas=d,this.width=u,this.height=c,this._options=l,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 sV,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=(i=t=>this.update(t),s=l.resizeDelay||0,function(...t){return s?(clearTimeout(a),a=setTimeout(i,s,t)):i.apply(this,t),s}),this._dataChanges=[],s3[this.id]=this,!h||!d){console.error("Failed to create chart: can't acquire context from the given item");return}iA.listen(this,"complete",s1),iA.listen(this,"progress",s2),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:a}=this;return I(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 sF}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ib(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return eR(this.canvas,this.ctx),this}stop(){return iA.stop(this),this}resize(t,e){iA.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,ib(this,r,!0)&&(this.notifyPlugins("resize",{size:n}),N(i.onResize,[this,n],this),this.attached&&this._doResize(o)&&this.render())}ensureScalesHaveIDs(){Y(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){let t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{}),a=[];e&&(a=a.concat(Object.keys(e).map(t=>{let i=e[t],s=sB(t,i),a="r"===s,n="x"===s;return{options:i,dposition:a?"chartArea":n?"bottom":"left",dtype:a?"radialLinear":n?"category":"linear"}}))),Y(a,e=>{let a=e.options,n=a.id,r=sB(n,a),o=W(a.type,e.dtype);(void 0===a.position||sQ(a.position,r)!==sQ(e.dposition))&&(a.position=e.dposition),s[n]=!0;let l=null;n in i&&i[n].type===o?l=i[n]:i[(l=new(sF.getScale(o))({id:n,type:o,ctx:this.ctx,chart:this})).id]=l,l.init(a,t)}),Y(s,(t,e)=>{t||delete i[e]}),Y(i,t=>{sd.configure(this,t,t.options),sd.addBox(this,t)})}_updateMetasets(){let t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(s0("order","index"))}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){let t,e;let i=[],s=this.data.datasets;for(this._removeUnreferencedMetasets(),t=0,e=s.length;t<e;t++){let e=s[t],a=this.getDatasetMeta(t),n=e.type||this.config.type;if(a.type&&a.type!==n&&(this._destroyDatasetMeta(t),a=this.getDatasetMeta(t)),a.type=n,a.indexAxis=e.indexAxis||s$(n,this.options),a.order=e.order||0,a.index=t,a.label=""+e.label,a.visible=this.isDatasetVisible(t),a.controller)a.controller.updateIndex(t),a.controller.linkScales();else{let e=sF.getController(n),{datasetElementType:s,dataElementType:r}=eT.datasets[n];Object.assign(e,{dataElementType:sF.getElement(r),datasetElementType:s&&sF.getElement(s)}),a.controller=new e(this,t),i.push(a.controller)}}return this._updateMetasets(),i}_resetElements(){Y(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let e=this.config;e.update();let i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;let a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let n=0;for(let t=0,e=this.data.datasets.length;t<e;t++){let{controller:e}=this.getDatasetMeta(t),i=!s&&-1===a.indexOf(e);e.buildOrUpdateElements(i),n=Math.max(+e.getMaxOverflow(),n)}n=this._minPadding=i.layout.autoPadding?n:0,this._updateLayout(n),s||Y(a,t=>{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(s0("z","_idx"));let{_active:r,_lastEvent:o}=this;o?this._eventHandler(o,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){Y(this.scales,t=>{sd.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options;ts(new Set(Object.keys(this._listeners)),new Set(t.events))&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this;for(let{method:e,start:i,count:s}of this._getUniformDataChanges()||[])!function(t,e,i){for(let s of Object.keys(t)){let a=+s;if(a>=e){let n=t[s];delete t[s],(i>0||a>e)&&(t[a+i]=n)}}}(t,i,"_removeElements"===e?-s:s)}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),s=i(0);for(let t=1;t<e;t++)if(!ts(s,i(t)))return;return Array.from(s).map(t=>t.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;sd.update(this,this.width,this.height,t);let e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],Y(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,ti(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){let i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",s)&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(iA.has(this)?this.attached&&!iA.running(this)&&iA.start(this):(this.draw(),s1({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){let{width:t,height:e}=this._resizeBeforeDraw;this._resize(t,e),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;let e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){let e,i;let s=this._sortedMetasets,a=[];for(e=0,i=s.length;e<i;++e){let i=s[e];(!t||i.visible)&&a.push(i)}return a}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;let t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let e=this.ctx,i=t._clip,s=!i.disabled,a=function(t,e){let{xScale:i,yScale:s}=t;return i&&s?{left:s6(i,e,"left"),right:s6(i,e,"right"),top:s6(s,e,"top"),bottom:s6(s,e,"bottom")}:e}(t,this.chartArea),n={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",n)&&(s&&eV(e,{left:!1===i.left?0:a.left-i.left,right:!1===i.right?this.width:a.right+i.right,top:!1===i.top?0:a.top-i.top,bottom:!1===i.bottom?this.height:a.bottom+i.bottom}),t.controller.draw(),s&&e$(e),n.cancelable=!1,this.notifyPlugins("afterDatasetDraw",n))}isPointInArea(t){return eF(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){let a=st.modes[e];return"function"==typeof a?a(this,t,i,s):[]}getDatasetMeta(t){let e=this.data.datasets[t],i=this._metasets,s=i.filter(t=>t&&t._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=eQ(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"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).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);te(e)?(a.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),n.update(a,{visible:i}),this.update(e=>e.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(),iA.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),eR(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete s3[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let t=this._listeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};Y(this.options.events,t=>i(t,s))}bindResponsiveEvents(){let t;this._responsiveListeners||(this._responsiveListeners={});let e=this._responsiveListeners,i=this.platform,s=(t,s)=>{i.addEventListener(this,t,s),e[t]=s},a=(t,s)=>{e[t]&&(i.removeEventListener(this,t,s),delete e[t])},n=(t,e)=>{this.canvas&&this.resize(t,e)},r=()=>{a("attach",r),this.attached=!0,this.resize(),s("resize",n),s("detach",t)};t=()=>{this.attached=!1,a("resize",n),this._stop(),this._resize(0,0),s("attach",r)},i.isAttached(this.canvas)?r():t()}unbindEvents(){Y(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Y(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){let s,a,n;let r=i?"set":"remove";for("dataset"===e&&this.getDatasetMeta(t[0].datasetIndex).controller["_"+r+"DatasetHoverStyle"](),a=0,n=t.length;a<n;++a){let e=(s=t[a])&&this.getDatasetMeta(s.datasetIndex).controller;e&&e[r+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){let e=this._active||[],i=t.map(({datasetIndex:t,index:e})=>{let i=this.getDatasetMeta(t);if(!i)throw Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}});j(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 1===this._plugins._cache.filter(e=>e.plugin.id===t).length}_updateHoverStyles(t,e,i){let s=this.options.hover,a=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),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=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))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){var s;let{_active:a=[],options:n}=this,r=this._getActiveElements(t,a,i,e),o="mouseup"===t.type||"click"===t.type||"contextmenu"===t.type,l=(s=this._lastEvent,i&&"mouseout"!==t.type?o?s:t:null);i&&(this._lastEvent=null,N(n.onHover,[t,r,this],this),o&&N(n.onClick,[t,r,this],this));let h=!j(r,a);return(h||e)&&(this._active=r,this._updateHoverStyles(r,a,e)),this._lastEvent=l,h}_getActiveElements(t,e,i,s){if("mouseout"===t.type)return[];if(!i)return e;let a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,s)}}function s7(){return Y(s8.instances,t=>t._plugins.invalidate())}function s9(t,e,i,s){return{x:i+t*Math.cos(e),y:s+t*Math.sin(e)}}function at(t,e,i,s,a,n){let{x:r,y:o,startAngle:l,pixelMargin:h,innerRadius:d}=e,c=Math.max(e.outerRadius+s+i-h,0),u=d>0?d+s+i+h:0,f=0,g=a-l;if(s){let t=c>0?c-s:0,e=((d>0?d-s:0)+t)/2;f=(g-(0!==e?g*e/(e+s):g))/2}let p=Math.max(.001,g*c-i/ta)/c,m=(g-p)/2,b=l+m+f,x=a-m-f,{outerStart:_,outerEnd:y,innerStart:v,innerEnd:M}=function(t,e,i,s){let a=eX(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),n=(i-e)/2,r=Math.min(n,s*e/2),o=t=>{let e=(i-Math.min(n,t))*s/2;return tS(t,0,Math.min(n,e))};return{outerStart:o(a.outerStart),outerEnd:o(a.outerEnd),innerStart:tS(a.innerStart,0,r),innerEnd:tS(a.innerEnd,0,r)}}(e,u,c,x-b),w=c-_,k=c-y,S=b+_/w,D=x-y/k,P=u+v,O=u+M,C=b+v/P,L=x-M/O;if(t.beginPath(),n){let e=(S+D)/2;if(t.arc(r,o,c,S,e),t.arc(r,o,c,e,D),y>0){let e=s9(k,D,r,o);t.arc(e.x,e.y,y,D,x+th)}let i=s9(O,x,r,o);if(t.lineTo(i.x,i.y),M>0){let e=s9(O,L,r,o);t.arc(e.x,e.y,M,x+th,L+Math.PI)}let s=(x-M/u+(b+v/u))/2;if(t.arc(r,o,u,x-M/u,s,!0),t.arc(r,o,u,s,b+v/u,!0),v>0){let e=s9(P,C,r,o);t.arc(e.x,e.y,v,C+Math.PI,b-th)}let a=s9(w,b,r,o);if(t.lineTo(a.x,a.y),_>0){let e=s9(w,S,r,o);t.arc(e.x,e.y,_,b-th,S)}}else{t.moveTo(r,o);let e=Math.cos(S)*c+r,i=Math.sin(S)*c+o;t.lineTo(e,i);let s=Math.cos(D)*c+r,a=Math.sin(D)*c+o;t.lineTo(s,a)}t.closePath()}function ae(t,e,i=e){t.lineCap=W(i.borderCapStyle,e.borderCapStyle),t.setLineDash(W(i.borderDash,e.borderDash)),t.lineDashOffset=W(i.borderDashOffset,e.borderDashOffset),t.lineJoin=W(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=W(i.borderWidth,e.borderWidth),t.strokeStyle=W(i.borderColor,e.borderColor)}function ai(t,e,i){t.lineTo(i.x,i.y)}function as(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);return{count:s,start:l,loop:e.loop,ilen:h<l&&!(a<r&&n<r||a>o&&n>o)?s+h-l:h-l}}function aa(t,e,i,s){let a,n,r;let{points:o,options:l}=e,{count:h,start:d,loop:c,ilen:u}=as(o,i,s),f=l.stepped?eW:l.tension||"monotone"===l.cubicInterpolationMode?eB:ai,{move:g=!0,reverse:p}=s||{};for(a=0;a<=u;++a)(n=o[(d+(p?u-a:a))%h]).skip||(g?(t.moveTo(n.x,n.y),g=!1):f(t,r,n,p,l.stepped),r=n);return c&&f(t,r,n=o[(d+(p?u:0))%h],p,l.stepped),!!c}function an(t,e,i,s){let a,n,r,o,l,h;let d=e.points,{count:c,start:u,ilen:f}=as(d,i,s),{move:g=!0,reverse:p}=s||{},m=0,b=0,x=t=>(u+(p?f-t:t))%c,_=()=>{o!==l&&(t.lineTo(m,l),t.lineTo(m,o),t.lineTo(m,h))};for(g&&(n=d[x(0)],t.moveTo(n.x,n.y)),a=0;a<=f;++a){if((n=d[x(a)]).skip)continue;let e=n.x,i=n.y,s=0|e;s===r?(i<o?o=i:i>l&&(l=i),m=(b*m+e)/++b):(_(),t.lineTo(e,i),r=s,b=0,o=l=i),h=i}_()}function ar(t){let e=t.options,i=e.borderDash&&e.borderDash.length;return t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i?aa:an}let ao="function"==typeof Path2D;class al extends sP{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};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||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){let s=i.spanGaps?this._loop:this._fullLoop;!function(t,e,i,s,a){let n,r,o,l;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)!function(t,e="x"){let i,s,a;let n=ia(e),r=t.length,o=Array(r).fill(0),l=Array(r),h=is(t,0);for(i=0;i<r;++i)if(s=a,a=h,h=is(t,i+1),a){if(h){let t=h[e]-a[e];o[i]=0!==t?(h[n]-a[n])/t:0}l[i]=s?h?tf(o[i-1])!==tf(o[i])?0:(o[i-1]+o[i])/2:o[i-1]:o[i]}(function(t,e,i){let s,a,n,r,o;let l=t.length,h=is(t,0);for(let d=0;d<l-1;++d)if(o=h,h=is(t,d+1),o&&h){if(tg(e[d],0,ii)){i[d]=i[d+1]=0;continue}(r=Math.pow(s=i[d]/e[d],2)+Math.pow(a=i[d+1]/e[d],2))<=9||(n=3/Math.sqrt(r),i[d]=s*n*e[d],i[d+1]=a*n*e[d])}})(t,o,l),function(t,e,i="x"){let s,a,n;let r=ia(i),o=t.length,l=is(t,0);for(let h=0;h<o;++h){if(a=n,n=l,l=is(t,h+1),!n)continue;let o=n[i],d=n[r];a&&(s=(o-a[i])/3,n[`cp1${i}`]=o-s,n[`cp1${r}`]=d-s*e[h]),l&&(s=(l[i]-o)/3,n[`cp2${i}`]=o+s,n[`cp2${r}`]=d+s*e[h])}}(t,l,e)}(t,a);else{let i=s?t[t.length-1]:t[0];for(n=0,r=t.length;n<r;++n)l=function(t,e,i,s){let a=t.skip?e:t,n=i.skip?e:i,r=tv(e,a),o=tv(n,e),l=r/(r+o),h=o/(r+o);l=isNaN(l)?0:l,h=isNaN(h)?0:h;let d=s*l,c=s*h;return{previous:{x:e.x-d*(n.x-a.x),y:e.y-d*(n.y-a.y)},next:{x:e.x+c*(n.x-a.x),y:e.y+c*(n.y-a.y)}}}(i,o=t[n],t[Math.min(n+1,r-(s?0:1))%r],e.tension),o.cp1x=l.previous.x,o.cp1y=l.previous.y,o.cp2x=l.next.x,o.cp2y=l.next.y,i=o}e.capBezierPoints&&function(t,e){let i,s,a,n,r;let o=eF(t[0],e);for(i=0,s=t.length;i<s;++i)r=n,n=o,o=i<s-1&&eF(t[i+1],e),n&&(a=t[i],r&&(a.cp1x=ir(a.cp1x,e.left,e.right),a.cp1y=ir(a.cp1y,e.top,e.bottom)),o&&(a.cp2x=ir(a.cp2x,e.left,e.right),a.cp2y=ir(a.cp2y,e.top,e.bottom)))}(t,i)}(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=function(t,e){let i=t.points,s=t.options.spanGaps,a=i.length;if(!a)return[];let n=!!t._loop,{start:r,end:o}=function(t,e,i,s){let a=0,n=e-1;if(i&&!s)for(;a<e&&!t[a].skip;)a++;for(;a<e&&t[a].skip;)a++;for(a%=e,i&&(n+=a);n>a&&t[n%e].skip;)n--;return{start:a,end:n%=e}}(i,a,n,s);if(!0===s)return iL(t,[{start:r,end:o,loop:n}],i,e);let l=o<r?o+a:o,h=!!t._fullLoop&&0===r&&o===a-1;return iL(t,function(t,e,i,s){let a;let n=t.length,r=[],o=e,l=t[e];for(a=e+1;a<=i;++a){let i=t[a%n];i.skip||i.stop?l.skip||(s=!1,r.push({start:e%n,end:(a-1)%n,loop:s}),e=o=i.stop?a:null):(o=a,l.skip&&(e=a)),l=i}return null!==o&&r.push({start:e%n,end:o%n,loop:s}),r}(i,r,l,h),i,e)}(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,s;let a=this.options,n=t[e],r=this.points,o=iC(this,{property:e,start:n,end:n});if(!o.length)return;let l=[],h=a.stepped?iv:a.tension||"monotone"===a.cubicInterpolationMode?iM:iy;for(i=0,s=o.length;i<s;++i){let{start:s,end:d}=o[i],c=r[s],u=r[d];if(c===u){l.push(c);continue}let f=Math.abs((n-c[e])/(u[e]-c[e])),g=h(c,u,f,a.stepped);g[e]=t[e],l.push(g)}return 1===l.length?l[0]:l}pathSegment(t,e,i){return ar(this)(t,this,e,i)}path(t,e,i){let s=this.segments,a=ar(this),n=this._loop;for(let r of(e=e||0,i=i||this.points.length-e,s))n&=a(t,this,r,{start:e,end:e+i-1});return!!n}draw(t,e,i,s){let a=this.options||{};(this.points||[]).length&&a.borderWidth&&(t.save(),function(t,e,i,s){if(ao&&!e.options.segment){let a;(a=e._path)||(a=e._path=new Path2D,e.path(a,i,s)&&a.closePath()),ae(t,e.options),t.stroke(a)}else!function(t,e,i,s){let{segments:a,options:n}=e,r=ar(e);for(let o of a)ae(t,n,o.style),t.beginPath(),r(t,e,o,{start:i,end:i+s-1})&&t.closePath(),t.stroke()}(t,e,i,s)}(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function ah(t,e,i,s){let a=t.options,{[i]:n}=t.getProps([i],s);return Math.abs(e-n)<a.radius+a.hitRadius}function ad(t,e){let i,s,a,n,r;let{x:o,y:l,base:h,width:d,height:c}=t.getProps(["x","y","base","width","height"],e);return t.horizontal?(r=c/2,i=Math.min(o,h),s=Math.max(o,h),a=l-r,n=l+r):(i=o-(r=d/2),s=o+r,a=Math.min(l,h),n=Math.max(l,h)),{left:i,top:a,right:s,bottom:n}}function ac(t,e,i,s){return t?0:tS(e,i,s)}function au(t,e,i,s){let a=null===e,n=null===i,r=t&&!(a&&n)&&ad(t,s);return r&&(a||tD(e,r.left,r.right))&&(n||tD(i,r.top,r.bottom))}function af(t,e){t.rect(e.x,e.y,e.w,e.h)}function ag(t,e,i={}){let s=t.x!==i.x?-e:0,a=t.y!==i.y?-e:0,n=(t.x+t.w!==i.x+i.w?e:0)-s,r=(t.y+t.h!==i.y+i.h?e:0)-a;return{x:t.x+s,y:t.y+a,w:t.w+n,h:t.h+r,radius:t.radius}}var ap=Object.freeze({__proto__:null,ArcElement:class extends sP{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){let{angle:s,distance:a}=ty(this.getProps(["x","y"],i),{x:t,y:e}),{startAngle:n,endAngle:r,innerRadius:o,outerRadius:l,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=(this.options.spacing+this.options.borderWidth)/2,c=W(h,r-n)>=tn||tk(s,n,r),u=tD(a,o+d,l+d);return c&&u}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,d=(n+r+l+o)/2;return{x:e+Math.cos(h)*d,y:i+Math.sin(h)*d}}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="inner"===e.borderAlign?.33:0,this.fullCircles=i>tn?Math.floor(i/tn):0,0===i||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=s*(1-Math.sin(Math.min(ta,i||0)));t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,i,s,a){let{fullCircles:n,startAngle:r,circumference:o}=e,l=e.endAngle;if(n){at(t,e,i,s,l,a);for(let e=0;e<n;++e)t.fill();isNaN(o)||(l=r+(o%tn||tn))}at(t,e,i,s,l,a),t.fill()}(t,this,o,a,n),function(t,e,i,s,a){let{fullCircles:n,startAngle:r,circumference:o,options:l}=e,{borderWidth:h,borderJoinStyle:d,borderDash:c,borderDashOffset:u}=l,f="inner"===l.borderAlign;if(!h)return;t.setLineDash(c||[]),t.lineDashOffset=u,f?(t.lineWidth=2*h,t.lineJoin=d||"round"):(t.lineWidth=h,t.lineJoin=d||"bevel");let g=e.endAngle;if(n){at(t,e,i,s,g,a);for(let e=0;e<n;++e)t.stroke();isNaN(o)||(g=r+(o%tn||tn))}f&&function(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+th,s-th),t.closePath(),t.clip()}(t,e,g),n||(at(t,e,i,s,g,a),t.stroke())}(t,this,o,a,n),t.restore()}},BarElement:class extends sP{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){var e;let{inflateAmount:i,options:{borderColor:s,backgroundColor:a}}=this,{inner:n,outer:r}=function(t){let e=ad(t),i=e.right-e.left,s=e.bottom-e.top,a=function(t,e,i){let s=t.options.borderWidth,a=t.borderSkipped,n=eq(s);return{t:ac(a.top,n.top,0,i),r:ac(a.right,n.right,0,e),b:ac(a.bottom,n.bottom,0,i),l:ac(a.left,n.left,0,e)}}(t,i/2,s/2),n=function(t,e,i){let{enableBorderRadius:s}=t.getProps(["enableBorderRadius"]),a=t.options.borderRadius,n=eZ(a),r=Math.min(e,i),o=t.borderSkipped,l=s||F(a);return{topLeft:ac(!l||o.top||o.left,n.topLeft,0,r),topRight:ac(!l||o.top||o.right,n.topRight,0,r),bottomLeft:ac(!l||o.bottom||o.left,n.bottomLeft,0,r),bottomRight:ac(!l||o.bottom||o.right,n.bottomRight,0,r)}}(t,i/2,s/2);return{outer:{x:e.left,y:e.top,w:i,h:s,radius:n},inner:{x:e.left+a.l,y:e.top+a.t,w:i-a.l-a.r,h:s-a.t-a.b,radius:{topLeft:Math.max(0,n.topLeft-Math.max(a.t,a.l)),topRight:Math.max(0,n.topRight-Math.max(a.t,a.r)),bottomLeft:Math.max(0,n.bottomLeft-Math.max(a.b,a.l)),bottomRight:Math.max(0,n.bottomRight-Math.max(a.b,a.r))}}}}(this),o=(e=r.radius).topLeft||e.topRight||e.bottomLeft||e.bottomRight?eN:af;t.save(),(r.w!==n.w||r.h!==n.h)&&(t.beginPath(),o(t,ag(r,i,n)),t.clip(),o(t,ag(n,-i,r)),t.fillStyle=s,t.fill("evenodd")),t.beginPath(),o(t,ag(n,i)),t.fillStyle=a,t.fill(),t.restore()}inRange(t,e,i){return au(this,t,e,i)}inXRange(t,e){return au(this,t,null,e)}inYRange(t,e){return au(this,null,t,e)}getCenterPoint(t){let{x:e,y:i,base:s,horizontal:a}=this.getProps(["x","y","base","horizontal"],t);return{x:a?(e+s)/2:e,y:a?i:(i+s)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}},LineElement:al,PointElement:class extends sP{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){let s=this.options,{x:a,y:n}=this.getProps(["x","y"],i);return Math.pow(t-a,2)+Math.pow(e-n,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return ah(this,t,"x",e)}inYRange(t,e){return ah(this,t,"y",e)}getCenterPoint(t){let{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0,i=(e=Math.max(e,e&&t.hoverRadius||0))&&t.borderWidth||0;return(e+i)*2}draw(t,e){let i=this.options;!this.skip&&!(i.radius<.1)&&eF(this,e,this.size(i)/2)&&(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,eI(t,i,this.x,this.y))}getRange(){let t=this.options||{};return t.radius+t.hitRadius}}});let am=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],ab=am.map(t=>t.replace("rgb(","rgba(").replace(")",", 0.5)"));function ax(t){return am[t%am.length]}function a_(t){return ab[t%ab.length]}function ay(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}function av(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})}}function aM(t){t.data.datasets.forEach(t=>{av(t)})}function aw(t,e,i,s){if(s)return;let a=e[t],n=i[t];return"angle"===t&&(a=tw(a),n=tw(n)),{property:t,start:a,end:n}}function ak(t,e,i){for(;e>t;e--){let t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function aS(t,e,i,s){return t&&e?s(t[i],e[i]):t?t[i]:e?e[i]:0}function aD(t,e){let i=[],s=!1;return z(t)?(s=!0,i=t):i=function(t,e){let{x:i=null,y:s=null}=t||{},a=e.points,n=[];return e.segments.forEach(({start:t,end:e})=>{e=ak(t,e,a);let r=a[t],o=a[e];null!==s?(n.push({x:r.x,y:s}),n.push({x:o.x,y:s})):null!==i&&(n.push({x:i,y:r.y}),n.push({x:i,y:o.y}))}),n}(t,e),i.length?new al({points:i,options:{tension:0},_loop:s,_fullLoop:s}):null}function aP(t){return t&&!1!==t.fill}class aO{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){let{x:s,y:a,radius:n}=this;return e=e||{start:0,end:tn},t.arc(s,a,n,e.end,e.start,!0),!i.bounds}interpolate(t){let{x:e,y:i,radius:s}=this,a=t.angle;return{x:e+Math.cos(a)*s,y:i+Math.sin(a)*s,angle:a}}}function aC(t,e,i){let s=function(t){let{chart:e,fill:i,line:s}=t;if(V(i))return function(t,e){let i=t.getDatasetMeta(e);return i&&t.isDatasetVisible(e)?i.dataset:null}(e,i);if("stack"===i)return function(t){let{scale:e,index:i,line:s}=t,a=[],n=s.segments,r=s.points,o=function(t,e){let i=[],s=t.getMatchingVisibleMetas("line");for(let t=0;t<s.length;t++){let a=s[t];if(a.index===e)break;a.hidden||i.unshift(a.dataset)}return i}(e,i);o.push(aD({x:null,y:e.bottom},s));for(let t=0;t<n.length;t++){let e=n[t];for(let t=e.start;t<=e.end;t++)!function(t,e,i){let s=[];for(let a=0;a<i.length;a++){let{first:n,last:r,point:o}=function(t,e,i){let s=t.interpolate(e,i);if(!s)return{};let a=s[i],n=t.segments,r=t.points,o=!1,l=!1;for(let t=0;t<n.length;t++){let e=n[t],s=r[e.start][i],h=r[e.end][i];if(tD(a,s,h)){o=a===s,l=a===h;break}}return{first:o,last:l,point:s}}(i[a],e,"x");if(o&&(!n||!r)){if(n)s.unshift(o);else if(t.push(o),!r)break}}t.push(...s)}(a,r[t],o)}return new al({points:a,options:{}})}(t);if("shape"===i)return!0;let a=(t.scale||{}).getPointPositionForValue?function(t){let{scale:e,fill:i}=t,s=e.options,a=e.getLabels().length,n=s.reverse?e.max:e.min,r="start"===i?n:"end"===i?e.options.reverse?e.min:e.max:F(i)?i.value:e.getBaseValue(),o=[];if(s.grid.circular){let t=e.getPointPositionForValue(0,n);return new aO({x:t.x,y:t.y,radius:e.getDistanceFromCenterForValue(r)})}for(let t=0;t<a;++t)o.push(e.getPointPositionForValue(t,r));return o}(t):function(t){let e;let{scale:i={},fill:s}=t,a=(e=null,"start"===s?e=i.bottom:"end"===s?e=i.top:F(s)?e=i.getPixelForValue(s.value):i.getBasePixel&&(e=i.getBasePixel()),e);if(V(a)){let t=i.isHorizontal();return{x:t?a:null,y:t?null:a}}return null}(t);return a instanceof aO?a:aD(a,s)}(e),{line:a,scale:n,axis:r}=e,o=a.options,l=o.fill,h=o.backgroundColor,{above:d=h,below:c=h}=l||{};s&&a.points.length&&(eV(t,i),function(t,e){let{line:i,target:s,above:a,below:n,area:r,scale:o}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&n!==a&&(aL(t,s,r.top),aT(t,{line:i,target:s,color:a,scale:o,property:l}),t.restore(),t.save(),aL(t,s,r.bottom)),aT(t,{line:i,target:s,color:n,scale:o,property:l}),t.restore()}(t,{line:a,target:s,above:d,below:c,area:i,scale:n,axis:r}),e$(t))}function aL(t,e,i){let{segments:s,points:a}=e,n=!0,r=!1;for(let o of(t.beginPath(),s)){let{start:s,end:l}=o,h=a[s],d=a[ak(s,l,a)];n?(t.moveTo(h.x,h.y),n=!1):(t.lineTo(h.x,i),t.lineTo(h.x,h.y)),(r=!!e.pathSegment(t,o,{move:r}))?t.closePath():t.lineTo(d.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function aT(t,e){let{line:i,target:s,property:a,color:n,scale:r}=e;for(let{source:e,target:o,start:l,end:h}of function(t,e,i){let s=t.segments,a=t.points,n=e.points,r=[];for(let t of s){let{start:s,end:o}=t;o=ak(s,o,a);let l=aw(i,a[s],a[o],t.loop);if(!e.segments){r.push({source:t,target:l,start:a[s],end:a[o]});continue}for(let s of iC(e,l)){let e=aw(i,n[s.start],n[s.end],s.loop);for(let n of iO(t,a,e))r.push({source:n,target:s,start:{[i]:aS(l,e,"start",Math.max)},end:{[i]:aS(l,e,"end",Math.min)}})}}return r}(i,s,a)){let d;let{style:{backgroundColor:c=n}={}}=e,u=!0!==s;t.save(),t.fillStyle=c,function(t,e,i){let{top:s,bottom:a}=e.chart.chartArea,{property:n,start:r,end:o}=i||{};"x"===n&&(t.beginPath(),t.rect(r,s,o-r,a-s),t.clip())}(t,r,u&&aw(a,l,h)),t.beginPath();let f=!!i.pathSegment(t,e);if(u){f?t.closePath():aA(t,s,h,a);let e=!!s.pathSegment(t,o,{move:f,reverse:!0});(d=f&&e)||aA(t,s,l,a)}t.closePath(),t.fill(d?"evenodd":"nonzero"),t.restore()}}function aA(t,e,i,s){let a=e.interpolate(i,s);a&&t.lineTo(a.x,a.y)}let aE=(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)}},aR=(t,e)=>null!==t&&null!==e&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class aI extends sP{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=N(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(e=>t.filter(e,this.chart.data))),t.sort&&(e=e.sort((e,i)=>t.sort(e,i,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){let t,e;let{options:i,ctx:s}=this;if(!i.display){this.width=this.height=0;return}let a=i.labels,n=eK(a.font),r=n.size,o=this._computeTitleHeight(),{boxWidth:l,itemHeight:h}=aE(a,r);s.font=n.string,this.isHorizontal()?(t=this.maxWidth,e=this._fitRows(o,r,l,h)+10):(e=this.maxHeight,t=this._fitCols(o,n,l,h)+10),this.width=Math.min(t,i.maxWidth||this.maxWidth),this.height=Math.min(e,i.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,d=t;a.textAlign="left",a.textBaseline="middle";let c=-1,u=-h;return this.legendItems.forEach((t,f)=>{let g=i+e/2+a.measureText(t.text).width;(0===f||l[l.length-1]+g+2*r>n)&&(d+=h,l[l.length-(f>0?0:1)]=0,u+=h,c++),o[f]={left:0,top:u,row:c,width:g,height:s},l[l.length-1]+=g+r}),d}_fitCols(t,e,i,s){let{ctx:a,maxHeight:n,options:{labels:{padding:r}}}=this,o=this.legendHitBoxes=[],l=this.columnSizes=[],h=n-t,d=r,c=0,u=0,f=0,g=0;return this.legendItems.forEach((t,n)=>{var p;let m,b;let{itemWidth:x,itemHeight:_}={itemWidth:((m=t.text)&&"string"!=typeof m&&(m=m.reduce((t,e)=>t.length>e.length?t:e)),i+e.size/2+a.measureText(m).width),itemHeight:(p=e.lineHeight,b=s,"string"!=typeof t.text&&(b=az(t,p)),b)};n>0&&u+_+2*r>h&&(d+=c+r,l.push({width:c,height:u}),f+=c+r,g++,c=u=0),o[n]={left:f,top:u,col:g,width:x,height:_},c=Math.max(c,x),u+=_+r}),d+=c,l.push({width:c,height:u}),d}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:a}}=this,n=iw(a,this.left,this.width);if(this.isHorizontal()){let a=0,r=tz(i,this.left+s,this.right-this.lineWidths[a]);for(let o of e)a!==o.row&&(a=o.row,r=tz(i,this.left+s,this.right-this.lineWidths[a])),o.top+=this.top+t+s,o.left=n.leftForLtr(n.x(r),o.width),r+=o.width+s}else{let a=0,r=tz(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(let o of e)o.col!==a&&(a=o.col,r=tz(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),o.top=r,o.left+=this.left+s,o.left=n.leftForLtr(n.x(o.left),o.width),r+=o.height+s}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){let t=this.ctx;eV(t,this),this._draw(),e$(t)}}_draw(){let t;let{options:e,columnSizes:i,lineWidths:s,ctx:a}=this,{align:n,labels:r}=e,o=eT.color,l=iw(e.rtl,this.left,this.width),h=eK(r.font),{padding:d}=r,c=h.size,u=c/2;this.drawTitle(),a.textAlign=l.textAlign("left"),a.textBaseline="middle",a.lineWidth=.5,a.font=h.string;let{boxWidth:f,boxHeight:g,itemHeight:p}=aE(r,c),m=function(t,e,i){if(isNaN(f)||f<=0||isNaN(g)||g<0)return;a.save();let s=W(i.lineWidth,1);if(a.fillStyle=W(i.fillStyle,o),a.lineCap=W(i.lineCap,"butt"),a.lineDashOffset=W(i.lineDashOffset,0),a.lineJoin=W(i.lineJoin,"miter"),a.lineWidth=s,a.strokeStyle=W(i.strokeStyle,o),a.setLineDash(W(i.lineDash,[])),r.usePointStyle)ez(a,{radius:g*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:s},l.xPlus(t,f/2),e+u,r.pointStyleWidth&&f);else{let n=e+Math.max((c-g)/2,0),r=l.leftForLtr(t,f),o=eZ(i.borderRadius);a.beginPath(),Object.values(o).some(t=>0!==t)?eN(a,{x:r,y:n,w:f,h:g,radius:o}):a.rect(r,n,f,g),a.fill(),0!==s&&a.stroke()}a.restore()},b=function(t,e,i){eH(a,i.text,t,e+p/2,h,{strikethrough:i.hidden,textAlign:l.textAlign(i.textAlign)})},x=this.isHorizontal(),_=this._computeTitleHeight();t=x?{x:tz(n,this.left+d,this.right-s[0]),y:this.top+d+_,line:0}:{x:this.left+d,y:tz(n,this.top+_+d,this.bottom-i[0].height),line:0},ik(this.ctx,e.textDirection);let y=p+d;this.legendItems.forEach((o,c)=>{a.strokeStyle=o.fontColor,a.fillStyle=o.fontColor;let g=a.measureText(o.text).width,p=l.textAlign(o.textAlign||(o.textAlign=r.textAlign)),v=f+u+g,M=t.x,w=t.y;if(l.setWidth(this.width),x?c>0&&M+v+d>this.right&&(w=t.y+=y,t.line++,M=t.x=tz(n,this.left+d,this.right-s[t.line])):c>0&&w+y>this.bottom&&(M=t.x=M+i[t.line].width+d,t.line++,w=t.y=tz(n,this.top+_+d,this.bottom-i[t.line].height)),m(l.x(M),w,o),M=tF(p,M+f+u,x?M+v:this.right,e.rtl),b(l.x(M),w,o),x)t.x+=v+d;else if("string"!=typeof o.text){let e=h.lineHeight;t.y+=az(o,e)+d}else t.y+=y}),iS(this.ctx,e.textDirection)}drawTitle(){let t;let e=this.options,i=e.title,s=eK(i.font),a=eG(i.padding);if(!i.display)return;let n=iw(e.rtl,this.left,this.width),r=this.ctx,o=i.position,l=s.size/2,h=a.top+l,d=this.left,c=this.width;if(this.isHorizontal())c=Math.max(...this.lineWidths),t=this.top+h,d=tz(e.align,d,this.right-c);else{let i=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);t=h+tz(e.align,this.top,this.bottom-i-e.labels.padding-this._computeTitleHeight())}let u=tz(o,d,d+c);r.textAlign=n.textAlign(tI(o)),r.textBaseline="middle",r.strokeStyle=i.color,r.fillStyle=i.color,r.font=s.string,eH(r,i.text,u,t,s)}_computeTitleHeight(){let t=this.options.title,e=eK(t.font),i=eG(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,a;if(tD(t,this.left,this.right)&&tD(e,this.top,this.bottom)){for(i=0,a=this.legendHitBoxes;i<a.length;++i)if(tD(t,(s=a[i]).left,s.left+s.width)&&tD(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){var e;let i=this.options;if(("mousemove"!==(e=t.type)&&"mouseout"!==e||!i.onHover&&!i.onLeave)&&(!i.onClick||"click"!==e&&"mouseup"!==e))return;let s=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){let e=this._hoveredItem,a=aR(e,s);e&&!a&&N(i.onLeave,[t,e,this],this),this._hoveredItem=s,s&&!a&&N(i.onHover,[t,s,this],this)}else s&&N(i.onClick,[t,s,this],this)}}function az(t,e){return e*(t.text?t.text.length:0)}class aF extends sP{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=z(i.text)?i.text.length:1;this._padding=eG(i.padding);let a=s*eK(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=a:this.width=a}isHorizontal(){let t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){let e,i,s;let{top:a,left:n,bottom:r,right:o,options:l}=this,h=l.align,d=0;return this.isHorizontal()?(i=tz(h,n,o),s=a+t,e=o-n):("left"===l.position?(i=n+t,s=tz(h,r,a),d=-.5*ta):(i=o-t,s=tz(h,a,r),d=.5*ta),e=r-a),{titleX:i,titleY:s,maxWidth:e,rotation:d}}draw(){let t=this.ctx,e=this.options;if(!e.display)return;let i=eK(e.font),s=i.lineHeight/2+this._padding.top,{titleX:a,titleY:n,maxWidth:r,rotation:o}=this._drawArgs(s);eH(t,e.text,0,0,i,{color:e.color,maxWidth:r,rotation:o,textAlign:tI(e.align),textBaseline:"middle",translation:[a,n]})}}let aV=new WeakMap,a$={average(t){let e,i;if(!t.length)return!1;let s=new Set,a=0,n=0;for(e=0,i=t.length;e<i;++e){let i=t[e].element;if(i&&i.hasValue()){let t=i.tooltipPosition();s.add(t.x),a+=t.y,++n}}return{x:[...s].reduce((t,e)=>t+e)/s.size,y:a/n}},nearest(t,e){let i,s,a;if(!t.length)return!1;let n=e.x,r=e.y,o=Number.POSITIVE_INFINITY;for(i=0,s=t.length;i<s;++i){let s=t[i].element;if(s&&s.hasValue()){let t=tv(e,s.getCenterPoint());t<o&&(o=t,a=s)}}if(a){let t=a.tooltipPosition();n=t.x,r=t.y}return{x:n,y:r}}};function aW(t,e){return e&&(z(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function aB(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function aH(t,e){let i=t.chart.ctx,{body:s,footer:a,title:n}=t,{boxWidth:r,boxHeight:o}=e,l=eK(e.bodyFont),h=eK(e.titleFont),d=eK(e.footerFont),c=n.length,u=a.length,f=s.length,g=eG(e.padding),p=g.height,m=0,b=s.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);b+=t.beforeBody.length+t.afterBody.length,c&&(p+=c*h.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),b&&(p+=f*(e.displayColors?Math.max(o,l.lineHeight):l.lineHeight)+(b-f)*l.lineHeight+(b-1)*e.bodySpacing),u&&(p+=e.footerMarginTop+u*d.lineHeight+(u-1)*e.footerSpacing);let x=0,_=function(t){m=Math.max(m,i.measureText(t).width+x)};return i.save(),i.font=h.string,Y(t.title,_),i.font=l.string,Y(t.beforeBody.concat(t.afterBody),_),x=e.displayColors?r+2+e.boxPadding:0,Y(s,t=>{Y(t.before,_),Y(t.lines,_),Y(t.after,_)}),x=0,i.font=d.string,Y(t.footer,_),i.restore(),{width:m+=g.width,height:p}}function aN(t,e,i){let s=i.yAlign||e.yAlign||function(t,e){let{y:i,height:s}=e;return i<s/2?"top":i>t.height-s/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||function(t,e,i,s){let{x:a,width:n}=i,{width:r,chartArea:{left:o,right:l}}=t,h="center";return"center"===s?h=a<=(o+l)/2?"left":"right":a<=n/2?h="left":a>=r-n/2&&(h="right"),function(t,e,i,s){let{x:a,width:n}=s,r=i.caretSize+i.caretPadding;if("left"===t&&a+n+r>e.width||"right"===t&&a-n-r<0)return!0}(h,t,e,i)&&(h="center"),h}(t,e,i,s),yAlign:s}}function aY(t,e,i,s){let{caretSize:a,caretPadding:n,cornerRadius:r}=t,{xAlign:o,yAlign:l}=i,h=a+n,{topLeft:d,topRight:c,bottomLeft:u,bottomRight:f}=eZ(r),g=function(t,e){let{x:i,width:s}=t;return"right"===e?i-=s:"center"===e&&(i-=s/2),i}(e,o),p=function(t,e,i){let{y:s,height:a}=t;return"top"===e?s+=i:"bottom"===e?s-=a+i:s-=a/2,s}(e,l,h);return"center"===l?"left"===o?g+=h:"right"===o&&(g-=h):"left"===o?g-=Math.max(d,u)+a:"right"===o&&(g+=Math.max(c,f)+a),{x:tS(g,0,s.width-e.width),y:tS(p,0,s.height-e.height)}}function aj(t,e,i){let s=eG(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-s.right:t.x+s.left}function aU(t,e){let i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}let aX={beforeTitle:E,title(t){if(t.length>0){let e=t[0],i=e.chart.data.labels,s=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex<s)return i[e.dataIndex]}return""},afterTitle:E,beforeBody:E,beforeLabel:E,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");let i=t.formattedValue;return I(i)||(e+=i),e},labelColor(t){let e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){let e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:E,afterBody:E,beforeFooter:E,footer:E,afterFooter:E};function aq(t,e,i,s){let a=t[e].call(i,s);return void 0===a?aX[e].call(i,s):a}class aZ extends sP{static positioners=a$;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 iz(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=eQ(this.chart.getContext(),{tooltip:this,tooltipItems:this._tooltipItems,type:"tooltip"}))}getTitle(t,e){let{callbacks:i}=e,s=aq(i,"beforeTitle",this,t),a=aq(i,"title",this,t),n=aq(i,"afterTitle",this,t),r=[];return r=aW(r,aB(s)),r=aW(r,aB(a)),r=aW(r,aB(n))}getBeforeBody(t,e){return aW([],aB(aq(e.callbacks,"beforeBody",this,t)))}getBody(t,e){let{callbacks:i}=e,s=[];return Y(t,t=>{let e={before:[],lines:[],after:[]},a=aU(i,t);aW(e.before,aB(aq(a,"beforeLabel",this,t))),aW(e.lines,aq(a,"label",this,t)),aW(e.after,aB(aq(a,"afterLabel",this,t))),s.push(e)}),s}getAfterBody(t,e){return aW([],aB(aq(e.callbacks,"afterBody",this,t)))}getFooter(t,e){let{callbacks:i}=e,s=aq(i,"beforeFooter",this,t),a=aq(i,"footer",this,t),n=aq(i,"afterFooter",this,t),r=[];return r=aW(r,aB(s)),r=aW(r,aB(a)),r=aW(r,aB(n))}_createItems(t){let e,i;let s=this._active,a=this.chart.data,n=[],r=[],o=[],l=[];for(e=0,i=s.length;e<i;++e)l.push(function(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}}(this.chart,s[e]));return t.filter&&(l=l.filter((e,i,s)=>t.filter(e,i,s,a))),t.itemSort&&(l=l.sort((e,i)=>t.itemSort(e,i,a))),Y(l,e=>{let i=aU(t.callbacks,e);n.push(aq(i,"labelColor",this,e)),r.push(aq(i,"labelPointStyle",this,e)),o.push(aq(i,"labelTextColor",this,e))}),this.labelColors=n,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=l,l}update(t,e){let i;let s=this.options.setContext(this.getContext()),a=this._active,n=[];if(a.length){let t=a$[s.position].call(this,a,this._eventPosition);n=this._createItems(s),this.title=this.getTitle(n,s),this.beforeBody=this.getBeforeBody(n,s),this.body=this.getBody(n,s),this.afterBody=this.getAfterBody(n,s),this.footer=this.getFooter(n,s);let e=this._size=aH(this,s),r=Object.assign({},t,e),o=aN(this.chart,s,r),l=aY(s,r,o,this.chart);this.xAlign=o.xAlign,this.yAlign=o.yAlign,i={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(i={opacity:0});this._tooltipItems=n,this.$context=void 0,i&&this._resolveAnimations().update(this,i),t&&s.external&&s.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 s,a,n,r,o,l;let{xAlign:h,yAlign:d}=this,{caretSize:c,cornerRadius:u}=i,{topLeft:f,topRight:g,bottomLeft:p,bottomRight:m}=eZ(u),{x:b,y:x}=t,{width:_,height:y}=e;return"center"===d?(o=x+y/2,"left"===h?(a=(s=b)-c,r=o+c,l=o-c):(a=(s=b+_)+c,r=o-c,l=o+c),n=s):(a="left"===h?b+Math.max(f,p)+c:"right"===h?b+_-Math.max(g,m)-c:this.caretX,"top"===d?(o=(r=x)-c,s=a-c,n=a+c):(o=(r=x+y)+c,s=a+c,n=a-c),l=r),{x1:s,x2:a,x3:n,y1:r,y2:o,y3:l}}drawTitle(t,e,i){let s,a,n;let r=this.title,o=r.length;if(o){let l=iw(i.rtl,this.x,this.width);for(n=0,t.x=aj(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",s=eK(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=s.string;n<o;++n)e.fillText(r[n],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+a,n+1===o&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,s,a){let n=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:o,boxWidth:l}=a,h=eK(a.bodyFont),d=aj(this,"left",a),c=s.x(d),u=o<h.lineHeight?(h.lineHeight-o)/2:0,f=e.y+u;if(a.usePointStyle){let e={radius:Math.min(l,o)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},i=s.leftForLtr(c,l)+l/2,h=f+o/2;t.strokeStyle=a.multiKeyBackground,t.fillStyle=a.multiKeyBackground,eI(t,e,i,h),t.strokeStyle=n.borderColor,t.fillStyle=n.backgroundColor,eI(t,e,i,h)}else{t.lineWidth=F(n.borderWidth)?Math.max(...Object.values(n.borderWidth)):n.borderWidth||1,t.strokeStyle=n.borderColor,t.setLineDash(n.borderDash||[]),t.lineDashOffset=n.borderDashOffset||0;let e=s.leftForLtr(c,l),i=s.leftForLtr(s.xPlus(c,1),l-2),r=eZ(n.borderRadius);Object.values(r).some(t=>0!==t)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,eN(t,{x:e,y:f,w:l,h:o,radius:r}),t.fill(),t.stroke(),t.fillStyle=n.backgroundColor,t.beginPath(),eN(t,{x:i,y:f+1,w:l-2,h:o-2,radius:r}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(e,f,l,o),t.strokeRect(e,f,l,o),t.fillStyle=n.backgroundColor,t.fillRect(i,f+1,l-2,o-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){let s,a,n,r,o,l,h;let{body:d}=this,{bodySpacing:c,bodyAlign:u,displayColors:f,boxHeight:g,boxWidth:p,boxPadding:m}=i,b=eK(i.bodyFont),x=b.lineHeight,_=0,y=iw(i.rtl,this.x,this.width),v=function(i){e.fillText(i,y.x(t.x+_),t.y+x/2),t.y+=x+c},M=y.textAlign(u);for(e.textAlign=u,e.textBaseline="middle",e.font=b.string,t.x=aj(this,M,i),e.fillStyle=i.bodyColor,Y(this.beforeBody,v),_=f&&"right"!==M?"center"===u?p/2+m:p+2+m:0,r=0,l=d.length;r<l;++r){for(s=d[r],a=this.labelTextColors[r],e.fillStyle=a,Y(s.before,v),n=s.lines,f&&n.length&&(this._drawColorBox(e,t,r,y,i),x=Math.max(b.lineHeight,g)),o=0,h=n.length;o<h;++o)v(n[o]),x=b.lineHeight;Y(s.after,v)}_=0,x=b.lineHeight,Y(this.afterBody,v),t.y-=c}drawFooter(t,e,i){let s,a;let n=this.footer,r=n.length;if(r){let o=iw(i.rtl,this.x,this.width);for(t.x=aj(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=o.textAlign(i.footerAlign),e.textBaseline="middle",s=eK(i.footerFont),e.fillStyle=i.footerColor,e.font=s.string,a=0;a<r;++a)e.fillText(n[a],o.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){let{xAlign:a,yAlign:n}=this,{x:r,y:o}=t,{width:l,height:h}=i,{topLeft:d,topRight:c,bottomLeft:u,bottomRight:f}=eZ(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(r+d,o),"top"===n&&this.drawCaret(t,e,i,s),e.lineTo(r+l-c,o),e.quadraticCurveTo(r+l,o,r+l,o+c),"center"===n&&"right"===a&&this.drawCaret(t,e,i,s),e.lineTo(r+l,o+h-f),e.quadraticCurveTo(r+l,o+h,r+l-f,o+h),"bottom"===n&&this.drawCaret(t,e,i,s),e.lineTo(r+u,o+h),e.quadraticCurveTo(r,o+h,r,o+h-u),"center"===n&&"left"===a&&this.drawCaret(t,e,i,s),e.lineTo(r,o+d),e.quadraticCurveTo(r,o,r+d,o),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){let e=this.chart,i=this.$animations,s=i&&i.x,a=i&&i.y;if(s||a){let i=a$[t.position].call(this,this._active,this._eventPosition);if(!i)return;let n=this._size=aH(this,t),r=Object.assign({},i,this._size),o=aN(e,t,r),l=aY(t,r,o,e);(s._to!==l.x||a._to!==l.y)&&(this.xAlign=o.xAlign,this.yAlign=o.yAlign,this.width=n.width,this.height=n.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_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=.001>Math.abs(i)?0:i;let n=eG(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),ik(t,e.textDirection),a.y+=n.top,this.drawTitle(a,t,e),this.drawBody(a,t,e),this.drawFooter(a,t,e),iS(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){let i=this._active,s=t.map(({datasetIndex:t,index:e})=>{let i=this.chart.getDatasetMeta(t);if(!i)throw Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),a=!j(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||!j(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("mouseout"===t.type)return[];if(!s)return e.filter(t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index));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=a$[a.position].call(this,t,e);return!1!==n&&(i!==n.x||s!==n.y)}}var aG=Object.freeze({__proto__:null,Colors:{id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,i){let s;if(!i.enabled)return;let{data:{datasets:a},options:n}=t.config,{elements:r}=n;if(!i.forceOverride&&(ay(a)||n&&(n.borderColor||n.backgroundColor)||r&&ay(r)))return;let o=(s=0,(e,i)=>{var a,n,r;let o=t.getDatasetMeta(i).controller;o instanceof i0?(a=s,e.backgroundColor=e.data.map(()=>ax(a++)),s=a):o instanceof i1?(n=s,e.backgroundColor=e.data.map(()=>a_(n++)),s=n):o&&(r=s,e.borderColor=ax(r),e.backgroundColor=a_(r),s=++r)});a.forEach(o)}},Decimation:{id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled){aM(t);return}let s=t.width;t.data.datasets.forEach((e,a)=>{let n;let{_data:r,indexAxis:o}=e,l=t.getDatasetMeta(a),h=r||e.data;if("y"===eJ([o,t.options.indexAxis])||!l.controller.supportsDecimation)return;let d=t.scales[l.xAxisID];if("linear"!==d.type&&"time"!==d.type||t.options.parsing)return;let{start:c,count:u}=function(t,e){let i;let s=e.length,a=0,{iScale:n}=t,{min:r,max:o,minDefined:l,maxDefined:h}=n.getUserBounds();return l&&(a=tS(tO(e,n.axis,r).lo,0,s-1)),i=h?tS(tO(e,n.axis,o).hi+1,a,s)-a:s-a,{start:a,count:i}}(l,h);if(u<=(i.threshold||4*s)){av(e);return}switch(I(r)&&(e._data=h,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":n=function(t,e,i,s,a){let n,r,o,l,h;let d=a.samples||s;if(d>=i)return t.slice(e,e+i);let c=[],u=(i-2)/(d-2),f=0,g=e+i-1,p=e;for(n=0,c[f++]=t[p];n<d-2;n++){let s,a=0,d=0,g=Math.floor((n+1)*u)+1+e,m=Math.min(Math.floor((n+2)*u)+1,i)+e,b=m-g;for(s=g;s<m;s++)a+=t[s].x,d+=t[s].y;a/=b,d/=b;let x=Math.floor(n*u)+1+e,_=Math.min(Math.floor((n+1)*u)+1,i)+e,{x:y,y:v}=t[p];for(o=l=-1,s=x;s<_;s++)(l=.5*Math.abs((y-a)*(t[s].y-v)-(y-t[s].x)*(d-v)))>o&&(o=l,r=t[s],h=s);c[f++]=r,p=h}return c[f++]=t[g],c}(h,c,u,s,i);break;case"min-max":n=function(t,e,i,s){let a,n,r,o,l,h,d,c,u,f,g=0,p=0,m=[],b=t[e].x,x=t[e+i-1].x-b;for(a=e;a<e+i;++a){r=((n=t[a]).x-b)/x*s,o=n.y;let e=0|r;if(e===l)o<u?(u=o,h=a):o>f&&(f=o,d=a),g=(p*g+n.x)/++p;else{let i=a-1;if(!I(h)&&!I(d)){let e=Math.min(h,d),s=Math.max(h,d);e!==c&&e!==i&&m.push({...t[e],x:g}),s!==c&&s!==i&&m.push({...t[s],x:g})}a>0&&i!==c&&m.push(t[i]),m.push(n),l=e,p=0,u=f=o,h=d=c=a}}return m}(h,c,u,s);break;default:throw Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=n})},destroy(t){aM(t)}},Filler:{id:"filler",afterDatasetsUpdate(t,e,i){let s,a,n,r;let o=(t.data.datasets||[]).length,l=[];for(a=0;a<o;++a)n=(s=t.getDatasetMeta(a)).dataset,r=null,n&&n.options&&n instanceof al&&(r={visible:t.isDatasetVisible(a),index:a,fill:function(t,e,i){var s,a;let n=function(t){let e=t.options,i=e.fill,s=W(i&&i.target,i);return void 0===s&&(s=!!e.backgroundColor),!1!==s&&null!==s&&(!0===s?"origin":s)}(t);if(F(n))return!isNaN(n.value)&&n;let r=parseFloat(n);return V(r)&&Math.floor(r)===r?(s=n[0],a=r,("-"===s||"+"===s)&&(a=e+a),a!==e&&!(a<0)&&!(a>=i)&&a):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}(n,a,o),chart:t,axis:s.controller.options.indexAxis,scale:s.vScale,line:n}),s.$filler=r,l.push(r);for(a=0;a<o;++a)(r=l[a])&&!1!==r.fill&&(r.fill=function(t,e,i){let s;let a=t[e].fill,n=[e];if(!i)return a;for(;!1!==a&&-1===n.indexOf(a);){if(!V(a))return a;if(!(s=t[a]))break;if(s.visible)return a;n.push(a),a=s.fill}return!1}(l,a,i.propagate))},beforeDraw(t,e,i){let s="beforeDraw"===i.drawTime,a=t.getSortedVisibleDatasetMetas(),n=t.chartArea;for(let e=a.length-1;e>=0;--e){let i=a[e].$filler;i&&(i.line.updateControlPoints(n,i.axis),s&&i.fill&&aC(t.ctx,i,n))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;let s=t.getSortedVisibleDatasetMetas();for(let e=s.length-1;e>=0;--e){let i=s[e].$filler;aP(i)&&aC(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){let s=e.meta.$filler;aP(s)&&"beforeDatasetDraw"===i.drawTime&&aC(t.ctx,s,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},Legend:{id:"legend",_element:aI,start(t,e,i){let s=t.legend=new aI({ctx:t.ctx,options:i,chart:t});sd.configure(t,s,i),sd.addBox(t,s)},stop(t){sd.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){let s=t.legend;sd.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(t=>{let l=t.controller.getStyle(i?0:void 0),h=eG(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:n,hidden:!t.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:l.borderColor,pointStyle:s||l.pointStyle,rotation:l.rotation,textAlign:a||l.textAlign,borderRadius:r&&(o||l.borderRadius),datasetIndex:t.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)}}},SubTitle:{id:"subtitle",start(t,e,i){let s=new aF({ctx:t.ctx,options:i,chart:t});sd.configure(t,s,i),sd.addBox(t,s),aV.set(t,s)},stop(t){sd.removeBox(t,aV.get(t)),aV.delete(t)},beforeUpdate(t,e,i){let s=aV.get(t);sd.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}},Title:{id:"title",_element:aF,start(t,e,i){!function(t,e){let i=new aF({ctx:t.ctx,options:e,chart:t});sd.configure(t,i,e),sd.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){let e=t.titleBlock;sd.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){let s=t.titleBlock;sd.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}},Tooltip:{id:"tooltip",_element:aZ,positioners:a$,afterInit(t,e,i){i&&(t.tooltip=new aZ({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(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))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:aX},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]}});let aK=(t,e,i,s)=>("string"==typeof e?(i=t.push(e)-1,s.unshift({index:i,label:e})):isNaN(e)&&(i=null),i),aJ=(t,e)=>null===t?null:tS(Math.round(t),0,e);function aQ(t){let e=this.getLabels();return t>=0&&t<e.length?e[t]:t}function a0(t,e,{horizontal:i,minRotation:s}){let a=tx(s),n=.75*e*(""+t).length;return Math.min(e/((i?Math.sin(a):Math.cos(a))||.001),n)}class a1 extends sI{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return I(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds(),{min:s,max:a}=this,n=t=>s=e?s:t,r=t=>a=i?a:t;if(t){let t=tf(s),e=tf(a);t<0&&e<0?r(0):t>0&&e>0&&n(0)}if(s===a){let e=0===a?1:Math.abs(.05*a);r(a+e),t||n(s-e)}this.min=s,this.max=a}getTickLimit(){let t;let{maxTicksLimit:e,stepSize:i}=this.options.ticks;return i?(t=Math.ceil(this.max/i)-Math.floor(this.min/i)+1)>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${t} ticks. Limiting to 1000.`),t=1e3):(t=this.computeTickLimit(),e=e||11),e&&(t=Math.min(e,t)),t}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,e=t.ticks,i=this.getTickLimit(),s=function(t,e){let i,s,a,n;let r=[],{bounds:o,step:l,min:h,max:d,precision:c,count:u,maxTicks:f,maxDigits:g,includeBounds:p}=t,m=l||1,b=f-1,{min:x,max:_}=e,y=!I(h),v=!I(d),M=!I(u),w=(_-x)/(g+1),k=tp((_-x)/b/m)*m;if(k<1e-14&&!y&&!v)return[{value:x},{value:_}];(n=Math.ceil(_/k)-Math.floor(x/k))>b&&(k=tp(n*k/b/m)*m),I(c)||(k=Math.ceil(k*(i=Math.pow(10,c)))/i),"ticks"===o?(s=Math.floor(x/k)*k,a=Math.ceil(_/k)*k):(s=x,a=_),y&&v&&l&&function(t,e){let i=Math.round(t);return i-e<=t&&i+e>=t}((d-h)/l,k/1e3)?(n=Math.round(Math.min((d-h)/k,f)),k=(d-h)/n,s=h,a=d):M?(s=y?h:s,k=((a=v?d:a)-s)/(n=u-1)):n=tg(n=(a-s)/k,Math.round(n),k/1e3)?Math.round(n):Math.ceil(n);let S=Math.max(t_(k),t_(s));s=Math.round(s*(i=Math.pow(10,I(c)?S:c)))/i,a=Math.round(a*i)/i;let D=0;for(y&&(p&&s!==h?(r.push({value:h}),s<h&&D++,tg(Math.round((s+D*k)*i)/i,h,a0(h,w,t))&&D++):s<h&&D++);D<n;++D){let t=Math.round((s+D*k)*i)/i;if(v&&t>d)break;r.push({value:t})}return v&&p&&a!==d?r.length&&tg(r[r.length-1].value,d,a0(d,w,t))?r[r.length-1].value=d:r.push({value:d}):v&&a!==d||r.push({value:a}),r}({maxTicks:i=Math.max(2,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:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&tb(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}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 tG(t,this.chart.options.locale,this.options.ticks.format)}}class a2 extends a1{static id="linear";static defaults={ticks:{callback:eD.formatters.numeric}};determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=V(t)?t:0,this.max=V(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),e=t?this.width:this.height,i=tx(this.options.ticks.minRotation);return Math.ceil(e/Math.min(40,this._resolveTickFontOptions(0).lineHeight/((t?Math.sin(i):Math.cos(i))||.001)))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}let a5=t=>Math.floor(tu(t)),a3=(t,e)=>Math.pow(10,a5(t)+e);function a4(t){return 1==t/Math.pow(10,a5(t))}function a6(t,e,i){let s=Math.pow(10,i);return Math.ceil(e/s)-Math.floor(t/s)}class a8 extends sI{static id="logarithmic";static defaults={ticks:{callback:eD.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){let i=a1.prototype.parse.apply(this,[t,e]);if(0===i){this._zero=!0;return}return V(i)&&i>0?i:null}determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=V(t)?Math.max(0,t):null,this.max=V(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!V(this._userMin)&&(this.min=t===a3(this.min,0)?a3(this.min,-1):a3(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),i=this.min,s=this.max,a=e=>i=t?i:e,n=t=>s=e?s:t;i===s&&(i<=0?(a(1),n(10)):(a(a3(i,-1)),n(a3(s,1)))),i<=0&&a(a3(s,-1)),s<=0&&n(a3(i,1)),this.min=i,this.max=s}buildTicks(){let t=this.options,e=function(t,{min:e,max:i}){e=$(t.min,e);let s=[],a=a5(e),n=function(t,e){let i=a5(e-t);for(;a6(t,e,i)>10;)i++;for(;10>a6(t,e,i);)i--;return Math.min(i,a5(t))}(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,d=Math.floor((e-l)/o/10)*o*10,c=Math.floor((h-d)/Math.pow(10,n)),u=$(t.min,Math.round((l+d+c*Math.pow(10,n))*r)/r);for(;u<i;)s.push({value:u,major:a4(u),significand:c}),c>=10?c=c<15?15:20:c++,c>=20&&(c=2,r=++n>=0?1:r),u=Math.round((l+d+c*Math.pow(10,n))*r)/r;let f=$(t.max,u);return s.push({value:f,major:a4(f),significand:c}),s}({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&tb(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":tG(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=tu(t),this._valueRange=tu(this.max)-tu(t)}getPixelForValue(t){return((void 0===t||0===t)&&(t=this.min),null===t||isNaN(t))?NaN:this.getPixelForDecimal(t===this.min?0:(tu(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function a7(t){let e=t.ticks;if(e.display&&t.display){let t=eG(e.backdropPadding);return W(e.font&&e.font.size,eT.font.size)+t.height}return 0}function a9(t,e,i,s,a){return t===s||t===a?{start:e-i/2,end:e+i/2}:t<s||t>a?{start:e-i,end:e}:{start:e,end:e+i}}function nt(t,e,i,s){let{ctx:a}=t;if(i)a.arc(t.xCenter,t.yCenter,e,0,tn);else{let i=t.getPointPosition(0,e);a.moveTo(i.x,i.y);for(let n=1;n<s;n++)i=t.getPointPosition(n,e),a.lineTo(i.x,i.y)}}class ne extends a1{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:eD.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let t=this._padding=eG(a7(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){let{min:t,max:e}=this.getMinMax(!1);this.min=V(t)&&!isNaN(t)?t:0,this.max=V(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/a7(this.options))}generateTickLabels(t){a1.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((t,e)=>{let i=N(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){let t=this.options;t.display&&t.pointLabels.display?function(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?ta/n:0;for(let d=0;d<n;d++){var l,h;let n=r.setContext(t.getPointLabelContext(d));a[d]=n.padding;let c=t.getPointPosition(d,t.drawingArea+a[d],o),u=eK(n.font),f=(l=t.ctx,h=z(h=t._pointLabels[d])?h:[h],{w:function(t,e,i,s){let a,n,r,o,l;let h=(s=s||{}).data=s.data||{},d=s.garbageCollect=s.garbageCollect||[];s.font!==e&&(h=s.data={},d=s.garbageCollect=[],s.font=e),t.save(),t.font=e;let c=0,u=i.length;for(a=0;a<u;a++)if(null==(o=i[a])||z(o)){if(z(o))for(n=0,r=o.length;n<r;n++)null==(l=o[n])||z(l)||(c=eA(t,h,d,c,l))}else c=eA(t,h,d,c,o);t.restore();let f=d.length/2;if(f>i.length){for(a=0;a<f;a++)delete h[d[a]];d.splice(0,f)}return c}(l,u.string,h),h:h.length*u.lineHeight});s[d]=f;let g=tw(t.getIndexAngle(d)+o),p=Math.round(180/ta*g);!function(t,e,i,s,a){let n=Math.abs(Math.sin(i)),r=Math.abs(Math.cos(i)),o=0,l=0;s.start<e.l?(o=(e.l-s.start)/n,t.l=Math.min(t.l,e.l-o)):s.end>e.r&&(o=(s.end-e.r)/n,t.r=Math.max(t.r,e.r+o)),a.start<e.t?(l=(e.t-a.start)/r,t.t=Math.min(t.t,e.t-l)):a.end>e.b&&(l=(a.end-e.b)/r,t.b=Math.max(t.b,e.b+l))}(i,e,g,a9(p,c.x,f.w,0,180),a9(p,c.y,f.h,90,270))}t.setCenterPoint(e.l-i.l,i.r-e.r,e.t-i.t,i.b-e.b),t._pointLabelItems=function(t,e,i){let s;let a=[],n=t._pointLabels.length,r=t.options,{centerPointLabels:o,display:l}=r.pointLabels,h={extra:a7(r)/2,additionalAngle:o?ta/n:0};for(let r=0;r<n;r++){h.padding=i[r],h.size=e[r];let n=function(t,e,i){var s,a,n,r;let o=t.drawingArea,{extra:l,additionalAngle:h,padding:d,size:c}=i,u=t.getPointPosition(e,o+l+d,h),f=Math.round(180/ta*tw(u.angle+th)),g=(s=u.y,a=c.h,90===f||270===f?s-=a/2:(f>270||f<90)&&(s-=a),s),p=0===f||180===f?"center":f<180?"left":"right",m=(n=u.x,r=c.w,"right"===p?n-=r:"center"===p&&(n-=r/2),n);return{visible:!0,x:u.x,y:g,textAlign:p,left:m,top:g,right:m+c.w,bottom:g+c.h}}(t,r,h);a.push(n),"auto"===l&&(n.visible=function(t,e){if(!e)return!0;let{left:i,top:s,right:a,bottom:n}=t;return!(eF({x:i,y:s},e)||eF({x:i,y:n},e)||eF({x:a,y:s},e)||eF({x:a,y:n},e))}(n,s),n.visible&&(s=n))}return a}(t,s,a)}(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){return tw(tn/(this._pointLabels.length||1)*t+tx(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(I(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(I(t))return NaN;let e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){let e=this._pointLabels||[];if(t>=0&&t<e.length){let i=e[t];return eQ(this.getContext(),{label:i,index:t,type:"pointLabel"})}}getPointPosition(t,e,i=0){let s=this.getIndexAngle(t)-th+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){let{left:e,top:i,right:s,bottom:a}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:a}}drawBackground(){let{backgroundColor:t,grid:{circular:e}}=this.options;if(t){let i=this.ctx;i.save(),i.beginPath(),nt(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){let t,e,i;let s=this.ctx,a=this.options,{angleLines:n,grid:r,border:o}=a,l=this._pointLabels.length;if(a.pointLabels.display&&function(t,e){let{ctx:i,options:{pointLabels:s}}=t;for(let a=e-1;a>=0;a--){let e=t._pointLabelItems[a];if(!e.visible)continue;let n=s.setContext(t.getPointLabelContext(a));!function(t,e,i){let{left:s,top:a,right:n,bottom:r}=i,{backdropColor:o}=e;if(!I(o)){let i=eZ(e.borderRadius),l=eG(e.backdropPadding);t.fillStyle=o;let h=s-l.left,d=a-l.top,c=n-s+l.width,u=r-a+l.height;Object.values(i).some(t=>0!==t)?(t.beginPath(),eN(t,{x:h,y:d,w:c,h:u,radius:i}),t.fill()):t.fillRect(h,d,c,u)}}(i,n,e);let r=eK(n.font),{x:o,y:l,textAlign:h}=e;eH(i,t._pointLabels[a],o,l+r.lineHeight/2,r,{color:n.color,textAlign:h,textBaseline:"middle"})}}(this,l),r.display&&this.ticks.forEach((t,i)=>{if(0!==i||0===i&&this.min<0){e=this.getDistanceFromCenterForValue(t.value);let s=this.getContext(i),a=r.setContext(s),n=o.setContext(s);!function(t,e,i,s,a){let n=t.ctx,r=e.circular,{color:o,lineWidth:l}=e;(r||s)&&o&&l&&!(i<0)&&(n.save(),n.strokeStyle=o,n.lineWidth=l,n.setLineDash(a.dash),n.lineDashOffset=a.dashOffset,n.beginPath(),nt(t,i,r,s),n.closePath(),n.stroke(),n.restore())}(this,a,e,l,n)}}),n.display){for(s.save(),t=l-1;t>=0;t--){let r=n.setContext(this.getPointLabelContext(t)),{color:o,lineWidth:l}=r;l&&o&&(s.lineWidth=l,s.strokeStyle=o,s.setLineDash(r.borderDash),s.lineDashOffset=r.borderDashOffset,e=this.getDistanceFromCenterForValue(a.ticks.reverse?this.min:this.max),i=this.getPointPosition(t,e),s.beginPath(),s.moveTo(this.xCenter,this.yCenter),s.lineTo(i.x,i.y),s.stroke())}s.restore()}}drawBorder(){}drawLabels(){let t,e;let i=this.ctx,s=this.options,a=s.ticks;if(!a.display)return;let n=this.getIndexAngle(0);i.save(),i.translate(this.xCenter,this.yCenter),i.rotate(n),i.textAlign="center",i.textBaseline="middle",this.ticks.forEach((n,r)=>{if(0===r&&this.min>=0&&!s.reverse)return;let o=a.setContext(this.getContext(r)),l=eK(o.font);if(t=this.getDistanceFromCenterForValue(this.ticks[r].value),o.showLabelBackdrop){i.font=l.string,e=i.measureText(n.label).width,i.fillStyle=o.backdropColor;let s=eG(o.backdropPadding);i.fillRect(-e/2-s.left,-t-l.size/2-s.top,e+s.width,l.size+s.height)}eH(i,n.label,0,-t,l,{color:o.color,strokeColor:o.textStrokeColor,strokeWidth:o.textStrokeWidth})}),i.restore()}drawTitle(){}}let ni={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}},ns=Object.keys(ni);function na(t,e){return t-e}function nn(t,e){if(I(e))return null;let i=t._adapter,{parser:s,round:a,isoWeekday:n}=t._parseOpts,r=e;return("function"==typeof s&&(r=s(r)),V(r)||(r="string"==typeof s?i.parse(r,s):i.parse(r)),null===r)?null:(a&&(r="week"===a&&(tm(n)||!0===n)?i.startOf(r,"isoWeek",n):i.startOf(r,a)),+r)}function nr(t,e,i,s){let a=ns.length;for(let n=ns.indexOf(t);n<a-1;++n){let t=ni[ns[n]],a=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((i-e)/(a*t.size))<=s)return ns[n]}return ns[a-1]}function no(t,e,i){if(i){if(i.length){let{lo:s,hi:a}=tP(i,e);t[i[s]>=e?i[s]:i[a]]=!0}}else t[e]=!0}function nl(t,e,i){let s,a;let n=[],r={},o=e.length;for(s=0;s<o;++s)r[a=e[s]]=s,n.push({value:a,major:!1});return 0!==o&&i?function(t,e,i,s){let a,n;let r=t._adapter,o=+r.startOf(e[0].value,s),l=e[e.length-1].value;for(a=o;a<=l;a=+r.add(a,1,s))(n=i[a])>=0&&(e[n].major=!0);return e}(t,n,r,i):n}class nh extends sI{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){let i=t.time||(t.time={}),s=this._adapter=new i4._date(t.adapters.date);s.init(e),G(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:nn(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,e=this._adapter,i=t.time.unit||"day",{min:s,max:a,minDefined:n,maxDefined:r}=this.getUserBounds();function o(t){n||isNaN(t.min)||(s=Math.min(s,t.min)),r||isNaN(t.max)||(a=Math.max(a,t.max))}n&&r||(o(this._getLabelBounds()),("ticks"!==t.bounds||"labels"!==t.ticks.source)&&o(this.getMinMax(!1))),s=V(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),a=V(a)&&!isNaN(a)?a:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,a-1),this.max=Math.max(s+1,a)}_getLabelBounds(){let t=this.getLabelTimestamps(),e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){let t=this.options,e=t.time,i=t.ticks,s="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);let a=this.min,n=function(t,e,i){let s=0,a=t.length;for(;s<a&&t[s]<e;)s++;for(;a>s&&t[a-1]>i;)a--;return s>0||a<t.length?t.slice(s,a):t}(s,a,this.max);return this._unit=e.unit||(i.autoSkip?nr(e.minUnit,this.min,this.max,this._getLabelCapacity(a)):function(t,e,i,s,a){for(let n=ns.length-1;n>=ns.indexOf(i);n--){let i=ns[n];if(ni[i].common&&t._adapter.diff(a,s,i)>=e-1)return i}return ns[i?ns.indexOf(i):0]}(this,n.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=ns.indexOf(t)+1,i=ns.length;e<i;++e)if(ni[ns[e]].common)return ns[e]}(this._unit):void 0,this.initOffsets(s),t.reverse&&n.reverse(),nl(this,n,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e,i,s=0,a=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),s=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),a=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);let n=t.length<3?.5:.25;s=tS(s,0,n),a=tS(a,0,n),this._offsets={start:s,end:a,factor:1/(s+1+a)}}_generate(){let t,e;let i=this._adapter,s=this.min,a=this.max,n=this.options,r=n.time,o=r.unit||nr(r.minUnit,s,a,this._getLabelCapacity(s)),l=W(n.ticks.stepSize,1),h="week"===o&&r.isoWeekday,d=tm(h)||!0===h,c={},u=s;if(d&&(u=+i.startOf(u,"isoWeek",h)),u=+i.startOf(u,d?"day":o),i.diff(a,s,o)>1e5*l)throw Error(s+" and "+a+" are too far apart with stepSize of "+l+" "+o);let f="data"===n.ticks.source&&this.getDataTimestamps();for(t=u,e=0;t<a;t=+i.add(t,l,o),e++)no(c,t,f);return(t===a||"ticks"===n.bounds||1===e)&&no(c,t,f),Object.keys(c).sort(na).map(t=>+t)}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 N(n,[t,e,i],this);let r=a.time.displayFormats,o=this._unit,l=this._majorUnit,h=o&&r[o],d=l&&r[l],c=i[e],u=l&&d&&c&&c.major;return this._adapter.format(t,s||(u?d:h))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)(s=t[e]).label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){let e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){let e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){let e=this.options.ticks,i=this.ctx.measureText(t).width,s=tx(this.isHorizontal()?e.maxRotation:e.minRotation),a=Math.cos(s),n=Math.sin(s),r=this._resolveTickFontOptions(0).size;return{w:i*a+r*n,h:i*n+r*a}}_getLabelCapacity(t){let e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,a=this._tickFormatFunction(t,0,nl(this,[t],this._majorUnit),s),n=this._getLabelSize(a),r=Math.floor(this.isHorizontal()?this.width/n.w:this.height/n.h)-1;return r>0?r:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;let s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,e=s.length;t<e;++t)i=i.concat(s[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}getLabelTimestamps(){let t,e;let i=this._cache.labels||[];if(i.length)return i;let s=this.getLabels();for(t=0,e=s.length;t<e;++t)i.push(nn(this,s[t]));return this._cache.labels=this._normalized?i:this.normalize(i)}normalize(t){return tA(t.sort(na))}}function nd(t,e,i){let s,a,n,r,o=0,l=t.length-1;i?(e>=t[o].pos&&e<=t[l].pos&&({lo:o,hi:l}=tO(t,"pos",e)),{pos:s,time:n}=t[o],{pos:a,time:r}=t[l]):(e>=t[o].time&&e<=t[l].time&&({lo:o,hi:l}=tO(t,"time",e)),{time:s,pos:n}=t[o],{time:a,pos:r}=t[l]);let h=a-s;return h?n+(r-n)*(e-s)/h:n}class nc extends nh{static id="timeseries";static defaults=nh.defaults;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=nd(e,this.min),this._tableRange=nd(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){let e,i,s;let{min:a,max:n}=this,r=[],o=[];for(e=0,i=t.length;e<i;++e)(s=t[e])>=a&&s<=n&&r.push(s);if(r.length<2)return[{time:a,pos:0},{time:n,pos:1}];for(e=0,i=r.length;e<i;++e)Math.round((r[e+1]+r[e-1])/2)!==(s=r[e])&&o.push({time:s,pos:e/(i-1)});return o}_generate(){let t=this.min,e=this.max,i=super.getDataTimestamps();return i.includes(t)&&i.length||i.splice(0,0,t),i.includes(e)&&1!==i.length||i.push(e),i.sort((t,e)=>t-e)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;let e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t}getDecimalForValue(t){return(nd(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){let e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return nd(this._table,i*this._tableRange+this._minPos,!0)}}var nu=Object.freeze({__proto__:null,CategoryScale:class extends sI{static id="category";static defaults={ticks:{callback:aQ}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let e=this._addedLabels;if(e.length){let t=this.getLabels();for(let{index:i,label:s}of e)t[i]===s&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(I(t))return null;let i=this.getLabels();return aJ(e=isFinite(e)&&i[e]===t?e:function(t,e,i,s){let a=t.indexOf(e);return -1===a?aK(t,e,i,s):a!==t.lastIndexOf(e)?i:a}(i,t,W(e,t),this._addedLabels),i.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),{min:i,max:s}=this.getMinMax(!0);"ticks"!==this.options.bounds||(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){let t=this.min,e=this.max,i=this.options.offset,s=[],a=this.getLabels();a=0===t&&e===a.length-1?a:a.slice(t,e+1),this._valueRange=Math.max(a.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)s.push({value:i});return s}getLabelForValue(t){return aQ.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){let e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}},LinearScale:a2,LogarithmicScale:a8,RadialLinearScale:ne,TimeScale:nh,TimeSeriesScale:nc});s8.register(...[i2,ap,aG,nu]);var nf={};tJ="millisecond",tQ="second",t0="minute",t1="hour",t2="week",t5="month",t3="quarter",t4="year",t6="date",t8="Invalid Date",t7=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,t9=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,et=function(t,e,i){var s=String(t);return!s||s.length>=e?t:""+Array(e+1-s.length).join(i)+t},(ei={})[ee="en"]={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||"th")+"]"}},es=function(t){return t instanceof eo},ea=function t(e,i,s){var a;if(!e)return ee;if("string"==typeof e){var n=e.toLowerCase();ei[n]&&(a=n),i&&(ei[n]=i,a=n);var r=e.split("-");if(!a&&r.length>1)return t(r[0])}else{var o=e.name;ei[o]=e,a=o}return!s&&a&&(ee=a),a||!s&&ee},en=function(t,e){if(es(t))return t.clone();var i="object"==typeof e?e:{};return i.date=t,i.args=arguments,new eo(i)},(er={s:et,z:function(t){var e=-t.utcOffset(),i=Math.abs(e);return(e<=0?"+":"-")+et(Math.floor(i/60),2,"0")+":"+et(i%60,2,"0")},m:function t(e,i){if(e.date()<i.date())return-t(i,e);var s=12*(i.year()-e.year())+(i.month()-e.month()),a=e.clone().add(s,t5),n=i-a<0,r=e.clone().add(s+(n?-1:1),t5);return+(-(s+(i-a)/(n?a-r:r-a))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return({M:t5,y:t4,w:t2,d:"day",D:t6,h:t1,m:t0,s:tQ,ms:tJ,Q:t3})[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}}).l=ea,er.i=es,er.w=function(t,e){return en(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})},el=(eo=function(){function t(t){this.$L=ea(t.locale,null,!0),this.parse(t)}var e=t.prototype;return e.parse=function(t){this.$d=function(t){var e=t.date,i=t.utc;if(null===e)return new Date(NaN);if(er.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var s=e.match(t7);if(s){var a=s[2]-1||0,n=(s[7]||"0").substring(0,3);return i?new Date(Date.UTC(s[1],a,s[3]||1,s[4]||0,s[5]||0,s[6]||0,n)):new Date(s[1],a,s[3]||1,s[4]||0,s[5]||0,s[6]||0,n)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},e.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},e.$utils=function(){return er},e.isValid=function(){return this.$d.toString()!==t8},e.isSame=function(t,e){var i=en(t);return this.startOf(e)<=i&&i<=this.endOf(e)},e.isAfter=function(t,e){return en(t)<this.startOf(e)},e.isBefore=function(t,e){return this.endOf(e)<en(t)},e.$g=function(t,e,i){return er.u(t)?this[e]:this.set(i,t)},e.unix=function(){return Math.floor(this.valueOf()/1e3)},e.valueOf=function(){return this.$d.getTime()},e.startOf=function(t,e){var i=this,s=!!er.u(e)||e,a=er.p(t),n=function(t,e){var a=er.w(i.$u?Date.UTC(i.$y,e,t):new Date(i.$y,e,t),i);return s?a:a.endOf("day")},r=function(t,e){return er.w(i.toDate()[t].apply(i.toDate("s"),(s?[0,0,0,0]:[23,59,59,999]).slice(e)),i)},o=this.$W,l=this.$M,h=this.$D,d="set"+(this.$u?"UTC":"");switch(a){case t4:return s?n(1,0):n(31,11);case t5:return s?n(1,l):n(0,l+1);case t2:var c=this.$locale().weekStart||0,u=(o<c?o+7:o)-c;return n(s?h-u:h+(6-u),l);case"day":case t6:return r(d+"Hours",0);case t1:return r(d+"Minutes",1);case t0:return r(d+"Seconds",2);case tQ:return r(d+"Milliseconds",3);default:return this.clone()}},e.endOf=function(t){return this.startOf(t,!1)},e.$set=function(t,e){var i,s=er.p(t),a="set"+(this.$u?"UTC":""),n=((i={}).day=a+"Date",i[t6]=a+"Date",i[t5]=a+"Month",i[t4]=a+"FullYear",i[t1]=a+"Hours",i[t0]=a+"Minutes",i[tQ]=a+"Seconds",i[tJ]=a+"Milliseconds",i)[s],r="day"===s?this.$D+(e-this.$W):e;if(s===t5||s===t4){var o=this.clone().set(t6,1);o.$d[n](r),o.init(),this.$d=o.set(t6,Math.min(this.$D,o.daysInMonth())).$d}else n&&this.$d[n](r);return this.init(),this},e.set=function(t,e){return this.clone().$set(t,e)},e.get=function(t){return this[er.p(t)]()},e.add=function(t,e){var i,s=this;t=Number(t);var a=er.p(e),n=function(e){var i=en(s);return er.w(i.date(i.date()+Math.round(e*t)),s)};if(a===t5)return this.set(t5,this.$M+t);if(a===t4)return this.set(t4,this.$y+t);if("day"===a)return n(1);if(a===t2)return n(7);var r=((i={})[t0]=6e4,i[t1]=36e5,i[tQ]=1e3,i)[a]||1,o=this.$d.getTime()+t*r;return er.w(o,this)},e.subtract=function(t,e){return this.add(-1*t,e)},e.format=function(t){var e=this,i=this.$locale();if(!this.isValid())return i.invalidDate||t8;var s=t||"YYYY-MM-DDTHH:mm:ssZ",a=er.z(this),n=this.$H,r=this.$m,o=this.$M,l=i.weekdays,h=i.months,d=i.meridiem,c=function(t,i,a,n){return t&&(t[i]||t(e,s))||a[i].slice(0,n)},u=function(t){return er.s(n%12||12,t,"0")},f=d||function(t,e,i){var s=t<12?"AM":"PM";return i?s.toLowerCase():s};return s.replace(t9,function(t,s){return s||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return er.s(e.$y,4,"0");case"M":return o+1;case"MM":return er.s(o+1,2,"0");case"MMM":return c(i.monthsShort,o,h,3);case"MMMM":return c(h,o);case"D":return e.$D;case"DD":return er.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return c(i.weekdaysMin,e.$W,l,2);case"ddd":return c(i.weekdaysShort,e.$W,l,3);case"dddd":return l[e.$W];case"H":return String(n);case"HH":return er.s(n,2,"0");case"h":return u(1);case"hh":return u(2);case"a":return f(n,r,!0);case"A":return f(n,r,!1);case"m":return String(r);case"mm":return er.s(r,2,"0");case"s":return String(e.$s);case"ss":return er.s(e.$s,2,"0");case"SSS":return er.s(e.$ms,3,"0");case"Z":return a}return null}(t)||a.replace(":","")})},e.utcOffset=function(){return-(15*Math.round(this.$d.getTimezoneOffset()/15))},e.diff=function(t,e,i){var s,a=this,n=er.p(e),r=en(t),o=(r.utcOffset()-this.utcOffset())*6e4,l=this-r,h=function(){return er.m(a,r)};switch(n){case t4:s=h()/12;break;case t5:s=h();break;case t3:s=h()/3;break;case t2:s=(l-o)/6048e5;break;case"day":s=(l-o)/864e5;break;case t1:s=l/36e5;break;case t0:s=l/6e4;break;case tQ:s=l/1e3;break;default:s=l}return i?s:er.a(s)},e.daysInMonth=function(){return this.endOf(t5).$D},e.$locale=function(){return ei[this.$L]},e.locale=function(t,e){if(!t)return this.$L;var i=this.clone(),s=ea(t,e,!0);return s&&(i.$L=s),i},e.clone=function(){return er.w(this.$d,this)},e.toDate=function(){return new Date(this.valueOf())},e.toJSON=function(){return this.isValid()?this.toISOString():null},e.toISOString=function(){return this.$d.toISOString()},e.toString=function(){return this.$d.toUTCString()},t}()).prototype,en.prototype=el,[["$ms",tJ],["$s",tQ],["$m",t0],["$H",t1],["$W","day"],["$M",t5],["$y",t4],["$D",t6]].forEach(function(t){el[t[1]]=function(e){return this.$g(e,t[0],t[1])}}),en.extend=function(t,e){return t.$i||(t(e,eo,en),t.$i=!0),en},en.locale=ea,en.isDayjs=es,en.unix=function(t){return en(1e3*t)},en.en=ei[ee],en.Ls=ei,en.p={},nf=en;var ng={};eh={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},ed=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,ec=/\d\d/,eu=/\d\d?/,ef=/\d*[^-_:/,()\s\d]+/,eg={},ep=function(t){return(t=+t)+(t>68?1900:2e3)},em=function(t){return function(e){this[t]=+e}},eb=[/[+-]\d\d:?(\d\d)?|Z/,function(t){(this.zone||(this.zone={})).offset=function(t){if(!t||"Z"===t)return 0;var e=t.match(/([+-]|\d\d)/g),i=60*e[1]+(+e[2]||0);return 0===i?0:"+"===e[0]?-i:i}(t)}],ex=function(t){var e=eg[t];return e&&(e.indexOf?e:e.s.concat(e.f))},e_=function(t,e){var i,s=eg.meridiem;if(s){for(var a=1;a<=24;a+=1)if(t.indexOf(s(a,0,e))>-1){i=a>12;break}}else i=t===(e?"pm":"PM");return i},ey={A:[ef,function(t){this.afternoon=e_(t,!1)}],a:[ef,function(t){this.afternoon=e_(t,!0)}],S:[/\d/,function(t){this.milliseconds=100*+t}],SS:[ec,function(t){this.milliseconds=10*+t}],SSS:[/\d{3}/,function(t){this.milliseconds=+t}],s:[eu,em("seconds")],ss:[eu,em("seconds")],m:[eu,em("minutes")],mm:[eu,em("minutes")],H:[eu,em("hours")],h:[eu,em("hours")],HH:[eu,em("hours")],hh:[eu,em("hours")],D:[eu,em("day")],DD:[ec,em("day")],Do:[ef,function(t){var e=eg.ordinal,i=t.match(/\d+/);if(this.day=i[0],e)for(var s=1;s<=31;s+=1)e(s).replace(/\[|\]/g,"")===t&&(this.day=s)}],M:[eu,em("month")],MM:[ec,em("month")],MMM:[ef,function(t){var e=ex("months"),i=(ex("monthsShort")||e.map(function(t){return t.slice(0,3)})).indexOf(t)+1;if(i<1)throw Error();this.month=i%12||i}],MMMM:[ef,function(t){var e=ex("months").indexOf(t)+1;if(e<1)throw Error();this.month=e%12||e}],Y:[/[+-]?\d+/,em("year")],YY:[ec,function(t){this.year=ep(t)}],YYYY:[/\d{4}/,em("year")],Z:eb,ZZ:eb},ng=function(t,e,i){i.p.customParseFormat=!0,t&&t.parseTwoDigitYear&&(ep=t.parseTwoDigitYear);var s=e.prototype,a=s.parse;s.parse=function(t){var e=t.date,s=t.utc,n=t.args;this.$u=s;var r=n[1];if("string"==typeof r){var o=!0===n[2],l=!0===n[3],h=n[2];l&&(h=n[2]),eg=this.$locale(),!o&&h&&(eg=i.Ls[h]),this.$d=function(t,e,i){try{if(["x","X"].indexOf(e)>-1)return new Date(("X"===e?1e3:1)*t);var s=(function(t){var e,i;e=t,i=eg&&eg.formats;for(var s=(t=e.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(t,e,s){var a=s&&s.toUpperCase();return e||i[s]||eh[s]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(t,e,i){return e||i.slice(1)})})).match(ed),a=s.length,n=0;n<a;n+=1){var r=s[n],o=ey[r],l=o&&o[0],h=o&&o[1];s[n]=h?{regex:l,parser:h}:r.replace(/^\[|\]$/g,"")}return function(t){for(var e={},i=0,n=0;i<a;i+=1){var r=s[i];if("string"==typeof r)n+=r.length;else{var o=r.regex,l=r.parser,h=t.slice(n),d=o.exec(h)[0];l.call(e,d),t=t.replace(d,"")}}return function(t){var e=t.afternoon;if(void 0!==e){var i=t.hours;e?i<12&&(t.hours+=12):12===i&&(t.hours=0),delete t.afternoon}}(e),e}})(e)(t),a=s.year,n=s.month,r=s.day,o=s.hours,l=s.minutes,h=s.seconds,d=s.milliseconds,c=s.zone,u=new Date,f=r||(a||n?1:u.getDate()),g=a||u.getFullYear(),p=0;a&&!n||(p=n>0?n-1:u.getMonth());var m=o||0,b=l||0,x=h||0,_=d||0;return c?new Date(Date.UTC(g,p,f,m,b,x,_+60*c.offset*1e3)):i?new Date(Date.UTC(g,p,f,m,b,x,_)):new Date(g,p,f,m,b,x,_)}catch(t){return new Date("")}}(e,r,s),this.init(),h&&!0!==h&&(this.$L=this.locale(h).$L),(o||l)&&e!=this.format(r)&&(this.$d=new Date("")),eg={}}else if(r instanceof Array)for(var d=r.length,c=1;c<=d;c+=1){n[1]=r[c-1];var u=i.apply(this,n);if(u.isValid()){this.$d=u.$d,this.$L=u.$L,this.init();break}c===d&&(this.$d=new Date(""))}else a.call(this,t)}};var np={};np=function(t,e){var i=e.prototype,s=i.format;i.format=function(t){var e=this,i=this.$locale();if(!this.isValid())return s.bind(this)(t);var a=this.$utils(),n=(t||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(t){switch(t){case"Q":return Math.ceil((e.$M+1)/3);case"Do":return i.ordinal(e.$D);case"gggg":return e.weekYear();case"GGGG":return e.isoWeekYear();case"wo":return i.ordinal(e.week(),"W");case"w":case"ww":return a.s(e.week(),"w"===t?1:2,"0");case"W":case"WW":return a.s(e.isoWeek(),"W"===t?1:2,"0");case"k":case"kk":return a.s(String(0===e.$H?24:e.$H),"k"===t?1:2,"0");case"X":return Math.floor(e.$d.getTime()/1e3);case"x":return e.$d.getTime();case"z":return"["+e.offsetName()+"]";case"zzz":return"["+e.offsetName("long")+"]";default:return t}});return s.bind(this)(n)}};var nm={};ev="month",eM="quarter",nm=function(t,e){var i=e.prototype;i.quarter=function(t){return this.$utils().u(t)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(t-1))};var s=i.add;i.add=function(t,e){return t=Number(t),this.$utils().p(e)===eM?this.add(3*t,ev):s.bind(this)(t,e)};var a=i.startOf;i.startOf=function(t,e){var i=this.$utils(),s=!!i.u(e)||e;if(i.p(t)===eM){var n=this.quarter()-1;return s?this.month(3*n).startOf(ev).startOf("day"):this.month(3*n+2).endOf(ev).endOf("day")}return a.bind(this)(t,e)}};var nb={};ew={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},nb=function(t,e,i){var s=e.prototype,a=s.format;i.en.formats=ew,s.format=function(t){void 0===t&&(t="YYYY-MM-DDTHH:mm:ssZ");var e,i,s=this.$locale().formats,n=(e=t,i=void 0===s?{}:s,e.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(t,e,s){var a=s&&s.toUpperCase();return e||i[s]||ew[s]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(t,e,i){return e||i.slice(1)})}));return a.call(this,n)}};var nx={};nx=function(t,e,i){var s=function(t){return t.add(4-t.isoWeekday(),"day")},a=e.prototype;a.isoWeekYear=function(){return s(this).year()},a.isoWeek=function(t){if(!this.$utils().u(t))return this.add(7*(t-this.isoWeek()),"day");var e,a,n,r=s(this),o=(e=this.isoWeekYear(),n=4-(a=(this.$u?i.utc:i)().year(e).startOf("year")).isoWeekday(),a.isoWeekday()>4&&(n+=7),a.add(n,"day"));return r.diff(o,"week")+1},a.isoWeekday=function(t){return this.$utils().u(t)?this.day()||7:this.day(this.day()%7?t:t-7)};var n=a.startOf;a.startOf=function(t,e){var i=this.$utils(),s=!!i.u(e)||e;return"isoweek"===i.p(t)?s?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):n.bind(this)(t,e)}},s(nf).extend(s(np)),s(nf).extend(s(nm)),s(nf).extend(s(nb)),s(nf).extend(s(ng)),s(nf).extend(s(nx));var n_={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};i4._date.override({formats:function(){return n_},parse:function(t,e){var i=typeof t;return null===t||"undefined"===i?null:"string"===i&&"string"==typeof e?s(nf)(t,e).isValid()?s(nf)(t,e).valueOf():null:t instanceof s(nf)?null:s(nf)(t).isValid()?s(nf)(t).valueOf():null},format:function(t,e){return s(nf)(t).format(e)},add:function(t,e,i){return s(nf)(t).add(e,i).valueOf()},diff:function(t,e,i){return s(nf)(t).diff(s(nf)(e),i)},startOf:function(t,e,i){return"isoWeek"===e?s(nf)(t).isoWeekday("number"==typeof i&&i>0&&i<7?i:1).startOf("day").valueOf():s(nf)(t).startOf(e).valueOf()},endOf:function(t,e){return s(nf)(t).endOf(e).valueOf()}});var ny=document.querySelector("#search-query"),nv=document.querySelector("#search-suggestions");Videobox={followSeries:function(t,e,i){var s=new FormData;s.append("following",e),fetch(`/series/follow/${t}`,{method:"POST",body:s}).then(t=>{if(!t.ok)throw Error(`Server returned error ${t.status} while handling POST request`);t.text().then(t=>{i.target.closest("button").outerHTML=t})})},suggest:(ek=()=>{var t=ny.value;t.length<=3||fetch(`/suggest?query=${t}`).then(t=>{if(!t.ok)throw Error(`Server returned error ${t.status} while handling suggest query`);t.text().then(t=>{nv.innerHTML=t})})},function(){let t=this,e=arguments,s=eS&&!i;clearTimeout(i),i=setTimeout(()=>{i=null,eS||ek.apply(t,e)},200),s&&ek.apply(t,e)}),sync:function(){var t=document.querySelector("#update-dialog"),e=new EventSource("/sync/events");e.addEventListener("sync-progress",e=>{t.innerHTML=e.data}),e.addEventListener("sync-done",i=>{t.innerHTML=i.data,e.close()}),e.addEventListener("error",t=>{e.close()})},openSearchDialog:function(t){ny.value="",nv.replaceChildren(),Videobox.openDialog(t,"#search-dialog")},openDialog:function(t,e){var i=document.querySelector(e);return i.showModal(),i.classList.add("in"),i.addEventListener("click",t=>{t.target===t.currentTarget&&t.currentTarget.close()}),i},loadReleaseInfo:function(t,e){var i=Videobox.openDialog(t,"#release-dialog");fetch(`/release/${e}`).then(t=>{if(!t.ok)throw Error(`Server returned error ${t.status} while handling request`);t.text().then(t=>{i.innerHTML=t})})},loadMore:function(t){var e=document.querySelector(".load-more-wrapper");fetch(t).then(t=>{if(!t.ok)throw Error(`Server returned error ${t.status} while handling tag pagination`);t.text().then(t=>{e.querySelector("button").remove();var i=document.createElement("template");i.innerHTML=t,e.appendChild(i.content.firstElementChild).scrollIntoView({behavior:"smooth",block:"start"})})})},loadChart:function(t){let e=chartData.map(t=>({x:t.date,y:t.count}));var i=t.getContext("2d").createLinearGradient(0,0,0,400);i.addColorStop(0,"rgba(49,93,124,0.9)"),i.addColorStop(1,"rgba(49,93,124,0.1)"),new s8(t,{data:{datasets:[{type:"line",data:e,fill:!0,pointBorderColor:"#e37dd7",pointBackgroundColor:"#fff",pointBorderWidth:1,borderColor:"#e37dd7",borderWidth:2,backgroundColor:i,borderJoinStyle:"round"}]},options:{plugins:{legend:{display:!1}},scales:{x:{grid:{color:"#2a6278"},ticks:{color:"#9dc5e0"},type:"time",time:{unit:"week"}},y:{beginAtZero:!0,grid:{color:"#2a6278"},ticks:{color:"#9dc5e0"}}}}})}}})();
//# sourceMappingURL=app.js.map
