@kvass/widgets 1.8.22 → 1.8.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index3.js CHANGED
@@ -4,15 +4,15 @@ import{q as ms,X as bs,s as He,ag as sn,r as nn,i as on,W as rn,E as an,L as We,
4
4
  * (c) 2024 Jukka Kurkela
5
5
  * Released under the MIT License
6
6
  */function Zt(i){return i+.5|0}const lt=(i,t,e)=>Math.max(Math.min(i,e),t);function Wt(i){return lt(Zt(i*2.55),0,255)}function ht(i){return lt(Zt(i*255),0,255)}function rt(i){return lt(Zt(i/2.55)/100,0,1)}function hi(i){return lt(Zt(i*100),0,100)}const G={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},je=[..."0123456789ABCDEF"],cn=i=>je[i&15],hn=i=>je[(i&240)>>4]+je[i&15],te=i=>(i&240)>>4===(i&15),dn=i=>te(i.r)&&te(i.g)&&te(i.b)&&te(i.a);function fn(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&G[i[1]]*17,g:255&G[i[2]]*17,b:255&G[i[3]]*17,a:t===5?G[i[4]]*17:255}:(t===7||t===9)&&(e={r:G[i[1]]<<4|G[i[2]],g:G[i[3]]<<4|G[i[4]],b:G[i[5]]<<4|G[i[6]],a:t===9?G[i[7]]<<4|G[i[8]]:255})),e}const un=(i,t)=>i<255?t(i):"";function gn(i){var t=dn(i)?cn:hn;return i?"#"+t(i.r)+t(i.g)+t(i.b)+un(i.a,t):void 0}const pn=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function xs(i,t,e){const s=t*Math.min(e,1-e),n=(o,r=(o+i/30)%12)=>e-s*Math.max(Math.min(r-3,9-r,1),-1);return[n(0),n(8),n(4)]}function mn(i,t,e){const s=(n,o=(n+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function bn(i,t,e){const s=xs(i,1,.5);let n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)s[n]*=1-t-e,s[n]+=t;return s}function _n(i,t,e,s,n){return i===n?(t-e)/s+(t<e?6:0):t===n?(e-i)/s+2:(i-t)/s+4}function Ue(i){const e=i.r/255,s=i.g/255,n=i.b/255,o=Math.max(e,s,n),r=Math.min(e,s,n),a=(o+r)/2;let l,c,h;return o!==r&&(h=o-r,c=a>.5?h/(2-o-r):h/(o+r),l=_n(e,s,n,h,o),l=l*60+.5),[l|0,c||0,a]}function Ke(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(ht)}function qe(i,t,e){return Ke(xs,i,t,e)}function xn(i,t,e){return Ke(bn,i,t,e)}function yn(i,t,e){return Ke(mn,i,t,e)}function ys(i){return(i%360+360)%360}function vn(i){const t=pn.exec(i);let e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?Wt(+t[5]):ht(+t[5]));const n=ys(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?s=xn(n,o,r):t[1]==="hsv"?s=yn(n,o,r):s=qe(n,o,r),{r:s[0],g:s[1],b:s[2],a:e}}function wn(i,t){var e=Ue(i);e[0]=ys(e[0]+t),e=qe(e),i.r=e[0],i.g=e[1],i.b=e[2]}function kn(i){if(!i)return;const t=Ue(i),e=t[0],s=hi(t[1]),n=hi(t[2]);return i.a<255?`hsla(${e}, ${s}%, ${n}%, ${rt(i.a)})`:`hsl(${e}, ${s}%, ${n}%)`}const di={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"},fi={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Sn(){const i={},t=Object.keys(fi),e=Object.keys(di);let s,n,o,r,a;for(s=0;s<t.length;s++){for(r=a=t[s],n=0;n<e.length;n++)o=e[n],a=a.replace(o,di[o]);o=parseInt(fi[r],16),i[a]=[o>>16&255,o>>8&255,o&255]}return i}let ee;function Mn(i){ee||(ee=Sn(),ee.transparent=[0,0,0,0]);const t=ee[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const On=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Cn(i){const t=On.exec(i);let e=255,s,n,o;if(t){if(t[7]!==s){const r=+t[7];e=t[8]?Wt(r):lt(r*255,0,255)}return s=+t[1],n=+t[3],o=+t[5],s=255&(t[2]?Wt(s):lt(s,0,255)),n=255&(t[4]?Wt(n):lt(n,0,255)),o=255&(t[6]?Wt(o):lt(o,0,255)),{r:s,g:n,b:o,a:e}}}function An(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${rt(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const Ae=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,Ot=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function Dn(i,t,e){const s=Ot(rt(i.r)),n=Ot(rt(i.g)),o=Ot(rt(i.b));return{r:ht(Ae(s+e*(Ot(rt(t.r))-s))),g:ht(Ae(n+e*(Ot(rt(t.g))-n))),b:ht(Ae(o+e*(Ot(rt(t.b))-o))),a:i.a+e*(t.a-i.a)}}function ie(i,t,e){if(i){let s=Ue(i);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=qe(s),i.r=s[0],i.g=s[1],i.b=s[2]}}function vs(i,t){return i&&Object.assign(t||{},i)}function ui(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=ht(i[3]))):(t=vs(i,{r:0,g:0,b:0,a:1}),t.a=ht(t.a)),t}function Pn(i){return i.charAt(0)==="r"?Cn(i):vn(i)}class Xt{constructor(t){if(t instanceof Xt)return t;const e=typeof t;let s;e==="object"?s=ui(t):e==="string"&&(s=fn(t)||Mn(t)||Pn(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=vs(this._rgb);return t&&(t.a=rt(t.a)),t}set rgb(t){this._rgb=ui(t)}rgbString(){return this._valid?An(this._rgb):void 0}hexString(){return this._valid?gn(this._rgb):void 0}hslString(){return this._valid?kn(this._rgb):void 0}mix(t,e){if(t){const s=this.rgb,n=t.rgb;let o;const r=e===o?.5:e,a=2*r-1,l=s.a-n.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,s.r=255&c*s.r+o*n.r+.5,s.g=255&c*s.g+o*n.g+.5,s.b=255&c*s.b+o*n.b+.5,s.a=r*s.a+(1-r)*n.a,this.rgb=s}return this}interpolate(t,e){return t&&(this._rgb=Dn(this._rgb,t._rgb,e)),this}clone(){return new Xt(this.rgb)}alpha(t){return this._rgb.a=ht(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Zt(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ie(this._rgb,2,t),this}darken(t){return ie(this._rgb,2,-t),this}saturate(t){return ie(this._rgb,1,t),this}desaturate(t){return ie(this._rgb,1,-t),this}rotate(t){return wn(this._rgb,t),this}}/*!
7
- * Chart.js v4.4.8
7
+ * Chart.js v4.4.9
8
8
  * https://www.chartjs.org
9
9
  * (c) 2025 Chart.js Contributors
10
10
  * Released under the MIT License
11
- */function st(){}const Tn=(()=>{let i=0;return()=>i++})();function N(i){return i==null}function H(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function O(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function at(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function tt(i,t){return at(i)?i:t}function A(i,t){return typeof i>"u"?t:i}const Rn=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/t,ws=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function L(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function P(i,t,e,s){let n,o,r;if(H(i))for(o=i.length,n=0;n<o;n++)t.call(e,i[n],n);else if(O(i))for(r=Object.keys(i),o=r.length,n=0;n<o;n++)t.call(e,i[r[n]],r[n])}function pe(i,t){let e,s,n,o;if(!i||!t||i.length!==t.length)return!1;for(e=0,s=i.length;e<s;++e)if(n=i[e],o=t[e],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function me(i){if(H(i))return i.map(me);if(O(i)){const t=Object.create(null),e=Object.keys(i),s=e.length;let n=0;for(;n<s;++n)t[e[n]]=me(i[e[n]]);return t}return i}function ks(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function Ln(i,t,e,s){if(!ks(i))return;const n=t[i],o=e[i];O(n)&&O(o)?Ut(n,o,s):t[i]=me(o)}function Ut(i,t,e){const s=H(t)?t:[t],n=s.length;if(!O(i))return i;e=e||{};const o=e.merger||Ln;let r;for(let a=0;a<n;++a){if(r=s[a],!O(r))continue;const l=Object.keys(r);for(let c=0,h=l.length;c<h;++c)o(l[c],i,r,e)}return i}function Vt(i,t){return Ut(i,t,{merger:En})}function En(i,t,e){if(!ks(i))return;const s=t[i],n=e[i];O(s)&&O(n)?Vt(s,n):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=me(n))}const gi={"":i=>i,x:i=>i.x,y:i=>i.y};function In(i){const t=i.split("."),e=[];let s="";for(const n of t)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function Fn(i){const t=In(i);return e=>{for(const s of t){if(s==="")break;e=e&&e[s]}return e}}function Kt(i,t){return(gi[t]||(gi[t]=Fn(t)))(i)}function Ge(i){return i.charAt(0).toUpperCase()+i.slice(1)}const be=i=>typeof i<"u",dt=i=>typeof i=="function",pi=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function zn(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const B=Math.PI,z=2*B,_e=Number.POSITIVE_INFINITY,Bn=B/180,W=B/2,pt=B/4,mi=B*2/3,bi=Math.sign;function Hn(i){const t=[],e=Math.sqrt(i);let s;for(s=1;s<e;s++)i%s===0&&(t.push(s),t.push(i/s));return e===(e|0)&&t.push(e),t.sort((n,o)=>n-o).pop(),t}function Wn(i){return typeof i=="symbol"||typeof i=="object"&&i!==null&&!(Symbol.toPrimitive in i||"toString"in i||"valueOf"in i)}function xe(i){return!Wn(i)&&!isNaN(parseFloat(i))&&isFinite(i)}function yt(i){return i*(B/180)}function jn(i){return i*(180/B)}function Ss(i,t){const e=t.x-i.x,s=t.y-i.y,n=Math.sqrt(e*e+s*s);let o=Math.atan2(s,e);return o<-.5*B&&(o+=z),{angle:o,distance:n}}function Nn(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function mt(i){return(i%z+z)%z}function ye(i,t,e,s){const n=mt(i),o=mt(t),r=mt(e),a=mt(o-n),l=mt(r-n),c=mt(n-o),h=mt(n-r);return n===o||n===r||s&&o===r||a>l&&c<h}function K(i,t,e){return Math.max(t,Math.min(e,i))}function Vn(i){return K(i,-32768,32767)}function vt(i,t,e,s=1e-6){return i>=Math.min(t,e)-s&&i<=Math.max(t,e)+s}function Ze(i,t,e){e=e||(r=>i[r]<t);let s=i.length-1,n=0,o;for(;s-n>1;)o=n+s>>1,e(o)?n=o:s=o;return{lo:n,hi:s}}const Ne=(i,t,e,s)=>Ze(i,e,s?n=>{const o=i[n][t];return o<e||o===e&&i[n+1][t]===e}:n=>i[n][t]<e),Yn=(i,t,e)=>Ze(i,e,s=>i[s][t]>=e);function $n(i,t,e){let s=0,n=i.length;for(;s<n&&i[s]<t;)s++;for(;n>s&&i[n-1]>e;)n--;return s>0||n<i.length?i.slice(s,n):i}const Ms=["push","pop","shift","splice","unshift"];function Xn(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Ms.forEach(e=>{const s="_onData"+Ge(e),n=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const r=n.apply(this,o);return i._chartjs.listeners.forEach(a=>{typeof a[s]=="function"&&a[s](...o)}),r}})})}function _i(i,t){const e=i._chartjs;if(!e)return;const s=e.listeners,n=s.indexOf(t);n!==-1&&s.splice(n,1),!(s.length>0)&&(Ms.forEach(o=>{delete i[o]}),delete i._chartjs)}function Un(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const Os=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function Cs(i,t){let e=[],s=!1;return function(...n){e=n,s||(s=!0,Os.call(window,()=>{s=!1,i.apply(t,e)}))}}function Kn(i,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(i,t,s)):i.apply(this,s),t}}const Qe=i=>i==="start"?"left":i==="end"?"right":"center",Y=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,qn=(i,t,e,s)=>i===(s?"left":"right")?e:i==="center"?(t+e)/2:t,se=i=>i===0||i===1,xi=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*z/e)),yi=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*z/e)+1,Yt={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*W)+1,easeOutSine:i=>Math.sin(i*W),easeInOutSine:i=>-.5*(Math.cos(B*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>se(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>se(i)?i:xi(i,.075,.3),easeOutElastic:i=>se(i)?i:yi(i,.075,.3),easeInOutElastic(i){return se(i)?i:i<.5?.5*xi(i*2,.1125,.45):.5+.5*yi(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-Yt.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?Yt.easeInBounce(i*2)*.5:Yt.easeOutBounce(i*2-1)*.5+.5};function As(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function vi(i){return As(i)?i:new Xt(i)}function De(i){return As(i)?i:new Xt(i).saturate(.5).darken(.1).hexString()}const Gn=["x","y","borderWidth","radius","tension"],Zn=["color","borderColor","backgroundColor"];function Qn(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),i.set("animations",{colors:{type:"color",properties:Zn},numbers:{type:"number",properties:Gn}}),i.describe("animations",{_fallback:"animation"}),i.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function Jn(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const wi=new Map;function to(i,t){t=t||{};const e=i+JSON.stringify(t);let s=wi.get(e);return s||(s=new Intl.NumberFormat(i,t),wi.set(e,s)),s}function eo(i,t,e){return to(t,e).format(i)}const io={values(i){return H(i)?i:""+i}};var so={formatters:io};function no(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:so.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const kt=Object.create(null),Ve=Object.create(null);function $t(i,t){if(!t)return i;const e=t.split(".");for(let s=0,n=e.length;s<n;++s){const o=e[s];i=i[o]||(i[o]=Object.create(null))}return i}function Pe(i,t,e){return typeof t=="string"?Ut($t(i,t),e):Ut($t(i,""),t)}class oo{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=s=>s.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(s,n)=>De(n.backgroundColor),this.hoverBorderColor=(s,n)=>De(n.borderColor),this.hoverColor=(s,n)=>De(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Pe(this,t,e)}get(t){return $t(this,t)}describe(t,e){return Pe(Ve,t,e)}override(t,e){return Pe(kt,t,e)}route(t,e,s,n){const o=$t(this,t),r=$t(this,s),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=r[n];return O(l)?Object.assign({},c,l):A(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var F=new oo({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Qn,Jn,no]);function ro(i){return!i||N(i.size)||N(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function ki(i,t,e,s,n){let o=t[n];return o||(o=t[n]=i.measureText(n).width,e.push(n)),o>s&&(s=o),s}function bt(i,t,e){const s=i.currentDevicePixelRatio,n=e!==0?Math.max(e/2,.5):0;return Math.round((t-n)*s)/s+n}function Si(i,t){!t&&!i||(t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore())}function Ye(i,t,e,s){Ds(i,t,e,s,null)}function Ds(i,t,e,s,n){let o,r,a,l,c,h,d,f;const u=t.pointStyle,m=t.rotation,g=t.radius;let p=(m||0)*Bn;if(u&&typeof u=="object"&&(o=u.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,s),i.rotate(p),i.drawImage(u,-u.width/2,-u.height/2,u.width,u.height),i.restore();return}if(!(isNaN(g)||g<=0)){switch(i.beginPath(),u){default:n?i.ellipse(e,s,n/2,g,0,0,z):i.arc(e,s,g,0,z),i.closePath();break;case"triangle":h=n?n/2:g,i.moveTo(e+Math.sin(p)*h,s-Math.cos(p)*g),p+=mi,i.lineTo(e+Math.sin(p)*h,s-Math.cos(p)*g),p+=mi,i.lineTo(e+Math.sin(p)*h,s-Math.cos(p)*g),i.closePath();break;case"rectRounded":c=g*.516,l=g-c,r=Math.cos(p+pt)*l,d=Math.cos(p+pt)*(n?n/2-c:l),a=Math.sin(p+pt)*l,f=Math.sin(p+pt)*(n?n/2-c:l),i.arc(e-d,s-a,c,p-B,p-W),i.arc(e+f,s-r,c,p-W,p),i.arc(e+d,s+a,c,p,p+W),i.arc(e-f,s+r,c,p+W,p+B),i.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*g,h=n?n/2:l,i.rect(e-h,s-l,2*h,2*l);break}p+=pt;case"rectRot":d=Math.cos(p)*(n?n/2:g),r=Math.cos(p)*g,a=Math.sin(p)*g,f=Math.sin(p)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+f,s-r),i.lineTo(e+d,s+a),i.lineTo(e-f,s+r),i.closePath();break;case"crossRot":p+=pt;case"cross":d=Math.cos(p)*(n?n/2:g),r=Math.cos(p)*g,a=Math.sin(p)*g,f=Math.sin(p)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+f,s-r),i.lineTo(e-f,s+r);break;case"star":d=Math.cos(p)*(n?n/2:g),r=Math.cos(p)*g,a=Math.sin(p)*g,f=Math.sin(p)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+f,s-r),i.lineTo(e-f,s+r),p+=pt,d=Math.cos(p)*(n?n/2:g),r=Math.cos(p)*g,a=Math.sin(p)*g,f=Math.sin(p)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+f,s-r),i.lineTo(e-f,s+r);break;case"line":r=n?n/2:Math.cos(p)*g,a=Math.sin(p)*g,i.moveTo(e-r,s-a),i.lineTo(e+r,s+a);break;case"dash":i.moveTo(e,s),i.lineTo(e+Math.cos(p)*(n?n/2:g),s+Math.sin(p)*g);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function Je(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.x<t.right+e&&i.y>t.top-e&&i.y<t.bottom+e}function ti(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function ei(i){i.restore()}function ao(i,t){t.translation&&i.translate(t.translation[0],t.translation[1]),N(t.rotation)||i.rotate(t.rotation),t.color&&(i.fillStyle=t.color),t.textAlign&&(i.textAlign=t.textAlign),t.textBaseline&&(i.textBaseline=t.textBaseline)}function lo(i,t,e,s,n){if(n.strikethrough||n.underline){const o=i.measureText(s),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,h=n.strikethrough?(l+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=n.decorationWidth||2,i.moveTo(r,h),i.lineTo(a,h),i.stroke()}}function co(i,t){const e=i.fillStyle;i.fillStyle=t.color,i.fillRect(t.left,t.top,t.width,t.height),i.fillStyle=e}function qt(i,t,e,s,n,o={}){const r=H(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=n.string,ao(i,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&co(i,o.backdrop),a&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),N(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(c,e,s,o.maxWidth)),i.fillText(c,e,s,o.maxWidth),lo(i,e,s,c,o),s+=Number(n.lineHeight);i.restore()}function ve(i,t){const{x:e,y:s,w:n,h:o,radius:r}=t;i.arc(e+r.topLeft,s+r.topLeft,r.topLeft,1.5*B,B,!0),i.lineTo(e,s+o-r.bottomLeft),i.arc(e+r.bottomLeft,s+o-r.bottomLeft,r.bottomLeft,B,W,!0),i.lineTo(e+n-r.bottomRight,s+o),i.arc(e+n-r.bottomRight,s+o-r.bottomRight,r.bottomRight,W,0,!0),i.lineTo(e+n,s+r.topRight),i.arc(e+n-r.topRight,s+r.topRight,r.topRight,0,-W,!0),i.lineTo(e+r.topLeft,s)}const ho=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,fo=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function uo(i,t){const e=(""+i).match(ho);if(!e||e[1]==="normal")return t*1.2;switch(i=+e[2],e[3]){case"px":return i;case"%":i/=100;break}return t*i}const go=i=>+i||0;function ii(i,t){const e={},s=O(t),n=s?Object.keys(t):t,o=O(i)?s?r=>A(i[r],i[t[r]]):r=>i[r]:()=>i;for(const r of n)e[r]=go(o(r));return e}function Ps(i){return ii(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Dt(i){return ii(i,["topLeft","topRight","bottomLeft","bottomRight"])}function Q(i){const t=Ps(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function $(i,t){i=i||{},t=t||F.font;let e=A(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=A(i.style,t.style);s&&!(""+s).match(fo)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:A(i.family,t.family),lineHeight:uo(A(i.lineHeight,t.lineHeight),e),size:e,style:s,weight:A(i.weight,t.weight),string:""};return n.string=ro(n),n}function ne(i,t,e,s){let n,o,r;for(n=0,o=i.length;n<o;++n)if(r=i[n],r!==void 0&&(t!==void 0&&typeof r=="function"&&(r=r(t)),e!==void 0&&H(r)&&(r=r[e%r.length]),r!==void 0))return r}function po(i,t,e){const{min:s,max:n}=i,o=ws(t,(n-s)/2),r=(a,l)=>e&&a===0?0:a+l;return{min:r(s,-Math.abs(o)),max:r(n,o)}}function Rt(i,t){return Object.assign(Object.create(i),t)}function si(i,t=[""],e,s,n=()=>i[0]){const o=e||i;typeof s>"u"&&(s=Es("_fallback",i));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:s,_getTarget:n,override:a=>si([a,...i],t,o,s)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete i[0][l],!0},get(a,l){return Rs(a,l,()=>ko(l,t,i,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(a,l){return Oi(a).includes(l)},ownKeys(a){return Oi(a)},set(a,l,c){const h=a._storage||(a._storage=n());return a[l]=h[l]=c,delete a._keys,!0}})}function Tt(i,t,e,s){const n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:Ts(i,s),setContext:o=>Tt(i,o,e,s),override:o=>Tt(i.override(o),t,e,s)};return new Proxy(n,{deleteProperty(o,r){return delete o[r],delete i[r],!0},get(o,r,a){return Rs(o,r,()=>bo(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(i,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,r)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,r){return Reflect.has(i,r)},ownKeys(){return Reflect.ownKeys(i)},set(o,r,a){return i[r]=a,delete o[r],!0}})}function Ts(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:n=t.allKeys}=i;return{allKeys:n,scriptable:e,indexable:s,isScriptable:dt(e)?e:()=>e,isIndexable:dt(s)?s:()=>s}}const mo=(i,t)=>i?i+Ge(t):t,ni=(i,t)=>O(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Rs(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];const s=e();return i[t]=s,s}function bo(i,t,e){const{_proxy:s,_context:n,_subProxy:o,_descriptors:r}=i;let a=s[t];return dt(a)&&r.isScriptable(t)&&(a=_o(t,a,i,e)),H(a)&&a.length&&(a=xo(t,a,i,r.isIndexable)),ni(t,a)&&(a=Tt(a,n,o&&o[t],r)),a}function _o(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_stack:a}=e;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);a.add(i);let l=t(o,r||s);return a.delete(i),ni(i,l)&&(l=oi(n._scopes,n,i,l)),l}function xo(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&s(i))return t[o.index%t.length];if(O(t[0])){const l=t,c=n._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=oi(c,n,i,h);t.push(Tt(d,o,r&&r[i],a))}}return t}function Ls(i,t,e){return dt(i)?i(t,e):i}const yo=(i,t)=>i===!0?t:typeof i=="string"?Kt(t,i):void 0;function vo(i,t,e,s,n){for(const o of t){const r=yo(e,o);if(r){i.add(r);const a=Ls(r._fallback,e,n);if(typeof a<"u"&&a!==e&&a!==s)return a}else if(r===!1&&typeof s<"u"&&e!==s)return null}return!1}function oi(i,t,e,s){const n=t._rootScopes,o=Ls(t._fallback,e,s),r=[...i,...n],a=new Set;a.add(s);let l=Mi(a,r,e,o||e,s);return l===null||typeof o<"u"&&o!==e&&(l=Mi(a,r,o,l,s),l===null)?!1:si(Array.from(a),[""],n,o,()=>wo(t,e,s))}function Mi(i,t,e,s,n){for(;e;)e=vo(i,t,e,s,n);return e}function wo(i,t,e){const s=i._getTarget();t in s||(s[t]={});const n=s[t];return H(n)&&O(e)?e:n||{}}function ko(i,t,e,s){let n;for(const o of t)if(n=Es(mo(o,i),e),typeof n<"u")return ni(i,n)?oi(e,s,i,n):n}function Es(i,t){for(const e of t){if(!e)continue;const s=e[i];if(typeof s<"u")return s}}function Oi(i){let t=i._keys;return t||(t=i._keys=So(i._scopes)),t}function So(i){const t=new Set;for(const e of i)for(const s of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(s);return Array.from(t)}function ri(){return typeof window<"u"&&typeof document<"u"}function ai(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function we(i,t,e){let s;return typeof i=="string"?(s=parseInt(i,10),i.indexOf("%")!==-1&&(s=s/100*t.parentNode[e])):s=i,s}const Me=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function Mo(i,t){return Me(i).getPropertyValue(t)}const Oo=["top","right","bottom","left"];function wt(i,t,e){const s={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=Oo[n];s[o]=parseFloat(i[t+"-"+o+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const Co=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function Ao(i,t){const e=i.touches,s=e&&e.length?e[0]:i,{offsetX:n,offsetY:o}=s;let r=!1,a,l;if(Co(n,o,i.target))a=n,l=o;else{const c=t.getBoundingClientRect();a=s.clientX-c.left,l=s.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function xt(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:s}=t,n=Me(e),o=n.boxSizing==="border-box",r=wt(n,"padding"),a=wt(n,"border","width"),{x:l,y:c,box:h}=Ao(i,e),d=r.left+(h&&a.left),f=r.top+(h&&a.top);let{width:u,height:m}=t;return o&&(u-=r.width+a.width,m-=r.height+a.height),{x:Math.round((l-d)/u*e.width/s),y:Math.round((c-f)/m*e.height/s)}}function Do(i,t,e){let s,n;if(t===void 0||e===void 0){const o=i&&ai(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const r=o.getBoundingClientRect(),a=Me(o),l=wt(a,"border","width"),c=wt(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,s=we(a.maxWidth,o,"clientWidth"),n=we(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:s||_e,maxHeight:n||_e}}const oe=i=>Math.round(i*10)/10;function Po(i,t,e,s){const n=Me(i),o=wt(n,"margin"),r=we(n.maxWidth,i,"clientWidth")||_e,a=we(n.maxHeight,i,"clientHeight")||_e,l=Do(i,t,e);let{width:c,height:h}=l;if(n.boxSizing==="content-box"){const f=wt(n,"border","width"),u=wt(n,"padding");c-=u.width+f.width,h-=u.height+f.height}return c=Math.max(0,c-o.width),h=Math.max(0,s?c/s:h-o.height),c=oe(Math.min(c,r,l.maxWidth)),h=oe(Math.min(h,a,l.maxHeight)),c&&!h&&(h=oe(c/2)),(t!==void 0||e!==void 0)&&s&&l.height&&h>l.height&&(h=l.height,c=oe(Math.floor(h*s))),{width:c,height:h}}function Ci(i,t,e){const s=t||1,n=Math.floor(i.height*s),o=Math.floor(i.width*s);i.height=Math.floor(i.height),i.width=Math.floor(i.width);const r=i.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${i.height}px`,r.style.width=`${i.width}px`),i.currentDevicePixelRatio!==s||r.height!==n||r.width!==o?(i.currentDevicePixelRatio=s,r.height=n,r.width=o,i.ctx.setTransform(s,0,0,s,0,0),!0):!1}const To=function(){let i=!1;try{const t={get passive(){return i=!0,!1}};ri()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i}();function Ai(i,t){const e=Mo(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}const Ro=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,s){return e-s},leftForLtr(e,s){return e-s}}},Lo=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function Pt(i,t,e){return i?Ro(t,e):Lo()}function Is(i,t){let e,s;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=s)}function Fs(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}/*!
12
- * Chart.js v4.4.8
11
+ */function st(){}const Tn=(()=>{let i=0;return()=>i++})();function N(i){return i==null}function H(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function O(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function at(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function tt(i,t){return at(i)?i:t}function A(i,t){return typeof i>"u"?t:i}const Rn=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/t,ws=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function L(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function P(i,t,e,s){let n,o,r;if(H(i))for(o=i.length,n=0;n<o;n++)t.call(e,i[n],n);else if(O(i))for(r=Object.keys(i),o=r.length,n=0;n<o;n++)t.call(e,i[r[n]],r[n])}function pe(i,t){let e,s,n,o;if(!i||!t||i.length!==t.length)return!1;for(e=0,s=i.length;e<s;++e)if(n=i[e],o=t[e],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function me(i){if(H(i))return i.map(me);if(O(i)){const t=Object.create(null),e=Object.keys(i),s=e.length;let n=0;for(;n<s;++n)t[e[n]]=me(i[e[n]]);return t}return i}function ks(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function Ln(i,t,e,s){if(!ks(i))return;const n=t[i],o=e[i];O(n)&&O(o)?Ut(n,o,s):t[i]=me(o)}function Ut(i,t,e){const s=H(t)?t:[t],n=s.length;if(!O(i))return i;e=e||{};const o=e.merger||Ln;let r;for(let a=0;a<n;++a){if(r=s[a],!O(r))continue;const l=Object.keys(r);for(let c=0,h=l.length;c<h;++c)o(l[c],i,r,e)}return i}function Vt(i,t){return Ut(i,t,{merger:En})}function En(i,t,e){if(!ks(i))return;const s=t[i],n=e[i];O(s)&&O(n)?Vt(s,n):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=me(n))}const gi={"":i=>i,x:i=>i.x,y:i=>i.y};function In(i){const t=i.split("."),e=[];let s="";for(const n of t)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function Fn(i){const t=In(i);return e=>{for(const s of t){if(s==="")break;e=e&&e[s]}return e}}function Kt(i,t){return(gi[t]||(gi[t]=Fn(t)))(i)}function Ge(i){return i.charAt(0).toUpperCase()+i.slice(1)}const be=i=>typeof i<"u",dt=i=>typeof i=="function",pi=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function zn(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const B=Math.PI,z=2*B,_e=Number.POSITIVE_INFINITY,Bn=B/180,W=B/2,pt=B/4,mi=B*2/3,bi=Math.sign;function Hn(i){const t=[],e=Math.sqrt(i);let s;for(s=1;s<e;s++)i%s===0&&(t.push(s),t.push(i/s));return e===(e|0)&&t.push(e),t.sort((n,o)=>n-o).pop(),t}function Wn(i){return typeof i=="symbol"||typeof i=="object"&&i!==null&&!(Symbol.toPrimitive in i||"toString"in i||"valueOf"in i)}function xe(i){return!Wn(i)&&!isNaN(parseFloat(i))&&isFinite(i)}function yt(i){return i*(B/180)}function jn(i){return i*(180/B)}function Ss(i,t){const e=t.x-i.x,s=t.y-i.y,n=Math.sqrt(e*e+s*s);let o=Math.atan2(s,e);return o<-.5*B&&(o+=z),{angle:o,distance:n}}function Nn(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function mt(i){return(i%z+z)%z}function ye(i,t,e,s){const n=mt(i),o=mt(t),r=mt(e),a=mt(o-n),l=mt(r-n),c=mt(n-o),h=mt(n-r);return n===o||n===r||s&&o===r||a>l&&c<h}function K(i,t,e){return Math.max(t,Math.min(e,i))}function Vn(i){return K(i,-32768,32767)}function vt(i,t,e,s=1e-6){return i>=Math.min(t,e)-s&&i<=Math.max(t,e)+s}function Ze(i,t,e){e=e||(r=>i[r]<t);let s=i.length-1,n=0,o;for(;s-n>1;)o=n+s>>1,e(o)?n=o:s=o;return{lo:n,hi:s}}const Ne=(i,t,e,s)=>Ze(i,e,s?n=>{const o=i[n][t];return o<e||o===e&&i[n+1][t]===e}:n=>i[n][t]<e),Yn=(i,t,e)=>Ze(i,e,s=>i[s][t]>=e);function $n(i,t,e){let s=0,n=i.length;for(;s<n&&i[s]<t;)s++;for(;n>s&&i[n-1]>e;)n--;return s>0||n<i.length?i.slice(s,n):i}const Ms=["push","pop","shift","splice","unshift"];function Xn(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Ms.forEach(e=>{const s="_onData"+Ge(e),n=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const r=n.apply(this,o);return i._chartjs.listeners.forEach(a=>{typeof a[s]=="function"&&a[s](...o)}),r}})})}function _i(i,t){const e=i._chartjs;if(!e)return;const s=e.listeners,n=s.indexOf(t);n!==-1&&s.splice(n,1),!(s.length>0)&&(Ms.forEach(o=>{delete i[o]}),delete i._chartjs)}function Un(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const Os=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function Cs(i,t){let e=[],s=!1;return function(...n){e=n,s||(s=!0,Os.call(window,()=>{s=!1,i.apply(t,e)}))}}function Kn(i,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(i,t,s)):i.apply(this,s),t}}const Qe=i=>i==="start"?"left":i==="end"?"right":"center",Y=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,qn=(i,t,e,s)=>i===(s?"left":"right")?e:i==="center"?(t+e)/2:t,se=i=>i===0||i===1,xi=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*z/e)),yi=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*z/e)+1,Yt={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*W)+1,easeOutSine:i=>Math.sin(i*W),easeInOutSine:i=>-.5*(Math.cos(B*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>se(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>se(i)?i:xi(i,.075,.3),easeOutElastic:i=>se(i)?i:yi(i,.075,.3),easeInOutElastic(i){return se(i)?i:i<.5?.5*xi(i*2,.1125,.45):.5+.5*yi(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-Yt.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?Yt.easeInBounce(i*2)*.5:Yt.easeOutBounce(i*2-1)*.5+.5};function As(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function vi(i){return As(i)?i:new Xt(i)}function De(i){return As(i)?i:new Xt(i).saturate(.5).darken(.1).hexString()}const Gn=["x","y","borderWidth","radius","tension"],Zn=["color","borderColor","backgroundColor"];function Qn(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),i.set("animations",{colors:{type:"color",properties:Zn},numbers:{type:"number",properties:Gn}}),i.describe("animations",{_fallback:"animation"}),i.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function Jn(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const wi=new Map;function to(i,t){t=t||{};const e=i+JSON.stringify(t);let s=wi.get(e);return s||(s=new Intl.NumberFormat(i,t),wi.set(e,s)),s}function eo(i,t,e){return to(t,e).format(i)}const io={values(i){return H(i)?i:""+i}};var so={formatters:io};function no(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:so.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const kt=Object.create(null),Ve=Object.create(null);function $t(i,t){if(!t)return i;const e=t.split(".");for(let s=0,n=e.length;s<n;++s){const o=e[s];i=i[o]||(i[o]=Object.create(null))}return i}function Pe(i,t,e){return typeof t=="string"?Ut($t(i,t),e):Ut($t(i,""),t)}class oo{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=s=>s.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(s,n)=>De(n.backgroundColor),this.hoverBorderColor=(s,n)=>De(n.borderColor),this.hoverColor=(s,n)=>De(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Pe(this,t,e)}get(t){return $t(this,t)}describe(t,e){return Pe(Ve,t,e)}override(t,e){return Pe(kt,t,e)}route(t,e,s,n){const o=$t(this,t),r=$t(this,s),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=r[n];return O(l)?Object.assign({},c,l):A(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var F=new oo({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Qn,Jn,no]);function ro(i){return!i||N(i.size)||N(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function ki(i,t,e,s,n){let o=t[n];return o||(o=t[n]=i.measureText(n).width,e.push(n)),o>s&&(s=o),s}function bt(i,t,e){const s=i.currentDevicePixelRatio,n=e!==0?Math.max(e/2,.5):0;return Math.round((t-n)*s)/s+n}function Si(i,t){!t&&!i||(t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore())}function Ye(i,t,e,s){Ds(i,t,e,s,null)}function Ds(i,t,e,s,n){let o,r,a,l,c,h,d,f;const u=t.pointStyle,m=t.rotation,g=t.radius;let p=(m||0)*Bn;if(u&&typeof u=="object"&&(o=u.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,s),i.rotate(p),i.drawImage(u,-u.width/2,-u.height/2,u.width,u.height),i.restore();return}if(!(isNaN(g)||g<=0)){switch(i.beginPath(),u){default:n?i.ellipse(e,s,n/2,g,0,0,z):i.arc(e,s,g,0,z),i.closePath();break;case"triangle":h=n?n/2:g,i.moveTo(e+Math.sin(p)*h,s-Math.cos(p)*g),p+=mi,i.lineTo(e+Math.sin(p)*h,s-Math.cos(p)*g),p+=mi,i.lineTo(e+Math.sin(p)*h,s-Math.cos(p)*g),i.closePath();break;case"rectRounded":c=g*.516,l=g-c,r=Math.cos(p+pt)*l,d=Math.cos(p+pt)*(n?n/2-c:l),a=Math.sin(p+pt)*l,f=Math.sin(p+pt)*(n?n/2-c:l),i.arc(e-d,s-a,c,p-B,p-W),i.arc(e+f,s-r,c,p-W,p),i.arc(e+d,s+a,c,p,p+W),i.arc(e-f,s+r,c,p+W,p+B),i.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*g,h=n?n/2:l,i.rect(e-h,s-l,2*h,2*l);break}p+=pt;case"rectRot":d=Math.cos(p)*(n?n/2:g),r=Math.cos(p)*g,a=Math.sin(p)*g,f=Math.sin(p)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+f,s-r),i.lineTo(e+d,s+a),i.lineTo(e-f,s+r),i.closePath();break;case"crossRot":p+=pt;case"cross":d=Math.cos(p)*(n?n/2:g),r=Math.cos(p)*g,a=Math.sin(p)*g,f=Math.sin(p)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+f,s-r),i.lineTo(e-f,s+r);break;case"star":d=Math.cos(p)*(n?n/2:g),r=Math.cos(p)*g,a=Math.sin(p)*g,f=Math.sin(p)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+f,s-r),i.lineTo(e-f,s+r),p+=pt,d=Math.cos(p)*(n?n/2:g),r=Math.cos(p)*g,a=Math.sin(p)*g,f=Math.sin(p)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+f,s-r),i.lineTo(e-f,s+r);break;case"line":r=n?n/2:Math.cos(p)*g,a=Math.sin(p)*g,i.moveTo(e-r,s-a),i.lineTo(e+r,s+a);break;case"dash":i.moveTo(e,s),i.lineTo(e+Math.cos(p)*(n?n/2:g),s+Math.sin(p)*g);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function Je(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.x<t.right+e&&i.y>t.top-e&&i.y<t.bottom+e}function ti(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function ei(i){i.restore()}function ao(i,t){t.translation&&i.translate(t.translation[0],t.translation[1]),N(t.rotation)||i.rotate(t.rotation),t.color&&(i.fillStyle=t.color),t.textAlign&&(i.textAlign=t.textAlign),t.textBaseline&&(i.textBaseline=t.textBaseline)}function lo(i,t,e,s,n){if(n.strikethrough||n.underline){const o=i.measureText(s),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,h=n.strikethrough?(l+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=n.decorationWidth||2,i.moveTo(r,h),i.lineTo(a,h),i.stroke()}}function co(i,t){const e=i.fillStyle;i.fillStyle=t.color,i.fillRect(t.left,t.top,t.width,t.height),i.fillStyle=e}function qt(i,t,e,s,n,o={}){const r=H(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=n.string,ao(i,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&co(i,o.backdrop),a&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),N(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(c,e,s,o.maxWidth)),i.fillText(c,e,s,o.maxWidth),lo(i,e,s,c,o),s+=Number(n.lineHeight);i.restore()}function ve(i,t){const{x:e,y:s,w:n,h:o,radius:r}=t;i.arc(e+r.topLeft,s+r.topLeft,r.topLeft,1.5*B,B,!0),i.lineTo(e,s+o-r.bottomLeft),i.arc(e+r.bottomLeft,s+o-r.bottomLeft,r.bottomLeft,B,W,!0),i.lineTo(e+n-r.bottomRight,s+o),i.arc(e+n-r.bottomRight,s+o-r.bottomRight,r.bottomRight,W,0,!0),i.lineTo(e+n,s+r.topRight),i.arc(e+n-r.topRight,s+r.topRight,r.topRight,0,-W,!0),i.lineTo(e+r.topLeft,s)}const ho=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,fo=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function uo(i,t){const e=(""+i).match(ho);if(!e||e[1]==="normal")return t*1.2;switch(i=+e[2],e[3]){case"px":return i;case"%":i/=100;break}return t*i}const go=i=>+i||0;function ii(i,t){const e={},s=O(t),n=s?Object.keys(t):t,o=O(i)?s?r=>A(i[r],i[t[r]]):r=>i[r]:()=>i;for(const r of n)e[r]=go(o(r));return e}function Ps(i){return ii(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Dt(i){return ii(i,["topLeft","topRight","bottomLeft","bottomRight"])}function Q(i){const t=Ps(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function $(i,t){i=i||{},t=t||F.font;let e=A(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=A(i.style,t.style);s&&!(""+s).match(fo)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:A(i.family,t.family),lineHeight:uo(A(i.lineHeight,t.lineHeight),e),size:e,style:s,weight:A(i.weight,t.weight),string:""};return n.string=ro(n),n}function ne(i,t,e,s){let n,o,r;for(n=0,o=i.length;n<o;++n)if(r=i[n],r!==void 0&&(t!==void 0&&typeof r=="function"&&(r=r(t)),e!==void 0&&H(r)&&(r=r[e%r.length]),r!==void 0))return r}function po(i,t,e){const{min:s,max:n}=i,o=ws(t,(n-s)/2),r=(a,l)=>e&&a===0?0:a+l;return{min:r(s,-Math.abs(o)),max:r(n,o)}}function Rt(i,t){return Object.assign(Object.create(i),t)}function si(i,t=[""],e,s,n=()=>i[0]){const o=e||i;typeof s>"u"&&(s=Es("_fallback",i));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:s,_getTarget:n,override:a=>si([a,...i],t,o,s)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete i[0][l],!0},get(a,l){return Rs(a,l,()=>ko(l,t,i,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(a,l){return Oi(a).includes(l)},ownKeys(a){return Oi(a)},set(a,l,c){const h=a._storage||(a._storage=n());return a[l]=h[l]=c,delete a._keys,!0}})}function Tt(i,t,e,s){const n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:Ts(i,s),setContext:o=>Tt(i,o,e,s),override:o=>Tt(i.override(o),t,e,s)};return new Proxy(n,{deleteProperty(o,r){return delete o[r],delete i[r],!0},get(o,r,a){return Rs(o,r,()=>bo(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(i,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,r)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,r){return Reflect.has(i,r)},ownKeys(){return Reflect.ownKeys(i)},set(o,r,a){return i[r]=a,delete o[r],!0}})}function Ts(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:n=t.allKeys}=i;return{allKeys:n,scriptable:e,indexable:s,isScriptable:dt(e)?e:()=>e,isIndexable:dt(s)?s:()=>s}}const mo=(i,t)=>i?i+Ge(t):t,ni=(i,t)=>O(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Rs(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];const s=e();return i[t]=s,s}function bo(i,t,e){const{_proxy:s,_context:n,_subProxy:o,_descriptors:r}=i;let a=s[t];return dt(a)&&r.isScriptable(t)&&(a=_o(t,a,i,e)),H(a)&&a.length&&(a=xo(t,a,i,r.isIndexable)),ni(t,a)&&(a=Tt(a,n,o&&o[t],r)),a}function _o(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_stack:a}=e;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);a.add(i);let l=t(o,r||s);return a.delete(i),ni(i,l)&&(l=oi(n._scopes,n,i,l)),l}function xo(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&s(i))return t[o.index%t.length];if(O(t[0])){const l=t,c=n._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=oi(c,n,i,h);t.push(Tt(d,o,r&&r[i],a))}}return t}function Ls(i,t,e){return dt(i)?i(t,e):i}const yo=(i,t)=>i===!0?t:typeof i=="string"?Kt(t,i):void 0;function vo(i,t,e,s,n){for(const o of t){const r=yo(e,o);if(r){i.add(r);const a=Ls(r._fallback,e,n);if(typeof a<"u"&&a!==e&&a!==s)return a}else if(r===!1&&typeof s<"u"&&e!==s)return null}return!1}function oi(i,t,e,s){const n=t._rootScopes,o=Ls(t._fallback,e,s),r=[...i,...n],a=new Set;a.add(s);let l=Mi(a,r,e,o||e,s);return l===null||typeof o<"u"&&o!==e&&(l=Mi(a,r,o,l,s),l===null)?!1:si(Array.from(a),[""],n,o,()=>wo(t,e,s))}function Mi(i,t,e,s,n){for(;e;)e=vo(i,t,e,s,n);return e}function wo(i,t,e){const s=i._getTarget();t in s||(s[t]={});const n=s[t];return H(n)&&O(e)?e:n||{}}function ko(i,t,e,s){let n;for(const o of t)if(n=Es(mo(o,i),e),typeof n<"u")return ni(i,n)?oi(e,s,i,n):n}function Es(i,t){for(const e of t){if(!e)continue;const s=e[i];if(typeof s<"u")return s}}function Oi(i){let t=i._keys;return t||(t=i._keys=So(i._scopes)),t}function So(i){const t=new Set;for(const e of i)for(const s of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(s);return Array.from(t)}function ri(){return typeof window<"u"&&typeof document<"u"}function ai(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function we(i,t,e){let s;return typeof i=="string"?(s=parseInt(i,10),i.indexOf("%")!==-1&&(s=s/100*t.parentNode[e])):s=i,s}const Me=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function Mo(i,t){return Me(i).getPropertyValue(t)}const Oo=["top","right","bottom","left"];function wt(i,t,e){const s={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=Oo[n];s[o]=parseFloat(i[t+"-"+o+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const Co=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function Ao(i,t){const e=i.touches,s=e&&e.length?e[0]:i,{offsetX:n,offsetY:o}=s;let r=!1,a,l;if(Co(n,o,i.target))a=n,l=o;else{const c=t.getBoundingClientRect();a=s.clientX-c.left,l=s.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function xt(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:s}=t,n=Me(e),o=n.boxSizing==="border-box",r=wt(n,"padding"),a=wt(n,"border","width"),{x:l,y:c,box:h}=Ao(i,e),d=r.left+(h&&a.left),f=r.top+(h&&a.top);let{width:u,height:m}=t;return o&&(u-=r.width+a.width,m-=r.height+a.height),{x:Math.round((l-d)/u*e.width/s),y:Math.round((c-f)/m*e.height/s)}}function Do(i,t,e){let s,n;if(t===void 0||e===void 0){const o=i&&ai(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const r=o.getBoundingClientRect(),a=Me(o),l=wt(a,"border","width"),c=wt(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,s=we(a.maxWidth,o,"clientWidth"),n=we(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:s||_e,maxHeight:n||_e}}const oe=i=>Math.round(i*10)/10;function Po(i,t,e,s){const n=Me(i),o=wt(n,"margin"),r=we(n.maxWidth,i,"clientWidth")||_e,a=we(n.maxHeight,i,"clientHeight")||_e,l=Do(i,t,e);let{width:c,height:h}=l;if(n.boxSizing==="content-box"){const f=wt(n,"border","width"),u=wt(n,"padding");c-=u.width+f.width,h-=u.height+f.height}return c=Math.max(0,c-o.width),h=Math.max(0,s?c/s:h-o.height),c=oe(Math.min(c,r,l.maxWidth)),h=oe(Math.min(h,a,l.maxHeight)),c&&!h&&(h=oe(c/2)),(t!==void 0||e!==void 0)&&s&&l.height&&h>l.height&&(h=l.height,c=oe(Math.floor(h*s))),{width:c,height:h}}function Ci(i,t,e){const s=t||1,n=Math.floor(i.height*s),o=Math.floor(i.width*s);i.height=Math.floor(i.height),i.width=Math.floor(i.width);const r=i.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${i.height}px`,r.style.width=`${i.width}px`),i.currentDevicePixelRatio!==s||r.height!==n||r.width!==o?(i.currentDevicePixelRatio=s,r.height=n,r.width=o,i.ctx.setTransform(s,0,0,s,0,0),!0):!1}const To=function(){let i=!1;try{const t={get passive(){return i=!0,!1}};ri()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i}();function Ai(i,t){const e=Mo(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}const Ro=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,s){return e-s},leftForLtr(e,s){return e-s}}},Lo=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function Pt(i,t,e){return i?Ro(t,e):Lo()}function Is(i,t){let e,s;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=s)}function Fs(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function re(i,t,e){return i.options.clip?i[e]:t[e]}function Eo(i,t){const{xScale:e,yScale:s}=i;return e&&s?{left:re(e,t,"left"),right:re(e,t,"right"),top:re(s,t,"top"),bottom:re(s,t,"bottom")}:t}function Io(i,t){const e=t._clip;if(e.disabled)return!1;const s=Eo(t,i.chartArea);return{left:e.left===!1?0:s.left-(e.left===!0?0:e.left),right:e.right===!1?i.width:s.right+(e.right===!0?0:e.right),top:e.top===!1?0:s.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?i.height:s.bottom+(e.bottom===!0?0:e.bottom)}}/*!
12
+ * Chart.js v4.4.9
13
13
  * https://www.chartjs.org
14
14
  * (c) 2025 Chart.js Contributors
15
15
  * Released under the MIT License
16
- */class Eo{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,s,n){const o=e.listeners[n],r=e.duration;o.forEach(a=>a({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(s-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=Os.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;const o=s.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(n.draw(),this._notify(n,s,t,"progress")),o.length||(s.running=!1,this._notify(n,s,t,"complete"),s.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((s,n)=>Math.max(s,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const s=e.items;let n=s.length-1;for(;n>=0;--n)s[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var nt=new Eo;const Di="transparent",Io={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const s=vi(i||Di),n=s.valid&&vi(t||Di);return n&&n.valid?n.mix(s,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class Fo{constructor(t,e,s,n){const o=e[s];n=ne([t.to,n,o,t.from]);const r=ne([t.from,o,n]);this._active=!0,this._fn=t.fn||Io[t.type||typeof r],this._easing=Yt[t.easing]||Yt.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=s,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);const n=this._target[this._prop],o=s-this._start,r=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=ne([t.to,e,n,t.from]),this._from=ne([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,s=this._duration,n=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e<s),!this._active){this._target[n]=a,this._notify(!0);return}if(e<0){this._target[n]=o;return}l=e/s%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){const e=t?"res":"rej",s=this._promises||[];for(let n=0;n<s.length;n++)s[n][e]()}}class zs{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!O(t))return;const e=Object.keys(F.animation),s=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const o=t[n];if(!O(o))return;const r={};for(const a of e)r[a]=o[a];(H(o.properties)&&o.properties||[n]).forEach(a=>{(a===n||!s.has(a))&&s.set(a,r)})})}_animateOptions(t,e){const s=e.options,n=Bo(t,s);if(!n)return[];const o=this._createAnimations(n,s);return s.$shared&&zo(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,e){const s=this._properties,n=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(t,e));continue}const h=e[c];let d=o[c];const f=s.get(c);if(d)if(f&&d.active()){d.update(f,h,a);continue}else d.cancel();if(!f||!f.duration){t[c]=h;continue}o[c]=d=new Fo(f,t,c,h),n.push(d)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const s=this._createAnimations(t,e);if(s.length)return nt.add(this._chart,s),!0}}function zo(i,t){const e=[],s=Object.keys(t);for(let n=0;n<s.length;n++){const o=i[s[n]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function Bo(i,t){if(!t)return;let e=i.options;if(!e){i.options=t;return}return e.$shared&&(i.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function Pi(i,t){const e=i&&i.options||{},s=e.reverse,n=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:s?o:n,end:s?n:o}}function Ho(i,t,e){if(e===!1)return!1;const s=Pi(i,e),n=Pi(t,e);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}function Wo(i){let t,e,s,n;return O(i)?(t=i.top,e=i.right,s=i.bottom,n=i.left):t=e=s=n=i,{top:t,right:e,bottom:s,left:n,disabled:i===!1}}function Bs(i,t){const e=[],s=i._getSortedDatasetMetas(t);let n,o;for(n=0,o=s.length;n<o;++n)e.push(s[n].index);return e}function Ti(i,t,e,s={}){const n=i.keys,o=s.mode==="single";let r,a,l,c;if(t===null)return;let h=!1;for(r=0,a=n.length;r<a;++r){if(l=+n[r],l===e){if(h=!0,s.all)continue;break}c=i.values[l],at(c)&&(o||t===0||bi(t)===bi(c))&&(t+=c)}return!h&&!s.all?0:t}function jo(i,t){const{iScale:e,vScale:s}=t,n=e.axis==="x"?"x":"y",o=s.axis==="x"?"x":"y",r=Object.keys(i),a=new Array(r.length);let l,c,h;for(l=0,c=r.length;l<c;++l)h=r[l],a[l]={[n]:h,[o]:i[h]};return a}function Te(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function No(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function Vo(i){const{min:t,max:e,minDefined:s,maxDefined:n}=i.getUserBounds();return{min:s?t:Number.NEGATIVE_INFINITY,max:n?e:Number.POSITIVE_INFINITY}}function Yo(i,t,e){const s=i[t]||(i[t]={});return s[e]||(s[e]={})}function Ri(i,t,e,s){for(const n of t.getMatchingVisibleMetas(s).reverse()){const o=i[n.index];if(e&&o>0||!e&&o<0)return n.index}return null}function Li(i,t){const{chart:e,_cachedMeta:s}=i,n=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=s,l=o.axis,c=r.axis,h=No(o,r,s),d=t.length;let f;for(let u=0;u<d;++u){const m=t[u],{[l]:g,[c]:p}=m,b=m._stacks||(m._stacks={});f=b[c]=Yo(n,h,g),f[a]=p,f._top=Ri(f,r,!0,s.type),f._bottom=Ri(f,r,!1,s.type);const _=f._visualValues||(f._visualValues={});_[a]=p}}function Re(i,t){const e=i.scales;return Object.keys(e).filter(s=>e[s].axis===t).shift()}function $o(i,t){return Rt(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Xo(i,t,e){return Rt(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function It(i,t){const e=i.controller.index,s=i.vScale&&i.vScale.axis;if(s){t=t||i._parsed;for(const n of t){const o=n._stacks;if(!o||o[s]===void 0||o[s][e]===void 0)return;delete o[s][e],o[s]._visualValues!==void 0&&o[s]._visualValues[e]!==void 0&&delete o[s]._visualValues[e]}}}const Le=i=>i==="reset"||i==="none",Ei=(i,t)=>t?i:Object.assign({},i),Uo=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Bs(e,!0),values:null};class Hs{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(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Te(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&&It(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(d,f,u,m)=>d==="x"?f:d==="r"?m:u,o=e.xAxisID=A(s.xAxisID,Re(t,"x")),r=e.yAxisID=A(s.yAxisID,Re(t,"y")),a=e.rAxisID=A(s.rAxisID,Re(t,"r")),l=e.indexAxis,c=e.iAxisID=n(l,o,r,a),h=e.vAxisID=n(l,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&_i(this._data,this),t._stacked&&It(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(O(e)){const n=this._cachedMeta;this._data=jo(e,n)}else if(s!==e){if(s){_i(s,this);const n=this._cachedMeta;It(n),n._parsed=[]}e&&Object.isExtensible(e)&&Xn(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,s=this.getDataset();let n=!1;this._dataCheck();const o=e._stacked;e._stacked=Te(e.vScale,e),e.stack!==s.stack&&(n=!0,It(e),e.stack=s.stack),this._resyncElements(t),(n||o!==e._stacked)&&(Li(this,e._parsed),e._stacked=Te(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:s,_data:n}=this,{iScale:o,_stacked:r}=s,a=o.axis;let l=t===0&&e===n.length?!0:s._sorted,c=t>0&&s._parsed[t-1],h,d,f;if(this._parsing===!1)s._parsed=n,s._sorted=!0,f=n;else{H(n[t])?f=this.parseArrayData(s,n,t,e):O(n[t])?f=this.parseObjectData(s,n,t,e):f=this.parsePrimitiveData(s,n,t,e);const u=()=>d[a]===null||c&&d[a]<c[a];for(h=0;h<e;++h)s._parsed[h+t]=d=f[h],l&&(u()&&(l=!1),c=d);s._sorted=l}r&&Li(this,f)}parsePrimitiveData(t,e,s,n){const{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),h=o===r,d=new Array(n);let f,u,m;for(f=0,u=n;f<u;++f)m=f+s,d[f]={[a]:h||o.parse(c[m],m),[l]:r.parse(e[m],m)};return d}parseArrayData(t,e,s,n){const{xScale:o,yScale:r}=t,a=new Array(n);let l,c,h,d;for(l=0,c=n;l<c;++l)h=l+s,d=e[h],a[l]={x:o.parse(d[0],h),y:r.parse(d[1],h)};return a}parseObjectData(t,e,s,n){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(n);let h,d,f,u;for(h=0,d=n;h<d;++h)f=h+s,u=e[f],c[h]={x:o.parse(Kt(u,a),f),y:r.parse(Kt(u,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,s){const n=this.chart,o=this._cachedMeta,r=e[t.axis],a={keys:Bs(n,!0),values:e._stacks[t.axis]._visualValues};return Ti(a,r,o.index,{mode:s})}updateRangeFromParsed(t,e,s,n){const o=s[e.axis];let r=o===null?NaN:o;const a=n&&s._stacks[e.axis];n&&a&&(n.values=a,r=Ti(n,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,e){const s=this._cachedMeta,n=s._parsed,o=s._sorted&&t===s.iScale,r=n.length,a=this._getOtherScale(t),l=Uo(e,s,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=Vo(a);let f,u;function m(){u=n[f];const g=u[a.axis];return!at(u[t.axis])||h>g||d<g}for(f=0;f<r&&!(!m()&&(this.updateRangeFromParsed(c,t,u,l),o));++f);if(o){for(f=r-1;f>=0;--f)if(!m()){this.updateRangeFromParsed(c,t,u,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,s=[];let n,o,r;for(n=0,o=e.length;n<o;++n)r=e[n][t.axis],at(r)&&s.push(r);return s}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,s=e.iScale,n=e.vScale,o=this.getParsed(t);return{label:s?""+s.getLabelForValue(o[s.axis]):"",value:n?""+n.getLabelForValue(o[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Wo(A(this.options.clip,Ho(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,s=this._cachedMeta,n=s.data||[],o=e.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||n.length-a,c=this.options.drawActiveElementsOnTop;let h;for(s.dataset&&s.dataset.draw(t,o,a,l),h=a;h<a+l;++h){const d=n[h];d.hidden||(d.active&&c?r.push(d):d.draw(t,o))}for(h=0;h<r.length;++h)r[h].draw(t,o)}getStyle(t,e){const s=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(t||0,s)}getContext(t,e,s){const n=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const r=this._cachedMeta.data[t];o=r.$context||(r.$context=Xo(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=n.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=$o(this.chart.getContext(),this.index)),o.dataset=n,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=s,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",s){const n=e==="active",o=this._cachedDataOpts,r=t+"-"+e,a=o[r],l=this.enableOptionSharing&&be(s);if(a)return Ei(a,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),d=n?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),h),u=Object.keys(F.elements[t]),m=()=>this.getContext(s,n,e),g=c.resolveNamedOptions(f,u,m,d);return g.$shared&&(g.$shared=l,o[r]=Object.freeze(Ei(g,l))),g}_resolveAnimations(t,e,s){const n=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let l;if(n.options.animation!==!1){const h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),f=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(f,this.getContext(t,s,e))}const c=new zs(n,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Le(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const s=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(s),r=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,s),{sharedOptions:o,includeOptions:r}}updateElement(t,e,s,n){Le(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!Le(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,s,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,s=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const n=s.length,o=e.length,r=Math.min(o,n);r&&this.parse(0,r),o>n?this._insertElements(n,o-n,t):o<n&&this._removeElements(o,n-o)}_insertElements(t,e,s=!0){const n=this._cachedMeta,o=n.data,r=t+e;let a;const l=c=>{for(c.length+=e,a=c.length-1;a>=r;a--)c[a]=c[a-e]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(n._parsed),this.parse(t,e),s&&this.updateElements(o,t,e,"reset")}updateElements(t,e,s,n){}_removeElements(t,e){const s=this._cachedMeta;if(this._parsing){const n=s._parsed.splice(t,e);s._stacked&&It(s,n)}s.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,s,n]=t;this[e](s,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const 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]);const s=arguments.length-2;s&&this._sync(["_insertElements",t,s])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function Ko(i,t,e){let s=1,n=1,o=0,r=0;if(t<z){const a=i,l=a+t,c=Math.cos(a),h=Math.sin(a),d=Math.cos(l),f=Math.sin(l),u=(x,y,v)=>ye(x,a,l,!0)?1:Math.max(y,y*e,v,v*e),m=(x,y,v)=>ye(x,a,l,!0)?-1:Math.min(y,y*e,v,v*e),g=u(0,c,d),p=u(W,h,f),b=m(B,c,d),_=m(B+W,h,f);s=(g-b)/2,n=(p-_)/2,o=-(g+b)/2,r=-(p+_)/2}return{ratioX:s,ratioY:n,offsetX:o,offsetY:r}}class qo extends Hs{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=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:s,color:n}}=t.legend.options;return e.labels.map((o,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:n,lineWidth:l.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,e,s){s.chart.toggleDataVisibility(e.index),s.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){const s=this.getDataset().data,n=this._cachedMeta;if(this._parsing===!1)n._parsed=s;else{let o=l=>+s[l];if(O(s[t])){const{key:l="value"}=this._parsing;o=c=>+Kt(s[c],l)}let r,a;for(r=t,a=t+e;r<a;++r)n._parsed[r]=o(r)}}_getRotation(){return yt(this.options.rotation-90)}_getCircumference(){return yt(this.options.circumference)}_getRotationExtents(){let t=z,e=-z;for(let s=0;s<this.chart.data.datasets.length;++s)if(this.chart.isDatasetVisible(s)&&this.chart.getDatasetMeta(s).type===this._type){const n=this.chart.getDatasetMeta(s).controller,o=n._getRotation(),r=n._getCircumference();t=Math.min(t,o),e=Math.max(e,o+r)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:s}=e,n=this._cachedMeta,o=n.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(s.width,s.height)-r)/2,0),l=Math.min(Rn(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:h,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:u,offsetX:m,offsetY:g}=Ko(d,h,l),p=(s.width-r)/f,b=(s.height-r)/u,_=Math.max(Math.min(p,b)/2,0),x=ws(this.options.radius,_),y=Math.max(x*l,0),v=(x-y)/this._getVisibleDatasetWeightTotal();this.offsetX=m*x,this.offsetY=g*x,n.total=this.calculateTotal(),this.outerRadius=x-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const s=this.options,n=this._cachedMeta,o=this._getCircumference();return e&&s.animation.animateRotate||!this.chart.getDataVisibility(t)||n._parsed[t]===null||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*o/z)}updateElements(t,e,s,n){const o=n==="reset",r=this.chart,a=r.chartArea,c=r.options.animation,h=(a.left+a.right)/2,d=(a.top+a.bottom)/2,f=o&&c.animateScale,u=f?0:this.innerRadius,m=f?0:this.outerRadius,{sharedOptions:g,includeOptions:p}=this._getSharedOptions(e,n);let b=this._getRotation(),_;for(_=0;_<e;++_)b+=this._circumference(_,o);for(_=e;_<e+s;++_){const x=this._circumference(_,o),y=t[_],v={x:h+this.offsetX,y:d+this.offsetY,startAngle:b,endAngle:b+x,circumference:x,outerRadius:m,innerRadius:u};p&&(v.options=g||this.resolveDataElementOptions(_,y.active?"active":n)),b+=x,this.updateElement(y,_,v,n)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let s=0,n;for(n=0;n<e.length;n++){const o=t._parsed[n];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(n)&&!e[n].hidden&&(s+=Math.abs(o))}return s}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?z*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart,n=s.data.labels||[],o=eo(e._parsed[t],s.options.locale);return{label:n[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const s=this.chart;let n,o,r,a,l;if(!t){for(n=0,o=s.data.datasets.length;n<o;++n)if(s.isDatasetVisible(n)){r=s.getDatasetMeta(n),t=r.data,a=r.controller;break}}if(!t)return 0;for(n=0,o=t.length;n<o;++n)l=a.resolveDataElementOptions(n),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let s=0,n=t.length;s<n;++s){const o=this.resolveDataElementOptions(s);e=Math.max(e,o.offset||0,o.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let s=0;s<t;++s)this.chart.isDatasetVisible(s)&&(e+=this._getRingWeight(s));return e}_getRingWeight(t){return Math.max(A(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}function _t(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class li{static override(t){Object.assign(li.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return _t()}parse(){return _t()}format(){return _t()}add(){return _t()}diff(){return _t()}startOf(){return _t()}endOf(){return _t()}}var Go={_date:li};function Zo(i,t,e,s){const{controller:n,data:o,_sorted:r}=i,a=n._cachedMeta.iScale,l=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const c=a._reversePixels?Yn:Ne;if(s){if(n._sharedOptions){const h=o[0],d=typeof h.getRange=="function"&&h.getRange(t);if(d){const f=c(o,t,e-d),u=c(o,t,e+d);return{lo:f.lo,hi:u.hi}}}}else{const h=c(o,t,e);if(l){const{vScale:d}=n._cachedMeta,{_parsed:f}=i,u=f.slice(0,h.lo+1).reverse().findIndex(g=>!N(g[d.axis]));h.lo-=Math.max(0,u);const m=f.slice(h.hi).findIndex(g=>!N(g[d.axis]));h.hi+=Math.max(0,m)}return h}}return{lo:0,hi:o.length-1}}function Oe(i,t,e,s,n){const o=i.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:h}=o[a],{lo:d,hi:f}=Zo(o[a],t,r,n);for(let u=d;u<=f;++u){const m=h[u];m.skip||s(m,c,u)}}}function Qo(i){const t=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(s,n){const o=t?Math.abs(s.x-n.x):0,r=e?Math.abs(s.y-n.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function Ee(i,t,e,s,n){const o=[];return!n&&!i.isPointInArea(t)||Oe(i,e,t,function(a,l,c){!n&&!Je(a,i.chartArea,0)||a.inRange(t.x,t.y,s)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function Jo(i,t,e,s){let n=[];function o(r,a,l){const{startAngle:c,endAngle:h}=r.getProps(["startAngle","endAngle"],s),{angle:d}=Ss(r,{x:t.x,y:t.y});ye(d,c,h)&&n.push({element:r,datasetIndex:a,index:l})}return Oe(i,e,t,o),n}function tr(i,t,e,s,n,o){let r=[];const a=Qo(e);let l=Number.POSITIVE_INFINITY;function c(h,d,f){const u=h.inRange(t.x,t.y,n);if(s&&!u)return;const m=h.getCenterPoint(n);if(!(!!o||i.isPointInArea(m))&&!u)return;const p=a(t,m);p<l?(r=[{element:h,datasetIndex:d,index:f}],l=p):p===l&&r.push({element:h,datasetIndex:d,index:f})}return Oe(i,e,t,c),r}function Ie(i,t,e,s,n,o){return!o&&!i.isPointInArea(t)?[]:e==="r"&&!s?Jo(i,t,e,n):tr(i,t,e,s,n,o)}function Ii(i,t,e,s,n){const o=[],r=e==="x"?"inXRange":"inYRange";let a=!1;return Oe(i,e,t,(l,c,h)=>{l[r]&&l[r](t[e],n)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,n))}),s&&!a?[]:o}var er={modes:{index(i,t,e,s){const n=xt(t,i),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?Ee(i,n,o,s,r):Ie(i,n,o,!1,s,r),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,s){const n=xt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?Ee(i,n,o,s,r):Ie(i,n,o,!1,s,r);if(a.length>0){const l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let h=0;h<c.length;++h)a.push({element:c[h],datasetIndex:l,index:h})}return a},point(i,t,e,s){const n=xt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return Ee(i,n,o,s,r)},nearest(i,t,e,s){const n=xt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return Ie(i,n,o,e.intersect,s,r)},x(i,t,e,s){const n=xt(t,i);return Ii(i,n,"x",e.intersect,s)},y(i,t,e,s){const n=xt(t,i);return Ii(i,n,"y",e.intersect,s)}}};const Ws=["left","top","right","bottom"];function Ft(i,t){return i.filter(e=>e.pos===t)}function Fi(i,t){return i.filter(e=>Ws.indexOf(e.pos)===-1&&e.box.axis===t)}function zt(i,t){return i.sort((e,s)=>{const n=t?s:e,o=t?e:s;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function ir(i){const t=[];let e,s,n,o,r,a;for(e=0,s=(i||[]).length;e<s;++e)n=i[e],{position:o,options:{stack:r,stackWeight:a=1}}=n,t.push({index:e,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:r&&o+r,stackWeight:a});return t}function sr(i){const t={};for(const e of i){const{stack:s,pos:n,stackWeight:o}=e;if(!s||!Ws.includes(n))continue;const r=t[s]||(t[s]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function nr(i,t){const e=sr(i),{vBoxMaxWidth:s,hBoxMaxHeight:n}=t;let o,r,a;for(o=0,r=i.length;o<r;++o){a=i[o];const{fullSize:l}=a.box,c=e[a.stack],h=c&&a.stackWeight/c.weight;a.horizontal?(a.width=h?h*s:l&&t.availableWidth,a.height=n):(a.width=s,a.height=h?h*n:l&&t.availableHeight)}return e}function or(i){const t=ir(i),e=zt(t.filter(c=>c.box.fullSize),!0),s=zt(Ft(t,"left"),!0),n=zt(Ft(t,"right")),o=zt(Ft(t,"top"),!0),r=zt(Ft(t,"bottom")),a=Fi(t,"x"),l=Fi(t,"y");return{fullSize:e,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(r).concat(a),chartArea:Ft(t,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(r).concat(a)}}function zi(i,t,e,s){return Math.max(i[e],t[e])+Math.max(i[s],t[s])}function js(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function rr(i,t,e,s){const{pos:n,box:o}=e,r=i.maxPadding;if(!O(n)){e.size&&(i[n]-=e.size);const d=s[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,i[n]+=e.size}o.getPadding&&js(r,o.getPadding());const a=Math.max(0,t.outerWidth-zi(r,i,"left","right")),l=Math.max(0,t.outerHeight-zi(r,i,"top","bottom")),c=a!==i.w,h=l!==i.h;return i.w=a,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function ar(i){const t=i.maxPadding;function e(s){const n=Math.max(t[s]-i[s],0);return i[s]+=n,n}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function lr(i,t){const e=t.maxPadding;function s(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return s(i?["left","right"]:["top","bottom"])}function jt(i,t,e,s){const n=[];let o,r,a,l,c,h;for(o=0,r=i.length,c=0;o<r;++o){a=i[o],l=a.box,l.update(a.width||t.w,a.height||t.h,lr(a.horizontal,t));const{same:d,other:f}=rr(t,e,a,s);c|=d&&n.length,h=h||f,l.fullSize||n.push(a)}return c&&jt(n,t,e,s)||h}function re(i,t,e,s,n){i.top=e,i.left=t,i.right=t+s,i.bottom=e+n,i.width=s,i.height=n}function Bi(i,t,e,s){const n=e.padding;let{x:o,y:r}=t;for(const a of i){const l=a.box,c=s[a.stack]||{placed:0,weight:1},h=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*h,f=c.size||l.height;be(c.start)&&(r=c.start),l.fullSize?re(l,n.left,r,e.outerWidth-n.right-n.left,f):re(l,t.left+c.placed,r,d,f),c.start=r,c.placed+=d,r=l.bottom}else{const d=t.h*h,f=c.size||l.width;be(c.start)&&(o=c.start),l.fullSize?re(l,o,n.top,f,e.outerHeight-n.bottom-n.top):re(l,o,t.top+c.placed,f,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=r}var Z={addBox(i,t){i.boxes||(i.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},i.boxes.push(t)},removeBox(i,t){const e=i.boxes?i.boxes.indexOf(t):-1;e!==-1&&i.boxes.splice(e,1)},configure(i,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(i,t,e,s){if(!i)return;const n=Q(i.options.layout.padding),o=Math.max(t-n.width,0),r=Math.max(e-n.height,0),a=or(i.boxes),l=a.vertical,c=a.horizontal;P(i.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const h=l.reduce((g,p)=>p.box.options&&p.box.options.display===!1?g:g+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),f=Object.assign({},n);js(f,Q(s));const u=Object.assign({maxPadding:f,w:o,h:r,x:n.left,y:n.top},n),m=nr(l.concat(c),d);jt(a.fullSize,u,d,m),jt(l,u,d,m),jt(c,u,d,m)&&jt(l,u,d,m),ar(u),Bi(a.leftAndTop,u,d,m),u.x+=u.w,u.y+=u.h,Bi(a.rightAndBottom,u,d,m),i.chartArea={left:u.left,top:u.top,right:u.left+u.w,bottom:u.top+u.h,height:u.h,width:u.w},P(a.chartArea,g=>{const p=g.box;Object.assign(p,i.chartArea),p.update(u.w,u.h,{left:0,top:0,right:0,bottom:0})})}};class Ns{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,n){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):s)}}isAttached(t){return!0}updateConfig(t){}}class cr extends Ns{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ue="$chartjs",hr={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Hi=i=>i===null||i==="";function dr(i,t){const e=i.style,s=i.getAttribute("height"),n=i.getAttribute("width");if(i[ue]={initial:{height:s,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Hi(n)){const o=Ai(i,"width");o!==void 0&&(i.width=o)}if(Hi(s))if(i.style.height==="")i.height=i.width/(t||2);else{const o=Ai(i,"height");o!==void 0&&(i.height=o)}return i}const Vs=To?{passive:!0}:!1;function fr(i,t,e){i&&i.addEventListener(t,e,Vs)}function ur(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,Vs)}function gr(i,t){const e=hr[i.type]||i.type,{x:s,y:n}=xt(i,t);return{type:e,chart:t,native:i,x:s!==void 0?s:null,y:n!==void 0?n:null}}function ke(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function pr(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||ke(a.addedNodes,s),r=r&&!ke(a.removedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function mr(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||ke(a.removedNodes,s),r=r&&!ke(a.addedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const Gt=new Map;let Wi=0;function Ys(){const i=window.devicePixelRatio;i!==Wi&&(Wi=i,Gt.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function br(i,t){Gt.size||window.addEventListener("resize",Ys),Gt.set(i,t)}function _r(i){Gt.delete(i),Gt.size||window.removeEventListener("resize",Ys)}function xr(i,t,e){const s=i.canvas,n=s&&ai(s);if(!n)return;const o=Cs((a,l)=>{const c=n.clientWidth;e(a,l),c<n.clientWidth&&e()},window),r=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return r.observe(n),br(i,o),r}function Fe(i,t,e){e&&e.disconnect(),t==="resize"&&_r(i)}function yr(i,t,e){const s=i.canvas,n=Cs(o=>{i.ctx!==null&&e(gr(o,i))},i);return fr(s,t,n),n}class vr extends Ns{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(dr(t,e),s):null}releaseContext(t){const e=t.canvas;if(!e[ue])return!1;const s=e[ue].initial;["height","width"].forEach(o=>{const r=s[o];N(r)?e.removeAttribute(o):e.setAttribute(o,r)});const n=s.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[ue],!0}addEventListener(t,e,s){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:pr,detach:mr,resize:xr}[e]||yr;n[e]=r(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={}),n=s[e];if(!n)return;({attach:Fe,detach:Fe,resize:Fe}[e]||ur)(t,e,n),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,n){return Po(t,e,s,n)}isAttached(t){const e=t&&ai(t);return!!(e&&e.isConnected)}}function wr(i){return!ri()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?cr:vr}class ft{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}hasValue(){return xe(this.x)&&xe(this.y)}getProps(t,e){const s=this.$animations;if(!e||!s)return this;const n={};return t.forEach(o=>{n[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),n}}function kr(i,t){const e=i.options.ticks,s=Sr(i),n=Math.min(e.maxTicksLimit||s,s),o=e.major.enabled?Or(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>n)return Cr(t,c,o,r/n),c;const h=Mr(o,t,n);if(r>0){let d,f;const u=r>1?Math.round((l-a)/(r-1)):null;for(ae(t,c,h,N(u)?0:a-u,a),d=0,f=r-1;d<f;d++)ae(t,c,h,o[d],o[d+1]);return ae(t,c,h,l,N(u)?t.length:l+u),c}return ae(t,c,h),c}function Sr(i){const t=i.options.offset,e=i._tickSize(),s=i._length/e+(t?0:1),n=i._maxLength/e;return Math.floor(Math.min(s,n))}function Mr(i,t,e){const s=Ar(i),n=t.length/e;if(!s)return Math.max(n,1);const o=Hn(s);for(let r=0,a=o.length-1;r<a;r++){const l=o[r];if(l>n)return l}return Math.max(n,1)}function Or(i){const t=[];let e,s;for(e=0,s=i.length;e<s;e++)i[e].major&&t.push(e);return t}function Cr(i,t,e,s){let n=0,o=e[0],r;for(s=Math.ceil(s),r=0;r<i.length;r++)r===o&&(t.push(i[r]),n++,o=e[n*s])}function ae(i,t,e,s,n){const o=A(s,0),r=Math.min(A(n,i.length),i.length);let a=0,l,c,h;for(e=Math.ceil(e),n&&(l=n-s,e=l/Math.floor(l/e)),h=o;h<0;)a++,h=Math.round(o+a*e);for(c=Math.max(o,0);c<r;c++)c===h&&(t.push(i[c]),a++,h=Math.round(o+a*e))}function Ar(i){const t=i.length;let e,s;if(t<2)return!1;for(s=i[0],e=1;e<t;++e)if(i[e]-i[e-1]!==s)return!1;return s}const Dr=i=>i==="left"?"right":i==="right"?"left":i,ji=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,Ni=(i,t)=>Math.min(t||i,i);function Vi(i,t){const e=[],s=i.length/t,n=i.length;let o=0;for(;o<n;o+=s)e.push(i[Math.floor(o)]);return e}function Pr(i,t,e){const s=i.ticks.length,n=Math.min(t,s-1),o=i._startPixel,r=i._endPixel,a=1e-6;let l=i.getPixelForTick(n),c;if(!(e&&(s===1?c=Math.max(l-o,r-l):t===0?c=(i.getPixelForTick(1)-l)/2:c=(l-i.getPixelForTick(n-1))/2,l+=n<t?c:-c,l<o-a||l>r+a)))return l}function Tr(i,t){P(i,e=>{const s=e.gc,n=s.length/2;let o;if(n>t){for(o=0;o<n;++o)delete e.data[s[o]];s.splice(0,n)}})}function Bt(i){return i.drawTicks?i.tickLength:0}function Yi(i,t){if(!i.display)return 0;const e=$(i.font,t),s=Q(i.padding);return(H(i.text)?i.text.length:1)*e.lineHeight+s.height}function Rr(i,t){return Rt(i,{scale:t,type:"scale"})}function Lr(i,t,e){return Rt(i,{tick:e,index:t,type:"tick"})}function Er(i,t,e){let s=Qe(i);return(e&&t!=="right"||!e&&t==="right")&&(s=Dr(s)),s}function Ir(i,t,e,s){const{top:n,left:o,bottom:r,right:a,chart:l}=i,{chartArea:c,scales:h}=l;let d=0,f,u,m;const g=r-n,p=a-o;if(i.isHorizontal()){if(u=Y(s,o,a),O(e)){const b=Object.keys(e)[0],_=e[b];m=h[b].getPixelForValue(_)+g-t}else e==="center"?m=(c.bottom+c.top)/2+g-t:m=ji(i,e,t);f=a-o}else{if(O(e)){const b=Object.keys(e)[0],_=e[b];u=h[b].getPixelForValue(_)-p+t}else e==="center"?u=(c.left+c.right)/2-p+t:u=ji(i,e,t);m=Y(s,r,n),d=e==="left"?-W:W}return{titleX:u,titleY:m,maxWidth:f,rotation:d}}class Qt extends ft{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:s,_suggestedMax:n}=this;return t=tt(t,Number.POSITIVE_INFINITY),e=tt(e,Number.NEGATIVE_INFINITY),s=tt(s,Number.POSITIVE_INFINITY),n=tt(n,Number.NEGATIVE_INFINITY),{min:tt(t,s),max:tt(e,n),minDefined:at(t),maxDefined:at(e)}}getMinMax(t){let{min:e,max:s,minDefined:n,maxDefined:o}=this.getUserBounds(),r;if(n&&o)return{min:e,max:s};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),n||(e=Math.min(e,r.min)),o||(s=Math.max(s,r.max));return e=o&&e>s?s:e,s=n&&e>s?e:s,{min:tt(e,tt(s,e)),max:tt(s,tt(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const 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(){L(this.options.beforeUpdate,[this])}update(t,e,s){const{beginAtZero:n,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=po(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Vi(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=kr(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,s;this.isHorizontal()?(e=this.left,s=this.right):(e=this.top,s=this.bottom,t=!t),this._startPixel=e,this._endPixel=s,this._reversePixels=t,this._length=s-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){L(this.options.afterUpdate,[this])}beforeSetDimensions(){L(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(){L(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),L(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){L(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let s,n,o;for(s=0,n=t.length;s<n;s++)o=t[s],o.label=L(e.callback,[o.value,s,t],this)}afterTickToLabelConversion(){L(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){L(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,s=Ni(this.ticks.length,t.ticks.maxTicksLimit),n=e.minRotation||0,o=e.maxRotation;let r=n,a,l,c;if(!this._isVisible()||!e.display||n>=o||s<=1||!this.isHorizontal()){this.labelRotation=n;return}const h=this._getLabelSizes(),d=h.widest.width,f=h.highest.height,u=K(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/s:u/(s-1),d+6>a&&(a=u/(s-(t.offset?.5:1)),l=this.maxHeight-Bt(t.grid)-e.padding-Yi(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),r=jn(Math.min(Math.asin(K((h.highest.height+6)/a,-1,1)),Math.asin(K(l/c,-1,1))-Math.asin(K(f/c,-1,1)))),r=Math.max(n,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){L(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){L(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:s,title:n,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=Yi(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=Bt(o)+l):(t.height=this.maxHeight,t.width=Bt(o)+l),s.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:f}=this._getLabelSizes(),u=s.padding*2,m=yt(this.labelRotation),g=Math.cos(m),p=Math.sin(m);if(a){const b=s.mirror?0:p*d.width+g*f.height;t.height=Math.min(this.maxHeight,t.height+b+u)}else{const b=s.mirror?0:g*d.width+p*f.height;t.width=Math.min(this.maxWidth,t.width+b+u)}this._calculatePadding(c,h,p,g)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,s,n){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,u=0;l?c?(f=n*t.width,u=s*e.height):(f=s*t.height,u=n*e.width):o==="start"?u=e.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,u=e.width/2),this.paddingLeft=Math.max((f-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((u-d+r)*this.width/(this.width-d),0)}else{let h=e.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=e.height,d=0),this.paddingTop=h+r,this.paddingBottom=d+r}}_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(){L(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e<s;e++)N(t[e].label)&&(t.splice(e,1),s--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let s=this.ticks;e<s.length&&(s=Vi(s,e)),this._labelSizes=t=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,s){const{ctx:n,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(e/Ni(e,s));let c=0,h=0,d,f,u,m,g,p,b,_,x,y,v;for(d=0;d<e;d+=l){if(m=t[d].label,g=this._resolveTickFontOptions(d),n.font=p=g.string,b=o[p]=o[p]||{data:{},gc:[]},_=g.lineHeight,x=y=0,!N(m)&&!H(m))x=ki(n,b.data,b.gc,x,m),y=_;else if(H(m))for(f=0,u=m.length;f<u;++f)v=m[f],!N(v)&&!H(v)&&(x=ki(n,b.data,b.gc,x,v),y+=_);r.push(x),a.push(y),c=Math.max(x,c),h=Math.max(y,h)}Tr(o,e);const w=r.indexOf(c),S=a.indexOf(h),k=R=>({width:r[R]||0,height:a[R]||0});return{first:k(0),last:k(e-1),widest:k(w),highest:k(S),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Vn(this._alignToPixels?bt(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const s=e[t];return s.$context||(s.$context=Lr(this.getContext(),t,s))}return this.$context||(this.$context=Rr(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=yt(this.labelRotation),s=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*s>a*n?a/s:l/n:l*n<a*s?l/s:a/n}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,s=this.chart,n=this.options,{grid:o,position:r,border:a}=n,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=Bt(o),u=[],m=a.setContext(this.getContext()),g=m.display?m.width:0,p=g/2,b=function(E){return bt(s,E,g)};let _,x,y,v,w,S,k,R,M,D,C,j;if(r==="top")_=b(this.bottom),S=this.bottom-f,R=_-p,D=b(t.top)+p,j=t.bottom;else if(r==="bottom")_=b(this.top),D=t.top,j=b(t.bottom)-p,S=_+p,R=this.top+f;else if(r==="left")_=b(this.right),w=this.right-f,k=_-p,M=b(t.left)+p,C=t.right;else if(r==="right")_=b(this.left),M=t.left,C=b(t.right)-p,w=_+p,k=this.left+f;else if(e==="x"){if(r==="center")_=b((t.top+t.bottom)/2+.5);else if(O(r)){const E=Object.keys(r)[0],I=r[E];_=b(this.chart.scales[E].getPixelForValue(I))}D=t.top,j=t.bottom,S=_+p,R=S+f}else if(e==="y"){if(r==="center")_=b((t.left+t.right)/2);else if(O(r)){const E=Object.keys(r)[0],I=r[E];_=b(this.chart.scales[E].getPixelForValue(I))}w=_-p,k=w-f,M=t.left,C=t.right}const q=A(n.ticks.maxTicksLimit,d),T=Math.max(1,Math.ceil(d/q));for(x=0;x<d;x+=T){const E=this.getContext(x),I=o.setContext(E),J=a.setContext(E),V=I.lineWidth,St=I.color,Jt=J.dash||[],Mt=J.dashOffset,Lt=I.tickWidth,ut=I.tickColor,Et=I.tickBorderDash||[],gt=I.tickBorderDashOffset;y=Pr(this,x,l),y!==void 0&&(v=bt(s,y,V),c?w=k=M=C=v:S=R=D=j=v,u.push({tx1:w,ty1:S,tx2:k,ty2:R,x1:M,y1:D,x2:C,y2:j,width:V,color:St,borderDash:Jt,borderDashOffset:Mt,tickWidth:Lt,tickColor:ut,tickBorderDash:Et,tickBorderDashOffset:gt}))}return this._ticksLength=d,this._borderValue=_,u}_computeLabelItems(t){const e=this.axis,s=this.options,{position:n,ticks:o}=s,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=o,f=Bt(s.grid),u=f+h,m=d?-h:u,g=-yt(this.labelRotation),p=[];let b,_,x,y,v,w,S,k,R,M,D,C,j="middle";if(n==="top")w=this.bottom-m,S=this._getXAxisLabelAlignment();else if(n==="bottom")w=this.top+m,S=this._getXAxisLabelAlignment();else if(n==="left"){const T=this._getYAxisLabelAlignment(f);S=T.textAlign,v=T.x}else if(n==="right"){const T=this._getYAxisLabelAlignment(f);S=T.textAlign,v=T.x}else if(e==="x"){if(n==="center")w=(t.top+t.bottom)/2+u;else if(O(n)){const T=Object.keys(n)[0],E=n[T];w=this.chart.scales[T].getPixelForValue(E)+u}S=this._getXAxisLabelAlignment()}else if(e==="y"){if(n==="center")v=(t.left+t.right)/2-u;else if(O(n)){const T=Object.keys(n)[0],E=n[T];v=this.chart.scales[T].getPixelForValue(E)}S=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?j="top":l==="end"&&(j="bottom"));const q=this._getLabelSizes();for(b=0,_=a.length;b<_;++b){x=a[b],y=x.label;const T=o.setContext(this.getContext(b));k=this.getPixelForTick(b)+o.labelOffset,R=this._resolveTickFontOptions(b),M=R.lineHeight,D=H(y)?y.length:1;const E=D/2,I=T.color,J=T.textStrokeColor,V=T.textStrokeWidth;let St=S;r?(v=k,S==="inner"&&(b===_-1?St=this.options.reverse?"left":"right":b===0?St=this.options.reverse?"right":"left":St="center"),n==="top"?c==="near"||g!==0?C=-D*M+M/2:c==="center"?C=-q.highest.height/2-E*M+M:C=-q.highest.height+M/2:c==="near"||g!==0?C=M/2:c==="center"?C=q.highest.height/2-E*M:C=q.highest.height-D*M,d&&(C*=-1),g!==0&&!T.showLabelBackdrop&&(v+=M/2*Math.sin(g))):(w=k,C=(1-D)*M/2);let Jt;if(T.showLabelBackdrop){const Mt=Q(T.backdropPadding),Lt=q.heights[b],ut=q.widths[b];let Et=C-Mt.top,gt=0-Mt.left;switch(j){case"middle":Et-=Lt/2;break;case"bottom":Et-=Lt;break}switch(S){case"center":gt-=ut/2;break;case"right":gt-=ut;break;case"inner":b===_-1?gt-=ut:b>0&&(gt-=ut/2);break}Jt={left:gt,top:Et,width:ut+Mt.width,height:Lt+Mt.height,color:T.backdropColor}}p.push({label:y,font:R,textOffset:C,options:{rotation:g,color:I,strokeColor:J,strokeWidth:V,textAlign:St,textBaseline:j,translation:[v,w],backdrop:Jt}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-yt(this.labelRotation))return t==="top"?"left":"right";let n="center";return e.align==="start"?n="left":e.align==="end"?n="right":e.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:s,mirror:n,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let c,h;return e==="left"?n?(h=this.right+o,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?n?(h=this.left+o,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:s,top:n,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(s,n,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex(o=>o.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,s=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,h)=>{!h.width||!h.color||(s.save(),s.lineWidth=h.width,s.strokeStyle=h.color,s.setLineDash(h.borderDash||[]),s.lineDashOffset=h.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.stroke(),s.restore())};if(e.display)for(o=0,r=n.length;o<r;++o){const l=n[o];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:s,grid:n}}=this,o=s.setContext(this.getContext()),r=s.display?o.width:0;if(!r)return;const a=n.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,h,d,f;this.isHorizontal()?(c=bt(t,this.left,r)-r/2,h=bt(t,this.right,a)+a/2,d=f=l):(d=bt(t,this.top,r)-r/2,f=bt(t,this.bottom,a)+a/2,c=h=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,d),e.lineTo(h,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const s=this.ctx,n=this._computeLabelArea();n&&ti(s,n);const o=this.getLabelItems(t);for(const r of o){const a=r.options,l=r.font,c=r.label,h=r.textOffset;qt(s,c,0,h,l,a)}n&&ei(s)}drawTitle(){const{ctx:t,options:{position:e,title:s,reverse:n}}=this;if(!s.display)return;const o=$(s.font),r=Q(s.padding),a=s.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||O(e)?(l+=r.bottom,H(s.text)&&(l+=o.lineHeight*(s.text.length-1))):l+=r.top;const{titleX:c,titleY:h,maxWidth:d,rotation:f}=Ir(this,l,e,a);qt(t,s.text,0,0,o,{color:s.color,maxWidth:d,rotation:f,textAlign:Er(a,e,n),textBaseline:"middle",translation:[c,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,s=A(t.grid&&t.grid.z,-1),n=A(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Qt.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[];let o,r;for(o=0,r=e.length;o<r;++o){const a=e[o];a[s]===this.id&&(!t||a.type===t)&&n.push(a)}return n}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return $(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class le{constructor(t,e,s){this.type=t,this.scope=e,this.override=s,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let s;Br(e)&&(s=this.register(e));const n=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in n||(n[o]=t,Fr(t,r,s),this.override&&F.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,s=t.id,n=this.scope;s in e&&delete e[s],n&&s in F[n]&&(delete F[n][s],this.override&&delete kt[s])}}function Fr(i,t,e){const s=Ut(Object.create(null),[e?F.get(e):{},F.get(t),i.defaults]);F.set(t,s),i.defaultRoutes&&zr(t,i.defaultRoutes),i.descriptors&&F.describe(t,i.descriptors)}function zr(i,t){Object.keys(t).forEach(e=>{const s=e.split("."),n=s.pop(),o=[i].concat(s).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");F.route(o,n,l,a)})}function Br(i){return"id"in i&&"defaults"in i}class Hr{constructor(){this.controllers=new le(Hs,"datasets",!0),this.elements=new le(ft,"elements"),this.plugins=new le(Object,"plugins"),this.scales=new le(Qt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,s){[...e].forEach(n=>{const o=s||this._getRegistryForType(n);s||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):P(n,r=>{const a=s||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,s){const n=Ge(t);L(s["before"+n],[],s),e[t](s),L(s["after"+n],[],s)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const s=this._typedRegistries[e];if(s.isForType(t))return s}return this.plugins}_get(t,e,s){const n=e.get(t);if(n===void 0)throw new Error('"'+t+'" is not a registered '+s+".");return n}}var it=new Hr;class Wr{constructor(){this._init=[]}notify(t,e,s,n){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=n?this._descriptors(t).filter(n):this._descriptors(t),r=this._notify(o,t,e,s);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),r}_notify(t,e,s,n){n=n||{};for(const o of t){const r=o.plugin,a=r[s],l=[e,n,o.options];if(L(a,l,r)===!1&&n.cancelable)return!1}return!0}invalidate(){N(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const s=t&&t.config,n=A(s.options&&s.options.plugins,{}),o=jr(s);return n===!1&&!e?[]:Vr(t,o,n,e)}_notifyStateChanges(t){const e=this._oldCache||[],s=this._cache,n=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(n(e,s),t,"stop"),this._notify(n(s,e),t,"start")}}function jr(i){const t={},e=[],s=Object.keys(it.plugins.items);for(let o=0;o<s.length;o++)e.push(it.getPlugin(s[o]));const n=i.plugins||[];for(let o=0;o<n.length;o++){const r=n[o];e.indexOf(r)===-1&&(e.push(r),t[r.id]=!0)}return{plugins:e,localIds:t}}function Nr(i,t){return!t&&i===!1?null:i===!0?{}:i}function Vr(i,{plugins:t,localIds:e},s,n){const o=[],r=i.getContext();for(const a of t){const l=a.id,c=Nr(s[l],n);c!==null&&o.push({plugin:a,options:Yr(i.config,{plugin:a,local:e[l]},c,r)})}return o}function Yr(i,{plugin:t,local:e},s,n){const o=i.pluginScopeKeys(t),r=i.getOptionScopes(s,o);return e&&t.defaults&&r.push(t.defaults),i.createResolver(r,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function $e(i,t){const e=F.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function $r(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function Xr(i,t){return i===t?"_index_":"_value_"}function $i(i){if(i==="x"||i==="y"||i==="r")return i}function Ur(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function Xe(i,...t){if($i(i))return i;for(const e of t){const s=e.axis||Ur(e.position)||i.length>1&&$i(i[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function Xi(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function Kr(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(s=>s.xAxisID===i||s.yAxisID===i);if(e.length)return Xi(i,"x",e[0])||Xi(i,"y",e[0])}return{}}function qr(i,t){const e=kt[i.type]||{scales:{}},s=t.scales||{},n=$e(i.type,t),o=Object.create(null);return Object.keys(s).forEach(r=>{const a=s[r];if(!O(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=Xe(r,a,Kr(r,i),F.scales[a.type]),c=Xr(l,n),h=e.scales||{};o[r]=Vt(Object.create(null),[{axis:l},a,h[l],h[c]])}),i.data.datasets.forEach(r=>{const a=r.type||i.type,l=r.indexAxis||$e(a,t),h=(kt[a]||{}).scales||{};Object.keys(h).forEach(d=>{const f=$r(d,l),u=r[f+"AxisID"]||f;o[u]=o[u]||Object.create(null),Vt(o[u],[{axis:f},s[u],h[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];Vt(a,[F.scales[a.type],F.scale])}),o}function $s(i){const t=i.options||(i.options={});t.plugins=A(t.plugins,{}),t.scales=qr(i,t)}function Xs(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function Gr(i){return i=i||{},i.data=Xs(i.data),$s(i),i}const Ui=new Map,Us=new Set;function ce(i,t){let e=Ui.get(i);return e||(e=t(),Ui.set(i,e),Us.add(e)),e}const Ht=(i,t,e)=>{const s=Kt(t,e);s!==void 0&&i.add(s)};class Zr{constructor(t){this._config=Gr(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Xs(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),$s(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ce(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return ce(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return ce(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return ce(`${s}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const s=this._scopeCache;let n=s.get(t);return(!n||e)&&(n=new Map,s.set(t,n)),n}getOptionScopes(t,e,s){const{options:n,type:o}=this,r=this._cachedScopes(t,s),a=r.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>Ht(l,t,d))),h.forEach(d=>Ht(l,n,d)),h.forEach(d=>Ht(l,kt[o]||{},d)),h.forEach(d=>Ht(l,F,d)),h.forEach(d=>Ht(l,Ve,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Us.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,kt[e]||{},F.datasets[e]||{},{type:e},F,Ve]}resolveNamedOptions(t,e,s,n=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Ki(this._resolverCache,t,n);let l=r;if(Jr(r,e)){o.$shared=!1,s=dt(s)?s():s;const c=this.createResolver(t,s,a);l=Tt(r,s,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,s=[""],n){const{resolver:o}=Ki(this._resolverCache,t,s);return O(e)?Tt(o,e,void 0,n):o}}function Ki(i,t,e){let s=i.get(t);s||(s=new Map,i.set(t,s));const n=e.join();let o=s.get(n);return o||(o={resolver:si(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},s.set(n,o)),o}const Qr=i=>O(i)&&Object.getOwnPropertyNames(i).some(t=>dt(i[t]));function Jr(i,t){const{isScriptable:e,isIndexable:s}=Ts(i);for(const n of t){const o=e(n),r=s(n),a=(r||o)&&i[n];if(o&&(dt(a)||Qr(a))||r&&H(a))return!0}return!1}var ta="4.4.8";const ea=["top","bottom","left","right","chartArea"];function qi(i,t){return i==="top"||i==="bottom"||ea.indexOf(i)===-1&&t==="x"}function Gi(i,t){return function(e,s){return e[i]===s[i]?e[t]-s[t]:e[i]-s[i]}}function Zi(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),L(e&&e.onComplete,[i],t)}function ia(i){const t=i.chart,e=t.options.animation;L(e&&e.onProgress,[i],t)}function Ks(i){return ri()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const ge={},Qi=i=>{const t=Ks(i);return Object.values(ge).filter(e=>e.canvas===t).pop()};function sa(i,t,e){const s=Object.keys(i);for(const n of s){const o=+n;if(o>=t){const r=i[n];delete i[n],(e>0||o>t)&&(i[o+e]=r)}}}function na(i,t,e,s){return!e||i.type==="mouseout"?null:s?t:i}function he(i,t,e){return i.options.clip?i[e]:t[e]}function oa(i,t){const{xScale:e,yScale:s}=i;return e&&s?{left:he(e,t,"left"),right:he(e,t,"right"),top:he(s,t,"top"),bottom:he(s,t,"bottom")}:t}let ci=class{static defaults=F;static instances=ge;static overrides=kt;static registry=it;static version=ta;static getChart=Qi;static register(...t){it.add(...t),Ji()}static unregister(...t){it.remove(...t),Ji()}constructor(t,e){const s=this.config=new Zr(e),n=Ks(t),o=Qi(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||wr(n)),this.platform.updateConfig(s);const a=this.platform.acquireContext(n,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Tn(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Wr,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Kn(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],ge[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}nt.listen(this,"complete",Zi),nt.listen(this,"progress",ia),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:o}=this;return N(t)?e&&o?o:n?s/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return it}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ci(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Si(this.canvas,this.ctx),this}stop(){return nt.stop(this),this}resize(t,e){nt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const s=this.options,n=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,o),a=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Ci(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),L(s.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};P(e,(s,n)=>{s.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,s=this.scales,n=Object.keys(s).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],l=Xe(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),P(o,r=>{const a=r.options,l=a.id,c=Xe(l,a),h=A(a.type,r.dtype);(a.position===void 0||qi(a.position,c)!==qi(r.dposition))&&(a.position=r.dposition),n[l]=!0;let d=null;if(l in s&&s[l].type===h)d=s[l];else{const f=it.getScale(h);d=new f({id:l,type:h,ctx:this.ctx,chart:this}),s[d.id]=d}d.init(a,t)}),P(n,(r,a)=>{r||delete s[a]}),P(s,r=>{Z.configure(this,r,r.options),Z.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((n,o)=>n.index-o.index),s>e){for(let n=e;n<s;++n)this._destroyDatasetMeta(n);t.splice(e,s-e)}this._sortedMetasets=t.slice(0).sort(Gi("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((s,n)=>{e.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let s,n;for(this._removeUnreferencedMetasets(),s=0,n=e.length;s<n;s++){const o=e[s];let r=this.getDatasetMeta(s);const a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(s),r=this.getDatasetMeta(s)),r.type=a,r.indexAxis=o.indexAxis||$e(a,this.options),r.order=o.order||0,r.index=s,r.label=""+o.label,r.visible=this.isDatasetVisible(s),r.controller)r.controller.updateIndex(s),r.controller.linkScales();else{const l=it.getController(a),{datasetElementType:c,dataElementType:h}=F.datasets[a];Object.assign(l,{dataElementType:it.getElement(h),datasetElementType:c&&it.getElement(c)}),r.controller=new l(this,s),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){P(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,h=this.data.datasets.length;c<h;c++){const{controller:d}=this.getDatasetMeta(c),f=!n&&o.indexOf(d)===-1;d.buildOrUpdateElements(f),r=Math.max(+d.getMaxOverflow(),r)}r=this._minPadding=s.layout.autoPadding?r:0,this._updateLayout(r),n||P(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Gi("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){P(this.scales,t=>{Z.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!pi(e,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:s,start:n,count:o}of e){const r=s==="_removeElements"?-o:o;sa(t,n,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,s=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),n=s(0);for(let o=1;o<e;o++)if(!pi(n,s(o)))return;return Array.from(n).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Z.update(this,this.width,this.height,t);const e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],P(this.boxes,n=>{s&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e<s;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,s=this.data.datasets.length;e<s;++e)this._updateDataset(e,dt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const s=this.getDatasetMeta(t),n={meta:s,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",n)!==!1&&(s.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(nt.has(this)?this.attached&&!nt.running(this)&&nt.start(this):(this.draw(),Zi({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:s,height:n}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(s,n)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const 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){const e=this._sortedMetasets,s=[];let n,o;for(n=0,o=e.length;n<o;++n){const r=e[n];(!t||r.visible)&&s.push(r)}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,s=t._clip,n=!s.disabled,o=oa(t,this.chartArea),r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(n&&ti(e,{left:s.left===!1?0:o.left-s.left,right:s.right===!1?this.width:o.right+s.right,top:s.top===!1?0:o.top-s.top,bottom:s.bottom===!1?this.height:o.bottom+s.bottom}),t.controller.draw(),n&&ei(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Je(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){const o=er.modes[e];return typeof o=="function"?o(this,t,s,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],s=this._metasets;let n=s.filter(o=>o&&o._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},s.push(n)),n}getContext(){return this.$context||(this.$context=Rt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){const s=this.getDatasetMeta(t);s.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){const n=s?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,n);be(e)?(o.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),r.update(o,{visible:s}),this.update(a=>a.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),nt.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Si(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete ge[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,s=(o,r)=>{e.addEventListener(this,o,r),t[o]=r},n=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};P(this.options.events,o=>s(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,s=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},n=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{n("attach",a),this.attached=!0,this.resize(),s("resize",o),s("detach",r)};r=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),s("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){P(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},P(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,s){const n=s?"set":"remove";let o,r,a,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];const c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[n+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],s=t.map(({datasetIndex:o,index:r})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!pe(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,s){const n=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),r=o(e,t),a=s?t:o(t,e);r.length&&this.updateHoverStyle(r,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,e){const s={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,n)===!1)return;const o=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,n),(o||s.changed)&&this.render(),this}_handleEvent(t,e,s){const{_active:n=[],options:o}=this,r=e,a=this._getActiveElements(t,n,s,r),l=zn(t),c=na(t,this._lastEvent,s,l);s&&(this._lastEvent=null,L(o.onHover,[t,a,this],this),l&&L(o.onClick,[t,a,this],this));const h=!pe(a,n);return(h||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=c,h}_getActiveElements(t,e,s,n){if(t.type==="mouseout")return[];if(!s)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}};function Ji(){return P(ci.instances,i=>i._plugins.invalidate())}function ra(i,t,e){const{startAngle:s,pixelMargin:n,x:o,y:r,outerRadius:a,innerRadius:l}=t;let c=n/a;i.beginPath(),i.arc(o,r,a,s-c,e+c),l>n?(c=n/l,i.arc(o,r,l,e+c,s-c,!0)):i.arc(o,r,n,e+W,s-W),i.closePath(),i.clip()}function aa(i){return ii(i,["outerStart","outerEnd","innerStart","innerEnd"])}function la(i,t,e,s){const n=aa(i.options.borderRadius),o=(e-t)/2,r=Math.min(o,s*t/2),a=l=>{const c=(e-Math.min(o,l))*s/2;return K(l,0,Math.min(o,c))};return{outerStart:a(n.outerStart),outerEnd:a(n.outerEnd),innerStart:K(n.innerStart,0,r),innerEnd:K(n.innerEnd,0,r)}}function Ct(i,t,e,s){return{x:e+i*Math.cos(t),y:s+i*Math.sin(t)}}function Se(i,t,e,s,n,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,d=Math.max(t.outerRadius+s+e-c,0),f=h>0?h+s+e+c:0;let u=0;const m=n-l;if(s){const T=h>0?h-s:0,E=d>0?d-s:0,I=(T+E)/2,J=I!==0?m*I/(I+s):m;u=(m-J)/2}const g=Math.max(.001,m*d-e/B)/d,p=(m-g)/2,b=l+p+u,_=n-p-u,{outerStart:x,outerEnd:y,innerStart:v,innerEnd:w}=la(t,f,d,_-b),S=d-x,k=d-y,R=b+x/S,M=_-y/k,D=f+v,C=f+w,j=b+v/D,q=_-w/C;if(i.beginPath(),o){const T=(R+M)/2;if(i.arc(r,a,d,R,T),i.arc(r,a,d,T,M),y>0){const V=Ct(k,M,r,a);i.arc(V.x,V.y,y,M,_+W)}const E=Ct(C,_,r,a);if(i.lineTo(E.x,E.y),w>0){const V=Ct(C,q,r,a);i.arc(V.x,V.y,w,_+W,q+Math.PI)}const I=(_-w/f+(b+v/f))/2;if(i.arc(r,a,f,_-w/f,I,!0),i.arc(r,a,f,I,b+v/f,!0),v>0){const V=Ct(D,j,r,a);i.arc(V.x,V.y,v,j+Math.PI,b-W)}const J=Ct(S,b,r,a);if(i.lineTo(J.x,J.y),x>0){const V=Ct(S,R,r,a);i.arc(V.x,V.y,x,b-W,R)}}else{i.moveTo(r,a);const T=Math.cos(R)*d+r,E=Math.sin(R)*d+a;i.lineTo(T,E);const I=Math.cos(M)*d+r,J=Math.sin(M)*d+a;i.lineTo(I,J)}i.closePath()}function ca(i,t,e,s,n){const{fullCircles:o,startAngle:r,circumference:a}=t;let l=t.endAngle;if(o){Se(i,t,e,s,l,n);for(let c=0;c<o;++c)i.fill();isNaN(a)||(l=r+(a%z||z))}return Se(i,t,e,s,l,n),i.fill(),l}function ha(i,t,e,s,n){const{fullCircles:o,startAngle:r,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:h,borderDash:d,borderDashOffset:f}=l,u=l.borderAlign==="inner";if(!c)return;i.setLineDash(d||[]),i.lineDashOffset=f,u?(i.lineWidth=c*2,i.lineJoin=h||"round"):(i.lineWidth=c,i.lineJoin=h||"bevel");let m=t.endAngle;if(o){Se(i,t,e,s,m,n);for(let g=0;g<o;++g)i.stroke();isNaN(a)||(m=r+(a%z||z))}u&&ra(i,t,m),o||(Se(i,t,e,s,m,n),i.stroke())}class $a extends ft{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=>t!=="borderDash"};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,s){const n=this.getProps(["x","y"],s),{angle:o,distance:r}=Ss(n,{x:t,y:e}),{startAngle:a,endAngle:l,innerRadius:c,outerRadius:h,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),f=(this.options.spacing+this.options.borderWidth)/2,u=A(d,l-a),m=ye(o,a,l)&&a!==l,g=u>=z||m,p=vt(r,c+f,h+f);return g&&p}getCenterPoint(t){const{x:e,y:s,startAngle:n,endAngle:o,innerRadius:r,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:l,spacing:c}=this.options,h=(n+o)/2,d=(r+a+c+l)/2;return{x:e+Math.cos(h)*d,y:s+Math.sin(h)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:s}=this,n=(e.offset||0)/4,o=(e.spacing||0)/2,r=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=s>z?Math.floor(s/z):0,s===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*n,Math.sin(a)*n);const l=1-Math.sin(Math.min(B,s||0)),c=n*l;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,ca(t,this,c,o,r),ha(t,this,c,o,r),t.restore()}}function ts(i,t,e,s){const n=i.options,{[e]:o}=i.getProps([e],s);return Math.abs(t-o)<n.radius+n.hitRadius}class Xa extends ft{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,s){const n=this.options,{x:o,y:r}=this.getProps(["x","y"],s);return Math.pow(t-o,2)+Math.pow(e-r,2)<Math.pow(n.hitRadius+n.radius,2)}inXRange(t,e){return ts(this,t,"x",e)}inYRange(t,e){return ts(this,t,"y",e)}getCenterPoint(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const s=e&&t.borderWidth||0;return(e+s)*2}draw(t,e){const s=this.options;this.skip||s.radius<.1||!Je(this,e,this.size(s)/2)||(t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth,t.fillStyle=s.backgroundColor,Ye(t,s,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function qs(i,t){const{x:e,y:s,base:n,width:o,height:r}=i.getProps(["x","y","base","width","height"],t);let a,l,c,h,d;return i.horizontal?(d=r/2,a=Math.min(e,n),l=Math.max(e,n),c=s-d,h=s+d):(d=o/2,a=e-d,l=e+d,c=Math.min(s,n),h=Math.max(s,n)),{left:a,top:c,right:l,bottom:h}}function ct(i,t,e,s){return i?0:K(t,e,s)}function da(i,t,e){const s=i.options.borderWidth,n=i.borderSkipped,o=Ps(s);return{t:ct(n.top,o.top,0,e),r:ct(n.right,o.right,0,t),b:ct(n.bottom,o.bottom,0,e),l:ct(n.left,o.left,0,t)}}function fa(i,t,e){const{enableBorderRadius:s}=i.getProps(["enableBorderRadius"]),n=i.options.borderRadius,o=Dt(n),r=Math.min(t,e),a=i.borderSkipped,l=s||O(n);return{topLeft:ct(!l||a.top||a.left,o.topLeft,0,r),topRight:ct(!l||a.top||a.right,o.topRight,0,r),bottomLeft:ct(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:ct(!l||a.bottom||a.right,o.bottomRight,0,r)}}function ua(i){const t=qs(i),e=t.right-t.left,s=t.bottom-t.top,n=da(i,e/2,s/2),o=fa(i,e/2,s/2);return{outer:{x:t.left,y:t.top,w:e,h:s,radius:o},inner:{x:t.left+n.l,y:t.top+n.t,w:e-n.l-n.r,h:s-n.t-n.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,o.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(n.b,n.r))}}}}function ze(i,t,e,s){const n=t===null,o=e===null,a=i&&!(n&&o)&&qs(i,s);return a&&(n||vt(t,a.left,a.right))&&(o||vt(e,a.top,a.bottom))}function ga(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function pa(i,t){i.rect(t.x,t.y,t.w,t.h)}function Be(i,t,e={}){const s=i.x!==e.x?-t:0,n=i.y!==e.y?-t:0,o=(i.x+i.w!==e.x+e.w?t:0)-s,r=(i.y+i.h!==e.y+e.h?t:0)-n;return{x:i.x+s,y:i.y+n,w:i.w+o,h:i.h+r,radius:i.radius}}class Ua extends ft{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){const{inflateAmount:e,options:{borderColor:s,backgroundColor:n}}=this,{inner:o,outer:r}=ua(this),a=ga(r.radius)?ve:pa;t.save(),(r.w!==o.w||r.h!==o.h)&&(t.beginPath(),a(t,Be(r,e,o)),t.clip(),a(t,Be(o,-e,r)),t.fillStyle=s,t.fill("evenodd")),t.beginPath(),a(t,Be(o,e)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,e,s){return ze(this,t,e,s)}inXRange(t,e){return ze(this,t,null,e)}inYRange(t,e){return ze(this,null,t,e)}getCenterPoint(t){const{x:e,y:s,base:n,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+n)/2:e,y:o?s:(s+n)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}const es=(i,t)=>{let{boxHeight:e=t,boxWidth:s=t}=i;return i.usePointStyle&&(e=Math.min(e,t),s=i.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(t,e)}},ma=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class is extends ft{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=L(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,n)=>t.sort(s,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const s=t.labels,n=$(s.font),o=n.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=es(s,o);let c,h;e.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,n,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,n){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+a;let d=t;o.textAlign="left",o.textBaseline="middle";let f=-1,u=-h;return this.legendItems.forEach((m,g)=>{const p=s+e/2+o.measureText(m.text).width;(g===0||c[c.length-1]+p+2*a>r)&&(d+=h,c[c.length-(g>0?0:1)]=0,u+=h,f++),l[g]={left:0,top:u,row:f,width:p,height:n},c[c.length-1]+=p+a}),d}_fitCols(t,e,s,n){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t;let d=a,f=0,u=0,m=0,g=0;return this.legendItems.forEach((p,b)=>{const{itemWidth:_,itemHeight:x}=ba(s,e,o,p,n);b>0&&u+x+2*a>h&&(d+=f+a,c.push({width:f,height:u}),m+=f+a,g++,f=u=0),l[b]={left:m,top:u,col:g,width:_,height:x},f=Math.max(f,_),u+=x+a}),d+=f,c.push({width:f,height:u}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:n},rtl:o}}=this,r=Pt(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=Y(s,this.left+n,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=Y(s,this.left+n,this.right-this.lineWidths[a])),c.top+=this.top+t+n,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+n}else{let a=0,l=Y(s,this.top+t+n,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=Y(s,this.top+t+n,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+n,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;ti(t,this),this._draw(),ei(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:n}=this,{align:o,labels:r}=t,a=F.color,l=Pt(t.rtl,this.left,this.width),c=$(r.font),{padding:h}=r,d=c.size,f=d/2;let u;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;const{boxWidth:m,boxHeight:g,itemHeight:p}=es(r,d),b=function(w,S,k){if(isNaN(m)||m<=0||isNaN(g)||g<0)return;n.save();const R=A(k.lineWidth,1);if(n.fillStyle=A(k.fillStyle,a),n.lineCap=A(k.lineCap,"butt"),n.lineDashOffset=A(k.lineDashOffset,0),n.lineJoin=A(k.lineJoin,"miter"),n.lineWidth=R,n.strokeStyle=A(k.strokeStyle,a),n.setLineDash(A(k.lineDash,[])),r.usePointStyle){const M={radius:g*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:R},D=l.xPlus(w,m/2),C=S+f;Ds(n,M,D,C,r.pointStyleWidth&&m)}else{const M=S+Math.max((d-g)/2,0),D=l.leftForLtr(w,m),C=Dt(k.borderRadius);n.beginPath(),Object.values(C).some(j=>j!==0)?ve(n,{x:D,y:M,w:m,h:g,radius:C}):n.rect(D,M,m,g),n.fill(),R!==0&&n.stroke()}n.restore()},_=function(w,S,k){qt(n,k.text,w,S+p/2,c,{strikethrough:k.hidden,textAlign:l.textAlign(k.textAlign)})},x=this.isHorizontal(),y=this._computeTitleHeight();x?u={x:Y(o,this.left+h,this.right-s[0]),y:this.top+h+y,line:0}:u={x:this.left+h,y:Y(o,this.top+y+h,this.bottom-e[0].height),line:0},Is(this.ctx,t.textDirection);const v=p+h;this.legendItems.forEach((w,S)=>{n.strokeStyle=w.fontColor,n.fillStyle=w.fontColor;const k=n.measureText(w.text).width,R=l.textAlign(w.textAlign||(w.textAlign=r.textAlign)),M=m+f+k;let D=u.x,C=u.y;l.setWidth(this.width),x?S>0&&D+M+h>this.right&&(C=u.y+=v,u.line++,D=u.x=Y(o,this.left+h,this.right-s[u.line])):S>0&&C+v>this.bottom&&(D=u.x=D+e[u.line].width+h,u.line++,C=u.y=Y(o,this.top+y+h,this.bottom-e[u.line].height));const j=l.x(D);if(b(j,C,w),D=qn(R,D+m+f,x?D+M:this.right,t.rtl),_(l.x(D),C,w),x)u.x+=M+h;else if(typeof w.text!="string"){const q=c.lineHeight;u.y+=Gs(w,q)+h}else u.y+=v}),Fs(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,s=$(e.font),n=Q(e.padding);if(!e.display)return;const o=Pt(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=s.size/2,c=n.top+l;let h,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),h=this.top+c,d=Y(t.align,d,this.right-f);else{const m=this.columnSizes.reduce((g,p)=>Math.max(g,p.height),0);h=c+Y(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}const u=Y(a,d,d+f);r.textAlign=o.textAlign(Qe(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=s.string,qt(r,e.text,u,h,s)}_computeTitleHeight(){const t=this.options.title,e=$(t.font),s=Q(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,n,o;if(vt(t,this.left,this.right)&&vt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;s<o.length;++s)if(n=o[s],vt(t,n.left,n.left+n.width)&&vt(e,n.top,n.top+n.height))return this.legendItems[s]}return null}handleEvent(t){const e=this.options;if(!ya(t.type,e))return;const s=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const n=this._hoveredItem,o=ma(n,s);n&&!o&&L(e.onLeave,[t,n,this],this),this._hoveredItem=s,s&&!o&&L(e.onHover,[t,s,this],this)}else s&&L(e.onClick,[t,s,this],this)}}function ba(i,t,e,s,n){const o=_a(s,i,t,e),r=xa(n,s,t.lineHeight);return{itemWidth:o,itemHeight:r}}function _a(i,t,e,s){let n=i.text;return n&&typeof n!="string"&&(n=n.reduce((o,r)=>o.length>r.length?o:r)),t+e.size/2+s.measureText(n).width}function xa(i,t,e){let s=i;return typeof t.text!="string"&&(s=Gs(t,e)),s}function Gs(i,t){const e=i.text?i.text.length:0;return t*e}function ya(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var Ka={id:"legend",_element:is,start(i,t,e){const s=i.legend=new is({ctx:i.ctx,options:e,chart:i});Z.configure(i,s,e),Z.addBox(i,s)},stop(i){Z.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const s=i.legend;Z.configure(i,s,e),s.options=e},afterUpdate(i){const t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){const s=t.datasetIndex,n=e.chart;n.isDatasetVisible(s)?(n.hide(s),t.hidden=!0):(n.show(s),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:n,color:o,useBorderRadius:r,borderRadius:a}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=Q(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:s||c.pointStyle,rotation:c.rotation,textAlign:n||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class Zs extends ft{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){const s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const n=H(s.text)?s.text.length:1;this._padding=Q(s.padding);const o=n*$(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:s,bottom:n,right:o,options:r}=this,a=r.align;let l=0,c,h,d;return this.isHorizontal()?(h=Y(a,s,o),d=e+t,c=o-s):(r.position==="left"?(h=s+t,d=Y(a,n,e),l=B*-.5):(h=o-t,d=Y(a,e,n),l=B*.5),c=n-e),{titleX:h,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const s=$(e.font),o=s.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);qt(t,e.text,0,0,s,{color:e.color,maxWidth:l,rotation:c,textAlign:Qe(e.align),textBaseline:"middle",translation:[r,a]})}}function va(i,t){const e=new Zs({ctx:i.ctx,options:t,chart:i});Z.configure(i,e,t),Z.addBox(i,e),i.titleBlock=e}var qa={id:"title",_element:Zs,start(i,t,e){va(i,e)},stop(i){const t=i.titleBlock;Z.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const s=i.titleBlock;Z.configure(i,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Nt={average(i){if(!i.length)return!1;let t,e,s=new Set,n=0,o=0;for(t=0,e=i.length;t<e;++t){const a=i[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();s.add(l.x),n+=l.y,++o}}return o===0||s.size===0?!1:{x:[...s].reduce((a,l)=>a+l)/s.size,y:n/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,s=t.y,n=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=i.length;o<r;++o){const l=i[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=Nn(t,c);h<n&&(n=h,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,s=l.y}return{x:e,y:s}}};function et(i,t){return t&&(H(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function ot(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
16
+ */class Fo{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,s,n){const o=e.listeners[n],r=e.duration;o.forEach(a=>a({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(s-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=Os.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;const o=s.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(n.draw(),this._notify(n,s,t,"progress")),o.length||(s.running=!1,this._notify(n,s,t,"complete"),s.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((s,n)=>Math.max(s,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const s=e.items;let n=s.length-1;for(;n>=0;--n)s[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var nt=new Fo;const Di="transparent",zo={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const s=vi(i||Di),n=s.valid&&vi(t||Di);return n&&n.valid?n.mix(s,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class Bo{constructor(t,e,s,n){const o=e[s];n=ne([t.to,n,o,t.from]);const r=ne([t.from,o,n]);this._active=!0,this._fn=t.fn||zo[t.type||typeof r],this._easing=Yt[t.easing]||Yt.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=s,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);const n=this._target[this._prop],o=s-this._start,r=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=ne([t.to,e,n,t.from]),this._from=ne([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,s=this._duration,n=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e<s),!this._active){this._target[n]=a,this._notify(!0);return}if(e<0){this._target[n]=o;return}l=e/s%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){const e=t?"res":"rej",s=this._promises||[];for(let n=0;n<s.length;n++)s[n][e]()}}class zs{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!O(t))return;const e=Object.keys(F.animation),s=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const o=t[n];if(!O(o))return;const r={};for(const a of e)r[a]=o[a];(H(o.properties)&&o.properties||[n]).forEach(a=>{(a===n||!s.has(a))&&s.set(a,r)})})}_animateOptions(t,e){const s=e.options,n=Wo(t,s);if(!n)return[];const o=this._createAnimations(n,s);return s.$shared&&Ho(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,e){const s=this._properties,n=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(t,e));continue}const h=e[c];let d=o[c];const f=s.get(c);if(d)if(f&&d.active()){d.update(f,h,a);continue}else d.cancel();if(!f||!f.duration){t[c]=h;continue}o[c]=d=new Bo(f,t,c,h),n.push(d)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const s=this._createAnimations(t,e);if(s.length)return nt.add(this._chart,s),!0}}function Ho(i,t){const e=[],s=Object.keys(t);for(let n=0;n<s.length;n++){const o=i[s[n]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function Wo(i,t){if(!t)return;let e=i.options;if(!e){i.options=t;return}return e.$shared&&(i.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function Pi(i,t){const e=i&&i.options||{},s=e.reverse,n=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:s?o:n,end:s?n:o}}function jo(i,t,e){if(e===!1)return!1;const s=Pi(i,e),n=Pi(t,e);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}function No(i){let t,e,s,n;return O(i)?(t=i.top,e=i.right,s=i.bottom,n=i.left):t=e=s=n=i,{top:t,right:e,bottom:s,left:n,disabled:i===!1}}function Bs(i,t){const e=[],s=i._getSortedDatasetMetas(t);let n,o;for(n=0,o=s.length;n<o;++n)e.push(s[n].index);return e}function Ti(i,t,e,s={}){const n=i.keys,o=s.mode==="single";let r,a,l,c;if(t===null)return;let h=!1;for(r=0,a=n.length;r<a;++r){if(l=+n[r],l===e){if(h=!0,s.all)continue;break}c=i.values[l],at(c)&&(o||t===0||bi(t)===bi(c))&&(t+=c)}return!h&&!s.all?0:t}function Vo(i,t){const{iScale:e,vScale:s}=t,n=e.axis==="x"?"x":"y",o=s.axis==="x"?"x":"y",r=Object.keys(i),a=new Array(r.length);let l,c,h;for(l=0,c=r.length;l<c;++l)h=r[l],a[l]={[n]:h,[o]:i[h]};return a}function Te(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function Yo(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function $o(i){const{min:t,max:e,minDefined:s,maxDefined:n}=i.getUserBounds();return{min:s?t:Number.NEGATIVE_INFINITY,max:n?e:Number.POSITIVE_INFINITY}}function Xo(i,t,e){const s=i[t]||(i[t]={});return s[e]||(s[e]={})}function Ri(i,t,e,s){for(const n of t.getMatchingVisibleMetas(s).reverse()){const o=i[n.index];if(e&&o>0||!e&&o<0)return n.index}return null}function Li(i,t){const{chart:e,_cachedMeta:s}=i,n=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=s,l=o.axis,c=r.axis,h=Yo(o,r,s),d=t.length;let f;for(let u=0;u<d;++u){const m=t[u],{[l]:g,[c]:p}=m,b=m._stacks||(m._stacks={});f=b[c]=Xo(n,h,g),f[a]=p,f._top=Ri(f,r,!0,s.type),f._bottom=Ri(f,r,!1,s.type);const _=f._visualValues||(f._visualValues={});_[a]=p}}function Re(i,t){const e=i.scales;return Object.keys(e).filter(s=>e[s].axis===t).shift()}function Uo(i,t){return Rt(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Ko(i,t,e){return Rt(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function It(i,t){const e=i.controller.index,s=i.vScale&&i.vScale.axis;if(s){t=t||i._parsed;for(const n of t){const o=n._stacks;if(!o||o[s]===void 0||o[s][e]===void 0)return;delete o[s][e],o[s]._visualValues!==void 0&&o[s]._visualValues[e]!==void 0&&delete o[s]._visualValues[e]}}}const Le=i=>i==="reset"||i==="none",Ei=(i,t)=>t?i:Object.assign({},i),qo=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Bs(e,!0),values:null};class Hs{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(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Te(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&&It(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(d,f,u,m)=>d==="x"?f:d==="r"?m:u,o=e.xAxisID=A(s.xAxisID,Re(t,"x")),r=e.yAxisID=A(s.yAxisID,Re(t,"y")),a=e.rAxisID=A(s.rAxisID,Re(t,"r")),l=e.indexAxis,c=e.iAxisID=n(l,o,r,a),h=e.vAxisID=n(l,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&_i(this._data,this),t._stacked&&It(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(O(e)){const n=this._cachedMeta;this._data=Vo(e,n)}else if(s!==e){if(s){_i(s,this);const n=this._cachedMeta;It(n),n._parsed=[]}e&&Object.isExtensible(e)&&Xn(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,s=this.getDataset();let n=!1;this._dataCheck();const o=e._stacked;e._stacked=Te(e.vScale,e),e.stack!==s.stack&&(n=!0,It(e),e.stack=s.stack),this._resyncElements(t),(n||o!==e._stacked)&&(Li(this,e._parsed),e._stacked=Te(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:s,_data:n}=this,{iScale:o,_stacked:r}=s,a=o.axis;let l=t===0&&e===n.length?!0:s._sorted,c=t>0&&s._parsed[t-1],h,d,f;if(this._parsing===!1)s._parsed=n,s._sorted=!0,f=n;else{H(n[t])?f=this.parseArrayData(s,n,t,e):O(n[t])?f=this.parseObjectData(s,n,t,e):f=this.parsePrimitiveData(s,n,t,e);const u=()=>d[a]===null||c&&d[a]<c[a];for(h=0;h<e;++h)s._parsed[h+t]=d=f[h],l&&(u()&&(l=!1),c=d);s._sorted=l}r&&Li(this,f)}parsePrimitiveData(t,e,s,n){const{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),h=o===r,d=new Array(n);let f,u,m;for(f=0,u=n;f<u;++f)m=f+s,d[f]={[a]:h||o.parse(c[m],m),[l]:r.parse(e[m],m)};return d}parseArrayData(t,e,s,n){const{xScale:o,yScale:r}=t,a=new Array(n);let l,c,h,d;for(l=0,c=n;l<c;++l)h=l+s,d=e[h],a[l]={x:o.parse(d[0],h),y:r.parse(d[1],h)};return a}parseObjectData(t,e,s,n){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(n);let h,d,f,u;for(h=0,d=n;h<d;++h)f=h+s,u=e[f],c[h]={x:o.parse(Kt(u,a),f),y:r.parse(Kt(u,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,s){const n=this.chart,o=this._cachedMeta,r=e[t.axis],a={keys:Bs(n,!0),values:e._stacks[t.axis]._visualValues};return Ti(a,r,o.index,{mode:s})}updateRangeFromParsed(t,e,s,n){const o=s[e.axis];let r=o===null?NaN:o;const a=n&&s._stacks[e.axis];n&&a&&(n.values=a,r=Ti(n,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,e){const s=this._cachedMeta,n=s._parsed,o=s._sorted&&t===s.iScale,r=n.length,a=this._getOtherScale(t),l=qo(e,s,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=$o(a);let f,u;function m(){u=n[f];const g=u[a.axis];return!at(u[t.axis])||h>g||d<g}for(f=0;f<r&&!(!m()&&(this.updateRangeFromParsed(c,t,u,l),o));++f);if(o){for(f=r-1;f>=0;--f)if(!m()){this.updateRangeFromParsed(c,t,u,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,s=[];let n,o,r;for(n=0,o=e.length;n<o;++n)r=e[n][t.axis],at(r)&&s.push(r);return s}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,s=e.iScale,n=e.vScale,o=this.getParsed(t);return{label:s?""+s.getLabelForValue(o[s.axis]):"",value:n?""+n.getLabelForValue(o[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=No(A(this.options.clip,jo(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,s=this._cachedMeta,n=s.data||[],o=e.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||n.length-a,c=this.options.drawActiveElementsOnTop;let h;for(s.dataset&&s.dataset.draw(t,o,a,l),h=a;h<a+l;++h){const d=n[h];d.hidden||(d.active&&c?r.push(d):d.draw(t,o))}for(h=0;h<r.length;++h)r[h].draw(t,o)}getStyle(t,e){const s=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(t||0,s)}getContext(t,e,s){const n=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const r=this._cachedMeta.data[t];o=r.$context||(r.$context=Ko(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=n.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=Uo(this.chart.getContext(),this.index)),o.dataset=n,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=s,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",s){const n=e==="active",o=this._cachedDataOpts,r=t+"-"+e,a=o[r],l=this.enableOptionSharing&&be(s);if(a)return Ei(a,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),d=n?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),h),u=Object.keys(F.elements[t]),m=()=>this.getContext(s,n,e),g=c.resolveNamedOptions(f,u,m,d);return g.$shared&&(g.$shared=l,o[r]=Object.freeze(Ei(g,l))),g}_resolveAnimations(t,e,s){const n=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let l;if(n.options.animation!==!1){const h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),f=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(f,this.getContext(t,s,e))}const c=new zs(n,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Le(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const s=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(s),r=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,s),{sharedOptions:o,includeOptions:r}}updateElement(t,e,s,n){Le(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!Le(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,s,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,s=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const n=s.length,o=e.length,r=Math.min(o,n);r&&this.parse(0,r),o>n?this._insertElements(n,o-n,t):o<n&&this._removeElements(o,n-o)}_insertElements(t,e,s=!0){const n=this._cachedMeta,o=n.data,r=t+e;let a;const l=c=>{for(c.length+=e,a=c.length-1;a>=r;a--)c[a]=c[a-e]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(n._parsed),this.parse(t,e),s&&this.updateElements(o,t,e,"reset")}updateElements(t,e,s,n){}_removeElements(t,e){const s=this._cachedMeta;if(this._parsing){const n=s._parsed.splice(t,e);s._stacked&&It(s,n)}s.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,s,n]=t;this[e](s,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const 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]);const s=arguments.length-2;s&&this._sync(["_insertElements",t,s])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function Go(i,t,e){let s=1,n=1,o=0,r=0;if(t<z){const a=i,l=a+t,c=Math.cos(a),h=Math.sin(a),d=Math.cos(l),f=Math.sin(l),u=(x,y,v)=>ye(x,a,l,!0)?1:Math.max(y,y*e,v,v*e),m=(x,y,v)=>ye(x,a,l,!0)?-1:Math.min(y,y*e,v,v*e),g=u(0,c,d),p=u(W,h,f),b=m(B,c,d),_=m(B+W,h,f);s=(g-b)/2,n=(p-_)/2,o=-(g+b)/2,r=-(p+_)/2}return{ratioX:s,ratioY:n,offsetX:o,offsetY:r}}class Zo extends Hs{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=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:s,color:n}}=t.legend.options;return e.labels.map((o,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:n,lineWidth:l.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,e,s){s.chart.toggleDataVisibility(e.index),s.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){const s=this.getDataset().data,n=this._cachedMeta;if(this._parsing===!1)n._parsed=s;else{let o=l=>+s[l];if(O(s[t])){const{key:l="value"}=this._parsing;o=c=>+Kt(s[c],l)}let r,a;for(r=t,a=t+e;r<a;++r)n._parsed[r]=o(r)}}_getRotation(){return yt(this.options.rotation-90)}_getCircumference(){return yt(this.options.circumference)}_getRotationExtents(){let t=z,e=-z;for(let s=0;s<this.chart.data.datasets.length;++s)if(this.chart.isDatasetVisible(s)&&this.chart.getDatasetMeta(s).type===this._type){const n=this.chart.getDatasetMeta(s).controller,o=n._getRotation(),r=n._getCircumference();t=Math.min(t,o),e=Math.max(e,o+r)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:s}=e,n=this._cachedMeta,o=n.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(s.width,s.height)-r)/2,0),l=Math.min(Rn(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:h,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:u,offsetX:m,offsetY:g}=Go(d,h,l),p=(s.width-r)/f,b=(s.height-r)/u,_=Math.max(Math.min(p,b)/2,0),x=ws(this.options.radius,_),y=Math.max(x*l,0),v=(x-y)/this._getVisibleDatasetWeightTotal();this.offsetX=m*x,this.offsetY=g*x,n.total=this.calculateTotal(),this.outerRadius=x-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const s=this.options,n=this._cachedMeta,o=this._getCircumference();return e&&s.animation.animateRotate||!this.chart.getDataVisibility(t)||n._parsed[t]===null||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*o/z)}updateElements(t,e,s,n){const o=n==="reset",r=this.chart,a=r.chartArea,c=r.options.animation,h=(a.left+a.right)/2,d=(a.top+a.bottom)/2,f=o&&c.animateScale,u=f?0:this.innerRadius,m=f?0:this.outerRadius,{sharedOptions:g,includeOptions:p}=this._getSharedOptions(e,n);let b=this._getRotation(),_;for(_=0;_<e;++_)b+=this._circumference(_,o);for(_=e;_<e+s;++_){const x=this._circumference(_,o),y=t[_],v={x:h+this.offsetX,y:d+this.offsetY,startAngle:b,endAngle:b+x,circumference:x,outerRadius:m,innerRadius:u};p&&(v.options=g||this.resolveDataElementOptions(_,y.active?"active":n)),b+=x,this.updateElement(y,_,v,n)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let s=0,n;for(n=0;n<e.length;n++){const o=t._parsed[n];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(n)&&!e[n].hidden&&(s+=Math.abs(o))}return s}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?z*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart,n=s.data.labels||[],o=eo(e._parsed[t],s.options.locale);return{label:n[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const s=this.chart;let n,o,r,a,l;if(!t){for(n=0,o=s.data.datasets.length;n<o;++n)if(s.isDatasetVisible(n)){r=s.getDatasetMeta(n),t=r.data,a=r.controller;break}}if(!t)return 0;for(n=0,o=t.length;n<o;++n)l=a.resolveDataElementOptions(n),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let s=0,n=t.length;s<n;++s){const o=this.resolveDataElementOptions(s);e=Math.max(e,o.offset||0,o.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let s=0;s<t;++s)this.chart.isDatasetVisible(s)&&(e+=this._getRingWeight(s));return e}_getRingWeight(t){return Math.max(A(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}function _t(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class li{static override(t){Object.assign(li.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return _t()}parse(){return _t()}format(){return _t()}add(){return _t()}diff(){return _t()}startOf(){return _t()}endOf(){return _t()}}var Qo={_date:li};function Jo(i,t,e,s){const{controller:n,data:o,_sorted:r}=i,a=n._cachedMeta.iScale,l=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const c=a._reversePixels?Yn:Ne;if(s){if(n._sharedOptions){const h=o[0],d=typeof h.getRange=="function"&&h.getRange(t);if(d){const f=c(o,t,e-d),u=c(o,t,e+d);return{lo:f.lo,hi:u.hi}}}}else{const h=c(o,t,e);if(l){const{vScale:d}=n._cachedMeta,{_parsed:f}=i,u=f.slice(0,h.lo+1).reverse().findIndex(g=>!N(g[d.axis]));h.lo-=Math.max(0,u);const m=f.slice(h.hi).findIndex(g=>!N(g[d.axis]));h.hi+=Math.max(0,m)}return h}}return{lo:0,hi:o.length-1}}function Oe(i,t,e,s,n){const o=i.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:h}=o[a],{lo:d,hi:f}=Jo(o[a],t,r,n);for(let u=d;u<=f;++u){const m=h[u];m.skip||s(m,c,u)}}}function tr(i){const t=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(s,n){const o=t?Math.abs(s.x-n.x):0,r=e?Math.abs(s.y-n.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function Ee(i,t,e,s,n){const o=[];return!n&&!i.isPointInArea(t)||Oe(i,e,t,function(a,l,c){!n&&!Je(a,i.chartArea,0)||a.inRange(t.x,t.y,s)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function er(i,t,e,s){let n=[];function o(r,a,l){const{startAngle:c,endAngle:h}=r.getProps(["startAngle","endAngle"],s),{angle:d}=Ss(r,{x:t.x,y:t.y});ye(d,c,h)&&n.push({element:r,datasetIndex:a,index:l})}return Oe(i,e,t,o),n}function ir(i,t,e,s,n,o){let r=[];const a=tr(e);let l=Number.POSITIVE_INFINITY;function c(h,d,f){const u=h.inRange(t.x,t.y,n);if(s&&!u)return;const m=h.getCenterPoint(n);if(!(!!o||i.isPointInArea(m))&&!u)return;const p=a(t,m);p<l?(r=[{element:h,datasetIndex:d,index:f}],l=p):p===l&&r.push({element:h,datasetIndex:d,index:f})}return Oe(i,e,t,c),r}function Ie(i,t,e,s,n,o){return!o&&!i.isPointInArea(t)?[]:e==="r"&&!s?er(i,t,e,n):ir(i,t,e,s,n,o)}function Ii(i,t,e,s,n){const o=[],r=e==="x"?"inXRange":"inYRange";let a=!1;return Oe(i,e,t,(l,c,h)=>{l[r]&&l[r](t[e],n)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,n))}),s&&!a?[]:o}var sr={modes:{index(i,t,e,s){const n=xt(t,i),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?Ee(i,n,o,s,r):Ie(i,n,o,!1,s,r),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,s){const n=xt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?Ee(i,n,o,s,r):Ie(i,n,o,!1,s,r);if(a.length>0){const l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let h=0;h<c.length;++h)a.push({element:c[h],datasetIndex:l,index:h})}return a},point(i,t,e,s){const n=xt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return Ee(i,n,o,s,r)},nearest(i,t,e,s){const n=xt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return Ie(i,n,o,e.intersect,s,r)},x(i,t,e,s){const n=xt(t,i);return Ii(i,n,"x",e.intersect,s)},y(i,t,e,s){const n=xt(t,i);return Ii(i,n,"y",e.intersect,s)}}};const Ws=["left","top","right","bottom"];function Ft(i,t){return i.filter(e=>e.pos===t)}function Fi(i,t){return i.filter(e=>Ws.indexOf(e.pos)===-1&&e.box.axis===t)}function zt(i,t){return i.sort((e,s)=>{const n=t?s:e,o=t?e:s;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function nr(i){const t=[];let e,s,n,o,r,a;for(e=0,s=(i||[]).length;e<s;++e)n=i[e],{position:o,options:{stack:r,stackWeight:a=1}}=n,t.push({index:e,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:r&&o+r,stackWeight:a});return t}function or(i){const t={};for(const e of i){const{stack:s,pos:n,stackWeight:o}=e;if(!s||!Ws.includes(n))continue;const r=t[s]||(t[s]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function rr(i,t){const e=or(i),{vBoxMaxWidth:s,hBoxMaxHeight:n}=t;let o,r,a;for(o=0,r=i.length;o<r;++o){a=i[o];const{fullSize:l}=a.box,c=e[a.stack],h=c&&a.stackWeight/c.weight;a.horizontal?(a.width=h?h*s:l&&t.availableWidth,a.height=n):(a.width=s,a.height=h?h*n:l&&t.availableHeight)}return e}function ar(i){const t=nr(i),e=zt(t.filter(c=>c.box.fullSize),!0),s=zt(Ft(t,"left"),!0),n=zt(Ft(t,"right")),o=zt(Ft(t,"top"),!0),r=zt(Ft(t,"bottom")),a=Fi(t,"x"),l=Fi(t,"y");return{fullSize:e,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(r).concat(a),chartArea:Ft(t,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(r).concat(a)}}function zi(i,t,e,s){return Math.max(i[e],t[e])+Math.max(i[s],t[s])}function js(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function lr(i,t,e,s){const{pos:n,box:o}=e,r=i.maxPadding;if(!O(n)){e.size&&(i[n]-=e.size);const d=s[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,i[n]+=e.size}o.getPadding&&js(r,o.getPadding());const a=Math.max(0,t.outerWidth-zi(r,i,"left","right")),l=Math.max(0,t.outerHeight-zi(r,i,"top","bottom")),c=a!==i.w,h=l!==i.h;return i.w=a,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function cr(i){const t=i.maxPadding;function e(s){const n=Math.max(t[s]-i[s],0);return i[s]+=n,n}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function hr(i,t){const e=t.maxPadding;function s(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return s(i?["left","right"]:["top","bottom"])}function jt(i,t,e,s){const n=[];let o,r,a,l,c,h;for(o=0,r=i.length,c=0;o<r;++o){a=i[o],l=a.box,l.update(a.width||t.w,a.height||t.h,hr(a.horizontal,t));const{same:d,other:f}=lr(t,e,a,s);c|=d&&n.length,h=h||f,l.fullSize||n.push(a)}return c&&jt(n,t,e,s)||h}function ae(i,t,e,s,n){i.top=e,i.left=t,i.right=t+s,i.bottom=e+n,i.width=s,i.height=n}function Bi(i,t,e,s){const n=e.padding;let{x:o,y:r}=t;for(const a of i){const l=a.box,c=s[a.stack]||{placed:0,weight:1},h=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*h,f=c.size||l.height;be(c.start)&&(r=c.start),l.fullSize?ae(l,n.left,r,e.outerWidth-n.right-n.left,f):ae(l,t.left+c.placed,r,d,f),c.start=r,c.placed+=d,r=l.bottom}else{const d=t.h*h,f=c.size||l.width;be(c.start)&&(o=c.start),l.fullSize?ae(l,o,n.top,f,e.outerHeight-n.bottom-n.top):ae(l,o,t.top+c.placed,f,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=r}var Z={addBox(i,t){i.boxes||(i.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},i.boxes.push(t)},removeBox(i,t){const e=i.boxes?i.boxes.indexOf(t):-1;e!==-1&&i.boxes.splice(e,1)},configure(i,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(i,t,e,s){if(!i)return;const n=Q(i.options.layout.padding),o=Math.max(t-n.width,0),r=Math.max(e-n.height,0),a=ar(i.boxes),l=a.vertical,c=a.horizontal;P(i.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const h=l.reduce((g,p)=>p.box.options&&p.box.options.display===!1?g:g+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),f=Object.assign({},n);js(f,Q(s));const u=Object.assign({maxPadding:f,w:o,h:r,x:n.left,y:n.top},n),m=rr(l.concat(c),d);jt(a.fullSize,u,d,m),jt(l,u,d,m),jt(c,u,d,m)&&jt(l,u,d,m),cr(u),Bi(a.leftAndTop,u,d,m),u.x+=u.w,u.y+=u.h,Bi(a.rightAndBottom,u,d,m),i.chartArea={left:u.left,top:u.top,right:u.left+u.w,bottom:u.top+u.h,height:u.h,width:u.w},P(a.chartArea,g=>{const p=g.box;Object.assign(p,i.chartArea),p.update(u.w,u.h,{left:0,top:0,right:0,bottom:0})})}};class Ns{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,n){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):s)}}isAttached(t){return!0}updateConfig(t){}}class dr extends Ns{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ue="$chartjs",fr={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Hi=i=>i===null||i==="";function ur(i,t){const e=i.style,s=i.getAttribute("height"),n=i.getAttribute("width");if(i[ue]={initial:{height:s,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Hi(n)){const o=Ai(i,"width");o!==void 0&&(i.width=o)}if(Hi(s))if(i.style.height==="")i.height=i.width/(t||2);else{const o=Ai(i,"height");o!==void 0&&(i.height=o)}return i}const Vs=To?{passive:!0}:!1;function gr(i,t,e){i&&i.addEventListener(t,e,Vs)}function pr(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,Vs)}function mr(i,t){const e=fr[i.type]||i.type,{x:s,y:n}=xt(i,t);return{type:e,chart:t,native:i,x:s!==void 0?s:null,y:n!==void 0?n:null}}function ke(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function br(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||ke(a.addedNodes,s),r=r&&!ke(a.removedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function _r(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||ke(a.removedNodes,s),r=r&&!ke(a.addedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const Gt=new Map;let Wi=0;function Ys(){const i=window.devicePixelRatio;i!==Wi&&(Wi=i,Gt.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function xr(i,t){Gt.size||window.addEventListener("resize",Ys),Gt.set(i,t)}function yr(i){Gt.delete(i),Gt.size||window.removeEventListener("resize",Ys)}function vr(i,t,e){const s=i.canvas,n=s&&ai(s);if(!n)return;const o=Cs((a,l)=>{const c=n.clientWidth;e(a,l),c<n.clientWidth&&e()},window),r=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return r.observe(n),xr(i,o),r}function Fe(i,t,e){e&&e.disconnect(),t==="resize"&&yr(i)}function wr(i,t,e){const s=i.canvas,n=Cs(o=>{i.ctx!==null&&e(mr(o,i))},i);return gr(s,t,n),n}class kr extends Ns{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(ur(t,e),s):null}releaseContext(t){const e=t.canvas;if(!e[ue])return!1;const s=e[ue].initial;["height","width"].forEach(o=>{const r=s[o];N(r)?e.removeAttribute(o):e.setAttribute(o,r)});const n=s.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[ue],!0}addEventListener(t,e,s){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:br,detach:_r,resize:vr}[e]||wr;n[e]=r(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={}),n=s[e];if(!n)return;({attach:Fe,detach:Fe,resize:Fe}[e]||pr)(t,e,n),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,n){return Po(t,e,s,n)}isAttached(t){const e=t&&ai(t);return!!(e&&e.isConnected)}}function Sr(i){return!ri()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?dr:kr}class ft{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}hasValue(){return xe(this.x)&&xe(this.y)}getProps(t,e){const s=this.$animations;if(!e||!s)return this;const n={};return t.forEach(o=>{n[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),n}}function Mr(i,t){const e=i.options.ticks,s=Or(i),n=Math.min(e.maxTicksLimit||s,s),o=e.major.enabled?Ar(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>n)return Dr(t,c,o,r/n),c;const h=Cr(o,t,n);if(r>0){let d,f;const u=r>1?Math.round((l-a)/(r-1)):null;for(le(t,c,h,N(u)?0:a-u,a),d=0,f=r-1;d<f;d++)le(t,c,h,o[d],o[d+1]);return le(t,c,h,l,N(u)?t.length:l+u),c}return le(t,c,h),c}function Or(i){const t=i.options.offset,e=i._tickSize(),s=i._length/e+(t?0:1),n=i._maxLength/e;return Math.floor(Math.min(s,n))}function Cr(i,t,e){const s=Pr(i),n=t.length/e;if(!s)return Math.max(n,1);const o=Hn(s);for(let r=0,a=o.length-1;r<a;r++){const l=o[r];if(l>n)return l}return Math.max(n,1)}function Ar(i){const t=[];let e,s;for(e=0,s=i.length;e<s;e++)i[e].major&&t.push(e);return t}function Dr(i,t,e,s){let n=0,o=e[0],r;for(s=Math.ceil(s),r=0;r<i.length;r++)r===o&&(t.push(i[r]),n++,o=e[n*s])}function le(i,t,e,s,n){const o=A(s,0),r=Math.min(A(n,i.length),i.length);let a=0,l,c,h;for(e=Math.ceil(e),n&&(l=n-s,e=l/Math.floor(l/e)),h=o;h<0;)a++,h=Math.round(o+a*e);for(c=Math.max(o,0);c<r;c++)c===h&&(t.push(i[c]),a++,h=Math.round(o+a*e))}function Pr(i){const t=i.length;let e,s;if(t<2)return!1;for(s=i[0],e=1;e<t;++e)if(i[e]-i[e-1]!==s)return!1;return s}const Tr=i=>i==="left"?"right":i==="right"?"left":i,ji=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,Ni=(i,t)=>Math.min(t||i,i);function Vi(i,t){const e=[],s=i.length/t,n=i.length;let o=0;for(;o<n;o+=s)e.push(i[Math.floor(o)]);return e}function Rr(i,t,e){const s=i.ticks.length,n=Math.min(t,s-1),o=i._startPixel,r=i._endPixel,a=1e-6;let l=i.getPixelForTick(n),c;if(!(e&&(s===1?c=Math.max(l-o,r-l):t===0?c=(i.getPixelForTick(1)-l)/2:c=(l-i.getPixelForTick(n-1))/2,l+=n<t?c:-c,l<o-a||l>r+a)))return l}function Lr(i,t){P(i,e=>{const s=e.gc,n=s.length/2;let o;if(n>t){for(o=0;o<n;++o)delete e.data[s[o]];s.splice(0,n)}})}function Bt(i){return i.drawTicks?i.tickLength:0}function Yi(i,t){if(!i.display)return 0;const e=$(i.font,t),s=Q(i.padding);return(H(i.text)?i.text.length:1)*e.lineHeight+s.height}function Er(i,t){return Rt(i,{scale:t,type:"scale"})}function Ir(i,t,e){return Rt(i,{tick:e,index:t,type:"tick"})}function Fr(i,t,e){let s=Qe(i);return(e&&t!=="right"||!e&&t==="right")&&(s=Tr(s)),s}function zr(i,t,e,s){const{top:n,left:o,bottom:r,right:a,chart:l}=i,{chartArea:c,scales:h}=l;let d=0,f,u,m;const g=r-n,p=a-o;if(i.isHorizontal()){if(u=Y(s,o,a),O(e)){const b=Object.keys(e)[0],_=e[b];m=h[b].getPixelForValue(_)+g-t}else e==="center"?m=(c.bottom+c.top)/2+g-t:m=ji(i,e,t);f=a-o}else{if(O(e)){const b=Object.keys(e)[0],_=e[b];u=h[b].getPixelForValue(_)-p+t}else e==="center"?u=(c.left+c.right)/2-p+t:u=ji(i,e,t);m=Y(s,r,n),d=e==="left"?-W:W}return{titleX:u,titleY:m,maxWidth:f,rotation:d}}class Qt extends ft{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:s,_suggestedMax:n}=this;return t=tt(t,Number.POSITIVE_INFINITY),e=tt(e,Number.NEGATIVE_INFINITY),s=tt(s,Number.POSITIVE_INFINITY),n=tt(n,Number.NEGATIVE_INFINITY),{min:tt(t,s),max:tt(e,n),minDefined:at(t),maxDefined:at(e)}}getMinMax(t){let{min:e,max:s,minDefined:n,maxDefined:o}=this.getUserBounds(),r;if(n&&o)return{min:e,max:s};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),n||(e=Math.min(e,r.min)),o||(s=Math.max(s,r.max));return e=o&&e>s?s:e,s=n&&e>s?e:s,{min:tt(e,tt(s,e)),max:tt(s,tt(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const 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(){L(this.options.beforeUpdate,[this])}update(t,e,s){const{beginAtZero:n,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=po(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Vi(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=Mr(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,s;this.isHorizontal()?(e=this.left,s=this.right):(e=this.top,s=this.bottom,t=!t),this._startPixel=e,this._endPixel=s,this._reversePixels=t,this._length=s-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){L(this.options.afterUpdate,[this])}beforeSetDimensions(){L(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(){L(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),L(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){L(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let s,n,o;for(s=0,n=t.length;s<n;s++)o=t[s],o.label=L(e.callback,[o.value,s,t],this)}afterTickToLabelConversion(){L(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){L(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,s=Ni(this.ticks.length,t.ticks.maxTicksLimit),n=e.minRotation||0,o=e.maxRotation;let r=n,a,l,c;if(!this._isVisible()||!e.display||n>=o||s<=1||!this.isHorizontal()){this.labelRotation=n;return}const h=this._getLabelSizes(),d=h.widest.width,f=h.highest.height,u=K(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/s:u/(s-1),d+6>a&&(a=u/(s-(t.offset?.5:1)),l=this.maxHeight-Bt(t.grid)-e.padding-Yi(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),r=jn(Math.min(Math.asin(K((h.highest.height+6)/a,-1,1)),Math.asin(K(l/c,-1,1))-Math.asin(K(f/c,-1,1)))),r=Math.max(n,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){L(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){L(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:s,title:n,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=Yi(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=Bt(o)+l):(t.height=this.maxHeight,t.width=Bt(o)+l),s.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:f}=this._getLabelSizes(),u=s.padding*2,m=yt(this.labelRotation),g=Math.cos(m),p=Math.sin(m);if(a){const b=s.mirror?0:p*d.width+g*f.height;t.height=Math.min(this.maxHeight,t.height+b+u)}else{const b=s.mirror?0:g*d.width+p*f.height;t.width=Math.min(this.maxWidth,t.width+b+u)}this._calculatePadding(c,h,p,g)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,s,n){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,u=0;l?c?(f=n*t.width,u=s*e.height):(f=s*t.height,u=n*e.width):o==="start"?u=e.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,u=e.width/2),this.paddingLeft=Math.max((f-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((u-d+r)*this.width/(this.width-d),0)}else{let h=e.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=e.height,d=0),this.paddingTop=h+r,this.paddingBottom=d+r}}_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(){L(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e<s;e++)N(t[e].label)&&(t.splice(e,1),s--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let s=this.ticks;e<s.length&&(s=Vi(s,e)),this._labelSizes=t=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,s){const{ctx:n,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(e/Ni(e,s));let c=0,h=0,d,f,u,m,g,p,b,_,x,y,v;for(d=0;d<e;d+=l){if(m=t[d].label,g=this._resolveTickFontOptions(d),n.font=p=g.string,b=o[p]=o[p]||{data:{},gc:[]},_=g.lineHeight,x=y=0,!N(m)&&!H(m))x=ki(n,b.data,b.gc,x,m),y=_;else if(H(m))for(f=0,u=m.length;f<u;++f)v=m[f],!N(v)&&!H(v)&&(x=ki(n,b.data,b.gc,x,v),y+=_);r.push(x),a.push(y),c=Math.max(x,c),h=Math.max(y,h)}Lr(o,e);const w=r.indexOf(c),S=a.indexOf(h),k=R=>({width:r[R]||0,height:a[R]||0});return{first:k(0),last:k(e-1),widest:k(w),highest:k(S),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Vn(this._alignToPixels?bt(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const s=e[t];return s.$context||(s.$context=Ir(this.getContext(),t,s))}return this.$context||(this.$context=Er(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=yt(this.labelRotation),s=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*s>a*n?a/s:l/n:l*n<a*s?l/s:a/n}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,s=this.chart,n=this.options,{grid:o,position:r,border:a}=n,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=Bt(o),u=[],m=a.setContext(this.getContext()),g=m.display?m.width:0,p=g/2,b=function(E){return bt(s,E,g)};let _,x,y,v,w,S,k,R,M,D,C,j;if(r==="top")_=b(this.bottom),S=this.bottom-f,R=_-p,D=b(t.top)+p,j=t.bottom;else if(r==="bottom")_=b(this.top),D=t.top,j=b(t.bottom)-p,S=_+p,R=this.top+f;else if(r==="left")_=b(this.right),w=this.right-f,k=_-p,M=b(t.left)+p,C=t.right;else if(r==="right")_=b(this.left),M=t.left,C=b(t.right)-p,w=_+p,k=this.left+f;else if(e==="x"){if(r==="center")_=b((t.top+t.bottom)/2+.5);else if(O(r)){const E=Object.keys(r)[0],I=r[E];_=b(this.chart.scales[E].getPixelForValue(I))}D=t.top,j=t.bottom,S=_+p,R=S+f}else if(e==="y"){if(r==="center")_=b((t.left+t.right)/2);else if(O(r)){const E=Object.keys(r)[0],I=r[E];_=b(this.chart.scales[E].getPixelForValue(I))}w=_-p,k=w-f,M=t.left,C=t.right}const q=A(n.ticks.maxTicksLimit,d),T=Math.max(1,Math.ceil(d/q));for(x=0;x<d;x+=T){const E=this.getContext(x),I=o.setContext(E),J=a.setContext(E),V=I.lineWidth,St=I.color,Jt=J.dash||[],Mt=J.dashOffset,Lt=I.tickWidth,ut=I.tickColor,Et=I.tickBorderDash||[],gt=I.tickBorderDashOffset;y=Rr(this,x,l),y!==void 0&&(v=bt(s,y,V),c?w=k=M=C=v:S=R=D=j=v,u.push({tx1:w,ty1:S,tx2:k,ty2:R,x1:M,y1:D,x2:C,y2:j,width:V,color:St,borderDash:Jt,borderDashOffset:Mt,tickWidth:Lt,tickColor:ut,tickBorderDash:Et,tickBorderDashOffset:gt}))}return this._ticksLength=d,this._borderValue=_,u}_computeLabelItems(t){const e=this.axis,s=this.options,{position:n,ticks:o}=s,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=o,f=Bt(s.grid),u=f+h,m=d?-h:u,g=-yt(this.labelRotation),p=[];let b,_,x,y,v,w,S,k,R,M,D,C,j="middle";if(n==="top")w=this.bottom-m,S=this._getXAxisLabelAlignment();else if(n==="bottom")w=this.top+m,S=this._getXAxisLabelAlignment();else if(n==="left"){const T=this._getYAxisLabelAlignment(f);S=T.textAlign,v=T.x}else if(n==="right"){const T=this._getYAxisLabelAlignment(f);S=T.textAlign,v=T.x}else if(e==="x"){if(n==="center")w=(t.top+t.bottom)/2+u;else if(O(n)){const T=Object.keys(n)[0],E=n[T];w=this.chart.scales[T].getPixelForValue(E)+u}S=this._getXAxisLabelAlignment()}else if(e==="y"){if(n==="center")v=(t.left+t.right)/2-u;else if(O(n)){const T=Object.keys(n)[0],E=n[T];v=this.chart.scales[T].getPixelForValue(E)}S=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?j="top":l==="end"&&(j="bottom"));const q=this._getLabelSizes();for(b=0,_=a.length;b<_;++b){x=a[b],y=x.label;const T=o.setContext(this.getContext(b));k=this.getPixelForTick(b)+o.labelOffset,R=this._resolveTickFontOptions(b),M=R.lineHeight,D=H(y)?y.length:1;const E=D/2,I=T.color,J=T.textStrokeColor,V=T.textStrokeWidth;let St=S;r?(v=k,S==="inner"&&(b===_-1?St=this.options.reverse?"left":"right":b===0?St=this.options.reverse?"right":"left":St="center"),n==="top"?c==="near"||g!==0?C=-D*M+M/2:c==="center"?C=-q.highest.height/2-E*M+M:C=-q.highest.height+M/2:c==="near"||g!==0?C=M/2:c==="center"?C=q.highest.height/2-E*M:C=q.highest.height-D*M,d&&(C*=-1),g!==0&&!T.showLabelBackdrop&&(v+=M/2*Math.sin(g))):(w=k,C=(1-D)*M/2);let Jt;if(T.showLabelBackdrop){const Mt=Q(T.backdropPadding),Lt=q.heights[b],ut=q.widths[b];let Et=C-Mt.top,gt=0-Mt.left;switch(j){case"middle":Et-=Lt/2;break;case"bottom":Et-=Lt;break}switch(S){case"center":gt-=ut/2;break;case"right":gt-=ut;break;case"inner":b===_-1?gt-=ut:b>0&&(gt-=ut/2);break}Jt={left:gt,top:Et,width:ut+Mt.width,height:Lt+Mt.height,color:T.backdropColor}}p.push({label:y,font:R,textOffset:C,options:{rotation:g,color:I,strokeColor:J,strokeWidth:V,textAlign:St,textBaseline:j,translation:[v,w],backdrop:Jt}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-yt(this.labelRotation))return t==="top"?"left":"right";let n="center";return e.align==="start"?n="left":e.align==="end"?n="right":e.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:s,mirror:n,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let c,h;return e==="left"?n?(h=this.right+o,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?n?(h=this.left+o,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:s,top:n,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(s,n,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex(o=>o.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,s=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,h)=>{!h.width||!h.color||(s.save(),s.lineWidth=h.width,s.strokeStyle=h.color,s.setLineDash(h.borderDash||[]),s.lineDashOffset=h.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.stroke(),s.restore())};if(e.display)for(o=0,r=n.length;o<r;++o){const l=n[o];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:s,grid:n}}=this,o=s.setContext(this.getContext()),r=s.display?o.width:0;if(!r)return;const a=n.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,h,d,f;this.isHorizontal()?(c=bt(t,this.left,r)-r/2,h=bt(t,this.right,a)+a/2,d=f=l):(d=bt(t,this.top,r)-r/2,f=bt(t,this.bottom,a)+a/2,c=h=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,d),e.lineTo(h,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const s=this.ctx,n=this._computeLabelArea();n&&ti(s,n);const o=this.getLabelItems(t);for(const r of o){const a=r.options,l=r.font,c=r.label,h=r.textOffset;qt(s,c,0,h,l,a)}n&&ei(s)}drawTitle(){const{ctx:t,options:{position:e,title:s,reverse:n}}=this;if(!s.display)return;const o=$(s.font),r=Q(s.padding),a=s.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||O(e)?(l+=r.bottom,H(s.text)&&(l+=o.lineHeight*(s.text.length-1))):l+=r.top;const{titleX:c,titleY:h,maxWidth:d,rotation:f}=zr(this,l,e,a);qt(t,s.text,0,0,o,{color:s.color,maxWidth:d,rotation:f,textAlign:Fr(a,e,n),textBaseline:"middle",translation:[c,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,s=A(t.grid&&t.grid.z,-1),n=A(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Qt.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[];let o,r;for(o=0,r=e.length;o<r;++o){const a=e[o];a[s]===this.id&&(!t||a.type===t)&&n.push(a)}return n}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return $(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class ce{constructor(t,e,s){this.type=t,this.scope=e,this.override=s,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let s;Wr(e)&&(s=this.register(e));const n=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in n||(n[o]=t,Br(t,r,s),this.override&&F.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,s=t.id,n=this.scope;s in e&&delete e[s],n&&s in F[n]&&(delete F[n][s],this.override&&delete kt[s])}}function Br(i,t,e){const s=Ut(Object.create(null),[e?F.get(e):{},F.get(t),i.defaults]);F.set(t,s),i.defaultRoutes&&Hr(t,i.defaultRoutes),i.descriptors&&F.describe(t,i.descriptors)}function Hr(i,t){Object.keys(t).forEach(e=>{const s=e.split("."),n=s.pop(),o=[i].concat(s).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");F.route(o,n,l,a)})}function Wr(i){return"id"in i&&"defaults"in i}class jr{constructor(){this.controllers=new ce(Hs,"datasets",!0),this.elements=new ce(ft,"elements"),this.plugins=new ce(Object,"plugins"),this.scales=new ce(Qt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,s){[...e].forEach(n=>{const o=s||this._getRegistryForType(n);s||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):P(n,r=>{const a=s||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,s){const n=Ge(t);L(s["before"+n],[],s),e[t](s),L(s["after"+n],[],s)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const s=this._typedRegistries[e];if(s.isForType(t))return s}return this.plugins}_get(t,e,s){const n=e.get(t);if(n===void 0)throw new Error('"'+t+'" is not a registered '+s+".");return n}}var it=new jr;class Nr{constructor(){this._init=[]}notify(t,e,s,n){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=n?this._descriptors(t).filter(n):this._descriptors(t),r=this._notify(o,t,e,s);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),r}_notify(t,e,s,n){n=n||{};for(const o of t){const r=o.plugin,a=r[s],l=[e,n,o.options];if(L(a,l,r)===!1&&n.cancelable)return!1}return!0}invalidate(){N(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const s=t&&t.config,n=A(s.options&&s.options.plugins,{}),o=Vr(s);return n===!1&&!e?[]:$r(t,o,n,e)}_notifyStateChanges(t){const e=this._oldCache||[],s=this._cache,n=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(n(e,s),t,"stop"),this._notify(n(s,e),t,"start")}}function Vr(i){const t={},e=[],s=Object.keys(it.plugins.items);for(let o=0;o<s.length;o++)e.push(it.getPlugin(s[o]));const n=i.plugins||[];for(let o=0;o<n.length;o++){const r=n[o];e.indexOf(r)===-1&&(e.push(r),t[r.id]=!0)}return{plugins:e,localIds:t}}function Yr(i,t){return!t&&i===!1?null:i===!0?{}:i}function $r(i,{plugins:t,localIds:e},s,n){const o=[],r=i.getContext();for(const a of t){const l=a.id,c=Yr(s[l],n);c!==null&&o.push({plugin:a,options:Xr(i.config,{plugin:a,local:e[l]},c,r)})}return o}function Xr(i,{plugin:t,local:e},s,n){const o=i.pluginScopeKeys(t),r=i.getOptionScopes(s,o);return e&&t.defaults&&r.push(t.defaults),i.createResolver(r,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function $e(i,t){const e=F.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Ur(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function Kr(i,t){return i===t?"_index_":"_value_"}function $i(i){if(i==="x"||i==="y"||i==="r")return i}function qr(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function Xe(i,...t){if($i(i))return i;for(const e of t){const s=e.axis||qr(e.position)||i.length>1&&$i(i[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function Xi(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function Gr(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(s=>s.xAxisID===i||s.yAxisID===i);if(e.length)return Xi(i,"x",e[0])||Xi(i,"y",e[0])}return{}}function Zr(i,t){const e=kt[i.type]||{scales:{}},s=t.scales||{},n=$e(i.type,t),o=Object.create(null);return Object.keys(s).forEach(r=>{const a=s[r];if(!O(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=Xe(r,a,Gr(r,i),F.scales[a.type]),c=Kr(l,n),h=e.scales||{};o[r]=Vt(Object.create(null),[{axis:l},a,h[l],h[c]])}),i.data.datasets.forEach(r=>{const a=r.type||i.type,l=r.indexAxis||$e(a,t),h=(kt[a]||{}).scales||{};Object.keys(h).forEach(d=>{const f=Ur(d,l),u=r[f+"AxisID"]||f;o[u]=o[u]||Object.create(null),Vt(o[u],[{axis:f},s[u],h[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];Vt(a,[F.scales[a.type],F.scale])}),o}function $s(i){const t=i.options||(i.options={});t.plugins=A(t.plugins,{}),t.scales=Zr(i,t)}function Xs(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function Qr(i){return i=i||{},i.data=Xs(i.data),$s(i),i}const Ui=new Map,Us=new Set;function he(i,t){let e=Ui.get(i);return e||(e=t(),Ui.set(i,e),Us.add(e)),e}const Ht=(i,t,e)=>{const s=Kt(t,e);s!==void 0&&i.add(s)};class Jr{constructor(t){this._config=Qr(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Xs(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),$s(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return he(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return he(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return he(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return he(`${s}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const s=this._scopeCache;let n=s.get(t);return(!n||e)&&(n=new Map,s.set(t,n)),n}getOptionScopes(t,e,s){const{options:n,type:o}=this,r=this._cachedScopes(t,s),a=r.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>Ht(l,t,d))),h.forEach(d=>Ht(l,n,d)),h.forEach(d=>Ht(l,kt[o]||{},d)),h.forEach(d=>Ht(l,F,d)),h.forEach(d=>Ht(l,Ve,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Us.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,kt[e]||{},F.datasets[e]||{},{type:e},F,Ve]}resolveNamedOptions(t,e,s,n=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Ki(this._resolverCache,t,n);let l=r;if(ea(r,e)){o.$shared=!1,s=dt(s)?s():s;const c=this.createResolver(t,s,a);l=Tt(r,s,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,s=[""],n){const{resolver:o}=Ki(this._resolverCache,t,s);return O(e)?Tt(o,e,void 0,n):o}}function Ki(i,t,e){let s=i.get(t);s||(s=new Map,i.set(t,s));const n=e.join();let o=s.get(n);return o||(o={resolver:si(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},s.set(n,o)),o}const ta=i=>O(i)&&Object.getOwnPropertyNames(i).some(t=>dt(i[t]));function ea(i,t){const{isScriptable:e,isIndexable:s}=Ts(i);for(const n of t){const o=e(n),r=s(n),a=(r||o)&&i[n];if(o&&(dt(a)||ta(a))||r&&H(a))return!0}return!1}var ia="4.4.9";const sa=["top","bottom","left","right","chartArea"];function qi(i,t){return i==="top"||i==="bottom"||sa.indexOf(i)===-1&&t==="x"}function Gi(i,t){return function(e,s){return e[i]===s[i]?e[t]-s[t]:e[i]-s[i]}}function Zi(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),L(e&&e.onComplete,[i],t)}function na(i){const t=i.chart,e=t.options.animation;L(e&&e.onProgress,[i],t)}function Ks(i){return ri()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const ge={},Qi=i=>{const t=Ks(i);return Object.values(ge).filter(e=>e.canvas===t).pop()};function oa(i,t,e){const s=Object.keys(i);for(const n of s){const o=+n;if(o>=t){const r=i[n];delete i[n],(e>0||o>t)&&(i[o+e]=r)}}}function ra(i,t,e,s){return!e||i.type==="mouseout"?null:s?t:i}let ci=class{static defaults=F;static instances=ge;static overrides=kt;static registry=it;static version=ia;static getChart=Qi;static register(...t){it.add(...t),Ji()}static unregister(...t){it.remove(...t),Ji()}constructor(t,e){const s=this.config=new Jr(e),n=Ks(t),o=Qi(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||Sr(n)),this.platform.updateConfig(s);const a=this.platform.acquireContext(n,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Tn(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Nr,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Kn(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],ge[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}nt.listen(this,"complete",Zi),nt.listen(this,"progress",na),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:o}=this;return N(t)?e&&o?o:n?s/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return it}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ci(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Si(this.canvas,this.ctx),this}stop(){return nt.stop(this),this}resize(t,e){nt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const s=this.options,n=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,o),a=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Ci(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),L(s.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};P(e,(s,n)=>{s.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,s=this.scales,n=Object.keys(s).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],l=Xe(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),P(o,r=>{const a=r.options,l=a.id,c=Xe(l,a),h=A(a.type,r.dtype);(a.position===void 0||qi(a.position,c)!==qi(r.dposition))&&(a.position=r.dposition),n[l]=!0;let d=null;if(l in s&&s[l].type===h)d=s[l];else{const f=it.getScale(h);d=new f({id:l,type:h,ctx:this.ctx,chart:this}),s[d.id]=d}d.init(a,t)}),P(n,(r,a)=>{r||delete s[a]}),P(s,r=>{Z.configure(this,r,r.options),Z.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((n,o)=>n.index-o.index),s>e){for(let n=e;n<s;++n)this._destroyDatasetMeta(n);t.splice(e,s-e)}this._sortedMetasets=t.slice(0).sort(Gi("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((s,n)=>{e.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let s,n;for(this._removeUnreferencedMetasets(),s=0,n=e.length;s<n;s++){const o=e[s];let r=this.getDatasetMeta(s);const a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(s),r=this.getDatasetMeta(s)),r.type=a,r.indexAxis=o.indexAxis||$e(a,this.options),r.order=o.order||0,r.index=s,r.label=""+o.label,r.visible=this.isDatasetVisible(s),r.controller)r.controller.updateIndex(s),r.controller.linkScales();else{const l=it.getController(a),{datasetElementType:c,dataElementType:h}=F.datasets[a];Object.assign(l,{dataElementType:it.getElement(h),datasetElementType:c&&it.getElement(c)}),r.controller=new l(this,s),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){P(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,h=this.data.datasets.length;c<h;c++){const{controller:d}=this.getDatasetMeta(c),f=!n&&o.indexOf(d)===-1;d.buildOrUpdateElements(f),r=Math.max(+d.getMaxOverflow(),r)}r=this._minPadding=s.layout.autoPadding?r:0,this._updateLayout(r),n||P(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Gi("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){P(this.scales,t=>{Z.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!pi(e,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:s,start:n,count:o}of e){const r=s==="_removeElements"?-o:o;oa(t,n,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,s=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),n=s(0);for(let o=1;o<e;o++)if(!pi(n,s(o)))return;return Array.from(n).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Z.update(this,this.width,this.height,t);const e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],P(this.boxes,n=>{s&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e<s;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,s=this.data.datasets.length;e<s;++e)this._updateDataset(e,dt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const s=this.getDatasetMeta(t),n={meta:s,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",n)!==!1&&(s.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(nt.has(this)?this.attached&&!nt.running(this)&&nt.start(this):(this.draw(),Zi({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:s,height:n}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(s,n)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const 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){const e=this._sortedMetasets,s=[];let n,o;for(n=0,o=e.length;n<o;++n){const r=e[n];(!t||r.visible)&&s.push(r)}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,s={meta:t,index:t.index,cancelable:!0},n=Io(this,t);this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(n&&ti(e,n),t.controller.draw(),n&&ei(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Je(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){const o=sr.modes[e];return typeof o=="function"?o(this,t,s,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],s=this._metasets;let n=s.filter(o=>o&&o._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},s.push(n)),n}getContext(){return this.$context||(this.$context=Rt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){const s=this.getDatasetMeta(t);s.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){const n=s?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,n);be(e)?(o.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),r.update(o,{visible:s}),this.update(a=>a.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),nt.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Si(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete ge[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,s=(o,r)=>{e.addEventListener(this,o,r),t[o]=r},n=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};P(this.options.events,o=>s(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,s=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},n=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{n("attach",a),this.attached=!0,this.resize(),s("resize",o),s("detach",r)};r=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),s("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){P(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},P(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,s){const n=s?"set":"remove";let o,r,a,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];const c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[n+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],s=t.map(({datasetIndex:o,index:r})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!pe(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,s){const n=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),r=o(e,t),a=s?t:o(t,e);r.length&&this.updateHoverStyle(r,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,e){const s={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,n)===!1)return;const o=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,n),(o||s.changed)&&this.render(),this}_handleEvent(t,e,s){const{_active:n=[],options:o}=this,r=e,a=this._getActiveElements(t,n,s,r),l=zn(t),c=ra(t,this._lastEvent,s,l);s&&(this._lastEvent=null,L(o.onHover,[t,a,this],this),l&&L(o.onClick,[t,a,this],this));const h=!pe(a,n);return(h||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=c,h}_getActiveElements(t,e,s,n){if(t.type==="mouseout")return[];if(!s)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}};function Ji(){return P(ci.instances,i=>i._plugins.invalidate())}function aa(i,t,e){const{startAngle:s,pixelMargin:n,x:o,y:r,outerRadius:a,innerRadius:l}=t;let c=n/a;i.beginPath(),i.arc(o,r,a,s-c,e+c),l>n?(c=n/l,i.arc(o,r,l,e+c,s-c,!0)):i.arc(o,r,n,e+W,s-W),i.closePath(),i.clip()}function la(i){return ii(i,["outerStart","outerEnd","innerStart","innerEnd"])}function ca(i,t,e,s){const n=la(i.options.borderRadius),o=(e-t)/2,r=Math.min(o,s*t/2),a=l=>{const c=(e-Math.min(o,l))*s/2;return K(l,0,Math.min(o,c))};return{outerStart:a(n.outerStart),outerEnd:a(n.outerEnd),innerStart:K(n.innerStart,0,r),innerEnd:K(n.innerEnd,0,r)}}function Ct(i,t,e,s){return{x:e+i*Math.cos(t),y:s+i*Math.sin(t)}}function Se(i,t,e,s,n,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,d=Math.max(t.outerRadius+s+e-c,0),f=h>0?h+s+e+c:0;let u=0;const m=n-l;if(s){const T=h>0?h-s:0,E=d>0?d-s:0,I=(T+E)/2,J=I!==0?m*I/(I+s):m;u=(m-J)/2}const g=Math.max(.001,m*d-e/B)/d,p=(m-g)/2,b=l+p+u,_=n-p-u,{outerStart:x,outerEnd:y,innerStart:v,innerEnd:w}=ca(t,f,d,_-b),S=d-x,k=d-y,R=b+x/S,M=_-y/k,D=f+v,C=f+w,j=b+v/D,q=_-w/C;if(i.beginPath(),o){const T=(R+M)/2;if(i.arc(r,a,d,R,T),i.arc(r,a,d,T,M),y>0){const V=Ct(k,M,r,a);i.arc(V.x,V.y,y,M,_+W)}const E=Ct(C,_,r,a);if(i.lineTo(E.x,E.y),w>0){const V=Ct(C,q,r,a);i.arc(V.x,V.y,w,_+W,q+Math.PI)}const I=(_-w/f+(b+v/f))/2;if(i.arc(r,a,f,_-w/f,I,!0),i.arc(r,a,f,I,b+v/f,!0),v>0){const V=Ct(D,j,r,a);i.arc(V.x,V.y,v,j+Math.PI,b-W)}const J=Ct(S,b,r,a);if(i.lineTo(J.x,J.y),x>0){const V=Ct(S,R,r,a);i.arc(V.x,V.y,x,b-W,R)}}else{i.moveTo(r,a);const T=Math.cos(R)*d+r,E=Math.sin(R)*d+a;i.lineTo(T,E);const I=Math.cos(M)*d+r,J=Math.sin(M)*d+a;i.lineTo(I,J)}i.closePath()}function ha(i,t,e,s,n){const{fullCircles:o,startAngle:r,circumference:a}=t;let l=t.endAngle;if(o){Se(i,t,e,s,l,n);for(let c=0;c<o;++c)i.fill();isNaN(a)||(l=r+(a%z||z))}return Se(i,t,e,s,l,n),i.fill(),l}function da(i,t,e,s,n){const{fullCircles:o,startAngle:r,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:h,borderDash:d,borderDashOffset:f}=l,u=l.borderAlign==="inner";if(!c)return;i.setLineDash(d||[]),i.lineDashOffset=f,u?(i.lineWidth=c*2,i.lineJoin=h||"round"):(i.lineWidth=c,i.lineJoin=h||"bevel");let m=t.endAngle;if(o){Se(i,t,e,s,m,n);for(let g=0;g<o;++g)i.stroke();isNaN(a)||(m=r+(a%z||z))}u&&aa(i,t,m),o||(Se(i,t,e,s,m,n),i.stroke())}class Xa extends ft{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=>t!=="borderDash"};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,s){const n=this.getProps(["x","y"],s),{angle:o,distance:r}=Ss(n,{x:t,y:e}),{startAngle:a,endAngle:l,innerRadius:c,outerRadius:h,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),f=(this.options.spacing+this.options.borderWidth)/2,u=A(d,l-a),m=ye(o,a,l)&&a!==l,g=u>=z||m,p=vt(r,c+f,h+f);return g&&p}getCenterPoint(t){const{x:e,y:s,startAngle:n,endAngle:o,innerRadius:r,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:l,spacing:c}=this.options,h=(n+o)/2,d=(r+a+c+l)/2;return{x:e+Math.cos(h)*d,y:s+Math.sin(h)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:s}=this,n=(e.offset||0)/4,o=(e.spacing||0)/2,r=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=s>z?Math.floor(s/z):0,s===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*n,Math.sin(a)*n);const l=1-Math.sin(Math.min(B,s||0)),c=n*l;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,ha(t,this,c,o,r),da(t,this,c,o,r),t.restore()}}function ts(i,t,e,s){const n=i.options,{[e]:o}=i.getProps([e],s);return Math.abs(t-o)<n.radius+n.hitRadius}class Ua extends ft{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,s){const n=this.options,{x:o,y:r}=this.getProps(["x","y"],s);return Math.pow(t-o,2)+Math.pow(e-r,2)<Math.pow(n.hitRadius+n.radius,2)}inXRange(t,e){return ts(this,t,"x",e)}inYRange(t,e){return ts(this,t,"y",e)}getCenterPoint(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const s=e&&t.borderWidth||0;return(e+s)*2}draw(t,e){const s=this.options;this.skip||s.radius<.1||!Je(this,e,this.size(s)/2)||(t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth,t.fillStyle=s.backgroundColor,Ye(t,s,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function qs(i,t){const{x:e,y:s,base:n,width:o,height:r}=i.getProps(["x","y","base","width","height"],t);let a,l,c,h,d;return i.horizontal?(d=r/2,a=Math.min(e,n),l=Math.max(e,n),c=s-d,h=s+d):(d=o/2,a=e-d,l=e+d,c=Math.min(s,n),h=Math.max(s,n)),{left:a,top:c,right:l,bottom:h}}function ct(i,t,e,s){return i?0:K(t,e,s)}function fa(i,t,e){const s=i.options.borderWidth,n=i.borderSkipped,o=Ps(s);return{t:ct(n.top,o.top,0,e),r:ct(n.right,o.right,0,t),b:ct(n.bottom,o.bottom,0,e),l:ct(n.left,o.left,0,t)}}function ua(i,t,e){const{enableBorderRadius:s}=i.getProps(["enableBorderRadius"]),n=i.options.borderRadius,o=Dt(n),r=Math.min(t,e),a=i.borderSkipped,l=s||O(n);return{topLeft:ct(!l||a.top||a.left,o.topLeft,0,r),topRight:ct(!l||a.top||a.right,o.topRight,0,r),bottomLeft:ct(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:ct(!l||a.bottom||a.right,o.bottomRight,0,r)}}function ga(i){const t=qs(i),e=t.right-t.left,s=t.bottom-t.top,n=fa(i,e/2,s/2),o=ua(i,e/2,s/2);return{outer:{x:t.left,y:t.top,w:e,h:s,radius:o},inner:{x:t.left+n.l,y:t.top+n.t,w:e-n.l-n.r,h:s-n.t-n.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,o.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(n.b,n.r))}}}}function ze(i,t,e,s){const n=t===null,o=e===null,a=i&&!(n&&o)&&qs(i,s);return a&&(n||vt(t,a.left,a.right))&&(o||vt(e,a.top,a.bottom))}function pa(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function ma(i,t){i.rect(t.x,t.y,t.w,t.h)}function Be(i,t,e={}){const s=i.x!==e.x?-t:0,n=i.y!==e.y?-t:0,o=(i.x+i.w!==e.x+e.w?t:0)-s,r=(i.y+i.h!==e.y+e.h?t:0)-n;return{x:i.x+s,y:i.y+n,w:i.w+o,h:i.h+r,radius:i.radius}}class Ka extends ft{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){const{inflateAmount:e,options:{borderColor:s,backgroundColor:n}}=this,{inner:o,outer:r}=ga(this),a=pa(r.radius)?ve:ma;t.save(),(r.w!==o.w||r.h!==o.h)&&(t.beginPath(),a(t,Be(r,e,o)),t.clip(),a(t,Be(o,-e,r)),t.fillStyle=s,t.fill("evenodd")),t.beginPath(),a(t,Be(o,e)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,e,s){return ze(this,t,e,s)}inXRange(t,e){return ze(this,t,null,e)}inYRange(t,e){return ze(this,null,t,e)}getCenterPoint(t){const{x:e,y:s,base:n,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+n)/2:e,y:o?s:(s+n)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}const es=(i,t)=>{let{boxHeight:e=t,boxWidth:s=t}=i;return i.usePointStyle&&(e=Math.min(e,t),s=i.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(t,e)}},ba=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class is extends ft{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=L(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,n)=>t.sort(s,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const s=t.labels,n=$(s.font),o=n.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=es(s,o);let c,h;e.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,n,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,n){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+a;let d=t;o.textAlign="left",o.textBaseline="middle";let f=-1,u=-h;return this.legendItems.forEach((m,g)=>{const p=s+e/2+o.measureText(m.text).width;(g===0||c[c.length-1]+p+2*a>r)&&(d+=h,c[c.length-(g>0?0:1)]=0,u+=h,f++),l[g]={left:0,top:u,row:f,width:p,height:n},c[c.length-1]+=p+a}),d}_fitCols(t,e,s,n){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t;let d=a,f=0,u=0,m=0,g=0;return this.legendItems.forEach((p,b)=>{const{itemWidth:_,itemHeight:x}=_a(s,e,o,p,n);b>0&&u+x+2*a>h&&(d+=f+a,c.push({width:f,height:u}),m+=f+a,g++,f=u=0),l[b]={left:m,top:u,col:g,width:_,height:x},f=Math.max(f,_),u+=x+a}),d+=f,c.push({width:f,height:u}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:n},rtl:o}}=this,r=Pt(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=Y(s,this.left+n,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=Y(s,this.left+n,this.right-this.lineWidths[a])),c.top+=this.top+t+n,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+n}else{let a=0,l=Y(s,this.top+t+n,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=Y(s,this.top+t+n,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+n,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;ti(t,this),this._draw(),ei(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:n}=this,{align:o,labels:r}=t,a=F.color,l=Pt(t.rtl,this.left,this.width),c=$(r.font),{padding:h}=r,d=c.size,f=d/2;let u;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;const{boxWidth:m,boxHeight:g,itemHeight:p}=es(r,d),b=function(w,S,k){if(isNaN(m)||m<=0||isNaN(g)||g<0)return;n.save();const R=A(k.lineWidth,1);if(n.fillStyle=A(k.fillStyle,a),n.lineCap=A(k.lineCap,"butt"),n.lineDashOffset=A(k.lineDashOffset,0),n.lineJoin=A(k.lineJoin,"miter"),n.lineWidth=R,n.strokeStyle=A(k.strokeStyle,a),n.setLineDash(A(k.lineDash,[])),r.usePointStyle){const M={radius:g*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:R},D=l.xPlus(w,m/2),C=S+f;Ds(n,M,D,C,r.pointStyleWidth&&m)}else{const M=S+Math.max((d-g)/2,0),D=l.leftForLtr(w,m),C=Dt(k.borderRadius);n.beginPath(),Object.values(C).some(j=>j!==0)?ve(n,{x:D,y:M,w:m,h:g,radius:C}):n.rect(D,M,m,g),n.fill(),R!==0&&n.stroke()}n.restore()},_=function(w,S,k){qt(n,k.text,w,S+p/2,c,{strikethrough:k.hidden,textAlign:l.textAlign(k.textAlign)})},x=this.isHorizontal(),y=this._computeTitleHeight();x?u={x:Y(o,this.left+h,this.right-s[0]),y:this.top+h+y,line:0}:u={x:this.left+h,y:Y(o,this.top+y+h,this.bottom-e[0].height),line:0},Is(this.ctx,t.textDirection);const v=p+h;this.legendItems.forEach((w,S)=>{n.strokeStyle=w.fontColor,n.fillStyle=w.fontColor;const k=n.measureText(w.text).width,R=l.textAlign(w.textAlign||(w.textAlign=r.textAlign)),M=m+f+k;let D=u.x,C=u.y;l.setWidth(this.width),x?S>0&&D+M+h>this.right&&(C=u.y+=v,u.line++,D=u.x=Y(o,this.left+h,this.right-s[u.line])):S>0&&C+v>this.bottom&&(D=u.x=D+e[u.line].width+h,u.line++,C=u.y=Y(o,this.top+y+h,this.bottom-e[u.line].height));const j=l.x(D);if(b(j,C,w),D=qn(R,D+m+f,x?D+M:this.right,t.rtl),_(l.x(D),C,w),x)u.x+=M+h;else if(typeof w.text!="string"){const q=c.lineHeight;u.y+=Gs(w,q)+h}else u.y+=v}),Fs(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,s=$(e.font),n=Q(e.padding);if(!e.display)return;const o=Pt(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=s.size/2,c=n.top+l;let h,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),h=this.top+c,d=Y(t.align,d,this.right-f);else{const m=this.columnSizes.reduce((g,p)=>Math.max(g,p.height),0);h=c+Y(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}const u=Y(a,d,d+f);r.textAlign=o.textAlign(Qe(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=s.string,qt(r,e.text,u,h,s)}_computeTitleHeight(){const t=this.options.title,e=$(t.font),s=Q(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,n,o;if(vt(t,this.left,this.right)&&vt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;s<o.length;++s)if(n=o[s],vt(t,n.left,n.left+n.width)&&vt(e,n.top,n.top+n.height))return this.legendItems[s]}return null}handleEvent(t){const e=this.options;if(!va(t.type,e))return;const s=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const n=this._hoveredItem,o=ba(n,s);n&&!o&&L(e.onLeave,[t,n,this],this),this._hoveredItem=s,s&&!o&&L(e.onHover,[t,s,this],this)}else s&&L(e.onClick,[t,s,this],this)}}function _a(i,t,e,s,n){const o=xa(s,i,t,e),r=ya(n,s,t.lineHeight);return{itemWidth:o,itemHeight:r}}function xa(i,t,e,s){let n=i.text;return n&&typeof n!="string"&&(n=n.reduce((o,r)=>o.length>r.length?o:r)),t+e.size/2+s.measureText(n).width}function ya(i,t,e){let s=i;return typeof t.text!="string"&&(s=Gs(t,e)),s}function Gs(i,t){const e=i.text?i.text.length:0;return t*e}function va(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var qa={id:"legend",_element:is,start(i,t,e){const s=i.legend=new is({ctx:i.ctx,options:e,chart:i});Z.configure(i,s,e),Z.addBox(i,s)},stop(i){Z.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const s=i.legend;Z.configure(i,s,e),s.options=e},afterUpdate(i){const t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){const s=t.datasetIndex,n=e.chart;n.isDatasetVisible(s)?(n.hide(s),t.hidden=!0):(n.show(s),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:n,color:o,useBorderRadius:r,borderRadius:a}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=Q(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:s||c.pointStyle,rotation:c.rotation,textAlign:n||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class Zs extends ft{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){const s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const n=H(s.text)?s.text.length:1;this._padding=Q(s.padding);const o=n*$(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:s,bottom:n,right:o,options:r}=this,a=r.align;let l=0,c,h,d;return this.isHorizontal()?(h=Y(a,s,o),d=e+t,c=o-s):(r.position==="left"?(h=s+t,d=Y(a,n,e),l=B*-.5):(h=o-t,d=Y(a,e,n),l=B*.5),c=n-e),{titleX:h,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const s=$(e.font),o=s.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);qt(t,e.text,0,0,s,{color:e.color,maxWidth:l,rotation:c,textAlign:Qe(e.align),textBaseline:"middle",translation:[r,a]})}}function wa(i,t){const e=new Zs({ctx:i.ctx,options:t,chart:i});Z.configure(i,e,t),Z.addBox(i,e),i.titleBlock=e}var Ga={id:"title",_element:Zs,start(i,t,e){wa(i,e)},stop(i){const t=i.titleBlock;Z.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const s=i.titleBlock;Z.configure(i,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Nt={average(i){if(!i.length)return!1;let t,e,s=new Set,n=0,o=0;for(t=0,e=i.length;t<e;++t){const a=i[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();s.add(l.x),n+=l.y,++o}}return o===0||s.size===0?!1:{x:[...s].reduce((a,l)=>a+l)/s.size,y:n/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,s=t.y,n=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=i.length;o<r;++o){const l=i[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=Nn(t,c);h<n&&(n=h,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,s=l.y}return{x:e,y:s}}};function et(i,t){return t&&(H(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function ot(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
17
17
  `)>-1?i.split(`
18
- `):i}function wa(i,t){const{element:e,datasetIndex:s,index:n}=t,o=i.getDatasetMeta(s).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:i,label:r,parsed:o.getParsed(n),raw:i.data.datasets[s].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function ss(i,t){const e=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:r,boxHeight:a}=t,l=$(t.bodyFont),c=$(t.titleFont),h=$(t.footerFont),d=o.length,f=n.length,u=s.length,m=Q(t.padding);let g=m.height,p=0,b=s.reduce((y,v)=>y+v.before.length+v.lines.length+v.after.length,0);if(b+=i.beforeBody.length+i.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const y=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;g+=u*y+(b-u)*l.lineHeight+(b-1)*t.bodySpacing}f&&(g+=t.footerMarginTop+f*h.lineHeight+(f-1)*t.footerSpacing);let _=0;const x=function(y){p=Math.max(p,e.measureText(y).width+_)};return e.save(),e.font=c.string,P(i.title,x),e.font=l.string,P(i.beforeBody.concat(i.afterBody),x),_=t.displayColors?r+2+t.boxPadding:0,P(s,y=>{P(y.before,x),P(y.lines,x),P(y.after,x)}),_=0,e.font=h.string,P(i.footer,x),e.restore(),p+=m.width,{width:p,height:g}}function ka(i,t){const{y:e,height:s}=t;return e<s/2?"top":e>i.height-s/2?"bottom":"center"}function Sa(i,t,e,s){const{x:n,width:o}=s,r=e.caretSize+e.caretPadding;if(i==="left"&&n+o+r>t.width||i==="right"&&n-o-r<0)return!0}function Ma(i,t,e,s){const{x:n,width:o}=e,{width:r,chartArea:{left:a,right:l}}=i;let c="center";return s==="center"?c=n<=(a+l)/2?"left":"right":n<=o/2?c="left":n>=r-o/2&&(c="right"),Sa(c,i,t,e)&&(c="center"),c}function ns(i,t,e){const s=e.yAlign||t.yAlign||ka(i,e);return{xAlign:e.xAlign||t.xAlign||Ma(i,t,e,s),yAlign:s}}function Oa(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function Ca(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function os(i,t,e,s){const{caretSize:n,caretPadding:o,cornerRadius:r}=i,{xAlign:a,yAlign:l}=e,c=n+o,{topLeft:h,topRight:d,bottomLeft:f,bottomRight:u}=Dt(r);let m=Oa(t,a);const g=Ca(t,l,c);return l==="center"?a==="left"?m+=c:a==="right"&&(m-=c):a==="left"?m-=Math.max(h,f)+n:a==="right"&&(m+=Math.max(d,u)+n),{x:K(m,0,s.width-t.width),y:K(g,0,s.height-t.height)}}function de(i,t,e){const s=Q(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function rs(i){return et([],ot(i))}function Aa(i,t,e){return Rt(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function as(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const Qs={beforeTitle:st,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex<s)return e[t.dataIndex]}return""},afterTitle:st,beforeBody:st,beforeLabel:st,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let t=i.dataset.label||"";t&&(t+=": ");const e=i.formattedValue;return N(e)||(t+=e),t},labelColor(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:st,afterBody:st,beforeFooter:st,footer:st,afterFooter:st};function X(i,t,e,s){const n=i[t].call(e,s);return typeof n>"u"?Qs[t].call(e,s):n}class ls extends ft{static positioners=Nt;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(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,s=this.options.setContext(this.getContext()),n=s.enabled&&e.options.animation&&s.animations,o=new zs(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Aa(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e,n=X(s,"beforeTitle",this,t),o=X(s,"title",this,t),r=X(s,"afterTitle",this,t);let a=[];return a=et(a,ot(n)),a=et(a,ot(o)),a=et(a,ot(r)),a}getBeforeBody(t,e){return rs(X(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:s}=e,n=[];return P(t,o=>{const r={before:[],lines:[],after:[]},a=as(s,o);et(r.before,ot(X(a,"beforeLabel",this,o))),et(r.lines,X(a,"label",this,o)),et(r.after,ot(X(a,"afterLabel",this,o))),n.push(r)}),n}getAfterBody(t,e){return rs(X(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:s}=e,n=X(s,"beforeFooter",this,t),o=X(s,"footer",this,t),r=X(s,"afterFooter",this,t);let a=[];return a=et(a,ot(n)),a=et(a,ot(o)),a=et(a,ot(r)),a}_createItems(t){const e=this._active,s=this.chart.data,n=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(wa(this.chart,e[l]));return t.filter&&(a=a.filter((h,d,f)=>t.filter(h,d,f,s))),t.itemSort&&(a=a.sort((h,d)=>t.itemSort(h,d,s))),P(a,h=>{const d=as(t.callbacks,h);n.push(X(d,"labelColor",this,h)),o.push(X(d,"labelPointStyle",this,h)),r.push(X(d,"labelTextColor",this,h))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const s=this.options.setContext(this.getContext()),n=this._active;let o,r=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const a=Nt[s.position].call(this,n,this._eventPosition);r=this._createItems(s),this.title=this.getTitle(r,s),this.beforeBody=this.getBeforeBody(r,s),this.body=this.getBody(r,s),this.afterBody=this.getAfterBody(r,s),this.footer=this.getFooter(r,s);const l=this._size=ss(this,s),c=Object.assign({},a,l),h=ns(this.chart,s,c),d=os(s,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,n){const o=this.getCaretPosition(t,s,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,s){const{xAlign:n,yAlign:o}=this,{caretSize:r,cornerRadius:a}=s,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=Dt(a),{x:f,y:u}=t,{width:m,height:g}=e;let p,b,_,x,y,v;return o==="center"?(y=u+g/2,n==="left"?(p=f,b=p-r,x=y+r,v=y-r):(p=f+m,b=p+r,x=y-r,v=y+r),_=p):(n==="left"?b=f+Math.max(l,h)+r:n==="right"?b=f+m-Math.max(c,d)-r:b=this.caretX,o==="top"?(x=u,y=x-r,p=b-r,_=b+r):(x=u+g,y=x+r,p=b+r,_=b-r),v=x),{x1:p,x2:b,x3:_,y1:x,y2:y,y3:v}}drawTitle(t,e,s){const n=this.title,o=n.length;let r,a,l;if(o){const c=Pt(s.rtl,this.x,this.width);for(t.x=de(this,s.titleAlign,s),e.textAlign=c.textAlign(s.titleAlign),e.textBaseline="middle",r=$(s.titleFont),a=s.titleSpacing,e.fillStyle=s.titleColor,e.font=r.string,l=0;l<o;++l)e.fillText(n[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=s.titleMarginBottom-a)}}_drawColorBox(t,e,s,n,o){const r=this.labelColors[s],a=this.labelPointStyles[s],{boxHeight:l,boxWidth:c}=o,h=$(o.bodyFont),d=de(this,"left",o),f=n.x(d),u=l<h.lineHeight?(h.lineHeight-l)/2:0,m=e.y+u;if(o.usePointStyle){const g={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},p=n.leftForLtr(f,c)+c/2,b=m+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Ye(t,g,p,b),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Ye(t,g,p,b)}else{t.lineWidth=O(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const g=n.leftForLtr(f,c),p=n.leftForLtr(n.xPlus(f,1),c-2),b=Dt(r.borderRadius);Object.values(b).some(_=>_!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ve(t,{x:g,y:m,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),ve(t,{x:p,y:m+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(g,m,c,l),t.strokeRect(g,m,c,l),t.fillStyle=r.backgroundColor,t.fillRect(p,m+1,c-2,l-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:n}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=s,d=$(s.bodyFont);let f=d.lineHeight,u=0;const m=Pt(s.rtl,this.x,this.width),g=function(k){e.fillText(k,m.x(t.x+u),t.y+f/2),t.y+=f+o},p=m.textAlign(r);let b,_,x,y,v,w,S;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=de(this,p,s),e.fillStyle=s.bodyColor,P(this.beforeBody,g),u=a&&p!=="right"?r==="center"?c/2+h:c+2+h:0,y=0,w=n.length;y<w;++y){for(b=n[y],_=this.labelTextColors[y],e.fillStyle=_,P(b.before,g),x=b.lines,a&&x.length&&(this._drawColorBox(e,t,y,m,s),f=Math.max(d.lineHeight,l)),v=0,S=x.length;v<S;++v)g(x[v]),f=d.lineHeight;P(b.after,g)}u=0,f=d.lineHeight,P(this.afterBody,g),t.y-=o}drawFooter(t,e,s){const n=this.footer,o=n.length;let r,a;if(o){const l=Pt(s.rtl,this.x,this.width);for(t.x=de(this,s.footerAlign,s),t.y+=s.footerMarginTop,e.textAlign=l.textAlign(s.footerAlign),e.textBaseline="middle",r=$(s.footerFont),e.fillStyle=s.footerColor,e.font=r.string,a=0;a<o;++a)e.fillText(n[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+s.footerSpacing}}drawBackground(t,e,s,n){const{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:h}=s,{topLeft:d,topRight:f,bottomLeft:u,bottomRight:m}=Dt(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(a+d,l),r==="top"&&this.drawCaret(t,e,s,n),e.lineTo(a+c-f,l),e.quadraticCurveTo(a+c,l,a+c,l+f),r==="center"&&o==="right"&&this.drawCaret(t,e,s,n),e.lineTo(a+c,l+h-m),e.quadraticCurveTo(a+c,l+h,a+c-m,l+h),r==="bottom"&&this.drawCaret(t,e,s,n),e.lineTo(a+u,l+h),e.quadraticCurveTo(a,l+h,a,l+h-u),r==="center"&&o==="left"&&this.drawCaret(t,e,s,n),e.lineTo(a,l+d),e.quadraticCurveTo(a,l,a+d,l),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,s=this.$animations,n=s&&s.x,o=s&&s.y;if(n||o){const r=Nt[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=ss(this,t),l=Object.assign({},r,this._size),c=ns(e,t,l),h=os(t,l,c,e);(n._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const r=Q(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=s,this.drawBackground(o,t,n,e),Is(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Fs(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const s=this._active,n=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!pe(s,n),r=this._positionChanged(n,e);(o||r)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,s),a=this._positionChanged(r,t),l=e||!pe(r,o)||a;return l&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,s,n){const o=this.options;if(t.type==="mouseout")return[];if(!n)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:s,caretY:n,options:o}=this,r=Nt[o.position].call(this,t,e);return r!==!1&&(s!==r.x||n!==r.y)}}var Ga={id:"tooltip",_element:ls,positioners:Nt,afterInit(i,t,e){e&&(i.tooltip=new ls({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Qs},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const Da=(i,t,e,s)=>(typeof t=="string"?(e=i.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Pa(i,t,e,s){const n=i.indexOf(t);if(n===-1)return Da(i,t,e,s);const o=i.lastIndexOf(t);return n!==o?e:n}const Ta=(i,t)=>i===null?null:K(Math.round(i),0,t);function cs(i){const t=this.getLabels();return i>=0&&i<t.length?t[i]:i}class Za extends Qt{static id="category";static defaults={ticks:{callback:cs}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const s=this.getLabels();for(const{index:n,label:o}of e)s[n]===o&&s.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(N(t))return null;const s=this.getLabels();return e=isFinite(e)&&s[e]===t?e:Pa(s,t,A(e,t),this._addedLabels),Ta(e,s.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:s,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(s=0),e||(n=this.getLabels().length-1)),this.min=s,this.max=n}buildTicks(){const t=this.min,e=this.max,s=this.options.offset,n=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let r=t;r<=e;r++)n.push({value:r});return n}getLabelForValue(t){return cs.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const 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}}const Ce={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}},U=Object.keys(Ce);function hs(i,t){return i-t}function ds(i,t){if(N(t))return null;const e=i._adapter,{parser:s,round:n,isoWeekday:o}=i._parseOpts;let r=t;return typeof s=="function"&&(r=s(r)),at(r)||(r=typeof s=="string"?e.parse(r,s):e.parse(r)),r===null?null:(n&&(r=n==="week"&&(xe(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,n)),+r)}function fs(i,t,e,s){const n=U.length;for(let o=U.indexOf(i);o<n-1;++o){const r=Ce[U[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((e-t)/(a*r.size))<=s)return U[o]}return U[n-1]}function Ra(i,t,e,s,n){for(let o=U.length-1;o>=U.indexOf(e);o--){const r=U[o];if(Ce[r].common&&i._adapter.diff(n,s,r)>=t-1)return r}return U[e?U.indexOf(e):0]}function La(i){for(let t=U.indexOf(i)+1,e=U.length;t<e;++t)if(Ce[U[t]].common)return U[t]}function us(i,t,e){if(!e)i[t]=!0;else if(e.length){const{lo:s,hi:n}=Ze(e,t),o=e[s]>=t?e[s]:e[n];i[o]=!0}}function Ea(i,t,e,s){const n=i._adapter,o=+n.startOf(t[0].value,s),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+n.add(a,1,s))l=e[a],l>=0&&(t[l].major=!0);return t}function gs(i,t,e){const s=[],n={},o=t.length;let r,a;for(r=0;r<o;++r)a=t[r],n[a]=r,s.push({value:a,major:!1});return o===0||!e?s:Ea(i,s,n,e)}class ps extends Qt{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={}){const s=t.time||(t.time={}),n=this._adapter=new Go._date(t.adapters.date);n.init(e),Vt(s.displayFormats,n.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:ds(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,s=t.time.unit||"day";let{min:n,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(n=Math.min(n,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!r||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),n=at(n)&&!isNaN(n)?n:+e.startOf(Date.now(),s),o=at(o)&&!isNaN(o)?o:+e.endOf(Date.now(),s)+1,this.min=Math.min(n,o-1),this.max=Math.max(n+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],s=t[t.length-1]),{min:e,max:s}}buildTicks(){const t=this.options,e=t.time,s=t.ticks,n=s.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const o=this.min,r=this.max,a=$n(n,o,r);return this._unit=e.unit||(s.autoSkip?fs(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):Ra(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:La(this._unit),this.initOffsets(n),t.reverse&&a.reverse(),gs(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,s=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?s=o:s=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=K(e,0,r),s=K(s,0,r),this._offsets={start:e,end:s,factor:1/(e+1+s)}}_generate(){const t=this._adapter,e=this.min,s=this.max,n=this.options,o=n.time,r=o.unit||fs(o.minUnit,e,s,this._getLabelCapacity(e)),a=A(n.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=xe(l)||l===!0,h={};let d=e,f,u;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":r),t.diff(s,e,r)>1e5*a)throw new Error(e+" and "+s+" are too far apart with stepSize of "+a+" "+r);const m=n.ticks.source==="data"&&this.getDataTimestamps();for(f=d,u=0;f<s;f=+t.add(f,a,r),u++)us(h,f,m);return(f===s||n.bounds==="ticks"||u===1)&&us(h,f,m),Object.keys(h).sort(hs).map(g=>+g)}getLabelForValue(t){const e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,o=this._unit,r=e||n[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,s,n){const o=this.options,r=o.ticks.callback;if(r)return L(r,[t,e,s],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],d=c&&a[c],f=s[e],u=c&&d&&f&&f.major;return this._adapter.format(t,n||(u?d:h))}generateTickLabels(t){let e,s,n;for(e=0,s=t.length;e<s;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,s=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+s)*e.factor)}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+s*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,s=this.ctx.measureText(t).width,n=yt(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(n),r=Math.sin(n),a=this._resolveTickFontOptions(0).size;return{w:s*o+a*r,h:s*r+a*o}}_getLabelCapacity(t){const e=this.options.time,s=e.displayFormats,n=s[e.unit]||s.millisecond,o=this._tickFormatFunction(t,0,gs(this,[t],this._majorUnit),n),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,s;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,s=n.length;e<s;++e)t=t.concat(n[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,s;if(t.length)return t;const n=this.getLabels();for(e=0,s=n.length;e<s;++e)t.push(ds(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Un(t.sort(hs))}}function fe(i,t,e){let s=0,n=i.length-1,o,r,a,l;e?(t>=i[s].pos&&t<=i[n].pos&&({lo:s,hi:n}=Ne(i,"pos",t)),{pos:o,time:a}=i[s],{pos:r,time:l}=i[n]):(t>=i[s].time&&t<=i[n].time&&({lo:s,hi:n}=Ne(i,"time",t)),{time:o,pos:a}=i[s],{time:r,pos:l}=i[n]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class Qa extends ps{static id="timeseries";static defaults=ps.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=fe(e,this.min),this._tableRange=fe(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:s}=this,n=[],o=[];let r,a,l,c,h;for(r=0,a=t.length;r<a;++r)c=t[r],c>=e&&c<=s&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(r=0,a=n.length;r<a;++r)h=n[r+1],l=n[r-1],c=n[r],Math.round((h+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_generate(){const t=this.min,e=this.max;let s=super.getDataTimestamps();return(!s.includes(t)||!s.length)&&s.splice(0,0,t),(!s.includes(e)||s.length===1)&&s.push(e),s.sort((n,o)=>n-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),s=this.getLabelTimestamps();return e.length&&s.length?t=this.normalize(e.concat(s)):t=e.length?e:s,t=this._cache.all=t,t}getDecimalForValue(t){return(fe(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return fe(this._table,s*this._tableRange+this._minPos,!0)}}const Js={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},Ia={ariaLabel:{type:String},ariaDescribedby:{type:String}},Fa={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...Js,...Ia},za=sn[0]==="2"?(i,t)=>Object.assign(i,{attrs:t}):(i,t)=>Object.assign(i,t);function At(i){return _s(i)?We(i):i}function Ba(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:i;return _s(t)?new Proxy(i,{}):i}function Ha(i,t){const e=i.options;e&&t&&Object.assign(e,t)}function tn(i,t){i.labels=t}function en(i,t,e){const s=[];i.datasets=t.map(n=>{const o=i.datasets.find(r=>r[e]===n[e]);return!o||!n.data||s.includes(o)?{...n}:(s.push(o),Object.assign(o,n),o)})}function Wa(i,t){const e={labels:[],datasets:[]};return tn(e,i.labels),en(e,i.datasets,t),e}const ja=ms({props:Fa,setup(i,t){let{expose:e,slots:s}=t;const n=nn(null),o=bs(null);e({chart:o});const r=()=>{if(!n.value)return;const{type:c,data:h,options:d,plugins:f,datasetIdKey:u}=i,m=Wa(h,u),g=Ba(m,h);o.value=new ci(n.value,{type:c,data:g,options:{...d},plugins:f})},a=()=>{const c=We(o.value);c&&(i.destroyDelay>0?setTimeout(()=>{c.destroy(),o.value=null},i.destroyDelay):(c.destroy(),o.value=null))},l=c=>{c.update(i.updateMode)};return on(r),rn(a),an([()=>i.options,()=>i.data],(c,h)=>{let[d,f]=c,[u,m]=h;const g=We(o.value);if(!g)return;let p=!1;if(d){const b=At(d),_=At(u);b&&b!==_&&(Ha(g,b),p=!0)}if(f){const b=At(f.labels),_=At(m.labels),x=At(f.datasets),y=At(m.datasets);b!==_&&(tn(g.config.data,b),p=!0),x&&x!==y&&(en(g.config.data,x,i.datasetIdKey),p=!0)}p&&ln(()=>{l(g)})},{deep:!0}),()=>He("canvas",{role:"img",ariaLabel:i.ariaLabel,ariaDescribedby:i.ariaDescribedby,ref:n},[He("p",{},[s.default?s.default():""])])}});function Na(i,t){return ci.register(t),ms({props:Js,setup(e,s){let{expose:n}=s;const o=bs(null),r=a=>{o.value=a?.chart};return n({chart:o}),()=>He(ja,za({ref:r},{type:i,...e}))}})}const Ja=Na("doughnut",qo);export{$a as A,Ua as B,ci as C,Ja as D,Xa as P,Q as a,O as b,L as c,F as d,P as e,Ga as f,Ka as g,Za as h,N as i,Ut as m,qa as p,ne as r,$ as t,A as v};
18
+ `):i}function ka(i,t){const{element:e,datasetIndex:s,index:n}=t,o=i.getDatasetMeta(s).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:i,label:r,parsed:o.getParsed(n),raw:i.data.datasets[s].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function ss(i,t){const e=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:r,boxHeight:a}=t,l=$(t.bodyFont),c=$(t.titleFont),h=$(t.footerFont),d=o.length,f=n.length,u=s.length,m=Q(t.padding);let g=m.height,p=0,b=s.reduce((y,v)=>y+v.before.length+v.lines.length+v.after.length,0);if(b+=i.beforeBody.length+i.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const y=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;g+=u*y+(b-u)*l.lineHeight+(b-1)*t.bodySpacing}f&&(g+=t.footerMarginTop+f*h.lineHeight+(f-1)*t.footerSpacing);let _=0;const x=function(y){p=Math.max(p,e.measureText(y).width+_)};return e.save(),e.font=c.string,P(i.title,x),e.font=l.string,P(i.beforeBody.concat(i.afterBody),x),_=t.displayColors?r+2+t.boxPadding:0,P(s,y=>{P(y.before,x),P(y.lines,x),P(y.after,x)}),_=0,e.font=h.string,P(i.footer,x),e.restore(),p+=m.width,{width:p,height:g}}function Sa(i,t){const{y:e,height:s}=t;return e<s/2?"top":e>i.height-s/2?"bottom":"center"}function Ma(i,t,e,s){const{x:n,width:o}=s,r=e.caretSize+e.caretPadding;if(i==="left"&&n+o+r>t.width||i==="right"&&n-o-r<0)return!0}function Oa(i,t,e,s){const{x:n,width:o}=e,{width:r,chartArea:{left:a,right:l}}=i;let c="center";return s==="center"?c=n<=(a+l)/2?"left":"right":n<=o/2?c="left":n>=r-o/2&&(c="right"),Ma(c,i,t,e)&&(c="center"),c}function ns(i,t,e){const s=e.yAlign||t.yAlign||Sa(i,e);return{xAlign:e.xAlign||t.xAlign||Oa(i,t,e,s),yAlign:s}}function Ca(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function Aa(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function os(i,t,e,s){const{caretSize:n,caretPadding:o,cornerRadius:r}=i,{xAlign:a,yAlign:l}=e,c=n+o,{topLeft:h,topRight:d,bottomLeft:f,bottomRight:u}=Dt(r);let m=Ca(t,a);const g=Aa(t,l,c);return l==="center"?a==="left"?m+=c:a==="right"&&(m-=c):a==="left"?m-=Math.max(h,f)+n:a==="right"&&(m+=Math.max(d,u)+n),{x:K(m,0,s.width-t.width),y:K(g,0,s.height-t.height)}}function de(i,t,e){const s=Q(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function rs(i){return et([],ot(i))}function Da(i,t,e){return Rt(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function as(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const Qs={beforeTitle:st,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex<s)return e[t.dataIndex]}return""},afterTitle:st,beforeBody:st,beforeLabel:st,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let t=i.dataset.label||"";t&&(t+=": ");const e=i.formattedValue;return N(e)||(t+=e),t},labelColor(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:st,afterBody:st,beforeFooter:st,footer:st,afterFooter:st};function X(i,t,e,s){const n=i[t].call(e,s);return typeof n>"u"?Qs[t].call(e,s):n}class ls extends ft{static positioners=Nt;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(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,s=this.options.setContext(this.getContext()),n=s.enabled&&e.options.animation&&s.animations,o=new zs(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Da(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e,n=X(s,"beforeTitle",this,t),o=X(s,"title",this,t),r=X(s,"afterTitle",this,t);let a=[];return a=et(a,ot(n)),a=et(a,ot(o)),a=et(a,ot(r)),a}getBeforeBody(t,e){return rs(X(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:s}=e,n=[];return P(t,o=>{const r={before:[],lines:[],after:[]},a=as(s,o);et(r.before,ot(X(a,"beforeLabel",this,o))),et(r.lines,X(a,"label",this,o)),et(r.after,ot(X(a,"afterLabel",this,o))),n.push(r)}),n}getAfterBody(t,e){return rs(X(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:s}=e,n=X(s,"beforeFooter",this,t),o=X(s,"footer",this,t),r=X(s,"afterFooter",this,t);let a=[];return a=et(a,ot(n)),a=et(a,ot(o)),a=et(a,ot(r)),a}_createItems(t){const e=this._active,s=this.chart.data,n=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(ka(this.chart,e[l]));return t.filter&&(a=a.filter((h,d,f)=>t.filter(h,d,f,s))),t.itemSort&&(a=a.sort((h,d)=>t.itemSort(h,d,s))),P(a,h=>{const d=as(t.callbacks,h);n.push(X(d,"labelColor",this,h)),o.push(X(d,"labelPointStyle",this,h)),r.push(X(d,"labelTextColor",this,h))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const s=this.options.setContext(this.getContext()),n=this._active;let o,r=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const a=Nt[s.position].call(this,n,this._eventPosition);r=this._createItems(s),this.title=this.getTitle(r,s),this.beforeBody=this.getBeforeBody(r,s),this.body=this.getBody(r,s),this.afterBody=this.getAfterBody(r,s),this.footer=this.getFooter(r,s);const l=this._size=ss(this,s),c=Object.assign({},a,l),h=ns(this.chart,s,c),d=os(s,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,n){const o=this.getCaretPosition(t,s,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,s){const{xAlign:n,yAlign:o}=this,{caretSize:r,cornerRadius:a}=s,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=Dt(a),{x:f,y:u}=t,{width:m,height:g}=e;let p,b,_,x,y,v;return o==="center"?(y=u+g/2,n==="left"?(p=f,b=p-r,x=y+r,v=y-r):(p=f+m,b=p+r,x=y-r,v=y+r),_=p):(n==="left"?b=f+Math.max(l,h)+r:n==="right"?b=f+m-Math.max(c,d)-r:b=this.caretX,o==="top"?(x=u,y=x-r,p=b-r,_=b+r):(x=u+g,y=x+r,p=b+r,_=b-r),v=x),{x1:p,x2:b,x3:_,y1:x,y2:y,y3:v}}drawTitle(t,e,s){const n=this.title,o=n.length;let r,a,l;if(o){const c=Pt(s.rtl,this.x,this.width);for(t.x=de(this,s.titleAlign,s),e.textAlign=c.textAlign(s.titleAlign),e.textBaseline="middle",r=$(s.titleFont),a=s.titleSpacing,e.fillStyle=s.titleColor,e.font=r.string,l=0;l<o;++l)e.fillText(n[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=s.titleMarginBottom-a)}}_drawColorBox(t,e,s,n,o){const r=this.labelColors[s],a=this.labelPointStyles[s],{boxHeight:l,boxWidth:c}=o,h=$(o.bodyFont),d=de(this,"left",o),f=n.x(d),u=l<h.lineHeight?(h.lineHeight-l)/2:0,m=e.y+u;if(o.usePointStyle){const g={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},p=n.leftForLtr(f,c)+c/2,b=m+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Ye(t,g,p,b),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Ye(t,g,p,b)}else{t.lineWidth=O(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const g=n.leftForLtr(f,c),p=n.leftForLtr(n.xPlus(f,1),c-2),b=Dt(r.borderRadius);Object.values(b).some(_=>_!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ve(t,{x:g,y:m,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),ve(t,{x:p,y:m+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(g,m,c,l),t.strokeRect(g,m,c,l),t.fillStyle=r.backgroundColor,t.fillRect(p,m+1,c-2,l-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:n}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=s,d=$(s.bodyFont);let f=d.lineHeight,u=0;const m=Pt(s.rtl,this.x,this.width),g=function(k){e.fillText(k,m.x(t.x+u),t.y+f/2),t.y+=f+o},p=m.textAlign(r);let b,_,x,y,v,w,S;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=de(this,p,s),e.fillStyle=s.bodyColor,P(this.beforeBody,g),u=a&&p!=="right"?r==="center"?c/2+h:c+2+h:0,y=0,w=n.length;y<w;++y){for(b=n[y],_=this.labelTextColors[y],e.fillStyle=_,P(b.before,g),x=b.lines,a&&x.length&&(this._drawColorBox(e,t,y,m,s),f=Math.max(d.lineHeight,l)),v=0,S=x.length;v<S;++v)g(x[v]),f=d.lineHeight;P(b.after,g)}u=0,f=d.lineHeight,P(this.afterBody,g),t.y-=o}drawFooter(t,e,s){const n=this.footer,o=n.length;let r,a;if(o){const l=Pt(s.rtl,this.x,this.width);for(t.x=de(this,s.footerAlign,s),t.y+=s.footerMarginTop,e.textAlign=l.textAlign(s.footerAlign),e.textBaseline="middle",r=$(s.footerFont),e.fillStyle=s.footerColor,e.font=r.string,a=0;a<o;++a)e.fillText(n[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+s.footerSpacing}}drawBackground(t,e,s,n){const{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:h}=s,{topLeft:d,topRight:f,bottomLeft:u,bottomRight:m}=Dt(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(a+d,l),r==="top"&&this.drawCaret(t,e,s,n),e.lineTo(a+c-f,l),e.quadraticCurveTo(a+c,l,a+c,l+f),r==="center"&&o==="right"&&this.drawCaret(t,e,s,n),e.lineTo(a+c,l+h-m),e.quadraticCurveTo(a+c,l+h,a+c-m,l+h),r==="bottom"&&this.drawCaret(t,e,s,n),e.lineTo(a+u,l+h),e.quadraticCurveTo(a,l+h,a,l+h-u),r==="center"&&o==="left"&&this.drawCaret(t,e,s,n),e.lineTo(a,l+d),e.quadraticCurveTo(a,l,a+d,l),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,s=this.$animations,n=s&&s.x,o=s&&s.y;if(n||o){const r=Nt[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=ss(this,t),l=Object.assign({},r,this._size),c=ns(e,t,l),h=os(t,l,c,e);(n._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const r=Q(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=s,this.drawBackground(o,t,n,e),Is(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Fs(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const s=this._active,n=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!pe(s,n),r=this._positionChanged(n,e);(o||r)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,s),a=this._positionChanged(r,t),l=e||!pe(r,o)||a;return l&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,s,n){const o=this.options;if(t.type==="mouseout")return[];if(!n)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:s,caretY:n,options:o}=this,r=Nt[o.position].call(this,t,e);return r!==!1&&(s!==r.x||n!==r.y)}}var Za={id:"tooltip",_element:ls,positioners:Nt,afterInit(i,t,e){e&&(i.tooltip=new ls({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Qs},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const Pa=(i,t,e,s)=>(typeof t=="string"?(e=i.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Ta(i,t,e,s){const n=i.indexOf(t);if(n===-1)return Pa(i,t,e,s);const o=i.lastIndexOf(t);return n!==o?e:n}const Ra=(i,t)=>i===null?null:K(Math.round(i),0,t);function cs(i){const t=this.getLabels();return i>=0&&i<t.length?t[i]:i}class Qa extends Qt{static id="category";static defaults={ticks:{callback:cs}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const s=this.getLabels();for(const{index:n,label:o}of e)s[n]===o&&s.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(N(t))return null;const s=this.getLabels();return e=isFinite(e)&&s[e]===t?e:Ta(s,t,A(e,t),this._addedLabels),Ra(e,s.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:s,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(s=0),e||(n=this.getLabels().length-1)),this.min=s,this.max=n}buildTicks(){const t=this.min,e=this.max,s=this.options.offset,n=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let r=t;r<=e;r++)n.push({value:r});return n}getLabelForValue(t){return cs.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const 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}}const Ce={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}},U=Object.keys(Ce);function hs(i,t){return i-t}function ds(i,t){if(N(t))return null;const e=i._adapter,{parser:s,round:n,isoWeekday:o}=i._parseOpts;let r=t;return typeof s=="function"&&(r=s(r)),at(r)||(r=typeof s=="string"?e.parse(r,s):e.parse(r)),r===null?null:(n&&(r=n==="week"&&(xe(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,n)),+r)}function fs(i,t,e,s){const n=U.length;for(let o=U.indexOf(i);o<n-1;++o){const r=Ce[U[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((e-t)/(a*r.size))<=s)return U[o]}return U[n-1]}function La(i,t,e,s,n){for(let o=U.length-1;o>=U.indexOf(e);o--){const r=U[o];if(Ce[r].common&&i._adapter.diff(n,s,r)>=t-1)return r}return U[e?U.indexOf(e):0]}function Ea(i){for(let t=U.indexOf(i)+1,e=U.length;t<e;++t)if(Ce[U[t]].common)return U[t]}function us(i,t,e){if(!e)i[t]=!0;else if(e.length){const{lo:s,hi:n}=Ze(e,t),o=e[s]>=t?e[s]:e[n];i[o]=!0}}function Ia(i,t,e,s){const n=i._adapter,o=+n.startOf(t[0].value,s),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+n.add(a,1,s))l=e[a],l>=0&&(t[l].major=!0);return t}function gs(i,t,e){const s=[],n={},o=t.length;let r,a;for(r=0;r<o;++r)a=t[r],n[a]=r,s.push({value:a,major:!1});return o===0||!e?s:Ia(i,s,n,e)}class ps extends Qt{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={}){const s=t.time||(t.time={}),n=this._adapter=new Qo._date(t.adapters.date);n.init(e),Vt(s.displayFormats,n.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:ds(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,s=t.time.unit||"day";let{min:n,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(n=Math.min(n,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!r||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),n=at(n)&&!isNaN(n)?n:+e.startOf(Date.now(),s),o=at(o)&&!isNaN(o)?o:+e.endOf(Date.now(),s)+1,this.min=Math.min(n,o-1),this.max=Math.max(n+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],s=t[t.length-1]),{min:e,max:s}}buildTicks(){const t=this.options,e=t.time,s=t.ticks,n=s.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const o=this.min,r=this.max,a=$n(n,o,r);return this._unit=e.unit||(s.autoSkip?fs(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):La(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:Ea(this._unit),this.initOffsets(n),t.reverse&&a.reverse(),gs(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,s=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?s=o:s=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=K(e,0,r),s=K(s,0,r),this._offsets={start:e,end:s,factor:1/(e+1+s)}}_generate(){const t=this._adapter,e=this.min,s=this.max,n=this.options,o=n.time,r=o.unit||fs(o.minUnit,e,s,this._getLabelCapacity(e)),a=A(n.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=xe(l)||l===!0,h={};let d=e,f,u;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":r),t.diff(s,e,r)>1e5*a)throw new Error(e+" and "+s+" are too far apart with stepSize of "+a+" "+r);const m=n.ticks.source==="data"&&this.getDataTimestamps();for(f=d,u=0;f<s;f=+t.add(f,a,r),u++)us(h,f,m);return(f===s||n.bounds==="ticks"||u===1)&&us(h,f,m),Object.keys(h).sort(hs).map(g=>+g)}getLabelForValue(t){const e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,o=this._unit,r=e||n[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,s,n){const o=this.options,r=o.ticks.callback;if(r)return L(r,[t,e,s],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],d=c&&a[c],f=s[e],u=c&&d&&f&&f.major;return this._adapter.format(t,n||(u?d:h))}generateTickLabels(t){let e,s,n;for(e=0,s=t.length;e<s;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,s=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+s)*e.factor)}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+s*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,s=this.ctx.measureText(t).width,n=yt(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(n),r=Math.sin(n),a=this._resolveTickFontOptions(0).size;return{w:s*o+a*r,h:s*r+a*o}}_getLabelCapacity(t){const e=this.options.time,s=e.displayFormats,n=s[e.unit]||s.millisecond,o=this._tickFormatFunction(t,0,gs(this,[t],this._majorUnit),n),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,s;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,s=n.length;e<s;++e)t=t.concat(n[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,s;if(t.length)return t;const n=this.getLabels();for(e=0,s=n.length;e<s;++e)t.push(ds(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Un(t.sort(hs))}}function fe(i,t,e){let s=0,n=i.length-1,o,r,a,l;e?(t>=i[s].pos&&t<=i[n].pos&&({lo:s,hi:n}=Ne(i,"pos",t)),{pos:o,time:a}=i[s],{pos:r,time:l}=i[n]):(t>=i[s].time&&t<=i[n].time&&({lo:s,hi:n}=Ne(i,"time",t)),{time:o,pos:a}=i[s],{time:r,pos:l}=i[n]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class Ja extends ps{static id="timeseries";static defaults=ps.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=fe(e,this.min),this._tableRange=fe(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:s}=this,n=[],o=[];let r,a,l,c,h;for(r=0,a=t.length;r<a;++r)c=t[r],c>=e&&c<=s&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(r=0,a=n.length;r<a;++r)h=n[r+1],l=n[r-1],c=n[r],Math.round((h+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_generate(){const t=this.min,e=this.max;let s=super.getDataTimestamps();return(!s.includes(t)||!s.length)&&s.splice(0,0,t),(!s.includes(e)||s.length===1)&&s.push(e),s.sort((n,o)=>n-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),s=this.getLabelTimestamps();return e.length&&s.length?t=this.normalize(e.concat(s)):t=e.length?e:s,t=this._cache.all=t,t}getDecimalForValue(t){return(fe(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return fe(this._table,s*this._tableRange+this._minPos,!0)}}const Js={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},Fa={ariaLabel:{type:String},ariaDescribedby:{type:String}},za={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...Js,...Fa},Ba=sn[0]==="2"?(i,t)=>Object.assign(i,{attrs:t}):(i,t)=>Object.assign(i,t);function At(i){return _s(i)?We(i):i}function Ha(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:i;return _s(t)?new Proxy(i,{}):i}function Wa(i,t){const e=i.options;e&&t&&Object.assign(e,t)}function tn(i,t){i.labels=t}function en(i,t,e){const s=[];i.datasets=t.map(n=>{const o=i.datasets.find(r=>r[e]===n[e]);return!o||!n.data||s.includes(o)?{...n}:(s.push(o),Object.assign(o,n),o)})}function ja(i,t){const e={labels:[],datasets:[]};return tn(e,i.labels),en(e,i.datasets,t),e}const Na=ms({props:za,setup(i,t){let{expose:e,slots:s}=t;const n=nn(null),o=bs(null);e({chart:o});const r=()=>{if(!n.value)return;const{type:c,data:h,options:d,plugins:f,datasetIdKey:u}=i,m=ja(h,u),g=Ha(m,h);o.value=new ci(n.value,{type:c,data:g,options:{...d},plugins:f})},a=()=>{const c=We(o.value);c&&(i.destroyDelay>0?setTimeout(()=>{c.destroy(),o.value=null},i.destroyDelay):(c.destroy(),o.value=null))},l=c=>{c.update(i.updateMode)};return on(r),rn(a),an([()=>i.options,()=>i.data],(c,h)=>{let[d,f]=c,[u,m]=h;const g=We(o.value);if(!g)return;let p=!1;if(d){const b=At(d),_=At(u);b&&b!==_&&(Wa(g,b),p=!0)}if(f){const b=At(f.labels),_=At(m.labels),x=At(f.datasets),y=At(m.datasets);b!==_&&(tn(g.config.data,b),p=!0),x&&x!==y&&(en(g.config.data,x,i.datasetIdKey),p=!0)}p&&ln(()=>{l(g)})},{deep:!0}),()=>He("canvas",{role:"img",ariaLabel:i.ariaLabel,ariaDescribedby:i.ariaDescribedby,ref:n},[He("p",{},[s.default?s.default():""])])}});function Va(i,t){return ci.register(t),ms({props:Js,setup(e,s){let{expose:n}=s;const o=bs(null),r=a=>{o.value=a?.chart};return n({chart:o}),()=>He(Na,Ba({ref:r},{type:i,...e}))}})}const tl=Va("doughnut",Zo);export{Xa as A,Ka as B,ci as C,tl as D,Ua as P,Q as a,O as b,L as c,F as d,P as e,Za as f,qa as g,Qa as h,N as i,Ut as m,Ga as p,ne as r,$ as t,A as v};